@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
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `namzu-net/1` wire protocol: newline-delimited JSON inside mutual TLS,
|
|
3
|
+
* one request and one response per exchange. Every schema is `.strict()`; a
|
|
4
|
+
* frame with a field this build does not know is refused rather than half read.
|
|
5
|
+
*
|
|
6
|
+
* Nothing in a roster carries a full path, a token, a conversation id or a
|
|
7
|
+
* message text.
|
|
8
|
+
*
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
export declare const NET_PROTOCOL = "namzu-net/1";
|
|
13
|
+
/** One authenticated line, request or response. */
|
|
14
|
+
export declare const MAX_NET_LINE_BYTES: number;
|
|
15
|
+
/** A line from a machine that is not (yet) a member. */
|
|
16
|
+
export declare const MAX_PREAUTH_LINE_BYTES: number;
|
|
17
|
+
export declare const MAX_NET_TEXT_BYTES: number;
|
|
18
|
+
export declare const MAX_ROLE_BYTES = 500;
|
|
19
|
+
export declare const MAX_NAME_LENGTH = 40;
|
|
20
|
+
export declare const MAX_ROSTER_SESSIONS = 64;
|
|
21
|
+
export declare const MAX_MEMBERS = 64;
|
|
22
|
+
export declare const MAX_HOPS = 3;
|
|
23
|
+
declare const HostPortSchema: z.ZodObject<{
|
|
24
|
+
host: z.ZodString;
|
|
25
|
+
port: z.ZodNumber;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type HostPort = z.infer<typeof HostPortSchema>;
|
|
28
|
+
/** Remove control characters, collapse whitespace, cut to `max` characters. */
|
|
29
|
+
export declare function sanitizeName(value: string, max?: number): string;
|
|
30
|
+
/** A role: free text, one paragraph, at most 500 bytes. Returns undefined for an empty result. */
|
|
31
|
+
export declare function sanitizeRole(value: string): string | undefined;
|
|
32
|
+
export declare const RosterSessionSchema: z.ZodObject<{
|
|
33
|
+
ref: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
folder: z.ZodString;
|
|
36
|
+
state: z.ZodEnum<{
|
|
37
|
+
running: "running";
|
|
38
|
+
idle: "idle";
|
|
39
|
+
"awaiting-approval": "awaiting-approval";
|
|
40
|
+
}>;
|
|
41
|
+
mode: z.ZodString;
|
|
42
|
+
role: z.ZodOptional<z.ZodString>;
|
|
43
|
+
acceptsMessages: z.ZodBoolean;
|
|
44
|
+
kind: z.ZodLiteral<"tui">;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export type RosterSession = z.infer<typeof RosterSessionSchema>;
|
|
47
|
+
export declare const RosterMachineSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
role: z.ZodOptional<z.ZodString>;
|
|
51
|
+
platform: z.ZodString;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export type RosterMachine = z.infer<typeof RosterMachineSchema>;
|
|
54
|
+
export declare const RosterSchema: z.ZodObject<{
|
|
55
|
+
machine: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
role: z.ZodOptional<z.ZodString>;
|
|
59
|
+
platform: z.ZodString;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
62
|
+
ref: z.ZodString;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
folder: z.ZodString;
|
|
65
|
+
state: z.ZodEnum<{
|
|
66
|
+
running: "running";
|
|
67
|
+
idle: "idle";
|
|
68
|
+
"awaiting-approval": "awaiting-approval";
|
|
69
|
+
}>;
|
|
70
|
+
mode: z.ZodString;
|
|
71
|
+
role: z.ZodOptional<z.ZodString>;
|
|
72
|
+
acceptsMessages: z.ZodBoolean;
|
|
73
|
+
kind: z.ZodLiteral<"tui">;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type Roster = z.infer<typeof RosterSchema>;
|
|
77
|
+
export declare const PingNetRequestSchema: z.ZodObject<{
|
|
78
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
79
|
+
op: z.ZodLiteral<"ping_net">;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
export declare const JoinRequestSchema: z.ZodObject<{
|
|
82
|
+
machineName: z.ZodString;
|
|
83
|
+
publicKey: z.ZodString;
|
|
84
|
+
nonce: z.ZodString;
|
|
85
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
86
|
+
op: z.ZodLiteral<"join_request">;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export type JoinRequest = z.infer<typeof JoinRequestSchema>;
|
|
89
|
+
export declare const HelloRequestSchema: z.ZodObject<{
|
|
90
|
+
machineName: z.ZodString;
|
|
91
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
92
|
+
host: z.ZodString;
|
|
93
|
+
port: z.ZodNumber;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
protocolMax: z.ZodNumber;
|
|
96
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
97
|
+
op: z.ZodLiteral<"hello">;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
export declare const MembersSyncRequestSchema: z.ZodObject<{
|
|
100
|
+
admissions: z.ZodArray<z.ZodObject<{
|
|
101
|
+
netId: z.ZodString;
|
|
102
|
+
machineId: z.ZodString;
|
|
103
|
+
publicKey: z.ZodString;
|
|
104
|
+
admittedBy: z.ZodString;
|
|
105
|
+
admittedAt: z.ZodNumber;
|
|
106
|
+
signature: z.ZodString;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
revocations: z.ZodArray<z.ZodObject<{
|
|
109
|
+
netId: z.ZodString;
|
|
110
|
+
machineId: z.ZodString;
|
|
111
|
+
revokedBy: z.ZodString;
|
|
112
|
+
revokedAt: z.ZodNumber;
|
|
113
|
+
cascade: z.ZodBoolean;
|
|
114
|
+
signature: z.ZodString;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
117
|
+
op: z.ZodLiteral<"members_sync">;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
export declare const JoinPendingRequestSchema: z.ZodObject<{
|
|
120
|
+
requestId: z.ZodString;
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
code: z.ZodString;
|
|
123
|
+
sourceAddr: z.ZodString;
|
|
124
|
+
createdAt: z.ZodNumber;
|
|
125
|
+
viaMachineId: z.ZodString;
|
|
126
|
+
publicKey: z.ZodString;
|
|
127
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
128
|
+
op: z.ZodLiteral<"join_pending">;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
export type JoinPendingRequest = z.infer<typeof JoinPendingRequestSchema>;
|
|
131
|
+
export declare const JoinDecisionRequestSchema: z.ZodObject<{
|
|
132
|
+
requestId: z.ZodString;
|
|
133
|
+
decision: z.ZodEnum<{
|
|
134
|
+
allow: "allow";
|
|
135
|
+
deny: "deny";
|
|
136
|
+
}>;
|
|
137
|
+
admission: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
netId: z.ZodString;
|
|
139
|
+
machineId: z.ZodString;
|
|
140
|
+
publicKey: z.ZodString;
|
|
141
|
+
admittedBy: z.ZodString;
|
|
142
|
+
admittedAt: z.ZodNumber;
|
|
143
|
+
signature: z.ZodString;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
146
|
+
op: z.ZodLiteral<"join_decision">;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
export declare const RosterRequestSchema: z.ZodObject<{
|
|
149
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
150
|
+
op: z.ZodLiteral<"roster">;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
export declare const RoleTargetSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
153
|
+
machine: z.ZodLiteral<true>;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
sessionRef: z.ZodString;
|
|
156
|
+
}, z.core.$strict>]>;
|
|
157
|
+
export type RoleTarget = z.infer<typeof RoleTargetSchema>;
|
|
158
|
+
export declare const RoleSetRequestSchema: z.ZodObject<{
|
|
159
|
+
target: z.ZodUnion<readonly [z.ZodObject<{
|
|
160
|
+
machine: z.ZodLiteral<true>;
|
|
161
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
162
|
+
sessionRef: z.ZodString;
|
|
163
|
+
}, z.core.$strict>]>;
|
|
164
|
+
role: z.ZodNullable<z.ZodString>;
|
|
165
|
+
by: z.ZodObject<{
|
|
166
|
+
machineName: z.ZodString;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
at: z.ZodNumber;
|
|
169
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
170
|
+
op: z.ZodLiteral<"role_set">;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
export type RoleSetRequest = z.infer<typeof RoleSetRequestSchema>;
|
|
173
|
+
export declare const NetDeliverRequestSchema: z.ZodObject<{
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
to: z.ZodObject<{
|
|
176
|
+
sessionRef: z.ZodString;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
from: z.ZodObject<{
|
|
179
|
+
sessionRef: z.ZodString;
|
|
180
|
+
sessionName: z.ZodString;
|
|
181
|
+
mode: z.ZodString;
|
|
182
|
+
kind: z.ZodLiteral<"tui">;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
text: z.ZodString;
|
|
185
|
+
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
186
|
+
hops: z.ZodNumber;
|
|
187
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
188
|
+
op: z.ZodLiteral<"net_deliver">;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
export type NetDeliverRequest = z.infer<typeof NetDeliverRequestSchema>;
|
|
191
|
+
export declare const NetOutcomeSchema: z.ZodEnum<{
|
|
192
|
+
refused: "refused";
|
|
193
|
+
queued: "queued";
|
|
194
|
+
held: "held";
|
|
195
|
+
delivered: "delivered";
|
|
196
|
+
expired: "expired";
|
|
197
|
+
}>;
|
|
198
|
+
export type NetOutcome = z.infer<typeof NetOutcomeSchema>;
|
|
199
|
+
export declare const NetNoticeRequestSchema: z.ZodObject<{
|
|
200
|
+
about: z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
outcome: z.ZodEnum<{
|
|
204
|
+
refused: "refused";
|
|
205
|
+
queued: "queued";
|
|
206
|
+
held: "held";
|
|
207
|
+
delivered: "delivered";
|
|
208
|
+
expired: "expired";
|
|
209
|
+
}>;
|
|
210
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
211
|
+
from: z.ZodObject<{
|
|
212
|
+
sessionRef: z.ZodString;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
215
|
+
op: z.ZodLiteral<"net_notice">;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
export type NetNoticeRequest = z.infer<typeof NetNoticeRequestSchema>;
|
|
218
|
+
export declare const NetRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
220
|
+
op: z.ZodLiteral<"ping_net">;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
machineName: z.ZodString;
|
|
223
|
+
publicKey: z.ZodString;
|
|
224
|
+
nonce: z.ZodString;
|
|
225
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
226
|
+
op: z.ZodLiteral<"join_request">;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
machineName: z.ZodString;
|
|
229
|
+
addresses: z.ZodArray<z.ZodObject<{
|
|
230
|
+
host: z.ZodString;
|
|
231
|
+
port: z.ZodNumber;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
protocolMax: z.ZodNumber;
|
|
234
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
235
|
+
op: z.ZodLiteral<"hello">;
|
|
236
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
237
|
+
admissions: z.ZodArray<z.ZodObject<{
|
|
238
|
+
netId: z.ZodString;
|
|
239
|
+
machineId: z.ZodString;
|
|
240
|
+
publicKey: z.ZodString;
|
|
241
|
+
admittedBy: z.ZodString;
|
|
242
|
+
admittedAt: z.ZodNumber;
|
|
243
|
+
signature: z.ZodString;
|
|
244
|
+
}, z.core.$strict>>;
|
|
245
|
+
revocations: z.ZodArray<z.ZodObject<{
|
|
246
|
+
netId: z.ZodString;
|
|
247
|
+
machineId: z.ZodString;
|
|
248
|
+
revokedBy: z.ZodString;
|
|
249
|
+
revokedAt: z.ZodNumber;
|
|
250
|
+
cascade: z.ZodBoolean;
|
|
251
|
+
signature: z.ZodString;
|
|
252
|
+
}, z.core.$strict>>;
|
|
253
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
254
|
+
op: z.ZodLiteral<"members_sync">;
|
|
255
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
256
|
+
requestId: z.ZodString;
|
|
257
|
+
name: z.ZodString;
|
|
258
|
+
code: z.ZodString;
|
|
259
|
+
sourceAddr: z.ZodString;
|
|
260
|
+
createdAt: z.ZodNumber;
|
|
261
|
+
viaMachineId: z.ZodString;
|
|
262
|
+
publicKey: z.ZodString;
|
|
263
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
264
|
+
op: z.ZodLiteral<"join_pending">;
|
|
265
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
266
|
+
requestId: z.ZodString;
|
|
267
|
+
decision: z.ZodEnum<{
|
|
268
|
+
allow: "allow";
|
|
269
|
+
deny: "deny";
|
|
270
|
+
}>;
|
|
271
|
+
admission: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
netId: z.ZodString;
|
|
273
|
+
machineId: z.ZodString;
|
|
274
|
+
publicKey: z.ZodString;
|
|
275
|
+
admittedBy: z.ZodString;
|
|
276
|
+
admittedAt: z.ZodNumber;
|
|
277
|
+
signature: z.ZodString;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
280
|
+
op: z.ZodLiteral<"join_decision">;
|
|
281
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
282
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
283
|
+
op: z.ZodLiteral<"roster">;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
target: z.ZodUnion<readonly [z.ZodObject<{
|
|
286
|
+
machine: z.ZodLiteral<true>;
|
|
287
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
288
|
+
sessionRef: z.ZodString;
|
|
289
|
+
}, z.core.$strict>]>;
|
|
290
|
+
role: z.ZodNullable<z.ZodString>;
|
|
291
|
+
by: z.ZodObject<{
|
|
292
|
+
machineName: z.ZodString;
|
|
293
|
+
}, z.core.$strict>;
|
|
294
|
+
at: z.ZodNumber;
|
|
295
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
296
|
+
op: z.ZodLiteral<"role_set">;
|
|
297
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
to: z.ZodObject<{
|
|
300
|
+
sessionRef: z.ZodString;
|
|
301
|
+
}, z.core.$strict>;
|
|
302
|
+
from: z.ZodObject<{
|
|
303
|
+
sessionRef: z.ZodString;
|
|
304
|
+
sessionName: z.ZodString;
|
|
305
|
+
mode: z.ZodString;
|
|
306
|
+
kind: z.ZodLiteral<"tui">;
|
|
307
|
+
}, z.core.$strict>;
|
|
308
|
+
text: z.ZodString;
|
|
309
|
+
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
310
|
+
hops: z.ZodNumber;
|
|
311
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
312
|
+
op: z.ZodLiteral<"net_deliver">;
|
|
313
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
314
|
+
about: z.ZodObject<{
|
|
315
|
+
id: z.ZodString;
|
|
316
|
+
}, z.core.$strict>;
|
|
317
|
+
outcome: z.ZodEnum<{
|
|
318
|
+
refused: "refused";
|
|
319
|
+
queued: "queued";
|
|
320
|
+
held: "held";
|
|
321
|
+
delivered: "delivered";
|
|
322
|
+
expired: "expired";
|
|
323
|
+
}>;
|
|
324
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
325
|
+
from: z.ZodObject<{
|
|
326
|
+
sessionRef: z.ZodString;
|
|
327
|
+
}, z.core.$strict>;
|
|
328
|
+
protocol: z.ZodLiteral<"namzu-net/1">;
|
|
329
|
+
op: z.ZodLiteral<"net_notice">;
|
|
330
|
+
}, z.core.$strict>], "op">;
|
|
331
|
+
export type NetRequest = z.infer<typeof NetRequestSchema>;
|
|
332
|
+
export type NetOp = NetRequest['op'];
|
|
333
|
+
/** The only operations a machine that is not a member may use. */
|
|
334
|
+
export declare const PREAUTH_OPS: ReadonlySet<NetOp>;
|
|
335
|
+
export declare const DeliverReplySchema: z.ZodObject<{
|
|
336
|
+
status: z.ZodEnum<{
|
|
337
|
+
refused: "refused";
|
|
338
|
+
queued: "queued";
|
|
339
|
+
held: "held";
|
|
340
|
+
}>;
|
|
341
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$strict>;
|
|
343
|
+
export type DeliverReply = z.infer<typeof DeliverReplySchema>;
|
|
344
|
+
export {};
|
|
345
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/network/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,YAAY,gBAAgB,CAAA;AACzC,mDAAmD;AACnD,eAAO,MAAM,kBAAkB,QAAY,CAAA;AAC3C,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,QAAW,CAAA;AAC9C,eAAO,MAAM,kBAAkB,QAAY,CAAA;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAA;AACjC,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,eAAO,MAAM,QAAQ,IAAI,CAAA;AAOzB,QAAA,MAAM,cAAc;;;kBAEV,CAAA;AACV,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAKrD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,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AM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;kBAsB1B,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,gBAAgB;;;;;;EAAgE,CAAA;AAC7F,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;kBAQzB,CAAA;AACV,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAW3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;AAEpC,kEAAkE;AAClE,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,KAAK,CAAgD,CAAA;AAE3F,eAAO,MAAM,kBAAkB;;;;;;;kBAErB,CAAA;AACV,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `namzu-net/1` wire protocol: newline-delimited JSON inside mutual TLS,
|
|
3
|
+
* one request and one response per exchange. Every schema is `.strict()`; a
|
|
4
|
+
* frame with a field this build does not know is refused rather than half read.
|
|
5
|
+
*
|
|
6
|
+
* Nothing in a roster carries a full path, a token, a conversation id or a
|
|
7
|
+
* message text.
|
|
8
|
+
*
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { AdmissionSchema, RevocationSchema } from './membership.js';
|
|
13
|
+
export const NET_PROTOCOL = 'namzu-net/1';
|
|
14
|
+
/** One authenticated line, request or response. */
|
|
15
|
+
export const MAX_NET_LINE_BYTES = 64 * 1024;
|
|
16
|
+
/** A line from a machine that is not (yet) a member. */
|
|
17
|
+
export const MAX_PREAUTH_LINE_BYTES = 4 * 1024;
|
|
18
|
+
export const MAX_NET_TEXT_BYTES = 32 * 1024;
|
|
19
|
+
export const MAX_ROLE_BYTES = 500;
|
|
20
|
+
export const MAX_NAME_LENGTH = 40;
|
|
21
|
+
export const MAX_ROSTER_SESSIONS = 64;
|
|
22
|
+
export const MAX_MEMBERS = 64;
|
|
23
|
+
export const MAX_HOPS = 3;
|
|
24
|
+
const MachineIdSchema = z
|
|
25
|
+
.string()
|
|
26
|
+
.length(64)
|
|
27
|
+
.regex(/^[0-9a-f]+$/);
|
|
28
|
+
const RefSchema = z.string().regex(/^[0-9a-f]{6}$/);
|
|
29
|
+
const HostPortSchema = z
|
|
30
|
+
.object({ host: z.string().min(1).max(255), port: z.number().int().min(1).max(65535) })
|
|
31
|
+
.strict();
|
|
32
|
+
const bytes = (max) => z.string().refine((v) => Buffer.byteLength(v, 'utf8') <= max, { message: `at most ${max} bytes` });
|
|
33
|
+
/** Remove control characters, collapse whitespace, cut to `max` characters. */
|
|
34
|
+
export function sanitizeName(value, max = MAX_NAME_LENGTH) {
|
|
35
|
+
const clean = Array.from(value)
|
|
36
|
+
.map((ch) => (/[\p{Cc}\p{Cf}]/u.test(ch) ? ' ' : ch))
|
|
37
|
+
.join('')
|
|
38
|
+
.replace(/\s+/g, ' ')
|
|
39
|
+
.trim();
|
|
40
|
+
return Array.from(clean).slice(0, max).join('');
|
|
41
|
+
}
|
|
42
|
+
/** A role: free text, one paragraph, at most 500 bytes. Returns undefined for an empty result. */
|
|
43
|
+
export function sanitizeRole(value) {
|
|
44
|
+
const clean = Array.from(value)
|
|
45
|
+
.map((ch) => (/[\p{Cc}\p{Cf}]/u.test(ch) ? ' ' : ch))
|
|
46
|
+
.join('')
|
|
47
|
+
.replace(/\s+/g, ' ')
|
|
48
|
+
.trim();
|
|
49
|
+
let out = '';
|
|
50
|
+
for (const ch of clean) {
|
|
51
|
+
if (Buffer.byteLength(out + ch, 'utf8') > MAX_ROLE_BYTES)
|
|
52
|
+
break;
|
|
53
|
+
out += ch;
|
|
54
|
+
}
|
|
55
|
+
return out.length > 0 ? out : undefined;
|
|
56
|
+
}
|
|
57
|
+
export const RosterSessionSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
ref: RefSchema,
|
|
60
|
+
name: z.string().min(1).max(80),
|
|
61
|
+
folder: z.string().max(120),
|
|
62
|
+
state: z.enum(['idle', 'running', 'awaiting-approval']),
|
|
63
|
+
mode: z.string().min(1).max(40),
|
|
64
|
+
role: z.string().max(MAX_ROLE_BYTES).optional(),
|
|
65
|
+
acceptsMessages: z.boolean(),
|
|
66
|
+
kind: z.literal('tui'),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const RosterMachineSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
id: MachineIdSchema,
|
|
72
|
+
name: z
|
|
73
|
+
.string()
|
|
74
|
+
.min(1)
|
|
75
|
+
.max(MAX_NAME_LENGTH * 2),
|
|
76
|
+
role: z.string().max(MAX_ROLE_BYTES).optional(),
|
|
77
|
+
platform: z.string().max(20),
|
|
78
|
+
})
|
|
79
|
+
.strict();
|
|
80
|
+
export const RosterSchema = z
|
|
81
|
+
.object({
|
|
82
|
+
machine: RosterMachineSchema,
|
|
83
|
+
sessions: z.array(RosterSessionSchema).max(MAX_ROSTER_SESSIONS),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
const head = (op) => ({ protocol: z.literal(NET_PROTOCOL), op: z.literal(op) });
|
|
87
|
+
export const PingNetRequestSchema = z.object({ ...head('ping_net') }).strict();
|
|
88
|
+
export const JoinRequestSchema = z
|
|
89
|
+
.object({
|
|
90
|
+
...head('join_request'),
|
|
91
|
+
machineName: z
|
|
92
|
+
.string()
|
|
93
|
+
.min(1)
|
|
94
|
+
.max(MAX_NAME_LENGTH * 2),
|
|
95
|
+
publicKey: z.string().min(1).max(256),
|
|
96
|
+
nonce: z.string().min(16).max(64),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
export const HelloRequestSchema = z
|
|
100
|
+
.object({
|
|
101
|
+
...head('hello'),
|
|
102
|
+
machineName: z
|
|
103
|
+
.string()
|
|
104
|
+
.min(1)
|
|
105
|
+
.max(MAX_NAME_LENGTH * 2),
|
|
106
|
+
addresses: z.array(HostPortSchema).max(8),
|
|
107
|
+
protocolMax: z.number().int().min(1).max(100),
|
|
108
|
+
})
|
|
109
|
+
.strict();
|
|
110
|
+
export const MembersSyncRequestSchema = z
|
|
111
|
+
.object({
|
|
112
|
+
...head('members_sync'),
|
|
113
|
+
admissions: z.array(AdmissionSchema).max(MAX_MEMBERS * 2),
|
|
114
|
+
revocations: z.array(RevocationSchema).max(MAX_MEMBERS * 2),
|
|
115
|
+
})
|
|
116
|
+
.strict();
|
|
117
|
+
export const JoinPendingRequestSchema = z
|
|
118
|
+
.object({
|
|
119
|
+
...head('join_pending'),
|
|
120
|
+
requestId: z.string().min(1).max(64),
|
|
121
|
+
name: z
|
|
122
|
+
.string()
|
|
123
|
+
.min(1)
|
|
124
|
+
.max(MAX_NAME_LENGTH * 2),
|
|
125
|
+
code: z.string().regex(/^\d{6}$/),
|
|
126
|
+
sourceAddr: z.string().max(80),
|
|
127
|
+
createdAt: z.number().int().nonnegative(),
|
|
128
|
+
viaMachineId: MachineIdSchema,
|
|
129
|
+
/** The joiner's key, SPKI DER base64, so any member can sign its admission. */
|
|
130
|
+
publicKey: z.string().min(1).max(256),
|
|
131
|
+
})
|
|
132
|
+
.strict();
|
|
133
|
+
export const JoinDecisionRequestSchema = z
|
|
134
|
+
.object({
|
|
135
|
+
...head('join_decision'),
|
|
136
|
+
requestId: z.string().min(1).max(64),
|
|
137
|
+
decision: z.enum(['allow', 'deny']),
|
|
138
|
+
admission: AdmissionSchema.optional(),
|
|
139
|
+
})
|
|
140
|
+
.strict();
|
|
141
|
+
export const RosterRequestSchema = z.object({ ...head('roster') }).strict();
|
|
142
|
+
export const RoleTargetSchema = z.union([
|
|
143
|
+
z.object({ machine: z.literal(true) }).strict(),
|
|
144
|
+
z.object({ sessionRef: RefSchema }).strict(),
|
|
145
|
+
]);
|
|
146
|
+
export const RoleSetRequestSchema = z
|
|
147
|
+
.object({
|
|
148
|
+
...head('role_set'),
|
|
149
|
+
target: RoleTargetSchema,
|
|
150
|
+
role: bytes(MAX_ROLE_BYTES).nullable(),
|
|
151
|
+
by: z
|
|
152
|
+
.object({
|
|
153
|
+
machineName: z
|
|
154
|
+
.string()
|
|
155
|
+
.min(1)
|
|
156
|
+
.max(MAX_NAME_LENGTH * 2),
|
|
157
|
+
})
|
|
158
|
+
.strict(),
|
|
159
|
+
at: z.number().int().nonnegative(),
|
|
160
|
+
})
|
|
161
|
+
.strict();
|
|
162
|
+
export const NetDeliverRequestSchema = z
|
|
163
|
+
.object({
|
|
164
|
+
...head('net_deliver'),
|
|
165
|
+
id: z.string().min(1).max(100),
|
|
166
|
+
to: z.object({ sessionRef: RefSchema }).strict(),
|
|
167
|
+
from: z
|
|
168
|
+
.object({
|
|
169
|
+
sessionRef: RefSchema,
|
|
170
|
+
sessionName: z.string().min(1).max(80),
|
|
171
|
+
mode: z.string().min(1).max(40),
|
|
172
|
+
kind: z.literal('tui'),
|
|
173
|
+
})
|
|
174
|
+
.strict(),
|
|
175
|
+
text: z
|
|
176
|
+
.string()
|
|
177
|
+
.min(1)
|
|
178
|
+
.refine((v) => Buffer.byteLength(v, 'utf8') <= MAX_NET_TEXT_BYTES, {
|
|
179
|
+
message: `at most ${MAX_NET_TEXT_BYTES} bytes`,
|
|
180
|
+
}),
|
|
181
|
+
inReplyTo: z.string().min(1).max(100).optional(),
|
|
182
|
+
hops: z.number().int().min(0).max(100),
|
|
183
|
+
})
|
|
184
|
+
.strict();
|
|
185
|
+
export const NetOutcomeSchema = z.enum(['delivered', 'queued', 'held', 'refused', 'expired']);
|
|
186
|
+
export const NetNoticeRequestSchema = z
|
|
187
|
+
.object({
|
|
188
|
+
...head('net_notice'),
|
|
189
|
+
about: z.object({ id: z.string().min(1).max(100) }).strict(),
|
|
190
|
+
outcome: NetOutcomeSchema,
|
|
191
|
+
detail: z.string().max(200).optional(),
|
|
192
|
+
from: z.object({ sessionRef: RefSchema }).strict(),
|
|
193
|
+
})
|
|
194
|
+
.strict();
|
|
195
|
+
export const NetRequestSchema = z.discriminatedUnion('op', [
|
|
196
|
+
PingNetRequestSchema,
|
|
197
|
+
JoinRequestSchema,
|
|
198
|
+
HelloRequestSchema,
|
|
199
|
+
MembersSyncRequestSchema,
|
|
200
|
+
JoinPendingRequestSchema,
|
|
201
|
+
JoinDecisionRequestSchema,
|
|
202
|
+
RosterRequestSchema,
|
|
203
|
+
RoleSetRequestSchema,
|
|
204
|
+
NetDeliverRequestSchema,
|
|
205
|
+
NetNoticeRequestSchema,
|
|
206
|
+
]);
|
|
207
|
+
/** The only operations a machine that is not a member may use. */
|
|
208
|
+
export const PREAUTH_OPS = new Set(['ping_net', 'join_request']);
|
|
209
|
+
export const DeliverReplySchema = z
|
|
210
|
+
.object({ status: z.enum(['queued', 'held', 'refused']), reason: z.string().max(200).optional() })
|
|
211
|
+
.strict();
|
|
212
|
+
//# sourceMappingURL=wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/network/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,gBAA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signed X.509 v3 certificate over a machine's Ed25519 key.
|
|
3
|
+
*
|
|
4
|
+
* `node:tls` needs a certificate and `node:crypto` has no builder, so this
|
|
5
|
+
* file only ENCODES the ASN.1 structure; the signature is made by
|
|
6
|
+
* `crypto.sign`. Trust is never taken from this certificate's chain: peers pin
|
|
7
|
+
* the machine key it carries (see `transport.ts`). The tests parse the output
|
|
8
|
+
* with Node's own `X509Certificate` and run a real handshake with it.
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
import type { MachineKey } from './identity.js';
|
|
13
|
+
export interface MachineCertificate {
|
|
14
|
+
readonly pem: string;
|
|
15
|
+
readonly der: Buffer;
|
|
16
|
+
}
|
|
17
|
+
export interface BuildCertificateOptions {
|
|
18
|
+
readonly now?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `CN=namzu-<random>`, issuer and subject alike. Trust is by the pinned key, never by this name, so it
|
|
22
|
+
* carries nothing of the machine: a stranger who completes a handshake cannot recognise a laptop by it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function certificateSubject(_machineId: string): string;
|
|
25
|
+
export declare function buildMachineCertificate(key: MachineKey, options?: BuildCertificateOptions): MachineCertificate;
|
|
26
|
+
/** The SPKI DER of the key a certificate carries. Never throws for a good certificate. */
|
|
27
|
+
export declare function certificatePublicKeyDer(certDer: Buffer): Buffer;
|
|
28
|
+
//# sourceMappingURL=x509.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x509.d.ts","sourceRoot":"","sources":["../../src/network/x509.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAqD/C,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE,uBAA4B,GACnC,kBAAkB,CAqBpB;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|