@namzu/sdk 65.3.0 → 67.0.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 +153 -0
- package/dist/account/lock.d.ts +4 -12
- package/dist/account/lock.d.ts.map +1 -1
- package/dist/account/lock.js +5 -140
- package/dist/account/lock.js.map +1 -1
- package/dist/account/registry.d.ts.map +1 -1
- package/dist/account/registry.js +50 -6
- package/dist/account/registry.js.map +1 -1
- package/dist/account/types.d.ts +7 -5
- package/dist/account/types.d.ts.map +1 -1
- package/dist/account/types.js +6 -7
- package/dist/account/types.js.map +1 -1
- package/dist/authorization/dangerous-commands.d.ts +64 -0
- package/dist/authorization/dangerous-commands.d.ts.map +1 -0
- package/dist/authorization/dangerous-commands.js +479 -0
- package/dist/authorization/dangerous-commands.js.map +1 -0
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +19 -5
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/protected-paths.d.ts +11 -6
- package/dist/authorization/protected-paths.d.ts.map +1 -1
- package/dist/authorization/protected-paths.js +13 -8
- package/dist/authorization/protected-paths.js.map +1 -1
- package/dist/authorization/readonly-commands.d.ts +6 -1
- package/dist/authorization/readonly-commands.d.ts.map +1 -1
- package/dist/authorization/readonly-commands.js +35 -1
- package/dist/authorization/readonly-commands.js.map +1 -1
- package/dist/authorization/removal.d.ts +10 -0
- package/dist/authorization/removal.d.ts.map +1 -1
- package/dist/authorization/removal.js +7 -7
- package/dist/authorization/removal.js.map +1 -1
- package/dist/authorization/rules.d.ts +10 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +60 -14
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +10 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +15 -0
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/acp/permission.d.ts +5 -0
- package/dist/bridge/acp/permission.d.ts.map +1 -1
- package/dist/bridge/acp/permission.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +8 -1
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +48 -6
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/compaction/context-breakdown.d.ts +25 -6
- package/dist/compaction/context-breakdown.d.ts.map +1 -1
- package/dist/compaction/context-breakdown.js +27 -7
- package/dist/compaction/context-breakdown.js.map +1 -1
- package/dist/compaction/dangling.d.ts.map +1 -1
- package/dist/compaction/dangling.js +2 -0
- package/dist/compaction/dangling.js.map +1 -1
- package/dist/compaction/extractor.d.ts +7 -1
- package/dist/compaction/extractor.d.ts.map +1 -1
- package/dist/compaction/extractor.js +8 -1
- package/dist/compaction/extractor.js.map +1 -1
- package/dist/compaction/index.d.ts +1 -1
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +1 -1
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/managers/structured.js +2 -2
- package/dist/compaction/managers/structured.js.map +1 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +11 -6
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/model-summary.d.ts.map +1 -1
- package/dist/compaction/model-summary.js +7 -1
- package/dist/compaction/model-summary.js.map +1 -1
- package/dist/compaction/summary.d.ts +13 -2
- package/dist/compaction/summary.d.ts.map +1 -1
- package/dist/compaction/summary.js +46 -3
- package/dist/compaction/summary.js.map +1 -1
- package/dist/constants/tools/index.d.ts +18 -1
- package/dist/constants/tools/index.d.ts.map +1 -1
- package/dist/constants/tools/index.js +28 -16
- package/dist/constants/tools/index.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts +6 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +29 -1
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/network/audit.d.ts +49 -0
- package/dist/network/audit.d.ts.map +1 -0
- package/dist/network/audit.js +84 -0
- package/dist/network/audit.js.map +1 -0
- package/dist/network/clock.d.ts +21 -0
- package/dist/network/clock.d.ts.map +1 -0
- package/dist/network/clock.js +51 -0
- package/dist/network/clock.js.map +1 -0
- package/dist/network/discovery-mdns.d.ts +120 -0
- package/dist/network/discovery-mdns.d.ts.map +1 -0
- package/dist/network/discovery-mdns.js +442 -0
- package/dist/network/discovery-mdns.js.map +1 -0
- package/dist/network/discovery.d.ts +63 -0
- package/dist/network/discovery.d.ts.map +1 -0
- package/dist/network/discovery.js +163 -0
- package/dist/network/discovery.js.map +1 -0
- package/dist/network/fingerprint.d.ts +73 -0
- package/dist/network/fingerprint.d.ts.map +1 -0
- package/dist/network/fingerprint.js +208 -0
- package/dist/network/fingerprint.js.map +1 -0
- package/dist/network/identity.d.ts +38 -0
- package/dist/network/identity.d.ts.map +1 -0
- package/dist/network/identity.js +71 -0
- package/dist/network/identity.js.map +1 -0
- package/dist/network/index.d.ts +39 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/index.js +25 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/join.d.ts +69 -0
- package/dist/network/join.d.ts.map +1 -0
- package/dist/network/join.js +136 -0
- package/dist/network/join.js.map +1 -0
- package/dist/network/mail-policy.d.ts +97 -0
- package/dist/network/mail-policy.d.ts.map +1 -0
- package/dist/network/mail-policy.js +147 -0
- package/dist/network/mail-policy.js.map +1 -0
- package/dist/network/membership.d.ts +76 -0
- package/dist/network/membership.d.ts.map +1 -0
- package/dist/network/membership.js +225 -0
- package/dist/network/membership.js.map +1 -0
- package/dist/network/roster.d.ts +59 -0
- package/dist/network/roster.d.ts.map +1 -0
- package/dist/network/roster.js +120 -0
- package/dist/network/roster.js.map +1 -0
- package/dist/network/service.d.ts +303 -0
- package/dist/network/service.d.ts.map +1 -0
- package/dist/network/service.js +1891 -0
- package/dist/network/service.js.map +1 -0
- package/dist/network/store.d.ts +141 -0
- package/dist/network/store.d.ts.map +1 -0
- package/dist/network/store.js +198 -0
- package/dist/network/store.js.map +1 -0
- package/dist/network/transport.d.ts +96 -0
- package/dist/network/transport.d.ts.map +1 -0
- package/dist/network/transport.js +342 -0
- package/dist/network/transport.js.map +1 -0
- package/dist/network/wire.d.ts +345 -0
- package/dist/network/wire.d.ts.map +1 -0
- package/dist/network/wire.js +212 -0
- package/dist/network/wire.js.map +1 -0
- package/dist/network/x509.d.ts +28 -0
- package/dist/network/x509.d.ts.map +1 -0
- package/dist/network/x509.js +84 -0
- package/dist/network/x509.js.map +1 -0
- package/dist/pals/activity/causality.d.ts.map +1 -1
- package/dist/pals/activity/causality.js +14 -2
- package/dist/pals/activity/causality.js.map +1 -1
- package/dist/peers/endpoint.d.ts.map +1 -1
- package/dist/peers/endpoint.js +6 -0
- package/dist/peers/endpoint.js.map +1 -1
- package/dist/peers/envelope.d.ts +18 -0
- package/dist/peers/envelope.d.ts.map +1 -1
- package/dist/peers/envelope.js +68 -5
- package/dist/peers/envelope.js.map +1 -1
- package/dist/peers/index.d.ts +5 -4
- package/dist/peers/index.d.ts.map +1 -1
- package/dist/peers/index.js +3 -2
- package/dist/peers/index.js.map +1 -1
- package/dist/peers/mode-word.d.ts +10 -0
- package/dist/peers/mode-word.d.ts.map +1 -0
- package/dist/peers/mode-word.js +19 -0
- package/dist/peers/mode-word.js.map +1 -0
- package/dist/peers/protocol.d.ts +42 -0
- package/dist/peers/protocol.d.ts.map +1 -1
- package/dist/peers/protocol.js +22 -1
- package/dist/peers/protocol.js.map +1 -1
- package/dist/peers/record.d.ts +8 -0
- package/dist/peers/record.d.ts.map +1 -1
- package/dist/peers/record.js +5 -0
- package/dist/peers/record.js.map +1 -1
- package/dist/plugin/session-hook-env.d.ts.map +1 -1
- package/dist/plugin/session-hook-env.js +22 -2
- package/dist/plugin/session-hook-env.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +16 -2
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +183 -14
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +4 -2
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +33 -38
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/public-runtime.d.ts +14 -6
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +22 -5
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +3 -2
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -2
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +7 -2
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +29 -1
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +64 -0
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts +30 -6
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.js +40 -12
- package/dist/runtime/query/auto-review/classifier.js.map +1 -1
- package/dist/runtime/query/auto-review/feedback.d.ts +37 -0
- package/dist/runtime/query/auto-review/feedback.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/feedback.js +45 -0
- package/dist/runtime/query/auto-review/feedback.js.map +1 -0
- package/dist/runtime/query/auto-review/git-status.d.ts +59 -0
- package/dist/runtime/query/auto-review/git-status.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/git-status.js +379 -0
- package/dist/runtime/query/auto-review/git-status.js.map +1 -0
- package/dist/runtime/query/auto-review/index.d.ts +3 -3
- package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/index.js +2 -2
- package/dist/runtime/query/auto-review/index.js.map +1 -1
- package/dist/runtime/query/auto-review/prompt.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/prompt.js +6 -1
- package/dist/runtime/query/auto-review/prompt.js.map +1 -1
- package/dist/runtime/query/auto-review/transcript.d.ts +14 -1
- package/dist/runtime/query/auto-review/transcript.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/transcript.js +48 -2
- package/dist/runtime/query/auto-review/transcript.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +40 -3
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +32 -10
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +78 -17
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +9 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +54 -17
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +17 -3
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +5 -2
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js +5 -0
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts +1 -2
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.js +2 -5
- package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +6 -1
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/pasted-frames.d.ts +34 -0
- package/dist/runtime/query/pasted-frames.d.ts.map +1 -0
- package/dist/runtime/query/pasted-frames.js +108 -0
- package/dist/runtime/query/pasted-frames.js.map +1 -0
- package/dist/runtime/query/path-escalation.d.ts +6 -0
- package/dist/runtime/query/path-escalation.d.ts.map +1 -1
- package/dist/runtime/query/path-escalation.js +15 -3
- package/dist/runtime/query/path-escalation.js.map +1 -1
- package/dist/runtime/query/request-interrupted-turns.d.ts +20 -0
- package/dist/runtime/query/request-interrupted-turns.d.ts.map +1 -0
- package/dist/runtime/query/request-interrupted-turns.js +43 -0
- package/dist/runtime/query/request-interrupted-turns.js.map +1 -0
- package/dist/runtime/query/review-policy.d.ts +16 -6
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +111 -15
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.d.ts +9 -0
- package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.js +94 -6
- package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
- package/dist/runtime/query/unanswered.d.ts +19 -0
- package/dist/runtime/query/unanswered.d.ts.map +1 -0
- package/dist/runtime/query/unanswered.js +25 -0
- package/dist/runtime/query/unanswered.js.map +1 -0
- package/dist/runtime/system-events.d.ts +4 -4
- package/dist/runtime/system-events.d.ts.map +1 -1
- package/dist/runtime/system-events.js +2 -0
- package/dist/runtime/system-events.js.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts +8 -0
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +21 -3
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/store/evidence/source-kind.d.ts +1 -1
- package/dist/store/evidence/source-kind.d.ts.map +1 -1
- package/dist/store/evidence/source-kind.js +1 -1
- package/dist/store/evidence/source-kind.js.map +1 -1
- package/dist/store/session-index/sqlite.d.ts.map +1 -1
- package/dist/store/session-index/sqlite.js +42 -3
- package/dist/store/session-index/sqlite.js.map +1 -1
- package/dist/store/session-log/disk.js +1 -1
- package/dist/store/session-log/disk.js.map +1 -1
- package/dist/store/session-log/lease.d.ts.map +1 -1
- package/dist/store/session-log/lease.js +3 -2
- package/dist/store/session-log/lease.js.map +1 -1
- package/dist/tools/admit-facts.d.ts.map +1 -1
- package/dist/tools/admit-facts.js +2 -0
- package/dist/tools/admit-facts.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +10 -2
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +56 -17
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser-local.d.ts +117 -0
- package/dist/tools/builtins/browser-local.d.ts.map +1 -0
- package/dist/tools/builtins/browser-local.js +437 -0
- package/dist/tools/builtins/browser-local.js.map +1 -0
- package/dist/tools/builtins/browser.d.ts +18 -1
- package/dist/tools/builtins/browser.d.ts.map +1 -1
- package/dist/tools/builtins/browser.js +84 -6
- package/dist/tools/builtins/browser.js.map +1 -1
- package/dist/tools/builtins/computer-use-window-id.d.ts +16 -0
- package/dist/tools/builtins/computer-use-window-id.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-window-id.js +52 -0
- package/dist/tools/builtins/computer-use-window-id.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +65 -7
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +384 -71
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts +6 -0
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +7 -1
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +89 -7
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/file-write-result.d.ts.map +1 -1
- package/dist/tools/builtins/file-write-result.js +2 -1
- package/dist/tools/builtins/file-write-result.js.map +1 -1
- package/dist/tools/builtins/grep.js +1 -1
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +4 -2
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/monitor.d.ts.map +1 -1
- package/dist/tools/builtins/monitor.js +6 -1
- package/dist/tools/builtins/monitor.js.map +1 -1
- package/dist/tools/builtins/search-tools.d.ts +12 -1
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +166 -20
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/shell-read-credit.d.ts +18 -6
- package/dist/tools/builtins/shell-read-credit.d.ts.map +1 -1
- package/dist/tools/builtins/shell-read-credit.js +95 -27
- package/dist/tools/builtins/shell-read-credit.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +14 -3
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/builtins/web-guidance.d.ts +6 -0
- package/dist/tools/builtins/web-guidance.d.ts.map +1 -1
- package/dist/tools/builtins/web-guidance.js +6 -0
- package/dist/tools/builtins/web-guidance.js.map +1 -1
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +2 -1
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +32 -2
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +1 -1
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +6 -8
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/defineTool.d.ts +2 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +17 -1
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/schedules/index.d.ts +1 -0
- package/dist/tools/schedules/index.d.ts.map +1 -1
- package/dist/tools/schedules/index.js +1 -0
- package/dist/tools/schedules/index.js.map +1 -1
- package/dist/tools/schedules/loop-tool.d.ts.map +1 -1
- package/dist/tools/schedules/loop-tool.js +8 -6
- package/dist/tools/schedules/loop-tool.js.map +1 -1
- package/dist/tools/schedules/present.js +1 -1
- package/dist/tools/schedules/present.js.map +1 -1
- package/dist/tools/schedules/timer-tools.d.ts +36 -0
- package/dist/tools/schedules/timer-tools.d.ts.map +1 -0
- package/dist/tools/schedules/timer-tools.js +234 -0
- package/dist/tools/schedules/timer-tools.js.map +1 -0
- package/dist/tools/schedules/types.d.ts +68 -3
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/task/create.d.ts.map +1 -1
- package/dist/tools/task/create.js +2 -0
- package/dist/tools/task/create.js.map +1 -1
- package/dist/toolsets/manager.d.ts +49 -7
- package/dist/toolsets/manager.d.ts.map +1 -1
- package/dist/toolsets/manager.js +239 -40
- package/dist/toolsets/manager.js.map +1 -1
- package/dist/turn/evidence-query.d.ts +18 -1
- package/dist/turn/evidence-query.d.ts.map +1 -1
- package/dist/turn/evidence-query.js +177 -35
- package/dist/turn/evidence-query.js.map +1 -1
- package/dist/turn/evidence-recall.d.ts +8 -1
- package/dist/turn/evidence-recall.d.ts.map +1 -1
- package/dist/turn/evidence-recall.js +82 -22
- package/dist/turn/evidence-recall.js.map +1 -1
- package/dist/turn/history-shed.d.ts +15 -0
- package/dist/turn/history-shed.d.ts.map +1 -0
- package/dist/turn/history-shed.js +23 -0
- package/dist/turn/history-shed.js.map +1 -0
- package/dist/types/acp/index.d.ts +26 -0
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +9 -1
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +11 -2
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/hitl/index.d.ts +10 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/message/index.d.ts +56 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +2 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/permission/index.d.ts +14 -0
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +14 -0
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +148 -1
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +9 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/provider/index.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +12 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/limits.d.ts +33 -0
- package/dist/types/provider/limits.d.ts.map +1 -0
- package/dist/types/provider/limits.js +7 -0
- package/dist/types/provider/limits.js.map +1 -0
- package/dist/types/tool/index.d.ts +30 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +4 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/file-lock.d.ts +88 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +281 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/state-backup.d.ts +87 -0
- package/dist/utils/state-backup.d.ts.map +1 -0
- package/dist/utils/state-backup.js +272 -0
- package/dist/utils/state-backup.js.map +1 -0
- package/dist/utils/temp-sweep.d.ts +66 -0
- package/dist/utils/temp-sweep.d.ts.map +1 -0
- package/dist/utils/temp-sweep.js +311 -0
- package/dist/utils/temp-sweep.js.map +1 -0
- package/dist/utils/temp.d.ts +14 -0
- package/dist/utils/temp.d.ts.map +1 -1
- package/dist/utils/temp.js +70 -2
- package/dist/utils/temp.js.map +1 -1
- package/package.json +1 -1
- package/src/account/lock.ts +13 -133
- package/src/account/registry.ts +75 -21
- package/src/account/types.ts +8 -9
- package/src/authorization/dangerous-commands.ts +542 -0
- package/src/authorization/gate.ts +19 -5
- package/src/authorization/protected-paths.ts +13 -8
- package/src/authorization/readonly-commands.ts +35 -1
- package/src/authorization/removal.ts +7 -7
- package/src/authorization/rules.ts +75 -15
- package/src/authorization/shell-lexer.ts +19 -0
- package/src/bridge/acp/permission.ts +2 -0
- package/src/bridge/acp/server.ts +66 -6
- package/src/compaction/context-breakdown.ts +53 -11
- package/src/compaction/dangling.ts +2 -0
- package/src/compaction/extractor.ts +9 -1
- package/src/compaction/index.ts +1 -0
- package/src/compaction/managers/structured.ts +2 -2
- package/src/compaction/manual.ts +11 -3
- package/src/compaction/model-summary.ts +8 -1
- package/src/compaction/summary.ts +54 -7
- package/src/constants/tools/index.ts +30 -16
- package/src/manager/session/turn-recorder.ts +37 -1
- package/src/network/audit.ts +113 -0
- package/src/network/clock.ts +62 -0
- package/src/network/discovery-mdns.ts +485 -0
- package/src/network/discovery.ts +210 -0
- package/src/network/fingerprint.ts +241 -0
- package/src/network/identity.ts +98 -0
- package/src/network/index.ts +134 -0
- package/src/network/join.ts +177 -0
- package/src/network/mail-policy.ts +199 -0
- package/src/network/membership.ts +290 -0
- package/src/network/roster.ts +165 -0
- package/src/network/service.ts +2304 -0
- package/src/network/store.ts +261 -0
- package/src/network/transport.ts +445 -0
- package/src/network/wire.ts +250 -0
- package/src/network/x509.ts +114 -0
- package/src/pals/activity/causality.ts +16 -2
- package/src/peers/endpoint.ts +6 -0
- package/src/peers/envelope.ts +82 -5
- package/src/peers/index.ts +10 -2
- package/src/peers/mode-word.ts +18 -0
- package/src/peers/protocol.ts +24 -1
- package/src/peers/record.ts +5 -0
- package/src/plugin/session-hook-env.ts +25 -2
- package/src/plugin/shell-hook.ts +208 -14
- package/src/prompt/coding-agent-doctrine.ts +33 -38
- package/src/public-runtime.ts +107 -1
- package/src/public-tools.ts +11 -0
- package/src/public-types.ts +67 -1
- package/src/runtime/jobs/registry.ts +93 -3
- package/src/runtime/query/auto-review/classifier.ts +76 -14
- package/src/runtime/query/auto-review/feedback.ts +50 -0
- package/src/runtime/query/auto-review/git-status.ts +437 -0
- package/src/runtime/query/auto-review/index.ts +7 -2
- package/src/runtime/query/auto-review/prompt.ts +6 -1
- package/src/runtime/query/auto-review/transcript.ts +67 -4
- package/src/runtime/query/executor/tool-call-admission.ts +49 -3
- package/src/runtime/query/executor.ts +104 -21
- package/src/runtime/query/index.ts +66 -17
- package/src/runtime/query/iteration/index.ts +24 -3
- package/src/runtime/query/iteration/phases/compaction.ts +4 -0
- package/src/runtime/query/iteration/phases/context.ts +5 -0
- package/src/runtime/query/iteration/phases/per-call-review.ts +8 -13
- package/src/runtime/query/iteration/phases/tool-review.ts +7 -1
- package/src/runtime/query/pasted-frames.ts +119 -0
- package/src/runtime/query/path-escalation.ts +27 -3
- package/src/runtime/query/request-interrupted-turns.ts +47 -0
- package/src/runtime/query/review-policy.ts +125 -22
- package/src/runtime/query/turn/outcome-ledger.ts +99 -6
- package/src/runtime/query/unanswered.ts +35 -0
- package/src/runtime/system-events.ts +2 -0
- package/src/session/workspace/git-worktree.ts +34 -3
- package/src/store/evidence/source-kind.ts +1 -1
- package/src/store/session-index/sqlite.ts +40 -3
- package/src/store/session-log/disk.ts +1 -1
- package/src/store/session-log/lease.ts +3 -2
- package/src/tools/admit-facts.ts +2 -0
- package/src/tools/builtins/bash.ts +62 -19
- package/src/tools/builtins/browser-local.ts +504 -0
- package/src/tools/builtins/browser.ts +108 -6
- package/src/tools/builtins/computer-use-window-id.ts +50 -0
- package/src/tools/builtins/computer-use.ts +460 -68
- package/src/tools/builtins/content-fingerprint.ts +8 -1
- package/src/tools/builtins/edit.ts +93 -7
- package/src/tools/builtins/file-write-result.ts +2 -1
- package/src/tools/builtins/grep.ts +1 -1
- package/src/tools/builtins/job.ts +4 -2
- package/src/tools/builtins/monitor.ts +6 -1
- package/src/tools/builtins/search-tools.ts +196 -21
- package/src/tools/builtins/shell-read-credit.ts +97 -33
- package/src/tools/builtins/wait-for-job.ts +13 -3
- package/src/tools/builtins/web-guidance.ts +6 -0
- package/src/tools/builtins/web.ts +2 -1
- package/src/tools/builtins/write-file.ts +31 -3
- package/src/tools/command-shell.ts +6 -8
- package/src/tools/defineTool.ts +20 -1
- package/src/tools/schedules/index.ts +11 -0
- package/src/tools/schedules/loop-tool.ts +10 -6
- package/src/tools/schedules/present.ts +1 -1
- package/src/tools/schedules/timer-tools.ts +258 -0
- package/src/tools/schedules/types.ts +72 -3
- package/src/tools/task/create.ts +2 -0
- package/src/toolsets/manager.ts +262 -46
- package/src/turn/evidence-query.ts +183 -42
- package/src/turn/evidence-recall.ts +96 -19
- package/src/turn/history-shed.ts +30 -0
- package/src/types/acp/index.ts +24 -0
- package/src/types/authorization/index.ts +20 -3
- package/src/types/hitl/index.ts +10 -0
- package/src/types/message/index.ts +65 -0
- package/src/types/permission/index.ts +18 -0
- package/src/types/plugin/index.ts +205 -26
- package/src/types/provider/index.ts +1 -0
- package/src/types/provider/interface.ts +13 -0
- package/src/types/provider/limits.ts +35 -0
- package/src/types/tool/index.ts +30 -2
- package/src/types/tool/presentation.ts +4 -0
- package/src/utils/file-lock.ts +328 -0
- package/src/utils/state-backup.ts +318 -0
- package/src/utils/temp-sweep.ts +327 -0
- package/src/utils/temp.ts +73 -2
package/src/public-runtime.ts
CHANGED
|
@@ -313,7 +313,35 @@ export {
|
|
|
313
313
|
resolveTempBase,
|
|
314
314
|
tempFilePath,
|
|
315
315
|
} from './utils/temp.js'
|
|
316
|
+
export {
|
|
317
|
+
HOOK_ENV_OWNER_FILE,
|
|
318
|
+
TEMP_SWEEP_EVERY_MS,
|
|
319
|
+
TEMP_SWEEP_MAX_AGE_MS,
|
|
320
|
+
TEMP_SWEEP_STAMP,
|
|
321
|
+
type TempSweepOptions,
|
|
322
|
+
type TempSweepReport,
|
|
323
|
+
sweepPrivateTempRoot,
|
|
324
|
+
} from './utils/temp-sweep.js'
|
|
316
325
|
export { extractFinalResponse } from './utils/conversation.js'
|
|
326
|
+
export {
|
|
327
|
+
EMPTY_LOCK_GRACE_MS,
|
|
328
|
+
FileLockError,
|
|
329
|
+
inspectFileLock,
|
|
330
|
+
lockPathFor,
|
|
331
|
+
withFileLock,
|
|
332
|
+
withFileLockSync,
|
|
333
|
+
} from './utils/file-lock.js'
|
|
334
|
+
export {
|
|
335
|
+
STATE_BACKUPS_DIR,
|
|
336
|
+
STATE_BACKUP_KEEP,
|
|
337
|
+
STATE_BACKUP_MIN_INTERVAL_MS,
|
|
338
|
+
backupStateFile,
|
|
339
|
+
listStateFileCopies,
|
|
340
|
+
preserveUnreadableStateFile,
|
|
341
|
+
rewriteStateFileBackups,
|
|
342
|
+
stateBackupsDir,
|
|
343
|
+
writeFileAtomicSync,
|
|
344
|
+
} from './utils/state-backup.js'
|
|
317
345
|
|
|
318
346
|
// ─── router, runtime, turn ───────────────────────────────────────────────
|
|
319
347
|
|
|
@@ -377,6 +405,15 @@ export {
|
|
|
377
405
|
export type { SteeringChannel } from './runtime/query/steering.js'
|
|
378
406
|
// Hidden mid-conversation reminders a host feeds per model request (opt-in).
|
|
379
407
|
export { isReminderMessage } from './runtime/query/reminders.js'
|
|
408
|
+
// Text a person pasted, set apart from their own words in the model request.
|
|
409
|
+
export {
|
|
410
|
+
PASTED_FRAME_GUIDANCE,
|
|
411
|
+
PASTED_MARKER,
|
|
412
|
+
framePastedContent,
|
|
413
|
+
newPasteNonce,
|
|
414
|
+
typedTextOf,
|
|
415
|
+
usablePastedSpans,
|
|
416
|
+
} from './runtime/query/pasted-frames.js'
|
|
380
417
|
export type {
|
|
381
418
|
ReminderContext,
|
|
382
419
|
ReminderSource,
|
|
@@ -499,6 +536,7 @@ export {
|
|
|
499
536
|
createEvidenceRecallStep,
|
|
500
537
|
refineEvidenceRecallTerms,
|
|
501
538
|
} from './turn/evidence-recall.js'
|
|
539
|
+
export { historyContentShed } from './turn/history-shed.js'
|
|
502
540
|
export type {
|
|
503
541
|
EvidenceRecallOptions,
|
|
504
542
|
EvidenceRecallRequest,
|
|
@@ -1137,6 +1175,11 @@ export {
|
|
|
1137
1175
|
lexShellCommandLine,
|
|
1138
1176
|
nestedShellCommand,
|
|
1139
1177
|
} from './authorization/shell-lexer.js'
|
|
1178
|
+
// Whether a command line only reads, and whether it writes a file through a
|
|
1179
|
+
// redirection: a host that offers "don't ask again" leaves a read-only filter
|
|
1180
|
+
// (`tail`, `grep`) out of the rule it remembers and declines a line that writes.
|
|
1181
|
+
export { writesThroughRedirection } from './authorization/command-line.js'
|
|
1182
|
+
export { isReadOnlyCommandLine } from './authorization/readonly-commands.js'
|
|
1140
1183
|
|
|
1141
1184
|
// Where a command line actually execs a program — unwrapping `sudo`, `env`,
|
|
1142
1185
|
// `nice`, `timeout` and the rest of a re-exec chain with their own real
|
|
@@ -1641,6 +1684,7 @@ export {
|
|
|
1641
1684
|
CLASSIFIER_TRANSCRIPT_TOO_LONG_FEEDBACK,
|
|
1642
1685
|
OUTSIDE_ROOTS_UNATTENDED_REFUSAL,
|
|
1643
1686
|
PLAN_MODE_REFUSAL,
|
|
1687
|
+
PLAN_MODE_REFUSAL_WITH_PLAN_FILE,
|
|
1644
1688
|
REVIEW_EXEMPT_WRITES,
|
|
1645
1689
|
REVIEW_MODES,
|
|
1646
1690
|
SANDBOX_ESCAPE_UNATTENDED_REFUSAL,
|
|
@@ -1659,12 +1703,17 @@ export {
|
|
|
1659
1703
|
// The model that decides, in the `classify` review mode, what a person would
|
|
1660
1704
|
// otherwise be asked. See `runtime/query/auto-review/`.
|
|
1661
1705
|
export {
|
|
1706
|
+
AUTO_REVIEW_BLOCKED_PREFIX,
|
|
1662
1707
|
AUTO_REVIEW_DEFAULTS_MARKER,
|
|
1708
|
+
AUTO_REVIEW_UNAVAILABLE_PREFIX,
|
|
1663
1709
|
DEFAULT_ALLOW as DEFAULT_AUTO_REVIEW_ALLOW,
|
|
1664
1710
|
DEFAULT_AUTO_REVIEW_LIMITS,
|
|
1665
1711
|
DEFAULT_HARD_DENY as DEFAULT_AUTO_REVIEW_HARD_DENY,
|
|
1666
1712
|
DEFAULT_SOFT_DENY as DEFAULT_AUTO_REVIEW_SOFT_DENY,
|
|
1667
1713
|
autoReviewBlockedFeedback,
|
|
1714
|
+
autoReviewOversizedFeedback,
|
|
1715
|
+
autoReviewStoppedFeedback,
|
|
1716
|
+
autoReviewUnavailableFeedback,
|
|
1668
1717
|
createAutoReviewClassifier,
|
|
1669
1718
|
resolveAutoReviewRules,
|
|
1670
1719
|
} from './runtime/query/auto-review/index.js'
|
|
@@ -1784,6 +1833,7 @@ export {
|
|
|
1784
1833
|
analyzeContextUsage,
|
|
1785
1834
|
describeToolCatalogTokens,
|
|
1786
1835
|
CONTEXT_CATEGORY_ORDER,
|
|
1836
|
+
DEFERRED_CATEGORY_ORDER,
|
|
1787
1837
|
} from './compaction/context-breakdown.js'
|
|
1788
1838
|
export type {
|
|
1789
1839
|
ContextBreakdown,
|
|
@@ -1793,7 +1843,7 @@ export type {
|
|
|
1793
1843
|
ContextMessageBreakdown,
|
|
1794
1844
|
ContextUsageInput,
|
|
1795
1845
|
} from './compaction/context-breakdown.js'
|
|
1796
|
-
export { estimateTextTokens } from './compaction/token-estimate.js'
|
|
1846
|
+
export { estimateMessagesTokens, estimateTextTokens } from './compaction/token-estimate.js'
|
|
1797
1847
|
export type { CompactRegionInput } from './compaction/manual.js'
|
|
1798
1848
|
export type {
|
|
1799
1849
|
CompactionVerificationOptions,
|
|
@@ -1830,6 +1880,7 @@ export type {
|
|
|
1830
1880
|
ComputerUseAdvisor,
|
|
1831
1881
|
ComputerUseAdvisorCandidate,
|
|
1832
1882
|
ComputerUseAdvisorRequest,
|
|
1883
|
+
ComputerUseObservation,
|
|
1833
1884
|
ComputerUseTool,
|
|
1834
1885
|
ComputerUseToolOptions,
|
|
1835
1886
|
ImageSize,
|
|
@@ -2026,13 +2077,16 @@ export {
|
|
|
2026
2077
|
PeerSessionStateSchema,
|
|
2027
2078
|
PingRequestSchema,
|
|
2028
2079
|
PingResponseSchema,
|
|
2080
|
+
RemoteOriginSchema,
|
|
2029
2081
|
SubscribeIdleRequestSchema,
|
|
2030
2082
|
SubscribeIdleResponseSchema,
|
|
2031
2083
|
createPeerEndpoint,
|
|
2032
2084
|
derivePeerRef,
|
|
2033
2085
|
formatPeerMessage,
|
|
2034
2086
|
formatPersonMessage,
|
|
2087
|
+
permissionModeWord,
|
|
2035
2088
|
formatPeerNotice,
|
|
2089
|
+
formatRoleContext,
|
|
2036
2090
|
hardenPeerRuntimeDir,
|
|
2037
2091
|
isPeerRecordLive,
|
|
2038
2092
|
listLivePeers,
|
|
@@ -2047,6 +2101,58 @@ export {
|
|
|
2047
2101
|
udsPeerAddress,
|
|
2048
2102
|
writePeerRecord,
|
|
2049
2103
|
} from './peers/index.js'
|
|
2104
|
+
// ─── your Namzu network (@experimental) ───────────────────────────────────
|
|
2105
|
+
//
|
|
2106
|
+
// Machines of one person find each other, share a roster of sessions and
|
|
2107
|
+
// roles, and message each other under the same safety rules as local peers.
|
|
2108
|
+
// See `network/index.ts`.
|
|
2109
|
+
|
|
2110
|
+
export {
|
|
2111
|
+
AUDIT_EVENTS,
|
|
2112
|
+
BROWSE_WINDOW_MS,
|
|
2113
|
+
DEFAULT_LISTEN_PORT,
|
|
2114
|
+
HOLD_EXPIRY_MS,
|
|
2115
|
+
HoldQueue,
|
|
2116
|
+
MAX_HELD_PER_TERMINAL,
|
|
2117
|
+
MAX_NET_LINE_BYTES,
|
|
2118
|
+
MAX_PREAUTH_LINE_BYTES,
|
|
2119
|
+
MAX_ROLE_BYTES,
|
|
2120
|
+
MDNS_GROUP,
|
|
2121
|
+
MDNS_PORT,
|
|
2122
|
+
NET_PROTOCOL,
|
|
2123
|
+
NetworkError,
|
|
2124
|
+
createDiscoveryHub,
|
|
2125
|
+
createFakeDiscovery,
|
|
2126
|
+
createFileAuditSink,
|
|
2127
|
+
createFounding,
|
|
2128
|
+
createManualClock,
|
|
2129
|
+
createMdnsDiscovery,
|
|
2130
|
+
createMemoryAuditSink,
|
|
2131
|
+
createNamzuNetwork,
|
|
2132
|
+
createNetworkIdentity,
|
|
2133
|
+
createNetworkStore,
|
|
2134
|
+
createSystemGatewayReader,
|
|
2135
|
+
decideMail,
|
|
2136
|
+
evaluateMembership,
|
|
2137
|
+
formatJoinCode,
|
|
2138
|
+
generateMachineKey,
|
|
2139
|
+
generateSessionName,
|
|
2140
|
+
isPrivateNetworkAddress,
|
|
2141
|
+
joinCode,
|
|
2142
|
+
machineLabel,
|
|
2143
|
+
mergeMembership,
|
|
2144
|
+
networkFingerprint,
|
|
2145
|
+
parseHostPort,
|
|
2146
|
+
privateInterfaces,
|
|
2147
|
+
resolveSessionTarget,
|
|
2148
|
+
sanitizeName,
|
|
2149
|
+
sanitizeRole,
|
|
2150
|
+
sessionDisplayName,
|
|
2151
|
+
sessionLabel,
|
|
2152
|
+
SlidingCounter,
|
|
2153
|
+
systemClock,
|
|
2154
|
+
textHash,
|
|
2155
|
+
} from './network/index.js'
|
|
2050
2156
|
export {
|
|
2051
2157
|
SESSION_CHILD_ENV,
|
|
2052
2158
|
startedBySession,
|
package/src/public-tools.ts
CHANGED
|
@@ -103,6 +103,7 @@ export {
|
|
|
103
103
|
getMonitorTools,
|
|
104
104
|
} from './tools/builtins/monitor.js'
|
|
105
105
|
export type { MonitorToolOptions } from './tools/builtins/monitor.js'
|
|
106
|
+
export type { BrowserToolsOptions } from './tools/builtins/browser.js'
|
|
106
107
|
export { GlobTool } from './tools/builtins/glob.js'
|
|
107
108
|
export { GrepTool } from './tools/builtins/grep.js'
|
|
108
109
|
// Reads, lists and stops what `bash run_in_background` starts. Ships in
|
|
@@ -191,6 +192,7 @@ export {
|
|
|
191
192
|
BROWSER_ACT_TOOL_NAME,
|
|
192
193
|
BROWSER_TOOL_NAME,
|
|
193
194
|
browserHostErrorOf,
|
|
195
|
+
closeBrowserLocalPages,
|
|
194
196
|
createBrowserTools,
|
|
195
197
|
formatBrowserPageHeader,
|
|
196
198
|
isBrowserCallReadOnly,
|
|
@@ -236,10 +238,19 @@ export { buildAgentTool, type AgentToolOptions } from './tools/coordinator/agent
|
|
|
236
238
|
export {
|
|
237
239
|
buildScheduleTools,
|
|
238
240
|
buildSessionLoopTools,
|
|
241
|
+
buildSessionTimerTools,
|
|
242
|
+
buildWakeUpTool,
|
|
243
|
+
clampWakeUpDelay,
|
|
239
244
|
revealHiddenCharacters,
|
|
240
245
|
scanSchedulePrompt,
|
|
241
246
|
SCHEDULE_TOOL_NAME,
|
|
242
247
|
SESSION_LOOP_TOOL_NAME,
|
|
248
|
+
TIMER_CANCEL_TOOL_NAME,
|
|
249
|
+
TIMER_LIST_TOOL_NAME,
|
|
250
|
+
TIMER_SET_TOOL_NAME,
|
|
251
|
+
WAKE_UP_MAX_SECONDS,
|
|
252
|
+
WAKE_UP_MIN_SECONDS,
|
|
253
|
+
WAKE_UP_TOOL_NAME,
|
|
243
254
|
} from './tools/schedules/index.js'
|
|
244
255
|
|
|
245
256
|
// ─── RAG tool builder ────────────────────────────────────────────────────
|
package/src/public-types.ts
CHANGED
|
@@ -27,7 +27,7 @@ export type { ViewImageToolOptions } from './tools/builtins/view-image.js'
|
|
|
27
27
|
export type * from './types/message/index.js'
|
|
28
28
|
export type * from './types/message/inbound-delivery.js'
|
|
29
29
|
export type * from './types/common/index.js'
|
|
30
|
-
export type { AcpPromptOptions, AcpTask, AcpTaskUpdate } from './types/acp/index.js'
|
|
30
|
+
export type { AcpPastedRange, AcpPromptOptions, AcpTask, AcpTaskUpdate } from './types/acp/index.js'
|
|
31
31
|
export type { CoalesceOptions } from './streaming/coalesce.js'
|
|
32
32
|
export type * from './types/bidi/index.js'
|
|
33
33
|
export type * from './types/tool/index.js'
|
|
@@ -180,6 +180,12 @@ export type {
|
|
|
180
180
|
ShellCompressOptions,
|
|
181
181
|
ShellCompressResult,
|
|
182
182
|
} from './utils/shell-compress.js'
|
|
183
|
+
export type { FileLockOptions, FileLockState, FileLockSyncOptions } from './utils/file-lock.js'
|
|
184
|
+
export type {
|
|
185
|
+
StateBackupFileOptions,
|
|
186
|
+
StateBackupOptions,
|
|
187
|
+
StateFileCopy,
|
|
188
|
+
} from './utils/state-backup.js'
|
|
183
189
|
|
|
184
190
|
export type { QueryParams } from './runtime/query/index.js'
|
|
185
191
|
export type {
|
|
@@ -714,8 +720,12 @@ export type {
|
|
|
714
720
|
ScheduleRuleEffect,
|
|
715
721
|
ScheduleToolHost,
|
|
716
722
|
ScheduleUpdateRequest,
|
|
723
|
+
SelfPacedHost,
|
|
717
724
|
SessionLoop,
|
|
718
725
|
SessionLoopHost,
|
|
726
|
+
SessionLoopPace,
|
|
727
|
+
SessionTimer,
|
|
728
|
+
SessionTimerHost,
|
|
719
729
|
} from './tools/schedules/index.js'
|
|
720
730
|
|
|
721
731
|
// ─── system events + peer messaging (@experimental) ───────────────────────
|
|
@@ -736,6 +746,62 @@ export type {
|
|
|
736
746
|
ResolvePeerRuntimeDirOptions,
|
|
737
747
|
} from './peers/dir.js'
|
|
738
748
|
export type { PeerExchange, PeerRecord } from './peers/record.js'
|
|
749
|
+
export type { RemoteOrigin } from './peers/protocol.js'
|
|
750
|
+
export type { RoleContextInput } from './peers/envelope.js'
|
|
751
|
+
export type {
|
|
752
|
+
Admission,
|
|
753
|
+
Advertisement,
|
|
754
|
+
AuditEntry,
|
|
755
|
+
AuditEventName,
|
|
756
|
+
AuditSink,
|
|
757
|
+
AutoAdmitSetting,
|
|
758
|
+
DgramLike,
|
|
759
|
+
DgramSocketLike,
|
|
760
|
+
DiscoveredEndpoint,
|
|
761
|
+
DiscoveryHub,
|
|
762
|
+
FakeDiscovery,
|
|
763
|
+
FileAuditSinkOptions,
|
|
764
|
+
CommandRunner,
|
|
765
|
+
Gateway,
|
|
766
|
+
GatewayReader,
|
|
767
|
+
NetworkIdentityOptions,
|
|
768
|
+
SystemGatewayOptions,
|
|
769
|
+
HeldMail,
|
|
770
|
+
HostPort,
|
|
771
|
+
ListenAddress,
|
|
772
|
+
LocalSession,
|
|
773
|
+
MailDecision,
|
|
774
|
+
MailDecisionInput,
|
|
775
|
+
MailSetting,
|
|
776
|
+
ManualClock,
|
|
777
|
+
HeldEntry,
|
|
778
|
+
HoldQueueOptions,
|
|
779
|
+
MachineKey,
|
|
780
|
+
MdnsOptions,
|
|
781
|
+
MembershipState,
|
|
782
|
+
MembershipView,
|
|
783
|
+
NetworkClock,
|
|
784
|
+
NetworkDiscovery,
|
|
785
|
+
NetworkErrorCode,
|
|
786
|
+
NetworkEvent,
|
|
787
|
+
NetworkHost,
|
|
788
|
+
NetworkRef,
|
|
789
|
+
NetworkService,
|
|
790
|
+
NetworkServiceOptions,
|
|
791
|
+
NetworkState,
|
|
792
|
+
NetworkStatus,
|
|
793
|
+
NetworkStore,
|
|
794
|
+
NetworkStoreOptions,
|
|
795
|
+
PendingJoin,
|
|
796
|
+
PrivateInterfaceOptions,
|
|
797
|
+
RemoteMail,
|
|
798
|
+
Revocation,
|
|
799
|
+
RosterMachineView,
|
|
800
|
+
RosterSession,
|
|
801
|
+
RosterView,
|
|
802
|
+
TargetResolution,
|
|
803
|
+
TrustedNetwork,
|
|
804
|
+
} from './network/index.js'
|
|
739
805
|
export type { AccountBoundRecord } from './types/session/records.js'
|
|
740
806
|
export type {
|
|
741
807
|
Account,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { spawn } from 'node:child_process'
|
|
2
|
+
import { closeSync, mkdirSync, openSync, writeSync } from 'node:fs'
|
|
3
|
+
import { join as joinPath } from 'node:path'
|
|
2
4
|
|
|
3
5
|
import { SANDBOX_KILL_GRACE_MS } from '../../constants/sandbox/index.js'
|
|
4
6
|
import { isSignalablePid, killTree } from '../../process/kill-tree.js'
|
|
@@ -78,7 +80,10 @@ export interface BackgroundJob {
|
|
|
78
80
|
* other job.
|
|
79
81
|
*/
|
|
80
82
|
readonly kind?: 'monitor'
|
|
81
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* What the job is for, in the model's words. For a monitor, what it watches
|
|
85
|
+
* (shown with every event); for a command started with a label, that label.
|
|
86
|
+
*/
|
|
82
87
|
readonly description?: string
|
|
83
88
|
/** When the monitor will be stopped if the command has not ended first (epoch ms). */
|
|
84
89
|
readonly expiresAt?: number
|
|
@@ -98,8 +103,18 @@ export interface BackgroundJob {
|
|
|
98
103
|
/** The close code and reason the server ended a WebSocket connection with, if it did. */
|
|
99
104
|
readonly closeCode?: number
|
|
100
105
|
readonly closeReason?: string
|
|
106
|
+
/**
|
|
107
|
+
* The file the job's whole output is also written to (stdout and stderr, in
|
|
108
|
+
* the order they arrived), when the host gave the registry a folder for it.
|
|
109
|
+
* The in-memory tail is capped; this file is not, up to
|
|
110
|
+
* {@link JOB_OUTPUT_FILE_MAX_BYTES}.
|
|
111
|
+
*/
|
|
112
|
+
readonly outputFile?: string
|
|
101
113
|
}
|
|
102
114
|
|
|
115
|
+
/** The most one job writes to its output file; the file says so when it stops. */
|
|
116
|
+
export const JOB_OUTPUT_FILE_MAX_BYTES = 256 * 1024 * 1024
|
|
117
|
+
|
|
103
118
|
/**
|
|
104
119
|
* One thing a monitor has to say: a batch of its stdout lines, or a notice
|
|
105
120
|
* from the monitor itself (events suppressed, stopped, expired).
|
|
@@ -202,6 +217,8 @@ export interface JobProcess {
|
|
|
202
217
|
export interface StartJobParams {
|
|
203
218
|
readonly owner: string
|
|
204
219
|
readonly command: string
|
|
220
|
+
/** A short label for a command that is not a monitor; see {@link BackgroundJob.description}. */
|
|
221
|
+
readonly description?: string
|
|
205
222
|
readonly workingDirectory: string
|
|
206
223
|
readonly env?: Readonly<Record<string, string>>
|
|
207
224
|
/**
|
|
@@ -226,6 +243,13 @@ export interface StartJobParams {
|
|
|
226
243
|
* decoded the way a foreground command's are, not as a Linux guest's.
|
|
227
244
|
*/
|
|
228
245
|
readonly hostOutput?: boolean
|
|
246
|
+
/**
|
|
247
|
+
* A folder (made if it is missing, owner-only) for a file named after the
|
|
248
|
+
* job that receives everything the job writes. Absent, the output lives in
|
|
249
|
+
* memory only. A folder that cannot be made leaves the job without a file;
|
|
250
|
+
* the job still runs.
|
|
251
|
+
*/
|
|
252
|
+
readonly outputDirectory?: string
|
|
229
253
|
/**
|
|
230
254
|
* Run the command as a monitor: stdout is split into lines and delivered
|
|
231
255
|
* to `onMonitorEvent` listeners in batches, and the job is stopped at
|
|
@@ -661,6 +685,32 @@ export class BackgroundJobRegistry {
|
|
|
661
685
|
}
|
|
662
686
|
|
|
663
687
|
const id = createBackgroundJobId((candidate) => this.jobs.has(candidate))
|
|
688
|
+
// The job's output file, when the host named a folder for it. A file that
|
|
689
|
+
// cannot be opened is not a reason to refuse the job: the in-memory tail
|
|
690
|
+
// is still there, and the model is simply not told a path.
|
|
691
|
+
let outputFile: string | undefined
|
|
692
|
+
let outputFd: number | undefined
|
|
693
|
+
let outputWritten = 0
|
|
694
|
+
if (params.outputDirectory !== undefined) {
|
|
695
|
+
try {
|
|
696
|
+
mkdirSync(params.outputDirectory, { recursive: true, mode: 0o700 })
|
|
697
|
+
const file = joinPath(params.outputDirectory, `${id}.log`)
|
|
698
|
+
outputFd = openSync(file, 'a', 0o600)
|
|
699
|
+
outputFile = file
|
|
700
|
+
} catch {
|
|
701
|
+
outputFd = undefined
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
const closeOutputFile = (): void => {
|
|
705
|
+
if (outputFd === undefined) return
|
|
706
|
+
const fd = outputFd
|
|
707
|
+
outputFd = undefined
|
|
708
|
+
try {
|
|
709
|
+
closeSync(fd)
|
|
710
|
+
} catch {
|
|
711
|
+
// Nothing is left to flush: every write above was synchronous.
|
|
712
|
+
}
|
|
713
|
+
}
|
|
664
714
|
// Same scrub as the foreground path: inheritance is implicit, so the
|
|
665
715
|
// operator's provider credentials do not travel into a command nobody
|
|
666
716
|
// decided should see them. A background job outlives the call that
|
|
@@ -747,6 +797,10 @@ export class BackgroundJobRegistry {
|
|
|
747
797
|
command: params.command,
|
|
748
798
|
status: 'running',
|
|
749
799
|
startedAt,
|
|
800
|
+
...(outputFile !== undefined ? { outputFile } : {}),
|
|
801
|
+
...(!monitor && params.description !== undefined
|
|
802
|
+
? { description: params.description }
|
|
803
|
+
: {}),
|
|
750
804
|
...(monitor
|
|
751
805
|
? {
|
|
752
806
|
kind: 'monitor' as const,
|
|
@@ -772,6 +826,7 @@ export class BackgroundJobRegistry {
|
|
|
772
826
|
const finalize = (code: number | null, signal: NodeJS.Signals | null): void => {
|
|
773
827
|
if (finalized) return
|
|
774
828
|
finalized = true
|
|
829
|
+
closeOutputFile()
|
|
775
830
|
untrackAtHostExit()
|
|
776
831
|
entry.record = {
|
|
777
832
|
...entry.record,
|
|
@@ -867,6 +922,23 @@ export class BackgroundJobRegistry {
|
|
|
867
922
|
const chunk: OutputChunk = { stream, offset: entry.produced, bytes: Buffer.from(text) }
|
|
868
923
|
if (chunk.bytes.length === 0) return
|
|
869
924
|
entry.produced += chunk.bytes.length
|
|
925
|
+
if (outputFd !== undefined) {
|
|
926
|
+
try {
|
|
927
|
+
if (outputWritten + chunk.bytes.length <= JOB_OUTPUT_FILE_MAX_BYTES) {
|
|
928
|
+
writeSync(outputFd, chunk.bytes)
|
|
929
|
+
outputWritten += chunk.bytes.length
|
|
930
|
+
} else {
|
|
931
|
+
writeSync(
|
|
932
|
+
outputFd,
|
|
933
|
+
`\n[the output file stopped at ${JOB_OUTPUT_FILE_MAX_BYTES} bytes; the job kept running]\n`,
|
|
934
|
+
)
|
|
935
|
+
closeOutputFile()
|
|
936
|
+
}
|
|
937
|
+
} catch {
|
|
938
|
+
// A full disk must not take the job's live output with it.
|
|
939
|
+
closeOutputFile()
|
|
940
|
+
}
|
|
941
|
+
}
|
|
870
942
|
const line = lastLineOf(text)
|
|
871
943
|
entry.record = {
|
|
872
944
|
...entry.record,
|
|
@@ -1366,23 +1438,35 @@ export function bindOwner(
|
|
|
1366
1438
|
* reported, because the host wakes on its events.
|
|
1367
1439
|
*/
|
|
1368
1440
|
readonly onMonitorStarted?: (id: string) => void
|
|
1441
|
+
/**
|
|
1442
|
+
* Where each job's output file goes; see {@link StartJobParams.outputDirectory}.
|
|
1443
|
+
* A function, so the folder is asked for when a job starts.
|
|
1444
|
+
*/
|
|
1445
|
+
readonly outputDirectory?: string | (() => string | undefined)
|
|
1369
1446
|
} = {},
|
|
1370
1447
|
) {
|
|
1448
|
+
const outputDirectory = (): string | undefined =>
|
|
1449
|
+
typeof defaults.outputDirectory === 'function'
|
|
1450
|
+
? defaults.outputDirectory()
|
|
1451
|
+
: defaults.outputDirectory
|
|
1371
1452
|
const mine = (id: string): BackgroundJob => {
|
|
1372
1453
|
const job = registry.get(id)
|
|
1373
1454
|
if (job.owner !== owner) throw new UnknownBackgroundJobError({ id })
|
|
1374
1455
|
return job
|
|
1375
1456
|
}
|
|
1376
1457
|
const launch = (
|
|
1377
|
-
params: { command: string; workingDirectory?: string },
|
|
1458
|
+
params: { command: string; workingDirectory?: string; description?: string },
|
|
1378
1459
|
monitor?: StartJobParams['monitor'],
|
|
1379
1460
|
): BackgroundJob => {
|
|
1380
1461
|
const workingDirectory = params.workingDirectory ?? defaults.workingDirectory ?? process.cwd()
|
|
1381
1462
|
const spawnHost = defaults.spawn
|
|
1463
|
+
const jobsFolder = outputDirectory()
|
|
1382
1464
|
return registry.start({
|
|
1383
1465
|
owner,
|
|
1384
1466
|
command: params.command,
|
|
1385
1467
|
workingDirectory,
|
|
1468
|
+
...(!monitor && params.description !== undefined ? { description: params.description } : {}),
|
|
1469
|
+
...(jobsFolder !== undefined ? { outputDirectory: jobsFolder } : {}),
|
|
1386
1470
|
...(defaults.env ? { env: defaults.env } : {}),
|
|
1387
1471
|
...(spawnHost
|
|
1388
1472
|
? {
|
|
@@ -1400,7 +1484,8 @@ export function bindOwner(
|
|
|
1400
1484
|
const clampMonitorTimeout = (requested: number): number =>
|
|
1401
1485
|
Math.min(requested, defaults.monitorTimeoutCapMs ?? MONITOR_TIMEOUT_CAP_MS)
|
|
1402
1486
|
return {
|
|
1403
|
-
start: (params: { command: string; workingDirectory?: string }) =>
|
|
1487
|
+
start: (params: { command: string; workingDirectory?: string; description?: string }) =>
|
|
1488
|
+
launch(params),
|
|
1404
1489
|
// The same spawn, owner and cap as `start`, plus a deadline. The timeout
|
|
1405
1490
|
// is clamped to the host's ceiling and the clamped value is returned, so
|
|
1406
1491
|
// the number the model is told is the number that will fire.
|
|
@@ -1444,6 +1529,7 @@ export function bindOwner(
|
|
|
1444
1529
|
// running, with what it has written so far.
|
|
1445
1530
|
adopt: (params: {
|
|
1446
1531
|
command: string
|
|
1532
|
+
description?: string
|
|
1447
1533
|
child: ReturnType<typeof spawn>
|
|
1448
1534
|
workingDirectory?: string
|
|
1449
1535
|
initialOutput?: StartJobParams['initialOutput']
|
|
@@ -1451,9 +1537,13 @@ export function bindOwner(
|
|
|
1451
1537
|
registry.start({
|
|
1452
1538
|
owner,
|
|
1453
1539
|
command: params.command,
|
|
1540
|
+
...(params.description !== undefined ? { description: params.description } : {}),
|
|
1454
1541
|
workingDirectory: params.workingDirectory ?? defaults.workingDirectory ?? process.cwd(),
|
|
1455
1542
|
spawn: () => ({ child: params.child }),
|
|
1456
1543
|
hostOutput: true,
|
|
1544
|
+
...(outputDirectory() !== undefined
|
|
1545
|
+
? { outputDirectory: outputDirectory() as string }
|
|
1546
|
+
: {}),
|
|
1457
1547
|
...(params.initialOutput ? { initialOutput: params.initialOutput } : {}),
|
|
1458
1548
|
}),
|
|
1459
1549
|
// The owner is bound here, so a tool can offer its own waiting command and
|