@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
|
@@ -5,6 +5,7 @@ import { defineTool } from '../defineTool.js';
|
|
|
5
5
|
import { neutralizeEnvelopeDelimiter, wrapUntrusted } from '../untrusted-envelope.js';
|
|
6
6
|
import { ScreenshotFrames, assumedDisplay, desktopRectOnImage, pointOnImage, toDisplayPoint, toDisplayRect, toImagePoint, toWindowPoint, } from './computer-use-coordinates.js';
|
|
7
7
|
import { STANDARD_SCREENSHOT_LIMITS, cropAndFitPng, fitPng, pngSize, } from './computer-use-image.js';
|
|
8
|
+
import { coerceWindowId, windowKey } from './computer-use-window-id.js';
|
|
8
9
|
export { HIGH_RES_SCREENSHOT_LIMITS, STANDARD_SCREENSHOT_LIMITS, screenshotTargetSize, } from './computer-use-image.js';
|
|
9
10
|
export const COMPUTER_USE_TOOL_NAME = 'computer_use';
|
|
10
11
|
const DEFAULT_SETTLE_MS = 500;
|
|
@@ -42,6 +43,15 @@ const ADVICE_MIN_CONFIDENCE = 0.85;
|
|
|
42
43
|
const ADVICE_MIN_MARGIN = 0.4;
|
|
43
44
|
/** The most controls an advisor is asked about at once. */
|
|
44
45
|
const MAX_ADVISED_CANDIDATES = 255;
|
|
46
|
+
/** How an application name is compared: trimmed, lower case, without a trailing `.exe`. */
|
|
47
|
+
function deniedAppKey(app) {
|
|
48
|
+
return app
|
|
49
|
+
.trim()
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.replace(/\.exe$/, '');
|
|
52
|
+
}
|
|
53
|
+
/** The longest edge, in pixels, of the picture {@link ComputerUseToolOptions.onObservation} gets. */
|
|
54
|
+
export const OBSERVATION_LONG_EDGE = 720;
|
|
45
55
|
/**
|
|
46
56
|
* Why `provider` cannot drive `computer_use`, or undefined when it can.
|
|
47
57
|
*
|
|
@@ -123,6 +133,7 @@ const keySchema = z.object({
|
|
|
123
133
|
at: pointSchema.optional(),
|
|
124
134
|
delivery_mode: z.enum(['background', 'foreground']).optional(),
|
|
125
135
|
});
|
|
136
|
+
const windowIdSchema = z.preprocess(coerceWindowId, z.string().min(1));
|
|
126
137
|
const waitSchema = z.object({
|
|
127
138
|
type: z.literal('wait'),
|
|
128
139
|
ms: z.number().int().nonnegative(),
|
|
@@ -130,7 +141,7 @@ const waitSchema = z.object({
|
|
|
130
141
|
const listWindowsSchema = z.object({ type: z.literal('list_windows') });
|
|
131
142
|
const focusWindowSchema = z.object({
|
|
132
143
|
type: z.literal('focus_window'),
|
|
133
|
-
window_id:
|
|
144
|
+
window_id: windowIdSchema,
|
|
134
145
|
});
|
|
135
146
|
const UI_ACTIONS = [
|
|
136
147
|
'invoke',
|
|
@@ -144,7 +155,7 @@ const UI_ACTIONS = [
|
|
|
144
155
|
];
|
|
145
156
|
const uiSnapshotSchema = z.object({
|
|
146
157
|
type: z.literal('ui_snapshot'),
|
|
147
|
-
window_id:
|
|
158
|
+
window_id: windowIdSchema.optional(),
|
|
148
159
|
/** A ref shown by an earlier ui_snapshot: read only that region or control. */
|
|
149
160
|
root: z.string().min(1).optional(),
|
|
150
161
|
/** With root: skip this many of the region's children (the next page of a long region). */
|
|
@@ -167,7 +178,7 @@ const waitForSchema = z.object({
|
|
|
167
178
|
match: z.string().min(1),
|
|
168
179
|
/** Narrows element_* to controls of this role, such as Button. */
|
|
169
180
|
role: z.string().min(1).optional(),
|
|
170
|
-
window_id:
|
|
181
|
+
window_id: windowIdSchema.optional(),
|
|
171
182
|
timeout_ms: z.number().int().positive().optional(),
|
|
172
183
|
});
|
|
173
184
|
const uiActSchema = z.object({
|
|
@@ -184,7 +195,7 @@ const uiDoSchema = z.object({
|
|
|
184
195
|
target: z.string().min(1).max(200),
|
|
185
196
|
action: z.enum(UI_ACTIONS),
|
|
186
197
|
value: z.string().optional(),
|
|
187
|
-
window_id:
|
|
198
|
+
window_id: windowIdSchema.optional(),
|
|
188
199
|
});
|
|
189
200
|
/** What a batch may carry: everything but the image-returning actions and another batch. */
|
|
190
201
|
const batchItemSchema = z.discriminatedUnion('type', [
|
|
@@ -201,11 +212,21 @@ const batchItemSchema = z.discriminatedUnion('type', [
|
|
|
201
212
|
uiActSchema,
|
|
202
213
|
uiDoSchema,
|
|
203
214
|
]);
|
|
215
|
+
/** The actions that read a place or a window off the latest screenshot. */
|
|
216
|
+
const NEEDS_FRAME = new Set([
|
|
217
|
+
'cursor_position',
|
|
218
|
+
'mouse_move',
|
|
219
|
+
'mouse_click',
|
|
220
|
+
'mouse_drag',
|
|
221
|
+
'scroll',
|
|
222
|
+
'type_text',
|
|
223
|
+
'key',
|
|
224
|
+
]);
|
|
204
225
|
const withFrame = { screenshot_id: screenshotIdSchema };
|
|
205
226
|
const actionSchema = z.discriminatedUnion('type', [
|
|
206
227
|
z.object({
|
|
207
228
|
type: z.literal('screenshot'),
|
|
208
|
-
window_id:
|
|
229
|
+
window_id: windowIdSchema.optional(),
|
|
209
230
|
}),
|
|
210
231
|
z.object({ type: z.literal('zoom'), region: regionSchema, ...withFrame }),
|
|
211
232
|
cursorPositionSchema.extend(withFrame),
|
|
@@ -437,6 +458,8 @@ function buildDescription(host, caps, settings, advisor) {
|
|
|
437
458
|
? `Offers the available computer controls on a ${caps.displayServer} host.`
|
|
438
459
|
: `Computer control is unavailable on this ${caps.displayServer} host; this tool reports the limitation.`;
|
|
439
460
|
const lines = [intro, `Available actions: ${available.join('; ') || 'none'}.`];
|
|
461
|
+
if (available.length > 0)
|
|
462
|
+
lines.push('When the person asks you to use an application on the screen ("open the text editor and type …", "click …"), do it here, on the screen, so they watch it happen (start the program from the shell if it is not open, then work in its window with the actions below): a script that writes the file or runs the program is a different way of getting the result, and is fine only when the result is all they asked for. Say in your reply which way you did the work, and never say you typed or clicked in an application when you wrote a file or ran a command instead.');
|
|
440
463
|
if (unavailable.length > 0) {
|
|
441
464
|
lines.push(caps.unavailableReason
|
|
442
465
|
? `Unavailable on this host: ${unavailable.join(', ')} — ${caps.unavailableReason} Do not retry; tell the user.`
|
|
@@ -971,6 +994,19 @@ function hostOutcome(verdict) {
|
|
|
971
994
|
throw deliveryFailure(verdict);
|
|
972
995
|
return deliveryOutcome(verdict);
|
|
973
996
|
}
|
|
997
|
+
const CONSEQUENTIAL_KEYS = /(^|\+)(alt\+f4|ctrl\+q|cmd\+q|super\+q|ctrl\+w|ctrl\+shift\+delete|shift\+delete|ctrl\+enter|cmd\+enter|delete)$/i;
|
|
998
|
+
const CONSEQUENTIAL_WORDS = /(?<!\p{L})(delete|remove|erase|discard|don'?t save|do not save|close|quit|exit|send|submit|pay|purchase|buy|order|sign out|log ?out|empty|format|uninstall|kaydetme|sil|gönder|kapat|çık|çıkış|satın al|öde)(?!\p{L})/iu;
|
|
999
|
+
/** An application as a person reads it: no `.exe`, and a lowercase process name starts with a capital. */
|
|
1000
|
+
function applicationName(name) {
|
|
1001
|
+
const bare = name.trim().replace(/\.exe$/i, '');
|
|
1002
|
+
return bare && bare === bare.toLowerCase()
|
|
1003
|
+
? `${bare.charAt(0).toUpperCase()}${bare.slice(1)}`
|
|
1004
|
+
: bare;
|
|
1005
|
+
}
|
|
1006
|
+
/** Words that make a control's name or an intent one a person should answer for. */
|
|
1007
|
+
function consequentialWords(text) {
|
|
1008
|
+
return text !== undefined && CONSEQUENTIAL_WORDS.test(text);
|
|
1009
|
+
}
|
|
974
1010
|
/** Whether a call sends the screen to the provider (see `ToolDefinition.capturesScreen`). */
|
|
975
1011
|
function capturesScreenInput(input, screenshotAfterActions) {
|
|
976
1012
|
const items = batchActions(input) ?? [input];
|
|
@@ -1090,7 +1126,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1090
1126
|
const label = (input) => itemLabel(input, describeUiRef);
|
|
1091
1127
|
/** The controls of a window's latest reading that offer an action (any, when none is named), as an advisor is shown them. */
|
|
1092
1128
|
const advisedCandidates = (windowId, action) => {
|
|
1093
|
-
const shown = shownRefs.get(windowId
|
|
1129
|
+
const shown = shownRefs.get(windowKey(windowId));
|
|
1094
1130
|
const out = [];
|
|
1095
1131
|
if (!shown)
|
|
1096
1132
|
return out;
|
|
@@ -1523,12 +1559,12 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1523
1559
|
}
|
|
1524
1560
|
uiSnapshotWindowId = snapshot.windowId ?? requestedWindowId;
|
|
1525
1561
|
{
|
|
1526
|
-
const key = uiSnapshotWindowId
|
|
1562
|
+
const key = windowKey(uiSnapshotWindowId);
|
|
1527
1563
|
const now = new Set(refs.keys());
|
|
1528
1564
|
shownRefs.set(key, snapshot.region ? new Set([...(shownRefs.get(key) ?? []), ...now]) : now);
|
|
1529
1565
|
}
|
|
1530
1566
|
if (uiSnapshotWindowId !== undefined)
|
|
1531
|
-
treeUsable.set(uiSnapshotWindowId, refs.size > 0);
|
|
1567
|
+
treeUsable.set(windowKey(uiSnapshotWindowId), refs.size > 0);
|
|
1532
1568
|
uiSnapshotFrame = frames.latest();
|
|
1533
1569
|
const window = snapshot.windowId && /^[\w.:-]{1,64}$/.test(snapshot.windowId) ? snapshot.windowId : undefined;
|
|
1534
1570
|
const opened = openedRef !== undefined && /^e\d{1,6}$/.test(openedRef) ? openedRef : undefined;
|
|
@@ -1661,7 +1697,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1661
1697
|
throw new StepFailure('cancelled');
|
|
1662
1698
|
try {
|
|
1663
1699
|
if (windowCondition) {
|
|
1664
|
-
const windows = await host.listWindows(callSignal);
|
|
1700
|
+
const windows = rememberWindows(await host.listWindows(callSignal));
|
|
1665
1701
|
const open = windows.some((window) => window.title.toLowerCase().includes(needle));
|
|
1666
1702
|
if (open === input.until.endsWith('appears')) {
|
|
1667
1703
|
const seconds = ((Date.now() - started) / 1000).toFixed(1);
|
|
@@ -1707,7 +1743,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1707
1743
|
const coordinateNudge = (frame) => {
|
|
1708
1744
|
if (!frame.window || !available.has('ui_snapshot'))
|
|
1709
1745
|
return undefined;
|
|
1710
|
-
const id = frame.window.window.id;
|
|
1746
|
+
const id = windowKey(frame.window.window.id);
|
|
1711
1747
|
if (nudgedWindows.has(id))
|
|
1712
1748
|
return undefined;
|
|
1713
1749
|
const usable = treeUsable.get(id);
|
|
@@ -1732,7 +1768,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1732
1768
|
return;
|
|
1733
1769
|
let windows;
|
|
1734
1770
|
try {
|
|
1735
|
-
windows = await host.listWindows(callSignal);
|
|
1771
|
+
windows = rememberWindows(await host.listWindows(callSignal));
|
|
1736
1772
|
}
|
|
1737
1773
|
catch (error) {
|
|
1738
1774
|
throw new StepFailure(`the window in front could not be read, so nothing was typed: ${errorText(error)}`);
|
|
@@ -1744,7 +1780,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1744
1780
|
const listWindows = async () => {
|
|
1745
1781
|
let windows;
|
|
1746
1782
|
try {
|
|
1747
|
-
windows = await host.listWindows(callSignal);
|
|
1783
|
+
windows = rememberWindows(await host.listWindows(callSignal));
|
|
1748
1784
|
}
|
|
1749
1785
|
catch (error) {
|
|
1750
1786
|
throw new StepFailure(errorText(error));
|
|
@@ -1940,6 +1976,17 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1940
1976
|
// the screenshot in step 5 should not arrive after steps 1–4 changed
|
|
1941
1977
|
// the desktop.
|
|
1942
1978
|
const planned = [];
|
|
1979
|
+
// An input that reads its place off a screenshot, when none was ever taken: it is not sent. The
|
|
1980
|
+
// tool takes the display screenshot and returns it, so the model chooses its target on a frame it
|
|
1981
|
+
// has seen. Actions before that input still run; it and everything after it do not.
|
|
1982
|
+
const blockedAt = frameId === undefined &&
|
|
1983
|
+
!frames.latest() &&
|
|
1984
|
+
available.has('screenshot') &&
|
|
1985
|
+
hostActionAvailable(caps, 'screenshot')
|
|
1986
|
+
? items.findIndex((item) => NEEDS_FRAME.has(item.type))
|
|
1987
|
+
: -1;
|
|
1988
|
+
const unsent = blockedAt >= 0 ? items.slice(blockedAt) : [];
|
|
1989
|
+
const toPlan = blockedAt >= 0 ? items.slice(0, blockedAt) : items;
|
|
1943
1990
|
const actionFrame = frameId ? frames.get(frameId) : frames.latest();
|
|
1944
1991
|
const explicitDisplayFrame = frameId !== undefined && actionFrame !== undefined && !actionFrame.window;
|
|
1945
1992
|
if (actionFrame?.window &&
|
|
@@ -1954,7 +2001,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
1954
2001
|
};
|
|
1955
2002
|
let postWindowId = actionFrame?.window?.window.id ??
|
|
1956
2003
|
(!hostActionAvailable(caps, 'screenshot') ? uiSnapshotWindowId : undefined);
|
|
1957
|
-
for (const [index, item] of
|
|
2004
|
+
for (const [index, item] of toPlan.entries()) {
|
|
1958
2005
|
try {
|
|
1959
2006
|
planned.push(plan(item, frameId));
|
|
1960
2007
|
}
|
|
@@ -2041,14 +2088,44 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
2041
2088
|
}
|
|
2042
2089
|
for (const step of planned.slice(records.length))
|
|
2043
2090
|
records.push({ label: step.label, status: 'not run' });
|
|
2091
|
+
for (const item of unsent)
|
|
2092
|
+
records.push({ label: label(item), status: 'not run' });
|
|
2093
|
+
const total = planned.length + unsent.length;
|
|
2094
|
+
// The frame the unsent input needed, taken after the actions that did run.
|
|
2095
|
+
let framePrelude;
|
|
2096
|
+
let frameShot;
|
|
2097
|
+
if (unsent.length > 0 && !failure && !signal?.aborted) {
|
|
2098
|
+
try {
|
|
2099
|
+
if (changed)
|
|
2100
|
+
await settleAfterActions(host, undefined, settings.settleMs, signal);
|
|
2101
|
+
frameShot = await capture();
|
|
2102
|
+
const before = single
|
|
2103
|
+
? ''
|
|
2104
|
+
: planned.length === 0
|
|
2105
|
+
? ' Nothing in the batch ran.'
|
|
2106
|
+
: ` Actions 1-${planned.length} ran; action ${planned.length + 1}${unsent.length > 1 ? ' and the ones after it' : ''} did not.`;
|
|
2107
|
+
framePrelude = `No screenshot had been taken yet, so nothing was clicked or typed: the ${single ? 'action' : 'input'} was not sent.${before} The display screenshot follows (${frameShot.frame.id}, ${frameShot.frame.imageWidth}x${frameShot.frame.imageHeight}); choose the target on it and send the action again.`;
|
|
2108
|
+
}
|
|
2109
|
+
catch (error) {
|
|
2110
|
+
const why = signal?.aborted ? 'cancelled' : errorText(error);
|
|
2111
|
+
const reason = `no screenshot has been taken yet, so nothing was clicked or typed, and the display screenshot could not be taken: ${why}`;
|
|
2112
|
+
failure = { index: planned.length, error: reason };
|
|
2113
|
+
records[planned.length] = {
|
|
2114
|
+
label: records[planned.length]?.label ?? '',
|
|
2115
|
+
status: 'failed',
|
|
2116
|
+
error: reason,
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2044
2120
|
// The screen after the batch: after anything that may have changed it,
|
|
2045
2121
|
// and after a wait, whose whole point is to look again.
|
|
2046
2122
|
const looks = settings.screenshotAfterActions &&
|
|
2047
2123
|
available.has('screenshot') &&
|
|
2048
2124
|
(hostActionAvailable(caps, 'screenshot') || postWindowId !== undefined) &&
|
|
2049
2125
|
(changed || planned.some((step) => step.item.type === 'wait')) &&
|
|
2126
|
+
unsent.length === 0 &&
|
|
2050
2127
|
!signal?.aborted;
|
|
2051
|
-
let shot;
|
|
2128
|
+
let shot = frameShot;
|
|
2052
2129
|
let shotError;
|
|
2053
2130
|
if (looks) {
|
|
2054
2131
|
try {
|
|
@@ -2070,13 +2147,18 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
2070
2147
|
return `${n}${record.label}: not run`;
|
|
2071
2148
|
}
|
|
2072
2149
|
};
|
|
2073
|
-
const header =
|
|
2074
|
-
? []
|
|
2075
|
-
|
|
2076
|
-
? [
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2150
|
+
const header = [
|
|
2151
|
+
...(framePrelude ? [framePrelude] : []),
|
|
2152
|
+
...(single
|
|
2153
|
+
? []
|
|
2154
|
+
: failure
|
|
2155
|
+
? [
|
|
2156
|
+
`Batch stopped at action ${failure.index + 1} of ${total}; ${total - failure.index - 1} not run.`,
|
|
2157
|
+
]
|
|
2158
|
+
: unsent.length > 0
|
|
2159
|
+
? []
|
|
2160
|
+
: [`Batch: all ${total} actions done.`]),
|
|
2161
|
+
];
|
|
2080
2162
|
const stepLines = records.map(summary);
|
|
2081
2163
|
const shotLines = shot
|
|
2082
2164
|
? [describeFrame(shot.frame)]
|
|
@@ -2137,7 +2219,7 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
2137
2219
|
? failure.unknown.message
|
|
2138
2220
|
: single
|
|
2139
2221
|
? `computer_use failed: ${failure.error}`
|
|
2140
|
-
: `Batch stopped at action ${failure.index + 1} of ${
|
|
2222
|
+
: `Batch stopped at action ${failure.index + 1} of ${total} (${planned[failure.index]?.label}): ${failure.error}`;
|
|
2141
2223
|
return result;
|
|
2142
2224
|
};
|
|
2143
2225
|
// Whether a call sends the screen to the provider: an observation, or an
|
|
@@ -2145,6 +2227,258 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
2145
2227
|
// reach nothing captures nothing.
|
|
2146
2228
|
const observes = available.has('screenshot') || available.has('list_windows') || available.has('ui_snapshot');
|
|
2147
2229
|
const capturesScreen = (input) => observes && capturesScreenInput(input, settings.screenshotAfterActions);
|
|
2230
|
+
/** The newest window list this tool read, so naming an application costs the host no call of its own. */
|
|
2231
|
+
let knownWindows = [];
|
|
2232
|
+
function rememberWindows(listed) {
|
|
2233
|
+
knownWindows = listed;
|
|
2234
|
+
return listed;
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* The application a call works on, from what is already known: the window a call names, the
|
|
2238
|
+
* window a window screenshot is bound to, and on a display screenshot the window under the
|
|
2239
|
+
* click or the one in front, as the newest list this tool read has them.
|
|
2240
|
+
*/
|
|
2241
|
+
/** A tree read or a wait on a control or text with no window named: it reads a window the tool already bound, or else the one in front. */
|
|
2242
|
+
const readsFrontWindow = (item) => item.type === 'ui_snapshot' ||
|
|
2243
|
+
(item.type === 'wait_for' && !String(item.until ?? '').startsWith('window_'));
|
|
2244
|
+
/** The window such a call is bound to by a ref or an earlier tree read, when it names none. */
|
|
2245
|
+
const boundWindowId = (item) => {
|
|
2246
|
+
if (typeof item.window_id === 'string')
|
|
2247
|
+
return item.window_id;
|
|
2248
|
+
if (item.type === 'ui_snapshot' && typeof item.root === 'string')
|
|
2249
|
+
return uiRefs.get(item.root)?.windowId;
|
|
2250
|
+
if (item.type === 'wait_for' && readsFrontWindow(item))
|
|
2251
|
+
return uiSnapshotWindowId;
|
|
2252
|
+
return undefined;
|
|
2253
|
+
};
|
|
2254
|
+
const appsKnown = (input, namedOnly = false) => {
|
|
2255
|
+
const found = [];
|
|
2256
|
+
const add = (app) => {
|
|
2257
|
+
if (app && !found.includes(app))
|
|
2258
|
+
found.push(app);
|
|
2259
|
+
};
|
|
2260
|
+
const items = batchActions(input) ?? [input];
|
|
2261
|
+
for (const item of items) {
|
|
2262
|
+
if (!isRecord(item))
|
|
2263
|
+
continue;
|
|
2264
|
+
if (typeof item.window_id === 'string') {
|
|
2265
|
+
add(knownWindows.find((window) => window.id === item.window_id)?.app);
|
|
2266
|
+
continue;
|
|
2267
|
+
}
|
|
2268
|
+
const bound = boundWindowId(item);
|
|
2269
|
+
if (bound !== undefined) {
|
|
2270
|
+
add(knownWindows.find((window) => window.id === bound)?.app);
|
|
2271
|
+
continue;
|
|
2272
|
+
}
|
|
2273
|
+
if (readsFrontWindow(item)) {
|
|
2274
|
+
add(knownWindows.find((window) => window.focused && !window.minimized)?.app);
|
|
2275
|
+
continue;
|
|
2276
|
+
}
|
|
2277
|
+
const shotId = typeof item.screenshot_id === 'string'
|
|
2278
|
+
? item.screenshot_id
|
|
2279
|
+
: isRecord(input) && typeof input.screenshot_id === 'string'
|
|
2280
|
+
? input.screenshot_id
|
|
2281
|
+
: undefined;
|
|
2282
|
+
const frame = shotId ? frames.get(shotId) : frames.latest();
|
|
2283
|
+
if (frame?.window) {
|
|
2284
|
+
add(frame.window.window.app);
|
|
2285
|
+
continue;
|
|
2286
|
+
}
|
|
2287
|
+
// A look at the whole display names no application.
|
|
2288
|
+
if (namedOnly)
|
|
2289
|
+
continue;
|
|
2290
|
+
const listed = knownWindows.filter((window) => !window.minimized);
|
|
2291
|
+
const at = isRecord(item.at) ? item.at : undefined;
|
|
2292
|
+
if (frame && at && typeof at.x === 'number' && typeof at.y === 'number') {
|
|
2293
|
+
const point = toDisplayPoint(frame, { x: at.x, y: at.y });
|
|
2294
|
+
const x = frame.display.x + point.x;
|
|
2295
|
+
const y = frame.display.y + point.y;
|
|
2296
|
+
const hit = listed.filter((window) => x >= window.bounds.x &&
|
|
2297
|
+
y >= window.bounds.y &&
|
|
2298
|
+
x < window.bounds.x + window.bounds.width &&
|
|
2299
|
+
y < window.bounds.y + window.bounds.height);
|
|
2300
|
+
const best = hit.find((window) => window.focused) ?? hit[0];
|
|
2301
|
+
if (best) {
|
|
2302
|
+
add(best.app);
|
|
2303
|
+
continue;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
add(listed.find((window) => window.focused)?.app);
|
|
2307
|
+
}
|
|
2308
|
+
return found;
|
|
2309
|
+
};
|
|
2310
|
+
/** The first application a call works on; see {@link appsKnown} for every one. */
|
|
2311
|
+
const appKnown = (input) => appsKnown(input)[0];
|
|
2312
|
+
/**
|
|
2313
|
+
* The application a call works on, before it runs. It reads the windows afresh when the host can
|
|
2314
|
+
* list them, so a review screen names the application as it is now.
|
|
2315
|
+
*/
|
|
2316
|
+
const appsOf = async (input) => {
|
|
2317
|
+
if (typeof host.listWindows === 'function') {
|
|
2318
|
+
try {
|
|
2319
|
+
rememberWindows(await host.listWindows(callSignal));
|
|
2320
|
+
}
|
|
2321
|
+
catch {
|
|
2322
|
+
/* The application is a nicety; a host that cannot list windows says nothing. */
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
return appsKnown(input);
|
|
2326
|
+
};
|
|
2327
|
+
const appOf = async (input) => (await appsOf(input))[0];
|
|
2328
|
+
/** Why one call must be answered for even in an allowed application; see {@link ComputerUseTool.consequence}. */
|
|
2329
|
+
const consequence = (input) => {
|
|
2330
|
+
const items = batchActions(input) ?? [input];
|
|
2331
|
+
for (const item of items) {
|
|
2332
|
+
if (!isRecord(item))
|
|
2333
|
+
continue;
|
|
2334
|
+
if (item.type === 'key' &&
|
|
2335
|
+
typeof item.keys === 'string' &&
|
|
2336
|
+
CONSEQUENTIAL_KEYS.test(item.keys.trim()))
|
|
2337
|
+
return `presses ${item.keys}`;
|
|
2338
|
+
if (item.type === 'ui_act' || item.type === 'ui_do') {
|
|
2339
|
+
const named = typeof item.ref === 'string'
|
|
2340
|
+
? describeUiRef(item.ref)
|
|
2341
|
+
: typeof item.target === 'string'
|
|
2342
|
+
? item.target
|
|
2343
|
+
: undefined;
|
|
2344
|
+
const intent = typeof item.intent === 'string' ? item.intent : undefined;
|
|
2345
|
+
if (consequentialWords(named) || consequentialWords(intent))
|
|
2346
|
+
return `acts on ${named ?? intent}`;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
return undefined;
|
|
2350
|
+
};
|
|
2351
|
+
// The applications this conversation's calls have worked on, so the first use of each is listed.
|
|
2352
|
+
const appsUsed = new Set();
|
|
2353
|
+
/** What the person gets of the picture the model received: small, with where a click landed. */
|
|
2354
|
+
const observe = async (input, before, result, toolUseId, app) => {
|
|
2355
|
+
if (!options.onObservation)
|
|
2356
|
+
return;
|
|
2357
|
+
try {
|
|
2358
|
+
const data = result.data;
|
|
2359
|
+
const image = Array.isArray(result.content)
|
|
2360
|
+
? result.content.find((block) => block.type === 'image')
|
|
2361
|
+
: undefined;
|
|
2362
|
+
const frameId = data?.screenshot?.id;
|
|
2363
|
+
if (!image || image.type !== 'image' || typeof frameId !== 'string')
|
|
2364
|
+
return;
|
|
2365
|
+
const small = await fitPng(Buffer.from(image.data, 'base64'), {
|
|
2366
|
+
maxLongEdge: OBSERVATION_LONG_EDGE,
|
|
2367
|
+
maxTiles: 600,
|
|
2368
|
+
});
|
|
2369
|
+
const items = batchActions(input) ?? [input];
|
|
2370
|
+
const click = [...items]
|
|
2371
|
+
.reverse()
|
|
2372
|
+
.find((item) => isRecord(item) && item.type === 'mouse_click' && isRecord(item.at));
|
|
2373
|
+
const at = isRecord(click) && isRecord(click.at) ? click.at : undefined;
|
|
2374
|
+
const point = before && at && typeof at.x === 'number' && typeof at.y === 'number'
|
|
2375
|
+
? {
|
|
2376
|
+
x: Math.min(1, Math.max(0, at.x / Math.max(1, before.imageWidth))),
|
|
2377
|
+
y: Math.min(1, Math.max(0, at.y / Math.max(1, before.imageHeight))),
|
|
2378
|
+
}
|
|
2379
|
+
: undefined;
|
|
2380
|
+
options.onObservation({
|
|
2381
|
+
...(toolUseId ? { toolUseId } : {}),
|
|
2382
|
+
frameId,
|
|
2383
|
+
action: label(input),
|
|
2384
|
+
...(app ? { app } : {}),
|
|
2385
|
+
mimeType: 'image/png',
|
|
2386
|
+
data: small.data.toString('base64'),
|
|
2387
|
+
width: small.width,
|
|
2388
|
+
height: small.height,
|
|
2389
|
+
...(point ? { point } : {}),
|
|
2390
|
+
});
|
|
2391
|
+
}
|
|
2392
|
+
catch {
|
|
2393
|
+
/* What the person is shown never changes what the model gets. */
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
const deniedKeys = new Set((options.deniedApps ?? []).map(deniedAppKey).filter((key) => key !== ''));
|
|
2397
|
+
/**
|
|
2398
|
+
* Why this call may not run because of the denied-application list, or undefined. Checked
|
|
2399
|
+
* before the host is touched, so no look, click or key reaches a window of a listed application.
|
|
2400
|
+
*/
|
|
2401
|
+
const deniedAppRefusal = async (input, context) => {
|
|
2402
|
+
if (deniedKeys.size === 0)
|
|
2403
|
+
return undefined;
|
|
2404
|
+
const readOnly = isReadOnlyInput(input);
|
|
2405
|
+
let refreshFailed = false;
|
|
2406
|
+
if (typeof host.listWindows === 'function') {
|
|
2407
|
+
try {
|
|
2408
|
+
rememberWindows(await host.listWindows(context.abortSignal));
|
|
2409
|
+
}
|
|
2410
|
+
catch (error) {
|
|
2411
|
+
refreshFailed = true;
|
|
2412
|
+
if (!readOnly)
|
|
2413
|
+
return `computer_use could not read which application this would act in (${errorText(error)}), and some applications are off limits, so nothing was done.`;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
else if (!readOnly) {
|
|
2417
|
+
return 'computer_use cannot tell which application this would act in on this computer, and some applications are off limits, so nothing was done.';
|
|
2418
|
+
}
|
|
2419
|
+
// A window the list cannot place may belong to a listed application: refuse it.
|
|
2420
|
+
const stale = refreshFailed;
|
|
2421
|
+
for (const item of batchActions(input) ?? [input]) {
|
|
2422
|
+
if (!isRecord(item))
|
|
2423
|
+
continue;
|
|
2424
|
+
const id = boundWindowId(item);
|
|
2425
|
+
const placeable = id === undefined || knownWindows.some((window) => window.id === id);
|
|
2426
|
+
if (!placeable || (stale && (id !== undefined || readsFrontWindow(item))))
|
|
2427
|
+
return 'computer_use cannot tell which application that window belongs to, and some applications are off limits, so nothing was done.';
|
|
2428
|
+
}
|
|
2429
|
+
const app = appsKnown(input, readOnly).find((name) => deniedKeys.has(deniedAppKey(name)));
|
|
2430
|
+
if (app === undefined)
|
|
2431
|
+
return undefined;
|
|
2432
|
+
return `computer_use does not act in ${applicationName(app)}: the person put it off limits. Nothing was done. Use another application, or tell the person you need it and let them change the list.`;
|
|
2433
|
+
};
|
|
2434
|
+
const runAction = async (input, context) => {
|
|
2435
|
+
const denied = refusal(input.type);
|
|
2436
|
+
if (denied)
|
|
2437
|
+
return { success: false, output: '', error: denied };
|
|
2438
|
+
// The host keeps per-turn state (an Escape stop, refused permissions); it
|
|
2439
|
+
// is told which turn this is and released when the turn is cut short.
|
|
2440
|
+
host.beginTurn?.(context.turnId);
|
|
2441
|
+
callSignal = context.abortSignal;
|
|
2442
|
+
if (host.endTurn) {
|
|
2443
|
+
const release = () => void Promise.resolve(host.endTurn?.()).catch(() => undefined);
|
|
2444
|
+
if (context.abortSignal.aborted)
|
|
2445
|
+
release();
|
|
2446
|
+
else
|
|
2447
|
+
context.abortSignal.addEventListener('abort', release, {
|
|
2448
|
+
once: true,
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
try {
|
|
2452
|
+
switch (input.type) {
|
|
2453
|
+
case 'screenshot':
|
|
2454
|
+
return screenshotResult(await capture(input.window_id));
|
|
2455
|
+
case 'zoom':
|
|
2456
|
+
return await zoom(input);
|
|
2457
|
+
case 'ui_snapshot':
|
|
2458
|
+
return await uiSnapshot(input);
|
|
2459
|
+
case 'wait_for':
|
|
2460
|
+
return await waitFor(input, context);
|
|
2461
|
+
case 'batch':
|
|
2462
|
+
return await runSteps(input.actions, input.screenshot_id, context, false);
|
|
2463
|
+
default: {
|
|
2464
|
+
const { screenshot_id: frameId, ...item } = input;
|
|
2465
|
+
return await runSteps([item], frameId, context, true);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
catch (error) {
|
|
2470
|
+
if (error instanceof StepFailure)
|
|
2471
|
+
return {
|
|
2472
|
+
success: false,
|
|
2473
|
+
output: '',
|
|
2474
|
+
error: `computer_use failed: ${error.message}`,
|
|
2475
|
+
};
|
|
2476
|
+
throw error;
|
|
2477
|
+
}
|
|
2478
|
+
finally {
|
|
2479
|
+
callSignal = undefined;
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2148
2482
|
const tool = defineTool({
|
|
2149
2483
|
name: COMPUTER_USE_TOOL_NAME,
|
|
2150
2484
|
description: buildDescription(host, caps, settings, options.advisor),
|
|
@@ -2166,58 +2500,37 @@ export function createComputerUseTool(host, options = {}) {
|
|
|
2166
2500
|
// without its input (the CLI passes `{}`). An action that only reports
|
|
2167
2501
|
// "done" — and the screenshot that followed it, which is for the model —
|
|
2168
2502
|
// adds nothing to the call row; observations, batches and failures do.
|
|
2169
|
-
presentResult: (_input, result) =>
|
|
2170
|
-
|
|
2171
|
-
|
|
2503
|
+
presentResult: (_input, result) => {
|
|
2504
|
+
// The first call to work on an application says so, so a person reading the
|
|
2505
|
+
// conversation can see which applications this conversation has used.
|
|
2506
|
+
const first = isRecord(result.data) ? result.data.firstUseOf : undefined;
|
|
2507
|
+
if (result.success && typeof first === 'string')
|
|
2508
|
+
return {
|
|
2509
|
+
kind: 'generic',
|
|
2510
|
+
label: `Using ${applicationName(first)}`,
|
|
2511
|
+
presentation: 'activity',
|
|
2512
|
+
};
|
|
2513
|
+
return result.success && ACKNOWLEDGEMENT.test(result.output)
|
|
2514
|
+
? { kind: 'generic', label: result.output, visibility: 'hidden' }
|
|
2515
|
+
: undefined;
|
|
2516
|
+
},
|
|
2172
2517
|
async execute(input, context) {
|
|
2173
|
-
const
|
|
2174
|
-
if (
|
|
2175
|
-
return { success: false, output: '', error:
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
host.
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
else
|
|
2185
|
-
context.abortSignal.addEventListener('abort', release, {
|
|
2186
|
-
once: true,
|
|
2187
|
-
});
|
|
2188
|
-
}
|
|
2189
|
-
try {
|
|
2190
|
-
switch (input.type) {
|
|
2191
|
-
case 'screenshot':
|
|
2192
|
-
return screenshotResult(await capture(input.window_id));
|
|
2193
|
-
case 'zoom':
|
|
2194
|
-
return await zoom(input);
|
|
2195
|
-
case 'ui_snapshot':
|
|
2196
|
-
return await uiSnapshot(input);
|
|
2197
|
-
case 'wait_for':
|
|
2198
|
-
return await waitFor(input, context);
|
|
2199
|
-
case 'batch':
|
|
2200
|
-
return await runSteps(input.actions, input.screenshot_id, context, false);
|
|
2201
|
-
default: {
|
|
2202
|
-
const { screenshot_id: frameId, ...item } = input;
|
|
2203
|
-
return await runSteps([item], frameId, context, true);
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
catch (error) {
|
|
2208
|
-
if (error instanceof StepFailure)
|
|
2209
|
-
return {
|
|
2210
|
-
success: false,
|
|
2211
|
-
output: '',
|
|
2212
|
-
error: `computer_use failed: ${error.message}`,
|
|
2213
|
-
};
|
|
2214
|
-
throw error;
|
|
2215
|
-
}
|
|
2216
|
-
finally {
|
|
2217
|
-
callSignal = undefined;
|
|
2518
|
+
const keptOut = await deniedAppRefusal(input, context);
|
|
2519
|
+
if (keptOut)
|
|
2520
|
+
return { success: false, output: '', error: keptOut };
|
|
2521
|
+
const shotId = 'screenshot_id' in input ? input.screenshot_id : undefined;
|
|
2522
|
+
const before = shotId ? frames.get(shotId) : frames.latest();
|
|
2523
|
+
// Only what is already known: acting must not cost the host a call it would not make.
|
|
2524
|
+
const app = appKnown(input);
|
|
2525
|
+
const result = await runAction(input, context);
|
|
2526
|
+
if (app && result.success !== false && !appsUsed.has(app) && !isReadOnlyInput(input)) {
|
|
2527
|
+
appsUsed.add(app);
|
|
2528
|
+
result.data = { ...(isRecord(result.data) ? result.data : {}), firstUseOf: app };
|
|
2218
2529
|
}
|
|
2530
|
+
await observe(input, before, result, context.toolUseId, app);
|
|
2531
|
+
return result;
|
|
2219
2532
|
},
|
|
2220
2533
|
});
|
|
2221
|
-
return Object.assign(tool, { describeUiRef });
|
|
2534
|
+
return Object.assign(tool, { describeUiRef, appOf, appsOf, consequence });
|
|
2222
2535
|
}
|
|
2223
2536
|
//# sourceMappingURL=computer-use.js.map
|