agent-bober 0.15.0 → 0.17.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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +30 -0
- package/README.md +127 -3
- package/agents/bober-architect.md +34 -0
- package/agents/bober-code-reviewer.md +2 -0
- package/agents/bober-curator.md +12 -0
- package/agents/bober-documenter.md +129 -0
- package/agents/bober-evaluator.md +46 -0
- package/agents/bober-generator.md +12 -0
- package/agents/bober-planner.md +8 -1
- package/dist/cli/commands/graph.js +3 -3
- package/dist/cli/commands/graph.js.map +1 -1
- package/dist/cli/commands/init.js +4 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/memory.d.ts +14 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +132 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +14 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +7 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/role-providers.d.ts +29 -0
- package/dist/config/role-providers.d.ts.map +1 -0
- package/dist/config/role-providers.js +115 -0
- package/dist/config/role-providers.js.map +1 -0
- package/dist/config/schema.d.ts +383 -14
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +42 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/contracts/eval-result.d.ts +112 -56
- package/dist/contracts/eval-result.d.ts.map +1 -1
- package/dist/contracts/eval-result.js +3 -0
- package/dist/contracts/eval-result.js.map +1 -1
- package/dist/contracts/sprint-contract.d.ts +30 -30
- package/dist/fleet/aggregator.d.ts +5 -0
- package/dist/fleet/aggregator.d.ts.map +1 -0
- package/dist/fleet/aggregator.js +39 -0
- package/dist/fleet/aggregator.js.map +1 -0
- package/dist/fleet/child-config.d.ts +12 -0
- package/dist/fleet/child-config.d.ts.map +1 -0
- package/dist/fleet/child-config.js +38 -0
- package/dist/fleet/child-config.js.map +1 -0
- package/dist/fleet/coordinator.d.ts +25 -0
- package/dist/fleet/coordinator.d.ts.map +1 -0
- package/dist/fleet/coordinator.js +40 -0
- package/dist/fleet/coordinator.js.map +1 -0
- package/dist/fleet/index.d.ts +40 -0
- package/dist/fleet/index.d.ts.map +1 -0
- package/dist/fleet/index.js +117 -0
- package/dist/fleet/index.js.map +1 -0
- package/dist/fleet/manifest.d.ts +51 -0
- package/dist/fleet/manifest.d.ts.map +1 -0
- package/dist/fleet/manifest.js +32 -0
- package/dist/fleet/manifest.js.map +1 -0
- package/dist/fleet/reporter.d.ts +32 -0
- package/dist/fleet/reporter.d.ts.map +1 -0
- package/dist/fleet/reporter.js +71 -0
- package/dist/fleet/reporter.js.map +1 -0
- package/dist/fleet/runner.d.ts +48 -0
- package/dist/fleet/runner.d.ts.map +1 -0
- package/dist/fleet/runner.js +104 -0
- package/dist/fleet/runner.js.map +1 -0
- package/dist/fleet/scaffolder.d.ts +12 -0
- package/dist/fleet/scaffolder.d.ts.map +1 -0
- package/dist/fleet/scaffolder.js +82 -0
- package/dist/fleet/scaffolder.js.map +1 -0
- package/dist/fleet/types.d.ts +21 -0
- package/dist/fleet/types.d.ts.map +1 -0
- package/dist/fleet/types.js +2 -0
- package/dist/fleet/types.js.map +1 -0
- package/dist/graph/cli.d.ts +6 -2
- package/dist/graph/cli.d.ts.map +1 -1
- package/dist/graph/cli.js +53 -12
- package/dist/graph/cli.js.map +1 -1
- package/dist/graph/pipeline-lifecycle.d.ts +9 -0
- package/dist/graph/pipeline-lifecycle.d.ts.map +1 -1
- package/dist/graph/pipeline-lifecycle.js +12 -0
- package/dist/graph/pipeline-lifecycle.js.map +1 -1
- package/dist/graph/preflight-injector.d.ts +14 -0
- package/dist/graph/preflight-injector.d.ts.map +1 -1
- package/dist/graph/preflight-injector.js +84 -4
- package/dist/graph/preflight-injector.js.map +1 -1
- package/dist/incident/types.d.ts +24 -24
- package/dist/mcp/tools/graph-schemas.d.ts +7 -7
- package/dist/mcp/tools/init.d.ts.map +1 -1
- package/dist/mcp/tools/init.js +2 -0
- package/dist/mcp/tools/init.js.map +1 -1
- package/dist/orchestrator/agent-loader.d.ts.map +1 -1
- package/dist/orchestrator/agent-loader.js +15 -1
- package/dist/orchestrator/agent-loader.js.map +1 -1
- package/dist/orchestrator/agentic-loop.d.ts +51 -0
- package/dist/orchestrator/agentic-loop.d.ts.map +1 -1
- package/dist/orchestrator/agentic-loop.js +123 -4
- package/dist/orchestrator/agentic-loop.js.map +1 -1
- package/dist/orchestrator/arch-lenses.d.ts +7 -0
- package/dist/orchestrator/arch-lenses.d.ts.map +1 -0
- package/dist/orchestrator/arch-lenses.js +22 -0
- package/dist/orchestrator/arch-lenses.js.map +1 -0
- package/dist/orchestrator/architect-agent.d.ts +16 -0
- package/dist/orchestrator/architect-agent.d.ts.map +1 -1
- package/dist/orchestrator/architect-agent.js +509 -1
- package/dist/orchestrator/architect-agent.js.map +1 -1
- package/dist/orchestrator/curator-agent.js +1 -1
- package/dist/orchestrator/curator-agent.js.map +1 -1
- package/dist/orchestrator/deploy/types.d.ts +2 -2
- package/dist/orchestrator/documenter-agent.d.ts +57 -0
- package/dist/orchestrator/documenter-agent.d.ts.map +1 -0
- package/dist/orchestrator/documenter-agent.js +195 -0
- package/dist/orchestrator/documenter-agent.js.map +1 -0
- package/dist/orchestrator/environment.d.ts +45 -0
- package/dist/orchestrator/environment.d.ts.map +1 -0
- package/dist/orchestrator/environment.js +151 -0
- package/dist/orchestrator/environment.js.map +1 -0
- package/dist/orchestrator/eval-lenses.d.ts +7 -0
- package/dist/orchestrator/eval-lenses.d.ts.map +1 -0
- package/dist/orchestrator/eval-lenses.js +19 -0
- package/dist/orchestrator/eval-lenses.js.map +1 -0
- package/dist/orchestrator/eval-persist.d.ts +25 -0
- package/dist/orchestrator/eval-persist.d.ts.map +1 -0
- package/dist/orchestrator/eval-persist.js +74 -0
- package/dist/orchestrator/eval-persist.js.map +1 -0
- package/dist/orchestrator/evaluator-agent.d.ts +23 -0
- package/dist/orchestrator/evaluator-agent.d.ts.map +1 -1
- package/dist/orchestrator/evaluator-agent.js +60 -3
- package/dist/orchestrator/evaluator-agent.js.map +1 -1
- package/dist/orchestrator/generator-agent.d.ts.map +1 -1
- package/dist/orchestrator/generator-agent.js +32 -0
- package/dist/orchestrator/generator-agent.js.map +1 -1
- package/dist/orchestrator/memory/distill.d.ts +60 -0
- package/dist/orchestrator/memory/distill.d.ts.map +1 -0
- package/dist/orchestrator/memory/distill.js +177 -0
- package/dist/orchestrator/memory/distill.js.map +1 -0
- package/dist/orchestrator/memory/eval-source.d.ts +20 -0
- package/dist/orchestrator/memory/eval-source.d.ts.map +1 -0
- package/dist/orchestrator/memory/eval-source.js +88 -0
- package/dist/orchestrator/memory/eval-source.js.map +1 -0
- package/dist/orchestrator/memory/retrieve.d.ts +45 -0
- package/dist/orchestrator/memory/retrieve.d.ts.map +1 -0
- package/dist/orchestrator/memory/retrieve.js +102 -0
- package/dist/orchestrator/memory/retrieve.js.map +1 -0
- package/dist/orchestrator/model-resolver.d.ts.map +1 -1
- package/dist/orchestrator/model-resolver.js +12 -0
- package/dist/orchestrator/model-resolver.js.map +1 -1
- package/dist/orchestrator/pipeline.d.ts +10 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -1
- package/dist/orchestrator/pipeline.js +111 -3
- package/dist/orchestrator/pipeline.js.map +1 -1
- package/dist/orchestrator/planner-agent.d.ts +22 -1
- package/dist/orchestrator/planner-agent.d.ts.map +1 -1
- package/dist/orchestrator/planner-agent.js +160 -4
- package/dist/orchestrator/planner-agent.js.map +1 -1
- package/dist/orchestrator/research-agent.js +2 -2
- package/dist/orchestrator/research-agent.js.map +1 -1
- package/dist/orchestrator/tools/handlers.d.ts +14 -0
- package/dist/orchestrator/tools/handlers.d.ts.map +1 -1
- package/dist/orchestrator/tools/handlers.js +29 -4
- package/dist/orchestrator/tools/handlers.js.map +1 -1
- package/dist/orchestrator/tools/schemas.js +5 -5
- package/dist/orchestrator/tools/schemas.js.map +1 -1
- package/dist/orchestrator/workflow/args-builder.d.ts +35 -0
- package/dist/orchestrator/workflow/args-builder.d.ts.map +1 -0
- package/dist/orchestrator/workflow/args-builder.js +142 -0
- package/dist/orchestrator/workflow/args-builder.js.map +1 -0
- package/dist/orchestrator/workflow/budget.d.ts +57 -0
- package/dist/orchestrator/workflow/budget.d.ts.map +1 -0
- package/dist/orchestrator/workflow/budget.js +80 -0
- package/dist/orchestrator/workflow/budget.js.map +1 -0
- package/dist/orchestrator/workflow/conformance.d.ts +27 -0
- package/dist/orchestrator/workflow/conformance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/conformance.js +111 -0
- package/dist/orchestrator/workflow/conformance.js.map +1 -0
- package/dist/orchestrator/workflow/eligibility.d.ts +8 -0
- package/dist/orchestrator/workflow/eligibility.d.ts.map +1 -0
- package/dist/orchestrator/workflow/eligibility.js +10 -0
- package/dist/orchestrator/workflow/eligibility.js.map +1 -0
- package/dist/orchestrator/workflow/engine.d.ts +10 -0
- package/dist/orchestrator/workflow/engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/engine.js +2 -0
- package/dist/orchestrator/workflow/engine.js.map +1 -0
- package/dist/orchestrator/workflow/errors.d.ts +13 -0
- package/dist/orchestrator/workflow/errors.d.ts.map +1 -0
- package/dist/orchestrator/workflow/errors.js +26 -0
- package/dist/orchestrator/workflow/errors.js.map +1 -0
- package/dist/orchestrator/workflow/flusher.d.ts +19 -0
- package/dist/orchestrator/workflow/flusher.d.ts.map +1 -0
- package/dist/orchestrator/workflow/flusher.js +81 -0
- package/dist/orchestrator/workflow/flusher.js.map +1 -0
- package/dist/orchestrator/workflow/interpreter.d.ts +48 -0
- package/dist/orchestrator/workflow/interpreter.d.ts.map +1 -0
- package/dist/orchestrator/workflow/interpreter.js +92 -0
- package/dist/orchestrator/workflow/interpreter.js.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts +65 -0
- package/dist/orchestrator/workflow/pure-sprint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/pure-sprint.js +82 -0
- package/dist/orchestrator/workflow/pure-sprint.js.map +1 -0
- package/dist/orchestrator/workflow/reconciler.d.ts +15 -0
- package/dist/orchestrator/workflow/reconciler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/reconciler.js +65 -0
- package/dist/orchestrator/workflow/reconciler.js.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts +10 -0
- package/dist/orchestrator/workflow/resume-cursor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/resume-cursor.js +25 -0
- package/dist/orchestrator/workflow/resume-cursor.js.map +1 -0
- package/dist/orchestrator/workflow/retry.d.ts +50 -0
- package/dist/orchestrator/workflow/retry.d.ts.map +1 -0
- package/dist/orchestrator/workflow/retry.js +100 -0
- package/dist/orchestrator/workflow/retry.js.map +1 -0
- package/dist/orchestrator/workflow/scheduler.d.ts +87 -0
- package/dist/orchestrator/workflow/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/workflow/scheduler.js +158 -0
- package/dist/orchestrator/workflow/scheduler.js.map +1 -0
- package/dist/orchestrator/workflow/selector.d.ts +26 -0
- package/dist/orchestrator/workflow/selector.d.ts.map +1 -0
- package/dist/orchestrator/workflow/selector.js +54 -0
- package/dist/orchestrator/workflow/selector.js.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts +52 -0
- package/dist/orchestrator/workflow/synthesizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/synthesizer.js +75 -0
- package/dist/orchestrator/workflow/synthesizer.js.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts +13 -0
- package/dist/orchestrator/workflow/ts-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ts-engine.js +14 -0
- package/dist/orchestrator/workflow/ts-engine.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +55 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +3 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts +31 -0
- package/dist/orchestrator/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-engine.js +70 -0
- package/dist/orchestrator/workflow/workflow-engine.js.map +1 -0
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +49 -6
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/claude-code.d.ts +44 -0
- package/dist/providers/claude-code.d.ts.map +1 -0
- package/dist/providers/claude-code.js +143 -0
- package/dist/providers/claude-code.js.map +1 -0
- package/dist/providers/factory.d.ts +16 -2
- package/dist/providers/factory.d.ts.map +1 -1
- package/dist/providers/factory.js +66 -12
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/google.d.ts.map +1 -1
- package/dist/providers/google.js +27 -3
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +24 -3
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/preflight.d.ts +22 -0
- package/dist/providers/preflight.d.ts.map +1 -0
- package/dist/providers/preflight.js +54 -0
- package/dist/providers/preflight.js.map +1 -0
- package/dist/providers/structured.d.ts +130 -0
- package/dist/providers/structured.d.ts.map +1 -0
- package/dist/providers/structured.js +205 -0
- package/dist/providers/structured.js.map +1 -0
- package/dist/providers/types.d.ts +28 -0
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/state/history-rotation.d.ts +17 -0
- package/dist/state/history-rotation.d.ts.map +1 -0
- package/dist/state/history-rotation.js +84 -0
- package/dist/state/history-rotation.js.map +1 -0
- package/dist/state/history.d.ts +16 -4
- package/dist/state/history.d.ts.map +1 -1
- package/dist/state/history.js +62 -20
- package/dist/state/history.js.map +1 -1
- package/dist/state/index.d.ts +1 -1
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +1 -1
- package/dist/state/index.js.map +1 -1
- package/dist/state/memory.d.ts +60 -0
- package/dist/state/memory.d.ts.map +1 -0
- package/dist/state/memory.js +242 -0
- package/dist/state/memory.js.map +1 -0
- package/hooks/hooks.json +12 -2
- package/package.json +9 -5
- package/scripts/spike-claude-code-provider.mjs +66 -0
- package/scripts/spike-deepseek.mjs +63 -0
- package/scripts/sync-targets.json +12 -0
- package/scripts/update-all.mjs +255 -0
- package/skills/bober.architect/SKILL.md +13 -0
- package/skills/bober.architect/references/arch-lens-panel.md +126 -0
- package/skills/bober.eval/SKILL.md +9 -0
- package/skills/bober.eval/references/lens-panel.md +115 -0
- package/skills/bober.plan/SKILL.md +6 -0
- package/skills/bober.run/SKILL.md +23 -4
- package/skills/bober.run/references/lens-panel.md +115 -0
- package/skills/bober.sprint/SKILL.md +44 -2
- package/skills/bober.sprint/references/lens-panel.md +115 -0
- package/skills/shared/arch-lens-panel.md +126 -0
- package/skills/shared/lens-panel.md +115 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ChildOutcome } from "./types.js";
|
|
2
|
+
export interface PortfolioReport {
|
|
3
|
+
total: number;
|
|
4
|
+
completed: number;
|
|
5
|
+
failed: number;
|
|
6
|
+
other: number;
|
|
7
|
+
generatedAt: string;
|
|
8
|
+
children: ChildOutcome[];
|
|
9
|
+
}
|
|
10
|
+
export declare class PortfolioReporter {
|
|
11
|
+
/**
|
|
12
|
+
* Tally a list of ChildOutcome records into a PortfolioReport.
|
|
13
|
+
*
|
|
14
|
+
* - completed: status === "completed"
|
|
15
|
+
* - failed: status === "failed"
|
|
16
|
+
* - other: anything else (running / aborted / unknown)
|
|
17
|
+
* - generatedAt: ISO-8601 timestamp at call time
|
|
18
|
+
*/
|
|
19
|
+
build(outcomes: ChildOutcome[]): PortfolioReport;
|
|
20
|
+
/**
|
|
21
|
+
* Atomically write the PortfolioReport to <rootDir>/.bober/fleet-report.json.
|
|
22
|
+
*
|
|
23
|
+
* Uses temp file + rename to prevent partial-write corruption (mirrors
|
|
24
|
+
* writeRunState in src/state/run-state.ts).
|
|
25
|
+
*
|
|
26
|
+
* This is the ONE place in the fleet subsystem allowed to throw on IO failure.
|
|
27
|
+
*
|
|
28
|
+
* @returns The absolute path of the written file.
|
|
29
|
+
*/
|
|
30
|
+
write(rootDir: string, report: PortfolioReport): Promise<string>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/fleet/reporter.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAID,qBAAa,iBAAiB;IAG5B;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,eAAe;IA2BhD;;;;;;;;;OASG;IACG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAgBvE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// ── reporter.ts ───────────────────────────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// PortfolioReporter: tally ChildOutcome[] into a PortfolioReport and
|
|
4
|
+
// atomically write it to <rootDir>/.bober/fleet-report.json.
|
|
5
|
+
//
|
|
6
|
+
// Write strategy mirrors writeRunState in src/state/run-state.ts:
|
|
7
|
+
// temp file + rename to prevent partial-write corruption.
|
|
8
|
+
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
9
|
+
import { randomBytes } from "node:crypto";
|
|
10
|
+
import { join, resolve } from "node:path";
|
|
11
|
+
// ── PortfolioReporter ─────────────────────────────────────────────────
|
|
12
|
+
export class PortfolioReporter {
|
|
13
|
+
// ── build ───────────────────────────────────────────────────────────
|
|
14
|
+
/**
|
|
15
|
+
* Tally a list of ChildOutcome records into a PortfolioReport.
|
|
16
|
+
*
|
|
17
|
+
* - completed: status === "completed"
|
|
18
|
+
* - failed: status === "failed"
|
|
19
|
+
* - other: anything else (running / aborted / unknown)
|
|
20
|
+
* - generatedAt: ISO-8601 timestamp at call time
|
|
21
|
+
*/
|
|
22
|
+
build(outcomes) {
|
|
23
|
+
let completed = 0;
|
|
24
|
+
let failed = 0;
|
|
25
|
+
let other = 0;
|
|
26
|
+
for (const o of outcomes) {
|
|
27
|
+
if (o.status === "completed") {
|
|
28
|
+
completed++;
|
|
29
|
+
}
|
|
30
|
+
else if (o.status === "failed") {
|
|
31
|
+
failed++;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
other++;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
total: outcomes.length,
|
|
39
|
+
completed,
|
|
40
|
+
failed,
|
|
41
|
+
other,
|
|
42
|
+
generatedAt: new Date().toISOString(),
|
|
43
|
+
children: outcomes,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// ── write ────────────────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* Atomically write the PortfolioReport to <rootDir>/.bober/fleet-report.json.
|
|
49
|
+
*
|
|
50
|
+
* Uses temp file + rename to prevent partial-write corruption (mirrors
|
|
51
|
+
* writeRunState in src/state/run-state.ts).
|
|
52
|
+
*
|
|
53
|
+
* This is the ONE place in the fleet subsystem allowed to throw on IO failure.
|
|
54
|
+
*
|
|
55
|
+
* @returns The absolute path of the written file.
|
|
56
|
+
*/
|
|
57
|
+
async write(rootDir, report) {
|
|
58
|
+
const dir = resolve(join(rootDir, ".bober"));
|
|
59
|
+
await mkdir(dir, { recursive: true });
|
|
60
|
+
const filePath = join(dir, "fleet-report.json");
|
|
61
|
+
const rnd = randomBytes(4).toString("hex");
|
|
62
|
+
const tmp = `${filePath}.${process.pid}.${Date.now()}.${rnd}.tmp`;
|
|
63
|
+
await writeFile(tmp, JSON.stringify(report, null, 2) + "\n", {
|
|
64
|
+
encoding: "utf-8",
|
|
65
|
+
mode: 0o600,
|
|
66
|
+
});
|
|
67
|
+
await rename(tmp, filePath);
|
|
68
|
+
return filePath;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../src/fleet/reporter.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,qEAAqE;AACrE,6DAA6D;AAC7D,EAAE;AACF,kEAAkE;AAClE,0DAA0D;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAe1C,yEAAyE;AAEzE,MAAM,OAAO,iBAAiB;IAC5B,uEAAuE;IAEvE;;;;;;;OAOG;IACH,KAAK,CAAC,QAAwB;QAC5B,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBAC7B,SAAS,EAAE,CAAC;YACd,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
|
3
|
+
cwd: string;
|
|
4
|
+
task: string;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ChildSpawnResult {
|
|
8
|
+
cwd: string;
|
|
9
|
+
exitCode: number | null;
|
|
10
|
+
stdout: string;
|
|
11
|
+
stderr: string;
|
|
12
|
+
timedOut?: boolean;
|
|
13
|
+
spawnError?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Probe the CLI binary for a successful --version response.
|
|
17
|
+
* Returns true if the entry file responds with exitCode 0, false otherwise.
|
|
18
|
+
* Never throws.
|
|
19
|
+
*/
|
|
20
|
+
export declare function probeCliVersion(cliEntry: string): Promise<boolean>;
|
|
21
|
+
export declare class ChildRunner {
|
|
22
|
+
/**
|
|
23
|
+
* Optional override for the CLI entry path.
|
|
24
|
+
* Production code leaves this undefined (defaults to resolveCliEntry()).
|
|
25
|
+
* Tests inject the stub fixture path via the constructor to avoid
|
|
26
|
+
* requiring a built dist/cli/index.js during unit testing.
|
|
27
|
+
*/
|
|
28
|
+
private readonly _cliEntry?;
|
|
29
|
+
/**
|
|
30
|
+
* Optional override for the Node.js binary path.
|
|
31
|
+
* Production code leaves this undefined (defaults to process.execPath).
|
|
32
|
+
* Tests may inject a bad path to exercise the spawn-failure / ENOENT path.
|
|
33
|
+
*/
|
|
34
|
+
private readonly _nodeBin?;
|
|
35
|
+
constructor(options?: {
|
|
36
|
+
cliEntry?: string;
|
|
37
|
+
nodeBin?: string;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Spawn one `agent-bober run <task>` child process in spec.cwd.
|
|
41
|
+
* Uses process.execPath (the current Node binary) + the parent's own
|
|
42
|
+
* dist/cli/index.js — never a bare PATH lookup.
|
|
43
|
+
*
|
|
44
|
+
* Never throws: spawn errors are captured in spawnError.
|
|
45
|
+
*/
|
|
46
|
+
run(spec: ChildRunSpec): Promise<ChildSpawnResult>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/fleet/runner.ts"],"names":[],"mappings":"AAQA,wBAAgB,eAAe,IAAI,MAAM,CAGxC;AAID,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUxE;AAID,qBAAa,WAAW;IACtB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;gBAEvB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IAK7D;;;;;;OAMG;IACG,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAmDzD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { execa } from "execa";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
// ── Entry resolution (ADR-4) ─────────────────────────────────────────
|
|
5
|
+
// At runtime this file is dist/fleet/runner.js → CLI is dist/cli/index.js.
|
|
6
|
+
// From dirname(runner.js) = dist/fleet, go ".." to dist, then "cli/index.js".
|
|
7
|
+
export function resolveCliEntry() {
|
|
8
|
+
const here = dirname(fileURLToPath(import.meta.url)); // dist/fleet
|
|
9
|
+
return join(here, "..", "cli", "index.js"); // dist/cli/index.js
|
|
10
|
+
}
|
|
11
|
+
// ── Constants ────────────────────────────────────────────────────────
|
|
12
|
+
const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes
|
|
13
|
+
const MAX_BUFFER = 10 * 1024 * 1024; // 10 MiB
|
|
14
|
+
// ── Version probe (ADR-4) ────────────────────────────────────────────
|
|
15
|
+
/**
|
|
16
|
+
* Probe the CLI binary for a successful --version response.
|
|
17
|
+
* Returns true if the entry file responds with exitCode 0, false otherwise.
|
|
18
|
+
* Never throws.
|
|
19
|
+
*/
|
|
20
|
+
export async function probeCliVersion(cliEntry) {
|
|
21
|
+
try {
|
|
22
|
+
const r = await execa(process.execPath, [cliEntry, "--version"], {
|
|
23
|
+
reject: false,
|
|
24
|
+
timeout: 5_000,
|
|
25
|
+
});
|
|
26
|
+
return r.exitCode === 0;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// ── Runner ───────────────────────────────────────────────────────────
|
|
33
|
+
export class ChildRunner {
|
|
34
|
+
/**
|
|
35
|
+
* Optional override for the CLI entry path.
|
|
36
|
+
* Production code leaves this undefined (defaults to resolveCliEntry()).
|
|
37
|
+
* Tests inject the stub fixture path via the constructor to avoid
|
|
38
|
+
* requiring a built dist/cli/index.js during unit testing.
|
|
39
|
+
*/
|
|
40
|
+
_cliEntry;
|
|
41
|
+
/**
|
|
42
|
+
* Optional override for the Node.js binary path.
|
|
43
|
+
* Production code leaves this undefined (defaults to process.execPath).
|
|
44
|
+
* Tests may inject a bad path to exercise the spawn-failure / ENOENT path.
|
|
45
|
+
*/
|
|
46
|
+
_nodeBin;
|
|
47
|
+
constructor(options) {
|
|
48
|
+
this._cliEntry = options?.cliEntry;
|
|
49
|
+
this._nodeBin = options?.nodeBin;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Spawn one `agent-bober run <task>` child process in spec.cwd.
|
|
53
|
+
* Uses process.execPath (the current Node binary) + the parent's own
|
|
54
|
+
* dist/cli/index.js — never a bare PATH lookup.
|
|
55
|
+
*
|
|
56
|
+
* Never throws: spawn errors are captured in spawnError.
|
|
57
|
+
*/
|
|
58
|
+
async run(spec) {
|
|
59
|
+
const cliEntry = this._cliEntry ?? resolveCliEntry();
|
|
60
|
+
const nodeBin = this._nodeBin ?? process.execPath;
|
|
61
|
+
const timeout = spec.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
62
|
+
try {
|
|
63
|
+
const result = await execa(nodeBin, [cliEntry, "run", spec.task], {
|
|
64
|
+
cwd: spec.cwd,
|
|
65
|
+
reject: false,
|
|
66
|
+
timeout,
|
|
67
|
+
maxBuffer: MAX_BUFFER,
|
|
68
|
+
});
|
|
69
|
+
// With reject:false, execa resolves even on spawn-level failures (e.g. ENOENT).
|
|
70
|
+
// Detect a spawn failure by checking whether exitCode is absent and the process
|
|
71
|
+
// did not actually start (originalMessage contains the spawn error details).
|
|
72
|
+
if (result.exitCode === undefined && result.failed && result.originalMessage) {
|
|
73
|
+
return {
|
|
74
|
+
cwd: spec.cwd,
|
|
75
|
+
exitCode: null,
|
|
76
|
+
stdout: result.stdout ?? "",
|
|
77
|
+
stderr: result.stderr ?? "",
|
|
78
|
+
spawnError: result.originalMessage,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const spawnResult = {
|
|
82
|
+
cwd: spec.cwd,
|
|
83
|
+
exitCode: result.exitCode ?? null,
|
|
84
|
+
stdout: result.stdout,
|
|
85
|
+
stderr: result.stderr,
|
|
86
|
+
};
|
|
87
|
+
if (result.timedOut) {
|
|
88
|
+
spawnResult.timedOut = true;
|
|
89
|
+
}
|
|
90
|
+
return spawnResult;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
// Fallback: if execa throws despite reject:false (older execa versions)
|
|
94
|
+
return {
|
|
95
|
+
cwd: spec.cwd,
|
|
96
|
+
exitCode: null,
|
|
97
|
+
stdout: "",
|
|
98
|
+
stderr: "",
|
|
99
|
+
spawnError: err.message,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/fleet/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,wEAAwE;AACxE,2EAA2E;AAC3E,8EAA8E;AAE9E,MAAM,UAAU,eAAe;IAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa;IACnE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,oBAAoB;AAClE,CAAC;AAmBD,wEAAwE;AAExE,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AACxD,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,SAAS;AAE9C,wEAAwE;AAExE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE;YAC/D,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;QACH,OAA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BACnC,CAAC;YACJ,CAAC;YAED,MAAM,WAAW,GAAqB;gBACpC,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,IAAI;gBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC;YACF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC9B,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,wEAAwE;YACxE,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,UAAU,EAAG,GAAa,CAAC,OAAO;aACnC,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FleetChild } from "./manifest.js";
|
|
2
|
+
export interface ScaffoldResult {
|
|
3
|
+
folder: string;
|
|
4
|
+
absPath: string;
|
|
5
|
+
configWritten: boolean;
|
|
6
|
+
gitInitialized: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ChildScaffolder {
|
|
10
|
+
scaffold(rootDir: string, child: FleetChild): Promise<ScaffoldResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=scaffolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffolder.d.ts","sourceRoot":"","sources":["../../src/fleet/scaffolder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,qBAAa,eAAe;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;CA0E5E"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { mkdir, writeFile, readdir, stat } from "node:fs/promises";
|
|
2
|
+
import { resolve, join } from "node:path";
|
|
3
|
+
import { execa } from "execa";
|
|
4
|
+
import { buildChildConfig } from "./child-config.js";
|
|
5
|
+
// ── Scaffolder ───────────────────────────────────────────────────────
|
|
6
|
+
export class ChildScaffolder {
|
|
7
|
+
async scaffold(rootDir, child) {
|
|
8
|
+
const absPath = resolve(rootDir, child.folder);
|
|
9
|
+
// 1. Non-empty safety check — bail untouched if folder exists and has entries
|
|
10
|
+
try {
|
|
11
|
+
const statResult = await stat(absPath);
|
|
12
|
+
if (statResult.isDirectory()) {
|
|
13
|
+
const entries = await readdir(absPath);
|
|
14
|
+
if (entries.length > 0) {
|
|
15
|
+
return {
|
|
16
|
+
folder: child.folder,
|
|
17
|
+
absPath,
|
|
18
|
+
configWritten: false,
|
|
19
|
+
gitInitialized: false,
|
|
20
|
+
error: "folder exists and is non-empty",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// stat failed → folder does not exist, proceed to create
|
|
27
|
+
}
|
|
28
|
+
// 2. Create the directory (recursive so intermediate dirs are made)
|
|
29
|
+
try {
|
|
30
|
+
await mkdir(absPath, { recursive: true });
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
return {
|
|
34
|
+
folder: child.folder,
|
|
35
|
+
absPath,
|
|
36
|
+
configWritten: false,
|
|
37
|
+
gitInitialized: false,
|
|
38
|
+
error: `mkdir failed: ${err.message}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// 3. Write bober.config.json using the Zod-valid config from buildChildConfig
|
|
42
|
+
try {
|
|
43
|
+
const configJson = JSON.stringify(buildChildConfig(child), null, 2);
|
|
44
|
+
await writeFile(join(absPath, "bober.config.json"), configJson, "utf-8");
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
return {
|
|
48
|
+
folder: child.folder,
|
|
49
|
+
absPath,
|
|
50
|
+
configWritten: false,
|
|
51
|
+
gitInitialized: false,
|
|
52
|
+
error: `writeFile failed: ${err.message}`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// 4. git init — reject:false so a non-zero exit is captured, not thrown
|
|
56
|
+
let gitInitialized = false;
|
|
57
|
+
let gitError;
|
|
58
|
+
try {
|
|
59
|
+
const gitResult = await execa("git", ["init"], {
|
|
60
|
+
cwd: absPath,
|
|
61
|
+
reject: false,
|
|
62
|
+
});
|
|
63
|
+
if (gitResult.exitCode === 0) {
|
|
64
|
+
gitInitialized = true;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
gitError = `git init exited ${gitResult.exitCode}: ${gitResult.stderr}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
gitError = `git init spawn error: ${err.message}`;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
folder: child.folder,
|
|
75
|
+
absPath,
|
|
76
|
+
configWritten: true,
|
|
77
|
+
gitInitialized,
|
|
78
|
+
...(gitError !== undefined ? { error: gitError } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=scaffolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffolder.js","sourceRoot":"","sources":["../../src/fleet/scaffolder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,OAAO,EA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der.js";
|
|
2
|
+
import type { ChildSpawnResult } from "./runner.js";
|
|
3
|
+
import type { RunState } from "../mcp/run-manager.js";
|
|
4
|
+
/** Result of fanning one child through scaffold → run. Produced by FleetCoordinator. */
|
|
5
|
+
export interface ChildExecution {
|
|
6
|
+
folder: string;
|
|
7
|
+
scaffold: ScaffoldResult;
|
|
8
|
+
spawn?: ChildSpawnResult;
|
|
9
|
+
}
|
|
10
|
+
export type ChildStatus = "completed" | "failed" | "other";
|
|
11
|
+
export type OutcomeSource = "disk" | "exit-code";
|
|
12
|
+
/** Resolved status for one child, produced by OutcomeAggregator. */
|
|
13
|
+
export interface ChildOutcome {
|
|
14
|
+
folder: string;
|
|
15
|
+
status: ChildStatus;
|
|
16
|
+
source: OutcomeSource;
|
|
17
|
+
exitCode?: number;
|
|
18
|
+
runId?: string;
|
|
19
|
+
runState?: RunState;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fleet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAID,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,CAAC;AAEjD,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/fleet/types.ts"],"names":[],"mappings":""}
|
package/dist/graph/cli.d.ts
CHANGED
|
@@ -21,12 +21,16 @@ export declare class TokensaveCli {
|
|
|
21
21
|
private readonly binary;
|
|
22
22
|
constructor(cwd: string, store?: GraphArtifactStore | null, binary?: string);
|
|
23
23
|
/**
|
|
24
|
-
* Run `tokensave init
|
|
24
|
+
* Run `tokensave init` (full index of the project at `cwd`).
|
|
25
|
+
*
|
|
26
|
+
* NOTE: tokensave's `init` has no `--tier` flag (that was a pre-6.x API).
|
|
27
|
+
* `languageTier` is now a bober-level concept recorded in the manifest only,
|
|
28
|
+
* so it is accepted for caller convenience but NOT forwarded to the binary.
|
|
25
29
|
* Resolves on exit code 0; throws a structured Error on non-zero.
|
|
26
30
|
*/
|
|
27
31
|
init(opts: {
|
|
28
32
|
cwd?: string;
|
|
29
|
-
languageTier
|
|
33
|
+
languageTier?: string;
|
|
30
34
|
}): Promise<void>;
|
|
31
35
|
/**
|
|
32
36
|
* Run `tokensave sync <paths...>` with a timeout.
|
package/dist/graph/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/graph/cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAID;;;;;;;GAOG;AACH,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,kBAAkB,GAAG,IAAW,EACvC,MAAM,GAAE,MAAoB;IAG/C
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/graph/cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAID;;;;;;;GAOG;AACH,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,kBAAkB,GAAG,IAAW,EACvC,MAAM,GAAE,MAAoB;IAG/C;;;;;;;OAOG;IACG,IAAI,CAAC,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBxE;;;;;;;;OAQG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA+CnE;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;CA+CtC"}
|
package/dist/graph/cli.js
CHANGED
|
@@ -18,18 +18,28 @@ export class TokensaveCli {
|
|
|
18
18
|
this.binary = binary;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Run `tokensave init
|
|
21
|
+
* Run `tokensave init` (full index of the project at `cwd`).
|
|
22
|
+
*
|
|
23
|
+
* NOTE: tokensave's `init` has no `--tier` flag (that was a pre-6.x API).
|
|
24
|
+
* `languageTier` is now a bober-level concept recorded in the manifest only,
|
|
25
|
+
* so it is accepted for caller convenience but NOT forwarded to the binary.
|
|
22
26
|
* Resolves on exit code 0; throws a structured Error on non-zero.
|
|
23
27
|
*/
|
|
24
28
|
async init(opts) {
|
|
25
29
|
const effectiveCwd = opts.cwd ?? this.cwd;
|
|
26
|
-
const result = await execa(this.binary, ["init"
|
|
30
|
+
const result = await execa(this.binary, ["init"], {
|
|
27
31
|
cwd: effectiveCwd,
|
|
28
32
|
reject: false,
|
|
29
33
|
all: true,
|
|
34
|
+
// tokensave prompts to create/gitignore; with no TTY it auto-accepts.
|
|
35
|
+
input: "",
|
|
30
36
|
});
|
|
31
37
|
if (result.exitCode !== 0) {
|
|
32
38
|
const output = result.all ?? result.stdout ?? result.stderr ?? "";
|
|
39
|
+
// `init` is idempotent from bober's perspective: an already-initialised
|
|
40
|
+
// project is a success, not an error (caller refreshes the manifest).
|
|
41
|
+
if (/already initialized/i.test(output))
|
|
42
|
+
return;
|
|
33
43
|
throw new Error(`tokensave init failed (exit ${result.exitCode ?? -1}): ${output.slice(0, 500)}`);
|
|
34
44
|
}
|
|
35
45
|
}
|
|
@@ -57,8 +67,10 @@ export class TokensaveCli {
|
|
|
57
67
|
const output = result.all ?? result.stdout ?? result.stderr ?? "";
|
|
58
68
|
throw new Error(`tokensave sync failed (exit ${result.exitCode ?? -1}): ${output.slice(0, 500)}`);
|
|
59
69
|
}
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
// tokensave prints its summary ("N added, M modified, K removed") to
|
|
71
|
+
// stderr, so parse the combined `all` stream rather than stdout alone.
|
|
72
|
+
const combined = result.all ?? result.stdout ?? "";
|
|
73
|
+
const indexed = parseSyncOutput(combined);
|
|
62
74
|
// Update manifest via store if injected
|
|
63
75
|
if (this.store) {
|
|
64
76
|
try {
|
|
@@ -101,9 +113,21 @@ export class TokensaveCli {
|
|
|
101
113
|
}
|
|
102
114
|
try {
|
|
103
115
|
const parsed = JSON.parse(stdout);
|
|
116
|
+
// tokensave `status --json` returns {node_count, edge_count, file_count,
|
|
117
|
+
// nodes_by_kind, ...}. There is no `ready`/`indexedFileCount` field and no
|
|
118
|
+
// version, so derive `ready` from the presence of an index (file_count).
|
|
119
|
+
// Tolerate the legacy {ready, indexedFileCount, tokensaveVersion} shape too.
|
|
120
|
+
const fileCount = typeof parsed.file_count === "number"
|
|
121
|
+
? parsed.file_count
|
|
122
|
+
: typeof parsed.indexedFileCount === "number"
|
|
123
|
+
? parsed.indexedFileCount
|
|
124
|
+
: 0;
|
|
125
|
+
const ready = parsed.ready === true ||
|
|
126
|
+
typeof parsed.file_count === "number" ||
|
|
127
|
+
typeof parsed.node_count === "number";
|
|
104
128
|
return {
|
|
105
|
-
ready
|
|
106
|
-
indexedFileCount:
|
|
129
|
+
ready,
|
|
130
|
+
indexedFileCount: fileCount,
|
|
107
131
|
tokensaveVersion: typeof parsed.tokensaveVersion === "string" ? parsed.tokensaveVersion : "",
|
|
108
132
|
};
|
|
109
133
|
}
|
|
@@ -115,14 +139,20 @@ export class TokensaveCli {
|
|
|
115
139
|
}
|
|
116
140
|
// ── Helpers ────────────────────────────────────────────────────────
|
|
117
141
|
/**
|
|
118
|
-
* Parse
|
|
119
|
-
*
|
|
142
|
+
* Parse the number of indexed files from tokensave sync output.
|
|
143
|
+
*
|
|
144
|
+
* tokensave 6.x prints a human summary like
|
|
145
|
+
* "✔ sync done — 3 added, 1 modified, 0 removed in 41ms"
|
|
146
|
+
* (with ANSI colour codes), so we sum added + modified. Legacy JSON
|
|
147
|
+
* (`{"indexed": N}`) and `indexed: N` key-value forms are still accepted.
|
|
120
148
|
*/
|
|
121
|
-
function parseSyncOutput(
|
|
122
|
-
|
|
149
|
+
function parseSyncOutput(output) {
|
|
150
|
+
// Strip ANSI escape sequences before matching.
|
|
151
|
+
// eslint-disable-next-line no-control-regex
|
|
152
|
+
const trimmed = output.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g, "").trim();
|
|
123
153
|
if (!trimmed)
|
|
124
154
|
return 0;
|
|
125
|
-
// Try direct JSON parse
|
|
155
|
+
// Try direct JSON parse (legacy shape)
|
|
126
156
|
try {
|
|
127
157
|
const obj = JSON.parse(trimmed);
|
|
128
158
|
if (typeof obj.indexed === "number")
|
|
@@ -131,7 +161,18 @@ function parseSyncOutput(stdout) {
|
|
|
131
161
|
catch {
|
|
132
162
|
// Fall through
|
|
133
163
|
}
|
|
134
|
-
//
|
|
164
|
+
// Incremental sync summary: "N added, M modified, K removed"
|
|
165
|
+
const added = /(\d+)\s+added/.exec(trimmed);
|
|
166
|
+
const modified = /(\d+)\s+modified/.exec(trimmed);
|
|
167
|
+
if (added || modified) {
|
|
168
|
+
return ((added ? parseInt(added[1], 10) : 0) +
|
|
169
|
+
(modified ? parseInt(modified[1], 10) : 0));
|
|
170
|
+
}
|
|
171
|
+
// Full re-index summary (--force): "indexing done — N files, ... nodes"
|
|
172
|
+
const files = /(\d+)\s+files\b/.exec(trimmed);
|
|
173
|
+
if (files)
|
|
174
|
+
return parseInt(files[1], 10);
|
|
175
|
+
// Legacy key-value pattern like "indexed: 42"
|
|
135
176
|
const match = /indexed["\s:]+(\d+)/.exec(trimmed);
|
|
136
177
|
if (match)
|
|
137
178
|
return parseInt(match[1], 10);
|
package/dist/graph/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/graph/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAe9B,sEAAsE;AAEtE;;;;;;;GAOG;AACH,MAAM,OAAO,YAAY;IAEJ;IACA;IACA;IAHnB,YACmB,GAAW,EACX,QAAmC,IAAI,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,OAAO,CACL,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;IACJ,CAAC;IAED,wEAAwE;IACxE,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,KAAK;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzC,8CAA8C;IAC9C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,KAAK;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzC,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -42,6 +42,15 @@ declare class GraphPipelineLifecycleImpl {
|
|
|
42
42
|
*/
|
|
43
43
|
stop(): Promise<void>;
|
|
44
44
|
engineHealth(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Project root of the active pipeline, or null when not started.
|
|
47
|
+
*
|
|
48
|
+
* Used by PreflightContextInjector to resolve a telemetry sink when the
|
|
49
|
+
* injector was constructed without an explicit projectRoot (the common case
|
|
50
|
+
* at most agent call sites). Lets graph-preflight telemetry fire for every
|
|
51
|
+
* role with zero changes to the call sites.
|
|
52
|
+
*/
|
|
53
|
+
projectRootOrNull(): string | null;
|
|
45
54
|
/**
|
|
46
55
|
* Lazy accessor for the GraphClient instance.
|
|
47
56
|
* Returns null if the engine is not 'ready'.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-lifecycle.d.ts","sourceRoot":"","sources":["../../src/graph/pipeline-lif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AaZ,aAAa;IAS3B,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,wBAAwB;CAMjC;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,4BAAmC,CAAC;AAGvE,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -140,6 +140,18 @@ class GraphPipelineLifecycleImpl {
|
|
|
140
140
|
return "starting";
|
|
141
141
|
return this.mcpClient.health();
|
|
142
142
|
}
|
|
143
|
+
// ── projectRootOrNull ─────────────────────────────────────────────
|
|
144
|
+
/**
|
|
145
|
+
* Project root of the active pipeline, or null when not started.
|
|
146
|
+
*
|
|
147
|
+
* Used by PreflightContextInjector to resolve a telemetry sink when the
|
|
148
|
+
* injector was constructed without an explicit projectRoot (the common case
|
|
149
|
+
* at most agent call sites). Lets graph-preflight telemetry fire for every
|
|
150
|
+
* role with zero changes to the call sites.
|
|
151
|
+
*/
|
|
152
|
+
projectRootOrNull() {
|
|
153
|
+
return this.projectRoot;
|
|
154
|
+
}
|
|
143
155
|
// ── getGraphClient ────────────────────────────────────────────────
|
|
144
156
|
/**
|
|
145
157
|
* Lazy accessor for the GraphClient instance.
|