@asterxsk/kiln 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -155
- package/agent/AGENTS.md +67 -67
- package/agent/README.md +5 -5
- package/agent/extensions/ask-user/index.ts +418 -418
- package/agent/extensions/ask-user/install.ps1 +27 -27
- package/agent/extensions/ask-user/install.sh +24 -24
- package/agent/extensions/ask-user/package-lock.json +769 -769
- package/agent/extensions/ask-user/package.json +19 -19
- package/agent/extensions/ask-user/prompt.ts +45 -45
- package/agent/extensions/ask-user/tsconfig.json +7 -7
- package/agent/extensions/background-terminals/docs/implementation-guide.md +942 -942
- package/agent/extensions/background-terminals/index.ts +627 -627
- package/agent/extensions/background-terminals/install.ps1 +27 -27
- package/agent/extensions/background-terminals/install.sh +24 -24
- package/agent/extensions/background-terminals/manager.test.ts +735 -735
- package/agent/extensions/background-terminals/output.test.ts +109 -109
- package/agent/extensions/background-terminals/package-lock.json +769 -769
- package/agent/extensions/background-terminals/package.json +17 -17
- package/agent/extensions/background-terminals/prompt.test.ts +125 -125
- package/agent/extensions/background-terminals/ps.test.ts +82 -82
- package/agent/extensions/background-terminals/result-delivery.test.ts +44 -44
- package/agent/extensions/background-terminals/src/domain.ts +87 -87
- package/agent/extensions/background-terminals/src/manager.ts +907 -907
- package/agent/extensions/background-terminals/src/output.ts +84 -84
- package/agent/extensions/background-terminals/src/prompt.ts +142 -142
- package/agent/extensions/background-terminals/src/result-delivery.ts +27 -27
- package/agent/extensions/background-terminals/src/runtime.ts +36 -36
- package/agent/extensions/background-terminals/src/ui/output-view.ts +79 -79
- package/agent/extensions/background-terminals/src/ui/ps.ts +621 -621
- package/agent/extensions/background-terminals/tsconfig.json +7 -7
- package/agent/extensions/destructive/README.md +31 -31
- package/agent/extensions/destructive/index.ts +88 -88
- package/agent/extensions/destructive/install.ps1 +27 -27
- package/agent/extensions/destructive/install.sh +24 -24
- package/agent/extensions/file-search/index.spec.ts +443 -443
- package/agent/extensions/file-search/index.ts +459 -459
- package/agent/extensions/file-search/install.ps1 +27 -27
- package/agent/extensions/file-search/install.sh +24 -24
- package/agent/extensions/file-search/package-lock.json +2253 -2253
- package/agent/extensions/file-search/package.json +23 -23
- package/agent/extensions/file-search/src/args.ts +122 -122
- package/agent/extensions/file-search/src/binaries.ts +422 -422
- package/agent/extensions/file-search/src/output.ts +126 -126
- package/agent/extensions/file-search/src/process.ts +146 -146
- package/agent/extensions/file-search/src/prompt.ts +52 -52
- package/agent/extensions/file-search/tsconfig.json +7 -7
- package/agent/extensions/goal/README.md +50 -50
- package/agent/extensions/goal/index.ts +155 -155
- package/agent/extensions/goal/install.ps1 +27 -27
- package/agent/extensions/goal/install.sh +24 -24
- package/agent/extensions/kiln-update/README.md +38 -25
- package/agent/extensions/kiln-update/index.ts +177 -99
- package/agent/extensions/modelconf/PLAN.md +915 -915
- package/agent/extensions/modelconf/README.md +66 -66
- package/agent/extensions/modelconf/index.ts +296 -296
- package/agent/extensions/modelconf/install.ps1 +27 -27
- package/agent/extensions/modelconf/install.sh +24 -24
- package/agent/extensions/modelconf/package-lock.json +1809 -1809
- package/agent/extensions/modelconf/package.json +13 -13
- package/agent/extensions/modelconf/src/fuzzy.ts +26 -26
- package/agent/extensions/modelconf/src/glob.ts +13 -13
- package/agent/extensions/modelconf/src/persistence.test.ts +46 -46
- package/agent/extensions/modelconf/src/persistence.ts +164 -164
- package/agent/extensions/modelconf/src/ui/ModelConfView.test.ts +75 -75
- package/agent/extensions/modelconf/src/ui/ModelConfView.ts +1101 -1101
- package/agent/extensions/modelconf/tsconfig.json +15 -15
- package/agent/extensions/pi-web-access/CHANGELOG.md +690 -690
- package/agent/extensions/pi-web-access/LICENSE +21 -21
- package/agent/extensions/pi-web-access/README.md +470 -470
- package/agent/extensions/pi-web-access/SECURITY.md +5 -5
- package/agent/extensions/pi-web-access/activity.ts +101 -101
- package/agent/extensions/pi-web-access/auth-fetch.ts +148 -148
- package/agent/extensions/pi-web-access/brightdata-unlocker.ts +272 -272
- package/agent/extensions/pi-web-access/chrome-cookies.ts +669 -669
- package/agent/extensions/pi-web-access/content-find.ts +139 -139
- package/agent/extensions/pi-web-access/credential-source.ts +191 -191
- package/agent/extensions/pi-web-access/data-uri-sanitize.ts +406 -406
- package/agent/extensions/pi-web-access/datalab-pdf-extract.ts +568 -568
- package/agent/extensions/pi-web-access/declared-web-links.ts +173 -173
- package/agent/extensions/pi-web-access/evidence/CONTRACT-EVIDENCE.md +496 -496
- package/agent/extensions/pi-web-access/evidence/contract-probe.mjs +140 -140
- package/agent/extensions/pi-web-access/exa.ts +526 -526
- package/agent/extensions/pi-web-access/extract.ts +1196 -1196
- package/agent/extensions/pi-web-access/feature-config.ts +29 -29
- package/agent/extensions/pi-web-access/fetch-params.ts +111 -111
- package/agent/extensions/pi-web-access/gemini-adc.ts +298 -298
- package/agent/extensions/pi-web-access/gemini-api.ts +353 -353
- package/agent/extensions/pi-web-access/gemini-pdf-extract.ts +108 -108
- package/agent/extensions/pi-web-access/gemini-search.ts +21 -21
- package/agent/extensions/pi-web-access/gemini-url-context.ts +128 -128
- package/agent/extensions/pi-web-access/gemini-web-config.ts +101 -101
- package/agent/extensions/pi-web-access/gemini-web.ts +487 -487
- package/agent/extensions/pi-web-access/github-api.ts +197 -197
- package/agent/extensions/pi-web-access/github-extract.ts +746 -746
- package/agent/extensions/pi-web-access/github-issue-pr.ts +700 -700
- package/agent/extensions/pi-web-access/index.ts +1737 -1737
- package/agent/extensions/pi-web-access/package-lock.json +5808 -5808
- package/agent/extensions/pi-web-access/package.json +64 -64
- package/agent/extensions/pi-web-access/page-query.ts +96 -96
- package/agent/extensions/pi-web-access/pdf-extract.ts +409 -409
- package/agent/extensions/pi-web-access/promise-try.d.ts +7 -7
- package/agent/extensions/pi-web-access/query-rewrite.ts +51 -51
- package/agent/extensions/pi-web-access/render-search-error.ts +170 -170
- package/agent/extensions/pi-web-access/rsc-extract.ts +338 -338
- package/agent/extensions/pi-web-access/search-types.ts +20 -20
- package/agent/extensions/pi-web-access/source-check.ts +282 -282
- package/agent/extensions/pi-web-access/ssrf-protection.ts +526 -526
- package/agent/extensions/pi-web-access/storage.ts +521 -521
- package/agent/extensions/pi-web-access/summary-model-scope.ts +125 -125
- package/agent/extensions/pi-web-access/test/auth-fetch.test.mjs +208 -208
- package/agent/extensions/pi-web-access/test/brightdata-unlocker.test.mjs +840 -840
- package/agent/extensions/pi-web-access/test/chrome-cookie-extraction.test.mjs +441 -441
- package/agent/extensions/pi-web-access/test/config-path.test.mjs +283 -283
- package/agent/extensions/pi-web-access/test/content-find.test.mjs +25 -25
- package/agent/extensions/pi-web-access/test/credential-source.test.mjs +118 -118
- package/agent/extensions/pi-web-access/test/data-uri-sanitize.test.mjs +210 -210
- package/agent/extensions/pi-web-access/test/datalab-pdf-extract.test.mjs +552 -552
- package/agent/extensions/pi-web-access/test/declared-web-links.test.mjs +212 -212
- package/agent/extensions/pi-web-access/test/fetch-answer-storage.test.mjs +40 -40
- package/agent/extensions/pi-web-access/test/fetch-cache-storage.test.mjs +334 -334
- package/agent/extensions/pi-web-access/test/fetch-content-domain-policy.test.mjs +95 -95
- package/agent/extensions/pi-web-access/test/fetch-modes.test.mjs +53 -53
- package/agent/extensions/pi-web-access/test/fetch-not-found-guidance.test.mjs +92 -92
- package/agent/extensions/pi-web-access/test/fetch-params.test.mjs +86 -86
- package/agent/extensions/pi-web-access/test/fetch-render-call.test.mjs +34 -34
- package/agent/extensions/pi-web-access/test/fetch-routing.test.mjs +173 -173
- package/agent/extensions/pi-web-access/test/gemini-adc-auth.test.mjs +257 -257
- package/agent/extensions/pi-web-access/test/gemini-api-transport.test.mjs +170 -170
- package/agent/extensions/pi-web-access/test/gemini-pdf-extract.test.mjs +133 -133
- package/agent/extensions/pi-web-access/test/gemini-web-cookie-opt-in.test.mjs +178 -178
- package/agent/extensions/pi-web-access/test/gemini-web-header-overflow.test.mjs +148 -148
- package/agent/extensions/pi-web-access/test/get-search-content.test.mjs +223 -223
- package/agent/extensions/pi-web-access/test/github-extract.test.mjs +378 -378
- package/agent/extensions/pi-web-access/test/github-issue-pr.test.mjs +565 -565
- package/agent/extensions/pi-web-access/test/inline-content-config.test.mjs +99 -99
- package/agent/extensions/pi-web-access/test/lazy-extract-load.test.mjs +118 -118
- package/agent/extensions/pi-web-access/test/local-video-oversize.test.mjs +52 -52
- package/agent/extensions/pi-web-access/test/package-typebox-dependency.test.mjs +50 -50
- package/agent/extensions/pi-web-access/test/page-query.test.mjs +51 -51
- package/agent/extensions/pi-web-access/test/pdf-config.test.mjs +140 -140
- package/agent/extensions/pi-web-access/test/pdf-extract.test.mjs +500 -500
- package/agent/extensions/pi-web-access/test/proxy-transport.test.mjs +286 -286
- package/agent/extensions/pi-web-access/test/query-rewrite.test.mjs +52 -52
- package/agent/extensions/pi-web-access/test/rsc-fallback.test.mjs +102 -102
- package/agent/extensions/pi-web-access/test/search-error-render.test.mjs +152 -152
- package/agent/extensions/pi-web-access/test/search-providers.test.mjs +274 -274
- package/agent/extensions/pi-web-access/test/source-check.test.mjs +179 -179
- package/agent/extensions/pi-web-access/test/ssrf-allow-ranges-config.test.mjs +205 -205
- package/agent/extensions/pi-web-access/test/ssrf-protection.test.mjs +456 -456
- package/agent/extensions/pi-web-access/test/summary-model-scope.test.mjs +106 -106
- package/agent/extensions/pi-web-access/test/tool-registration-config.test.mjs +182 -182
- package/agent/extensions/pi-web-access/test/web-search-answer-render.test.mjs +66 -66
- package/agent/extensions/pi-web-access/test/youtube-extract-errors.test.mjs +64 -64
- package/agent/extensions/pi-web-access/tsconfig.json +11 -11
- package/agent/extensions/pi-web-access/utils.ts +451 -451
- package/agent/extensions/pi-web-access/video-extract.ts +392 -392
- package/agent/extensions/pi-web-access/youtube-extract.ts +328 -328
- package/agent/extensions/shared/activity-status.ts +31 -31
- package/agent/extensions/shared/child-session.test.ts +270 -270
- package/agent/extensions/shared/child-session.ts +148 -148
- package/agent/extensions/shared/context-utilization.test.ts +48 -48
- package/agent/extensions/shared/context-utilization.ts +47 -47
- package/agent/extensions/shared/dashboard-state.ts +99 -99
- package/agent/extensions/shared/install.ps1 +27 -27
- package/agent/extensions/shared/install.sh +24 -24
- package/agent/extensions/shared/tool-call-timeout.test.ts +117 -117
- package/agent/extensions/shared/tool-call-timeout.ts +104 -104
- package/agent/extensions/skillsconf/README.md +74 -74
- package/agent/extensions/skillsconf/index.ts +92 -92
- package/agent/extensions/skillsconf/install.ps1 +27 -27
- package/agent/extensions/skillsconf/install.sh +24 -24
- package/agent/extensions/skillsconf/package-lock.json +1809 -1809
- package/agent/extensions/skillsconf/package.json +18 -18
- package/agent/extensions/skillsconf/src/delete-skill.test.ts +64 -64
- package/agent/extensions/skillsconf/src/delete-skill.ts +45 -45
- package/agent/extensions/skillsconf/src/filter.test.ts +80 -80
- package/agent/extensions/skillsconf/src/filter.ts +74 -74
- package/agent/extensions/skillsconf/src/fuzzy.ts +26 -26
- package/agent/extensions/skillsconf/src/persistence.test.ts +72 -72
- package/agent/extensions/skillsconf/src/persistence.ts +169 -169
- package/agent/extensions/skillsconf/src/ui/SkillConfView.test.ts +337 -337
- package/agent/extensions/skillsconf/src/ui/SkillConfView.ts +758 -758
- package/agent/extensions/skillsconf/src/ui/text-input.ts +91 -91
- package/agent/extensions/skillsconf/src/ui/tui-helpers.ts +144 -144
- package/agent/extensions/skillsconf/tsconfig.json +15 -15
- package/agent/extensions/statusline/index.ts +273 -282
- package/agent/extensions/statusline/install.ps1 +27 -27
- package/agent/extensions/statusline/install.sh +24 -24
- package/agent/extensions/subagents/by-the-way.test.ts +29 -29
- package/agent/extensions/subagents/claude.test.ts +119 -119
- package/agent/extensions/subagents/codex.test.ts +102 -102
- package/agent/extensions/subagents/context-usage.test.ts +107 -107
- package/agent/extensions/subagents/docs/design-plan.md +568 -568
- package/agent/extensions/subagents/docs/effect-v4-extension-guide.md +354 -354
- package/agent/extensions/subagents/docs/effect-v4-notes.md +571 -571
- package/agent/extensions/subagents/index.ts +779 -779
- package/agent/extensions/subagents/install.ps1 +27 -27
- package/agent/extensions/subagents/install.sh +24 -24
- package/agent/extensions/subagents/manager.test.ts +276 -276
- package/agent/extensions/subagents/package-lock.json +2244 -2244
- package/agent/extensions/subagents/package.json +19 -19
- package/agent/extensions/subagents/result-delivery.test.ts +27 -27
- package/agent/extensions/subagents/src/backend.ts +73 -73
- package/agent/extensions/subagents/src/backends/claude.ts +701 -701
- package/agent/extensions/subagents/src/backends/codex.ts +1060 -1060
- package/agent/extensions/subagents/src/backends/pi.ts +575 -575
- package/agent/extensions/subagents/src/backends/stub.ts +300 -300
- package/agent/extensions/subagents/src/by-the-way.ts +21 -21
- package/agent/extensions/subagents/src/domain.ts +253 -253
- package/agent/extensions/subagents/src/format.ts +74 -74
- package/agent/extensions/subagents/src/manager.ts +736 -736
- package/agent/extensions/subagents/src/prompt.ts +92 -92
- package/agent/extensions/subagents/src/result-delivery.ts +20 -20
- package/agent/extensions/subagents/src/runtime.ts +53 -53
- package/agent/extensions/subagents/src/ui/takeover.ts +583 -583
- package/agent/extensions/subagents/src/ui/transcript.ts +201 -201
- package/agent/extensions/subagents/takeover.test.ts +29 -29
- package/agent/extensions/subagents/tsconfig.json +7 -7
- package/agent/extensions/todo/AGENTS.md +38 -38
- package/agent/extensions/todo/LICENSE +21 -21
- package/agent/extensions/todo/config.ts +55 -55
- package/agent/extensions/todo/index.ts +151 -151
- package/agent/extensions/todo/install.ps1 +27 -27
- package/agent/extensions/todo/install.sh +24 -24
- package/agent/extensions/todo/locales/de.json +17 -17
- package/agent/extensions/todo/locales/en.json +15 -15
- package/agent/extensions/todo/locales/es.json +17 -17
- package/agent/extensions/todo/locales/fr.json +17 -17
- package/agent/extensions/todo/locales/pt-BR.json +17 -17
- package/agent/extensions/todo/locales/pt.json +17 -17
- package/agent/extensions/todo/locales/ru.json +17 -17
- package/agent/extensions/todo/locales/uk.json +17 -17
- package/agent/extensions/todo/locales/zh.json +17 -17
- package/agent/extensions/todo/package-lock.json +3358 -3358
- package/agent/extensions/todo/package.json +67 -67
- package/agent/extensions/todo/state/i18n-bridge.ts +64 -64
- package/agent/extensions/todo/state/invariants.ts +20 -20
- package/agent/extensions/todo/state/replay.ts +38 -38
- package/agent/extensions/todo/state/selectors.ts +107 -107
- package/agent/extensions/todo/state/state-reducer.ts +326 -326
- package/agent/extensions/todo/state/state.ts +18 -18
- package/agent/extensions/todo/state/store.ts +82 -82
- package/agent/extensions/todo/state/task-graph.ts +57 -57
- package/agent/extensions/todo/todo-overlay.ts +200 -200
- package/agent/extensions/todo/todo.ts +155 -155
- package/agent/extensions/todo/tool/response-envelope.ts +109 -109
- package/agent/extensions/todo/tool/types.ts +206 -206
- package/agent/extensions/todo/view/format.ts +177 -177
- package/agent/extensions/trim-context/README.md +54 -54
- package/agent/extensions/trim-context/index.ts +487 -487
- package/agent/extensions/trim-context/install.ps1 +27 -27
- package/agent/extensions/trim-context/install.sh +24 -24
- package/agent/keybindings.json +7 -7
- package/agent/version.txt +1 -1
- package/bin/kiln.js +20 -13
- package/package.json +1 -1
- package/agent/extensions/taste/index.ts +0 -443
- package/agent/extensions/taste/install.ps1 +0 -27
- package/agent/extensions/taste/install.sh +0 -24
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# goal
|
|
2
|
-
|
|
3
|
-
Keep the agent working until a goal is achieved.
|
|
4
|
-
|
|
5
|
-
## Command
|
|
6
|
-
|
|
7
|
-
| Command | Action |
|
|
8
|
-
|---|---|
|
|
9
|
-
| `/goal <prompt>` | Runs the workflow below, looping until you confirm the goal is achieved |
|
|
10
|
-
| `/goal` | Prompts for the goal interactively, then runs the same workflow |
|
|
11
|
-
|
|
12
|
-
`/goal` with no argument opens an input dialog; if the dialog is cancelled or
|
|
13
|
-
left empty, nothing runs.
|
|
14
|
-
|
|
15
|
-
## Workflow
|
|
16
|
-
|
|
17
|
-
`/goal <prompt>` injects an instruction into the main agent that runs four
|
|
18
|
-
phases in order:
|
|
19
|
-
|
|
20
|
-
1. **Research** — web-search the goal to ground the design.
|
|
21
|
-
2. **Design** — follow the `brainstorming` skill; present the design for
|
|
22
|
-
approval, then save the design doc to `docs/superpowers/specs/`.
|
|
23
|
-
3. **Plan** — follow the `writing-plans` skill; save a bite-sized plan to
|
|
24
|
-
`docs/superpowers/plans/`.
|
|
25
|
-
4. **Implement and verify** — write the code, tests, and docs; run them and
|
|
26
|
-
fix failures until the goal actually works.
|
|
27
|
-
|
|
28
|
-
### The loop
|
|
29
|
-
|
|
30
|
-
After the agent settles, `/goal` asks you what to do next:
|
|
31
|
-
|
|
32
|
-
- **Continue working toward the goal** — re-engages the agent to keep going,
|
|
33
|
-
respecting the phase gates (it won't skip design approval).
|
|
34
|
-
- **Goal achieved - stop** — ends the loop.
|
|
35
|
-
- **Pause - stop checking** — ends the loop and leaves you to take over
|
|
36
|
-
manually.
|
|
37
|
-
|
|
38
|
-
The loop runs in the interactive TUI (it needs to ask you). In RPC and
|
|
39
|
-
print/JSON modes there is no dialog, so the agent works a single pass and the
|
|
40
|
-
loop ends. The workflow always stops after Phase 2 and waits for you to approve
|
|
41
|
-
the design doc before planning and implementing.
|
|
42
|
-
|
|
43
|
-
## Files
|
|
44
|
-
|
|
45
|
-
- `index.ts` — registers the `/goal` command, builds the phase instruction,
|
|
46
|
-
and re-engages the agent on `agent_settled`
|
|
47
|
-
- `README.md` — this file
|
|
48
|
-
|
|
49
|
-
Nothing is written into the extension folder; the design and plan land in the
|
|
50
|
-
project's `docs/superpowers/` tree (the skills' default locations).
|
|
1
|
+
# goal
|
|
2
|
+
|
|
3
|
+
Keep the agent working until a goal is achieved.
|
|
4
|
+
|
|
5
|
+
## Command
|
|
6
|
+
|
|
7
|
+
| Command | Action |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `/goal <prompt>` | Runs the workflow below, looping until you confirm the goal is achieved |
|
|
10
|
+
| `/goal` | Prompts for the goal interactively, then runs the same workflow |
|
|
11
|
+
|
|
12
|
+
`/goal` with no argument opens an input dialog; if the dialog is cancelled or
|
|
13
|
+
left empty, nothing runs.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
`/goal <prompt>` injects an instruction into the main agent that runs four
|
|
18
|
+
phases in order:
|
|
19
|
+
|
|
20
|
+
1. **Research** — web-search the goal to ground the design.
|
|
21
|
+
2. **Design** — follow the `brainstorming` skill; present the design for
|
|
22
|
+
approval, then save the design doc to `docs/superpowers/specs/`.
|
|
23
|
+
3. **Plan** — follow the `writing-plans` skill; save a bite-sized plan to
|
|
24
|
+
`docs/superpowers/plans/`.
|
|
25
|
+
4. **Implement and verify** — write the code, tests, and docs; run them and
|
|
26
|
+
fix failures until the goal actually works.
|
|
27
|
+
|
|
28
|
+
### The loop
|
|
29
|
+
|
|
30
|
+
After the agent settles, `/goal` asks you what to do next:
|
|
31
|
+
|
|
32
|
+
- **Continue working toward the goal** — re-engages the agent to keep going,
|
|
33
|
+
respecting the phase gates (it won't skip design approval).
|
|
34
|
+
- **Goal achieved - stop** — ends the loop.
|
|
35
|
+
- **Pause - stop checking** — ends the loop and leaves you to take over
|
|
36
|
+
manually.
|
|
37
|
+
|
|
38
|
+
The loop runs in the interactive TUI (it needs to ask you). In RPC and
|
|
39
|
+
print/JSON modes there is no dialog, so the agent works a single pass and the
|
|
40
|
+
loop ends. The workflow always stops after Phase 2 and waits for you to approve
|
|
41
|
+
the design doc before planning and implementing.
|
|
42
|
+
|
|
43
|
+
## Files
|
|
44
|
+
|
|
45
|
+
- `index.ts` — registers the `/goal` command, builds the phase instruction,
|
|
46
|
+
and re-engages the agent on `agent_settled`
|
|
47
|
+
- `README.md` — this file
|
|
48
|
+
|
|
49
|
+
Nothing is written into the extension folder; the design and plan land in the
|
|
50
|
+
project's `docs/superpowers/` tree (the skills' default locations).
|
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* goal — keep the agent working until the goal is achieved.
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* /goal <prompt> Research → design → plan → implement → verify, looping
|
|
6
|
-
* until you confirm the goal is achieved.
|
|
7
|
-
* /goal Prompts for the goal interactively.
|
|
8
|
-
*
|
|
9
|
-
* After the agent settles, this extension asks whether to keep working, mark
|
|
10
|
-
* the goal achieved, or pause. "Keep working" re-engages the agent until the
|
|
11
|
-
* goal is done. See README.md for the phase-by-phase workflow.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { homedir } from "node:os";
|
|
15
|
-
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
16
|
-
|
|
17
|
-
const HOME = homedir().replace(/\\/g, "/");
|
|
18
|
-
const BRAINSTORMING_SKILL = `${HOME}/.agents/skills/brainstorming/SKILL.md`;
|
|
19
|
-
const WRITING_PLANS_SKILL = `${HOME}/.agents/skills/writing-plans/SKILL.md`;
|
|
20
|
-
|
|
21
|
-
/** Shared closing instruction for every /goal pass. */
|
|
22
|
-
const REPORT_TAIL = "When you finish a pass, report what is done, what remains, and whether the goal is achieved.";
|
|
23
|
-
|
|
24
|
-
/** The goal the agent is currently working toward, or null when idle. */
|
|
25
|
-
let activeGoal: string | null = null;
|
|
26
|
-
|
|
27
|
-
function shortGoal(goal: string): string {
|
|
28
|
-
const s = goal.replace(/\s+/g, " ").trim();
|
|
29
|
-
return s.length > 60 ? `${s.slice(0, 60)}…` : s;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function buildInstruction(goal: string): string {
|
|
33
|
-
return [
|
|
34
|
-
"You are executing a /goal workflow: research, then design, then plan, then implement and verify — working until the goal is achieved.",
|
|
35
|
-
"",
|
|
36
|
-
"GOAL:",
|
|
37
|
-
goal,
|
|
38
|
-
"",
|
|
39
|
-
"Work through the phases in order.",
|
|
40
|
-
"",
|
|
41
|
-
"PHASE 1 — RESEARCH",
|
|
42
|
-
"- Use web_search to research the goal: relevant technologies, existing libraries and approaches, best practices, constraints, and open questions.",
|
|
43
|
-
"- Gather grounded facts to inform the design; cite what you learn in the design doc.",
|
|
44
|
-
"",
|
|
45
|
-
"PHASE 2 — DESIGN",
|
|
46
|
-
`- First read the brainstorming skill: ${BRAINSTORMING_SKILL}. Follow it.`,
|
|
47
|
-
"- Ask clarifying questions one at a time (use ask_user when a choice can be enumerated) to pin down purpose, constraints, and success criteria.",
|
|
48
|
-
"- Propose 2-3 approaches with trade-offs and a recommendation; present the design in sections and get approval after each section.",
|
|
49
|
-
"- When the design is approved, save it to docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md and ask the user to review it.",
|
|
50
|
-
"- STOP here and wait for the user to approve the design doc. Do not begin later phases until the user explicitly approves.",
|
|
51
|
-
"",
|
|
52
|
-
"PHASE 3 — PLAN",
|
|
53
|
-
`- First read the writing-plans skill: ${WRITING_PLANS_SKILL}. Follow it.`,
|
|
54
|
-
"- Write a detailed, bite-sized implementation plan with no placeholders and save it to docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md.",
|
|
55
|
-
"",
|
|
56
|
-
"PHASE 4 — IMPLEMENT AND VERIFY",
|
|
57
|
-
"- Implement the plan: write the actual code, tests, and docs.",
|
|
58
|
-
"- Run the tests and any verification; fix failures until everything passes.",
|
|
59
|
-
"- Verify the goal is actually achieved and working, not just that code was written.",
|
|
60
|
-
"",
|
|
61
|
-
REPORT_TAIL,
|
|
62
|
-
].join("\n");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function buildContinueInstruction(goal: string): string {
|
|
66
|
-
return [
|
|
67
|
-
`Continue working toward the goal: ${goal}`,
|
|
68
|
-
"",
|
|
69
|
-
"Review the current state and resume the /goal workflow from where you left off, respecting the phase gates:",
|
|
70
|
-
"- If the design has not been approved yet: present the design and STOP for approval. Do not plan or implement until the user approves.",
|
|
71
|
-
"- If the design is approved but the plan is not written: follow the writing-plans skill and write the plan.",
|
|
72
|
-
"- Otherwise: implement and verify, fixing failures until everything passes.",
|
|
73
|
-
"If you are blocked or need a decision, ask the user.",
|
|
74
|
-
REPORT_TAIL,
|
|
75
|
-
].join("\n");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function runGoal(pi: ExtensionAPI, ctx: ExtensionCommandContext, goal: string): Promise<void> {
|
|
79
|
-
activeGoal = goal;
|
|
80
|
-
if (ctx.isIdle()) {
|
|
81
|
-
await pi.sendUserMessage(buildInstruction(goal));
|
|
82
|
-
} else {
|
|
83
|
-
await pi.sendUserMessage(buildInstruction(goal), { deliverAs: "followUp" });
|
|
84
|
-
}
|
|
85
|
-
ctx.ui.notify("goal: working until achieved", "info");
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export default function (pi: ExtensionAPI) {
|
|
89
|
-
pi.registerCommand("goal", {
|
|
90
|
-
description:
|
|
91
|
-
"Keep the agent working until a goal is achieved: web research, brainstorming design, writing-plans plan, implement and verify",
|
|
92
|
-
handler: async (args, ctx) => {
|
|
93
|
-
let goal = (args ?? "").trim();
|
|
94
|
-
if (!goal) {
|
|
95
|
-
if (!ctx.hasUI) {
|
|
96
|
-
console.error("Usage: /goal <goal> - work on it until it is achieved");
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const typed = await ctx.ui.input("What goal would you like to achieve?", "e.g. add a /goal extension to pi");
|
|
100
|
-
goal = (typed ?? "").trim();
|
|
101
|
-
if (!goal) return;
|
|
102
|
-
}
|
|
103
|
-
await runGoal(pi, ctx, goal);
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// Re-engage the agent after each settle until the goal is achieved.
|
|
108
|
-
pi.on("agent_settled", async (_event, ctx) => {
|
|
109
|
-
if (!activeGoal) return;
|
|
110
|
-
|
|
111
|
-
// The interactive loop needs the TUI: awaiting a dialog from inside
|
|
112
|
-
// the settle handler can deadlock RPC clients, and print/JSON modes
|
|
113
|
-
// can't prompt at all. Stop the loop rather than spin.
|
|
114
|
-
if (ctx.mode !== "tui") {
|
|
115
|
-
activeGoal = null;
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const choice = await ctx.ui.select(`Goal: ${shortGoal(activeGoal)}`, [
|
|
120
|
-
"Continue working toward the goal",
|
|
121
|
-
"Goal achieved - stop",
|
|
122
|
-
"Pause - stop checking",
|
|
123
|
-
]);
|
|
124
|
-
|
|
125
|
-
// Esc / cancel → pause, so the loop never runs away.
|
|
126
|
-
if (!choice || choice === "Pause - stop checking") {
|
|
127
|
-
activeGoal = null;
|
|
128
|
-
ctx.ui.notify("goal: paused - take over manually", "info");
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (choice === "Goal achieved - stop") {
|
|
133
|
-
activeGoal = null;
|
|
134
|
-
ctx.ui.notify("goal: marked achieved", "info");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// "Continue working toward the goal"
|
|
139
|
-
if (ctx.isIdle()) {
|
|
140
|
-
await pi.sendUserMessage(buildContinueInstruction(activeGoal));
|
|
141
|
-
} else {
|
|
142
|
-
await pi.sendUserMessage(buildContinueInstruction(activeGoal), { deliverAs: "followUp" });
|
|
143
|
-
}
|
|
144
|
-
ctx.ui.notify("goal: continuing...", "info");
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// Reset state on session boundaries so a stale goal never leaks into a
|
|
148
|
-
// fresh session (or across /reload).
|
|
149
|
-
pi.on("session_start", () => {
|
|
150
|
-
activeGoal = null;
|
|
151
|
-
});
|
|
152
|
-
pi.on("session_shutdown", () => {
|
|
153
|
-
activeGoal = null;
|
|
154
|
-
});
|
|
155
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* goal — keep the agent working until the goal is achieved.
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* /goal <prompt> Research → design → plan → implement → verify, looping
|
|
6
|
+
* until you confirm the goal is achieved.
|
|
7
|
+
* /goal Prompts for the goal interactively.
|
|
8
|
+
*
|
|
9
|
+
* After the agent settles, this extension asks whether to keep working, mark
|
|
10
|
+
* the goal achieved, or pause. "Keep working" re-engages the agent until the
|
|
11
|
+
* goal is done. See README.md for the phase-by-phase workflow.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
16
|
+
|
|
17
|
+
const HOME = homedir().replace(/\\/g, "/");
|
|
18
|
+
const BRAINSTORMING_SKILL = `${HOME}/.agents/skills/brainstorming/SKILL.md`;
|
|
19
|
+
const WRITING_PLANS_SKILL = `${HOME}/.agents/skills/writing-plans/SKILL.md`;
|
|
20
|
+
|
|
21
|
+
/** Shared closing instruction for every /goal pass. */
|
|
22
|
+
const REPORT_TAIL = "When you finish a pass, report what is done, what remains, and whether the goal is achieved.";
|
|
23
|
+
|
|
24
|
+
/** The goal the agent is currently working toward, or null when idle. */
|
|
25
|
+
let activeGoal: string | null = null;
|
|
26
|
+
|
|
27
|
+
function shortGoal(goal: string): string {
|
|
28
|
+
const s = goal.replace(/\s+/g, " ").trim();
|
|
29
|
+
return s.length > 60 ? `${s.slice(0, 60)}…` : s;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function buildInstruction(goal: string): string {
|
|
33
|
+
return [
|
|
34
|
+
"You are executing a /goal workflow: research, then design, then plan, then implement and verify — working until the goal is achieved.",
|
|
35
|
+
"",
|
|
36
|
+
"GOAL:",
|
|
37
|
+
goal,
|
|
38
|
+
"",
|
|
39
|
+
"Work through the phases in order.",
|
|
40
|
+
"",
|
|
41
|
+
"PHASE 1 — RESEARCH",
|
|
42
|
+
"- Use web_search to research the goal: relevant technologies, existing libraries and approaches, best practices, constraints, and open questions.",
|
|
43
|
+
"- Gather grounded facts to inform the design; cite what you learn in the design doc.",
|
|
44
|
+
"",
|
|
45
|
+
"PHASE 2 — DESIGN",
|
|
46
|
+
`- First read the brainstorming skill: ${BRAINSTORMING_SKILL}. Follow it.`,
|
|
47
|
+
"- Ask clarifying questions one at a time (use ask_user when a choice can be enumerated) to pin down purpose, constraints, and success criteria.",
|
|
48
|
+
"- Propose 2-3 approaches with trade-offs and a recommendation; present the design in sections and get approval after each section.",
|
|
49
|
+
"- When the design is approved, save it to docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md and ask the user to review it.",
|
|
50
|
+
"- STOP here and wait for the user to approve the design doc. Do not begin later phases until the user explicitly approves.",
|
|
51
|
+
"",
|
|
52
|
+
"PHASE 3 — PLAN",
|
|
53
|
+
`- First read the writing-plans skill: ${WRITING_PLANS_SKILL}. Follow it.`,
|
|
54
|
+
"- Write a detailed, bite-sized implementation plan with no placeholders and save it to docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md.",
|
|
55
|
+
"",
|
|
56
|
+
"PHASE 4 — IMPLEMENT AND VERIFY",
|
|
57
|
+
"- Implement the plan: write the actual code, tests, and docs.",
|
|
58
|
+
"- Run the tests and any verification; fix failures until everything passes.",
|
|
59
|
+
"- Verify the goal is actually achieved and working, not just that code was written.",
|
|
60
|
+
"",
|
|
61
|
+
REPORT_TAIL,
|
|
62
|
+
].join("\n");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function buildContinueInstruction(goal: string): string {
|
|
66
|
+
return [
|
|
67
|
+
`Continue working toward the goal: ${goal}`,
|
|
68
|
+
"",
|
|
69
|
+
"Review the current state and resume the /goal workflow from where you left off, respecting the phase gates:",
|
|
70
|
+
"- If the design has not been approved yet: present the design and STOP for approval. Do not plan or implement until the user approves.",
|
|
71
|
+
"- If the design is approved but the plan is not written: follow the writing-plans skill and write the plan.",
|
|
72
|
+
"- Otherwise: implement and verify, fixing failures until everything passes.",
|
|
73
|
+
"If you are blocked or need a decision, ask the user.",
|
|
74
|
+
REPORT_TAIL,
|
|
75
|
+
].join("\n");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function runGoal(pi: ExtensionAPI, ctx: ExtensionCommandContext, goal: string): Promise<void> {
|
|
79
|
+
activeGoal = goal;
|
|
80
|
+
if (ctx.isIdle()) {
|
|
81
|
+
await pi.sendUserMessage(buildInstruction(goal));
|
|
82
|
+
} else {
|
|
83
|
+
await pi.sendUserMessage(buildInstruction(goal), { deliverAs: "followUp" });
|
|
84
|
+
}
|
|
85
|
+
ctx.ui.notify("goal: working until achieved", "info");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default function (pi: ExtensionAPI) {
|
|
89
|
+
pi.registerCommand("goal", {
|
|
90
|
+
description:
|
|
91
|
+
"Keep the agent working until a goal is achieved: web research, brainstorming design, writing-plans plan, implement and verify",
|
|
92
|
+
handler: async (args, ctx) => {
|
|
93
|
+
let goal = (args ?? "").trim();
|
|
94
|
+
if (!goal) {
|
|
95
|
+
if (!ctx.hasUI) {
|
|
96
|
+
console.error("Usage: /goal <goal> - work on it until it is achieved");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const typed = await ctx.ui.input("What goal would you like to achieve?", "e.g. add a /goal extension to pi");
|
|
100
|
+
goal = (typed ?? "").trim();
|
|
101
|
+
if (!goal) return;
|
|
102
|
+
}
|
|
103
|
+
await runGoal(pi, ctx, goal);
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Re-engage the agent after each settle until the goal is achieved.
|
|
108
|
+
pi.on("agent_settled", async (_event, ctx) => {
|
|
109
|
+
if (!activeGoal) return;
|
|
110
|
+
|
|
111
|
+
// The interactive loop needs the TUI: awaiting a dialog from inside
|
|
112
|
+
// the settle handler can deadlock RPC clients, and print/JSON modes
|
|
113
|
+
// can't prompt at all. Stop the loop rather than spin.
|
|
114
|
+
if (ctx.mode !== "tui") {
|
|
115
|
+
activeGoal = null;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const choice = await ctx.ui.select(`Goal: ${shortGoal(activeGoal)}`, [
|
|
120
|
+
"Continue working toward the goal",
|
|
121
|
+
"Goal achieved - stop",
|
|
122
|
+
"Pause - stop checking",
|
|
123
|
+
]);
|
|
124
|
+
|
|
125
|
+
// Esc / cancel → pause, so the loop never runs away.
|
|
126
|
+
if (!choice || choice === "Pause - stop checking") {
|
|
127
|
+
activeGoal = null;
|
|
128
|
+
ctx.ui.notify("goal: paused - take over manually", "info");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (choice === "Goal achieved - stop") {
|
|
133
|
+
activeGoal = null;
|
|
134
|
+
ctx.ui.notify("goal: marked achieved", "info");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// "Continue working toward the goal"
|
|
139
|
+
if (ctx.isIdle()) {
|
|
140
|
+
await pi.sendUserMessage(buildContinueInstruction(activeGoal));
|
|
141
|
+
} else {
|
|
142
|
+
await pi.sendUserMessage(buildContinueInstruction(activeGoal), { deliverAs: "followUp" });
|
|
143
|
+
}
|
|
144
|
+
ctx.ui.notify("goal: continuing...", "info");
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Reset state on session boundaries so a stale goal never leaks into a
|
|
148
|
+
// fresh session (or across /reload).
|
|
149
|
+
pi.on("session_start", () => {
|
|
150
|
+
activeGoal = null;
|
|
151
|
+
});
|
|
152
|
+
pi.on("session_shutdown", () => {
|
|
153
|
+
activeGoal = null;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
#!/usr/bin/env pwsh
|
|
2
|
-
# Per-extension installer — Windows / PowerShell
|
|
3
|
-
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
-
$ErrorActionPreference = "Stop"
|
|
5
|
-
# Drop npm_config_allow_scripts inherited from a parent npm/npx process:
|
|
6
|
-
# npm >=11 rejects it for project installs (EALLOWSCRIPTS). File config still applies.
|
|
7
|
-
Remove-Item Env:\npm_config_allow_scripts -ErrorAction SilentlyContinue
|
|
8
|
-
Remove-Item Env:\NPM_CONFIG_ALLOW_SCRIPTS -ErrorAction SilentlyContinue
|
|
9
|
-
$extDir = $PSScriptRoot
|
|
10
|
-
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
11
|
-
if (-not (Test-Path "$extDir/package.json")) {
|
|
12
|
-
Write-Host " - no package.json — skipping" -ForegroundColor DarkGray
|
|
13
|
-
exit 0
|
|
14
|
-
}
|
|
15
|
-
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
|
|
16
|
-
Write-Host " x npm not found — install Node.js 22+" -ForegroundColor Red
|
|
17
|
-
exit 1
|
|
18
|
-
}
|
|
19
|
-
if (Test-Path "$extDir/package-lock.json") {
|
|
20
|
-
Write-Host " - npm ci" -ForegroundColor DarkGray
|
|
21
|
-
npm --prefix $extDir ci --no-audit --no-fund
|
|
22
|
-
} else {
|
|
23
|
-
Write-Host " - npm install" -ForegroundColor DarkGray
|
|
24
|
-
npm --prefix $extDir install --no-audit --no-fund
|
|
25
|
-
}
|
|
26
|
-
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
27
|
-
Write-Host " + done" -ForegroundColor Green
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
# Per-extension installer — Windows / PowerShell
|
|
3
|
+
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
+
$ErrorActionPreference = "Stop"
|
|
5
|
+
# Drop npm_config_allow_scripts inherited from a parent npm/npx process:
|
|
6
|
+
# npm >=11 rejects it for project installs (EALLOWSCRIPTS). File config still applies.
|
|
7
|
+
Remove-Item Env:\npm_config_allow_scripts -ErrorAction SilentlyContinue
|
|
8
|
+
Remove-Item Env:\NPM_CONFIG_ALLOW_SCRIPTS -ErrorAction SilentlyContinue
|
|
9
|
+
$extDir = $PSScriptRoot
|
|
10
|
+
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
11
|
+
if (-not (Test-Path "$extDir/package.json")) {
|
|
12
|
+
Write-Host " - no package.json — skipping" -ForegroundColor DarkGray
|
|
13
|
+
exit 0
|
|
14
|
+
}
|
|
15
|
+
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
|
|
16
|
+
Write-Host " x npm not found — install Node.js 22+" -ForegroundColor Red
|
|
17
|
+
exit 1
|
|
18
|
+
}
|
|
19
|
+
if (Test-Path "$extDir/package-lock.json") {
|
|
20
|
+
Write-Host " - npm ci" -ForegroundColor DarkGray
|
|
21
|
+
npm --prefix $extDir ci --no-audit --no-fund
|
|
22
|
+
} else {
|
|
23
|
+
Write-Host " - npm install" -ForegroundColor DarkGray
|
|
24
|
+
npm --prefix $extDir install --no-audit --no-fund
|
|
25
|
+
}
|
|
26
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
27
|
+
Write-Host " + done" -ForegroundColor Green
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# Per-extension installer — macOS / Linux
|
|
3
|
-
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
-
set -eu
|
|
5
|
-
# Drop npm_config_allow_scripts inherited from a parent npm/npx process:
|
|
6
|
-
# npm >=11 rejects it for project installs (EALLOWSCRIPTS). File config still applies.
|
|
7
|
-
unset npm_config_allow_scripts NPM_CONFIG_ALLOW_SCRIPTS 2>/dev/null || true
|
|
8
|
-
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
9
|
-
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
10
|
-
echo " · no package.json — skipping"
|
|
11
|
-
exit 0
|
|
12
|
-
fi
|
|
13
|
-
if ! command -v npm >/dev/null 2>&1; then
|
|
14
|
-
echo " ✖ npm not found — install Node.js 22+" >&2
|
|
15
|
-
exit 1
|
|
16
|
-
fi
|
|
17
|
-
if [ -f "$EXT_DIR/package-lock.json" ]; then
|
|
18
|
-
echo " · npm ci"
|
|
19
|
-
npm --prefix "$EXT_DIR" ci --no-audit --no-fund
|
|
20
|
-
else
|
|
21
|
-
echo " · npm install"
|
|
22
|
-
npm --prefix "$EXT_DIR" install --no-audit --no-fund
|
|
23
|
-
fi
|
|
24
|
-
echo " ✓ done"
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Per-extension installer — macOS / Linux
|
|
3
|
+
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
+
set -eu
|
|
5
|
+
# Drop npm_config_allow_scripts inherited from a parent npm/npx process:
|
|
6
|
+
# npm >=11 rejects it for project installs (EALLOWSCRIPTS). File config still applies.
|
|
7
|
+
unset npm_config_allow_scripts NPM_CONFIG_ALLOW_SCRIPTS 2>/dev/null || true
|
|
8
|
+
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
9
|
+
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
10
|
+
echo " · no package.json — skipping"
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
if ! command -v npm >/dev/null 2>&1; then
|
|
14
|
+
echo " ✖ npm not found — install Node.js 22+" >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
if [ -f "$EXT_DIR/package-lock.json" ]; then
|
|
18
|
+
echo " · npm ci"
|
|
19
|
+
npm --prefix "$EXT_DIR" ci --no-audit --no-fund
|
|
20
|
+
else
|
|
21
|
+
echo " · npm install"
|
|
22
|
+
npm --prefix "$EXT_DIR" install --no-audit --no-fund
|
|
23
|
+
fi
|
|
24
|
+
echo " ✓ done"
|
|
@@ -1,25 +1,38 @@
|
|
|
1
|
-
# kiln-update
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
# kiln-update
|
|
2
|
+
|
|
3
|
+
A minimal kiln header for pi, and a nudge when your install is behind GitHub.
|
|
4
|
+
|
|
5
|
+
- Replaces the built-in startup header with:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
pi vX kiln vY
|
|
9
|
+
skills N extensions N
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Press `ctrl+o` to expand the header and list every installed skill and
|
|
13
|
+
extension.
|
|
14
|
+
- When `~/.pi/agent/version.txt` is behind `agent/version.txt` on `main`, the
|
|
15
|
+
header also shows:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Update Available. To update, run:
|
|
19
|
+
run npx @asterxsk/kiln@latest
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Silent when up to date, offline, or timed out (5s).
|
|
23
|
+
|
|
24
|
+
## Manual check
|
|
25
|
+
|
|
26
|
+
`/kiln-update` — re-check on demand, refresh the header, and report the result.
|
|
27
|
+
|
|
28
|
+
## Releasing a new version
|
|
29
|
+
|
|
30
|
+
1. Make your changes.
|
|
31
|
+
2. Bump `agent/version.txt` (e.g. `0.2.0` → `0.3.0`).
|
|
32
|
+
3. Push to GitHub. No `npm publish` needed — `kiln` installs from git,
|
|
33
|
+
and every user gets the nudge on their next session.
|
|
34
|
+
|
|
35
|
+
## Opt out
|
|
36
|
+
|
|
37
|
+
`KILN_NO_UPDATE_CHECK=1`. Forks can point elsewhere with
|
|
38
|
+
`KILN_VERSION_URL=https://.../version.txt`.
|