@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
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { QvacErrorBase } from '@qvac/error';
|
|
2
|
+
declare const HARNESS_ERRORS: {
|
|
3
|
+
readonly ABORTED: {
|
|
4
|
+
readonly code: 102001;
|
|
5
|
+
readonly message: () => string;
|
|
6
|
+
};
|
|
7
|
+
readonly HARNESS_CLOSING: {
|
|
8
|
+
readonly code: 102002;
|
|
9
|
+
readonly message: () => string;
|
|
10
|
+
};
|
|
11
|
+
readonly HARNESS_SUSPENDED: {
|
|
12
|
+
readonly code: 102003;
|
|
13
|
+
readonly message: () => string;
|
|
14
|
+
};
|
|
15
|
+
readonly HARNESS_EXITED_BEFORE_READY: {
|
|
16
|
+
readonly code: 102004;
|
|
17
|
+
readonly message: (exitCode: number | null) => string;
|
|
18
|
+
};
|
|
19
|
+
readonly CAPABILITY_UNSUPPORTED: {
|
|
20
|
+
readonly code: 102005;
|
|
21
|
+
readonly message: (what: string) => string;
|
|
22
|
+
};
|
|
23
|
+
readonly UNKNOWN_CAPABILITY: {
|
|
24
|
+
readonly code: 102006;
|
|
25
|
+
readonly message: (capability: string) => string;
|
|
26
|
+
};
|
|
27
|
+
readonly CLIENT_GONE: {
|
|
28
|
+
readonly code: 102007;
|
|
29
|
+
readonly message: () => string;
|
|
30
|
+
};
|
|
31
|
+
readonly RPC_STREAM_DESTROYED: {
|
|
32
|
+
readonly code: 102008;
|
|
33
|
+
readonly message: () => string;
|
|
34
|
+
};
|
|
35
|
+
readonly EMBED_ABORTED: {
|
|
36
|
+
readonly code: 102009;
|
|
37
|
+
readonly message: () => string;
|
|
38
|
+
};
|
|
39
|
+
readonly NO_SKILLS_OVERLAY: {
|
|
40
|
+
readonly code: 102010;
|
|
41
|
+
readonly message: () => string;
|
|
42
|
+
};
|
|
43
|
+
readonly CHAT_MODEL_BUSY: {
|
|
44
|
+
readonly code: 102101;
|
|
45
|
+
readonly message: (output: string) => string;
|
|
46
|
+
};
|
|
47
|
+
readonly MODEL_NOT_RESIDENT: {
|
|
48
|
+
readonly code: 102102;
|
|
49
|
+
readonly message: (model: string) => string;
|
|
50
|
+
};
|
|
51
|
+
readonly AUDIOGEN_MODEL_NOT_FOUND: {
|
|
52
|
+
readonly code: 102103;
|
|
53
|
+
readonly message: (model: string) => string;
|
|
54
|
+
};
|
|
55
|
+
readonly MODEL_NOT_IN_REGISTRY: {
|
|
56
|
+
readonly code: 102104;
|
|
57
|
+
readonly message: (model: string, addon: string) => string;
|
|
58
|
+
};
|
|
59
|
+
readonly MODEL_LOAD_CLOCK_SKEW: {
|
|
60
|
+
readonly code: 102105;
|
|
61
|
+
readonly message: (model: string) => string;
|
|
62
|
+
};
|
|
63
|
+
readonly IMAGE_LOAD_STALLED: {
|
|
64
|
+
readonly code: 102106;
|
|
65
|
+
readonly message: () => string;
|
|
66
|
+
};
|
|
67
|
+
readonly TRANSLATION_LOAD_STALLED: {
|
|
68
|
+
readonly code: 102107;
|
|
69
|
+
readonly message: () => string;
|
|
70
|
+
};
|
|
71
|
+
readonly MEDIA_MODEL_MISSING: {
|
|
72
|
+
readonly code: 102108;
|
|
73
|
+
readonly message: (kind: string, model: string) => string;
|
|
74
|
+
};
|
|
75
|
+
readonly CONTEXT_WINDOW_EXCEEDED: {
|
|
76
|
+
readonly code: 102201;
|
|
77
|
+
readonly message: () => string;
|
|
78
|
+
};
|
|
79
|
+
readonly TTS_NO_AUDIO: {
|
|
80
|
+
readonly code: 102202;
|
|
81
|
+
readonly message: () => string;
|
|
82
|
+
};
|
|
83
|
+
readonly TTS_INCOMPLETE: {
|
|
84
|
+
readonly code: 102203;
|
|
85
|
+
readonly message: () => string;
|
|
86
|
+
};
|
|
87
|
+
readonly FETCH_TIMED_OUT: {
|
|
88
|
+
readonly code: 102301;
|
|
89
|
+
readonly message: (ms: number) => string;
|
|
90
|
+
};
|
|
91
|
+
readonly FETCH_CANCELLED: {
|
|
92
|
+
readonly code: 102302;
|
|
93
|
+
readonly message: () => string;
|
|
94
|
+
};
|
|
95
|
+
readonly RESPONSE_NOT_JSON: {
|
|
96
|
+
readonly code: 102303;
|
|
97
|
+
readonly message: (chars: number, detail: string) => string;
|
|
98
|
+
};
|
|
99
|
+
readonly HTTP_STATUS: {
|
|
100
|
+
readonly code: 102304;
|
|
101
|
+
readonly message: (status: number) => string;
|
|
102
|
+
};
|
|
103
|
+
readonly SEARCH_CAPTCHA: {
|
|
104
|
+
readonly code: 102305;
|
|
105
|
+
readonly message: (engine: string) => string;
|
|
106
|
+
};
|
|
107
|
+
readonly RESPONSE_TOO_LARGE: {
|
|
108
|
+
readonly code: 102306;
|
|
109
|
+
readonly message: (maxBytes: number) => string;
|
|
110
|
+
};
|
|
111
|
+
readonly UNSUPPORTED_HTTP_METHOD: {
|
|
112
|
+
readonly code: 102307;
|
|
113
|
+
readonly message: (method: string) => string;
|
|
114
|
+
};
|
|
115
|
+
readonly GEOCODER_HTTP_STATUS: {
|
|
116
|
+
readonly code: 102308;
|
|
117
|
+
readonly message: (status: number) => string;
|
|
118
|
+
};
|
|
119
|
+
readonly EGRESS_BLOCKED: {
|
|
120
|
+
readonly code: 102309;
|
|
121
|
+
readonly message: (reason: string) => string;
|
|
122
|
+
};
|
|
123
|
+
readonly OFFICE_UNSUPPORTED_DOCUMENT: {
|
|
124
|
+
readonly code: 102401;
|
|
125
|
+
readonly message: (fileName: string) => string;
|
|
126
|
+
};
|
|
127
|
+
readonly OFFICE_TOO_LARGE: {
|
|
128
|
+
readonly code: 102402;
|
|
129
|
+
readonly message: (bytes: number, limit: number) => string;
|
|
130
|
+
};
|
|
131
|
+
readonly OFFICE_EXTRACTION_ABORTED: {
|
|
132
|
+
readonly code: 102403;
|
|
133
|
+
readonly message: (fileName: string) => string;
|
|
134
|
+
};
|
|
135
|
+
readonly OFFICE_EXTRACTION_FAILED: {
|
|
136
|
+
readonly code: 102404;
|
|
137
|
+
readonly message: (fileName: string, detail: string) => string;
|
|
138
|
+
};
|
|
139
|
+
readonly OFFICE_OP_UNAVAILABLE: {
|
|
140
|
+
readonly code: 102405;
|
|
141
|
+
readonly message: (op: string) => string;
|
|
142
|
+
};
|
|
143
|
+
readonly COMMAND_TIMED_OUT: {
|
|
144
|
+
readonly code: 102501;
|
|
145
|
+
readonly message: (ms: number) => string;
|
|
146
|
+
};
|
|
147
|
+
readonly PACKAGE_INSTALL_TIMED_OUT: {
|
|
148
|
+
readonly code: 102502;
|
|
149
|
+
readonly message: (ms: number) => string;
|
|
150
|
+
};
|
|
151
|
+
readonly PYTHON_WORKER_FAILED: {
|
|
152
|
+
readonly code: 102503;
|
|
153
|
+
readonly message: (detail: string) => string;
|
|
154
|
+
};
|
|
155
|
+
readonly PYTHON_WORKER_EXITED: {
|
|
156
|
+
readonly code: 102504;
|
|
157
|
+
readonly message: (exitCode: number) => string;
|
|
158
|
+
};
|
|
159
|
+
readonly ATTACHMENT_STAGING_TIMED_OUT: {
|
|
160
|
+
readonly code: 102505;
|
|
161
|
+
readonly message: (ms: number) => string;
|
|
162
|
+
};
|
|
163
|
+
readonly FETCH_REFUSED: {
|
|
164
|
+
readonly code: 102506;
|
|
165
|
+
readonly message: (reason: string) => string;
|
|
166
|
+
};
|
|
167
|
+
readonly OBSIDIAN_NOTE_NAME_IS_PATH: {
|
|
168
|
+
readonly code: 102601;
|
|
169
|
+
readonly message: () => string;
|
|
170
|
+
};
|
|
171
|
+
readonly OBSIDIAN_NOTE_NOT_FOUND: {
|
|
172
|
+
readonly code: 102602;
|
|
173
|
+
readonly message: (args: readonly string[]) => string;
|
|
174
|
+
};
|
|
175
|
+
readonly OBSIDIAN_MISSING_ARGUMENT: {
|
|
176
|
+
readonly code: 102603;
|
|
177
|
+
readonly message: (names: string) => string;
|
|
178
|
+
};
|
|
179
|
+
readonly OBSIDIAN_NO_PROPERTIES: {
|
|
180
|
+
readonly code: 102604;
|
|
181
|
+
readonly message: () => string;
|
|
182
|
+
};
|
|
183
|
+
readonly OBSIDIAN_NOTE_EXISTS: {
|
|
184
|
+
readonly code: 102605;
|
|
185
|
+
readonly message: (name: string, folder: string) => string;
|
|
186
|
+
};
|
|
187
|
+
readonly OBSIDIAN_ACTION_UNSUPPORTED: {
|
|
188
|
+
readonly code: 102606;
|
|
189
|
+
readonly message: (action: string) => string;
|
|
190
|
+
};
|
|
191
|
+
readonly OBSIDIAN_NOTE_CHANGED: {
|
|
192
|
+
readonly code: 102607;
|
|
193
|
+
readonly message: (why: string, file: string) => string;
|
|
194
|
+
};
|
|
195
|
+
readonly OBSIDIAN_PATH_CROSSES_SYMLINK: {
|
|
196
|
+
readonly code: 102608;
|
|
197
|
+
readonly message: (target: string) => string;
|
|
198
|
+
};
|
|
199
|
+
readonly OBSIDIAN_PATH_ESCAPES_VAULT: {
|
|
200
|
+
readonly code: 102609;
|
|
201
|
+
readonly message: (rel: string) => string;
|
|
202
|
+
};
|
|
203
|
+
readonly OBSIDIAN_DESTINATION_EXISTS: {
|
|
204
|
+
readonly code: 102610;
|
|
205
|
+
readonly message: (filePath: string) => string;
|
|
206
|
+
};
|
|
207
|
+
readonly OBSIDIAN_PATH_IS_FOLDER: {
|
|
208
|
+
readonly code: 102611;
|
|
209
|
+
readonly message: (folder: string) => string;
|
|
210
|
+
};
|
|
211
|
+
readonly SKILL_FILE_NOT_FOUND: {
|
|
212
|
+
readonly code: 102701;
|
|
213
|
+
readonly message: (name: string, file: string) => string;
|
|
214
|
+
};
|
|
215
|
+
readonly INVALID_SKILL_NAME: {
|
|
216
|
+
readonly code: 102702;
|
|
217
|
+
readonly message: (name: string) => string;
|
|
218
|
+
};
|
|
219
|
+
readonly SKILL_NOT_FOUND: {
|
|
220
|
+
readonly code: 102703;
|
|
221
|
+
readonly message: (name: string) => string;
|
|
222
|
+
};
|
|
223
|
+
readonly BUNDLED_SKILLS_INVALID: {
|
|
224
|
+
readonly code: 102704;
|
|
225
|
+
readonly message: (staging: string) => string;
|
|
226
|
+
};
|
|
227
|
+
readonly BUNDLED_SKILLS_TAMPERED: {
|
|
228
|
+
readonly code: 102705;
|
|
229
|
+
readonly message: (dir: string) => string;
|
|
230
|
+
};
|
|
231
|
+
readonly BUNDLED_SKILLS_OCCUPIED: {
|
|
232
|
+
readonly code: 102706;
|
|
233
|
+
readonly message: (dir: string, why: string) => string;
|
|
234
|
+
};
|
|
235
|
+
readonly DRIVE_TIMED_OUT: {
|
|
236
|
+
readonly code: 102707;
|
|
237
|
+
readonly message: (op: string) => string;
|
|
238
|
+
};
|
|
239
|
+
readonly DRIVE_READ_TRUNCATED: {
|
|
240
|
+
readonly code: 102708;
|
|
241
|
+
readonly message: (maxBytes: number, key: string) => string;
|
|
242
|
+
};
|
|
243
|
+
readonly NO_STORAGE_ROOT: {
|
|
244
|
+
readonly code: 102709;
|
|
245
|
+
readonly message: () => string;
|
|
246
|
+
};
|
|
247
|
+
readonly SLM_TRANSLATION_UNAVAILABLE: {
|
|
248
|
+
readonly code: 102710;
|
|
249
|
+
readonly message: () => string;
|
|
250
|
+
};
|
|
251
|
+
readonly PDF_TEXT_UNAVAILABLE: {
|
|
252
|
+
readonly code: 102711;
|
|
253
|
+
readonly message: () => string;
|
|
254
|
+
};
|
|
255
|
+
readonly BUNDLED_SKILLS_HASH_INVALID: {
|
|
256
|
+
readonly code: 102712;
|
|
257
|
+
readonly message: (hash: string) => string;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
type Errors = typeof HARNESS_ERRORS;
|
|
261
|
+
export type HarnessErrorName = keyof Errors;
|
|
262
|
+
type Adds<K extends HarnessErrorName> = Parameters<Errors[K]['message']>;
|
|
263
|
+
interface HarnessErrorOptions {
|
|
264
|
+
readonly cause?: unknown;
|
|
265
|
+
}
|
|
266
|
+
type HarnessErrorArgs<K extends HarnessErrorName> = [
|
|
267
|
+
] extends Adds<K> ? [adds?: Adds<K>, opts?: HarnessErrorOptions] : [adds: Adds<K>, opts?: HarnessErrorOptions];
|
|
268
|
+
export declare class HarnessError<K extends HarnessErrorName = HarnessErrorName> extends QvacErrorBase {
|
|
269
|
+
static readonly CONTEXT_OVERFLOW_MESSAGE: string;
|
|
270
|
+
static readonly IMAGE_LOAD_STALL_ERROR: string;
|
|
271
|
+
static readonly TRANSLATION_LOAD_STALL_ERROR: string;
|
|
272
|
+
static readonly NO_STORAGE_ROOT: string;
|
|
273
|
+
constructor(name: K, ...[adds, opts]: HarnessErrorArgs<K>);
|
|
274
|
+
static code(name: HarnessErrorName): number;
|
|
275
|
+
static codes(): ReadonlyArray<number>;
|
|
276
|
+
static is(err: unknown, name: HarnessErrorName): boolean;
|
|
277
|
+
}
|
|
278
|
+
export {};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { QvacErrorBase, addCodes } from '@qvac/error';
|
|
2
|
+
import { isRecord } from './guards.js';
|
|
3
|
+
const HARNESS_ERRORS = {
|
|
4
|
+
ABORTED: { code: 102001, message: () => 'aborted' },
|
|
5
|
+
HARNESS_CLOSING: { code: 102002, message: () => 'harness is closing' },
|
|
6
|
+
HARNESS_SUSPENDED: { code: 102003, message: () => 'harness is suspended' },
|
|
7
|
+
HARNESS_EXITED_BEFORE_READY: {
|
|
8
|
+
code: 102004,
|
|
9
|
+
message: (exitCode) => `harness exited (${exitCode}) before ready`
|
|
10
|
+
},
|
|
11
|
+
CAPABILITY_UNSUPPORTED: {
|
|
12
|
+
code: 102005,
|
|
13
|
+
message: (what) => `harness does not support ${what}`
|
|
14
|
+
},
|
|
15
|
+
UNKNOWN_CAPABILITY: {
|
|
16
|
+
code: 102006,
|
|
17
|
+
message: (capability) => `unknown capability: ${capability}`
|
|
18
|
+
},
|
|
19
|
+
CLIENT_GONE: { code: 102007, message: () => 'client gone' },
|
|
20
|
+
RPC_STREAM_DESTROYED: { code: 102008, message: () => 'rpc stream destroyed' },
|
|
21
|
+
EMBED_ABORTED: { code: 102009, message: () => 'embed aborted' },
|
|
22
|
+
NO_SKILLS_OVERLAY: { code: 102010, message: () => 'no writable skills overlay is configured' },
|
|
23
|
+
CHAT_MODEL_BUSY: {
|
|
24
|
+
code: 102101,
|
|
25
|
+
message: (output) => `the chat model is busy; try the ${output} again once the current reply finishes`
|
|
26
|
+
},
|
|
27
|
+
MODEL_NOT_RESIDENT: {
|
|
28
|
+
code: 102102,
|
|
29
|
+
message: (model) => `${model} loads for each generation and is not kept in memory`
|
|
30
|
+
},
|
|
31
|
+
AUDIOGEN_MODEL_NOT_FOUND: {
|
|
32
|
+
code: 102103,
|
|
33
|
+
message: (model) => `audiogen model not found: ${model}`
|
|
34
|
+
},
|
|
35
|
+
MODEL_NOT_IN_REGISTRY: {
|
|
36
|
+
code: 102104,
|
|
37
|
+
message: (model, addon) => `model not found in registry: ${model} (addon=${addon})`
|
|
38
|
+
},
|
|
39
|
+
MODEL_LOAD_CLOCK_SKEW: {
|
|
40
|
+
code: 102105,
|
|
41
|
+
message: (model) => `model load abandoned: system clock moved backward mid-load: ${model}`
|
|
42
|
+
},
|
|
43
|
+
IMAGE_LOAD_STALLED: { code: 102106, message: () => 'image model download stalled' },
|
|
44
|
+
TRANSLATION_LOAD_STALLED: {
|
|
45
|
+
code: 102107,
|
|
46
|
+
message: () => 'translation model download stalled'
|
|
47
|
+
},
|
|
48
|
+
MEDIA_MODEL_MISSING: {
|
|
49
|
+
code: 102108,
|
|
50
|
+
message: (kind, model) => `this device does not hold the ${kind} model ${model}`
|
|
51
|
+
},
|
|
52
|
+
CONTEXT_WINDOW_EXCEEDED: {
|
|
53
|
+
code: 102201,
|
|
54
|
+
message: () => 'This message is too large for the model context window.'
|
|
55
|
+
},
|
|
56
|
+
TTS_NO_AUDIO: { code: 102202, message: () => 'Text-to-speech returned no audio.' },
|
|
57
|
+
TTS_INCOMPLETE: { code: 102203, message: () => 'tts synthesis did not complete' },
|
|
58
|
+
FETCH_TIMED_OUT: { code: 102301, message: (ms) => `Request timed out after ${ms}ms` },
|
|
59
|
+
FETCH_CANCELLED: { code: 102302, message: () => 'Request cancelled' },
|
|
60
|
+
RESPONSE_NOT_JSON: {
|
|
61
|
+
code: 102303,
|
|
62
|
+
message: (chars, detail) => `Response was not valid JSON (${chars} chars): ${detail}`
|
|
63
|
+
},
|
|
64
|
+
HTTP_STATUS: { code: 102304, message: (status) => `HTTP ${status}` },
|
|
65
|
+
SEARCH_CAPTCHA: { code: 102305, message: (engine) => `${engine} CAPTCHA detected` },
|
|
66
|
+
RESPONSE_TOO_LARGE: {
|
|
67
|
+
code: 102306,
|
|
68
|
+
message: (maxBytes) => `response exceeded ${maxBytes} bytes`
|
|
69
|
+
},
|
|
70
|
+
UNSUPPORTED_HTTP_METHOD: {
|
|
71
|
+
code: 102307,
|
|
72
|
+
message: (method) => `unsupported HTTP method: ${method}`
|
|
73
|
+
},
|
|
74
|
+
GEOCODER_HTTP_STATUS: {
|
|
75
|
+
code: 102308,
|
|
76
|
+
message: (status) => `geocoder answered HTTP ${status}`
|
|
77
|
+
},
|
|
78
|
+
EGRESS_BLOCKED: { code: 102309, message: (reason) => reason },
|
|
79
|
+
OFFICE_UNSUPPORTED_DOCUMENT: {
|
|
80
|
+
code: 102401,
|
|
81
|
+
message: (fileName) => `Unsupported Office document: ${fileName}`
|
|
82
|
+
},
|
|
83
|
+
OFFICE_TOO_LARGE: {
|
|
84
|
+
code: 102402,
|
|
85
|
+
message: (bytes, limit) => `document is too large to extract: ${bytes} bytes, limit ${limit}`
|
|
86
|
+
},
|
|
87
|
+
OFFICE_EXTRACTION_ABORTED: {
|
|
88
|
+
code: 102403,
|
|
89
|
+
message: (fileName) => `${fileName}: extraction aborted`
|
|
90
|
+
},
|
|
91
|
+
OFFICE_EXTRACTION_FAILED: {
|
|
92
|
+
code: 102404,
|
|
93
|
+
message: (fileName, detail) => `${fileName}: ${detail}`
|
|
94
|
+
},
|
|
95
|
+
OFFICE_OP_UNAVAILABLE: {
|
|
96
|
+
code: 102405,
|
|
97
|
+
message: (op) => `${op} is not available on this file`
|
|
98
|
+
},
|
|
99
|
+
COMMAND_TIMED_OUT: { code: 102501, message: (ms) => `Command timed out after ${ms}ms` },
|
|
100
|
+
PACKAGE_INSTALL_TIMED_OUT: {
|
|
101
|
+
code: 102502,
|
|
102
|
+
message: (ms) => `package install timed out after ${ms}ms`
|
|
103
|
+
},
|
|
104
|
+
PYTHON_WORKER_FAILED: { code: 102503, message: (detail) => `python worker: ${detail}` },
|
|
105
|
+
PYTHON_WORKER_EXITED: {
|
|
106
|
+
code: 102504,
|
|
107
|
+
message: (exitCode) => `python worker exited with code ${exitCode}`
|
|
108
|
+
},
|
|
109
|
+
ATTACHMENT_STAGING_TIMED_OUT: {
|
|
110
|
+
code: 102505,
|
|
111
|
+
message: (ms) => `staging attachments timed out after ${ms}ms`
|
|
112
|
+
},
|
|
113
|
+
FETCH_REFUSED: { code: 102506, message: (reason) => `fetch refused: ${reason}` },
|
|
114
|
+
OBSIDIAN_NOTE_NAME_IS_PATH: {
|
|
115
|
+
code: 102601,
|
|
116
|
+
message: () => 'name= must be a note name, not a path.'
|
|
117
|
+
},
|
|
118
|
+
OBSIDIAN_NOTE_NOT_FOUND: {
|
|
119
|
+
code: 102602,
|
|
120
|
+
message: (args) => `Note not found. Args: ${args.join(', ')}`
|
|
121
|
+
},
|
|
122
|
+
OBSIDIAN_MISSING_ARGUMENT: {
|
|
123
|
+
code: 102603,
|
|
124
|
+
message: (names) => `Missing required argument: ${names}`
|
|
125
|
+
},
|
|
126
|
+
OBSIDIAN_NO_PROPERTIES: { code: 102604, message: () => 'No property key=value pairs provided.' },
|
|
127
|
+
OBSIDIAN_NOTE_EXISTS: {
|
|
128
|
+
code: 102605,
|
|
129
|
+
message: (name, folder) => `Note "${name}" already exists at ${folder}`
|
|
130
|
+
},
|
|
131
|
+
OBSIDIAN_ACTION_UNSUPPORTED: {
|
|
132
|
+
code: 102606,
|
|
133
|
+
message: (action) => `Action "${action}" is not supported in vault file mode. ` +
|
|
134
|
+
`This action requires the Obsidian CLI connected to the running app.`
|
|
135
|
+
},
|
|
136
|
+
OBSIDIAN_NOTE_CHANGED: {
|
|
137
|
+
code: 102607,
|
|
138
|
+
message: (why, file) => `Note changed on disk during update (${why}): ${file}`
|
|
139
|
+
},
|
|
140
|
+
OBSIDIAN_PATH_CROSSES_SYMLINK: {
|
|
141
|
+
code: 102608,
|
|
142
|
+
message: (target) => `Path "${target}" crosses a symlink inside the vault.`
|
|
143
|
+
},
|
|
144
|
+
OBSIDIAN_PATH_ESCAPES_VAULT: {
|
|
145
|
+
code: 102609,
|
|
146
|
+
message: (rel) => `Path "${rel}" escapes the vault root.`
|
|
147
|
+
},
|
|
148
|
+
OBSIDIAN_DESTINATION_EXISTS: {
|
|
149
|
+
code: 102610,
|
|
150
|
+
message: (filePath) => `Destination already exists: ${filePath}`
|
|
151
|
+
},
|
|
152
|
+
OBSIDIAN_PATH_IS_FOLDER: {
|
|
153
|
+
code: 102611,
|
|
154
|
+
message: (folder) => `"${folder || '.'}" is a folder, not a note. List it with ` +
|
|
155
|
+
(folder ? `\`obsidian files folder="${folder}"\`` : '`obsidian files`') +
|
|
156
|
+
', then read one note by its path.'
|
|
157
|
+
},
|
|
158
|
+
SKILL_FILE_NOT_FOUND: {
|
|
159
|
+
code: 102701,
|
|
160
|
+
message: (name, file) => `ENOENT: ${name}/${file}`
|
|
161
|
+
},
|
|
162
|
+
INVALID_SKILL_NAME: { code: 102702, message: (name) => `invalid skill name: ${name}` },
|
|
163
|
+
SKILL_NOT_FOUND: { code: 102703, message: (name) => `skill not found: ${name}` },
|
|
164
|
+
BUNDLED_SKILLS_INVALID: {
|
|
165
|
+
code: 102704,
|
|
166
|
+
message: (staging) => `skills staging dir ${staging} failed validation`
|
|
167
|
+
},
|
|
168
|
+
BUNDLED_SKILLS_TAMPERED: {
|
|
169
|
+
code: 102705,
|
|
170
|
+
message: (dir) => `skills dir ${dir} failed validation after a rewrite — ` +
|
|
171
|
+
'another process is tampering with it; remove it and restart'
|
|
172
|
+
},
|
|
173
|
+
BUNDLED_SKILLS_OCCUPIED: {
|
|
174
|
+
code: 102706,
|
|
175
|
+
message: (dir, why) => `skills dir ${dir} could not be read or replaced${why} — remove it and restart`
|
|
176
|
+
},
|
|
177
|
+
DRIVE_TIMED_OUT: { code: 102707, message: (op) => `drive ${op} timed out` },
|
|
178
|
+
DRIVE_READ_TRUNCATED: {
|
|
179
|
+
code: 102708,
|
|
180
|
+
message: (maxBytes, key) => `read stopped at ${maxBytes} bytes: ${key}`
|
|
181
|
+
},
|
|
182
|
+
NO_STORAGE_ROOT: {
|
|
183
|
+
code: 102709,
|
|
184
|
+
message: () => 'cannot fence the app storage root: the SDK home is unknown'
|
|
185
|
+
},
|
|
186
|
+
SLM_TRANSLATION_UNAVAILABLE: { code: 102710, message: () => 'slm translation is unavailable' },
|
|
187
|
+
PDF_TEXT_UNAVAILABLE: { code: 102711, message: () => 'PDF text is not available on this device' },
|
|
188
|
+
BUNDLED_SKILLS_HASH_INVALID: {
|
|
189
|
+
code: 102712,
|
|
190
|
+
message: (hash) => `bundled skills hash ${hash} is not 16 hex characters`
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
addCodes(Object.fromEntries(Object.entries(HARNESS_ERRORS).map(([name, { code, message }]) => [code, { name, message }])), { name: '@qvac/harness', version: `${Object.keys(HARNESS_ERRORS).length}.0.0` });
|
|
194
|
+
export class HarnessError extends QvacErrorBase {
|
|
195
|
+
static CONTEXT_OVERFLOW_MESSAGE = HARNESS_ERRORS.CONTEXT_WINDOW_EXCEEDED.message();
|
|
196
|
+
static IMAGE_LOAD_STALL_ERROR = HARNESS_ERRORS.IMAGE_LOAD_STALLED.message();
|
|
197
|
+
static TRANSLATION_LOAD_STALL_ERROR = HARNESS_ERRORS.TRANSLATION_LOAD_STALLED.message();
|
|
198
|
+
static NO_STORAGE_ROOT = HARNESS_ERRORS.NO_STORAGE_ROOT.message();
|
|
199
|
+
constructor(name, ...[adds, opts]) {
|
|
200
|
+
const cause = opts?.cause instanceof Error ? opts.cause : undefined;
|
|
201
|
+
super({ code: HARNESS_ERRORS[name].code, adds: adds ?? [], cause });
|
|
202
|
+
}
|
|
203
|
+
static code(name) {
|
|
204
|
+
return HARNESS_ERRORS[name].code;
|
|
205
|
+
}
|
|
206
|
+
static codes() {
|
|
207
|
+
return Object.values(HARNESS_ERRORS).map(({ code }) => code);
|
|
208
|
+
}
|
|
209
|
+
static is(err, name) {
|
|
210
|
+
return isRecord(err) && String(err.code) === String(HARNESS_ERRORS[name].code);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { FoldEvent, Message } from '../contract/index.ts';
|
|
|
2
2
|
export interface FoldReading {
|
|
3
3
|
cacheTokens: number | undefined;
|
|
4
4
|
ctxSize: number | undefined;
|
|
5
|
+
cutOff?: boolean | undefined;
|
|
5
6
|
}
|
|
6
7
|
export interface FoldSummary {
|
|
7
8
|
text: string | null;
|
|
@@ -27,24 +28,48 @@ export interface FoldOptions {
|
|
|
27
28
|
ctxSize?: number | undefined;
|
|
28
29
|
instructions?: string | undefined;
|
|
29
30
|
}
|
|
31
|
+
export interface RoundsBoundary {
|
|
32
|
+
task: number;
|
|
33
|
+
folded: number[];
|
|
34
|
+
foldedRounds: number;
|
|
35
|
+
}
|
|
36
|
+
export interface RoundsOptions extends FoldOptions {
|
|
37
|
+
nudges: readonly string[];
|
|
38
|
+
goals?: readonly string[] | undefined;
|
|
39
|
+
keeps: (message: Message) => boolean;
|
|
40
|
+
}
|
|
41
|
+
export type RoundsResult = {
|
|
42
|
+
folded: true;
|
|
43
|
+
history: Message[];
|
|
44
|
+
summary: string;
|
|
45
|
+
foldedRounds: number;
|
|
46
|
+
} | {
|
|
47
|
+
folded: false;
|
|
48
|
+
reason: FoldRefusal;
|
|
49
|
+
};
|
|
30
50
|
export declare class Fold {
|
|
31
51
|
static FLOOR: number;
|
|
32
52
|
static TIERS: readonly (readonly [below: number, ratio: number])[];
|
|
33
53
|
static RATIO: number;
|
|
34
54
|
static KEEP_TURNS: number;
|
|
55
|
+
static KEEP_ROUNDS: number;
|
|
35
56
|
static PREFIX: string;
|
|
36
57
|
summarize: Summarize;
|
|
37
58
|
constructor(summarize: Summarize);
|
|
38
59
|
static turn(summary: string): string;
|
|
39
60
|
static isSummary(message: Pick<Message, 'role' | 'content'>): boolean;
|
|
61
|
+
static isTurn(message: Pick<Message, 'role' | 'content'>, nudges: readonly string[]): boolean;
|
|
62
|
+
static carriesState(message: Pick<Message, 'role' | 'content'>, nudges: readonly string[]): boolean;
|
|
40
63
|
static ratio(ctxSize: number): number;
|
|
41
64
|
static fits(ctxSize: number | undefined): boolean;
|
|
42
|
-
static due({ cacheTokens, ctxSize }: FoldReading): boolean;
|
|
65
|
+
static due({ cacheTokens, ctxSize, cutOff }: FoldReading): boolean;
|
|
43
66
|
static observe(cacheKey: string, reading: FoldReading): void;
|
|
44
67
|
static reading(cacheKey: string): FoldReading | undefined;
|
|
45
68
|
static forget(cacheKey: string): void;
|
|
46
69
|
static boundary(messages: readonly Message[], keepTurns?: number): FoldBoundary | null;
|
|
70
|
+
static roundBoundary(messages: readonly Message[], { nudges, goals, keeps }: Pick<RoundsOptions, 'nudges' | 'goals' | 'keeps'>, most?: number): RoundsBoundary | null;
|
|
47
71
|
static prompt(messages: readonly Message[], instructions?: string): string;
|
|
48
72
|
static shrinks(folded: readonly Message[], summary: string): boolean;
|
|
49
73
|
run(messages: readonly Message[], options?: FoldOptions): AsyncGenerator<FoldEvent, FoldResult>;
|
|
74
|
+
rounds(messages: readonly Message[], options: RoundsOptions): Promise<RoundsResult>;
|
|
50
75
|
}
|
|
@@ -10,6 +10,7 @@ export class Fold {
|
|
|
10
10
|
static TIERS = TIERS;
|
|
11
11
|
static RATIO = 0.95;
|
|
12
12
|
static KEEP_TURNS = 1;
|
|
13
|
+
static KEEP_ROUNDS = 2;
|
|
13
14
|
static PREFIX = '[Summary of the earlier conversation in this chat, written by another model. Treat it as established context, not as a new request.]';
|
|
14
15
|
summarize;
|
|
15
16
|
constructor(summarize) {
|
|
@@ -21,13 +22,25 @@ export class Fold {
|
|
|
21
22
|
static isSummary(message) {
|
|
22
23
|
return message.role === 'user' && message.content.startsWith(Fold.PREFIX);
|
|
23
24
|
}
|
|
25
|
+
static isTurn(message, nudges) {
|
|
26
|
+
return (message.role === 'user' &&
|
|
27
|
+
!Fold.isSummary(message) &&
|
|
28
|
+
!nudges.includes(message.content) &&
|
|
29
|
+
!Fold.carriesState(message, nudges));
|
|
30
|
+
}
|
|
31
|
+
static carriesState(message, nudges) {
|
|
32
|
+
return (message.role === 'user' &&
|
|
33
|
+
nudges.some((nudge) => nudge !== '' && message.content.startsWith(`${nudge}\n`)));
|
|
34
|
+
}
|
|
24
35
|
static ratio(ctxSize) {
|
|
25
36
|
return TIERS.find(([below]) => ctxSize < below)?.[1] ?? Fold.RATIO;
|
|
26
37
|
}
|
|
27
38
|
static fits(ctxSize) {
|
|
28
39
|
return ctxSize === undefined || ctxSize >= Fold.FLOOR;
|
|
29
40
|
}
|
|
30
|
-
static due({ cacheTokens, ctxSize }) {
|
|
41
|
+
static due({ cacheTokens, ctxSize, cutOff }) {
|
|
42
|
+
if (cutOff)
|
|
43
|
+
return true;
|
|
31
44
|
if (!cacheTokens || !ctxSize)
|
|
32
45
|
return false;
|
|
33
46
|
return cacheTokens >= ctxSize * Fold.ratio(ctxSize);
|
|
@@ -49,18 +62,31 @@ export class Fold {
|
|
|
49
62
|
const end = users[users.length - keepTurns];
|
|
50
63
|
return end > 0 ? { end, foldedTurns: users.length - keepTurns } : null;
|
|
51
64
|
}
|
|
65
|
+
static roundBoundary(messages, { nudges, goals = [], keeps }, most = Infinity) {
|
|
66
|
+
const task = messages.findLastIndex((message) => Fold.isTurn(message, nudges));
|
|
67
|
+
if (task === -1) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const starts = messages.flatMap((message, at) => at > task && message.role === 'assistant' ? [at] : []);
|
|
71
|
+
const latest = (among) => messages.findLastIndex((message, at) => at > task && Fold.carriesState(message, among));
|
|
72
|
+
const states = [latest(goals), latest(nudges)];
|
|
73
|
+
const kept = (from, to) => states.some((at) => at >= from && at < to) || messages.slice(from, to).some(keeps);
|
|
74
|
+
const rounds = starts
|
|
75
|
+
.map((from, index) => [from, starts[index + 1] ?? messages.length])
|
|
76
|
+
.slice(0, Math.max(0, starts.length - Fold.KEEP_ROUNDS))
|
|
77
|
+
.filter(([from, to]) => !kept(from, to))
|
|
78
|
+
.slice(0, most);
|
|
79
|
+
const summaries = messages.flatMap((message, at) => at > task && Fold.isSummary(message) ? [at] : []);
|
|
80
|
+
const folded = rounds.flatMap(([from, to]) => Array.from({ length: to - from }, (_, offset) => from + offset));
|
|
81
|
+
return { task, folded: [...summaries, ...folded], foldedRounds: rounds.length };
|
|
82
|
+
}
|
|
52
83
|
static prompt(messages, instructions) {
|
|
53
|
-
const prior = messages
|
|
54
|
-
const transcript = messages
|
|
55
|
-
.map((message) => {
|
|
56
|
-
const sender = message.role === 'user' && message.name ? `${message.name}: ` : '';
|
|
57
|
-
return `${message.role === 'user' ? 'User' : 'Assistant'}: ${sender}${message.content}`;
|
|
58
|
-
})
|
|
59
|
-
.join('\n\n');
|
|
84
|
+
const prior = messages.some(Fold.isSummary);
|
|
85
|
+
const transcript = messages.map(transcribed).join('\n\n');
|
|
60
86
|
return [
|
|
61
87
|
'Summarize the conversation below so another model can continue it without seeing it.',
|
|
62
88
|
prior
|
|
63
|
-
? 'The conversation
|
|
89
|
+
? 'The conversation carries an earlier summary. Carry everything from it that is still true into your new summary — it is discarded after this, so whatever you leave out is lost — and correct it where the later turns disagree.'
|
|
64
90
|
: null,
|
|
65
91
|
'Output exactly these four sections, in this order, keeping every heading even when it has nothing under it:',
|
|
66
92
|
'## Objective\n## Facts and decisions\n## State\n## Next steps',
|
|
@@ -120,4 +146,45 @@ export class Fold {
|
|
|
120
146
|
};
|
|
121
147
|
}
|
|
122
148
|
}
|
|
149
|
+
async rounds(messages, options) {
|
|
150
|
+
if (!Fold.fits(options.ctxSize)) {
|
|
151
|
+
return { folded: false, reason: 'below-floor' };
|
|
152
|
+
}
|
|
153
|
+
let most = Infinity;
|
|
154
|
+
for (;;) {
|
|
155
|
+
const boundary = Fold.roundBoundary(messages, options, most);
|
|
156
|
+
if (!boundary?.foldedRounds) {
|
|
157
|
+
const summarized = boundary !== null && boundary.folded.length > 0;
|
|
158
|
+
return { folded: false, reason: summarized ? 'already-compacted' : 'nothing-to-fold' };
|
|
159
|
+
}
|
|
160
|
+
const folded = boundary.folded.map((at) => messages[at]);
|
|
161
|
+
const attempt = await this.summarize(Fold.prompt([messages[boundary.task], ...folded], options.instructions));
|
|
162
|
+
const summary = attempt.text?.trim() || null;
|
|
163
|
+
if (!summary) {
|
|
164
|
+
if (attempt.overflowed && boundary.foldedRounds > 1) {
|
|
165
|
+
most = Math.floor(boundary.foldedRounds / 2);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
return { folded: false, reason: 'no-summary' };
|
|
169
|
+
}
|
|
170
|
+
if (!Fold.shrinks(folded, summary)) {
|
|
171
|
+
return { folded: false, reason: 'summary-not-smaller' };
|
|
172
|
+
}
|
|
173
|
+
const history = spliced(messages, boundary, summary);
|
|
174
|
+
return { folded: true, history, summary, foldedRounds: boundary.foldedRounds };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function spliced(messages, boundary, summary) {
|
|
179
|
+
const gone = new Set(boundary.folded);
|
|
180
|
+
return [
|
|
181
|
+
...messages.slice(0, boundary.task + 1),
|
|
182
|
+
{ role: 'user', content: Fold.turn(summary) },
|
|
183
|
+
...messages.filter((_, at) => at > boundary.task && !gone.has(at))
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
const SENDERS = { user: 'User', tool: 'Tool result' };
|
|
187
|
+
function transcribed(message) {
|
|
188
|
+
const sender = message.role === 'user' && message.name ? `${message.name}: ` : '';
|
|
189
|
+
return `${SENDERS[message.role] ?? 'Assistant'}: ${sender}${message.content}`;
|
|
123
190
|
}
|