@nredd/pi-subagents 0.22.0-nredd.7 → 0.22.0-nredd.9
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 +245 -77
- package/package.json +16 -13
- package/src/abortable.ts +1 -1
- package/src/agent-file-toggle.ts +6 -5
- package/src/agent-manager.ts +489 -129
- package/src/agent-runner.ts +244 -93
- package/src/child-context.ts +19 -1
- package/src/completion-outbox.ts +22 -3
- package/src/cross-extension-rpc.ts +21 -42
- package/src/custom-agents.ts +11 -6
- package/src/default-agents.ts +21 -21
- package/src/detached-results.ts +18 -2
- package/src/enabled-models.ts +8 -7
- package/src/enterprise-local.ts +7 -6
- package/src/error-message.ts +11 -0
- package/src/git-path.ts +66 -0
- package/src/group-join.ts +4 -10
- package/src/home-paths.ts +27 -0
- package/src/index.ts +898 -297
- package/src/invocation-config.ts +4 -21
- package/src/memory.ts +9 -9
- package/src/mention-clone.ts +13 -8
- package/src/model-resolver.ts +92 -25
- package/src/model-scope.ts +2 -1
- package/src/model-selection.ts +170 -0
- package/src/model-tiers.ts +176 -0
- package/src/nested-tools.ts +99 -44
- package/src/notification-result.ts +118 -0
- package/src/output-file.ts +23 -1
- package/src/package-resources.ts +25 -10
- package/src/plan-mode-children.ts +176 -0
- package/src/process-budget.ts +6 -3
- package/src/prompts.ts +7 -2
- package/src/quota-admission.ts +35 -13
- package/src/resource-loader.ts +65 -0
- package/src/schedule.ts +94 -30
- package/src/settings.ts +63 -13
- package/src/skill-loader.ts +244 -93
- package/src/stale-ctx.ts +16 -0
- package/src/status-note.ts +28 -5
- package/src/types.ts +79 -2
- package/src/ui/agent-mention.ts +5 -2
- package/src/ui/agent-row.ts +13 -3
- package/src/ui/agent-widget.ts +55 -25
- package/src/ui/conversation-viewer.ts +10 -5
- package/src/ui/fallback-flag.ts +114 -0
- package/src/ui/fleet-list.ts +431 -86
- package/src/ui/fleet-state.ts +154 -0
- package/src/ui/notification-view.ts +22 -3
- package/src/ui/workflow-card.ts +6 -9
- package/src/ui/workflow-dialog.ts +36 -13
- package/src/workflow/host.ts +47 -50
- package/src/workflow/journal.ts +13 -1
- package/src/workflow/meta.ts +7 -4
- package/src/workflow/progress.ts +8 -3
- package/src/workflow/runtime.ts +48 -15
- package/src/workflow/saved.ts +21 -21
- package/src/workflow/task.ts +22 -7
- package/src/workflow/tool-description.ts +2 -2
- package/src/workflow/worker-source.ts +162 -40
- package/src/worktree.ts +309 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nredd/pi-subagents",
|
|
3
|
-
"version": "0.22.0-nredd.
|
|
3
|
+
"version": "0.22.0-nredd.9",
|
|
4
4
|
"description": "A pi extension that brings Claude Code-like sub-agents and workflow orchestration to pi — parallel execution, live widget, fleet view, custom agent types, mid-run steering, dynamic workflows, Claude Code compatibility, look and feel.",
|
|
5
5
|
"author": "tintinweb",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,30 +42,33 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
|
|
44
44
|
"prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build",
|
|
45
|
-
"test": "vitest
|
|
46
|
-
"test:watch": "vitest",
|
|
47
|
-
"test:e2e": "vitest run e2e --reporter=verbose",
|
|
45
|
+
"test": "node ../../scripts/run-vitest.ts node --coverage",
|
|
46
|
+
"test:watch": "JITI_FS_CACHE=false vitest",
|
|
47
|
+
"test:e2e": "JITI_FS_CACHE=false vitest run e2e --reporter=verbose",
|
|
48
48
|
"typecheck": "tsc --noEmit",
|
|
49
49
|
"lint": "biome check src/ test/",
|
|
50
50
|
"lint:fix": "biome check --fix src/ test/",
|
|
51
|
-
"check": "npm run lint && npm run typecheck && npm run test && npm run test:bun",
|
|
52
|
-
"test:bun": "
|
|
53
|
-
"test:
|
|
54
|
-
"
|
|
51
|
+
"check": "npm run lint && npm run typecheck && npm run test && npm run test:workflow-examples && npm run test:bun",
|
|
52
|
+
"test:bun": "node ../../scripts/run-vitest.ts bun",
|
|
53
|
+
"test:workflow-examples": "JITI_FS_CACHE=false vitest run --config vitest.workflow-examples.config.ts --coverage",
|
|
54
|
+
"test:coverage": "node ../../scripts/run-vitest.ts node --coverage",
|
|
55
|
+
"bench": "JITI_FS_CACHE=false vitest bench",
|
|
55
56
|
"bench:ab": "node test/perf/ab.mjs"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@biomejs/biome": "^2.4.14",
|
|
59
|
-
"@earendil-works/pi-ai": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.
|
|
60
|
-
"@earendil-works/pi-coding-agent": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.
|
|
61
|
-
"@earendil-works/pi-tui": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.
|
|
60
|
+
"@earendil-works/pi-ai": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.10/earendil-works-pi-ai-1.3.0.tgz",
|
|
61
|
+
"@earendil-works/pi-coding-agent": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.10/earendil-works-pi-coding-agent-1.3.0.tgz",
|
|
62
|
+
"@earendil-works/pi-tui": "https://github.com/nredd/pi/releases/download/v1.3.0-nredd.10/earendil-works-pi-tui-1.3.0.tgz",
|
|
62
63
|
"@xterm/headless": "5.5.0",
|
|
63
64
|
"@sinclair/typebox": "^0.34.49",
|
|
64
65
|
"@types/node": "^25.5.0",
|
|
65
|
-
"@vitest/coverage-istanbul": "
|
|
66
|
+
"@vitest/coverage-istanbul": "5.0.3",
|
|
67
|
+
"@vitest/istanbul-lib-coverage": "1.0.2",
|
|
68
|
+
"@vitest/istanbul-lib-instrument": "1.0.2",
|
|
66
69
|
"typebox": "^1.3.27",
|
|
67
70
|
"typescript": "^6.0.0",
|
|
68
|
-
"vitest": "
|
|
71
|
+
"vitest": "5.0.3"
|
|
69
72
|
},
|
|
70
73
|
"pi": {
|
|
71
74
|
"extensions": [
|
package/src/abortable.ts
CHANGED
|
@@ -17,8 +17,8 @@ export function abortable<T>(promise: Promise<T>, signal?: AbortSignal): Promise
|
|
|
17
17
|
return new Promise<T>((resolve, reject) => {
|
|
18
18
|
let settled = false;
|
|
19
19
|
const cleanup = () => signal.removeEventListener("abort", onAbort);
|
|
20
|
+
// The listener is removed on every settle path, so abort can only fire while pending.
|
|
20
21
|
const onAbort = () => {
|
|
21
|
-
if (settled) return;
|
|
22
22
|
settled = true;
|
|
23
23
|
cleanup();
|
|
24
24
|
reject(signal.reason);
|
package/src/agent-file-toggle.ts
CHANGED
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
|
|
28
28
|
import { existsSync } from "node:fs";
|
|
29
29
|
import { join, sep } from "node:path";
|
|
30
|
-
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
31
30
|
import { parseAgentFrontmatter } from "./custom-agents.js";
|
|
31
|
+
import { resolveAgentDir } from "./home-paths.js";
|
|
32
32
|
import type { AgentConfig } from "./types.js";
|
|
33
33
|
|
|
34
34
|
export type AgentFileLocation = "project" | "workspace" | "personal";
|
|
35
35
|
|
|
36
36
|
export const projectAgentsDir = (cwd: string = process.cwd()) => join(cwd, ".pi", "agents");
|
|
37
37
|
export const workspaceAgentsDir = (cwd: string = process.cwd()) => join(cwd, ".agents", "agents");
|
|
38
|
-
export const personalAgentsDir = () => join(
|
|
38
|
+
export const personalAgentsDir = (homeDir?: string) => join(resolveAgentDir(homeDir), "agents");
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Find the file path of a custom agent by name, in discovery-precedence order
|
|
@@ -46,12 +46,13 @@ export const personalAgentsDir = () => join(getAgentDir(), "agents");
|
|
|
46
46
|
export function findAgentFile(
|
|
47
47
|
name: string,
|
|
48
48
|
cwd: string = process.cwd(),
|
|
49
|
+
homeDir?: string,
|
|
49
50
|
): { path: string; location: AgentFileLocation } | undefined {
|
|
50
51
|
const projectPath = join(projectAgentsDir(cwd), `${name}.md`);
|
|
51
52
|
if (existsSync(projectPath)) return { path: projectPath, location: "project" };
|
|
52
53
|
const workspacePath = join(workspaceAgentsDir(cwd), `${name}.md`);
|
|
53
54
|
if (existsSync(workspacePath)) return { path: workspacePath, location: "workspace" };
|
|
54
|
-
const personalPath = join(personalAgentsDir(), `${name}.md`);
|
|
55
|
+
const personalPath = join(personalAgentsDir(homeDir), `${name}.md`);
|
|
55
56
|
if (existsSync(personalPath)) return { path: personalPath, location: "personal" };
|
|
56
57
|
return undefined;
|
|
57
58
|
}
|
|
@@ -83,11 +84,12 @@ export function locateAgentFile(
|
|
|
83
84
|
sourcePath: string | undefined,
|
|
84
85
|
cwd: string = process.cwd(),
|
|
85
86
|
source?: AgentConfig["source"],
|
|
87
|
+
homeDir?: string,
|
|
86
88
|
): { path: string; location: AgentFileLocation } | undefined {
|
|
87
89
|
if (source !== "package" && sourcePath && existsSync(sourcePath)) {
|
|
88
90
|
return { path: sourcePath, location: classifyAgentDir(sourcePath, cwd) };
|
|
89
91
|
}
|
|
90
|
-
return findAgentFile(name, cwd);
|
|
92
|
+
return findAgentFile(name, cwd, homeDir);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
/**
|
|
@@ -126,7 +128,6 @@ function splitFrontmatter(content: string):
|
|
|
126
128
|
| { lines: string[]; openIdx: number; closeIdx: number; eol: string }
|
|
127
129
|
| undefined {
|
|
128
130
|
const lines = content.split(/(?<=\n)/);
|
|
129
|
-
if (lines.length === 0) return undefined;
|
|
130
131
|
// The BOM stays where it is — it belongs to the file, not the block — so the
|
|
131
132
|
// fence test looks past it and every index below is unaffected.
|
|
132
133
|
const bom = content.startsWith("\uFEFF");
|