@gotgenes/pi-subagents 1.0.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/.markdownlint-cli2.yaml +19 -0
- package/.prettierignore +5 -0
- package/.release-please-manifest.json +3 -0
- package/AGENTS.md +85 -0
- package/CHANGELOG.md +495 -0
- package/LICENSE +21 -0
- package/README.md +528 -0
- package/dist/agent-manager.d.ts +108 -0
- package/dist/agent-manager.js +390 -0
- package/dist/agent-runner.d.ts +93 -0
- package/dist/agent-runner.js +428 -0
- package/dist/agent-types.d.ts +48 -0
- package/dist/agent-types.js +136 -0
- package/dist/context.d.ts +12 -0
- package/dist/context.js +56 -0
- package/dist/cross-extension-rpc.d.ts +46 -0
- package/dist/cross-extension-rpc.js +54 -0
- package/dist/custom-agents.d.ts +14 -0
- package/dist/custom-agents.js +127 -0
- package/dist/default-agents.d.ts +7 -0
- package/dist/default-agents.js +119 -0
- package/dist/env.d.ts +6 -0
- package/dist/env.js +28 -0
- package/dist/group-join.d.ts +32 -0
- package/dist/group-join.js +116 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1731 -0
- package/dist/invocation-config.d.ts +22 -0
- package/dist/invocation-config.js +15 -0
- package/dist/memory.d.ts +49 -0
- package/dist/memory.js +151 -0
- package/dist/model-resolver.d.ts +19 -0
- package/dist/model-resolver.js +62 -0
- package/dist/output-file.d.ts +24 -0
- package/dist/output-file.js +86 -0
- package/dist/prompts.d.ts +29 -0
- package/dist/prompts.js +72 -0
- package/dist/schedule-store.d.ts +36 -0
- package/dist/schedule-store.js +144 -0
- package/dist/schedule.d.ts +109 -0
- package/dist/schedule.js +338 -0
- package/dist/settings.d.ts +66 -0
- package/dist/settings.js +130 -0
- package/dist/skill-loader.d.ts +24 -0
- package/dist/skill-loader.js +93 -0
- package/dist/types.d.ts +164 -0
- package/dist/types.js +5 -0
- package/dist/ui/agent-widget.d.ts +134 -0
- package/dist/ui/agent-widget.js +451 -0
- package/dist/ui/conversation-viewer.d.ts +35 -0
- package/dist/ui/conversation-viewer.js +252 -0
- package/dist/ui/schedule-menu.d.ts +16 -0
- package/dist/ui/schedule-menu.js +95 -0
- package/dist/usage.d.ts +50 -0
- package/dist/usage.js +49 -0
- package/dist/worktree.d.ts +36 -0
- package/dist/worktree.js +139 -0
- package/docs/decisions/0001-deferred-patches.md +75 -0
- package/package.json +68 -0
- package/prek.toml +24 -0
- package/release-please-config.json +22 -0
- package/src/agent-manager.ts +482 -0
- package/src/agent-runner.ts +625 -0
- package/src/agent-types.ts +164 -0
- package/src/context.ts +58 -0
- package/src/cross-extension-rpc.ts +95 -0
- package/src/custom-agents.ts +136 -0
- package/src/default-agents.ts +123 -0
- package/src/env.ts +33 -0
- package/src/group-join.ts +141 -0
- package/src/index.ts +1894 -0
- package/src/invocation-config.ts +40 -0
- package/src/memory.ts +165 -0
- package/src/model-resolver.ts +81 -0
- package/src/output-file.ts +96 -0
- package/src/prompts.ts +105 -0
- package/src/schedule-store.ts +143 -0
- package/src/schedule.ts +365 -0
- package/src/settings.ts +186 -0
- package/src/skill-loader.ts +102 -0
- package/src/types.ts +176 -0
- package/src/ui/agent-widget.ts +533 -0
- package/src/ui/conversation-viewer.ts +261 -0
- package/src/ui/schedule-menu.ts +104 -0
- package/src/usage.ts +60 -0
- package/src/worktree.ts +162 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# CHANGELOG.md is machine-generated by release-please. Its double blank lines
|
|
2
|
+
# between sections are intentional; exclude it from linting entirely.
|
|
3
|
+
#
|
|
4
|
+
# README.md is largely the upstream tintinweb/pi-subagents README — we
|
|
5
|
+
# preserve the original copy as-is and add a "Fork notice" block at the top
|
|
6
|
+
# rather than reformatting the entire document.
|
|
7
|
+
ignores:
|
|
8
|
+
- "CHANGELOG.md"
|
|
9
|
+
- "README.md"
|
|
10
|
+
|
|
11
|
+
config:
|
|
12
|
+
line-length: false
|
|
13
|
+
no-duplicate-heading:
|
|
14
|
+
siblings_only: true
|
|
15
|
+
no-inline-html:
|
|
16
|
+
allowed_elements:
|
|
17
|
+
- p
|
|
18
|
+
- img
|
|
19
|
+
first-line-heading: false
|
package/.prettierignore
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# This fork does not use Prettier — formatting is handled by Biome
|
|
2
|
+
# (see biome.json and the sibling Pi-package conventions). Ignore all
|
|
3
|
+
# files to prevent Prettier from being run accidentally (e.g. by an
|
|
4
|
+
# agent harness with project-level write-time Prettier formatting).
|
|
5
|
+
*
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Project Purpose
|
|
4
|
+
|
|
5
|
+
This repository is a Pi extension that adds Claude Code-style autonomous subagent dispatch to the Pi coding agent.
|
|
6
|
+
|
|
7
|
+
This package is a friendly fork of [`tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents).
|
|
8
|
+
It carries a small number of patches needed for downstream consumers (notably [RepOne](https://github.com/Tiny-IG-Software/repone)) that intend to use it as a normal Pi extension dependency:
|
|
9
|
+
|
|
10
|
+
1. **Peer-dep rename** — peer dependencies point at `@earendil-works/pi-*` (the active scope) rather than the deprecated `@mariozechner/pi-*` scope.
|
|
11
|
+
2. **Patch 2 (post-bind active-tool re-filter)** — `runAgent` re-runs the active-tool filter after `session.bindExtensions(...)` so extension-registered tools land in the child's active tool set. Without this, the `extensions: string[]` allowlist branch is functionally dead for extension tools.
|
|
12
|
+
3. **Patch 3 (active_agent tag)** — `runAgent` prepends `<active_agent name="${agentConfig.name}"/>` to every assembled child system prompt so `@gotgenes/pi-permission-system` can resolve per-agent `permission:` frontmatter inside the child.
|
|
13
|
+
|
|
14
|
+
See `docs/decisions/0001-deferred-patches.md` for a fourth patch (mirror parent resource paths) that was scoped out, and the rationale for not opening upstream PRs yet.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
- Keep scope tight — this fork stays as close to upstream as possible.
|
|
19
|
+
- Prefer small, reversible changes.
|
|
20
|
+
- Preserve upstream behavior unless there is a clear reason to diverge.
|
|
21
|
+
- When in doubt about whether a change should land here or be proposed upstream, prefer upstream.
|
|
22
|
+
|
|
23
|
+
## Implementation Priorities
|
|
24
|
+
|
|
25
|
+
- Maintain compatibility with upstream's public API.
|
|
26
|
+
- Keep the patch set minimal and clearly identified in the code (search for `Patch 2 (RepOne` / `Patch 3 (RepOne` comments).
|
|
27
|
+
- Mirror sibling Pi-package conventions for tooling (pnpm, biome, vitest, prek, markdownlint-cli2, release-please).
|
|
28
|
+
- Track the upstream `tintinweb/pi-subagents` repository for fixes and incorporate them as merges or cherry-picks.
|
|
29
|
+
|
|
30
|
+
## Code Style
|
|
31
|
+
|
|
32
|
+
Use TypeScript. This project uses **pnpm** exclusively — never `npm` or `npx`.
|
|
33
|
+
|
|
34
|
+
Formatting is handled by Biome (`biome check`, `biome format`). The repo intentionally does not use Prettier — a top-level `.prettierignore` blocks any harness with project-level write-time Prettier formatting from reformatting files here.
|
|
35
|
+
|
|
36
|
+
## Build, Test, Lint Commands
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm install # Install dependencies + run prek install
|
|
40
|
+
pnpm run build # tsc
|
|
41
|
+
pnpm run typecheck # tsc --noEmit
|
|
42
|
+
pnpm run lint # biome check src/ test/
|
|
43
|
+
pnpm run lint:fix # biome check --fix src/ test/
|
|
44
|
+
pnpm run lint:md # markdownlint-cli2 '*.md' 'docs/**/*.md'
|
|
45
|
+
pnpm run lint:md:fix # markdownlint-cli2 --fix '*.md' 'docs/**/*.md'
|
|
46
|
+
pnpm run lint:all # lint + lint:md
|
|
47
|
+
pnpm run format # biome format --write src/ test/
|
|
48
|
+
pnpm test # vitest run
|
|
49
|
+
pnpm run test:watch # vitest
|
|
50
|
+
pnpm run check # build + lint:all + test (full local CI)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Markdown
|
|
54
|
+
|
|
55
|
+
This project uses `markdownlint-cli2` with the config in `.markdownlint-cli2.yaml`.
|
|
56
|
+
The `CHANGELOG.md` file is machine-generated by release-please and is excluded from linting.
|
|
57
|
+
|
|
58
|
+
## Testing
|
|
59
|
+
|
|
60
|
+
The fork preserves upstream's full `vitest` suite (362 tests) plus tests added for Patches 2 and 3.
|
|
61
|
+
All tests must pass before publishing.
|
|
62
|
+
Use `vi.hoisted(...)` for module-level mocks, matching the existing patterns in `test/agent-runner.test.ts`.
|
|
63
|
+
|
|
64
|
+
## Releases
|
|
65
|
+
|
|
66
|
+
This repo uses [release-please](https://github.com/googleapis/release-please) and npm trusted publishing via OIDC.
|
|
67
|
+
|
|
68
|
+
- Conventional Commits drive the version bump (`feat:` → minor, `fix:` → patch, `BREAKING CHANGE:` → major).
|
|
69
|
+
- Pushing to `main` triggers `release-please-action` which opens a release PR.
|
|
70
|
+
- Merging the release PR creates a tag and triggers the publish job (no `NPM_TOKEN` — trusted publishing via OIDC).
|
|
71
|
+
|
|
72
|
+
## Commits
|
|
73
|
+
|
|
74
|
+
Use Conventional Commits.
|
|
75
|
+
Commit at meaningful checkpoints without waiting for an explicit reminder.
|
|
76
|
+
Prefer small, reviewable commits that leave the repository in a valid state.
|
|
77
|
+
|
|
78
|
+
## Notes for Agents
|
|
79
|
+
|
|
80
|
+
When working in this repo:
|
|
81
|
+
|
|
82
|
+
1. The two RepOne-specific patches are clearly marked in source — search for `// Patch 2 (RepOne` or `// Patch 3 (RepOne` to find them.
|
|
83
|
+
2. Do not introduce a third or fourth patch without first documenting the rationale in `docs/decisions/`.
|
|
84
|
+
3. Upstream PRs to `tintinweb/pi-subagents` for Patches 2 and 3 are deferred pending production validation in RepOne — see `docs/decisions/0001-deferred-patches.md`.
|
|
85
|
+
4. When syncing with upstream (rare), reapply the peer-dep rename and the two patches; the upstream `vitest` suite is the canary that nothing regressed.
|