@getpipher/armory-fleet 0.16.0 → 1.1.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/README.md +98 -1
- package/package.json +1 -1
- package/src/engine/retry-fallback.ts +14 -0
- package/src/engine/spawnSubagent.ts +13 -4
- package/src/index.ts +186 -4
- package/src/panel/fleet-panel.ts +62 -9
- package/src/panel/live-timeline.ts +32 -0
- package/src/rpc/event-bus.ts +105 -0
- package/src/rpc/rpc-server.ts +284 -0
- package/src/runtime/async-runner.ts +17 -4
- package/src/runtime/run-journal.ts +11 -0
- package/src/runtime/run-log.ts +15 -0
- package/src/settings/fleet-settings.ts +103 -0
- package/src/tools/subagent.ts +8 -1
- package/src/workflows/runtime/adapters.ts +3 -0
package/src/tools/subagent.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { statSync } from "node:fs";
|
|
4
4
|
import { Type, type Static } from "typebox";
|
|
5
|
-
import type { AgentDef } from "../registry/frontmatter.ts";
|
|
5
|
+
import type { AgentDef, ThinkingLevel } from "../registry/frontmatter.ts";
|
|
6
6
|
import type { TodoSyncPort } from "../todo-sync/port.ts";
|
|
7
7
|
import type { RunRegistry } from "../engine/run-registry.ts";
|
|
8
8
|
import type { ForegroundLock } from "../engine/concurrency-lock.ts";
|
|
@@ -96,6 +96,10 @@ export interface SubagentToolDeps {
|
|
|
96
96
|
* Per-dispatch `modelFallback` (when passed) takes precedence. Applies to the direct foreground
|
|
97
97
|
* path, the foreground lifecycle spawn, and the background/scheduled spawn. */
|
|
98
98
|
defaultModelFallback?: string;
|
|
99
|
+
/** #78: fleet-wide default thinking level for subagents (settings.json `defaultSubagentThinking`).
|
|
100
|
+
* Applied when the agent frontmatter does NOT pin `thinkingLevel`. Threads to every spawn
|
|
101
|
+
* path (direct, lifecycle phase, fallback retry) exactly like `defaultModelFallback`. */
|
|
102
|
+
defaultSubagentThinking?: ThinkingLevel;
|
|
99
103
|
/** SPEC-6-5: notify hook for cross-cwd dispatch surfacing. Wired from ctx.ui.notify in index.ts. */
|
|
100
104
|
onNotify?: (message: string, kind?: "info" | "warning" | "error") => void;
|
|
101
105
|
}
|
|
@@ -155,6 +159,7 @@ export function createSubagentTool(deps: SubagentToolDeps) {
|
|
|
155
159
|
backendRegistry: deps.backendRegistry, parentModel: deps.parentModel, parentCwd: deps.parentCwd, runLog: deps.runLog, signal,
|
|
156
160
|
maxTurns: params.maxTurns,
|
|
157
161
|
tierRegistry: deps.tierRegistry, modelRegistry: deps.modelRegistry,
|
|
162
|
+
defaultThinkingLevel: deps.defaultSubagentThinking,
|
|
158
163
|
readOnly: params.readOnly,
|
|
159
164
|
cwd: o.cwd,
|
|
160
165
|
}), params.modelFallback ?? deps.defaultModelFallback, signal),
|
|
@@ -192,6 +197,7 @@ export function createSubagentTool(deps: SubagentToolDeps) {
|
|
|
192
197
|
signal,
|
|
193
198
|
maxTurns: params.maxTurns,
|
|
194
199
|
tierRegistry: deps.tierRegistry, modelRegistry: deps.modelRegistry,
|
|
200
|
+
defaultThinkingLevel: deps.defaultSubagentThinking,
|
|
195
201
|
cwd: resolvedCwd,
|
|
196
202
|
});
|
|
197
203
|
// #39: auto-retry on a retryable provider rate-limit / auth failure (stopReason "error").
|
|
@@ -227,6 +233,7 @@ export function createSubagentTool(deps: SubagentToolDeps) {
|
|
|
227
233
|
signal,
|
|
228
234
|
maxTurns: params.maxTurns,
|
|
229
235
|
tierRegistry: deps.tierRegistry, modelRegistry: deps.modelRegistry,
|
|
236
|
+
defaultThinkingLevel: deps.defaultSubagentThinking,
|
|
230
237
|
cwd: resolvedCwd,
|
|
231
238
|
});
|
|
232
239
|
retriedWithModel = fallback;
|
|
@@ -22,6 +22,8 @@ export interface WorkflowAdapterBase {
|
|
|
22
22
|
runLog?: unknown
|
|
23
23
|
tierRegistry?: unknown
|
|
24
24
|
modelRegistry?: unknown
|
|
25
|
+
/** #78: fleet-wide default thinking level, threaded into every workflow child spawn. */
|
|
26
|
+
defaultThinkingLevel?: SpawnOptions["defaultThinkingLevel"]
|
|
25
27
|
lifecycleDeps: unknown
|
|
26
28
|
spawnSubagentFn: (opts: SpawnOptions) => Promise<SpawnResult>
|
|
27
29
|
runLifecycleFn: (task: string, name: string, opts: LifecycleRunOpts) => Promise<LifecycleRunResult>
|
|
@@ -69,6 +71,7 @@ export function createWorkflowAdapters(
|
|
|
69
71
|
...(base.runLog ? { runLog: base.runLog as SpawnOptions["runLog"] } : {}),
|
|
70
72
|
...(base.tierRegistry ? { tierRegistry: base.tierRegistry as SpawnOptions["tierRegistry"] } : {}),
|
|
71
73
|
...(base.modelRegistry ? { modelRegistry: base.modelRegistry as SpawnOptions["modelRegistry"] } : {}),
|
|
74
|
+
...(base.defaultThinkingLevel ? { defaultThinkingLevel: base.defaultThinkingLevel } : {}),
|
|
72
75
|
})
|
|
73
76
|
|
|
74
77
|
const combineSignal = (timeoutMs?: number): AbortSignal => {
|