@asterxsk/kiln 0.2.0 → 0.4.0
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/LICENSE +21 -21
- package/README.md +4 -19
- package/agent/extensions/AGENTS.md +68 -68
- package/agent/extensions/ask-user/install.ps1 +4 -0
- package/agent/extensions/ask-user/install.sh +3 -0
- package/agent/extensions/background-terminals/install.ps1 +4 -0
- package/agent/extensions/background-terminals/install.sh +3 -0
- package/agent/extensions/destructive/install.ps1 +4 -0
- package/agent/extensions/destructive/install.sh +3 -0
- package/agent/extensions/file-search/install.ps1 +4 -0
- package/agent/extensions/file-search/install.sh +3 -0
- package/agent/extensions/goal/install.ps1 +4 -0
- package/agent/extensions/goal/install.sh +3 -0
- package/agent/extensions/herdr-agent-state.ts +257 -0
- package/agent/extensions/kiln-update/README.md +25 -0
- package/agent/extensions/kiln-update/index.ts +99 -0
- package/agent/extensions/kiln-update/install.ps1 +27 -0
- package/agent/extensions/kiln-update/install.sh +24 -0
- package/agent/extensions/modelconf/install.ps1 +4 -0
- package/agent/extensions/modelconf/install.sh +3 -0
- package/agent/extensions/shared/install.ps1 +4 -0
- package/agent/extensions/shared/install.sh +3 -0
- package/agent/extensions/skillsconf/install.ps1 +4 -0
- package/agent/extensions/skillsconf/install.sh +3 -0
- package/agent/extensions/statusline/install.ps1 +4 -0
- package/agent/extensions/statusline/install.sh +3 -0
- package/agent/extensions/subagents/install.ps1 +4 -0
- package/agent/extensions/subagents/install.sh +3 -0
- package/agent/extensions/taste/index.ts +443 -0
- package/agent/extensions/taste/install.ps1 +27 -0
- package/agent/extensions/taste/install.sh +24 -0
- package/agent/extensions/todo/install.ps1 +4 -0
- package/agent/extensions/todo/install.sh +3 -0
- package/agent/extensions/trim-context/install.ps1 +4 -0
- package/agent/extensions/trim-context/install.sh +3 -0
- package/agent/version.txt +1 -0
- package/bin/kiln.js +590 -471
- package/package.json +27 -27
- package/agent/install.ps1 +0 -637
- package/agent/install.sh +0 -620
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 asterxsk
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 asterxsk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -18,20 +18,7 @@ Dotfiles rot. Extensions drift out of sync. A fresh machine means an afternoon o
|
|
|
18
18
|
One line, then you're done:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
# npm / bun (recommended — no Defender flag, no git needed)
|
|
22
21
|
npx @asterxsk/kiln --yes
|
|
23
|
-
# or: npm i -g @asterxsk/kiln && kiln --yes
|
|
24
|
-
# or: bunx @asterxsk/kiln --yes
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# macOS / Linux / Git Bash (classic)
|
|
29
|
-
curl -fsSL https://raw.githubusercontent.com/asterxsk/kiln/main/agent/install.sh | sh
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```powershell
|
|
33
|
-
# Windows PowerShell (5.1 or 7+)
|
|
34
|
-
powershell -NoProfile -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/asterxsk/kiln/main/agent/install.ps1 -UseBasicParsing | iex"
|
|
35
22
|
```
|
|
36
23
|
|
|
37
24
|
What the installer does:
|
|
@@ -41,7 +28,7 @@ What the installer does:
|
|
|
41
28
|
3. Clones `asterxsk/kiln` over plain HTTPS (no credential prompts, ever) and copies the managed files into `~/.pi/agent` — extensions and config get overwritten, your `settings.json`, `taste/`, sessions, and secrets are left alone
|
|
42
29
|
4. Runs each extension's `install.sh` / `install.ps1` (`npm ci`)
|
|
43
30
|
|
|
44
|
-
**Safe to re-run.** It back ups the extensions and config files it replaces, never touches per-user state, and accepts `--help` options (`--repo`, `--branch`, `--target`, `--local`, `--skip-pi`, `--skip-packages`, `--yes`) when you want control. The
|
|
31
|
+
**Safe to re-run.** It back ups the extensions and config files it replaces, never touches per-user state, and accepts `--help` options (`--repo`, `--branch`, `--target`, `--local`, `--skip-pi`, `--skip-packages`, `--yes`) when you want control. The installer always clones the repo over plain HTTPS — no credential prompts, ever — so every install starts from the latest GitHub code (`--repo`/`--branch` for forks, `--local` for a local checkout).
|
|
45
32
|
|
|
46
33
|
### Publishing the npm package
|
|
47
34
|
|
|
@@ -68,7 +55,7 @@ cp kiln/agent/{AGENTS.md,keybindings.json,settings.json} ~/.pi/agent/
|
|
|
68
55
|
- **Safe installer** — public HTTPS clone, atomic overwrites, narrow backups of only the files it replaces. Your config is never collateral damage.
|
|
69
56
|
- **Forge-first UX** — `theme: forge`, fullscreen TUI, high thinking by default. Built for long sessions.
|
|
70
57
|
- **Secret-free by construction** — `auth.json`, `sessions/`, `trust.json`, `models-store.json`, `bin/`, and `themes/.pi` are `.gitignore`'d. The repo holds config, never credentials.
|
|
71
|
-
- **Cross-platform** —
|
|
58
|
+
- **Cross-platform** — one Node installer for macOS, Linux, and Windows.
|
|
72
59
|
|
|
73
60
|
### Extensions
|
|
74
61
|
|
|
@@ -101,12 +88,10 @@ Each extension lives at `agent/extensions/{name}/index.ts` and installs independ
|
|
|
101
88
|
├── README.md # pointer → ../README.md
|
|
102
89
|
├── settings.json # canonical settings (the installer never overwrites yours)
|
|
103
90
|
├── keybindings.json # TUI keybindings
|
|
104
|
-
├── install.sh # macOS/Linux installer
|
|
105
|
-
├── install.ps1 # Windows installer
|
|
106
91
|
└── extensions/ # self-contained pi extensions
|
|
107
92
|
```
|
|
108
93
|
|
|
109
|
-
Tracked paths only: `agent/extensions`, `agent/settings.json`, `agent/keybindings.json`, `agent/AGENTS.md`, `
|
|
94
|
+
Tracked paths only: `agent/extensions`, `agent/settings.json`, `agent/keybindings.json`, `agent/AGENTS.md`, `README.md`. Everything else is local-only.
|
|
110
95
|
|
|
111
96
|
---
|
|
112
97
|
|
|
@@ -157,7 +142,7 @@ The house rules, merged into every session: *think before coding*, *simplicity f
|
|
|
157
142
|
```bash
|
|
158
143
|
git clone https://github.com/asterxsk/kiln.git
|
|
159
144
|
cd kiln
|
|
160
|
-
|
|
145
|
+
node bin/kiln.js --local --target /tmp/pi-test --skip-pi --skip-packages --yes
|
|
161
146
|
ls /tmp/pi-test/extensions
|
|
162
147
|
```
|
|
163
148
|
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# extensions
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
Each subfolder is a self-contained pi extension. Pi auto-loads any `extensions/<name>/index.ts` (or `extensions/<name>/package.json` with a `pi.extensions` field).
|
|
5
|
-
|
|
6
|
-
## Ownership
|
|
7
|
-
- Modular extension system for Pi.
|
|
8
|
-
- Registration, integration, and architecture patterns across all extensions.
|
|
9
|
-
|
|
10
|
-
## Local Contracts
|
|
11
|
-
- **Independence**: Each extension folder is self-contained — no extension imports from a sibling.
|
|
12
|
-
- **Bridges**: Cross-extension integration uses `globalThis` bridges (e.g., `globalThis.__pi_copilot_usage`, `globalThis.__pi_goal_state`). Bridge keys are prefixed with `__pi_` and unique per extension.
|
|
13
|
-
- **NPM dep safety**: Every extension with npm dependencies must guard all top-level requires/imports in a try/catch. Missing deps log a warning, register with `status: "degraded"` or `status: "disabled"`, and return early rather than crashing Pi.
|
|
14
|
-
- **Graceful degradation**: When an extension's peer is missing, it degrades gracefully. Widgets and commands from other extensions continue working.
|
|
15
|
-
- **Self-contained rendering**: Extensions include their own components (e.g., `CompactToolBox`) rather than importing from a shared extension to avoid tight coupling.
|
|
16
|
-
- **UI Primitives**: Extensions use `ctx.ui` methods (`setHeader`, `setFooter`, `setWidget`, `notify`, `custom`, `select`, `input`) independently.
|
|
17
|
-
|
|
18
|
-
## Work Guidance
|
|
19
|
-
- **Adding an extension**:
|
|
20
|
-
1. Create a new folder `extensions/<name>/`
|
|
21
|
-
2. Add an `index.ts` with a default export that receives `pi: ExtensionAPI`
|
|
22
|
-
3. Add an `AGENTS.md` explaining purpose, API surface, and how to remove
|
|
23
|
-
4. Update the Child DOX Index in this file
|
|
24
|
-
- If npm deps are needed, add `"pi": { "extensions": ["./index.ts"] }` to `package.json` and run `npm install`.
|
|
25
|
-
- **All npm imports must be guarded**: wrap `require()` or dynamic `import()` in a try/catch at the top of `index.ts` (or call a lazy init function). If the dep is missing, log a warning, register with `status: "disabled"` (if non-optional) or `status: "degraded"` (if partial functionality), and return early. See `filechanges`, `artifacts`, and `pi-hermes-memory` for reference patterns.
|
|
26
|
-
- **Feature Registration Pattern**: To make the LLM aware of a new extension, add a registration call at the top of its `default export`:
|
|
27
|
-
```ts
|
|
28
|
-
export default function (pi: ExtensionAPI) {
|
|
29
|
-
(globalThis as any).__pi_extension_features?.push({
|
|
30
|
-
name: "my-extension",
|
|
31
|
-
description: "What it does — shown in system prompt",
|
|
32
|
-
commands: ["/cmd1"],
|
|
33
|
-
tools: ["tool1"],
|
|
34
|
-
shortcuts: ["Ctrl+X"],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
- **Removing an extension**: Delete the folder. Tools/commands/shortcuts will disappear automatically, and peers will degrade gracefully.
|
|
39
|
-
|
|
40
|
-
## Verification
|
|
41
|
-
- Extensions should load automatically via `index.ts` or `package.json`.
|
|
42
|
-
- Missing peer extensions should not crash the host extension (verify graceful degradation).
|
|
43
|
-
- New extensions should appear in the system prompt under `## Loaded Extensions` if properly registered.
|
|
44
|
-
|
|
45
|
-
## Child DOX Index
|
|
46
|
-
- `agentzero/` — `/init` command (create or audit AGENTS.md) and global AGENTS.md injection into system prompt
|
|
47
|
-
- `artifacts/` — `create_artifact`, `scaffold_artifact`, `render_artifact`, `list_artifacts`, `delete_artifact`, and `check_artifact` tools + `/artifacts` command: save/browse standalone html/md artifacts, opening html in the default browser (with WSL support) and md in a fullscreen reader (with line numbers, arrow cursor selection, inline commenting, and review submission)
|
|
48
|
-
- `compactui/` — Compact tool rendering, responsive wrapping, assistant time tracking footer, tagged thinking dimming, tool status dot, and auto-hide notifications (3s).
|
|
49
|
-
- `context/` — `/context` overlay: token grid breakdown with per-category color-coded visualization
|
|
50
|
-
- `destructive/` — confirms before running deletion commands (`rm`, `del`, `git rm`, `git clean -f`, …): Allow/Deny prompt, blocks by default with no UI
|
|
51
|
-
- `ferment/` — Structured delivery framework (scope, phases, steps) for long-running agent tasks
|
|
52
|
-
- `9router-provider/` — Local/remote 9router AI gateway provider with auto-discovered models and `/login` integration
|
|
53
|
-
- `filechanges/` — `/filechanges` overlay + accept/decline; tracks file modifications per session and exposes counts for the ui-customization footer
|
|
54
|
-
- `goal/` — `/goal` command — autonomous task orchestrator with pause/resume, turn tracking, history
|
|
55
|
-
- `header/` — Banner header: ASCII art on the left, provider/model/version info panel on the right
|
|
56
|
-
- `instruct/` — Custom system instructions: shell preference, task tracking, no emojis, plan mode guidelines
|
|
57
|
-
- `perms/` — Permissions manager and checklist (`/extensions`), plus plan mode (`/plan`, `plan` tool with strict disabling of `write`/`edit`/`bash` tools)
|
|
58
|
-
- `pi-hermes-memory/` — Persistent memory system with MEMORY.md, SQLite, session search, skill storage, auto-consolidation
|
|
59
|
-
- `powershell/` — `powershell` tool (LLM-callable) with compactui-style rendering
|
|
60
|
-
- `questions/` — `questions` tool (multi-choice TUI with optional custom-answer fallback and ASCII sketches)
|
|
61
|
-
- `spinner/` — Animated star spinner with theme-aware accent color, glow effect, and fun phrases
|
|
62
|
-
- `ui-customization/` — Gradient ASCII header banner + status footer showing provider, model, token I/O, context usage, git branch, worktree, file changes; Alt+C compact shortcut; theme removal
|
|
63
|
-
- `subagents/` — the `subagent`/`subagent_resume`/`subagent_interrupt` tools + `/sub` and `/jobs` commands: spawn isolated pi processes with predefined agent .md files. Runs in the BACKGROUND — returns a job id immediately and pings the agent with a follow-up message when the job finishes. Agents can be `interactive` (pause between phases, resumable) and use `session: fork|lineage` to inherit or trace parent context
|
|
64
|
-
- `tasks/` — `/manage_task` command — background terminal task runner with output capture, wait, cancel; persists across sessions
|
|
65
|
-
- `timers/` — `/schedule` command — one-shot and repeating timers with notifications, auto-delete on fire, and overlay browser
|
|
66
|
-
- `todo/` — `todo` tool + `/todos` command — structured task list with status tracking, categories, reminders, and persistent overlay widget
|
|
67
|
-
- `video-extract/` — `video_extract` tool: YouTube + local video content extraction via Gemini API, ffmpeg, and yt-dlp
|
|
68
|
-
|
|
1
|
+
# extensions
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Each subfolder is a self-contained pi extension. Pi auto-loads any `extensions/<name>/index.ts` (or `extensions/<name>/package.json` with a `pi.extensions` field).
|
|
5
|
+
|
|
6
|
+
## Ownership
|
|
7
|
+
- Modular extension system for Pi.
|
|
8
|
+
- Registration, integration, and architecture patterns across all extensions.
|
|
9
|
+
|
|
10
|
+
## Local Contracts
|
|
11
|
+
- **Independence**: Each extension folder is self-contained — no extension imports from a sibling.
|
|
12
|
+
- **Bridges**: Cross-extension integration uses `globalThis` bridges (e.g., `globalThis.__pi_copilot_usage`, `globalThis.__pi_goal_state`). Bridge keys are prefixed with `__pi_` and unique per extension.
|
|
13
|
+
- **NPM dep safety**: Every extension with npm dependencies must guard all top-level requires/imports in a try/catch. Missing deps log a warning, register with `status: "degraded"` or `status: "disabled"`, and return early rather than crashing Pi.
|
|
14
|
+
- **Graceful degradation**: When an extension's peer is missing, it degrades gracefully. Widgets and commands from other extensions continue working.
|
|
15
|
+
- **Self-contained rendering**: Extensions include their own components (e.g., `CompactToolBox`) rather than importing from a shared extension to avoid tight coupling.
|
|
16
|
+
- **UI Primitives**: Extensions use `ctx.ui` methods (`setHeader`, `setFooter`, `setWidget`, `notify`, `custom`, `select`, `input`) independently.
|
|
17
|
+
|
|
18
|
+
## Work Guidance
|
|
19
|
+
- **Adding an extension**:
|
|
20
|
+
1. Create a new folder `extensions/<name>/`
|
|
21
|
+
2. Add an `index.ts` with a default export that receives `pi: ExtensionAPI`
|
|
22
|
+
3. Add an `AGENTS.md` explaining purpose, API surface, and how to remove
|
|
23
|
+
4. Update the Child DOX Index in this file
|
|
24
|
+
- If npm deps are needed, add `"pi": { "extensions": ["./index.ts"] }` to `package.json` and run `npm install`.
|
|
25
|
+
- **All npm imports must be guarded**: wrap `require()` or dynamic `import()` in a try/catch at the top of `index.ts` (or call a lazy init function). If the dep is missing, log a warning, register with `status: "disabled"` (if non-optional) or `status: "degraded"` (if partial functionality), and return early. See `filechanges`, `artifacts`, and `pi-hermes-memory` for reference patterns.
|
|
26
|
+
- **Feature Registration Pattern**: To make the LLM aware of a new extension, add a registration call at the top of its `default export`:
|
|
27
|
+
```ts
|
|
28
|
+
export default function (pi: ExtensionAPI) {
|
|
29
|
+
(globalThis as any).__pi_extension_features?.push({
|
|
30
|
+
name: "my-extension",
|
|
31
|
+
description: "What it does — shown in system prompt",
|
|
32
|
+
commands: ["/cmd1"],
|
|
33
|
+
tools: ["tool1"],
|
|
34
|
+
shortcuts: ["Ctrl+X"],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
- **Removing an extension**: Delete the folder. Tools/commands/shortcuts will disappear automatically, and peers will degrade gracefully.
|
|
39
|
+
|
|
40
|
+
## Verification
|
|
41
|
+
- Extensions should load automatically via `index.ts` or `package.json`.
|
|
42
|
+
- Missing peer extensions should not crash the host extension (verify graceful degradation).
|
|
43
|
+
- New extensions should appear in the system prompt under `## Loaded Extensions` if properly registered.
|
|
44
|
+
|
|
45
|
+
## Child DOX Index
|
|
46
|
+
- `agentzero/` — `/init` command (create or audit AGENTS.md) and global AGENTS.md injection into system prompt
|
|
47
|
+
- `artifacts/` — `create_artifact`, `scaffold_artifact`, `render_artifact`, `list_artifacts`, `delete_artifact`, and `check_artifact` tools + `/artifacts` command: save/browse standalone html/md artifacts, opening html in the default browser (with WSL support) and md in a fullscreen reader (with line numbers, arrow cursor selection, inline commenting, and review submission)
|
|
48
|
+
- `compactui/` — Compact tool rendering, responsive wrapping, assistant time tracking footer, tagged thinking dimming, tool status dot, and auto-hide notifications (3s).
|
|
49
|
+
- `context/` — `/context` overlay: token grid breakdown with per-category color-coded visualization
|
|
50
|
+
- `destructive/` — confirms before running deletion commands (`rm`, `del`, `git rm`, `git clean -f`, …): Allow/Deny prompt, blocks by default with no UI
|
|
51
|
+
- `ferment/` — Structured delivery framework (scope, phases, steps) for long-running agent tasks
|
|
52
|
+
- `9router-provider/` — Local/remote 9router AI gateway provider with auto-discovered models and `/login` integration
|
|
53
|
+
- `filechanges/` — `/filechanges` overlay + accept/decline; tracks file modifications per session and exposes counts for the ui-customization footer
|
|
54
|
+
- `goal/` — `/goal` command — autonomous task orchestrator with pause/resume, turn tracking, history
|
|
55
|
+
- `header/` — Banner header: ASCII art on the left, provider/model/version info panel on the right
|
|
56
|
+
- `instruct/` — Custom system instructions: shell preference, task tracking, no emojis, plan mode guidelines
|
|
57
|
+
- `perms/` — Permissions manager and checklist (`/extensions`), plus plan mode (`/plan`, `plan` tool with strict disabling of `write`/`edit`/`bash` tools)
|
|
58
|
+
- `pi-hermes-memory/` — Persistent memory system with MEMORY.md, SQLite, session search, skill storage, auto-consolidation
|
|
59
|
+
- `powershell/` — `powershell` tool (LLM-callable) with compactui-style rendering
|
|
60
|
+
- `questions/` — `questions` tool (multi-choice TUI with optional custom-answer fallback and ASCII sketches)
|
|
61
|
+
- `spinner/` — Animated star spinner with theme-aware accent color, glow effect, and fun phrases
|
|
62
|
+
- `ui-customization/` — Gradient ASCII header banner + status footer showing provider, model, token I/O, context usage, git branch, worktree, file changes; Alt+C compact shortcut; theme removal
|
|
63
|
+
- `subagents/` — the `subagent`/`subagent_resume`/`subagent_interrupt` tools + `/sub` and `/jobs` commands: spawn isolated pi processes with predefined agent .md files. Runs in the BACKGROUND — returns a job id immediately and pings the agent with a follow-up message when the job finishes. Agents can be `interactive` (pause between phases, resumable) and use `session: fork|lineage` to inherit or trace parent context
|
|
64
|
+
- `tasks/` — `/manage_task` command — background terminal task runner with output capture, wait, cancel; persists across sessions
|
|
65
|
+
- `timers/` — `/schedule` command — one-shot and repeating timers with notifications, auto-delete on fire, and overlay browser
|
|
66
|
+
- `todo/` — `todo` tool + `/todos` command — structured task list with status tracking, categories, reminders, and persistent overlay widget
|
|
67
|
+
- `video-extract/` — `video_extract` tool: YouTube + local video content extraction via Gemini API, ffmpeg, and yt-dlp
|
|
68
|
+
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Per-extension installer — Windows / PowerShell
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
9
|
$extDir = $PSScriptRoot
|
|
6
10
|
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
11
|
if (-not (Test-Path "$extDir/package.json")) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Per-extension installer — macOS / Linux
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
8
|
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
9
|
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
10
|
echo " · no package.json — skipping"
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Per-extension installer — Windows / PowerShell
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
9
|
$extDir = $PSScriptRoot
|
|
6
10
|
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
11
|
if (-not (Test-Path "$extDir/package.json")) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Per-extension installer — macOS / Linux
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
8
|
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
9
|
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
10
|
echo " · no package.json — skipping"
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Per-extension installer — Windows / PowerShell
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
9
|
$extDir = $PSScriptRoot
|
|
6
10
|
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
11
|
if (-not (Test-Path "$extDir/package.json")) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Per-extension installer — macOS / Linux
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
8
|
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
9
|
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
10
|
echo " · no package.json — skipping"
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Per-extension installer — Windows / PowerShell
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
9
|
$extDir = $PSScriptRoot
|
|
6
10
|
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
11
|
if (-not (Test-Path "$extDir/package.json")) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Per-extension installer — macOS / Linux
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
8
|
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
9
|
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
10
|
echo " · no package.json — skipping"
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Per-extension installer — Windows / PowerShell
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
9
|
$extDir = $PSScriptRoot
|
|
6
10
|
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
11
|
if (-not (Test-Path "$extDir/package.json")) {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Per-extension installer — macOS / Linux
|
|
3
3
|
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
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
|
|
5
8
|
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
9
|
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
10
|
echo " · no package.json — skipping"
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// installed by herdr
|
|
2
|
+
// managed by herdr; reinstalling or updating the integration overwrites this file.
|
|
3
|
+
// add custom hooks/plugins beside this file instead of editing it.
|
|
4
|
+
// HERDR_INTEGRATION_ID=pi
|
|
5
|
+
// HERDR_INTEGRATION_VERSION=8
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
8
|
+
import net from "node:net";
|
|
9
|
+
|
|
10
|
+
const HERDR_ENV = process.env.HERDR_ENV;
|
|
11
|
+
const socketPath = process.env.HERDR_SOCKET_PATH;
|
|
12
|
+
const socketEndpoint =
|
|
13
|
+
process.platform === "win32" && socketPath ? `\\\\.\\pipe\\${socketPath}` : socketPath;
|
|
14
|
+
const paneId = process.env.HERDR_PANE_ID;
|
|
15
|
+
const source = "herdr:pi";
|
|
16
|
+
|
|
17
|
+
function enabled() {
|
|
18
|
+
return HERDR_ENV === "1" && !!socketPath && !!paneId;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function sendRequestAttempt(request: unknown, timeoutMs: number): Promise<boolean> {
|
|
22
|
+
if (!enabled()) {
|
|
23
|
+
return Promise.resolve(true);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
let done = false;
|
|
28
|
+
let timeout: ReturnType<typeof setTimeout> | undefined;
|
|
29
|
+
const finish = (delivered: boolean) => {
|
|
30
|
+
if (done) return;
|
|
31
|
+
done = true;
|
|
32
|
+
if (timeout) {
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
}
|
|
35
|
+
socket.destroy();
|
|
36
|
+
resolve(delivered);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const socket = net.createConnection(socketEndpoint!);
|
|
40
|
+
socket.on("error", () => finish(false));
|
|
41
|
+
socket.on("connect", () => socket.write(`${JSON.stringify(request)}\n`));
|
|
42
|
+
socket.on("data", () => finish(true));
|
|
43
|
+
socket.on("end", () => finish(false));
|
|
44
|
+
timeout = setTimeout(() => finish(false), timeoutMs);
|
|
45
|
+
timeout.unref?.();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function sendRequest(request: unknown): Promise<void> {
|
|
50
|
+
if (await sendRequestAttempt(request, 500)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await sendRequestAttempt(request, 1500);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type AgentState = "working" | "blocked" | "idle";
|
|
57
|
+
|
|
58
|
+
type QueuedState = {
|
|
59
|
+
state: AgentState;
|
|
60
|
+
message?: string;
|
|
61
|
+
seq: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
let reportSeq = Date.now() * 1000;
|
|
65
|
+
let currentAgentSessionId: string | undefined;
|
|
66
|
+
let currentAgentSessionPath: string | undefined;
|
|
67
|
+
|
|
68
|
+
function nextReportSeq(): number {
|
|
69
|
+
reportSeq += 1;
|
|
70
|
+
return reportSeq;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function updateSessionRef(ctx: any): void {
|
|
74
|
+
try {
|
|
75
|
+
const file = ctx?.sessionManager?.getSessionFile?.();
|
|
76
|
+
currentAgentSessionPath =
|
|
77
|
+
typeof file === "string" && file.startsWith("/") ? file : undefined;
|
|
78
|
+
} catch {
|
|
79
|
+
currentAgentSessionPath = undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const id = ctx?.sessionManager?.getSessionId?.();
|
|
84
|
+
currentAgentSessionId = typeof id === "string" && id.length > 0 ? id : undefined;
|
|
85
|
+
} catch {
|
|
86
|
+
currentAgentSessionId = undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function withSessionRef(params: Record<string, unknown>): Record<string, unknown> {
|
|
91
|
+
if (currentAgentSessionPath) {
|
|
92
|
+
return { ...params, agent_session_path: currentAgentSessionPath };
|
|
93
|
+
}
|
|
94
|
+
if (currentAgentSessionId) {
|
|
95
|
+
return { ...params, agent_session_id: currentAgentSessionId };
|
|
96
|
+
}
|
|
97
|
+
return params;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function currentSessionRef(): Record<string, unknown> | undefined {
|
|
101
|
+
if (currentAgentSessionPath) {
|
|
102
|
+
return { agent_session_path: currentAgentSessionPath };
|
|
103
|
+
}
|
|
104
|
+
if (currentAgentSessionId) {
|
|
105
|
+
return { agent_session_id: currentAgentSessionId };
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function reportSession(sessionStartSource?: string): Promise<void> {
|
|
111
|
+
const sessionRef = currentSessionRef();
|
|
112
|
+
if (!sessionRef) {
|
|
113
|
+
return Promise.resolve();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return sendRequest({
|
|
117
|
+
id: `${source}:session:${Date.now()}:${Math.random().toString(36).slice(2)}`,
|
|
118
|
+
method: "pane.report_agent_session",
|
|
119
|
+
params: {
|
|
120
|
+
pane_id: paneId,
|
|
121
|
+
source,
|
|
122
|
+
agent: "pi",
|
|
123
|
+
seq: nextReportSeq(),
|
|
124
|
+
session_start_source: sessionStartSource,
|
|
125
|
+
...sessionRef,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function sendState(state: AgentState, message?: string, seq = nextReportSeq()): Promise<void> {
|
|
131
|
+
return sendRequest({
|
|
132
|
+
id: `${source}:${Date.now()}:${Math.random().toString(36).slice(2)}`,
|
|
133
|
+
method: "pane.report_agent",
|
|
134
|
+
params: withSessionRef({
|
|
135
|
+
pane_id: paneId,
|
|
136
|
+
source,
|
|
137
|
+
agent: "pi",
|
|
138
|
+
state,
|
|
139
|
+
message,
|
|
140
|
+
seq,
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let sendInFlight = false;
|
|
146
|
+
let queuedState: QueuedState | undefined;
|
|
147
|
+
|
|
148
|
+
function queueState(state: AgentState, message?: string): void {
|
|
149
|
+
queuedState = { state, message, seq: nextReportSeq() };
|
|
150
|
+
if (!sendInFlight) {
|
|
151
|
+
void drainStateQueue();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function drainStateQueue(): Promise<void> {
|
|
156
|
+
if (sendInFlight) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
sendInFlight = true;
|
|
161
|
+
try {
|
|
162
|
+
while (queuedState) {
|
|
163
|
+
const next = queuedState;
|
|
164
|
+
queuedState = undefined;
|
|
165
|
+
await sendState(next.state, next.message, next.seq);
|
|
166
|
+
}
|
|
167
|
+
} finally {
|
|
168
|
+
sendInFlight = false;
|
|
169
|
+
if (queuedState) {
|
|
170
|
+
void drainStateQueue();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export default function (pi) {
|
|
176
|
+
if (!enabled()) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let agentActive = false;
|
|
181
|
+
let blockedCount = 0;
|
|
182
|
+
let blockedMessage: string | undefined;
|
|
183
|
+
let lastState: AgentState | undefined;
|
|
184
|
+
let lastMessage: string | undefined;
|
|
185
|
+
let rootSession = false;
|
|
186
|
+
|
|
187
|
+
function desiredState() {
|
|
188
|
+
if (blockedCount > 0) {
|
|
189
|
+
return { state: "blocked" as const, message: blockedMessage };
|
|
190
|
+
}
|
|
191
|
+
if (agentActive) {
|
|
192
|
+
return { state: "working" as const, message: undefined };
|
|
193
|
+
}
|
|
194
|
+
return { state: "idle" as const, message: undefined };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function publishState(force = false) {
|
|
198
|
+
const next = desiredState();
|
|
199
|
+
if (!force && next.state === lastState && next.message === lastMessage) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
lastState = next.state;
|
|
203
|
+
lastMessage = next.message;
|
|
204
|
+
queueState(next.state, next.message);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
pi.events.on("herdr:blocked", (data) => {
|
|
208
|
+
if (!rootSession) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!data?.active) {
|
|
212
|
+
blockedCount = Math.max(0, blockedCount - 1);
|
|
213
|
+
if (blockedCount === 0) {
|
|
214
|
+
blockedMessage = undefined;
|
|
215
|
+
}
|
|
216
|
+
publishState();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
blockedCount += 1;
|
|
221
|
+
blockedMessage = data.label;
|
|
222
|
+
publishState();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
pi.on("session_start", async (event, ctx) => {
|
|
226
|
+
// TUI only: RPC/JSON/print modes are headless (no PTY herdr can display),
|
|
227
|
+
// and RPC still reports hasUI=true, so mode is the reliable gate.
|
|
228
|
+
if (ctx?.mode !== "tui") {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
rootSession = true;
|
|
232
|
+
updateSessionRef(ctx);
|
|
233
|
+
await reportSession(event?.reason);
|
|
234
|
+
// A reload can replace this extension mid-run without emitting another agent_start.
|
|
235
|
+
agentActive = ctx?.isIdle?.() === false;
|
|
236
|
+
publishState(true);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
pi.on("agent_start", (_event, ctx) => {
|
|
240
|
+
if (!rootSession) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
updateSessionRef(ctx);
|
|
244
|
+
void reportSession();
|
|
245
|
+
agentActive = true;
|
|
246
|
+
publishState();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
pi.on("agent_settled", (_event, ctx) => {
|
|
250
|
+
if (!rootSession || ctx?.isIdle?.() !== true) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
agentActive = false;
|
|
255
|
+
publishState();
|
|
256
|
+
});
|
|
257
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# kiln-update
|
|
2
|
+
|
|
3
|
+
Nudges you when your installed kiln is behind GitHub.
|
|
4
|
+
|
|
5
|
+
- On every session start it compares `~/.pi/agent/version.txt` with
|
|
6
|
+
`agent/version.txt` on the `main` branch.
|
|
7
|
+
- On mismatch: `Kiln update available (X → Y) — to update kiln to the
|
|
8
|
+
newest version, run: kiln`
|
|
9
|
+
- Silent when up to date, offline, or timed out (5s).
|
|
10
|
+
|
|
11
|
+
## Manual check
|
|
12
|
+
|
|
13
|
+
`/kiln-update` — re-check on demand.
|
|
14
|
+
|
|
15
|
+
## Releasing a new version
|
|
16
|
+
|
|
17
|
+
1. Make your changes.
|
|
18
|
+
2. Bump `agent/version.txt` (e.g. `0.2.0` → `0.3.0`).
|
|
19
|
+
3. Push to GitHub. No `npm publish` needed — `kiln` installs from git,
|
|
20
|
+
and every user gets the nudge on their next session.
|
|
21
|
+
|
|
22
|
+
## Opt out
|
|
23
|
+
|
|
24
|
+
`KILN_NO_UPDATE_CHECK=1`. Forks can point elsewhere with
|
|
25
|
+
`KILN_VERSION_URL=https://.../version.txt`.
|