@tangle-network/agent-runtime 0.102.1 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -10
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +5 -5
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/candidate-execution/index.d.ts +5 -41
- package/dist/candidate-execution/index.js +8 -6
- package/dist/{chunk-KPHTCHQ4.js → chunk-3LJF5XSE.js} +79 -334
- package/dist/chunk-3LJF5XSE.js.map +1 -0
- package/dist/{chunk-3DW5DEKQ.js → chunk-5AITUUHO.js} +3 -3
- package/dist/{chunk-SQ3ZJH3Y.js → chunk-6WZZXQV5.js} +467 -23
- package/dist/chunk-6WZZXQV5.js.map +1 -0
- package/dist/{chunk-RTB3TC73.js → chunk-AAN2MB2X.js} +3 -3
- package/dist/{chunk-KSM6GFHP.js → chunk-B7K7V22Y.js} +2 -2
- package/dist/{chunk-6MR4IJRW.js → chunk-EAQ5YRRY.js} +1383 -63
- package/dist/chunk-EAQ5YRRY.js.map +1 -0
- package/dist/chunk-ISPWRSEC.js +408 -0
- package/dist/chunk-ISPWRSEC.js.map +1 -0
- package/dist/{chunk-7FJJUC73.js → chunk-LFM4JBRW.js} +29 -6
- package/dist/{chunk-7FJJUC73.js.map → chunk-LFM4JBRW.js.map} +1 -1
- package/dist/{chunk-ROILMKDL.js → chunk-QYCKIV6C.js} +3 -3
- package/dist/{chunk-LJLG734E.js → chunk-SBTWKPVR.js} +10 -11
- package/dist/{chunk-LJLG734E.js.map → chunk-SBTWKPVR.js.map} +1 -1
- package/dist/{chunk-CK76OZPM.js → chunk-SNSMRT6H.js} +56 -386
- package/dist/chunk-SNSMRT6H.js.map +1 -0
- package/dist/{chunk-KJ2Q4T7F.js → chunk-TUSOOIDV.js} +2 -2
- package/dist/{chunk-CI7WS6S2.js → chunk-ZOYN3JR5.js} +5 -5
- package/dist/{chunk-377GOJHJ.js → chunk-ZXICDSAK.js} +333 -4
- package/dist/chunk-ZXICDSAK.js.map +1 -0
- package/dist/{completion-gate-C6dhVN-N.d.ts → completion-gate-DLINnrkM.d.ts} +1 -1
- package/dist/{coordination-D9l_YmwW.d.ts → coordination-DTehA977.d.ts} +250 -8
- package/dist/environment-provider.d.ts +2 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +26 -8
- package/dist/intelligence.js +24 -7
- package/dist/intelligence.js.map +1 -1
- package/dist/knowledge.d.ts +6 -6
- package/dist/knowledge.js +9 -9
- package/dist/{loop-runner-bin-PnWslIw4.d.ts → loop-runner-bin-DhIXsLAd.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +5 -5
- package/dist/loop-runner-bin.js +6 -6
- package/dist/loops.d.ts +305 -148
- package/dist/loops.js +82 -14
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.js +6 -6
- package/dist/profiles.d.ts +1 -1
- package/dist/{profile-DbfaMTdk.d.ts → protected-model-port-DzkUY3HQ.d.ts} +41 -3
- package/dist/{structural-rollout-D7xik9XR.d.ts → structural-rollout-BFPIy3iw.d.ts} +3 -3
- package/dist/supervise-Cp8bNcJi.d.ts +379 -0
- package/dist/testing.js +10 -10
- package/dist/testing.js.map +1 -1
- package/dist/{types-CWqfCO8s.d.ts → types-Cbp72qyu.d.ts} +1 -1
- package/dist/{types-CLat4bT9.d.ts → types-DK11_O4L.d.ts} +1 -1
- package/dist/types-lZTE_LBd.d.ts +957 -0
- package/dist/{worktree-fanout-DsIR4d6w.d.ts → worktree-fanout-DiiJWjJO.d.ts} +17 -5
- package/package.json +3 -2
- package/skills/build-with-agent-runtime/SKILL.md +7 -5
- package/skills/generate-eval/SKILL.md +45 -52
- package/skills/loop-writer/SKILL.md +79 -147
- package/skills/supervise/SKILL.md +33 -14
- package/dist/chunk-377GOJHJ.js.map +0 -1
- package/dist/chunk-6MR4IJRW.js.map +0 -1
- package/dist/chunk-CK76OZPM.js.map +0 -1
- package/dist/chunk-IMSNJSXH.js +0 -73
- package/dist/chunk-IMSNJSXH.js.map +0 -1
- package/dist/chunk-KPHTCHQ4.js.map +0 -1
- package/dist/chunk-SQ3ZJH3Y.js.map +0 -1
- package/dist/supervise-BQdNAXtK.d.ts +0 -131
- package/dist/types-D870JlH0.d.ts +0 -500
- /package/dist/{chunk-3DW5DEKQ.js.map → chunk-5AITUUHO.js.map} +0 -0
- /package/dist/{chunk-RTB3TC73.js.map → chunk-AAN2MB2X.js.map} +0 -0
- /package/dist/{chunk-KSM6GFHP.js.map → chunk-B7K7V22Y.js.map} +0 -0
- /package/dist/{chunk-ROILMKDL.js.map → chunk-QYCKIV6C.js.map} +0 -0
- /package/dist/{chunk-KJ2Q4T7F.js.map → chunk-TUSOOIDV.js.map} +0 -0
- /package/dist/{chunk-CI7WS6S2.js.map → chunk-ZOYN3JR5.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/candidate-execution/exact-process-executor.ts","../src/candidate-execution/protected-model-port.ts"],"sourcesContent":["import { posix } from 'node:path'\nimport { isDeepStrictEqual } from 'node:util'\n\nimport type { TraceStore } from '@tangle-network/agent-eval'\nimport type { AgentCandidateTermination, Sha256Digest } from '@tangle-network/agent-interface'\nimport type {\n AgentEnvironmentCapabilities,\n AgentEnvironmentProvider,\n AgentExactProcess,\n AgentExactProcessEnvironment,\n AgentExactProcessLaunch,\n AgentExactProcessResources,\n AgentExactProcessStatus,\n} from '@tangle-network/agent-interface/environment-provider'\n\nimport {\n canonicalCandidateBytes,\n canonicalCandidateDigest,\n immutableCandidateValue,\n sha256Bytes,\n} from './digest'\nimport {\n CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV,\n CANDIDATE_KNOWLEDGE_ROOT_ENV,\n candidateKnowledgeExecutionPaths,\n} from './knowledge'\nimport type {\n AgentCandidateExecutorPort,\n AgentCandidateExecutorRequest,\n AgentCandidateExecutorStopRequest,\n} from './types'\n\nconst DEFAULT_PROVISION_TIMEOUT_MS = 120_000\nconst DEFAULT_RECOVERY_RETENTION_MS = 15 * 60_000\n\ninterface ExactProcessRunState {\n environment: AgentExactProcessEnvironment\n output?: Uint8Array\n termination?: AgentCandidateTermination\n runtimeTermination?: AgentCandidateTermination\n trace?: {\n runId: string\n scenarioId: string\n startedAt: number\n deadlineAtMs: number\n timeoutMs: number\n tags: Record<string, string>\n written: boolean\n }\n}\n\nexport interface ExactProcessCandidateExecutorOptions {\n provider: AgentEnvironmentProvider\n resources: AgentExactProcessResources\n provisionTimeoutMs?: number\n recoveryRetentionMs?: number\n providerOptions?: Record<string, unknown>\n}\n\n/** Adapt one neutral exact-process provider to Runtime's trusted candidate boundary. */\nexport function exactProcessProviderAsCandidateExecutor(\n options: ExactProcessCandidateExecutorOptions,\n): AgentCandidateExecutorPort {\n return new ExactProcessAgentCandidateExecutor(options)\n}\n\nclass ExactProcessAgentCandidateExecutor implements AgentCandidateExecutorPort {\n private readonly states = new Map<string, ExactProcessRunState>()\n private readonly exactProcess\n private readonly resources: AgentExactProcessResources\n private readonly provisionTimeoutMs: number\n private readonly recoveryRetentionMs: number\n private readonly providerOptions?: Record<string, unknown>\n private capabilitiesPromise?: Promise<AgentEnvironmentCapabilities>\n\n constructor(private readonly options: ExactProcessCandidateExecutorOptions) {\n if (!options.provider.exactProcess) {\n throw new Error(\n `agent environment provider \"${options.provider.name}\" does not implement exact processes`,\n )\n }\n this.exactProcess = options.provider.exactProcess\n this.resources = exactResources(options.resources)\n this.provisionTimeoutMs = positiveInteger(\n options.provisionTimeoutMs ?? DEFAULT_PROVISION_TIMEOUT_MS,\n 'exact process provision timeout',\n )\n this.recoveryRetentionMs = positiveInteger(\n options.recoveryRetentionMs ?? DEFAULT_RECOVERY_RETENTION_MS,\n 'exact process recovery retention',\n )\n this.providerOptions = options.providerOptions\n ? immutableCandidateValue(options.providerOptions)\n : undefined\n }\n\n async execute(\n request: AgentCandidateExecutorRequest,\n context: Parameters<AgentCandidateExecutorPort['execute']>[1],\n ) {\n assertSupportedRequest(request)\n const outcome = request.benchmark.task.outcome\n if (outcome.kind !== 'output') throw new Error('exact process executor requires an output task')\n const network = request.executionPlan.value.material.model.access.network\n const egress =\n network.mode === 'disabled'\n ? ({ mode: 'blocked' } as const)\n : ({ mode: 'strict', allowDomains: [...network.domains] } as const)\n await this.assertCapability(egress.mode)\n context.signal.throwIfAborted()\n\n const key = executionKey(request.executionId, request.executionPlan.value.digest)\n if (this.states.has(key)) throw new Error('candidate execution environment is already active')\n const image = exactImage(\n request.executionPlan.value.material.container.image,\n request.executionPlan.value.material.container.manifestDigest,\n )\n const maxLifetimeMs = environmentLifetimeMs(\n request.hardLimits.timeoutMs,\n this.recoveryRetentionMs,\n )\n const createMaterial = immutableCandidateValue({\n kind: 'agent-candidate-exact-process-create',\n provider: this.options.provider.name,\n executionId: request.executionId,\n executionPlanDigest: request.executionPlan.value.digest,\n image,\n egress,\n maxLifetimeMs,\n provisionTimeoutMs: this.provisionTimeoutMs,\n resources: this.resources,\n output: { mediaType: outcome.mediaType, maxBytes: outcome.maxBytes },\n ...(this.providerOptions ? { providerOptions: this.providerOptions } : {}),\n })\n const createInputDigest = canonicalCandidateDigest(createMaterial)\n const metadata = immutableCandidateValue({\n kind: 'agent-candidate-execution',\n provider: this.options.provider.name,\n executionId: request.executionId,\n executionPlanDigest: request.executionPlan.value.digest,\n createInputDigest,\n outputMediaType: outcome.mediaType,\n outputMaxBytes: outcome.maxBytes,\n })\n const environment = await this.exactProcess.create({\n image,\n egress,\n maxLifetimeMs,\n provisionTimeoutMs: this.provisionTimeoutMs,\n resources: this.resources,\n metadata,\n idempotencyKey: executionIdempotencyKey(\n request.executionId,\n request.executionPlan.value.digest,\n ),\n signal: context.signal,\n ...(this.providerOptions ? { providerOptions: this.providerOptions } : {}),\n })\n try {\n assertExecutionEnvironment(environment, metadata, this.options.provider.name)\n } catch (error) {\n try {\n await environment.destroy()\n } catch (cleanupError) {\n throw new AggregateError(\n [error, cleanupError],\n 'exact process validation and cleanup both failed',\n )\n }\n throw error\n }\n const state: ExactProcessRunState = { environment }\n this.states.set(key, state)\n\n const existing = await environment.process.list()\n if (existing.length !== 0) {\n throw new Error('fresh candidate environment already contains a process')\n }\n await materializeRequest(environment, request, context.signal)\n const launch = exactLaunch(request)\n const startedAt = Date.now()\n state.trace = {\n runId: request.trace.runId,\n scenarioId: request.benchmark.task.scenario.id,\n startedAt,\n deadlineAtMs: context.deadlineAtMs,\n timeoutMs: request.hardLimits.timeoutMs,\n tags: {\n ...request.trace.tags,\n environmentId: environment.id,\n environmentProvider: environment.provider,\n },\n written: false,\n }\n const process = await environment.process.spawn(launch, { signal: context.signal })\n const outputPromise = collectOutput(process, outcome.maxBytes)\n void outputPromise.catch(() => undefined)\n let cancellation: Promise<void> | undefined\n let processExited = false\n const cancel = () => {\n if (!processExited) cancellation ??= stopProcess(process)\n }\n context.signal.addEventListener('abort', cancel, { once: true })\n if (context.signal.aborted) cancel()\n try {\n const termination = await process.wait()\n processExited = true\n context.signal.removeEventListener('abort', cancel)\n if (cancellation) await cancellation\n const status = await process.status()\n assertTerminalStatus(status, termination)\n state.output = await awaitOutput(outputPromise, context.signal, context.deadlineAtMs)\n state.termination = termination\n await appendExactProcessTrace(state, context.traceStore, status)\n return { executionId: request.executionId, termination }\n } finally {\n context.signal.removeEventListener('abort', cancel)\n }\n }\n\n async stop(\n request: AgentCandidateExecutorStopRequest,\n context: Parameters<AgentCandidateExecutorPort['stop']>[1],\n ): Promise<{ readonly stopped: true }> {\n await this.assertCapability()\n context.signal.throwIfAborted()\n const environment = await this.resolve(request, true)\n if (!environment) return { stopped: true }\n let statuses = await environment.process.list()\n if (statuses.length > 1) {\n throw new Error('candidate exact process environment contains more than one process')\n }\n const status = statuses[0]\n if (status?.running) {\n const process = await environment.process.get(status.pid)\n if (!process) throw new Error('candidate environment lost its running process handle')\n await stopProcess(process)\n }\n context.signal.throwIfAborted()\n statuses = await environment.process.list()\n if (statuses.some((entry) => entry.running)) {\n throw new Error('candidate exact process termination is not proven')\n }\n const finalStatus = statuses[0]\n if (finalStatus) assertTerminalStatus(finalStatus)\n const state = this.states.get(executionKey(request.executionId, request.executionPlanDigest))\n if (state) {\n state.termination = finalStatus?.termination ?? state.termination\n if (context.reason === 'timeout' && state.trace) {\n state.runtimeTermination = {\n kind: 'timeout',\n timeoutMs: state.trace.timeoutMs,\n }\n }\n await appendExactProcessTrace(state, context.traceStore, finalStatus)\n }\n return { stopped: true }\n }\n\n async capture(\n request: AgentCandidateExecutorStopRequest,\n context: Parameters<AgentCandidateExecutorPort['capture']>[1],\n ) {\n await this.assertCapability()\n context.signal.throwIfAborted()\n const environment = await this.resolve(request, false)\n const statuses = await environment.process.list()\n const status = statuses[0]\n if (statuses.length !== 1 || !status || status.running) {\n throw new Error('candidate environment must contain one stopped process before capture')\n }\n assertTerminalStatus(status)\n const process = await environment.process.get(status.pid)\n if (!process) throw new Error('candidate environment lost its captured process handle')\n const currentStatus = await process.status()\n assertTerminalStatus(currentStatus, status.termination)\n const state = this.states.get(executionKey(request.executionId, request.executionPlanDigest))\n const output =\n state?.output ??\n (await awaitOutput(\n collectOutput(process, outputSpec(environment).maxBytes),\n context.signal,\n Date.now() + this.provisionTimeoutMs,\n ))\n context.signal.throwIfAborted()\n const evidence = canonicalCandidateBytes({\n kind: 'agent-candidate-exact-process-capture',\n provider: environment.provider,\n environmentId: environment.id,\n executionId: request.executionId,\n executionPlanDigest: request.executionPlanDigest,\n createInputDigest: environment.metadata?.createInputDigest,\n process: {\n pid: status.pid,\n exitCode: status.exitCode,\n ...(status.exitSignal ? { exitSignal: status.exitSignal } : {}),\n termination: status.termination,\n },\n ...(state?.runtimeTermination ? { runtimeTermination: state.runtimeTermination } : {}),\n output: { sha256: sha256Bytes(output), byteLength: output.byteLength },\n })\n return {\n taskOutcome: { kind: 'output' as const, bytes: output },\n evidence,\n }\n }\n\n async dispose(\n request: AgentCandidateExecutorStopRequest,\n context: { signal: AbortSignal },\n ): Promise<{ readonly disposed: true }> {\n await this.assertCapability()\n context.signal.throwIfAborted()\n const environment = await this.resolve(request, true)\n if (!environment) return { disposed: true }\n let destroyError: unknown\n try {\n await environment.destroy()\n } catch (error) {\n destroyError = error\n }\n const remaining = await this.exactProcess.get(environment.id)\n if (remaining) {\n throw new Error('exact process environment disposal is not proven', { cause: destroyError })\n }\n context.signal.throwIfAborted()\n this.states.delete(executionKey(request.executionId, request.executionPlanDigest))\n return { disposed: true }\n }\n\n private async assertCapability(mode?: 'blocked' | 'strict'): Promise<void> {\n const pending =\n this.capabilitiesPromise ?? Promise.resolve(this.options.provider.capabilities())\n this.capabilitiesPromise = pending\n let capabilities: AgentEnvironmentCapabilities\n try {\n capabilities = await pending\n } catch (error) {\n if (this.capabilitiesPromise === pending) this.capabilitiesPromise = undefined\n throw error\n }\n const exact = capabilities.exactProcess\n if (!exact) {\n throw new Error(\n `agent environment provider \"${this.options.provider.name}\" does not declare exact process support`,\n )\n }\n if (mode && !exact.egress.includes(mode)) {\n throw new Error(\n `agent environment provider \"${this.options.provider.name}\" does not declare ${mode} exact egress`,\n )\n }\n }\n\n private async resolve(\n request: AgentCandidateExecutorStopRequest,\n missingIsDeleted: false,\n ): Promise<AgentExactProcessEnvironment>\n private async resolve(\n request: AgentCandidateExecutorStopRequest,\n missingIsDeleted: true,\n ): Promise<AgentExactProcessEnvironment | undefined>\n private async resolve(\n request: AgentCandidateExecutorStopRequest,\n missingIsDeleted: boolean,\n ): Promise<AgentExactProcessEnvironment | undefined> {\n const key = executionKey(request.executionId, request.executionPlanDigest)\n const active = this.states.get(key)?.environment\n if (active) return active\n const metadata = {\n kind: 'agent-candidate-execution',\n provider: this.options.provider.name,\n executionId: request.executionId,\n executionPlanDigest: request.executionPlanDigest,\n }\n const listed = await this.exactProcess.list({\n metadata,\n ...(this.providerOptions ? { providerOptions: this.providerOptions } : {}),\n })\n const matches = listed.filter(\n (environment) =>\n environment.provider === this.options.provider.name &&\n Object.entries(metadata).every(([name, value]) =>\n isDeepStrictEqual(environment.metadata?.[name], value),\n ),\n )\n if (matches.length > 1) {\n throw new Error('multiple exact process environments match one candidate execution')\n }\n const environment = matches[0]\n if (!environment) {\n if (missingIsDeleted) return undefined\n throw new Error('candidate exact process evidence is unavailable')\n }\n if (!isSha256Digest(environment.metadata?.createInputDigest)) {\n throw new Error('candidate exact process create-input digest is unavailable')\n }\n this.states.set(key, { environment })\n return environment\n }\n}\n\nasync function appendExactProcessTrace(\n state: ExactProcessRunState,\n traceStore: TraceStore,\n status?: AgentExactProcessStatus,\n): Promise<void> {\n const trace = state.trace\n if (!trace || trace.written) return\n const endedAt = Math.max(trace.startedAt, Math.min(Date.now(), trace.deadlineAtMs))\n const termination = state.runtimeTermination ?? state.termination ?? status?.termination\n await traceStore.appendRun({\n runId: trace.runId,\n scenarioId: trace.scenarioId,\n startedAt: trace.startedAt,\n endedAt,\n status: termination?.kind === 'exit' && termination.exitCode === 0 ? 'completed' : 'failed',\n tags: trace.tags,\n })\n trace.written = true\n}\n\nfunction assertSupportedRequest(request: AgentCandidateExecutorRequest): void {\n if (request.benchmark.task.outcome.kind !== 'output') {\n throw new Error(\n 'exact process candidate executor does not support workspace outcomes; use Pier',\n )\n }\n if (request.executionPlan.value.material.codeKind !== 'disabled' || request.inputs.candidate) {\n throw new Error('exact process candidate executor does not support code workspaces; use Pier')\n }\n if (request.memory.mode !== 'disabled') {\n throw new Error('exact process candidate executor does not support isolated memory')\n }\n const mediaType = request.benchmark.task.outcome.mediaType.toLowerCase()\n if (\n !(\n mediaType.startsWith('text/') ||\n mediaType === 'application/json' ||\n mediaType.endsWith('+json')\n )\n ) {\n throw new Error('exact process candidate executor supports only UTF-8 text and JSON outputs')\n }\n if (!posix.isAbsolute(request.launch.executable) && !request.launch.env.PATH?.trim()) {\n throw new Error('exact process candidate executable must be absolute or declare a signed PATH')\n }\n}\n\nasync function materializeRequest(\n environment: AgentExactProcessEnvironment,\n request: AgentCandidateExecutorRequest,\n signal: AbortSignal,\n): Promise<void> {\n const knowledgePaths = assertKnowledgeExecutionBinding(request)\n for (const file of request.inputs.task.files) {\n await environment.writeFile(beneath(request.roots.taskRoot, file.path), file.bytes, {\n mode: file.mode,\n signal,\n })\n }\n const profileRoot =\n request.executionPlan.value.material.profile.targetWorkspace === 'task'\n ? request.roots.taskRoot\n : request.roots.candidateRoot\n if (!profileRoot) throw new Error('candidate profile targets a missing workspace')\n for (const file of request.profileActivation.files) {\n await environment.writeFile(\n beneath(profileRoot, file.path),\n Buffer.from(file.content, 'utf8'),\n { mode: file.mode, signal },\n )\n }\n if (request.knowledge && knowledgePaths) {\n for (const file of request.knowledge.files) {\n await environment.writeFile(beneath(knowledgePaths.root, file.path), file.bytes, {\n mode: file.mode,\n signal,\n })\n }\n if (request.knowledge.retrievalConfig && knowledgePaths.retrievalConfig) {\n await environment.writeFile(\n knowledgePaths.retrievalConfig,\n request.knowledge.retrievalConfig,\n { mode: 0o644, signal },\n )\n }\n }\n if (request.instruction.delivery.kind === 'utf8-file') {\n await environment.writeFile(request.instruction.delivery.path, request.instruction.bytes, {\n mode: 0o644,\n signal,\n })\n }\n}\n\nfunction assertKnowledgeExecutionBinding(\n request: AgentCandidateExecutorRequest,\n): ReturnType<typeof candidateKnowledgeExecutionPaths> | undefined {\n const knowledge = request.knowledge\n if (!knowledge) {\n if (\n request.launch.env[CANDIDATE_KNOWLEDGE_ROOT_ENV] !== undefined ||\n request.launch.env[CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV] !== undefined\n ) {\n throw new Error('candidate launch declares knowledge paths without verified knowledge')\n }\n return undefined\n }\n const paths = candidateKnowledgeExecutionPaths(\n request.roots.taskRoot,\n knowledge.retrievalConfig !== undefined,\n )\n if (\n request.launch.env[CANDIDATE_KNOWLEDGE_ROOT_ENV] !== paths.root ||\n request.launch.env[CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV] !== paths.retrievalConfig\n ) {\n throw new Error('candidate knowledge paths do not match the signed launch environment')\n }\n const reserved = [paths.root, paths.retrievalConfig].filter(\n (value): value is string => value !== undefined,\n )\n const profileRoot =\n request.executionPlan.value.material.profile.targetWorkspace === 'task'\n ? request.roots.taskRoot\n : request.roots.candidateRoot\n const otherFiles = [\n ...request.inputs.task.files.map((file) => beneath(request.roots.taskRoot, file.path)),\n ...(profileRoot\n ? request.profileActivation.files.map((file) => beneath(profileRoot, file.path))\n : []),\n ...(request.instruction.delivery.kind === 'utf8-file'\n ? [request.instruction.delivery.path]\n : []),\n ]\n if (\n otherFiles.some((path) =>\n reserved.some(\n (reservedPath) =>\n path === reservedPath ||\n path.startsWith(`${reservedPath}/`) ||\n reservedPath.startsWith(`${path}/`),\n ),\n )\n ) {\n throw new Error('candidate knowledge paths overlap other execution inputs')\n }\n return paths\n}\n\nfunction exactLaunch(request: AgentCandidateExecutorRequest): AgentExactProcessLaunch {\n const instruction = new TextDecoder('utf-8', { fatal: true }).decode(request.instruction.bytes)\n const base = {\n executable: request.launch.executable,\n args: request.launch.args,\n cwd: request.launch.cwd,\n env: request.launch.env,\n timeoutMs: 0,\n }\n switch (request.instruction.delivery.kind) {\n case 'argv-append':\n return { ...base, args: [...base.args, instruction] }\n case 'stdin-utf8':\n return { ...base, stdin: instruction }\n case 'utf8-file':\n return base\n }\n}\n\nasync function collectOutput(process: AgentExactProcess, maxBytes: number): Promise<Uint8Array> {\n const chunks: Buffer[] = []\n let byteLength = 0\n for await (const chunk of process.stdout()) {\n const bytes = Buffer.from(chunk, 'utf8')\n byteLength += bytes.byteLength\n if (byteLength > maxBytes) {\n let stopError: unknown\n try {\n await stopProcess(process)\n } catch (error) {\n stopError = error\n }\n throw new Error(`candidate output exceeds its ${maxBytes}-byte maximum`, {\n cause: stopError,\n })\n }\n chunks.push(bytes)\n }\n return Uint8Array.from(Buffer.concat(chunks, byteLength))\n}\n\nasync function awaitOutput(\n output: Promise<Uint8Array>,\n signal: AbortSignal,\n deadlineAtMs: number,\n): Promise<Uint8Array> {\n signal.throwIfAborted()\n const remainingMs = deadlineAtMs - Date.now()\n if (remainingMs <= 0) throw new Error('candidate output deadline expired')\n let timer: ReturnType<typeof setTimeout> | undefined\n let onAbort: (() => void) | undefined\n try {\n return await Promise.race([\n output,\n new Promise<never>((_resolve, reject) => {\n onAbort = () => reject(signal.reason ?? new Error('candidate output cancelled'))\n signal.addEventListener('abort', onAbort, { once: true })\n timer = setTimeout(\n () => reject(new Error('candidate output deadline expired')),\n remainingMs,\n )\n }),\n ])\n } finally {\n if (onAbort) signal.removeEventListener('abort', onAbort)\n if (timer) clearTimeout(timer)\n }\n}\n\nasync function stopProcess(process: AgentExactProcess): Promise<void> {\n const before = await process.status()\n if (!before.running) return\n try {\n await process.kill()\n } catch (error) {\n if ((await process.status()).running) throw error\n }\n const termination = await process.wait()\n assertTerminalStatus(await process.status(), termination)\n}\n\nfunction assertTerminalStatus(\n status: AgentExactProcessStatus,\n expected?: AgentCandidateTermination,\n): asserts status is AgentExactProcessStatus & { termination: AgentCandidateTermination } {\n if (status.running || !status.termination) {\n throw new Error('exact process returned no terminal reason after exit')\n }\n if (expected && !isDeepStrictEqual(status.termination, expected)) {\n throw new Error('exact process wait and status returned different terminal reasons')\n }\n}\n\nfunction assertExecutionEnvironment(\n environment: AgentExactProcessEnvironment,\n metadata: Record<string, unknown>,\n providerName: string,\n): void {\n if (!environment.id || environment.provider !== providerName) {\n throw new Error('exact process provider returned the wrong environment identity')\n }\n if (\n !Object.entries(metadata).every(([name, value]) =>\n isDeepStrictEqual(environment.metadata?.[name], value),\n )\n ) {\n throw new Error('exact process provider did not persist candidate execution metadata')\n }\n}\n\nfunction outputSpec(environment: AgentExactProcessEnvironment): { maxBytes: number } {\n const maxBytes = environment.metadata?.outputMaxBytes\n if (!Number.isSafeInteger(maxBytes) || Number(maxBytes) < 1) {\n throw new Error('candidate exact process output bound is unavailable')\n }\n return { maxBytes: Number(maxBytes) }\n}\n\nfunction executionKey(executionId: string, executionPlanDigest: Sha256Digest): string {\n return `${executionId}\\0${executionPlanDigest}`\n}\n\nfunction executionIdempotencyKey(executionId: string, executionPlanDigest: Sha256Digest): string {\n return `candidate-${canonicalCandidateDigest({\n kind: 'agent-candidate-execution-identity',\n executionId,\n executionPlanDigest,\n }).slice('sha256:'.length)}`\n}\n\nfunction exactImage(image: string, manifestDigest: Sha256Digest): string {\n if (isSha256Digest(image)) {\n if (image !== manifestDigest) {\n throw new Error('candidate container image conflicts with its resolved manifest')\n }\n return image\n }\n const marker = image.lastIndexOf('@')\n if (marker < 0) return `${image}@${manifestDigest}`\n if (image.slice(marker + 1) !== manifestDigest) {\n throw new Error('candidate container image conflicts with its resolved manifest')\n }\n return image\n}\n\nfunction environmentLifetimeMs(timeoutMs: number, retentionMs: number): number {\n const total = positiveInteger(timeoutMs, 'candidate execution timeout') + retentionMs\n if (!Number.isSafeInteger(total)) throw new Error('candidate environment lifetime is too large')\n return Math.ceil(total / 1_000) * 1_000\n}\n\nfunction exactResources(resources: AgentExactProcessResources): AgentExactProcessResources {\n if (!Number.isFinite(resources.cpu) || resources.cpu <= 0) {\n throw new Error('exact process CPU must be positive and finite')\n }\n return Object.freeze({\n cpu: resources.cpu,\n memoryMb: positiveInteger(resources.memoryMb, 'exact process memory'),\n diskMb: positiveInteger(resources.diskMb, 'exact process disk'),\n })\n}\n\nfunction positiveInteger(value: number, label: string): number {\n if (!Number.isSafeInteger(value) || value < 1)\n throw new Error(`${label} must be a positive integer`)\n return value\n}\n\nfunction beneath(root: string, relativePath: string): string {\n if (posix.isAbsolute(relativePath)) throw new Error('candidate input path must be relative')\n const path = posix.normalize(relativePath)\n if (path === '..' || path.startsWith('../')) {\n throw new Error('candidate input path escapes its execution root')\n }\n return posix.join(root, path)\n}\n\nfunction isSha256Digest(value: unknown): value is Sha256Digest {\n return typeof value === 'string' && /^sha256:[a-f0-9]{64}$/.test(value)\n}\n","import type {\n AgentCandidateModelAccessNetwork,\n AgentCandidateResolvedModel,\n Sha256Digest,\n} from '@tangle-network/agent-interface'\n\nimport { canonicalCandidateDigest, immutableCandidateValue } from './digest'\nimport { assertExactObjectKeys } from './exact-object'\nimport { sealAgentCandidateModelSettlement, usdToNanos } from './model-settlement'\nimport type {\n AgentCandidateModelLimits,\n AgentCandidateModelPort,\n AgentCandidateProtectedModelActivation,\n AgentCandidateProtectedModelReservation,\n AgentCandidateProtectedModelSettlement,\n} from './types'\n\nexport type AgentCandidateModelGrantReserveInput = Parameters<\n AgentCandidateModelPort['reserveGrant']\n>[0]\nexport type AgentCandidateModelGrantActivateInput = Parameters<\n AgentCandidateModelPort['activateGrant']\n>[0]\nexport type AgentCandidateModelGrantSettleInput = Parameters<\n AgentCandidateModelPort['settleGrant']\n>[0]\n\n/** Secret-free response from the service's reservation endpoint. */\nexport type AgentCandidateModelGrantReservation = AgentCandidateProtectedModelReservation\n\n/**\n * Narrow transport contract for a service that owns scoped model credentials\n * and the authoritative per-call usage ledger.\n *\n * An HTTP client can bind these methods to control-plane endpoints. Keeping\n * transport out of the runtime prevents parent credentials, endpoint paths,\n * and retry policy from becoming part of the portable candidate contract.\n */\nexport interface AgentCandidateModelGrantClient {\n reserve(input: AgentCandidateModelGrantReserveInput): Promise<AgentCandidateModelGrantReservation>\n activate(\n input: AgentCandidateModelGrantActivateInput,\n ): Promise<AgentCandidateProtectedModelActivation>\n settle(\n input: AgentCandidateModelGrantSettleInput,\n ): Promise<AgentCandidateProtectedModelSettlement>\n}\n\nexport interface CreateProtectedAgentCandidateModelPortOptions {\n client: AgentCandidateModelGrantClient\n /** Catalog/snapshot resolution stays separate from credential issuance. */\n resolveModel: AgentCandidateModelPort['resolve']\n /** The only public DNS name candidate processes may reach for inference. */\n gatewayDomain: string\n /** Exact environment names the activation endpoint must return, no more or fewer. */\n activationEnvNames: readonly string[]\n}\n\ninterface RememberedReservation {\n requestDigest: Sha256Digest\n responseDigest: Sha256Digest\n executionId: string\n preparationId: string\n grantDigest: Sha256Digest\n expiresAtMs: number\n resolved: AgentCandidateResolvedModel\n limits: AgentCandidateModelLimits\n maxCostUsdNanos: number\n activation: 'reserved' | 'activating' | 'activated'\n settlementDigest?: Sha256Digest\n settlementReason?: AgentCandidateModelGrantSettleInput['reason']\n}\n\ninterface RememberedSettlement {\n settlementDigest: Sha256Digest\n settlementReason: AgentCandidateModelGrantSettleInput['reason']\n expiresAtMs: number\n}\n\nconst MAX_RECENT_SETTLEMENTS = 4_096\nconst RECOVERED_SETTLEMENT_RETENTION_MS = 15 * 60 * 1_000\n\n/**\n * Bind a protected model-grant service to the immutable candidate runtime.\n *\n * The service remains the authority for expiry, admission, revocation, and\n * metering. This adapter independently checks every response before allowing\n * it to cross into candidate execution or durable receipt finalization.\n */\nexport function createProtectedAgentCandidateModelPort(\n options: CreateProtectedAgentCandidateModelPortOptions,\n): AgentCandidateModelPort {\n const gatewayDomain = assertGatewayDomain(options.gatewayDomain)\n const activationEnvNames = exactEnvironmentNames(options.activationEnvNames)\n const reservations = new Map<string, RememberedReservation>()\n const recentSettlements = new Map<string, RememberedSettlement>()\n\n return {\n resolve: async (input) => {\n const request = immutableCandidateValue(input)\n const resolved = validateResolvedModel(await options.resolveModel(request), request)\n return immutableCandidateValue(resolved)\n },\n\n reserveGrant: async (input) => {\n pruneExpiredState(reservations, recentSettlements, Date.now())\n const request = immutableCandidateValue(input)\n validateReserveInput(request)\n const requestDigest = canonicalCandidateDigest(request)\n const key = reservationKey(request.executionId, request.preparationId)\n if (recentSettlements.has(key)) {\n throw new Error('protected model reservation is already settled')\n }\n const previous = reservations.get(key)\n if (previous && previous.requestDigest !== requestDigest) {\n throw new Error('protected model reservation retry changed immutable input')\n }\n\n const reservation = validateReservation(\n await options.client.reserve(request),\n request,\n gatewayDomain,\n )\n const responseDigest = canonicalCandidateDigest(reservation)\n if (recentSettlements.has(key)) {\n throw new Error('protected model reservation completed after the grant was settled')\n }\n const recorded = previous ?? reservations.get(key)\n if (recorded && recorded.requestDigest !== requestDigest) {\n throw new Error('protected model reservation retry changed immutable input')\n }\n if (recorded && recorded.responseDigest !== responseDigest) {\n throw new Error('protected model reservation retry returned different evidence')\n }\n if (!recorded) {\n reservations.set(key, {\n requestDigest,\n responseDigest,\n executionId: request.executionId,\n preparationId: request.preparationId,\n grantDigest: reservation.digest,\n expiresAtMs: request.expiresAtMs,\n resolved: immutableCandidateValue(request.resolved),\n limits: immutableCandidateValue(request.limits),\n maxCostUsdNanos: usdToNanos(request.limits.maxCostUsd, 'reserved maxCostUsd'),\n activation: 'reserved',\n })\n }\n return reservation\n },\n\n activateGrant: async (input) => {\n pruneExpiredState(reservations, recentSettlements, Date.now())\n const request = immutableCandidateValue(input)\n const key = reservationKey(request.executionId, request.preparationId)\n if (recentSettlements.has(key)) throw new Error('protected model grant is already settled')\n const state = reservations.get(key)\n if (!state) throw new Error('protected model grant was not reserved by this port')\n assertGrantIdentity(state, request)\n if (state.settlementDigest) throw new Error('protected model grant is already settled')\n if (state.activation !== 'reserved') {\n throw new Error('protected model grant activation is single-use')\n }\n if (!Number.isSafeInteger(request.deadlineAtMs) || request.deadlineAtMs <= 0) {\n throw new Error('protected model activation deadline must be a positive safe integer')\n }\n if (request.deadlineAtMs <= Date.now()) {\n throw new Error('protected model activation deadline must be in the future')\n }\n if (request.deadlineAtMs > state.expiresAtMs) {\n throw new Error('protected model activation deadline exceeds the reserved expiry')\n }\n state.activation = 'activating'\n try {\n const activation = validateActivation(\n await options.client.activate(request),\n state.limits.maxModelCalls === 0 ? [] : activationEnvNames,\n )\n if (recentSettlements.has(key) || reservations.get(key) !== state) {\n throw new Error('protected model grant settled while activation was in flight')\n }\n state.activation = 'activated'\n return activation\n } catch (error) {\n state.activation = 'reserved'\n throw error\n }\n },\n\n settleGrant: async (input) => {\n const now = Date.now()\n pruneExpiredState(reservations, recentSettlements, now)\n const request = immutableCandidateValue(input)\n const key = reservationKey(request.executionId, request.preparationId)\n const state = reservations.get(key)\n if (state) assertGrantIdentity(state, request)\n const remembered = state ?? recentSettlements.get(key)\n if (remembered?.settlementReason && remembered.settlementReason !== request.reason) {\n throw new Error('protected model settlement retry changed the termination reason')\n }\n\n const sealed = sealAgentCandidateModelSettlement(await options.client.settle(request), {\n preparationId: request.preparationId,\n grantDigest: request.grantDigest,\n model: request.resolved.model,\n })\n if (state) assertWithinReservedLimits(sealed.usage, state)\n\n const settlementDigest = canonicalCandidateDigest(sealed.value)\n if (remembered?.settlementDigest && remembered.settlementDigest !== settlementDigest) {\n throw new Error('protected model settlement retry returned a different final ledger')\n }\n if (remembered?.settlementReason && remembered.settlementReason !== request.reason) {\n throw new Error('protected model settlement retry changed the termination reason')\n }\n const expiresAtMs = state?.expiresAtMs ?? now + RECOVERED_SETTLEMENT_RETENTION_MS\n if (state) {\n state.settlementDigest = settlementDigest\n state.settlementReason = request.reason\n }\n reservations.delete(key)\n rememberSettlement(recentSettlements, key, {\n settlementDigest,\n settlementReason: request.reason,\n expiresAtMs,\n })\n return sealed.value\n },\n }\n}\n\nfunction validateReserveInput(input: AgentCandidateModelGrantReserveInput): void {\n if (!Number.isSafeInteger(input.expiresAtMs) || input.expiresAtMs <= 0) {\n throw new Error('protected model reservation expiry must be a positive safe integer')\n }\n if (input.expiresAtMs <= Date.now()) {\n throw new Error('protected model reservation expiry must be in the future')\n }\n for (const [name, value] of [\n ['maxModelCalls', input.limits.maxModelCalls],\n ['maxInputTokens', input.limits.maxInputTokens],\n ['maxOutputTokens', input.limits.maxOutputTokens],\n ] as const) {\n if (!Number.isSafeInteger(value) || value < 0) {\n throw new Error(`protected model reservation ${name} must be a nonnegative safe integer`)\n }\n }\n usdToNanos(input.limits.maxCostUsd, 'reserved maxCostUsd')\n}\n\nfunction validateReservation(\n value: unknown,\n expected: AgentCandidateModelGrantReserveInput,\n gatewayDomain: string,\n): AgentCandidateModelGrantReservation {\n const source = exactRecord(\n value,\n ['preparationId', 'digest', 'expiresAtMs', 'enforcedLimits', 'network'],\n 'protected model reservation response',\n )\n if (source.preparationId !== expected.preparationId) {\n throw new Error('protected model reservation response changed preparation identity')\n }\n if (!isSha256Digest(source.digest)) {\n throw new Error('protected model reservation response has an invalid digest')\n }\n if (source.expiresAtMs !== expected.expiresAtMs) {\n throw new Error('protected model reservation response changed expiry')\n }\n exactRecord(\n source.enforcedLimits,\n ['maxModelCalls', 'maxInputTokens', 'maxOutputTokens', 'maxCostUsd'],\n 'protected model reservation enforced limits',\n )\n if (\n canonicalCandidateDigest(source.enforcedLimits) !== canonicalCandidateDigest(expected.limits)\n ) {\n throw new Error('protected model reservation response changed enforced limits')\n }\n\n const network = validateReservationNetwork(\n source.network,\n expected.limits.maxModelCalls,\n gatewayDomain,\n )\n return immutableCandidateValue({\n preparationId: source.preparationId,\n digest: source.digest,\n expiresAtMs: source.expiresAtMs,\n enforcedLimits: source.enforcedLimits,\n network,\n }) as AgentCandidateModelGrantReservation\n}\n\nfunction validateReservationNetwork(\n value: unknown,\n maxModelCalls: number,\n gatewayDomain: string,\n): AgentCandidateModelAccessNetwork {\n if (maxModelCalls === 0) {\n const source = exactRecord(value, ['mode'], 'protected model reservation network')\n if (source.mode !== 'disabled') {\n throw new Error('zero-call protected model reservation must disable gateway access')\n }\n return { mode: 'disabled' }\n }\n\n const source = exactRecord(value, ['mode', 'domains'], 'protected model reservation network')\n if (source.mode !== 'gateway-only') {\n throw new Error('protected model reservation must allow only its model gateway')\n }\n if (\n !Array.isArray(source.domains) ||\n source.domains.length !== 1 ||\n source.domains[0] !== gatewayDomain\n ) {\n throw new Error('protected model reservation returned an unexpected gateway domain')\n }\n return { mode: 'gateway-only', domains: [gatewayDomain] }\n}\n\nfunction validateActivation(\n value: unknown,\n expectedNames: readonly string[],\n): AgentCandidateProtectedModelActivation {\n const source = exactRecord(value, ['env'], 'protected model activation response')\n const env = record(source.env, 'protected model activation environment')\n const actualNames = Object.keys(env).sort()\n if (\n actualNames.length !== expectedNames.length ||\n actualNames.some((name, index) => name !== expectedNames[index])\n ) {\n throw new Error('protected model activation returned unexpected environment names')\n }\n const detached: Record<string, string> = Object.create(null) as Record<string, string>\n for (const name of expectedNames) {\n const value = env[name]\n if (typeof value !== 'string' || value.length < 8 || value.length > 65_536) {\n throw new Error(`protected model activation ${name} must be a non-empty protected value`)\n }\n detached[name] = value\n }\n return Object.freeze({ env: Object.freeze(detached) })\n}\n\nfunction validateResolvedModel(\n value: unknown,\n expected: Parameters<AgentCandidateModelPort['resolve']>[0],\n): AgentCandidateResolvedModel {\n const source = exactRecord(\n value,\n ['requested', 'provider', 'model', 'snapshot', 'reasoningEffort'],\n 'resolved candidate model',\n )\n if (source.requested !== expected.requested) {\n throw new Error('model resolver changed the evaluator-owned request')\n }\n if (source.reasoningEffort !== expected.reasoningEffort) {\n throw new Error('model resolver changed the evaluator-owned reasoning effort')\n }\n for (const name of ['requested', 'provider', 'model', 'snapshot'] as const) {\n if (typeof source[name] !== 'string' || source[name].length === 0) {\n throw new Error(`resolved candidate model ${name} must be non-empty`)\n }\n }\n return source as unknown as AgentCandidateResolvedModel\n}\n\nfunction assertGrantIdentity(\n expected: RememberedReservation,\n actual: AgentCandidateModelGrantActivateInput | AgentCandidateModelGrantSettleInput,\n): void {\n if (\n actual.executionId !== expected.executionId ||\n actual.preparationId !== expected.preparationId ||\n actual.grantDigest !== expected.grantDigest ||\n canonicalCandidateDigest(actual.resolved) !== canonicalCandidateDigest(expected.resolved)\n ) {\n throw new Error('protected model grant input does not match its immutable reservation')\n }\n}\n\nfunction assertWithinReservedLimits(\n usage: {\n modelCalls: number\n inputTokens: number\n outputTokens: number\n costUsdNanos: number\n },\n reservation: RememberedReservation,\n): void {\n for (const [name, actual, limit] of [\n ['model calls', usage.modelCalls, reservation.limits.maxModelCalls],\n ['input tokens', usage.inputTokens, reservation.limits.maxInputTokens],\n ['output tokens', usage.outputTokens, reservation.limits.maxOutputTokens],\n ['cost USD nanos', usage.costUsdNanos, reservation.maxCostUsdNanos],\n ] as const) {\n if (actual > limit) {\n throw new Error(`protected model settlement ${name} ${actual} exceeds reserved ${limit}`)\n }\n }\n}\n\nfunction exactEnvironmentNames(values: readonly string[]): readonly string[] {\n if (values.length === 0) {\n throw new Error('protected model activation environment names must not be empty')\n }\n const names = [...values].sort()\n if (new Set(names).size !== names.length) {\n throw new Error('protected model activation environment names must be unique')\n }\n for (const name of names) {\n if (\n !/^[A-Za-z_][A-Za-z0-9_]*$/.test(name) ||\n ['__proto__', 'constructor', 'prototype'].includes(name)\n ) {\n throw new Error(`protected model activation environment name is invalid: ${name}`)\n }\n }\n return Object.freeze(names)\n}\n\nfunction assertGatewayDomain(value: string): string {\n if (\n value.length > 253 ||\n value !== value.toLowerCase() ||\n value.endsWith('.') ||\n value.includes(':') ||\n value === 'localhost' ||\n value.endsWith('.localhost') ||\n value === 'metadata.google' ||\n value === 'metadata.google.internal'\n ) {\n throw new Error('protected model gateway must be an exact lowercase public DNS name')\n }\n const labels = value.split('.')\n if (\n labels.length < 2 ||\n !labels.every(\n (label) =>\n label.length >= 1 && label.length <= 63 && /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label),\n ) ||\n !/[a-z]/.test(labels.at(-1) ?? '')\n ) {\n throw new Error('protected model gateway must be an exact lowercase public DNS name')\n }\n return value\n}\n\nfunction reservationKey(executionId: string, preparationId: string): string {\n return canonicalCandidateDigest({ executionId, preparationId })\n}\n\nfunction pruneExpiredState(\n reservations: Map<string, RememberedReservation>,\n settlements: Map<string, RememberedSettlement>,\n now: number,\n): void {\n for (const [key, value] of reservations) {\n if (value.expiresAtMs <= now) reservations.delete(key)\n }\n for (const [key, value] of settlements) {\n if (value.expiresAtMs <= now) settlements.delete(key)\n }\n}\n\nfunction rememberSettlement(\n settlements: Map<string, RememberedSettlement>,\n key: string,\n value: RememberedSettlement,\n): void {\n settlements.delete(key)\n settlements.set(key, value)\n while (settlements.size > MAX_RECENT_SETTLEMENTS) {\n const oldest = settlements.keys().next().value\n if (oldest === undefined) return\n settlements.delete(oldest)\n }\n}\n\nfunction isSha256Digest(value: unknown): value is Sha256Digest {\n return typeof value === 'string' && /^sha256:[a-f0-9]{64}$/.test(value)\n}\n\nfunction exactRecord(\n value: unknown,\n keys: readonly string[],\n label: string,\n): Record<string, unknown> {\n const source = record(value, label)\n assertExactObjectKeys(source, keys, label)\n return source\n}\n\nfunction record(value: unknown, label: string): Record<string, unknown> {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error(`${label} must be an object`)\n }\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n throw new Error(`${label} must be a plain object`)\n }\n return value as Record<string, unknown>\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,SAAS,yBAAyB;AA+BlC,IAAM,+BAA+B;AACrC,IAAM,gCAAgC,KAAK;AA2BpC,SAAS,wCACd,SAC4B;AAC5B,SAAO,IAAI,mCAAmC,OAAO;AACvD;AAEA,IAAM,qCAAN,MAA+E;AAAA,EAS7E,YAA6B,SAA+C;AAA/C;AAC3B,QAAI,CAAC,QAAQ,SAAS,cAAc;AAClC,YAAM,IAAI;AAAA,QACR,+BAA+B,QAAQ,SAAS,IAAI;AAAA,MACtD;AAAA,IACF;AACA,SAAK,eAAe,QAAQ,SAAS;AACrC,SAAK,YAAY,eAAe,QAAQ,SAAS;AACjD,SAAK,qBAAqB;AAAA,MACxB,QAAQ,sBAAsB;AAAA,MAC9B;AAAA,IACF;AACA,SAAK,sBAAsB;AAAA,MACzB,QAAQ,uBAAuB;AAAA,MAC/B;AAAA,IACF;AACA,SAAK,kBAAkB,QAAQ,kBAC3B,wBAAwB,QAAQ,eAAe,IAC/C;AAAA,EACN;AAAA,EAnB6B;AAAA,EARZ,SAAS,oBAAI,IAAkC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT;AAAA,EAuBR,MAAM,QACJ,SACA,SACA;AACA,2BAAuB,OAAO;AAC9B,UAAM,UAAU,QAAQ,UAAU,KAAK;AACvC,QAAI,QAAQ,SAAS,SAAU,OAAM,IAAI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,GAAG;AAAA,EACtD;AACF;AAEA,SAAS,mBACP,aACA,KACA,OACM;AACN,cAAY,OAAO,GAAG;AACtB,cAAY,IAAI,KAAK,KAAK;AAC1B,SAAO,YAAY,OAAO,wBAAwB;AAChD,UAAM,SAAS,YAAY,KAAK,EAAE,KAAK,EAAE;AACzC,QAAI,WAAW,OAAW;AAC1B,gBAAY,OAAO,MAAM;AAAA,EAC3B;AACF;AAEA,SAASF,gBAAe,OAAuC;AAC7D,SAAO,OAAO,UAAU,YAAY,wBAAwB,KAAK,KAAK;AACxE;AAEA,SAAS,YACP,OACA,MACA,OACyB;AACzB,QAAM,SAAS,OAAO,OAAO,KAAK;AAClC,wBAAsB,QAAQ,MAAM,KAAK;AACzC,SAAO;AACT;AAEA,SAAS,OAAO,OAAgB,OAAwC;AACtE,MAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG;AACvE,UAAM,IAAI,MAAM,GAAG,KAAK,oBAAoB;AAAA,EAC9C;AACA,QAAM,YAAY,OAAO,eAAe,KAAK;AAC7C,MAAI,cAAc,OAAO,aAAa,cAAc,MAAM;AACxD,UAAM,IAAI,MAAM,GAAG,KAAK,yBAAyB;AAAA,EACnD;AACA,SAAO;AACT;","names":["environment","isSha256Digest","source","value"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkspacePlanReceipt } from '@tangle-network/agent-profile-materialize';
|
|
2
2
|
import { L as LocalHarness, C as CodexTokenUsage, c as CodexExecutionPolicy } from './local-harness-CtK9dSny.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as Executor } from './types-lZTE_LBd.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -1,16 +1,183 @@
|
|
|
1
|
-
import { E as ExecutorFactory,
|
|
2
|
-
import {
|
|
1
|
+
import { R as Runtime, E as ExecutorFactory, U as UsageEvent, k as ExecutorProgress, T as TraceSource, g as Spend, i as ExecutorRegistry, A as Agent, S as Scope, b as ResultBlobStore, B as Budget } from './types-lZTE_LBd.js';
|
|
2
|
+
import { StreamingDetector, DetectorSignal, ToolSpan, AgentEvalError } from '@tangle-network/agent-eval';
|
|
3
|
+
import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
|
|
3
4
|
import { a as UiLens, U as UiFinding, C as CoderTask } from './substrate-Dyiqmd3o.js';
|
|
4
|
-
import { S as SandboxClient, E as ExecCtx,
|
|
5
|
-
import { BackendType, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
6
|
-
import { AgentEvalError } from '@tangle-network/agent-eval';
|
|
5
|
+
import { S as SandboxClient, E as ExecCtx, t as LoopTraceEmitter, c as LoopTraceEvent, A as AgentRunSpec } from './types-DK11_O4L.js';
|
|
6
|
+
import { AgentProfile, BackendType, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
7
7
|
import { b as ToolSpec, c as RuntimeTelemetryOptions, R as RouterConfig } from './sanitize-DEbPNtyI.js';
|
|
8
8
|
import { R as RuntimeStreamEvent } from './types-BwoZWq-i.js';
|
|
9
|
-
import { G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-
|
|
9
|
+
import { G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-DLINnrkM.js';
|
|
10
10
|
import { L as LocalHarness } from './local-harness-CtK9dSny.js';
|
|
11
11
|
import { ProviderExecutorOptions, AgentEnvironmentProviderRegistry } from './environment-provider.js';
|
|
12
12
|
import { AgentEnvironmentProvider } from '@tangle-network/agent-interface/environment-provider';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* `piExecutor` — pi wrapped behind `Executor`, NOT forked.
|
|
17
|
+
*
|
|
18
|
+
* pi already implements everything a steerable worker needs, and implements it well: a queued
|
|
19
|
+
* steering channel delivered between turns, follow-ups, abort, compaction, session persistence
|
|
20
|
+
* with fork/branch, and an out-of-process line-delimited JSON protocol over stdin/stdout
|
|
21
|
+
* (`pi --mode rpc`). Reimplementing any of that here would mean owning a turn loop someone else
|
|
22
|
+
* already maintains. So this module is a thin protocol adapter, and every capability maps onto a
|
|
23
|
+
* verb pi already has:
|
|
24
|
+
*
|
|
25
|
+
* `execute` → `prompt`, draining pi's event stream until `agent_end`
|
|
26
|
+
* `deliver` → `steer` (forceful) / `follow_up` (queued) — pi owns the queue, we do not
|
|
27
|
+
* `teardown` → `abort`, then close stdin and reap the process
|
|
28
|
+
* `progress` → pi's `tool_execution_start`/`_end` + `turn_end` events, plus `get_state`'s
|
|
29
|
+
* `pendingMessageCount` mirrored locally so the read stays synchronous
|
|
30
|
+
* `traceSource` → the same tool events decoded into the shared `ToolSpan` currency
|
|
31
|
+
* `resultArtifact` → the last assistant text collected off the stream
|
|
32
|
+
*
|
|
33
|
+
* It is registered through the DOCUMENTED extension point (`ExecutorRegistry.register('pi', …)`),
|
|
34
|
+
* so nothing in the resolver switches on it and a consumer can replace it wholesale.
|
|
35
|
+
*
|
|
36
|
+
* agent-runtime does NOT take a dependency on pi. The wire shapes (`RpcCommand`, `AgentEvent`)
|
|
37
|
+
* are read structurally off JSON lines, so a pi that adds commands stays compatible and a pi that
|
|
38
|
+
* is not installed simply fails loud at spawn instead of at import.
|
|
39
|
+
*
|
|
40
|
+
* Usage accounting: pi reports token usage on its assistant messages when the provider supplies
|
|
41
|
+
* it. Nothing is fabricated — a turn whose usage pi does not report contributes an `iteration`
|
|
42
|
+
* event and zero tokens, exactly like the other honest executors.
|
|
43
|
+
*
|
|
44
|
+
* @experimental
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/** The runtime name `piExecutor` registers under. */
|
|
48
|
+
declare const PI_RUNTIME: Runtime;
|
|
49
|
+
/** Seam key the registry threads a `PiSeam` through (`ExecutorContext.seams['pi']`). */
|
|
50
|
+
declare const piSeamKey = "pi";
|
|
51
|
+
/** How to launch pi in its out-of-process RPC mode, and how long to wait on it. */
|
|
52
|
+
interface PiSeam {
|
|
53
|
+
/** The pi executable (default `'pi'`). Anything on PATH or an absolute path. */
|
|
54
|
+
bin?: string;
|
|
55
|
+
/** Extra args appended after `--mode rpc`. `--provider` / `--model` are added from `model`. */
|
|
56
|
+
args?: ReadonlyArray<string>;
|
|
57
|
+
/** `provider/model` or just `model` — split on the first `/` into pi's two flags. */
|
|
58
|
+
model?: string;
|
|
59
|
+
cwd?: string;
|
|
60
|
+
env?: Record<string, string>;
|
|
61
|
+
/** Wall-clock ceiling for one `prompt` (the wait for `agent_end`). Omit = no timeout. */
|
|
62
|
+
turnTimeoutMs?: number;
|
|
63
|
+
/** Newest-last activity window `progress()` reports. Default 12. */
|
|
64
|
+
activityWindow?: number;
|
|
65
|
+
}
|
|
66
|
+
/** Build the `Executor` for one pi worker. Registered as runtime `'pi'`. */
|
|
67
|
+
declare const piExecutor: ExecutorFactory<unknown>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as
|
|
72
|
+
* `Executor.deliver`. The driver's `steer_agent` / `answer_question` land here,
|
|
73
|
+
* and the worker's agent loop drains them at two points (Drew's two delivery modes):
|
|
74
|
+
*
|
|
75
|
+
* - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded
|
|
76
|
+
* into the conversation before the next think. A worker is also forced to flush BEFORE it may
|
|
77
|
+
* settle, so it can never finish while a steer/answer it never read is still pending.
|
|
78
|
+
* - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its
|
|
79
|
+
* in-flight turn immediately, then re-plan with the message folded in — breaking the worker out
|
|
80
|
+
* of a wrong path mid-task instead of waiting for it to finish the step.
|
|
81
|
+
*
|
|
82
|
+
* `deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract.
|
|
83
|
+
*
|
|
84
|
+
* @experimental
|
|
85
|
+
*/
|
|
86
|
+
interface InboxMessage {
|
|
87
|
+
readonly kind: 'steer' | 'answer';
|
|
88
|
+
readonly text: string;
|
|
89
|
+
/** Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. */
|
|
90
|
+
readonly interrupt: boolean;
|
|
91
|
+
/** Present for an `answer` — the question id it resolves. */
|
|
92
|
+
readonly questionId?: string;
|
|
93
|
+
}
|
|
94
|
+
interface Inbox {
|
|
95
|
+
/** The `Executor.deliver` implementation — accept a raw down-message from `Scope.send`. */
|
|
96
|
+
deliver(msg: unknown): void;
|
|
97
|
+
/** Remove and return all pending messages (the flush). */
|
|
98
|
+
drain(): InboxMessage[];
|
|
99
|
+
pending(): number;
|
|
100
|
+
/** Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links
|
|
101
|
+
* this into the signal it passes to its inference call, then re-plans when it fires. */
|
|
102
|
+
freshInterrupt(): AbortSignal;
|
|
103
|
+
/** Render drained messages as ONE operator turn to fold into the worker's conversation. */
|
|
104
|
+
fold(messages: ReadonlyArray<InboxMessage>): string;
|
|
105
|
+
}
|
|
106
|
+
/** Create the worker-side inbox for the down-leg: the driver's `steer_agent` / `answer_question` messages queue here and the worker's loop drains them at step boundaries and before settle. */
|
|
107
|
+
declare function createInbox(): Inbox;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* The STEERABLE sandbox worker: one box, one server-side session, MANY turns — so a message
|
|
112
|
+
* from the driver has a boundary to be folded into.
|
|
113
|
+
*
|
|
114
|
+
* The default cloud worker was built on `singleShotDriver`: one `runLoop` shot, no turn
|
|
115
|
+
* boundary, and no `Executor.deliver`. `Scope.send` therefore returned `false` for it and
|
|
116
|
+
* `steer_agent` reported `delivered:false` on every call — steering the DEFAULT worker was
|
|
117
|
+
* mechanically impossible, not merely unused. This module is the missing continuation loop.
|
|
118
|
+
*
|
|
119
|
+
* Structure deliberately mirrors `streamBridgeSession` (the cli-bridge equivalent that already
|
|
120
|
+
* works) so both steerable runtimes have ONE shape:
|
|
121
|
+
*
|
|
122
|
+
* - turn 0 sends the task through `SandboxLineage.start` (fresh box, minted session id);
|
|
123
|
+
* - each later turn fires ONLY when the inbox has a steer/answer to fold, and goes through
|
|
124
|
+
* `SandboxLineage.continue` — the SAME box and the SAME server-side session, so the prompt
|
|
125
|
+
* carries only the new instruction and the worker keeps everything it had already learned;
|
|
126
|
+
* - a worker may not settle while a delivered steer is unread: the loop drains once more
|
|
127
|
+
* before breaking, which is what makes `steer_agent` a promise rather than a hint;
|
|
128
|
+
* - a forceful (`interrupt:true`) steer aborts the in-flight turn so the worker re-plans
|
|
129
|
+
* immediately instead of finishing a path the supervisor already rejected.
|
|
130
|
+
*
|
|
131
|
+
* It also produces the LIVE signal a supervisor steers FROM: every sandbox event stamps
|
|
132
|
+
* activity, tool parts are decoded into the shared `ToolSpan` currency for the online detector
|
|
133
|
+
* panel, and `progress()` answers turn / tool / idle / pending-steer questions synchronously.
|
|
134
|
+
*
|
|
135
|
+
* Reports REAL usage only — token and cost numbers come from the sandbox events themselves.
|
|
136
|
+
*
|
|
137
|
+
* @experimental
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
/** Ceiling on continuation turns. Turn 0 is the task; every later turn is a folded steer, so
|
|
141
|
+
* this bounds how many times a supervisor may redirect ONE worker before it must respawn. */
|
|
142
|
+
declare const DEFAULT_SANDBOX_STEERING_MAX_TURNS = 24;
|
|
143
|
+
/** Opt-in configuration for the steerable sandbox worker (`SandboxSeam.steering`). Absent, the
|
|
144
|
+
* sandbox executor keeps its historical single-shot `runLoop` composition verbatim. */
|
|
145
|
+
interface SandboxSteeringOptions {
|
|
146
|
+
/** Max turns for one worker (turn 0 + folded steers). Default {@link DEFAULT_SANDBOX_STEERING_MAX_TURNS}. */
|
|
147
|
+
readonly maxTurns?: number;
|
|
148
|
+
/** How many recent tool/turn notes `progress()` reports. Default 12. */
|
|
149
|
+
readonly activityWindow?: number;
|
|
150
|
+
/** Per-turn wall-clock ceiling; the turn's stream is aborted when it elapses. */
|
|
151
|
+
readonly turnTimeoutMs?: number;
|
|
152
|
+
}
|
|
153
|
+
/** What the steerable session exposes to its executor: the usage stream plus the live reads. */
|
|
154
|
+
interface SteerableSandboxSession {
|
|
155
|
+
/** Drive the worker to settlement. `signal` is the spawn-scoped abort handed to `execute`. */
|
|
156
|
+
stream(task: unknown, signal: AbortSignal): AsyncIterable<UsageEvent>;
|
|
157
|
+
progress(): ExecutorProgress;
|
|
158
|
+
traceSource(): TraceSource;
|
|
159
|
+
artifact(): {
|
|
160
|
+
outRef: string;
|
|
161
|
+
out: unknown;
|
|
162
|
+
spent: Spend;
|
|
163
|
+
} | undefined;
|
|
164
|
+
teardown(): Promise<void>;
|
|
165
|
+
}
|
|
166
|
+
interface SteerableSandboxArgs {
|
|
167
|
+
readonly controller: AbortController;
|
|
168
|
+
readonly profile: AgentProfile;
|
|
169
|
+
readonly harness: BackendType;
|
|
170
|
+
readonly sandboxClient: SandboxClient;
|
|
171
|
+
readonly inbox: Inbox;
|
|
172
|
+
readonly taskToPrompt: (task: unknown) => string;
|
|
173
|
+
readonly options?: SandboxSteeringOptions;
|
|
174
|
+
readonly loopCtx?: Partial<Omit<ExecCtx, 'sandboxClient' | 'signal'>>;
|
|
175
|
+
readonly contentRef: (prefix: string, value: unknown) => string;
|
|
176
|
+
readonly now?: () => number;
|
|
177
|
+
}
|
|
178
|
+
/** One steerable sandbox worker. The returned session is inert until `stream()` is drained. */
|
|
179
|
+
declare function createSteerableSandboxSession(args: SteerableSandboxArgs): SteerableSandboxSession;
|
|
180
|
+
|
|
14
181
|
/**
|
|
15
182
|
*
|
|
16
183
|
* The leaf runtime — the built-in `Executor` IMPLEMENTATIONS behind the ONE
|
|
@@ -63,6 +230,18 @@ interface SandboxSeam {
|
|
|
63
230
|
/** Hard cap on the composed loop's iterations. The budget pool reserves against
|
|
64
231
|
* the spawn `Budget.maxIterations`; this is the leaf's own ceiling. Default 1. */
|
|
65
232
|
maxIterations?: number;
|
|
233
|
+
/**
|
|
234
|
+
* OPT-IN: run this worker as a multi-turn, STEERABLE session instead of the historical
|
|
235
|
+
* single-shot `runLoop` composition. Setting it gives the sandbox worker an `Executor.deliver`
|
|
236
|
+
* inbox (so `Scope.send` / `steer_agent` actually reach it), a live tool-activity trace, and a
|
|
237
|
+
* `progress()` read — turning the default cloud worker from something a supervisor can only
|
|
238
|
+
* wait on into something it can watch and correct.
|
|
239
|
+
*
|
|
240
|
+
* Absent, nothing changes: the same `runLoop` leaf, no inbox, `steer_agent` still reports
|
|
241
|
+
* `delivered:false`. Opt-in because a steerable worker holds ONE box across several turns,
|
|
242
|
+
* which is a different resource profile from a fire-and-forget shot.
|
|
243
|
+
*/
|
|
244
|
+
steering?: SandboxSteeringOptions;
|
|
66
245
|
}
|
|
67
246
|
/** CLI subprocess seam. `bin` + `args` describe the Halo/RLM process to spawn. */
|
|
68
247
|
interface CliSeam {
|
|
@@ -209,6 +388,8 @@ type ExecutorConfig = ({
|
|
|
209
388
|
} & CliWorktreeSeam) | ({
|
|
210
389
|
backend: 'provider';
|
|
211
390
|
} & ProviderSeam) | ({
|
|
391
|
+
backend: 'pi';
|
|
392
|
+
} & PiSeam) | ({
|
|
212
393
|
backend: 'sandbox';
|
|
213
394
|
harness?: BackendType;
|
|
214
395
|
} & SandboxSeam);
|
|
@@ -234,6 +415,36 @@ declare function createExecutor(config: ExecutorConfig): ExecutorFactory<unknown
|
|
|
234
415
|
*/
|
|
235
416
|
declare function createExecutorRegistry(): ExecutorRegistry;
|
|
236
417
|
|
|
418
|
+
/**
|
|
419
|
+
*
|
|
420
|
+
* The ONLINE analyst: watch a `TraceSource` and fold each tool span through agent-eval's published
|
|
421
|
+
* streaming detector kernel (`repeatedActionDetector`/`errorStreakDetector` — the SAME kernel the
|
|
422
|
+
* control loop folds), firing `onSignal` the moment a worker loops or error-storms. Substrate-
|
|
423
|
+
* agnostic: it consumes spans from any source (owned router/bridge loop OR a sandbox box session),
|
|
424
|
+
* never the raw tool seam. Detection logic + the failure taxonomy live in agent-eval; not reimplemented.
|
|
425
|
+
*
|
|
426
|
+
* @experimental
|
|
427
|
+
*/
|
|
428
|
+
|
|
429
|
+
interface WatchTraceOptions {
|
|
430
|
+
/** The detectors to run online. Defaults to a stuck-loop + error-streak panel. */
|
|
431
|
+
readonly detectors?: ReadonlyArray<StreamingDetector>;
|
|
432
|
+
/** Fired for each signal a detector raises — the seam that raises a `finding` on the bus. */
|
|
433
|
+
readonly onSignal?: (signal: DetectorSignal, span: ToolSpan) => void | Promise<void>;
|
|
434
|
+
}
|
|
435
|
+
/** The default online panel for a tool-call pipe: a worker repeating the same call, or hammering
|
|
436
|
+
* consecutive errors. (No-progress needs a domain progress-probe, so it is opt-in, not default.)
|
|
437
|
+
*
|
|
438
|
+
* Coverage note: `repeated-action` works for EVERY harness (it needs only tool name + args, which
|
|
439
|
+
* every adapter provides). `error-streak` needs per-call status — opencode carries it inline
|
|
440
|
+
* (`state.status`, VALIDATED live), but claude-code/codex tool-call parts do NOT (their errors live
|
|
441
|
+
* in separate result blocks not yet decoded), so error-streak is silent for those until result-block
|
|
442
|
+
* decoding is added + live-validated. It is in the panel because it is correct where status exists. */
|
|
443
|
+
declare function defaultToolDetectors(): StreamingDetector[];
|
|
444
|
+
/** Subscribe to a `TraceSource` and run the streaming detectors over its live spans. Returns an
|
|
445
|
+
* unsubscribe. A defensive `argHash` failure (circular args) never throws out of the side-channel. */
|
|
446
|
+
declare function watchTrace(source: TraceSource, opts?: WatchTraceOptions): () => void;
|
|
447
|
+
|
|
237
448
|
/**
|
|
238
449
|
*
|
|
239
450
|
* The child→parent message bus: the ONE pipe carrying every message a worker, sub-driver, or
|
|
@@ -1806,7 +2017,7 @@ interface DetachedSessionDelegateOptions {
|
|
|
1806
2017
|
* `harness` / `model` / `systemPrompt` below are convenience overrides layered onto whichever
|
|
1807
2018
|
* profile is used.
|
|
1808
2019
|
*/
|
|
1809
|
-
workerProfile?: AgentProfile;
|
|
2020
|
+
workerProfile?: AgentProfile$1;
|
|
1810
2021
|
/** Backend harness for the single-coder path (sets `metadata.backendType`). Default `claude-code`. */
|
|
1811
2022
|
harness?: string;
|
|
1812
2023
|
/** Model override for the single-coder path. */
|
|
@@ -2183,6 +2394,10 @@ interface SettledWorker {
|
|
|
2183
2394
|
readonly valid?: boolean;
|
|
2184
2395
|
readonly outRef?: string;
|
|
2185
2396
|
readonly reason?: string;
|
|
2397
|
+
/** Epoch ms the ledger recorded this settlement — the resolution a progress-based stop rule
|
|
2398
|
+
* needs to answer "how long since anything landed?" without inventing a timestamp at read
|
|
2399
|
+
* time. Stamped when the cursor yields the settlement, not when a reader first looks. */
|
|
2400
|
+
readonly settledAt?: number;
|
|
2186
2401
|
}
|
|
2187
2402
|
type QuestionLevel = 'worker' | 'driver' | 'loop';
|
|
2188
2403
|
type QuestionUrgency = 'continue-without' | 'blocks-step' | 'blocks-run';
|
|
@@ -2288,6 +2503,33 @@ interface CoordinationToolsOptions {
|
|
|
2288
2503
|
* pulled by the next call — nothing is lost. Omit = {@link DEFAULT_AWAIT_EVENT_TIMEOUT_MS}; `<= 0`
|
|
2289
2504
|
* restores the prior UNBOUNDED block (only safe for in-process drivers with no transport timeout). */
|
|
2290
2505
|
readonly awaitTimeoutMs?: number;
|
|
2506
|
+
/**
|
|
2507
|
+
* OPT-IN: run the ONLINE detector panel over each spawned worker's live tool trace and raise a
|
|
2508
|
+
* `finding` on the bus the moment a detector fires — so the driver learns "this worker is
|
|
2509
|
+
* looping" mid-run, from `await_event`, instead of at settle.
|
|
2510
|
+
*
|
|
2511
|
+
* This closes the `watchTrace` → `raiseFinding` wire whose own docstring already described it
|
|
2512
|
+
* ("the seam an ONLINE detector uses to tell the driver 'this worker is looping/erroring' the
|
|
2513
|
+
* moment it happens") but which nothing connected. Workers whose executor exposes no
|
|
2514
|
+
* `traceSource` are simply not watched; nothing fails.
|
|
2515
|
+
*
|
|
2516
|
+
* Omit = no online watching (the settle-time analysts are unaffected).
|
|
2517
|
+
*/
|
|
2518
|
+
readonly watchWorkers?: WorkerWatchOptions;
|
|
2519
|
+
/**
|
|
2520
|
+
* How long a worker may go without metered activity before `observe_agent` reports it as
|
|
2521
|
+
* `stalled`. A derived read at observation time, never a background watchdog — nothing is
|
|
2522
|
+
* killed or retried. Omit = the runtime default.
|
|
2523
|
+
*/
|
|
2524
|
+
readonly stallAfterMs?: number;
|
|
2525
|
+
}
|
|
2526
|
+
/** Online-detector wiring for spawned workers (`CoordinationToolsOptions.watchWorkers`). */
|
|
2527
|
+
interface WorkerWatchOptions {
|
|
2528
|
+
/** Detector panel; omit for the default stuck-loop + error-streak pair. */
|
|
2529
|
+
readonly detectors?: WatchTraceOptions['detectors'];
|
|
2530
|
+
/** Raise at most this many findings per worker, so one pathological worker cannot flood the
|
|
2531
|
+
* driver's inbox with the same signal every span. Default 3; `<= 0` = unlimited. */
|
|
2532
|
+
readonly maxFindingsPerWorker?: number;
|
|
2291
2533
|
}
|
|
2292
2534
|
/**
|
|
2293
2535
|
* The supervisor-side toolbox returned by {@link createCoordinationTools}: the MCP tool
|
|
@@ -2325,4 +2567,4 @@ interface CoordinationTools {
|
|
|
2325
2567
|
/** Build the driver's MCP tools over a live scope. */
|
|
2326
2568
|
declare function createCoordinationTools(opts: CoordinationToolsOptions): CoordinationTools;
|
|
2327
2569
|
|
|
2328
|
-
export {
|
|
2570
|
+
export { DelegationStateCorruptError as $, type AnalystRegistry as A, type DelegateResearchArgs as B, type CappedDelegationTrace as C, type DelegationExecutor as D, type ExecutorConfig as E, type FleetHandle as F, type DelegateResearchConfig as G, type DelegateResearchResult as H, type DelegateResult as I, type DelegateRunCtx as J, type DelegateUiAuditConfig as K, type DelegateUiAuditRoute as L, type MakeWorkerAgent as M, type DelegationError as N, type DelegationFeedbackSnapshot as O, type DelegationHistoryEntry as P, DelegationPersistenceError as Q, type DelegationProfile as R, type DelegationProgress as S, type DelegationRecord as T, type UiAuditorDelegate as U, type DelegationResultPayload as V, type WorkerWatchOptions as W, type DelegationResumeContext as X, type DelegationResumeDriver as Y, type DelegationResumeTick as Z, type DelegationRunContext as _, DelegationTaskQueue as a, traceContextToEnv as a$, type DelegationStatus as a0, type DelegationStore as a1, type DelegationTaskQueueOptions as a2, type DelegationTraceCaps as a3, type DelegationTraceCollector as a4, type DelegationTraceSpan as a5, type DetachedSessionDelegateOptions as a6, type DetachedSessionRefParts as a7, type DetachedTurn as a8, type DetachedTurnResumeDriverOptions as a9, type SiblingSandboxExecutorOptions as aA, type SubmitInput as aB, type SubmitOutput as aC, type TraceContext as aD, type UiAuditorDelegationOutput as aE, buildDelegationTraceSpans as aF, capDelegationTrace as aG, coderTaskFromArgs as aH, composeLoopTraceEmitters as aI, createCoordinationTools as aJ, createDelegateHandler as aK, createDelegationTraceCollector as aL, createDetachedTurnResumeDriver as aM, createFleetWorkspaceExecutor as aN, createInProcessTransport as aO, createMcpServer as aP, createPropagatingTraceEmitter as aQ, createSiblingSandboxExecutor as aR, detachedSessionDelegate as aS, detachedTurnEvents as aT, eventToSnapshot as aU, formatDetachedSessionRef as aV, hashIdempotencyInput as aW, parseDetachedSessionRef as aX, readTraceContextFromEnv as aY, runDetachedTurn as aZ, settleDetachedCoderTurn as a_, type DetachedWinnerSelection as aa, type DriveTurnCapableBox as ab, type DriveTurnTick as ac, type FeedbackEvent as ad, type FeedbackRating as ae, type FeedbackRefersTo as af, FileDelegationStore as ag, type FileDelegationStoreOptions as ah, type FleetWorkspaceExecutorOptions as ai, InMemoryDelegationStore as aj, InMemoryFeedbackStore as ak, type JsonRpcMessage as al, type JsonRpcResponse as am, type McpServer as an, type McpServerOptions as ao, type McpToolDescriptor as ap, type McpTransport as aq, type Question as ar, type QuestionDecision as as, type QuestionPolicy as at, type QuestionRecord as au, type ResearchOutputShape as av, type ResearchSource as aw, type RunDetachedTurnOptions as ax, type SettleDetachedCoderTurnOptions as ay, type SettledWorker as az, type FeedbackStore as b, validateDelegateArgs as b0, type EvalRunEvent as b1, type EvalRunGeneration as b2, type EvalRunsExportConfig as b3, type EvalRunsExportResult as b4, INTELLIGENCE_WIRE_VERSION as b5, type LoopSpanNode as b6, type OtelAttribute as b7, type OtelExportConfig as b8, type OtelExporter as b9, createInbox as bA, createSteerableSandboxSession as bB, defaultToolDetectors as bC, piExecutor as bD, piSeamKey as bE, watchTrace as bF, type OtelSpan as ba, type RuntimeEventOtelOptions as bb, buildLoopOtelSpans as bc, buildLoopSpanNodes as bd, buildRuntimeEventOtelSpans as be, createOtelExporter as bf, exportEvalRuns as bg, loopEventToOtelSpan as bh, type BusEvent as bi, type BusRecord as bj, type BusStats as bk, DEFAULT_SANDBOX_STEERING_MAX_TURNS as bl, type EventBus as bm, type Inbox as bn, type InboxMessage as bo, PI_RUNTIME as bp, type PiSeam as bq, type ProviderSeam as br, type PublishOptions as bs, type SandboxSteeringOptions as bt, type SteerableSandboxSession as bu, type WatchTraceOptions as bv, cliWorktreeExecutor as bw, createEventBus as bx, createExecutor as by, createExecutorRegistry as bz, type DelegateFeedbackResult as c, type DelegateFeedbackArgs as d, type DelegateUiAuditArgs as e, type DelegateUiAuditResult as f, type DelegationHistoryResult as g, type DelegationHistoryArgs as h, type DelegationStatusResult as i, type DelegationStatusArgs as j, type CoderDelegate as k, type CoderReview as l, type CoderReviewer as m, type CoordinationEvent as n, type CoordinationTools as o, type CoordinationToolsOptions as p, DELEGATE_DESCRIPTION as q, DELEGATE_INPUT_SCHEMA as r, DELEGATE_TOOL_NAME as s, DELEGATION_TRACE_MAX_BYTES as t, DELEGATION_TRACE_MAX_SPANS as u, type DelegateArgs as v, type DelegateCodeArgs as w, type DelegateCodeConfig as x, type DelegateCodeResult as y, type DelegateHandlerOptions as z };
|
|
@@ -2,8 +2,8 @@ import { AgentProfile, AgentProfileValidationResult } from '@tangle-network/agen
|
|
|
2
2
|
import { CreateAgentEnvironmentInput, AgentTurnInput, AgentEnvironmentProvider, AgentEnvironmentCapabilities, AgentProfileRef } from '@tangle-network/agent-interface/environment-provider';
|
|
3
3
|
export { AgentEnvironment, AgentEnvironmentCapabilities, AgentEnvironmentEvent, AgentEnvironmentProvider, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentSession, AgentSessionRef, AgentSessionStatus, AgentTurnInput, AgentTurnResult, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from '@tangle-network/agent-interface/environment-provider';
|
|
4
4
|
import { CreateSandboxOptions, BackendType } from '@tangle-network/sandbox';
|
|
5
|
-
import { R as Runtime, E as ExecutorFactory } from './types-
|
|
6
|
-
import { S as SandboxClient } from './types-
|
|
5
|
+
import { R as Runtime, E as ExecutorFactory } from './types-lZTE_LBd.js';
|
|
6
|
+
import { S as SandboxClient } from './types-DK11_O4L.js';
|
|
7
7
|
import '@tangle-network/agent-eval';
|
|
8
8
|
import './types-BwoZWq-i.js';
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { AgentEvalError, AnalystFinding, KnowledgeReadinessReport, RunRecord, Co
|
|
|
2
2
|
export { AgentEvalError, AgentEvalErrorCode, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, RunRecord, ValidationError } from '@tangle-network/agent-eval';
|
|
3
3
|
import { c as createOpenAICompatibleBackend } from './backends-BO4Jqoe2.js';
|
|
4
4
|
export { a as createIterableBackend, b as createSandboxPromptBackend } from './backends-BO4Jqoe2.js';
|
|
5
|
-
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource,
|
|
6
|
-
export { a as AgentCandidateExecutionAttemptRecord, b as AgentCandidateExecutionAttemptRef, c as AgentCandidateExecutionClaim, d as AgentCandidateExecutionClaimResult, A as AgentCandidateExecutionClaimStore, e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, g as AgentCandidateExecutionFinishResult, h as AgentCandidateExecutionLease, i as AgentCandidateExecutionPhase, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionRecoveryEvidence, l as AgentCandidateExecutionStageResult, m as AgentCandidateExecutionTerminalRecord, n as AgentCandidateExecutionTerminalResult, o as
|
|
7
|
-
export {
|
|
5
|
+
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource, AgentCandidateProfileSource, AgentCandidateWorkspaceArchiveLimits, BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CaptureAgentCandidateWorkspaceOptions, CapturedAgentCandidateWorkspace, CreateAgentCandidateWorkspacePortOptions, DisposePreparedAgentCandidateOptions, ExactProcessCandidateExecutorOptions, FileAgentCandidateExecutionClaimStore, FileAgentCandidateExecutionClaimStoreOptions, RecoverExpiredAgentCandidateOptions, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle } from './candidate-execution/index.js';
|
|
6
|
+
export { a as AgentCandidateExecutionAttemptRecord, b as AgentCandidateExecutionAttemptRef, c as AgentCandidateExecutionClaim, d as AgentCandidateExecutionClaimResult, A as AgentCandidateExecutionClaimStore, e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, g as AgentCandidateExecutionFinishResult, h as AgentCandidateExecutionLease, i as AgentCandidateExecutionPhase, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionRecoveryEvidence, l as AgentCandidateExecutionStageResult, m as AgentCandidateExecutionTerminalRecord, n as AgentCandidateExecutionTerminalResult, o as AgentCandidateModelGrantActivateInput, q as AgentCandidateModelGrantClient, r as AgentCandidateModelGrantReservation, s as AgentCandidateModelGrantReserveInput, t as AgentCandidateModelGrantSettleInput, u as AgentCandidatePreparationEvidence, v as AgentCandidateRetryRejection, C as CreateProtectedAgentCandidateModelPortOptions, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, w as applyExactAgentProfileDiff, x as assertCandidateProfileBinding, y as createProtectedAgentCandidateModelPort, z as executePreparedAgentCandidate, B as parseExactAgentProfile, D as parseExactAgentProfileDiff, F as prepareAgentCandidateExecution } from './protected-model-port-DzkUY3HQ.js';
|
|
7
|
+
export { j as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, k as AgentCandidateContainerPort, e as AgentCandidateExecutionPorts, l as AgentCandidateExecutorFinalCapture, m as AgentCandidateExecutorMemoryCapture, A as AgentCandidateExecutorPort, n as AgentCandidateExecutorProfileFile, o as AgentCandidateExecutorRequest, p as AgentCandidateExecutorStopRequest, q as AgentCandidateExecutorTaskOutcomeCapture, r as AgentCandidateExecutorWorkspaceFile, s as AgentCandidateExecutorWorkspaceInput, t as AgentCandidateMemoryPort, u as AgentCandidateMemoryResetResult, v as AgentCandidateModelLimits, f as AgentCandidateModelPort, b as AgentCandidateOutputArtifactPort, w as AgentCandidateOutputPurpose, h as AgentCandidateProtectedModelActivation, g as AgentCandidateProtectedModelReservation, i as AgentCandidateProtectedModelSettlement, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, z as AgentCandidateVerificationPorts, B as AgentCandidateWorkspacePort, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, P as PreparedAgentCandidateExecution, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, V as VerifiedAgentCandidate, J as VerifiedAgentCandidateTaskOutcome } from './types-Cbp72qyu.js';
|
|
8
8
|
export { AuthSource, BackendCallPolicy, CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, Conversation, ConversationDriveState, ConversationJournal, ConversationJournalEntry, ConversationParticipant, ConversationPolicy, ConversationResult, ConversationStreamEvent, ConversationTurn, D1DatabaseLike, D1StmtLike, DEFAULT_MAX_DEPTH, DeadlineExceededError, FORWARD_HEADERS, FileConversationJournal, ForwardHeaderName, HaltContext, HaltPredicate, HaltReason, HaltSignal, InMemoryConversationJournal, PersonaConversationResult, PersonaDriver, PropagatedHeaders, RetryBackoff, RetryableErrorPredicate, RunConversationOptions, RunPersonaConfig, RunPersonaConversationOptions, SqlAdapter, SqlConversationJournal, TurnOrder, buildForwardHeaders, computeBackoff, createConversationBackend, d1ToSqlAdapter, defaultIsRetryable, defineConversation, isDepthExceeded, makePerAttemptSignal, readDepth, runConversation, runConversationStream, runPersonaConversation, runPersonaDispatch, sleep, slugifySpeaker, turnId } from './conversation.js';
|
|
9
9
|
import { V as Verifier, C as CandidateGenerator } from './improve-B40dRu0X.js';
|
|
10
10
|
export { A as AGENTIC_PROFILE_RESOURCE_ROOT, b as AgenticGeneratorOptions, c as AgenticGeneratorShotDisposition, d as AgenticGeneratorShotExecution, e as AgenticGeneratorShotReceipt, f as ImproveCodeOptions, I as ImproveOptions, a as ImproveResult, g as ImproveSkillsOptions, h as ImproveSurface, i as ImprovementCandidate, j as ImprovementDriverOptions, M as ManagedImprovementDriver, k as VerifyResult, l as agenticGenerator, m as commandVerifier, n as defaultBuildPrompt, o as improve, p as improvementDriver } from './improve-B40dRu0X.js';
|
|
@@ -17,25 +17,25 @@ export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-int
|
|
|
17
17
|
import { Scenario, SelfImproveOptions } from '@tangle-network/agent-eval/contract';
|
|
18
18
|
import { S as SurfaceImprovementEdit } from './improvement-adapter-HAZz-7vK.js';
|
|
19
19
|
import { I as ImprovementProposalSource } from './types-CmYCMbFT.js';
|
|
20
|
-
import { S as StructuralRolloutPolicy } from './structural-rollout-
|
|
20
|
+
import { S as StructuralRolloutPolicy } from './structural-rollout-BFPIy3iw.js';
|
|
21
21
|
export { AgentKnowledgeReadinessCheckOptions, CreateKnowledgeImprovementActivationExecutorOptions, KnowledgeImprovementActivationExecutor, KnowledgeImprovementCandidatePair, KnowledgeImprovementExperimentBundles, KnowledgeImprovementJobMeasurement, KnowledgeImprovementJobResult, KnowledgeReadinessCheck, KnowledgeReadinessCheckInput, KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, RunKnowledgeImprovementJobOptions, SupervisedKnowledgeUpdateInput, SupervisedKnowledgeUpdateOptions, SupervisedKnowledgeUpdateResult, SupervisedKnowledgeUpdater, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate } from './knowledge.js';
|
|
22
|
-
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-
|
|
22
|
+
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-DhIXsLAd.js';
|
|
23
23
|
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-fnj6SRVg.js';
|
|
24
|
-
export {
|
|
24
|
+
export { b1 as EvalRunEvent, b2 as EvalRunGeneration, b3 as EvalRunsExportConfig, b4 as EvalRunsExportResult, b5 as INTELLIGENCE_WIRE_VERSION, b6 as LoopSpanNode, b7 as OtelAttribute, b8 as OtelExportConfig, b9 as OtelExporter, ba as OtelSpan, bb as RuntimeEventOtelOptions, bc as buildLoopOtelSpans, bd as buildLoopSpanNodes, be as buildRuntimeEventOtelSpans, bf as createOtelExporter, bg as exportEvalRuns, bh as loopEventToOtelSpan } from './coordination-DTehA977.js';
|
|
25
25
|
import { K as KnowledgeReadinessDecision, A as AgentBackendInput, c as AgentExecutionBackend, h as RunAgentTaskOptions, i as AgentTaskRunResult, j as RunAgentTaskStreamOptions, R as RuntimeStreamEvent, k as RuntimeSessionStore, l as RuntimeSession } from './types-BwoZWq-i.js';
|
|
26
26
|
export { m as AgentAdapter, d as AgentBackendContext, n as AgentKnowledgeProvider, e as AgentRuntimeEvent, o as AgentRuntimeEventSink, p as AgentTaskContext, g as AgentTaskSpec, f as AgentTaskStatus, B as BackendErrorDetail, b as OpenAIChatResponseFormat, O as OpenAIChatTool, a as OpenAIChatToolChoice } from './types-BwoZWq-i.js';
|
|
27
|
-
import { R as RuntimeHooks } from './types-
|
|
28
|
-
export {
|
|
27
|
+
import { R as RuntimeHooks } from './types-DK11_O4L.js';
|
|
28
|
+
export { d as RuntimeDecisionEvidenceRef, e as RuntimeDecisionKind, f as RuntimeDecisionPoint, g as RuntimeHookContext, h as RuntimeHookErrorContext, i as RuntimeHookEvent, j as RuntimeHookPhase, k as RuntimeHookTarget, l as RuntimeRunHandle, m as RuntimeRunPersistenceAdapter, n as RuntimeRunRow, o as composeRuntimeHooks, p as defineRuntimeHooks, q as notifyRuntimeDecisionPoint, r as notifyRuntimeHookEvent, s as startRuntimeRun } from './types-DK11_O4L.js';
|
|
29
29
|
import '@tangle-network/agent-interface/environment-provider';
|
|
30
30
|
import 'node:child_process';
|
|
31
|
-
import './worktree-fanout-
|
|
32
|
-
import './types-
|
|
31
|
+
import './worktree-fanout-DiiJWjJO.js';
|
|
32
|
+
import './types-lZTE_LBd.js';
|
|
33
33
|
import '@tangle-network/sandbox';
|
|
34
|
-
import './completion-gate-
|
|
34
|
+
import './completion-gate-DLINnrkM.js';
|
|
35
35
|
import '@tangle-network/agent-profile-materialize';
|
|
36
36
|
import '@tangle-network/agent-knowledge';
|
|
37
37
|
import './activation-Cm-9MMX1.js';
|
|
38
|
-
import './supervise-
|
|
38
|
+
import './supervise-Cp8bNcJi.js';
|
|
39
39
|
import './kb-gate-CwHO0vz6.js';
|
|
40
40
|
import './substrate-Dyiqmd3o.js';
|
|
41
41
|
import './environment-provider.js';
|