Skip to content

Commit d6affdc

Browse files
Remove auth container after it exits
1 parent f942fc4 commit d6affdc

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed

dev/catalog.clj

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
(ns catalog
22
(:require
33
[babashka.fs :as fs]
4+
[cheshire.core :as json]
45
[clj-yaml.core :as yaml]
56
[clojure.edn :as edn]
7+
[clojure.pprint :refer [pprint]]
8+
[clojure.string :as string]
69
[flatland.ordered.map :refer [ordered-map]]
710
git
811
[markdown :as markdown-parser]
@@ -60,6 +63,18 @@
6063
(generate-updated-catalog)
6164
;; parse catalog
6265
(def catalog (yaml/parse-string (slurp "prompts/catalog.yaml")))
66+
(string/join "," (->> (:registry catalog) keys (map name)))
67+
68+
;; raw github urls to
69+
(def prompt-refs
70+
(->> catalog
71+
:registry
72+
vals
73+
(map :ref)
74+
(map #(git/parse-github-ref %))
75+
(map #(format "https://raw.githubusercontent.com/%s/%s/refs/heads/%s/%s" (:owner %) (:repo %) (or (:ref %) "main") (:path %)))))
76+
77+
(->> prompt-refs (interpose "\n") (apply str) (println))
6378

6479
;; current git ref files
6580
(def local-prompt-files
@@ -70,25 +85,34 @@
7085
(map #(conj [%] (git/prompt-file %)))
7186
(into {})))
7287

73-
;; parse all of the current git prompts
74-
(with-redefs [#'client/get-mcp-tools-from-prompt (constantly [])]
88+
;; parse all of the current git prompts
89+
(with-redefs [client/get-mcp-tools-from-prompt (constantly [])]
7590
(def all-prompt-files (map (fn [[k v]] [k (f->prompt v)]) local-prompt-files)))
7691

92+
(pprint (->> all-prompt-files
93+
(map (fn [[k v]] [k (dissoc v :mcp/resources)]))
94+
(into {})))
95+
(spit "crap.json" (json/generate-string
96+
(->> all-prompt-files
97+
(map (fn [[k v]] [k (dissoc v :mcp/resources :mcp/prompt-registry)]))
98+
(into {}))
99+
{:pretty true}))
100+
77101
(def all-images
78102
(->>
79-
(concat
80-
(->> (into {} all-prompt-files)
81-
(vals)
82-
(mapcat (comp :mcp :metadata))
83-
(map (comp :image :container))
84-
(into #{}))
85-
(->> (into {} all-prompt-files)
86-
(vals)
87-
(mapcat :functions)
88-
(map (comp :image :container :function))
89-
(into #{})))
90-
(into #{})
91-
(sort)))
103+
(concat
104+
(->> (into {} all-prompt-files)
105+
(vals)
106+
(mapcat (comp :mcp :metadata))
107+
(map (comp :image :container))
108+
(into #{}))
109+
(->> (into {} all-prompt-files)
110+
(vals)
111+
(mapcat :functions)
112+
(map (comp :image :container :function))
113+
(into #{})))
114+
(into #{})
115+
(sort)))
92116

93117
;;
94118
(markdown-parser/parse-markdown (slurp "prompts/examples/sequentialthinking.md")))

src/docker.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@
624624
(async/go
625625
(docker/wait x)
626626
(async/>! c :stopped)
627-
#_(delete x))
627+
(delete x))
628628
(async/go-loop
629629
[block (async/<! c)]
630630
(logger/info "background socket read loop " block)

0 commit comments

Comments
 (0)