@qvac/harness 1.0.0-rc.2 → 1.0.0-rc.21
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/.nvmrc +1 -0
- package/CHANGELOG.md +3073 -1485
- package/README.md +110 -46
- package/dist-lib/index.d.ts +63 -16
- package/dist-lib/index.js +232 -38
- package/dist-lib/lib/agent/delegate.d.ts +3 -2
- package/dist-lib/lib/agent/delegate.js +6 -4
- package/dist-lib/lib/agent/follow.d.ts +5 -0
- package/dist-lib/lib/agent/follow.js +11 -2
- package/dist-lib/lib/agent/resolve.js +30 -17
- package/dist-lib/lib/agent/tool-selection.d.ts +4 -2
- package/dist-lib/lib/agent/tool-selection.js +5 -6
- package/dist-lib/lib/agent/tools.d.ts +2 -0
- package/dist-lib/lib/agent/tools.js +2 -1
- package/dist-lib/lib/capabilities/agent-ports.d.ts +1 -1
- package/dist-lib/lib/capabilities/agent-ports.js +11 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/answering.js +2 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/batching.js +1 -0
- package/dist-lib/lib/capabilities/completion-engine/actors/direct-search.js +2 -0
- package/dist-lib/lib/capabilities/completion-engine/actors/execute.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/executing.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/executing.js +132 -13
- package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.js +11 -5
- package/dist-lib/lib/capabilities/completion-engine/actors/inspect-prepare.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.js +54 -10
- package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.js +12 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +142 -50
- package/dist-lib/lib/capabilities/completion-engine/actors/rejecting.js +10 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/resolving.js +78 -20
- package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.js +33 -16
- package/dist-lib/lib/capabilities/completion-engine/actors/run-prepare.js +38 -23
- package/dist-lib/lib/capabilities/completion-engine/actors/skill-step.js +50 -12
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.d.ts +10 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.js +80 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.d.ts +5 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.js +101 -41
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.js +56 -17
- package/dist-lib/lib/capabilities/completion-engine/driver.js +58 -15
- package/dist-lib/lib/capabilities/completion-engine/durable.d.ts +3 -1
- package/dist-lib/lib/capabilities/completion-engine/durable.js +12 -2
- package/dist-lib/lib/capabilities/completion-engine/engine.d.ts +4 -1
- package/dist-lib/lib/capabilities/completion-engine/engine.js +14 -1
- package/dist-lib/lib/capabilities/completion-engine/index.d.ts +5 -1
- package/dist-lib/lib/capabilities/completion-engine/index.js +5 -2
- package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +26 -3
- package/dist-lib/lib/capabilities/completion-engine/loop.js +14 -2
- package/dist-lib/lib/capabilities/completion-engine/metrics.d.ts +9 -2
- package/dist-lib/lib/capabilities/completion-engine/metrics.js +28 -7
- package/dist-lib/lib/capabilities/completion-engine/model-round.d.ts +63 -0
- package/dist-lib/lib/capabilities/completion-engine/model-round.js +99 -0
- package/dist-lib/lib/capabilities/completion-engine/operations.js +30 -10
- package/dist-lib/lib/capabilities/completion-engine/ports.js +6 -9
- package/dist-lib/lib/capabilities/completion-engine/prepare-step.d.ts +4 -1
- package/dist-lib/lib/capabilities/completion-engine/round.d.ts +38 -6
- package/dist-lib/lib/capabilities/completion-engine/round.js +395 -118
- package/dist-lib/lib/capabilities/completion-engine/session.d.ts +12 -4
- package/dist-lib/lib/capabilities/completion-engine/session.js +31 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-caller.js +5 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.d.ts +8 -43
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.js +32 -141
- package/dist-lib/lib/capabilities/completion-engine/tool-outcome.d.ts +4 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-outcome.js +42 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-preflight.d.ts +43 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-preflight.js +91 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-sets.d.ts +24 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-sets.js +15 -0
- package/dist-lib/lib/capabilities/completion-engine/turns.d.ts +17 -9
- package/dist-lib/lib/capabilities/completion-engine/turns.js +98 -86
- package/dist-lib/lib/capabilities/detect-language.d.ts +2 -1
- package/dist-lib/lib/capabilities/detect-language.js +14 -2
- package/dist-lib/lib/capabilities/download.d.ts +10 -8
- package/dist-lib/lib/capabilities/download.js +1 -1
- package/dist-lib/lib/capabilities/enhance.d.ts +1 -1
- package/dist-lib/lib/capabilities/enhance.js +23 -11
- package/dist-lib/lib/capabilities/kv-cache.d.ts +1 -1
- package/dist-lib/lib/capabilities/preview-model-source.d.ts +7 -0
- package/dist-lib/lib/capabilities/preview-model-source.js +83 -23
- package/dist-lib/lib/capabilities/prompt-prefix.d.ts +3 -1
- package/dist-lib/lib/capabilities/prompt-prefix.js +8 -0
- package/dist-lib/lib/capabilities/sdk-tool.d.ts +13 -4
- package/dist-lib/lib/capabilities/sdk-tool.js +59 -7
- package/dist-lib/lib/capabilities/skill-entry.d.ts +13 -1
- package/dist-lib/lib/capabilities/skill-entry.js +33 -2
- package/dist-lib/lib/capabilities/tool-failed-note.d.ts +1 -0
- package/dist-lib/lib/capabilities/tool-failed-note.js +1 -0
- package/dist-lib/lib/capabilities/tool-plan.d.ts +5 -1
- package/dist-lib/lib/capabilities/tool-plan.js +20 -5
- package/dist-lib/lib/capabilities/tool-prompt-log.d.ts +1 -1
- package/dist-lib/lib/capabilities/tool-prompt-log.js +3 -3
- package/dist-lib/lib/capabilities/tool-turns/attachments.d.ts +7 -0
- package/dist-lib/lib/capabilities/tool-turns/attachments.js +39 -0
- package/dist-lib/lib/capabilities/tool-turns/copy.d.ts +13 -0
- package/dist-lib/lib/capabilities/tool-turns/copy.js +29 -0
- package/dist-lib/lib/capabilities/tool-turns/result-turn.d.ts +22 -0
- package/dist-lib/lib/capabilities/tool-turns/result-turn.js +120 -0
- package/dist-lib/lib/capabilities/tool-turns/run-limits.d.ts +6 -0
- package/dist-lib/lib/capabilities/tool-turns/run-limits.js +32 -0
- package/dist-lib/lib/capabilities/tool-turns/skill-loads.d.ts +9 -0
- package/dist-lib/lib/capabilities/tool-turns/skill-loads.js +71 -0
- package/dist-lib/lib/capabilities/tool-turns.d.ts +8 -43
- package/dist-lib/lib/capabilities/tool-turns.js +6 -253
- package/dist-lib/lib/capabilities/usage-breakdown.d.ts +1 -0
- package/dist-lib/lib/capabilities/usage-breakdown.js +4 -1
- package/dist-lib/lib/client/index.d.ts +19 -0
- package/dist-lib/lib/client/index.js +263 -0
- package/dist-lib/lib/connect/abort.d.ts +6 -0
- package/dist-lib/lib/connect/abort.js +52 -0
- package/dist-lib/lib/connect/bridges.d.ts +21 -0
- package/dist-lib/lib/connect/bridges.js +185 -0
- package/dist-lib/lib/connect/decode.d.ts +31 -0
- package/dist-lib/lib/connect/decode.js +114 -0
- package/dist-lib/lib/connect/host-run-log.d.ts +16 -0
- package/dist-lib/lib/connect/host-run-log.js +74 -0
- package/dist-lib/lib/connect/served.d.ts +7 -0
- package/dist-lib/lib/connect/served.js +45 -0
- package/dist-lib/lib/connect.d.ts +20 -11
- package/dist-lib/lib/connect.js +178 -415
- package/dist-lib/lib/context-window.d.ts +13 -5
- package/dist-lib/lib/context-window.js +19 -6
- package/dist-lib/lib/contract/agent.d.ts +25 -4
- package/dist-lib/lib/contract/completion.d.ts +82 -32
- package/dist-lib/lib/contract/drive.d.ts +130 -0
- package/dist-lib/lib/contract/drive.js +1 -0
- package/dist-lib/lib/contract/egress-proxy.d.ts +13 -0
- package/dist-lib/lib/contract/egress-proxy.js +1 -0
- package/dist-lib/lib/contract/exec.d.ts +4 -3
- package/dist-lib/lib/contract/hooks.d.ts +4 -1
- package/dist-lib/lib/contract/index.d.ts +4 -0
- package/dist-lib/lib/contract/knowledge.d.ts +10 -0
- package/dist-lib/lib/contract/managed-skills.d.ts +1 -0
- package/dist-lib/lib/contract/managed-skills.js +1 -0
- package/dist-lib/lib/contract/media.d.ts +58 -0
- package/dist-lib/lib/contract/media.js +1 -0
- package/dist-lib/lib/contract/models.d.ts +12 -6
- package/dist-lib/lib/contract/ocr.d.ts +17 -0
- package/dist-lib/lib/contract/ocr.js +1 -0
- package/dist-lib/lib/contract/policy.d.ts +75 -0
- package/dist-lib/lib/contract/policy.js +1 -0
- package/dist-lib/lib/contract/run.d.ts +28 -3
- package/dist-lib/lib/contract/sandbox.d.ts +3 -1
- package/dist-lib/lib/contract/speech.d.ts +1 -1
- package/dist-lib/lib/contract/translation.d.ts +20 -0
- package/dist-lib/lib/contract/translation.js +1 -0
- package/dist-lib/lib/contract-types.d.ts +48 -16
- package/dist-lib/lib/embeddings/index.d.ts +7 -1
- package/dist-lib/lib/embeddings/index.js +26 -5
- package/dist-lib/lib/errors.d.ts +278 -0
- package/dist-lib/lib/errors.js +212 -0
- package/dist-lib/lib/fold/index.d.ts +26 -1
- package/dist-lib/lib/fold/index.js +76 -9
- package/dist-lib/lib/guarded-fetch.js +11 -7
- package/dist-lib/lib/guards.d.ts +2 -0
- package/dist-lib/lib/guards.js +7 -0
- package/dist-lib/lib/hardware/capability-probe.js +10 -7
- package/dist-lib/lib/hardware/cpu-placement.d.ts +8 -0
- package/dist-lib/lib/hardware/cpu-placement.js +48 -0
- package/dist-lib/lib/hardware/gpu-probe-addon.js +26 -11
- package/dist-lib/lib/hardware/gpu-probe.js +10 -1
- package/dist-lib/lib/hardware/gpu-stats.native.cjs +17 -1
- package/dist-lib/lib/helpers/completion-params.d.ts +7 -2
- package/dist-lib/lib/helpers/completion-params.js +26 -2
- package/dist-lib/lib/helpers/control-tokens.d.ts +3 -0
- package/dist-lib/lib/helpers/control-tokens.js +25 -0
- package/dist-lib/lib/helpers/engine-error.d.ts +2 -1
- package/dist-lib/lib/helpers/engine-error.js +12 -12
- package/dist-lib/lib/helpers/goal-check/asks.d.ts +25 -0
- package/dist-lib/lib/helpers/goal-check/asks.js +52 -0
- package/dist-lib/lib/helpers/goal-check/checks.d.ts +8 -0
- package/dist-lib/lib/helpers/goal-check/checks.js +92 -0
- package/dist-lib/lib/helpers/goal-check/commands.d.ts +7 -0
- package/dist-lib/lib/helpers/goal-check/commands.js +130 -0
- package/dist-lib/lib/helpers/goal-check/paths.d.ts +5 -0
- package/dist-lib/lib/helpers/goal-check/paths.js +44 -0
- package/dist-lib/lib/helpers/goal-check/shell.d.ts +9 -0
- package/dist-lib/lib/helpers/goal-check/shell.js +96 -0
- package/dist-lib/lib/helpers/goal-check.d.ts +36 -0
- package/dist-lib/lib/helpers/goal-check.js +35 -0
- package/dist-lib/lib/helpers/head-tail.js +1 -1
- package/dist-lib/lib/helpers/html-helpers.js +9 -6
- package/dist-lib/lib/helpers/load-stall.d.ts +1 -1
- package/dist-lib/lib/helpers/load-stall.js +2 -2
- package/dist-lib/lib/helpers/markup-stream-filter.d.ts +4 -1
- package/dist-lib/lib/helpers/markup-stream-filter.js +20 -6
- package/dist-lib/lib/helpers/recent-map.d.ts +7 -0
- package/dist-lib/lib/helpers/recent-map.js +23 -0
- package/dist-lib/lib/helpers/repeated-reply.js +24 -16
- package/dist-lib/lib/helpers/require-peers.d.ts +3 -0
- package/dist-lib/lib/helpers/require-peers.js +23 -0
- package/dist-lib/lib/helpers/run-outcome.d.ts +2 -0
- package/dist-lib/lib/helpers/run-outcome.js +6 -2
- package/dist-lib/lib/helpers/spawn-path.d.ts +1 -0
- package/dist-lib/lib/helpers/spawn-path.js +2 -1
- package/dist-lib/lib/helpers/thinking.d.ts +3 -2
- package/dist-lib/lib/helpers/thinking.js +19 -0
- package/dist-lib/lib/helpers/tool-call-markup/emit.d.ts +6 -0
- package/dist-lib/lib/helpers/tool-call-markup/emit.js +15 -0
- package/dist-lib/lib/helpers/tool-call-markup/recover.d.ts +22 -0
- package/dist-lib/lib/helpers/tool-call-markup/recover.js +130 -0
- package/dist-lib/lib/helpers/tool-call-markup/skill-recovery.d.ts +3 -0
- package/dist-lib/lib/helpers/tool-call-markup/skill-recovery.js +56 -0
- package/dist-lib/lib/helpers/tool-call-markup/strip.d.ts +4 -0
- package/dist-lib/lib/helpers/tool-call-markup/strip.js +149 -0
- package/dist-lib/lib/helpers/tool-call-markup.d.ts +19 -24
- package/dist-lib/lib/helpers/tool-call-markup.js +17 -343
- package/dist-lib/lib/hooks/built-in/arg-repair.js +6 -2
- package/dist-lib/lib/hooks/built-in/policy-rules.d.ts +8 -0
- package/dist-lib/lib/hooks/built-in/policy-rules.js +192 -0
- package/dist-lib/lib/hooks/built-in/sandbox.js +23 -5
- package/dist-lib/lib/hooks/index.d.ts +4 -1
- package/dist-lib/lib/hooks/index.js +9 -4
- package/dist-lib/lib/hooks/run.js +3 -3
- package/dist-lib/lib/lifecycle/index.js +15 -14
- package/dist-lib/lib/lifecycle/machine.js +2 -2
- package/dist-lib/lib/log.d.ts +26 -5
- package/dist-lib/lib/log.js +86 -23
- package/dist-lib/lib/machine/completion/actions/completion.d.ts +15 -16
- package/dist-lib/lib/machine/completion/actions/completion.js +164 -107
- package/dist-lib/lib/machine/completion/actions/goal.d.ts +10 -0
- package/dist-lib/lib/machine/completion/actions/goal.js +93 -0
- package/dist-lib/lib/machine/completion/actions/prepare.js +3 -2
- package/dist-lib/lib/machine/completion/actions/reject-tool.d.ts +16 -0
- package/dist-lib/lib/machine/completion/actions/reject-tool.js +147 -0
- package/dist-lib/lib/machine/completion/actions/retry-round.d.ts +6 -0
- package/dist-lib/lib/machine/completion/actions/retry-round.js +50 -0
- package/dist-lib/lib/machine/completion/actions/rounds.d.ts +5 -0
- package/dist-lib/lib/machine/completion/actions/rounds.js +31 -0
- package/dist-lib/lib/machine/completion/actions/tools.d.ts +1 -16
- package/dist-lib/lib/machine/completion/actions/tools.js +111 -140
- package/dist-lib/lib/machine/completion/context.js +11 -1
- package/dist-lib/lib/machine/completion/guards/retry.d.ts +3 -1
- package/dist-lib/lib/machine/completion/guards/retry.js +9 -2
- package/dist-lib/lib/machine/completion/implementations.d.ts +18 -9
- package/dist-lib/lib/machine/completion/implementations.js +64 -16
- package/dist-lib/lib/machine/completion/machine.d.ts +38 -9
- package/dist-lib/lib/machine/completion/machine.js +58 -9
- package/dist-lib/lib/machine/completion/metrics.d.ts +25 -0
- package/dist-lib/lib/machine/completion/metrics.js +68 -0
- package/dist-lib/lib/machine/completion/nudges.d.ts +5 -0
- package/dist-lib/lib/machine/completion/nudges.js +33 -0
- package/dist-lib/lib/machine/completion/rules.d.ts +19 -27
- package/dist-lib/lib/machine/completion/rules.js +48 -79
- package/dist-lib/lib/machine/completion/splice.d.ts +9 -0
- package/dist-lib/lib/machine/completion/splice.js +19 -0
- package/dist-lib/lib/machine/completion/types.d.ts +81 -14
- package/dist-lib/lib/machine/index.d.ts +50 -11
- package/dist-lib/lib/machine/index.js +12 -2
- package/dist-lib/lib/media-host.d.ts +12 -0
- package/dist-lib/lib/media-host.js +52 -0
- package/dist-lib/lib/media-port.d.ts +20 -0
- package/dist-lib/lib/media-port.js +77 -0
- package/dist-lib/lib/media-wire.d.ts +8 -0
- package/dist-lib/lib/media-wire.js +111 -0
- package/dist-lib/lib/models/context-choice.d.ts +15 -0
- package/dist-lib/lib/models/context-choice.js +62 -0
- package/dist-lib/lib/models/context.d.ts +1 -1
- package/dist-lib/lib/models/custom-model-cache.d.ts +1 -0
- package/dist-lib/lib/models/custom-model-cache.js +3 -0
- package/dist-lib/lib/models/download-gate.d.ts +20 -0
- package/dist-lib/lib/models/download-gate.js +73 -0
- package/dist-lib/lib/models/gguf-header.d.ts +11 -0
- package/dist-lib/lib/models/gguf-header.js +203 -15
- package/dist-lib/lib/models/gpu-selection.d.ts +6 -1
- package/dist-lib/lib/models/gpu-selection.js +29 -5
- package/dist-lib/lib/models/kv-cache.d.ts +2 -0
- package/dist-lib/lib/models/kv-cache.js +8 -0
- package/dist-lib/lib/models/llm-presets.d.ts +6 -1
- package/dist-lib/lib/models/llm-presets.js +33 -6
- package/dist-lib/lib/models/load-requests.d.ts +9 -0
- package/dist-lib/lib/models/load-requests.js +42 -0
- package/dist-lib/lib/models/memory-cap.d.ts +13 -0
- package/dist-lib/lib/models/memory-cap.js +21 -0
- package/dist-lib/lib/models/model-catalog-constants.d.ts +2 -2
- package/dist-lib/lib/models/model-catalog-constants.js +3 -4
- package/dist-lib/lib/models/model-catalog.d.ts +7 -3
- package/dist-lib/lib/models/model-catalog.js +44 -11
- package/dist-lib/lib/models/model-delete.d.ts +1 -1
- package/dist-lib/lib/models/model-fit.d.ts +2 -2
- package/dist-lib/lib/models/model-fit.js +5 -6
- package/dist-lib/lib/models/model-handle.d.ts +9 -2
- package/dist-lib/lib/models/model-handle.js +14 -3
- package/dist-lib/lib/models/model-list.d.ts +9 -2
- package/dist-lib/lib/models/model-list.js +23 -0
- package/dist-lib/lib/models/model-pool.d.ts +42 -7
- package/dist-lib/lib/models/model-pool.js +139 -49
- package/dist-lib/lib/models/model-source.d.ts +3 -2
- package/dist-lib/lib/models/model-source.js +23 -5
- package/dist-lib/lib/models/opencl-cache.js +2 -2
- package/dist-lib/lib/models/sdk-faults.d.ts +1 -0
- package/dist-lib/lib/models/sdk-faults.js +9 -0
- package/dist-lib/lib/models/tool-dialect.d.ts +1 -1
- package/dist-lib/lib/models/tts-model-default.d.ts +2 -1
- package/dist-lib/lib/models/tts-model-default.js +8 -6
- package/dist-lib/lib/no-redirect-fetch-bare.js +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.d.ts +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.js +46 -8
- package/dist-lib/lib/office/engine/pptx/picture-area.d.ts +23 -0
- package/dist-lib/lib/office/engine/pptx/picture-area.js +84 -0
- package/dist-lib/lib/office/engine/pptx/presentation.d.ts +2 -0
- package/dist-lib/lib/office/engine/pptx/presentation.js +64 -21
- package/dist-lib/lib/office/engine/pptx/types.d.ts +1 -0
- package/dist-lib/lib/office/engine/xlsx/sheet.js +10 -4
- package/dist-lib/lib/office/engine/xlsx/workbook.d.ts +1 -0
- package/dist-lib/lib/office/engine/xlsx/workbook.js +34 -3
- package/dist-lib/lib/office/extract.js +4 -3
- package/dist-lib/lib/office/index.js +2 -1
- package/dist-lib/lib/plugins/registry.d.ts +15 -0
- package/dist-lib/lib/plugins/registry.js +91 -22
- package/dist-lib/lib/plugins/require-bare.d.ts +1 -0
- package/dist-lib/lib/plugins/require-bare.js +13 -0
- package/dist-lib/lib/policy/index.d.ts +11 -0
- package/dist-lib/lib/policy/index.js +235 -0
- package/dist-lib/lib/prompt.d.ts +9 -4
- package/dist-lib/lib/prompt.js +95 -32
- package/dist-lib/lib/residency/completion-runtime.d.ts +17 -6
- package/dist-lib/lib/residency/completion-runtime.js +91 -37
- package/dist-lib/lib/residency/index.d.ts +59 -6
- package/dist-lib/lib/residency/index.js +444 -42
- package/dist-lib/lib/resolution-detector.js +3 -3
- package/dist-lib/lib/round-host.d.ts +12 -0
- package/dist-lib/lib/round-host.js +57 -0
- package/dist-lib/lib/round-port.d.ts +24 -0
- package/dist-lib/lib/round-port.js +81 -0
- package/dist-lib/lib/rpc-session.js +2 -1
- package/dist-lib/lib/run-log/redact.js +7 -7
- package/dist-lib/lib/run-log/request-codec.js +2 -2
- package/dist-lib/lib/sdk-loader.d.ts +1 -1
- package/dist-lib/lib/sdk-loader.js +47 -17
- package/dist-lib/lib/sdk-storage.d.ts +1 -0
- package/dist-lib/lib/sdk-storage.js +18 -2
- package/dist-lib/lib/serve/completion.d.ts +7 -0
- package/dist-lib/lib/serve/completion.js +553 -0
- package/dist-lib/lib/serve/downloads.d.ts +4 -0
- package/dist-lib/lib/serve/downloads.js +79 -0
- package/dist-lib/lib/serve/models.d.ts +5 -0
- package/dist-lib/lib/serve/models.js +120 -0
- package/dist-lib/lib/serve/noop.d.ts +1 -0
- package/dist-lib/lib/serve/noop.js +1 -0
- package/dist-lib/lib/serve/requests.d.ts +147 -0
- package/dist-lib/lib/serve/requests.js +1 -0
- package/dist-lib/lib/serve/rounds.d.ts +11 -0
- package/dist-lib/lib/serve/rounds.js +67 -0
- package/dist-lib/lib/serve/run-log-start.d.ts +38 -0
- package/dist-lib/lib/serve/run-log-start.js +254 -0
- package/dist-lib/lib/serve/skills.d.ts +32 -0
- package/dist-lib/lib/serve/skills.js +46 -0
- package/dist-lib/lib/serve.d.ts +5 -1
- package/dist-lib/lib/serve.js +51 -916
- package/dist-lib/lib/sidecar/index.d.ts +39 -0
- package/dist-lib/lib/sidecar/index.js +205 -0
- package/dist-lib/lib/sidecar/user-plugins.d.ts +9 -0
- package/dist-lib/lib/sidecar/user-plugins.js +119 -0
- package/dist-lib/lib/skills-host/index.d.ts +7 -3
- package/dist-lib/lib/skills-host/index.js +47 -22
- package/dist-lib/lib/spawn.d.ts +6 -4
- package/dist-lib/lib/spawn.js +22 -20
- package/dist-lib/lib/spill.d.ts +1 -0
- package/dist-lib/lib/spill.js +12 -8
- package/dist-lib/lib/tools/ask-user.d.ts +2 -0
- package/dist-lib/lib/tools/ask-user.js +137 -0
- package/dist-lib/lib/tools/attachments/delivered.d.ts +5 -0
- package/dist-lib/lib/tools/attachments/delivered.js +16 -0
- package/dist-lib/lib/tools/attachments/fetched-file.d.ts +32 -0
- package/dist-lib/lib/tools/attachments/fetched-file.js +134 -0
- package/dist-lib/lib/tools/attachments/staging.d.ts +1 -0
- package/dist-lib/lib/tools/attachments/staging.js +19 -8
- package/dist-lib/lib/tools/exec/runner.d.ts +4 -0
- package/dist-lib/lib/tools/exec/runner.js +20 -2
- package/dist-lib/lib/tools/exec/scope.d.ts +0 -1
- package/dist-lib/lib/tools/exec/scope.js +23 -114
- package/dist-lib/lib/tools/exec/shell-guidance.js +4 -4
- package/dist-lib/lib/tools/exec/shell-line.d.ts +26 -0
- package/dist-lib/lib/tools/exec/shell-line.js +334 -0
- package/dist-lib/lib/tools/exec.d.ts +4 -1
- package/dist-lib/lib/tools/exec.js +89 -27
- package/dist-lib/lib/tools/files/edit-file.d.ts +6 -0
- package/dist-lib/lib/tools/files/edit-file.js +266 -0
- package/dist-lib/lib/tools/files/glob.d.ts +3 -0
- package/dist-lib/lib/tools/files/glob.js +65 -0
- package/dist-lib/lib/tools/files/grep.d.ts +6 -0
- package/dist-lib/lib/tools/files/grep.js +212 -0
- package/dist-lib/lib/tools/files/index.d.ts +3 -0
- package/dist-lib/lib/tools/files/index.js +25 -0
- package/dist-lib/lib/tools/files/list-dir.d.ts +6 -0
- package/dist-lib/lib/tools/files/list-dir.js +136 -0
- package/dist-lib/lib/tools/files/make-dir.d.ts +3 -0
- package/dist-lib/lib/tools/files/make-dir.js +48 -0
- package/dist-lib/lib/tools/files/read-file.d.ts +3 -0
- package/dist-lib/lib/tools/files/read-file.js +224 -0
- package/dist-lib/lib/tools/files/transfer.d.ts +4 -0
- package/dist-lib/lib/tools/files/transfer.js +83 -0
- package/dist-lib/lib/tools/files/trash-file.d.ts +4 -0
- package/dist-lib/lib/tools/files/trash-file.js +62 -0
- package/dist-lib/lib/tools/files/write-file.d.ts +3 -0
- package/dist-lib/lib/tools/files/write-file.js +56 -0
- package/dist-lib/lib/tools/fs/document-text.d.ts +8 -0
- package/dist-lib/lib/tools/fs/document-text.js +22 -0
- package/dist-lib/lib/tools/fs/drive.d.ts +5 -25
- package/dist-lib/lib/tools/fs/drive.js +9 -1
- package/dist-lib/lib/tools/fs/edit-match.d.ts +33 -0
- package/dist-lib/lib/tools/fs/edit-match.js +445 -0
- package/dist-lib/lib/tools/fs/ignore.d.ts +13 -0
- package/dist-lib/lib/tools/fs/ignore.js +104 -0
- package/dist-lib/lib/tools/fs/local.js +28 -5
- package/dist-lib/lib/tools/fs/remote-protocol.d.ts +2 -40
- package/dist-lib/lib/tools/fs/remote-protocol.js +1 -1
- package/dist-lib/lib/tools/fs/remote.d.ts +3 -11
- package/dist-lib/lib/tools/fs/remote.js +24 -14
- package/dist-lib/lib/tools/fs/scope.d.ts +4 -15
- package/dist-lib/lib/tools/fs/scope.js +5 -2
- package/dist-lib/lib/tools/fs/search.d.ts +25 -0
- package/dist-lib/lib/tools/fs/search.js +383 -0
- package/dist-lib/lib/tools/{file-glob.d.ts → fs/targets.d.ts} +1 -5
- package/dist-lib/lib/tools/fs/targets.js +32 -0
- package/dist-lib/lib/tools/fs/tool-path.d.ts +27 -0
- package/dist-lib/lib/tools/fs/tool-path.js +70 -0
- package/dist-lib/lib/tools/fs/walk.d.ts +14 -5
- package/dist-lib/lib/tools/fs/walk.js +119 -24
- package/dist-lib/lib/tools/http-request/request.d.ts +4 -2
- package/dist-lib/lib/tools/http-request/request.js +2 -1
- package/dist-lib/lib/tools/http-request/truncate-response.d.ts +16 -1
- package/dist-lib/lib/tools/http-request/truncate-response.js +56 -11
- package/dist-lib/lib/tools/http-request.d.ts +1 -0
- package/dist-lib/lib/tools/http-request.js +101 -16
- package/dist-lib/lib/tools/index.d.ts +4 -1
- package/dist-lib/lib/tools/index.js +8 -12
- package/dist-lib/lib/tools/office/ops.d.ts +1 -0
- package/dist-lib/lib/tools/office/ops.js +5 -1
- package/dist-lib/lib/tools/office.d.ts +2 -1
- package/dist-lib/lib/tools/office.js +273 -56
- package/dist-lib/lib/tools/operations/builders.d.ts +4 -3
- package/dist-lib/lib/tools/operations/builders.js +41 -3
- package/dist-lib/lib/tools/operations/calendar-range.d.ts +16 -0
- package/dist-lib/lib/tools/operations/calendar-range.js +40 -0
- package/dist-lib/lib/tools/operations/compile.js +8 -6
- package/dist-lib/lib/tools/operations/manifest.d.ts +4 -0
- package/dist-lib/lib/tools/pdf/build.d.ts +17 -3
- package/dist-lib/lib/tools/pdf/build.js +77 -16
- package/dist-lib/lib/tools/pdf/pages.d.ts +12 -0
- package/dist-lib/lib/tools/pdf/pages.js +31 -0
- package/dist-lib/lib/tools/pdf/recognize.d.ts +13 -0
- package/dist-lib/lib/tools/pdf/recognize.js +55 -0
- package/dist-lib/lib/tools/pdf/request.d.ts +3 -8
- package/dist-lib/lib/tools/pdf/request.js +4 -4
- package/dist-lib/lib/tools/pdf.d.ts +0 -1
- package/dist-lib/lib/tools/pdf.js +56 -13
- package/dist-lib/lib/tools/skill.js +23 -11
- package/dist-lib/lib/tools/skills/bundled-dir.d.ts +8 -1
- package/dist-lib/lib/tools/skills/bundled-dir.js +42 -36
- package/dist-lib/lib/tools/skills/bundled-hash.d.ts +1 -0
- package/dist-lib/lib/tools/skills/bundled-hash.js +4 -1
- package/dist-lib/lib/tools/skills/catalog-loader.d.ts +12 -0
- package/dist-lib/lib/tools/skills/catalog-loader.js +173 -0
- package/dist-lib/lib/tools/skills/catalog.d.ts +7 -8
- package/dist-lib/lib/tools/skills/catalog.js +1 -158
- package/dist-lib/lib/tools/skills/cli-argv.js +25 -5
- package/dist-lib/lib/tools/skills/cli-schema-check.d.ts +1 -0
- package/dist-lib/lib/tools/skills/cli-schema-check.js +3 -0
- package/dist-lib/lib/tools/skills/cli-schema-load.js +10 -0
- package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +2 -0
- package/dist-lib/lib/tools/skills/cli-schema.js +6 -3
- package/dist-lib/lib/tools/skills/credential-check.d.ts +1 -0
- package/dist-lib/lib/tools/skills/credential-check.js +3 -0
- package/dist-lib/lib/tools/skills/credential-health.js +3 -3
- package/dist-lib/lib/tools/skills/frontmatter-parser.d.ts +3 -0
- package/dist-lib/lib/tools/skills/frontmatter-parser.js +5 -0
- package/dist-lib/lib/tools/skills/index.d.ts +1 -0
- package/dist-lib/lib/tools/skills/index.js +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.d.ts +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +39 -3
- package/dist-lib/lib/tools/skills/manifest.d.ts +1 -0
- package/dist-lib/lib/tools/skills/mention-name.d.ts +6 -0
- package/dist-lib/lib/tools/skills/mention-name.js +6 -0
- package/dist-lib/lib/tools/skills/mention.d.ts +2 -2
- package/dist-lib/lib/tools/skills/mention.js +11 -4
- package/dist-lib/lib/tools/skills/overlay-crud.d.ts +3 -3
- package/dist-lib/lib/tools/skills/overlay-crud.js +7 -6
- package/dist-lib/lib/tools/skills/overlay-watch.d.ts +2 -2
- package/dist-lib/lib/tools/skills/overlay-watch.js +4 -3
- package/dist-lib/lib/tools/skills/scope-key.d.ts +1 -0
- package/dist-lib/lib/tools/skills/scope-key.js +4 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.d.ts +1 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.js +4 -0
- package/dist-lib/lib/tools/skills/skill-tree.d.ts +5 -0
- package/dist-lib/lib/tools/skills/skill-tree.js +54 -0
- package/dist-lib/lib/tools/url-guard.d.ts +6 -1
- package/dist-lib/lib/tools/url-guard.js +8 -2
- package/dist-lib/lib/tools/web-fetch.js +50 -133
- package/dist-lib/lib/wire/download.d.ts +10 -0
- package/dist-lib/lib/wire/download.js +35 -0
- package/dist-lib/lib/wire/event.d.ts +41 -0
- package/dist-lib/lib/wire/event.js +306 -0
- package/dist-lib/lib/wire/fields.d.ts +3 -0
- package/dist-lib/lib/wire/fields.js +12 -0
- package/dist-lib/lib/wire/knowledge.d.ts +9 -0
- package/dist-lib/lib/wire/knowledge.js +68 -0
- package/dist-lib/lib/wire/round.d.ts +14 -0
- package/dist-lib/lib/wire/round.js +45 -0
- package/dist-lib/lib/wire/vectors.d.ts +6 -0
- package/dist-lib/lib/wire/vectors.js +33 -0
- package/dist-lib/lib/wire.d.ts +28 -64
- package/dist-lib/lib/wire.js +24 -417
- package/dist-lib/plugins/coding/index.d.ts +1 -1
- package/dist-lib/plugins/coding/index.js +2 -4
- package/dist-lib/plugins/coding/read-only.d.ts +1 -0
- package/dist-lib/plugins/coding/read-only.js +264 -0
- package/dist-lib/plugins/coding/session.d.ts +6 -4
- package/dist-lib/plugins/coding/session.js +45 -16
- package/dist-lib/plugins/coding-guards/index.d.ts +25 -0
- package/dist-lib/plugins/coding-guards/index.js +126 -0
- package/dist-lib/plugins/command-hooks/index.js +5 -3
- package/dist-lib/plugins/egress-proxy/index.d.ts +53 -0
- package/dist-lib/plugins/egress-proxy/index.js +184 -0
- package/dist-lib/plugins/image/edit-image.d.ts +3 -22
- package/dist-lib/plugins/image/edit-image.js +23 -46
- package/dist-lib/plugins/image/fit.d.ts +31 -0
- package/dist-lib/plugins/image/fit.js +28 -0
- package/dist-lib/plugins/image/generate-image.d.ts +27 -6
- package/dist-lib/plugins/image/generate-image.js +201 -74
- package/dist-lib/plugins/image/index.d.ts +2 -1
- package/dist-lib/plugins/image/index.js +29 -12
- package/dist-lib/plugins/knowledge/index.d.ts +3 -0
- package/dist-lib/plugins/knowledge/index.js +5 -0
- package/dist-lib/plugins/knowledge/manifest.d.ts +53 -0
- package/dist-lib/plugins/knowledge/manifest.js +86 -0
- package/dist-lib/plugins/knowledge/search-tool.js +8 -8
- package/dist-lib/plugins/knowledge/store.d.ts +45 -8
- package/dist-lib/plugins/knowledge/store.js +428 -166
- package/dist-lib/plugins/language-hint/index.d.ts +15 -0
- package/dist-lib/plugins/language-hint/index.js +54 -0
- package/dist-lib/plugins/lsp/tool.js +2 -2
- package/dist-lib/plugins/mcp/call.js +15 -4
- package/dist-lib/plugins/mcp/index.js +6 -3
- package/dist-lib/plugins/mcp/protocol.d.ts +10 -2
- package/dist-lib/plugins/mcp/protocol.js +13 -12
- package/dist-lib/plugins/mcp/server.js +1 -1
- package/dist-lib/plugins/mcp/tool-listing.d.ts +6 -0
- package/dist-lib/plugins/mcp/tool-listing.js +97 -0
- package/dist-lib/plugins/music/generate-music.d.ts +24 -5
- package/dist-lib/plugins/music/generate-music.js +170 -64
- package/dist-lib/plugins/music/index.d.ts +2 -1
- package/dist-lib/plugins/music/index.js +23 -11
- package/dist-lib/plugins/obsidian/command.js +2 -2
- package/dist-lib/plugins/obsidian/index.js +14 -4
- package/dist-lib/plugins/obsidian/note-name.js +2 -1
- package/dist-lib/plugins/obsidian/readiness.js +2 -2
- package/dist-lib/plugins/obsidian/safe-path.js +5 -4
- package/dist-lib/plugins/obsidian/vault-create.js +3 -2
- package/dist-lib/plugins/obsidian/vault-fs.js +2 -2
- package/dist-lib/plugins/obsidian/vault-paths.js +3 -2
- package/dist-lib/plugins/obsidian/vault-read.js +20 -18
- package/dist-lib/plugins/obsidian/vault-write.js +13 -12
- package/dist-lib/plugins/ocr/bmp.d.ts +2 -0
- package/dist-lib/plugins/ocr/bmp.js +27 -0
- package/dist-lib/plugins/ocr/coverage.d.ts +3 -0
- package/dist-lib/plugins/ocr/coverage.js +67 -0
- package/dist-lib/plugins/ocr/index.d.ts +12 -0
- package/dist-lib/plugins/ocr/index.js +20 -0
- package/dist-lib/plugins/ocr/ocr-runtime.d.ts +25 -0
- package/dist-lib/plugins/ocr/ocr-runtime.js +103 -0
- package/dist-lib/plugins/ocr/reading-order.d.ts +5 -0
- package/dist-lib/plugins/ocr/reading-order.js +218 -0
- package/dist-lib/plugins/python/bare-floor.d.ts +1 -0
- package/dist-lib/plugins/python/bare-floor.js +2 -0
- package/dist-lib/plugins/python/guarded-fetch.d.ts +2 -1
- package/dist-lib/plugins/python/guarded-fetch.js +5 -1
- package/dist-lib/plugins/python/index.d.ts +4 -1
- package/dist-lib/plugins/python/index.js +6 -1
- package/dist-lib/plugins/python/interrupt-timer.js +2 -2
- package/dist-lib/plugins/python/language.js +11 -10
- package/dist-lib/plugins/python/loader.d.ts +1 -0
- package/dist-lib/plugins/python/loader.js +76 -3
- package/dist-lib/plugins/python/memfs.js +2 -2
- package/dist-lib/plugins/python/pyodide.d.ts +1 -0
- package/dist-lib/plugins/python/pyodide.js +9 -8
- package/dist-lib/plugins/python/python-adapter.d.ts +6 -1
- package/dist-lib/plugins/python/python-adapter.js +37 -2
- package/dist-lib/plugins/python/run-session.d.ts +1 -0
- package/dist-lib/plugins/python/run-session.js +19 -8
- package/dist-lib/plugins/python/wheels.js +8 -6
- package/dist-lib/plugins/python/worker/active.js +2 -2
- package/dist-lib/plugins/python/worker/client.js +10 -9
- package/dist-lib/plugins/python/worker/entry.js +2 -8
- package/dist-lib/plugins/python/worker/preload.d.ts +1 -0
- package/dist-lib/plugins/python/worker/preload.js +2 -0
- package/dist-lib/plugins/python/worker/protocol.d.ts +2 -0
- package/dist-lib/plugins/python/worker/serve.js +23 -4
- package/dist-lib/plugins/python/worker/spawn.d.ts +2 -1
- package/dist-lib/plugins/python/worker/spawn.js +3 -2
- package/dist-lib/plugins/quickjs/index.js +4 -0
- package/dist-lib/plugins/quickjs/runtime.js +8 -3
- package/dist-lib/plugins/run-report/chain.d.ts +2 -0
- package/dist-lib/plugins/run-report/chain.js +73 -0
- package/dist-lib/plugins/run-report/flow-view.js +2 -1
- package/dist-lib/plugins/run-report/flow.d.ts +1 -1
- package/dist-lib/plugins/run-report/flow.js +66 -14
- package/dist-lib/plugins/run-report/index.d.ts +23 -2
- package/dist-lib/plugins/run-report/index.js +32 -13
- package/dist-lib/plugins/run-report/layout.js +1 -1
- package/dist-lib/plugins/run-report/model.d.ts +10 -1
- package/dist-lib/plugins/run-report/model.js +12 -6
- package/dist-lib/plugins/run-report/page.d.ts +9 -0
- package/dist-lib/plugins/run-report/page.js +55 -15
- package/dist-lib/plugins/run-report/script.js +317 -43
- package/dist-lib/plugins/run-report/story.d.ts +2 -1
- package/dist-lib/plugins/run-report/story.js +7 -4
- package/dist-lib/plugins/run-report/style.d.ts +1 -1
- package/dist-lib/plugins/run-report/style.js +126 -0
- package/dist-lib/plugins/run-report/why.js +1 -1
- package/dist-lib/plugins/sandbox-linux/index.d.ts +62 -0
- package/dist-lib/plugins/sandbox-linux/index.js +354 -0
- package/dist-lib/plugins/sandbox-linux/seccomp.d.ts +2 -0
- package/dist-lib/plugins/sandbox-linux/seccomp.js +74 -0
- package/dist-lib/plugins/sandbox-macos/index.d.ts +25 -11
- package/dist-lib/plugins/sandbox-macos/index.js +244 -49
- package/dist-lib/plugins/sandbox-vm/index.d.ts +2 -1
- package/dist-lib/plugins/sandbox-vm/index.js +5 -2
- package/dist-lib/plugins/sandbox-vm/vm-shell.d.ts +7 -3
- package/dist-lib/plugins/sandbox-vm/vm-shell.js +54 -20
- package/dist-lib/plugins/sandbox-windows/helper/qvac-sandbox.c +554 -0
- package/dist-lib/plugins/sandbox-windows/index.d.ts +53 -0
- package/dist-lib/plugins/sandbox-windows/index.js +205 -0
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-arm64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-x64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/speech/audio-resample.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-resample.js +8 -8
- package/dist-lib/plugins/speech/audio-transcode-bare.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-transcode-bare.js +23 -26
- package/dist-lib/plugins/speech/audio-transcode-node.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-transcode-node.js +1 -3
- package/dist-lib/plugins/speech/index.d.ts +1 -0
- package/dist-lib/plugins/speech/index.js +8 -1
- package/dist-lib/plugins/speech/speech-engine.d.ts +1 -1
- package/dist-lib/plugins/speech/speech-engine.js +10 -5
- package/dist-lib/plugins/speech/speech-runtime.js +37 -37
- package/dist-lib/plugins/speech/speech-text.d.ts +1 -0
- package/dist-lib/plugins/speech/speech-text.js +9 -4
- package/dist-lib/plugins/speech/voice.d.ts +5 -1
- package/dist-lib/plugins/speech/voice.js +107 -33
- package/dist-lib/plugins/translation/index.d.ts +2 -1
- package/dist-lib/plugins/translation/index.js +21 -10
- package/dist-lib/plugins/translation/translate.d.ts +9 -5
- package/dist-lib/plugins/translation/translate.js +69 -64
- package/dist-lib/plugins/walkie-talkie/index.d.ts +4 -2
- package/dist-lib/plugins/walkie-talkie/index.js +19 -6
- package/dist-lib/plugins/walkie-talkie/wire.d.ts +5 -0
- package/dist-lib/plugins/walkie-talkie/wire.js +6 -5
- package/dist-lib/plugins/weather/geocode.js +2 -1
- package/dist-lib/plugins/weather/lookup.js +6 -4
- package/dist-lib/plugins/web-search/engines/bing.js +2 -1
- package/dist-lib/plugins/web-search/engines/google.js +2 -1
- package/dist-lib/plugins/web-search/fetch-html.d.ts +5 -5
- package/dist-lib/plugins/web-search/fetch-html.js +12 -15
- package/dist-lib/plugins/web-search/tool.js +1 -0
- package/dist-lib/schema/generate.js +8 -1
- package/dist-lib/schema/harness.js +94 -12
- package/dist-lib/spec/bind.js +12 -0
- package/dist-lib/spec/calls.js +4 -0
- package/dist-lib/spec/hrpc/hrpc.json +55 -3
- package/dist-lib/spec/hrpc/index.js +58 -10
- package/dist-lib/spec/hrpc/messages.js +485 -209
- package/dist-lib/spec/hyperschema/index.js +485 -209
- package/dist-lib/spec/hyperschema/schema.json +290 -85
- package/dist-lib/spec/hyperschema/types.d.ts +42 -5
- package/package.json +265 -65
- package/patches/pyodide@314.0.2.patch +37 -8
- package/scripts/addon-externals.cjs +16 -5
- package/worker/harness-sidecar.mjs +23 -154
- package/dist-lib/lib/tools/create-documents.d.ts +0 -3
- package/dist-lib/lib/tools/create-documents.js +0 -95
- package/dist-lib/lib/tools/edit-documents.d.ts +0 -3
- package/dist-lib/lib/tools/edit-documents.js +0 -132
- package/dist-lib/lib/tools/exec/shell-argv.d.ts +0 -2
- package/dist-lib/lib/tools/exec/shell-argv.js +0 -61
- package/dist-lib/lib/tools/file-glob.js +0 -118
- package/dist-lib/lib/tools/grep.d.ts +0 -5
- package/dist-lib/lib/tools/grep.js +0 -184
- package/dist-lib/lib/tools/read-files.d.ts +0 -5
- package/dist-lib/lib/tools/read-files.js +0 -160
- package/dist-lib/plugins/coding/write-file.d.ts +0 -3
- package/dist-lib/plugins/coding/write-file.js +0 -52
- package/patches/@qvac%2Finference@0.21.0.patch +0 -67
- package/patches/bare-stow@0.1.5.patch +0 -68
- package/patches/hypercore-blob-server@1.15.0.patch +0 -15
- package/patches/localwatch@1.4.3.patch +0 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isFailureResultReference } from '../../helpers/failure-result.js';
|
|
2
|
+
import { GoalCheck } from '../../helpers/goal-check.js';
|
|
2
3
|
export function runsUnasked(facts) {
|
|
3
4
|
if (facts.permission === 'ask')
|
|
4
5
|
return false;
|
|
@@ -8,29 +9,52 @@ export function runsUnasked(facts) {
|
|
|
8
9
|
facts.skipApprovals);
|
|
9
10
|
}
|
|
10
11
|
export const MAX_MUTE_ROUNDS = 1;
|
|
12
|
+
export const MAX_CUT_ROUNDS = 2;
|
|
11
13
|
export const MAX_CAPPED_ROUNDS = 1;
|
|
12
14
|
export const MAX_BLOCKED_REPEATS = 3;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export function nudgeWithPlan(nudge, plan) {
|
|
19
|
-
if (plan.every(isDone)) {
|
|
20
|
-
return nudge;
|
|
21
|
-
}
|
|
22
|
-
const lines = plan.map(({ step, status }) => `${PLAN_MARKS[status]} ${step}`);
|
|
23
|
-
return `${nudge}\nPlan:\n${lines.join('\n')}`;
|
|
24
|
-
}
|
|
25
|
-
function isDone(step) {
|
|
15
|
+
export const MAX_UNCHANGED_RESULTS = 3;
|
|
16
|
+
export const MAX_ROUND_REPEATS = 3;
|
|
17
|
+
export const MAX_ROUND_CALLS = 32;
|
|
18
|
+
export const MAX_SHOWN_IMAGES = 4;
|
|
19
|
+
export function isDone(step) {
|
|
26
20
|
return step.status === 'done';
|
|
27
21
|
}
|
|
28
|
-
|
|
22
|
+
function planDone(plan) {
|
|
29
23
|
return plan.length > 0 && plan.every(isDone);
|
|
30
24
|
}
|
|
25
|
+
export function goalMet(context) {
|
|
26
|
+
return checksMet(context) && !reviewPending(context.goal) && !casesOpen(context);
|
|
27
|
+
}
|
|
28
|
+
export function casesDue(context) {
|
|
29
|
+
return checksMet(context) && !reviewPending(context.goal) && casesOpen(context);
|
|
30
|
+
}
|
|
31
|
+
function casesOpen(context) {
|
|
32
|
+
return !!context.goal?.checkable && !context.goal.cases && halfLeft(context);
|
|
33
|
+
}
|
|
34
|
+
function halfLeft({ halfTime, round, policy, goal, metrics }) {
|
|
35
|
+
return (!halfTime &&
|
|
36
|
+
(round + 1) * 2 < policy.maxToolRounds &&
|
|
37
|
+
(!goal || goal.tokens === null || metrics.tokens * 2 < goal.tokens));
|
|
38
|
+
}
|
|
39
|
+
export function checksMet({ plan, goal }) {
|
|
40
|
+
const checks = goal?.checks ?? [];
|
|
41
|
+
return (planDone(plan) &&
|
|
42
|
+
!(goal && GoalCheck.asksChecks(goal)) &&
|
|
43
|
+
checks.every((check) => check.passed) &&
|
|
44
|
+
(!goal || (GoalCheck.deliverableChecked(goal) && !GoalCheck.codeUnrun(goal))));
|
|
45
|
+
}
|
|
46
|
+
function reviewPending(goal) {
|
|
47
|
+
return !!goal?.checkable && (goal.review === 'due' || goal.review === 'asked');
|
|
48
|
+
}
|
|
31
49
|
export function goalTokensLeft({ goal, metrics }) {
|
|
32
50
|
return !goal || goal.tokens === null || metrics.tokens < goal.tokens;
|
|
33
51
|
}
|
|
52
|
+
export function goalStalled({ outcome }) {
|
|
53
|
+
return outcome === 'exhausted';
|
|
54
|
+
}
|
|
55
|
+
export function settledSince(settled) {
|
|
56
|
+
return Object.fromEntries(Object.entries(settled).map(([key, result]) => [key, { ...result, repeats: 0 }]));
|
|
57
|
+
}
|
|
34
58
|
export function retainFailureResults(history, values, failedCalls) {
|
|
35
59
|
const retained = new Set();
|
|
36
60
|
for (const entry of history) {
|
|
@@ -51,62 +75,16 @@ export function activate(activated, names) {
|
|
|
51
75
|
const added = names.filter((name, at) => !activated.includes(name) && names.indexOf(name) === at);
|
|
52
76
|
return added.length ? [...activated, ...added] : activated;
|
|
53
77
|
}
|
|
54
|
-
export function
|
|
55
|
-
|
|
56
|
-
const failureResults = options.failureResults ?? context.failureResults;
|
|
57
|
-
const history = applySplice(context.history, splice);
|
|
58
|
-
return {
|
|
59
|
-
history,
|
|
60
|
-
failureResults: retainFailureResults(history, failureResults, failedCalls)
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function foldMetrics(state, round, finished) {
|
|
64
|
-
const { stats, stopReason } = finished;
|
|
65
|
-
state.stopReason = stopReason;
|
|
66
|
-
state.rounds = [...state.rounds, roundSpeed(round, finished)];
|
|
67
|
-
if (finished.ctxSize) {
|
|
68
|
-
state.ctxSize = finished.ctxSize;
|
|
69
|
-
}
|
|
70
|
-
if (!stats) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (state.ttft === undefined && stats.timeToFirstToken) {
|
|
74
|
-
state.ttft = stats.timeToFirstToken;
|
|
75
|
-
}
|
|
76
|
-
if (stats.generatedTokens) {
|
|
77
|
-
state.tokens += stats.generatedTokens;
|
|
78
|
-
if (stats.tokensPerSecond) {
|
|
79
|
-
state.decodeMs += (stats.generatedTokens / stats.tokensPerSecond) * 1000;
|
|
80
|
-
state.timedTokens += stats.generatedTokens;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (stats.promptTokens) {
|
|
84
|
-
state.promptTokens = stats.promptTokens;
|
|
85
|
-
}
|
|
86
|
-
if (stats.cacheTokens) {
|
|
87
|
-
state.cacheTokens = stats.cacheTokens;
|
|
88
|
-
}
|
|
78
|
+
export function atContextBoundary({ stats, stopReason }) {
|
|
79
|
+
return stopReason === 'length' && stats?.contextBoundary !== false;
|
|
89
80
|
}
|
|
90
|
-
|
|
91
|
-
'
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
];
|
|
98
|
-
function roundSpeed(round, { stats, stopReason, durationMs }) {
|
|
99
|
-
const speed = { round, durationMs: durationMs ?? 0 };
|
|
100
|
-
for (const key of ROUND_STATS) {
|
|
101
|
-
const value = stats?.[key];
|
|
102
|
-
if (value !== undefined) {
|
|
103
|
-
speed[key] = value;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (stopReason) {
|
|
107
|
-
speed.stopReason = stopReason;
|
|
108
|
-
}
|
|
109
|
-
return speed;
|
|
81
|
+
export function cutShort(round) {
|
|
82
|
+
return round.stopReason === 'length' || round.cut !== undefined;
|
|
83
|
+
}
|
|
84
|
+
export function cutOffMessage(policy, round) {
|
|
85
|
+
if (round?.cut !== undefined)
|
|
86
|
+
return policy.roundCutMessage;
|
|
87
|
+
return round && atContextBoundary(round) ? policy.contextBoundaryMessage : policy.cutOffMessage;
|
|
110
88
|
}
|
|
111
89
|
export function recordTool(context, call, durationMs) {
|
|
112
90
|
if (durationMs === undefined || !call) {
|
|
@@ -118,19 +96,10 @@ export function recordTool(context, call, durationMs) {
|
|
|
118
96
|
export function leadingReads(context) {
|
|
119
97
|
const keys = new Set();
|
|
120
98
|
for (const call of context.toolQueue) {
|
|
121
|
-
if (!call.concurrent || keys.has(call.key) || context.failedCalls[call.key]) {
|
|
99
|
+
if (!call.concurrent || call.cutOff || keys.has(call.key) || context.failedCalls[call.key]) {
|
|
122
100
|
break;
|
|
123
101
|
}
|
|
124
102
|
keys.add(call.key);
|
|
125
103
|
}
|
|
126
104
|
return keys.size;
|
|
127
105
|
}
|
|
128
|
-
export function applySplice(history, splice) {
|
|
129
|
-
if (!splice) {
|
|
130
|
-
return history;
|
|
131
|
-
}
|
|
132
|
-
if (splice.at === history.length && !splice.messages.length) {
|
|
133
|
-
return history;
|
|
134
|
-
}
|
|
135
|
-
return [...history.slice(0, splice.at), ...splice.messages];
|
|
136
|
-
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CompletionHistoryEntry, HistorySplice } from '../../contract/run.ts';
|
|
2
|
+
import type { FailureResultValue } from '../../helpers/failure-result.ts';
|
|
3
|
+
import type { CompletionContext, SettledCall } from './types.ts';
|
|
4
|
+
export interface ApplyHistorySpliceOptions {
|
|
5
|
+
failedCalls?: Readonly<Record<string, SettledCall>>;
|
|
6
|
+
failureResults?: Readonly<Record<string, FailureResultValue>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function applyHistorySplice(context: Readonly<CompletionContext>, splice?: HistorySplice, options?: ApplyHistorySpliceOptions): Pick<CompletionContext, 'history' | 'failureResults'>;
|
|
9
|
+
export declare function applySplice(history: CompletionHistoryEntry[], splice?: HistorySplice): CompletionHistoryEntry[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { retainFailureResults } from './rules.js';
|
|
2
|
+
export function applyHistorySplice(context, splice, options = {}) {
|
|
3
|
+
const failedCalls = options.failedCalls ?? context.failedCalls;
|
|
4
|
+
const failureResults = options.failureResults ?? context.failureResults;
|
|
5
|
+
const history = applySplice(context.history, splice);
|
|
6
|
+
return {
|
|
7
|
+
history,
|
|
8
|
+
failureResults: retainFailureResults(history, failureResults, failedCalls)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function applySplice(history, splice) {
|
|
12
|
+
if (!splice) {
|
|
13
|
+
return history;
|
|
14
|
+
}
|
|
15
|
+
if (splice.at === history.length && !splice.messages.length) {
|
|
16
|
+
return history;
|
|
17
|
+
}
|
|
18
|
+
return [...history.slice(0, splice.at), ...splice.messages];
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CompletionHistoryEntry, GoalStatus, HistorySplice, HookRejection, Operation, PlanStep, ResourceDescriptor, RoundSpeed, RunBackendUse, RunBudget, RunOutcome, ToolActivityEvent, ToolCallDisplay, ToolEffect, ToolExecutionOutcome, ToolSpeed, TrustedSourceFacts } from '../../contract/run.ts';
|
|
1
|
+
import type { CompletionHistoryEntry, GoalStatus, HistorySplice, HookRejection, Operation, PlanStep, ResourceDescriptor, RoundSpeed, RunBackendUse, RunBudget, RunOutcome, ToolActivityEvent, ToolCallDisplay, ToolEffect, ToolExecutionOutcome, ToolSpeed, TrustedSourceFacts, TurnContext } from '../../contract/run.ts';
|
|
2
2
|
import type { EngineError } from '../../helpers/engine-error.ts';
|
|
3
3
|
import type { FailureResultValue } from '../../helpers/failure-result.ts';
|
|
4
4
|
export interface CompletionStats {
|
|
@@ -8,6 +8,8 @@ export interface CompletionStats {
|
|
|
8
8
|
tokensPerSecond?: number | undefined;
|
|
9
9
|
promptTokens?: number | undefined;
|
|
10
10
|
cacheTokens?: number | undefined;
|
|
11
|
+
avgConcurrentSeq?: number | undefined;
|
|
12
|
+
contextBoundary?: boolean | undefined;
|
|
11
13
|
}
|
|
12
14
|
export interface EngineEvent {
|
|
13
15
|
type: string;
|
|
@@ -20,11 +22,15 @@ export interface EngineEvent {
|
|
|
20
22
|
replacedTypes?: ('content' | 'thinking')[];
|
|
21
23
|
status?: GoalStatus;
|
|
22
24
|
turn?: number;
|
|
25
|
+
checks?: string[];
|
|
26
|
+
proof?: string;
|
|
27
|
+
cases?: true;
|
|
28
|
+
context?: TurnContext;
|
|
23
29
|
}
|
|
24
30
|
export interface EngineFacts extends Record<string, unknown> {
|
|
25
31
|
runBudget: RunBudget;
|
|
26
32
|
}
|
|
27
|
-
|
|
33
|
+
interface CompletionMetrics {
|
|
28
34
|
ttft?: number;
|
|
29
35
|
tokens: number;
|
|
30
36
|
timedTokens: number;
|
|
@@ -51,7 +57,7 @@ export interface ApprovalCall {
|
|
|
51
57
|
display?: ToolCallDisplay | null;
|
|
52
58
|
quote?: string | null;
|
|
53
59
|
}
|
|
54
|
-
|
|
60
|
+
interface RoundToolCall {
|
|
55
61
|
id: string;
|
|
56
62
|
name: string;
|
|
57
63
|
arguments: Record<string, unknown>;
|
|
@@ -72,11 +78,15 @@ export interface RoundDonePayload {
|
|
|
72
78
|
stopReason?: string;
|
|
73
79
|
durationMs: number;
|
|
74
80
|
ctxSize?: number | undefined;
|
|
81
|
+
overflows?: number | undefined;
|
|
82
|
+
reasoningDeltas?: number | undefined;
|
|
75
83
|
replay: string | null;
|
|
76
84
|
response?: string;
|
|
77
85
|
history?: HistorySplice;
|
|
78
86
|
cacheable?: boolean;
|
|
87
|
+
keyed?: boolean;
|
|
79
88
|
fallbackResponse?: string;
|
|
89
|
+
cut?: string;
|
|
80
90
|
}
|
|
81
91
|
export interface ResolvedCallSnapshot {
|
|
82
92
|
key: string;
|
|
@@ -89,6 +99,7 @@ export interface ResolvedCallSnapshot {
|
|
|
89
99
|
permission?: 'allow' | 'ask';
|
|
90
100
|
concurrent?: true;
|
|
91
101
|
leavesPlan?: true;
|
|
102
|
+
cutOff?: true;
|
|
92
103
|
}
|
|
93
104
|
export interface ToolExecutionSnapshot {
|
|
94
105
|
kind: 'direct' | 'tool';
|
|
@@ -120,6 +131,10 @@ export interface ApprovalGate {
|
|
|
120
131
|
approver: boolean;
|
|
121
132
|
call: ApprovalCall;
|
|
122
133
|
}
|
|
134
|
+
export interface ShownImage {
|
|
135
|
+
path: string;
|
|
136
|
+
fileName: string;
|
|
137
|
+
}
|
|
123
138
|
export interface ToolDonePayload {
|
|
124
139
|
deniedKey?: string;
|
|
125
140
|
webSearch?: boolean;
|
|
@@ -134,13 +149,28 @@ export interface ToolDonePayload {
|
|
|
134
149
|
};
|
|
135
150
|
progressed?: boolean;
|
|
136
151
|
blockedRepeat?: boolean;
|
|
152
|
+
unchanged?: boolean;
|
|
153
|
+
settled?: {
|
|
154
|
+
key: string;
|
|
155
|
+
digest: string;
|
|
156
|
+
};
|
|
157
|
+
stableRead?: true;
|
|
137
158
|
endedRun?: boolean;
|
|
138
159
|
answer?: string;
|
|
139
160
|
delivered?: boolean;
|
|
161
|
+
deliveryEndsRun?: boolean;
|
|
162
|
+
shown?: ShownImage[];
|
|
140
163
|
durationMs?: number;
|
|
141
164
|
activate?: string;
|
|
142
165
|
plan?: PlanStep[];
|
|
143
166
|
leftPlanMode?: boolean;
|
|
167
|
+
checked?: GoalCheck[];
|
|
168
|
+
proved?: GoalCheck;
|
|
169
|
+
wrote?: {
|
|
170
|
+
path: string;
|
|
171
|
+
proving?: boolean;
|
|
172
|
+
}[];
|
|
173
|
+
ran?: string;
|
|
144
174
|
}
|
|
145
175
|
export interface BatchDonePayload {
|
|
146
176
|
history?: HistorySplice;
|
|
@@ -150,7 +180,7 @@ export interface SettledCall {
|
|
|
150
180
|
resultRef: string;
|
|
151
181
|
outcome: ToolExecutionOutcome;
|
|
152
182
|
}
|
|
153
|
-
|
|
183
|
+
type RejectedToolResult = {
|
|
154
184
|
result: unknown;
|
|
155
185
|
resultRef?: never;
|
|
156
186
|
} | {
|
|
@@ -169,16 +199,6 @@ export type ToolRejectedPayload = RejectedToolResult & {
|
|
|
169
199
|
source: 'skill' | 'tool-result';
|
|
170
200
|
repeat?: ToolExecutionOutcome;
|
|
171
201
|
};
|
|
172
|
-
export type ToolPolicyRejection = 'skill-already-loaded' | 'skill-unready' | 'skill-unavailable' | 'search-cap' | 'hook-rejected' | 'unknown-tool' | 'validation' | 'outbound-refusal' | 'already-denied' | 'denied-without-approver';
|
|
173
|
-
export type DirectToolRejectedPayload = ToolRejectedPayload & {
|
|
174
|
-
execution: ToolExecutionSnapshot;
|
|
175
|
-
preparation: PreparingPayload;
|
|
176
|
-
};
|
|
177
|
-
export interface ToolStartedPayload {
|
|
178
|
-
call: ResolvedCallSnapshot;
|
|
179
|
-
execution: ToolExecutionSnapshot;
|
|
180
|
-
preparation: PreparingPayload;
|
|
181
|
-
}
|
|
182
202
|
export interface PreparingPayload {
|
|
183
203
|
history?: HistorySplice;
|
|
184
204
|
activated?: string[];
|
|
@@ -187,6 +207,7 @@ export interface PreparingPayload {
|
|
|
187
207
|
sources?: TrustedSourceFacts[];
|
|
188
208
|
availableTools?: string[];
|
|
189
209
|
promptPrefix?: string;
|
|
210
|
+
checkable?: boolean;
|
|
190
211
|
}
|
|
191
212
|
export interface PrepareStepProposal {
|
|
192
213
|
id: string;
|
|
@@ -223,6 +244,7 @@ export interface AnsweredPayload {
|
|
|
223
244
|
durationMs?: number;
|
|
224
245
|
narrated?: string;
|
|
225
246
|
malformed?: boolean;
|
|
247
|
+
cutOff?: true;
|
|
226
248
|
}
|
|
227
249
|
export interface ToolsResolvedPayload {
|
|
228
250
|
calls: ResolvedCallSnapshot[];
|
|
@@ -232,24 +254,58 @@ export interface RunPolicy {
|
|
|
232
254
|
maxToolRounds: number;
|
|
233
255
|
continuationNudge: string;
|
|
234
256
|
deliveredNudge: string;
|
|
257
|
+
wrapUpNudge?: string;
|
|
235
258
|
deniedMessage: string;
|
|
236
259
|
cutOffMessage: string;
|
|
260
|
+
contextBoundaryMessage: string;
|
|
261
|
+
roundCutMessage: string;
|
|
262
|
+
repeatedCallMessage: string;
|
|
263
|
+
repeatedFailureMessage: string;
|
|
264
|
+
unchangedMessage: string;
|
|
265
|
+
failingMessage?: string;
|
|
237
266
|
goalNudge: string;
|
|
267
|
+
goalStalledNudge: string;
|
|
268
|
+
}
|
|
269
|
+
export interface SettledResult {
|
|
270
|
+
name?: string;
|
|
271
|
+
digest: string;
|
|
272
|
+
repeats: number;
|
|
273
|
+
round: number;
|
|
274
|
+
folded?: true;
|
|
275
|
+
}
|
|
276
|
+
export interface GoalCheck {
|
|
277
|
+
name: string;
|
|
278
|
+
passed: boolean;
|
|
279
|
+
output: string | null;
|
|
238
280
|
}
|
|
239
281
|
export interface GoalState {
|
|
240
282
|
objective: string;
|
|
241
283
|
tokens: number | null;
|
|
242
284
|
turns: number;
|
|
243
285
|
status: GoalStatus;
|
|
286
|
+
checks: GoalCheck[];
|
|
287
|
+
checkable?: boolean;
|
|
288
|
+
named?: boolean;
|
|
289
|
+
stalled?: true;
|
|
290
|
+
review?: 'due' | 'asked' | 'done';
|
|
291
|
+
deliverable?: string[];
|
|
292
|
+
proving?: string[];
|
|
293
|
+
edited?: string[];
|
|
294
|
+
proof?: string;
|
|
295
|
+
reviewAsks?: number;
|
|
296
|
+
cases?: true;
|
|
244
297
|
}
|
|
245
298
|
export interface QueuedInput {
|
|
246
299
|
id?: string;
|
|
247
300
|
text: string;
|
|
301
|
+
context?: TurnContext;
|
|
302
|
+
content?: string;
|
|
248
303
|
}
|
|
249
304
|
export interface CompletionContext {
|
|
250
305
|
runId: string;
|
|
251
306
|
policy: RunPolicy;
|
|
252
307
|
timeUp: boolean;
|
|
308
|
+
halfTime?: true;
|
|
253
309
|
pauseCount: number;
|
|
254
310
|
durable: EngineFacts | null;
|
|
255
311
|
recovery: Operation | undefined;
|
|
@@ -262,6 +318,7 @@ export interface CompletionContext {
|
|
|
262
318
|
round: number;
|
|
263
319
|
roundsSent: number;
|
|
264
320
|
mute: number;
|
|
321
|
+
cuts: number;
|
|
265
322
|
narrated: boolean;
|
|
266
323
|
malformed: boolean;
|
|
267
324
|
webSearches: number;
|
|
@@ -271,10 +328,15 @@ export interface CompletionContext {
|
|
|
271
328
|
deniedKeys: string[];
|
|
272
329
|
failedCalls: Record<string, SettledCall>;
|
|
273
330
|
blockedRepeats: number;
|
|
331
|
+
settledResults: Record<string, SettledResult>;
|
|
332
|
+
failureStreaks?: Record<string, number>;
|
|
333
|
+
answeredReads?: string[];
|
|
274
334
|
roundProgressed: boolean;
|
|
275
335
|
answer: string | null;
|
|
276
336
|
delivered: boolean;
|
|
277
337
|
deliveredThisRound: boolean;
|
|
338
|
+
deliveryEndsRun: boolean;
|
|
339
|
+
shownThisRound?: ShownImage[];
|
|
278
340
|
activated: string[];
|
|
279
341
|
outcome: RunOutcome | 'failed' | null;
|
|
280
342
|
metrics: CompletionMetrics;
|
|
@@ -299,6 +361,7 @@ export interface CompletionContext {
|
|
|
299
361
|
failMessage: string | null;
|
|
300
362
|
steering: QueuedInput[];
|
|
301
363
|
followUps: QueuedInput[];
|
|
364
|
+
edgeInputs: QueuedInput[];
|
|
302
365
|
plan: PlanStep[];
|
|
303
366
|
planMode: boolean;
|
|
304
367
|
goal: GoalState | null;
|
|
@@ -333,6 +396,7 @@ export interface ToolRejection {
|
|
|
333
396
|
emitCall?: boolean;
|
|
334
397
|
emitResult?: boolean;
|
|
335
398
|
capped?: boolean;
|
|
399
|
+
repeat?: ToolExecutionOutcome;
|
|
336
400
|
}
|
|
337
401
|
export interface SearchingOutput {
|
|
338
402
|
directTool: DirectToolOutput | null;
|
|
@@ -413,4 +477,7 @@ export type CompletionMachineEvent = {
|
|
|
413
477
|
mode: 'steer' | 'follow-up';
|
|
414
478
|
id?: string;
|
|
415
479
|
text: string;
|
|
480
|
+
context?: TurnContext;
|
|
481
|
+
content?: string;
|
|
416
482
|
};
|
|
483
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { goalStatus } from './completion/actions/goal.ts';
|
|
1
2
|
import { emptyCompletionContext } from './completion/context.ts';
|
|
2
|
-
import { runsUnasked } from './completion/rules.ts';
|
|
3
|
+
import { atContextBoundary, cutOffMessage, cutShort, runsUnasked } from './completion/rules.ts';
|
|
4
|
+
import { repeatsBlocked } from './completion/guards/retry.ts';
|
|
3
5
|
import { completionMachineDefinition, transitionName } from './definition.ts';
|
|
4
6
|
export declare class CompletionMachine {
|
|
5
7
|
static VERSION: number;
|
|
@@ -38,6 +40,8 @@ export declare class CompletionMachine {
|
|
|
38
40
|
mode: 'steer' | 'follow-up';
|
|
39
41
|
id?: string;
|
|
40
42
|
text: string;
|
|
43
|
+
context?: import("../contract/run.ts").TurnContext;
|
|
44
|
+
content?: string;
|
|
41
45
|
}, {
|
|
42
46
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").AnsweredPayload, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").BatchDonePayload, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").InspectingOutput, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").PrepareInspectionOutput, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").PreparingOutput, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").RetrievingOutput, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").RoundDonePayload, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").SearchingOutput, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<import("./completion/types.ts").ToolDonePayload, import("./index.ts").InvocationInput> | import("xstate").PromiseActorLogic<{
|
|
43
47
|
approved: boolean;
|
|
@@ -117,7 +121,7 @@ export declare class CompletionMachine {
|
|
|
117
121
|
}, import("./index.ts").InvocationInput>;
|
|
118
122
|
id: string | undefined;
|
|
119
123
|
}, {
|
|
120
|
-
type: "
|
|
124
|
+
type: "ackFollowUps";
|
|
121
125
|
params: undefined;
|
|
122
126
|
} | {
|
|
123
127
|
type: "ackSteering";
|
|
@@ -137,11 +141,14 @@ export declare class CompletionMachine {
|
|
|
137
141
|
} | {
|
|
138
142
|
type: "continueGoal";
|
|
139
143
|
params: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
type: "continueStalledGoal";
|
|
146
|
+
params: undefined;
|
|
140
147
|
} | {
|
|
141
148
|
type: "continueStop";
|
|
142
149
|
params: import("./completion/types.ts").AnsweredPayload;
|
|
143
150
|
} | {
|
|
144
|
-
type: "
|
|
151
|
+
type: "continueWithFollowUps";
|
|
145
152
|
params: undefined;
|
|
146
153
|
} | {
|
|
147
154
|
type: "endRunOnTool";
|
|
@@ -171,6 +178,12 @@ export declare class CompletionMachine {
|
|
|
171
178
|
} | {
|
|
172
179
|
type: "finishWrapRound";
|
|
173
180
|
params: import("./completion/types.ts").RoundDonePayload;
|
|
181
|
+
} | {
|
|
182
|
+
type: "markGoalStalled";
|
|
183
|
+
params: undefined;
|
|
184
|
+
} | {
|
|
185
|
+
type: "markHalfTime";
|
|
186
|
+
params: undefined;
|
|
174
187
|
} | {
|
|
175
188
|
type: "markTimeUp";
|
|
176
189
|
params: undefined;
|
|
@@ -197,19 +210,22 @@ export declare class CompletionMachine {
|
|
|
197
210
|
params: import("./completion/types.ts").RejectDeniedApprovalParams;
|
|
198
211
|
} | {
|
|
199
212
|
type: "rejectPlanModeWrite";
|
|
200
|
-
params: import("./completion/actions/
|
|
213
|
+
params: import("./completion/actions/reject-tool.ts").RejectPlanModeWriteParams;
|
|
201
214
|
} | {
|
|
202
215
|
type: "rejectRepeatedTool";
|
|
203
216
|
params: import("./completion/types.ts").RepeatOfFailedCallParams;
|
|
204
217
|
} | {
|
|
205
218
|
type: "rejectTool";
|
|
206
|
-
params: import("./completion/actions/
|
|
219
|
+
params: import("./completion/actions/reject-tool.ts").RejectToolParams;
|
|
207
220
|
} | {
|
|
208
221
|
type: "requestApproval";
|
|
209
222
|
params: import("./completion/types.ts").ApprovalCall;
|
|
210
223
|
} | {
|
|
211
224
|
type: "requestPrepare";
|
|
212
225
|
params: import("./completion/actions/prepare.ts").RequestPrepareParams;
|
|
226
|
+
} | {
|
|
227
|
+
type: "resetCutRound";
|
|
228
|
+
params: import("./completion/types.ts").ToolsResolvedPayload & import("./completion/types.ts").AnsweredPayload;
|
|
213
229
|
} | {
|
|
214
230
|
type: "resolveTools";
|
|
215
231
|
params: import("./completion/types.ts").ToolsResolvedPayload;
|
|
@@ -219,12 +235,15 @@ export declare class CompletionMachine {
|
|
|
219
235
|
} | {
|
|
220
236
|
type: "retryCappedSearch";
|
|
221
237
|
params: undefined;
|
|
238
|
+
} | {
|
|
239
|
+
type: "retryCutRound";
|
|
240
|
+
params: undefined;
|
|
222
241
|
} | {
|
|
223
242
|
type: "retryMalformedRound";
|
|
224
243
|
params: import("./completion/types.ts").AnsweredPayload;
|
|
225
244
|
} | {
|
|
226
245
|
type: "retryMuteRound";
|
|
227
|
-
params:
|
|
246
|
+
params: import("./completion/types.ts").AnsweredPayload;
|
|
228
247
|
} | {
|
|
229
248
|
type: "retryNarratedRound";
|
|
230
249
|
params: import("./completion/types.ts").AnsweredPayload;
|
|
@@ -257,6 +276,9 @@ export declare class CompletionMachine {
|
|
|
257
276
|
} | {
|
|
258
277
|
type: "wrapCompletion";
|
|
259
278
|
params: import("../contract/run.ts").RunOutcome;
|
|
279
|
+
} | {
|
|
280
|
+
type: "wrapCutCompletion";
|
|
281
|
+
params: undefined;
|
|
260
282
|
} | {
|
|
261
283
|
type: "wrapDeliveredCompletion";
|
|
262
284
|
params: undefined;
|
|
@@ -265,7 +287,7 @@ export declare class CompletionMachine {
|
|
|
265
287
|
params: undefined;
|
|
266
288
|
} | {
|
|
267
289
|
type: "wrapMuteCompletion";
|
|
268
|
-
params:
|
|
290
|
+
params: import("./completion/types.ts").AnsweredPayload;
|
|
269
291
|
} | {
|
|
270
292
|
type: "wrapSearchCappedCompletion";
|
|
271
293
|
params: undefined;
|
|
@@ -281,6 +303,9 @@ export declare class CompletionMachine {
|
|
|
281
303
|
} | {
|
|
282
304
|
type: "canMuteRetry";
|
|
283
305
|
params: unknown;
|
|
306
|
+
} | {
|
|
307
|
+
type: "canRetryCut";
|
|
308
|
+
params: unknown;
|
|
284
309
|
} | {
|
|
285
310
|
type: "canRetrySearchCap";
|
|
286
311
|
params: unknown;
|
|
@@ -323,6 +348,9 @@ export declare class CompletionMachine {
|
|
|
323
348
|
} | {
|
|
324
349
|
type: "failedOutcome";
|
|
325
350
|
params: unknown;
|
|
351
|
+
} | {
|
|
352
|
+
type: "goalStalled";
|
|
353
|
+
params: unknown;
|
|
326
354
|
} | {
|
|
327
355
|
type: "goalTokensLeft";
|
|
328
356
|
params: unknown;
|
|
@@ -333,7 +361,7 @@ export declare class CompletionMachine {
|
|
|
333
361
|
type: "hasAnswer";
|
|
334
362
|
params: unknown;
|
|
335
363
|
} | {
|
|
336
|
-
type: "
|
|
364
|
+
type: "hasFollowUp";
|
|
337
365
|
params: unknown;
|
|
338
366
|
} | {
|
|
339
367
|
type: "hasQueuedTool";
|
|
@@ -341,6 +369,9 @@ export declare class CompletionMachine {
|
|
|
341
369
|
} | {
|
|
342
370
|
type: "hasRoundsLeft";
|
|
343
371
|
params: unknown;
|
|
372
|
+
} | {
|
|
373
|
+
type: "headCutOff";
|
|
374
|
+
params: unknown;
|
|
344
375
|
} | {
|
|
345
376
|
type: "interrupted";
|
|
346
377
|
params: unknown;
|
|
@@ -378,7 +409,7 @@ export declare class CompletionMachine {
|
|
|
378
409
|
type: "repeatsBlocked";
|
|
379
410
|
params: unknown;
|
|
380
411
|
} | {
|
|
381
|
-
type: "
|
|
412
|
+
type: "roundCut";
|
|
382
413
|
params: unknown;
|
|
383
414
|
} | {
|
|
384
415
|
type: "roundHasToolCalls";
|
|
@@ -404,7 +435,7 @@ export declare class CompletionMachine {
|
|
|
404
435
|
} | {
|
|
405
436
|
type: "toolRejected";
|
|
406
437
|
params: unknown;
|
|
407
|
-
}, "deadline", "done" | "failed" | "paused" | "pausing" | "resuming" | {
|
|
438
|
+
}, "deadline" | "halfTime", "done" | "failed" | "paused" | "pausing" | "resuming" | {
|
|
408
439
|
active: "answering" | "finishing" | "generating" | "idle" | "prepareChecking" | "prepareRunning" | "preparing" | "resolving" | "retrieving" | "round" | "searching" | "wrapping" | {
|
|
409
440
|
tools: "approving" | "batching" | "executing" | "inspecting" | "rejecting" | "selecting";
|
|
410
441
|
};
|
|
@@ -454,10 +485,18 @@ export declare class CompletionMachine {
|
|
|
454
485
|
}, import("xstate").MetaObject>;
|
|
455
486
|
static definition: typeof completionMachineDefinition;
|
|
456
487
|
static emptyContext: typeof emptyCompletionContext;
|
|
488
|
+
static goalStatus: typeof goalStatus;
|
|
457
489
|
static transitionName: typeof transitionName;
|
|
458
490
|
static runsUnasked: typeof runsUnasked;
|
|
491
|
+
static cutOffMessage: typeof cutOffMessage;
|
|
492
|
+
static cutShort: typeof cutShort;
|
|
493
|
+
static atContextBoundary: typeof atContextBoundary;
|
|
494
|
+
static repeatsBlocked: typeof repeatsBlocked;
|
|
495
|
+
static MAX_ROUND_CALLS: number;
|
|
496
|
+
static MAX_SHOWN_IMAGES: number;
|
|
497
|
+
static MAX_ROUND_REPEATS: number;
|
|
459
498
|
}
|
|
460
499
|
export type { MachineDefinitionNode } from './definition.ts';
|
|
461
500
|
export type { EmptyCompletionContextOptions } from './completion/context.ts';
|
|
462
501
|
export type { CompletionActorLogic, CompletionParent, InvocationInput, Stage } from './completion/ports.ts';
|
|
463
|
-
export type { CompletionContext, RunPolicy, CompletionActorOutput, CompletionActorOutputs, EngineEvent } from './completion/types.ts';
|
|
502
|
+
export type { CompletionContext, RunPolicy, CompletionActorOutput, CompletionActorOutputs, EngineEvent, ShownImage } from './completion/types.ts';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { goalStatus } from './completion/actions/goal.js';
|
|
2
|
+
import { PLAN_MODE_REFUSAL } from './completion/actions/reject-tool.js';
|
|
2
3
|
import { emptyCompletionContext } from './completion/context.js';
|
|
3
4
|
import { createCompletionMachine } from './completion/machine.js';
|
|
4
|
-
import { runsUnasked } from './completion/rules.js';
|
|
5
|
+
import { atContextBoundary, cutOffMessage, cutShort, MAX_ROUND_CALLS, MAX_ROUND_REPEATS, MAX_SHOWN_IMAGES, runsUnasked } from './completion/rules.js';
|
|
6
|
+
import { repeatsBlocked } from './completion/guards/retry.js';
|
|
5
7
|
import { MACHINE_VERSION } from './completion/version.js';
|
|
6
8
|
import { completionMachineDefinition, transitionName } from './definition.js';
|
|
7
9
|
export class CompletionMachine {
|
|
@@ -10,6 +12,14 @@ export class CompletionMachine {
|
|
|
10
12
|
static create = createCompletionMachine;
|
|
11
13
|
static definition = completionMachineDefinition;
|
|
12
14
|
static emptyContext = emptyCompletionContext;
|
|
15
|
+
static goalStatus = goalStatus;
|
|
13
16
|
static transitionName = transitionName;
|
|
14
17
|
static runsUnasked = runsUnasked;
|
|
18
|
+
static cutOffMessage = cutOffMessage;
|
|
19
|
+
static cutShort = cutShort;
|
|
20
|
+
static atContextBoundary = atContextBoundary;
|
|
21
|
+
static repeatsBlocked = repeatsBlocked;
|
|
22
|
+
static MAX_ROUND_CALLS = MAX_ROUND_CALLS;
|
|
23
|
+
static MAX_SHOWN_IMAGES = MAX_SHOWN_IMAGES;
|
|
24
|
+
static MAX_ROUND_REPEATS = MAX_ROUND_REPEATS;
|
|
15
25
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MediaRoundPort } from './contract/index.ts';
|
|
2
|
+
export declare class MediaHost {
|
|
3
|
+
private readonly _port;
|
|
4
|
+
private readonly _out;
|
|
5
|
+
private readonly _rounds;
|
|
6
|
+
constructor(port: MediaRoundPort, send: (frame: object) => void);
|
|
7
|
+
ask(callId: string, payload: unknown): void;
|
|
8
|
+
cancel(callId: string): void;
|
|
9
|
+
close(): void;
|
|
10
|
+
private _settle;
|
|
11
|
+
private _drain;
|
|
12
|
+
}
|