@namzu/sdk 65.2.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 +161 -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 +98 -8
- 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/browser/index.d.ts +12 -0
- package/dist/types/browser/index.d.ts.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 +121 -8
- 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/browser/index.ts +9 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,166 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 67.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- c1989fd: The auto-review classifier now sees how each earlier call ended, and the working tree before a git command that can destroy local work. For a host that uses the `classify` review mode, these change with no option set:
|
|
8
|
+
|
|
9
|
+
- Before a shell call that runs a destructive git command (a hard reset, a forced clean, a checkout or restore over changes, a forced push, a forced branch deletion, a dropped or cleared stash, a rebase that starts, skips or abandons one), the kernel runs `git status --porcelain --branch` as a subprocess in the folder the command runs in, with a 2 second deadline, no optional locks, the file system monitor off and no lazy fetch, and shows the classifier its answer. It is skipped for a sandboxed shell, and whenever the line does not name the folder for certain (a `cd` joined to the command by anything but `&&`, a closed subshell, `popd`, `eval`, `GIT_DIR` and the like). `ResumeContext.gitStatus(line, dialect)` and `AutoReviewRequest.gitStatus` carry it; a failure attaches nothing.
|
|
10
|
+
- The classifier's prompt has new rules, so some verdicts change: a call that was rejected by the person, blocked by permissions or blocked by auto mode and comes back is judged as a second try at it; a refusal by plan mode or `strict`, an unanswered question and an answer with no verdict are not; a git command that would discard the listed files is blocked unless the person asked for that loss, and a list with no files is weak evidence only.
|
|
11
|
+
- `ToolMessage` has an optional `outcome` (`ToolResultOutcome`: `interrupted`, `rejected`, `refused_by_mode`, `blocked_by_permissions`, `blocked_by_auto_mode`, `auto_mode_unavailable`), written by the executor on the result of a call that did not simply run. `createToolMessage` takes it as a fifth, optional argument. The classifier reads it, never the result's text.
|
|
12
|
+
- A call the classifier gave no verdict on is told `autoReviewUnavailableFeedback(reason)` ("Auto mode could not check this action: ... it may be tried again") instead of the block text. An action too long for the check to read now has its own `cause: 'oversized'` (it was `unreadable`), is told `autoReviewOversizedFeedback(reason)` to split it up, and is not counted as an answer with no verdict.
|
|
13
|
+
- `AutoReviewLimits.noVerdict` (off unless set) counts answers in a row that were no verdict. The block that completes the run carries `noVerdictLimitReached`, and the review policy then refuses the batch with `autoReviewStoppedFeedback(reason)`, calls the new `ReviewPolicyOptions.onClassifierUnavailable`, and ends the turn.
|
|
14
|
+
|
|
15
|
+
What to check before upgrading: a host that finds auto mode refusals by matching the text "Blocked by auto mode:" should also match `AUTO_REVIEW_UNAVAILABLE_PREFIX`, or read `ToolMessage.outcome`. A host that handles every value of `AutoReviewDecision['cause']` gains `oversized`, and one that treated `unreadable` as "too long" should read `oversized` instead. A host whose process may not start `git` loses nothing but the status.
|
|
16
|
+
|
|
17
|
+
This is a major release. Nothing is removed or renamed, but two things a host may rely on change: an over-long action now returns `cause: 'oversized'` instead of `unreadable` (the `AutoReviewDecision['cause']` union is wider, so an exhaustive switch over it needs the new case), and a destructive git command now starts a `git status` subprocess by default. To keep the old reading of an over-long action, treat `oversized` as you treated `unreadable`; a host whose process must not start `git` should run the classifier with a sandboxed shell, where the status is skipped.
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 735ab77: Adds your Namzu network: the pieces a host needs for machines of one person to find each other on a private network, join with one Allow, show one roster of sessions, pass roles, and exchange messages under the local safety rules. It is new, `@experimental` and used only if you call it: `createNamzuNetwork`, `createMdnsDiscovery`, `decideMail`, `evaluateMembership`, the roster helpers and `formatRoleContext`. Nothing in an existing host changes until it adopts it.
|
|
22
|
+
|
|
23
|
+
Additive changes to what already existed, which an exhaustive `switch` over these unions will notice: `PeerSessionKind` has `'net'`, `NoticeOutcome` has `'expired'`, `DeliverRequest` has an optional `remote`, `PeerRecord` has optional `role`, `roleBy` and `roleAt`, `formatPeerMessage` takes an optional `machine`, and `SystemEventKind` / `SystemEventStatus` have `'role-notice'` and `'expired'`. An endpoint accepts `remote` only from a verified `net` sender and refuses a `net` sender that omits it; no existing sender is affected. The network listens only on private addresses, never for an unattended host, and writes nothing under `~/.namzu/network` until a host starts it.
|
|
24
|
+
|
|
25
|
+
Also exported for a host that holds its own mail the way the network does: `HoldQueue` and `SlidingCounter` (with the `HeldEntry` and `HoldQueueOptions` types). A member that let a joiner in now shows it by the name the joiner gave in its request, before the joiner's own greeting arrives; it showed the machine id until then.
|
|
26
|
+
|
|
27
|
+
Also new: `NetworkService.cancelJoin()` and `nearbyNetworks()`, `FRESH_NETWORK_MS`, the `'cancelled'` result of `join-ended` and `join()`, and `permissionModeWord` (the screen's name for a mode: `classify` is `auto`, `auto` is `unattended`), now used in the hold reasons of `decideMail` and in the `formatPeerMessage` wrapper, which used to print the kernel names. A machine that is alone in a network founded less than a minute ago and hears another such network asks the younger to join the older (`ping_net` of such a network adds `ageMs`). `AuditEntry` has an optional `direction` (`in` or `out`); the service now writes role changes with a hash and size of the text and every mail decision on the sending side too.
|
|
28
|
+
|
|
29
|
+
Membership no longer orders statements by the times a signer wrote in them: a revocation always removes what its target admitted, a machine cannot revoke one above it in its own admission chain, so a stolen machine cannot back-date its way back in (`Revocation.cascade` stays in the wire shape and no longer changes the outcome). `createMdnsDiscovery().start()` can be called again to begin or change an advertisement (it was ignored after the first call), drops packets from public sources and addresses outside the sender's subnet, and `start(undefined)` withdraws one. The certificate name is random on each start. The `role-notice` text says the role was written elsewhere and not reviewed; a role from another machine is refused for a bypass session. Text from another machine (roster names, folders, modes, roles, reasons) has control characters stripped. `JoinTable.find` by name matches only a unique name.
|
|
30
|
+
|
|
31
|
+
Trusted networks: `createNamzuNetwork` takes `autoAdmit` (`'trusted-networks'` by default, `'always'`, `'never'`) and `networkIdentity`; a member admits a join request without an Allow when it comes from a network in the machine's `trusted-networks.json` (or any private network with `always`), emitting a `join-auto` event and writing `join_allowed` with an "automatically" decision. New on `NetworkService`: `networkOf(address)`, `allow(query, { trust })`, `trustedNetworks()`, `trustNetwork()`, `renameNetwork()`, `untrustNetwork()`; new audit events `network_trusted` and `network_untrusted`; new exports `createNetworkIdentity`, `createSystemGatewayReader`, `networkFingerprint` and the types `AutoAdmitSetting`, `NetworkRef`, `TrustedNetwork`, `Gateway`, `GatewayReader`. A network whose default gateway's hardware address cannot be read is unknown and never trusted.
|
|
32
|
+
|
|
33
|
+
- ce8b85d: A turn's session log no longer writes the system prompt twice. A `request_envelope` record whose system text is the turn's own prompt carries `systemPromptFrom: 'turn_started'` and no `systemPrompt`; read the text from the turn's `turn_started`. A request whose prompt a step rewrote keeps its `systemPrompt`, and logs written before this read unchanged. The live `request_envelope` event still carries the text. If you read `systemPrompt` from `request_envelope` records, fall back to the turn's `turn_started` record when it is missing.
|
|
34
|
+
- ce8b85d: New exports for small files that more than one process changes: `withFileLock`, `withFileLockSync`, `lockPathFor`, `FileLockError`, `inspectFileLock` (with the `FileLockState` type) and `EMPTY_LOCK_GRACE_MS` (the lock-file protocol the account locks already used, now under a general name), and `backupStateFile`, `preserveUnreadableStateFile`, `listStateFileCopies`, `rewriteStateFileBackups`, `stateBackupsDir`, `writeFileAtomicSync` with `STATE_BACKUPS_DIR`, `STATE_BACKUP_KEEP` (5) and `STATE_BACKUP_MIN_INTERVAL_MS` (60 s). `AccountLockError` is now a subclass of `FileLockError`; its `name` is still the literal `'AccountLockError'`, and `AccountLockOptions` / `AccountLockSyncOptions` are the same shapes as before.
|
|
35
|
+
|
|
36
|
+
The account locks, and every lock on this protocol, now also take over a lock that was left without its owner written into it (a full disk, or a process killed right after creating it) once it is ten seconds old, and a lock that carries this process's own pid but is not held by it (left by an earlier process with the same pid, as after a container restart). Before, either one refused every later change until the file was removed by hand. A process whose lock body cannot be written now removes the lock before it reports the error.
|
|
37
|
+
|
|
38
|
+
The account registry now copies `accounts.json` to `<home>/backups/accounts.json.backup.<epoch ms>` (mode 0600, at most one a minute, five kept) before each change, and removing an API-key account takes that key out of every copy before the store is written. A store that cannot be read is still refused, and the refusal now names the newest copy and when it was taken. A file the CLI cannot read is kept as `<home>/backups/<file>.corrupted.<epoch ms>`. Nothing to change on your side; delete `<home>/backups/` if you do not want the copies.
|
|
39
|
+
|
|
40
|
+
- ce8b85d: Adds `sweepPrivateTempRoot` (with `TEMP_SWEEP_MAX_AGE_MS`, `TEMP_SWEEP_EVERY_MS`, `TEMP_SWEEP_STAMP`, `HOOK_ENV_OWNER_FILE`) to clear old session scratch folders, dead `hook-env*` folders and dangling `s-*` names from Namzu's private temp folder. A hook-env folder now records an `owner.json` with its process id; nothing to do for existing callers.
|
|
41
|
+
|
|
42
|
+
A hook folder whose owning process reads as gone is now also kept until nothing in it changed for ten minutes, so a process in another pid namespace sharing the temp folder keeps its folder.
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- ce8b85d: A write into a project's `.namzu/worktrees/` is now asked about like any other
|
|
47
|
+
write under `.namzu`. The exemption dates from when delegated work kept its
|
|
48
|
+
worktrees there; they live in the Namzu home now
|
|
49
|
+
(`projects/<slug>/worktrees/`), and a write inside one is still judged against
|
|
50
|
+
that worktree's own root, so delegated work asks no more often than before.
|
|
51
|
+
Only a write you make into an old `.namzu/worktrees/` folder now asks first.
|
|
52
|
+
- ce8b85d: No change in behaviour. The protected-path list's notes now say that `.namzu/settings.json` and `.namzu/settings.local.json` are covered through the `.namzu` folder, and that `namzu.config.local.json` stays protected as the local file's earlier name.
|
|
53
|
+
- ce8b85d: The session index (`index.sqlite`) is now readable by its owner only. It holds
|
|
54
|
+
the opening of every prompt and the full text of tool results and replies, and
|
|
55
|
+
it used to take the umask's mode (0644 on most systems), so other users of the
|
|
56
|
+
machine could read it while the session logs themselves were 0600. A new index
|
|
57
|
+
is created 0600 in a folder created 0700; opening an existing index narrows it,
|
|
58
|
+
and any journal file beside it, to 0600 when you own it. Session folders and
|
|
59
|
+
`lease.<fence>.json` files are created owner-only too. Nothing to do: the next
|
|
60
|
+
open fixes an existing index, and no data changes.
|
|
61
|
+
|
|
62
|
+
## 66.0.0
|
|
63
|
+
|
|
64
|
+
### Major Changes
|
|
65
|
+
|
|
66
|
+
- e350ce6: In `accept-edits`, an in-place `sed` now runs without asking only as `sed -i [-E|-r|--posix] 's/old/new/[flags]' file...` on literal paths inside the roots. Before, `-i` with any attached backup suffix (`-i.bak`, `--in-place=/elsewhere`), `-e`, `-n`, `;`-joined scripts, other delimiters and line commands such as `3d` were also approved; a backup suffix named a second file nothing checked. Those are now asked about. To keep a call from asking, write it in the one form above, or add an allow rule for it. `sed` without `-i` and the other file commands are unchanged.
|
|
67
|
+
- db1019a: `analyzeContextUsage` now draws the compaction reserve whenever `autoCompact` is on, for every `windowSource`. Before, a window the provider or the model table declares (`windowSource: 'auto'`) had no reserve, so `categories` had no `buffer` entry and `Free space` was larger by the reserve (up to 33,000 tokens). A host that draws these categories shows the reserve, and a smaller free space, on those windows; to keep the old numbers, drop the `buffer` category before drawing. `windowSource` stays in the input and no longer changes the result.
|
|
68
|
+
|
|
69
|
+
New: `measuredBy: 'provider' | 'estimate'` on the input says who counted `contextTokens`. The kernel's own estimate covers only messages and the tool catalogue, so with `'estimate'` the system prompt, server instructions, agents, instruction files and skills are added on top instead of being subtracted, which fixes an understated Messages row on a conversation with no reply yet or just after a shortening. Absent is read as `'provider'`, as before. New: `deferredToolTokens` and `deferredMcpToolTokens` size the tool definitions that load only when needed as categories `deferred-tools` and `deferred-mcp-tools` of kind `deferred` (`ContextCategoryKind` gains `'deferred'`); they are never counted in `totalTokens`. `ToolManager.toDeferredLLMTools()` renders those definitions for sizing, and `DEFERRED_CATEGORY_ORDER` is exported.
|
|
70
|
+
|
|
71
|
+
- 85cf094: The dangerous-command floor (`denyDangerousPatterns: true`) no longer refuses `sudo`, `doas`, `pkexec`, `su -`, `ssh user@host`, `eval` of a dynamic string, or a `curl`/`wget` piped into a shell. Those now come back from the gate as `review`, which a mode that asks puts to the person (allow once) and which `bypass` and `auto` approve like any other review. They are not ask rules: `explicitReview` and `askRule` stay unset on the call. If your host relied on the gate to refuse them, set `denyDangerousPatterns: 'strict'` (or add the rule `{ type: 'deny_dangerous_patterns', strict: true }`), which keeps every one of the previous patterns a denial in every mode, matched on the raw text as before. A host with nobody to ask now sees those calls refused by its review policy rather than by the gate, with that policy's wording.
|
|
72
|
+
|
|
73
|
+
Still refused in every mode, now in every spelling and only when it is the command that runs: a recursive removal of the file system root, the home folder, a top-level directory, or a variable that may be empty followed by one (`rm -fr /`, `rm -rf ~`, `rm -rf "$DIR/usr"`); `mkfs`; `dd` writing to a device with `of=/dev/…`; a fork bomb; `chmod 777 /`. `rm -rf /tmp/build` and `rm -f /usr/local/.wtest` match nothing, where the old `rm -rf /` pattern refused the first.
|
|
74
|
+
|
|
75
|
+
The floor now reads the commands a line runs (through the shell lexer), not its text, so a word inside quotes, an `echo` argument, a heredoc body or a comment is no longer a match, while a real `sudo` after `;`, `&&`, `|`, in a subshell, in `$( )` or in a `bash -c` payload still is. The refusal says what was refused (`this command removes the file system root.`) and tells the model that nothing ran and not to retry it or a reworded form; the old fixed "rewording it will not help" sentence is gone. `describeRule` for `deny_dangerous_patterns` takes the call to describe it. `denyDangerousPatterns` now accepts `boolean | 'strict'` and the rule type gains an optional `strict`. The `bash` and `monitor` tools' own check now stops only the irreversible tier, so it never takes back a command the gate let through as a question, and a command line given without a tool definition or as a tool's whole serialized input is still read as raw text.
|
|
76
|
+
|
|
77
|
+
The floor also reads through `xargs` and `find -exec`, a variable head word and a substitution that prints a name. `find / -delete` and `shred`, `wipefs -a` and a redirection on a device are stops. `mkfs` on a regular file, `dd of=/dev/shm/…` and `/dev/pts/…` are no longer stops.
|
|
78
|
+
|
|
79
|
+
- e31b74f: New tools for a host that has a person present: `buildSessionTimerTools` (`timer_set`, `timer_list`, `timer_cancel`) for prompts the model sets to fire into the conversation once or on a schedule, and `buildWakeUpTool` (`wake_up`) with `clampWakeUpDelay` for a loop the model paces itself.
|
|
80
|
+
|
|
81
|
+
Breaking for a host that implements `SessionLoopHost`: `session_loop` `create` may now leave out `interval` to start a self-paced loop, so `SessionLoopHost.create` can receive no `interval` (`SessionLoop.paced` marks such a loop). Handle a missing `interval` by starting a self-paced loop, or refuse it with a message. Nothing changes for a host that does not implement `SessionLoopHost`; `session_loop` with an interval and `schedule` behave as before.
|
|
82
|
+
|
|
83
|
+
### Minor Changes
|
|
84
|
+
|
|
85
|
+
- 6744aa7: Three defaults changed, and a page dialog can now be answered either way.
|
|
86
|
+
|
|
87
|
+
`browser.signInDetection` now defaults to `page` (it was `address`), in the CLI setting and in `PlaywrightBrowserHost` / the classifier when the option is left out. A page at a `/login`-style address no longer stops the turn by itself: the model is told once that it cannot type a password or code and carries on with every other step. CAPTCHAs, bot blocks, HTTP authentication, the known sign-in hosts and `signInAddresses` still stop the turn, and credential fields are still never typed. To keep the old behaviour set `browser.signInDetection: address` (a host built directly passes `signInDetection: 'address'`; `isSignInAddress`, `classifyHumanRequired` and `signInNotice` now take the address behaviour only with that option).
|
|
88
|
+
|
|
89
|
+
The `pick` decision point now defaults to `on` when a `decision` model is configured and the point is not named (it was `off`), so `ui_do` is offered and acts only when the decision model is sure (confidence 0.85, a 0.4 lead). The connect flow also writes `pick: on` instead of `pick: shadow`. To keep the old behaviour set `decision.points.pick: off` (or `shadow`). The other points keep `off`, and nothing changes without a decision model.
|
|
90
|
+
|
|
91
|
+
`browser_act dialog` can now accept a held page dialog: `accept: true` answers an alert or a confirm and answers a prompt with `promptText` (empty when omitted). The Playwright host used to refuse every accept. A prompt whose message asks for a password, passcode or one-time code refuses `promptText` and says nothing was typed; a second dialog while one is held is still dismissed. `@namzu/browser` exports `asksForCredential`, and the tool description in `@namzu/sdk` says the model may accept or dismiss.
|
|
92
|
+
|
|
93
|
+
- 7fa32b6: Computer use on Windows stops failing in ways the screen did not show.
|
|
94
|
+
|
|
95
|
+
A click that the driver refused with `No screenshot frame for window …` no longer reads as `sent, not confirmed`: nothing had been sent. The adapter reads the window again with a screenshot and sends the click once more, and when the window changed size it says `not_delivered`, safe to repeat. A window id is now one number however it is written (`0x2b040a`, `2819082`, a bare number or `{ "hwnd": 2819082 }`), so a read of a window's controls, a screenshot and a click agree on it. An input that reads its place off a screenshot, sent before any screenshot was taken, is not sent: the tool takes the display screenshot and returns it as the result, saying that nothing was clicked or typed, so the model chooses its target on a frame it has seen and sends the action again (a batch runs the actions before that input and says which ran). Before, it failed with `no screenshot taken yet` and a separate screenshot call was needed. `expand` and `collapse` report `done, verified` only when the window shows what opened and shows it again a moment later; a menu that opened and closed again is `sent, not confirmed`. The tool description tells the model to do on the screen what the person asked to see done on the screen, and to say whether it typed in an application or wrote a file.
|
|
96
|
+
|
|
97
|
+
`@namzu/computer-use` adds the host option `idleReleaseMs` (default 60 000) and the optional `Adapter.release()`: a host with no call in flight for that long ends its cua-driver process (and the cursor overlay it draws) and the two resident PowerShell helpers beside it (the overlay border and the accessibility host), and starts them again on the next call. `Presence` and `AccessibilityBackend` gain an optional `release()`. Before, every conversation of an app kept its own driver until it closed. `idleReleaseMs: 0` keeps the old behaviour. A ref taken before a release is stale, as after any driver restart; a window screenshot is carried over to the new process by the first input on it, so a pause before a click is not refused. A release that finds a call began meanwhile does nothing.
|
|
98
|
+
|
|
99
|
+
`@namzu/sdk` tells the model, where the `bash` tool is Git Bash on Windows, to start PowerShell with its script in single quotes or in a quoted heredoc and never in double quotes, where bash expands `$name` first, and to write text files as UTF-8 without a BOM; `@namzu/cli` repeats that in the environment facts. No action is needed to upgrade.
|
|
100
|
+
|
|
101
|
+
- 5f0611a: Pasted text and the time of a message reach the model as their own notes, and five tool results say what to do next.
|
|
102
|
+
|
|
103
|
+
New and optional, nothing to change unless you want them: `UserMessage.pasted` (ranges of `content` the person pasted, each with a nonce) and `UserMessage.timeNote` (one line saying when the message was sent). The model request puts each pasted range inside a `<namzu-pasted-NONCE>` frame with one line of guidance and puts the time line in front of the message; the stored `content` is untouched, so every view of the conversation shows what the person typed and a resume sends the same bytes. New exports: `newPasteNonce`, `framePastedContent`, `typedTextOf`, `usablePastedSpans`, `PASTED_FRAME_GUIDANCE`, `PASTED_MARKER`, and the types `PastedSpan` and `AcpPastedRange`. The compaction state, the memory candidate and the auto-mode transcript no longer file pasted text as something the person said (`extractFromUserMessage` now also takes the whole `UserMessage`). ACP: `session/prompt` accepts `pasted: [{ start, end }]` for a host that opts in with `supportsPromptPasted` (advertised as `promptPasted`); a host that does not opt in refuses the field, so a client that never sends it is unaffected.
|
|
104
|
+
|
|
105
|
+
Tool results changed in wording, not in shape. A successful `edit` or `write` now ends with `The file on disk is now exactly this; no need to read it back.`; an `edit` refused for an unread file says not to read it again; a `read` or `edit` of a missing path says to find the file with `glob`; a `write` over an unread file and a `grep` with an inline flag such as `(?i)` each say what to do instead. Code that matches the whole text of a write receipt with an end anchor (`... bytes$`) must allow the added sentence; the structured `facts` and `data` are the same.
|
|
106
|
+
|
|
107
|
+
- 4b31a12: Plan mode in the terminal no longer costs the model extra requests. `exit_plan_mode` is loaded from the first request instead of being found through a search, `sed -n '1,40p' file` and other print-only `sed -n` commands count as read-only and run in plan mode, and when a call is refused the model is told to write the plan file and call `exit_plan_mode` rather than to present the plan as its reply (the SDK exports `PLAN_MODE_REFUSAL_WITH_PLAN_FILE`). The plan approval box now shows the plan as formatted text (headings, tables, code, bold) instead of markdown source, with its pager counted in rows as drawn, and offers "Yes, and use auto mode" first when the session can enter auto mode.
|
|
108
|
+
- db1019a: `AcpPromptOptions` gains an optional `hypermode?: boolean`, and the ACP server forwards it to the host instead of refusing the prompt with "Invalid prompt settings". A host that does not read it ignores it. Nothing to change for existing callers.
|
|
109
|
+
- 3eda627: The model is no longer sent to search its own conversation for what it can already see. One rule is told wherever history comes up: answer from your own visible messages and tool results, and use the history tools only for something no longer visible. Pointers to those tools (`additionalEvidence`, `continuations`, the tool names) are shown only once a compaction summary or a cleared tool result is in the conversation. A recalled assistant message is framed as what the model itself said, to be quoted for a "why did you say" question, and only a question about the current state of the world is re-checked; the working doctrine says the same. The history planner now uses a mostly usable plan instead of refusing it (over-long lists are cut, a quote the history does not hold is ignored, a reply in a code fence or with a repeated key is read), reads the start and end of a long reply, is skipped when the question points at the model's own whole last reply, and a lookup that found passages is no longer announced as "not available". New optional `EvidenceRecallOptions.log` receives one line with the reason a lookup stage did not run. Nothing a caller does has to change.
|
|
110
|
+
- 38299fb: `bash` accepts an optional `description` (a few words for what the command does). A job started with `run_in_background`, or a command moved to the background, keeps it as `BackgroundJob.description`, and `BackgroundJobRegistryRef.start`, `adopt` and `StartJobParams` take it, so a host can name the job to a person. Nothing changes for a caller that passes none.
|
|
111
|
+
- 2d0d863: The `browser` tool opens a page the agent wrote, by its path: relative, absolute, a Windows form (`C:\site\index.html`) or a `file:` URL, when the file is inside the session's work folder, a folder added to it or Namzu's scratch folder. Before, every such address was refused and an agent that built a page could not look at it. The page is served from a read-only server on 127.0.0.1 (random port, random token, one folder, no directory listing) that stops with the browser session, so relative CSS, images and scripts load and screenshots work, while nothing else on the disk is reachable. A path outside those folders, a link that leaves them, `.git`, a secret file, anything the read rules deny, and a missing file are refused with the reason. Web addresses are checked as before, and the browser is still never given a `file:` address. A host that builds the tools with `createBrowserTools` gets this without a change; call the new `closeBrowserLocalPages(host)` when the browser session ends to stop the server at once. `createBrowserTools(host, { localPages: false })` turns this off for a browser that is not on this machine; the Pal computer's browser does.
|
|
112
|
+
- c385adc: The typed facts of a command that went to a background job now name the job (`jobId`) and, when its own time limit moved it, that limit in milliseconds (`timeLimitMs`); `admitToolFacts` reads both back. A host can use them to show what the job is doing now. Both fields are optional, so nothing changes for a host that ignores them.
|
|
113
|
+
- b39dfb0: `createComputerUseTool` gains `onObservation` (told, after each call that returned a screenshot, the picture made small, the application and where a click landed) and its tool now has `appOf(input)`, `appsOf(input)` (every application a batch reaches) and `consequence(input)`: the application a call works on, and why a call should be put to a person even in an allowed application (a key that closes or deletes, or a control that discards, sends or submits). The first call in each application presents as "Using <application>". The ACP permission request's calls may carry `computer: { app, apps?, consequence }`. Existing callers change nothing.
|
|
114
|
+
- db1019a: `createComputerUseTool` takes `deniedApps`, a list of application names the tool never acts in. A call whose window (a window id it names, a window screenshot's window, or the window under a click or in front for a key) is a listed application is refused before the host is touched, with a message that says nothing was done; a look at the whole display and `list_windows` are not refused. When the host cannot list windows, an acting call is refused while the list is not empty. Absent or empty, behaviour is unchanged.
|
|
115
|
+
|
|
116
|
+
A `ui_snapshot` or `wait_for` that names no window is checked against the window in front, and a window id the fresh window list cannot place (or a list that could not be read, for a call that names a window) is refused while the list is not empty.
|
|
117
|
+
|
|
118
|
+
- 123e225: Nine new hook events, all additive: `pre_model_switch` and `post_model_switch`, `elicitation` and `elicitation_result`, `directory_added`, `instructions_loaded`, `user_prompt_expansion`, `task_created` and `task_completed`. A shell hook can attach to any of them (written `PreModelSwitch`, `PostModelSwitch`, `Elicitation`, `ElicitationResult`, `DirectoryAdded`, `InstructionsLoaded`, `UserPromptExpansion`, `TaskCreated`, `TaskCompleted`). The two task events are fired by the kernel in the tool step, before `task_create` and before a `task_update` that completes a task; a hook can refuse either and the model is told why. Existing events and hooks change in no way. Hooks that already exit `2` on a task tool through `pre_tool_use` keep working. Plugin hook authors who `switch` over every `PluginHookEvent` must add the new names. Documented in the hook events page.
|
|
119
|
+
- 20e79e3: The warning that a provider cannot see images or read documents now comes once, with the message that carries the picture or file, instead of before every later reply in the conversation. Adds the export `estimateMessagesTokens(messages)`, the kernel's own size estimate of a message list (text, tool calls and results, pictures, documents).
|
|
120
|
+
- db1019a: Adds the optional `LLMProvider.readLimits(signal?)` and the `ProviderLimits`, `ProviderLimitWindow` and `ProviderLimitCredit` types, so a driver can report what its vendor says about the account (usage windows, credit left). A driver that does not implement it reads as "not reported"; nothing existing changes.
|
|
121
|
+
- 3eda627: New export `historyContentShed(messages)`, which says whether the conversation has lost content (a compaction summary, a cleared tool result, or a tool result cut at storage that points at the file holding the rest). A history lookup now treats a clipped tool result as shed content, so its pointers appear and the planner runs. A focus word past the 16-word allowance is dropped with its word instead of failing the plan, a question that points at a different earlier reply ("the first answer") still goes to the planner, and the planner's repeated-key repair looks only at the plan's own keys. The operator log line for a rejected lookup carries a reason code and no error text. Scratch-folder links are replaced atomically and dangling ones removed. Nothing a caller does has to change.
|
|
122
|
+
- d715cc7: A session's scratch folder is made when its first turn starts, not when a tool call first names it, and a background job's output is saved to a file. Nothing is removed and no export changes name.
|
|
123
|
+
|
|
124
|
+
What changes for a host: `query` makes the folder (owner-only, under the private temporary folder) before the first request, and a delegated turn uses its parent's folder instead of one of its own. New optional `QueryParams.scratchpadDirectory` names the folder for a host that keeps no session state on disk (without `paths` there was none); a path outside the private temporary folder is refused and the turn runs without one. Every background job (`bash` with `run_in_background`, a foreground command moved to the background, `monitor`) now also writes its whole output to `<scratch>/jobs/<job id>.log`; `BackgroundJob.outputFile`, the `outputFile` in the tool results' `data`, and the `bash`, `job` and `wait_for_job` result text carry the path. `bindOwner` takes an optional `outputDirectory` and `StartJobParams` an optional `outputDirectory`; a host that passes neither sees no change. The `bash` tool description now tells the model that long and background output is saved for it. The working rules say a reproduction script stays in the scratch folder unless it becomes a test. This lowers how often a session leaves stray files; it does not guarantee none.
|
|
125
|
+
|
|
126
|
+
If a test of yours counted the folders under the temporary root after a turn, it now sees the scratch folder even when no tool ran.
|
|
127
|
+
|
|
128
|
+
- 666b0fb: A shell write into the session scratch folder through `$NAMZU_SCRATCH` (`printf x > $NAMZU_SCRATCH/out.csv`) no longer asks "Outside the working directory". A test run piped through `tail` or `grep` whose output shows the runner's own summary (node, vitest, jest, pytest, cargo, go), or that uses `set -o pipefail` or `exit ${PIPESTATUS[0]}`, is counted as read, so the end-of-turn line no longer says the pipe hides whether it passed after a passing run (a failing summary now counts as a failure). A saved shell rule covers a line whose other commands only read, and declines a line that writes a file through a redirection. New exports: `isReadOnlyCommandLine` and `writesThroughRedirection`. Behaviour change for operator rules: an `argument_pattern` allow rule on a shell command (`make *`) no longer covers a line that also writes a file through a redirection (`make > build.log`); such a line is asked about, as before the rule existed. A go test run piped through `tail` is read as passed only from a bare `PASS` line, not from `ok` lines alone, since an earlier package's `FAIL` may have been cut. `exit ${PIPESTATUS[0]}` counts as the check's own status only when the check is the first stage of its pipe.
|
|
129
|
+
- 12f8afd: A file a successful `bash` call printed now counts as read for `edit` in more cases: after a leading `cd <dir> &&`, beside `ls`, `wc`, `stat` or `file` on the same line, and through `head`, `tail`, `sed -n` ranges or a pipe into another printer. A whole print (`cat`, `nl`, `sed -n p`) records the whole body; the others record a window, which `edit` accepts but which is not taken as the whole file. A failed command, a glob, a variable, a redirection into a file, a pipe into a non-printer, or a file changed after it was printed earns nothing, so `edit` still refuses it as unread or stale. Beyond that, `edit` on a file the session has not read now reads it and applies the edit in the same call when every `old_string` matches exactly (once, or at least once under `replace_all`); a missing or ambiguous match, or an insertion, is still refused with the numbered contents, and a file changed after a read is still refused as stale.
|
|
130
|
+
- 78631cb: A tool can declare `loadsWith`, the names of tools that are needed right after it. When `search_tools` loads such a tool it loads those companions in the same call and names them in its result, so a deferred session no longer pays a second search and model request for them. `browser` and `browser_act` load together, and `task_create` loads `task_update`. Nothing breaks: a tool without `loadsWith` loads as before.
|
|
131
|
+
- c2840a1: `search_tools` has an exact form and a better ranking, and tools it loaded stay loaded across a compaction. Nothing you call changes, so there is nothing to do; read the list for behaviour you may notice.
|
|
132
|
+
|
|
133
|
+
- `select:a,b` loads exactly the named deferred tools (up to 64, an MCP tool by full or short name). A query that is exactly one tool's name loads that tool and no other match, plus any companions it declares. `+term` requires a word in the result. The new optional `max_results` input (1 to 64, default 5) bounds a keyword search.
|
|
134
|
+
- Keyword ranking now weighs a word of a tool's name far above a word of its description (name word 10, name piece 5, description word 2, required `+term`), and `search` counts when a tool's name has it, so `web search` finds `web_search`. If you relied on the old weights (name 12 / contains 8 / description 5 / argument 3), results may order differently.
|
|
135
|
+
- A compaction summary now carries the tools loaded before it (`SystemMessage.revealedTools`, `collectRevealedTools`, an optional third argument of `buildCompactionMessage`), `ToolManager.availability` counts them, and the summary ends with a line naming them. Before, every loaded tool went back to deferred after a compaction and the model had to search again. A summary written without receipts behaves as before.
|
|
136
|
+
- The turn loop now calls `ToolManager.refresh()` each iteration and records one `tools-changed` context entry when a live toolset gained or lost tools (`ToolManager.describeChange`). `query()` mounts `search_tools` for a deferred live toolset that has no tools yet. `ToolsView` gained an optional `select`.
|
|
137
|
+
|
|
138
|
+
The tools-changed announcement and the loaded-tools line in a compaction summary are bounded and end in a count. A `select:` list past 64 names says which names were not loaded, and a short MCP name that matches several tools says it loaded all of them. `DATA_EPOCH` is deliberately unchanged: an older engine that resumes a session written by this one ignores the new `revealedTools` field, so loaded tools go back to deferred after the resume and nothing else is lost.
|
|
139
|
+
|
|
140
|
+
- db1019a: `GitWorktreeDriver` takes an optional `branchPrefix` (default `namzu`, so its branches are unchanged): a new worktree's branch is `<branchPrefix>/<label>`. The prefix is one safe component of up to 40 characters and the constructor refuses any other. A worktree whose branch carries a different valid prefix is still owned, because its path and Git's registration of that exact branch decide ownership.
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- db1019a: A Desktop conversation now honours the engine settings that Settings saves, the same as `namzu exec`: the longest answer, thinking budget, check before finishing, hook refusals, tokens and spend per task, workflow caps, hand-back, extra folders, hypermode, the refusal fallback, and shedding old results after a long break were saved but ignored there. `exec --json` now reads the workflow caps too. "Forbid auto mode" and "Forbid bypass mode" now remove those modes from the engine's advertised list; the ACP `initialize` answer carries `promptPermissionModes: []` when both are closed (it was left out), so a client can tell that from an older host that sends no list. Nothing to change on your side; a limit you had saved starts to apply in Desktop.
|
|
145
|
+
- db1019a: `ACPServer` sends a gateway error's stable code as the JSON-RPC error's `data: { code }`. A gateway attaches it by throwing an error with a `data: { code: 'some-name' }` property (a short lower-case name); nothing else on the error is sent, and an error without one is answered as before.
|
|
146
|
+
- 1090dd3: The coding-agent working rules (`CODING_AGENT_WORKING_DOCTRINE`) are reworded and shorter, and the `web_search` and `web_fetch` descriptions now carry the web usage rules. No export is removed or renamed. `CODING_AGENT_DELEGATION_DOCTRINE` loses the fork, explore, worktree and "how is it going" paragraphs (the host's tool descriptions carry those now). `webGuidanceContribution` and `WEB_GUIDANCE_CONTRIBUTION_ID` are marked `@deprecated` and unchanged: the same rules are in the tool descriptions, so a host that registers the contribution can stop, and a host that keeps it only repeats them. The working rules now say: a report that something is broken is a request to fix it, an investigation runs to its cause, finish the whole task and do not end on a plan, compaction is automatic, and an action that is hard to reverse or visible outside the machine is confirmed first. If you matched on the old sentences (for example `Answering a question`), match on the new headings `Finishing the work` and `Questions, problems and investigations`.
|
|
147
|
+
- 16896ad: The `[Request interrupted by user]` note now appears only between two messages you typed yourself. A goal-round prompt or a steering note that arrives before the first reply is no longer taken for an interruption.
|
|
148
|
+
- 78631cb: Calling a deferred tool before its schema is loaded now returns `Tool "<name>" is not loaded yet. Call search_tools with its exact name, then call it again.` where it returned `Tool "<name>" is deferred and cannot be executed`. A host that matched the old text should match on the tool being deferred instead; nothing else changes.
|
|
149
|
+
- db1019a: The coding-agent working rules gain one rule: answer about the work, name a path only when the person needs it, and do not describe the machine, the sandbox, the session, scratch folders or the tools used unless asked. "Name what was actually executed" now reads "Name which checks were actually run". No API changes.
|
|
150
|
+
- 16896ad: An `edit` or `write` that cannot run (an edit whose text is not in a file never read, an overwrite of a file never read, a file that changed since it was read) and a `bash` command that opens with a long `sleep` are refused before the permission dialog, with the same message as before, so you are no longer asked to approve a call that fails the moment you say yes. A request you stopped before the model replied is marked `[Request interrupted by user]` in what the model reads, so the next message is not mistaken for a second part of it, also after resuming the conversation.
|
|
151
|
+
- 3eda627: A shell command run by a session with a scratch folder now gets `NAMZU_SCRATCH`, a short link (`<private temp root>/s-<8 hex>`) to that folder, so a command need not type the long encoded path. The real folder and its path are unchanged; a value the host puts in `turnConfig.env` wins.
|
|
152
|
+
- c2840a1: When `search_tools` loads nothing it now says why: the named tool is already loaded (call it directly), it is not available in this session (carry on without it), or no deferred tool matches, in which case the answer adds that a tool not listed under `deferred_tools` does not exist in the session. Before, all three came back as the same "No deferred tools matching" sentence, which models read as "this tool does not exist" and then searched elsewhere.
|
|
153
|
+
- f91386d: A command the agent runs in the foreground now gets end-of-file on stdin at once, on every platform, instead of waiting on an input that never came until its timeout. A caller of `spawnHostShell` that needs to feed the child still passes its own `stdio`. The `bash` tool description and its moved-to-the-background message now tell the model the shell has no keyboard, so it uses a non-interactive flag, passes the answer in the command, or asks the person.
|
|
154
|
+
- 75c6f70: A picture attached to a model that reads text only now tells you so. When the provider reads images but the chosen model does not (its listing says text only, for example some OpenRouter or local models), the picture was left out of the request with no word to you. Now the run emits the usual `capability_warning`, with the `model` field set, and the terminal says "This model can't see images, so it won't see the picture you attached. Pick a model that reads images with /model to include it."
|
|
155
|
+
|
|
156
|
+
## 65.3.0
|
|
157
|
+
|
|
158
|
+
### Minor Changes
|
|
159
|
+
|
|
160
|
+
- e44bdab: A browser action that changed nothing visible now says what the page sent. Where the result used to read `Effect: no visible change.` it reads `Effect: no visible change on the page; it sent 1 request.` when the page started `fetch`, XHR or document requests after the action, with the method and path (no query string) of the first three inside the untrusted `web-page-change` envelope. Images, scripts, beacons and other resources are not counted. This lets a model tell a control that only talks to the server from one that does nothing.
|
|
161
|
+
|
|
162
|
+
`@namzu/sdk` adds the optional `BrowserEffect.requests` and `BrowserEffect.requestCount`; nothing existing changes, and a host that does not set them renders the old sentence. `@namzu/cli` adds one line to the web-task guidance telling the model, when a step cannot be done or confirmed, to carry on with every other step the page allows and report the step left. No action is needed to upgrade.
|
|
163
|
+
|
|
3
164
|
## 65.2.0
|
|
4
165
|
|
|
5
166
|
### Minor Changes
|
package/dist/account/lock.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { type FileLockOptions, type FileLockSyncOptions } from '../utils/file-lock.js';
|
|
1
2
|
/**
|
|
2
3
|
* The lock file beside a Codex account's `auth.json`. One lock per account
|
|
3
4
|
* directory, so a stuck account never blocks another.
|
|
4
5
|
*/
|
|
5
6
|
export declare function codexRefreshLockPath(dir: string): string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** Waits between attempts; injected so a test never depends on the clock. */
|
|
10
|
-
readonly wait?: (attempt: number) => Promise<void>;
|
|
11
|
-
}
|
|
7
|
+
/** The account locks follow the shared lock-file protocol in `utils/file-lock.ts`. */
|
|
8
|
+
export type AccountLockOptions = FileLockOptions;
|
|
9
|
+
export type AccountLockSyncOptions = FileLockSyncOptions;
|
|
12
10
|
/**
|
|
13
11
|
* Run `operation` while holding the lock file at `lockPath`. The lock is held
|
|
14
12
|
* across local read/write work, never across a user prompt. A lock whose
|
|
@@ -16,12 +14,6 @@ export interface AccountLockOptions {
|
|
|
16
14
|
* refusal (or a wait, when attempts and a wait function are given).
|
|
17
15
|
*/
|
|
18
16
|
export declare function withAccountLock<T>(lockPath: string, operation: () => Promise<T> | T, options?: AccountLockOptions): Promise<T>;
|
|
19
|
-
export interface AccountLockSyncOptions {
|
|
20
|
-
/** How many times to try before refusing. Default 1. */
|
|
21
|
-
readonly attempts?: number;
|
|
22
|
-
/** Blocks between attempts; injected so a test never depends on the clock. */
|
|
23
|
-
readonly wait?: (attempt: number) => void;
|
|
24
|
-
}
|
|
25
17
|
/** Synchronous form for short store mutations. */
|
|
26
18
|
export declare function withAccountLockSync<T>(lockPath: string, operation: () => T, options?: AccountLockSyncOptions): T;
|
|
27
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/account/lock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/account/lock.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAGxB,MAAM,uBAAuB,CAAA;AAG9B;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAA;AAEhD,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAA;AASxD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC/B,OAAO,GAAE,kBAAuB,GAC9B,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED,kDAAkD;AAClD,wBAAgB,mBAAmB,CAAC,CAAC,EACpC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,EAClB,OAAO,GAAE,sBAA2B,GAClC,CAAC,CAEH;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACvC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC/B,OAAO,GAAE,kBAAuB,GAC9B,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
package/dist/account/lock.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { dirname, join } from 'node:path';
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { runLocked, runLockedSync, } from '../utils/file-lock.js';
|
|
4
3
|
import { AccountLockError } from './types.js';
|
|
5
4
|
/**
|
|
6
5
|
* The lock file beside a Codex account's `auth.json`. One lock per account
|
|
@@ -9,108 +8,6 @@ import { AccountLockError } from './types.js';
|
|
|
9
8
|
export function codexRefreshLockPath(dir) {
|
|
10
9
|
return join(dir, 'auth.json.namzu.lock');
|
|
11
10
|
}
|
|
12
|
-
function acquire(lockPath) {
|
|
13
|
-
const token = `${process.pid}:${Date.now()}:${randomBytes(12).toString('hex')}`;
|
|
14
|
-
mkdirSync(dirname(lockPath), { recursive: true, mode: 0o700 });
|
|
15
|
-
for (let pass = 0; pass < 2; pass++) {
|
|
16
|
-
let fd;
|
|
17
|
-
try {
|
|
18
|
-
fd = openSync(lockPath, 'wx', 0o600);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
if (error.code !== 'EEXIST')
|
|
22
|
-
throw error;
|
|
23
|
-
if (pass === 0 && reclaimIfStale(lockPath))
|
|
24
|
-
continue;
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
writeSync(fd, token);
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
closeSync(fd);
|
|
32
|
-
}
|
|
33
|
-
return token;
|
|
34
|
-
}
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
function pidOf(token) {
|
|
38
|
-
const pid = Number.parseInt(token.split(':', 1)[0] ?? '', 10);
|
|
39
|
-
return Number.isInteger(pid) && pid > 0 ? pid : undefined;
|
|
40
|
-
}
|
|
41
|
-
function processIsDead(pid) {
|
|
42
|
-
try {
|
|
43
|
-
process.kill(pid, 0);
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
// EPERM means the process exists but belongs to someone else: alive.
|
|
48
|
-
return error.code === 'ESRCH';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Remove a lock whose recorded owner process no longer exists. Reclaimers are
|
|
53
|
-
* serialised by a guard file, and the lock is re-read under the guard, so a
|
|
54
|
-
* lock that was replaced by a live owner in the meantime is never removed.
|
|
55
|
-
*/
|
|
56
|
-
function reclaimIfStale(lockPath) {
|
|
57
|
-
let observed;
|
|
58
|
-
try {
|
|
59
|
-
observed = readFileSync(lockPath, 'utf8');
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
return true; // already gone; the caller may simply try again
|
|
63
|
-
}
|
|
64
|
-
const pid = pidOf(observed);
|
|
65
|
-
if (pid === undefined || !processIsDead(pid))
|
|
66
|
-
return false;
|
|
67
|
-
const guard = `${lockPath}.reclaim`;
|
|
68
|
-
let fd;
|
|
69
|
-
try {
|
|
70
|
-
fd = openSync(guard, 'wx', 0o600);
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
if (error.code !== 'EEXIST')
|
|
74
|
-
throw error;
|
|
75
|
-
try {
|
|
76
|
-
const holder = pidOf(readFileSync(guard, 'utf8'));
|
|
77
|
-
if (holder !== undefined && processIsDead(holder))
|
|
78
|
-
rmSync(guard, { force: true });
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
// The guard vanished or is unreadable; the next attempt decides.
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
writeSync(fd, `${process.pid}`);
|
|
87
|
-
closeSync(fd);
|
|
88
|
-
let again;
|
|
89
|
-
try {
|
|
90
|
-
again = readFileSync(lockPath, 'utf8');
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
if (again !== observed)
|
|
96
|
-
return false;
|
|
97
|
-
rmSync(lockPath, { force: true });
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
finally {
|
|
101
|
-
rmSync(guard, { force: true });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function release(lockPath, token) {
|
|
105
|
-
// Never remove a successor's lock if something else replaced the file.
|
|
106
|
-
try {
|
|
107
|
-
if (readFileSync(lockPath, 'utf8') === token)
|
|
108
|
-
rmSync(lockPath, { force: true });
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
// The work already has its result; a missing lock is not its failure.
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
11
|
function refusal(lockPath) {
|
|
115
12
|
return new AccountLockError(lockPath, `another owner holds the account lock ${lockPath}. The lock is reclaimed on its own when the process that recorded it has exited; if that process is still running, wait for it to finish.`);
|
|
116
13
|
}
|
|
@@ -120,44 +17,12 @@ function refusal(lockPath) {
|
|
|
120
17
|
* recorded process has exited is reclaimed; a lock held by a live process is a
|
|
121
18
|
* refusal (or a wait, when attempts and a wait function are given).
|
|
122
19
|
*/
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
let token;
|
|
126
|
-
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
127
|
-
token = acquire(lockPath);
|
|
128
|
-
if (token !== undefined)
|
|
129
|
-
break;
|
|
130
|
-
if (attempt + 1 < attempts && options.wait)
|
|
131
|
-
await options.wait(attempt);
|
|
132
|
-
}
|
|
133
|
-
if (token === undefined)
|
|
134
|
-
throw refusal(lockPath);
|
|
135
|
-
try {
|
|
136
|
-
return await operation();
|
|
137
|
-
}
|
|
138
|
-
finally {
|
|
139
|
-
release(lockPath, token);
|
|
140
|
-
}
|
|
20
|
+
export function withAccountLock(lockPath, operation, options = {}) {
|
|
21
|
+
return runLocked(lockPath, operation, options, refusal);
|
|
141
22
|
}
|
|
142
23
|
/** Synchronous form for short store mutations. */
|
|
143
24
|
export function withAccountLockSync(lockPath, operation, options = {}) {
|
|
144
|
-
|
|
145
|
-
let token;
|
|
146
|
-
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
147
|
-
token = acquire(lockPath);
|
|
148
|
-
if (token !== undefined)
|
|
149
|
-
break;
|
|
150
|
-
if (attempt + 1 < attempts && options.wait)
|
|
151
|
-
options.wait(attempt);
|
|
152
|
-
}
|
|
153
|
-
if (token === undefined)
|
|
154
|
-
throw refusal(lockPath);
|
|
155
|
-
try {
|
|
156
|
-
return operation();
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
release(lockPath, token);
|
|
160
|
-
}
|
|
25
|
+
return runLockedSync(lockPath, operation, options, refusal);
|
|
161
26
|
}
|
|
162
27
|
/**
|
|
163
28
|
* Serialise a Codex account's read-refresh-write. A reader that implements
|
package/dist/account/lock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/account/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/account/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAGN,SAAS,EACT,aAAa,GACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC/C,OAAO,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAA;AACzC,CAAC;AAOD,SAAS,OAAO,CAAC,QAAgB;IAChC,OAAO,IAAI,gBAAgB,CAC1B,QAAQ,EACR,wCAAwC,QAAQ,2IAA2I,CAC3L,CAAA;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC9B,QAAgB,EAChB,SAA+B,EAC/B,UAA8B,EAAE;IAEhC,OAAO,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AACxD,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,mBAAmB,CAClC,QAAgB,EAChB,SAAkB,EAClB,UAAkC,EAAE;IAEpC,OAAO,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,GAAW,EACX,SAA+B,EAC/B,UAA8B,EAAE;IAEhC,OAAO,eAAe,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AACtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/account/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/account/registry.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEN,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,eAAe,EAOpB,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,kBAAkB,kBAAkB,CAAA;AACjD,eAAO,MAAM,qBAAqB,IAAI,CAAA;AA+BtC,MAAM,WAAW,sBAAsB;IACtC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,2FAA2F;IAC3F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAA;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C;AAMD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAEpE;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAI1F;AAyCD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CA6U3F"}
|
package/dist/account/registry.js
CHANGED
|
@@ -3,6 +3,7 @@ import { chmodSync, closeSync, fsyncSync, mkdirSync, openSync, readFileSync, rea
|
|
|
3
3
|
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { resolveNamzuHome } from '../session/home.js';
|
|
6
|
+
import { backupStateFile, listStateFileCopies, rewriteStateFileBackups, } from '../utils/state-backup.js';
|
|
6
7
|
import { withAccountLockSync } from './lock.js';
|
|
7
8
|
import { AccountRegistryError, CredentialWithdrawnError, DEFAULT_ACCOUNT_LABEL, } from './types.js';
|
|
8
9
|
export const ACCOUNTS_FILE_NAME = 'accounts.json';
|
|
@@ -70,6 +71,25 @@ function writeAtomic(path, text) {
|
|
|
70
71
|
throw error;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* A recovery copy of the store without the removed key: its entry goes, and a
|
|
76
|
+
* copy that does not parse has the key's text cut out wherever it appears, so
|
|
77
|
+
* the rest of a damaged copy is still there to recover from.
|
|
78
|
+
*/
|
|
79
|
+
function withoutKey(text, removed) {
|
|
80
|
+
let json;
|
|
81
|
+
try {
|
|
82
|
+
json = JSON.parse(text);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return removed.secret ? text.split(removed.secret).join('') : text;
|
|
86
|
+
}
|
|
87
|
+
const keys = json?.keys;
|
|
88
|
+
if (typeof keys !== 'object' || keys === null || !Object.hasOwn(keys, removed.ref))
|
|
89
|
+
return text;
|
|
90
|
+
delete keys[removed.ref];
|
|
91
|
+
return `${JSON.stringify(json, null, 2)}\n`;
|
|
92
|
+
}
|
|
73
93
|
export function createAccountRegistry(options = {}) {
|
|
74
94
|
const home = options.home ?? resolveNamzuHome();
|
|
75
95
|
const path = join(home, ACCOUNTS_FILE_NAME);
|
|
@@ -101,19 +121,37 @@ export function createAccountRegistry(options = {}) {
|
|
|
101
121
|
json = JSON.parse(text);
|
|
102
122
|
}
|
|
103
123
|
catch {
|
|
104
|
-
throw new AccountRegistryError(`${path} is not valid JSON; no account was changed
|
|
124
|
+
throw new AccountRegistryError(`${path} is not valid JSON; no account was changed.${newestCopySentence()}`);
|
|
105
125
|
}
|
|
106
126
|
const parsed = FileSchema.safeParse(json);
|
|
107
127
|
if (!parsed.success) {
|
|
108
|
-
throw new AccountRegistryError(`${path} is not a version ${ACCOUNTS_FILE_VERSION} account store
|
|
128
|
+
throw new AccountRegistryError(`${path} is not a version ${ACCOUNTS_FILE_VERSION} account store.${newestCopySentence()}`);
|
|
109
129
|
}
|
|
110
130
|
return parsed.data;
|
|
111
131
|
}
|
|
112
|
-
|
|
132
|
+
/** Where the newest recovery copy is, for a refusal over a store that does not read. */
|
|
133
|
+
function newestCopySentence() {
|
|
134
|
+
const copy = listStateFileCopies(home, ACCOUNTS_FILE_NAME).find((c) => c.kind === 'backup');
|
|
135
|
+
if (!copy)
|
|
136
|
+
return '';
|
|
137
|
+
return ` The newest recovery copy is ${copy.path}, the store as it was before a change at ${new Date(copy.takenAt).toISOString()}; that change and any later one are not in it. To go back to it, copy it over ${path}.`;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Read, change and write the store under its lock. `redact`, given the
|
|
141
|
+
* change's result, names a secret the change removes: it is cut out of every
|
|
142
|
+
* recovery copy, and out of the one taken now, before the store is written,
|
|
143
|
+
* so no copy keeps it even if the process stops half way.
|
|
144
|
+
*/
|
|
145
|
+
function mutate(change, redact) {
|
|
113
146
|
mkdirSync(home, { recursive: true, mode: 0o700 });
|
|
114
147
|
return withAccountLockSync(lockPath, () => {
|
|
115
148
|
const file = read();
|
|
116
149
|
const result = change(file);
|
|
150
|
+
const cut = redact?.(result);
|
|
151
|
+
if (cut)
|
|
152
|
+
rewriteStateFileBackups(home, ACCOUNTS_FILE_NAME, cut);
|
|
153
|
+
// The store as it was, under <home>/backups/, before it is replaced.
|
|
154
|
+
backupStateFile(path, { home, now: () => now().getTime(), ...(cut ? { redact: cut } : {}) });
|
|
117
155
|
writeAtomic(path, `${JSON.stringify(file, null, 2)}\n`);
|
|
118
156
|
try {
|
|
119
157
|
chmodSync(path, 0o600);
|
|
@@ -290,15 +328,21 @@ export function createAccountRegistry(options = {}) {
|
|
|
290
328
|
throw new AccountRegistryError('No such account.');
|
|
291
329
|
file.accounts.splice(index, 1);
|
|
292
330
|
if (current.source.kind === 'api-key') {
|
|
293
|
-
|
|
331
|
+
const ref = current.source.keyRef;
|
|
332
|
+
const secret = file.keys[ref] ?? '';
|
|
333
|
+
delete file.keys[ref];
|
|
334
|
+
return { ref, secret };
|
|
294
335
|
}
|
|
295
|
-
|
|
336
|
+
if (insideAccountsRoot(ownDir(current.source)) &&
|
|
296
337
|
!file.accounts.some((a) => a.source.kind === 'codex-home' && nests(ownDir(current.source), a.source.dir))) {
|
|
297
338
|
// Only a directory this registry could have created, and that holds no
|
|
298
339
|
// other account's directory, is ever deleted.
|
|
299
340
|
rmSync(ownDir(current.source), { recursive: true, force: true });
|
|
300
341
|
}
|
|
301
|
-
|
|
342
|
+
return undefined;
|
|
343
|
+
},
|
|
344
|
+
// A removed key must not live on in a recovery copy of the store.
|
|
345
|
+
(removed) => (removed ? (text) => withoutKey(text, removed) : undefined));
|
|
302
346
|
},
|
|
303
347
|
async resolve(id, signal) {
|
|
304
348
|
const account = registry.get(id);
|