@howarewoo/pi-subagents 0.0.0-stage → 0.1.1
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/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +328 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/docs/advanced-policies.md +76 -0
- package/docs/delegation-contract.md +268 -0
- package/docs/images/subagent-hub.svg +1 -0
- package/docs/images/subagent-profiles.svg +1 -0
- package/docs/images/subagent-widget.svg +1 -0
- package/docs/parity-inventory.md +330 -0
- package/docs/provenance.md +13 -0
- package/docs/releases.md +148 -0
- package/docs/verification.md +430 -0
- package/package.json +64 -4
- package/src/capabilities.ts +39 -0
- package/src/coordinator.ts +1432 -0
- package/src/hub.ts +841 -0
- package/src/model-adapter.ts +77 -0
- package/src/model-policy.ts +100 -0
- package/src/outcomes.ts +110 -0
- package/src/pi-extended-subagents.ts +779 -0
- package/src/profile-viewer.ts +175 -0
- package/src/profiles.ts +225 -0
- package/src/scheduling.ts +73 -0
- package/src/task-input.ts +73 -0
- package/src/thread.ts +268 -0
- package/src/workspace.ts +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howarewoo/pi-subagents",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Pi-native single-assignment delegation with explicit profiles and parent-owned SDK children",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/howarewoo/pi-extended-subagents#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/howarewoo/pi-extended-subagents/issues"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/howarewoo/pi-extended-subagents.git"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"docs",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"THIRD_PARTY_NOTICES.md"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "node --test test/*.test.ts",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"lint": "oxlint --deny-warnings .",
|
|
33
|
+
"lint:fix": "npm run lint -- --fix",
|
|
34
|
+
"format": "oxfmt --write .",
|
|
35
|
+
"format:check": "oxfmt --check .",
|
|
36
|
+
"exercise": "node examples/sdk-exercise.ts",
|
|
37
|
+
"check": "npm run lint && npm run format:check && npm run typecheck && npm test && npm run exercise",
|
|
38
|
+
"test:package": "node scripts/test-package.mjs",
|
|
39
|
+
"release:check": "node scripts/release-notes.mjs"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@earendil-works/pi-schema": "1.5.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@earendil-works/pi-ai": "1.5.2",
|
|
46
|
+
"@earendil-works/pi-coding-agent": "1.5.2",
|
|
47
|
+
"@earendil-works/pi-tui": "1.5.2",
|
|
48
|
+
"@types/node": "26.6.6",
|
|
49
|
+
"oxfmt": "0.78.0",
|
|
50
|
+
"oxlint": "1.93.0",
|
|
51
|
+
"typescript": "7.0.2"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@earendil-works/pi-ai": "*",
|
|
55
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
56
|
+
"@earendil-works/pi-tui": "*"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=22.19.0"
|
|
60
|
+
},
|
|
61
|
+
"pi": {
|
|
62
|
+
"extensions": [
|
|
63
|
+
"./src/pi-extended-subagents.ts"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { WRITE_TOOLS } from "./profiles.ts";
|
|
3
|
+
|
|
4
|
+
export type ToolMetadata = ReturnType<ExtensionAPI["getAllTools"]>[number];
|
|
5
|
+
export type CapabilityDenial = { name: string; reason: string };
|
|
6
|
+
|
|
7
|
+
/** These controls belong to the child coordinator, never to the root dispatcher. */
|
|
8
|
+
const CONTROLS = new Set([
|
|
9
|
+
"delegate_task",
|
|
10
|
+
"delegate_coordinate",
|
|
11
|
+
"subagent",
|
|
12
|
+
"submit_result",
|
|
13
|
+
"codemode",
|
|
14
|
+
"tool_search",
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
/** A leaf grant is an operator assertion about trusted code, not a JavaScript sandbox.
|
|
18
|
+
* Undeclared orchestration is outside that contract; annotations never authorize forwarding.
|
|
19
|
+
*/
|
|
20
|
+
export function leafDenial(
|
|
21
|
+
tool: ToolMetadata,
|
|
22
|
+
grants: readonly string[],
|
|
23
|
+
sameWorkspace: boolean,
|
|
24
|
+
): string | undefined {
|
|
25
|
+
if (CONTROLS.has(tool.name)) return "owned or orchestrating control cannot be forwarded";
|
|
26
|
+
if (tool.reachesTools) return "tool-to-tool forwarding has no child execution scope";
|
|
27
|
+
if (tool.exposure === "hidden" || tool.exposure === "model-only") return "tool is not callable";
|
|
28
|
+
if (tool.sourceInfo.path.startsWith("builtin:")) return "builtin is outside the profile ceiling";
|
|
29
|
+
if (WRITE_TOOLS.includes(tool.name as (typeof WRITE_TOOLS)[number]))
|
|
30
|
+
return "builtin replacements cannot be leaf grants";
|
|
31
|
+
if (!grants.includes(tool.name))
|
|
32
|
+
return "no operator-reviewed leaf grant (unknown execution capabilities)";
|
|
33
|
+
if (!sameWorkspace) return "custom tool execution cwd cannot be rebound to the child workspace";
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function toolProvenance(tool: ToolMetadata): string {
|
|
38
|
+
return JSON.stringify([tool.sourceInfo, tool.exposure, tool.namespace]);
|
|
39
|
+
}
|