@namzu/sdk 68.0.1 → 69.1.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 +96 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -1
- package/dist/agents/QueryAgent.js +2 -0
- package/dist/agents/QueryAgent.js.map +1 -1
- package/dist/authorization/skill-grant.d.ts.map +1 -1
- package/dist/authorization/skill-grant.js +1 -0
- package/dist/authorization/skill-grant.js.map +1 -1
- package/dist/bridge/acp/permission.d.ts +10 -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 +12 -0
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +21 -0
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/compaction/context-window.d.ts +8 -0
- package/dist/compaction/context-window.d.ts.map +1 -1
- package/dist/compaction/context-window.js +14 -0
- package/dist/compaction/context-window.js.map +1 -1
- package/dist/compaction/loaded-skills.d.ts +10 -0
- package/dist/compaction/loaded-skills.d.ts.map +1 -1
- package/dist/compaction/loaded-skills.js +45 -1
- package/dist/compaction/loaded-skills.js.map +1 -1
- package/dist/compaction/manager.d.ts +8 -0
- package/dist/compaction/manager.d.ts.map +1 -1
- package/dist/compaction/manager.js +31 -0
- package/dist/compaction/manager.js.map +1 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +7 -1
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/model-summary.js +2 -2
- package/dist/compaction/model-summary.js.map +1 -1
- package/dist/compaction/restore.d.ts +8 -0
- package/dist/compaction/restore.d.ts.map +1 -1
- package/dist/compaction/restore.js +65 -0
- package/dist/compaction/restore.js.map +1 -1
- package/dist/compaction/salience/working-set.d.ts.map +1 -1
- package/dist/compaction/salience/working-set.js +2 -2
- package/dist/compaction/salience/working-set.js.map +1 -1
- package/dist/compaction/tool-result-editing.d.ts +6 -0
- package/dist/compaction/tool-result-editing.d.ts.map +1 -1
- package/dist/compaction/tool-result-editing.js +7 -1
- package/dist/compaction/tool-result-editing.js.map +1 -1
- package/dist/compaction/types.d.ts +2 -0
- package/dist/compaction/types.d.ts.map +1 -1
- package/dist/compaction/wire.d.ts.map +1 -1
- package/dist/compaction/wire.js +4 -0
- package/dist/compaction/wire.js.map +1 -1
- package/dist/connector/index.d.ts +2 -2
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +1 -1
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +29 -0
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +59 -2
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/errors.d.ts +7 -0
- package/dist/connector/mcp/errors.d.ts.map +1 -1
- package/dist/connector/mcp/errors.js +14 -0
- package/dist/connector/mcp/errors.js.map +1 -1
- package/dist/connector/mcp/index.d.ts +5 -1
- package/dist/connector/mcp/index.d.ts.map +1 -1
- package/dist/connector/mcp/index.js +3 -1
- package/dist/connector/mcp/index.js.map +1 -1
- package/dist/connector/mcp/skill-source.d.ts +144 -0
- package/dist/connector/mcp/skill-source.d.ts.map +1 -0
- package/dist/connector/mcp/skill-source.js +375 -0
- package/dist/connector/mcp/skill-source.js.map +1 -0
- package/dist/connector/mcp/skills.d.ts +137 -0
- package/dist/connector/mcp/skills.d.ts.map +1 -0
- package/dist/connector/mcp/skills.js +303 -0
- package/dist/connector/mcp/skills.js.map +1 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +23 -1
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/network/audit.d.ts +1 -1
- package/dist/network/audit.d.ts.map +1 -1
- package/dist/network/audit.js +2 -0
- package/dist/network/audit.js.map +1 -1
- package/dist/network/computer.d.ts +107 -0
- package/dist/network/computer.d.ts.map +1 -0
- package/dist/network/computer.js +250 -0
- package/dist/network/computer.js.map +1 -0
- package/dist/network/index.d.ts +2 -0
- package/dist/network/index.d.ts.map +1 -1
- package/dist/network/index.js +1 -0
- package/dist/network/index.js.map +1 -1
- package/dist/network/join.d.ts +13 -1
- package/dist/network/join.d.ts.map +1 -1
- package/dist/network/join.js +21 -3
- package/dist/network/join.js.map +1 -1
- package/dist/network/roster.d.ts +5 -0
- package/dist/network/roster.d.ts.map +1 -1
- package/dist/network/roster.js.map +1 -1
- package/dist/network/service.d.ts +12 -2
- package/dist/network/service.d.ts.map +1 -1
- package/dist/network/service.js +539 -60
- package/dist/network/service.js.map +1 -1
- package/dist/network/store.d.ts +33 -1
- package/dist/network/store.d.ts.map +1 -1
- package/dist/network/store.js +48 -4
- package/dist/network/store.js.map +1 -1
- package/dist/network/transport.d.ts +1 -1
- package/dist/network/transport.js +1 -1
- package/dist/network/wire.d.ts +14 -0
- package/dist/network/wire.d.ts.map +1 -1
- package/dist/network/wire.js +17 -1
- package/dist/network/wire.js.map +1 -1
- package/dist/plugin/shell-hook-tool-names.d.ts.map +1 -1
- package/dist/plugin/shell-hook-tool-names.js +1 -0
- package/dist/plugin/shell-hook-tool-names.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +8 -3
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +132 -7
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +4 -4
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +7 -2
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +9 -0
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts.map +1 -1
- package/dist/provider/idle-timeout.js +8 -0
- package/dist/provider/idle-timeout.js.map +1 -1
- package/dist/provider/instrumentation.d.ts.map +1 -1
- package/dist/provider/instrumentation.js +10 -0
- package/dist/provider/instrumentation.js.map +1 -1
- package/dist/provider/model-window-suffix.d.ts.map +1 -1
- package/dist/provider/model-window-suffix.js +2 -0
- package/dist/provider/model-window-suffix.js.map +1 -1
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +8 -0
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +10 -7
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +12 -5
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +7 -4
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +9 -3
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +4 -1
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/tool/presentation.d.ts +8 -1
- package/dist/registry/tool/presentation.d.ts.map +1 -1
- package/dist/registry/tool/presentation.js +14 -5
- package/dist/registry/tool/presentation.js.map +1 -1
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +2 -1
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.js +19 -3
- package/dist/runtime/query/auto-review/classifier.js.map +1 -1
- package/dist/runtime/query/auto-review/failure.d.ts +12 -0
- package/dist/runtime/query/auto-review/failure.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/failure.js +46 -0
- package/dist/runtime/query/auto-review/failure.js.map +1 -0
- package/dist/runtime/query/auto-review/index.d.ts +1 -0
- package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/index.js +1 -0
- package/dist/runtime/query/auto-review/index.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 +10 -1
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +12 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +43 -9
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/file-evidence-replay.d.ts.map +1 -1
- package/dist/runtime/query/file-evidence-replay.js +6 -6
- package/dist/runtime/query/file-evidence-replay.js.map +1 -1
- package/dist/runtime/query/index.d.ts +4 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +40 -1
- 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 +2 -0
- 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 +21 -3
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +4 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts +6 -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 +24 -9
- package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
- package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
- package/dist/runtime/query/iteration/step-shaping.js +4 -0
- package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
- package/dist/runtime/query/prepare-turn.d.ts +5 -1
- package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
- package/dist/runtime/query/prepare-turn.js +13 -3
- package/dist/runtime/query/prepare-turn.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +15 -4
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +15 -4
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/shell-line-escalation.d.ts +24 -0
- package/dist/runtime/query/shell-line-escalation.d.ts.map +1 -0
- package/dist/runtime/query/shell-line-escalation.js +38 -0
- package/dist/runtime/query/shell-line-escalation.js.map +1 -0
- package/dist/runtime/query/tooling.d.ts +7 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +2 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.d.ts +4 -0
- package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.js +47 -1
- package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +3 -1
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/scheduler/local.d.ts.map +1 -1
- package/dist/scheduler/local.js +3 -1
- package/dist/scheduler/local.js.map +1 -1
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/inline-shell-host.d.ts +103 -0
- package/dist/skills/inline-shell-host.d.ts.map +1 -0
- package/dist/skills/inline-shell-host.js +238 -0
- package/dist/skills/inline-shell-host.js.map +1 -0
- package/dist/skills/inline-shell.d.ts +176 -0
- package/dist/skills/inline-shell.d.ts.map +1 -0
- package/dist/skills/inline-shell.js +646 -0
- package/dist/skills/inline-shell.js.map +1 -0
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +1 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/task/file.d.ts +124 -0
- package/dist/store/task/file.d.ts.map +1 -0
- package/dist/store/task/file.js +498 -0
- package/dist/store/task/file.js.map +1 -0
- package/dist/teams/backend.d.ts +28 -0
- package/dist/teams/backend.d.ts.map +1 -0
- package/dist/teams/backend.js +2 -0
- package/dist/teams/backend.js.map +1 -0
- package/dist/teams/fs-sync.d.ts +19 -0
- package/dist/teams/fs-sync.d.ts.map +1 -0
- package/dist/teams/fs-sync.js +81 -0
- package/dist/teams/fs-sync.js.map +1 -0
- package/dist/teams/index.d.ts +14 -0
- package/dist/teams/index.d.ts.map +1 -0
- package/dist/teams/index.js +11 -0
- package/dist/teams/index.js.map +1 -0
- package/dist/teams/names.d.ts +15 -0
- package/dist/teams/names.d.ts.map +1 -0
- package/dist/teams/names.js +43 -0
- package/dist/teams/names.js.map +1 -0
- package/dist/teams/store.d.ts +133 -0
- package/dist/teams/store.d.ts.map +1 -0
- package/dist/teams/store.js +536 -0
- package/dist/teams/store.js.map +1 -0
- package/dist/teams/types.d.ts +97 -0
- package/dist/teams/types.d.ts.map +1 -0
- package/dist/teams/types.js +70 -0
- package/dist/teams/types.js.map +1 -0
- package/dist/tools/admit-facts.d.ts.map +1 -1
- package/dist/tools/admit-facts.js +28 -0
- package/dist/tools/admit-facts.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +5 -2
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser.js +1 -1
- package/dist/tools/builtins/browser.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +60 -2
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +695 -80
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +2 -1
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit-apply.d.ts +1 -0
- package/dist/tools/builtins/edit-apply.d.ts.map +1 -1
- package/dist/tools/builtins/edit-apply.js +108 -21
- package/dist/tools/builtins/edit-apply.js.map +1 -1
- package/dist/tools/builtins/edit-match.d.ts +37 -0
- package/dist/tools/builtins/edit-match.d.ts.map +1 -1
- package/dist/tools/builtins/edit-match.js +193 -0
- package/dist/tools/builtins/edit-match.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +14 -7
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/exit-semantics.d.ts +8 -0
- package/dist/tools/builtins/exit-semantics.d.ts.map +1 -1
- package/dist/tools/builtins/exit-semantics.js +19 -0
- package/dist/tools/builtins/exit-semantics.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +3 -1
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -0
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/present-file.d.ts +24 -0
- package/dist/tools/builtins/present-file.d.ts.map +1 -0
- package/dist/tools/builtins/present-file.js +116 -0
- package/dist/tools/builtins/present-file.js.map +1 -0
- package/dist/tools/builtins/read-file.js +1 -1
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/read-render.d.ts +12 -1
- package/dist/tools/builtins/read-render.d.ts.map +1 -1
- package/dist/tools/builtins/read-render.js +16 -3
- package/dist/tools/builtins/read-render.js.map +1 -1
- package/dist/tools/builtins/search-tools.d.ts +10 -0
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +36 -2
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts +31 -0
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +232 -88
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +5 -0
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +13 -2
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/task/create.d.ts.map +1 -1
- package/dist/tools/task/create.js +13 -4
- package/dist/tools/task/create.js.map +1 -1
- package/dist/tools/task/get.d.ts +8 -0
- package/dist/tools/task/get.d.ts.map +1 -0
- package/dist/tools/task/get.js +51 -0
- package/dist/tools/task/get.js.map +1 -0
- package/dist/tools/task/index.d.ts +7 -0
- package/dist/tools/task/index.d.ts.map +1 -1
- package/dist/tools/task/index.js +10 -2
- package/dist/tools/task/index.js.map +1 -1
- package/dist/tools/task/list.d.ts.map +1 -1
- package/dist/tools/task/list.js +10 -2
- package/dist/tools/task/list.js.map +1 -1
- package/dist/tools/task/number.d.ts +13 -0
- package/dist/tools/task/number.d.ts.map +1 -0
- package/dist/tools/task/number.js +30 -0
- package/dist/tools/task/number.js.map +1 -0
- package/dist/tools/task/present.d.ts.map +1 -1
- package/dist/tools/task/present.js +17 -3
- package/dist/tools/task/present.js.map +1 -1
- package/dist/tools/task/update.d.ts +2 -1
- package/dist/tools/task/update.d.ts.map +1 -1
- package/dist/tools/task/update.js +87 -20
- package/dist/tools/task/update.js.map +1 -1
- package/dist/types/acp/index.d.ts +10 -0
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/agent/base.d.ts +4 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/scheduler.d.ts +9 -0
- package/dist/types/agent/scheduler.d.ts.map +1 -1
- package/dist/types/computer-use/index.d.ts +7 -0
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +10 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/permission/index.d.ts +20 -0
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +25 -0
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +47 -3
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +4 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +8 -0
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +16 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/model.d.ts +6 -0
- package/dist/types/provider/model.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +2 -0
- package/dist/types/provider/stream.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +28 -2
- 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 +15 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/node-on-path.d.ts +27 -0
- package/dist/utils/node-on-path.d.ts.map +1 -0
- package/dist/utils/node-on-path.js +70 -0
- package/dist/utils/node-on-path.js.map +1 -0
- package/package.json +1 -1
- package/src/agents/QueryAgent.ts +2 -0
- package/src/authorization/skill-grant.ts +1 -0
- package/src/bridge/acp/permission.ts +11 -1
- package/src/bridge/acp/server.ts +26 -0
- package/src/compaction/context-window.ts +18 -0
- package/src/compaction/loaded-skills.ts +42 -1
- package/src/compaction/manager.ts +28 -0
- package/src/compaction/manual.ts +9 -1
- package/src/compaction/model-summary.ts +2 -2
- package/src/compaction/restore.ts +69 -0
- package/src/compaction/salience/working-set.ts +6 -2
- package/src/compaction/tool-result-editing.ts +8 -1
- package/src/compaction/types.ts +2 -0
- package/src/compaction/wire.ts +4 -0
- package/src/connector/index.ts +27 -0
- package/src/connector/mcp/client.ts +71 -2
- package/src/connector/mcp/errors.ts +14 -0
- package/src/connector/mcp/index.ts +36 -0
- package/src/connector/mcp/skill-source.ts +499 -0
- package/src/connector/mcp/skills.ts +367 -0
- package/src/manager/session/turn-recorder.ts +24 -1
- package/src/network/audit.ts +2 -0
- package/src/network/computer.ts +347 -0
- package/src/network/index.ts +20 -0
- package/src/network/join.ts +21 -2
- package/src/network/roster.ts +5 -0
- package/src/network/service.ts +674 -84
- package/src/network/store.ts +57 -4
- package/src/network/transport.ts +1 -1
- package/src/network/wire.ts +18 -1
- package/src/plugin/shell-hook-tool-names.ts +1 -0
- package/src/plugin/shell-hook.ts +144 -7
- package/src/prompt/coding-agent-doctrine.ts +7 -2
- package/src/provider/fallback.ts +10 -0
- package/src/provider/idle-timeout.ts +9 -0
- package/src/provider/instrumentation.ts +12 -0
- package/src/provider/model-window-suffix.ts +2 -0
- package/src/provider/retry.ts +9 -0
- package/src/public-runtime.ts +100 -0
- package/src/public-tools.ts +18 -0
- package/src/public-types.ts +29 -0
- package/src/registry/tool/presentation.ts +14 -4
- package/src/runtime/jobs/registry.ts +2 -1
- package/src/runtime/query/auto-review/classifier.ts +19 -3
- package/src/runtime/query/auto-review/failure.ts +50 -0
- package/src/runtime/query/auto-review/index.ts +1 -0
- package/src/runtime/query/executor/tool-call-admission.ts +10 -1
- package/src/runtime/query/executor.ts +57 -8
- package/src/runtime/query/file-evidence-replay.ts +6 -5
- package/src/runtime/query/index.ts +62 -0
- package/src/runtime/query/iteration/index.ts +2 -0
- package/src/runtime/query/iteration/phases/compaction.ts +25 -2
- package/src/runtime/query/iteration/phases/context.ts +4 -0
- package/src/runtime/query/iteration/phases/per-call-review.ts +24 -7
- package/src/runtime/query/iteration/step-shaping.ts +4 -0
- package/src/runtime/query/prepare-turn.ts +20 -2
- package/src/runtime/query/review-policy.ts +31 -5
- package/src/runtime/query/shell-line-escalation.ts +49 -0
- package/src/runtime/query/tooling.ts +6 -0
- package/src/runtime/query/turn/outcome-ledger.ts +56 -1
- package/src/sandbox/provider/local.ts +3 -1
- package/src/scheduler/local.ts +3 -1
- package/src/skills/index.ts +43 -0
- package/src/skills/inline-shell-host.ts +303 -0
- package/src/skills/inline-shell.ts +765 -0
- package/src/store/index.ts +8 -0
- package/src/store/task/file.ts +641 -0
- package/src/teams/backend.ts +29 -0
- package/src/teams/fs-sync.ts +91 -0
- package/src/teams/index.ts +47 -0
- package/src/teams/names.ts +49 -0
- package/src/teams/store.ts +607 -0
- package/src/teams/types.ts +102 -0
- package/src/tools/admit-facts.ts +26 -0
- package/src/tools/builtins/bash.ts +5 -2
- package/src/tools/builtins/browser.ts +1 -1
- package/src/tools/builtins/computer-use.ts +799 -86
- package/src/tools/builtins/content-fingerprint.ts +2 -1
- package/src/tools/builtins/edit-apply.ts +124 -24
- package/src/tools/builtins/edit-match.ts +200 -0
- package/src/tools/builtins/edit.ts +16 -7
- package/src/tools/builtins/exit-semantics.ts +23 -0
- package/src/tools/builtins/index.ts +3 -0
- package/src/tools/builtins/present-file.ts +127 -0
- package/src/tools/builtins/read-file.ts +1 -1
- package/src/tools/builtins/read-render.ts +18 -3
- package/src/tools/builtins/search-tools.ts +36 -2
- package/src/tools/builtins/skill.ts +291 -95
- package/src/tools/builtins/wait-for-job.ts +5 -0
- package/src/tools/builtins/web.ts +15 -2
- package/src/tools/task/create.ts +13 -4
- package/src/tools/task/get.ts +53 -0
- package/src/tools/task/index.ts +14 -2
- package/src/tools/task/list.ts +10 -2
- package/src/tools/task/number.ts +32 -0
- package/src/tools/task/present.ts +18 -3
- package/src/tools/task/update.ts +94 -20
- package/src/types/acp/index.ts +11 -1
- package/src/types/agent/base.ts +6 -0
- package/src/types/agent/scheduler.ts +9 -0
- package/src/types/computer-use/index.ts +7 -0
- package/src/types/connector/mcp.ts +10 -0
- package/src/types/permission/index.ts +29 -0
- package/src/types/plugin/index.ts +95 -39
- package/src/types/provider/chat.ts +9 -0
- package/src/types/provider/interface.ts +18 -0
- package/src/types/provider/model.ts +6 -0
- package/src/types/provider/stream.ts +2 -0
- package/src/types/tool/index.ts +23 -2
- package/src/types/tool/presentation.ts +14 -0
- package/src/utils/node-on-path.ts +81 -0
package/src/tools/task/create.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { ToolDefinition } from '../../types/tool/index.js'
|
|
|
4
4
|
import { asTaskId } from '../../utils/id.js'
|
|
5
5
|
import { defineTool } from '../defineTool.js'
|
|
6
6
|
import type { TaskToolScope } from './index.js'
|
|
7
|
+
import { taskNumbers } from './number.js'
|
|
7
8
|
import { presentTaskCreateCall, presentTaskCreateResult } from './present.js'
|
|
8
9
|
|
|
9
10
|
export function buildTaskCreateTool(
|
|
@@ -13,7 +14,7 @@ export function buildTaskCreateTool(
|
|
|
13
14
|
return defineTool({
|
|
14
15
|
name: 'task_create',
|
|
15
16
|
description:
|
|
16
|
-
'Create a task to track a unit of planned work. Use this to break down complex work into trackable steps before starting. Each task has a subject (imperative: "Fix auth bug") and optionally an activeForm (present continuous: "Fixing auth bug") for progress display. Returns the new task\'s id.',
|
|
17
|
+
'Create a task to track a unit of planned work. Use this to break down complex work into trackable steps before starting. Each task has a subject (imperative: "Fix auth bug") and optionally an activeForm (present continuous: "Fixing auth bug") for progress display. Call task_list first so you do not add a duplicate. Returns the new task\'s id.',
|
|
17
18
|
inputSchema: z.object({
|
|
18
19
|
subject: z.string().describe('Brief title in imperative form ("Fix auth middleware")'),
|
|
19
20
|
description: z.string().optional().describe('Detailed description of the work'),
|
|
@@ -37,7 +38,7 @@ export function buildTaskCreateTool(
|
|
|
37
38
|
destructive: false,
|
|
38
39
|
concurrencySafe: true,
|
|
39
40
|
// Tasks are made to be moved through their statuses as the work goes.
|
|
40
|
-
loadsWith: ['task_update'],
|
|
41
|
+
loadsWith: ['task_update', 'task_list'],
|
|
41
42
|
presentCall: presentTaskCreateCall,
|
|
42
43
|
presentResult: presentTaskCreateResult,
|
|
43
44
|
async execute({ subject, description, activeForm, owner, blockedBy, metadata }) {
|
|
@@ -52,10 +53,18 @@ export function buildTaskCreateTool(
|
|
|
52
53
|
metadata,
|
|
53
54
|
})
|
|
54
55
|
|
|
56
|
+
const number = (await taskNumbers(taskStore)).get(task.id)
|
|
57
|
+
const named = number === undefined ? `${task.id}` : `#${number} (id ${task.id})`
|
|
55
58
|
return {
|
|
56
59
|
success: true,
|
|
57
|
-
output: `Task created: ${
|
|
58
|
-
data: {
|
|
60
|
+
output: `Task created: ${named} — "${subject}"${owner ? ` [owner: ${owner}]` : ''}`,
|
|
61
|
+
data: {
|
|
62
|
+
id: task.id,
|
|
63
|
+
...(number === undefined ? {} : { number }),
|
|
64
|
+
subject: task.subject,
|
|
65
|
+
status: task.status,
|
|
66
|
+
owner: task.owner,
|
|
67
|
+
},
|
|
59
68
|
}
|
|
60
69
|
},
|
|
61
70
|
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import type { ClaimableTaskStore } from '../../store/task/file.js'
|
|
3
|
+
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
4
|
+
import { asTaskId } from '../../utils/id.js'
|
|
5
|
+
import { defineTool } from '../defineTool.js'
|
|
6
|
+
import { taskNumbers } from './number.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Read one task in full: its description, owner and what it waits on. Only for a list several
|
|
10
|
+
* sessions share, where a teammate reads a task before it takes it.
|
|
11
|
+
*/
|
|
12
|
+
export function buildTaskGetTool(taskStore: ClaimableTaskStore): ToolDefinition {
|
|
13
|
+
return defineTool({
|
|
14
|
+
name: 'task_get',
|
|
15
|
+
description:
|
|
16
|
+
'Read one task in full: subject, description, status, owner, what it blocks and what blocks it. Read a task before you start it. A blocker only stops a task until that blocker is completed.',
|
|
17
|
+
inputSchema: z.object({
|
|
18
|
+
id: z.string().describe('Task ID'),
|
|
19
|
+
}),
|
|
20
|
+
category: 'custom',
|
|
21
|
+
permissions: [],
|
|
22
|
+
readOnly: true,
|
|
23
|
+
destructive: false,
|
|
24
|
+
concurrencySafe: true,
|
|
25
|
+
async execute({ id }) {
|
|
26
|
+
const task = await taskStore.get(asTaskId(id))
|
|
27
|
+
if (!task) return { success: false, output: `Task ${id} not found` }
|
|
28
|
+
const waiting = await taskStore.unresolvedBlockers(task)
|
|
29
|
+
const numbers = await taskNumbers(taskStore)
|
|
30
|
+
const number = numbers.get(task.id)
|
|
31
|
+
const data = {
|
|
32
|
+
id: task.id,
|
|
33
|
+
...(number === undefined ? {} : { number }),
|
|
34
|
+
subject: task.subject,
|
|
35
|
+
description: task.description ?? null,
|
|
36
|
+
status: task.status,
|
|
37
|
+
owner: task.owner ?? null,
|
|
38
|
+
blocks: task.blocks,
|
|
39
|
+
blockedBy: task.blockedBy,
|
|
40
|
+
waitingOn: waiting,
|
|
41
|
+
activeForm: task.activeForm ?? null,
|
|
42
|
+
metadata: task.metadata ?? null,
|
|
43
|
+
}
|
|
44
|
+
const lines = [
|
|
45
|
+
`${number === undefined ? '' : `#${number} `}${task.subject} [${task.status}]${task.owner ? ` owner: ${task.owner}` : ''}`,
|
|
46
|
+
...(task.description ? [task.description] : []),
|
|
47
|
+
...(waiting.length > 0 ? [`Waiting on: ${waiting.join(', ')}`] : []),
|
|
48
|
+
...(task.blocks.length > 0 ? [`Blocks: ${task.blocks.join(', ')}`] : []),
|
|
49
|
+
]
|
|
50
|
+
return { success: true, output: lines.join('\n'), data }
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
}
|
package/src/tools/task/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { isClaimableTaskStore } from '../../store/task/file.js'
|
|
1
2
|
import type { SessionId, TurnId } from '../../types/ids/index.js'
|
|
2
3
|
import type { TaskStore } from '../../types/task/index.js'
|
|
3
4
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
4
5
|
import { buildTaskCreateTool } from './create.js'
|
|
6
|
+
import { buildTaskGetTool } from './get.js'
|
|
5
7
|
import { buildTaskListTool } from './list.js'
|
|
6
8
|
import { buildTaskUpdateTool } from './update.js'
|
|
7
9
|
|
|
@@ -18,17 +20,27 @@ export interface TaskToolScope {
|
|
|
18
20
|
* time it first started. Absent: the time the tools were built.
|
|
19
21
|
*/
|
|
20
22
|
readonly turnStartedAt?: number
|
|
23
|
+
/**
|
|
24
|
+
* The member the tools act for when the list is shared by a team: the name that moving a task to
|
|
25
|
+
* in_progress claims it under. Ignored for a store only this session uses.
|
|
26
|
+
*/
|
|
27
|
+
readonly member?: string
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export function buildTaskTools(taskStore: TaskStore, scope: TaskToolScope): ToolDefinition[] {
|
|
24
31
|
const resolved = { ...scope, turnStartedAt: scope.turnStartedAt ?? Date.now() }
|
|
25
|
-
|
|
32
|
+
const tools = [
|
|
26
33
|
buildTaskCreateTool(taskStore, resolved),
|
|
27
|
-
buildTaskUpdateTool(taskStore),
|
|
34
|
+
buildTaskUpdateTool(taskStore, resolved),
|
|
28
35
|
buildTaskListTool(taskStore, resolved),
|
|
29
36
|
]
|
|
37
|
+
// A list that several sessions share also lets a task be read in full.
|
|
38
|
+
if (isClaimableTaskStore(taskStore)) tools.push(buildTaskGetTool(taskStore))
|
|
39
|
+
return tools
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
export { buildTaskCreateTool } from './create.js'
|
|
43
|
+
export { buildTaskGetTool } from './get.js'
|
|
33
44
|
export { buildTaskUpdateTool } from './update.js'
|
|
34
45
|
export { buildTaskListTool } from './list.js'
|
|
46
|
+
export { plainTaskReceipt } from './number.js'
|
package/src/tools/task/list.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
2
|
import { selectTaskContext } from '../../store/task/context.js'
|
|
3
|
+
import { isClaimableTaskStore } from '../../store/task/file.js'
|
|
3
4
|
import { type TaskStore, isTerminalTaskStatus } from '../../types/task/index.js'
|
|
4
5
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
5
6
|
import { defineTool } from '../defineTool.js'
|
|
6
7
|
import type { TaskToolScope } from './index.js'
|
|
8
|
+
import { taskNumbers } from './number.js'
|
|
7
9
|
import { countTasks, presentTaskListCall, presentTaskListResult } from './present.js'
|
|
8
10
|
|
|
9
11
|
export function buildTaskListTool(
|
|
@@ -26,16 +28,22 @@ export function buildTaskListTool(
|
|
|
26
28
|
const all = await taskStore.list({ sessionId: scope.sessionId })
|
|
27
29
|
// Blockers resolve against every task of the session, shown or not: a
|
|
28
30
|
// blocker closed in an earlier turn is resolved, not unknown.
|
|
31
|
+
// A list several sessions share is shown whole, and a blocker only resolves by completing.
|
|
32
|
+
const shared = isClaimableTaskStore(taskStore)
|
|
29
33
|
const terminalIds = new Set(
|
|
30
|
-
all
|
|
34
|
+
all
|
|
35
|
+
.filter((t) => (shared ? t.status === 'completed' : isTerminalTaskStatus(t.status)))
|
|
36
|
+
.map((t) => t.id),
|
|
31
37
|
)
|
|
32
|
-
const tasks = selectTaskContext(all, scope)
|
|
38
|
+
const tasks = shared ? all : selectTaskContext(all, scope)
|
|
33
39
|
|
|
40
|
+
const numbers = await taskNumbers(taskStore)
|
|
34
41
|
const summary = tasks.map((task) => {
|
|
35
42
|
const unresolvedBlockers = task.blockedBy.filter((bid) => !terminalIds.has(bid))
|
|
36
43
|
|
|
37
44
|
return {
|
|
38
45
|
id: task.id,
|
|
46
|
+
...(numbers.has(task.id) ? { number: numbers.get(task.id) } : {}),
|
|
39
47
|
subject: task.subject,
|
|
40
48
|
status: task.status,
|
|
41
49
|
owner: task.owner ?? null,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isClaimableTaskStore } from '../../store/task/file.js'
|
|
2
|
+
import type { TaskStore } from '../../types/task/index.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The number a task of a shared (team) list is shown under: its place in the list, lowest id first,
|
|
6
|
+
* from 1. A team's screens say `#2`, not a UUID, and this is the same count. A list only one session
|
|
7
|
+
* uses has no numbers; there the id stays the only handle.
|
|
8
|
+
*/
|
|
9
|
+
export async function taskNumbers(store: TaskStore): Promise<ReadonlyMap<string, number>> {
|
|
10
|
+
if (!isClaimableTaskStore(store)) return new Map()
|
|
11
|
+
const tasks = await store.list()
|
|
12
|
+
const ids = tasks.map((task) => String(task.id)).sort(byId)
|
|
13
|
+
return new Map(ids.map((id, index) => [id, index + 1]))
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function byId(a: string, b: string): number {
|
|
17
|
+
const left = Number(a)
|
|
18
|
+
const right = Number(b)
|
|
19
|
+
if (Number.isFinite(left) && Number.isFinite(right) && left !== right) return left - right
|
|
20
|
+
return a < b ? -1 : a > b ? 1 : 0
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The id the model needs, set apart so a screen can leave it out. */
|
|
24
|
+
const ID_TAIL = /^(Task (?:created: )?#\d+) \(id [^)]*\)/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A task tool's receipt as a person reads it: the handle the model needs to call the next tool is
|
|
28
|
+
* dropped where the receipt already names the task by its number.
|
|
29
|
+
*/
|
|
30
|
+
export function plainTaskReceipt(output: string): string {
|
|
31
|
+
return output.replace(ID_TAIL, '$1')
|
|
32
|
+
}
|
|
@@ -27,7 +27,16 @@ function activity(label: string): ToolCallView {
|
|
|
27
27
|
return { kind: 'generic', presentation: 'activity', label }
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/**
|
|
30
|
+
/** The number a team's screens call the task by, when its receipt carries one. */
|
|
31
|
+
function numberOf(result: ToolResult): number | undefined {
|
|
32
|
+
const number = (result.data as { number?: unknown } | undefined)?.number
|
|
33
|
+
return typeof number === 'number' ? number : undefined
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A successful receipt: the call row already said it. A task of a team's list has a number the
|
|
38
|
+
* rest of the screen uses (`task #2`), so there the receipt says which one.
|
|
39
|
+
*/
|
|
31
40
|
const HIDDEN_RESULT: ToolResultView = {
|
|
32
41
|
kind: 'generic',
|
|
33
42
|
label: '',
|
|
@@ -57,7 +66,8 @@ export function presentTaskCreateCall(input: {
|
|
|
57
66
|
|
|
58
67
|
export function presentTaskCreateResult(_input: unknown, result: ToolResult): ToolResultView {
|
|
59
68
|
if (!result.success) return failure(result, 'The task was not added')
|
|
60
|
-
|
|
69
|
+
const number = numberOf(result)
|
|
70
|
+
return number === undefined ? HIDDEN_RESULT : { kind: 'generic', label: `Task #${number} added` }
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
/** The verb for a `task_update` call, from the status it asks for. */
|
|
@@ -104,7 +114,12 @@ export function presentTaskUpdateResult(_input: unknown, result: ToolResult): To
|
|
|
104
114
|
}
|
|
105
115
|
return failure(result, 'The task was not changed')
|
|
106
116
|
}
|
|
107
|
-
|
|
117
|
+
const number = numberOf(result)
|
|
118
|
+
if (number === undefined) return HIDDEN_RESULT
|
|
119
|
+
const status = (result.data as { status?: unknown } | undefined)?.status
|
|
120
|
+
const said =
|
|
121
|
+
status === 'in_progress' ? 'started' : typeof status === 'string' ? status : 'updated'
|
|
122
|
+
return { kind: 'generic', label: `Task #${number} ${said}` }
|
|
108
123
|
}
|
|
109
124
|
|
|
110
125
|
export function presentTaskListCall(): ToolCallView {
|
package/src/tools/task/update.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
+
import { TaskListError, isClaimableTaskStore } from '../../store/task/file.js'
|
|
2
3
|
import type { TaskStore } from '../../types/task/index.js'
|
|
3
4
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
4
5
|
import { asTaskId } from '../../utils/id.js'
|
|
5
6
|
import { defineTool } from '../defineTool.js'
|
|
7
|
+
import type { TaskToolScope } from './index.js'
|
|
8
|
+
import { taskNumbers } from './number.js'
|
|
6
9
|
import { presentTaskUpdateCall, presentTaskUpdateResult } from './present.js'
|
|
7
10
|
|
|
8
|
-
export function buildTaskUpdateTool(
|
|
11
|
+
export function buildTaskUpdateTool(
|
|
12
|
+
taskStore: TaskStore,
|
|
13
|
+
scope?: Pick<TaskToolScope, 'member'>,
|
|
14
|
+
): ToolDefinition {
|
|
9
15
|
return defineTool({
|
|
10
16
|
name: 'task_update',
|
|
11
17
|
description:
|
|
12
|
-
'Update task fields, owner or dependencies. Built-in statuses move forward only; completed/failed are terminal. Create follow-up tasks instead of reopening. Record failures as failed. An unconfirmed status may leave other edits applied. Outcomes are reported, not verified. Use "deleted" to remove a task.',
|
|
18
|
+
'Update task fields, owner or dependencies. Built-in statuses move forward only; completed/failed are terminal. Create follow-up tasks instead of reopening. Record failures as failed. An unconfirmed status may leave other edits applied. Outcomes are reported, not verified. Use "deleted" to remove a task that no longer applies.',
|
|
13
19
|
inputSchema: z.object({
|
|
14
20
|
id: z.string().describe('Task ID (e.g. "task_abc123")'),
|
|
15
21
|
subject: z.string().optional().describe('Updated title'),
|
|
@@ -52,37 +58,104 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
|
|
|
52
58
|
// which tells the model its task disappeared rather than that it
|
|
53
59
|
// named the wrong thing.
|
|
54
60
|
const taskId = asTaskId(id)
|
|
61
|
+
// A team's list numbers its tasks; the screen says `#2`, so the receipt does too and keeps the id beside it.
|
|
62
|
+
const number = (await taskNumbers(taskStore)).get(taskId)
|
|
63
|
+
const named = number === undefined ? `${id}` : `#${number} (id ${id})`
|
|
55
64
|
|
|
56
65
|
if (status === 'deleted') {
|
|
57
66
|
const deleted = await taskStore.delete(taskId)
|
|
58
67
|
return {
|
|
59
68
|
success: deleted,
|
|
60
|
-
output: deleted ? `Task ${
|
|
69
|
+
output: deleted ? `Task ${named} deleted` : `Task ${named} not found`,
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
// Only a list several sessions share can refuse an edge or a claim, and only it is asked to.
|
|
74
|
+
const shared = isClaimableTaskStore(taskStore) ? taskStore : undefined
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
if (addBlocks) {
|
|
78
|
+
for (const blockedId of addBlocks) {
|
|
79
|
+
await taskStore.block(taskId, asTaskId(blockedId))
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (addBlockedBy) {
|
|
83
|
+
for (const blockerId of addBlockedBy) {
|
|
84
|
+
await taskStore.block(asTaskId(blockerId), taskId)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
if (shared && error instanceof TaskListError) {
|
|
89
|
+
return { success: false, output: error.message }
|
|
90
|
+
}
|
|
91
|
+
throw error
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Moving a shared task to in_progress is a claim: it goes to one owner, and a task that is
|
|
95
|
+
// owned, closed or still waiting on a blocker says so instead of being taken.
|
|
96
|
+
let claimed: Awaited<ReturnType<TaskStore['get']>>
|
|
97
|
+
if (shared && status === 'in_progress') {
|
|
98
|
+
const claimant = owner ?? scope?.member
|
|
99
|
+
if (claimant === undefined) {
|
|
100
|
+
return {
|
|
101
|
+
success: false,
|
|
102
|
+
output: `Task ${named} cannot move to in_progress without an owner; pass owner (your member name).`,
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
{
|
|
106
|
+
const result = await shared.claimTask(taskId, claimant)
|
|
107
|
+
if (!result.ok) {
|
|
108
|
+
const reason: Record<typeof result.code, string> = {
|
|
109
|
+
not_found: `Task ${named} not found`,
|
|
110
|
+
already_claimed: `Task ${named} is already claimed by ${result.task?.owner ?? 'another member'}`,
|
|
111
|
+
already_resolved: `Task ${named} is already ${result.task?.status ?? 'closed'}; create a follow-up task instead`,
|
|
112
|
+
blocked: `Task ${named} is blocked by ${result.blockedBy?.join(', ') ?? 'another task'}; finish those first`,
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
success: false,
|
|
116
|
+
output: reason[result.code],
|
|
117
|
+
data: { code: result.code },
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
claimed = result.task
|
|
67
121
|
}
|
|
68
122
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
123
|
+
|
|
124
|
+
// One member does not close another's task.
|
|
125
|
+
if (
|
|
126
|
+
shared &&
|
|
127
|
+
scope?.member !== undefined &&
|
|
128
|
+
(status === 'completed' || status === 'failed')
|
|
129
|
+
) {
|
|
130
|
+
const current = await shared.get(taskId)
|
|
131
|
+
if (current?.owner !== undefined && current.owner !== scope.member) {
|
|
132
|
+
return {
|
|
133
|
+
success: false,
|
|
134
|
+
output: `Task ${named} is owned by ${current.owner}; only its owner closes it.`,
|
|
135
|
+
data: { code: 'already_claimed' },
|
|
136
|
+
}
|
|
72
137
|
}
|
|
73
138
|
}
|
|
74
139
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
140
|
+
let updated: Awaited<ReturnType<TaskStore['update']>>
|
|
141
|
+
try {
|
|
142
|
+
updated = await taskStore.update(taskId, {
|
|
143
|
+
subject,
|
|
144
|
+
description,
|
|
145
|
+
activeForm,
|
|
146
|
+
status: claimed && status === 'in_progress' ? undefined : status,
|
|
147
|
+
owner: claimed ? undefined : owner,
|
|
148
|
+
metadata,
|
|
149
|
+
})
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (shared && error instanceof TaskListError) {
|
|
152
|
+
return { success: false, output: error.message, data: { code: error.code } }
|
|
153
|
+
}
|
|
154
|
+
throw error
|
|
155
|
+
}
|
|
83
156
|
|
|
84
157
|
if (!updated) {
|
|
85
|
-
return { success: false, output: `Task ${
|
|
158
|
+
return { success: false, output: `Task ${named} not found` }
|
|
86
159
|
}
|
|
87
160
|
|
|
88
161
|
// Stores can retain the old status while applying other edits. The
|
|
@@ -92,10 +165,11 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
|
|
|
92
165
|
return {
|
|
93
166
|
success: statusApplied,
|
|
94
167
|
output: statusApplied
|
|
95
|
-
? `Task ${
|
|
96
|
-
: `Task ${
|
|
168
|
+
? `Task ${named} updated — status: ${updated.status}`
|
|
169
|
+
: `Task ${named} requested status "${status}" could not be confirmed; returned status is "${updated.status}". Other requested edits may have applied. Inspect the task and create a new task for follow-up work.`,
|
|
97
170
|
data: {
|
|
98
171
|
id: updated.id,
|
|
172
|
+
...(number === undefined ? {} : { number }),
|
|
99
173
|
subject: updated.subject,
|
|
100
174
|
status: updated.status,
|
|
101
175
|
owner: updated.owner,
|
package/src/types/acp/index.ts
CHANGED
|
@@ -133,6 +133,11 @@ export interface AcpFileChangePreview {
|
|
|
133
133
|
/** What the agent asks the client before running a tool batch. */
|
|
134
134
|
export interface AcpRequestPermissionParams {
|
|
135
135
|
readonly sessionId: string
|
|
136
|
+
/**
|
|
137
|
+
* Present when the ask is a teammate's: its name and team. A client names the member in the
|
|
138
|
+
* question ("<name> wants to run ..."). Absent on the session's own calls and from an older agent.
|
|
139
|
+
*/
|
|
140
|
+
readonly teammate?: { readonly name: string; readonly team: string }
|
|
136
141
|
readonly toolCalls: readonly {
|
|
137
142
|
readonly id: string
|
|
138
143
|
readonly name: string
|
|
@@ -152,7 +157,12 @@ export interface AcpRequestPermissionParams {
|
|
|
152
157
|
* was allowed (it closes, deletes, sends or submits). Absent on other calls
|
|
153
158
|
* and from an older agent.
|
|
154
159
|
*/
|
|
155
|
-
readonly computer?: {
|
|
160
|
+
readonly computer?: {
|
|
161
|
+
readonly app?: string
|
|
162
|
+
readonly consequence?: string
|
|
163
|
+
/** Browsers this call acts in that the engine will put its own question about. */
|
|
164
|
+
readonly browserAsk?: readonly string[]
|
|
165
|
+
}
|
|
156
166
|
}[]
|
|
157
167
|
}
|
|
158
168
|
|
package/src/types/agent/base.ts
CHANGED
|
@@ -401,6 +401,12 @@ export interface AgentInput {
|
|
|
401
401
|
|
|
402
402
|
taskStore?: TaskStore
|
|
403
403
|
|
|
404
|
+
/** The member name the task tools claim under when `taskStore` is a list a team shares. */
|
|
405
|
+
taskMember?: string
|
|
406
|
+
|
|
407
|
+
/** The team a teammate belongs to; with `taskMember` it names the teammate on the task hooks. */
|
|
408
|
+
taskTeam?: string
|
|
409
|
+
|
|
404
410
|
runtimeToolOverrides?: RuntimeToolOverrides
|
|
405
411
|
|
|
406
412
|
runtimeContext?: AgentRuntimeContext
|
|
@@ -35,6 +35,15 @@ export interface TaskHandle {
|
|
|
35
35
|
export type SiblingFailurePolicy = 'continue' | 'cancel-siblings'
|
|
36
36
|
|
|
37
37
|
export interface CreateTaskOptions {
|
|
38
|
+
/**
|
|
39
|
+
* The task list this one child works from, in place of the scheduler's own. A team's members each
|
|
40
|
+
* get the team's shared list this way.
|
|
41
|
+
*/
|
|
42
|
+
readonly taskStore?: import('../task/index.js').TaskStore
|
|
43
|
+
/** The member name this child's task tools claim under when the list is shared by a team. */
|
|
44
|
+
readonly taskMember?: string
|
|
45
|
+
/** The team that member belongs to: with `taskMember` it names the teammate on the task hooks. */
|
|
46
|
+
readonly taskTeam?: string
|
|
38
47
|
/**
|
|
39
48
|
* Continue a child conversation under a NEW task, with this invocation's
|
|
40
49
|
* parent authority, budget and configuration. Local managers accept only
|
|
@@ -301,6 +301,8 @@ export interface UiSnapshot {
|
|
|
301
301
|
readonly region?: boolean
|
|
302
302
|
/** For a region listed in pages: the `offset` that reads the page after this one. */
|
|
303
303
|
readonly next?: number
|
|
304
|
+
/** The text selected in the window, when the host could read it. */
|
|
305
|
+
readonly selectedText?: string
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
/**
|
|
@@ -315,6 +317,11 @@ export interface UiSnapshotOptions {
|
|
|
315
317
|
readonly offset?: number
|
|
316
318
|
/** Only controls whose text contains this (case-insensitive), with the elements above them. */
|
|
317
319
|
readonly query?: string
|
|
320
|
+
/**
|
|
321
|
+
* Only controls of this role (case-insensitive; several may be joined with
|
|
322
|
+
* a comma), with the elements above them. Combines with `query`.
|
|
323
|
+
*/
|
|
324
|
+
readonly role?: string
|
|
318
325
|
}
|
|
319
326
|
|
|
320
327
|
/** Why a ref could not be acted on, as a typed failure. */
|
|
@@ -518,6 +518,16 @@ export interface MCPClientConfig {
|
|
|
518
518
|
* nothing, so a server never returns a task to this client.
|
|
519
519
|
*/
|
|
520
520
|
tasks?: boolean
|
|
521
|
+
/**
|
|
522
|
+
* Take part in the skills extension (2026-07-28). Default `false`.
|
|
523
|
+
*
|
|
524
|
+
* Server-supplied skills are server-supplied instructions, so a host opts
|
|
525
|
+
* in per server. When `true` and the server advertises
|
|
526
|
+
* `io.modelcontextprotocol/skills`, the client declares it on each
|
|
527
|
+
* request and `listSkillPage` and `getSkill` ask the server. `false`
|
|
528
|
+
* declares nothing and sends neither method.
|
|
529
|
+
*/
|
|
530
|
+
skills?: boolean
|
|
521
531
|
/**
|
|
522
532
|
* Answer a server's `elicitation/create` (form mode) by asking the person.
|
|
523
533
|
*
|
|
@@ -28,3 +28,32 @@ export const STRICT_MODE_REFUSAL =
|
|
|
28
28
|
*/
|
|
29
29
|
export const PLAN_MODE_REFUSAL_WITH_PLAN_FILE =
|
|
30
30
|
'Refused: plan mode is read-only. Explore with the reading tools (read, glob, grep, and shell commands that only read; run git on its own, not after cd), write the plan to the plan file, then call exit_plan_mode so the user can approve it. Change nothing else before then.'
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Why a call made from inside another tool (a command a skill holds, run while
|
|
34
|
+
* it loads) may not run under a mode, or `undefined` when the mode has nothing
|
|
35
|
+
* to say about it.
|
|
36
|
+
*
|
|
37
|
+
* The tool that makes the call is read-only (the `skill` tool), so the mode
|
|
38
|
+
* never saw the call and the nested one has to be answered here, the way the
|
|
39
|
+
* mode answers the same call made directly:
|
|
40
|
+
*
|
|
41
|
+
* - `plan` runs only calls that read, whatever a rule or a skill's grant says.
|
|
42
|
+
* - `strict` runs only calls a rule allowed (or that only read). A skill's
|
|
43
|
+
* grant is not a rule, so it never lifts this.
|
|
44
|
+
*
|
|
45
|
+
* Every other mode answers a call that no rule decided by asking a person or a
|
|
46
|
+
* classifier, which a load cannot do; that stays the caller's refusal.
|
|
47
|
+
*/
|
|
48
|
+
export function nestedCallModeRefusal(
|
|
49
|
+
mode: string | undefined,
|
|
50
|
+
call: { readonly readOnly: boolean; readonly allowedByRule: boolean },
|
|
51
|
+
): string | undefined {
|
|
52
|
+
if (mode === 'plan' && !call.readOnly) {
|
|
53
|
+
return 'plan mode only runs commands that read, and this one can change something'
|
|
54
|
+
}
|
|
55
|
+
if (mode === 'strict' && !call.readOnly && !call.allowedByRule) {
|
|
56
|
+
return 'strict mode only runs what a rule allows by name or pattern, and no rule covers this (a skill’s allowed-tools is not a rule)'
|
|
57
|
+
}
|
|
58
|
+
return undefined
|
|
59
|
+
}
|