@sema-agent/core 7.6.3 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -10
- package/dist/agents/agent-transcript-tool.js +2 -2
- package/dist/agents/list-agents-tool.js +2 -3
- package/dist/agents/observer.js +2 -2
- package/dist/agents/peer-admission.d.ts +1 -1
- package/dist/agents/send-message-tool.js +2 -1
- package/dist/agents/subagent-steps.js +5 -4
- package/dist/agents/subagent.js +2 -3
- package/dist/brain/anthropic.js +8 -2
- package/dist/brain/open-responses.js +5 -3
- package/dist/brain/openai.js +31 -8
- package/dist/brain/reasoning.d.ts +32 -0
- package/dist/brain/reasoning.js +18 -0
- package/dist/core/ask-question.js +2 -2
- package/dist/core/auto-mode-defaults.d.ts +16 -0
- package/dist/core/auto-mode-defaults.js +1 -0
- package/dist/core/auto-mode.d.ts +19 -0
- package/dist/core/auto-mode.js +74 -56
- package/dist/core/checkpoint-execution-record.d.ts +110 -0
- package/dist/core/checkpoint-execution-record.js +49 -0
- package/dist/core/checkpoint-store.d.ts +114 -2
- package/dist/core/checkpoint-store.js +35 -2
- package/dist/core/context-edit.d.ts +0 -22
- package/dist/core/context-edit.js +2 -11
- package/dist/core/engine-notice.d.ts +17 -0
- package/dist/core/fs-write-gate-policy.d.ts +7 -1
- package/dist/core/fs-write-gate-policy.js +7 -7
- package/dist/core/gate-fold.js +2 -2
- package/dist/core/gate-lanes.js +4 -3
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +8 -0
- package/dist/core/hooks.d.ts +8 -2
- package/dist/core/hooks.js +1 -1
- package/dist/core/lsp.js +2 -2
- package/dist/core/mcp-server-spec.d.ts +17 -0
- package/dist/core/mcp.js +3 -1
- package/dist/core/memory-engine/tools.js +4 -12
- package/dist/core/permission-rules.d.ts +32 -2
- package/dist/core/permission-rules.js +43 -37
- package/dist/core/present-plan-tool.js +3 -4
- package/dist/core/runner/active-skill-scope.js +7 -4
- package/dist/core/runner/clock-and-limits.d.ts +117 -0
- package/dist/core/runner/clock-and-limits.js +118 -0
- package/dist/core/runner/compaction-call-options.d.ts +1 -1
- package/dist/core/runner/contracts.d.ts +37 -3
- package/dist/core/runner/decide-continuation.d.ts +98 -0
- package/dist/core/runner/decide-continuation.js +133 -0
- package/dist/core/runner/execution-record.d.ts +26 -0
- package/dist/core/runner/execution-record.js +19 -0
- package/dist/core/runner/git-leg-delivery.d.ts +28 -0
- package/dist/core/runner/git-leg-delivery.js +94 -0
- package/dist/core/runner/initial-run-state.d.ts +14 -0
- package/dist/core/runner/initial-run-state.js +11 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +1 -1
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -4
- package/dist/core/runner/prepare-caps-and-workflow.js +33 -11
- package/dist/core/runner/prepare-defer-classify.d.ts +5 -26
- package/dist/core/runner/prepare-defer-classify.js +10 -10
- package/dist/core/runner/prepare-delegation-surface.d.ts +5 -4
- package/dist/core/runner/prepare-delegation-surface.js +15 -17
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -1
- package/dist/core/runner/prepare-gate-stations.js +3 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +3 -2
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-inherited-gate.d.ts +1 -1
- package/dist/core/runner/prepare-inherited-gate.js +1 -0
- package/dist/core/runner/prepare-lsp.d.ts +4 -3
- package/dist/core/runner/prepare-lsp.js +3 -2
- package/dist/core/runner/prepare-memory-engine-session.d.ts +4 -4
- package/dist/core/runner/prepare-memory-engine-session.js +4 -2
- package/dist/core/runner/prepare-offload-wrappers.js +7 -5
- package/dist/core/runner/prepare-park-ask.d.ts +4 -0
- package/dist/core/runner/prepare-park-ask.js +4 -1
- package/dist/core/runner/prepare-project-context.d.ts +5 -23
- package/dist/core/runner/prepare-project-context.js +7 -5
- package/dist/core/runner/prepare-prompt-assembly.d.ts +1 -1
- package/dist/core/runner/prepare-protocol-tools.d.ts +5 -1
- package/dist/core/runner/prepare-protocol-tools.js +38 -21
- package/dist/core/runner/prepare-question-face.d.ts +4 -3
- package/dist/core/runner/prepare-question-face.js +5 -3
- package/dist/core/runner/prepare-safety-scan.js +42 -2
- package/dist/core/runner/prepare-task.js +37 -19
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +5 -2
- package/dist/core/runner/prepare-tool-disclosure-mount.js +3 -1
- package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -0
- package/dist/core/runner/prepare-wiring-manifest.js +3 -8
- package/dist/core/runner/run-harness-handlers.d.ts +46 -0
- package/dist/core/runner/run-harness-handlers.js +345 -0
- package/dist/core/runner/run-turn-boundary.d.ts +69 -0
- package/dist/core/runner/run-turn-boundary.js +694 -0
- package/dist/core/runner/runtask.d.ts +0 -68
- package/dist/core/runner/runtask.js +66 -1486
- package/dist/core/runner/session-rule-policy.js +9 -4
- package/dist/core/runner/steer-admission.d.ts +17 -0
- package/dist/core/runner/steer-admission.js +17 -0
- package/dist/core/runner/synthetic-tools.js +5 -8
- package/dist/core/runner/tool-disclosure.d.ts +4 -0
- package/dist/core/runner/tool-disclosure.js +9 -5
- package/dist/core/runner/tool-end-body.d.ts +71 -0
- package/dist/core/runner/tool-end-body.js +75 -0
- package/dist/core/runner/tool-face-overlay.d.ts +40 -0
- package/dist/core/runner/tool-face-overlay.js +125 -0
- package/dist/core/runner/tool-output-projection.d.ts +10 -0
- package/dist/core/runner/tool-output-projection.js +33 -10
- package/dist/core/sensitive-path-policy.d.ts +3 -0
- package/dist/core/sensitive-path-policy.js +6 -5
- package/dist/core/shared-memory/tools.js +3 -6
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +4 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +108 -0
- package/dist/core/task-event.d.ts +10 -0
- package/dist/core/task-registry.js +4 -5
- package/dist/core/task-spec.d.ts +8 -0
- package/dist/core/tool-catalog-entries.d.ts +48 -0
- package/dist/core/tool-catalog-entries.js +174 -0
- package/dist/core/tool-conformance.d.ts +22 -0
- package/dist/core/tool-conformance.js +37 -0
- package/dist/core/tool-face.d.ts +171 -0
- package/dist/core/tool-face.js +25 -0
- package/dist/core/tool-policy.d.ts +24 -0
- package/dist/core/tool-policy.js +4 -2
- package/dist/core/tool-registry.d.ts +114 -0
- package/dist/core/tool-registry.js +114 -0
- package/dist/core/tool-result-budget.d.ts +0 -3
- package/dist/core/tool-result-budget.js +4 -3
- package/dist/core/tool-result-store.d.ts +0 -18
- package/dist/core/tool-result-store.js +2 -18
- package/dist/core/tool-roster.d.ts +450 -0
- package/dist/core/tool-roster.js +497 -0
- package/dist/core/tool-spec.d.ts +54 -3
- package/dist/core/tools.js +7 -0
- package/dist/core/trace.d.ts +24 -0
- package/dist/core/wiring-manifest.d.ts +13 -0
- package/dist/core/wiring-manifest.js +2 -1
- package/dist/core/write-protect.d.ts +2 -1
- package/dist/core/write-protect.js +5 -4
- package/dist/engine/compaction/utils.d.ts +6 -0
- package/dist/engine/compaction/utils.js +19 -19
- package/dist/engine/loop/types.d.ts +6 -0
- package/dist/index.d.ts +20 -8
- package/dist/index.js +19 -7
- package/dist/orchestration/goal.js +2 -1
- package/dist/orchestration/run-spec.js +3 -5
- package/dist/orchestration/run-workflow-tool.js +2 -2
- package/dist/prompt-assembly/event-registry.js +3 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +2 -2
- package/dist/stores/file/checkpoint-store.d.ts +7 -0
- package/dist/stores/file/checkpoint-store.js +20 -1
- package/dist/tools/fs/fs-bash.d.ts +1 -1
- package/dist/tools/fs/fs-bash.js +7 -11
- package/dist/tools/fs/fs-read.js +2 -2
- package/dist/tools/fs/fs-search-tools.d.ts +0 -7
- package/dist/tools/fs/fs-search-tools.js +3 -16
- package/dist/tools/fs/fs-write.js +4 -6
- package/dist/tools/fs/repo-map.js +2 -2
- package/dist/tools/fs/safety.d.ts +2 -1
- package/dist/tools/fs/safety.js +6 -5
- package/dist/tools/monitor.js +2 -2
- package/dist/tools/scheduler-tools.js +5 -8
- package/dist/tools/task-list.js +5 -8
- package/dist/tools/todo.js +2 -2
- package/dist/tools/web.js +3 -6
- package/dist/tools/worktree.js +3 -4
- package/package.json +4 -1
- package/test/export-surface.snapshot.json +183 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ToolCallLike } from "./tool-registry.js";
|
|
1
2
|
/**
|
|
2
3
|
* How one table row matches the judged path:
|
|
3
4
|
* · `"basename"` — the target's last segment equals the row name (CC `DANGEROUS_FILES` form);
|
|
@@ -81,4 +82,4 @@ export declare function compileWriteProtection(entries?: readonly WriteProtected
|
|
|
81
82
|
*/
|
|
82
83
|
export declare function createWriteProtectionCheck(entries?: readonly WriteProtectedEntry[], opts?: {
|
|
83
84
|
dataRoot?: string;
|
|
84
|
-
}): ((toolName: string, args: unknown) => WriteProtectedHit | null) | undefined;
|
|
85
|
+
}): ((toolName: string, args: unknown, face?: ToolCallLike["face"]) => WriteProtectedHit | null) | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isWinFormPath, writeTargetPath, isUncPath } from "../tools/fs/safety.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isProtectedWrite } from "./tool-registry.js";
|
|
3
3
|
import { dataRootSpellings } from "./sensitive-path-policy.js";
|
|
4
4
|
const freezeTable = (rows) => Object.freeze(rows.map((r) => Object.freeze(r)));
|
|
5
5
|
export const WRITE_PROTECTED_DEFAULT_TABLE = freezeTable([
|
|
@@ -213,10 +213,11 @@ export function createWriteProtectionCheck(entries, opts) {
|
|
|
213
213
|
const matcher = compileWriteProtection(entries, opts);
|
|
214
214
|
if (matcher === undefined)
|
|
215
215
|
return undefined;
|
|
216
|
-
return (toolName, args) => {
|
|
217
|
-
|
|
216
|
+
return (toolName, args, face) => {
|
|
217
|
+
const call = { toolName, args, ...(face !== undefined ? { face } : {}) };
|
|
218
|
+
if (!isProtectedWrite(call))
|
|
218
219
|
return null;
|
|
219
|
-
const path = writeTargetPath(
|
|
220
|
+
const path = writeTargetPath(call);
|
|
220
221
|
if (typeof path !== "string" || path.length === 0)
|
|
221
222
|
return null;
|
|
222
223
|
return matcher.matchPath(path);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { Message } from "../llm/index.js";
|
|
2
2
|
import type { AgentMessage } from "../loop/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* design/388 A-18 — the FROZEN history table: tool names a persisted pre-rename transcript may still carry
|
|
5
|
+
* (the upstream trio and the pre-CC-name core trio), mapped to the path access the live definition declares.
|
|
6
|
+
* Never grows: a new name declares its access on the catalog instead. Registered with the name-table gate.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DURABLE_HISTORY_NAMES: ReadonlyMap<string, "read" | "create" | "edit">;
|
|
3
9
|
/** File paths touched by a session branch or compaction range. */
|
|
4
10
|
export interface FileOperations {
|
|
5
11
|
/** Files read but not necessarily modified. */
|
|
@@ -2,6 +2,15 @@ import { normalizeLlmMessageContent } from "../harness/messages.js";
|
|
|
2
2
|
import { sliceHeadSafe } from "../../core/surrogate-safe-slice.js";
|
|
3
3
|
import { cutEnginePrefix, cutEngineSegments, flattenableUserText } from "../../core/untrusted-text.js";
|
|
4
4
|
import { fileArgPath } from "../../tools/fs/safety.js";
|
|
5
|
+
import { fileOpAccessOf } from "../../core/tool-registry.js";
|
|
6
|
+
export const DURABLE_HISTORY_NAMES = new Map([
|
|
7
|
+
["read", "read"],
|
|
8
|
+
["write", "create"],
|
|
9
|
+
["edit", "edit"],
|
|
10
|
+
["read_file", "read"],
|
|
11
|
+
["write_file", "create"],
|
|
12
|
+
["edit_file", "edit"],
|
|
13
|
+
]);
|
|
5
14
|
export function createFileOps() {
|
|
6
15
|
return {
|
|
7
16
|
read: new Set(),
|
|
@@ -35,25 +44,16 @@ export function extractFileOpsFromMessage(message, fileOps) {
|
|
|
35
44
|
if (!path) {
|
|
36
45
|
continue;
|
|
37
46
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
touchModified(fileOps, path);
|
|
49
|
-
break;
|
|
50
|
-
case "edit":
|
|
51
|
-
case "Edit":
|
|
52
|
-
case "edit_file":
|
|
53
|
-
case "MultiEdit":
|
|
54
|
-
fileOps.edited.add(path);
|
|
55
|
-
touchModified(fileOps, path);
|
|
56
|
-
break;
|
|
47
|
+
const access = fileOpAccessOf(block.name) ?? DURABLE_HISTORY_NAMES.get(block.name);
|
|
48
|
+
if (access === "read")
|
|
49
|
+
fileOps.read.add(path);
|
|
50
|
+
else if (access === "create") {
|
|
51
|
+
fileOps.written.add(path);
|
|
52
|
+
touchModified(fileOps, path);
|
|
53
|
+
}
|
|
54
|
+
else if (access === "edit") {
|
|
55
|
+
fileOps.edited.add(path);
|
|
56
|
+
touchModified(fileOps, path);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -750,6 +750,12 @@ export interface AgentTool<TParameters extends TSchema = TSchema, TDetails = unk
|
|
|
750
750
|
* server's own channel for keeping one tool's full schema inlined. Absent on non-MCP tools.
|
|
751
751
|
*/
|
|
752
752
|
mcpAlwaysLoad?: boolean;
|
|
753
|
+
/**
|
|
754
|
+
* design/388 — the server's RAW tool name this mounted MCP tool was accepted under (byte-exact, the `tools/call`
|
|
755
|
+
* spelling). The `toolFaces` overlay binds to it: two raw names can fold onto one minted wire name, and an overlay
|
|
756
|
+
* keyed by the folded-away spelling must stay inert rather than land on the other tool. Absent on non-MCP tools.
|
|
757
|
+
*/
|
|
758
|
+
mcpRemoteName?: string;
|
|
753
759
|
/**
|
|
754
760
|
* design/120 P1.5 (CC `isConcurrencySafe(parsedInput)` parity): INPUT-level concurrency refinement
|
|
755
761
|
* for a tool whose safety depends on its arguments — CC's only real consumer is
|
package/dist/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { createTodoWriteTool } from "./tools/todo.js";
|
|
|
24
24
|
export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata, type TaskListItem, type TaskListStore } from "./tools/task-list.js";
|
|
25
25
|
export { assembleCodeTools, type CodeToolsConfig, CODE_ROLE } from "./scenarios/full-body.js";
|
|
26
26
|
export { TOOL_MODEL_GATE_CLASSES, isModelGatedForClass, type ToolModelGateRule } from "./core/tool-model-gate.js";
|
|
27
|
-
export { capAggregateToolResults, AGGREGATE_TOOL_RESULT_BUDGET_CHARS,
|
|
27
|
+
export { capAggregateToolResults, AGGREGATE_TOOL_RESULT_BUDGET_CHARS, type AggregateBudgetOptions, } from "./core/tool-result-budget.js";
|
|
28
28
|
export { capAggregateMediaBytes, AGGREGATE_MEDIA_BUDGET_BYTES, type MediaStripInfo } from "./core/media-byte-cap.js";
|
|
29
|
-
export { createAskUserQuestionTool, createDurableQuestionPolicy, QUESTION_AWAITS_RESUME, isQuestionUnavailable, type OnQuestionOutcome, type QuestionUnavailable, type OnQuestion, type AskQuestion, type AskQuestionOption, type AskQuestionRequest, type QuestionAnswer, type QuestionAnswerItem, type AskQuestionCardDetails, type AskUserQuestionToolOptions, type AskAnswerContinuationSource, type SyntheticContinuationReason, } from "./core/ask-question.js";
|
|
29
|
+
export { createAskUserQuestionTool, createDurableQuestionPolicy, QUESTION_AWAITS_RESUME, isQuestionUnavailable, type OnQuestionOutcome, type QuestionUnavailable, type OnQuestion, type AskQuestion, type AskQuestionOption, type AskQuestionRequest, type QuestionAnswer, type QuestionAnswerItem, type AskQuestionCardDetails, type AskUserQuestionToolOptions, type AskAnswerContinuationSource, type SyntheticContinuationReason, ASK_USER_QUESTION_TOOL_NAME, } from "./core/ask-question.js";
|
|
30
30
|
export { createLspTool, gitCheckIgnoreFilter, LSP_OPERATIONS, LSP_FAILURE_BRAND, brandLspFailure, lspFailureOf, SharedAbortScope, settleOnAbort, type LspNoneReason, type LspOperation, type LspServerManager, type LspSession, type LspResult, type LspLocation, type LspSymbolInfo, type LspRequestParams, type LspToolOptions, type LspTransport, type LspReadText, } from "./core/lsp.js";
|
|
31
31
|
export { buildRequest, parseResult, callHierarchyMethod, pathToUri } from "./core/lsp-protocol.js";
|
|
32
32
|
export { TransportLspSession, type SessionWarmup } from "./core/lsp-session.js";
|
|
@@ -91,14 +91,15 @@ export { sanitizeUntrustedText, delimitUntrusted, inlineUntrusted } from "./core
|
|
|
91
91
|
export { mintReminderMark, isValidReminderMark, openSystemReminder, mintSystemReminder, reminderMarkDeclaration } from "./core/reminder-mint.js";
|
|
92
92
|
export { deriveInvariants, checkInvariants } from "./core/property-harness.js";
|
|
93
93
|
export type { InvariantKind, FunctionContract, Invariant, InvariantViolation, CheckResult, } from "./core/property-harness.js";
|
|
94
|
-
export {
|
|
94
|
+
export { bashReversibilityProbe, BASH_READONLY_DEFAULT_ALLOW, parseLeadingCommandName, classifyCompoundReadonly, MAX_EDIT_BYTES } from "./tools/fs/index.js";
|
|
95
95
|
export { classifyCompoundReadonlyDetailed, formatOutOfRootReadApprovalOption, type BashReadonlyRootBoundary, type CompoundReadonlyVerdict, } from "./tools/fs/index.js";
|
|
96
96
|
export { resolveBashTimeoutCaps } from "./tools/fs/index.js";
|
|
97
97
|
export { READ_FACE_DEFAULT_DENY_ENTRIES, READ_FACE_BUILTIN_DENY_TABLE, READ_DENY_BUILTIN_TIERS, READ_DENY_DEFAULT_TIERS, resolveReadDenyBuiltins, compileReadDeny, type ReadDenyEntry, type ReadDenyMatcher, type NormalizedReadDenyEntry, type ReadDenyBuiltinTier, type ReadDenyBuiltinRow, type ReadDenyBuiltinConfig, } from "./tools/fs/index.js";
|
|
98
98
|
export { deploymentReadFaceClampNotice, resolveReadFace, type ReadFace, type ReadFaceInputs } from "./tools/fs/index.js";
|
|
99
99
|
export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, type WriteProtectedEntry, type WriteProtectedRow, type WriteProtectedKind, type WriteProtectedHit, type WriteProtectionMatcher, } from "./core/write-protect.js";
|
|
100
100
|
export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, type ToolResultProvenance, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, type ToolResultStore, type ToolResultSlice, type ToolResultDeletionReport, } from "./core/tool-result-store.js";
|
|
101
|
-
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, type CheckpointRow, realApprovalOrgFact, resolveCheckpointStore, } from "./core/checkpoint-store.js";
|
|
101
|
+
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, type ActorAssertion, type PendingSteerEntry, type PendingSteerInput, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, type RiskDescriptor, type ProbeCause, type ProbeCauseOperands, type CheckpointStore, type CheckpointSummary, type Checkpoint, type CheckpointToken, type CheckpointGate, type CheckpointState, type SerializedCheckpointState, type CheckpointFaultMode, type PendingAction, type ResumeOutcome, type ResolvedOutcome, type ReopenReason, type ResolveExpectation, type TerminalClaimIntent, type TerminalClaimOutcome, type SafetyAxis, type RealApprovalGateBit, type ResourceLedger, type ResourceLimitReason, type PlatformLimitReason, type CheckpointRow, realApprovalOrgFact, resolveCheckpointStore, checkpointStoreExecutionUndeclared, } from "./core/checkpoint-store.js";
|
|
102
|
+
export { EXECUTION_OUTCOME_RECORD_WORDS, EXECUTION_RECORD_LEAVES_ROW_UNRECORDED, isExecutionOutcomeRecordWord, type ExecutionOutcomeRecordWord, type ExecutionRecordTableCoversEveryWord, type ExecutionRecordRowFacts, type ExecutionVerdict, ExecutionOutcomeConflictError, checkpointExecutionRecorded, executionRecordDisposition, sameExecutionRecord, executionVerdict, } from "./core/checkpoint-execution-record.js";
|
|
102
103
|
export { PAUSE_REGISTRY, type GateKind, type PendingKind, type ResumeGate, isGateKind, resumeGateMatches, type CheckpointPause, type CheckpointFields, pauseOf, checkpointFrom } from "./core/pause-registry.js";
|
|
103
104
|
export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, type UsageWindow, type UsageWindowStore, type UsageWindowReading, type UsageWindowRecord, type UsageSlot, type UsageBucketRow, } from "./core/usage-window-store.js";
|
|
104
105
|
export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
|
|
@@ -123,6 +124,17 @@ export { createFsWriteGatePolicy, type FsWriteGatePolicyOptions } from "./core/f
|
|
|
123
124
|
export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
|
|
124
125
|
export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
|
|
125
126
|
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, type TaskNotificationPayload, type TaskNotificationStatus, type ExternalNotificationInput, type SystemInjection, type SystemInjectionPriority, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, type SemaProvenance, } from "./core/task-notification.js";
|
|
127
|
+
export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, type ToolFamily, type ToolMountTag, type ToolApprovalCard, type ToolPathAccess, type ToolPathTarget, type ToolRuleFace, type ToolRenderHints, type ToolFaceDeclaration, type ToolCatalogEntry, } from "./core/tool-face.js";
|
|
128
|
+
export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, type ToolCallLike, pathConfinableWriteToolNames, skillScopeWriteToolNames, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
|
|
129
|
+
export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, type RosterSource, type ToolIdentity, toolIdentityOf, mintCapabilityId, diffToolRoster, judgeParkedToolIdentity, ruleFacesFromRoster, toolCallFaceOf, inputKeysOf, ruleFaceOfInstance, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
|
|
130
|
+
export { type ToolCallFace } from "./core/tool-policy.js";
|
|
131
|
+
export { TOOL_CONFORMANCE_VECTORS, describeToolConformanceVectors, type ToolConformanceVector } from "./core/tool-conformance.js";
|
|
132
|
+
export { applyMcpToolFaces, toolFaceProblem, APPROVAL_CARD_REQUIRED_KEYS, type McpToolFace } from "./core/runner/tool-face-overlay.js";
|
|
133
|
+
export { createStructuredProjector } from "./core/runner/tool-output-projection.js";
|
|
134
|
+
export { parkedToolIdentity } from "./core/tool-roster.js";
|
|
135
|
+
export { type ToolCallIdentity } from "./core/fs-write-gate-policy.js";
|
|
136
|
+
export { type RuleFaceView, catalogRuleFaceView } from "./core/permission-rules.js";
|
|
137
|
+
export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
|
|
126
138
|
export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, type SubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, type AutoModeArmReason, type WiringManifest, type WiringManifestMcpEntry, type WiringFacts, type WiringLegKind, type AskSeamForm, type AskEffective, type QuestionChannelState, type SeamProvenance, type ParkLaneReason, type ManifestDurability, type StaticWiringDeps, type StaticWiringSpec, } from "./core/wiring-manifest.js";
|
|
127
139
|
export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, type ParkSelfCheckResult, type ParkProbeFinding, type ParkProbeFindingCode, } from "./core/park-selfcheck.js";
|
|
128
140
|
export { type StoreDurability } from "./core/checkpoint-store.js";
|
|
@@ -152,8 +164,8 @@ export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, create
|
|
|
152
164
|
export { type AskOrigin, ASK_ORIGINS, isAskOrigin, classifierMayAnswer, ORIGIN_IMPLIES_REAL_APPROVAL } from "./core/ask-origin.js";
|
|
153
165
|
export { SETTLEMENT_KINDS, type SettlementKind, isSettlementKind, type Settlement, SETTLEMENT_IS_REFUSAL, DENIED_BY_VALUES, type DeniedBy, isDeniedBy, DENIED_BY_MAY_VETO, type GateDisposition, type GateOutcome, screenGateOutcome } from "./core/gate-outcome.js";
|
|
154
166
|
export { type AskCarry } from "./core/hooks.js";
|
|
155
|
-
export { parseAutoModeResponse, createAutoModeDecider, type AutoModeVerdict, type AutoModeDecider, type AutoModeDeciderOptions, type AutoModeClassifyFn, type AutoModeClassifyInput, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, unarmedWindow, type AutoModeDenialTracker, type AutoModeDenialLimitOptions, type DenialLimitCounts, type DenialLimitFallbackFace, type UnarmedDenialLimitFallback, type DenialLimitFallback, type DenialLimitVerdict, } from "./core/auto-mode.js";
|
|
156
|
-
export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS } from "./core/auto-mode-defaults.js";
|
|
167
|
+
export { parseAutoModeResponse, createAutoModeDecider, type AutoModeVerdict, type AutoModeDecider, type AutoModeDeciderOptions, type AutoModeClassified, type AutoModeClassifyFn, type AutoModeClassifyInput, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, unarmedWindow, type AutoModeDenialTracker, type AutoModeDenialLimitOptions, type DenialLimitCounts, type DenialLimitFallbackFace, type UnarmedDenialLimitFallback, type DenialLimitFallback, type DenialLimitVerdict, } from "./core/auto-mode.js";
|
|
168
|
+
export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS, AUTO_MODE_CLASSIFIER_MAX_TOKENS } from "./core/auto-mode-defaults.js";
|
|
157
169
|
export { buildAutoModePrompt, renderAutoModeWindow, renderAutoModeAction, AUTO_MODE_DEFAULTS_SENTINEL, type AutoModeRules, type BuildAutoModePromptOptions, type AutoModeWindowOptions, } from "./core/auto-mode-prompt.js";
|
|
158
170
|
export { AUTO_MODE_BASE_PROMPT, AUTO_MODE_PERMISSIONS_EXTERNAL } from "./core/auto-mode-prompt-assets.js";
|
|
159
171
|
export { AUTO_MODE_ARMING_RECIPE_VERSION, autoModeArmingRecipeOf, sanitizeAutoModeArmingRecipe, foldAutoModeArming, type AutoModeArmingRecipe, type AutoModeArmingFace, type AutoModeArmingFold, type AutoModeRebuildRefusal, } from "./core/auto-mode-arming.js";
|
|
@@ -209,7 +221,7 @@ export { CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore
|
|
|
209
221
|
export { stripEngineMetadata } from "./internal/llm.js";
|
|
210
222
|
export { EVENT_PROMPT_REGISTRY, eventDefaultOn, type CompiledEventPrompt, type CompiledMessageInjection, type EventDedupe, type EventDefaultPolicy } from "./prompt-assembly/event-registry.js";
|
|
211
223
|
export type { CompiledSection, ComposedPrompt, PackSectionDeclaration, PromptCacheClass, PromptCarrier, PromptMutability, PromptOwner, PromptPack, PromptRenderCadence, PromptRuntimeFacts, PromptSlot, PromptTrust, SectionRenderInputs, } from "./prompt-assembly/types.js";
|
|
212
|
-
export { type ReasoningIntensity, type ReasoningResolution, type ResolvedReasoning, type ReasoningFormat, DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, resolveBinary, reasoningBudgetShare, resolveReasoning, resolveReasoningProfile, type ReasoningTier, type ReasoningProfileFlags, } from "./brain/reasoning.js";
|
|
224
|
+
export { type ReasoningIntensity, type ReasoningResolution, type ResolvedReasoning, type ReasoningFormat, DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, resolveBinary, reasoningBudgetShare, resolveReasoning, thinkingOffExpressible, declaredOffSpelling, type OffCapabilityModel, resolveReasoningProfile, type ReasoningTier, type ReasoningProfileFlags, } from "./brain/reasoning.js";
|
|
213
225
|
export { DESIGN_REVIEW_PROMPTS, CODE_REVIEW_PROMPT, SCENARIO_REGISTRY, runScenario, type ScenarioId, type CodeReviewMode, type ScenarioProfile, type RunScenarioOptions, type RunScenarioResult, } from "./scenarios/scenario-registry.js";
|
|
214
226
|
export { teacherMode, TEACHER_PROFILE, type TeacherModePair, type TeacherProfile, } from "./scenarios/teacher-quickstart.js";
|
|
215
227
|
export { loadOrchestrationEnv, DEFAULT_REASONING_INTENSITY, type OrchestrationMode, type OrchestrationEnv, } from "./scenarios/env.js";
|
|
@@ -279,7 +291,7 @@ export { defineAgent } from "./agents/agent-definition.js";
|
|
|
279
291
|
export { builtinAgentDefinitions, BUILTIN_READONLY_DENY_TOOLS, EXPLORE_WHEN_TO_USE, EXPLORE_WHEN_TO_USE_LEAN, PLAN_WHEN_TO_USE, EXPLORE_SYSTEM_PROMPT, PLAN_SYSTEM_PROMPT, } from "./agents/builtin-agents.js";
|
|
280
292
|
export { runTeamDiscussion, type TeamDiscussionOptions, type TeamMember, type TeamResult, type TeamTurn, type TeamEvent, } from "./agents/team.js";
|
|
281
293
|
export { createTaskServer, type TaskServerOptions, type TaskRequestBody, } from "./server/http.js";
|
|
282
|
-
export { clearStaleToolResults,
|
|
294
|
+
export { clearStaleToolResults, editBudget, type ContextEditOptions, } from "./core/context-edit.js";
|
|
283
295
|
export { createOpenAIBrain, type OpenAIBrainConfig } from "./brain/openai.js";
|
|
284
296
|
export { createAnthropicBrain, type AnthropicBrainConfig } from "./brain/anthropic.js";
|
|
285
297
|
export { createOpenResponsesBrain, type OpenResponsesBrainConfig } from "./brain/open-responses.js";
|
package/dist/index.js
CHANGED
|
@@ -12,9 +12,9 @@ export { createTodoWriteTool } from "./tools/todo.js";
|
|
|
12
12
|
export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata } from "./tools/task-list.js";
|
|
13
13
|
export { assembleCodeTools, CODE_ROLE } from "./scenarios/full-body.js";
|
|
14
14
|
export { TOOL_MODEL_GATE_CLASSES, isModelGatedForClass } from "./core/tool-model-gate.js";
|
|
15
|
-
export { capAggregateToolResults, AGGREGATE_TOOL_RESULT_BUDGET_CHARS,
|
|
15
|
+
export { capAggregateToolResults, AGGREGATE_TOOL_RESULT_BUDGET_CHARS, } from "./core/tool-result-budget.js";
|
|
16
16
|
export { capAggregateMediaBytes, AGGREGATE_MEDIA_BUDGET_BYTES } from "./core/media-byte-cap.js";
|
|
17
|
-
export { createAskUserQuestionTool, createDurableQuestionPolicy, QUESTION_AWAITS_RESUME, isQuestionUnavailable, } from "./core/ask-question.js";
|
|
17
|
+
export { createAskUserQuestionTool, createDurableQuestionPolicy, QUESTION_AWAITS_RESUME, isQuestionUnavailable, ASK_USER_QUESTION_TOOL_NAME, } from "./core/ask-question.js";
|
|
18
18
|
export { createLspTool, gitCheckIgnoreFilter, LSP_OPERATIONS, LSP_FAILURE_BRAND, brandLspFailure, lspFailureOf, SharedAbortScope, settleOnAbort, } from "./core/lsp.js";
|
|
19
19
|
export { buildRequest, parseResult, callHierarchyMethod, pathToUri } from "./core/lsp-protocol.js";
|
|
20
20
|
export { TransportLspSession } from "./core/lsp-session.js";
|
|
@@ -70,14 +70,15 @@ export { runExecGate } from "./core/exec-gate.js";
|
|
|
70
70
|
export { sanitizeUntrustedText, delimitUntrusted, inlineUntrusted } from "./core/untrusted-text.js";
|
|
71
71
|
export { mintReminderMark, isValidReminderMark, openSystemReminder, mintSystemReminder, reminderMarkDeclaration } from "./core/reminder-mint.js";
|
|
72
72
|
export { deriveInvariants, checkInvariants } from "./core/property-harness.js";
|
|
73
|
-
export {
|
|
73
|
+
export { bashReversibilityProbe, BASH_READONLY_DEFAULT_ALLOW, parseLeadingCommandName, classifyCompoundReadonly, MAX_EDIT_BYTES } from "./tools/fs/index.js";
|
|
74
74
|
export { classifyCompoundReadonlyDetailed, formatOutOfRootReadApprovalOption, } from "./tools/fs/index.js";
|
|
75
75
|
export { resolveBashTimeoutCaps } from "./tools/fs/index.js";
|
|
76
76
|
export { READ_FACE_DEFAULT_DENY_ENTRIES, READ_FACE_BUILTIN_DENY_TABLE, READ_DENY_BUILTIN_TIERS, READ_DENY_DEFAULT_TIERS, resolveReadDenyBuiltins, compileReadDeny, } from "./tools/fs/index.js";
|
|
77
77
|
export { deploymentReadFaceClampNotice, resolveReadFace } from "./tools/fs/index.js";
|
|
78
78
|
export { WRITE_PROTECTED_DEFAULT_TABLE, resolveWriteProtectedTable, compileWriteProtection, } from "./core/write-protect.js";
|
|
79
79
|
export { InMemoryToolResultStore, OFFLOAD_TOOL_NAME, DEFAULT_TOOL_RESULT_THRESHOLD_CHARS, assertSafeToolResultRef, buildToolResultRef, toolResultContentSegment, MAX_MINTED_TOOL_RESULT_REF_CHARS, assertToolResultProvenanceMatch, normalizeToolResultProvenance, toolResultProvenanceOf, ToolResultRefConflictError, TOOL_RESULT_REF_CONFLICT_CODE, } from "./core/tool-result-store.js";
|
|
80
|
-
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, realApprovalOrgFact, resolveCheckpointStore, } from "./core/checkpoint-store.js";
|
|
80
|
+
export { InMemoryCheckpointStore, CheckpointError, mintCheckpointId, mintCheckpointToken, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, MAX_SUPPORTED_CHECKPOINT_VERSION, ORG_ADMISSION_CHECKPOINT_VERSION, F012_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, TOKEN_CHECKPOINT_VERSION, debitLedger, remainingBudgetMicroUsd, remainingTokens, winnerFromOutcome, validatePendingSteer, readPendingSteerQueue, appendPendingSteer, MAX_PENDING_STEER_CHARS, MAX_PENDING_STEER_ENTRIES, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, PENDING_STEER_FROZEN_FIELDS, ACTOR_ASSERTION_FROZEN_FIELDS, MAX_ACTOR_FIELD_CHARS, MAX_STEER_INPUT_ID_CHARS, LEGACY_PENDING_STEER_INPUT_ID, riskSeverity, buildRiskDescriptor, summarizeCheckpoint, realApprovalOrgFact, resolveCheckpointStore, checkpointStoreExecutionUndeclared, } from "./core/checkpoint-store.js";
|
|
81
|
+
export { EXECUTION_OUTCOME_RECORD_WORDS, EXECUTION_RECORD_LEAVES_ROW_UNRECORDED, isExecutionOutcomeRecordWord, ExecutionOutcomeConflictError, checkpointExecutionRecorded, executionRecordDisposition, sameExecutionRecord, executionVerdict, } from "./core/checkpoint-execution-record.js";
|
|
81
82
|
export { PAUSE_REGISTRY, isGateKind, resumeGateMatches, pauseOf, checkpointFrom } from "./core/pause-registry.js";
|
|
82
83
|
export { InMemoryUsageWindowStore, GLOBAL_USAGE_KEY, EMPTY_USAGE_WINDOW_RECORD, chargeUsageRecord, readUsageRecord, usageRetryAfterMs, resolveUsageWindows, } from "./core/usage-window-store.js";
|
|
83
84
|
export { FileUsageWindowStore } from "./stores/file/usage-window-store.js";
|
|
@@ -99,6 +100,17 @@ export { createFsWriteGatePolicy } from "./core/fs-write-gate-policy.js";
|
|
|
99
100
|
export { RETIRED_TOOL_NAMES } from "./core/tool-name-aliases.js";
|
|
100
101
|
export { DEFAULT_SUBAGENT_TOOL_NAME } from "./agents/subagent.js";
|
|
101
102
|
export { renderTaskNotificationXml, taskNotificationDedupKey, isDelegatedAgentTerminal, isTerminalTaskNotification, SystemInjectionQueue, SYSTEM_INJECTION_PRIORITIES, isSystemInjectionPriority, AGENT_MESSAGE_TAG, renderAgentMessageFrame, } from "./core/task-notification.js";
|
|
103
|
+
export { TOOL_FAMILIES, TOOL_MOUNT_TAGS, TOOL_APPROVAL_CARDS, TOOL_PATH_ACCESSES, TOOL_WIRE_NAME_MAX_CHARS, TOOL_CONTRACT_MAX_CHARS, TOOL_KEY_MAX_CHARS, TOOL_KEYS_MAX, RENDER_HINT_MAX_CHARS, RENDER_HINT_ACTIVITY_MAX_CHARS, RENDER_HINT_MAX_LIST, } from "./core/tool-face.js";
|
|
104
|
+
export { describeToolCatalog, catalogEntriesNamed, catalogToolNames, catalogRuleFaceOf, pathTargetOf, pathTargetValue, protectivePathTargetOf, declaredPathTargetOf, isProtectedWrite, isDeclaredWrite, fileOpAccessOf, pathConfinableWriteToolNames, skillScopeWriteToolNames, pathTargetingToolNames, compactableToolNames, budgetExemptToolNames, handBandEffects, engineCardTypes, predictMountedToolNames, HANDS_BAND_TAGS, MOUNT_TAG_IN_HANDS_BAND, } from "./core/tool-registry.js";
|
|
105
|
+
export { ToolRosterEntry, ToolRoster, ToolRosterDelta, ToolRosterRenderHints, ROSTER_SOURCES, toolIdentityOf, mintCapabilityId, diffToolRoster, judgeParkedToolIdentity, ruleFacesFromRoster, toolCallFaceOf, inputKeysOf, ruleFaceOfInstance, ToolRosterDeltaSeat, } from "./core/tool-roster.js";
|
|
106
|
+
export {} from "./core/tool-policy.js";
|
|
107
|
+
export { TOOL_CONFORMANCE_VECTORS, describeToolConformanceVectors } from "./core/tool-conformance.js";
|
|
108
|
+
export { applyMcpToolFaces, toolFaceProblem, APPROVAL_CARD_REQUIRED_KEYS } from "./core/runner/tool-face-overlay.js";
|
|
109
|
+
export { createStructuredProjector } from "./core/runner/tool-output-projection.js";
|
|
110
|
+
export { parkedToolIdentity } from "./core/tool-roster.js";
|
|
111
|
+
export {} from "./core/fs-write-gate-policy.js";
|
|
112
|
+
export { catalogRuleFaceView } from "./core/permission-rules.js";
|
|
113
|
+
export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
|
|
102
114
|
export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, } from "./core/wiring-manifest.js";
|
|
103
115
|
export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, } from "./core/park-selfcheck.js";
|
|
104
116
|
export {} from "./core/checkpoint-store.js";
|
|
@@ -127,7 +139,7 @@ export { ASK_ORIGINS, isAskOrigin, classifierMayAnswer, ORIGIN_IMPLIES_REAL_APPR
|
|
|
127
139
|
export { SETTLEMENT_KINDS, isSettlementKind, SETTLEMENT_IS_REFUSAL, DENIED_BY_VALUES, isDeniedBy, DENIED_BY_MAY_VETO, screenGateOutcome } from "./core/gate-outcome.js";
|
|
128
140
|
export {} from "./core/hooks.js";
|
|
129
141
|
export { parseAutoModeResponse, createAutoModeDecider, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, unarmedWindow, } from "./core/auto-mode.js";
|
|
130
|
-
export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS } from "./core/auto-mode-defaults.js";
|
|
142
|
+
export { AUTO_MODE_DENIAL_LIMIT_DEFAULTS, AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS, AUTO_MODE_CLASSIFIER_MAX_TOKENS } from "./core/auto-mode-defaults.js";
|
|
131
143
|
export { buildAutoModePrompt, renderAutoModeWindow, renderAutoModeAction, AUTO_MODE_DEFAULTS_SENTINEL, } from "./core/auto-mode-prompt.js";
|
|
132
144
|
export { AUTO_MODE_BASE_PROMPT, AUTO_MODE_PERMISSIONS_EXTERNAL } from "./core/auto-mode-prompt-assets.js";
|
|
133
145
|
export { AUTO_MODE_ARMING_RECIPE_VERSION, autoModeArmingRecipeOf, sanitizeAutoModeArmingRecipe, foldAutoModeArming, } from "./core/auto-mode-arming.js";
|
|
@@ -167,7 +179,7 @@ export { buildTurnPromptSnapshot, loweringRecordFor, LOWERING_VERSION, PREFIX_IN
|
|
|
167
179
|
export { CenterPromptSource, FilePromptArtifactStore, FilePromptSourceStateStore, MemoryPromptArtifactStore, MemoryPromptSourceStateStore, } from "./prompt-assembly/artifact-store.js";
|
|
168
180
|
export { stripEngineMetadata } from "./internal/llm.js";
|
|
169
181
|
export { EVENT_PROMPT_REGISTRY, eventDefaultOn } from "./prompt-assembly/event-registry.js";
|
|
170
|
-
export { DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, resolveBinary, reasoningBudgetShare, resolveReasoning, resolveReasoningProfile, } from "./brain/reasoning.js";
|
|
182
|
+
export { DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, resolveBinary, reasoningBudgetShare, resolveReasoning, thinkingOffExpressible, declaredOffSpelling, resolveReasoningProfile, } from "./brain/reasoning.js";
|
|
171
183
|
export { DESIGN_REVIEW_PROMPTS, CODE_REVIEW_PROMPT, SCENARIO_REGISTRY, runScenario, } from "./scenarios/scenario-registry.js";
|
|
172
184
|
export { teacherMode, TEACHER_PROFILE, } from "./scenarios/teacher-quickstart.js";
|
|
173
185
|
export { loadOrchestrationEnv, DEFAULT_REASONING_INTENSITY, } from "./scenarios/env.js";
|
|
@@ -235,7 +247,7 @@ export { defineAgent } from "./agents/agent-definition.js";
|
|
|
235
247
|
export { builtinAgentDefinitions, BUILTIN_READONLY_DENY_TOOLS, EXPLORE_WHEN_TO_USE, EXPLORE_WHEN_TO_USE_LEAN, PLAN_WHEN_TO_USE, EXPLORE_SYSTEM_PROMPT, PLAN_SYSTEM_PROMPT, } from "./agents/builtin-agents.js";
|
|
236
248
|
export { runTeamDiscussion, } from "./agents/team.js";
|
|
237
249
|
export { createTaskServer, } from "./server/http.js";
|
|
238
|
-
export { clearStaleToolResults,
|
|
250
|
+
export { clearStaleToolResults, editBudget, } from "./core/context-edit.js";
|
|
239
251
|
export { createOpenAIBrain } from "./brain/openai.js";
|
|
240
252
|
export { createAnthropicBrain } from "./brain/anthropic.js";
|
|
241
253
|
export { createOpenResponsesBrain } from "./brain/open-responses.js";
|
|
@@ -3,16 +3,17 @@ import { Type } from "typebox";
|
|
|
3
3
|
import { delimitUntrusted } from "../core/untrusted-text.js";
|
|
4
4
|
import { OUTPUT_TOOL_NAME } from "../core/runner/synthetic-tools.js";
|
|
5
5
|
import { isDurablePause, pauseFamily } from "../agents/suspend-guard.js";
|
|
6
|
+
import { toolFace } from "../core/tool-catalog-entries.js";
|
|
6
7
|
export const DECLARE_DONE_TOOL_NAME = "DeclareDone";
|
|
7
8
|
function createDeclareDoneTool(ref) {
|
|
8
9
|
return {
|
|
9
10
|
name: DECLARE_DONE_TOOL_NAME,
|
|
11
|
+
...toolFace("declare-done"),
|
|
10
12
|
description: "Call this ONLY when you believe the goal is FULLY achieved — verified against evidence, not just " +
|
|
11
13
|
"attempted. Provide a concise summary of what was achieved and how you verified it. Calling this " +
|
|
12
14
|
"declares completion; a verification check then runs. If it passes, the goal stops and surfaces for " +
|
|
13
15
|
"human review. If it does NOT pass, you will be asked to keep working with the verification feedback.",
|
|
14
16
|
parameters: Type.Object({ summary: Type.String() }),
|
|
15
|
-
effect: "read",
|
|
16
17
|
execute: (args) => {
|
|
17
18
|
ref.declared = true;
|
|
18
19
|
ref.summary = String(args.summary ?? "").trim();
|
|
@@ -7,7 +7,7 @@ import { isDurablePause } from "../agents/suspend-guard.js";
|
|
|
7
7
|
import { terminalProjection } from "../core/runner/terminal-projection.js";
|
|
8
8
|
import { isAbsolutePathForm, writeTargetPath } from "../tools/fs/safety.js";
|
|
9
9
|
import { captureBaseline, resolveFrozenPaths, restoreFrozenPaths, runOracle, snapshotFrozenPaths, specError, } from "../core/spec-contract.js";
|
|
10
|
-
|
|
10
|
+
import { isProtectedWrite } from "../core/tool-registry.js";
|
|
11
11
|
const CASE_INSENSITIVE_FS = process.platform === "darwin" || process.platform === "win32";
|
|
12
12
|
const pathKey = (p) => {
|
|
13
13
|
let n = p.replace(/\\/g, "/");
|
|
@@ -19,11 +19,9 @@ function frozenDenyPolicy(rootDir, frozenResolved) {
|
|
|
19
19
|
const frozen = new Set(frozenResolved.map(pathKey));
|
|
20
20
|
return {
|
|
21
21
|
check(req) {
|
|
22
|
-
|
|
23
|
-
if (!WRITE_TOOLS.has(toolName))
|
|
22
|
+
if (!isProtectedWrite(req))
|
|
24
23
|
return { action: "allow" };
|
|
25
|
-
const
|
|
26
|
-
const raw = writeTargetPath(toolName, args);
|
|
24
|
+
const raw = writeTargetPath(req);
|
|
27
25
|
if (typeof raw !== "string" || raw.length === 0)
|
|
28
26
|
return { action: "allow" };
|
|
29
27
|
const absForm = isAbsolutePathForm(raw);
|
|
@@ -10,6 +10,7 @@ import { parseWorkflowMeta, splitWorkflowMeta, workflowScriptReadsClockOrRandom
|
|
|
10
10
|
import { mergeWorkflowArgs, normalizeStringArg } from "./workflow-script-store.js";
|
|
11
11
|
import { builtinWorkflowListings, canonicalWorkflowName, resolveBuiltinWorkflow, workflowNameProbeOrder } from "./builtin-workflows.js";
|
|
12
12
|
import { workflowSizeGuidelineSection } from "./workflow-size-guideline.js";
|
|
13
|
+
import { toolFace } from "../core/tool-catalog-entries.js";
|
|
13
14
|
export const RUN_WORKFLOW_TOOL_NAME = "Workflow";
|
|
14
15
|
function stripCodeFences(s) {
|
|
15
16
|
const t = s.trim();
|
|
@@ -244,7 +245,7 @@ export async function createRunWorkflowTool(d) {
|
|
|
244
245
|
const structuredError = (message) => errorResult(JSON.stringify({ error: message }));
|
|
245
246
|
return defineTool({
|
|
246
247
|
name: RUN_WORKFLOW_TOOL_NAME,
|
|
247
|
-
|
|
248
|
+
...toolFace("workflow"),
|
|
248
249
|
approvalPreview: (raw) => {
|
|
249
250
|
const a = (raw ?? {});
|
|
250
251
|
if (typeof a.name === "string" && a.name)
|
|
@@ -374,7 +375,6 @@ export async function createRunWorkflowTool(d) {
|
|
|
374
375
|
"Requires a journal-backed deployment; omit for a fresh run.",
|
|
375
376
|
})),
|
|
376
377
|
}),
|
|
377
|
-
effect: "write",
|
|
378
378
|
execute: async (rawArgs, ctx) => {
|
|
379
379
|
const rawScript = rawArgs.script;
|
|
380
380
|
const rawName = rawArgs.name;
|
|
@@ -6,7 +6,7 @@ export const EVENT_PROMPT_REGISTRY = new Map([
|
|
|
6
6
|
{ kind: "plan_mode", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "off", rendererRef: "turn-attachments.ts#PLAN_MODE_FULL_BODY" },
|
|
7
7
|
{ kind: "date_change", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "always", rendererRef: "turn-attachments.ts#renderDateChange" },
|
|
8
8
|
{ kind: "instructions_change", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", maxBytes: 512, defaultPolicy: "always", rendererRef: "turn-attachments.ts#collectInstructionsChange" },
|
|
9
|
-
{ kind: "workflow_size_guideline_change", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "always", rendererRef: "
|
|
9
|
+
{ kind: "workflow_size_guideline_change", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "always", rendererRef: "run-turn-boundary.ts#workflowSizeGuidelineChangeNotice" },
|
|
10
10
|
{ kind: "budget_usd", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "off", rendererRef: "turn-attachments.ts#renderBudgetUsd" },
|
|
11
11
|
{ kind: "total_tokens_reminder", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "on", rendererRef: "turn-attachments.ts#renderTotalTokensReminder" },
|
|
12
12
|
{ kind: "background_tasks", carrier: "message.user-prefix", trust: "operator", dedupe: "replace-by-key", defaultPolicy: "on", rendererRef: "turn-attachments.ts#renderBackgroundTasks" },
|
|
@@ -16,8 +16,8 @@ export const EVENT_PROMPT_REGISTRY = new Map([
|
|
|
16
16
|
{ kind: "mcp_instructions", carrier: "message.user-prefix", trust: "external", dedupe: "replace-by-key", defaultPolicy: "off", rendererRef: "turn-attachments.ts#renderMcpInstructionsDelta" },
|
|
17
17
|
{ kind: "mcp_dropped_tools", carrier: "message.user-prefix", trust: "external", dedupe: "replace-by-key", defaultPolicy: "off", rendererRef: "turn-attachments.ts#renderMcpDroppedTools" },
|
|
18
18
|
{ kind: "git_status", carrier: "message.user-prefix", trust: "external", dedupe: "replace-by-key", defaultPolicy: "always", rendererRef: "git-status-frame.ts#renderGitStatusFrameBody" },
|
|
19
|
-
{ kind: "limit_approach_converge", carrier: "message.user-prefix", trust: "operator", dedupe: "once-per-run", defaultPolicy: "always", rendererRef: "
|
|
20
|
-
{ kind: "limit_approach_deliver", carrier: "message.user-prefix", trust: "operator", dedupe: "once-per-run", defaultPolicy: "always", rendererRef: "
|
|
19
|
+
{ kind: "limit_approach_converge", carrier: "message.user-prefix", trust: "operator", dedupe: "once-per-run", defaultPolicy: "always", rendererRef: "run-turn-boundary.ts#limitApproachFrames" },
|
|
20
|
+
{ kind: "limit_approach_deliver", carrier: "message.user-prefix", trust: "operator", dedupe: "once-per-run", defaultPolicy: "always", rendererRef: "run-turn-boundary.ts#limitApproachFrames" },
|
|
21
21
|
{ kind: "final_verification", carrier: "message.user-prefix", trust: "operator", dedupe: "once-per-run", defaultPolicy: "always", rendererRef: "runtask.ts#final-verification" },
|
|
22
22
|
].map((e) => [e.kind, e]));
|
|
23
23
|
export function eventDefaultOn(kind) {
|
|
@@ -61,7 +61,7 @@ export declare function attachToolContract(tool: AgentTool, input: AttachContrac
|
|
|
61
61
|
export declare function getToolContract(tool: AgentTool, fallbackOrigin?: ToolOrigin): ToolContractDescriptor;
|
|
62
62
|
export declare function hasToolContract(tool: AgentTool): boolean;
|
|
63
63
|
/** Manifest projection for the final mounted tool set (manifest v2 `tools`, protocol §5.4). */
|
|
64
|
-
export declare function projectToolManifest(tools: AgentTool[], originOf?: (tool: AgentTool) => ToolOrigin): ToolManifestRow[];
|
|
64
|
+
export declare function projectToolManifest(tools: readonly AgentTool[], originOf?: (tool: AgentTool) => ToolOrigin): ToolManifestRow[];
|
|
65
65
|
/**
|
|
66
66
|
* RB-15: wire-identity collision audit over the FINAL mounted tool set.
|
|
67
67
|
* Rules (plan §6.2 tool row):
|
|
@@ -71,7 +71,7 @@ export declare function projectToolManifest(tools: AgentTool[], originOf?: (tool
|
|
|
71
71
|
* a built-in; the harness Map keeps the later mount) — NOT fatal, but returned as an explicit
|
|
72
72
|
* exemption record so the mount site can surface it (observable, never silent).
|
|
73
73
|
*/
|
|
74
|
-
export declare function auditToolCollisions(tools: AgentTool[]): {
|
|
74
|
+
export declare function auditToolCollisions(tools: readonly AgentTool[]): {
|
|
75
75
|
yields: Array<{
|
|
76
76
|
name: string;
|
|
77
77
|
}>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type ExecutionOutcomeRecordWord } from "../../core/checkpoint-execution-record.js";
|
|
1
2
|
import { type Checkpoint, type PendingSteerInput, type CheckpointFaultMode, type CheckpointStore, type CheckpointSummary, type CheckpointToken, type ReopenReason, type ResolveExpectation, type ResumeOutcome } from "../../core/checkpoint-store.js";
|
|
3
|
+
import type { GateOutcome } from "../../core/gate-outcome.js";
|
|
2
4
|
export interface FileCheckpointStoreOptions {
|
|
3
5
|
/** When false, an `appendLine` for a state transition is NOT fsync'd. The checkpoint COMMIT POINT always
|
|
4
6
|
* fsyncs regardless (its crash-safety depends on it); this governs the `put` and `setPendingSteer`
|
|
@@ -25,6 +27,10 @@ export declare class FileCheckpointStore implements CheckpointStore {
|
|
|
25
27
|
readonly redecision: {
|
|
26
28
|
readonly reopen: true;
|
|
27
29
|
};
|
|
30
|
+
/** The execution-outcome record verb below is the contract's CAS (journaled), and `reopen` honours the record. */
|
|
31
|
+
readonly execution: {
|
|
32
|
+
readonly outcome: true;
|
|
33
|
+
};
|
|
28
34
|
private readonly fsyncEnabled;
|
|
29
35
|
private readonly compactEvery;
|
|
30
36
|
/** RB-134: the directory's ONE authority (map + token mutex + append log), joined not rebuilt. */
|
|
@@ -50,6 +56,7 @@ export declare class FileCheckpointStore implements CheckpointStore {
|
|
|
50
56
|
put(token: CheckpointToken, cp: Checkpoint): Promise<void>;
|
|
51
57
|
get(token: CheckpointToken): Promise<Checkpoint | null>;
|
|
52
58
|
resolve(token: CheckpointToken, scope: string, outcome: ResumeOutcome, expect?: ResolveExpectation): Promise<boolean>;
|
|
59
|
+
recordExecutionOutcome(token: CheckpointToken, scope: string, gate: GateOutcome): Promise<ExecutionOutcomeRecordWord>;
|
|
53
60
|
reopen(token: CheckpointToken, scope: string, reason: ReopenReason): Promise<boolean>;
|
|
54
61
|
setPendingSteer(token: CheckpointToken, scope: string, steer: PendingSteerInput): Promise<boolean>;
|
|
55
62
|
expire(token: CheckpointToken, scope: string): Promise<boolean>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { assertAdoptionBootGate } from "./adoption/marker.js";
|
|
3
|
+
import { checkpointExecutionRecorded, executionRecordDisposition, ExecutionOutcomeConflictError, } from "../../core/checkpoint-execution-record.js";
|
|
3
4
|
import { appendPendingSteer, CheckpointError, checkpointOccMatches, checkpointRowMatches, summarizeCheckpoint, validatePendingSteer, winnerFromOutcome, } from "../../core/checkpoint-store.js";
|
|
4
5
|
import { SharedLedgerTable } from "./shared-ledger.js";
|
|
5
6
|
const CHECKPOINT_LEDGER_EVENT_REGISTRY = {
|
|
6
7
|
put: true,
|
|
7
8
|
resolve: true,
|
|
8
9
|
reopen: true,
|
|
10
|
+
execution: true,
|
|
9
11
|
expire: true,
|
|
10
12
|
steer: true,
|
|
11
13
|
steer_append: true,
|
|
@@ -36,6 +38,10 @@ function applyCheckpointEvent(cps, ev) {
|
|
|
36
38
|
cp.rev = ev.rev;
|
|
37
39
|
cp.reopenReason = ev.reason;
|
|
38
40
|
break;
|
|
41
|
+
case "execution":
|
|
42
|
+
cp.executionOutcome = ev.gate;
|
|
43
|
+
cp.executionAtMs = ev.atMs;
|
|
44
|
+
break;
|
|
39
45
|
case "expire":
|
|
40
46
|
cp.status = "expired";
|
|
41
47
|
break;
|
|
@@ -64,6 +70,7 @@ export class FileCheckpointStore {
|
|
|
64
70
|
durability = "durable";
|
|
65
71
|
fidelity = "json";
|
|
66
72
|
redecision = { reopen: true };
|
|
73
|
+
execution = { outcome: true };
|
|
67
74
|
fsyncEnabled;
|
|
68
75
|
compactEvery;
|
|
69
76
|
ledger;
|
|
@@ -126,10 +133,22 @@ export class FileCheckpointStore {
|
|
|
126
133
|
return true;
|
|
127
134
|
});
|
|
128
135
|
}
|
|
136
|
+
async recordExecutionOutcome(token, scope, gate) {
|
|
137
|
+
return this.withLock(token, () => {
|
|
138
|
+
const cp = this.cps.get(token);
|
|
139
|
+
const disposition = executionRecordDisposition(cp, scope, gate);
|
|
140
|
+
if (disposition === "conflict")
|
|
141
|
+
throw new ExecutionOutcomeConflictError(cp.executionOutcome, gate);
|
|
142
|
+
if (disposition !== "commit")
|
|
143
|
+
return disposition;
|
|
144
|
+
this.commit({ t: "execution", token, gate: structuredClone(gate), atMs: Date.now() }, true);
|
|
145
|
+
return "recorded";
|
|
146
|
+
});
|
|
147
|
+
}
|
|
129
148
|
async reopen(token, scope, reason) {
|
|
130
149
|
return this.withLock(token, () => {
|
|
131
150
|
const cp = this.cps.get(token);
|
|
132
|
-
if (!checkpointRowMatches(cp, scope, "resolved")) {
|
|
151
|
+
if (!checkpointRowMatches(cp, scope, "resolved") || checkpointExecutionRecorded(cp)) {
|
|
133
152
|
return false;
|
|
134
153
|
}
|
|
135
154
|
const rev = (cp.rev ?? 0) + 1;
|
|
@@ -62,7 +62,7 @@ export declare function bashReversibilityProbe(allow?: readonly string[], bounda
|
|
|
62
62
|
* the read-only allowlist face (`core.bash_readonly@1`). Consumed by prepare-task's
|
|
63
63
|
* fullShellReachable roster assertion (its first load-bearing consumer).
|
|
64
64
|
*/
|
|
65
|
-
export
|
|
65
|
+
export { FULL_SHELL_CONTRACT_ID } from "../../core/tool-catalog-entries.js";
|
|
66
66
|
/** The CC-verbatim exit-1 interpretation for `command`, or undefined when exit 1 means a real error.
|
|
67
67
|
* Conservative parse: last `;`/`&&`/`||`/newline statement → last `|` pipeline segment → leading
|
|
68
68
|
* command name (env-assignments skipped, path prefix stripped); `git grep`/`git diff` special-cased
|
package/dist/tools/fs/fs-bash.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Type } from "typebox";
|
|
|
2
2
|
import { defineTool, errorResult } from "../../core/tools.js";
|
|
3
3
|
import { defaultTaskRegistry } from "../../core/task-registry.js";
|
|
4
4
|
import { accountDroppedBytes, spoolDropNote } from "../../core/task-registry-shared.js";
|
|
5
|
-
import { TASK_OUTPUT_TOOL_NAME, TASK_STOP_TOOL_NAME,
|
|
5
|
+
import { TASK_OUTPUT_TOOL_NAME, TASK_STOP_TOOL_NAME, TASK_OUTPUT_MISSING_ID_MESSAGE, TASK_STOP_MISSING_ID_MESSAGE, TASK_STOP_PARAMS, resolveTaskIdArg, ENV_DIRECT_TASK_TOOL_CAPS, composeTaskOutputDescription, composeTaskOutputParams, composeTaskStopDescription, } from "../../core/task-tool-shape.js";
|
|
6
6
|
import { hasBackgroundShell } from "../../core/background-shell.js";
|
|
7
7
|
import { delimitUntrusted } from "../../core/untrusted-text.js";
|
|
8
8
|
import { MCP_IMAGE_MAX_BASE64 } from "../../core/mcp.js";
|
|
@@ -12,6 +12,7 @@ import { ghRateLimitHint } from "./gh-rate-limit.js";
|
|
|
12
12
|
import { resolveBashTimeoutCaps, bashTimeoutCapsSec, bashTimeoutArgRefusal, bashTimeoutParamDescription, envErrorDetail, bashMaxOutputChars, clipShellOutput, writeShellOverflowFile, createShellOverflowSpoolFence, shellRecoveryHint, CWD_SENTINEL, BASH_READONLY_CONFINEMENT_NOTE, } from "./fs-shared.js";
|
|
13
13
|
import { PROBE_CAUSE_PATH_MAX, inlineUntrusted } from "../../core/untrusted-text.js";
|
|
14
14
|
import { BASH_CLASSIFY_DEFAULT_ALLOW, BASH_READONLY_DEFAULT_ALLOW, coarseReadonlyCheck, classifyBoundedReadonlyPollLoop, classifyCompoundReadonlyDetailed, classifyOutOfRootReadGate, classifySimpleCommandReadBoundary, NOT_AUTO_ALLOWED, } from "./bash-readonly-classifier.js";
|
|
15
|
+
import { toolFace } from "../../core/tool-catalog-entries.js";
|
|
15
16
|
const RECURSIVE_CAUSE_MAX_PATHS = 3;
|
|
16
17
|
const RECURSIVE_READ_CAUSE_CODE = "shell.recursive_read_unbounded";
|
|
17
18
|
function operandFamily(paths) {
|
|
@@ -58,7 +59,7 @@ export function bashReversibilityProbe(allow, boundary) {
|
|
|
58
59
|
: { reversible: false, ...outOfRootGate() };
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
|
-
export
|
|
62
|
+
export { FULL_SHELL_CONTRACT_ID } from "../../core/tool-catalog-entries.js";
|
|
62
63
|
const EXIT1_INTERPRETATION = {
|
|
63
64
|
grep: "No matches found",
|
|
64
65
|
rg: "No matches found",
|
|
@@ -537,7 +538,7 @@ export function createBashTool(env, rootCanonical, coAuthor = false, cwdRef = {
|
|
|
537
538
|
const bgEnvIsolatedOwned = hasDestroy(env) && isIsolated(env);
|
|
538
539
|
return defineTool({
|
|
539
540
|
name: "Bash",
|
|
540
|
-
|
|
541
|
+
...toolFace("bash"),
|
|
541
542
|
description: bashDescription(coAuthor, timeoutCaps, bgNotifies, bgRetained, bgSessionScoped, bgEnvIsolatedOwned),
|
|
542
543
|
parameters: Type.Object({
|
|
543
544
|
command: Type.String({ description: "The command to execute" }),
|
|
@@ -559,8 +560,6 @@ export function createBashTool(env, rootCanonical, coAuthor = false, cwdRef = {
|
|
|
559
560
|
description: "Set to true to run this command in the background.",
|
|
560
561
|
})),
|
|
561
562
|
}),
|
|
562
|
-
effect: "write",
|
|
563
|
-
contentOrigin: "execution",
|
|
564
563
|
isConcurrencySafe: (args) => {
|
|
565
564
|
const cmd = args?.command;
|
|
566
565
|
if (typeof cmd !== "string")
|
|
@@ -991,7 +990,7 @@ export function createBashReadonlyTool(env, rootCanonical, allow, opts) {
|
|
|
991
990
|
const canonicalBoundary = createCanonicalReadBoundary(env, readRoots);
|
|
992
991
|
return defineTool({
|
|
993
992
|
name: "Bash",
|
|
994
|
-
|
|
993
|
+
...toolFace("bash-readonly"),
|
|
995
994
|
description: `Run a SINGLE read-only inspection command (e.g. ${sample}, …) and return its output. Shell ` +
|
|
996
995
|
"operators (pipes, redirects, ;, &&, command substitution, subshells) are rejected and only " +
|
|
997
996
|
"allowlisted commands run. Reads are confined to the workspace root(s): a path outside them is " +
|
|
@@ -1002,7 +1001,6 @@ export function createBashReadonlyTool(env, rootCanonical, allow, opts) {
|
|
|
1002
1001
|
command: Type.String({ description: "A single allowlisted read-only command (no shell operators)." }),
|
|
1003
1002
|
timeout: Type.Optional(Type.Number({ description: bashTimeoutParamDescription(timeoutCaps, true) })),
|
|
1004
1003
|
}),
|
|
1005
|
-
effect: "read",
|
|
1006
1004
|
execute: async (args, ctx) => {
|
|
1007
1005
|
const { command, timeout } = args;
|
|
1008
1006
|
const timeoutRefusal = bashTimeoutArgRefusal(timeout, timeoutCaps);
|
|
@@ -1035,10 +1033,9 @@ export function createBashReadonlyTool(env, rootCanonical, allow, opts) {
|
|
|
1035
1033
|
export function createEnvTaskOutputTool(env) {
|
|
1036
1034
|
return defineTool({
|
|
1037
1035
|
name: TASK_OUTPUT_TOOL_NAME,
|
|
1038
|
-
|
|
1036
|
+
...toolFace("task-output-hands"),
|
|
1039
1037
|
description: composeTaskOutputDescription(ENV_DIRECT_TASK_TOOL_CAPS),
|
|
1040
1038
|
parameters: composeTaskOutputParams(ENV_DIRECT_TASK_TOOL_CAPS),
|
|
1041
|
-
effect: "read",
|
|
1042
1039
|
execute: async (args) => {
|
|
1043
1040
|
const { task_id, filter } = args;
|
|
1044
1041
|
const id = resolveTaskIdArg(task_id);
|
|
@@ -1073,10 +1070,9 @@ export function createEnvTaskOutputTool(env) {
|
|
|
1073
1070
|
export function createEnvTaskStopTool(env, registry = defaultTaskRegistry) {
|
|
1074
1071
|
return defineTool({
|
|
1075
1072
|
name: TASK_STOP_TOOL_NAME,
|
|
1076
|
-
|
|
1073
|
+
...toolFace("task-stop-hands"),
|
|
1077
1074
|
description: composeTaskStopDescription(ENV_DIRECT_TASK_TOOL_CAPS),
|
|
1078
1075
|
parameters: TASK_STOP_PARAMS,
|
|
1079
|
-
effect: "write",
|
|
1080
1076
|
execute: async (args) => {
|
|
1081
1077
|
const { task_id, shell_id } = args;
|
|
1082
1078
|
const id = resolveTaskIdArg(task_id, shell_id);
|
package/dist/tools/fs/fs-read.js
CHANGED
|
@@ -9,6 +9,7 @@ import { MAX_READ_BYTES, SLICED_READ_MAX_BYTES, MAX_IMAGE_READ_BYTES, MAX_IMAGE_
|
|
|
9
9
|
import { readPdfFile, pdfResultToToolReturn } from "./fs-pdf.js";
|
|
10
10
|
import { openSystemReminder } from "../../core/reminder-mint.js";
|
|
11
11
|
import { discloseReminderShaped } from "../../core/reminder-disclosure.js";
|
|
12
|
+
import { toolFace } from "../../core/tool-catalog-entries.js";
|
|
12
13
|
export function createReadFileTool(env, state, rootCanonical, cwdRef, additionalRoots, imageDownsampler, pdfCapabilities, bgOutputReadExemption, readCyberReminder, readDeny, readFace, reminderMark, reminderDisclosureCounts) {
|
|
13
14
|
const cyberReminder = readCyberReminder === false ? "" : readCyberReminderText(reminderMark);
|
|
14
15
|
const reminderDisclosureWindows = new Map();
|
|
@@ -23,7 +24,7 @@ export function createReadFileTool(env, state, rootCanonical, cwdRef, additional
|
|
|
23
24
|
: "- `file_path` may be relative (resolved against the tracked working directory) or absolute (within the configured roots).\n";
|
|
24
25
|
return defineTool({
|
|
25
26
|
name: "Read",
|
|
26
|
-
|
|
27
|
+
...toolFace("read"),
|
|
27
28
|
description: "Reads a file from the local filesystem.\n" +
|
|
28
29
|
"\n" +
|
|
29
30
|
pathBoundLine +
|
|
@@ -55,7 +56,6 @@ export function createReadFileTool(env, state, rootCanonical, cwdRef, additional
|
|
|
55
56
|
limit: Type.Optional(Type.Integer({ minimum: 1, description: "The number of lines to read. Only provide if the file is too large to read at once. (Default: the whole file, bounded by the output-token cap.)" })),
|
|
56
57
|
pages: Type.Optional(Type.String({ description: `Page range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files. Maximum ${PDF_MAX_PAGES_PER_READ} pages per request.` })),
|
|
57
58
|
}),
|
|
58
|
-
effect: "read",
|
|
59
59
|
execute: async (args, ctx) => {
|
|
60
60
|
const { offset, limit, pages } = args;
|
|
61
61
|
const path = fileArgPath(args);
|