@caupulican/pi-adaptative 0.93.3 → 0.93.4
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 +16 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +15 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/approval-gate.d.ts +1 -0
- package/dist/core/autonomy/approval-gate.d.ts.map +1 -1
- package/dist/core/autonomy/approval-gate.js +4 -1
- package/dist/core/autonomy/approval-gate.js.map +1 -1
- package/dist/core/autonomy/composite-tool-gate.d.ts +13 -0
- package/dist/core/autonomy/composite-tool-gate.d.ts.map +1 -0
- package/dist/core/autonomy/composite-tool-gate.js +44 -0
- package/dist/core/autonomy/composite-tool-gate.js.map +1 -0
- package/dist/core/autonomy/envelope-enforcement.d.ts +2 -0
- package/dist/core/autonomy/envelope-enforcement.d.ts.map +1 -1
- package/dist/core/autonomy/envelope-enforcement.js +48 -7
- package/dist/core/autonomy/envelope-enforcement.js.map +1 -1
- package/dist/core/autonomy/gates.d.ts.map +1 -1
- package/dist/core/autonomy/gates.js +48 -76
- package/dist/core/autonomy/gates.js.map +1 -1
- package/dist/core/autonomy/path-scope.d.ts.map +1 -1
- package/dist/core/autonomy/path-scope.js +7 -7
- package/dist/core/autonomy/path-scope.js.map +1 -1
- package/dist/core/background-tool-task-controller.d.ts +2 -0
- package/dist/core/background-tool-task-controller.d.ts.map +1 -1
- package/dist/core/background-tool-task-controller.js +13 -5
- package/dist/core/background-tool-task-controller.js.map +1 -1
- package/dist/core/compaction-controller.d.ts +3 -0
- package/dist/core/compaction-controller.d.ts.map +1 -1
- package/dist/core/compaction-controller.js +132 -97
- package/dist/core/compaction-controller.js.map +1 -1
- package/dist/core/delegation/session-root-mailbox.d.ts.map +1 -1
- package/dist/core/delegation/session-root-mailbox.js +14 -1
- package/dist/core/delegation/session-root-mailbox.js.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.js +6 -9
- package/dist/core/delegation/worker-agent-control-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.js +3 -2
- package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +10 -8
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/foreground-recovery-controller.d.ts +2 -0
- package/dist/core/foreground-recovery-controller.d.ts.map +1 -1
- package/dist/core/foreground-recovery-controller.js +18 -9
- package/dist/core/foreground-recovery-controller.js.map +1 -1
- package/dist/core/goal-loop-controller.d.ts.map +1 -1
- package/dist/core/goal-loop-controller.js +3 -5
- package/dist/core/goal-loop-controller.js.map +1 -1
- package/dist/core/goals/goal-auto-continue-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-auto-continue-controller.js +6 -0
- package/dist/core/goals/goal-auto-continue-controller.js.map +1 -1
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +1 -0
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +2 -0
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +1 -1
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/orchestration/capability-gateway.d.ts.map +1 -1
- package/dist/core/orchestration/capability-gateway.js +32 -9
- package/dist/core/orchestration/capability-gateway.js.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js +5 -5
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
- package/dist/core/orchestration/policy-compiler.d.ts.map +1 -1
- package/dist/core/orchestration/policy-compiler.js +7 -0
- package/dist/core/orchestration/policy-compiler.js.map +1 -1
- package/dist/core/orchestration/profile-registry.js +2 -2
- package/dist/core/orchestration/profile-registry.js.map +1 -1
- package/dist/core/pipelines/active-context.d.ts +16 -0
- package/dist/core/pipelines/active-context.d.ts.map +1 -0
- package/dist/core/pipelines/active-context.js +29 -0
- package/dist/core/pipelines/active-context.js.map +1 -0
- package/dist/core/pipelines/context.d.ts +1 -1
- package/dist/core/pipelines/context.d.ts.map +1 -1
- package/dist/core/pipelines/context.js +40 -31
- package/dist/core/pipelines/context.js.map +1 -1
- package/dist/core/pipelines/discover.d.ts +5 -1
- package/dist/core/pipelines/discover.d.ts.map +1 -1
- package/dist/core/pipelines/discover.js +91 -33
- package/dist/core/pipelines/discover.js.map +1 -1
- package/dist/core/pipelines/increment.d.ts +0 -2
- package/dist/core/pipelines/increment.d.ts.map +1 -1
- package/dist/core/pipelines/increment.js +35 -13
- package/dist/core/pipelines/increment.js.map +1 -1
- package/dist/core/pipelines/index.d.ts +4 -3
- package/dist/core/pipelines/index.d.ts.map +1 -1
- package/dist/core/pipelines/index.js +4 -3
- package/dist/core/pipelines/index.js.map +1 -1
- package/dist/core/pipelines/run-state.d.ts +8 -0
- package/dist/core/pipelines/run-state.d.ts.map +1 -1
- package/dist/core/pipelines/run-state.js +172 -38
- package/dist/core/pipelines/run-state.js.map +1 -1
- package/dist/core/pipelines/types.d.ts +2 -0
- package/dist/core/pipelines/types.d.ts.map +1 -1
- package/dist/core/pipelines/types.js +21 -4
- package/dist/core/pipelines/types.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +2 -1
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +46 -10
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +1 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +25 -1
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +6 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/task-projection.d.ts +2 -0
- package/dist/core/tasks/task-projection.d.ts.map +1 -1
- package/dist/core/tasks/task-projection.js +2 -0
- package/dist/core/tasks/task-projection.js.map +1 -1
- package/dist/core/tasks/task-state.d.ts +10 -0
- package/dist/core/tasks/task-state.d.ts.map +1 -1
- package/dist/core/tasks/task-state.js +43 -2
- package/dist/core/tasks/task-state.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts +13 -3
- package/dist/core/tool-capability-policy.d.ts.map +1 -1
- package/dist/core/tool-capability-policy.js +136 -28
- package/dist/core/tool-capability-policy.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +45 -7
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +17 -1
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/orchestration-panel.d.ts.map +1 -1
- package/dist/core/tools/orchestration-panel.js +1 -0
- package/dist/core/tools/orchestration-panel.js.map +1 -1
- package/dist/core/tools/persistent-process-coordinator.d.ts.map +1 -1
- package/dist/core/tools/persistent-process-coordinator.js +12 -7
- package/dist/core/tools/persistent-process-coordinator.js.map +1 -1
- package/dist/core/tools/pipeline.d.ts +1 -0
- package/dist/core/tools/pipeline.d.ts.map +1 -1
- package/dist/core/tools/pipeline.js +95 -44
- package/dist/core/tools/pipeline.js.map +1 -1
- package/dist/core/tools/secret-store.d.ts.map +1 -1
- package/dist/core/tools/secret-store.js +2 -1
- package/dist/core/tools/secret-store.js.map +1 -1
- package/dist/core/tools/shell-session.d.ts.map +1 -1
- package/dist/core/tools/shell-session.js +6 -1
- package/dist/core/tools/shell-session.js.map +1 -1
- package/dist/core/tools/task-steps.d.ts +10 -0
- package/dist/core/tools/task-steps.d.ts.map +1 -1
- package/dist/core/tools/task-steps.js +70 -29
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/windows-shell-engine.d.ts.map +1 -1
- package/dist/core/tools/windows-shell-engine.js +6 -1
- package/dist/core/tools/windows-shell-engine.js.map +1 -1
- package/dist/core/util/bounded-file.d.ts +8 -0
- package/dist/core/util/bounded-file.d.ts.map +1 -1
- package/dist/core/util/bounded-file.js +81 -16
- package/dist/core/util/bounded-file.js.map +1 -1
- 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
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** ICM pipeline form: numbered stages, factory vs product, status from files. */
|
|
2
|
+
import { assertPortablePathSegment } from "../../utils/work-directory.js";
|
|
2
3
|
export const PIPELINE_STAGE_FOLDER_RE = /^(\d{2})_([a-z0-9][a-z0-9-]{0,62})$/;
|
|
4
|
+
/** Two-digit ordinal, separator, and the longest stage slug accepted by PIPELINE_STAGE_FOLDER_RE. */
|
|
5
|
+
export const MAX_PIPELINE_STAGE_ID_LENGTH = 66;
|
|
3
6
|
export const MAX_PIPELINE_STAGES = 32;
|
|
4
7
|
export const MAX_PIPELINE_NAME_LENGTH = 64;
|
|
5
8
|
export const MAX_CONTRACT_PROCESS_CHARS = 4_000;
|
|
@@ -20,20 +23,34 @@ export function isPipelineRun(value) {
|
|
|
20
23
|
if (typeof value !== "object" || value === null)
|
|
21
24
|
return false;
|
|
22
25
|
const record = value;
|
|
26
|
+
if (typeof record.runId !== "string")
|
|
27
|
+
return false;
|
|
28
|
+
try {
|
|
29
|
+
assertPortablePathSegment("Pipeline run id", record.runId);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
23
34
|
return (record.version === 1 &&
|
|
24
35
|
typeof record.revision === "number" &&
|
|
25
|
-
Number.
|
|
36
|
+
Number.isSafeInteger(record.revision) &&
|
|
26
37
|
record.revision >= 0 &&
|
|
27
|
-
typeof record.runId === "string" &&
|
|
28
|
-
record.runId.length > 0 &&
|
|
29
38
|
typeof record.pipelineName === "string" &&
|
|
39
|
+
record.pipelineName.length > 0 &&
|
|
40
|
+
record.pipelineName.length <= MAX_PIPELINE_NAME_LENGTH &&
|
|
41
|
+
record.pipelineName.trim() === record.pipelineName &&
|
|
30
42
|
typeof record.definitionPath === "string" &&
|
|
43
|
+
record.definitionPath.length > 0 &&
|
|
31
44
|
typeof record.runRoot === "string" &&
|
|
45
|
+
record.runRoot.length > 0 &&
|
|
32
46
|
typeof record.currentStageId === "string" &&
|
|
47
|
+
PIPELINE_STAGE_FOLDER_RE.test(record.currentStageId) &&
|
|
33
48
|
(record.status === "active" || record.status === "completed" || record.status === "abandoned") &&
|
|
34
49
|
typeof record.createdAt === "string" &&
|
|
50
|
+
record.createdAt.length > 0 &&
|
|
35
51
|
typeof record.updatedAt === "string" &&
|
|
36
|
-
|
|
52
|
+
record.updatedAt.length > 0 &&
|
|
53
|
+
(record.goalId === undefined || (typeof record.goalId === "string" && record.goalId.trim().length > 0)));
|
|
37
54
|
}
|
|
38
55
|
export function clonePipelineRun(run) {
|
|
39
56
|
return { ...run };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/pipelines/types.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,MAAM,CAAC,MAAM,wBAAwB,GAAG,qCAAqC,CAAC;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM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;QACzC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAChC,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;QAClC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QACzB,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ;QACzC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QACpD,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;QAC9F,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ;QACpC,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;QAC3B,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ;QACpC,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;QAC3B,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CACvG,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAgB;IAChD,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAgC;IACnE,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC;AAChC,CAAC","sourcesContent":["/** ICM pipeline form: numbered stages, factory vs product, status from files. */\n\nimport { assertPortablePathSegment } from \"../../utils/work-directory.ts\";\n\nexport const PIPELINE_STAGE_FOLDER_RE = /^(\\d{2})_([a-z0-9][a-z0-9-]{0,62})$/;\n/** Two-digit ordinal, separator, and the longest stage slug accepted by PIPELINE_STAGE_FOLDER_RE. */\nexport const MAX_PIPELINE_STAGE_ID_LENGTH = 66;\nexport const MAX_PIPELINE_STAGES = 32;\nexport const MAX_PIPELINE_NAME_LENGTH = 64;\nexport const MAX_CONTRACT_PROCESS_CHARS = 4_000;\nexport const MAX_HUMAN_CHECK_CHARS = 1_000;\nexport const MAX_STAGE_CONTEXT_CHARS = 8_000;\nexport const MAX_LAYER_FILE_CHARS = 4_000;\n\nexport type PipelineForm =\n\t| \"pipeline\"\n\t| \"umbrella\"\n\t| \"record-library\"\n\t| \"knowledge-bundle\"\n\t| \"context-map\"\n\t| \"system-map\";\n\nexport type ContextLayer = 0 | 1 | 2 | 3 | 4;\n\nexport type InputKind = \"working\" | \"reference\";\n\nexport interface PipelineInputRef {\n\tkind: InputKind;\n\tpath: string;\n}\n\nexport interface StageContract {\n\ttitle: string;\n\toneJob: string;\n\tinputs: readonly PipelineInputRef[];\n\tdoNotLoad: readonly string[];\n\tprocess: readonly string[];\n\toutputs: readonly string[];\n\thumanCheck: string;\n}\n\nexport interface PipelineStage {\n\tid: string;\n\tordinal: number;\n\tslug: string;\n\tfolderName: string;\n\tcontractPath: string;\n\toutputDir: string;\n\tcontract: StageContract;\n}\n\nexport type StageDiskStatus = \"empty\" | \"complete\";\n\nexport interface PipelineDefinition {\n\tname: string;\n\tdescription: string;\n\tform: PipelineForm;\n\trootDir: string;\n\tentryFile: string;\n\troutingPath: string;\n\tfactoryDir: string;\n\tstagesDir: string;\n\tstages: readonly PipelineStage[];\n}\n\nexport type PipelineRunStatus = \"active\" | \"completed\" | \"abandoned\";\n\nexport interface PipelineRun {\n\tversion: 1;\n\trevision: number;\n\trunId: string;\n\tpipelineName: string;\n\tdefinitionPath: string;\n\trunRoot: string;\n\tcurrentStageId: string;\n\tstatus: PipelineRunStatus;\n\tgoalId?: string;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface StageScan {\n\tstageId: string;\n\tstatus: StageDiskStatus;\n\toutputFiles: readonly string[];\n}\n\nexport interface IncrementResult {\n\tsurface: \"pipeline\" | \"task_steps\" | \"goal\";\n\tfrom?: string;\n\tto?: string;\n\tcompleted: boolean;\n\tdetail: string;\n}\n\nexport interface AssembledLayer {\n\tlayer: ContextLayer;\n\tpath: string;\n\tlabel: string;\n\ttext: string;\n\ttruncated: boolean;\n}\n\nexport interface AssembledStageContext {\n\tstageId: string;\n\tlayers: readonly AssembledLayer[];\n\ttext: string;\n\ttokenEstimate: number;\n}\n\nexport const PIPELINE_RUN_CUSTOM_TYPE = \"pipeline_run\";\nexport const PIPELINE_CONTEXT_MARKER = \"<pipeline_context\";\n\nexport function isPipelineForm(value: unknown): value is PipelineForm {\n\treturn (\n\t\tvalue === \"pipeline\" ||\n\t\tvalue === \"umbrella\" ||\n\t\tvalue === \"record-library\" ||\n\t\tvalue === \"knowledge-bundle\" ||\n\t\tvalue === \"context-map\" ||\n\t\tvalue === \"system-map\"\n\t);\n}\n\nexport function isPipelineRun(value: unknown): value is PipelineRun {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst record = value as Record<string, unknown>;\n\tif (typeof record.runId !== \"string\") return false;\n\ttry {\n\t\tassertPortablePathSegment(\"Pipeline run id\", record.runId);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn (\n\t\trecord.version === 1 &&\n\t\ttypeof record.revision === \"number\" &&\n\t\tNumber.isSafeInteger(record.revision) &&\n\t\trecord.revision >= 0 &&\n\t\ttypeof record.pipelineName === \"string\" &&\n\t\trecord.pipelineName.length > 0 &&\n\t\trecord.pipelineName.length <= MAX_PIPELINE_NAME_LENGTH &&\n\t\trecord.pipelineName.trim() === record.pipelineName &&\n\t\ttypeof record.definitionPath === \"string\" &&\n\t\trecord.definitionPath.length > 0 &&\n\t\ttypeof record.runRoot === \"string\" &&\n\t\trecord.runRoot.length > 0 &&\n\t\ttypeof record.currentStageId === \"string\" &&\n\t\tPIPELINE_STAGE_FOLDER_RE.test(record.currentStageId) &&\n\t\t(record.status === \"active\" || record.status === \"completed\" || record.status === \"abandoned\") &&\n\t\ttypeof record.createdAt === \"string\" &&\n\t\trecord.createdAt.length > 0 &&\n\t\ttypeof record.updatedAt === \"string\" &&\n\t\trecord.updatedAt.length > 0 &&\n\t\t(record.goalId === undefined || (typeof record.goalId === \"string\" && record.goalId.trim().length > 0))\n\t);\n}\n\nexport function clonePipelineRun(run: PipelineRun): PipelineRun {\n\treturn { ...run };\n}\n\nexport function isPipelineRunActive(run: Pick<PipelineRun, \"status\">): boolean {\n\treturn run.status === \"active\";\n}\n"]}
|
|
@@ -36,7 +36,7 @@ import type { Agent, AgentContext, AgentMessage, AgentTool } from "@caupulican/p
|
|
|
36
36
|
import type { SessionManager } from "@caupulican/pi-agent-core/node";
|
|
37
37
|
import type { Api, Model, Usage } from "@caupulican/pi-ai";
|
|
38
38
|
import type { IsolatedCompletionOptions, IsolatedCompletionResult, WorkerDelegationRunOutcome } from "./agent-session-contracts.ts";
|
|
39
|
-
import type { WorkerClaim } from "./autonomy/contracts.ts";
|
|
39
|
+
import type { CapabilityEnvelope, WorkerClaim } from "./autonomy/contracts.ts";
|
|
40
40
|
import type { LaneRecord } from "./autonomy/lane-tracker.ts";
|
|
41
41
|
import type { ArtifactStore } from "./context/context-artifacts.ts";
|
|
42
42
|
import type { MemoryPromptInclusionReport, MemoryRetrievalDiagnostics } from "./context/memory-diagnostics.ts";
|
|
@@ -123,6 +123,7 @@ export interface RuntimeBuilderDeps {
|
|
|
123
123
|
getToolProfileFilter(): Required<ResourceProfileFilterSettings> | undefined;
|
|
124
124
|
setToolProfileFilter(filter: Required<ResourceProfileFilterSettings> | undefined): void;
|
|
125
125
|
getAllowedToolNames(): Set<string> | undefined;
|
|
126
|
+
getCapabilityEnvelope?(): CapabilityEnvelope | undefined;
|
|
126
127
|
/** Immutable active orchestration profile; absent sessions never construct run_process. */
|
|
127
128
|
getOrchestrationProfile?(): OrchestrationProfile | undefined;
|
|
128
129
|
getExcludedToolNames(): Set<string> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-builder.d.ts","sourceRoot":"","sources":["../../src/core/runtime-builder.ts"],"names":[],"mappings":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I,OAAO,CAAC,IAAI,CAAC,CA+C/C;CACD;AAED,wBAAsB,iBAAiB,CACtC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,GAAE,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAqB,EAC9D,oBAAoB,CAAC,EAAE,OAAO;;;;;;;;;;;;GAuD9B"}
|
|
@@ -32,10 +32,12 @@
|
|
|
32
32
|
* load / unload / reconcile API and for `getAllTools` / `getToolDefinition`, and a private
|
|
33
33
|
* `_refreshToolRegistry` delegation for its internal callers.
|
|
34
34
|
*/
|
|
35
|
-
import { existsSync
|
|
35
|
+
import { existsSync } from "node:fs";
|
|
36
36
|
import { isAbsolute, join } from "node:path";
|
|
37
37
|
import { getShellEnv } from "../utils/shell.js";
|
|
38
38
|
import { managedSecretEnvDir, resourceDir, secretVaultFile } from "./agent-paths.js";
|
|
39
|
+
import { deriveCompositeChildEnvelope, wrapToolWithCapabilityEnvelopeGate } from "./autonomy/composite-tool-gate.js";
|
|
40
|
+
import { isPathWithinEnvelope } from "./autonomy/envelope-enforcement.js";
|
|
39
41
|
import { isCompletedBackgroundToolEvidence } from "./background-tool-task-controller.js";
|
|
40
42
|
import { DEFAULT_ACTIVE_TOOL_NAMES, mapToolNamesForPlatform } from "./default-tool-surface.js";
|
|
41
43
|
import { acknowledgeWorkerClaimReview } from "./delegation/session-worker-claim.js";
|
|
@@ -51,6 +53,8 @@ import { evaluateSurfaceFitness } from "./model-router/fitness-gate.js";
|
|
|
51
53
|
import { resolveModelToolProtocol } from "./model-tool-protocol.js";
|
|
52
54
|
import { ModelAdaptationStore } from "./models/adaptation-store.js";
|
|
53
55
|
import { FitnessStore } from "./models/fitness-store.js";
|
|
56
|
+
import { resolvePipelineDefinitionForRun } from "./pipelines/discover.js";
|
|
57
|
+
import { resolveCurrentProjectPipelineRun } from "./pipelines/run-state.js";
|
|
54
58
|
import { isPipelineRunActive } from "./pipelines/types.js";
|
|
55
59
|
import { describeInFlightWorkUnit, getInFlightWorkUnits } from "./reload-blockers.js";
|
|
56
60
|
import { ScoutController } from "./scout-controller.js";
|
|
@@ -87,6 +91,7 @@ import { allToolNames, createToolDefinitionWithRuntime, } from "./tools/tool-def
|
|
|
87
91
|
import { createToolDefinitionFromAgentTool } from "./tools/tool-definition-wrapper.js";
|
|
88
92
|
import { createToolTaskToolDefinition } from "./tools/tool-task.js";
|
|
89
93
|
import { createWorktreeSyncToolDefinition } from "./tools/worktree-sync.js";
|
|
94
|
+
import { countFileLinesSync } from "./util/bounded-file.js";
|
|
90
95
|
import { createLane } from "./worktree-sync/git-engine.js";
|
|
91
96
|
import { WorktreeLaneGate } from "./worktree-sync/lane-gate.js";
|
|
92
97
|
import { buildWorktreeSyncEngineDeps, getBoundWorktreeLaneKey } from "./worktree-sync/runtime.js";
|
|
@@ -113,6 +118,8 @@ export function deriveOpenTaskStepRefs(taskStepsState) {
|
|
|
113
118
|
content: step.content,
|
|
114
119
|
...(step.requirementIds?.length ? { requirementIds: step.requirementIds } : {}),
|
|
115
120
|
...(step.evidence?.length ? { evidence: step.evidence } : {}),
|
|
121
|
+
...(step.pipelineRunId ? { pipelineRunId: step.pipelineRunId } : {}),
|
|
122
|
+
...(step.pipelineStageId ? { pipelineStageId: step.pipelineStageId } : {}),
|
|
116
123
|
}));
|
|
117
124
|
}
|
|
118
125
|
/** Bind goal-selected requirement identity as runtime metadata, outside the model-facing delegate schema. */
|
|
@@ -205,17 +212,36 @@ export class RuntimeBuilder {
|
|
|
205
212
|
}
|
|
206
213
|
async _runContextScout(query, maxTurns, artifactStore) {
|
|
207
214
|
const cwd = this.deps.getCwd();
|
|
215
|
+
const envelope = this.deps.getCapabilityEnvelope?.();
|
|
216
|
+
const childEnvelope = deriveCompositeChildEnvelope("context_scout", ["read", "grep", "find"], envelope);
|
|
208
217
|
const controller = new ScoutController({
|
|
209
218
|
resolveScoutModel: async () => resolveScoutModel(this.deps.getModelRegistry(), this.deps.getSettingsManager().getScoutSettings().model, this.deps.getAgentDir(), (model) => this.deps.isModelExhausted(model), resolveCurrentToolRepairSettings(this.deps.getSettingsManager().settings).textProtocol),
|
|
210
219
|
getCwd: () => cwd,
|
|
211
|
-
buildReadOnlyTools: (toolCwd) =>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
buildReadOnlyTools: (toolCwd) => {
|
|
221
|
+
const readTool = wrapToolWithCapabilityEnvelopeGate(createReadTool(toolCwd), toolCwd, childEnvelope);
|
|
222
|
+
const grepTool = wrapToolWithCapabilityEnvelopeGate(createGrepTool(toolCwd, { artifactStore }), toolCwd, childEnvelope);
|
|
223
|
+
const findTool = wrapToolWithCapabilityEnvelopeGate(createFindTool(toolCwd, { artifactStore }), toolCwd, childEnvelope);
|
|
224
|
+
return [
|
|
225
|
+
wrapToolWithCredentialExposureGuard(readTool, toolCwd, this._credentialExposureBoundary),
|
|
226
|
+
wrapToolWithCredentialExposureGuard(grepTool, toolCwd, this._credentialExposureBoundary),
|
|
227
|
+
wrapToolWithCredentialExposureGuard(findTool, toolCwd, this._credentialExposureBoundary),
|
|
228
|
+
];
|
|
229
|
+
},
|
|
216
230
|
streamFn: this.deps.getAgent().streamFn,
|
|
217
|
-
fileExists: (path) =>
|
|
218
|
-
|
|
231
|
+
fileExists: (path) => {
|
|
232
|
+
const target = resolveCwdPath(cwd, path);
|
|
233
|
+
if (childEnvelope && !isPathWithinEnvelope(childEnvelope, target, cwd)) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
return existsSync(target);
|
|
237
|
+
},
|
|
238
|
+
countLines: (path) => {
|
|
239
|
+
const target = resolveCwdPath(cwd, path);
|
|
240
|
+
if (childEnvelope && !isPathWithinEnvelope(childEnvelope, target, cwd)) {
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
return countFileLines(target);
|
|
244
|
+
},
|
|
219
245
|
// Lets the scout register itself in the reload-gate quiesce registry (see
|
|
220
246
|
// reload-blockers.ts) for its own agentDir — the same key `_assertReloadQuiescent` reads.
|
|
221
247
|
getAgentDir: () => this.deps.getAgentDir(),
|
|
@@ -634,7 +660,7 @@ export class RuntimeBuilder {
|
|
|
634
660
|
getOpenTaskSteps: () => deriveOpenTaskStepRefs(this.deps.getTaskStepsStateSnapshot()),
|
|
635
661
|
getBackgroundToolTasks: () => this.deps.getToolTaskDependencies?.().list() ?? [],
|
|
636
662
|
getActivePipeline: () => {
|
|
637
|
-
const run = this.deps.getPipelineRunSnapshot();
|
|
663
|
+
const run = resolveCurrentProjectPipelineRun(this.deps.getCwd(), this.deps.getPipelineRunSnapshot());
|
|
638
664
|
if (!run || !isPipelineRunActive(run))
|
|
639
665
|
return undefined;
|
|
640
666
|
return {
|
|
@@ -660,6 +686,16 @@ export class RuntimeBuilder {
|
|
|
660
686
|
saveTaskStepsState: (state) => {
|
|
661
687
|
this.deps.saveTaskStepsStateSnapshot(state);
|
|
662
688
|
},
|
|
689
|
+
getActivePipelineScope: () => {
|
|
690
|
+
const run = resolveCurrentProjectPipelineRun(this.deps.getCwd(), this.deps.getPipelineRunSnapshot());
|
|
691
|
+
if (!run || !isPipelineRunActive(run))
|
|
692
|
+
return undefined;
|
|
693
|
+
const definition = resolvePipelineDefinitionForRun({
|
|
694
|
+
agentPipelinesDir: resourceDir("pipelines", this.deps.getAgentDir()),
|
|
695
|
+
cwd: this.deps.getCwd(),
|
|
696
|
+
}, run);
|
|
697
|
+
return { runId: run.runId, stageIds: definition?.stages.map((stage) => stage.id) ?? [] };
|
|
698
|
+
},
|
|
663
699
|
});
|
|
664
700
|
this._baseToolDefinitions.set(taskStepsToolDefinition.name, taskStepsToolDefinition);
|
|
665
701
|
}
|
|
@@ -1271,7 +1307,7 @@ function resolveCwdPath(cwd, path) {
|
|
|
1271
1307
|
}
|
|
1272
1308
|
function countFileLines(path) {
|
|
1273
1309
|
try {
|
|
1274
|
-
return
|
|
1310
|
+
return countFileLinesSync(path, "Context scout citation file");
|
|
1275
1311
|
}
|
|
1276
1312
|
catch {
|
|
1277
1313
|
return undefined;
|