@sema-agent/core 7.15.0 → 7.17.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 +202 -0
- package/dist/agents/builtin-agents.d.ts +3 -3
- package/dist/agents/cross-session-envelope.d.ts +0 -1
- package/dist/agents/cross-session-envelope.js +0 -1
- package/dist/agents/peer-notices.d.ts +0 -9
- package/dist/agents/peer-notices.js +0 -63
- package/dist/agents/subagent.js +7 -15
- package/dist/brain/request-params.d.ts +2 -2
- package/dist/config/defaults.d.ts +0 -7
- package/dist/config/defaults.js +0 -2
- package/dist/core/artifact-host.d.ts +218 -0
- package/dist/core/artifact-host.js +92 -0
- package/dist/core/ask-origin.d.ts +29 -3
- package/dist/core/ask-origin.js +17 -9
- package/dist/core/ask-question.d.ts +25 -0
- package/dist/core/ask-question.js +4 -0
- package/dist/core/ask-unresolvable-notice.d.ts +30 -21
- package/dist/core/ask-unresolvable-notice.js +16 -8
- package/dist/core/auto-compaction.d.ts +10 -10
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/background-agent-store.d.ts +5 -5
- package/dist/core/background-shell.d.ts +1 -1
- package/dist/core/checkpoint-execution-record.d.ts +0 -3
- package/dist/core/checkpoint-execution-record.js +0 -4
- package/dist/core/checkpoint-store.d.ts +71 -99
- package/dist/core/checkpoint-store.js +9 -16
- package/dist/core/context-edit.d.ts +36 -104
- package/dist/core/context-edit.js +37 -60
- package/dist/core/effective-path-target.d.ts +68 -8
- package/dist/core/effective-path-target.js +42 -30
- package/dist/core/engine-notice.d.ts +46 -32
- package/dist/core/env-budget.d.ts +31 -0
- package/dist/core/env-budget.js +39 -0
- package/dist/core/exec-output-tail.d.ts +5 -5
- package/dist/core/file-history-store.js +3 -6
- package/dist/core/fs-write-gate-policy.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.js +3 -3
- package/dist/core/gate-lanes.js +9 -15
- package/dist/core/governance-codes.d.ts +1 -1
- package/dist/core/governance-codes.js +4 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +18 -17
- package/dist/core/lsp-session.d.ts +1 -1
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/lsp.js +5 -4
- package/dist/core/mcp.d.ts +5 -5
- package/dist/core/mcp.js +4 -48
- package/dist/core/memory-engine/delegation-settlement.d.ts +37 -12
- package/dist/core/memory-engine/delegation-settlement.js +128 -39
- package/dist/core/memory-engine/engine.d.ts +9 -8
- package/dist/core/memory-engine/engine.js +115 -120
- package/dist/core/memory-engine/file-backend.d.ts +17 -5
- package/dist/core/memory-engine/file-backend.js +78 -34
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +2 -2
- package/dist/core/memory-engine/layout.d.ts +152 -54
- package/dist/core/memory-engine/layout.js +441 -104
- package/dist/core/memory-engine/types.d.ts +8 -3
- package/dist/core/memory-engine/types.js +5 -0
- package/dist/core/memory-recall.d.ts +0 -8
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/oracle-isolation.js +2 -2
- package/dist/core/parent-spec-seat.d.ts +66 -0
- package/dist/core/parent-spec-seat.js +47 -0
- package/dist/core/permission-rule-model.d.ts +11 -6
- package/dist/core/permission-rule-model.js +53 -37
- package/dist/core/permission-rules.js +8 -3
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/remote-env.d.ts +1 -1
- package/dist/core/retired-keys.d.ts +19 -0
- package/dist/core/retired-keys.js +15 -0
- package/dist/core/runner/abort-race.d.ts +3 -3
- package/dist/core/runner/active-skill-scope.d.ts +2 -2
- package/dist/core/runner/active-skill-scope.js +3 -3
- package/dist/core/runner/assemble-result.d.ts +42 -40
- package/dist/core/runner/assemble-result.js +5 -4
- package/dist/core/runner/checkpoint-scope.d.ts +4 -4
- package/dist/core/runner/clock-and-limits.d.ts +3 -3
- package/dist/core/runner/compaction-call-options.d.ts +35 -99
- package/dist/core/runner/compaction-knobs.d.ts +4 -4
- package/dist/core/runner/compaction-seams.d.ts +5 -5
- package/dist/core/runner/contracts.d.ts +232 -233
- package/dist/core/runner/decide-continuation.d.ts +6 -6
- package/dist/core/runner/denial-limit-arms.d.ts +8 -8
- package/dist/core/runner/derived-route-fallback.d.ts +2 -2
- package/dist/core/runner/gate-exit.d.ts +6 -6
- package/dist/core/runner/gate-exit.js +15 -1
- package/dist/core/runner/git-status-frame.d.ts +7 -7
- package/dist/core/runner/halt-attribution.d.ts +35 -0
- package/dist/core/runner/halt-attribution.js +16 -0
- package/dist/core/runner/inherited-ask-grants.d.ts +6 -6
- package/dist/core/runner/memory-capture-optout.d.ts +1 -1
- package/dist/core/runner/memory-consolidation-driver.d.ts +4 -4
- package/dist/core/runner/memory-consolidation.d.ts +6 -8
- package/dist/core/runner/memory-consolidation.js +0 -1
- package/dist/core/runner/park-commit.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.d.ts +19 -19
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -4
- package/dist/core/runner/prepare-artifact.d.ts +53 -0
- package/dist/core/runner/prepare-artifact.js +77 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +3 -3
- package/dist/core/runner/prepare-boundary-parks.d.ts +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +9 -7
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -3
- package/dist/core/runner/prepare-config-doors.d.ts +24 -24
- package/dist/core/runner/prepare-config-doors.js +5 -2
- package/dist/core/runner/prepare-context-lane.d.ts +8 -8
- package/dist/core/runner/prepare-context-lane.js +2 -13
- package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +3 -3
- package/dist/core/runner/prepare-file-history.js +3 -52
- package/dist/core/runner/prepare-gate-stations.d.ts +5 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +35 -38
- package/dist/core/runner/prepare-hands-readface.js +3 -2
- package/dist/core/runner/prepare-inherited-gate.d.ts +9 -6
- package/dist/core/runner/prepare-inherited-gate.js +7 -8
- package/dist/core/runner/prepare-listings.d.ts +3 -3
- package/dist/core/runner/prepare-lsp.d.ts +3 -3
- package/dist/core/runner/prepare-memory-engine-session.d.ts +5 -5
- package/dist/core/runner/prepare-memory.d.ts +4 -6
- package/dist/core/runner/prepare-memory.js +10 -9
- package/dist/core/runner/prepare-offload-wrappers.d.ts +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +6 -6
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -7
- package/dist/core/runner/prepare-policy-chain.js +15 -30
- package/dist/core/runner/prepare-prompt-assembly.js +1 -1
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -5
- package/dist/core/runner/prepare-protocol-tools.d.ts +1 -1
- package/dist/core/runner/prepare-question-face.d.ts +4 -4
- package/dist/core/runner/prepare-run-refs.d.ts +11 -11
- package/dist/core/runner/prepare-safety-scan.d.ts +2 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -4
- package/dist/core/runner/prepare-suspend-saga.js +0 -2
- package/dist/core/runner/prepare-task.d.ts +12 -12
- package/dist/core/runner/prepare-task.js +10 -9
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +2 -3
- package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -4
- package/dist/core/runner/prepare-wiring-manifest.js +9 -7
- package/dist/core/runner/prepare-workspace-restore.d.ts +1 -1
- package/dist/core/runner/remote-env-retry.d.ts +3 -3
- package/dist/core/runner/resume-admission.d.ts +1 -1
- package/dist/core/runner/resume-admission.js +2 -1
- package/dist/core/runner/resume-claim.d.ts +1 -1
- package/dist/core/runner/resume-internals-and-config.d.ts +1 -1
- package/dist/core/runner/resume-internals-and-config.js +4 -0
- package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
- package/dist/core/runner/resume-preflight.d.ts +1 -1
- package/dist/core/runner/resume-review-outcome.d.ts +1 -1
- package/dist/core/runner/retired-runner-deps.d.ts +3 -0
- package/dist/core/runner/retired-runner-deps.js +7 -0
- package/dist/core/runner/run-brain-sinks.d.ts +1 -1
- package/dist/core/runner/run-clock-and-content.d.ts +4 -4
- package/dist/core/runner/run-compaction-machinery.d.ts +3 -3
- package/dist/core/runner/run-git-lane.d.ts +1 -1
- package/dist/core/runner/run-harness-handlers.d.ts +2 -2
- package/dist/core/runner/run-harness-handlers.js +2 -3
- package/dist/core/runner/run-identity-wiring.d.ts +4 -4
- package/dist/core/runner/run-leg.d.ts +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +2 -2
- package/dist/core/runner/run-reasoning-seat.d.ts +2 -2
- package/dist/core/runner/run-settle-and-teardown.d.ts +5 -5
- package/dist/core/runner/run-settle-and-teardown.js +3 -1
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +2 -2
- package/dist/core/runner/run-terminal-adoption.d.ts +5 -5
- package/dist/core/runner/runtask.d.ts +14 -14
- package/dist/core/runner/session-file-state-replay.d.ts +3 -3
- package/dist/core/runner/session-file-state-replay.js +3 -3
- package/dist/core/runner/session-rule-policy.d.ts +2 -2
- package/dist/core/runner/session-rule-policy.js +3 -4
- package/dist/core/runner/steer-admission.d.ts +2 -2
- package/dist/core/runner/stream-halt-verbs.d.ts +1 -1
- package/dist/core/runner/stream-halt-verbs.js +1 -1
- package/dist/core/runner/stream-reap.d.ts +1 -1
- package/dist/core/runner/stream-steer-verb.js +1 -4
- package/dist/core/runner/synthetic-tools.d.ts +8 -8
- package/dist/core/runner/teardown-bounded.d.ts +2 -2
- package/dist/core/runner/tool-defer-gate.d.ts +1 -1
- package/dist/core/runner/tool-disclosure.d.ts +33 -33
- package/dist/core/runner/tool-end-body.d.ts +3 -3
- package/dist/core/runner/tool-face-overlay.d.ts +2 -2
- package/dist/core/runner/tool-output-projection.d.ts +2 -2
- package/dist/core/runner/turn-attachments.d.ts +53 -53
- package/dist/core/runner/usage-accounting.d.ts +4 -4
- package/dist/core/runner/workspace-path.d.ts +1 -1
- package/dist/core/runner/workspace-path.js +3 -0
- package/dist/core/runner-deps.d.ts +30 -49
- package/dist/core/safe-notify.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +4 -4
- package/dist/core/session.d.ts +2 -2
- package/dist/core/skill-tool-specifier.d.ts +1 -1
- package/dist/core/skills-directory.d.ts +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +1 -1
- package/dist/core/strategy-store.d.ts +8 -11
- package/dist/core/task-event.d.ts +20 -17
- package/dist/core/task-limits.d.ts +1 -1
- package/dist/core/task-notification.d.ts +5 -5
- package/dist/core/task-registry-agent.d.ts +5 -5
- package/dist/core/task-registry-monitor.d.ts +2 -2
- package/dist/core/task-registry-shared.d.ts +27 -27
- package/dist/core/task-registry-shared.js +3 -13
- package/dist/core/task-registry.d.ts +8 -8
- package/dist/core/task-result.d.ts +37 -37
- package/dist/core/task-spec.d.ts +5 -5
- package/dist/core/task-stream.d.ts +16 -11
- package/dist/core/tool-catalog-entries.d.ts +1 -0
- package/dist/core/tool-catalog-entries.js +5 -0
- package/dist/core/tool-conformance.d.ts +0 -2
- package/dist/core/tool-conformance.js +1 -3
- package/dist/core/tool-errors.d.ts +5 -0
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-policy.d.ts +51 -22
- package/dist/core/tool-policy.js +28 -5
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +11 -11
- package/dist/core/tool-spec.d.ts +34 -38
- package/dist/core/tools.d.ts +2 -2
- package/dist/core/trace.d.ts +12 -15
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +4 -3
- package/dist/core/workflow-journal-store.d.ts +11 -11
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -2
- package/dist/engine/execution-env/node-execution-env.js +4 -2
- package/dist/engine/harness/agent-harness.d.ts +47 -4
- package/dist/engine/harness/agent-harness.js +52 -9
- package/dist/engine/llm/types.d.ts +1 -1
- package/dist/engine/loop/agent-loop.js +15 -8
- package/dist/engine/loop/types.d.ts +5 -0
- package/dist/index.d.ts +21 -16
- package/dist/index.js +17 -12
- package/dist/internal/harness.d.ts +1 -0
- package/dist/orchestration/run-spec.d.ts +3 -0
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +12 -6
- package/dist/orchestration/run-workflow-tool.js +23 -5
- package/dist/orchestration/workflow-primitives.d.ts +4 -2
- package/dist/orchestration/workflow-primitives.js +1 -4
- package/dist/orchestration/workflow-types.d.ts +34 -4
- package/dist/orchestration/workflow-types.js +2 -0
- package/dist/orchestration/workflow.d.ts +39 -7
- package/dist/orchestration/workflow.js +234 -113
- package/dist/prompt-assembly/assemble.d.ts +2 -2
- package/dist/prompt-assembly/assemble.js +9 -9
- package/dist/prompt-assembly/composer.d.ts +6 -7
- package/dist/prompt-assembly/composer.js +10 -10
- package/dist/prompt-assembly/epoch.js +1 -1
- package/dist/prompt-assembly/event-registry.d.ts +0 -21
- package/dist/prompt-assembly/packs/sema-default.js +30 -30
- package/dist/prompt-assembly/types.d.ts +14 -14
- package/dist/prompts/coordinator.d.ts +0 -13
- package/dist/prompts/coordinator.js +0 -3
- package/dist/stores/file/checkpoint-store.js +1 -5
- package/dist/stores/file/file-history-store.js +2 -2
- package/dist/stores/file/permission-rule-store.d.ts +4 -35
- package/dist/stores/file/permission-rule-store.js +4 -148
- package/dist/tools/artifact/artifact-text.d.ts +62 -0
- package/dist/tools/artifact/artifact-text.js +68 -0
- package/dist/tools/artifact/artifact-tool.d.ts +52 -0
- package/dist/tools/artifact/artifact-tool.js +351 -0
- package/dist/tools/artifact/local-stub.d.ts +26 -0
- package/dist/tools/artifact/local-stub.js +296 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +114 -48
- package/dist/tools/fs/bash-readonly-classifier.js +171 -60
- package/dist/tools/fs/encoding.d.ts +31 -40
- package/dist/tools/fs/fs-bash.d.ts +49 -45
- package/dist/tools/fs/fs-bash.js +19 -27
- package/dist/tools/fs/fs-pdf.d.ts +8 -8
- package/dist/tools/fs/fs-search-tools.d.ts +4 -4
- package/dist/tools/fs/fs-search-tools.js +5 -2
- package/dist/tools/fs/fs-shared.d.ts +146 -158
- package/dist/tools/fs/fs-shared.js +3 -11
- package/dist/tools/fs/fs-write.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +13 -14
- package/dist/tools/fs/index.d.ts +78 -78
- package/dist/tools/fs/index.js +4 -1
- package/dist/tools/fs/notebook.d.ts +24 -25
- package/dist/tools/fs/pdf.d.ts +3 -3
- package/dist/tools/fs/read-deny.d.ts +22 -22
- package/dist/tools/fs/read-face.d.ts +21 -24
- package/dist/tools/fs/repo-map.d.ts +8 -8
- package/dist/tools/fs/safety.d.ts +233 -130
- package/dist/tools/fs/safety.js +131 -31
- package/dist/tools/fs/search.d.ts +63 -71
- package/dist/tools/fs/search.js +8 -6
- package/package.json +6 -2
- package/test/export-surface.snapshot.json +119 -39
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* gh rate-limit hint (CC 2.1.198 parity
|
|
2
|
+
* gh rate-limit hint (CC 2.1.198 parity).
|
|
3
3
|
*
|
|
4
4
|
* CC appends a one-shot <system-reminder> to a FOREGROUND Bash result when a `gh` invocation hits the
|
|
5
|
-
* GitHub API rate limit, so the model sleeps/schedules instead of hammering retries.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* sema's wait primitive is the Monitor tool, so the clause is adapted — everything else is verbatim.
|
|
5
|
+
* GitHub API rate limit, so the model sleeps/schedules instead of hammering retries. The command gate,
|
|
6
|
+
* output gate and 60s throttle below are ported verbatim; a detached/background task is never hinted.
|
|
7
|
+
* Registered delta: CC's closing clause names its ScheduleWakeup tool; sema's wait primitive is the
|
|
8
|
+
* Monitor tool, so that clause is adapted — everything else is verbatim.
|
|
10
9
|
*/
|
|
11
|
-
/** Test seam: reset the process-wide throttle window (mirrors CC's module-level
|
|
10
|
+
/** Test seam: reset the process-wide throttle window (mirrors CC's module-level timestamp). */
|
|
12
11
|
export declare function resetGhRateLimitHintThrottleForTests(): void;
|
|
13
12
|
/**
|
|
14
13
|
* Returns the rate-limit reminder when `command` is a real gh call AND `output` shows a rate-limit
|
|
15
14
|
* error AND the 60s throttle window is open; otherwise undefined. Callers attach it to FOREGROUND
|
|
16
15
|
* Bash results only (CC gates on `backgroundTaskId` — a detached/background task is never hinted).
|
|
17
16
|
*
|
|
18
|
-
* `monitorToolActive
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* `monitorToolActive`: the closing clause teaches the Monitor tool, but Monitor is mounted by the
|
|
18
|
+
* Runner (`backgroundTaskToolsActive`), not by the Bash tool — under handsReadOnly or a background-less
|
|
19
|
+
* env the taught tool is not on the roster. `false` drops exactly that clause (the sleep-until-reset
|
|
20
|
+
* advice stays); absent/`true` keeps the full wording, so an uninformed caller gets the byte-identical
|
|
21
|
+
* sentence rather than a silent rewrite.
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* `mark`: the session's reminder provenance mark, stamped on the open tag by the mint home (body bytes
|
|
24
|
+
* unchanged; absent ⇒ bare tag).
|
|
26
25
|
*/
|
|
27
26
|
export declare function ghRateLimitHint(command: string, output: string, now?: number, monitorToolActive?: boolean, mark?: string): string | undefined;
|
package/dist/tools/fs/index.d.ts
CHANGED
|
@@ -17,34 +17,34 @@ export * from "./read-face.js";
|
|
|
17
17
|
import { type CwdRef, type ReadImageDownsamplerOption } from "./fs-shared.js";
|
|
18
18
|
/** Options for {@link createHandsToolkit}. */
|
|
19
19
|
export interface HandsToolkitOptions {
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
/** CC --add-dir parity: extra allowed containment roots (canonical). Widens file-tool containment
|
|
21
|
+
* only; the primary root keeps the cwd/base role. The full `bash` (effect:write) is NOT constrained
|
|
22
|
+
* by these — it is deliberately unsandboxed and only uses them for its post-`cd` disclosure note.
|
|
23
|
+
* `bash_readonly` IS constrained by them (that face refuses a read outside the roots), so widening
|
|
24
|
+
* here widens what the read-only band may read. */
|
|
25
25
|
additionalRoots?: readonly string[];
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
26
|
+
/** The read-boundary whitelist: extra allowed containment roots for the READ faces only —
|
|
27
|
+
* read_file/grep/glob/repo_map and `bash_readonly` admit them; edit_file/write_file/notebook_edit
|
|
28
|
+
* and the full `bash`'s disclosure roots deliberately do NOT (widening reads must never silently
|
|
29
|
+
* widen writes). Caveat, the same tradeoff `additionalRoots` states:
|
|
30
|
+
* `bash_readonly`'s COMMAND allowlist is a deployment declaration — a
|
|
31
31
|
* deployment that puts a mutating command into `bashReadonlyAllow` has declared it read-safe,
|
|
32
32
|
* and that declaration applies inside every root, these included. Keep the allowlist genuinely
|
|
33
33
|
* non-mutating if these roots must stay read-only through the shell face too. */
|
|
34
34
|
additionalReadRoots?: readonly string[];
|
|
35
35
|
/** Mount a shell tool. Pass false for an env without a real shell (e.g. `StubExecutionEnv`) so a bash
|
|
36
|
-
* tool that can only error never reaches the model
|
|
36
|
+
* tool that can only error never reaches the model. Default false. */
|
|
37
37
|
includeShell?: boolean;
|
|
38
|
-
/** Verifier read-only boundary
|
|
38
|
+
/** Verifier read-only boundary: mount ONLY effect:read hand tools — read_file/grep/glob
|
|
39
39
|
* (+ `bash_readonly` when `includeShell`). Drops edit_file/write_file and the full `bash`. Default false. */
|
|
40
40
|
readOnly?: boolean;
|
|
41
41
|
/** Override the `bash_readonly` command allowlist (default {@link BASH_READONLY_DEFAULT_ALLOW}). */
|
|
42
42
|
bashReadonlyAllow?: readonly string[];
|
|
43
|
-
/** Commit-message attribution trailer for the `bash` git protocol
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
/** Commit-message attribution trailer for the `bash` git protocol. Default NONE — attribution is a
|
|
44
|
+
* deployment identity asset, so the branded deployment sets it; pass `"Name <email>"` to advertise
|
|
45
|
+
* one, `false` (≡ unset) for no trailer section. */
|
|
46
46
|
commitCoAuthor?: string | false;
|
|
47
|
-
/**
|
|
47
|
+
/** The caller's own {@link CwdRef} to track this task's logical cwd, instead of one
|
|
48
48
|
* created internally. The Runner passes its own so it can OBSERVE `cd` moves (`cwdRef.current` changes)
|
|
49
49
|
* and emit a `workspace_changed` event. Ignored in `readOnly` mode (no `cd`). Default: a fresh ref at root. */
|
|
50
50
|
cwdRef?: CwdRef;
|
|
@@ -53,56 +53,55 @@ export interface HandsToolkitOptions {
|
|
|
53
53
|
/** Runner-owned owner/scope fallback used when a tool execute context is unavailable in tests. */
|
|
54
54
|
taskOwner?: string;
|
|
55
55
|
taskScope?: string;
|
|
56
|
-
/**
|
|
56
|
+
/** See createBashTool's taskOpts.sessionId: session-resident background commands. */
|
|
57
57
|
sessionId?: string;
|
|
58
58
|
/** Mount TaskOutput/TaskStop directly from this band. Runner sets false and mounts the unified dispatcher once. */
|
|
59
59
|
mountBackgroundTaskTools?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
60
|
+
/** Completion-notification sink for finished background commands (threaded to createBashTool's
|
|
61
|
+
* onTaskNotification; the Runner wires the run-local injection lane here). */
|
|
62
62
|
taskNotification?: (n: import("../../core/task-notification.js").TaskNotificationPayload, opts?: {
|
|
63
63
|
priority?: "now" | "next" | "later";
|
|
64
64
|
}) => void;
|
|
65
|
-
/**
|
|
65
|
+
/** The run-local per-tool-call detach hub (mid-flight ctrl+b → adopt as background). */
|
|
66
66
|
detachHub?: import("../../core/tool-detach.js").ToolDetachHub;
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
67
|
+
/** The Bash `timeout` parameter's DEFAULT budget, in ms — applied when the model omits `timeout`.
|
|
68
|
+
* Resolution (options over env over constant — the standing sema discipline: deployments configure
|
|
69
|
+
* the tool, not the process): this field ?? env `BASH_DEFAULT_TIMEOUT_MS` ?? 120000; invalid
|
|
70
|
+
* (non-finite / <= 0) values are discarded at every leg. See
|
|
71
71
|
* {@link import("./fs-shared.js").resolveBashTimeoutCaps} — the SAME resolver renders the tool
|
|
72
|
-
* description, so the advertised numbers always match the enforced ones.
|
|
73
|
-
*
|
|
72
|
+
* description, so the advertised numbers always match the enforced ones. Absent ⇒ 120s. Applies to
|
|
73
|
+
* both shell legs (`bash` and `bash_readonly`). */
|
|
74
74
|
bashDefaultTimeoutMs?: number;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
75
|
+
/** The Bash `timeout` parameter's engine CEILING, in ms — requests above it are clamped (the
|
|
76
|
+
* requested/capped disclosure names THIS value). Resolution: (this field ?? env
|
|
77
|
+
* `BASH_MAX_TIMEOUT_MS` ?? 600000), then floored at the resolved default — CC's own only-widen
|
|
78
|
+
* semantic: a ceiling below the default is a narrowing intent = invalid, ignored in favor of the
|
|
79
|
+
* default. Absent ⇒ 600s. */
|
|
80
80
|
bashMaxTimeoutMs?: number;
|
|
81
81
|
/** Structured sink for the timeout-cap discard announcements both shell legs emit at mount (see
|
|
82
82
|
* {@link import("../../core/types.js").EngineNotice} / `RunnerDeps.onNotice`). Wired, it REPLACES
|
|
83
83
|
* their `console.warn` line (a forwarding host must not show every fact twice); absent, the
|
|
84
|
-
* console line prints verbatim (
|
|
84
|
+
* console line prints verbatim (last-resort loudness). Threaded per toolkit build — never a
|
|
85
85
|
* global. */
|
|
86
86
|
onNotice?: (n: import("../../core/types.js").EngineNotice) => void;
|
|
87
|
-
/**
|
|
88
|
-
*
|
|
87
|
+
/** See createBashTool's taskOpts.oneShot / createTaskOutputTool's TaskToolOptions.oneShot for the
|
|
88
|
+
* full contract: this run has no later turn for an async background notification to land in.
|
|
89
89
|
* Threaded to both the Bash background-launch receipt and (when this band mounts TaskOutput itself,
|
|
90
|
-
* `mountBackgroundTaskTools: true`) the TaskOutput poll receipt. Absent ⇒
|
|
91
|
-
* pre-RB-220 wording). */
|
|
90
|
+
* `mountBackgroundTaskTools: true`) the TaskOutput poll receipt. Absent ⇒ the unbranched wording. */
|
|
92
91
|
oneShot?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* opt-in) — NOT from `detachHub`/`taskRegistry` merely being present, which are wired unconditionally
|
|
96
|
-
* the Runner for every task and so cannot double as an opt-in signal. Default undefined ⇒ `false`
|
|
97
|
-
* downstream
|
|
92
|
+
/** CC `Zry`/`WZi.#m` parity: see createBashTool's taskOpts field of the same name for the full
|
|
93
|
+
* contract. Threaded from {@link HandsBandOptions.autoBackgroundOnTimeout} (a deployment-level
|
|
94
|
+
* opt-in) — NOT from `detachHub`/`taskRegistry` merely being present, which are wired unconditionally
|
|
95
|
+
* by the Runner for every task and so cannot double as an opt-in signal. Default undefined ⇒ `false`
|
|
96
|
+
* downstream. */
|
|
98
97
|
autoBackgroundOnTimeout?: boolean;
|
|
99
|
-
/**
|
|
98
|
+
/** Read-image downsampler seam ({@link ReadImageDownsamplerOption}). Default undefined = auto-detect
|
|
100
99
|
* the optional sharp dependency once per process; `false` disables it (deterministic no-sharp behavior). */
|
|
101
100
|
readImageDownsampler?: ReadImageDownsamplerOption;
|
|
102
|
-
/** PDF degradation chain
|
|
101
|
+
/** PDF degradation chain: the SERVING model's PDF capability profile (prepare-task derives it via
|
|
103
102
|
* {@link import("./fs-pdf.js").pdfModelCapabilitiesOf}). A model without native document input gets pdftotext text extraction →
|
|
104
103
|
* rendered page images (vision) → an honest placeholder, instead of a brain-level placeholder. Default
|
|
105
|
-
* undefined = fully capable (
|
|
104
|
+
* undefined = fully capable (native document block). */
|
|
106
105
|
pdfModelCapabilities?: PdfModelCapabilities;
|
|
107
106
|
/** Append the per-read content-safety reminder after a successful text read
|
|
108
107
|
* ({@link import("./fs-shared.js").readCyberReminderText}). Default TRUE — a BYOM deployment cannot
|
|
@@ -112,10 +111,10 @@ export interface HandsToolkitOptions {
|
|
|
112
111
|
* exemption gate the upstream 88 source had around the same mechanism (see readCyberReminderText's note
|
|
113
112
|
* for the full attribution). Absent ⇒ appended. */
|
|
114
113
|
readCyberReminder?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
114
|
+
/** Write-time content gate for Write/Edit/NotebookEdit (see {@link BeforeWriteHook}). The Runner
|
|
115
|
+
* wires the MemoryEngine's memory-domain scan here; absent ⇒ byte-identical behavior. */
|
|
117
116
|
beforeWrite?: BeforeWriteHook;
|
|
118
|
-
/**
|
|
117
|
+
/** First-touch file-history hook for Write/Edit/NotebookEdit (see
|
|
119
118
|
* {@link TrackFileEditHook}): called after the content gates pass, immediately before the final
|
|
120
119
|
* env write, so the file's pre-edit state is durably recorded before it changes. The Runner
|
|
121
120
|
* wires it to `FileHistoryStore.trackEdit`; absent ⇒ byte-identical behavior (no history). */
|
|
@@ -126,54 +125,51 @@ export interface HandsToolkitOptions {
|
|
|
126
125
|
* Purely additive: it cannot refuse a write, and a fault in it is contained in both shapes (a
|
|
127
126
|
* synchronous throw and a rejected promise), neither of them awaited. */
|
|
128
127
|
onFileEdited?: FileEditedHook;
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
128
|
+
/** See createBashTool's taskOpts field of the same name: whether the Monitor tool is on this run's
|
|
129
|
+
* roster (the Runner mounts Monitor, this band never does). `false` drops the gh rate-limit hint's
|
|
130
|
+
* Monitor clause; absent ⇒ the full wording. */
|
|
132
131
|
monitorToolActive?: boolean;
|
|
133
|
-
/**
|
|
132
|
+
/** ADDITIONS to the built-in sensitive-path READ deny set
|
|
134
133
|
* ({@link import("./read-deny.js").READ_FACE_DEFAULT_DENY_ENTRIES}), judged by the structured read
|
|
135
134
|
* faces (Read/Grep/Glob/RepoMap and their traversals) in BOTH containment modes. Add-only:
|
|
136
135
|
* additions union with the active built-ins, `[]` ≡ absent (union identity), and additions can
|
|
137
136
|
* never remove a built-in — the one removal channel is the deployment's built-in configuration
|
|
138
|
-
* ({@link readDenyBuiltinTiers} / {@link readDenyBuiltinExclude}
|
|
139
|
-
*
|
|
140
|
-
* createSensitivePathPolicy). */
|
|
137
|
+
* ({@link readDenyBuiltinTiers} / {@link readDenyBuiltinExclude}). Bad entry shapes throw at wiring
|
|
138
|
+
* time. The write faces are untouched (their guard is createSensitivePathPolicy). */
|
|
141
139
|
readDenyPatterns?: readonly ReadDenyEntry[];
|
|
142
|
-
/**
|
|
140
|
+
/** The deployment's built-in-table TIER selection ({@link import("./read-deny.js").ReadDenyBuiltinConfig}
|
|
143
141
|
* `tiers` key): EXACTLY the listed tiers of {@link import("./read-deny.js").READ_FACE_BUILTIN_DENY_TABLE}
|
|
144
142
|
* are active (`[]` = none — explicit and legal); absent = the default selection
|
|
145
143
|
* ({@link import("./read-deny.js").READ_DENY_DEFAULT_TIERS} — every tier except `shell-history`).
|
|
146
144
|
* Composes with {@link readDenyBuiltinExclude} (tier selection first, then row removal) and never
|
|
147
|
-
* touches the additions seats. Unknown tier names throw at wiring time
|
|
148
|
-
*
|
|
145
|
+
* touches the additions seats. Unknown tier names throw at wiring time. Deployment seat ONLY —
|
|
146
|
+
* deliberately not a TaskSpec key, so no task can widen below its deployment. */
|
|
149
147
|
readDenyBuiltinTiers?: readonly string[];
|
|
150
|
-
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* argument as the tiers key. */
|
|
148
|
+
/** Per-row removal from the built-in table by STABLE NAME (= the row's canonical pattern text, e.g.
|
|
149
|
+
* `".ssh"`, `".config/gcloud"`), applied after {@link readDenyBuiltinTiers} selection. Naming a row
|
|
150
|
+
* of an inactive tier is a satisfied intent (no-op); a name matching NO table row throws at wiring
|
|
151
|
+
* time (never silently ignored). Deployment seat ONLY, same clamp argument as the tiers key. */
|
|
155
152
|
readDenyBuiltinExclude?: readonly string[];
|
|
156
|
-
/**
|
|
153
|
+
/** The READ-face containment state for the structured read faces
|
|
157
154
|
* ({@link import("./read-face.js").ReadFace}; resolved through the SAME
|
|
158
155
|
* {@link import("./read-face.js").resolveReadFace} order prepare-task uses). Absent ⇒ the
|
|
159
|
-
* resolution order's default = "roots" (
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* predated the 96ef89d seat distinction). Never affects the write faces. */
|
|
156
|
+
* resolution order's default = "roots" (the engine never opens implicitly). "open" skips ONLY the
|
|
157
|
+
* roots containment judgment — the deny set, the UNC out-of-set refusal and the special-file type
|
|
158
|
+
* gates run in both faces. Beside `readOnly: true` the mount wins: this seat is deps-shaped (a
|
|
159
|
+
* deployment default, not a per-call assertion), so its "open" CLAMPS to "roots" and the clamp is
|
|
160
|
+
* ANNOUNCED (`config.read_face_deployment_clamped`, through `onNotice` / `console.warn`) — the loud
|
|
161
|
+
* refusal belongs to the TASK seat (`TaskSpec.readFace`), the one genuine per-call contradiction.
|
|
162
|
+
* Never affects the write faces. */
|
|
167
163
|
readFace?: "open" | "roots";
|
|
168
|
-
/**
|
|
164
|
+
/** The session's reminder provenance mark: the band's engine-minted
|
|
169
165
|
* `<system-reminder>` open tags (the Read cyber/dedup/offset/empty reminders and the gh
|
|
170
166
|
* rate-limit hint) carry it as `mark="…"`, matching the system-prompt declaration the Runner
|
|
171
167
|
* renders for the same session. Threaded by prepare-task; a library-direct mount that omits it
|
|
172
|
-
* keeps
|
|
173
|
-
*
|
|
174
|
-
*
|
|
168
|
+
* keeps bare tags — with no declaration in its prompt, a bare tag is the honest form. The tag is
|
|
169
|
+
* rendered by the mint home (core/reminder-mint.ts) — the content BODY next to it is
|
|
170
|
+
* byte-untouched. */
|
|
175
171
|
reminderMark?: string;
|
|
176
|
-
/**
|
|
172
|
+
/** The per-run trailer/defuse trigger counters (observation seat):
|
|
177
173
|
* the Read text/notebook/PDF-text disclosure trailers bump `read.*` / `notebook.*` / `pdf.*`
|
|
178
174
|
* keys here. The form suffixes are enumerated once, on the consumer-facing contract
|
|
179
175
|
* (`TaskResult.stats.mechanisms.reminderDisclosures` in core/types.ts) — this map is the same
|
|
@@ -183,11 +179,15 @@ export interface HandsToolkitOptions {
|
|
|
183
179
|
* is off anyway when `reminderMark` is absent). */
|
|
184
180
|
reminderDisclosureCounts?: import("../../core/reminder-disclosure.js").ReminderDisclosureCounts;
|
|
185
181
|
}
|
|
182
|
+
/** Whether the band's WRITE half (Edit / Write / NotebookEdit, and the full `bash`) mounts for these options — the ONE
|
|
183
|
+
* predicate {@link createHandsToolkit} branches on and prepare-task plans by (the memory phase must know, before the
|
|
184
|
+
* band exists, whether the instruction-taught write channel will be there). `readOnly` is the verifier boundary. */
|
|
185
|
+
export declare function handsWriteHalfMounts(opts: Pick<HandsToolkitOptions, "readOnly">): boolean;
|
|
186
186
|
/**
|
|
187
|
-
* Build the per-task hand tool band over an injected env + fresh per-task read state
|
|
187
|
+
* Build the per-task hand tool band over an injected env + fresh per-task read state.
|
|
188
188
|
* `rootCanonical` is the already-canonicalized containment root (prepare-task resolves it once). Normal
|
|
189
189
|
* mode mounts read/edit/write/grep/glob (+`bash` when `includeShell`); `readOnly` mode mounts only the
|
|
190
190
|
* effect:read tools read/grep/glob (+`bash_readonly` when `includeShell`) — the verifier boundary. Subset
|
|
191
|
-
* selection beyond that is the caller's job via the
|
|
191
|
+
* selection beyond that is the caller's job via the tool-filter.
|
|
192
192
|
*/
|
|
193
193
|
export declare function createHandsToolkit(env: ExecutionEnv, readFileState: ReadFileState, rootCanonical: string, opts?: HandsToolkitOptions): AgentTool[];
|
package/dist/tools/fs/index.js
CHANGED
|
@@ -21,6 +21,9 @@ import { createReadFileTool } from "./fs-read.js";
|
|
|
21
21
|
import { createEditFileTool, createWriteFileTool, createNotebookEditTool } from "./fs-write.js";
|
|
22
22
|
import { createGrepTool, createGlobTool } from "./fs-search-tools.js";
|
|
23
23
|
import { createBashTool, createBashReadonlyTool, createEnvTaskOutputTool, createEnvTaskStopTool } from "./fs-bash.js";
|
|
24
|
+
export function handsWriteHalfMounts(opts) {
|
|
25
|
+
return opts.readOnly !== true;
|
|
26
|
+
}
|
|
24
27
|
export function createHandsToolkit(env, readFileState, rootCanonical, opts = {}) {
|
|
25
28
|
const { includeShell = false, readOnly = false, bashReadonlyAllow, commitCoAuthor = false, mountBackgroundTaskTools = true, additionalRoots, additionalReadRoots, } = opts;
|
|
26
29
|
const readFaceRoots = additionalReadRoots === undefined || additionalReadRoots.length === 0
|
|
@@ -49,7 +52,7 @@ export function createHandsToolkit(env, readFileState, rootCanonical, opts = {})
|
|
|
49
52
|
const tools = [
|
|
50
53
|
createReadFileTool(env, readFileState, rootCanonical, readOnly ? undefined : cwdRef, readFaceRoots, opts.readImageDownsampler, opts.pdfModelCapabilities, bgOutputReadExemption, opts.readCyberReminder, readDeny, readFace, opts.reminderMark, opts.reminderDisclosureCounts),
|
|
51
54
|
];
|
|
52
|
-
if (
|
|
55
|
+
if (handsWriteHalfMounts({ readOnly })) {
|
|
53
56
|
tools.push(createEditFileTool(env, readFileState, rootCanonical, cwdRef, additionalRoots, opts.beforeWrite, opts.trackFileEdit, opts.onFileEdited), createWriteFileTool(env, readFileState, rootCanonical, cwdRef, additionalRoots, opts.beforeWrite, opts.trackFileEdit, opts.onFileEdited), createNotebookEditTool(env, readFileState, rootCanonical, cwdRef, additionalRoots, opts.beforeWrite, opts.trackFileEdit, opts.onFileEdited));
|
|
54
57
|
}
|
|
55
58
|
tools.push(createGrepTool(env, rootCanonical, readFaceRoots, readDeny, readFace, cwdRef), createGlobTool(env, rootCanonical, readFaceRoots, readDeny, readFace, cwdRef), createRepoMapTool(env, rootCanonical, readFaceRoots, readDeny, readFace));
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { ImageContent } from "../../internal/llm.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* pointing at a range that itself exceeds the cap (the base64 lives on one mega-line).
|
|
3
|
+
* The Read tool's Jupyter-notebook projection: `.ipynb` is rendered as cells with outputs (CC 2.1.220
|
|
4
|
+
* parity), never as raw JSON text. Raw-JSON rendering lets a notebook's base64 outputs overflow the
|
|
5
|
+
* Read token cap, auto-paginate into an `isPartialView` entry, and thereby lock NotebookEdit out via
|
|
6
|
+
* the requireRead gate — with the marker's own offset/limit hint pointing at a range that itself
|
|
7
|
+
* exceeds the cap (the base64 lives on one mega-line). That is the failure mode this lane removes.
|
|
9
8
|
*
|
|
10
9
|
* Pure module (no I/O, no env): index.ts owns reading/decoding/state; this owns parse + render.
|
|
11
10
|
*/
|
|
12
|
-
/** CC
|
|
11
|
+
/** CC `o3r` parity: extname === ".ipynb". */
|
|
13
12
|
export declare function isNotebookPath(p: string): boolean;
|
|
14
|
-
/** CC
|
|
13
|
+
/** CC `Jx_` = 1e4: PER-CELL cap on the summed output payload (text chars + image
|
|
15
14
|
* base64 chars). A cell over it has its ENTIRE outputs array replaced by one pointer line —
|
|
16
15
|
* per cell, never a running global budget (CC's `Xx_` accumulator restarts for every cell). */
|
|
17
16
|
export declare const NOTEBOOK_CELL_OUTPUT_POINTER_CHARS = 10000;
|
|
@@ -20,12 +19,12 @@ export declare const NOTEBOOK_CELL_OUTPUT_POINTER_CHARS = 10000;
|
|
|
20
19
|
* text exceeds 10K is always pointered, so this clip is unreachable insurance kept at the same
|
|
21
20
|
* 10K yardstick (simplification of CC's two-stage clip, recorded deliberately). */
|
|
22
21
|
export declare const NOTEBOOK_OUTPUT_TEXT_CLIP = 10000;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
22
|
+
/** Cumulative image budget across the WHOLE notebook: the 10K per-cell pointer bounds one cell, but
|
|
23
|
+
* N cells × ~9KB images is unbounded. CC gets an implicit bound because image data counts toward its
|
|
24
|
+
* 256KB projected-JSON cap (`ePi` = 262144) and then HARD-ERRORS; sema reuses that same figure but as
|
|
25
|
+
* a DEGRADATION budget — images past it are dropped with an honest marker instead of making the
|
|
26
|
+
* notebook unreadable/uneditable, which is the failure mode this lane exists to remove.
|
|
27
|
+
* Divergence-logged. */
|
|
29
28
|
export declare const NOTEBOOK_IMAGE_BASE64_BUDGET = 262144;
|
|
30
29
|
export interface NotebookOutputImage {
|
|
31
30
|
/** Whitespace-stripped base64 (magic-validated — never an unverified blob, see `imageFromData`). */
|
|
@@ -40,9 +39,9 @@ export interface NotebookOutput {
|
|
|
40
39
|
export interface NotebookCell {
|
|
41
40
|
/** `cell.id`, or the synthesized `cell-${index}` for nbformat<4.5 — index = the UNFILTERED array
|
|
42
41
|
* position, because NotebookEdit's `/^cell-(\d+)$/` positional fallback resolves exactly that.
|
|
43
|
-
* Deliberate delta
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* Deliberate delta: sema synthesizes for any NON-STRING id (`typeof id === "string"` guard in
|
|
43
|
+
* `parseNotebookCells`) where CC's `wtd` uses `e.id ?? cell-${t}` and would render e.g. a numeric
|
|
44
|
+
* id literally — but NotebookEdit's id match is string-only, so
|
|
46
45
|
* CC's literal form would be un-addressable while sema's positional alias resolves; nbformat
|
|
47
46
|
* ids are spec-string, so this branch only fires on out-of-spec input. */
|
|
48
47
|
cell_id: string;
|
|
@@ -62,7 +61,7 @@ export type ParsedNotebook = {
|
|
|
62
61
|
reason: "json" | "shape";
|
|
63
62
|
};
|
|
64
63
|
/**
|
|
65
|
-
* CC `Ctd` + `wtd
|
|
64
|
+
* CC `Ctd` + `wtd`: parse the notebook JSON into the projected cell list.
|
|
66
65
|
* Failure is a typed reason, not a throw — the Read lane falls back to raw text on it (sema
|
|
67
66
|
* divergence from CC's hard error: a corrupt notebook stays readable so the model can see what is
|
|
68
67
|
* wrong; NotebookEdit still refuses it with its own JSON-validation errors, so nothing is loosened).
|
|
@@ -81,13 +80,13 @@ export interface NotebookRender {
|
|
|
81
80
|
imageChars: number;
|
|
82
81
|
}
|
|
83
82
|
/**
|
|
84
|
-
* CC `eI_`/`tI_`/`Atd
|
|
85
|
-
*
|
|
86
|
-
* `<
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* `
|
|
90
|
-
*
|
|
83
|
+
* CC `eI_`/`tI_`/`Atd`: render projected cells to content blocks. Tag shape is CC-verbatim, including
|
|
84
|
+
* the deliberately malformed closing tag `</cell id="X">`; `<cell_type>` only when not code,
|
|
85
|
+
* `<language>` only for code cells whose language !== "python". Output text rides with a leading "\n"
|
|
86
|
+
* and adjacent text blocks merge with "\n", so an all-text notebook collapses to a single text block.
|
|
87
|
+
* Images ride as real image blocks in sema's `{type:"image", data, mimeType}` shape, bounded by the
|
|
88
|
+
* cumulative `imageBase64Budget`: past it the image is DROPPED with an honest text marker — a
|
|
89
|
+
* degradation, never an error.
|
|
91
90
|
*/
|
|
92
91
|
export declare function renderNotebookCells(cells: readonly NotebookCell[], imageBase64Budget: number): NotebookRender;
|
|
93
92
|
/** Wire-card projection of a cell: base64 replaced by a length marker so the `details` card never
|
package/dist/tools/fs/pdf.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PDF read pipeline (
|
|
2
|
+
* PDF read pipeline (CC FileReadTool parity).
|
|
3
3
|
*
|
|
4
|
-
* CC ground truth (original
|
|
4
|
+
* CC ground truth (original source code):
|
|
5
5
|
* - Whole-PDF path (`FileReadTool.ts:987-1016` + `utils/pdf.ts:88-103`): the file bytes are base64'd and
|
|
6
6
|
* sent as a native `{type:"document",source:{type:"base64",media_type:"application/pdf",data}}` content
|
|
7
7
|
* block — the model reads the text layer directly (no local text extraction).
|
|
@@ -40,7 +40,7 @@ export declare function parsePdfPageRange(pages: string): PdfPageRange | undefin
|
|
|
40
40
|
* nothing matches (page tree inside compressed object streams — modern writers), NEVER a guess.
|
|
41
41
|
*/
|
|
42
42
|
export declare function countPdfPagesFromBytes(bytes: Uint8Array): number | undefined;
|
|
43
|
-
/** Max chars of a failed poppler call's stderr/stdout kept in the reported error
|
|
43
|
+
/** Max chars of a failed poppler call's stderr/stdout kept in the reported error. */
|
|
44
44
|
export declare const PDF_EXEC_ERROR_PREVIEW_CHARS = 400;
|
|
45
45
|
/** Bound a poppler exec failure's captured stream to {@link PDF_EXEC_ERROR_PREVIEW_CHARS}, marking the cut
|
|
46
46
|
* (a bare slice reads identical to a short capture that just happened to end there — the model has no way
|
|
@@ -60,9 +60,9 @@ export interface ReadDenyMatcher {
|
|
|
60
60
|
readonly rgProbeGlobs: readonly ReadDenyRgGlob[];
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* The closed set of built-in tiers
|
|
63
|
+
* The closed set of built-in tiers. A tier is the deployment's selection unit
|
|
64
64
|
* ({@link ReadDenyBuiltinConfig.tiers}); every {@link READ_FACE_BUILTIN_DENY_TABLE} row belongs to
|
|
65
|
-
* exactly one. Unknown tier names refuse loudly
|
|
65
|
+
* exactly one. Unknown tier names refuse loudly — this array is the validation source and the
|
|
66
66
|
* admin-face vocabulary, never re-spelled downstream.
|
|
67
67
|
*/
|
|
68
68
|
export declare const READ_DENY_BUILTIN_TIERS: readonly ["credentials", "shell-history", "browser", "wallet", "agent-config"];
|
|
@@ -78,12 +78,12 @@ export interface ReadDenyBuiltinRow {
|
|
|
78
78
|
readonly tier: ReadDenyBuiltinTier;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* READ_FACE_BUILTIN_DENY_TABLE — the FULL built-in table with tier metadata
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
* READ_FACE_BUILTIN_DENY_TABLE — the FULL built-in table with tier metadata: the material basis of
|
|
82
|
+
* the deployment admin face, what an org administrator "sees" before selecting tiers / excluding
|
|
83
|
+
* rows. Activation is a separate fact: the default face is the table under
|
|
84
84
|
* {@link READ_DENY_DEFAULT_TIERS} (shell-history rows exist here but are OFF by default).
|
|
85
85
|
* The dotenv family is deliberately NOT here — workspace `.env` files are working material for the
|
|
86
|
-
* tasks this engine runs
|
|
86
|
+
* tasks this engine runs; an `outside_workspace` tier is likewise deliberately absent.
|
|
87
87
|
*
|
|
88
88
|
* Each row states its tradeoff. Rows are matched as segment runs anywhere in the path, so a repo
|
|
89
89
|
* fixture spelled `fixtures/.ssh/id_rsa` is refused too — deliberate: the refusal names the pattern,
|
|
@@ -99,20 +99,20 @@ export interface ReadDenyBuiltinRow {
|
|
|
99
99
|
*
|
|
100
100
|
* agent-config tier — the agent's OWN configuration files whose `env` / server blocks carry API keys
|
|
101
101
|
* in cleartext (the shell's `settings.json` env block, a project `.mcp.json` server env, the engine
|
|
102
|
-
* host's data-root `.env`).
|
|
103
|
-
* tool result and therefore in the session record. Rows name FILES, not the config DIRECTORIES:
|
|
102
|
+
* host's data-root `.env`). Unguarded, a structured read of one of these lands the key verbatim in
|
|
103
|
+
* the tool result and therefore in the session record. Rows name FILES, not the config DIRECTORIES:
|
|
104
104
|
* `.sema`/`.claude` also hold agents, skills, hooks and (under the shell's layout,
|
|
105
105
|
* `~/.sema/engine-data`) the engine data root with the memory library — material the model reads
|
|
106
106
|
* and edits as ordinary work, and a directory-wide row would need a data-root passthrough (one more
|
|
107
107
|
* rule) to keep it readable. The write face guards the directories (`sensitive-path-policy.ts`): a
|
|
108
108
|
* write there is self-authorization; a read of a non-credential file there is debugging. Token
|
|
109
|
-
* STORES of the same tooling (`.credentials.json`,
|
|
109
|
+
* STORES of the same tooling (`.credentials.json`, an agent CLI's `auth.json`, …) are credentials rows, not
|
|
110
110
|
* agent-config rows: a deployment that switches this tier off to debug its agent configuration must
|
|
111
111
|
* not also expose the OAuth stores beside it.
|
|
112
112
|
*/
|
|
113
113
|
export declare const READ_FACE_BUILTIN_DENY_TABLE: readonly ReadDenyBuiltinRow[];
|
|
114
114
|
/**
|
|
115
|
-
* The DEFAULT tier selection
|
|
115
|
+
* The DEFAULT tier selection: every tier EXCEPT `shell-history` — history files are
|
|
116
116
|
* unrestricted unless a deployment opts the tier in. Derived, not re-listed: a tier added to the
|
|
117
117
|
* closed set is default-ON unless this expression is deliberately revisited (`agent-config` joined
|
|
118
118
|
* default-ON this way: an unconfigured deployment refuses the agent's own key-bearing settings files;
|
|
@@ -120,30 +120,30 @@ export declare const READ_FACE_BUILTIN_DENY_TABLE: readonly ReadDenyBuiltinRow[]
|
|
|
120
120
|
*/
|
|
121
121
|
export declare const READ_DENY_DEFAULT_TIERS: readonly ReadDenyBuiltinTier[];
|
|
122
122
|
/**
|
|
123
|
-
* The deployment's built-in-table configuration
|
|
123
|
+
* The deployment's built-in-table configuration — deployment seat ONLY (RunnerDeps /
|
|
124
124
|
* HandsToolkitOptions; deliberately NOT a TaskSpec key and NOT in the governed workflow whitelist,
|
|
125
125
|
* so no task or governed script can widen below its deployment).
|
|
126
126
|
* - `tiers` — EXACTLY-these tier selection: listed tiers are active, unlisted ones are not
|
|
127
127
|
* (`[]` = no built-in tiers at all — an explicit, legal posture; absent = {@link READ_DENY_DEFAULT_TIERS}).
|
|
128
128
|
* - `exclude` — per-row removal by canonical pattern name, applied AFTER tier selection.
|
|
129
|
-
* Unknown tier names / unknown row names refuse loudly
|
|
129
|
+
* Unknown tier names / unknown row names refuse loudly — never silently ignored.
|
|
130
130
|
*/
|
|
131
131
|
export interface ReadDenyBuiltinConfig {
|
|
132
132
|
tiers?: readonly string[];
|
|
133
133
|
exclude?: readonly string[];
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
* Resolve the ACTIVE built-in rows under a deployment configuration (validated, loud —
|
|
137
|
-
* bad-value states
|
|
136
|
+
* Resolve the ACTIVE built-in rows under a deployment configuration (validated, loud — all three
|
|
137
|
+
* bad-value states throw: garbage shapes, unknown tier names, unknown row names). The one
|
|
138
138
|
* resolution used by {@link compileReadDeny}; exported so an admin face can preview the effective
|
|
139
139
|
* table under a candidate configuration with the engine's own rules.
|
|
140
140
|
*/
|
|
141
141
|
export declare function resolveReadDenyBuiltins(config?: ReadDenyBuiltinConfig): readonly ReadDenyBuiltinRow[];
|
|
142
142
|
/**
|
|
143
143
|
* READ_FACE_DEFAULT_DENY_ENTRIES — the DEFAULT-ACTIVE built-in set: {@link READ_FACE_BUILTIN_DENY_TABLE}
|
|
144
|
-
* under {@link READ_DENY_DEFAULT_TIERS} (
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* under {@link READ_DENY_DEFAULT_TIERS} (shell-history rows are in the table, not in this face). This
|
|
145
|
+
* is the export for consumers rendering "what does an unconfigured deployment refuse"; the
|
|
146
|
+
* tier-annotated table is the admin-face export.
|
|
147
147
|
*/
|
|
148
148
|
export declare const READ_FACE_DEFAULT_DENY_ENTRIES: readonly ReadDenyEntry[];
|
|
149
149
|
/** A compiled segment-run pattern (shared engine — the write guard delegates here too). */
|
|
@@ -159,8 +159,8 @@ export interface CompiledSegmentPattern {
|
|
|
159
159
|
* · "ascii" — ASCII-case-insensitive (deny-set contract);
|
|
160
160
|
* · "unicode" — RegExp `i` flag (the write guard's historical host-keyed behavior — kept for it
|
|
161
161
|
* byte-identically; NOT used by the deny set).
|
|
162
|
-
* Returns null when the pattern reduces to zero segments — the CALLER owns its loud path (
|
|
163
|
-
*
|
|
162
|
+
* Returns null when the pattern reduces to zero segments — the CALLER owns its loud path (the two
|
|
163
|
+
* consumers refuse with their own surface-specific texts).
|
|
164
164
|
*/
|
|
165
165
|
export declare function compileSegmentPattern(raw: string, fold: "none" | "ascii" | "unicode"): CompiledSegmentPattern | null;
|
|
166
166
|
/**
|
|
@@ -185,10 +185,10 @@ export declare function persistedReadDenyEntryProblem(e: unknown): string | null
|
|
|
185
185
|
* Compile the read-face deny judge: ACTIVE built-in rows ∪ additions. Additions are add-only at every
|
|
186
186
|
* task layer (`[]` additions ≡ absent, deliberately a no-op rather than a refusal: an array API
|
|
187
187
|
* cannot observe a "replace" intent, and union-with-empty is the identity, not a silent fallback);
|
|
188
|
-
* the built-in half is selected by the DEPLOYMENT's `builtin` config (
|
|
189
|
-
*
|
|
188
|
+
* the built-in half is selected by the DEPLOYMENT's `builtin` config (absent = the default tier
|
|
189
|
+
* selection, see {@link resolveReadDenyBuiltins}). A deployment that turned a tier off can still
|
|
190
190
|
* re-add single patterns through the additions seats — they then ride as ordinary additions.
|
|
191
191
|
* Bad entry shapes / zero-segment patterns / unknown tier or row names throw loudly, naming the
|
|
192
|
-
* layer or knob
|
|
192
|
+
* layer or knob.
|
|
193
193
|
*/
|
|
194
194
|
export declare function compileReadDeny(additions?: readonly ReadDenyEntry[], layer?: string, builtin?: ReadDenyBuiltinConfig): ReadDenyMatcher;
|