@namzu/sdk 48.3.1 → 50.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 +542 -0
- package/README.md +137 -125
- package/dist/agents/QueryAgent.d.ts.map +1 -1
- package/dist/agents/QueryAgent.js +1 -0
- package/dist/agents/QueryAgent.js.map +1 -1
- package/dist/agents/examples/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/examples/SupervisorAgent.js +1 -0
- package/dist/agents/examples/SupervisorAgent.js.map +1 -1
- package/dist/agents/runAgent.d.ts +2 -0
- package/dist/agents/runAgent.d.ts.map +1 -1
- package/dist/agents/runAgent.js +1 -0
- package/dist/agents/runAgent.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +16 -1
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/acp/permission.d.ts +8 -2
- package/dist/bridge/acp/permission.d.ts.map +1 -1
- package/dist/bridge/acp/permission.js +1 -0
- package/dist/bridge/acp/permission.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +25 -1
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +205 -21
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/bridge/acp/tasks.d.ts +5 -0
- package/dist/bridge/acp/tasks.d.ts.map +1 -0
- package/dist/bridge/acp/tasks.js +19 -0
- package/dist/bridge/acp/tasks.js.map +1 -0
- package/dist/bridge/acp/update.d.ts.map +1 -1
- package/dist/bridge/acp/update.js +148 -13
- package/dist/bridge/acp/update.js.map +1 -1
- package/dist/config/registry.d.ts +2 -0
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/registry.js +23 -3
- package/dist/config/registry.js.map +1 -1
- package/dist/config/runtime.d.ts +31 -31
- package/dist/connector/mcp/adapter.d.ts.map +1 -1
- package/dist/connector/mcp/adapter.js +11 -4
- package/dist/connector/mcp/adapter.js.map +1 -1
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +6 -3
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/connector/mcp/discovery.d.ts +9 -5
- package/dist/connector/mcp/discovery.d.ts.map +1 -1
- package/dist/connector/mcp/discovery.js +16 -8
- package/dist/connector/mcp/discovery.js.map +1 -1
- package/dist/connector/mcp/mcp-toolset.d.ts +3 -0
- package/dist/connector/mcp/mcp-toolset.d.ts.map +1 -1
- package/dist/connector/mcp/mcp-toolset.js +20 -2
- package/dist/connector/mcp/mcp-toolset.js.map +1 -1
- package/dist/connector/mcp/reconnect.d.ts +2 -0
- package/dist/connector/mcp/reconnect.d.ts.map +1 -1
- package/dist/connector/mcp/reconnect.js +36 -5
- package/dist/connector/mcp/reconnect.js.map +1 -1
- package/dist/constants/acp/index.d.ts +3 -0
- package/dist/constants/acp/index.d.ts.map +1 -1
- package/dist/constants/acp/index.js +3 -0
- package/dist/constants/acp/index.js.map +1 -1
- package/dist/contracts/a2a.d.ts +80 -80
- package/dist/contracts/schemas.d.ts +2 -2
- package/dist/contracts/session/schemas.d.ts +10 -10
- package/dist/manager/agent/lifecycle.d.ts +11 -0
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +178 -3
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/plan/lifecycle.d.ts +7 -8
- package/dist/manager/plan/lifecycle.d.ts.map +1 -1
- package/dist/manager/plan/lifecycle.js +7 -8
- package/dist/manager/plan/lifecycle.js.map +1 -1
- package/dist/manager/resident/consumption.d.ts +8 -8
- package/dist/manager/resident/learning-cycle.d.ts +2 -2
- package/dist/manager/resident/learning-observation.d.ts +12 -12
- package/dist/manager/resident/learning.d.ts +82 -82
- package/dist/manager/resident/outbox.d.ts +8 -8
- package/dist/manager/resident/proposal.d.ts +2 -2
- package/dist/manager/resident/store.d.ts +10 -10
- package/dist/manager/session/attribution.d.ts +1 -0
- package/dist/manager/session/attribution.d.ts.map +1 -1
- package/dist/manager/session/attribution.js +9 -1
- package/dist/manager/session/attribution.js.map +1 -1
- package/dist/manager/session/streamed-message-identity.d.ts +6 -0
- package/dist/manager/session/streamed-message-identity.d.ts.map +1 -0
- package/dist/manager/session/streamed-message-identity.js +14 -0
- package/dist/manager/session/streamed-message-identity.js.map +1 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +4 -3
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/pals/activity/causality.d.ts +23 -0
- package/dist/pals/activity/causality.d.ts.map +1 -0
- package/dist/pals/activity/causality.js +205 -0
- package/dist/pals/activity/causality.js.map +1 -0
- package/dist/pals/activity/projection.d.ts +5 -0
- package/dist/pals/activity/projection.d.ts.map +1 -0
- package/dist/pals/activity/projection.js +79 -0
- package/dist/pals/activity/projection.js.map +1 -0
- package/dist/pals/activity/source.d.ts +16 -0
- package/dist/pals/activity/source.d.ts.map +1 -0
- package/dist/pals/activity/source.js +235 -0
- package/dist/pals/activity/source.js.map +1 -0
- package/dist/pals/activity/subscription-policy.d.ts +38 -0
- package/dist/pals/activity/subscription-policy.d.ts.map +1 -0
- package/dist/pals/activity/subscription-policy.js +183 -0
- package/dist/pals/activity/subscription-policy.js.map +1 -0
- package/dist/pals/activity/subscription-schema.d.ts +353 -0
- package/dist/pals/activity/subscription-schema.d.ts.map +1 -0
- package/dist/pals/activity/subscription-schema.js +24 -0
- package/dist/pals/activity/subscription-schema.js.map +1 -0
- package/dist/pals/activity/subscription-store.d.ts +25 -0
- package/dist/pals/activity/subscription-store.d.ts.map +1 -0
- package/dist/pals/activity/subscription-store.js +152 -0
- package/dist/pals/activity/subscription-store.js.map +1 -0
- package/dist/pals/activity/subscription-types.d.ts +42 -0
- package/dist/pals/activity/subscription-types.d.ts.map +1 -0
- package/dist/pals/activity/subscription-types.js +2 -0
- package/dist/pals/activity/subscription-types.js.map +1 -0
- package/dist/pals/activity/subscriptions.d.ts +32 -0
- package/dist/pals/activity/subscriptions.d.ts.map +1 -0
- package/dist/pals/activity/subscriptions.js +151 -0
- package/dist/pals/activity/subscriptions.js.map +1 -0
- package/dist/pals/activity/types.d.ts +77 -0
- package/dist/pals/activity/types.d.ts.map +1 -0
- package/dist/pals/activity/types.js +2 -0
- package/dist/pals/activity/types.js.map +1 -0
- package/dist/pals/channels/ingress.d.ts +9 -0
- package/dist/pals/channels/ingress.d.ts.map +1 -0
- package/dist/pals/channels/ingress.js +131 -0
- package/dist/pals/channels/ingress.js.map +1 -0
- package/dist/pals/channels/routes.d.ts +20 -0
- package/dist/pals/channels/routes.d.ts.map +1 -0
- package/dist/pals/channels/routes.js +111 -0
- package/dist/pals/channels/routes.js.map +1 -0
- package/dist/pals/channels/routing.d.ts +37 -0
- package/dist/pals/channels/routing.d.ts.map +1 -0
- package/dist/pals/channels/routing.js +150 -0
- package/dist/pals/channels/routing.js.map +1 -0
- package/dist/pals/channels/schema.d.ts +234 -0
- package/dist/pals/channels/schema.d.ts.map +1 -0
- package/dist/pals/channels/schema.js +94 -0
- package/dist/pals/channels/schema.js.map +1 -0
- package/dist/pals/channels/types.d.ts +115 -0
- package/dist/pals/channels/types.d.ts.map +1 -0
- package/dist/pals/channels/types.js +2 -0
- package/dist/pals/channels/types.js.map +1 -0
- package/dist/pals/communication/broker.d.ts +8 -0
- package/dist/pals/communication/broker.d.ts.map +1 -0
- package/dist/pals/communication/broker.js +121 -0
- package/dist/pals/communication/broker.js.map +1 -0
- package/dist/pals/communication/dispatch.d.ts +4 -0
- package/dist/pals/communication/dispatch.d.ts.map +1 -0
- package/dist/pals/communication/dispatch.js +57 -0
- package/dist/pals/communication/dispatch.js.map +1 -0
- package/dist/pals/communication/inbound.d.ts +9 -0
- package/dist/pals/communication/inbound.d.ts.map +1 -0
- package/dist/pals/communication/inbound.js +155 -0
- package/dist/pals/communication/inbound.js.map +1 -0
- package/dist/pals/communication/ingress-dispatch.d.ts +5 -0
- package/dist/pals/communication/ingress-dispatch.d.ts.map +1 -0
- package/dist/pals/communication/ingress-dispatch.js +51 -0
- package/dist/pals/communication/ingress-dispatch.js.map +1 -0
- package/dist/pals/communication/ingress-inbound.d.ts +9 -0
- package/dist/pals/communication/ingress-inbound.d.ts.map +1 -0
- package/dist/pals/communication/ingress-inbound.js +222 -0
- package/dist/pals/communication/ingress-inbound.js.map +1 -0
- package/dist/pals/communication/ingress-schema.d.ts +7829 -0
- package/dist/pals/communication/ingress-schema.d.ts.map +1 -0
- package/dist/pals/communication/ingress-schema.js +479 -0
- package/dist/pals/communication/ingress-schema.js.map +1 -0
- package/dist/pals/communication/ingress-types.d.ts +187 -0
- package/dist/pals/communication/ingress-types.d.ts.map +1 -0
- package/dist/pals/communication/ingress-types.js +73 -0
- package/dist/pals/communication/ingress-types.js.map +1 -0
- package/dist/pals/communication/operator.d.ts +75 -0
- package/dist/pals/communication/operator.d.ts.map +1 -0
- package/dist/pals/communication/operator.js +217 -0
- package/dist/pals/communication/operator.js.map +1 -0
- package/dist/pals/communication/policy.d.ts +41 -0
- package/dist/pals/communication/policy.d.ts.map +1 -0
- package/dist/pals/communication/policy.js +138 -0
- package/dist/pals/communication/policy.js.map +1 -0
- package/dist/pals/communication/schema.d.ts +2000 -0
- package/dist/pals/communication/schema.d.ts.map +1 -0
- package/dist/pals/communication/schema.js +170 -0
- package/dist/pals/communication/schema.js.map +1 -0
- package/dist/pals/communication/store.d.ts +61 -0
- package/dist/pals/communication/store.d.ts.map +1 -0
- package/dist/pals/communication/store.js +450 -0
- package/dist/pals/communication/store.js.map +1 -0
- package/dist/pals/communication/tools.d.ts +23 -0
- package/dist/pals/communication/tools.d.ts.map +1 -0
- package/dist/pals/communication/tools.js +107 -0
- package/dist/pals/communication/tools.js.map +1 -0
- package/dist/pals/communication/types.d.ts +168 -0
- package/dist/pals/communication/types.d.ts.map +1 -0
- package/dist/pals/communication/types.js +24 -0
- package/dist/pals/communication/types.js.map +1 -0
- package/dist/pals/communication/verify.d.ts +22 -0
- package/dist/pals/communication/verify.d.ts.map +1 -0
- package/dist/pals/communication/verify.js +142 -0
- package/dist/pals/communication/verify.js.map +1 -0
- package/dist/pals/lifecycle.d.ts +37 -0
- package/dist/pals/lifecycle.d.ts.map +1 -0
- package/dist/pals/lifecycle.js +22 -0
- package/dist/pals/lifecycle.js.map +1 -0
- package/dist/pals/prompt.d.ts +30 -0
- package/dist/pals/prompt.d.ts.map +1 -0
- package/dist/pals/prompt.js +65 -0
- package/dist/pals/prompt.js.map +1 -0
- package/dist/pals/reference-images.d.ts +44 -0
- package/dist/pals/reference-images.d.ts.map +1 -0
- package/dist/pals/reference-images.js +248 -0
- package/dist/pals/reference-images.js.map +1 -0
- package/dist/pals/runtime.d.ts +46 -0
- package/dist/pals/runtime.d.ts.map +1 -0
- package/dist/pals/runtime.js +624 -0
- package/dist/pals/runtime.js.map +1 -0
- package/dist/pals/store.d.ts +26 -0
- package/dist/pals/store.d.ts.map +1 -0
- package/dist/pals/store.js +334 -0
- package/dist/pals/store.js.map +1 -0
- package/dist/pals/types.d.ts +145 -0
- package/dist/pals/types.d.ts.map +1 -0
- package/dist/pals/types.js +2 -0
- package/dist/pals/types.js.map +1 -0
- package/dist/peers/envelope.js +1 -1
- package/dist/peers/envelope.js.map +1 -1
- package/dist/peers/protocol.d.ts +83 -83
- package/dist/peers/record.d.ts +10 -10
- package/dist/plugin/lifecycle.d.ts +14 -10
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +178 -41
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +7 -2
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/process/kill-tree.d.ts.map +1 -1
- package/dist/process/kill-tree.js +9 -1
- package/dist/process/kill-tree.js.map +1 -1
- package/dist/prompt/resident-learning.js +2 -2
- package/dist/prompt/resident-learning.js.map +1 -1
- package/dist/prompt/resident-step.d.ts +2 -2
- package/dist/prompt/resident-step.js +4 -4
- package/dist/prompt/resident-step.js.map +1 -1
- package/dist/provider/errors.d.ts +19 -0
- package/dist/provider/errors.d.ts.map +1 -1
- package/dist/provider/errors.js +123 -2
- package/dist/provider/errors.js.map +1 -1
- package/dist/public-runtime.d.ts +43 -15
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +37 -9
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +8 -3
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +8 -3
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +27 -7
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/tool/presentation.d.ts +1 -0
- package/dist/registry/tool/presentation.d.ts.map +1 -1
- package/dist/registry/tool/presentation.js +9 -7
- package/dist/registry/tool/presentation.js.map +1 -1
- package/dist/registry/tool/screen.d.ts.map +1 -1
- package/dist/registry/tool/screen.js +33 -2
- package/dist/registry/tool/screen.js.map +1 -1
- package/dist/runtime/harness-session/index.d.ts +5 -0
- package/dist/runtime/harness-session/index.d.ts.map +1 -0
- package/dist/runtime/harness-session/index.js +928 -0
- package/dist/runtime/harness-session/index.js.map +1 -0
- package/dist/runtime/harness-session/journal.d.ts +37 -0
- package/dist/runtime/harness-session/journal.d.ts.map +1 -0
- package/dist/runtime/harness-session/journal.js +177 -0
- package/dist/runtime/harness-session/journal.js.map +1 -0
- package/dist/runtime/harness-session/saved-view.d.ts +8 -0
- package/dist/runtime/harness-session/saved-view.d.ts.map +1 -0
- package/dist/runtime/harness-session/saved-view.js +112 -0
- package/dist/runtime/harness-session/saved-view.js.map +1 -0
- package/dist/runtime/jobs/awaited-jobs.d.ts +2 -1
- package/dist/runtime/jobs/awaited-jobs.d.ts.map +1 -1
- package/dist/runtime/jobs/awaited-jobs.js +2 -1
- package/dist/runtime/jobs/awaited-jobs.js.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +56 -1
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +377 -39
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/abandon-turn.d.ts +12 -1
- package/dist/runtime/query/abandon-turn.d.ts.map +1 -1
- package/dist/runtime/query/abandon-turn.js +3 -1
- package/dist/runtime/query/abandon-turn.js.map +1 -1
- package/dist/runtime/query/checkpoint.d.ts +4 -0
- package/dist/runtime/query/checkpoint.d.ts.map +1 -1
- package/dist/runtime/query/checkpoint.js +10 -0
- package/dist/runtime/query/checkpoint.js.map +1 -1
- package/dist/runtime/query/durable-inbound.d.ts +5 -0
- package/dist/runtime/query/durable-inbound.d.ts.map +1 -0
- package/dist/runtime/query/durable-inbound.js +89 -0
- package/dist/runtime/query/durable-inbound.js.map +1 -0
- package/dist/runtime/query/events.d.ts +4 -0
- package/dist/runtime/query/events.d.ts.map +1 -1
- package/dist/runtime/query/events.js +22 -5
- package/dist/runtime/query/events.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts +5 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +85 -13
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +41 -18
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +227 -114
- 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 +41 -5
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +18 -6
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +176 -75
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.d.ts +9 -5
- package/dist/runtime/query/iteration/outstanding-work.d.ts.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.js +63 -6
- package/dist/runtime/query/iteration/outstanding-work.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +8 -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/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +106 -17
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/step-shaping.d.ts +2 -0
- package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
- package/dist/runtime/query/iteration/step-shaping.js +5 -1
- package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
- package/dist/runtime/query/observation-context.d.ts +2 -2
- package/dist/runtime/query/observation-context.d.ts.map +1 -1
- package/dist/runtime/query/observation-context.js +20 -13
- package/dist/runtime/query/observation-context.js.map +1 -1
- package/dist/runtime/query/prepare-turn.js +2 -2
- package/dist/runtime/query/prepare-turn.js.map +1 -1
- package/dist/runtime/query/prompt-cache.d.ts +1 -0
- package/dist/runtime/query/prompt-cache.d.ts.map +1 -1
- package/dist/runtime/query/prompt-cache.js +2 -0
- package/dist/runtime/query/prompt-cache.js.map +1 -1
- package/dist/runtime/query/prompt.d.ts +2 -0
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +23 -1
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/repeat-call.d.ts +12 -3
- package/dist/runtime/query/repeat-call.d.ts.map +1 -1
- package/dist/runtime/query/repeat-call.js +33 -10
- package/dist/runtime/query/repeat-call.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts +5 -6
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +30 -3
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/resume-session.js +1 -1
- package/dist/runtime/query/resume-session.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +8 -1
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +6 -0
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/saved-presentation.d.ts +13 -0
- package/dist/runtime/query/saved-presentation.d.ts.map +1 -0
- package/dist/runtime/query/saved-presentation.js +63 -0
- package/dist/runtime/query/saved-presentation.js.map +1 -0
- package/dist/runtime/query/steering.d.ts +6 -9
- package/dist/runtime/query/steering.d.ts.map +1 -1
- package/dist/runtime/query/steering.js.map +1 -1
- package/dist/runtime/query/tool-executions.d.ts +7 -3
- package/dist/runtime/query/tool-executions.d.ts.map +1 -1
- package/dist/runtime/query/tool-executions.js +89 -9
- package/dist/runtime/query/tool-executions.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +3 -1
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +3 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/scheduler/completion-inbox.d.ts +25 -1
- package/dist/scheduler/completion-inbox.d.ts.map +1 -1
- package/dist/scheduler/completion-inbox.js +102 -8
- package/dist/scheduler/completion-inbox.js.map +1 -1
- package/dist/scheduler/delegating.d.ts.map +1 -1
- package/dist/scheduler/delegating.js +5 -0
- package/dist/scheduler/delegating.js.map +1 -1
- package/dist/scheduler/local.d.ts.map +1 -1
- package/dist/scheduler/local.js +2 -0
- package/dist/scheduler/local.js.map +1 -1
- package/dist/session/summary/materialize.d.ts +10 -6
- package/dist/session/summary/materialize.d.ts.map +1 -1
- package/dist/session/summary/materialize.js +41 -8
- package/dist/session/summary/materialize.js.map +1 -1
- package/dist/store/budget/ledger.d.ts +9 -0
- package/dist/store/budget/ledger.d.ts.map +1 -1
- package/dist/store/budget/ledger.js +58 -6
- package/dist/store/budget/ledger.js.map +1 -1
- package/dist/store/evidence/index-page.d.ts +12 -12
- package/dist/store/evidence/source-text.d.ts +4 -4
- package/dist/store/index.d.ts +1 -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/memory/disk.d.ts +7 -2
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +58 -5
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/memory/index.d.ts +9 -0
- package/dist/store/memory/index.d.ts.map +1 -1
- package/dist/store/memory/index.js +43 -5
- package/dist/store/memory/index.js.map +1 -1
- package/dist/store/memory/markdown.d.ts +7 -2
- package/dist/store/memory/markdown.d.ts.map +1 -1
- package/dist/store/memory/markdown.js +33 -0
- package/dist/store/memory/markdown.js.map +1 -1
- package/dist/store/memory/memory.d.ts +7 -2
- package/dist/store/memory/memory.d.ts.map +1 -1
- package/dist/store/memory/memory.js +34 -0
- package/dist/store/memory/memory.js.map +1 -1
- package/dist/store/memory/revision.d.ts +16 -0
- package/dist/store/memory/revision.d.ts.map +1 -0
- package/dist/store/memory/revision.js +144 -0
- package/dist/store/memory/revision.js.map +1 -0
- package/dist/store/session/disk.d.ts +9 -4
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +57 -11
- package/dist/store/session/disk.js.map +1 -1
- package/dist/store/session/memory.d.ts +5 -3
- package/dist/store/session/memory.d.ts.map +1 -1
- package/dist/store/session/memory.js +24 -7
- package/dist/store/session/memory.js.map +1 -1
- package/dist/store/session-log/core.d.ts +26 -6
- package/dist/store/session-log/core.d.ts.map +1 -1
- package/dist/store/session-log/core.js +61 -8
- package/dist/store/session-log/core.js.map +1 -1
- package/dist/store/session-log/disk.d.ts +2 -2
- package/dist/store/session-log/disk.d.ts.map +1 -1
- package/dist/store/session-log/disk.js +1 -0
- package/dist/store/session-log/disk.js.map +1 -1
- package/dist/store/session-log/fold.d.ts +7 -0
- package/dist/store/session-log/fold.d.ts.map +1 -1
- package/dist/store/session-log/fold.js +21 -0
- package/dist/store/session-log/fold.js.map +1 -1
- package/dist/store/session-log/index.d.ts +5 -3
- package/dist/store/session-log/index.d.ts.map +1 -1
- package/dist/store/session-log/index.js +3 -1
- package/dist/store/session-log/index.js.map +1 -1
- package/dist/store/session-log/memory.d.ts +1 -1
- package/dist/store/session-log/memory.d.ts.map +1 -1
- package/dist/store/session-log/memory.js +1 -0
- package/dist/store/session-log/memory.js.map +1 -1
- package/dist/store/session-log/spill.d.ts +10 -3
- package/dist/store/session-log/spill.d.ts.map +1 -1
- package/dist/store/session-log/spill.js +70 -5
- package/dist/store/session-log/spill.js.map +1 -1
- package/dist/store/session-log/structured-result.d.ts +21 -0
- package/dist/store/session-log/structured-result.d.ts.map +1 -0
- package/dist/store/session-log/structured-result.js +67 -0
- package/dist/store/session-log/structured-result.js.map +1 -0
- package/dist/store/task/disk.d.ts +11 -0
- package/dist/store/task/disk.d.ts.map +1 -1
- package/dist/store/task/disk.js +41 -2
- package/dist/store/task/disk.js.map +1 -1
- package/dist/store/task/memory.d.ts.map +1 -1
- package/dist/store/task/memory.js +15 -3
- package/dist/store/task/memory.js.map +1 -1
- package/dist/tools/admit-facts.d.ts +13 -0
- package/dist/tools/admit-facts.d.ts.map +1 -0
- package/dist/tools/admit-facts.js +142 -0
- package/dist/tools/admit-facts.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts +4 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +108 -22
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser.d.ts +10 -10
- package/dist/tools/builtins/computer-use.d.ts +90 -90
- package/dist/tools/builtins/edit.d.ts +17 -0
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +34 -0
- 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 +13 -0
- package/dist/tools/builtins/file-write-result.js.map +1 -1
- package/dist/tools/builtins/glob.d.ts.map +1 -1
- package/dist/tools/builtins/glob.js +12 -0
- package/dist/tools/builtins/glob.js.map +1 -1
- package/dist/tools/builtins/grep.d.ts.map +1 -1
- package/dist/tools/builtins/grep.js +14 -0
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +2 -0
- 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/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +4 -1
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/lsp.d.ts +2 -2
- package/dist/tools/builtins/read-file.d.ts.map +1 -1
- package/dist/tools/builtins/read-file.js +49 -0
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/view-image.d.ts +24 -0
- package/dist/tools/builtins/view-image.d.ts.map +1 -0
- package/dist/tools/builtins/view-image.js +385 -0
- package/dist/tools/builtins/view-image.js.map +1 -0
- package/dist/tools/builtins/wait-for-job-bounds.d.ts +8 -4
- package/dist/tools/builtins/wait-for-job-bounds.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job-bounds.js +43 -8
- package/dist/tools/builtins/wait-for-job-bounds.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts +3 -0
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +127 -15
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +1 -0
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +37 -2
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +100 -3
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/coordinator/agent.d.ts +9 -19
- package/dist/tools/coordinator/agent.d.ts.map +1 -1
- package/dist/tools/coordinator/agent.js.map +1 -1
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +127 -67
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/tools/coordinator/wait-with-idle-bound.d.ts +2 -0
- package/dist/tools/coordinator/wait-with-idle-bound.d.ts.map +1 -1
- package/dist/tools/coordinator/wait-with-idle-bound.js +1 -1
- package/dist/tools/coordinator/wait-with-idle-bound.js.map +1 -1
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +4 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/failure-facts.d.ts +8 -0
- package/dist/tools/failure-facts.d.ts.map +1 -0
- package/dist/tools/failure-facts.js +24 -0
- package/dist/tools/failure-facts.js.map +1 -0
- package/dist/tools/host-output.d.ts +24 -0
- package/dist/tools/host-output.d.ts.map +1 -0
- package/dist/tools/host-output.js +117 -0
- package/dist/tools/host-output.js.map +1 -0
- package/dist/tools/memory/delete.d.ts.map +1 -1
- package/dist/tools/memory/delete.js +38 -3
- package/dist/tools/memory/delete.js.map +1 -1
- package/dist/tools/memory/read.d.ts.map +1 -1
- package/dist/tools/memory/read.js +38 -2
- package/dist/tools/memory/read.js.map +1 -1
- package/dist/tools/memory/search.d.ts.map +1 -1
- package/dist/tools/memory/search.js +38 -7
- package/dist/tools/memory/search.js.map +1 -1
- package/dist/tools/memory/update.d.ts.map +1 -1
- package/dist/tools/memory/update.js +30 -3
- package/dist/tools/memory/update.js.map +1 -1
- package/dist/tools/oem-code-pages.d.ts +8 -0
- package/dist/tools/oem-code-pages.d.ts.map +1 -0
- package/dist/tools/oem-code-pages.js +23 -0
- package/dist/tools/oem-code-pages.js.map +1 -0
- package/dist/tools/schedules/schedule-tool.d.ts.map +1 -1
- package/dist/tools/schedules/schedule-tool.js +35 -6
- package/dist/tools/schedules/schedule-tool.js.map +1 -1
- package/dist/tools/schedules/types.d.ts +23 -3
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/task/list.d.ts.map +1 -1
- package/dist/tools/task/list.js +14 -6
- package/dist/tools/task/list.js.map +1 -1
- package/dist/tools/task/present.d.ts.map +1 -1
- package/dist/tools/task/present.js +26 -6
- package/dist/tools/task/present.js.map +1 -1
- package/dist/tools/task/update.d.ts.map +1 -1
- package/dist/tools/task/update.js +12 -5
- package/dist/tools/task/update.js.map +1 -1
- package/dist/tools/text-window.d.ts +19 -0
- package/dist/tools/text-window.d.ts.map +1 -0
- package/dist/tools/text-window.js +83 -0
- package/dist/tools/text-window.js.map +1 -0
- package/dist/toolsets/manager.d.ts +24 -0
- package/dist/toolsets/manager.d.ts.map +1 -1
- package/dist/toolsets/manager.js +105 -2
- package/dist/toolsets/manager.js.map +1 -1
- package/dist/turn/memory-recall.d.ts +2 -0
- package/dist/turn/memory-recall.d.ts.map +1 -1
- package/dist/turn/memory-recall.js +3 -1
- package/dist/turn/memory-recall.js.map +1 -1
- package/dist/types/acp/index.d.ts +137 -1
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/agent/base.d.ts +3 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/manager.d.ts +8 -23
- package/dist/types/agent/manager.d.ts.map +1 -1
- package/dist/types/agent/scheduler.d.ts +10 -1
- package/dist/types/agent/scheduler.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +4 -0
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +30 -30
- package/dist/types/connector/mcp.d.ts +7 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/errors/catalog.d.ts.map +1 -1
- package/dist/types/errors/catalog.js +4 -2
- package/dist/types/errors/catalog.js.map +1 -1
- package/dist/types/harness/schema.d.ts +354 -0
- package/dist/types/harness/schema.d.ts.map +1 -0
- package/dist/types/harness/schema.js +203 -0
- package/dist/types/harness/schema.js.map +1 -0
- package/dist/types/harness/session.d.ts +278 -0
- package/dist/types/harness/session.d.ts.map +1 -0
- package/dist/types/harness/session.js +2 -0
- package/dist/types/harness/session.js.map +1 -0
- package/dist/types/hitl/index.d.ts +12 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/job/index.d.ts +47 -0
- package/dist/types/job/index.d.ts.map +1 -0
- package/dist/types/job/index.js +2 -0
- package/dist/types/job/index.js.map +1 -0
- package/dist/types/memory/index.d.ts +29 -0
- package/dist/types/memory/index.d.ts.map +1 -1
- package/dist/types/memory/index.js +6 -0
- package/dist/types/memory/index.js.map +1 -1
- package/dist/types/message/inbound-delivery.d.ts +44 -0
- package/dist/types/message/inbound-delivery.d.ts.map +1 -0
- package/dist/types/message/inbound-delivery.js +14 -0
- package/dist/types/message/inbound-delivery.js.map +1 -0
- package/dist/types/message/index.d.ts +4 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +5 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +18 -8
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +5 -2
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/sandbox/index.d.ts +39 -2
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/session/checkpoint.d.ts +24 -17
- package/dist/types/session/checkpoint.d.ts.map +1 -1
- package/dist/types/session/checkpoint.js +1 -0
- package/dist/types/session/checkpoint.js.map +1 -1
- package/dist/types/session/events.d.ts +23 -1
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/session/records.d.ts +1514 -565
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +89 -1
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/session/step.d.ts +2 -0
- package/dist/types/session/step.d.ts.map +1 -1
- package/dist/types/session/step.js.map +1 -1
- package/dist/types/session/store.d.ts +19 -10
- package/dist/types/session/store.d.ts.map +1 -1
- package/dist/types/session/tool-execution.d.ts +6 -0
- package/dist/types/session/tool-execution.d.ts.map +1 -1
- package/dist/types/structured-output/index.d.ts +12 -2
- package/dist/types/structured-output/index.d.ts.map +1 -1
- package/dist/types/summary/ref.d.ts +3 -1
- package/dist/types/summary/ref.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +32 -4
- 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 +106 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/json-snapshot.d.ts +6 -2
- package/dist/utils/json-snapshot.d.ts.map +1 -1
- package/dist/utils/json-snapshot.js +19 -9
- package/dist/utils/json-snapshot.js.map +1 -1
- package/dist/utils/structured-result-json.d.ts +5 -0
- package/dist/utils/structured-result-json.d.ts.map +1 -0
- package/dist/utils/structured-result-json.js +10 -0
- package/dist/utils/structured-result-json.js.map +1 -0
- package/package.json +1 -1
- package/src/agents/QueryAgent.ts +1 -0
- package/src/agents/examples/SupervisorAgent.ts +1 -0
- package/src/agents/runAgent.ts +3 -0
- package/src/authorization/shell-lexer.ts +16 -1
- package/src/bridge/acp/permission.ts +17 -3
- package/src/bridge/acp/server.ts +271 -25
- package/src/bridge/acp/tasks.ts +23 -0
- package/src/bridge/acp/update.ts +167 -13
- package/src/config/registry.ts +24 -3
- package/src/connector/mcp/adapter.ts +16 -4
- package/src/connector/mcp/client.ts +6 -2
- package/src/connector/mcp/discovery.ts +29 -8
- package/src/connector/mcp/mcp-toolset.ts +25 -4
- package/src/connector/mcp/reconnect.ts +34 -4
- package/src/constants/acp/index.ts +4 -0
- package/src/manager/agent/lifecycle.ts +230 -3
- package/src/manager/plan/lifecycle.ts +11 -9
- package/src/manager/session/attribution.ts +12 -2
- package/src/manager/session/streamed-message-identity.ts +21 -0
- package/src/manager/session/turn-recorder.ts +4 -3
- package/src/pals/activity/causality.ts +261 -0
- package/src/pals/activity/projection.ts +89 -0
- package/src/pals/activity/source.ts +240 -0
- package/src/pals/activity/subscription-policy.ts +230 -0
- package/src/pals/activity/subscription-schema.ts +27 -0
- package/src/pals/activity/subscription-store.ts +172 -0
- package/src/pals/activity/subscription-types.ts +48 -0
- package/src/pals/activity/subscriptions.ts +209 -0
- package/src/pals/activity/types.ts +108 -0
- package/src/pals/channels/ingress.ts +153 -0
- package/src/pals/channels/routes.ts +118 -0
- package/src/pals/channels/routing.ts +197 -0
- package/src/pals/channels/schema.ts +108 -0
- package/src/pals/channels/types.ts +156 -0
- package/src/pals/communication/broker.ts +131 -0
- package/src/pals/communication/dispatch.ts +66 -0
- package/src/pals/communication/inbound.ts +193 -0
- package/src/pals/communication/ingress-dispatch.ts +63 -0
- package/src/pals/communication/ingress-inbound.ts +269 -0
- package/src/pals/communication/ingress-schema.ts +526 -0
- package/src/pals/communication/ingress-types.ts +336 -0
- package/src/pals/communication/operator.ts +315 -0
- package/src/pals/communication/policy.ts +174 -0
- package/src/pals/communication/schema.ts +173 -0
- package/src/pals/communication/store.ts +577 -0
- package/src/pals/communication/tools.ts +139 -0
- package/src/pals/communication/types.ts +227 -0
- package/src/pals/communication/verify.ts +220 -0
- package/src/pals/lifecycle.ts +54 -0
- package/src/pals/prompt.ts +101 -0
- package/src/pals/reference-images.ts +322 -0
- package/src/pals/runtime.ts +670 -0
- package/src/pals/store.ts +369 -0
- package/src/pals/types.ts +157 -0
- package/src/peers/envelope.ts +1 -1
- package/src/plugin/lifecycle.ts +217 -46
- package/src/plugin/shell-hook.ts +8 -2
- package/src/process/kill-tree.ts +10 -1
- package/src/prompt/resident-learning.ts +2 -2
- package/src/prompt/resident-step.ts +4 -4
- package/src/provider/errors.ts +135 -2
- package/src/public-runtime.ts +119 -12
- package/src/public-tools.ts +13 -1
- package/src/public-types.ts +69 -7
- package/src/registry/tool/presentation.ts +9 -4
- package/src/registry/tool/screen.ts +34 -2
- package/src/runtime/harness-session/index.ts +1125 -0
- package/src/runtime/harness-session/journal.ts +209 -0
- package/src/runtime/harness-session/saved-view.ts +122 -0
- package/src/runtime/jobs/awaited-jobs.ts +2 -1
- package/src/runtime/jobs/registry.ts +423 -50
- package/src/runtime/query/abandon-turn.ts +18 -2
- package/src/runtime/query/checkpoint.ts +11 -0
- package/src/runtime/query/durable-inbound.ts +101 -0
- package/src/runtime/query/events.ts +22 -5
- package/src/runtime/query/executor/tool-call-admission.ts +125 -32
- package/src/runtime/query/executor.ts +316 -130
- package/src/runtime/query/index.ts +48 -5
- package/src/runtime/query/iteration/index.ts +253 -114
- package/src/runtime/query/iteration/outstanding-work.ts +57 -7
- package/src/runtime/query/iteration/phases/context.ts +8 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +124 -22
- package/src/runtime/query/iteration/step-shaping.ts +9 -1
- package/src/runtime/query/observation-context.ts +22 -16
- package/src/runtime/query/prepare-turn.ts +2 -2
- package/src/runtime/query/prompt-cache.ts +3 -0
- package/src/runtime/query/prompt.ts +32 -1
- package/src/runtime/query/repeat-call.ts +40 -10
- package/src/runtime/query/resume-pending.ts +60 -7
- package/src/runtime/query/resume-session.ts +1 -1
- package/src/runtime/query/review-policy.ts +23 -2
- package/src/runtime/query/saved-presentation.ts +70 -0
- package/src/runtime/query/steering.ts +6 -9
- package/src/runtime/query/tool-executions.ts +108 -9
- package/src/runtime/query/tooling.ts +6 -1
- package/src/scheduler/completion-inbox.ts +108 -7
- package/src/scheduler/delegating.ts +5 -0
- package/src/scheduler/local.ts +2 -0
- package/src/session/summary/materialize.ts +51 -9
- package/src/store/budget/ledger.ts +60 -5
- package/src/store/index.ts +1 -0
- package/src/store/memory/disk.ts +82 -7
- package/src/store/memory/index.ts +66 -7
- package/src/store/memory/markdown.ts +54 -2
- package/src/store/memory/memory.ts +52 -2
- package/src/store/memory/revision.ts +158 -0
- package/src/store/session/disk.ts +77 -10
- package/src/store/session/memory.ts +32 -7
- package/src/store/session-log/core.ts +118 -11
- package/src/store/session-log/disk.ts +9 -2
- package/src/store/session-log/fold.ts +22 -0
- package/src/store/session-log/index.ts +5 -0
- package/src/store/session-log/memory.ts +2 -1
- package/src/store/session-log/spill.ts +89 -6
- package/src/store/session-log/structured-result.ts +96 -0
- package/src/store/task/disk.ts +46 -2
- package/src/store/task/memory.ts +13 -3
- package/src/tools/admit-facts.ts +145 -0
- package/src/tools/builtins/bash.ts +132 -24
- package/src/tools/builtins/edit.ts +42 -0
- package/src/tools/builtins/file-write-result.ts +14 -0
- package/src/tools/builtins/glob.ts +12 -0
- package/src/tools/builtins/grep.ts +14 -0
- package/src/tools/builtins/index.ts +2 -0
- package/src/tools/builtins/job.ts +4 -1
- package/src/tools/builtins/read-file.ts +57 -0
- package/src/tools/builtins/view-image.ts +409 -0
- package/src/tools/builtins/wait-for-job-bounds.ts +45 -7
- package/src/tools/builtins/wait-for-job.ts +159 -36
- package/src/tools/builtins/write-file.ts +4 -2
- package/src/tools/command-shell.ts +132 -5
- package/src/tools/coordinator/agent.ts +9 -19
- package/src/tools/coordinator/index.ts +150 -75
- package/src/tools/coordinator/wait-with-idle-bound.ts +3 -1
- package/src/tools/defineTool.ts +4 -0
- package/src/tools/failure-facts.ts +24 -0
- package/src/tools/host-output.ts +136 -0
- package/src/tools/memory/delete.ts +33 -3
- package/src/tools/memory/read.ts +35 -2
- package/src/tools/memory/search.ts +38 -7
- package/src/tools/memory/update.ts +28 -3
- package/src/tools/oem-code-pages.ts +22 -0
- package/src/tools/schedules/schedule-tool.ts +38 -5
- package/src/tools/schedules/types.ts +23 -3
- package/src/tools/task/list.ts +15 -7
- package/src/tools/task/present.ts +37 -7
- package/src/tools/task/update.ts +12 -5
- package/src/tools/text-window.ts +87 -0
- package/src/toolsets/manager.ts +132 -2
- package/src/turn/memory-recall.ts +5 -1
- package/src/types/acp/index.ts +150 -4
- package/src/types/agent/base.ts +3 -0
- package/src/types/agent/manager.ts +8 -23
- package/src/types/agent/scheduler.ts +10 -1
- package/src/types/agent/task.ts +4 -0
- package/src/types/connector/mcp.ts +7 -0
- package/src/types/errors/catalog.ts +4 -2
- package/src/types/harness/schema.ts +203 -0
- package/src/types/harness/session.ts +306 -0
- package/src/types/hitl/index.ts +17 -1
- package/src/types/job/index.ts +42 -0
- package/src/types/memory/index.ts +43 -0
- package/src/types/message/inbound-delivery.ts +63 -0
- package/src/types/message/index.ts +8 -1
- package/src/types/plugin/index.ts +11 -6
- package/src/types/sandbox/index.ts +46 -0
- package/src/types/session/checkpoint.ts +4 -1
- package/src/types/session/events.ts +23 -1
- package/src/types/session/records.ts +114 -2
- package/src/types/session/step.ts +2 -0
- package/src/types/session/store.ts +23 -9
- package/src/types/session/tool-execution.ts +6 -0
- package/src/types/structured-output/index.ts +13 -2
- package/src/types/summary/ref.ts +3 -1
- package/src/types/tool/index.ts +39 -5
- package/src/types/tool/presentation.ts +121 -0
- package/src/utils/json-snapshot.ts +26 -9
- package/src/utils/structured-result-json.ts +10 -0
|
@@ -10,12 +10,13 @@ import type { ToolDefinition } from '../../types/tool/index.js'
|
|
|
10
10
|
import { defineTool } from '../defineTool.js'
|
|
11
11
|
|
|
12
12
|
type SearchMemory = (params: MemorySearchParams) => MemorySearchResult | Promise<MemorySearchResult>
|
|
13
|
+
const MAX_MEMORY_SCAN = 256
|
|
13
14
|
|
|
14
15
|
function defineSearchMemoryTool(search: SearchMemory): ToolDefinition {
|
|
15
16
|
return defineTool({
|
|
16
17
|
name: 'search_memory',
|
|
17
18
|
description:
|
|
18
|
-
'Search active stored memories by relevant words or tags. The built-in
|
|
19
|
+
'Search active stored memories by relevant words or tags. The built-in stores rank matches in names, titles, descriptions, summaries and full content. Built-in search examines at most 256 recent candidates per call; if incomplete, continue with the returned scan_offset. Use read_memory for evidence. Set status to archived to inspect obsolete records.',
|
|
19
20
|
inputSchema: z.object({
|
|
20
21
|
query: z.string().optional().describe('Relevant words or identifiers to search'),
|
|
21
22
|
tags: z.array(z.string()).optional().describe('Filter by tags (all must match)'),
|
|
@@ -30,20 +31,47 @@ function defineSearchMemoryTool(search: SearchMemory): ToolDefinition {
|
|
|
30
31
|
.max(50)
|
|
31
32
|
.default(10)
|
|
32
33
|
.describe('Maximum results to return (1–50)'),
|
|
34
|
+
scan_offset: z
|
|
35
|
+
.number()
|
|
36
|
+
.int()
|
|
37
|
+
.min(0)
|
|
38
|
+
.default(0)
|
|
39
|
+
.describe('Candidate offset from an earlier incomplete search; starts at 0'),
|
|
33
40
|
}),
|
|
34
41
|
category: 'analysis',
|
|
35
42
|
permissions: [],
|
|
36
43
|
readOnly: true,
|
|
37
44
|
destructive: false,
|
|
38
45
|
concurrencySafe: true,
|
|
39
|
-
async execute({ query, tags, status, limit }) {
|
|
40
|
-
const result = await search({
|
|
46
|
+
async execute({ query, tags, status, limit, scan_offset }) {
|
|
47
|
+
const result = await search({
|
|
48
|
+
query,
|
|
49
|
+
tags,
|
|
50
|
+
status,
|
|
51
|
+
limit,
|
|
52
|
+
maxScanned: MAX_MEMORY_SCAN,
|
|
53
|
+
scanOffset: scan_offset,
|
|
54
|
+
})
|
|
55
|
+
const continuation = result.truncated
|
|
56
|
+
? result.nextScanOffset === undefined
|
|
57
|
+
? ' Search incomplete; narrow the query or read a known ID.'
|
|
58
|
+
: ` Search incomplete; continue with scan_offset ${result.nextScanOffset}.`
|
|
59
|
+
: ''
|
|
60
|
+
const page = scan_offset > 0 || result.truncated ? ' in this scan page' : ''
|
|
41
61
|
|
|
42
62
|
if (result.entries.length === 0) {
|
|
43
63
|
return {
|
|
44
64
|
success: true,
|
|
45
|
-
output:
|
|
46
|
-
data: {
|
|
65
|
+
output: `No memories found${page}.${continuation}`,
|
|
66
|
+
data: {
|
|
67
|
+
entries: [],
|
|
68
|
+
totalCount: result.totalCount,
|
|
69
|
+
truncated: result.truncated === true,
|
|
70
|
+
...(result.scannedCount !== undefined ? { scannedCount: result.scannedCount } : {}),
|
|
71
|
+
...(result.nextScanOffset !== undefined
|
|
72
|
+
? { nextScanOffset: result.nextScanOffset }
|
|
73
|
+
: {}),
|
|
74
|
+
},
|
|
47
75
|
}
|
|
48
76
|
}
|
|
49
77
|
|
|
@@ -57,8 +85,8 @@ function defineSearchMemoryTool(search: SearchMemory): ToolDefinition {
|
|
|
57
85
|
|
|
58
86
|
const output =
|
|
59
87
|
result.totalCount > result.entries.length
|
|
60
|
-
? `Found ${result.totalCount} memories (showing ${result.entries.length}):\n${lines.join('\n')}`
|
|
61
|
-
: `Found ${result.totalCount} memories:\n${lines.join('\n')}`
|
|
88
|
+
? `Found ${result.totalCount} memories${page} (showing ${result.entries.length}):\n${lines.join('\n')}${continuation}`
|
|
89
|
+
: `Found ${result.totalCount} memories${page}:\n${lines.join('\n')}${continuation}`
|
|
62
90
|
|
|
63
91
|
return {
|
|
64
92
|
success: true,
|
|
@@ -66,6 +94,9 @@ function defineSearchMemoryTool(search: SearchMemory): ToolDefinition {
|
|
|
66
94
|
data: {
|
|
67
95
|
entries: result.entries,
|
|
68
96
|
totalCount: result.totalCount,
|
|
97
|
+
truncated: result.truncated === true,
|
|
98
|
+
...(result.scannedCount !== undefined ? { scannedCount: result.scannedCount } : {}),
|
|
99
|
+
...(result.nextScanOffset !== undefined ? { nextScanOffset: result.nextScanOffset } : {}),
|
|
69
100
|
},
|
|
70
101
|
}
|
|
71
102
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
2
|
import { MemoryContentRejectedError, MemoryNameConflictError } from '../../store/memory/naming.js'
|
|
3
|
+
import { MemoryRevisionConflictError } from '../../store/memory/revision.js'
|
|
3
4
|
import type { MemoryStore } from '../../types/memory/index.js'
|
|
5
|
+
import { hasConditionalMemoryWrites } from '../../types/memory/index.js'
|
|
4
6
|
import type { ToolDefinition } from '../../types/tool/index.js'
|
|
5
7
|
import { defineTool } from '../defineTool.js'
|
|
6
8
|
import { memoryFieldsSchema } from './fields.js'
|
|
@@ -10,11 +12,16 @@ export function buildUpdateMemoryTool(store: MemoryStore): ToolDefinition {
|
|
|
10
12
|
return defineTool({
|
|
11
13
|
name: 'update_memory',
|
|
12
14
|
description:
|
|
13
|
-
'Correct an existing memory in place, or archive an obsolete claim so it is no longer recalled. Prefer this to saving a second memory about the same thing. Identify it by the ID from search_memory or by its name from the memory index; current evidence should determine corrections.',
|
|
15
|
+
'Correct an existing memory in place, or archive an obsolete claim so it is no longer recalled. Prefer this to saving a second memory about the same thing. Identify it by the ID from search_memory or by its name from the memory index; current evidence should determine corrections. Pass the revision from read_memory when available to refuse a stale correction.',
|
|
14
16
|
inputSchema: z.object({
|
|
15
17
|
id: z
|
|
16
18
|
.string()
|
|
17
19
|
.describe('Memory ID, or the memory name from the index, to correct or archive'),
|
|
20
|
+
revision: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Opaque revision from read_memory; refuse the update if the record changed'),
|
|
18
25
|
title: z.string().min(1).optional().describe('Corrected short descriptive title'),
|
|
19
26
|
summary: z.string().min(1).optional().describe('Corrected brief summary (1-2 sentences)'),
|
|
20
27
|
content: z.string().min(1).optional().describe('Corrected full content'),
|
|
@@ -30,7 +37,7 @@ export function buildUpdateMemoryTool(store: MemoryStore): ToolDefinition {
|
|
|
30
37
|
readOnly: false,
|
|
31
38
|
destructive: false,
|
|
32
39
|
concurrencySafe: true,
|
|
33
|
-
async execute({ id, ...updates }) {
|
|
40
|
+
async execute({ id, revision, ...updates }) {
|
|
34
41
|
if (Object.values(updates).every((value) => value === undefined)) {
|
|
35
42
|
return {
|
|
36
43
|
success: false,
|
|
@@ -38,6 +45,13 @@ export function buildUpdateMemoryTool(store: MemoryStore): ToolDefinition {
|
|
|
38
45
|
error: 'No memory update supplied',
|
|
39
46
|
}
|
|
40
47
|
}
|
|
48
|
+
if (revision !== undefined && !hasConditionalMemoryWrites(store)) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
output: 'This memory store does not support revision-checked updates.',
|
|
52
|
+
error: 'Conditional memory update unavailable',
|
|
53
|
+
}
|
|
54
|
+
}
|
|
41
55
|
const reference = await resolveMemoryReference(store, id)
|
|
42
56
|
if (!reference.found) {
|
|
43
57
|
return {
|
|
@@ -51,8 +65,19 @@ export function buildUpdateMemoryTool(store: MemoryStore): ToolDefinition {
|
|
|
51
65
|
// provenance here would overwrite metadata from a concurrent writer.
|
|
52
66
|
let entry: Awaited<ReturnType<MemoryStore['update']>>
|
|
53
67
|
try {
|
|
54
|
-
entry = await store.update(memoryId, updates)
|
|
68
|
+
if (revision === undefined) entry = await store.update(memoryId, updates)
|
|
69
|
+
else if (hasConditionalMemoryWrites(store))
|
|
70
|
+
entry = await store.updateIfRevision(memoryId, updates, revision)
|
|
71
|
+
else throw new Error('Conditional memory support changed during the update.')
|
|
55
72
|
} catch (error) {
|
|
73
|
+
if (error instanceof MemoryRevisionConflictError) {
|
|
74
|
+
return {
|
|
75
|
+
success: false,
|
|
76
|
+
output: error.message,
|
|
77
|
+
error: 'Memory changed since read',
|
|
78
|
+
data: { reason: 'revision_conflict' },
|
|
79
|
+
}
|
|
80
|
+
}
|
|
56
81
|
if (error instanceof MemoryContentRejectedError) {
|
|
57
82
|
return {
|
|
58
83
|
success: false,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The upper half (bytes 0x80-0xFF) of the DOS/OEM single-byte code pages a
|
|
3
|
+
* Windows console reports. WHATWG `TextDecoder` has no IBM437/850/852/857
|
|
4
|
+
* labels, and cmd.exe writes these, so they are tabulated here. Generated
|
|
5
|
+
* from Python's `codecs` tables; each string is exactly 128 characters.
|
|
6
|
+
*/
|
|
7
|
+
export const OEM_UPPER_HALF: Readonly<Record<number, string>> = {
|
|
8
|
+
437: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
9
|
+
737: '\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c2\u03c4\u03c5\u03c6\u03c7\u03c8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03c9\u03ac\u03ad\u03ae\u03ca\u03af\u03cc\u03cd\u03cb\u03ce\u0386\u0388\u0389\u038a\u038c\u038e\u038f\xb1\u2265\u2264\u03aa\u03ab\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
10
|
+
775: '\u0106\xfc\xe9\u0101\xe4\u0123\xe5\u0107\u0142\u0113\u0156\u0157\u012b\u0179\xc4\xc5\xc9\xe6\xc6\u014d\xf6\u0122\xa2\u015a\u015b\xd6\xdc\xf8\xa3\xd8\xd7\xa4\u0100\u012a\xf3\u017b\u017c\u017a\u201d\xa6\xa9\xae\xac\xbd\xbc\u0141\xab\xbb\u2591\u2592\u2593\u2502\u2524\u0104\u010c\u0118\u0116\u2563\u2551\u2557\u255d\u012e\u0160\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0172\u016a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u017d\u0105\u010d\u0119\u0117\u012f\u0161\u0173\u016b\u017e\u2518\u250c\u2588\u2584\u258c\u2590\u2580\xd3\xdf\u014c\u0143\xf5\xd5\xb5\u0144\u0136\u0137\u013b\u013c\u0146\u0112\u0145\u2019\xad\xb1\u201c\xbe\xb6\xa7\xf7\u201e\xb0\u2219\xb7\xb9\xb3\xb2\u25a0\xa0',
|
|
11
|
+
850: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xf8\xa3\xd8\xd7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\xae\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\xc1\xc2\xc0\xa9\u2563\u2551\u2557\u255d\xa2\xa5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\xe3\xc3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\xf0\xd0\xca\xcb\xc8\u0131\xcd\xce\xcf\u2518\u250c\u2588\u2584\xa6\xcc\u2580\xd3\xdf\xd4\xd2\xf5\xd5\xb5\xfe\xde\xda\xdb\xd9\xfd\xdd\xaf\xb4\xad\xb1\u2017\xbe\xb6\xa7\xf7\xb8\xb0\xa8\xb7\xb9\xb3\xb2\u25a0\xa0',
|
|
12
|
+
852: '\xc7\xfc\xe9\xe2\xe4\u016f\u0107\xe7\u0142\xeb\u0150\u0151\xee\u0179\xc4\u0106\xc9\u0139\u013a\xf4\xf6\u013d\u013e\u015a\u015b\xd6\xdc\u0164\u0165\u0141\xd7\u010d\xe1\xed\xf3\xfa\u0104\u0105\u017d\u017e\u0118\u0119\xac\u017a\u010c\u015f\xab\xbb\u2591\u2592\u2593\u2502\u2524\xc1\xc2\u011a\u015e\u2563\u2551\u2557\u255d\u017b\u017c\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0102\u0103\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\u0111\u0110\u010e\xcb\u010f\u0147\xcd\xce\u011b\u2518\u250c\u2588\u2584\u0162\u016e\u2580\xd3\xdf\xd4\u0143\u0144\u0148\u0160\u0161\u0154\xda\u0155\u0170\xfd\xdd\u0163\xb4\xad\u02dd\u02db\u02c7\u02d8\xa7\xf7\xb8\xb0\xa8\u02d9\u0171\u0158\u0159\u25a0\xa0',
|
|
13
|
+
855: '\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xab\xbb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\xad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\xa7\u25a0\xa0',
|
|
14
|
+
857: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\u0131\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\u0130\xd6\xdc\xf8\xa3\xd8\u015e\u015f\xe1\xed\xf3\xfa\xf1\xd1\u011e\u011f\xbf\xae\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\xc1\xc2\xc0\xa9\u2563\u2551\u2557\u255d\xa2\xa5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\xe3\xc3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\xba\xaa\xca\xcb\xc8\ufffd\xcd\xce\xcf\u2518\u250c\u2588\u2584\xa6\xcc\u2580\xd3\xdf\xd4\xd2\xf5\xd5\xb5\ufffd\xd7\xda\xdb\xd9\xec\xff\xaf\xb4\xad\xb1\ufffd\xbe\xb6\xa7\xf7\xb8\xb0\xa8\xb7\xb9\xb3\xb2\u25a0\xa0',
|
|
15
|
+
858: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xf8\xa3\xd8\xd7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\xae\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\xc1\xc2\xc0\xa9\u2563\u2551\u2557\u255d\xa2\xa5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\xe3\xc3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\xf0\xd0\xca\xcb\xc8\u20ac\xcd\xce\xcf\u2518\u250c\u2588\u2584\xa6\xcc\u2580\xd3\xdf\xd4\xd2\xf5\xd5\xb5\xfe\xde\xda\xdb\xd9\xfd\xdd\xaf\xb4\xad\xb1\u2017\xbe\xb6\xa7\xf7\xb8\xb0\xa8\xb7\xb9\xb3\xb2\u25a0\xa0',
|
|
16
|
+
860: '\xc7\xfc\xe9\xe2\xe3\xe0\xc1\xe7\xea\xca\xe8\xcd\xd4\xec\xc3\xc2\xc9\xc0\xc8\xf4\xf5\xf2\xda\xf9\xcc\xd5\xdc\xa2\xa3\xd9\u20a7\xd3\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\xd2\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
17
|
+
861: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xd0\xf0\xde\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xfe\xfb\xdd\xfd\xd6\xdc\xf8\xa3\xd8\u20a7\u0192\xe1\xed\xf3\xfa\xc1\xcd\xd3\xda\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
18
|
+
862: '\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
19
|
+
863: '\xc7\xfc\xe9\xe2\xc2\xe0\xb6\xe7\xea\xeb\xe8\xef\xee\u2017\xc0\xa7\xc9\xc8\xca\xf4\xcb\xcf\xfb\xf9\xa4\xd4\xdc\xa2\xa3\xd9\xdb\u0192\xa6\xb4\xf3\xfa\xa8\xb8\xb3\xaf\xce\u2310\xac\xbd\xbc\xbe\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
20
|
+
865: '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xf8\xa3\xd8\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xa4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0',
|
|
21
|
+
869: '\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0386\ufffd\xb7\xac\xa6\u2018\u2019\u0388\u2015\u0389\u038a\u03aa\u038c\ufffd\ufffd\u038e\u03ab\xa9\u038f\xb2\xb3\u03ac\xa3\u03ad\u03ae\u03af\u03ca\u0390\u03cc\u03cd\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xbd\u0398\u0399\xab\xbb\u2591\u2592\u2593\u2502\u2524\u039a\u039b\u039c\u039d\u2563\u2551\u2557\u255d\u039e\u039f\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u03a0\u03a1\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03b1\u03b2\u03b3\u2518\u250c\u2588\u2584\u03b4\u03b5\u2580\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c3\u03c2\u03c4\u0384\xad\xb1\u03c5\u03c6\u03c7\xa7\u03c8\u0385\xb0\xa8\u03c9\u03cb\u03b0\u03ce\u25a0\xa0',
|
|
22
|
+
}
|
|
@@ -54,6 +54,12 @@ const inputSchema = z.object({
|
|
|
54
54
|
body: z.string().min(1).describe('The exact script text, run verbatim once confirmed'),
|
|
55
55
|
shell: z.enum(['bash', 'sh']).describe('Which shell reads it; no default'),
|
|
56
56
|
timeoutMs: z.number().int().positive().optional().describe('The script’s own wall clock'),
|
|
57
|
+
report: z
|
|
58
|
+
.literal('json-v1')
|
|
59
|
+
.optional()
|
|
60
|
+
.describe(
|
|
61
|
+
'Pure script only: stdout must be exactly one JSON object line, {"v":1,"state":"quiet"} or {"v":1,"state":"changed","summary":"..."}, with optional nextState. Quiet runs report no result; changed runs deliver the summary. The scheduler owns nextState. Omit for ordinary stdout.',
|
|
62
|
+
),
|
|
57
63
|
})
|
|
58
64
|
.optional()
|
|
59
65
|
.describe(
|
|
@@ -75,7 +81,13 @@ const inputSchema = z.object({
|
|
|
75
81
|
.string()
|
|
76
82
|
.optional()
|
|
77
83
|
.describe(
|
|
78
|
-
"create: existing
|
|
84
|
+
"create/update: existing project directory for the job; leave unset to use this session's project folder. Root, the operator's home directory, NAMZU_HOME and a folder containing NAMZU_HOME are refused. For a project-free pure script use workspace: 'none' and omit folder; do not make a visible folder merely to satisfy validation",
|
|
85
|
+
),
|
|
86
|
+
workspace: z
|
|
87
|
+
.literal('none')
|
|
88
|
+
.optional()
|
|
89
|
+
.describe(
|
|
90
|
+
'create/update: pure script only. Run in a private scheduler workspace with no project; omit folder. The script still runs as your user on this machine, so this is not a sandbox or a write boundary.',
|
|
79
91
|
),
|
|
80
92
|
tz: z
|
|
81
93
|
.string()
|
|
@@ -143,10 +155,10 @@ const inputSchema = z.object({
|
|
|
143
155
|
tokenBudget: z
|
|
144
156
|
.number()
|
|
145
157
|
.int()
|
|
146
|
-
.
|
|
158
|
+
.nonnegative()
|
|
147
159
|
.optional()
|
|
148
160
|
.describe(
|
|
149
|
-
'Tokens one run may spend in total. Every model call resends the whole prompt (often 10,000-30,000 tokens each), so a
|
|
161
|
+
'Tokens one run may spend in total; 0 means no token limit. Every model call resends the whole prompt (often 10,000-30,000 tokens each), so a finite budget needs far more than its answer; omit to inherit the host default.',
|
|
150
162
|
),
|
|
151
163
|
timeoutMs: z
|
|
152
164
|
.number()
|
|
@@ -299,6 +311,12 @@ async function create(
|
|
|
299
311
|
if (runKind === 'agent' && input.script !== undefined) {
|
|
300
312
|
return refuse('an agent job has no script; omit kind (or set it to agent) to use one')
|
|
301
313
|
}
|
|
314
|
+
if (input.workspace === 'none' && runKind !== 'script')
|
|
315
|
+
return refuse("workspace: 'none' is only for a pure script job")
|
|
316
|
+
if (input.workspace === 'none' && input.folder !== undefined)
|
|
317
|
+
return refuse("workspace: 'none' cannot be combined with folder; omit folder")
|
|
318
|
+
if (input.script?.report !== undefined && runKind !== 'script')
|
|
319
|
+
return refuse('script.report is only for a pure script job')
|
|
302
320
|
if (runKind === 'script' && input.prompt !== undefined)
|
|
303
321
|
return refuse('a pure script job has no prompt; remove prompt')
|
|
304
322
|
if (runKind === 'script' && input.budget !== undefined) {
|
|
@@ -318,6 +336,7 @@ async function create(
|
|
|
318
336
|
...(input.script ? { script: input.script } : {}),
|
|
319
337
|
...(input.prompt !== undefined ? { prompt: input.prompt } : {}),
|
|
320
338
|
...(input.folder !== undefined ? { folder: input.folder } : {}),
|
|
339
|
+
...(input.workspace !== undefined ? { workspace: input.workspace } : {}),
|
|
321
340
|
...(input.tz !== undefined ? { tz: input.tz } : {}),
|
|
322
341
|
...(input.notifyOnFinish !== undefined ? { notifyOnFinish: input.notifyOnFinish } : {}),
|
|
323
342
|
permissions,
|
|
@@ -389,6 +408,7 @@ const CHANGEABLE = [
|
|
|
389
408
|
'prompt',
|
|
390
409
|
'when',
|
|
391
410
|
'folder',
|
|
411
|
+
'workspace',
|
|
392
412
|
'tz',
|
|
393
413
|
'notifyOnFinish',
|
|
394
414
|
'permissions',
|
|
@@ -422,6 +442,12 @@ async function update(
|
|
|
422
442
|
'update cannot set kind to agent while also giving a script; drop script to make it an agent job, or leave kind unset (or as script/script+agent) to keep one.',
|
|
423
443
|
)
|
|
424
444
|
}
|
|
445
|
+
if (input.workspace === 'none' && input.folder !== undefined)
|
|
446
|
+
return refuse("workspace: 'none' cannot be combined with folder; omit folder")
|
|
447
|
+
if (input.workspace === 'none' && input.kind !== undefined && input.kind !== 'script')
|
|
448
|
+
return refuse("workspace: 'none' is only for a pure script job")
|
|
449
|
+
if (input.script?.report !== undefined && input.kind !== undefined && input.kind !== 'script')
|
|
450
|
+
return refuse('script.report is only for a pure script job')
|
|
425
451
|
let permissions: ScheduleJobDraft['permissions'] | undefined
|
|
426
452
|
if (input.permissions) {
|
|
427
453
|
const checked = checkPermissions(host, input.permissions)
|
|
@@ -448,6 +474,7 @@ async function update(
|
|
|
448
474
|
...(input.prompt !== undefined ? { prompt: input.prompt } : {}),
|
|
449
475
|
...(input.when !== undefined ? { when: input.when } : {}),
|
|
450
476
|
...(input.folder !== undefined ? { folder: input.folder } : {}),
|
|
477
|
+
...(input.workspace !== undefined ? { workspace: input.workspace } : {}),
|
|
451
478
|
...(input.tz !== undefined ? { tz: input.tz } : {}),
|
|
452
479
|
...(input.notifyOnFinish !== undefined ? { notifyOnFinish: input.notifyOnFinish } : {}),
|
|
453
480
|
...(permissions ? { permissions } : {}),
|
|
@@ -532,7 +559,13 @@ async function lifecycle(
|
|
|
532
559
|
}
|
|
533
560
|
if (action === 'pause') await host.pause(job.name)
|
|
534
561
|
else if (action === 'resume') await host.resume(job.name)
|
|
535
|
-
else
|
|
562
|
+
else {
|
|
563
|
+
try {
|
|
564
|
+
await host.delete(job.name)
|
|
565
|
+
} catch (error) {
|
|
566
|
+
return refuse(error instanceof Error ? error.message : String(error))
|
|
567
|
+
}
|
|
568
|
+
}
|
|
536
569
|
const verb = action === 'pause' ? 'paused' : action === 'resume' ? 'resumed' : 'deleted'
|
|
537
570
|
return { success: true, output: `Job "${job.name}" ${verb}.`, data: { name: job.name, action } }
|
|
538
571
|
}
|
|
@@ -554,7 +587,7 @@ export function buildScheduleTools(host: ScheduleToolHost): ToolDefinition[] {
|
|
|
554
587
|
defineTool({
|
|
555
588
|
name: SCHEDULE_TOOL_NAME,
|
|
556
589
|
description:
|
|
557
|
-
"Manage
|
|
590
|
+
"Manage durable jobs that run later, including while Namzu is closed when its scheduler is installed. For repetition in this open conversation while the TUI is open, use session_loop (/loop); a loop is not a background service. Use schedule only when the user asks for durable scheduled work. create, update, resume and delete ask the operator; pause does not. A job needs name, when and explicit permissions. agent and script+agent need prompt; script and script+agent need script. For a pure script, use permissions {rules:{},unmatched:'deny'} without a preset unless you intend deny rules: read-only denies bash and blocks every script. A pure script has no prompt, model, agent budget, browser grant or run session; set script.timeoutMs to limit it. A pure script may opt into script.report:'json-v1': one JSON stdout line says quiet or changed with a summary and optional scheduler-owned nextState. For a project-free pure script set workspace:'none' and omit folder; its private scheduler workspace is not a sandbox, and its shell still has host authority. For project work, use the actual existing project folder; home, root and NAMZU_HOME are invalid. Do not create a visible folder merely to satisfy validation. The requesting conversation can receive important results separately from the run workspace. To change a job, update it with job and only the fields that change; do not delete and recreate it. Leave tz, execution, budget and headed unset unless requested: defaults are the operator's. Scheduled runs cannot ask questions.",
|
|
558
591
|
inputSchema,
|
|
559
592
|
category: 'custom',
|
|
560
593
|
permissions: [],
|
|
@@ -33,11 +33,15 @@ export interface ScheduleJobDraft {
|
|
|
33
33
|
readonly body: string
|
|
34
34
|
readonly shell: 'bash' | 'sh'
|
|
35
35
|
readonly timeoutMs?: number
|
|
36
|
+
/** Pure scripts only: one JSON v1 report line on stdout per run. */
|
|
37
|
+
readonly report?: 'json-v1'
|
|
36
38
|
}
|
|
37
39
|
/** Schedule words: `every 30m`, `0 9 * * 1-5`, `at 09:00`, `in 2h`. */
|
|
38
40
|
readonly when: string
|
|
39
|
-
/**
|
|
41
|
+
/** Project folder the job runs in. Absent: the session's folder, unless `workspace` is `'none'`. */
|
|
40
42
|
readonly folder?: string
|
|
43
|
+
/** A private scheduler workspace for a pure script; omit `folder` when set. */
|
|
44
|
+
readonly workspace?: 'none'
|
|
41
45
|
/** IANA zone for a cron expression or a local time. Absent: the host's. */
|
|
42
46
|
readonly tz?: string
|
|
43
47
|
/** Enable routine completion notices. Absent: the host's usual setting. */
|
|
@@ -65,6 +69,7 @@ export interface ScheduleJobDraft {
|
|
|
65
69
|
}
|
|
66
70
|
readonly budget?: {
|
|
67
71
|
readonly maxIterations?: number
|
|
72
|
+
/** Total model tokens per agent phase; zero means no token limit. Omit to inherit the host default. */
|
|
68
73
|
readonly tokenBudget?: number
|
|
69
74
|
readonly timeoutMs?: number
|
|
70
75
|
}
|
|
@@ -95,8 +100,18 @@ export interface ScheduleBrowserGrant {
|
|
|
95
100
|
/** What the person confirming is shown. Every field is the host's own computation. */
|
|
96
101
|
export interface ScheduleJobPreview {
|
|
97
102
|
readonly name: string
|
|
98
|
-
/** The canonical
|
|
103
|
+
/** The canonical working directory, including the private planned path for `workspace: 'none'`. */
|
|
99
104
|
readonly folder: string
|
|
105
|
+
/** The private scheduler workspace is used instead of a project folder. */
|
|
106
|
+
readonly workspace?: 'none'
|
|
107
|
+
/** Host-bound source conversation that receives results; absent for older hosts. */
|
|
108
|
+
readonly delivery?: {
|
|
109
|
+
readonly kind: 'source-conversation'
|
|
110
|
+
readonly sessionId: string
|
|
111
|
+
readonly projectSlug: string
|
|
112
|
+
readonly projectId: string
|
|
113
|
+
readonly tenantId: string
|
|
114
|
+
}
|
|
100
115
|
/** True when `folder` is outside the session's working directory and added directories. */
|
|
101
116
|
readonly outsideSessionRoots: boolean
|
|
102
117
|
/** Empty for a pure `'script'` job, whose prompt is unused. */
|
|
@@ -108,6 +123,7 @@ export interface ScheduleJobPreview {
|
|
|
108
123
|
readonly body: string
|
|
109
124
|
readonly shell: 'bash' | 'sh'
|
|
110
125
|
readonly timeoutMs: number
|
|
126
|
+
readonly report?: 'json-v1'
|
|
111
127
|
}
|
|
112
128
|
/** The schedule in words, with its zone. */
|
|
113
129
|
readonly schedule: string
|
|
@@ -126,10 +142,11 @@ export interface ScheduleJobPreview {
|
|
|
126
142
|
/** Effective run limits. A pure script has zero model iterations/tokens and its script timeout. */
|
|
127
143
|
readonly budget: {
|
|
128
144
|
readonly maxIterations: number
|
|
145
|
+
/** Zero means no token limit for an agent phase, or no model use for a pure script. */
|
|
129
146
|
readonly tokenBudget: number
|
|
130
147
|
readonly timeoutMs: number
|
|
131
148
|
}
|
|
132
|
-
/** Runs per day at most, times
|
|
149
|
+
/** Runs per day at most, times a finite token budget. Absent for a one-shot, an unlimited agent phase, or a pure script. */
|
|
133
150
|
readonly dailyTokenCeiling?: number
|
|
134
151
|
/** Provider and model the agent phase is pinned to. Absent for a pure script job. */
|
|
135
152
|
readonly model?: string
|
|
@@ -142,6 +159,7 @@ export interface ScheduleJobPreview {
|
|
|
142
159
|
/** A job as the `list` action reports it. */
|
|
143
160
|
export interface ScheduleJobSummary {
|
|
144
161
|
readonly name: string
|
|
162
|
+
/** Canonical project path, or a host-provided label for a private workspace. */
|
|
145
163
|
readonly folder: string
|
|
146
164
|
readonly state: string
|
|
147
165
|
readonly schedule: string
|
|
@@ -167,6 +185,8 @@ export interface ScheduleJobChanges {
|
|
|
167
185
|
readonly prompt?: string
|
|
168
186
|
readonly when?: string
|
|
169
187
|
readonly folder?: string
|
|
188
|
+
/** Switch a pure script to a private scheduler workspace; omit `folder` when set. */
|
|
189
|
+
readonly workspace?: 'none'
|
|
170
190
|
readonly tz?: string
|
|
171
191
|
/** Whether routine Namzu desktop completion notices are enabled. */
|
|
172
192
|
readonly notifyOnFinish?: boolean
|
package/src/tools/task/list.ts
CHANGED
|
@@ -13,7 +13,7 @@ export function buildTaskListTool(
|
|
|
13
13
|
return defineTool({
|
|
14
14
|
name: 'task_list',
|
|
15
15
|
description:
|
|
16
|
-
'List planning items for this session: every open one, and those closed during the current turn. Not delegated agent invocations. Use agent_task_list, when available, to inspect agent execution. Shows subject, status, owner, and unresolved blockers. Use this to review your plan and decide what to work on next.',
|
|
16
|
+
'List planning items for this session: every open one, and those closed during the current turn. Earlier completed or failed items remain stored but are omitted; returned tasks and stats count only this current-turn view, not the full stored history. Not delegated agent invocations. Use agent_task_list, when available, to inspect agent execution. Shows subject, status, owner, and unresolved blockers. Use this to review your plan and decide what to work on next.',
|
|
17
17
|
inputSchema: z.object({}),
|
|
18
18
|
category: 'custom',
|
|
19
19
|
permissions: [],
|
|
@@ -26,13 +26,13 @@ export function buildTaskListTool(
|
|
|
26
26
|
const all = await taskStore.list({ sessionId: scope.sessionId })
|
|
27
27
|
// Blockers resolve against every task of the session, shown or not: a
|
|
28
28
|
// blocker closed in an earlier turn is resolved, not unknown.
|
|
29
|
-
const
|
|
29
|
+
const terminalIds = new Set(
|
|
30
30
|
all.filter((t) => isTerminalTaskStatus(t.status)).map((t) => t.id),
|
|
31
31
|
)
|
|
32
32
|
const tasks = selectTaskContext(all, scope)
|
|
33
33
|
|
|
34
34
|
const summary = tasks.map((task) => {
|
|
35
|
-
const unresolvedBlockers = task.blockedBy.filter((bid) => !
|
|
35
|
+
const unresolvedBlockers = task.blockedBy.filter((bid) => !terminalIds.has(bid))
|
|
36
36
|
|
|
37
37
|
return {
|
|
38
38
|
id: task.id,
|
|
@@ -49,14 +49,22 @@ export function buildTaskListTool(
|
|
|
49
49
|
pending: tasks.filter((t) => t.status === 'pending').length,
|
|
50
50
|
in_progress: tasks.filter((t) => t.status === 'in_progress').length,
|
|
51
51
|
completed: tasks.filter((t) => t.status === 'completed').length,
|
|
52
|
+
failed: tasks.filter((t) => t.status === 'failed').length,
|
|
52
53
|
}
|
|
54
|
+
const omitted = all.length - tasks.length
|
|
55
|
+
const history = omitted
|
|
56
|
+
? ` ${countTasks(omitted)} closed in earlier turns ${omitted === 1 ? 'remains' : 'remain'} stored and ${omitted === 1 ? 'is' : 'are'} omitted from this view.`
|
|
57
|
+
: ''
|
|
58
|
+
const output =
|
|
59
|
+
all.length === 0
|
|
60
|
+
? 'No planning tasks found for this session. This list does not report delegated agent status; use agent_task_list when available.'
|
|
61
|
+
: tasks.length === 0
|
|
62
|
+
? `No open or current-turn planning tasks.${history}`
|
|
63
|
+
: `Current-turn view: ${countTasks(stats.total)}: ${stats.completed} completed, ${stats.in_progress} in progress, ${stats.pending} pending${stats.failed ? `, ${stats.failed} failed` : ''}.${history}`
|
|
53
64
|
|
|
54
65
|
return {
|
|
55
66
|
success: true,
|
|
56
|
-
output
|
|
57
|
-
tasks.length === 0
|
|
58
|
-
? 'No planning tasks yet. This list does not report delegated agent status; use agent_task_list when available.'
|
|
59
|
-
: `${countTasks(stats.total)}: ${stats.completed} completed, ${stats.in_progress} in progress, ${stats.pending} pending.`,
|
|
67
|
+
output,
|
|
60
68
|
data: { tasks: summary, stats },
|
|
61
69
|
}
|
|
62
70
|
},
|
|
@@ -28,7 +28,11 @@ function activity(label: string): ToolCallView {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/** A successful receipt: the call row already said it. */
|
|
31
|
-
const HIDDEN_RESULT: ToolResultView = {
|
|
31
|
+
const HIDDEN_RESULT: ToolResultView = {
|
|
32
|
+
kind: 'generic',
|
|
33
|
+
label: '',
|
|
34
|
+
visibility: 'hidden',
|
|
35
|
+
}
|
|
32
36
|
|
|
33
37
|
/** `N task` / `N tasks`. */
|
|
34
38
|
export function countTasks(count: number): string {
|
|
@@ -44,7 +48,9 @@ function failure(result: ToolResult, fallback: string): ToolResultView {
|
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
export function presentTaskCreateCall(input: {
|
|
51
|
+
export function presentTaskCreateCall(input: {
|
|
52
|
+
readonly subject?: unknown
|
|
53
|
+
}): ToolCallView {
|
|
48
54
|
const subject = typeof input.subject === 'string' ? oneLine(input.subject) : ''
|
|
49
55
|
return activity(subject ? `Add task · ${subject}` : 'Add task')
|
|
50
56
|
}
|
|
@@ -61,10 +67,12 @@ export function taskUpdateVerb(status: unknown): string {
|
|
|
61
67
|
return 'Start task'
|
|
62
68
|
case 'completed':
|
|
63
69
|
return 'Complete task'
|
|
70
|
+
case 'failed':
|
|
71
|
+
return 'Fail task'
|
|
64
72
|
case 'deleted':
|
|
65
73
|
return 'Remove task'
|
|
66
74
|
case 'pending':
|
|
67
|
-
return '
|
|
75
|
+
return 'Set task pending'
|
|
68
76
|
default:
|
|
69
77
|
return 'Update task'
|
|
70
78
|
}
|
|
@@ -80,7 +88,22 @@ export function presentTaskUpdateCall(input: {
|
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
export function presentTaskUpdateResult(_input: unknown, result: ToolResult): ToolResultView {
|
|
83
|
-
if (!result.success)
|
|
91
|
+
if (!result.success) {
|
|
92
|
+
const data = result.data as { status?: unknown; requestedStatus?: unknown } | undefined
|
|
93
|
+
if (
|
|
94
|
+
typeof data?.requestedStatus === 'string' &&
|
|
95
|
+
data.requestedStatus !== data.status &&
|
|
96
|
+
(data.status === 'pending' ||
|
|
97
|
+
data.status === 'in_progress' ||
|
|
98
|
+
data.status === 'completed' ||
|
|
99
|
+
data.status === 'failed')
|
|
100
|
+
)
|
|
101
|
+
return {
|
|
102
|
+
kind: 'generic',
|
|
103
|
+
label: `Task remains ${data.status.replace('_', ' ')}; other edits may have applied`,
|
|
104
|
+
}
|
|
105
|
+
return failure(result, 'The task was not changed')
|
|
106
|
+
}
|
|
84
107
|
return HIDDEN_RESULT
|
|
85
108
|
}
|
|
86
109
|
|
|
@@ -90,13 +113,20 @@ export function presentTaskListCall(): ToolCallView {
|
|
|
90
113
|
|
|
91
114
|
export function presentTaskListResult(_input: unknown, result: ToolResult): ToolResultView {
|
|
92
115
|
if (!result.success) return { kind: 'generic', label: 'The task list could not be read' }
|
|
93
|
-
const stats = (
|
|
94
|
-
|
|
116
|
+
const stats = (
|
|
117
|
+
result.data as
|
|
118
|
+
| { stats?: { total?: unknown; completed?: unknown; failed?: unknown } }
|
|
119
|
+
| undefined
|
|
120
|
+
)?.stats
|
|
95
121
|
const total = typeof stats?.total === 'number' ? stats.total : undefined
|
|
96
122
|
const completed = typeof stats?.completed === 'number' ? stats.completed : undefined
|
|
123
|
+
const failed = typeof stats?.failed === 'number' ? stats.failed : 0
|
|
97
124
|
if (total === undefined || completed === undefined) return HIDDEN_RESULT
|
|
98
125
|
return {
|
|
99
126
|
kind: 'generic',
|
|
100
|
-
label:
|
|
127
|
+
label:
|
|
128
|
+
total === 0
|
|
129
|
+
? 'No open or current-turn tasks'
|
|
130
|
+
: `Current-turn task view · ${completed}/${total} done${failed ? ` · ${failed} failed` : ''}`,
|
|
101
131
|
}
|
|
102
132
|
}
|
package/src/tools/task/update.ts
CHANGED
|
@@ -9,14 +9,14 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
|
|
|
9
9
|
return defineTool({
|
|
10
10
|
name: 'task_update',
|
|
11
11
|
description:
|
|
12
|
-
'Update
|
|
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.',
|
|
13
13
|
inputSchema: z.object({
|
|
14
14
|
id: z.string().describe('Task ID (e.g. "task_abc123")'),
|
|
15
15
|
subject: z.string().optional().describe('Updated title'),
|
|
16
16
|
description: z.string().optional().describe('Updated description'),
|
|
17
17
|
activeForm: z.string().optional().describe('Updated present continuous form'),
|
|
18
18
|
status: z
|
|
19
|
-
.enum(['pending', 'in_progress', 'completed', 'deleted'])
|
|
19
|
+
.enum(['pending', 'in_progress', 'completed', 'failed', 'deleted'])
|
|
20
20
|
.optional()
|
|
21
21
|
.describe('New status'),
|
|
22
22
|
owner: z.string().optional().describe('Agent name to assign ownership'),
|
|
@@ -76,7 +76,7 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
|
|
|
76
76
|
subject,
|
|
77
77
|
description,
|
|
78
78
|
activeForm,
|
|
79
|
-
status
|
|
79
|
+
status,
|
|
80
80
|
owner,
|
|
81
81
|
metadata,
|
|
82
82
|
})
|
|
@@ -85,14 +85,21 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
|
|
|
85
85
|
return { success: false, output: `Task ${id} not found` }
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// Stores can retain the old status while applying other edits. The
|
|
89
|
+
// receipt describes the returned state; it cannot prove whether the
|
|
90
|
+
// request was refused or a concurrent writer advanced it again.
|
|
91
|
+
const statusApplied = status === undefined || updated.status === status
|
|
88
92
|
return {
|
|
89
|
-
success:
|
|
90
|
-
output:
|
|
93
|
+
success: statusApplied,
|
|
94
|
+
output: statusApplied
|
|
95
|
+
? `Task ${id} updated — status: ${updated.status}`
|
|
96
|
+
: `Task ${id} 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.`,
|
|
91
97
|
data: {
|
|
92
98
|
id: updated.id,
|
|
93
99
|
subject: updated.subject,
|
|
94
100
|
status: updated.status,
|
|
95
101
|
owner: updated.owner,
|
|
102
|
+
...(statusApplied ? {} : { requestedStatus: status }),
|
|
96
103
|
},
|
|
97
104
|
}
|
|
98
105
|
},
|