@caupulican/pi-adaptative 0.94.1 → 0.95.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/CHANGELOG.md +39 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/README.md +32 -13
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts +7 -4
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +173 -293
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +247 -392
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.d.ts +52 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.d.ts.map +1 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.js +118 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.js.map +1 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/launch-profile.ts +169 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/templates/builder-validator.json +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/templates/provider-prompt-smoke.json +1 -1
- package/dist/bundled-resources/skills/pi-harness-learning/SKILL.md +13 -7
- package/dist/bundled-resources/skills/worker-profile-writer/SKILL.md +11 -11
- package/dist/core/agent-session.d.ts +11 -41
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +93 -160
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.d.ts +6 -1
- package/dist/core/autonomy/envelope-enforcement.d.ts.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.js +26 -25
- package/dist/core/autonomy/envelope-enforcement.js.map +1 -1
- package/dist/core/autonomy/lane-private-paths.d.ts.map +1 -1
- package/dist/core/autonomy/lane-private-paths.js +2 -1
- package/dist/core/autonomy/lane-private-paths.js.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.d.ts +8 -8
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.js +45 -30
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
- package/dist/core/autonomy/worker-session-private-scope.d.ts +12 -0
- package/dist/core/autonomy/worker-session-private-scope.d.ts.map +1 -0
- package/dist/core/autonomy/worker-session-private-scope.js +42 -0
- package/dist/core/autonomy/worker-session-private-scope.js.map +1 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.d.ts +65 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.d.ts.map +1 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.js +145 -0
- package/dist/core/autonomy/worker-tool-adapter-registry.js.map +1 -0
- package/dist/core/background-lane-controller.d.ts +1 -1
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +1 -1
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/background-tool-task-controller.d.ts +8 -2
- package/dist/core/background-tool-task-controller.d.ts.map +1 -1
- package/dist/core/background-tool-task-controller.js +10 -2
- package/dist/core/background-tool-task-controller.js.map +1 -1
- package/dist/core/cost-guard-controller.d.ts +37 -0
- package/dist/core/cost-guard-controller.d.ts.map +1 -0
- package/dist/core/cost-guard-controller.js +71 -0
- package/dist/core/cost-guard-controller.js.map +1 -0
- package/dist/core/cost-guard.d.ts +9 -4
- package/dist/core/cost-guard.d.ts.map +1 -1
- package/dist/core/cost-guard.js +7 -3
- package/dist/core/cost-guard.js.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.d.ts +1 -1
- package/dist/core/delegation/worker-attempt-executor.d.ts.map +1 -1
- package/dist/core/delegation/worker-attempt-executor.js +0 -1
- package/dist/core/delegation/worker-attempt-executor.js.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.d.ts +16 -3
- package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.js +114 -55
- package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
- package/dist/core/delegation/worker-claim.d.ts +1 -2
- package/dist/core/delegation/worker-claim.d.ts.map +1 -1
- package/dist/core/delegation/worker-claim.js.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.d.ts +19 -6
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.js +125 -40
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
- package/dist/core/delegation/worker-delegation-request.d.ts +3 -3
- package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-request.js +13 -19
- package/dist/core/delegation/worker-delegation-request.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts +3 -2
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +54 -39
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/delegation/worker-fleet-limits.d.ts +3 -3
- package/dist/core/delegation/worker-fleet-limits.d.ts.map +1 -1
- package/dist/core/delegation/worker-fleet-limits.js +7 -7
- package/dist/core/delegation/worker-fleet-limits.js.map +1 -1
- package/dist/core/delegation/worker-machine-scope.d.ts +12 -0
- package/dist/core/delegation/worker-machine-scope.d.ts.map +1 -0
- package/dist/core/delegation/worker-machine-scope.js +38 -0
- package/dist/core/delegation/worker-machine-scope.js.map +1 -0
- package/dist/core/delegation/worker-recovery-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-recovery-coordinator.js +6 -1
- package/dist/core/delegation/worker-recovery-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +5 -7
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +1 -4
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/delegation/worker-write-reservation-coordinator.d.ts +3 -2
- package/dist/core/delegation/worker-write-reservation-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-write-reservation-coordinator.js +50 -25
- package/dist/core/delegation/worker-write-reservation-coordinator.js.map +1 -1
- package/dist/core/durable-custom-message-turn-controller.d.ts +6 -0
- package/dist/core/durable-custom-message-turn-controller.d.ts.map +1 -1
- package/dist/core/durable-custom-message-turn-controller.js +38 -15
- package/dist/core/durable-custom-message-turn-controller.js.map +1 -1
- package/dist/core/extension-binding-controller.d.ts +5 -1
- package/dist/core/extension-binding-controller.d.ts.map +1 -1
- package/dist/core/extension-binding-controller.js +15 -0
- package/dist/core/extension-binding-controller.js.map +1 -1
- package/dist/core/extensions/factory-runtime.d.ts.map +1 -1
- package/dist/core/extensions/factory-runtime.js +5 -0
- package/dist/core/extensions/factory-runtime.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.d.ts +14 -0
- package/dist/core/foreground-terminal-handoff-controller.d.ts.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.js +188 -72
- package/dist/core/foreground-terminal-handoff-controller.js.map +1 -1
- package/dist/core/goals/goal-session-controller.d.ts +2 -0
- package/dist/core/goals/goal-session-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-session-controller.js +8 -0
- package/dist/core/goals/goal-session-controller.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +5 -4
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +23 -19
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/learning/auto-learn-settings.d.ts +84 -0
- package/dist/core/learning/auto-learn-settings.d.ts.map +1 -0
- package/dist/core/learning/auto-learn-settings.js +66 -0
- package/dist/core/learning/auto-learn-settings.js.map +1 -0
- package/dist/core/learning/reflection-engine.d.ts +4 -0
- package/dist/core/learning/reflection-engine.d.ts.map +1 -1
- package/dist/core/learning/reflection-engine.js +48 -10
- package/dist/core/learning/reflection-engine.js.map +1 -1
- package/dist/core/local-prefix-warm-controller.d.ts +24 -0
- package/dist/core/local-prefix-warm-controller.d.ts.map +1 -0
- package/dist/core/local-prefix-warm-controller.js +79 -0
- package/dist/core/local-prefix-warm-controller.js.map +1 -0
- package/dist/core/memory/providers/file-store.d.ts +2 -0
- package/dist/core/memory/providers/file-store.d.ts.map +1 -1
- package/dist/core/memory/providers/file-store.js +71 -15
- package/dist/core/memory/providers/file-store.js.map +1 -1
- package/dist/core/memory/worker-memory-tools.d.ts +5 -0
- package/dist/core/memory/worker-memory-tools.d.ts.map +1 -0
- package/dist/core/memory/worker-memory-tools.js +5 -0
- package/dist/core/memory/worker-memory-tools.js.map +1 -0
- package/dist/core/model-capability.d.ts +7 -0
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +12 -0
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -10
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-router-controller.d.ts +3 -2
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +3 -2
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/orchestration/contracts.d.ts +16 -12
- package/dist/core/orchestration/contracts.d.ts.map +1 -1
- package/dist/core/orchestration/contracts.js +2 -2
- package/dist/core/orchestration/contracts.js.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.d.ts +2 -2
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js +6 -1
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
- package/dist/core/orchestration/profile-registry.d.ts.map +1 -1
- package/dist/core/orchestration/profile-registry.js +14 -0
- package/dist/core/orchestration/profile-registry.js.map +1 -1
- package/dist/core/orchestration/task-profile-writer.d.ts +7 -4
- package/dist/core/orchestration/task-profile-writer.d.ts.map +1 -1
- package/dist/core/orchestration/task-profile-writer.js +71 -59
- package/dist/core/orchestration/task-profile-writer.js.map +1 -1
- package/dist/core/orchestration/thinking-level-schema.d.ts +7 -0
- package/dist/core/orchestration/thinking-level-schema.d.ts.map +1 -0
- package/dist/core/orchestration/thinking-level-schema.js +19 -0
- package/dist/core/orchestration/thinking-level-schema.js.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -1
- package/dist/core/orchestration/worker-execution-contract.js +12 -5
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -1
- package/dist/core/provider-prompt-contracts.d.ts +1 -4
- package/dist/core/provider-prompt-contracts.d.ts.map +1 -1
- package/dist/core/provider-prompt-contracts.js +4 -10
- package/dist/core/provider-prompt-contracts.js.map +1 -1
- package/dist/core/provider-request-context-controller.d.ts +2 -0
- package/dist/core/provider-request-context-controller.d.ts.map +1 -1
- package/dist/core/provider-request-context-controller.js +10 -3
- package/dist/core/provider-request-context-controller.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +56 -27
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +206 -117
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +1 -0
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +25 -14
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.js +55 -10
- package/dist/core/secrets/credential-exposure-guard.js.map +1 -1
- package/dist/core/session-role.d.ts +6 -8
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +8 -18
- package/dist/core/session-role.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -16
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +53 -50
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skill-vault.d.ts +15 -0
- package/dist/core/skill-vault.d.ts.map +1 -1
- package/dist/core/skill-vault.js +79 -45
- package/dist/core/skill-vault.js.map +1 -1
- package/dist/core/skills.d.ts +3 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -6
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +2 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +52 -12
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts +3 -0
- package/dist/core/tool-capability-policy.d.ts.map +1 -1
- package/dist/core/tool-capability-policy.js +13 -2
- package/dist/core/tool-capability-policy.js.map +1 -1
- package/dist/core/toolkit/script-runner.d.ts +2 -1
- package/dist/core/toolkit/script-runner.d.ts.map +1 -1
- package/dist/core/toolkit/script-runner.js +10 -2
- package/dist/core/toolkit/script-runner.js.map +1 -1
- package/dist/core/tools/delegate-status.d.ts +1 -1
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +1 -1
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +4 -15
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +111 -73
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/goal.d.ts +3 -4
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +24 -7
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/profile-writer.d.ts +2 -8
- package/dist/core/tools/profile-writer.d.ts.map +1 -1
- package/dist/core/tools/profile-writer.js +6 -18
- package/dist/core/tools/profile-writer.js.map +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts +1 -1
- package/dist/core/tools/run-toolkit-script.d.ts.map +1 -1
- package/dist/core/tools/run-toolkit-script.js +2 -2
- package/dist/core/tools/run-toolkit-script.js.map +1 -1
- package/dist/core/tools/skill-audit.d.ts +28 -1
- package/dist/core/tools/skill-audit.d.ts.map +1 -1
- package/dist/core/tools/skill-audit.js +56 -12
- package/dist/core/tools/skill-audit.js.map +1 -1
- package/dist/core/tools/skill.d.ts +12 -1
- package/dist/core/tools/skill.d.ts.map +1 -1
- package/dist/core/tools/skill.js +52 -0
- package/dist/core/tools/skill.js.map +1 -1
- package/dist/core/tools/skillify.d.ts.map +1 -1
- package/dist/core/tools/skillify.js +16 -7
- package/dist/core/tools/skillify.js.map +1 -1
- package/dist/core/tools/task-steps.js +1 -1
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/tmux-dispatch.d.ts +4 -16
- package/dist/core/tools/tmux-dispatch.d.ts.map +1 -1
- package/dist/core/tools/tmux-dispatch.js +5 -20
- package/dist/core/tools/tmux-dispatch.js.map +1 -1
- package/dist/core/worktree-sync/codes.d.ts +1 -2
- package/dist/core/worktree-sync/codes.d.ts.map +1 -1
- package/dist/core/worktree-sync/codes.js +1 -2
- package/dist/core/worktree-sync/codes.js.map +1 -1
- package/dist/core/worktree-sync/lane-gate.d.ts +4 -8
- package/dist/core/worktree-sync/lane-gate.d.ts.map +1 -1
- package/dist/core/worktree-sync/lane-gate.js +5 -51
- package/dist/core/worktree-sync/lane-gate.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.d.ts +6 -7
- package/dist/modes/interactive/auto-learn-controller.d.ts.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.js +30 -207
- package/dist/modes/interactive/auto-learn-controller.js.map +1 -1
- package/dist/modes/interactive/autonomy-commands.js +2 -2
- package/dist/modes/interactive/autonomy-commands.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +17 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.js +2 -2
- package/dist/modes/interactive/components/fitness-role-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +150 -73
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +8 -4
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.d.ts.map +1 -1
- package/dist/modes/interactive/settings-selector-flow.js +10 -0
- package/dist/modes/interactive/settings-selector-flow.js.map +1 -1
- package/docs/extensions.md +8 -0
- package/docs/harness-architecture.md +28 -32
- package/docs/index.md +1 -1
- package/docs/process-matrix.md +8 -6
- package/docs/resources.md +1 -1
- package/docs/settings.md +61 -51
- package/docs/tmux-agent-manager.md +47 -40
- package/docs/usage.md +1 -1
- package/docs/worker-profiles.md +8 -6
- package/docs/worktree-sync.md +26 -20
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts +0 -133
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts.map +0 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js +0 -199
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js.map +0 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.ts +0 -312
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AgentTool } from "@caupulican/pi-agent-core";
|
|
2
|
+
import type { TSchema } from "typebox";
|
|
3
|
+
import type { ArtifactStore } from "../context/context-artifacts.ts";
|
|
4
|
+
import { type CredentialExposureBoundary } from "../secrets/credential-exposure-guard.ts";
|
|
5
|
+
import { type RunToolkitScriptDependencies } from "../tools/run-toolkit-script.ts";
|
|
6
|
+
import { type ReadOnlySkillBroker } from "../tools/skill.ts";
|
|
7
|
+
import { type SkillAuditToolOptions } from "../tools/skill-audit.ts";
|
|
8
|
+
/**
|
|
9
|
+
* Host-owned inputs available while constructing one fresh worker tool.
|
|
10
|
+
*
|
|
11
|
+
* An adapter is deliberately a factory, not a live AgentTool. This keeps worker retries and
|
|
12
|
+
* concurrent lanes from sharing mutable foreground/session state. The host owns the broker
|
|
13
|
+
* callbacks and is responsible for preserving its cancellation and credential boundaries.
|
|
14
|
+
*/
|
|
15
|
+
export interface WorkerToolAdapterContext {
|
|
16
|
+
cwd: string;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
credentialBoundary?: CredentialExposureBoundary;
|
|
19
|
+
}
|
|
20
|
+
export type WorkerToolAdapterFactory = (context: WorkerToolAdapterContext) => AgentTool<TSchema, unknown>;
|
|
21
|
+
export interface WorkerToolAdapter {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly create: WorkerToolAdapterFactory;
|
|
25
|
+
}
|
|
26
|
+
/** Root/session controls are never brokered into a leaf, even when a host registers factories. */
|
|
27
|
+
export declare const WORKER_TOOL_ADAPTER_FORBIDDEN_NAMES: ReadonlySet<string>;
|
|
28
|
+
/** Adapter names with host-owned factories; explicit profiles must have these active in foreground. */
|
|
29
|
+
export declare const WORKER_TOOL_ADAPTER_NAMES: ReadonlySet<string>;
|
|
30
|
+
export type WorkerToolAdapterMaterialization = {
|
|
31
|
+
ok: true;
|
|
32
|
+
tool: AgentTool<TSchema, unknown>;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
reason: string;
|
|
36
|
+
};
|
|
37
|
+
export interface WorkerToolAdapterSources {
|
|
38
|
+
/** Session-owned packed output store; retrieval is bounded and identifier-only. */
|
|
39
|
+
artifactStore?: ArtifactStore;
|
|
40
|
+
/** Host-owned script registry and bounded executor. */
|
|
41
|
+
runToolkitScript?: RunToolkitScriptDependencies;
|
|
42
|
+
/** Optional brokered read-only skill surface. */
|
|
43
|
+
skill?: ReadOnlySkillBroker;
|
|
44
|
+
/** Optional read-only skill audit broker with host-path redaction. */
|
|
45
|
+
skillAudit?: Pick<SkillAuditToolOptions, "getSkills" | "maxSkills" | "maxComparisonPairs" | "maxDraftFieldChars"> & Required<Pick<SkillAuditToolOptions, "redactPath">>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Registry for the small set of foreground capabilities that can be brokered safely to a leaf
|
|
49
|
+
* worker. It owns no session state and never clones or returns the foreground tool instance.
|
|
50
|
+
*
|
|
51
|
+
* Extension/MCP tools must be registered explicitly by a host broker. A missing registration is
|
|
52
|
+
* a deterministic unsupported result so an omitted inherited tool cannot silently disappear.
|
|
53
|
+
*/
|
|
54
|
+
export declare class WorkerToolAdapterRegistry {
|
|
55
|
+
private readonly adapters;
|
|
56
|
+
register(adapter: WorkerToolAdapter): this;
|
|
57
|
+
has(name: string): boolean;
|
|
58
|
+
names(): readonly string[];
|
|
59
|
+
description(name: string): string | undefined;
|
|
60
|
+
materialize(name: string, context: WorkerToolAdapterContext): WorkerToolAdapterMaterialization;
|
|
61
|
+
}
|
|
62
|
+
/** Build the default safe adapters from host-owned brokers. Omitted sources stay unsupported. */
|
|
63
|
+
export declare function createWorkerToolAdapterRegistry(sources?: WorkerToolAdapterSources): WorkerToolAdapterRegistry;
|
|
64
|
+
export declare function unsupportedWorkerToolReason(name: string): string;
|
|
65
|
+
//# sourceMappingURL=worker-tool-adapter-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-tool-adapter-registry.d.ts","sourceRoot":"","sources":["../../../src/core/autonomy/worker-tool-adapter-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,KAAK,0BAA0B,EAA6B,MAAM,yCAAyC,CAAC;AAErH,OAAO,EAEN,KAAK,4BAA4B,EACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAqC,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAKN,KAAK,qBAAqB,EAC1B,MAAM,yBAAyB,CAAC;AAGjC;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;CAChD;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAE1G,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;CAC1C;AAED,kGAAkG;AAClG,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAAC,MAAM,CAuBlE,CAAC;AAEH,uGAAuG;AACvG,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,CAKxD,CAAC;AAEH,MAAM,MAAM,gCAAgC,GACzC;IAAE,EAAE,EAAE,IAAI,CA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-exposure-guard.js";
|
|
3
|
+
import { createArtifactRetrieveTool } from "../tools/artifact-retrieve.js";
|
|
4
|
+
import { createRunToolkitScriptToolDefinition, } from "../tools/run-toolkit-script.js";
|
|
5
|
+
import { createReadOnlySkillToolDefinition } from "../tools/skill.js";
|
|
6
|
+
import { createSkillAuditToolDefinition, DEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS, DEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS, DEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS, } from "../tools/skill-audit.js";
|
|
7
|
+
import { wrapToolDefinition } from "../tools/tool-definition-wrapper.js";
|
|
8
|
+
/** Root/session controls are never brokered into a leaf, even when a host registers factories. */
|
|
9
|
+
export const WORKER_TOOL_ADAPTER_FORBIDDEN_NAMES = new Set([
|
|
10
|
+
"delegate",
|
|
11
|
+
"tmux_dispatch",
|
|
12
|
+
"tmux_agent_manager",
|
|
13
|
+
"context_scout",
|
|
14
|
+
ROOT_MEMORY_TOOL_NAME,
|
|
15
|
+
WORKER_MEMORY_READ_TOOL_NAME,
|
|
16
|
+
"goal",
|
|
17
|
+
"get_goal",
|
|
18
|
+
"update_goal",
|
|
19
|
+
"task_steps",
|
|
20
|
+
"pipeline",
|
|
21
|
+
"tool_task",
|
|
22
|
+
"ask_question",
|
|
23
|
+
"secret_store",
|
|
24
|
+
"settings",
|
|
25
|
+
"session",
|
|
26
|
+
"credential",
|
|
27
|
+
"model_fitness",
|
|
28
|
+
"improvement_loop",
|
|
29
|
+
"skillify",
|
|
30
|
+
"extensionify",
|
|
31
|
+
"worktree_sync",
|
|
32
|
+
]);
|
|
33
|
+
/** Adapter names with host-owned factories; explicit profiles must have these active in foreground. */
|
|
34
|
+
export const WORKER_TOOL_ADAPTER_NAMES = new Set([
|
|
35
|
+
"artifact_retrieve",
|
|
36
|
+
"run_toolkit_script",
|
|
37
|
+
"skill",
|
|
38
|
+
"skill_audit",
|
|
39
|
+
]);
|
|
40
|
+
/**
|
|
41
|
+
* Registry for the small set of foreground capabilities that can be brokered safely to a leaf
|
|
42
|
+
* worker. It owns no session state and never clones or returns the foreground tool instance.
|
|
43
|
+
*
|
|
44
|
+
* Extension/MCP tools must be registered explicitly by a host broker. A missing registration is
|
|
45
|
+
* a deterministic unsupported result so an omitted inherited tool cannot silently disappear.
|
|
46
|
+
*/
|
|
47
|
+
export class WorkerToolAdapterRegistry {
|
|
48
|
+
constructor() {
|
|
49
|
+
this.adapters = new Map();
|
|
50
|
+
}
|
|
51
|
+
register(adapter) {
|
|
52
|
+
const name = adapter.name.trim();
|
|
53
|
+
if (!name)
|
|
54
|
+
throw new TypeError("Worker tool adapter name must not be empty.");
|
|
55
|
+
if (WORKER_TOOL_ADAPTER_FORBIDDEN_NAMES.has(name.toLowerCase())) {
|
|
56
|
+
throw new Error(`worker_tool_adapter_forbidden:${name}`);
|
|
57
|
+
}
|
|
58
|
+
if (this.adapters.has(name))
|
|
59
|
+
throw new Error(`Duplicate worker tool adapter: ${name}`);
|
|
60
|
+
this.adapters.set(name, Object.freeze({ ...adapter, name }));
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
has(name) {
|
|
64
|
+
return this.adapters.has(name);
|
|
65
|
+
}
|
|
66
|
+
names() {
|
|
67
|
+
return [...this.adapters.keys()];
|
|
68
|
+
}
|
|
69
|
+
description(name) {
|
|
70
|
+
return this.adapters.get(name)?.description;
|
|
71
|
+
}
|
|
72
|
+
materialize(name, context) {
|
|
73
|
+
const adapter = this.adapters.get(name);
|
|
74
|
+
if (!adapter)
|
|
75
|
+
return { ok: false, reason: unsupportedWorkerToolReason(name) };
|
|
76
|
+
try {
|
|
77
|
+
const tool = adapter.create({ ...context });
|
|
78
|
+
if (tool.name !== name) {
|
|
79
|
+
return {
|
|
80
|
+
ok: false,
|
|
81
|
+
reason: `worker_tool_adapter_contract_violation:${name}:created=${tool.name}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return { ok: true, tool };
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return {
|
|
88
|
+
ok: false,
|
|
89
|
+
reason: `worker_tool_adapter_failed:${name}:${error instanceof Error ? error.message : String(error)}`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Build the default safe adapters from host-owned brokers. Omitted sources stay unsupported. */
|
|
95
|
+
export function createWorkerToolAdapterRegistry(sources = {}) {
|
|
96
|
+
const registry = new WorkerToolAdapterRegistry();
|
|
97
|
+
if (sources.artifactStore) {
|
|
98
|
+
registry.register({
|
|
99
|
+
name: "artifact_retrieve",
|
|
100
|
+
description: "Retrieve a bounded slice from a host-owned packed tool-output artifact.",
|
|
101
|
+
create: (context) => createArtifactRetrieveTool(context.cwd, { artifactStore: sources.artifactStore }),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (sources.runToolkitScript) {
|
|
105
|
+
registry.register({
|
|
106
|
+
name: "run_toolkit_script",
|
|
107
|
+
description: "Run a registered toolkit script through the host-owned bounded executor.",
|
|
108
|
+
create: (context) => {
|
|
109
|
+
const dependencies = sources.runToolkitScript;
|
|
110
|
+
return wrapToolDefinition(createRunToolkitScriptToolDefinition({
|
|
111
|
+
...dependencies,
|
|
112
|
+
getScripts: () => dependencies
|
|
113
|
+
.getScripts()
|
|
114
|
+
.filter((script) => !context.credentialBoundary ||
|
|
115
|
+
!isProtectedCredentialPath(script.path, context.cwd, context.credentialBoundary)),
|
|
116
|
+
}));
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (sources.skill) {
|
|
121
|
+
registry.register({
|
|
122
|
+
name: "skill",
|
|
123
|
+
description: "Use the host-owned read-only skill broker.",
|
|
124
|
+
create: () => wrapToolDefinition(createReadOnlySkillToolDefinition(sources.skill)),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (sources.skillAudit) {
|
|
128
|
+
const skillAudit = sources.skillAudit;
|
|
129
|
+
registry.register({
|
|
130
|
+
name: "skill_audit",
|
|
131
|
+
description: "Audit skills through the host-owned read-only broker.",
|
|
132
|
+
create: (context) => wrapToolDefinition(createSkillAuditToolDefinition(context.cwd, {
|
|
133
|
+
...skillAudit,
|
|
134
|
+
maxSkills: Math.min(skillAudit.maxSkills ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS, DEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS),
|
|
135
|
+
maxComparisonPairs: Math.min(skillAudit.maxComparisonPairs ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS, DEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS),
|
|
136
|
+
maxDraftFieldChars: Math.min(skillAudit.maxDraftFieldChars ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS, DEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS),
|
|
137
|
+
})),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return registry;
|
|
141
|
+
}
|
|
142
|
+
export function unsupportedWorkerToolReason(name) {
|
|
143
|
+
return `worker_tool_adapter_unavailable:${name}`;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=worker-tool-adapter-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-tool-adapter-registry.js","sourceRoot":"","sources":["../../../src/core/autonomy/worker-tool-adapter-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACvG,OAAO,EAAmC,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACrH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACN,oCAAoC,GAEpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iCAAiC,EAA4B,MAAM,mBAAmB,CAAC;AAChG,OAA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AC,OAAO,CAAC,KAAM,CAAC,CAAC;SACnF,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,QAAQ,CAAC,QAAQ,CAAC;YACjB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,uDAAuD;YACpE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,kBAAkB,CACjB,8BAA8B,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC3C,GAAG,UAAU;gBACb,SAAS,EAAE,IAAI,CAAC,GAAG,CAClB,UAAU,CAAC,SAAS,IAAI,qCAAqC,EAC7D,qCAAqC,CACrC;gBACD,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAC3B,UAAU,CAAC,kBAAkB,IAAI,+CAA+C,EAChF,+CAA+C,CAC/C;gBACD,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAC3B,UAAU,CAAC,kBAAkB,IAAI,gDAAgD,EACjF,gDAAgD,CAChD;aACD,CAAC,CACF;SACF,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACvD,OAAO,mCAAmC,IAAI,EAAE,CAAC;AAClD,CAAC","sourcesContent":["import type { AgentTool } from \"@caupulican/pi-agent-core\";\nimport type { TSchema } from \"typebox\";\nimport type { ArtifactStore } from \"../context/context-artifacts.ts\";\nimport { ROOT_MEMORY_TOOL_NAME, WORKER_MEMORY_READ_TOOL_NAME } from \"../memory/worker-memory-tools.ts\";\nimport { type CredentialExposureBoundary, isProtectedCredentialPath } from \"../secrets/credential-exposure-guard.ts\";\nimport { createArtifactRetrieveTool } from \"../tools/artifact-retrieve.ts\";\nimport {\n\tcreateRunToolkitScriptToolDefinition,\n\ttype RunToolkitScriptDependencies,\n} from \"../tools/run-toolkit-script.ts\";\nimport { createReadOnlySkillToolDefinition, type ReadOnlySkillBroker } from \"../tools/skill.ts\";\nimport {\n\tcreateSkillAuditToolDefinition,\n\tDEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS,\n\tDEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS,\n\tDEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS,\n\ttype SkillAuditToolOptions,\n} from \"../tools/skill-audit.ts\";\nimport { wrapToolDefinition } from \"../tools/tool-definition-wrapper.ts\";\n\n/**\n * Host-owned inputs available while constructing one fresh worker tool.\n *\n * An adapter is deliberately a factory, not a live AgentTool. This keeps worker retries and\n * concurrent lanes from sharing mutable foreground/session state. The host owns the broker\n * callbacks and is responsible for preserving its cancellation and credential boundaries.\n */\nexport interface WorkerToolAdapterContext {\n\tcwd: string;\n\tsignal?: AbortSignal;\n\tcredentialBoundary?: CredentialExposureBoundary;\n}\n\nexport type WorkerToolAdapterFactory = (context: WorkerToolAdapterContext) => AgentTool<TSchema, unknown>;\n\nexport interface WorkerToolAdapter {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly create: WorkerToolAdapterFactory;\n}\n\n/** Root/session controls are never brokered into a leaf, even when a host registers factories. */\nexport const WORKER_TOOL_ADAPTER_FORBIDDEN_NAMES: ReadonlySet<string> = new Set([\n\t\"delegate\",\n\t\"tmux_dispatch\",\n\t\"tmux_agent_manager\",\n\t\"context_scout\",\n\tROOT_MEMORY_TOOL_NAME,\n\tWORKER_MEMORY_READ_TOOL_NAME,\n\t\"goal\",\n\t\"get_goal\",\n\t\"update_goal\",\n\t\"task_steps\",\n\t\"pipeline\",\n\t\"tool_task\",\n\t\"ask_question\",\n\t\"secret_store\",\n\t\"settings\",\n\t\"session\",\n\t\"credential\",\n\t\"model_fitness\",\n\t\"improvement_loop\",\n\t\"skillify\",\n\t\"extensionify\",\n\t\"worktree_sync\",\n]);\n\n/** Adapter names with host-owned factories; explicit profiles must have these active in foreground. */\nexport const WORKER_TOOL_ADAPTER_NAMES: ReadonlySet<string> = new Set([\n\t\"artifact_retrieve\",\n\t\"run_toolkit_script\",\n\t\"skill\",\n\t\"skill_audit\",\n]);\n\nexport type WorkerToolAdapterMaterialization =\n\t| { ok: true; tool: AgentTool<TSchema, unknown> }\n\t| { ok: false; reason: string };\n\nexport interface WorkerToolAdapterSources {\n\t/** Session-owned packed output store; retrieval is bounded and identifier-only. */\n\tartifactStore?: ArtifactStore;\n\t/** Host-owned script registry and bounded executor. */\n\trunToolkitScript?: RunToolkitScriptDependencies;\n\t/** Optional brokered read-only skill surface. */\n\tskill?: ReadOnlySkillBroker;\n\t/** Optional read-only skill audit broker with host-path redaction. */\n\tskillAudit?: Pick<SkillAuditToolOptions, \"getSkills\" | \"maxSkills\" | \"maxComparisonPairs\" | \"maxDraftFieldChars\"> &\n\t\tRequired<Pick<SkillAuditToolOptions, \"redactPath\">>;\n}\n\n/**\n * Registry for the small set of foreground capabilities that can be brokered safely to a leaf\n * worker. It owns no session state and never clones or returns the foreground tool instance.\n *\n * Extension/MCP tools must be registered explicitly by a host broker. A missing registration is\n * a deterministic unsupported result so an omitted inherited tool cannot silently disappear.\n */\nexport class WorkerToolAdapterRegistry {\n\tprivate readonly adapters = new Map<string, WorkerToolAdapter>();\n\n\tregister(adapter: WorkerToolAdapter): this {\n\t\tconst name = adapter.name.trim();\n\t\tif (!name) throw new TypeError(\"Worker tool adapter name must not be empty.\");\n\t\tif (WORKER_TOOL_ADAPTER_FORBIDDEN_NAMES.has(name.toLowerCase())) {\n\t\t\tthrow new Error(`worker_tool_adapter_forbidden:${name}`);\n\t\t}\n\t\tif (this.adapters.has(name)) throw new Error(`Duplicate worker tool adapter: ${name}`);\n\t\tthis.adapters.set(name, Object.freeze({ ...adapter, name }));\n\t\treturn this;\n\t}\n\n\thas(name: string): boolean {\n\t\treturn this.adapters.has(name);\n\t}\n\n\tnames(): readonly string[] {\n\t\treturn [...this.adapters.keys()];\n\t}\n\n\tdescription(name: string): string | undefined {\n\t\treturn this.adapters.get(name)?.description;\n\t}\n\n\tmaterialize(name: string, context: WorkerToolAdapterContext): WorkerToolAdapterMaterialization {\n\t\tconst adapter = this.adapters.get(name);\n\t\tif (!adapter) return { ok: false, reason: unsupportedWorkerToolReason(name) };\n\t\ttry {\n\t\t\tconst tool = adapter.create({ ...context });\n\t\t\tif (tool.name !== name) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\treason: `worker_tool_adapter_contract_violation:${name}:created=${tool.name}`,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn { ok: true, tool };\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\treason: `worker_tool_adapter_failed:${name}:${error instanceof Error ? error.message : String(error)}`,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/** Build the default safe adapters from host-owned brokers. Omitted sources stay unsupported. */\nexport function createWorkerToolAdapterRegistry(sources: WorkerToolAdapterSources = {}): WorkerToolAdapterRegistry {\n\tconst registry = new WorkerToolAdapterRegistry();\n\tif (sources.artifactStore) {\n\t\tregistry.register({\n\t\t\tname: \"artifact_retrieve\",\n\t\t\tdescription: \"Retrieve a bounded slice from a host-owned packed tool-output artifact.\",\n\t\t\tcreate: (context) => createArtifactRetrieveTool(context.cwd, { artifactStore: sources.artifactStore }),\n\t\t});\n\t}\n\tif (sources.runToolkitScript) {\n\t\tregistry.register({\n\t\t\tname: \"run_toolkit_script\",\n\t\t\tdescription: \"Run a registered toolkit script through the host-owned bounded executor.\",\n\t\t\tcreate: (context) => {\n\t\t\t\tconst dependencies = sources.runToolkitScript!;\n\t\t\t\treturn wrapToolDefinition(\n\t\t\t\t\tcreateRunToolkitScriptToolDefinition({\n\t\t\t\t\t\t...dependencies,\n\t\t\t\t\t\tgetScripts: () =>\n\t\t\t\t\t\t\tdependencies\n\t\t\t\t\t\t\t\t.getScripts()\n\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t(script) =>\n\t\t\t\t\t\t\t\t\t\t!context.credentialBoundary ||\n\t\t\t\t\t\t\t\t\t\t!isProtectedCredentialPath(script.path, context.cwd, context.credentialBoundary),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\t}\n\tif (sources.skill) {\n\t\tregistry.register({\n\t\t\tname: \"skill\",\n\t\t\tdescription: \"Use the host-owned read-only skill broker.\",\n\t\t\tcreate: () => wrapToolDefinition(createReadOnlySkillToolDefinition(sources.skill!)),\n\t\t});\n\t}\n\tif (sources.skillAudit) {\n\t\tconst skillAudit = sources.skillAudit;\n\t\tregistry.register({\n\t\t\tname: \"skill_audit\",\n\t\t\tdescription: \"Audit skills through the host-owned read-only broker.\",\n\t\t\tcreate: (context) =>\n\t\t\t\twrapToolDefinition(\n\t\t\t\t\tcreateSkillAuditToolDefinition(context.cwd, {\n\t\t\t\t\t\t...skillAudit,\n\t\t\t\t\t\tmaxSkills: Math.min(\n\t\t\t\t\t\t\tskillAudit.maxSkills ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS,\n\t\t\t\t\t\t\tDEFAULT_WORKER_SKILL_AUDIT_MAX_SKILLS,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmaxComparisonPairs: Math.min(\n\t\t\t\t\t\t\tskillAudit.maxComparisonPairs ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS,\n\t\t\t\t\t\t\tDEFAULT_WORKER_SKILL_AUDIT_MAX_COMPARISON_PAIRS,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmaxDraftFieldChars: Math.min(\n\t\t\t\t\t\t\tskillAudit.maxDraftFieldChars ?? DEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS,\n\t\t\t\t\t\t\tDEFAULT_WORKER_SKILL_AUDIT_MAX_DRAFT_FIELD_CHARS,\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t});\n\t}\n\treturn registry;\n}\n\nexport function unsupportedWorkerToolReason(name: string): string {\n\treturn `worker_tool_adapter_unavailable:${name}`;\n}\n"]}
|
|
@@ -164,7 +164,7 @@ export declare class BackgroundLaneController implements WorkerAgentControlPort
|
|
|
164
164
|
context?: string;
|
|
165
165
|
goalId?: string;
|
|
166
166
|
}): Promise<ResearchLaneRunOutcome>;
|
|
167
|
-
/** Start a durable
|
|
167
|
+
/** Start a durable leaf worker with inherited, preset, or model-selected authority. */
|
|
168
168
|
startWorkerDelegation(request: WorkerDelegationRequest): {
|
|
169
169
|
started: false;
|
|
170
170
|
skipReason: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-lane-controller.d.ts","sourceRoot":"","sources":["../../src/core/background-lane-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAwB,KAAK,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAGhG,OAAO,KAAK,EACX,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACX,oCAAoC,EACpC,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,KAAK,8BAA8B,EACnC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE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BAAmB,CAAC,OAAO,CAAC,EAAE;QACnC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAElC;IACD,
|
|
1
|
+
{"version":3,"file":"background-lane-controller.d.ts","sourceRoot":"","sources":["../../src/core/background-lane-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAwB,KAAK,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAGhG,OAAO,KAAK,EACX,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACX,oCAAoC,EACpC,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,KAAK,8BAA8B,EACnC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB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G;IACnG,uBAAuB,IAAI,mBAAmB,EAAE,CAE/C;CACD"}
|
|
@@ -308,7 +308,7 @@ export class BackgroundLaneController {
|
|
|
308
308
|
async runResearchLaneOnce(request) {
|
|
309
309
|
return this._research.runOnce(request);
|
|
310
310
|
}
|
|
311
|
-
/** Start a durable
|
|
311
|
+
/** Start a durable leaf worker with inherited, preset, or model-selected authority. */
|
|
312
312
|
startWorkerDelegation(request) {
|
|
313
313
|
return this._getWorkerController().start(request);
|
|
314
314
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-lane-controller.js","sourceRoot":"","sources":["../../src/core/background-lane-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,EAAE,oBAAoB,EAAmB,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAsBhF,OAAO,EACN,0BAA0B,GAE1B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEhG,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAYtF,OAAO,EAAE,iBAAiB,EAA8B,MAAM,mCAAmC,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAmC,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,sBAAsB,EAAmC,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAwBpE,MAAM,OAAO,wBAAwB;IAmBpC;oGACgG;IACxF,SAAS,CAAC,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AAI,CAAC,CAAC;IAChC,CAAC;IAED,mGAAmG;IACnG,4BAA4B;QAC3B,IAAI,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE;YAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,CAAC;IAC7E,CAAC;IAED,mGAAmG;IACnG,uBAAuB;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;CACD","sourcesContent":["/**\n * Execution-plane coordinator for goal continuation, research, managed lanes, worker delegation,\n * and model fitness.\n *\n * Coordination state is owned by focused controllers. This coordinator retains one AgentSession\n * composition seam and a shared lane read model. Everything it needs\n * — the session manager, settings, model registry, live model, capability envelope, the goal\n * continuation LOOP, the isolated-completion primitive, spawned-usage accounting, and the telemetry\n * sink — is reached through narrow deps accessors rather than the whole AgentSession.\n *\n * Drive-loop boundary (deliberate): the idle triggers ({@link scheduleGoalAutoContinueFromIdle},\n * {@link scheduleResearchLaneFromIdle}) are invoked from the session's prompt tail as one-line\n * delegations; goal auto-continue itself only ever asks the session to `continueGoalLoop`, so this\n * controller never touches `prompt()`, the last-assistant-message, retry, or streaming state.\n */\n\nimport type { Api, Model } from \"@caupulican/pi-ai\";\nimport type {\n\tGoalContinuationLoopOptions,\n\tGoalContinuationLoopResult,\n\tPromptOptions,\n\tResearchLaneRunOutcome,\n\tWorkerDelegationRunOutcome,\n} from \"./agent-session-contracts.ts\";\nimport { isLaneTerminalStatus, type LaneRecord, LaneTracker } from \"./autonomy/lane-tracker.ts\";\nimport { appendLaneRecordSnapshot, getLatestLaneRecordSnapshots } from \"./autonomy/session-lane-record.ts\";\nimport { ManagedLaneController } from \"./delegation/managed-lane-controller.ts\";\nimport type {\n\tSessionRootReply,\n\tSessionRootReplyQuery,\n\tSessionRootReplyWaitOptions,\n\tSessionRootReplyWaitResult,\n} from \"./delegation/session-root-mailbox.ts\";\nimport type {\n\tSessionRootWorkerAgentMessageOptions,\n\tWorkerAgentActivity,\n\tWorkerAgentBroadcastOptions,\n\tWorkerAgentBroadcastResult,\n\tWorkerAgentControlPort,\n\tWorkerAgentControlScope,\n\tWorkerAgentMessageOptions,\n\tWorkerAgentReplyResult,\n\tWorkerAgentRetireResult,\n\tWorkerAgentTaskStartOptions,\n\tWorkerAgentTranscriptOptions,\n\tWorkerAgentWaitMode,\n\tWorkerAgentWaitResult,\n} from \"./delegation/worker-agent-control.ts\";\nimport {\n\tWorkerDelegationController,\n\ttype WorkerDelegationControllerDeps,\n} from \"./delegation/worker-delegation-controller.ts\";\nimport type { WorkerDelegationRequest } from \"./delegation/worker-delegation-request.ts\";\nimport { WorkerLifecycle } from \"./delegation/worker-lifecycle.ts\";\nimport { WorkerNotificationCoordinator } from \"./delegation/worker-notification-coordinator.ts\";\nimport type { ManagedLaneEvent } from \"./extensions/types.ts\";\nimport { GoalAutoContinueController } from \"./goals/goal-auto-continue-controller.ts\";\nimport type { GoalRuntimeSnapshot, GoalRuntimeSnapshotSettings } from \"./goals/goal-runtime-snapshot.ts\";\nimport type { GoalState } from \"./goals/goal-state.ts\";\nimport type { ModelCapabilityProfile } from \"./model-capability.ts\";\nimport type { StoredFitnessReport } from \"./models/fitness-store.ts\";\nimport type { WorkerResultContract } from \"./orchestration/contracts.ts\";\nimport type {\n\tTaskProfileCreateInput,\n\tTaskProfileCreateResult,\n\tTaskProfileInspection,\n} from \"./orchestration/task-profile-writer.ts\";\nimport type { TaskRuntimeProjection } from \"./orchestration/task-runtime.ts\";\nimport { LaneModelResolver, type LaneModelResolverDeps } from \"./research/lane-model-resolver.ts\";\nimport type { ModelFitnessReport } from \"./research/model-fitness.ts\";\nimport { ModelFitnessController, type ModelFitnessControllerDeps } from \"./research/model-fitness-controller.ts\";\nimport { ResearchLaneController, type ResearchLaneControllerDeps } from \"./research/research-lane-controller.ts\";\nimport { getActiveSessionBranchEntries } from \"./session-snapshot.ts\";\n\nexport { isLocalExecutionModel } from \"./delegation/worker-delegation-controller.ts\";\nexport { clampLaneMaxUsd } from \"./research/lane-model-resolver.ts\";\n\nexport interface BackgroundLaneControllerDeps\n\textends WorkerDelegationControllerDeps,\n\t\tResearchLaneControllerDeps,\n\t\tModelFitnessControllerDeps,\n\t\tLaneModelResolverDeps {\n\t/** True iff the active surface can terminalize a goal through `goal` or `update_goal`.\n\t * Explicit tool/profile exclusion and the worker-role ceiling still disable continuation. */\n\tisGoalToolActive(): boolean;\n\t/** Capability profile of the SESSION model (gates background lanes, scales continuation budgets). */\n\tgetModelCapabilityProfile(): ModelCapabilityProfile;\n\t/** Continuation gate + goal state for the idle autosteer scheduler. */\n\tgetGoalRuntimeSnapshot(settings: GoalRuntimeSnapshotSettings): GoalRuntimeSnapshot;\n\t/** Drive-loop boundary: the session's bounded goal-continuation loop (owns `prompt()`, not us). */\n\tcontinueGoalLoop(options: GoalContinuationLoopOptions): Promise<GoalContinuationLoopResult>;\n\t/** True while the session owns a foreground prompt/retry/follow-up run. */\n\tisForegroundBusy(): boolean;\n\t/** Resolve only after the complete foreground retry/follow-up run releases the session. */\n\twaitForForegroundIdle(): Promise<void>;\n\t/** Persist an explicit stopped state when the selected surface cannot drive the active goal. */\n\tmarkGoalToolUnavailable(): void;\n}\n\nexport class BackgroundLaneController implements WorkerAgentControlPort {\n\t/** Live lane registry — the real source for AutonomyStatusSnapshot.activeLaneCount. */\n\tprivate readonly _laneTracker = new LaneTracker();\n\tprivate readonly _laneModels: LaneModelResolver;\n\tprivate readonly _goalAutoContinue: GoalAutoContinueController;\n\tprivate readonly _research: ResearchLaneController;\n\tprivate readonly _fitness: ModelFitnessController;\n\t/** Lazily materialized only when managed-lane state is queried or reported. */\n\tprivate _managedLanes: ManagedLaneController | undefined;\n\t/** Lazily materialized so a UAC surface without `delegate` allocates no worker runtime state. */\n\tprivate _workers: WorkerDelegationController | undefined;\n\t/** One durable lifecycle shared by every worker execution adapter. */\n\tprivate _workerLifecycle: WorkerLifecycle | undefined;\n\t/** Shared terminal outbox for managed and in-process workers; lazy under UAC omission. */\n\tprivate _workerNotifications: WorkerNotificationCoordinator | undefined;\n\t/** Active event waits consume matching terminal edges before a redundant parent wake is admitted. */\n\tprivate readonly _workerWaitConsumers = new Map<string, number>();\n\tprivate readonly deps: BackgroundLaneControllerDeps;\n\n\t/** Emit a warning without ever throwing — used from disposal-adjacent persistence where a\n\t * listener failure (or a bare test double missing `emit`) must never block or crash cleanup. */\n\tprivate _safeWarn(message: string): void {\n\t\ttry {\n\t\t\tthis.deps.emit({ type: \"warning\", message });\n\t\t} catch {\n\t\t\t// Dispose must never throw.\n\t\t}\n\t}\n\n\tprivate _recordWorkerTerminal(record: LaneRecord, durableNotificationId: string): void {\n\t\tthis._getWorkerNotificationCoordinator().recordTerminal(record, durableNotificationId);\n\t}\n\n\tconstructor(deps: BackgroundLaneControllerDeps) {\n\t\tthis.deps = deps;\n\t\tthis._laneModels = new LaneModelResolver(deps);\n\t\tthis._research = new ResearchLaneController(deps, this._laneTracker, this._laneModels);\n\t\tthis._fitness = new ModelFitnessController(deps, this._laneModels);\n\t\tthis._goalAutoContinue = new GoalAutoContinueController({\n\t\t\tisDisposed: deps.isDisposed,\n\t\t\tisGoalToolActive: deps.isGoalToolActive,\n\t\t\tgetSettingsManager: deps.getSettingsManager,\n\t\t\tgetGoalRuntimeSnapshot: deps.getGoalRuntimeSnapshot,\n\t\t\thasInFlightLaneForGoal: (goalId) => this._hasInFlightLaneForGoal(goalId),\n\t\t\tcontinueGoalLoop: deps.continueGoalLoop,\n\t\t\tisForegroundBusy: deps.isForegroundBusy,\n\t\t\twaitForForegroundIdle: deps.waitForForegroundIdle,\n\t\t\tmarkGoalToolUnavailable: deps.markGoalToolUnavailable,\n\t\t\temit: deps.emit,\n\t\t});\n\t}\n\n\tprivate _getWorkerController(): WorkerDelegationController {\n\t\tthis._workers ??= new WorkerDelegationController(\n\t\t\tthis.deps,\n\t\t\tthis._getWorkerNotificationCoordinator(),\n\t\t\tthis._getWorkerLifecycle(),\n\t\t);\n\t\treturn this._workers;\n\t}\n\n\tprivate _getWorkerLifecycle(): WorkerLifecycle {\n\t\tif (this._workerLifecycle) return this._workerLifecycle;\n\t\tconst lifecycle = new WorkerLifecycle({\n\t\t\tagentDir: this.deps.getAgentDir(),\n\t\t\tsessionId: this.deps.getSessionId(),\n\t\t});\n\t\tthis._workerLifecycle = lifecycle;\n\t\tfor (const notification of lifecycle.getPendingTerminalNotifications()) {\n\t\t\tthis._getWorkerNotificationCoordinator().recordTerminal(notification.record, notification.notificationId);\n\t\t}\n\t\treturn lifecycle;\n\t}\n\n\tprivate _getWorkerNotificationCoordinator(): WorkerNotificationCoordinator {\n\t\tthis._workerNotifications ??= new WorkerNotificationCoordinator({\n\t\t\tgetWorkerRecords: () => this._workerLifecycle?.getAllRecords() ?? [],\n\t\t\temitStatus: (status) => {\n\t\t\t\t// Runs once per flush, with the EXACT batch about to be handed to notify() -- the\n\t\t\t\t// natural checkpoint to backfill durability before that batch can get stuck behind\n\t\t\t\t// an unsettled notify() call with no durable trace. (getOutstandingRecords() is not\n\t\t\t\t// usable here: the coordinator emits status BEFORE moving this same batch from\n\t\t\t\t// `pending` into `inFlight`, so at this exact moment it would report nothing\n\t\t\t\t// outstanding — status.terminalSinceFlush is the batch, directly, no timing gap.)\n\t\t\t\tthis._ensureDurableNotifications(status.terminalSinceFlush);\n\t\t\t\ttry {\n\t\t\t\t\tthis.deps.emit({\n\t\t\t\t\t\ttype: \"delegate_workers\",\n\t\t\t\t\t\t...status,\n\t\t\t\t\t\tterminalSinceFlush: [...status.terminalSinceFlush],\n\t\t\t\t\t});\n\t\t\t\t} catch {\n\t\t\t\t\t// A partial integration must not crash the event-driven terminal outbox.\n\t\t\t\t}\n\t\t\t},\n\t\t\tnotify: (records) => this.deps.notifyWorkerTerminalHandoff(records),\n\t\t\twarn: (message) => this._safeWarn(message),\n\t\t\tmarkDurableDelivered: (notificationIds) => this._workerLifecycle?.markNotificationsDelivered(notificationIds),\n\t\t\tisObserved: (record) => this._isWorkerTerminalAwaited(record),\n\t\t});\n\t\treturn this._workerNotifications;\n\t}\n\n\tprivate _workerAgentIdForRecord(record: Pick<LaneRecord, \"laneId\">): string {\n\t\tconst attempt =\n\t\t\tthis._workerLifecycle?.getActiveAttempt(record.laneId) ??\n\t\t\tthis._workerLifecycle?.getManagedAttempt(record.laneId);\n\t\treturn attempt?.agentId ?? attempt?.dispatch.logicalLaneId ?? record.laneId;\n\t}\n\n\tprivate _isWorkerTerminalAwaited(record: Pick<LaneRecord, \"laneId\">): boolean {\n\t\treturn (this._workerWaitConsumers.get(this._workerAgentIdForRecord(record)) ?? 0) > 0;\n\t}\n\n\tprivate _retainWorkerWaitConsumers(agentIds: readonly string[]): () => void {\n\t\tconst unique = [...new Set(agentIds)];\n\t\tfor (const agentId of unique) {\n\t\t\tthis._workerWaitConsumers.set(agentId, (this._workerWaitConsumers.get(agentId) ?? 0) + 1);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const agentId of unique) {\n\t\t\t\tconst remaining = (this._workerWaitConsumers.get(agentId) ?? 1) - 1;\n\t\t\t\tif (remaining > 0) this._workerWaitConsumers.set(agentId, remaining);\n\t\t\t\telse this._workerWaitConsumers.delete(agentId);\n\t\t\t}\n\t\t};\n\t}\n\n\t/** Observe only logical-agent terminals explicitly exposed by a bounded model result. */\n\tobserveWorkerAgentTerminals(agentIds: readonly string[]): void {\n\t\tif (!this._workerLifecycle) return;\n\t\tconst targets = new Set(agentIds);\n\t\tthis.observeWorkerTerminalRecords(\n\t\t\tthis.getLaneRecords().filter(\n\t\t\t\t(record) => isLaneTerminalStatus(record.status) && targets.has(this._workerAgentIdForRecord(record)),\n\t\t\t),\n\t\t);\n\t}\n\n\tobserveWorkerTerminalRecords(records: readonly LaneRecord[]): void {\n\t\tconst terminal = records.filter((record) => isLaneTerminalStatus(record.status));\n\t\tif (terminal.length > 0) this._getWorkerNotificationCoordinator().observeTerminals(terminal);\n\t}\n\n\t/**\n\t * Backfills a durable notification for every record about to be flushed, through the SAME\n\t * durable notification store `_getWorkerLifecycle()` already replays from on construction\n\t * (`getPendingTerminalNotifications()` / `markNotificationsDelivered()`) -- not a new\n\t * persistence subsystem. `WorkerLifecycle.getTerminalNotification()` is idempotent (it reuses\n\t * an existing durable entry for the same laneId/attemptId or creates exactly one), so calling\n\t * it for a record that already has a durable notification is a safe no-op. Without this, a\n\t * \"transient:<laneId>:<completedAt>\" record (recorded without a durableNotificationId — e.g.\n\t * because no attempt was resolvable at record time) has no trace in the durable ledger at all:\n\t * if it's still stuck behind an unresolved notify() when the process restarts, the replay on\n\t * the next construction can only find what was durably enqueued, so it would be lost instead of\n\t * replayed.\n\t */\n\tprivate _ensureDurableNotifications(records: readonly Pick<LaneRecord, \"laneId\">[]): void {\n\t\tif (!this._workerLifecycle) return;\n\t\tfor (const record of records) {\n\t\t\ttry {\n\t\t\t\tthis._workerLifecycle.getTerminalNotification(record.laneId);\n\t\t\t} catch (error) {\n\t\t\t\tthis._safeWarn(\n\t\t\t\t\t`Failed to durably back the worker terminal notification for ${record.laneId}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _getManagedLaneController(): ManagedLaneController {\n\t\tthis._managedLanes ??= new ManagedLaneController(\n\t\t\tthis.deps,\n\t\t\tthis._getWorkerLifecycle(),\n\t\t\t(record, notificationId) => this._recordWorkerTerminal(record, notificationId),\n\t\t\t(message) => this._safeWarn(message),\n\t\t);\n\t\treturn this._managedLanes;\n\t}\n\n\tprivate _hydrateManagedLanes(): void {\n\t\tif (this._managedLanes) {\n\t\t\tthis._managedLanes.ensureHydrated();\n\t\t\treturn;\n\t\t}\n\t\tconst hasPersistedActiveManagedLane = getLatestLaneRecordSnapshots(\n\t\t\tgetActiveSessionBranchEntries(this.deps.getSessionManager()),\n\t\t).some((record) => record.type === \"tmux-worker\" && (record.status === \"queued\" || record.status === \"running\"));\n\t\tif (hasPersistedActiveManagedLane) this._getManagedLaneController().ensureHydrated();\n\t}\n\n\t/** Live lane records tracked by this process (running and terminal). */\n\tgetLaneRecords(): LaneRecord[] {\n\t\tthis._hydrateManagedLanes();\n\t\tconst workerRecords =\n\t\t\tthis._workers?.getRecords() ??\n\t\t\t(this.deps.isDelegateToolActive?.() ? this._getWorkerController().getRecords() : []);\n\t\treturn [\n\t\t\t...this._laneTracker.getRecords(),\n\t\t\t...workerRecords,\n\t\t\t...(this._workerLifecycle?.getManagedRecords() ?? []),\n\t\t];\n\t}\n\n\t/** Does not materialize the worker controller when UAC omitted delegation. */\n\tgetTaskRuntimeSnapshot(): TaskRuntimeProjection | undefined {\n\t\treturn this._workerLifecycle?.getTaskRuntimeSnapshot();\n\t}\n\n\tgetWorkerResult(laneId: string): WorkerResultContract | undefined {\n\t\treturn this._workerLifecycle?.getResult(laneId);\n\t}\n\n\t/** Reconcile only when delegation has already been materialized; UAC omission stays zero-load. */\n\tsynchronizeGoalState(goal: GoalState): void {\n\t\tthis._workers?.synchronizeGoalState(goal);\n\t}\n\n\t/**\n\t * Resolve a tracked managed-lane dispatch. The caller's stable id is also the canonical durable\n\t * lane id, so this is an existence check rather than an id translation.\n\t */\n\tresolveManagedLaneId(callerLaneId: string): string | undefined {\n\t\treturn this._getManagedLaneController().resolve(callerLaneId);\n\t}\n\n\t/** Live count of active lanes — the real source for AutonomyStatusSnapshot.activeLaneCount. */\n\tgetActiveLaneCount(): number {\n\t\treturn this.getLaneRecords().filter((record) => record.status === \"queued\" || record.status === \"running\").length;\n\t}\n\n\t/** Belt-and-braces guard: whether ANY queued/running lane is tagged with this goalId. */\n\tprivate _hasInFlightLaneForGoal(goalId: string): boolean {\n\t\treturn this.getLaneRecords().some(\n\t\t\t(record) => record.goalId === goalId && (record.status === \"queued\" || record.status === \"running\"),\n\t\t);\n\t}\n\n\t/** Delegate the out-of-process dispatch/terminal claim to its single lifecycle owner. */\n\trecordManagedLane(event: ManagedLaneEvent): LaneRecord | undefined {\n\t\treturn this._getManagedLaneController().record(event);\n\t}\n\n\t/** Why the last idle research-lane evaluation skipped, for /autonomy diagnostics. */\n\tgetLastResearchLaneSkipReason(): string | undefined {\n\t\treturn this._research.getLastSkipReason();\n\t}\n\n\t/**\n\t * Abort in-flight research and delegate worker disposal to its single owning controller.\n\t *\n\t * This synchronous body is the LAST provably-safe write window for canceled/in-flight work.\n\t * `dispose()` (agent-session.ts) has already set the session's own disposed flag but has not yet\n\t * returned — no successor session (e.g. a `/reload` adoption) can exist yet, so an append here\n\t * cannot interleave with one; a post-await continuation resuming AFTER this method returns must\n\t * not append (see the disposed branch in `runWorkerDelegationOnce`). Persist FIRST, then\n\t * complete-in-memory, so a throw from one lane's persist cannot skip another's; each persist gets\n\t * its own try/catch — dispose must never throw.\n\t */\n\tabortInFlightLanes(): void {\n\t\tthis._goalAutoContinue.clearTimer();\n\t\tthis._research.abort();\n\t\tthis._fitness.abort();\n\t\tfor (const record of this._laneTracker.getRecords()) {\n\t\t\tif (record.status !== \"queued\" && record.status !== \"running\") continue;\n\t\t\tif (record.type === \"tmux-worker\") continue;\n\t\t\tconst canceled = this._laneTracker.complete(record.laneId, {\n\t\t\t\tstatus: \"canceled\",\n\t\t\t\treasonCode: \"session_disposed\",\n\t\t\t});\n\t\t\tif (!canceled) continue;\n\t\t\ttry {\n\t\t\t\tappendLaneRecordSnapshot(this.deps.getSessionManager(), canceled);\n\t\t\t} catch (error) {\n\t\t\t\tthis._safeWarn(\n\t\t\t\t\t`Failed to persist canceled lane record ${canceled.laneId}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis._managedLanes?.release();\n\n\t\tthis._workers?.abort();\n\t\tthis._workerNotifications?.dispose();\n\t}\n\n\tclearGoalAutoContinueTimer(): void {\n\t\tthis._goalAutoContinue.clearTimer();\n\t}\n\n\tscheduleGoalAutoContinueFromIdle(options?: PromptOptions): void {\n\t\tthis._goalAutoContinue.scheduleFromIdle(options);\n\t}\n\n\t/**\n\t * Single-flight entry point for EVERY goal-continuation loop invocation — idle autosteer\n\t * ({@link _runScheduledGoalAutoContinue}) AND the manual `/goal start` / `/goal-continue`\n\t * commands (reached through `AgentSession.continueGoalLoop`). Both paths ultimately submit\n\t * continuation prompts through the session's single `prompt()` path, so two loops racing throws\n\t * \"Agent is already processing\" from whichever submits second. `_isGoalAutoContinuing` is the\n\t * ONE owner of that mutex; `deps.continueGoalLoop` (the raw {@link GoalLoopController} loop)\n\t * must never be called directly outside this method, or the guard is bypassed.\n\t */\n\tasync continueGoalLoopExclusive(options: GoalContinuationLoopOptions): Promise<GoalContinuationLoopResult> {\n\t\treturn this._goalAutoContinue.continueExclusive(options);\n\t}\n\n\tclearResearchLaneTimer(): void {\n\t\tthis._research.clearTimer();\n\t}\n\n\tscheduleResearchLaneFromIdle(): void {\n\t\tthis._research.scheduleFromIdle();\n\t}\n\n\tresolveLaneModel(configuredPattern: string | undefined): Model<Api> | undefined {\n\t\treturn this._laneModels.resolveModel(configuredPattern);\n\t}\n\n\tgetOrchestrationProfileCatalog(): Array<{ profileId: string; role: string; description: string }> {\n\t\treturn this._getWorkerController().getProfileCatalog();\n\t}\n\n\tinspectTaskProfileOptions(): TaskProfileInspection {\n\t\treturn this._getWorkerController().inspectTaskProfileOptions();\n\t}\n\n\tcreateTaskProfile(input: TaskProfileCreateInput): TaskProfileCreateResult {\n\t\treturn this._getWorkerController().createTaskProfile(input);\n\t}\n\n\t/**\n\t * Run one bounded, read-only research pass and persist its results: evidence bundle snapshot,\n\t * terminal lane record, and spawned-usage cost report (single-hop invariant, idempotent on the\n\t * lane's reportId). Explicit calls (e.g. `/autonomy research`) express user intent and bypass the\n\t * enabled/mode/dedupe gates the idle scheduler enforces; budget and capability gates always apply.\n\t */\n\tasync runResearchLaneOnce(request?: {\n\t\tquery?: string;\n\t\tcontext?: string;\n\t\tgoalId?: string;\n\t}): Promise<ResearchLaneRunOutcome> {\n\t\treturn this._research.runOnce(request);\n\t}\n\t/** Start a durable recursive agent with inherited, preset, or model-selected authority. */\n\tstartWorkerDelegation(\n\t\trequest: WorkerDelegationRequest,\n\t): { started: false; skipReason: string } | { started: true; record: LaneRecord } {\n\t\treturn this._getWorkerController().start(request);\n\t}\n\n\t/** Durable logical-worker controls. Each checks UAC before materializing worker state. */\n\tlistWorkerAgents(scope?: WorkerAgentControlScope): ReturnType<WorkerAgentControlPort[\"listWorkerAgents\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().listWorkerAgents(scope);\n\t}\n\n\tgetWorkerTaskSessionView(): ReturnType<WorkerAgentControlPort[\"getWorkerTaskSessionView\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().getWorkerTaskSessionView();\n\t}\n\n\tgetWorkerAgentActivity(agentId: string, scope?: WorkerAgentControlScope): WorkerAgentActivity {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst activity = this._getWorkerController().getAgentControl().getWorkerAgentActivity(agentId, scope);\n\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\treturn activity;\n\t}\n\n\treadWorkerAgentTranscript(\n\t\tagentId: string,\n\t\toptions?: WorkerAgentTranscriptOptions,\n\t): ReturnType<WorkerAgentControlPort[\"readWorkerAgentTranscript\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst page = this._getWorkerController().getAgentControl().readWorkerAgentTranscript(agentId, options);\n\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\treturn page;\n\t}\n\n\tsendWorkerAgentMessage(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentMessageOptions,\n\t): { messageId: string; queued: true } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().sendWorkerAgentMessage(agentId, message, options);\n\t}\n\n\tfollowUpWorkerAgent(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentMessageOptions,\n\t): { started: boolean; steering: boolean; messageId: string; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().followUpWorkerAgent(agentId, message, options);\n\t}\n\n\tsendSessionRootWorkerAgentMessage(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: SessionRootWorkerAgentMessageOptions,\n\t): { messageId: string; queued: true } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().sendSessionRootWorkerAgentMessage(agentId, message, options);\n\t}\n\n\tfollowUpSessionRootWorkerAgent(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: SessionRootWorkerAgentMessageOptions,\n\t): { started: boolean; steering: boolean; messageId: string; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().followUpSessionRootWorkerAgent(agentId, message, options);\n\t}\n\n\treplyToWorkerAgentMessage(sourceAgentId: string, message: string, replyToMessageId: string): WorkerAgentReplyResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController()\n\t\t\t.getAgentControl()\n\t\t\t.replyToWorkerAgentMessage(sourceAgentId, message, replyToMessageId);\n\t}\n\n\tlistSessionRootReplies(query?: SessionRootReplyQuery): SessionRootReply[] {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().listSessionRootReplies(query);\n\t}\n\n\twaitForSessionRootReplies(options?: SessionRootReplyWaitOptions): Promise<SessionRootReplyWaitResult> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().waitForSessionRootReplies(options);\n\t}\n\n\tacknowledgeSessionRootReply(messageId: string, ackToken: string): boolean {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().acknowledgeSessionRootReply(messageId, ackToken);\n\t}\n\n\treconcileSessionRootReplies(): void {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tthis._getWorkerController().getAgentControl().reconcileSessionRootReplies();\n\t}\n\n\tstartWorkerAgentTask(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentTaskStartOptions,\n\t): ReturnType<WorkerAgentControlPort[\"startWorkerAgentTask\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().startWorkerAgentTask(agentId, message, options);\n\t}\n\n\tinterruptWorkerAgent(agentId: string, scope?: WorkerAgentControlScope): { interrupted: boolean; reason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().interruptWorkerAgent(agentId, scope);\n\t}\n\n\tresumeWorkerAgent(\n\t\tagentId: string,\n\t\tscope?: WorkerAgentControlScope,\n\t): { started: boolean; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().resumeWorkerAgent(agentId, scope);\n\t}\n\n\tcancelWorkerAgent(agentId: string, reasonCode?: string, scope?: WorkerAgentControlScope): LaneRecord | undefined {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().cancelWorkerAgent(agentId, reasonCode, scope);\n\t}\n\n\tretireWorkerAgent(agentId: string, scope?: WorkerAgentControlScope): WorkerAgentRetireResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().retireWorkerAgent(agentId, scope);\n\t}\n\n\twaitForWorkerAgent(\n\t\tagentId: string,\n\t\ttimeoutMs?: number,\n\t\tscope?: WorkerAgentControlScope,\n\t): ReturnType<WorkerAgentControlPort[\"waitForWorkerAgent\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst release = this._retainWorkerWaitConsumers([agentId]);\n\t\tlet wait: ReturnType<WorkerAgentControlPort[\"waitForWorkerAgent\"]>;\n\t\ttry {\n\t\t\twait = this._getWorkerController().getAgentControl().waitForWorkerAgent(agentId, timeoutMs, scope);\n\t\t} catch (error) {\n\t\t\trelease();\n\t\t\tthrow error;\n\t\t}\n\t\treturn wait\n\t\t\t.then((result) => {\n\t\t\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t\t.finally(release);\n\t}\n\n\twaitForWorkerAgents(\n\t\tagentIds: readonly string[],\n\t\tmode: WorkerAgentWaitMode,\n\t\ttimeoutMs?: number,\n\t\tscope?: WorkerAgentControlScope,\n\t): Promise<WorkerAgentWaitResult> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst release = this._retainWorkerWaitConsumers(agentIds);\n\t\tlet wait: Promise<WorkerAgentWaitResult>;\n\t\ttry {\n\t\t\twait = this._getWorkerController().getAgentControl().waitForWorkerAgents(agentIds, mode, timeoutMs, scope);\n\t\t} catch (error) {\n\t\t\trelease();\n\t\t\tthrow error;\n\t\t}\n\t\treturn wait\n\t\t\t.then((result) => {\n\t\t\t\tthis.observeWorkerAgentTerminals(agentIds);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t\t.finally(release);\n\t}\n\n\tbroadcastWorkerAgentMessage(\n\t\tagentIds: readonly string[],\n\t\tmessage: string,\n\t\toptions: WorkerAgentBroadcastOptions,\n\t): WorkerAgentBroadcastResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().broadcastWorkerAgentMessage(agentIds, message, options);\n\t}\n\n\t/** Run one worker immediately; used by focused integrations and tests. */\n\tasync runWorkerDelegationOnce(\n\t\trequest: WorkerDelegationRequest,\n\t\tonStarted?: (record: LaneRecord) => void,\n\t\texistingRecord?: LaneRecord,\n\t): Promise<WorkerDelegationRunOutcome> {\n\t\treturn this._getWorkerController().runOnce(request, onStarted, existingRecord);\n\t}\n\t/**\n\t * Probe a candidate model against the subagent contracts (research/worker/judge/search/\n\t * tool-call surfaces) via {@link runModelFitnessProbe}. The model must resolve and\n\t * authenticate; every probe call runs as an isolated completion on that model, and probe\n\t * spend is reported through spawned-usage accounting.\n\t */\n\tasync runModelFitness(args: {\n\t\tmodel: string;\n\t\ttrials?: number;\n\t\t/** LLM tool-call id, present only via the model_fitness tool path — see model-fitness.ts. */\n\t\ttoolCallId?: string;\n\t}): Promise<{ started: true; model: string; report: ModelFitnessReport } | { started: false; skipReason: string }> {\n\t\treturn this._fitness.run(args);\n\t}\n\n\t/** Start every capacity-eligible queued worker at the owner session's foreground-idle boundary. */\n\tdrainQueuedWorkerDelegations(): void {\n\t\tif (this.deps.isDelegateToolActive?.()) this._getWorkerController().drain();\n\t}\n\n\t/** Fitness reports persisted for THIS host (measured evidence for architect/profile decisions). */\n\tgetStoredFitnessReports(): StoredFitnessReport[] {\n\t\treturn this._fitness.getStoredReports();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"background-lane-controller.js","sourceRoot":"","sources":["../../src/core/background-lane-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,EAAE,oBAAoB,EAAmB,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAsBhF,OAAO,EACN,0BAA0B,GAE1B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEhG,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAYtF,OAAO,EAAE,iBAAiB,EAA8B,MAAM,mCAAmC,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAmC,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,sBAAsB,EAAmC,MAAM,wCAAwC,CAAC;AACjH,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAwBpE,MAAM,OAAO,wBAAwB;IAmBpC;oGACgG;IACxF,SAAS,CAAC,OAAe;QAChC,IAAI,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACR,4B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AAE,CAAC;IAC7E,CAAC;IAED,mGAAmG;IACnG,uBAAuB;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;CACD","sourcesContent":["/**\n * Execution-plane coordinator for goal continuation, research, managed lanes, worker delegation,\n * and model fitness.\n *\n * Coordination state is owned by focused controllers. This coordinator retains one AgentSession\n * composition seam and a shared lane read model. Everything it needs\n * — the session manager, settings, model registry, live model, capability envelope, the goal\n * continuation LOOP, the isolated-completion primitive, spawned-usage accounting, and the telemetry\n * sink — is reached through narrow deps accessors rather than the whole AgentSession.\n *\n * Drive-loop boundary (deliberate): the idle triggers ({@link scheduleGoalAutoContinueFromIdle},\n * {@link scheduleResearchLaneFromIdle}) are invoked from the session's prompt tail as one-line\n * delegations; goal auto-continue itself only ever asks the session to `continueGoalLoop`, so this\n * controller never touches `prompt()`, the last-assistant-message, retry, or streaming state.\n */\n\nimport type { Api, Model } from \"@caupulican/pi-ai\";\nimport type {\n\tGoalContinuationLoopOptions,\n\tGoalContinuationLoopResult,\n\tPromptOptions,\n\tResearchLaneRunOutcome,\n\tWorkerDelegationRunOutcome,\n} from \"./agent-session-contracts.ts\";\nimport { isLaneTerminalStatus, type LaneRecord, LaneTracker } from \"./autonomy/lane-tracker.ts\";\nimport { appendLaneRecordSnapshot, getLatestLaneRecordSnapshots } from \"./autonomy/session-lane-record.ts\";\nimport { ManagedLaneController } from \"./delegation/managed-lane-controller.ts\";\nimport type {\n\tSessionRootReply,\n\tSessionRootReplyQuery,\n\tSessionRootReplyWaitOptions,\n\tSessionRootReplyWaitResult,\n} from \"./delegation/session-root-mailbox.ts\";\nimport type {\n\tSessionRootWorkerAgentMessageOptions,\n\tWorkerAgentActivity,\n\tWorkerAgentBroadcastOptions,\n\tWorkerAgentBroadcastResult,\n\tWorkerAgentControlPort,\n\tWorkerAgentControlScope,\n\tWorkerAgentMessageOptions,\n\tWorkerAgentReplyResult,\n\tWorkerAgentRetireResult,\n\tWorkerAgentTaskStartOptions,\n\tWorkerAgentTranscriptOptions,\n\tWorkerAgentWaitMode,\n\tWorkerAgentWaitResult,\n} from \"./delegation/worker-agent-control.ts\";\nimport {\n\tWorkerDelegationController,\n\ttype WorkerDelegationControllerDeps,\n} from \"./delegation/worker-delegation-controller.ts\";\nimport type { WorkerDelegationRequest } from \"./delegation/worker-delegation-request.ts\";\nimport { WorkerLifecycle } from \"./delegation/worker-lifecycle.ts\";\nimport { WorkerNotificationCoordinator } from \"./delegation/worker-notification-coordinator.ts\";\nimport type { ManagedLaneEvent } from \"./extensions/types.ts\";\nimport { GoalAutoContinueController } from \"./goals/goal-auto-continue-controller.ts\";\nimport type { GoalRuntimeSnapshot, GoalRuntimeSnapshotSettings } from \"./goals/goal-runtime-snapshot.ts\";\nimport type { GoalState } from \"./goals/goal-state.ts\";\nimport type { ModelCapabilityProfile } from \"./model-capability.ts\";\nimport type { StoredFitnessReport } from \"./models/fitness-store.ts\";\nimport type { WorkerResultContract } from \"./orchestration/contracts.ts\";\nimport type {\n\tTaskProfileCreateInput,\n\tTaskProfileCreateResult,\n\tTaskProfileInspection,\n} from \"./orchestration/task-profile-writer.ts\";\nimport type { TaskRuntimeProjection } from \"./orchestration/task-runtime.ts\";\nimport { LaneModelResolver, type LaneModelResolverDeps } from \"./research/lane-model-resolver.ts\";\nimport type { ModelFitnessReport } from \"./research/model-fitness.ts\";\nimport { ModelFitnessController, type ModelFitnessControllerDeps } from \"./research/model-fitness-controller.ts\";\nimport { ResearchLaneController, type ResearchLaneControllerDeps } from \"./research/research-lane-controller.ts\";\nimport { getActiveSessionBranchEntries } from \"./session-snapshot.ts\";\n\nexport { isLocalExecutionModel } from \"./delegation/worker-delegation-controller.ts\";\nexport { clampLaneMaxUsd } from \"./research/lane-model-resolver.ts\";\n\nexport interface BackgroundLaneControllerDeps\n\textends WorkerDelegationControllerDeps,\n\t\tResearchLaneControllerDeps,\n\t\tModelFitnessControllerDeps,\n\t\tLaneModelResolverDeps {\n\t/** True iff the active surface can terminalize a goal through `goal` or `update_goal`.\n\t * Explicit tool/profile exclusion and the worker-role ceiling still disable continuation. */\n\tisGoalToolActive(): boolean;\n\t/** Capability profile of the SESSION model (gates background lanes, scales continuation budgets). */\n\tgetModelCapabilityProfile(): ModelCapabilityProfile;\n\t/** Continuation gate + goal state for the idle autosteer scheduler. */\n\tgetGoalRuntimeSnapshot(settings: GoalRuntimeSnapshotSettings): GoalRuntimeSnapshot;\n\t/** Drive-loop boundary: the session's bounded goal-continuation loop (owns `prompt()`, not us). */\n\tcontinueGoalLoop(options: GoalContinuationLoopOptions): Promise<GoalContinuationLoopResult>;\n\t/** True while the session owns a foreground prompt/retry/follow-up run. */\n\tisForegroundBusy(): boolean;\n\t/** Resolve only after the complete foreground retry/follow-up run releases the session. */\n\twaitForForegroundIdle(): Promise<void>;\n\t/** Persist an explicit stopped state when the selected surface cannot drive the active goal. */\n\tmarkGoalToolUnavailable(): void;\n}\n\nexport class BackgroundLaneController implements WorkerAgentControlPort {\n\t/** Live lane registry — the real source for AutonomyStatusSnapshot.activeLaneCount. */\n\tprivate readonly _laneTracker = new LaneTracker();\n\tprivate readonly _laneModels: LaneModelResolver;\n\tprivate readonly _goalAutoContinue: GoalAutoContinueController;\n\tprivate readonly _research: ResearchLaneController;\n\tprivate readonly _fitness: ModelFitnessController;\n\t/** Lazily materialized only when managed-lane state is queried or reported. */\n\tprivate _managedLanes: ManagedLaneController | undefined;\n\t/** Lazily materialized so a UAC surface without `delegate` allocates no worker runtime state. */\n\tprivate _workers: WorkerDelegationController | undefined;\n\t/** One durable lifecycle shared by every worker execution adapter. */\n\tprivate _workerLifecycle: WorkerLifecycle | undefined;\n\t/** Shared terminal outbox for managed and in-process workers; lazy under UAC omission. */\n\tprivate _workerNotifications: WorkerNotificationCoordinator | undefined;\n\t/** Active event waits consume matching terminal edges before a redundant parent wake is admitted. */\n\tprivate readonly _workerWaitConsumers = new Map<string, number>();\n\tprivate readonly deps: BackgroundLaneControllerDeps;\n\n\t/** Emit a warning without ever throwing — used from disposal-adjacent persistence where a\n\t * listener failure (or a bare test double missing `emit`) must never block or crash cleanup. */\n\tprivate _safeWarn(message: string): void {\n\t\ttry {\n\t\t\tthis.deps.emit({ type: \"warning\", message });\n\t\t} catch {\n\t\t\t// Dispose must never throw.\n\t\t}\n\t}\n\n\tprivate _recordWorkerTerminal(record: LaneRecord, durableNotificationId: string): void {\n\t\tthis._getWorkerNotificationCoordinator().recordTerminal(record, durableNotificationId);\n\t}\n\n\tconstructor(deps: BackgroundLaneControllerDeps) {\n\t\tthis.deps = deps;\n\t\tthis._laneModels = new LaneModelResolver(deps);\n\t\tthis._research = new ResearchLaneController(deps, this._laneTracker, this._laneModels);\n\t\tthis._fitness = new ModelFitnessController(deps, this._laneModels);\n\t\tthis._goalAutoContinue = new GoalAutoContinueController({\n\t\t\tisDisposed: deps.isDisposed,\n\t\t\tisGoalToolActive: deps.isGoalToolActive,\n\t\t\tgetSettingsManager: deps.getSettingsManager,\n\t\t\tgetGoalRuntimeSnapshot: deps.getGoalRuntimeSnapshot,\n\t\t\thasInFlightLaneForGoal: (goalId) => this._hasInFlightLaneForGoal(goalId),\n\t\t\tcontinueGoalLoop: deps.continueGoalLoop,\n\t\t\tisForegroundBusy: deps.isForegroundBusy,\n\t\t\twaitForForegroundIdle: deps.waitForForegroundIdle,\n\t\t\tmarkGoalToolUnavailable: deps.markGoalToolUnavailable,\n\t\t\temit: deps.emit,\n\t\t});\n\t}\n\n\tprivate _getWorkerController(): WorkerDelegationController {\n\t\tthis._workers ??= new WorkerDelegationController(\n\t\t\tthis.deps,\n\t\t\tthis._getWorkerNotificationCoordinator(),\n\t\t\tthis._getWorkerLifecycle(),\n\t\t);\n\t\treturn this._workers;\n\t}\n\n\tprivate _getWorkerLifecycle(): WorkerLifecycle {\n\t\tif (this._workerLifecycle) return this._workerLifecycle;\n\t\tconst lifecycle = new WorkerLifecycle({\n\t\t\tagentDir: this.deps.getAgentDir(),\n\t\t\tsessionId: this.deps.getSessionId(),\n\t\t});\n\t\tthis._workerLifecycle = lifecycle;\n\t\tfor (const notification of lifecycle.getPendingTerminalNotifications()) {\n\t\t\tthis._getWorkerNotificationCoordinator().recordTerminal(notification.record, notification.notificationId);\n\t\t}\n\t\treturn lifecycle;\n\t}\n\n\tprivate _getWorkerNotificationCoordinator(): WorkerNotificationCoordinator {\n\t\tthis._workerNotifications ??= new WorkerNotificationCoordinator({\n\t\t\tgetWorkerRecords: () => this._workerLifecycle?.getAllRecords() ?? [],\n\t\t\temitStatus: (status) => {\n\t\t\t\t// Runs once per flush, with the EXACT batch about to be handed to notify() -- the\n\t\t\t\t// natural checkpoint to backfill durability before that batch can get stuck behind\n\t\t\t\t// an unsettled notify() call with no durable trace. (getOutstandingRecords() is not\n\t\t\t\t// usable here: the coordinator emits status BEFORE moving this same batch from\n\t\t\t\t// `pending` into `inFlight`, so at this exact moment it would report nothing\n\t\t\t\t// outstanding — status.terminalSinceFlush is the batch, directly, no timing gap.)\n\t\t\t\tthis._ensureDurableNotifications(status.terminalSinceFlush);\n\t\t\t\ttry {\n\t\t\t\t\tthis.deps.emit({\n\t\t\t\t\t\ttype: \"delegate_workers\",\n\t\t\t\t\t\t...status,\n\t\t\t\t\t\tterminalSinceFlush: [...status.terminalSinceFlush],\n\t\t\t\t\t});\n\t\t\t\t} catch {\n\t\t\t\t\t// A partial integration must not crash the event-driven terminal outbox.\n\t\t\t\t}\n\t\t\t},\n\t\t\tnotify: (records) => this.deps.notifyWorkerTerminalHandoff(records),\n\t\t\twarn: (message) => this._safeWarn(message),\n\t\t\tmarkDurableDelivered: (notificationIds) => this._workerLifecycle?.markNotificationsDelivered(notificationIds),\n\t\t\tisObserved: (record) => this._isWorkerTerminalAwaited(record),\n\t\t});\n\t\treturn this._workerNotifications;\n\t}\n\n\tprivate _workerAgentIdForRecord(record: Pick<LaneRecord, \"laneId\">): string {\n\t\tconst attempt =\n\t\t\tthis._workerLifecycle?.getActiveAttempt(record.laneId) ??\n\t\t\tthis._workerLifecycle?.getManagedAttempt(record.laneId);\n\t\treturn attempt?.agentId ?? attempt?.dispatch.logicalLaneId ?? record.laneId;\n\t}\n\n\tprivate _isWorkerTerminalAwaited(record: Pick<LaneRecord, \"laneId\">): boolean {\n\t\treturn (this._workerWaitConsumers.get(this._workerAgentIdForRecord(record)) ?? 0) > 0;\n\t}\n\n\tprivate _retainWorkerWaitConsumers(agentIds: readonly string[]): () => void {\n\t\tconst unique = [...new Set(agentIds)];\n\t\tfor (const agentId of unique) {\n\t\t\tthis._workerWaitConsumers.set(agentId, (this._workerWaitConsumers.get(agentId) ?? 0) + 1);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const agentId of unique) {\n\t\t\t\tconst remaining = (this._workerWaitConsumers.get(agentId) ?? 1) - 1;\n\t\t\t\tif (remaining > 0) this._workerWaitConsumers.set(agentId, remaining);\n\t\t\t\telse this._workerWaitConsumers.delete(agentId);\n\t\t\t}\n\t\t};\n\t}\n\n\t/** Observe only logical-agent terminals explicitly exposed by a bounded model result. */\n\tobserveWorkerAgentTerminals(agentIds: readonly string[]): void {\n\t\tif (!this._workerLifecycle) return;\n\t\tconst targets = new Set(agentIds);\n\t\tthis.observeWorkerTerminalRecords(\n\t\t\tthis.getLaneRecords().filter(\n\t\t\t\t(record) => isLaneTerminalStatus(record.status) && targets.has(this._workerAgentIdForRecord(record)),\n\t\t\t),\n\t\t);\n\t}\n\n\tobserveWorkerTerminalRecords(records: readonly LaneRecord[]): void {\n\t\tconst terminal = records.filter((record) => isLaneTerminalStatus(record.status));\n\t\tif (terminal.length > 0) this._getWorkerNotificationCoordinator().observeTerminals(terminal);\n\t}\n\n\t/**\n\t * Backfills a durable notification for every record about to be flushed, through the SAME\n\t * durable notification store `_getWorkerLifecycle()` already replays from on construction\n\t * (`getPendingTerminalNotifications()` / `markNotificationsDelivered()`) -- not a new\n\t * persistence subsystem. `WorkerLifecycle.getTerminalNotification()` is idempotent (it reuses\n\t * an existing durable entry for the same laneId/attemptId or creates exactly one), so calling\n\t * it for a record that already has a durable notification is a safe no-op. Without this, a\n\t * \"transient:<laneId>:<completedAt>\" record (recorded without a durableNotificationId — e.g.\n\t * because no attempt was resolvable at record time) has no trace in the durable ledger at all:\n\t * if it's still stuck behind an unresolved notify() when the process restarts, the replay on\n\t * the next construction can only find what was durably enqueued, so it would be lost instead of\n\t * replayed.\n\t */\n\tprivate _ensureDurableNotifications(records: readonly Pick<LaneRecord, \"laneId\">[]): void {\n\t\tif (!this._workerLifecycle) return;\n\t\tfor (const record of records) {\n\t\t\ttry {\n\t\t\t\tthis._workerLifecycle.getTerminalNotification(record.laneId);\n\t\t\t} catch (error) {\n\t\t\t\tthis._safeWarn(\n\t\t\t\t\t`Failed to durably back the worker terminal notification for ${record.laneId}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _getManagedLaneController(): ManagedLaneController {\n\t\tthis._managedLanes ??= new ManagedLaneController(\n\t\t\tthis.deps,\n\t\t\tthis._getWorkerLifecycle(),\n\t\t\t(record, notificationId) => this._recordWorkerTerminal(record, notificationId),\n\t\t\t(message) => this._safeWarn(message),\n\t\t);\n\t\treturn this._managedLanes;\n\t}\n\n\tprivate _hydrateManagedLanes(): void {\n\t\tif (this._managedLanes) {\n\t\t\tthis._managedLanes.ensureHydrated();\n\t\t\treturn;\n\t\t}\n\t\tconst hasPersistedActiveManagedLane = getLatestLaneRecordSnapshots(\n\t\t\tgetActiveSessionBranchEntries(this.deps.getSessionManager()),\n\t\t).some((record) => record.type === \"tmux-worker\" && (record.status === \"queued\" || record.status === \"running\"));\n\t\tif (hasPersistedActiveManagedLane) this._getManagedLaneController().ensureHydrated();\n\t}\n\n\t/** Live lane records tracked by this process (running and terminal). */\n\tgetLaneRecords(): LaneRecord[] {\n\t\tthis._hydrateManagedLanes();\n\t\tconst workerRecords =\n\t\t\tthis._workers?.getRecords() ??\n\t\t\t(this.deps.isDelegateToolActive?.() ? this._getWorkerController().getRecords() : []);\n\t\treturn [\n\t\t\t...this._laneTracker.getRecords(),\n\t\t\t...workerRecords,\n\t\t\t...(this._workerLifecycle?.getManagedRecords() ?? []),\n\t\t];\n\t}\n\n\t/** Does not materialize the worker controller when UAC omitted delegation. */\n\tgetTaskRuntimeSnapshot(): TaskRuntimeProjection | undefined {\n\t\treturn this._workerLifecycle?.getTaskRuntimeSnapshot();\n\t}\n\n\tgetWorkerResult(laneId: string): WorkerResultContract | undefined {\n\t\treturn this._workerLifecycle?.getResult(laneId);\n\t}\n\n\t/** Reconcile only when delegation has already been materialized; UAC omission stays zero-load. */\n\tsynchronizeGoalState(goal: GoalState): void {\n\t\tthis._workers?.synchronizeGoalState(goal);\n\t}\n\n\t/**\n\t * Resolve a tracked managed-lane dispatch. The caller's stable id is also the canonical durable\n\t * lane id, so this is an existence check rather than an id translation.\n\t */\n\tresolveManagedLaneId(callerLaneId: string): string | undefined {\n\t\treturn this._getManagedLaneController().resolve(callerLaneId);\n\t}\n\n\t/** Live count of active lanes — the real source for AutonomyStatusSnapshot.activeLaneCount. */\n\tgetActiveLaneCount(): number {\n\t\treturn this.getLaneRecords().filter((record) => record.status === \"queued\" || record.status === \"running\").length;\n\t}\n\n\t/** Belt-and-braces guard: whether ANY queued/running lane is tagged with this goalId. */\n\tprivate _hasInFlightLaneForGoal(goalId: string): boolean {\n\t\treturn this.getLaneRecords().some(\n\t\t\t(record) => record.goalId === goalId && (record.status === \"queued\" || record.status === \"running\"),\n\t\t);\n\t}\n\n\t/** Delegate the out-of-process dispatch/terminal claim to its single lifecycle owner. */\n\trecordManagedLane(event: ManagedLaneEvent): LaneRecord | undefined {\n\t\treturn this._getManagedLaneController().record(event);\n\t}\n\n\t/** Why the last idle research-lane evaluation skipped, for /autonomy diagnostics. */\n\tgetLastResearchLaneSkipReason(): string | undefined {\n\t\treturn this._research.getLastSkipReason();\n\t}\n\n\t/**\n\t * Abort in-flight research and delegate worker disposal to its single owning controller.\n\t *\n\t * This synchronous body is the LAST provably-safe write window for canceled/in-flight work.\n\t * `dispose()` (agent-session.ts) has already set the session's own disposed flag but has not yet\n\t * returned — no successor session (e.g. a `/reload` adoption) can exist yet, so an append here\n\t * cannot interleave with one; a post-await continuation resuming AFTER this method returns must\n\t * not append (see the disposed branch in `runWorkerDelegationOnce`). Persist FIRST, then\n\t * complete-in-memory, so a throw from one lane's persist cannot skip another's; each persist gets\n\t * its own try/catch — dispose must never throw.\n\t */\n\tabortInFlightLanes(): void {\n\t\tthis._goalAutoContinue.clearTimer();\n\t\tthis._research.abort();\n\t\tthis._fitness.abort();\n\t\tfor (const record of this._laneTracker.getRecords()) {\n\t\t\tif (record.status !== \"queued\" && record.status !== \"running\") continue;\n\t\t\tif (record.type === \"tmux-worker\") continue;\n\t\t\tconst canceled = this._laneTracker.complete(record.laneId, {\n\t\t\t\tstatus: \"canceled\",\n\t\t\t\treasonCode: \"session_disposed\",\n\t\t\t});\n\t\t\tif (!canceled) continue;\n\t\t\ttry {\n\t\t\t\tappendLaneRecordSnapshot(this.deps.getSessionManager(), canceled);\n\t\t\t} catch (error) {\n\t\t\t\tthis._safeWarn(\n\t\t\t\t\t`Failed to persist canceled lane record ${canceled.laneId}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis._managedLanes?.release();\n\n\t\tthis._workers?.abort();\n\t\tthis._workerNotifications?.dispose();\n\t}\n\n\tclearGoalAutoContinueTimer(): void {\n\t\tthis._goalAutoContinue.clearTimer();\n\t}\n\n\tscheduleGoalAutoContinueFromIdle(options?: PromptOptions): void {\n\t\tthis._goalAutoContinue.scheduleFromIdle(options);\n\t}\n\n\t/**\n\t * Single-flight entry point for EVERY goal-continuation loop invocation — idle autosteer\n\t * ({@link _runScheduledGoalAutoContinue}) AND the manual `/goal start` / `/goal-continue`\n\t * commands (reached through `AgentSession.continueGoalLoop`). Both paths ultimately submit\n\t * continuation prompts through the session's single `prompt()` path, so two loops racing throws\n\t * \"Agent is already processing\" from whichever submits second. `_isGoalAutoContinuing` is the\n\t * ONE owner of that mutex; `deps.continueGoalLoop` (the raw {@link GoalLoopController} loop)\n\t * must never be called directly outside this method, or the guard is bypassed.\n\t */\n\tasync continueGoalLoopExclusive(options: GoalContinuationLoopOptions): Promise<GoalContinuationLoopResult> {\n\t\treturn this._goalAutoContinue.continueExclusive(options);\n\t}\n\n\tclearResearchLaneTimer(): void {\n\t\tthis._research.clearTimer();\n\t}\n\n\tscheduleResearchLaneFromIdle(): void {\n\t\tthis._research.scheduleFromIdle();\n\t}\n\n\tresolveLaneModel(configuredPattern: string | undefined): Model<Api> | undefined {\n\t\treturn this._laneModels.resolveModel(configuredPattern);\n\t}\n\n\tgetOrchestrationProfileCatalog(): Array<{ profileId: string; role: string; description: string }> {\n\t\treturn this._getWorkerController().getProfileCatalog();\n\t}\n\n\tinspectTaskProfileOptions(): TaskProfileInspection {\n\t\treturn this._getWorkerController().inspectTaskProfileOptions();\n\t}\n\n\tcreateTaskProfile(input: TaskProfileCreateInput): TaskProfileCreateResult {\n\t\treturn this._getWorkerController().createTaskProfile(input);\n\t}\n\n\t/**\n\t * Run one bounded, read-only research pass and persist its results: evidence bundle snapshot,\n\t * terminal lane record, and spawned-usage cost report (single-hop invariant, idempotent on the\n\t * lane's reportId). Explicit calls (e.g. `/autonomy research`) express user intent and bypass the\n\t * enabled/mode/dedupe gates the idle scheduler enforces; budget and capability gates always apply.\n\t */\n\tasync runResearchLaneOnce(request?: {\n\t\tquery?: string;\n\t\tcontext?: string;\n\t\tgoalId?: string;\n\t}): Promise<ResearchLaneRunOutcome> {\n\t\treturn this._research.runOnce(request);\n\t}\n\t/** Start a durable leaf worker with inherited, preset, or model-selected authority. */\n\tstartWorkerDelegation(\n\t\trequest: WorkerDelegationRequest,\n\t): { started: false; skipReason: string } | { started: true; record: LaneRecord } {\n\t\treturn this._getWorkerController().start(request);\n\t}\n\n\t/** Durable logical-worker controls. Each checks UAC before materializing worker state. */\n\tlistWorkerAgents(scope?: WorkerAgentControlScope): ReturnType<WorkerAgentControlPort[\"listWorkerAgents\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().listWorkerAgents(scope);\n\t}\n\n\tgetWorkerTaskSessionView(): ReturnType<WorkerAgentControlPort[\"getWorkerTaskSessionView\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().getWorkerTaskSessionView();\n\t}\n\n\tgetWorkerAgentActivity(agentId: string, scope?: WorkerAgentControlScope): WorkerAgentActivity {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst activity = this._getWorkerController().getAgentControl().getWorkerAgentActivity(agentId, scope);\n\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\treturn activity;\n\t}\n\n\treadWorkerAgentTranscript(\n\t\tagentId: string,\n\t\toptions?: WorkerAgentTranscriptOptions,\n\t): ReturnType<WorkerAgentControlPort[\"readWorkerAgentTranscript\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst page = this._getWorkerController().getAgentControl().readWorkerAgentTranscript(agentId, options);\n\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\treturn page;\n\t}\n\n\tsendWorkerAgentMessage(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentMessageOptions,\n\t): { messageId: string; queued: true } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().sendWorkerAgentMessage(agentId, message, options);\n\t}\n\n\tfollowUpWorkerAgent(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentMessageOptions,\n\t): { started: boolean; steering: boolean; messageId: string; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().followUpWorkerAgent(agentId, message, options);\n\t}\n\n\tsendSessionRootWorkerAgentMessage(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: SessionRootWorkerAgentMessageOptions,\n\t): { messageId: string; queued: true } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().sendSessionRootWorkerAgentMessage(agentId, message, options);\n\t}\n\n\tfollowUpSessionRootWorkerAgent(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: SessionRootWorkerAgentMessageOptions,\n\t): { started: boolean; steering: boolean; messageId: string; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().followUpSessionRootWorkerAgent(agentId, message, options);\n\t}\n\n\treplyToWorkerAgentMessage(sourceAgentId: string, message: string, replyToMessageId: string): WorkerAgentReplyResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController()\n\t\t\t.getAgentControl()\n\t\t\t.replyToWorkerAgentMessage(sourceAgentId, message, replyToMessageId);\n\t}\n\n\tlistSessionRootReplies(query?: SessionRootReplyQuery): SessionRootReply[] {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().listSessionRootReplies(query);\n\t}\n\n\twaitForSessionRootReplies(options?: SessionRootReplyWaitOptions): Promise<SessionRootReplyWaitResult> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().waitForSessionRootReplies(options);\n\t}\n\n\tacknowledgeSessionRootReply(messageId: string, ackToken: string): boolean {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().acknowledgeSessionRootReply(messageId, ackToken);\n\t}\n\n\treconcileSessionRootReplies(): void {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tthis._getWorkerController().getAgentControl().reconcileSessionRootReplies();\n\t}\n\n\tstartWorkerAgentTask(\n\t\tagentId: string,\n\t\tmessage: string,\n\t\toptions?: WorkerAgentTaskStartOptions,\n\t): ReturnType<WorkerAgentControlPort[\"startWorkerAgentTask\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().startWorkerAgentTask(agentId, message, options);\n\t}\n\n\tinterruptWorkerAgent(agentId: string, scope?: WorkerAgentControlScope): { interrupted: boolean; reason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().interruptWorkerAgent(agentId, scope);\n\t}\n\n\tresumeWorkerAgent(\n\t\tagentId: string,\n\t\tscope?: WorkerAgentControlScope,\n\t): { started: boolean; record?: LaneRecord; skipReason?: string } {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().resumeWorkerAgent(agentId, scope);\n\t}\n\n\tcancelWorkerAgent(agentId: string, reasonCode?: string, scope?: WorkerAgentControlScope): LaneRecord | undefined {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().cancelWorkerAgent(agentId, reasonCode, scope);\n\t}\n\n\tretireWorkerAgent(agentId: string, scope?: WorkerAgentControlScope): WorkerAgentRetireResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().retireWorkerAgent(agentId, scope);\n\t}\n\n\twaitForWorkerAgent(\n\t\tagentId: string,\n\t\ttimeoutMs?: number,\n\t\tscope?: WorkerAgentControlScope,\n\t): ReturnType<WorkerAgentControlPort[\"waitForWorkerAgent\"]> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst release = this._retainWorkerWaitConsumers([agentId]);\n\t\tlet wait: ReturnType<WorkerAgentControlPort[\"waitForWorkerAgent\"]>;\n\t\ttry {\n\t\t\twait = this._getWorkerController().getAgentControl().waitForWorkerAgent(agentId, timeoutMs, scope);\n\t\t} catch (error) {\n\t\t\trelease();\n\t\t\tthrow error;\n\t\t}\n\t\treturn wait\n\t\t\t.then((result) => {\n\t\t\t\tthis.observeWorkerAgentTerminals([agentId]);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t\t.finally(release);\n\t}\n\n\twaitForWorkerAgents(\n\t\tagentIds: readonly string[],\n\t\tmode: WorkerAgentWaitMode,\n\t\ttimeoutMs?: number,\n\t\tscope?: WorkerAgentControlScope,\n\t): Promise<WorkerAgentWaitResult> {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\tconst release = this._retainWorkerWaitConsumers(agentIds);\n\t\tlet wait: Promise<WorkerAgentWaitResult>;\n\t\ttry {\n\t\t\twait = this._getWorkerController().getAgentControl().waitForWorkerAgents(agentIds, mode, timeoutMs, scope);\n\t\t} catch (error) {\n\t\t\trelease();\n\t\t\tthrow error;\n\t\t}\n\t\treturn wait\n\t\t\t.then((result) => {\n\t\t\t\tthis.observeWorkerAgentTerminals(agentIds);\n\t\t\t\treturn result;\n\t\t\t})\n\t\t\t.finally(release);\n\t}\n\n\tbroadcastWorkerAgentMessage(\n\t\tagentIds: readonly string[],\n\t\tmessage: string,\n\t\toptions: WorkerAgentBroadcastOptions,\n\t): WorkerAgentBroadcastResult {\n\t\tif (!this.deps.isDelegateToolActive())\n\t\t\tthrow new Error(\"Worker delegation control is unavailable in this UAC surface.\");\n\t\treturn this._getWorkerController().getAgentControl().broadcastWorkerAgentMessage(agentIds, message, options);\n\t}\n\n\t/** Run one worker immediately; used by focused integrations and tests. */\n\tasync runWorkerDelegationOnce(\n\t\trequest: WorkerDelegationRequest,\n\t\tonStarted?: (record: LaneRecord) => void,\n\t\texistingRecord?: LaneRecord,\n\t): Promise<WorkerDelegationRunOutcome> {\n\t\treturn this._getWorkerController().runOnce(request, onStarted, existingRecord);\n\t}\n\t/**\n\t * Probe a candidate model against the subagent contracts (research/worker/judge/search/\n\t * tool-call surfaces) via {@link runModelFitnessProbe}. The model must resolve and\n\t * authenticate; every probe call runs as an isolated completion on that model, and probe\n\t * spend is reported through spawned-usage accounting.\n\t */\n\tasync runModelFitness(args: {\n\t\tmodel: string;\n\t\ttrials?: number;\n\t\t/** LLM tool-call id, present only via the model_fitness tool path — see model-fitness.ts. */\n\t\ttoolCallId?: string;\n\t}): Promise<{ started: true; model: string; report: ModelFitnessReport } | { started: false; skipReason: string }> {\n\t\treturn this._fitness.run(args);\n\t}\n\n\t/** Start every capacity-eligible queued worker at the owner session's foreground-idle boundary. */\n\tdrainQueuedWorkerDelegations(): void {\n\t\tif (this.deps.isDelegateToolActive?.()) this._getWorkerController().drain();\n\t}\n\n\t/** Fitness reports persisted for THIS host (measured evidence for architect/profile decisions). */\n\tgetStoredFitnessReports(): StoredFitnessReport[] {\n\t\treturn this._fitness.getStoredReports();\n\t}\n}\n"]}
|
|
@@ -7,7 +7,7 @@ export declare const DEFAULT_BACKGROUND_TOOL_TASK_WAIT_TIMEOUT_MS = 30000;
|
|
|
7
7
|
export declare const BACKGROUND_TOOL_TASK_CUSTOM_TYPE = "background_tool_task";
|
|
8
8
|
export type BackgroundToolTaskStatus = "running" | "completed" | "failed" | "canceled";
|
|
9
9
|
export type BackgroundToolTerminalDelivery = "pending" | "delivered";
|
|
10
|
-
export type BackgroundToolTaskRef = Pick<BackgroundToolTaskRecord, "taskId" | "toolCallId" | "status">;
|
|
10
|
+
export type BackgroundToolTaskRef = Pick<BackgroundToolTaskRecord, "taskId" | "toolCallId" | "goalId" | "status">;
|
|
11
11
|
/** Match a goal/task_steps evidence uri to a session background tool task by task id or toolCallId. */
|
|
12
12
|
export declare function findBackgroundToolTask<T extends BackgroundToolTaskRef>(records: readonly T[], uri: string): T | undefined;
|
|
13
13
|
/** True only when the cited background task finished successfully. Undefined when no task matches. */
|
|
@@ -21,6 +21,8 @@ export interface BackgroundToolTaskRecord {
|
|
|
21
21
|
taskId: string;
|
|
22
22
|
toolCallId: string;
|
|
23
23
|
toolName: string;
|
|
24
|
+
/** Goal execution that owned the foreground tool call when it was handed off. */
|
|
25
|
+
goalId?: string;
|
|
24
26
|
status: BackgroundToolTaskStatus;
|
|
25
27
|
startedAt: string;
|
|
26
28
|
completedAt?: string;
|
|
@@ -56,6 +58,8 @@ export interface BackgroundToolTerminalMessage {
|
|
|
56
58
|
}
|
|
57
59
|
export interface BackgroundToolTaskControllerDeps {
|
|
58
60
|
getSessionId(): string;
|
|
61
|
+
/** Authoritative goal execution attribution at the tool handoff boundary. */
|
|
62
|
+
getGoalId?(): string | undefined;
|
|
59
63
|
/** Current session followed by the authoritative fork ancestry whose branch records remain visible. */
|
|
60
64
|
getSessionLineageIds?(): readonly string[];
|
|
61
65
|
getArtifactStore(): ArtifactStore | undefined;
|
|
@@ -74,7 +78,9 @@ export interface BackgroundToolTaskControllerDeps {
|
|
|
74
78
|
}
|
|
75
79
|
/** Read only task records on the active branch without allocating or hydrating the full branch context. */
|
|
76
80
|
export declare function loadBackgroundToolTaskRecordsNewestFirst(sessionManager: Pick<SessionManager, "getLatestCustomEntryOnBranch">): unknown[];
|
|
77
|
-
export declare function createBackgroundToolTerminalMessage(records: readonly BackgroundToolTaskRecord[]
|
|
81
|
+
export declare function createBackgroundToolTerminalMessage(records: readonly BackgroundToolTaskRecord[], options?: {
|
|
82
|
+
wakeParent?: boolean;
|
|
83
|
+
}): BackgroundToolTerminalMessage;
|
|
78
84
|
/**
|
|
79
85
|
* Session-owned registry for foreground tool calls transferred into background execution.
|
|
80
86
|
* It emits edge records for durability and a replace-style live-task signal for UI consumers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-tool-task-controller.d.ts","sourceRoot":"","sources":["../../src/core/background-tool-task-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAIpE,eAAO,MAAM,qCAAqC,QAAS,CAAC;AAC5D,eAAO,MAAM,4CAA4C,QAAS,CAAC;AACnE,eAAO,MAAM,gCAAgC,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"background-tool-task-controller.d.ts","sourceRoot":"","sources":["../../src/core/background-tool-task-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa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