Skip to content

Commit e257aa1

Browse files
Add sequentialthinking
1 parent 874b6d4 commit e257aa1

File tree

10 files changed

+192
-12
lines changed

10 files changed

+192
-12
lines changed

docs/content/tools/docs/running_containers.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ title: defining container tools
1414

1515
# parameters
1616

17-
* volumes (list of strings) supports interpolation optional
18-
* command (list of strings) supports interpolation optional
19-
* workdir (string) supports interpolation optional
20-
* stdin (keys content, file) supports interpolation optional
21-
* entrypoint (string) does NOT suport interpolation optional
22-
* image (string) does not support interpolation mandatory
17+
* volumes (list of strings) supports interpolation optional
18+
* entrypoint (list of strings) supports interpolation optional
19+
* command (list of strings) supports interpolation optional
20+
* workdir (string) supports interpolation optional
21+
* stdin (keys content, file) supports interpolation optional
22+
23+
* environment (map) does NOT support interpolation optional
24+
* image (string) does not support interpolation mandatory
2325

2426
# interpolation
2527

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(ns init
2+
(:require
3+
[clojure.spec.alpha :as s]))
4+
5+
;; validate initial thought
6+
;; read in previous thought history
7+
;; read in branches which are maps of named thought collections
8+
;;
9+
;; return text message with current thought
10+
;;
11+
(s/def ::thought string?)
12+
(s/def ::thoughtNumber number?)
13+
(s/def ::totalThoughts number?)
14+
(s/def ::nextThoughtNeeded boolean?)
15+
(s/def ::thought-data (s/keys :req-un [::thought ::thoughtNumber ::totalThoughts ::nextThoughtNeeded]))

