@sema-agent/core 5.57.0 → 5.58.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 +48 -0
- package/dist/agents/cascade.d.ts +1 -1
- package/dist/agents/cumulative-stats.d.ts +1 -1
- package/dist/agents/observer.d.ts +2 -2
- package/dist/agents/peer-admission.d.ts +1 -1
- package/dist/agents/retain-ledger.d.ts +2 -2
- package/dist/agents/roster-store.d.ts +8 -8
- package/dist/agents/send-message-tool.d.ts +2 -2
- package/dist/agents/subagent-steps.d.ts +1 -1
- package/dist/agents/subagent.d.ts +13 -13
- package/dist/agents/team.d.ts +5 -5
- package/dist/agents/tool-filter.d.ts +2 -2
- package/dist/agents/verify.d.ts +1 -1
- package/dist/bench/metrics.d.ts +35 -35
- package/dist/brain/degrading.d.ts +1 -1
- package/dist/brain/errors.d.ts +3 -3
- package/dist/brain/reasoning.d.ts +2 -2
- package/dist/brain/repetition.d.ts +1 -1
- package/dist/brain/status-sink.d.ts +2 -2
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/config/catalog.d.ts +5 -5
- package/dist/core/arg-summary.d.ts +4 -4
- package/dist/core/ask-class.d.ts +2 -2
- package/dist/core/ask-question.d.ts +1 -1
- package/dist/core/auto-compaction.d.ts +15 -15
- package/dist/core/auto-mode.d.ts +5 -5
- package/dist/core/background-agent-store.d.ts +20 -20
- package/dist/core/background-shell.d.ts +4 -4
- package/dist/core/checkpoint-store.d.ts +35 -27
- package/dist/core/context-edit.d.ts +1 -1
- package/dist/core/context-guard.d.ts +1 -1
- package/dist/core/exec-output-tail.d.ts +6 -6
- package/dist/core/file-snapshot-store.d.ts +8 -8
- package/dist/core/git-worktree-env.d.ts +3 -3
- package/dist/core/governance-codes.js +2 -0
- package/dist/core/hooks.d.ts +73 -33
- package/dist/core/hooks.js +87 -25
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/locked-config.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/mailbox-store.d.ts +1 -1
- package/dist/core/mcp.d.ts +3 -3
- package/dist/core/memory-engine/consolidation-driver.d.ts +207 -0
- package/dist/core/memory-engine/consolidation-driver.js +378 -0
- package/dist/core/memory-engine/consolidation.d.ts +46 -2
- package/dist/core/memory-engine/consolidation.js +1 -0
- package/dist/core/memory-engine/data-plane.d.ts +1 -1
- package/dist/core/memory-engine/distiller.d.ts +550 -0
- package/dist/core/memory-engine/distiller.js +598 -0
- package/dist/core/memory-engine/dual-root.d.ts +1 -1
- package/dist/core/memory-engine/engine.d.ts +47 -3
- package/dist/core/memory-engine/engine.js +37 -3
- package/dist/core/memory-engine/file-backend.d.ts +1 -1
- package/dist/core/memory-engine/index.d.ts +4 -2
- package/dist/core/memory-engine/index.js +4 -2
- package/dist/core/memory-engine/origin-clearance.d.ts +1 -1
- package/dist/core/memory-engine/scope-contract.d.ts +4 -4
- package/dist/core/memory-engine/sync-client.d.ts +16 -16
- package/dist/core/memory-engine/sync.d.ts +4 -4
- package/dist/core/memory-recall.d.ts +1 -1
- package/dist/core/memory.d.ts +2 -2
- package/dist/core/permission-rule-consent.d.ts +185 -36
- package/dist/core/permission-rule-consent.js +219 -44
- package/dist/core/permission-rule-model.d.ts +194 -31
- package/dist/core/permission-rule-model.js +93 -35
- package/dist/core/permission-rules.d.ts +9 -9
- package/dist/core/remote-env.d.ts +8 -8
- package/dist/core/roles.d.ts +3 -3
- package/dist/core/roles.js +1 -0
- package/dist/core/runner/assemble-result.d.ts +2 -2
- package/dist/core/runner/compaction-call-options.d.ts +3 -3
- package/dist/core/runner/memory-consolidation-driver.d.ts +49 -0
- package/dist/core/runner/memory-consolidation-driver.js +60 -0
- package/dist/core/runner/memory-consolidation.d.ts +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +3 -3
- package/dist/core/runner/prepare-task.d.ts +21 -21
- package/dist/core/runner/prepare-task.js +21 -14
- package/dist/core/runner/prepare-workspace-restore.d.ts +2 -2
- package/dist/core/runner/runtask.d.ts +11 -11
- package/dist/core/runner/session-rule-policy.d.ts +1 -1
- package/dist/core/runner/teardown-bounded.d.ts +1 -1
- package/dist/core/runner/tool-disclosure.d.ts +2 -2
- package/dist/core/runner/turn-attachments.d.ts +11 -11
- package/dist/core/scheduler.d.ts +5 -5
- package/dist/core/secret-env.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/session-policy-store.d.ts +2 -2
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +3 -3
- package/dist/core/session.d.ts +1 -1
- package/dist/core/shutdown-debug.d.ts +2 -2
- package/dist/core/side-query.d.ts +2 -2
- package/dist/core/spec-contract.d.ts +1 -1
- package/dist/core/store-contracts/contract-harness.d.ts +2 -2
- package/dist/core/store-contracts/contract-kit-version.d.ts +2 -2
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/mailbox-store-contract.js +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +12 -12
- package/dist/core/task-registry-monitor.d.ts +1 -1
- package/dist/core/task-registry-shared.d.ts +41 -41
- package/dist/core/task-registry.d.ts +12 -12
- package/dist/core/tool-detach.d.ts +2 -2
- package/dist/core/tool-errors.d.ts +3 -3
- package/dist/core/tool-policy.d.ts +55 -28
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +2 -2
- package/dist/core/tools.d.ts +1 -1
- package/dist/core/trace.d.ts +26 -23
- package/dist/core/types.d.ts +123 -70
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +7 -7
- package/dist/core/wiring-manifest.d.ts +5 -5
- package/dist/core/workflow-journal-store.d.ts +14 -14
- package/dist/core/workflow-run-store-contract.d.ts +1 -1
- package/dist/core/workflow-run-store-contract.js +1 -1
- package/dist/core/workflow-run-store.d.ts +4 -4
- package/dist/engine/compaction/compaction.d.ts +3 -3
- package/dist/engine/compaction/utils.d.ts +2 -2
- package/dist/engine/execution-env/kill-tree.d.ts +1 -1
- package/dist/engine/execution-env/node-execution-env.d.ts +8 -8
- package/dist/engine/harness/agent-harness.d.ts +6 -6
- package/dist/engine/harness/messages.d.ts +1 -1
- package/dist/engine/harness/types.d.ts +10 -10
- package/dist/engine/llm/types.d.ts +14 -14
- package/dist/engine/loop/agent-loop.d.ts +3 -3
- package/dist/engine/loop/types.d.ts +4 -4
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/import-validate.d.ts +1 -1
- package/dist/engine/session/log-digest.d.ts +1 -1
- package/dist/engine/session/memory-repo.d.ts +2 -2
- package/dist/engine/session/session.d.ts +4 -4
- package/dist/fixtures/index.d.ts +4 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -2
- package/dist/orchestration/goal.d.ts +1 -1
- package/dist/orchestration/run-spec.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +12 -12
- package/dist/orchestration/workflow-governance.d.ts +4 -4
- package/dist/orchestration/workflow-observe.d.ts +1 -1
- package/dist/orchestration/workflow-script-runner.d.ts +1 -1
- package/dist/orchestration/workflow-script-store.d.ts +9 -9
- package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +5 -5
- package/dist/orchestration/workflow.d.ts +10 -10
- package/dist/prompt-assembly/artifact-store.d.ts +1 -1
- package/dist/prompt-assembly/artifact.d.ts +1 -1
- package/dist/prompt-assembly/assemble.d.ts +1 -1
- package/dist/prompt-assembly/composer.d.ts +2 -2
- package/dist/prompt-assembly/epoch.d.ts +2 -2
- package/dist/prompt-assembly/event-registry.d.ts +1 -1
- package/dist/prompt-assembly/explain.d.ts +3 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +1 -1
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -4
- package/dist/prompt-assembly/types.d.ts +12 -12
- package/dist/prompts/coordinator.d.ts +1 -1
- package/dist/prompts/default.d.ts +8 -8
- package/dist/prompts/simple-sections.d.ts +3 -3
- package/dist/prompts/supervisor.d.ts +2 -2
- package/dist/scenarios/full-body.d.ts +3 -3
- package/dist/scenarios/scenario-registry.d.ts +1 -1
- package/dist/stores/cc/sidecar-transcript.d.ts +3 -3
- package/dist/stores/file/fs-atomic.d.ts +2 -2
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/session-store.d.ts +2 -2
- package/dist/stores/file/workflow-journal-store.d.ts +4 -4
- package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
- package/dist/tools/fs/encoding.d.ts +4 -4
- package/dist/tools/fs/fs-bash.d.ts +3 -3
- package/dist/tools/fs/fs-pdf.d.ts +1 -1
- package/dist/tools/fs/fs-shared.d.ts +6 -6
- package/dist/tools/fs/index.d.ts +2 -2
- package/dist/tools/fs/notebook.d.ts +1 -1
- package/dist/tools/fs/pdf.d.ts +1 -1
- package/dist/tools/fs/read-deny.d.ts +1 -1
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +2 -2
- package/dist/tools/monitor.d.ts +3 -3
- package/dist/tools/task-list.d.ts +2 -2
- package/dist/tools/web.d.ts +4 -4
- package/dist/tools/worktree.d.ts +5 -5
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +56 -3
|
@@ -6,12 +6,12 @@ import type { Message } from "../../internal/llm.js";
|
|
|
6
6
|
* handover) can enumerate the teammates' transcript sidecars and project them into sema message
|
|
7
7
|
* shapes for resume context.
|
|
8
8
|
*
|
|
9
|
-
* D-2 ruling (
|
|
9
|
+
* D-2 ruling (design/152 §3): the sidecar is CC→sema ONE-WAY. sema's transcript truth source
|
|
10
10
|
* is the SessionStore — this module never writes, and nothing here mints a second truth source
|
|
11
11
|
* (the dual-truth-source pathology design/151 just eliminated stays eliminated). Dual-write is a
|
|
12
12
|
* separate ruling gated on a real user need.
|
|
13
13
|
*
|
|
14
|
-
* Disk shape (
|
|
14
|
+
* Disk shape (cc-teams-diskform README):
|
|
15
15
|
* - flat sidecars: `subagents/agent-<id>.jsonl`
|
|
16
16
|
* - nested children: `subagents/<parentSeg>/agent-<id>.jsonl` (parent-segment subdirectories)
|
|
17
17
|
* - workflow runs: `subagents/workflows/<runId>/agent-<t>.jsonl`
|
|
@@ -53,7 +53,7 @@ export interface CcSidecarHandle {
|
|
|
53
53
|
* Enumerate every transcript sidecar under a CC `subagents/` directory, walking nested
|
|
54
54
|
* parent-segment subdirectories (symlinks not followed). Missing directory ⇒ `[]` — the CC tree is
|
|
55
55
|
* a PARTIAL tree (headless runs write sidecars but a REPL-only subtree may be absent entirely), so
|
|
56
|
-
* absence is a normal state, never a throw
|
|
56
|
+
* absence is a normal state, never a throw.
|
|
57
57
|
* Order is deterministic: lexicographic by (segments join, agentId).
|
|
58
58
|
*/
|
|
59
59
|
export declare function listCcSidecarAgents(subagentsDir: string): CcSidecarHandle[];
|
|
@@ -19,7 +19,7 @@ export declare function resolveDataRoot(explicit?: string): string;
|
|
|
19
19
|
/** Ensure a directory exists with 0o700 perms (idempotent). */
|
|
20
20
|
/**
|
|
21
21
|
* Atomically CREATE `target` carrying `content` — it appears in ONE step already fully written, no empty/partial
|
|
22
|
-
* window. Fixes the create-then-write race
|
|
22
|
+
* window. Fixes the create-then-write race: a reader/pruner can see a half-written
|
|
23
23
|
* file, and a crash mid-write leaves a zero-byte target a retry would silently keep. Writes a temp in `target`'s
|
|
24
24
|
* OWN dir (same FS → `link` is atomic) + fsync, then `linkSync`-publishes it; throws `EEXIST` if `target` exists.
|
|
25
25
|
*/
|
|
@@ -134,7 +134,7 @@ export declare class AppendLog {
|
|
|
134
134
|
*
|
|
135
135
|
* RB-66 (2026-07-25, red probe): `writeSync(fd, string)` issues ONE write(2) and may SHORT-WRITE — the
|
|
136
136
|
* same defect class this file's own `writeThenLink` already documents and fixed ("silently SHORT-WRITES
|
|
137
|
-
*
|
|
137
|
+
* "), never propagated to this shared primitive. A short write here leaves a torn
|
|
138
138
|
* line with no trailing newline, so the NEXT append concatenates onto it and replay drops BOTH records.
|
|
139
139
|
* Loop until every byte lands (write(2) returns how many it took) — the O_APPEND atomicity per call is
|
|
140
140
|
* unchanged, and a genuine I/O error still throws.
|
|
@@ -127,7 +127,7 @@ export declare class FileStorageBackend {
|
|
|
127
127
|
* `RunnerDeps.fileSnapshotStore`. Content-addressed blobs persist across restarts (local-only; a remote env
|
|
128
128
|
* defers rewind to its own VM-snapshot backend). */
|
|
129
129
|
readonly fileSnapshotStore: FileSnapshotStore;
|
|
130
|
-
/** SVC-2
|
|
130
|
+
/** SVC-2 (onboarded per) — file-backed durable workflow resume journal. Wire into
|
|
131
131
|
* `RunnerDeps.workflowJournalStore` so `resumeFromRunId` survives a process restart on a TOC box. */
|
|
132
132
|
readonly workflowJournalStore: WorkflowJournalStore;
|
|
133
133
|
/** design/164 件五 — file-backed cross-task usage-governance ledger. Wire into
|
|
@@ -71,11 +71,11 @@ export declare class FileSessionRepo implements SessionRepo {
|
|
|
71
71
|
placementOf(sessionId: string): Promise<SessionPlacementRecord | undefined>;
|
|
72
72
|
delete(metadata: SessionMetadata): Promise<void>;
|
|
73
73
|
fork(sourceMetadata: SessionMetadata, options?: SessionForkOptions): Promise<Session>;
|
|
74
|
-
/** 2c session-sync (
|
|
74
|
+
/** 2c session-sync (the FILE half): the FULL oldest-first log for export. The file backend
|
|
75
75
|
* has NO F3 floor — `read` returns EVERY persisted entry (`id`/`parentId` verbatim) — so this is the complete
|
|
76
76
|
* log, BYPASSing any bounded tail (matches `InMemorySessionRepo.exportEntries`). Missing file → not_found. */
|
|
77
77
|
exportEntries(sessionId: string): Promise<SessionTreeEntry[]>;
|
|
78
|
-
/** 2c session-sync
|
|
78
|
+
/** 2c session-sync: import a verbatim log into `sessionId`. The single fail-closed invariant gate runs
|
|
79
79
|
* FIRST ({@link validateEntriesForImport}); `owner` is a durable multi-tenant concept the local file backend
|
|
80
80
|
* has no field for (accepted, unused — same as `InMemorySessionRepo`). Writes the WHOLE file (meta + entries)
|
|
81
81
|
* atomically via tmp→fsync→rename — the rename is the commit point, so a crash leaves either nothing or an
|
|
@@ -70,7 +70,7 @@ export declare class FileWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
70
70
|
private get scopes();
|
|
71
71
|
constructor(root: string, fsyncEnabled?: boolean);
|
|
72
72
|
private pathFor;
|
|
73
|
-
/**
|
|
73
|
+
/** CC local form: the run's on-disk journal path for the notification diagnostics line.
|
|
74
74
|
* Traversal-shaped ids (LLM-controlled on some paths) degrade to undefined, never throw. */
|
|
75
75
|
locator(runId: string): string | undefined;
|
|
76
76
|
/** Replay a run's ledger: last-writer-wins per ordinal; a torn/unparsable line is skipped (uncommitted). */
|
|
@@ -78,7 +78,7 @@ export declare class FileWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
78
78
|
append(runId: string, scope: string, entry: WorkflowJournalEntry): Promise<void>;
|
|
79
79
|
load(runId: string, scope: string): Promise<WorkflowJournalEntry[]>;
|
|
80
80
|
/**
|
|
81
|
-
* RB-242 — the claim file for `(sourceRunId, scope)`. Keyed by BOTH
|
|
81
|
+
* RB-242 — the claim file for `(sourceRunId, scope)`. Keyed by BOTH: a cross-scope caller already
|
|
82
82
|
* resolves to an empty journal (it cannot fork anything), so letting it share one claim key would only hand
|
|
83
83
|
* any tenant a denial-of-resume lever over another's runs. The scope is folded in as a digest rather than
|
|
84
84
|
* a sanitized literal so two distinct scopes can never collapse onto one filename by sanitization.
|
|
@@ -111,7 +111,7 @@ export declare class FileWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
111
111
|
*/
|
|
112
112
|
private sweepExpiredClaims;
|
|
113
113
|
/**
|
|
114
|
-
* RB-242
|
|
114
|
+
* RB-242 — admission for a resume off `sourceRunId`. The LOCAL (TOC) twin of the SQL-backed
|
|
115
115
|
* `idem_key UNIQUE` + TTL: publishing the claim file is one atomic namespace operation that fails EEXIST
|
|
116
116
|
* against anyone who got there first, so two processes racing on the same box (the shape the in-process
|
|
117
117
|
* `startWorkflow` guards cannot see — a shell restart resuming a run a still-live process is already
|
|
@@ -121,7 +121,7 @@ export declare class FileWorkflowJournalStore implements WorkflowJournalStore {
|
|
|
121
121
|
granted: boolean;
|
|
122
122
|
holder?: string;
|
|
123
123
|
}>;
|
|
124
|
-
/** RB-242
|
|
124
|
+
/** RB-242 — release ONLY a claim this `newRunId` still holds. A claim that is already gone (TTL-reaped
|
|
125
125
|
* and possibly taken over) is a no-op: unlinking a successor's claim would re-open the very fork this prevents. */
|
|
126
126
|
releaseResumeClaim(input: ResumeClaimArgs): Promise<void>;
|
|
127
127
|
/** GC (service extra, mirrors the SQL twins): drop the run's ledger once the run is terminal + retained. */
|
|
@@ -415,7 +415,7 @@ export declare const POLL_LOOP_MAX_SLEEP_SECONDS = 600;
|
|
|
415
415
|
* no-egress envelope — every beat still runs allowlisted readers + literal `sleep`), and the
|
|
416
416
|
* walltime axis cascades a hard kill regardless. A deployment wanting NO command-substitution at
|
|
417
417
|
* all can prefer `{<lo>..<hi>}` or a literal list, which bash expands internally with no command
|
|
418
|
-
* run. (
|
|
418
|
+
* run. (falsification review flagged the substitution as [high] and recommended dropping it;
|
|
419
419
|
* kept per the ruling that names `$(seq <int> <int>)` as the one exemption — recorded for a
|
|
420
420
|
* tightening decision, since the brace form is a drop-in equivalent.)
|
|
421
421
|
* · STDIN-BLOCKING BODY (an availability residual, not a safety one). CLOSED for the shape this note
|
|
@@ -33,7 +33,7 @@ export interface DecodedTextFile {
|
|
|
33
33
|
encoding: DetectedFileEncoding;
|
|
34
34
|
/** Dominant line ending of the ORIGINAL bytes (majority vote — CC `CKt` @58184 同算法).
|
|
35
35
|
* Deliberately NOT per-line lossless: a mixed-endings file is unified to the dominant ending on
|
|
36
|
-
* the first edit (
|
|
36
|
+
* the first edit (镜头1/2 LOW, accepted non-goal — CC behaves the same way).
|
|
37
37
|
* RB-285 (encoding LOW): the COUNTING RULE is CC's; the SAMPLE is not. CC votes on the first 4096
|
|
38
38
|
* characters only (`CKt(s.slice(0, 4096))` @58201) while {@link detectLineEndings} below votes on
|
|
39
39
|
* the whole file — so a file whose first 4KB is LF and whose bulk is CRLF gets opposite verdicts.
|
|
@@ -41,7 +41,7 @@ export interface DecodedTextFile {
|
|
|
41
41
|
* the entire file, so sampling a prefix is exactly the case where the cheap answer flips the
|
|
42
42
|
* remaining 99% of the lines. Registered as a deliberate delta, not parity. */
|
|
43
43
|
endings: DetectedLineEndings;
|
|
44
|
-
/**
|
|
44
|
+
/** 双镜头 MED: a utf16le body with an ODD byte count is TRUNCATED/corrupt — decoding would
|
|
45
45
|
* silently drop the dangling byte and a later write-back would destroy it permanently. Flagged so
|
|
46
46
|
* the tool layer fails closed instead of "repairing" the file. */
|
|
47
47
|
malformed?: true;
|
|
@@ -65,7 +65,7 @@ export declare function encodeTextForFile(text: string, encoding: DetectedFileEn
|
|
|
65
65
|
* Deliberately does NOT strip a leading U+FEFF: an `old_string` starting with one may be quoting
|
|
66
66
|
* genuine file content — use {@link normalizeFileText} only where the string stands for a whole file. */
|
|
67
67
|
export declare function normalizeEditText(s: string): string;
|
|
68
|
-
/** RB-222
|
|
68
|
+
/** RB-222 — split a leading U+FEFF off MODEL-SUPPLIED whole-file text (CC `CTe` parity,
|
|
69
69
|
* 220 @365630). The BOM is a file-level byte marker, not text: decodeTextBytes strips it on the way
|
|
70
70
|
* in, so it can never live in the normalized coordinate. Only for strings that stand for a WHOLE
|
|
71
71
|
* file (Write `content`, readFileState seeding) — a decoded file text's leading U+FEFF is genuine
|
|
@@ -74,7 +74,7 @@ export declare function splitLeadingBom(text: string): {
|
|
|
74
74
|
hadBom: boolean;
|
|
75
75
|
text: string;
|
|
76
76
|
};
|
|
77
|
-
/** RB-222
|
|
77
|
+
/** RB-222 — CC `X9` parity (220 @365635 = BOM-strip + CRLF-normalize): THE coordinate
|
|
78
78
|
* every readFileState hash lives in (Read/Edit/Write staleness all hash `decodeTextBytes(...).text`).
|
|
79
79
|
* A hash taken on raw model content with a leading U+FEFF can never agree with any later re-read. */
|
|
80
80
|
export declare function normalizeFileText(s: string): string;
|
|
@@ -126,11 +126,11 @@ export declare function createBashTool(env: ExecutionEnv, rootCanonical: string,
|
|
|
126
126
|
* unconfined; passing this never gates anything.
|
|
127
127
|
*/
|
|
128
128
|
additionalRoots?: readonly string[];
|
|
129
|
-
/** RB-370 ② (cli
|
|
129
|
+
/** RB-370 ② (cli): override of the `timeout` parameter's DEFAULT budget, in ms — see
|
|
130
130
|
* {@link import("./index.js").HandsToolkitOptions.bashDefaultTimeoutMs} for the resolution
|
|
131
131
|
* contract (options over env over constant; invalid values discarded). */
|
|
132
132
|
bashDefaultTimeoutMs?: number;
|
|
133
|
-
/** RB-370 ② (cli
|
|
133
|
+
/** RB-370 ② (cli): override of the `timeout` parameter's engine CEILING, in ms — only-widen
|
|
134
134
|
* vs the resolved default; see {@link import("./index.js").HandsToolkitOptions.bashMaxTimeoutMs}. */
|
|
135
135
|
bashMaxTimeoutMs?: number;
|
|
136
136
|
/** Structured sink for this leg's timeout-cap discard announcements — consumed by
|
|
@@ -167,7 +167,7 @@ export declare function createBashTool(env: ExecutionEnv, rootCanonical: string,
|
|
|
167
167
|
* the operand cannot be resolved statically (there is nothing to degrade to).
|
|
168
168
|
*/
|
|
169
169
|
export declare function createBashReadonlyTool(env: ExecutionEnv, rootCanonical: string, allow: ReadonlySet<string>, opts?: {
|
|
170
|
-
/** RB-370 ② (cli
|
|
170
|
+
/** RB-370 ② (cli): same timeout-cap overrides the full `bash` leg takes — see
|
|
171
171
|
* {@link import("./index.js").HandsToolkitOptions.bashDefaultTimeoutMs} /
|
|
172
172
|
* {@link import("./index.js").HandsToolkitOptions.bashMaxTimeoutMs} (类修完整域: both foreground
|
|
173
173
|
* legs share runShell's clamp, so both must share the configurable resolution). */
|
|
@@ -34,7 +34,7 @@ type ReadPdfReturn = string | {
|
|
|
34
34
|
* it was not — every `document` card, sized or not, was dropped at the gate, making the 48K rule dead
|
|
35
35
|
* code and the pages/fallback-level disclosure invisible to a host. The word is registered now.
|
|
36
36
|
*
|
|
37
|
-
* Degradation chain v2 (
|
|
37
|
+
* Degradation chain v2 (裁定: the brain-level placeholder is NOT the end state): when the SERVING model
|
|
38
38
|
* cannot take a native document block (`caps.document === false` — e.g. any openai-compatible API), the
|
|
39
39
|
* whole-PDF path degrades IN THE TOOL (the only layer holding env.exec), best first:
|
|
40
40
|
* 1. `pdftotext -layout` text extraction → the content arrives as TEXT (Read byte-cap discipline applies);
|
|
@@ -65,7 +65,7 @@ export declare function truncatedUtf16BodyMessage(tool: string, path: string): s
|
|
|
65
65
|
/** Why a bash_readonly refusal is terminal rather than escalated. Appended by every arm of that refusal
|
|
66
66
|
* family; the arms differ in what they found, never in what the model can do about it. */
|
|
67
67
|
export declare const BASH_READONLY_CONFINEMENT_NOTE = "bash_readonly is confined to the workspace roots; it has no approval path, so the call is refused rather than escalated.";
|
|
68
|
-
/** RB-222
|
|
68
|
+
/** RB-222 r3 — the readFileState hash coordinate for a file that was JUST WRITTEN via
|
|
69
69
|
* `encodeTextForFile`: decode the EXACT payload handed to `env.writeFile`, i.e. what the next
|
|
70
70
|
* re-read's `decodeTextBytes` will produce. A blanket `normalizeFileText` is WRONG on the
|
|
71
71
|
* encode-preserving Edit lanes: a leading U+FEFF in the new text is stripped by the next read only
|
|
@@ -209,7 +209,7 @@ export declare function bashTimeoutArgRefusal(timeoutMs: number | undefined, cap
|
|
|
209
209
|
maxMs: number;
|
|
210
210
|
}): string | undefined;
|
|
211
211
|
/**
|
|
212
|
-
* RB-370 ②/③
|
|
212
|
+
* RB-370 ②/③ — the SINGLE authority for the Bash `timeout` parameter's two numbers:
|
|
213
213
|
* the default budget applied when the model omits `timeout`, and the engine ceiling requests are
|
|
214
214
|
* clamped to. The 120s/600s constants themselves are CC 220-same; what CC additionally has — and this
|
|
215
215
|
* resolver adds — is configurability.
|
|
@@ -223,7 +223,7 @@ export declare function bashTimeoutArgRefusal(timeoutMs: number | undefined, cap
|
|
|
223
223
|
* default floors the cap. Invalid values (non-finite / <= 0) are discarded at every leg, options
|
|
224
224
|
* included, exactly like CC's env read.
|
|
225
225
|
*
|
|
226
|
-
* ③ Readable seam
|
|
226
|
+
* ③ Readable seam: a shell/host rendering its OWN copy of the Bash tool description MUST
|
|
227
227
|
* read the true values from here instead of holding a sibling constant — the engine's description/param
|
|
228
228
|
* text and its runtime clamp both interpolate this function's output (resolved once per tool instance),
|
|
229
229
|
* so a self-held "600s" only matches by coincidence and forks silently the moment a deployment
|
|
@@ -271,7 +271,7 @@ export declare function clipShellOutput(s: string): string;
|
|
|
271
271
|
* ALREADY fully in memory here (the env delivered them whole — only `clipShellOutput` above decides how
|
|
272
272
|
* much of that the model's turn actually sees) — the gap this closes is that the omitted middle was
|
|
273
273
|
* simply discarded, forcing a blind full re-run to recover output that was, in fact, captured. "Whole"
|
|
274
|
-
* means whatever THIS layer received, not a guarantee about what the process originally wrote (
|
|
274
|
+
* means whatever THIS layer received, not a guarantee about what the process originally wrote (
|
|
275
275
|
* review P1): the env's own rolling-tail cap (`MAX_EXEC_OUTPUT_BYTES`, exec-output-tail.ts) can already
|
|
276
276
|
* have dropped the head before delivery on a truly enormous single command — this file is a faithful copy
|
|
277
277
|
* of the received bytes either way, and still carries that cap's own `markTruncated()` marker when it
|
|
@@ -379,7 +379,7 @@ export declare function countLines(s: string): number;
|
|
|
379
379
|
* home and carries the session mark when one is threaded (the recorded wire-form divergence). */
|
|
380
380
|
export declare function seededFileUnchangedReminder(filePath: string, mark?: string): string;
|
|
381
381
|
/**
|
|
382
|
-
* RB-197②(
|
|
382
|
+
* RB-197②(交叉复审命中,已修) — true when `resultText` is one of the Read tool's TWO dedup
|
|
383
383
|
* markers (the ordinary unchanged-since-last-read stub below, or {@link seededFileUnchangedReminder})
|
|
384
384
|
* rather than a genuine content transmission. A consumer deciding "is this file's real content
|
|
385
385
|
* present in THIS message" (e.g. auto-compaction's kept-tail visibility scan) must treat a stub hit
|
|
@@ -431,7 +431,7 @@ export declare function seedReadFileStateFromTranscript(state: ReadFileState, ke
|
|
|
431
431
|
* The read-before-edit gate tightens as a consequence, matching CC: after a compaction the model must
|
|
432
432
|
* re-Read a summarized-away file before editing it, instead of blind-editing from a stale recollection.
|
|
433
433
|
*
|
|
434
|
-
* RB-197②(独立复审 +
|
|
434
|
+
* RB-197②(独立复审 + 命中,已修): a THIRD category besides seeded/re-attached — a file whose most
|
|
435
435
|
* recent Read is still visible verbatim in the compaction's KEPT tail is deliberately left OUT of
|
|
436
436
|
* `attachedComplete` (re-attaching it would just duplicate content already in context), but its
|
|
437
437
|
* existing read-state entry must survive unmodified for the SAME reason a seeded entry does: the
|
package/dist/tools/fs/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export interface HandsToolkitOptions {
|
|
|
63
63
|
}) => void;
|
|
64
64
|
/** design/116 detach: the run-local per-tool-call detach hub (mid-flight ctrl+b → adopt as background). */
|
|
65
65
|
detachHub?: import("../../core/tool-detach.js").ToolDetachHub;
|
|
66
|
-
/** RB-370 ② (cli
|
|
66
|
+
/** RB-370 ② (cli): the Bash `timeout` parameter's DEFAULT budget, in ms — applied when the
|
|
67
67
|
* model omits `timeout`. Resolution (options over env over constant — the standing sema discipline:
|
|
68
68
|
* deployments configure the tool, not the process): this field ?? env `BASH_DEFAULT_TIMEOUT_MS` ??
|
|
69
69
|
* 120000; invalid (non-finite / <= 0) values are discarded at every leg. See
|
|
@@ -71,7 +71,7 @@ export interface HandsToolkitOptions {
|
|
|
71
71
|
* description, so the advertised numbers always match the enforced ones. Additive: absent ⇒
|
|
72
72
|
* byte-compat 120s. Applies to both shell legs (`bash` and `bash_readonly`). */
|
|
73
73
|
bashDefaultTimeoutMs?: number;
|
|
74
|
-
/** RB-370 ② (cli
|
|
74
|
+
/** RB-370 ② (cli): the Bash `timeout` parameter's engine CEILING, in ms — requests above it
|
|
75
75
|
* are clamped (with the RB-370 requested/capped disclosure naming THIS value). Resolution: (this
|
|
76
76
|
* field ?? env `BASH_MAX_TIMEOUT_MS` ?? 600000), then floored at the resolved default — CC's own
|
|
77
77
|
* only-widen semantic: a ceiling below the default is a narrowing intent = invalid, ignored in
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImageContent } from "../../internal/llm.js";
|
|
2
2
|
/**
|
|
3
|
-
* RB-227
|
|
3
|
+
* RB-227 — the Read tool's Jupyter-notebook projection: `.ipynb` is rendered as cells
|
|
4
4
|
* with outputs (CC 2.1.220 parity: `Ctd`/`wtd`/`Zx_`/`Qx_`/`eI_`/`tI_`/`Atd`, pretty220.js
|
|
5
5
|
* :371265-:371426), never as raw JSON text. The raw-JSON rendering let a notebook's base64 outputs
|
|
6
6
|
* overflow the Read token cap, auto-paginate into an `isPartialView` entry, and thereby lock
|
package/dist/tools/fs/pdf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PDF read pipeline (
|
|
2
|
+
* PDF read pipeline (+ 审计 — CC FileReadTool parity).
|
|
3
3
|
*
|
|
4
4
|
* CC ground truth (original-source-code, 取证 2026-07-07):
|
|
5
5
|
* - Whole-PDF path (`FileReadTool.ts:987-1016` + `utils/pdf.ts:88-103`): the file bytes are base64'd and
|
|
@@ -157,7 +157,7 @@ export declare function matchSegmentPatterns(path: string, compiled: readonly Co
|
|
|
157
157
|
readonly aliasResolved?: boolean;
|
|
158
158
|
}): string | null;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* the PURE validation/canonicality predicate over a PERSISTED deny entry (checkpoint v9
|
|
161
161
|
* face section), for the resume pre-CAS ladder: it must refuse BEFORE the approval CAS everything
|
|
162
162
|
* {@link compileReadDeny} would throw on AFTER it (a post-CAS compile throw consumes the human's
|
|
163
163
|
* approval and strands the row), plus non-canonical spellings (normalizeEntry canonicalizes at every
|
|
@@ -14,13 +14,13 @@ import type { ExecutionEnv } from "../../internal/harness-types.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function fileArgPath(args: unknown): string | undefined;
|
|
16
16
|
/**
|
|
17
|
-
* The WRITE TARGET of a path-confinable write call, tool-aware (
|
|
17
|
+
* The WRITE TARGET of a path-confinable write call, tool-aware (b — single source for every
|
|
18
18
|
* gate that confines a write target, same discipline as {@link fileArgPath} above):
|
|
19
19
|
*
|
|
20
20
|
* · canonical `NotebookEdit` → `notebook_path` FIRST, `file_path`/`path` only as fallback. The tool
|
|
21
21
|
* itself writes `notebook_path`; its schema tolerates extra keys, so a stray/decoy `file_path` on a
|
|
22
22
|
* NotebookEdit call must never become the judged target while the real write lands elsewhere
|
|
23
|
-
* (a gate that read `file_path` first would confine the decoy — the
|
|
23
|
+
* (a gate that read `file_path` first would confine the decoy — the hole).
|
|
24
24
|
* · every other tool → `file_path`/`path` first ({@link fileArgPath}), `notebook_path` as the
|
|
25
25
|
* historical fallback (unchanged behavior for the pre-existing gate callers).
|
|
26
26
|
*
|
|
@@ -63,7 +63,7 @@ export interface ReadEntry {
|
|
|
63
63
|
start: number;
|
|
64
64
|
end: number;
|
|
65
65
|
};
|
|
66
|
-
/** Millisecond timestamp of the last read/write-back that recorded this entry (
|
|
66
|
+
/** Millisecond timestamp of the last read/write-back that recorded this entry (
|
|
67
67
|
* 2026-07-03, compact re-read parity: the post-compaction attachment picks the most RECENTLY
|
|
68
68
|
* read files — CC sorts readFileState by timestamp). Optional/additive: undefined (an entry
|
|
69
69
|
* seeded from an older checkpoint) sorts last, never breaks. */
|
|
@@ -125,7 +125,7 @@ export interface FsViolation {
|
|
|
125
125
|
*/
|
|
126
126
|
export declare function isAbsolutePathForm(p: string): boolean;
|
|
127
127
|
/**
|
|
128
|
-
* Windows-FAMILY spelling of a path (
|
|
128
|
+
* Windows-FAMILY spelling of a path (extracted here so {@link canonicalizeTarget} judges
|
|
129
129
|
* the UNC family by the same rule): drive-rooted (`C:\…`/`C:/…`), UNC-backslash (`\\host\share`), or a
|
|
130
130
|
* RELATIVE path using `\` as its separator. Never keyed on `process.platform` — the exec env may be remote
|
|
131
131
|
* and of the other family than the host. A `/`-rooted path is POSIX-form even when a file NAME inside it
|
|
@@ -184,7 +184,7 @@ export declare function hasBinaryExtension(path: string): boolean;
|
|
|
184
184
|
export declare function imageMimeForRead(path: string): string | undefined;
|
|
185
185
|
/** Verify the raw bytes actually ARE the image format the extension claims (magic-number sniff). Extension alone
|
|
186
186
|
* is forgeable: a `.png` holding text / an empty file / a truncated blob would otherwise become a malformed
|
|
187
|
-
* `ImageContent` that makes the NEXT provider request fail (400). Pure — no I/O. (batch-C
|
|
187
|
+
* `ImageContent` that makes the NEXT provider request fail (400). Pure — no I/O. (batch-C.) */
|
|
188
188
|
export declare function imageMagicMatches(bytes: Uint8Array, mimeType: string): boolean;
|
|
189
189
|
/** One contiguous byte pattern that must appear at a fixed offset for its signature to match. */
|
|
190
190
|
export interface BinaryMagicSegment {
|
|
@@ -349,8 +349,8 @@ export declare const PATH_NOT_IN_ROOT_ESCAPE_HINT = "(This boundary applies to t
|
|
|
349
349
|
* Message is CC 2.1.198 live-verbatim (all-tools-live-probe 2026-07-08 §2.1/§3.1/§5.1 — one message for
|
|
350
350
|
* Edit/Write/NotebookEdit: "before writing to it", not the old sema "before editing").
|
|
351
351
|
*
|
|
352
|
-
* RB-200 F2(
|
|
353
|
-
* `!p || p.isPartialView
|
|
352
|
+
* RB-200 F2 (CC 220 corpus-confirmed, @367198/@367671 — Edit and Write spell the read gate identically,
|
|
353
|
+
* `!p || p.isPartialView`): an AUTO-TRUNCATED read (the model asked for the
|
|
354
354
|
* file by default, no explicit offset/limit, and the token cap cut it anyway — {@link ReadEntry.isPartialView})
|
|
355
355
|
* used to satisfy this gate exactly like a full read (`state.has(key)` alone was the whole check) — the
|
|
356
356
|
* model could Write (full overwrite) or Edit a file having genuinely seen only its first page, silently
|
|
@@ -372,7 +372,7 @@ export declare function requireRead(state: ReadFileState, key: string): FsViolat
|
|
|
372
372
|
*/
|
|
373
373
|
export declare const OVERSIZE_READ_ESCAPE_HINT = "(This file is over the Read tool's whole-file byte cap, so a default Read is refused \u2014 read it in slices with explicit offset/limit to satisfy the read-first rule, or inspect/transform it with bash (e.g. `sed -n`, `grep`) instead.)";
|
|
374
374
|
/**
|
|
375
|
-
* RB-264 N1 (
|
|
375
|
+
* RB-264 N1 (repro `notebookedit-tool-read-gate-deadlock` assertion A.c2) —
|
|
376
376
|
* the escape-hatch parenthetical for the OTHER shape of the read-before-edit refusal: the file was read,
|
|
377
377
|
* but the read was AUTO-PAGINATED by the output token cap ({@link ReadEntry.isPartialView}), so only the
|
|
378
378
|
* first page was ever seen. The oversize branch above has named its escape route since the fidelity
|
|
@@ -384,7 +384,7 @@ export declare const OVERSIZE_READ_ESCAPE_HINT = "(This file is over the Read to
|
|
|
384
384
|
*/
|
|
385
385
|
export declare const PARTIAL_VIEW_READ_ESCAPE_HINT = "(Your last Read of this file returned only a PARTIAL view \u2014 the output token cap paginated it, so a default Read will keep returning the same page. Re-read it with explicit offset/limit (start from the page marker's next-page hint) until you have seen the part you are about to change; an explicit slice that fits satisfies the read-first rule. Or inspect/transform it with bash (e.g. `sed -n`, `grep`) instead.)";
|
|
386
386
|
/**
|
|
387
|
-
* RB-264 ⑥W1
|
|
387
|
+
* RB-264 ⑥W1 — the escape-hatch parenthetical for the ONE shape of the
|
|
388
388
|
* read-first deadlock that nothing observable diagnoses: a file the Read tool REFUSES (binary /
|
|
389
389
|
* BOM-less UTF-16 / unknown encoding) can never satisfy read-before-write, and — unlike the oversize
|
|
390
390
|
* and partial-view shapes — leaves no trace the refusal renderer can stat for. It is therefore the
|
|
@@ -95,8 +95,8 @@ export declare function gitignoreMatcher(content: string): (rel: string, isDir:
|
|
|
95
95
|
/** Build the combined ignore predicate (ignore-set ∪ .gitignore) for a JS-fallback walk.
|
|
96
96
|
* Exported so repo-map (design/72 §1) walks with the SAME ignore semantics as grep/glob.
|
|
97
97
|
*
|
|
98
|
-
* RB-200 F1(
|
|
99
|
-
* "!"+N)
|
|
98
|
+
* RB-200 F1 (CC 220 corpus-confirmed, @368590-368592 Grep `T=["--hidden"]; for(N of Ok_) T.push("--glob",
|
|
99
|
+
* "!"+N)`, @367957/367959-367965 Glob `CLAUDE_CODE_GLOB_HIDDEN` defaults to true and also passes `--hidden`): CC's own
|
|
100
100
|
* "keep it quiet" posture is NOT "every dot-prefixed name is invisible" — it's `--hidden` (show
|
|
101
101
|
* everything dot-prefixed) plus an explicit VCS-directory exclusion list ({@link DEFAULT_IGNORE_DIRS}).
|
|
102
102
|
* The blanket rule this function used to apply here (`base.startsWith(".")`) instead made EVERY hidden
|
package/dist/tools/monitor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* design/135 G2 (审计
|
|
2
|
+
* design/135 G2 (审计 🔴) — the `Monitor` tool: run a shell command in the background and watch its
|
|
3
3
|
* stdout as a stream of NOTIFICATION EVENTS (the自主循环 core piece: "watch this and tell me when something
|
|
4
4
|
* happens" without burning poll turns).
|
|
5
5
|
*
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
* TaskNotificationPayload lane at "later" priority (delivered at the next turn boundary like every
|
|
18
18
|
* notification — ruled 2026-08-05; consecutive frames drain as one boundary batch, and a backlog past
|
|
19
19
|
* the engine-note cap parks per session, so a chatty watcher cannot monopolize the run's boundaries).
|
|
20
|
-
*
|
|
20
|
+
* (1.257): events born BETWEEN turns (run torn down / harness idle — the long-watch main case)
|
|
21
21
|
* are no longer lost: the Runner parks them per session (bounded, drop-disclosing) and the session's next
|
|
22
22
|
* run redelivers them through the same notification lane at its first turn boundary.
|
|
23
|
-
*
|
|
23
|
+
* (CC parity): a monitor's lifetime = min(timeout_ms, process exit, TaskStop); a `persistent`
|
|
24
24
|
* one is SESSION-anchored (reaped at session release). NEITHER is run-anchored: the run teardown leaves an
|
|
25
25
|
* in-window non-persistent watch alive (process on the dispose except-list, watcher ticking, row kept), so
|
|
26
26
|
* cross-turn watching — CC's main Monitor use case — works with the default persistent:false too; its
|
|
@@ -62,7 +62,7 @@ export interface TaskListStore {
|
|
|
62
62
|
delete(id: string): boolean | Promise<boolean>;
|
|
63
63
|
list(): TaskListItem[] | Promise<TaskListItem[]>;
|
|
64
64
|
allocateId(): string | Promise<string>;
|
|
65
|
-
/**
|
|
65
|
+
/** the transaction boundary for adapters whose backend outlives one wrapper
|
|
66
66
|
* instance (pg, shared files): when present, the tools run EVERY read-modify-write sequence
|
|
67
67
|
* inside `mutate` and the adapter supplies sequence-level atomicity (a DB transaction, an
|
|
68
68
|
* advisory lock keyed on the backend — not on this object). Absent ⇒ the tools fall back to the
|
|
@@ -70,7 +70,7 @@ export interface TaskListStore {
|
|
|
70
70
|
* backend IS this object) and wrong for anything shared wider — implement `mutate` there. */
|
|
71
71
|
mutate?<T>(fn: (tx: TaskListStore) => Promise<T>): Promise<T>;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
73
|
+
/** the clone policy behind the detached-copy contract: metadata must be JSON-shaped
|
|
74
74
|
* (structuredClone would accept — and SHARE — SharedArrayBuffer backing memory, and throws opaquely
|
|
75
75
|
* on functions/proxies; the tool lane is always JSON, so this guards DIRECT store users). */
|
|
76
76
|
/**
|
package/dist/tools/web.d.ts
CHANGED
|
@@ -91,12 +91,12 @@ export declare function webFetchToolSpec(config?: WebFetchConfig): ToolSpec;
|
|
|
91
91
|
export declare function createWebFetchTool(config?: WebFetchConfig): AgentTool;
|
|
92
92
|
/** {@link createWebFetchSummarizer}'s truncation bound — CC's `MAX_MARKDOWN_LENGTH`
|
|
93
93
|
* (WebFetchTool/utils.ts:128). Exported so a deployment wiring the reference summarizer doesn't need
|
|
94
|
-
* its own copy of this number to reason about (
|
|
94
|
+
* its own copy of this number to reason about (a downstream deployment asked for this explicitly,
|
|
95
95
|
* to avoid a value-copy of the truncation threshold drifting from this one). */
|
|
96
96
|
export declare const WEBFETCH_SUMMARY_MAX_CONTENT = 100000;
|
|
97
97
|
/** {@link createWebFetchSummarizer}'s fixed guidelines block — CC's `makeSecondaryModelPrompt`
|
|
98
98
|
* (WebFetchTool/prompt.ts, non-preapproved-domain arm, guidelines verbatim). Exported alongside
|
|
99
|
-
* {@link WEBFETCH_SUMMARY_MAX_CONTENT} for the same reason
|
|
99
|
+
* {@link WEBFETCH_SUMMARY_MAX_CONTENT} for the same reason: a deployment composing
|
|
100
100
|
* its OWN summarizer (not this reference one) that still wants CC-parity guidance text doesn't need its
|
|
101
101
|
* own copy of this string. Not runtime-parameterized — the page content and the caller's `prompt` are
|
|
102
102
|
* interpolated AROUND this block, never inside it. */
|
|
@@ -177,7 +177,7 @@ export interface WebFetchSummarizerOptions {
|
|
|
177
177
|
} | undefined;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
180
|
+
* A reference {@link WebFetchConfig.summarize} implementation: reuses a
|
|
181
181
|
* caller-supplied `brain` (rather than requiring a dedicated second model) to extract a focused answer
|
|
182
182
|
* from fetched content per the caller's `prompt`, instead of the tool dumping the whole (fenced, still
|
|
183
183
|
* untrusted) page. CC ALWAYS routes fetched content through a secondary model this way
|
|
@@ -227,7 +227,7 @@ export interface WebSearchConfig {
|
|
|
227
227
|
}>>;
|
|
228
228
|
/** Max results returned to the model (default 10). */
|
|
229
229
|
maxResults?: number;
|
|
230
|
-
/** Wall-clock budget for one `search` call, in ms. Default 30 000 (RB-231
|
|
230
|
+
/** Wall-clock budget for one `search` call, in ms. Default 30 000 (RB-231). The backend is
|
|
231
231
|
* deployment-injected and may ignore the AbortSignal entirely, so this is enforced with BOTH an abort
|
|
232
232
|
* and a race — a hung backend must not hang the turn, and without this the deployment had no interface
|
|
233
233
|
* to bound it. */
|
package/dist/tools/worktree.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 审计深挖 G4 — the `EnterWorktree` / `ExitWorktree` tool pair: SESSION-level git-worktree
|
|
3
3
|
* isolation (CC 2.1.198 parity). EnterWorktree creates a managed worktree under `.sema-worktrees/`
|
|
4
4
|
* (the same {@link WORKTREE_PARENT} the subagent `isolation:"worktree"` lane uses) and REALLY switches
|
|
5
5
|
* the task's working directory into it; ExitWorktree returns to the original directory and cleans up.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* containment is untouched: the worktree lives UNDER the task root, so resolveKey's canonical-within
|
|
28
28
|
* check still holds for every subsequent fs op.
|
|
29
29
|
*
|
|
30
|
-
* ⚠️ Containment ruling (
|
|
30
|
+
* ⚠️ Containment ruling (deliberate): entering a worktree is a **cwd switch, NOT a
|
|
31
31
|
* sandbox**. resolveKey's containment anchor stays the ORIGINAL task root — it is deliberately NOT
|
|
32
32
|
* re-anchored/tightened to the worktree dir, so `../../` from inside the worktree can still reach the
|
|
33
33
|
* rest of the repository (which is WITHIN the task root and was reachable before Enter too), while
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* arbitrary command surface), but they create/delete on-disk state ⇒ effect:"write" (plan mode gates
|
|
41
41
|
* them like every other write tool; read-only hands never mount them — see prepare-task).
|
|
42
42
|
*
|
|
43
|
-
* Durability
|
|
43
|
+
* Durability: the active session lives in a SHARED, ALL-SERIALIZABLE
|
|
44
44
|
* {@link WorktreeSessionRef} owned by prepare-task (never a closure-only var, and no captured destroy
|
|
45
45
|
* closure — Exit re-derives removal as a plain `git worktree remove`). A durable suspend stamps it into
|
|
46
46
|
* `CheckpointState.activeWorktree` (+ the cwd into `handsCwd`); resume re-seeds both, so
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
*/
|
|
49
49
|
import type { ActiveWorktreeSession, AgentTool, ExecutionEnv } from "../internal/harness-types.js";
|
|
50
50
|
import type { CwdRef } from "./fs/index.js";
|
|
51
|
-
/**
|
|
51
|
+
/** the ACTIVE worktree session, ALL-SERIALIZABLE (plain strings, no closures):
|
|
52
52
|
* prepare-task owns the ref, stamps `current` into `CheckpointState.activeWorktree` at a durable
|
|
53
53
|
* suspend, and re-seeds it on resume, so ExitWorktree works across the suspend/resume boundary (the
|
|
54
54
|
* tree survives on disk; removal is re-derived as a plain `git worktree remove`).
|
|
@@ -80,7 +80,7 @@ export interface WorktreeToolsOptions {
|
|
|
80
80
|
* assigns it to the worktree path (a REAL cwd switch: Bash/Read/Edit/Write/Monitor all follow),
|
|
81
81
|
* ExitWorktree restores it. */
|
|
82
82
|
cwdRef: CwdRef;
|
|
83
|
-
/**
|
|
83
|
+
/** the shared session-state ref (checkpointable — prepare-task serializes it into
|
|
84
84
|
* the durable checkpoint and re-seeds it on resume). Omitted ⇒ a private per-mount ref (same live
|
|
85
85
|
* behavior, minus durable-suspend survival — prepare-task always passes one). */
|
|
86
86
|
session?: WorktreeSessionRef;
|