@qvac/harness 1.0.0-rc.3 → 1.0.0-rc.4
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 +2280 -1485
- package/README.md +44 -31
- package/dist-lib/index.d.ts +50 -6
- package/dist-lib/index.js +130 -28
- 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 +2 -0
- package/dist-lib/lib/agent/resolve.js +22 -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 +1 -0
- package/dist-lib/lib/agent/tools.js +2 -1
- package/dist-lib/lib/capabilities/agent-ports.js +3 -3
- 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/executing.js +60 -9
- package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.js +4 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/inspect-prepare.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.js +35 -6
- 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 +2 -0
- package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +67 -27
- package/dist-lib/lib/capabilities/completion-engine/actors/rejecting.js +6 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/resolving.js +61 -16
- package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.js +2 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/skill-step.js +23 -13
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.d.ts +8 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.js +61 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.d.ts +5 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.js +47 -21
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.d.ts +1 -0
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.js +30 -5
- package/dist-lib/lib/capabilities/completion-engine/driver.js +27 -11
- package/dist-lib/lib/capabilities/completion-engine/durable.d.ts +1 -0
- package/dist-lib/lib/capabilities/completion-engine/durable.js +5 -1
- package/dist-lib/lib/capabilities/completion-engine/index.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/index.js +2 -2
- package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +15 -2
- package/dist-lib/lib/capabilities/completion-engine/loop.js +7 -0
- 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 +46 -0
- package/dist-lib/lib/capabilities/completion-engine/model-round.js +45 -0
- package/dist-lib/lib/capabilities/completion-engine/operations.js +1 -1
- package/dist-lib/lib/capabilities/completion-engine/ports.js +3 -7
- package/dist-lib/lib/capabilities/completion-engine/round.d.ts +23 -3
- package/dist-lib/lib/capabilities/completion-engine/round.js +323 -97
- package/dist-lib/lib/capabilities/completion-engine/session.d.ts +10 -3
- package/dist-lib/lib/capabilities/completion-engine/session.js +30 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-caller.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.d.ts +4 -3
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.js +15 -10
- package/dist-lib/lib/capabilities/completion-engine/turns.d.ts +11 -4
- package/dist-lib/lib/capabilities/completion-engine/turns.js +48 -65
- package/dist-lib/lib/capabilities/download.d.ts +9 -7
- 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 +20 -8
- 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/sdk-tool.d.ts +1 -0
- package/dist-lib/lib/capabilities/sdk-tool.js +18 -1
- package/dist-lib/lib/capabilities/tool-plan.d.ts +1 -1
- package/dist-lib/lib/capabilities/tool-plan.js +5 -5
- package/dist-lib/lib/capabilities/tool-prompt-log.js +3 -3
- package/dist-lib/lib/capabilities/tool-turns.d.ts +7 -9
- package/dist-lib/lib/capabilities/tool-turns.js +25 -20
- package/dist-lib/lib/client/index.d.ts +19 -0
- package/dist-lib/lib/client/index.js +262 -0
- package/dist-lib/lib/connect.d.ts +13 -10
- package/dist-lib/lib/connect.js +62 -24
- package/dist-lib/lib/context-window.d.ts +1 -0
- package/dist-lib/lib/context-window.js +3 -3
- package/dist-lib/lib/contract/agent.d.ts +7 -3
- package/dist-lib/lib/contract/completion.d.ts +44 -29
- 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 +3 -3
- package/dist-lib/lib/contract/hooks.d.ts +4 -1
- package/dist-lib/lib/contract/index.d.ts +1 -0
- package/dist-lib/lib/contract/models.d.ts +6 -4
- 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 +9 -3
- package/dist-lib/lib/contract/sandbox.d.ts +3 -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 +32 -14
- 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 +266 -0
- package/dist-lib/lib/errors.js +198 -0
- package/dist-lib/lib/fold/index.d.ts +25 -1
- package/dist-lib/lib/fold/index.js +75 -9
- package/dist-lib/lib/guarded-fetch.js +11 -7
- package/dist-lib/lib/hardware/gpu-probe.js +10 -1
- package/dist-lib/lib/helpers/completion-params.d.ts +6 -2
- package/dist-lib/lib/helpers/completion-params.js +10 -1
- 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.d.ts +4 -0
- package/dist-lib/lib/helpers/goal-check.js +81 -0
- package/dist-lib/lib/helpers/head-tail.js +1 -1
- 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/repeated-reply.js +24 -16
- package/dist-lib/lib/helpers/thinking.d.ts +3 -2
- package/dist-lib/lib/helpers/thinking.js +19 -0
- 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 +4 -2
- package/dist-lib/lib/machine/completion/actions/completion.js +75 -10
- package/dist-lib/lib/machine/completion/actions/prepare.js +1 -1
- package/dist-lib/lib/machine/completion/actions/tools.js +48 -5
- package/dist-lib/lib/machine/completion/context.js +4 -1
- package/dist-lib/lib/machine/completion/guards/retry.d.ts +1 -0
- package/dist-lib/lib/machine/completion/guards/retry.js +8 -2
- package/dist-lib/lib/machine/completion/implementations.d.ts +10 -4
- package/dist-lib/lib/machine/completion/implementations.js +27 -6
- package/dist-lib/lib/machine/completion/machine.d.ts +21 -3
- package/dist-lib/lib/machine/completion/machine.js +33 -4
- package/dist-lib/lib/machine/completion/rules.d.ts +17 -2
- package/dist-lib/lib/machine/completion/rules.js +49 -3
- package/dist-lib/lib/machine/completion/types.d.ts +36 -0
- package/dist-lib/lib/machine/index.d.ts +27 -4
- package/dist-lib/lib/machine/index.js +6 -1
- package/dist-lib/lib/models/context-choice.d.ts +15 -0
- package/dist-lib/lib/models/context-choice.js +55 -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 +5 -0
- package/dist-lib/lib/models/gguf-header.js +165 -14
- package/dist-lib/lib/models/llm-presets.d.ts +5 -1
- package/dist-lib/lib/models/llm-presets.js +6 -5
- 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.d.ts +2 -0
- package/dist-lib/lib/models/model-catalog.js +15 -0
- package/dist-lib/lib/models/model-fit.d.ts +1 -1
- package/dist-lib/lib/models/model-fit.js +5 -6
- package/dist-lib/lib/models/model-handle.d.ts +8 -2
- package/dist-lib/lib/models/model-handle.js +14 -3
- package/dist-lib/lib/models/model-list.d.ts +8 -1
- package/dist-lib/lib/models/model-list.js +23 -0
- package/dist-lib/lib/models/model-pool.d.ts +35 -5
- package/dist-lib/lib/models/model-pool.js +121 -43
- package/dist-lib/lib/models/model-source.d.ts +1 -0
- package/dist-lib/lib/models/model-source.js +23 -5
- 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/no-redirect-fetch-bare.js +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.js +2 -1
- 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 +55 -17
- package/dist-lib/lib/office/engine/pptx/types.d.ts +1 -0
- 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 +3 -0
- package/dist-lib/lib/plugins/registry.js +16 -7
- package/dist-lib/lib/policy/index.d.ts +10 -0
- package/dist-lib/lib/policy/index.js +229 -0
- package/dist-lib/lib/prompt.d.ts +1 -0
- package/dist-lib/lib/prompt.js +7 -1
- package/dist-lib/lib/residency/completion-runtime.d.ts +1 -0
- package/dist-lib/lib/residency/completion-runtime.js +11 -4
- package/dist-lib/lib/residency/index.d.ts +44 -4
- package/dist-lib/lib/residency/index.js +399 -35
- package/dist-lib/lib/resolution-detector.js +3 -3
- package/dist-lib/lib/rpc-session.js +2 -1
- package/dist-lib/lib/sdk-loader.js +17 -11
- package/dist-lib/lib/serve.js +76 -36
- package/dist-lib/lib/sidecar/index.d.ts +29 -0
- package/dist-lib/lib/sidecar/index.js +174 -0
- package/dist-lib/lib/sidecar/user-plugins.d.ts +8 -0
- package/dist-lib/lib/sidecar/user-plugins.js +117 -0
- package/dist-lib/lib/skills-host/index.d.ts +1 -0
- package/dist-lib/lib/skills-host/index.js +8 -4
- package/dist-lib/lib/spawn.d.ts +3 -4
- package/dist-lib/lib/spawn.js +17 -17
- package/dist-lib/lib/spill.d.ts +1 -0
- package/dist-lib/lib/spill.js +12 -8
- package/dist-lib/lib/tools/attachments/staging.js +8 -8
- package/dist-lib/lib/tools/exec/runner.js +2 -1
- 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 +87 -26
- package/dist-lib/lib/tools/files/edit-file.d.ts +3 -0
- package/dist-lib/lib/tools/files/edit-file.js +74 -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 +114 -0
- package/dist-lib/lib/tools/files/index.d.ts +3 -0
- package/dist-lib/lib/tools/files/index.js +23 -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 +105 -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 +2 -0
- package/dist-lib/lib/tools/fs/document-text.js +38 -0
- package/dist-lib/lib/tools/fs/drive.d.ts +14 -3
- package/dist-lib/lib/tools/fs/drive.js +9 -1
- package/dist-lib/lib/tools/fs/edit-match.d.ts +11 -0
- package/dist-lib/lib/tools/fs/edit-match.js +85 -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 +23 -3
- package/dist-lib/lib/tools/fs/remote.d.ts +3 -4
- package/dist-lib/lib/tools/fs/remote.js +23 -13
- package/dist-lib/lib/tools/fs/scope.d.ts +5 -1
- package/dist-lib/lib/tools/fs/scope.js +5 -2
- package/dist-lib/lib/tools/fs/search.d.ts +41 -0
- package/dist-lib/lib/tools/fs/search.js +382 -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 +15 -3
- package/dist-lib/lib/tools/fs/walk.js +118 -24
- package/dist-lib/lib/tools/http-request.js +12 -2
- package/dist-lib/lib/tools/index.js +2 -10
- package/dist-lib/lib/tools/office/ops.js +1 -1
- package/dist-lib/lib/tools/office.js +77 -21
- package/dist-lib/lib/tools/pdf/build.d.ts +5 -1
- package/dist-lib/lib/tools/pdf/build.js +31 -6
- package/dist-lib/lib/tools/pdf.js +17 -2
- package/dist-lib/lib/tools/skill.js +10 -7
- package/dist-lib/lib/tools/skills/bundled-dir.js +4 -4
- package/dist-lib/lib/tools/skills/catalog.d.ts +2 -0
- package/dist-lib/lib/tools/skills/catalog.js +6 -2
- 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-health.js +3 -3
- package/dist-lib/lib/tools/skills/frontmatter-parser.d.ts +2 -0
- package/dist-lib/lib/tools/skills/frontmatter-parser.js +4 -0
- package/dist-lib/lib/tools/skills/manifest-parse.d.ts +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +12 -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.js +3 -2
- 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 +10 -4
- package/dist-lib/lib/wire.js +3 -5
- package/dist-lib/plugins/coding/index.d.ts +1 -1
- package/dist-lib/plugins/coding/index.js +2 -4
- package/dist-lib/plugins/coding/session.d.ts +3 -3
- package/dist-lib/plugins/coding/session.js +26 -14
- 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 +182 -0
- package/dist-lib/plugins/image/edit-image.js +4 -3
- package/dist-lib/plugins/image/generate-image.d.ts +4 -3
- package/dist-lib/plugins/image/generate-image.js +10 -9
- package/dist-lib/plugins/image/index.d.ts +1 -1
- package/dist-lib/plugins/image/index.js +13 -10
- package/dist-lib/plugins/language-hint/index.d.ts +15 -0
- package/dist-lib/plugins/language-hint/index.js +51 -0
- package/dist-lib/plugins/lsp/tool.js +2 -2
- package/dist-lib/plugins/mcp/index.js +6 -3
- package/dist-lib/plugins/music/generate-music.d.ts +4 -2
- package/dist-lib/plugins/music/generate-music.js +7 -4
- package/dist-lib/plugins/music/index.js +12 -9
- package/dist-lib/plugins/obsidian/command.js +2 -2
- package/dist-lib/plugins/obsidian/note-name.js +2 -1
- 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 +6 -5
- package/dist-lib/plugins/obsidian/vault-write.js +13 -12
- 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/interrupt-timer.js +2 -2
- package/dist-lib/plugins/python/loader.js +68 -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.js +3 -1
- 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 +9 -8
- 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 +2 -1
- 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 +27 -12
- 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 +3 -3
- 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 +60 -0
- package/dist-lib/plugins/sandbox-linux/index.js +347 -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 +23 -11
- package/dist-lib/plugins/sandbox-macos/index.js +239 -49
- package/dist-lib/plugins/sandbox-vm/vm-shell.d.ts +4 -2
- package/dist-lib/plugins/sandbox-vm/vm-shell.js +9 -4
- 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 +7 -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/speech-runtime.js +37 -37
- package/dist-lib/plugins/speech/voice.d.ts +5 -1
- package/dist-lib/plugins/speech/voice.js +100 -31
- package/dist-lib/plugins/translation/index.d.ts +1 -0
- package/dist-lib/plugins/translation/index.js +16 -9
- package/dist-lib/plugins/translation/translate.d.ts +7 -3
- package/dist-lib/plugins/translation/translate.js +64 -58
- package/dist-lib/plugins/weather/geocode.js +2 -1
- package/dist-lib/plugins/weather/lookup.js +5 -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/harness.js +48 -7
- package/dist-lib/spec/bind.js +9 -0
- package/dist-lib/spec/calls.js +3 -0
- package/dist-lib/spec/hrpc/hrpc.json +42 -3
- package/dist-lib/spec/hrpc/index.js +44 -8
- package/dist-lib/spec/hrpc/messages.js +297 -202
- package/dist-lib/spec/hyperschema/index.js +297 -202
- package/dist-lib/spec/hyperschema/schema.json +155 -84
- package/dist-lib/spec/hyperschema/types.d.ts +23 -3
- package/package.json +98 -26
- package/patches/@qvac%2Finference@0.22.0.patch +59 -0
- package/patches/pyodide@314.0.2.patch +37 -8
- package/scripts/addon-externals.cjs +10 -5
- package/worker/harness-sidecar.mjs +18 -154
- package/bench/README.md +0 -94
- package/bench/bfcl/checker.ts +0 -313
- package/bench/bfcl/data.ts +0 -93
- package/bench/bfcl/observe.ts +0 -93
- package/bench/bfcl/run.ts +0 -213
- package/bench/bfcl/tools.ts +0 -72
- package/bench/bridge/bridge.ts +0 -392
- package/bench/bridge/openai.ts +0 -150
- package/bench/bridge/python/qvac_bench/__init__.py +0 -3
- package/bench/bridge/python/qvac_bench/airline.py +0 -42
- package/bench/bridge/python/qvac_bench/approval.py +0 -26
- package/bench/bridge/python/qvac_bench/bfcl_multi_turn.py +0 -152
- package/bench/bridge/python/qvac_bench/client.py +0 -88
- package/bench/bridge/python/qvac_bench/harbor_agent.py +0 -85
- package/bench/bridge/python/qvac_bench/session.py +0 -107
- package/bench/bridge/python/qvac_bench/speed.py +0 -30
- package/bench/bridge/python/qvac_bench/tau2_agent.py +0 -106
- package/bench/bridge/python/qvac_bench/tools.py +0 -11
- package/bench/bridge/python/run_bfcl_multi_turn.py +0 -95
- package/bench/bridge/python/run_tau2.py +0 -150
- package/bench/bridge/python/smoke.py +0 -47
- package/bench/bridge/python/test_airline.py +0 -28
- package/bench/bridge/python/test_approval.py +0 -57
- package/bench/bridge/python/test_bfcl_multi_turn.py +0 -185
- package/bench/bridge/python/test_harbor_agent.py +0 -107
- package/bench/bridge/serve.ts +0 -52
- package/bench/bridge/transcript.ts +0 -52
- package/bench/bun-tsconfig.json +0 -15
- package/bench/cpu-main.mjs +0 -216
- package/bench/cpu.ts +0 -457
- package/bench/evidence/2026-09-28-review15.md +0 -225
- package/bench/evidence/redact-bun1.3.14.json +0 -92
- package/bench/evidence/redact-node24.11.json +0 -92
- package/bench/graph-metrics.ts +0 -43
- package/bench/harness.ts +0 -73
- package/bench/issue129-matrix.mjs +0 -722
- package/bench/redact-adversarial.ts +0 -256
- package/bench/repeat-cpu.mjs +0 -281
- package/bench/report.ts +0 -1075
- package/bench/skill-eval/harness.ts +0 -30
- package/bench/skill-eval/laws.ts +0 -37
- package/bench/skill-eval/mermaid/client.ts +0 -132
- package/bench/skill-eval/mermaid/validate.mjs +0 -115
- package/bench/skill-eval/pack.ts +0 -61
- package/bench/skill-eval/packs/diagrams/cases.ts +0 -281
- package/bench/skill-eval/packs/diagrams/index.ts +0 -50
- package/bench/skill-eval/packs/diagrams/score.ts +0 -74
- package/bench/skill-eval/packs/index.ts +0 -5
- package/bench/skill-eval/packs/weather/cases.ts +0 -279
- package/bench/skill-eval/packs/weather/fixtures/wttr.json +0 -566
- package/bench/skill-eval/packs/weather/fixtures.ts +0 -84
- package/bench/skill-eval/packs/weather/index.ts +0 -55
- package/bench/skill-eval/packs/weather/score.ts +0 -92
- package/bench/skill-eval/report.ts +0 -194
- package/bench/skill-eval/run.ts +0 -316
- package/bench/speed.ts +0 -80
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CompletionFinal, Tool as SdkTool, ToolCallWithCall, ToolDialect } from '@qvac/sdk';
|
|
1
|
+
import type { CompletionEvent as SdkCompletionEvent, CompletionFinal, Tool as SdkTool, ToolCallWithCall, ToolDialect } from '@qvac/sdk';
|
|
2
2
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
3
3
|
import type { TextEvent } from '../helpers/thinking.ts';
|
|
4
4
|
import type { LlmGenerationParams } from '../models/llm-presets.ts';
|
|
@@ -7,7 +7,8 @@ import type { DriveRoot } from '../tools/fs/scope.ts';
|
|
|
7
7
|
import type { CliValidator } from '../tools/skills/cli-schema-types.ts';
|
|
8
8
|
import type { UsageBreakdown } from '../capabilities/usage-breakdown.ts';
|
|
9
9
|
import type { KnowledgeGrant } from './knowledge.ts';
|
|
10
|
-
import type {
|
|
10
|
+
import type { AccessPolicy, CompiledPolicy } from './policy.ts';
|
|
11
|
+
import type { GoalStatus, HistoryToolCall, HookRejection, Message, ResourceDescriptor, RoundSpeed, RunBackendUse, RunBudget, RunLifecycleEvent, RunOutcome, ToolActivityEvent, ToolCallDisplay, ToolDecision, ToolEffect, ToolSpeed, TrustedSource, TrustedSourceFacts } from './run.ts';
|
|
11
12
|
export type { CliValidator, DriveRoot, LlmGenerationParams };
|
|
12
13
|
export interface OutboundGuard {
|
|
13
14
|
facts(origin: TrustedSourceFacts['origin'], text: string): TrustedSourceFacts;
|
|
@@ -39,7 +40,7 @@ export interface AgentConfig {
|
|
|
39
40
|
imageHeight?: number | null;
|
|
40
41
|
approvalMode?: 'ask' | 'skip-all' | null;
|
|
41
42
|
disabledToolsets?: string[] | null;
|
|
42
|
-
|
|
43
|
+
policy?: AccessPolicy | null;
|
|
43
44
|
handoffs?: AgentHandoff[] | null;
|
|
44
45
|
plan?: boolean | null;
|
|
45
46
|
model?: string | null;
|
|
@@ -139,6 +140,7 @@ export interface ToolExecuteContext {
|
|
|
139
140
|
runId?: string;
|
|
140
141
|
callId?: string;
|
|
141
142
|
ctxSize?: number | undefined;
|
|
143
|
+
session?: string | undefined;
|
|
142
144
|
image?: ImageSettings | undefined;
|
|
143
145
|
settings?: Record<string, unknown> | undefined;
|
|
144
146
|
turnImages?: {
|
|
@@ -155,7 +157,7 @@ export interface ToolExecuteContext {
|
|
|
155
157
|
runBudget?: RunBudget | undefined;
|
|
156
158
|
reportBackend?: ((use: RunBackendUse) => void) | undefined;
|
|
157
159
|
uncappedResponse?: boolean | undefined;
|
|
158
|
-
|
|
160
|
+
policy?: CompiledPolicy | undefined;
|
|
159
161
|
toolNames?: readonly string[] | undefined;
|
|
160
162
|
approval?: ToolDecision | undefined;
|
|
161
163
|
fetch?: ToolFetch | undefined;
|
|
@@ -202,6 +204,7 @@ export interface ToolDefinition {
|
|
|
202
204
|
prompt?: ToolPromptDefinition;
|
|
203
205
|
autoApprove?: boolean;
|
|
204
206
|
skillGated?: boolean;
|
|
207
|
+
ungatedFor?: ReadonlyArray<CapabilityProfile>;
|
|
205
208
|
rootsRequired?: boolean;
|
|
206
209
|
writeRootsRequired?: boolean;
|
|
207
210
|
externalWrite?: boolean;
|
|
@@ -212,9 +215,12 @@ export interface ToolDefinition {
|
|
|
212
215
|
resource?: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => ResourceDescriptor | null;
|
|
213
216
|
quote?: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => string | null;
|
|
214
217
|
egress?: (args: Record<string, unknown>) => string | readonly string[] | null;
|
|
218
|
+
command?: (args: Record<string, unknown>) => string | null;
|
|
219
|
+
paths?: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => readonly string[] | null;
|
|
215
220
|
compiled?: true;
|
|
216
221
|
endsRun?: true;
|
|
217
222
|
concurrent?: true;
|
|
223
|
+
stableRead?: boolean;
|
|
218
224
|
callsTools?: true;
|
|
219
225
|
defer?: true;
|
|
220
226
|
group?: string;
|
|
@@ -223,20 +229,20 @@ export interface ToolDefinition {
|
|
|
223
229
|
addons?: AddonLoaders;
|
|
224
230
|
execute: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => Promise<unknown>;
|
|
225
231
|
}
|
|
226
|
-
export
|
|
232
|
+
export type ToolCallEvent = {
|
|
227
233
|
type: 'tool-call';
|
|
228
234
|
name: string;
|
|
229
235
|
args: Record<string, unknown>;
|
|
230
236
|
rawCall?: string | undefined;
|
|
231
237
|
effect?: ToolEffect | undefined;
|
|
232
238
|
display?: ToolCallDisplay | undefined;
|
|
233
|
-
}
|
|
234
|
-
export
|
|
239
|
+
};
|
|
240
|
+
export type ToolResultEvent = {
|
|
235
241
|
type: 'tool-result';
|
|
236
242
|
name: string;
|
|
237
243
|
result: unknown;
|
|
238
|
-
}
|
|
239
|
-
export
|
|
244
|
+
};
|
|
245
|
+
export type ErrorEvent = {
|
|
240
246
|
type: 'error';
|
|
241
247
|
message: string;
|
|
242
248
|
name?: string;
|
|
@@ -247,11 +253,11 @@ export interface ErrorEvent {
|
|
|
247
253
|
forkAt?: number | null;
|
|
248
254
|
forkSafe?: boolean;
|
|
249
255
|
recoveryOperationIds?: string[];
|
|
250
|
-
}
|
|
251
|
-
export
|
|
256
|
+
};
|
|
257
|
+
export type AbortedEvent = {
|
|
252
258
|
type: 'aborted';
|
|
253
|
-
}
|
|
254
|
-
export
|
|
259
|
+
};
|
|
260
|
+
export type MetricsEvent = {
|
|
255
261
|
type: 'metrics';
|
|
256
262
|
totalTokens: number;
|
|
257
263
|
durationMs: number;
|
|
@@ -268,25 +274,26 @@ export interface MetricsEvent {
|
|
|
268
274
|
backends?: RunBackendUse[] | undefined;
|
|
269
275
|
usage?: UsageBreakdown | undefined;
|
|
270
276
|
stopReason?: string | undefined;
|
|
277
|
+
outcome?: RunOutcome | undefined;
|
|
271
278
|
route?: 'direct' | 'enhanced' | undefined;
|
|
272
279
|
routeModel?: string | undefined;
|
|
273
|
-
}
|
|
280
|
+
};
|
|
274
281
|
export interface InferenceCall {
|
|
275
282
|
round: number;
|
|
276
283
|
droppedTurns: number;
|
|
277
284
|
modelId: string;
|
|
278
285
|
messages: Message[];
|
|
279
286
|
tools: SdkTool[] | undefined;
|
|
280
|
-
generationParams: LlmGenerationParams | undefined;
|
|
287
|
+
generationParams: Partial<LlmGenerationParams> | undefined;
|
|
281
288
|
responseFormat: ResponseFormat | undefined;
|
|
282
289
|
toolDialect: ToolDialect | undefined;
|
|
283
290
|
cacheKey: string | undefined;
|
|
284
291
|
promptPrefix: string;
|
|
285
292
|
}
|
|
286
|
-
export
|
|
293
|
+
export type InferenceCallEvent = {
|
|
287
294
|
type: 'inference-call';
|
|
288
295
|
call: InferenceCall;
|
|
289
|
-
}
|
|
296
|
+
};
|
|
290
297
|
export type TransferEvent = {
|
|
291
298
|
type: 'transfer';
|
|
292
299
|
from: string;
|
|
@@ -298,23 +305,24 @@ export interface RunInput {
|
|
|
298
305
|
text: string;
|
|
299
306
|
id?: string;
|
|
300
307
|
}
|
|
301
|
-
export
|
|
308
|
+
export type InputEvent = {
|
|
302
309
|
type: 'input';
|
|
303
310
|
id?: string;
|
|
304
311
|
text: string;
|
|
305
312
|
round: number;
|
|
306
|
-
}
|
|
307
|
-
export
|
|
313
|
+
};
|
|
314
|
+
export type InputRejectedEvent = {
|
|
308
315
|
type: 'input-rejected';
|
|
309
316
|
reason: string;
|
|
310
|
-
}
|
|
311
|
-
export
|
|
317
|
+
};
|
|
318
|
+
export type GoalEvent = {
|
|
312
319
|
type: 'goal';
|
|
313
320
|
status: GoalStatus;
|
|
314
321
|
turn: number;
|
|
315
322
|
round: number;
|
|
316
323
|
text?: string;
|
|
317
|
-
|
|
324
|
+
checks?: string[];
|
|
325
|
+
};
|
|
318
326
|
export type FoldEvent = {
|
|
319
327
|
type: 'fold';
|
|
320
328
|
phase: 'start';
|
|
@@ -325,15 +333,14 @@ export type FoldEvent = {
|
|
|
325
333
|
throughId: string;
|
|
326
334
|
foldedTurns: number;
|
|
327
335
|
};
|
|
328
|
-
export
|
|
336
|
+
export type InferenceSentEvent = {
|
|
329
337
|
type: 'inference-sent';
|
|
330
338
|
round: number;
|
|
331
339
|
droppedTurns: number;
|
|
332
|
-
messages: Message[] | undefined;
|
|
333
340
|
tokens: InferenceTokens | undefined;
|
|
334
341
|
outcome: 'completed' | 'overflowed' | 'failed';
|
|
335
342
|
reason: string | undefined;
|
|
336
|
-
}
|
|
343
|
+
};
|
|
337
344
|
export interface InferenceTokens {
|
|
338
345
|
prompt?: number | undefined;
|
|
339
346
|
generated?: number | undefined;
|
|
@@ -348,7 +355,10 @@ export type CompletionEvent = (RunLifecycleEvent | TextEvent | ToolCallEvent | T
|
|
|
348
355
|
};
|
|
349
356
|
export interface CompletionSdkResult {
|
|
350
357
|
requestId?: string;
|
|
351
|
-
|
|
358
|
+
events: AsyncIterable<SdkCompletionEvent>;
|
|
359
|
+
toolCallStream?: AsyncIterable<{
|
|
360
|
+
call: CompletionFinal['toolCalls'][number];
|
|
361
|
+
}>;
|
|
352
362
|
final: Promise<CompletionFinal>;
|
|
353
363
|
}
|
|
354
364
|
export type ResponseFormat = {
|
|
@@ -364,13 +374,17 @@ export type ResponseFormat = {
|
|
|
364
374
|
strict?: boolean;
|
|
365
375
|
};
|
|
366
376
|
};
|
|
377
|
+
export type SdkMessage = Message & {
|
|
378
|
+
toolCalls?: HistoryToolCall[];
|
|
379
|
+
toolCallId?: string;
|
|
380
|
+
};
|
|
367
381
|
export interface CompletionSdk {
|
|
368
382
|
completion(params: {
|
|
369
383
|
modelId: string;
|
|
370
|
-
history:
|
|
384
|
+
history: SdkMessage[];
|
|
371
385
|
stream: true;
|
|
372
386
|
tools?: SdkTool[] | undefined;
|
|
373
|
-
generationParams?: LlmGenerationParams | undefined;
|
|
387
|
+
generationParams?: Partial<LlmGenerationParams> | undefined;
|
|
374
388
|
responseFormat?: ResponseFormat | undefined;
|
|
375
389
|
toolDialect?: ToolDialect | undefined;
|
|
376
390
|
kvCache?: string | boolean;
|
|
@@ -387,6 +401,7 @@ export interface CompletionSdk {
|
|
|
387
401
|
export interface RoundModelLease {
|
|
388
402
|
modelId: string;
|
|
389
403
|
ctxSize?: number | undefined;
|
|
404
|
+
slots?: number | undefined;
|
|
390
405
|
sdk?: CompletionSdk;
|
|
391
406
|
release: () => void;
|
|
392
407
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
2
|
+
export interface EgressProxyOptions {
|
|
3
|
+
readonly hosts: readonly string[];
|
|
4
|
+
readonly signal?: BareAbortSignal;
|
|
5
|
+
}
|
|
6
|
+
export interface EgressProxySession {
|
|
7
|
+
readonly port: number;
|
|
8
|
+
denied(): readonly string[];
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export interface EgressProxyService {
|
|
12
|
+
open(options: EgressProxyOptions): Promise<EgressProxySession>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
2
2
|
import type { AskUserFn, AttachFn, FetchAttachmentFn, RunBudget, ToolDecision, ToolEffect, ToolExecuteContext, ToolParameterSchema, ToolSpill } from './index.ts';
|
|
3
|
+
import type { CompiledPolicy, PolicyEnforcement } from './policy.ts';
|
|
3
4
|
export interface ExecAttachment {
|
|
4
5
|
readonly attachmentId: string;
|
|
5
6
|
readonly fileName: string;
|
|
@@ -57,12 +58,10 @@ export interface ExecutionContext {
|
|
|
57
58
|
path: string;
|
|
58
59
|
}[];
|
|
59
60
|
readonly runBudget?: RunBudget;
|
|
60
|
-
readonly
|
|
61
|
+
readonly policy?: CompiledPolicy;
|
|
61
62
|
readonly toolNames?: readonly string[];
|
|
62
63
|
readonly approval?: ToolDecision;
|
|
63
64
|
readonly askUser?: AskUserFn;
|
|
64
|
-
readonly writeRoots?: readonly string[];
|
|
65
|
-
readonly deniedRoots?: readonly string[];
|
|
66
65
|
}
|
|
67
66
|
export interface ExecutionPlan {
|
|
68
67
|
run(options: ExecutionOptions): Promise<ExecResult> | ExecResult;
|
|
@@ -75,6 +74,7 @@ export interface FallbackExecutionAdapter {
|
|
|
75
74
|
}
|
|
76
75
|
export interface ExecShell extends FallbackExecutionAdapter {
|
|
77
76
|
readonly name: string;
|
|
77
|
+
readonly enforces?: PolicyEnforcement;
|
|
78
78
|
}
|
|
79
79
|
export interface ExecError {
|
|
80
80
|
error: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
2
2
|
import type { ToolDefinition } from './completion.ts';
|
|
3
|
+
import type { NetworkMode } from './policy.ts';
|
|
3
4
|
import type { HookRejection, Message, ResourceDescriptor, ToolEffect, ToolExecutionOutcome } from './run.ts';
|
|
4
5
|
export type HookPhase = 'runStart' | 'preToolCall' | 'postToolCall' | 'runEnd' | 'runPause' | 'runResume' | 'promptSubmit' | 'toolFailure' | 'stop' | 'preFold';
|
|
5
6
|
export interface RunStartPayload {
|
|
@@ -17,8 +18,10 @@ export interface PreToolCallPayload {
|
|
|
17
18
|
readonly signal?: BareAbortSignal | undefined;
|
|
18
19
|
readonly skillNames?: readonly string[];
|
|
19
20
|
readonly parameters?: ToolDefinition['parameters'];
|
|
20
|
-
readonly
|
|
21
|
+
readonly network?: NetworkMode;
|
|
21
22
|
readonly egress?: ToolDefinition['egress'];
|
|
23
|
+
readonly command?: ToolDefinition['command'];
|
|
24
|
+
readonly paths?: (args: Record<string, unknown>) => readonly string[] | null;
|
|
22
25
|
readonly effect: ToolEffect;
|
|
23
26
|
readonly resource: ResourceDescriptor | null;
|
|
24
27
|
args: Record<string, unknown>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { createVectorIndex, loadVectorIndex } from '@qvac/sdk';
|
|
2
2
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
3
3
|
import type { ModelSrc } from '../models/context.ts';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
4
|
+
import type { HoldFn } from '../models/download-gate.ts';
|
|
5
|
+
import type { CancelSdk, ModelState, PendingLoad, TrackedLoad } from '../models/model-pool.ts';
|
|
6
|
+
export type { CancelSdk, HoldFn, ModelState, TrackedLoad };
|
|
6
7
|
export interface ModelHost {
|
|
7
8
|
sdk(): Promise<unknown>;
|
|
8
9
|
track(load: TrackedLoad, sdk?: Partial<CancelSdk>): TrackedLoad;
|
|
9
|
-
makeRoom(signal: BareAbortSignal | undefined,
|
|
10
|
+
makeRoom(signal: BareAbortSignal | undefined, busy: string | Error, srcs?: ReadonlyArray<string>): Promise<void>;
|
|
11
|
+
hold: HoldFn;
|
|
10
12
|
completionModel(model: string, signal?: BareAbortSignal): Promise<BorrowedModel>;
|
|
11
13
|
emit(state: ModelState): void;
|
|
12
14
|
progressState(model: string, progress: Record<string, unknown>): ModelState;
|
|
@@ -21,7 +23,7 @@ export interface BorrowedModel {
|
|
|
21
23
|
}
|
|
22
24
|
export interface ResidentPoolSpec {
|
|
23
25
|
addon: 'tts' | 'parakeet';
|
|
24
|
-
modelType:
|
|
26
|
+
modelType: PendingLoad['modelType'];
|
|
25
27
|
modelConfig?: Record<string, unknown>;
|
|
26
28
|
modelConfigFor?: (modelSrc: ModelSrc) => Readonly<Record<string, unknown>> | undefined;
|
|
27
29
|
openclCache?: boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { DriveRoot } from './completion.ts';
|
|
2
|
+
export type PolicyPreset = 'read-only' | 'workspace-write' | 'full';
|
|
3
|
+
export type NetworkMode = 'off' | 'hosts' | 'on';
|
|
4
|
+
export type PolicyRoot = string;
|
|
5
|
+
export interface FilesPolicy {
|
|
6
|
+
readonly read?: readonly PolicyRoot[] | 'all';
|
|
7
|
+
readonly write?: readonly PolicyRoot[];
|
|
8
|
+
readonly deny?: readonly PolicyRoot[];
|
|
9
|
+
}
|
|
10
|
+
export interface NetworkPolicy {
|
|
11
|
+
readonly mode: NetworkMode;
|
|
12
|
+
readonly hosts?: readonly string[];
|
|
13
|
+
readonly localhost?: boolean;
|
|
14
|
+
readonly bind?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ExecPolicy {
|
|
17
|
+
readonly allow?: readonly string[];
|
|
18
|
+
readonly deny?: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface PolicyRule {
|
|
21
|
+
readonly decision: 'allow' | 'ask' | 'deny';
|
|
22
|
+
readonly tool?: string;
|
|
23
|
+
readonly command?: readonly string[];
|
|
24
|
+
readonly paths?: readonly string[];
|
|
25
|
+
readonly hosts?: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export interface AccessPolicy {
|
|
28
|
+
readonly preset?: PolicyPreset;
|
|
29
|
+
readonly files?: FilesPolicy;
|
|
30
|
+
readonly network?: NetworkPolicy;
|
|
31
|
+
readonly sockets?: readonly PolicyRoot[];
|
|
32
|
+
readonly exec?: ExecPolicy;
|
|
33
|
+
readonly env?: readonly string[];
|
|
34
|
+
readonly rules?: readonly PolicyRule[];
|
|
35
|
+
}
|
|
36
|
+
export interface CompiledPolicy {
|
|
37
|
+
readonly files: {
|
|
38
|
+
readonly read: readonly PolicyRoot[] | 'all';
|
|
39
|
+
readonly write: readonly PolicyRoot[];
|
|
40
|
+
readonly deny: readonly PolicyRoot[];
|
|
41
|
+
};
|
|
42
|
+
readonly network: {
|
|
43
|
+
readonly mode: NetworkMode;
|
|
44
|
+
readonly hosts: readonly string[];
|
|
45
|
+
readonly localhost: boolean;
|
|
46
|
+
readonly bind: boolean;
|
|
47
|
+
};
|
|
48
|
+
readonly sockets: readonly PolicyRoot[] | 'all';
|
|
49
|
+
readonly exec: {
|
|
50
|
+
readonly allow: readonly string[] | 'all';
|
|
51
|
+
readonly deny: readonly string[];
|
|
52
|
+
};
|
|
53
|
+
readonly env: readonly string[] | 'all';
|
|
54
|
+
readonly rules: readonly PolicyRule[];
|
|
55
|
+
}
|
|
56
|
+
export interface PolicyGrants {
|
|
57
|
+
readonly read?: readonly PolicyRoot[];
|
|
58
|
+
readonly write?: readonly PolicyRoot[];
|
|
59
|
+
readonly deny?: readonly PolicyRoot[];
|
|
60
|
+
}
|
|
61
|
+
export interface RunRoots {
|
|
62
|
+
readonly fsRoots?: readonly DriveRoot[] | undefined;
|
|
63
|
+
readonly fsWriteRoots?: readonly DriveRoot[] | undefined;
|
|
64
|
+
readonly deny?: readonly PolicyRoot[];
|
|
65
|
+
}
|
|
66
|
+
export interface PolicyEnforcement {
|
|
67
|
+
readonly files: 'paths' | 'workspace-only' | 'none';
|
|
68
|
+
readonly network: 'hosts' | 'on-off' | 'none';
|
|
69
|
+
readonly env?: boolean;
|
|
70
|
+
readonly exec?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface PolicyProvider {
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly enforces?: PolicyEnforcement;
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -40,12 +40,13 @@ export interface PlanStep {
|
|
|
40
40
|
step: string;
|
|
41
41
|
status: 'pending' | 'in_progress' | 'done';
|
|
42
42
|
}
|
|
43
|
-
export type GoalStatus = 'open' | 'met' | 'rounds' | 'time' | 'tokens';
|
|
43
|
+
export type GoalStatus = 'open' | 'met' | 'rounds' | 'time' | 'tokens' | 'stalled';
|
|
44
44
|
export interface RunGoal {
|
|
45
45
|
objective: string;
|
|
46
46
|
rounds?: number;
|
|
47
47
|
ms?: number;
|
|
48
48
|
tokens?: number;
|
|
49
|
+
checks?: string[];
|
|
49
50
|
}
|
|
50
51
|
export type ToolEffect = 'read' | 'write';
|
|
51
52
|
export type ToolDecision = 'auto' | 'allowed' | 'denied' | 'skip-all' | 'blocked';
|
|
@@ -53,14 +54,14 @@ export interface ResourceDescriptor {
|
|
|
53
54
|
kind: string;
|
|
54
55
|
label: string;
|
|
55
56
|
}
|
|
56
|
-
export
|
|
57
|
+
export type ToolActivityEvent = {
|
|
57
58
|
type: 'tool-activity';
|
|
58
59
|
name: string;
|
|
59
60
|
args: Record<string, unknown>;
|
|
60
61
|
resource: ResourceDescriptor | null;
|
|
61
62
|
effect: ToolEffect;
|
|
62
63
|
decision: ToolDecision;
|
|
63
|
-
}
|
|
64
|
+
};
|
|
64
65
|
export type RunOutcome = 'answered' | 'mute' | 'exhausted' | 'search-capped' | 'time-capped' | 'tool-ended' | 'delivered';
|
|
65
66
|
export interface ToolCallDisplay {
|
|
66
67
|
readonly label: string;
|
|
@@ -134,6 +135,11 @@ export interface RoundSpeed {
|
|
|
134
135
|
tokensPerSecond?: number;
|
|
135
136
|
timeToFirstToken?: number;
|
|
136
137
|
stopReason?: string;
|
|
138
|
+
overflows?: number;
|
|
139
|
+
contextBoundary?: true;
|
|
140
|
+
reasoningDeltas?: number;
|
|
141
|
+
rawContentChars?: number;
|
|
142
|
+
kind?: 'streaming' | 'wrap-up';
|
|
137
143
|
}
|
|
138
144
|
export interface ToolSpeed {
|
|
139
145
|
round: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
2
|
+
import type { CompiledPolicy, PolicyEnforcement } from './policy.ts';
|
|
2
3
|
export interface SandboxExecOptions {
|
|
3
4
|
cwd?: string;
|
|
4
5
|
env?: Record<string, string>;
|
|
@@ -25,5 +26,6 @@ export interface SandboxWorkspace {
|
|
|
25
26
|
export interface SandboxService {
|
|
26
27
|
readonly name: string;
|
|
27
28
|
readonly isolated: boolean;
|
|
28
|
-
|
|
29
|
+
readonly enforces?: PolicyEnforcement;
|
|
30
|
+
open(workspaceDir: string, policy: CompiledPolicy): Promise<SandboxWorkspace>;
|
|
29
31
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
2
|
+
export interface TranslationRequest {
|
|
3
|
+
text: string;
|
|
4
|
+
to: string;
|
|
5
|
+
from?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface Translation {
|
|
8
|
+
text: string;
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
engine: 'nmt' | 'slm' | 'none';
|
|
12
|
+
model?: string;
|
|
13
|
+
pivoted?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface TranslationRefused {
|
|
16
|
+
error: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TranslationService {
|
|
19
|
+
translate(request: TranslationRequest, signal?: BareAbortSignal): Promise<Translation | TranslationRefused>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
1
2
|
import type { HarnessCapabilityProfile } from '../spec/hyperschema/types.d.ts';
|
|
2
|
-
import type { AgentHandoff, ApproveFn, AskUserFn, AttachFn, FetchAttachmentFn, HistoryToolCall, ProgressFn, ResourceDescriptor, ResponseFormat } from './contract/index.ts';
|
|
3
|
+
import type { AccessPolicy, AgentHandoff, ApproveFn, AskUserFn, AttachFn, FetchAttachmentFn, HistoryToolCall, ProgressFn, ResourceDescriptor, ResponseFormat } from './contract/index.ts';
|
|
3
4
|
import type { KvCacheDeletionResult } from './capabilities/kv-cache.ts';
|
|
4
5
|
import type { ModelSourcePreview, PreviewModelSourceContext } from './capabilities/preview-model-source.ts';
|
|
5
6
|
import type { MemoryBudget } from './hardware/memory-budget.ts';
|
|
@@ -21,17 +22,17 @@ import type { EngineBoot, EngineStep, HostRunLog, HostRunLogLease, RecoveryResol
|
|
|
21
22
|
export type { InstallStep, ListModelsOptions, ModelInfo, ResolvedSkillCatalogEntry, ResourceDescriptor, RunRecord, SkillSetup, ToolCatalogEntry };
|
|
22
23
|
export type { HostRunLog, HostRunLogLease, SpeakResult };
|
|
23
24
|
export type ApprovalCall = Parameters<ApproveFn>[0];
|
|
24
|
-
export
|
|
25
|
+
export type ChatMessage = {
|
|
25
26
|
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
26
27
|
content: string;
|
|
27
28
|
attachments?: {
|
|
28
29
|
path: string;
|
|
29
|
-
}[]
|
|
30
|
+
}[];
|
|
30
31
|
toolCalls?: HistoryToolCall[] | null;
|
|
31
32
|
toolCallId?: string | null;
|
|
32
33
|
name?: string | null;
|
|
33
34
|
id?: string | null;
|
|
34
|
-
}
|
|
35
|
+
};
|
|
35
36
|
export interface AgentKnobs {
|
|
36
37
|
id?: string;
|
|
37
38
|
name?: string;
|
|
@@ -50,7 +51,7 @@ export interface AgentKnobs {
|
|
|
50
51
|
imageHeight?: number | null;
|
|
51
52
|
approvalMode?: 'ask' | 'skip-all' | null;
|
|
52
53
|
disabledToolsets?: string[] | null;
|
|
53
|
-
|
|
54
|
+
policy?: AccessPolicy | null;
|
|
54
55
|
handoffs?: AgentHandoff[] | null;
|
|
55
56
|
plan?: boolean | null;
|
|
56
57
|
model?: string | null;
|
|
@@ -64,7 +65,9 @@ export interface CompletionContext {
|
|
|
64
65
|
agent: AgentKnobs;
|
|
65
66
|
agents?: Record<string, AgentKnobs>;
|
|
66
67
|
messages: ChatMessage[];
|
|
68
|
+
typedText?: string;
|
|
67
69
|
cacheKey?: string;
|
|
70
|
+
session?: string;
|
|
68
71
|
thinkingDefault?: string;
|
|
69
72
|
toolConfigs?: Record<string, Record<string, unknown>>;
|
|
70
73
|
generationParams?: LlmGenerationParams;
|
|
@@ -73,6 +76,7 @@ export interface CompletionContext {
|
|
|
73
76
|
maxToolRounds?: number;
|
|
74
77
|
knowledge?: KnowledgeGrant;
|
|
75
78
|
planMode?: boolean;
|
|
79
|
+
deferTools?: boolean;
|
|
76
80
|
goal?: RunGoal;
|
|
77
81
|
grantedDirs?: string[];
|
|
78
82
|
grantedDrives?: GrantedDrive[];
|
|
@@ -88,15 +92,19 @@ export interface CompletionContext {
|
|
|
88
92
|
onStep?: (step: EngineStep) => Promise<void>;
|
|
89
93
|
hostAppendTimeoutMs?: number;
|
|
90
94
|
requestDigestKey?: Uint8Array;
|
|
91
|
-
signal?:
|
|
92
|
-
aborted?: boolean;
|
|
93
|
-
addEventListener?: (type: 'abort', fn: () => void, opts?: {
|
|
94
|
-
once?: boolean;
|
|
95
|
-
}) => void;
|
|
96
|
-
removeEventListener?: (type: 'abort', fn: () => void) => void;
|
|
97
|
-
};
|
|
95
|
+
signal?: BareAbortSignal;
|
|
98
96
|
input?: AsyncIterable<RunInput>;
|
|
99
97
|
}
|
|
98
|
+
export interface HostSignal {
|
|
99
|
+
aborted?: boolean;
|
|
100
|
+
addEventListener?: (type: 'abort', fn: () => void, opts?: {
|
|
101
|
+
once?: boolean;
|
|
102
|
+
}) => void;
|
|
103
|
+
removeEventListener?: (type: 'abort', fn: () => void) => void;
|
|
104
|
+
}
|
|
105
|
+
export type HostContext<T> = T extends unknown ? Omit<T, 'signal'> & {
|
|
106
|
+
signal?: HostSignal;
|
|
107
|
+
} : never;
|
|
100
108
|
export type ResumeCompletionContext = Omit<Partial<CompletionContext>, 'runId' | 'resume'> & {
|
|
101
109
|
runId: string;
|
|
102
110
|
resume: true;
|
|
@@ -142,6 +150,9 @@ export interface LoadedModel {
|
|
|
142
150
|
refs: number;
|
|
143
151
|
fit?: LoadFit;
|
|
144
152
|
}
|
|
153
|
+
export interface DownloadsAllowedOptions {
|
|
154
|
+
allowed: boolean;
|
|
155
|
+
}
|
|
145
156
|
export interface ModelState {
|
|
146
157
|
status: string;
|
|
147
158
|
model?: string;
|
|
@@ -151,6 +162,7 @@ export interface ModelState {
|
|
|
151
162
|
message?: string;
|
|
152
163
|
catalogChanged?: boolean;
|
|
153
164
|
loaded?: LoadedModel[];
|
|
165
|
+
addon?: string | null;
|
|
154
166
|
}
|
|
155
167
|
export interface WarmModelContext {
|
|
156
168
|
model: string;
|
|
@@ -162,6 +174,9 @@ export interface LoadModelResult {
|
|
|
162
174
|
loaded: boolean;
|
|
163
175
|
reason?: 'memory';
|
|
164
176
|
}
|
|
177
|
+
export interface MemoryUsage {
|
|
178
|
+
readonly usedBytes: number;
|
|
179
|
+
}
|
|
165
180
|
export interface UnloadModelContext {
|
|
166
181
|
model: string;
|
|
167
182
|
}
|
|
@@ -247,8 +262,8 @@ export interface HarnessContract {
|
|
|
247
262
|
speakStream?(context: SpeakStreamContext): AsyncIterable<SpeakResult>;
|
|
248
263
|
getEmbeddingDevice?(): EmbedDevice | Promise<EmbedDevice>;
|
|
249
264
|
setEmbeddingDevice?(device: EmbedDevice): Promise<void> | void;
|
|
250
|
-
on?(event: 'model'
|
|
251
|
-
off?(event: 'model'
|
|
265
|
+
on?(event: 'model', listener: (state: ModelState) => void): unknown;
|
|
266
|
+
off?(event: 'model', listener: (state: ModelState) => void): unknown;
|
|
252
267
|
presuspend?(): Promise<void> | void;
|
|
253
268
|
suspend?(): Promise<void> | void;
|
|
254
269
|
wakeup?(): Promise<void> | void;
|
|
@@ -263,6 +278,9 @@ export interface HarnessContract {
|
|
|
263
278
|
agentId?: string | null;
|
|
264
279
|
}>): void | Promise<void>;
|
|
265
280
|
setModelIdleTimeout?(ms: number): void | Promise<void>;
|
|
281
|
+
setModelMemoryCap?(percent: number): void | Promise<void>;
|
|
282
|
+
memoryUsage?(): Promise<MemoryUsage>;
|
|
283
|
+
setDownloadsAllowed?(options: DownloadsAllowedOptions): void | Promise<void>;
|
|
266
284
|
listManagedSkills?(): Promise<ManagedSkill[]>;
|
|
267
285
|
readSkillFile?(name: string): Promise<SkillFileContent | null>;
|
|
268
286
|
writeSkillFile?(name: string, content: string): Promise<{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type EmbedContext } from '../capabilities/embed.ts';
|
|
2
2
|
import type { Lifecycle } from '../lifecycle/index.ts';
|
|
3
|
+
import type { HoldFn } from '../models/download-gate.ts';
|
|
3
4
|
import { type EmbedDevice } from '../models/embed-config.ts';
|
|
4
5
|
import { type FitAssessment, type FitQuery } from '../models/model-fit.ts';
|
|
5
|
-
import { createEmbedPool, type LoadTracker, type ModelState } from '../models/model-pool.ts';
|
|
6
|
+
import { createEmbedPool, type BeforeLoad, type LoadTracker, type ModelState } from '../models/model-pool.ts';
|
|
6
7
|
import type { SdkLoader } from '../sdk-loader.ts';
|
|
7
8
|
export type EmbedPool = ReturnType<typeof createEmbedPool>;
|
|
8
9
|
export type EmbeddingsGate = Pick<Lifecycle, 'suspended' | 'opened' | 'ready' | 'enterWork' | 'assertNotClosing' | 'recordPoolCleanupFailure' | 'recordModelUnloadFailure'>;
|
|
@@ -16,10 +17,13 @@ export interface EmbeddingsOptions {
|
|
|
16
17
|
notify(state: ModelState): void;
|
|
17
18
|
settleFit(query: FitQuery): Promise<FitAssessment | null>;
|
|
18
19
|
evictIdleChat(): Promise<void>;
|
|
20
|
+
beforeLoad?: BeforeLoad | undefined;
|
|
21
|
+
hold?: HoldFn | undefined;
|
|
19
22
|
}
|
|
20
23
|
export interface EmbedTarget {
|
|
21
24
|
readonly pool: EmbedPool;
|
|
22
25
|
readonly key: string;
|
|
26
|
+
readonly modelType: 'llamacpp-embedding';
|
|
23
27
|
open(): ReturnType<EmbedPool['open']>;
|
|
24
28
|
}
|
|
25
29
|
export interface RoomTarget {
|
|
@@ -33,6 +37,8 @@ export declare class Embeddings {
|
|
|
33
37
|
private readonly _notify;
|
|
34
38
|
private readonly _settleFit;
|
|
35
39
|
private readonly _evictIdleChat;
|
|
40
|
+
private readonly _beforeLoad;
|
|
41
|
+
private readonly _hold;
|
|
36
42
|
private _embedModels;
|
|
37
43
|
private readonly _retiredEmbedModels;
|
|
38
44
|
private readonly _faultedEmbedKeys;
|