@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/account/lock.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { join } from 'node:path'
|
|
2
|
+
import {
|
|
3
|
+
type FileLockOptions,
|
|
4
|
+
type FileLockSyncOptions,
|
|
5
|
+
runLocked,
|
|
6
|
+
runLockedSync,
|
|
7
|
+
} from '../utils/file-lock.js'
|
|
4
8
|
import { AccountLockError } from './types.js'
|
|
5
9
|
|
|
6
10
|
/**
|
|
@@ -11,103 +15,10 @@ export function codexRefreshLockPath(dir: string): string {
|
|
|
11
15
|
return join(dir, 'auth.json.namzu.lock')
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly attempts?: number
|
|
17
|
-
/** Waits between attempts; injected so a test never depends on the clock. */
|
|
18
|
-
readonly wait?: (attempt: number) => Promise<void>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function acquire(lockPath: string): string | undefined {
|
|
22
|
-
const token = `${process.pid}:${Date.now()}:${randomBytes(12).toString('hex')}`
|
|
23
|
-
mkdirSync(dirname(lockPath), { recursive: true, mode: 0o700 })
|
|
24
|
-
for (let pass = 0; pass < 2; pass++) {
|
|
25
|
-
let fd: number
|
|
26
|
-
try {
|
|
27
|
-
fd = openSync(lockPath, 'wx', 0o600)
|
|
28
|
-
} catch (error) {
|
|
29
|
-
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error
|
|
30
|
-
if (pass === 0 && reclaimIfStale(lockPath)) continue
|
|
31
|
-
return undefined
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
writeSync(fd, token)
|
|
35
|
-
} finally {
|
|
36
|
-
closeSync(fd)
|
|
37
|
-
}
|
|
38
|
-
return token
|
|
39
|
-
}
|
|
40
|
-
return undefined
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function pidOf(token: string): number | undefined {
|
|
44
|
-
const pid = Number.parseInt(token.split(':', 1)[0] ?? '', 10)
|
|
45
|
-
return Number.isInteger(pid) && pid > 0 ? pid : undefined
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function processIsDead(pid: number): boolean {
|
|
49
|
-
try {
|
|
50
|
-
process.kill(pid, 0)
|
|
51
|
-
return false
|
|
52
|
-
} catch (error) {
|
|
53
|
-
// EPERM means the process exists but belongs to someone else: alive.
|
|
54
|
-
return (error as NodeJS.ErrnoException).code === 'ESRCH'
|
|
55
|
-
}
|
|
56
|
-
}
|
|
18
|
+
/** The account locks follow the shared lock-file protocol in `utils/file-lock.ts`. */
|
|
19
|
+
export type AccountLockOptions = FileLockOptions
|
|
57
20
|
|
|
58
|
-
|
|
59
|
-
* Remove a lock whose recorded owner process no longer exists. Reclaimers are
|
|
60
|
-
* serialised by a guard file, and the lock is re-read under the guard, so a
|
|
61
|
-
* lock that was replaced by a live owner in the meantime is never removed.
|
|
62
|
-
*/
|
|
63
|
-
function reclaimIfStale(lockPath: string): boolean {
|
|
64
|
-
let observed: string
|
|
65
|
-
try {
|
|
66
|
-
observed = readFileSync(lockPath, 'utf8')
|
|
67
|
-
} catch {
|
|
68
|
-
return true // already gone; the caller may simply try again
|
|
69
|
-
}
|
|
70
|
-
const pid = pidOf(observed)
|
|
71
|
-
if (pid === undefined || !processIsDead(pid)) return false
|
|
72
|
-
const guard = `${lockPath}.reclaim`
|
|
73
|
-
let fd: number
|
|
74
|
-
try {
|
|
75
|
-
fd = openSync(guard, 'wx', 0o600)
|
|
76
|
-
} catch (error) {
|
|
77
|
-
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error
|
|
78
|
-
try {
|
|
79
|
-
const holder = pidOf(readFileSync(guard, 'utf8'))
|
|
80
|
-
if (holder !== undefined && processIsDead(holder)) rmSync(guard, { force: true })
|
|
81
|
-
} catch {
|
|
82
|
-
// The guard vanished or is unreadable; the next attempt decides.
|
|
83
|
-
}
|
|
84
|
-
return false
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
writeSync(fd, `${process.pid}`)
|
|
88
|
-
closeSync(fd)
|
|
89
|
-
let again: string | undefined
|
|
90
|
-
try {
|
|
91
|
-
again = readFileSync(lockPath, 'utf8')
|
|
92
|
-
} catch {
|
|
93
|
-
return true
|
|
94
|
-
}
|
|
95
|
-
if (again !== observed) return false
|
|
96
|
-
rmSync(lockPath, { force: true })
|
|
97
|
-
return true
|
|
98
|
-
} finally {
|
|
99
|
-
rmSync(guard, { force: true })
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function release(lockPath: string, token: string): void {
|
|
104
|
-
// Never remove a successor's lock if something else replaced the file.
|
|
105
|
-
try {
|
|
106
|
-
if (readFileSync(lockPath, 'utf8') === token) rmSync(lockPath, { force: true })
|
|
107
|
-
} catch {
|
|
108
|
-
// The work already has its result; a missing lock is not its failure.
|
|
109
|
-
}
|
|
110
|
-
}
|
|
21
|
+
export type AccountLockSyncOptions = FileLockSyncOptions
|
|
111
22
|
|
|
112
23
|
function refusal(lockPath: string): AccountLockError {
|
|
113
24
|
return new AccountLockError(
|
|
@@ -122,31 +33,12 @@ function refusal(lockPath: string): AccountLockError {
|
|
|
122
33
|
* recorded process has exited is reclaimed; a lock held by a live process is a
|
|
123
34
|
* refusal (or a wait, when attempts and a wait function are given).
|
|
124
35
|
*/
|
|
125
|
-
export
|
|
36
|
+
export function withAccountLock<T>(
|
|
126
37
|
lockPath: string,
|
|
127
38
|
operation: () => Promise<T> | T,
|
|
128
39
|
options: AccountLockOptions = {},
|
|
129
40
|
): Promise<T> {
|
|
130
|
-
|
|
131
|
-
let token: string | undefined
|
|
132
|
-
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
133
|
-
token = acquire(lockPath)
|
|
134
|
-
if (token !== undefined) break
|
|
135
|
-
if (attempt + 1 < attempts && options.wait) await options.wait(attempt)
|
|
136
|
-
}
|
|
137
|
-
if (token === undefined) throw refusal(lockPath)
|
|
138
|
-
try {
|
|
139
|
-
return await operation()
|
|
140
|
-
} finally {
|
|
141
|
-
release(lockPath, token)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface AccountLockSyncOptions {
|
|
146
|
-
/** How many times to try before refusing. Default 1. */
|
|
147
|
-
readonly attempts?: number
|
|
148
|
-
/** Blocks between attempts; injected so a test never depends on the clock. */
|
|
149
|
-
readonly wait?: (attempt: number) => void
|
|
41
|
+
return runLocked(lockPath, operation, options, refusal)
|
|
150
42
|
}
|
|
151
43
|
|
|
152
44
|
/** Synchronous form for short store mutations. */
|
|
@@ -155,19 +47,7 @@ export function withAccountLockSync<T>(
|
|
|
155
47
|
operation: () => T,
|
|
156
48
|
options: AccountLockSyncOptions = {},
|
|
157
49
|
): T {
|
|
158
|
-
|
|
159
|
-
let token: string | undefined
|
|
160
|
-
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
161
|
-
token = acquire(lockPath)
|
|
162
|
-
if (token !== undefined) break
|
|
163
|
-
if (attempt + 1 < attempts && options.wait) options.wait(attempt)
|
|
164
|
-
}
|
|
165
|
-
if (token === undefined) throw refusal(lockPath)
|
|
166
|
-
try {
|
|
167
|
-
return operation()
|
|
168
|
-
} finally {
|
|
169
|
-
release(lockPath, token)
|
|
170
|
-
}
|
|
50
|
+
return runLockedSync(lockPath, operation, options, refusal)
|
|
171
51
|
}
|
|
172
52
|
|
|
173
53
|
/**
|
package/src/account/registry.ts
CHANGED
|
@@ -15,6 +15,11 @@ import {
|
|
|
15
15
|
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path'
|
|
16
16
|
import { z } from 'zod'
|
|
17
17
|
import { resolveNamzuHome } from '../session/home.js'
|
|
18
|
+
import {
|
|
19
|
+
backupStateFile,
|
|
20
|
+
listStateFileCopies,
|
|
21
|
+
rewriteStateFileBackups,
|
|
22
|
+
} from '../utils/state-backup.js'
|
|
18
23
|
import { withAccountLockSync } from './lock.js'
|
|
19
24
|
import {
|
|
20
25
|
type Account,
|
|
@@ -108,6 +113,24 @@ function writeAtomic(path: string, text: string): void {
|
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
|
|
116
|
+
/**
|
|
117
|
+
* A recovery copy of the store without the removed key: its entry goes, and a
|
|
118
|
+
* copy that does not parse has the key's text cut out wherever it appears, so
|
|
119
|
+
* the rest of a damaged copy is still there to recover from.
|
|
120
|
+
*/
|
|
121
|
+
function withoutKey(text: string, removed: { ref: string; secret: string }): string {
|
|
122
|
+
let json: unknown
|
|
123
|
+
try {
|
|
124
|
+
json = JSON.parse(text)
|
|
125
|
+
} catch {
|
|
126
|
+
return removed.secret ? text.split(removed.secret).join('') : text
|
|
127
|
+
}
|
|
128
|
+
const keys = (json as { keys?: unknown } | null)?.keys
|
|
129
|
+
if (typeof keys !== 'object' || keys === null || !Object.hasOwn(keys, removed.ref)) return text
|
|
130
|
+
delete (keys as Record<string, unknown>)[removed.ref]
|
|
131
|
+
return `${JSON.stringify(json, null, 2)}\n`
|
|
132
|
+
}
|
|
133
|
+
|
|
111
134
|
export function createAccountRegistry(options: AccountRegistryOptions = {}): AccountRegistry {
|
|
112
135
|
const home = options.home ?? resolveNamzuHome()
|
|
113
136
|
const path = join(home, ACCOUNTS_FILE_NAME)
|
|
@@ -139,24 +162,46 @@ export function createAccountRegistry(options: AccountRegistryOptions = {}): Acc
|
|
|
139
162
|
try {
|
|
140
163
|
json = JSON.parse(text)
|
|
141
164
|
} catch {
|
|
142
|
-
throw new AccountRegistryError(
|
|
165
|
+
throw new AccountRegistryError(
|
|
166
|
+
`${path} is not valid JSON; no account was changed.${newestCopySentence()}`,
|
|
167
|
+
)
|
|
143
168
|
}
|
|
144
169
|
const parsed = FileSchema.safeParse(json)
|
|
145
170
|
if (!parsed.success) {
|
|
146
171
|
throw new AccountRegistryError(
|
|
147
|
-
`${path} is not a version ${ACCOUNTS_FILE_VERSION} account store
|
|
172
|
+
`${path} is not a version ${ACCOUNTS_FILE_VERSION} account store.${newestCopySentence()}`,
|
|
148
173
|
)
|
|
149
174
|
}
|
|
150
175
|
return parsed.data
|
|
151
176
|
}
|
|
152
177
|
|
|
153
|
-
|
|
178
|
+
/** Where the newest recovery copy is, for a refusal over a store that does not read. */
|
|
179
|
+
function newestCopySentence(): string {
|
|
180
|
+
const copy = listStateFileCopies(home, ACCOUNTS_FILE_NAME).find((c) => c.kind === 'backup')
|
|
181
|
+
if (!copy) return ''
|
|
182
|
+
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}.`
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Read, change and write the store under its lock. `redact`, given the
|
|
187
|
+
* change's result, names a secret the change removes: it is cut out of every
|
|
188
|
+
* recovery copy, and out of the one taken now, before the store is written,
|
|
189
|
+
* so no copy keeps it even if the process stops half way.
|
|
190
|
+
*/
|
|
191
|
+
function mutate<T>(
|
|
192
|
+
change: (file: StoreFile) => T,
|
|
193
|
+
redact?: (result: T) => ((text: string) => string) | undefined,
|
|
194
|
+
): T {
|
|
154
195
|
mkdirSync(home, { recursive: true, mode: 0o700 })
|
|
155
196
|
return withAccountLockSync(
|
|
156
197
|
lockPath,
|
|
157
198
|
() => {
|
|
158
199
|
const file = read()
|
|
159
200
|
const result = change(file)
|
|
201
|
+
const cut = redact?.(result)
|
|
202
|
+
if (cut) rewriteStateFileBackups(home, ACCOUNTS_FILE_NAME, cut)
|
|
203
|
+
// The store as it was, under <home>/backups/, before it is replaced.
|
|
204
|
+
backupStateFile(path, { home, now: () => now().getTime(), ...(cut ? { redact: cut } : {}) })
|
|
160
205
|
writeAtomic(path, `${JSON.stringify(file, null, 2)}\n`)
|
|
161
206
|
try {
|
|
162
207
|
chmodSync(path, 0o600)
|
|
@@ -345,24 +390,33 @@ export function createAccountRegistry(options: AccountRegistryOptions = {}): Acc
|
|
|
345
390
|
'The existing sign-in is not an account that can be removed.',
|
|
346
391
|
)
|
|
347
392
|
}
|
|
348
|
-
mutate(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
393
|
+
mutate(
|
|
394
|
+
(file): { ref: string; secret: string } | undefined => {
|
|
395
|
+
const index = file.accounts.findIndex((a) => a.id === id)
|
|
396
|
+
const current = file.accounts[index]
|
|
397
|
+
if (!current) throw new AccountRegistryError('No such account.')
|
|
398
|
+
file.accounts.splice(index, 1)
|
|
399
|
+
if (current.source.kind === 'api-key') {
|
|
400
|
+
const ref = current.source.keyRef
|
|
401
|
+
const secret = file.keys[ref] ?? ''
|
|
402
|
+
delete file.keys[ref]
|
|
403
|
+
return { ref, secret }
|
|
404
|
+
}
|
|
405
|
+
if (
|
|
406
|
+
insideAccountsRoot(ownDir(current.source)) &&
|
|
407
|
+
!file.accounts.some(
|
|
408
|
+
(a) => a.source.kind === 'codex-home' && nests(ownDir(current.source), a.source.dir),
|
|
409
|
+
)
|
|
410
|
+
) {
|
|
411
|
+
// Only a directory this registry could have created, and that holds no
|
|
412
|
+
// other account's directory, is ever deleted.
|
|
413
|
+
rmSync(ownDir(current.source), { recursive: true, force: true })
|
|
414
|
+
}
|
|
415
|
+
return undefined
|
|
416
|
+
},
|
|
417
|
+
// A removed key must not live on in a recovery copy of the store.
|
|
418
|
+
(removed) => (removed ? (text) => withoutKey(text, removed) : undefined),
|
|
419
|
+
)
|
|
366
420
|
},
|
|
367
421
|
|
|
368
422
|
async resolve(id, signal): Promise<ResolvedAccountCredential> {
|
package/src/account/types.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* @experimental
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import { FileLockError } from '../utils/file-lock.js'
|
|
13
|
+
|
|
12
14
|
/** `<provider>:<label>`. The label is `[a-z0-9-]{1,32}`; `default` is reserved for today's sign-in. */
|
|
13
15
|
export type AccountId = string
|
|
14
16
|
|
|
@@ -89,15 +91,12 @@ export class AccountRegistryError extends Error {
|
|
|
89
91
|
override readonly name = 'AccountRegistryError'
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
) {
|
|
99
|
-
super(message)
|
|
100
|
-
}
|
|
94
|
+
/**
|
|
95
|
+
* Another owner holds the lock for a store or an account's credential file. A
|
|
96
|
+
* {@link FileLockError}, so a caller can catch either.
|
|
97
|
+
*/
|
|
98
|
+
export class AccountLockError extends FileLockError {
|
|
99
|
+
override readonly name = 'AccountLockError' as const
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
/**
|