@namzu/sdk 65.2.0 → 67.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +161 -0
- package/dist/account/lock.d.ts +4 -12
- package/dist/account/lock.d.ts.map +1 -1
- package/dist/account/lock.js +5 -140
- package/dist/account/lock.js.map +1 -1
- package/dist/account/registry.d.ts.map +1 -1
- package/dist/account/registry.js +50 -6
- package/dist/account/registry.js.map +1 -1
- package/dist/account/types.d.ts +7 -5
- package/dist/account/types.d.ts.map +1 -1
- package/dist/account/types.js +6 -7
- package/dist/account/types.js.map +1 -1
- package/dist/authorization/dangerous-commands.d.ts +64 -0
- package/dist/authorization/dangerous-commands.d.ts.map +1 -0
- package/dist/authorization/dangerous-commands.js +479 -0
- package/dist/authorization/dangerous-commands.js.map +1 -0
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +19 -5
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/protected-paths.d.ts +11 -6
- package/dist/authorization/protected-paths.d.ts.map +1 -1
- package/dist/authorization/protected-paths.js +13 -8
- package/dist/authorization/protected-paths.js.map +1 -1
- package/dist/authorization/readonly-commands.d.ts +6 -1
- package/dist/authorization/readonly-commands.d.ts.map +1 -1
- package/dist/authorization/readonly-commands.js +35 -1
- package/dist/authorization/readonly-commands.js.map +1 -1
- package/dist/authorization/removal.d.ts +10 -0
- package/dist/authorization/removal.d.ts.map +1 -1
- package/dist/authorization/removal.js +7 -7
- package/dist/authorization/removal.js.map +1 -1
- package/dist/authorization/rules.d.ts +10 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +60 -14
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +10 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +15 -0
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/acp/permission.d.ts +5 -0
- package/dist/bridge/acp/permission.d.ts.map +1 -1
- package/dist/bridge/acp/permission.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +8 -1
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +48 -6
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/compaction/context-breakdown.d.ts +25 -6
- package/dist/compaction/context-breakdown.d.ts.map +1 -1
- package/dist/compaction/context-breakdown.js +27 -7
- package/dist/compaction/context-breakdown.js.map +1 -1
- package/dist/compaction/dangling.d.ts.map +1 -1
- package/dist/compaction/dangling.js +2 -0
- package/dist/compaction/dangling.js.map +1 -1
- package/dist/compaction/extractor.d.ts +7 -1
- package/dist/compaction/extractor.d.ts.map +1 -1
- package/dist/compaction/extractor.js +8 -1
- package/dist/compaction/extractor.js.map +1 -1
- package/dist/compaction/index.d.ts +1 -1
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +1 -1
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/managers/structured.js +2 -2
- package/dist/compaction/managers/structured.js.map +1 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +11 -6
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/model-summary.d.ts.map +1 -1
- package/dist/compaction/model-summary.js +7 -1
- package/dist/compaction/model-summary.js.map +1 -1
- package/dist/compaction/summary.d.ts +13 -2
- package/dist/compaction/summary.d.ts.map +1 -1
- package/dist/compaction/summary.js +46 -3
- package/dist/compaction/summary.js.map +1 -1
- package/dist/constants/tools/index.d.ts +18 -1
- package/dist/constants/tools/index.d.ts.map +1 -1
- package/dist/constants/tools/index.js +28 -16
- package/dist/constants/tools/index.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts +6 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +29 -1
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/network/audit.d.ts +49 -0
- package/dist/network/audit.d.ts.map +1 -0
- package/dist/network/audit.js +84 -0
- package/dist/network/audit.js.map +1 -0
- package/dist/network/clock.d.ts +21 -0
- package/dist/network/clock.d.ts.map +1 -0
- package/dist/network/clock.js +51 -0
- package/dist/network/clock.js.map +1 -0
- package/dist/network/discovery-mdns.d.ts +120 -0
- package/dist/network/discovery-mdns.d.ts.map +1 -0
- package/dist/network/discovery-mdns.js +442 -0
- package/dist/network/discovery-mdns.js.map +1 -0
- package/dist/network/discovery.d.ts +63 -0
- package/dist/network/discovery.d.ts.map +1 -0
- package/dist/network/discovery.js +163 -0
- package/dist/network/discovery.js.map +1 -0
- package/dist/network/fingerprint.d.ts +73 -0
- package/dist/network/fingerprint.d.ts.map +1 -0
- package/dist/network/fingerprint.js +208 -0
- package/dist/network/fingerprint.js.map +1 -0
- package/dist/network/identity.d.ts +38 -0
- package/dist/network/identity.d.ts.map +1 -0
- package/dist/network/identity.js +71 -0
- package/dist/network/identity.js.map +1 -0
- package/dist/network/index.d.ts +39 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/index.js +25 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/join.d.ts +69 -0
- package/dist/network/join.d.ts.map +1 -0
- package/dist/network/join.js +136 -0
- package/dist/network/join.js.map +1 -0
- package/dist/network/mail-policy.d.ts +97 -0
- package/dist/network/mail-policy.d.ts.map +1 -0
- package/dist/network/mail-policy.js +147 -0
- package/dist/network/mail-policy.js.map +1 -0
- package/dist/network/membership.d.ts +76 -0
- package/dist/network/membership.d.ts.map +1 -0
- package/dist/network/membership.js +225 -0
- package/dist/network/membership.js.map +1 -0
- package/dist/network/roster.d.ts +59 -0
- package/dist/network/roster.d.ts.map +1 -0
- package/dist/network/roster.js +120 -0
- package/dist/network/roster.js.map +1 -0
- package/dist/network/service.d.ts +303 -0
- package/dist/network/service.d.ts.map +1 -0
- package/dist/network/service.js +1891 -0
- package/dist/network/service.js.map +1 -0
- package/dist/network/store.d.ts +141 -0
- package/dist/network/store.d.ts.map +1 -0
- package/dist/network/store.js +198 -0
- package/dist/network/store.js.map +1 -0
- package/dist/network/transport.d.ts +96 -0
- package/dist/network/transport.d.ts.map +1 -0
- package/dist/network/transport.js +342 -0
- package/dist/network/transport.js.map +1 -0
- package/dist/network/wire.d.ts +345 -0
- package/dist/network/wire.d.ts.map +1 -0
- package/dist/network/wire.js +212 -0
- package/dist/network/wire.js.map +1 -0
- package/dist/network/x509.d.ts +28 -0
- package/dist/network/x509.d.ts.map +1 -0
- package/dist/network/x509.js +84 -0
- package/dist/network/x509.js.map +1 -0
- package/dist/pals/activity/causality.d.ts.map +1 -1
- package/dist/pals/activity/causality.js +14 -2
- package/dist/pals/activity/causality.js.map +1 -1
- package/dist/peers/endpoint.d.ts.map +1 -1
- package/dist/peers/endpoint.js +6 -0
- package/dist/peers/endpoint.js.map +1 -1
- package/dist/peers/envelope.d.ts +18 -0
- package/dist/peers/envelope.d.ts.map +1 -1
- package/dist/peers/envelope.js +68 -5
- package/dist/peers/envelope.js.map +1 -1
- package/dist/peers/index.d.ts +5 -4
- package/dist/peers/index.d.ts.map +1 -1
- package/dist/peers/index.js +3 -2
- package/dist/peers/index.js.map +1 -1
- package/dist/peers/mode-word.d.ts +10 -0
- package/dist/peers/mode-word.d.ts.map +1 -0
- package/dist/peers/mode-word.js +19 -0
- package/dist/peers/mode-word.js.map +1 -0
- package/dist/peers/protocol.d.ts +42 -0
- package/dist/peers/protocol.d.ts.map +1 -1
- package/dist/peers/protocol.js +22 -1
- package/dist/peers/protocol.js.map +1 -1
- package/dist/peers/record.d.ts +8 -0
- package/dist/peers/record.d.ts.map +1 -1
- package/dist/peers/record.js +5 -0
- package/dist/peers/record.js.map +1 -1
- package/dist/plugin/session-hook-env.d.ts.map +1 -1
- package/dist/plugin/session-hook-env.js +22 -2
- package/dist/plugin/session-hook-env.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +16 -2
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +183 -14
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +4 -2
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +33 -38
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/public-runtime.d.ts +14 -6
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +22 -5
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +3 -2
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -2
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +7 -2
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +29 -1
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +64 -0
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts +30 -6
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.js +40 -12
- package/dist/runtime/query/auto-review/classifier.js.map +1 -1
- package/dist/runtime/query/auto-review/feedback.d.ts +37 -0
- package/dist/runtime/query/auto-review/feedback.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/feedback.js +45 -0
- package/dist/runtime/query/auto-review/feedback.js.map +1 -0
- package/dist/runtime/query/auto-review/git-status.d.ts +59 -0
- package/dist/runtime/query/auto-review/git-status.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/git-status.js +379 -0
- package/dist/runtime/query/auto-review/git-status.js.map +1 -0
- package/dist/runtime/query/auto-review/index.d.ts +3 -3
- package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/index.js +2 -2
- package/dist/runtime/query/auto-review/index.js.map +1 -1
- package/dist/runtime/query/auto-review/prompt.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/prompt.js +6 -1
- package/dist/runtime/query/auto-review/prompt.js.map +1 -1
- package/dist/runtime/query/auto-review/transcript.d.ts +14 -1
- package/dist/runtime/query/auto-review/transcript.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/transcript.js +48 -2
- package/dist/runtime/query/auto-review/transcript.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +40 -3
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +32 -10
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +78 -17
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +9 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +54 -17
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +17 -3
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +5 -2
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js +5 -0
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts +1 -2
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.js +2 -5
- package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +6 -1
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/pasted-frames.d.ts +34 -0
- package/dist/runtime/query/pasted-frames.d.ts.map +1 -0
- package/dist/runtime/query/pasted-frames.js +108 -0
- package/dist/runtime/query/pasted-frames.js.map +1 -0
- package/dist/runtime/query/path-escalation.d.ts +6 -0
- package/dist/runtime/query/path-escalation.d.ts.map +1 -1
- package/dist/runtime/query/path-escalation.js +15 -3
- package/dist/runtime/query/path-escalation.js.map +1 -1
- package/dist/runtime/query/request-interrupted-turns.d.ts +20 -0
- package/dist/runtime/query/request-interrupted-turns.d.ts.map +1 -0
- package/dist/runtime/query/request-interrupted-turns.js +43 -0
- package/dist/runtime/query/request-interrupted-turns.js.map +1 -0
- package/dist/runtime/query/review-policy.d.ts +16 -6
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +111 -15
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.d.ts +9 -0
- package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.js +94 -6
- package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
- package/dist/runtime/query/unanswered.d.ts +19 -0
- package/dist/runtime/query/unanswered.d.ts.map +1 -0
- package/dist/runtime/query/unanswered.js +25 -0
- package/dist/runtime/query/unanswered.js.map +1 -0
- package/dist/runtime/system-events.d.ts +4 -4
- package/dist/runtime/system-events.d.ts.map +1 -1
- package/dist/runtime/system-events.js +2 -0
- package/dist/runtime/system-events.js.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts +8 -0
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +21 -3
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/store/evidence/source-kind.d.ts +1 -1
- package/dist/store/evidence/source-kind.d.ts.map +1 -1
- package/dist/store/evidence/source-kind.js +1 -1
- package/dist/store/evidence/source-kind.js.map +1 -1
- package/dist/store/session-index/sqlite.d.ts.map +1 -1
- package/dist/store/session-index/sqlite.js +42 -3
- package/dist/store/session-index/sqlite.js.map +1 -1
- package/dist/store/session-log/disk.js +1 -1
- package/dist/store/session-log/disk.js.map +1 -1
- package/dist/store/session-log/lease.d.ts.map +1 -1
- package/dist/store/session-log/lease.js +3 -2
- package/dist/store/session-log/lease.js.map +1 -1
- package/dist/tools/admit-facts.d.ts.map +1 -1
- package/dist/tools/admit-facts.js +2 -0
- package/dist/tools/admit-facts.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +10 -2
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +56 -17
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser-local.d.ts +117 -0
- package/dist/tools/builtins/browser-local.d.ts.map +1 -0
- package/dist/tools/builtins/browser-local.js +437 -0
- package/dist/tools/builtins/browser-local.js.map +1 -0
- package/dist/tools/builtins/browser.d.ts +18 -1
- package/dist/tools/builtins/browser.d.ts.map +1 -1
- package/dist/tools/builtins/browser.js +98 -8
- package/dist/tools/builtins/browser.js.map +1 -1
- package/dist/tools/builtins/computer-use-window-id.d.ts +16 -0
- package/dist/tools/builtins/computer-use-window-id.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-window-id.js +52 -0
- package/dist/tools/builtins/computer-use-window-id.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +65 -7
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +384 -71
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts +6 -0
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +7 -1
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +89 -7
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/file-write-result.d.ts.map +1 -1
- package/dist/tools/builtins/file-write-result.js +2 -1
- package/dist/tools/builtins/file-write-result.js.map +1 -1
- package/dist/tools/builtins/grep.js +1 -1
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +4 -2
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/monitor.d.ts.map +1 -1
- package/dist/tools/builtins/monitor.js +6 -1
- package/dist/tools/builtins/monitor.js.map +1 -1
- package/dist/tools/builtins/search-tools.d.ts +12 -1
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +166 -20
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/shell-read-credit.d.ts +18 -6
- package/dist/tools/builtins/shell-read-credit.d.ts.map +1 -1
- package/dist/tools/builtins/shell-read-credit.js +95 -27
- package/dist/tools/builtins/shell-read-credit.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +14 -3
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/builtins/web-guidance.d.ts +6 -0
- package/dist/tools/builtins/web-guidance.d.ts.map +1 -1
- package/dist/tools/builtins/web-guidance.js +6 -0
- package/dist/tools/builtins/web-guidance.js.map +1 -1
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +2 -1
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +32 -2
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +1 -1
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +6 -8
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/defineTool.d.ts +2 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +17 -1
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/schedules/index.d.ts +1 -0
- package/dist/tools/schedules/index.d.ts.map +1 -1
- package/dist/tools/schedules/index.js +1 -0
- package/dist/tools/schedules/index.js.map +1 -1
- package/dist/tools/schedules/loop-tool.d.ts.map +1 -1
- package/dist/tools/schedules/loop-tool.js +8 -6
- package/dist/tools/schedules/loop-tool.js.map +1 -1
- package/dist/tools/schedules/present.js +1 -1
- package/dist/tools/schedules/present.js.map +1 -1
- package/dist/tools/schedules/timer-tools.d.ts +36 -0
- package/dist/tools/schedules/timer-tools.d.ts.map +1 -0
- package/dist/tools/schedules/timer-tools.js +234 -0
- package/dist/tools/schedules/timer-tools.js.map +1 -0
- package/dist/tools/schedules/types.d.ts +68 -3
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/task/create.d.ts.map +1 -1
- package/dist/tools/task/create.js +2 -0
- package/dist/tools/task/create.js.map +1 -1
- package/dist/toolsets/manager.d.ts +49 -7
- package/dist/toolsets/manager.d.ts.map +1 -1
- package/dist/toolsets/manager.js +239 -40
- package/dist/toolsets/manager.js.map +1 -1
- package/dist/turn/evidence-query.d.ts +18 -1
- package/dist/turn/evidence-query.d.ts.map +1 -1
- package/dist/turn/evidence-query.js +177 -35
- package/dist/turn/evidence-query.js.map +1 -1
- package/dist/turn/evidence-recall.d.ts +8 -1
- package/dist/turn/evidence-recall.d.ts.map +1 -1
- package/dist/turn/evidence-recall.js +82 -22
- package/dist/turn/evidence-recall.js.map +1 -1
- package/dist/turn/history-shed.d.ts +15 -0
- package/dist/turn/history-shed.d.ts.map +1 -0
- package/dist/turn/history-shed.js +23 -0
- package/dist/turn/history-shed.js.map +1 -0
- package/dist/types/acp/index.d.ts +26 -0
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +9 -1
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +11 -2
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/browser/index.d.ts +12 -0
- package/dist/types/browser/index.d.ts.map +1 -1
- package/dist/types/hitl/index.d.ts +10 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/message/index.d.ts +56 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +2 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/permission/index.d.ts +14 -0
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +14 -0
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +148 -1
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +9 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/provider/index.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +12 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/limits.d.ts +33 -0
- package/dist/types/provider/limits.d.ts.map +1 -0
- package/dist/types/provider/limits.js +7 -0
- package/dist/types/provider/limits.js.map +1 -0
- package/dist/types/tool/index.d.ts +30 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +4 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/file-lock.d.ts +88 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +281 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/state-backup.d.ts +87 -0
- package/dist/utils/state-backup.d.ts.map +1 -0
- package/dist/utils/state-backup.js +272 -0
- package/dist/utils/state-backup.js.map +1 -0
- package/dist/utils/temp-sweep.d.ts +66 -0
- package/dist/utils/temp-sweep.d.ts.map +1 -0
- package/dist/utils/temp-sweep.js +311 -0
- package/dist/utils/temp-sweep.js.map +1 -0
- package/dist/utils/temp.d.ts +14 -0
- package/dist/utils/temp.d.ts.map +1 -1
- package/dist/utils/temp.js +70 -2
- package/dist/utils/temp.js.map +1 -1
- package/package.json +1 -1
- package/src/account/lock.ts +13 -133
- package/src/account/registry.ts +75 -21
- package/src/account/types.ts +8 -9
- package/src/authorization/dangerous-commands.ts +542 -0
- package/src/authorization/gate.ts +19 -5
- package/src/authorization/protected-paths.ts +13 -8
- package/src/authorization/readonly-commands.ts +35 -1
- package/src/authorization/removal.ts +7 -7
- package/src/authorization/rules.ts +75 -15
- package/src/authorization/shell-lexer.ts +19 -0
- package/src/bridge/acp/permission.ts +2 -0
- package/src/bridge/acp/server.ts +66 -6
- package/src/compaction/context-breakdown.ts +53 -11
- package/src/compaction/dangling.ts +2 -0
- package/src/compaction/extractor.ts +9 -1
- package/src/compaction/index.ts +1 -0
- package/src/compaction/managers/structured.ts +2 -2
- package/src/compaction/manual.ts +11 -3
- package/src/compaction/model-summary.ts +8 -1
- package/src/compaction/summary.ts +54 -7
- package/src/constants/tools/index.ts +30 -16
- package/src/manager/session/turn-recorder.ts +37 -1
- package/src/network/audit.ts +113 -0
- package/src/network/clock.ts +62 -0
- package/src/network/discovery-mdns.ts +485 -0
- package/src/network/discovery.ts +210 -0
- package/src/network/fingerprint.ts +241 -0
- package/src/network/identity.ts +98 -0
- package/src/network/index.ts +134 -0
- package/src/network/join.ts +177 -0
- package/src/network/mail-policy.ts +199 -0
- package/src/network/membership.ts +290 -0
- package/src/network/roster.ts +165 -0
- package/src/network/service.ts +2304 -0
- package/src/network/store.ts +261 -0
- package/src/network/transport.ts +445 -0
- package/src/network/wire.ts +250 -0
- package/src/network/x509.ts +114 -0
- package/src/pals/activity/causality.ts +16 -2
- package/src/peers/endpoint.ts +6 -0
- package/src/peers/envelope.ts +82 -5
- package/src/peers/index.ts +10 -2
- package/src/peers/mode-word.ts +18 -0
- package/src/peers/protocol.ts +24 -1
- package/src/peers/record.ts +5 -0
- package/src/plugin/session-hook-env.ts +25 -2
- package/src/plugin/shell-hook.ts +208 -14
- package/src/prompt/coding-agent-doctrine.ts +33 -38
- package/src/public-runtime.ts +107 -1
- package/src/public-tools.ts +11 -0
- package/src/public-types.ts +67 -1
- package/src/runtime/jobs/registry.ts +93 -3
- package/src/runtime/query/auto-review/classifier.ts +76 -14
- package/src/runtime/query/auto-review/feedback.ts +50 -0
- package/src/runtime/query/auto-review/git-status.ts +437 -0
- package/src/runtime/query/auto-review/index.ts +7 -2
- package/src/runtime/query/auto-review/prompt.ts +6 -1
- package/src/runtime/query/auto-review/transcript.ts +67 -4
- package/src/runtime/query/executor/tool-call-admission.ts +49 -3
- package/src/runtime/query/executor.ts +104 -21
- package/src/runtime/query/index.ts +66 -17
- package/src/runtime/query/iteration/index.ts +24 -3
- package/src/runtime/query/iteration/phases/compaction.ts +4 -0
- package/src/runtime/query/iteration/phases/context.ts +5 -0
- package/src/runtime/query/iteration/phases/per-call-review.ts +8 -13
- package/src/runtime/query/iteration/phases/tool-review.ts +7 -1
- package/src/runtime/query/pasted-frames.ts +119 -0
- package/src/runtime/query/path-escalation.ts +27 -3
- package/src/runtime/query/request-interrupted-turns.ts +47 -0
- package/src/runtime/query/review-policy.ts +125 -22
- package/src/runtime/query/turn/outcome-ledger.ts +99 -6
- package/src/runtime/query/unanswered.ts +35 -0
- package/src/runtime/system-events.ts +2 -0
- package/src/session/workspace/git-worktree.ts +34 -3
- package/src/store/evidence/source-kind.ts +1 -1
- package/src/store/session-index/sqlite.ts +40 -3
- package/src/store/session-log/disk.ts +1 -1
- package/src/store/session-log/lease.ts +3 -2
- package/src/tools/admit-facts.ts +2 -0
- package/src/tools/builtins/bash.ts +62 -19
- package/src/tools/builtins/browser-local.ts +504 -0
- package/src/tools/builtins/browser.ts +121 -8
- package/src/tools/builtins/computer-use-window-id.ts +50 -0
- package/src/tools/builtins/computer-use.ts +460 -68
- package/src/tools/builtins/content-fingerprint.ts +8 -1
- package/src/tools/builtins/edit.ts +93 -7
- package/src/tools/builtins/file-write-result.ts +2 -1
- package/src/tools/builtins/grep.ts +1 -1
- package/src/tools/builtins/job.ts +4 -2
- package/src/tools/builtins/monitor.ts +6 -1
- package/src/tools/builtins/search-tools.ts +196 -21
- package/src/tools/builtins/shell-read-credit.ts +97 -33
- package/src/tools/builtins/wait-for-job.ts +13 -3
- package/src/tools/builtins/web-guidance.ts +6 -0
- package/src/tools/builtins/web.ts +2 -1
- package/src/tools/builtins/write-file.ts +31 -3
- package/src/tools/command-shell.ts +6 -8
- package/src/tools/defineTool.ts +20 -1
- package/src/tools/schedules/index.ts +11 -0
- package/src/tools/schedules/loop-tool.ts +10 -6
- package/src/tools/schedules/present.ts +1 -1
- package/src/tools/schedules/timer-tools.ts +258 -0
- package/src/tools/schedules/types.ts +72 -3
- package/src/tools/task/create.ts +2 -0
- package/src/toolsets/manager.ts +262 -46
- package/src/turn/evidence-query.ts +183 -42
- package/src/turn/evidence-recall.ts +96 -19
- package/src/turn/history-shed.ts +30 -0
- package/src/types/acp/index.ts +24 -0
- package/src/types/authorization/index.ts +20 -3
- package/src/types/browser/index.ts +9 -0
- package/src/types/hitl/index.ts +10 -0
- package/src/types/message/index.ts +65 -0
- package/src/types/permission/index.ts +18 -0
- package/src/types/plugin/index.ts +205 -26
- package/src/types/provider/index.ts +1 -0
- package/src/types/provider/interface.ts +13 -0
- package/src/types/provider/limits.ts +35 -0
- package/src/types/tool/index.ts +30 -2
- package/src/types/tool/presentation.ts +4 -0
- package/src/utils/file-lock.ts +328 -0
- package/src/utils/state-backup.ts +318 -0
- package/src/utils/temp-sweep.ts +327 -0
- package/src/utils/temp.ts +73 -2
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
3
|
+
import type { ToolCallView, ToolResultView } from '../../types/tool/presentation.js'
|
|
4
|
+
import { defineTool } from '../defineTool.js'
|
|
5
|
+
import type { SelfPacedHost, SessionTimerHost } from './types.js'
|
|
6
|
+
|
|
7
|
+
export const TIMER_SET_TOOL_NAME = 'timer_set'
|
|
8
|
+
export const TIMER_LIST_TOOL_NAME = 'timer_list'
|
|
9
|
+
export const TIMER_CANCEL_TOOL_NAME = 'timer_cancel'
|
|
10
|
+
export const WAKE_UP_TOOL_NAME = 'wake_up'
|
|
11
|
+
|
|
12
|
+
/** A self-paced wake-up is never sooner than this many seconds away. */
|
|
13
|
+
export const WAKE_UP_MIN_SECONDS = 60
|
|
14
|
+
/** A self-paced wake-up is never later than this many seconds away. */
|
|
15
|
+
export const WAKE_UP_MAX_SECONDS = 3600
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The delay a wake-up really gets: rounded to a whole second and held between
|
|
19
|
+
* a minute and an hour. Not a number counts as the shortest, infinity as the
|
|
20
|
+
* longest.
|
|
21
|
+
*/
|
|
22
|
+
export function clampWakeUpDelay(requested: number): { seconds: number; clamped: boolean } {
|
|
23
|
+
let rounded: number
|
|
24
|
+
if (Number.isNaN(requested)) rounded = WAKE_UP_MIN_SECONDS
|
|
25
|
+
else if (requested === Number.POSITIVE_INFINITY) rounded = WAKE_UP_MAX_SECONDS
|
|
26
|
+
else if (requested === Number.NEGATIVE_INFINITY) rounded = WAKE_UP_MIN_SECONDS
|
|
27
|
+
else rounded = Math.round(requested)
|
|
28
|
+
const seconds = Math.max(WAKE_UP_MIN_SECONDS, Math.min(WAKE_UP_MAX_SECONDS, rounded))
|
|
29
|
+
return { seconds, clamped: !Number.isFinite(requested) || rounded !== seconds }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const MAX = 80
|
|
33
|
+
|
|
34
|
+
function oneLine(value: unknown): string {
|
|
35
|
+
if (typeof value !== 'string') return ''
|
|
36
|
+
const flat = value.replace(/\s+/g, ' ').trim()
|
|
37
|
+
return flat.length > MAX ? `${flat.slice(0, MAX - 1)}…` : flat
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function activity(label: string): ToolCallView {
|
|
41
|
+
return { kind: 'generic', presentation: 'activity', label }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const HIDDEN: ToolResultView = { kind: 'generic', label: '', visibility: 'hidden' }
|
|
45
|
+
|
|
46
|
+
function failureOrHidden(result: { success: boolean; error?: string }): ToolResultView {
|
|
47
|
+
if (!result.success) return { kind: 'generic', label: oneLine(result.error) || 'Not done' }
|
|
48
|
+
return HIDDEN
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function clock(iso: string): string {
|
|
52
|
+
const d = new Date(iso)
|
|
53
|
+
const two = (n: number) => String(n).padStart(2, '0')
|
|
54
|
+
return `${two(d.getHours())}:${two(d.getMinutes())}:${two(d.getSeconds())}`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const timerSetSchema = z.object({
|
|
58
|
+
when: z
|
|
59
|
+
.string()
|
|
60
|
+
.describe(
|
|
61
|
+
'when it fires: "10m" or "every 10m" (interval, at least a minute), "in 10m" or "at 14:30" (once), or a five-field cron expression in local time',
|
|
62
|
+
),
|
|
63
|
+
prompt: z
|
|
64
|
+
.string()
|
|
65
|
+
.min(1)
|
|
66
|
+
.max(4_000)
|
|
67
|
+
.describe('the message sent to this conversation each time it fires'),
|
|
68
|
+
recurring: z
|
|
69
|
+
.boolean()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe(
|
|
72
|
+
'true (default) fires every time `when` comes round until cancelled or after 7 days; false fires once at the next match, then is removed',
|
|
73
|
+
),
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const timerCancelSchema = z.object({
|
|
77
|
+
id: z.string().describe('the timer id timer_set returned'),
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const wakeUpSchema = z.object({
|
|
81
|
+
delay_seconds: z
|
|
82
|
+
.number()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe(
|
|
85
|
+
'seconds until the next wake-up, held between 60 and 3600; required unless stop is true',
|
|
86
|
+
),
|
|
87
|
+
reason: z
|
|
88
|
+
.string()
|
|
89
|
+
.optional()
|
|
90
|
+
.describe(
|
|
91
|
+
'one short sentence on why that delay, shown to the person; required unless stop is true',
|
|
92
|
+
),
|
|
93
|
+
quiet: z
|
|
94
|
+
.boolean()
|
|
95
|
+
.optional()
|
|
96
|
+
.describe(
|
|
97
|
+
'true when nothing changed this tick (checked, nothing to report); false when something happened. Runs of quiet ticks are folded on screen',
|
|
98
|
+
),
|
|
99
|
+
stop: z
|
|
100
|
+
.boolean()
|
|
101
|
+
.optional()
|
|
102
|
+
.describe('true ends the self-paced loop now; every other field is then ignored'),
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* `timer_set`, `timer_list`, `timer_cancel`: prompts the model sets to fire
|
|
107
|
+
* into THIS conversation once or on a schedule, in memory only.
|
|
108
|
+
*
|
|
109
|
+
* Unlike `session_loop` they need no review: a timer lives only while the
|
|
110
|
+
* session is open, is never written to the durable schedule store, fires only
|
|
111
|
+
* when the conversation is idle (queued behind a running turn), and is shown to
|
|
112
|
+
* the person when it fires.
|
|
113
|
+
*/
|
|
114
|
+
export function buildSessionTimerTools(host: SessionTimerHost): ToolDefinition[] {
|
|
115
|
+
return [
|
|
116
|
+
defineTool({
|
|
117
|
+
name: TIMER_SET_TOOL_NAME,
|
|
118
|
+
description:
|
|
119
|
+
'Set a timer that sends a prompt to this conversation later: once ("remind me at 3pm") or on a schedule. It lives only while this session is open, fires only between turns, and recurring timers end after 7 days. A recurring timer may fire a little late, by at most half its interval and never more than 30 minutes; pick a minute other than :00 and :30 when the time is not fixed. At most 50 timers. For work that must survive closing Namzu use schedule; to repeat on the user\'s request use session_loop.',
|
|
120
|
+
inputSchema: timerSetSchema,
|
|
121
|
+
category: 'custom',
|
|
122
|
+
permissions: [],
|
|
123
|
+
readOnly: false,
|
|
124
|
+
destructive: false,
|
|
125
|
+
concurrencySafe: false,
|
|
126
|
+
presentCall: (input: { when?: unknown; prompt?: unknown }) =>
|
|
127
|
+
activity(`Timer ${oneLine(input.when)} · ${oneLine(input.prompt)}`),
|
|
128
|
+
presentResult: (_input: unknown, result) => failureOrHidden(result),
|
|
129
|
+
async execute(input) {
|
|
130
|
+
try {
|
|
131
|
+
const timer = await host.create({
|
|
132
|
+
when: input.when,
|
|
133
|
+
prompt: input.prompt,
|
|
134
|
+
recurring: input.recurring ?? true,
|
|
135
|
+
})
|
|
136
|
+
const next = timer.nextFireAt ? ` Next run: ${clock(timer.nextFireAt)}.` : ''
|
|
137
|
+
return {
|
|
138
|
+
success: true,
|
|
139
|
+
output: timer.recurring
|
|
140
|
+
? `Timer ${timer.id} set (${timer.schedule}).${next} Session-only; it ends after 7 days. timer_cancel ${timer.id} stops it sooner.`
|
|
141
|
+
: `Timer ${timer.id} set (${timer.schedule}).${next} Session-only; it fires once, then is removed.`,
|
|
142
|
+
data: { id: timer.id },
|
|
143
|
+
}
|
|
144
|
+
} catch (error) {
|
|
145
|
+
return {
|
|
146
|
+
success: false,
|
|
147
|
+
output: '',
|
|
148
|
+
error: error instanceof Error ? error.message : String(error),
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
defineTool({
|
|
154
|
+
name: TIMER_LIST_TOOL_NAME,
|
|
155
|
+
description: "List this session's timers with when each next fires.",
|
|
156
|
+
inputSchema: z.object({}),
|
|
157
|
+
category: 'custom',
|
|
158
|
+
permissions: [],
|
|
159
|
+
readOnly: true,
|
|
160
|
+
destructive: false,
|
|
161
|
+
concurrencySafe: true,
|
|
162
|
+
presentCall: () => activity('List timers'),
|
|
163
|
+
presentResult: (_input: unknown, result) => failureOrHidden(result),
|
|
164
|
+
async execute() {
|
|
165
|
+
const timers = host.list()
|
|
166
|
+
if (timers.length === 0) return { success: true, output: 'No timers.', data: { timers } }
|
|
167
|
+
return {
|
|
168
|
+
success: true,
|
|
169
|
+
output: timers
|
|
170
|
+
.map(
|
|
171
|
+
(t) =>
|
|
172
|
+
`${t.id} — ${t.schedule} (${t.recurring ? 'recurring' : 'once'})${t.nextFireAt ? `, next run ${clock(t.nextFireAt)}` : ''}: ${oneLine(t.prompt)}`,
|
|
173
|
+
)
|
|
174
|
+
.join('\n'),
|
|
175
|
+
data: { timers },
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
defineTool({
|
|
180
|
+
name: TIMER_CANCEL_TOOL_NAME,
|
|
181
|
+
description: 'Cancel a timer set with timer_set, by its id.',
|
|
182
|
+
inputSchema: timerCancelSchema,
|
|
183
|
+
category: 'custom',
|
|
184
|
+
permissions: [],
|
|
185
|
+
readOnly: false,
|
|
186
|
+
destructive: false,
|
|
187
|
+
concurrencySafe: false,
|
|
188
|
+
presentCall: () => activity('Cancel timer'),
|
|
189
|
+
presentResult: (_input: unknown, result) => failureOrHidden(result),
|
|
190
|
+
async execute(input) {
|
|
191
|
+
const stopped = await host.cancel(input.id)
|
|
192
|
+
return stopped
|
|
193
|
+
? { success: true, output: `Cancelled timer ${input.id}.` }
|
|
194
|
+
: { success: false, output: '', error: `No timer has id "${input.id}".` }
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* `wake_up`: how the model paces a self-paced loop. Each tick it says when to
|
|
202
|
+
* wake next (a minute to an hour away), why, and whether anything changed, or
|
|
203
|
+
* ends the loop. A tick that does not call it ends the loop.
|
|
204
|
+
*/
|
|
205
|
+
export function buildWakeUpTool(host: SelfPacedHost): ToolDefinition {
|
|
206
|
+
return defineTool({
|
|
207
|
+
name: WAKE_UP_TOOL_NAME,
|
|
208
|
+
description:
|
|
209
|
+
'Pace a self-paced loop (one started without an interval). Before ending each tick call it with delay_seconds (held between 60 and 3600), a short reason and quiet; with stop true it ends the loop. Do not poll background work with short waits: pick 1200 to 1800 seconds for idle ticks and wake sooner only for something specific. A tick that does not call it ends the loop.',
|
|
210
|
+
inputSchema: wakeUpSchema,
|
|
211
|
+
category: 'custom',
|
|
212
|
+
permissions: [],
|
|
213
|
+
readOnly: false,
|
|
214
|
+
destructive: false,
|
|
215
|
+
concurrencySafe: false,
|
|
216
|
+
presentCall: (input: { stop?: unknown; reason?: unknown }) =>
|
|
217
|
+
input.stop === true
|
|
218
|
+
? activity('End loop')
|
|
219
|
+
: activity(`Next wake-up · ${oneLine(input.reason)}`),
|
|
220
|
+
presentResult: (_input: unknown, result) => failureOrHidden(result),
|
|
221
|
+
async execute(input) {
|
|
222
|
+
if (input.stop === true) {
|
|
223
|
+
const ended = host.stop()
|
|
224
|
+
return ended === 0
|
|
225
|
+
? { success: true, output: 'No self-paced loop is running; nothing to stop.' }
|
|
226
|
+
: { success: true, output: 'Loop stopped. No further wake-ups are scheduled.' }
|
|
227
|
+
}
|
|
228
|
+
if (input.delay_seconds === undefined || !input.reason) {
|
|
229
|
+
return {
|
|
230
|
+
success: false,
|
|
231
|
+
output: '',
|
|
232
|
+
error: 'delay_seconds and reason are required unless stop is true.',
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
const next = host.wakeUp({
|
|
237
|
+
delaySeconds: input.delay_seconds,
|
|
238
|
+
reason: input.reason,
|
|
239
|
+
quiet: input.quiet === true,
|
|
240
|
+
})
|
|
241
|
+
const note = next.clamped
|
|
242
|
+
? ` (held to ${next.delaySeconds}s from the ${Number.isFinite(input.delay_seconds) ? input.delay_seconds : 'unbounded'}s you asked for)`
|
|
243
|
+
: ''
|
|
244
|
+
return {
|
|
245
|
+
success: true,
|
|
246
|
+
output: `Next wake-up at ${clock(next.dueAt)} (in ${next.delaySeconds}s)${note}. End your turn now; the loop sends you the next tick then.`,
|
|
247
|
+
data: { dueAt: next.dueAt, delaySeconds: next.delaySeconds },
|
|
248
|
+
}
|
|
249
|
+
} catch (error) {
|
|
250
|
+
return {
|
|
251
|
+
success: false,
|
|
252
|
+
output: '',
|
|
253
|
+
error: error instanceof Error ? error.message : String(error),
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
})
|
|
258
|
+
}
|
|
@@ -322,7 +322,22 @@ export interface ScheduleToolHost {
|
|
|
322
322
|
update?(preview: ScheduleJobPreview): Promise<{ readonly name: string; readonly note?: string }>
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
/**
|
|
325
|
+
/**
|
|
326
|
+
* Where a self-paced loop stands: no fixed interval, the model picks each
|
|
327
|
+
* next wake-up after every tick.
|
|
328
|
+
*/
|
|
329
|
+
export interface SessionLoopPace {
|
|
330
|
+
/** When the next tick is due; absent until the first tick has been answered. */
|
|
331
|
+
readonly dueAt?: string
|
|
332
|
+
/** The model's one-sentence reason for the delay it chose. */
|
|
333
|
+
readonly reason?: string
|
|
334
|
+
/** Consecutive ticks the model reported as quiet (nothing changed). */
|
|
335
|
+
readonly quietTicks: number
|
|
336
|
+
/** A tick was sent and the model has not yet said when to wake next. */
|
|
337
|
+
readonly awaitingWakeUp?: boolean
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** A prompt the session re-sends to itself on an interval, or at a pace the model picks. */
|
|
326
341
|
export interface SessionLoop {
|
|
327
342
|
readonly id: string
|
|
328
343
|
/** The interval in words. */
|
|
@@ -332,12 +347,18 @@ export interface SessionLoop {
|
|
|
332
347
|
readonly expiresAt?: string
|
|
333
348
|
readonly lastFiredAt?: string
|
|
334
349
|
readonly createdBy: 'operator' | 'model'
|
|
350
|
+
/** Present on a self-paced loop. */
|
|
351
|
+
readonly paced?: SessionLoopPace
|
|
335
352
|
}
|
|
336
353
|
|
|
337
354
|
export interface SessionLoopHost {
|
|
338
|
-
/**
|
|
355
|
+
/**
|
|
356
|
+
* Throws with a message when the interval is not usable or the loop limit is reached.
|
|
357
|
+
* Without an `interval` the loop is self-paced: the model chooses each next wake-up
|
|
358
|
+
* with `wake_up`.
|
|
359
|
+
*/
|
|
339
360
|
create(request: {
|
|
340
|
-
readonly interval
|
|
361
|
+
readonly interval?: string
|
|
341
362
|
readonly prompt: string
|
|
342
363
|
readonly createdBy: 'model'
|
|
343
364
|
}): Promise<SessionLoop>
|
|
@@ -345,3 +366,51 @@ export interface SessionLoopHost {
|
|
|
345
366
|
/** Stop one loop by id, or every loop with `all`. Returns how many stopped. */
|
|
346
367
|
delete(id: string): Promise<number>
|
|
347
368
|
}
|
|
369
|
+
|
|
370
|
+
/** A prompt the model set to fire into this conversation once, or on a schedule, while the session is open. */
|
|
371
|
+
export interface SessionTimer {
|
|
372
|
+
readonly id: string
|
|
373
|
+
/** When it fires, in words. */
|
|
374
|
+
readonly schedule: string
|
|
375
|
+
readonly prompt: string
|
|
376
|
+
readonly recurring: boolean
|
|
377
|
+
readonly createdAt: string
|
|
378
|
+
/** Recurring timers end seven days after they were made. */
|
|
379
|
+
readonly expiresAt?: string
|
|
380
|
+
readonly nextFireAt?: string
|
|
381
|
+
readonly lastFiredAt?: string
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface SessionTimerHost {
|
|
385
|
+
/** Throws with a message when `when` is not usable or the timer limit is reached. */
|
|
386
|
+
create(request: {
|
|
387
|
+
readonly when: string
|
|
388
|
+
readonly prompt: string
|
|
389
|
+
readonly recurring: boolean
|
|
390
|
+
}): Promise<SessionTimer>
|
|
391
|
+
list(): readonly SessionTimer[]
|
|
392
|
+
/** Cancel one timer by id. Returns false when no timer has that id. */
|
|
393
|
+
cancel(id: string): Promise<boolean>
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/** What a self-paced loop's host does with a wake-up the model asked for. */
|
|
397
|
+
export interface SelfPacedHost {
|
|
398
|
+
/**
|
|
399
|
+
* Schedule the next tick of the loop that is waiting for one. Throws with a
|
|
400
|
+
* message when no self-paced loop is waiting or the loop has reached its
|
|
401
|
+
* maximum duration.
|
|
402
|
+
*/
|
|
403
|
+
wakeUp(request: {
|
|
404
|
+
readonly delaySeconds: number
|
|
405
|
+
readonly reason: string
|
|
406
|
+
/** Nothing changed this tick. */
|
|
407
|
+
readonly quiet: boolean
|
|
408
|
+
}): {
|
|
409
|
+
/** ISO time of the next tick. */
|
|
410
|
+
readonly dueAt: string
|
|
411
|
+
readonly delaySeconds: number
|
|
412
|
+
readonly clamped: boolean
|
|
413
|
+
}
|
|
414
|
+
/** End the self-paced loop that is waiting for a wake-up. Returns how many ended. */
|
|
415
|
+
stop(): number
|
|
416
|
+
}
|
package/src/tools/task/create.ts
CHANGED
|
@@ -36,6 +36,8 @@ export function buildTaskCreateTool(
|
|
|
36
36
|
readOnly: false,
|
|
37
37
|
destructive: false,
|
|
38
38
|
concurrencySafe: true,
|
|
39
|
+
// Tasks are made to be moved through their statuses as the work goes.
|
|
40
|
+
loadsWith: ['task_update'],
|
|
39
41
|
presentCall: presentTaskCreateCall,
|
|
40
42
|
presentResult: presentTaskCreateResult,
|
|
41
43
|
async execute({ subject, description, activeForm, owner, blockedBy, metadata }) {
|