prompts/catalog.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,14 @@ registry:
556556
name: curl
557557
prompts: 2
558558
resources: {}
559+
sequentialthinking:
560+
description: provides a tool for dynamic and reflective problem-solving through a structured thinking process
561+
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/sequentialthinking.md
562+
icon: https://2.gravatar.com/userimage/39790510/4918b92358fde20da56c0ec8e5ac7a23?size=256
563+
tools:
564+
- type: function
565+
function:
566+
name: sequentialthinking
559567
stripe:
560568
description: Provides a tool to interact with Stripe services over the Stripe API.
561569
ref: github:docker/labs-ai-tools-for-devs?path=prompts/mcp/stripe.md
@@ -574,3 +582,10 @@ registry:
574582
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/slack.svg
575583
secrets:
576584
- name: slack.team_id
585+
redis:
586+
description: interact with Slack Workspaces
587+
ref: github:docker/labs-ai-tools-for-devs?path=prompts/mcp/slack.md
588+
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/redis.svg
589+
secrets:
590+
- name: redis.url
591+
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
tools:
3+
- name: sequentialthinking
4+
description: |
5+
A detailed tool for dynamic and reflective problem-solving through thoughts.
6+
This tool helps analyze problems through a flexible thinking process that can adapt and evolve.
7+
Each thought can build on, question, or revise previous insights as understanding deepens.
8+
9+
When to use this tool:
10+
- Breaking down complex problems into steps
11+
- Planning and design with room for revision
12+
- Analysis that might need course correction
13+
- Problems where the full scope might not be clear initially
14+
- Problems that require a multi-step solution
15+
- Tasks that need to maintain context over multiple steps
16+
- Situations where irrelevant information needs to be filtered out
17+
18+
Key features:
19+
- You can adjust total_thoughts up or down as you progress
20+
- You can question or revise previous thoughts
21+
- You can add more thoughts even after reaching what seemed like the end
22+
- You can express uncertainty and explore alternative approaches
23+
- Not every thought needs to build linearly - you can branch or backtrack
24+
- Generates a solution hypothesis
25+
- Verifies the hypothesis based on the Chain of Thought steps
26+
- Repeats the process until satisfied
27+
- Provides a correct answer
28+
29+
Parameters explained:
30+
- thought: Your current thinking step, which can include:
31+
* Regular analytical steps
32+
* Revisions of previous thoughts
33+
* Questions about previous decisions
34+
* Realizations about needing more analysis
35+
* Changes in approach
36+
* Hypothesis generation
37+
* Hypothesis verification
38+
- next_thought_needed: True if you need more thinking, even if at what seemed like the end
39+
- thought_number: Current number in sequence (can go beyond initial total if needed)
40+
- total_thoughts: Current estimate of thoughts needed (can be adjusted up/down)
41+
- is_revision: A boolean indicating if this thought revises previous thinking
42+
- revises_thought: If is_revision is true, which thought number is being reconsidered
43+
- branch_from_thought: If branching, which thought number is the branching point
44+
- branch_id: Identifier for the current branch (if any)
45+
- needs_more_thoughts: If reaching end but realizing more thoughts needed
46+
47+
You should:
48+
1. Start with an initial estimate of needed thoughts, but be ready to adjust
49+
2. Feel free to question or revise previous thoughts
50+
3. Don't hesitate to add more thoughts if needed, even at the "end"
51+
4. Express uncertainty when present
52+
5. Mark thoughts that revise previous thinking or branch into new paths
53+
6. Ignore information that is irrelevant to the current step
54+
7. Generate a solution hypothesis when appropriate
55+
8. Verify the hypothesis based on the Chain of Thought steps
56+
9. Repeat the process until satisfied with the solution
57+
10. Provide a single, ideally correct answer as the final output
58+
11. Only set next_thought_needed to false when truly done and a satisfactory answer is reached`
59+
parameters:
60+
type: object
61+
properties:
62+
thought:
63+
type: "string",
64+
description: "Your current thinking step"
65+
nextThoughtNeeded:
66+
type: "boolean",
67+
description: "Whether another thought step is needed"
68+
thoughtNumber:
69+
type: "integer"
70+
description: "Current thought number",
71+
minimum: 1
72+
totalThoughts:
73+
type: "integer",
74+
description: "Estimated total thoughts needed",
75+
minimum: 1
76+
isRevision:
77+
type: "boolean",
78+
description: "Whether this revises previous thinking"
79+
revisesThought: {
80+
type: "integer",
81+
description: "Which thought is being reconsidered",
82+
minimum: 1
83+
branchFromThought:
84+
type: "integer",
85+
description: "Branching point thought number",
86+
minimum: 1
87+
branchId:
88+
type: "string",
89+
description: "Branch identifier"
90+
needsMoreThoughts:
91+
type: "boolean",
92+
description: "If more thoughts are needed"
93+
required:
94+
- thought
95+
- nextThoughtNeeded
96+
- thoughtNumber
97+
- totalThoughts
98+
container:
99+
image: vonwig/sequential-thinking:latest
100+
volumes:
101+
- "mcp-sequentialthinking:/sequentialthinking"
102+
---

prompts/mcp/brave.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
mcp:
3-
- name: brave
4-
container:
3+
- container:
54
image: mcp/brave-search:latest
65
environment:
76
BRAVE_API_KEY: "{{ brave.api_key }}"

prompts/mcp/redis.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
mcp:
3+
- container:
4+
image: mcp/redis:latest
5+
---
6+

prompts/mcp/slack.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
mcp:
3-
- name: slack
4-
container:
3+
- container:
54
image: mcp/slack:latest
65
environment:
76
SLACK_BOT_TOKEN: "{{ slack.bot_token }}"

prompts/mcp/stripe.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
mcp:
3-
- name: stripe
4-
container:
3+
- container:
54
image: mcp/stripe:latest
65
command:
76
- "--tools=all"

test/jsonrpc/db_t.clj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[clojure.pprint :refer [pprint]]
55
[clojure.test :as t]
66
[jsonrpc.db :as db]
7+
[jsonrpc.producer :as producer]
8+
jsonrpc.server
79
[lsp4clj.server :as server]))
810

911
(def correct-refs
@@ -61,3 +63,21 @@
6163

6264
(comment
6365
(pprint @db/db*))
66+
67+
(comment
68+
(def hey
69+
(atom
70+
{:mcp.prompts/resources
71+
{"memo://insights"
72+
{:uri "memo://insights"
73+
:text "No Business Insights"
74+
:matches "resource:///thread/insights.txt"}}}))
75+
(jsonrpc.server/update-resources
76+
{:db* hey
77+
:producer (reify producer/IProducer (publish-resource-list-changed [_ _] (println "called")))}
78+
[{:resource {:uri "resource:///thread/insights.txt" :text "updated"}}]))
79+
80+
(comment
81+
(jsonrpc.server/update-matched-resources
82+
{"memo://insights" {:uri "memo://insights" :text "No Business Insights" :matches "resource:///thread/insights.txt"}}
83+
[{:resource {:uri "resource:///thread/insights.txt" :text "updated"}}]))

test/secrets_t.clj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(ns secrets-t
2+
(:require [docker]))
3+
4+
(def c
5+
(docker/create {:image "alpine"
6+
:secrets ["brave.api_key"]
7+
:entrypoint ["/bin/sh" "-c" "cat /secret/brave.api_key"]}))
8+
9+
(def c
10+
(docker/create {:image "alpine"
11+
:secrets ["brave.api_key"]
12+
:entrypoint ["/bin/sh" "-c" "ls -l /secret"]}))
13+
14+
(def c
15+
(docker/create {:image "alpine"
16+
:secrets ["brave.api_key"]
17+
:entrypoint ["/bin/sh" "-c" "whoami"]}))
18+
19+
(docker/start c)
20+
(docker/attach c)
21+
22+
(docker/delete-container c)
23+

0 commit comments

Comments
 (0)