pi-crew 0.9.59 → 0.9.61
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 +48 -0
- package/dist/index.mjs +1264 -743
- package/docs/commands-reference.md +5 -0
- package/docs/resource-formats.md +7 -1
- package/package.json +1 -1
- package/skills/real-test-pi-crew/REPORT-TEMPLATE.md +52 -0
- package/skills/real-test-pi-crew/SKILL.md +6 -4
- package/src/config/types.ts +29 -0
- package/src/extension/registration/lifecycle-handlers.ts +33 -0
- package/src/extension/team-tool/chain-dispatch.ts +20 -2
- package/src/extension/team-tool/chain-executor.ts +6 -1
- package/src/extension/team-tool/doctor.ts +43 -0
- package/src/extension/team-tool/run.ts +19 -3
- package/src/extension/team-tool.ts +2 -1
- package/src/runtime/background-runner.ts +26 -0
- package/src/runtime/child-pi/child-pi-spawn.ts +1 -0
- package/src/runtime/child-pi/child-pi.ts +2 -0
- package/src/runtime/live-session/live-session-runtime.ts +83 -16
- package/src/runtime/model/model-fallback.ts +412 -36
- package/src/runtime/model/model-scope.ts +2 -0
- package/src/runtime/model/pi-args.ts +7 -3
- package/src/runtime/model/provider-quota.ts +228 -0
- package/src/runtime/model/session-model.ts +135 -0
- package/src/runtime/task-runner/child-executor.ts +82 -4
- package/src/runtime/task-runner/live-executor.ts +12 -0
- package/src/runtime/task-runner.ts +5 -0
- package/src/runtime/team-runner.ts +18 -4
- package/src/schema/config-schema.ts +12 -0
- package/src/state/types.ts +27 -0
- package/src/teams/discover-teams.ts +16 -2
- package/src/teams/team-config.ts +4 -0
package/src/state/types.ts
CHANGED
|
@@ -249,6 +249,25 @@ export interface TeamRunManifest {
|
|
|
249
249
|
/** #2 (assessment): goal-achievement verdict — kills the silent false-green. */
|
|
250
250
|
goalAchieved?: boolean | "unknown";
|
|
251
251
|
goalAchievementNote?: string;
|
|
252
|
+
/**
|
|
253
|
+
* Model routing snapshot captured at dispatch time. Background/async runs
|
|
254
|
+
* execute in a detached process with no `ExtensionContext`, so without this
|
|
255
|
+
* they lose the caller's `model=` override, the inherited session model and
|
|
256
|
+
* the auth-filtered model catalogue — and silently route to whatever
|
|
257
|
+
* models.json happens to list first.
|
|
258
|
+
*/
|
|
259
|
+
modelContext?: RunModelContext;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface RunModelContext {
|
|
263
|
+
/** `model=` passed to the team tool for this run. */
|
|
264
|
+
override?: string;
|
|
265
|
+
/** The main session's live model at dispatch time (`"provider/id"`). */
|
|
266
|
+
parentModel?: string;
|
|
267
|
+
/** The main session's thinking level at dispatch time. */
|
|
268
|
+
parentThinking?: string;
|
|
269
|
+
/** `"provider/id"` entries from the caller's pi ModelRegistry (auth-filtered). */
|
|
270
|
+
availableModels?: string[];
|
|
252
271
|
}
|
|
253
272
|
|
|
254
273
|
export interface UsageState {
|
|
@@ -348,6 +367,14 @@ export interface ModelRoutingState {
|
|
|
348
367
|
fallbackChain: string[];
|
|
349
368
|
reason?: string;
|
|
350
369
|
usedAttempt: number;
|
|
370
|
+
/**
|
|
371
|
+
* Set when the caller asked for a model that is not resolvable against the
|
|
372
|
+
* available catalogue, so the chain silently ran something else. Surfaced
|
|
373
|
+
* as a warning in the tool result and doctor output.
|
|
374
|
+
*/
|
|
375
|
+
droppedRequested?: string;
|
|
376
|
+
/** How many candidates came from the auto tail (diagnostics). */
|
|
377
|
+
autoFallbackCount?: number;
|
|
351
378
|
}
|
|
352
379
|
|
|
353
380
|
export interface TaskWorktreeState {
|
|
@@ -37,10 +37,17 @@ function parseRoleLine(line: string): TeamRole | undefined {
|
|
|
37
37
|
metadata.skills = raw.replace(/\s*,\s*/g, ",").trim();
|
|
38
38
|
return "";
|
|
39
39
|
});
|
|
40
|
-
descriptionSource = descriptionSource.replace(/\
|
|
41
|
-
metadata
|
|
40
|
+
descriptionSource = descriptionSource.replace(/\bfallbackModels\s*=\s*([\w/.:-]+(?:\s*,\s*[\w/.:-]+)*)/g, (_match, raw: string) => {
|
|
41
|
+
metadata.fallbackModels = raw.replace(/\s*,\s*/g, ",").trim();
|
|
42
42
|
return "";
|
|
43
43
|
});
|
|
44
|
+
descriptionSource = descriptionSource.replace(
|
|
45
|
+
/\b(agent|model|thinking|maxConcurrency)\s*=\s*(\S+)/g,
|
|
46
|
+
(_match, key: string, raw: string) => {
|
|
47
|
+
metadata[key] = raw.trim();
|
|
48
|
+
return "";
|
|
49
|
+
},
|
|
50
|
+
);
|
|
44
51
|
const description = descriptionSource.replace(/\s+/g, " ").trim() || undefined;
|
|
45
52
|
const maxConcurrency = metadata.maxConcurrency
|
|
46
53
|
? (() => {
|
|
@@ -53,6 +60,13 @@ function parseRoleLine(line: string): TeamRole | undefined {
|
|
|
53
60
|
agent: metadata.agent ?? name,
|
|
54
61
|
description,
|
|
55
62
|
model: metadata.model,
|
|
63
|
+
fallbackModels: metadata.fallbackModels
|
|
64
|
+
? metadata.fallbackModels
|
|
65
|
+
.split(",")
|
|
66
|
+
.map((s) => s.trim())
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
: undefined,
|
|
69
|
+
thinking: metadata.thinking?.trim() || undefined,
|
|
56
70
|
skills: parseRoleSkills(metadata.skills),
|
|
57
71
|
maxConcurrency: maxConcurrency && maxConcurrency > 0 ? maxConcurrency : undefined,
|
|
58
72
|
};
|
package/src/teams/team-config.ts
CHANGED
|
@@ -5,6 +5,10 @@ export interface TeamRole {
|
|
|
5
5
|
agent: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
model?: string;
|
|
8
|
+
/** Comma-separated fallback models declared on the role line. */
|
|
9
|
+
fallbackModels?: string[];
|
|
10
|
+
/** Thinking level for this role (e.g. "high", "medium", "low", "off"). */
|
|
11
|
+
thinking?: string;
|
|
8
12
|
/** Additional skills for this role; false disables role-default injected skills for tasks using this role. */
|
|
9
13
|
skills?: string[] | false;
|
|
10
14
|
maxConcurrency?: number;
|