@qvac/harness 1.0.0-rc.2 → 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 +56 -43
- 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 +101 -38
- 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/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
|
@@ -2,8 +2,9 @@ import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
|
2
2
|
import type { RecoveryResolution } from '../../run-log/index.ts';
|
|
3
3
|
import type { KnowledgeGrant } from '../../contract/knowledge.ts';
|
|
4
4
|
import type { ToolCallDisplay } from '../../contract/index.ts';
|
|
5
|
-
import type { AgentConfig, CompletionEvent, ApproveFn, AskUserFn, AttachFn, DriveRoot, FetchAttachmentFn, LlmGenerationParams, Message, ProgressFn, ResponseFormat, RunBudget, RunGoal, RunInput, RoundModelLease, ToolDefinition, ToolExecuteContext } from '../../contract/index.ts';
|
|
5
|
+
import type { AgentConfig, AccessPolicy, CompiledPolicy, CompletionEvent, ApproveFn, AskUserFn, AttachFn, DriveRoot, FetchAttachmentFn, LlmGenerationParams, Message, ProgressFn, ResponseFormat, RunBudget, RunGoal, RunInput, RoundModelLease, ToolDefinition, ToolExecuteContext } from '../../contract/index.ts';
|
|
6
6
|
import type { CompletionSkillEntry } from '../skill-entry.ts';
|
|
7
|
+
import type { ModelRoundPort } from './model-round.ts';
|
|
7
8
|
export interface CompletionArgs {
|
|
8
9
|
runId?: string;
|
|
9
10
|
parentRunId?: string;
|
|
@@ -12,14 +13,17 @@ export interface CompletionArgs {
|
|
|
12
13
|
lockOwner?: object;
|
|
13
14
|
modelId: string;
|
|
14
15
|
acquireRound?: (signal?: BareAbortSignal) => Promise<RoundModelLease>;
|
|
16
|
+
modelRound?: ModelRoundPort;
|
|
15
17
|
model?: string;
|
|
16
18
|
agent?: AgentConfig;
|
|
17
19
|
ctxSize?: number;
|
|
18
20
|
cacheKey?: string;
|
|
21
|
+
session?: string;
|
|
19
22
|
thinkingDefault?: string;
|
|
20
23
|
generationParams?: LlmGenerationParams;
|
|
21
24
|
responseFormat?: ResponseFormat;
|
|
22
25
|
messages: Message[];
|
|
26
|
+
typedText?: string;
|
|
23
27
|
requestMessages?: Message[];
|
|
24
28
|
tools?: ToolDefinition[];
|
|
25
29
|
skillCatalog?: readonly CompletionSkillEntry[];
|
|
@@ -30,20 +34,29 @@ export interface CompletionArgs {
|
|
|
30
34
|
askUser?: AskUserFn;
|
|
31
35
|
signal?: BareAbortSignal;
|
|
32
36
|
input?: AsyncIterable<RunInput>;
|
|
37
|
+
roundCut?: (cut: (note: string) => void) => void;
|
|
33
38
|
toolConfigs?: Record<string, Record<string, unknown>>;
|
|
34
39
|
fsRoots?: readonly DriveRoot[];
|
|
35
40
|
fsWriteRoots?: readonly DriveRoot[];
|
|
41
|
+
policy?: AccessPolicy;
|
|
42
|
+
access?: CompiledPolicy;
|
|
36
43
|
captureInferenceCalls?: boolean;
|
|
37
44
|
now?: () => number;
|
|
38
45
|
maxToolRounds?: number;
|
|
46
|
+
budgetMs?: number;
|
|
39
47
|
knowledge?: KnowledgeGrant;
|
|
40
48
|
planMode?: boolean;
|
|
49
|
+
deferTools?: boolean;
|
|
41
50
|
goal?: RunGoal;
|
|
42
51
|
wording?: {
|
|
43
52
|
toolContinuation?: string;
|
|
44
53
|
fileDelivered?: string;
|
|
45
54
|
toolDenied?: string;
|
|
46
55
|
toolCutOff?: string;
|
|
56
|
+
toolRoundCut?: string;
|
|
57
|
+
toolContextBoundary?: string;
|
|
58
|
+
toolRepeated?: string;
|
|
59
|
+
toolUnchanged?: string;
|
|
47
60
|
goalContinuation?: string;
|
|
48
61
|
};
|
|
49
62
|
}
|
|
@@ -55,4 +68,4 @@ export declare function createRunBudget(startedAt: number, ms?: number): RunBudg
|
|
|
55
68
|
export type ToolContextFactory = (turnImages?: {
|
|
56
69
|
path: string;
|
|
57
70
|
}[], ctxSize?: number, signal?: BareAbortSignal) => ToolExecuteContext;
|
|
58
|
-
export declare function runToolContext(args: Pick<CompletionArgs, 'agent' | 'attach' | 'fetchAttachment' | 'progress' | 'askUser' | 'signal' | 'fsRoots' | 'fsWriteRoots'>, runBudget: RunBudget): ToolContextFactory;
|
|
71
|
+
export declare function runToolContext(args: Pick<CompletionArgs, 'agent' | 'attach' | 'fetchAttachment' | 'progress' | 'askUser' | 'signal' | 'fsRoots' | 'fsWriteRoots' | 'session' | 'cacheKey'>, runBudget: RunBudget): ToolContextFactory;
|
|
@@ -30,6 +30,7 @@ export function createRunBudget(startedAt, ms) {
|
|
|
30
30
|
export function runToolContext(args, runBudget) {
|
|
31
31
|
const { agent, attach, fetchAttachment, progress, askUser, signal } = args;
|
|
32
32
|
const image = imageSettingsFrom(agent);
|
|
33
|
+
const session = args.session ?? sessionOf(args.cacheKey);
|
|
33
34
|
return (turnImages = [], ctxSize, invocationSignal) => {
|
|
34
35
|
const context = {
|
|
35
36
|
agentId: agent?.id ?? null,
|
|
@@ -39,6 +40,9 @@ export function runToolContext(args, runBudget) {
|
|
|
39
40
|
runBudget,
|
|
40
41
|
signal: invocationSignal ?? signal
|
|
41
42
|
};
|
|
43
|
+
if (session) {
|
|
44
|
+
context.session = session;
|
|
45
|
+
}
|
|
42
46
|
if (image) {
|
|
43
47
|
context.image = image;
|
|
44
48
|
}
|
|
@@ -60,3 +64,6 @@ export function runToolContext(args, runBudget) {
|
|
|
60
64
|
return context;
|
|
61
65
|
};
|
|
62
66
|
}
|
|
67
|
+
function sessionOf(cacheKey) {
|
|
68
|
+
return cacheKey?.split('/')[0] || undefined;
|
|
69
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { CompletionContext } from '../../machine/index.ts';
|
|
2
|
-
import type { MetricsEvent } from '../../contract/index.ts';
|
|
2
|
+
import type { MetricsEvent, RoundSpeed, RunOutcome } from '../../contract/index.ts';
|
|
3
3
|
import type { UsageBreakdown } from '../usage-breakdown.ts';
|
|
4
|
-
|
|
4
|
+
import type { LiveRound } from './round.ts';
|
|
5
|
+
export interface RunEnd {
|
|
6
|
+
usage?: UsageBreakdown | null;
|
|
7
|
+
outcome?: RunOutcome | null;
|
|
8
|
+
cancelled?: RoundSpeed | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function metricsEvent(state: CompletionContext['metrics'], wallMs: number, { usage, outcome, cancelled }?: RunEnd): MetricsEvent | null;
|
|
11
|
+
export declare function cancelledRound(live: LiveRound | null | undefined): RoundSpeed | null;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
export function metricsEvent(state, wallMs, usage) {
|
|
2
|
-
if (!state.tokens) {
|
|
1
|
+
export function metricsEvent(state, wallMs, { usage, outcome, cancelled } = {}) {
|
|
2
|
+
if (!state.tokens && !cancelled) {
|
|
3
3
|
return null;
|
|
4
4
|
}
|
|
5
|
+
const rounds = cancelled ? [...state.rounds, cancelled] : state.rounds;
|
|
5
6
|
const event = {
|
|
6
7
|
type: 'metrics',
|
|
7
8
|
totalTokens: state.tokens,
|
|
8
9
|
durationMs: wallMs,
|
|
9
|
-
modelMs: sum(
|
|
10
|
+
modelMs: sum(rounds),
|
|
10
11
|
toolMs: sum(state.tools),
|
|
11
12
|
timeToFirstToken: state.ttft,
|
|
12
|
-
promptTokensPerSecond: prefillRate(
|
|
13
|
+
promptTokensPerSecond: prefillRate(rounds),
|
|
13
14
|
tokensPerSecond: state.decodeMs > 0 ? (state.timedTokens / state.decodeMs) * 1000 : undefined,
|
|
14
15
|
promptTokens: state.promptTokens,
|
|
15
16
|
cacheTokens: state.cacheTokens,
|
|
16
|
-
rounds
|
|
17
|
+
rounds,
|
|
17
18
|
tools: state.tools
|
|
18
19
|
};
|
|
19
20
|
if (state.ctxSize) {
|
|
@@ -25,11 +26,31 @@ export function metricsEvent(state, wallMs, usage) {
|
|
|
25
26
|
if (usage) {
|
|
26
27
|
event.usage = usage;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const stopReason = cancelled ? cancelled.stopReason : state.stopReason;
|
|
30
|
+
if (stopReason) {
|
|
31
|
+
event.stopReason = stopReason;
|
|
32
|
+
}
|
|
33
|
+
if (outcome) {
|
|
34
|
+
event.outcome = outcome;
|
|
30
35
|
}
|
|
31
36
|
return event;
|
|
32
37
|
}
|
|
38
|
+
export function cancelledRound(live) {
|
|
39
|
+
if (!live) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const record = {
|
|
43
|
+
round: live.round,
|
|
44
|
+
durationMs: Date.now() - live.startedAt,
|
|
45
|
+
stopReason: 'cancelled',
|
|
46
|
+
rawContentChars: live.rawChars,
|
|
47
|
+
kind: live.kind
|
|
48
|
+
};
|
|
49
|
+
if (live.reasoningDeltas > 0) {
|
|
50
|
+
record.reasoningDeltas = live.reasoningDeltas;
|
|
51
|
+
}
|
|
52
|
+
return record;
|
|
53
|
+
}
|
|
33
54
|
function sum(records) {
|
|
34
55
|
return records.reduce((total, record) => total + record.durationMs, 0);
|
|
35
56
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CompletionFinal, Tool as SdkTool, ToolDialect } from '@qvac/sdk';
|
|
2
|
+
import { type AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
3
|
+
import type { TextEvent } from '../../helpers/thinking.ts';
|
|
4
|
+
import type { LlmGenerationParams, Message, ResponseFormat, RunLifecycleEvent } from '../../contract/index.ts';
|
|
5
|
+
export interface ModelRoundRequest {
|
|
6
|
+
runId: string;
|
|
7
|
+
round: number;
|
|
8
|
+
kind: 'streaming' | 'wrap-up';
|
|
9
|
+
attempt: number;
|
|
10
|
+
modelId: string;
|
|
11
|
+
history: Message[];
|
|
12
|
+
tools?: SdkTool[] | undefined;
|
|
13
|
+
generationParams?: Partial<LlmGenerationParams> | undefined;
|
|
14
|
+
responseFormat?: ResponseFormat | undefined;
|
|
15
|
+
toolDialect?: ToolDialect | undefined;
|
|
16
|
+
cacheKey?: string | undefined;
|
|
17
|
+
promptPrefix: string;
|
|
18
|
+
continuationNudge: string;
|
|
19
|
+
deliveredNudge: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ModelRoundResult {
|
|
22
|
+
contentText: string;
|
|
23
|
+
final: CompletionFinal;
|
|
24
|
+
cut?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
export type ModelRoundEvent = TextEvent;
|
|
27
|
+
type RoundReset = Extract<RunLifecycleEvent, {
|
|
28
|
+
type: 'round-reset';
|
|
29
|
+
}>;
|
|
30
|
+
export interface ModelRoundIo {
|
|
31
|
+
signal: BareAbortSignal;
|
|
32
|
+
emit(event: ModelRoundEvent): void;
|
|
33
|
+
retake(): (event: ModelRoundEvent) => void;
|
|
34
|
+
}
|
|
35
|
+
export type ModelRoundPort = (request: ModelRoundRequest, io: ModelRoundIo) => Promise<ModelRoundResult>;
|
|
36
|
+
interface RunOptions {
|
|
37
|
+
signal?: BareAbortSignal | undefined;
|
|
38
|
+
emit(event: ModelRoundEvent | RoundReset): void;
|
|
39
|
+
}
|
|
40
|
+
export declare class ModelRound {
|
|
41
|
+
port: ModelRoundPort;
|
|
42
|
+
constructor(port: ModelRoundPort);
|
|
43
|
+
run(request: ModelRoundRequest, options: RunOptions): Promise<ModelRoundResult>;
|
|
44
|
+
static run(port: ModelRoundPort, request: ModelRoundRequest, { signal, emit }: RunOptions): Promise<ModelRoundResult>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AbortController } from 'bare-abort-controller';
|
|
2
|
+
import { raceAbort } from '../../helpers/race-abort.js';
|
|
3
|
+
export class ModelRound {
|
|
4
|
+
port;
|
|
5
|
+
constructor(port) {
|
|
6
|
+
this.port = port;
|
|
7
|
+
}
|
|
8
|
+
run(request, options) {
|
|
9
|
+
return ModelRound.run(this.port, request, options);
|
|
10
|
+
}
|
|
11
|
+
static async run(port, request, { signal = new AbortController().signal, emit }) {
|
|
12
|
+
let taker = 0;
|
|
13
|
+
let open = true;
|
|
14
|
+
const live = () => open && !signal.aborted;
|
|
15
|
+
const emitter = (generation) => (event) => {
|
|
16
|
+
if (generation === taker && live()) {
|
|
17
|
+
emit(event);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const sent = port(request, {
|
|
21
|
+
signal,
|
|
22
|
+
emit: emitter(0),
|
|
23
|
+
retake: () => {
|
|
24
|
+
if (!live())
|
|
25
|
+
return noop;
|
|
26
|
+
taker++;
|
|
27
|
+
emit({
|
|
28
|
+
type: 'round-reset',
|
|
29
|
+
runId: request.runId,
|
|
30
|
+
round: request.round,
|
|
31
|
+
replacedTypes: ['content', 'thinking']
|
|
32
|
+
});
|
|
33
|
+
return emitter(taker);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
sent.catch(noop);
|
|
37
|
+
try {
|
|
38
|
+
return await raceAbort(sent, signal);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
open = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const noop = () => { };
|
|
@@ -223,7 +223,7 @@ export function bindOperations(deps, context, stage) {
|
|
|
223
223
|
};
|
|
224
224
|
let preToolCount = 0;
|
|
225
225
|
pipeline.runPreToolFold = async (payload) => {
|
|
226
|
-
const { signal: _signal, egress: _egress, ...durable } = payload;
|
|
226
|
+
const { signal: _signal, egress: _egress, command: _command, paths: _paths, ...durable } = payload;
|
|
227
227
|
return runHookOperation({
|
|
228
228
|
deps,
|
|
229
229
|
base,
|
|
@@ -21,7 +21,7 @@ import { wrapUp } from './actors/wrap-up.js';
|
|
|
21
21
|
import { toolContext } from './actors/execution-plan.js';
|
|
22
22
|
import { capabilityPolicy, captureFacts, restoreFacts, schemaDigest } from './durable.js';
|
|
23
23
|
import { bindOperations, toolOperationFacts } from './operations.js';
|
|
24
|
-
import {} from './session.js';
|
|
24
|
+
import { loadedSkills } from './session.js';
|
|
25
25
|
import { errorMessage, isRecord } from '../../guards.js';
|
|
26
26
|
import { detachJson } from '../../helpers/detach-json.js';
|
|
27
27
|
const prepareSource = skillStep;
|
|
@@ -168,11 +168,7 @@ function detachEventPayload(event) {
|
|
|
168
168
|
case 'inference-call':
|
|
169
169
|
return { ...event, call: detachJson(event.call) };
|
|
170
170
|
case 'inference-sent':
|
|
171
|
-
return {
|
|
172
|
-
...event,
|
|
173
|
-
messages: detachJson(event.messages),
|
|
174
|
-
tokens: detachJson(event.tokens)
|
|
175
|
-
};
|
|
171
|
+
return { ...event, tokens: detachJson(event.tokens) };
|
|
176
172
|
case 'metrics':
|
|
177
173
|
return {
|
|
178
174
|
...event,
|
|
@@ -230,7 +226,7 @@ async function rebuildSession(deps, cx) {
|
|
|
230
226
|
restoreFacts(invocation.input, durable);
|
|
231
227
|
}
|
|
232
228
|
const session = deps.session;
|
|
233
|
-
session.reselectTools?.(
|
|
229
|
+
session.reselectTools?.(loadedSkills(context, session));
|
|
234
230
|
const missing = context.availableTools.filter((name) => !session.enabled.some((tool) => tool.name === name));
|
|
235
231
|
const changed = durable?.tools
|
|
236
232
|
.filter((saved) => {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { CompletionFinal, Tool as SdkTool, ToolDialect } from '@qvac/sdk';
|
|
1
|
+
import type { CompletionFinal, CompletionStats, Tool as SdkTool, ToolDialect } from '@qvac/sdk';
|
|
2
2
|
import type { AbortSignal as BareAbortSignal } from 'bare-abort-controller';
|
|
3
|
+
import { type KnownTool } from '../../helpers/tool-call-markup.ts';
|
|
3
4
|
import { type TextEvent } from '../../helpers/thinking.ts';
|
|
4
5
|
import type { CompletionHistoryEntry, LlmGenerationParams } from '../../contract/index.ts';
|
|
5
|
-
import type { CompletionSdk, InferenceCallEvent, InferenceSentEvent, FoldEvent, Message, ResponseFormat, RoundModelLease, RunLifecycleEvent } from '../../contract/index.ts';
|
|
6
|
+
import type { CompletionSdk, InferenceCallEvent, InferenceSentEvent, FoldEvent, Message, ResponseFormat, RoundModelLease, RoundSpeed, RunLifecycleEvent } from '../../contract/index.ts';
|
|
6
7
|
import { type FailureTurn } from '../tool-turns.ts';
|
|
8
|
+
import { type CompletionParams } from '../../helpers/completion-params.ts';
|
|
7
9
|
import type { ModelRequest } from '../../run-log/index.ts';
|
|
8
10
|
import { type FailureResultValue } from '../../helpers/failure-result.ts';
|
|
9
|
-
|
|
11
|
+
import { type FoldReading } from '../../fold/index.ts';
|
|
12
|
+
export declare function foldTokens(stats: CompletionStats | undefined, cacheable: boolean | undefined): number | undefined;
|
|
10
13
|
export interface RecoveredRound {
|
|
11
14
|
contentText: string;
|
|
12
15
|
final: CompletionFinal;
|
|
@@ -14,7 +17,10 @@ export interface RecoveredRound {
|
|
|
14
17
|
cacheable: boolean;
|
|
15
18
|
unproven: string | null;
|
|
16
19
|
replay: string | null;
|
|
20
|
+
reasoningDeltas?: number | undefined;
|
|
17
21
|
ctxSize?: number | undefined;
|
|
22
|
+
overflows?: number | undefined;
|
|
23
|
+
cut?: string | undefined;
|
|
18
24
|
}
|
|
19
25
|
export interface RoundArgs {
|
|
20
26
|
modelId: string;
|
|
@@ -33,21 +39,35 @@ export interface RoundArgs {
|
|
|
33
39
|
runId?: string | undefined;
|
|
34
40
|
promptPrefix: string;
|
|
35
41
|
capture: boolean;
|
|
42
|
+
knownTools?: ReadonlyArray<KnownTool> | undefined;
|
|
36
43
|
unforced?: {
|
|
37
44
|
generationParams: LlmGenerationParams | undefined;
|
|
38
45
|
} | undefined;
|
|
39
46
|
recordRequest?: ((request: ModelRequest, failures: readonly FailureTurn[]) => Promise<void>) | undefined;
|
|
40
47
|
fold?: RoundFold | undefined;
|
|
48
|
+
live: LiveRound;
|
|
41
49
|
}
|
|
50
|
+
export interface LiveRound {
|
|
51
|
+
readonly round: number;
|
|
52
|
+
readonly kind: RoundKind;
|
|
53
|
+
readonly startedAt: number;
|
|
54
|
+
rawChars: number;
|
|
55
|
+
reasoningDeltas: number;
|
|
56
|
+
cut?: ((note: string) => void) | undefined;
|
|
57
|
+
}
|
|
58
|
+
export type RoundKind = NonNullable<RoundSpeed['kind']>;
|
|
42
59
|
export interface RoundFold {
|
|
43
60
|
messages: readonly Message[];
|
|
44
61
|
nudge: string;
|
|
45
62
|
ctxSize?: number | undefined;
|
|
63
|
+
cacheKey?: string | undefined;
|
|
46
64
|
instructions?: ((messages: readonly Message[]) => Promise<string | undefined>) | undefined;
|
|
65
|
+
reading?: FoldReading | undefined;
|
|
47
66
|
}
|
|
48
67
|
type RoundReset = Extract<RunLifecycleEvent, {
|
|
49
68
|
type: 'round-reset';
|
|
50
69
|
}>;
|
|
51
70
|
type RoundEvent = TextEvent | InferenceCallEvent | InferenceSentEvent | RoundReset | FoldEvent;
|
|
52
71
|
export declare function runRecoveredRound(sdk: CompletionSdk | undefined, args: RoundArgs): AsyncGenerator<RoundEvent, RecoveredRound>;
|
|
72
|
+
export declare function recordWholeRound(args: RoundArgs): Promise<CompletionParams>;
|
|
53
73
|
export {};
|