@qvac/harness 1.0.0-rc.3 → 1.0.0-rc.5
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 +2302 -1485
- package/README.md +44 -31
- package/dist-lib/index.d.ts +51 -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 +104 -40
- 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 +22 -13
- 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 +50 -22
- 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 +33 -6
- package/dist-lib/lib/capabilities/completion-engine/driver.js +28 -13
- 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/engine.d.ts +4 -1
- package/dist-lib/lib/capabilities/completion-engine/engine.js +14 -1
- package/dist-lib/lib/capabilities/completion-engine/index.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/index.js +2 -2
- package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +16 -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 +14 -9
- package/dist-lib/lib/capabilities/completion-engine/turns.js +63 -86
- 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 +68 -26
- 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 +51 -30
- package/dist-lib/lib/contract/drive.d.ts +4 -0
- package/dist-lib/lib/contract/drive.js +1 -0
- package/dist-lib/lib/contract/egress-proxy.d.ts +13 -0
- package/dist-lib/lib/contract/egress-proxy.js +1 -0
- package/dist-lib/lib/contract/exec.d.ts +3 -3
- package/dist-lib/lib/contract/hooks.d.ts +4 -1
- package/dist-lib/lib/contract/index.d.ts +3 -0
- package/dist-lib/lib/contract/managed-skills.d.ts +1 -0
- package/dist-lib/lib/contract/managed-skills.js +1 -0
- package/dist-lib/lib/contract/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 +15 -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 +35 -15
- 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 +78 -12
- 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 +5 -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 +43 -10
- package/dist-lib/lib/machine/completion/machine.d.ts +23 -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 +43 -1
- package/dist-lib/lib/machine/index.d.ts +29 -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 +83 -38
- 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 +8 -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 +52 -9
- 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 +310 -205
- package/dist-lib/spec/hyperschema/index.js +310 -205
- package/dist-lib/spec/hyperschema/schema.json +164 -84
- package/dist-lib/spec/hyperschema/types.d.ts +25 -4
- 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
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { harnessClient } from '../../spec/calls.js';
|
|
2
|
+
import HRPC from '../../spec/hrpc/index.js';
|
|
3
|
+
import { encode } from '../../spec/hrpc/messages.js';
|
|
4
|
+
import { errorMessage, isRecord } from '../guards.js';
|
|
5
|
+
import { addonTaskType } from '../models/model-task.js';
|
|
6
|
+
import { pushQueue } from '../queue.js';
|
|
7
|
+
import { settleOnClose } from '../rpc-session.js';
|
|
8
|
+
import { fromDownloadWire, fromWire } from '../wire.js';
|
|
9
|
+
const NO_ATTACHMENTS = 'this client carries no attachments';
|
|
10
|
+
export class HarnessClient {
|
|
11
|
+
_transport;
|
|
12
|
+
_opening = null;
|
|
13
|
+
_closed = false;
|
|
14
|
+
constructor(transport) {
|
|
15
|
+
this._transport = transport;
|
|
16
|
+
}
|
|
17
|
+
async *completion(context) {
|
|
18
|
+
const { client } = await this._open();
|
|
19
|
+
const signal = context.signal;
|
|
20
|
+
if (signal?.aborted) {
|
|
21
|
+
yield { type: 'aborted' };
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const duplex = client.completion();
|
|
25
|
+
let runId;
|
|
26
|
+
let failure = null;
|
|
27
|
+
let closed = false;
|
|
28
|
+
let done = false;
|
|
29
|
+
let emittedAborted = false;
|
|
30
|
+
const send = (frame) => {
|
|
31
|
+
if (closed)
|
|
32
|
+
return;
|
|
33
|
+
try {
|
|
34
|
+
encode('@harness/completion-frame', frame);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
failure ??= new Error(`cannot encode ${String(frame.type)} frame: ${errorMessage(err)}`);
|
|
38
|
+
duplex.destroy(failure);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
duplex.write(frame);
|
|
42
|
+
};
|
|
43
|
+
const onAbort = () => duplex.destroy();
|
|
44
|
+
signal?.addEventListener?.('abort', onAbort, { once: true });
|
|
45
|
+
try {
|
|
46
|
+
send({
|
|
47
|
+
type: 'start',
|
|
48
|
+
payload: { recoveryEvents: true },
|
|
49
|
+
model: context.model,
|
|
50
|
+
agent: context.agent,
|
|
51
|
+
cacheKey: context.cacheKey,
|
|
52
|
+
thinkingDefault: context.thinkingDefault,
|
|
53
|
+
toolConfigs: context.toolConfigs,
|
|
54
|
+
generationParams: context.generationParams,
|
|
55
|
+
responseFormat: context.responseFormat,
|
|
56
|
+
maxToolRounds: context.maxToolRounds || undefined,
|
|
57
|
+
messages: context.messages
|
|
58
|
+
});
|
|
59
|
+
if (failure) {
|
|
60
|
+
throw failure;
|
|
61
|
+
}
|
|
62
|
+
for await (const event of frames(duplex)) {
|
|
63
|
+
if (event.type === 'done') {
|
|
64
|
+
done = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
if (answered(event, context, send)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const wire = fromWire(event);
|
|
71
|
+
if (wire.type === 'run-started' || wire.type === 'run-resumed') {
|
|
72
|
+
runId = event.runId ?? runId;
|
|
73
|
+
}
|
|
74
|
+
if (wire.type === 'aborted' || wire.type === 'paused') {
|
|
75
|
+
emittedAborted = true;
|
|
76
|
+
}
|
|
77
|
+
yield wire;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
if (failure) {
|
|
82
|
+
throw failure;
|
|
83
|
+
}
|
|
84
|
+
if (!signal?.aborted) {
|
|
85
|
+
throw new Error(`harness died mid-run: ${errorMessage(err)}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
closed = true;
|
|
90
|
+
signal?.removeEventListener?.('abort', onAbort);
|
|
91
|
+
duplex.destroy();
|
|
92
|
+
}
|
|
93
|
+
if (signal?.aborted) {
|
|
94
|
+
if (!emittedAborted) {
|
|
95
|
+
yield { type: 'aborted', runId };
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (!done) {
|
|
100
|
+
throw new Error('harness closed mid-run');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async *download(context) {
|
|
104
|
+
const { client } = await this._open();
|
|
105
|
+
const signal = context.signal;
|
|
106
|
+
if (signal?.aborted) {
|
|
107
|
+
yield { type: 'aborted' };
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const stream = client.download({
|
|
111
|
+
model: context.model,
|
|
112
|
+
addon: context.addon,
|
|
113
|
+
seed: context.seed
|
|
114
|
+
});
|
|
115
|
+
let emittedAborted = false;
|
|
116
|
+
const onAbort = () => stream.destroy();
|
|
117
|
+
signal?.addEventListener?.('abort', onAbort, { once: true });
|
|
118
|
+
try {
|
|
119
|
+
for await (const event of frames(stream)) {
|
|
120
|
+
const wire = fromDownloadWire(event);
|
|
121
|
+
if (wire.type === 'aborted') {
|
|
122
|
+
emittedAborted = true;
|
|
123
|
+
}
|
|
124
|
+
yield wire;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
if (!signal?.aborted) {
|
|
129
|
+
throw new Error(`harness died mid-download: ${errorMessage(err)}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
signal?.removeEventListener?.('abort', onAbort);
|
|
134
|
+
stream.destroy();
|
|
135
|
+
}
|
|
136
|
+
if (signal?.aborted && !emittedAborted) {
|
|
137
|
+
yield { type: 'aborted' };
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async list(options = {}) {
|
|
141
|
+
const { client } = await this._open();
|
|
142
|
+
const response = await client.listModels({
|
|
143
|
+
type: options.type,
|
|
144
|
+
cachedOnly: options.cachedOnly,
|
|
145
|
+
fullRegistry: options.fullRegistry
|
|
146
|
+
});
|
|
147
|
+
return (response.models ?? []).map(({ actualSize, label, fit, fitBasis, fitEvidence, ...row }) => ({
|
|
148
|
+
...row,
|
|
149
|
+
actualSize: actualSize || undefined,
|
|
150
|
+
label: label || undefined,
|
|
151
|
+
taskType: addonTaskType(row.type),
|
|
152
|
+
fit: (fit || undefined),
|
|
153
|
+
fitBasis: (fitBasis || undefined),
|
|
154
|
+
fitEvidence: (fitEvidence || undefined)
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
close() {
|
|
158
|
+
this._closed = true;
|
|
159
|
+
void this._opening?.then((session) => session.stream.destroy(), () => { });
|
|
160
|
+
}
|
|
161
|
+
_open() {
|
|
162
|
+
if (this._closed) {
|
|
163
|
+
return Promise.reject(new Error('harness client closed'));
|
|
164
|
+
}
|
|
165
|
+
this._opening ??= this._connect();
|
|
166
|
+
return this._opening.then((session) => {
|
|
167
|
+
if (session.dead)
|
|
168
|
+
throw new Error('harness connection closed');
|
|
169
|
+
return session;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
async _connect() {
|
|
173
|
+
const stream = await this._transport();
|
|
174
|
+
const session = {
|
|
175
|
+
client: harnessClient(settleOnClose(new HRPC(stream))),
|
|
176
|
+
stream,
|
|
177
|
+
dead: false
|
|
178
|
+
};
|
|
179
|
+
stream.on('close', () => {
|
|
180
|
+
session.dead = true;
|
|
181
|
+
});
|
|
182
|
+
if (this._closed) {
|
|
183
|
+
stream.destroy();
|
|
184
|
+
}
|
|
185
|
+
return session;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async function* frames(stream) {
|
|
189
|
+
const queue = pushQueue();
|
|
190
|
+
let error = null;
|
|
191
|
+
stream.on('data', (frame) => queue.push(frame));
|
|
192
|
+
stream.on('end', () => queue.end());
|
|
193
|
+
stream.on('close', () => queue.end());
|
|
194
|
+
stream.on('error', (err) => {
|
|
195
|
+
error = err;
|
|
196
|
+
queue.end();
|
|
197
|
+
});
|
|
198
|
+
yield* queue;
|
|
199
|
+
if (error) {
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function answered(event, context, send) {
|
|
204
|
+
const callId = event.callId;
|
|
205
|
+
switch (event.type) {
|
|
206
|
+
case 'approval-ask':
|
|
207
|
+
void Promise.resolve()
|
|
208
|
+
.then(() => context.approve?.(approvalCall(event)))
|
|
209
|
+
.then((approved) => approved === true, () => false)
|
|
210
|
+
.then((approved) => send({ type: 'decision', callId, approved }));
|
|
211
|
+
return true;
|
|
212
|
+
case 'question-ask':
|
|
213
|
+
answerQuestion(event, context.askUser, send);
|
|
214
|
+
return true;
|
|
215
|
+
case 'attach-ask':
|
|
216
|
+
send({ type: 'attach-result', callId, message: NO_ATTACHMENTS });
|
|
217
|
+
return true;
|
|
218
|
+
case 'fetch-ask':
|
|
219
|
+
send({ type: 'fetch-result', callId, message: NO_ATTACHMENTS });
|
|
220
|
+
return true;
|
|
221
|
+
case 'progress':
|
|
222
|
+
context.progress?.(event.cleared ? null : { percentage: event.percentage ?? 0 });
|
|
223
|
+
return true;
|
|
224
|
+
default:
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function answerQuestion(event, askUser, send) {
|
|
229
|
+
const callId = event.callId;
|
|
230
|
+
if (!askUser) {
|
|
231
|
+
send({ type: 'question-result', callId, message: 'the host cannot ask questions' });
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
void Promise.resolve()
|
|
235
|
+
.then(() => askUser({
|
|
236
|
+
question: event.question ?? '',
|
|
237
|
+
options: Array.isArray(event.options) ? event.options.map(String) : undefined
|
|
238
|
+
}))
|
|
239
|
+
.then((answer) => send({ type: 'question-result', callId, answer: answer ?? '' }), (err) => send({ type: 'question-result', callId, message: errorMessage(err) }));
|
|
240
|
+
}
|
|
241
|
+
function approvalCall(event) {
|
|
242
|
+
const identity = isRecord(event.payload) ? event.payload : {};
|
|
243
|
+
const approval = {
|
|
244
|
+
name: event.name ?? '',
|
|
245
|
+
arguments: isRecord(event.arguments) ? event.arguments : {},
|
|
246
|
+
resource: event.resource ?? null,
|
|
247
|
+
effect: event.effect === 'read' ? 'read' : 'write',
|
|
248
|
+
intent: event.intent || null,
|
|
249
|
+
display: isToolCallDisplay(event.display) ? event.display : null,
|
|
250
|
+
quote: event.question || null
|
|
251
|
+
};
|
|
252
|
+
if (typeof identity.callId === 'string') {
|
|
253
|
+
approval.callId = identity.callId;
|
|
254
|
+
}
|
|
255
|
+
if (typeof identity.round === 'number') {
|
|
256
|
+
approval.round = identity.round;
|
|
257
|
+
}
|
|
258
|
+
return approval;
|
|
259
|
+
}
|
|
260
|
+
function isToolCallDisplay(value) {
|
|
261
|
+
return isRecord(value) && typeof value.label === 'string';
|
|
262
|
+
}
|
|
@@ -3,7 +3,7 @@ import { type Transport } from './rpc-session.ts';
|
|
|
3
3
|
import { type KvCacheDeletionResult } from './capabilities/kv-cache.ts';
|
|
4
4
|
import type { CustomModelEntry } from './models/model-catalog.ts';
|
|
5
5
|
import { type ModelSourcePreview, type PreviewModelSourceContext } from './capabilities/preview-model-source.ts';
|
|
6
|
-
import type { CapabilityInfo, CompletionContext, CredentialEntry, DetectedLanguage, DetectLanguageContext, DownloadContext, EmbedContext, HarnessContract, HarnessDiagnostics, HarnessEvent, HarnessInfo, InfraModel, InvokeContext, ListModelsOptions, ModelInfo, ResolvedSkillCatalogEntry, SkillsOptions, SkillWriteResult, SpeakContext, SpeakResult, SpeakStreamContext, ToolCatalogEntry, TranscribeContext, LoadModelContext, LoadModelResult, UnloadModelContext, UnloadModelResult, WarmModelContext } from './contract-types.ts';
|
|
6
|
+
import type { CapabilityInfo, CompletionContext, CredentialEntry, DetectedLanguage, DetectLanguageContext, DownloadContext, EmbedContext, HarnessContract, HarnessDiagnostics, HarnessEvent, HarnessInfo, HostContext, InfraModel, InvokeContext, ListModelsOptions, ModelInfo, ResolvedSkillCatalogEntry, SkillsOptions, SkillWriteResult, SpeakContext, SpeakResult, SpeakStreamContext, ToolCatalogEntry, TranscribeContext, LoadModelContext, LoadModelResult, MemoryUsage, UnloadModelContext, UnloadModelResult, WarmModelContext, DownloadsAllowedOptions } from './contract-types.ts';
|
|
7
7
|
import type { KnowledgeArtifact, KnowledgeHit, KnowledgeQuery, KnowledgeRemoved, KnowledgeStatus, KnowledgeUpsertResult } from './contract/knowledge.ts';
|
|
8
8
|
import { type EmbedDevice } from './models/embed-config.ts';
|
|
9
9
|
import type { DeleteModelSummary } from './models/model-delete.ts';
|
|
@@ -30,21 +30,24 @@ export declare class RemoteHarness extends EventEmitter implements HarnessContra
|
|
|
30
30
|
constructor(transport: Transport, options?: ConnectOptions);
|
|
31
31
|
private _ensure;
|
|
32
32
|
private _open;
|
|
33
|
-
completion(context: CompletionContext | import('./contract-types.ts').ResumeCompletionContext): AsyncIterable<HarnessEvent>;
|
|
33
|
+
completion(context: HostContext<CompletionContext | import('./contract-types.ts').ResumeCompletionContext>): AsyncIterable<HarnessEvent>;
|
|
34
34
|
private _hop;
|
|
35
|
-
invoke(context: InvokeContext): AsyncIterable<HarnessEvent>;
|
|
35
|
+
invoke(context: HostContext<InvokeContext>): AsyncIterable<HarnessEvent>;
|
|
36
36
|
private _run;
|
|
37
|
-
download(context: DownloadContext): AsyncIterable<HarnessEvent>;
|
|
38
|
-
embed(context: EmbedContext): Promise<number[][]>;
|
|
39
|
-
transcribe(context: TranscribeContext): Promise<string>;
|
|
37
|
+
download(context: HostContext<DownloadContext>): AsyncIterable<HarnessEvent>;
|
|
38
|
+
embed(context: HostContext<EmbedContext>): Promise<number[][]>;
|
|
39
|
+
transcribe(context: HostContext<TranscribeContext>): Promise<string>;
|
|
40
40
|
detectLanguage(context: DetectLanguageContext): Promise<DetectedLanguage[]>;
|
|
41
|
-
speak(context: SpeakContext): Promise<SpeakResult>;
|
|
42
|
-
speakStream(context: SpeakStreamContext): AsyncIterable<SpeakResult>;
|
|
41
|
+
speak(context: HostContext<SpeakContext>): Promise<SpeakResult>;
|
|
42
|
+
speakStream(context: HostContext<SpeakStreamContext>): AsyncIterable<SpeakResult>;
|
|
43
43
|
getEmbeddingDevice(): Promise<EmbedDevice>;
|
|
44
44
|
setEmbeddingDevice(device: EmbedDevice): Promise<void>;
|
|
45
45
|
setCredentials(entries: ReadonlyArray<CredentialEntry>): Promise<void>;
|
|
46
46
|
setSkillSettings(entries: ReadonlyArray<SkillSettingEntry>): Promise<void>;
|
|
47
47
|
setModelIdleTimeout(ms: number): Promise<void>;
|
|
48
|
+
setModelMemoryCap(percent: number): Promise<void>;
|
|
49
|
+
memoryUsage(): Promise<MemoryUsage>;
|
|
50
|
+
setDownloadsAllowed({ allowed }: DownloadsAllowedOptions): Promise<void>;
|
|
48
51
|
listManagedSkills(): Promise<ManagedSkill[]>;
|
|
49
52
|
readSkillFile(name: string): Promise<SkillFileContent | null>;
|
|
50
53
|
writeSkillFile(name: string, content: string): Promise<SkillWriteResult>;
|
|
@@ -54,8 +57,8 @@ export declare class RemoteHarness extends EventEmitter implements HarnessContra
|
|
|
54
57
|
previewModelSource(context: PreviewModelSourceContext): Promise<ModelSourcePreview>;
|
|
55
58
|
skills(agentId?: string | null, modelName?: string | null, options?: SkillsOptions): Promise<ResolvedSkillCatalogEntry[]>;
|
|
56
59
|
tools(): Promise<ToolCatalogEntry[]>;
|
|
57
|
-
warmModel(context: WarmModelContext): Promise<void>;
|
|
58
|
-
loadModel(context: LoadModelContext): Promise<LoadModelResult>;
|
|
60
|
+
warmModel(context: HostContext<WarmModelContext>): Promise<void>;
|
|
61
|
+
loadModel(context: HostContext<LoadModelContext>): Promise<LoadModelResult>;
|
|
59
62
|
unloadModel(context: UnloadModelContext): Promise<UnloadModelResult>;
|
|
60
63
|
knowledgeUpsert(artifact: KnowledgeArtifact): Promise<KnowledgeUpsertResult>;
|
|
61
64
|
knowledgeRemove(artifactId: string): Promise<KnowledgeRemoved>;
|
package/dist-lib/lib/connect.js
CHANGED
|
@@ -3,6 +3,7 @@ import { randomBytes } from 'crypto';
|
|
|
3
3
|
import EventEmitter from 'events';
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { HarnessError } from './errors.js';
|
|
6
7
|
import { settleOnClose } from './rpc-session.js';
|
|
7
8
|
import { harnessClient } from '../spec/calls.js';
|
|
8
9
|
import HRPC from '../spec/hrpc/index.js';
|
|
@@ -12,7 +13,7 @@ import { checkGoal, checkMaxToolRounds } from './capabilities/tool-turns.js';
|
|
|
12
13
|
import { Agent } from './agent/index.js';
|
|
13
14
|
import { readModelSourcePreview } from './capabilities/preview-model-source.js';
|
|
14
15
|
import { RunLog } from './run-log/index.js';
|
|
15
|
-
import {
|
|
16
|
+
import { HarnessLog } from './log.js';
|
|
16
17
|
import { assertEmbedDevice } from './models/embed-config.js';
|
|
17
18
|
import { addonTaskType } from './models/model-task.js';
|
|
18
19
|
import { errorCode, errorMessage, isRecord } from './guards.js';
|
|
@@ -104,7 +105,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
104
105
|
await session.client.setCustomModels({ models: this._customModels });
|
|
105
106
|
}
|
|
106
107
|
catch (err) {
|
|
107
|
-
|
|
108
|
+
HarnessLog.warn('custom model restore failed', { message: errorMessage(err) });
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
return session;
|
|
@@ -135,12 +136,24 @@ export class RemoteHarness extends EventEmitter {
|
|
|
135
136
|
if (context.planMode) {
|
|
136
137
|
payload.planMode = true;
|
|
137
138
|
}
|
|
139
|
+
if (context.deferTools) {
|
|
140
|
+
payload.deferTools = true;
|
|
141
|
+
}
|
|
138
142
|
if (context.parentRunId) {
|
|
139
143
|
payload.parentRunId = context.parentRunId;
|
|
140
144
|
}
|
|
141
145
|
if (context.goal) {
|
|
142
146
|
payload.goal = checkGoal({ ...context.goal }, context.responseFormat);
|
|
143
147
|
}
|
|
148
|
+
if (context.typedText !== undefined) {
|
|
149
|
+
payload.typedText = context.typedText;
|
|
150
|
+
}
|
|
151
|
+
if (context.replaysContext) {
|
|
152
|
+
payload.replaysContext = true;
|
|
153
|
+
}
|
|
154
|
+
if (context.maxToolRounds !== undefined && context.maxToolRounds !== 0) {
|
|
155
|
+
payload.maxToolRounds = checkMaxToolRounds(context.maxToolRounds);
|
|
156
|
+
}
|
|
144
157
|
yield* this._run({
|
|
145
158
|
type: 'start',
|
|
146
159
|
runId,
|
|
@@ -148,21 +161,20 @@ export class RemoteHarness extends EventEmitter {
|
|
|
148
161
|
model: context.model,
|
|
149
162
|
agent: context.agent ? knobs(context.agent) : undefined,
|
|
150
163
|
cacheKey: context.cacheKey,
|
|
164
|
+
session: context.session,
|
|
151
165
|
thinkingDefault: context.thinkingDefault,
|
|
152
166
|
generationParams: context.generationParams,
|
|
153
167
|
responseFormat: context.responseFormat,
|
|
154
168
|
captureInferenceCalls: context.captureInferenceCalls,
|
|
155
|
-
|
|
156
|
-
? undefined
|
|
157
|
-
: checkMaxToolRounds(context.maxToolRounds),
|
|
158
|
-
messages: context.messages?.map(({ role, content, attachments, toolCalls, toolCallId, name, id }) => ({
|
|
169
|
+
messages: context.messages?.map(({ role, content, attachments, toolCalls, toolCallId, name, id, context: added }) => ({
|
|
159
170
|
role,
|
|
160
171
|
content,
|
|
161
172
|
attachments: attachments?.map(({ path: file }) => ({ path: file })),
|
|
162
173
|
toolCalls,
|
|
163
174
|
toolCallId,
|
|
164
175
|
name,
|
|
165
|
-
id
|
|
176
|
+
id,
|
|
177
|
+
context: added
|
|
166
178
|
})),
|
|
167
179
|
toolConfigs: context.toolConfigs,
|
|
168
180
|
grantedDirs: context.grantedDirs,
|
|
@@ -326,11 +338,11 @@ export class RemoteHarness extends EventEmitter {
|
|
|
326
338
|
});
|
|
327
339
|
}).catch(noop);
|
|
328
340
|
}
|
|
329
|
-
|
|
341
|
+
HarnessLog.debug('client wire open', { model: context.model, capability: open.capability });
|
|
330
342
|
for await (const event of frames(duplex)) {
|
|
331
343
|
received++;
|
|
332
344
|
if (event.type !== 'content' && event.type !== 'thinking') {
|
|
333
|
-
|
|
345
|
+
HarnessLog.debug('client frame', { type: event.type, n: received });
|
|
334
346
|
}
|
|
335
347
|
if (event.type === 'run-started' || event.type === 'run-resumed') {
|
|
336
348
|
activeRunId = event.runId ?? activeRunId;
|
|
@@ -352,7 +364,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
352
364
|
send({ type: 'decision', callId, approved: false });
|
|
353
365
|
}
|
|
354
366
|
})
|
|
355
|
-
.catch((err) =>
|
|
367
|
+
.catch((err) => HarnessLog.warn('approval reply failed', { callId, message: errorMessage(err) }));
|
|
356
368
|
continue;
|
|
357
369
|
}
|
|
358
370
|
if (event.type === 'attach-ask') {
|
|
@@ -371,7 +383,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
371
383
|
});
|
|
372
384
|
}
|
|
373
385
|
})
|
|
374
|
-
.catch((err) =>
|
|
386
|
+
.catch((err) => HarnessLog.warn('attach reply failed', { callId, message: errorMessage(err) }));
|
|
375
387
|
continue;
|
|
376
388
|
}
|
|
377
389
|
if (event.type === 'fetch-ask') {
|
|
@@ -388,7 +400,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
388
400
|
}
|
|
389
401
|
send({ type: 'fetch-result', callId, message: errorMessage(err) });
|
|
390
402
|
})
|
|
391
|
-
.catch((err) =>
|
|
403
|
+
.catch((err) => HarnessLog.warn('fetch reply failed', { callId, message: errorMessage(err) }));
|
|
392
404
|
continue;
|
|
393
405
|
}
|
|
394
406
|
if (event.type === 'drive-ask') {
|
|
@@ -411,7 +423,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
411
423
|
});
|
|
412
424
|
}
|
|
413
425
|
})
|
|
414
|
-
.catch((err) =>
|
|
426
|
+
.catch((err) => HarnessLog.warn('drive reply failed', { callId, message: errorMessage(err) }));
|
|
415
427
|
continue;
|
|
416
428
|
}
|
|
417
429
|
if (event.type === 'run-log-append') {
|
|
@@ -435,7 +447,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
435
447
|
});
|
|
436
448
|
}
|
|
437
449
|
})
|
|
438
|
-
.catch((err) =>
|
|
450
|
+
.catch((err) => HarnessLog.warn('run-log reply failed', { callId, message: errorMessage(err) }));
|
|
439
451
|
continue;
|
|
440
452
|
}
|
|
441
453
|
if (event.type === 'question-ask') {
|
|
@@ -459,7 +471,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
459
471
|
}
|
|
460
472
|
yield wire;
|
|
461
473
|
}
|
|
462
|
-
|
|
474
|
+
HarnessLog.info('client wire ended', { received });
|
|
463
475
|
}
|
|
464
476
|
catch (err) {
|
|
465
477
|
if (failure) {
|
|
@@ -477,7 +489,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
477
489
|
throw died(`harness died mid-run: ${errorMessage(err)}`);
|
|
478
490
|
}
|
|
479
491
|
finally {
|
|
480
|
-
|
|
492
|
+
HarnessLog.debug('client run end', { received, aborted: Boolean(context.signal?.aborted) });
|
|
481
493
|
context.signal?.removeEventListener?.('abort', onAbort);
|
|
482
494
|
clearTimeout(pauseTimer);
|
|
483
495
|
duplex?.destroy();
|
|
@@ -494,7 +506,10 @@ export class RemoteHarness extends EventEmitter {
|
|
|
494
506
|
]);
|
|
495
507
|
}
|
|
496
508
|
catch (err) {
|
|
497
|
-
|
|
509
|
+
HarnessLog.info('host run-log release failed', {
|
|
510
|
+
runId: leasedRunId,
|
|
511
|
+
message: errorMessage(err)
|
|
512
|
+
});
|
|
498
513
|
}
|
|
499
514
|
finally {
|
|
500
515
|
clearTimeout(timer);
|
|
@@ -624,6 +639,18 @@ export class RemoteHarness extends EventEmitter {
|
|
|
624
639
|
const { client } = await this._ensure();
|
|
625
640
|
await client.setModelIdleTimeout({ ms });
|
|
626
641
|
}
|
|
642
|
+
async setModelMemoryCap(percent) {
|
|
643
|
+
const { client } = await this._ensure();
|
|
644
|
+
await client.setModelMemoryCap({ percent });
|
|
645
|
+
}
|
|
646
|
+
async memoryUsage() {
|
|
647
|
+
const { client } = await this._ensure();
|
|
648
|
+
return await client.memoryUsage({});
|
|
649
|
+
}
|
|
650
|
+
async setDownloadsAllowed({ allowed }) {
|
|
651
|
+
const { client } = await this._ensure();
|
|
652
|
+
await client.setDownloadsAllowed({ allowed });
|
|
653
|
+
}
|
|
627
654
|
async listManagedSkills() {
|
|
628
655
|
const { client } = await this._ensure();
|
|
629
656
|
const response = await client.listManagedSkills({});
|
|
@@ -699,6 +726,7 @@ export class RemoteHarness extends EventEmitter {
|
|
|
699
726
|
}));
|
|
700
727
|
return {
|
|
701
728
|
name: skill.name,
|
|
729
|
+
displayName: skill.displayName || undefined,
|
|
702
730
|
description: skill.description,
|
|
703
731
|
tools: skill.tools ?? [],
|
|
704
732
|
credentials: skill.credentials ?? [],
|
|
@@ -792,9 +820,10 @@ export class RemoteHarness extends EventEmitter {
|
|
|
792
820
|
cachedOnly: options.cachedOnly,
|
|
793
821
|
fullRegistry: options.fullRegistry
|
|
794
822
|
});
|
|
795
|
-
return (response.models ?? []).map(({ actualSize, label, fit, fitBasis, fitEvidence, ...row }) => ({
|
|
823
|
+
return (response.models ?? []).map(({ actualSize, memoryBytes, label, fit, fitBasis, fitEvidence, ...row }) => ({
|
|
796
824
|
...row,
|
|
797
825
|
actualSize: actualSize || undefined,
|
|
826
|
+
memoryBytes: memoryBytes || undefined,
|
|
798
827
|
label: label || undefined,
|
|
799
828
|
taskType: addonTaskType(row.type),
|
|
800
829
|
fit: (fit || undefined),
|
|
@@ -945,10 +974,10 @@ function abortable(promise, signal) {
|
|
|
945
974
|
return new Promise((resolve, reject) => {
|
|
946
975
|
if (signal.aborted) {
|
|
947
976
|
promise.then(noop, noop);
|
|
948
|
-
reject(new
|
|
977
|
+
reject(new HarnessError('EMBED_ABORTED'));
|
|
949
978
|
return;
|
|
950
979
|
}
|
|
951
|
-
const onAbort = () => reject(new
|
|
980
|
+
const onAbort = () => reject(new HarnessError('EMBED_ABORTED'));
|
|
952
981
|
signal.addEventListener?.('abort', onAbort, { once: true });
|
|
953
982
|
promise.then(resolve, reject).finally(() => signal.removeEventListener?.('abort', onAbort));
|
|
954
983
|
});
|
|
@@ -972,7 +1001,7 @@ function knobs(agent) {
|
|
|
972
1001
|
imageHeight: agent.imageHeight ?? undefined,
|
|
973
1002
|
approvalMode: agent.approvalMode ?? undefined,
|
|
974
1003
|
disabledToolsets: agent.disabledToolsets ?? undefined,
|
|
975
|
-
|
|
1004
|
+
policy: agent.policy ?? undefined,
|
|
976
1005
|
handoffs: agent.handoffs?.map(({ id, description }) => ({ id, description })),
|
|
977
1006
|
plan: agent.plan ?? undefined,
|
|
978
1007
|
model: agent.model ?? undefined
|
|
@@ -1083,6 +1112,7 @@ const DriveRequestSchema = z.discriminatedUnion('op', [
|
|
|
1083
1112
|
driveKey: z.string(),
|
|
1084
1113
|
folder: z.string(),
|
|
1085
1114
|
skip: z.array(z.string()),
|
|
1115
|
+
recursive: z.boolean(),
|
|
1086
1116
|
limit: z.number(),
|
|
1087
1117
|
cursor: z.string().nullable()
|
|
1088
1118
|
}),
|
|
@@ -1092,6 +1122,18 @@ const DriveRequestSchema = z.discriminatedUnion('op', [
|
|
|
1092
1122
|
key: z.string(),
|
|
1093
1123
|
path: z.string(),
|
|
1094
1124
|
executable: z.boolean().optional()
|
|
1125
|
+
}),
|
|
1126
|
+
z.looseObject({
|
|
1127
|
+
op: z.literal('search'),
|
|
1128
|
+
driveKey: z.string(),
|
|
1129
|
+
folder: z.string(),
|
|
1130
|
+
queries: z.array(z.string()),
|
|
1131
|
+
regex: z.boolean(),
|
|
1132
|
+
caseSensitive: z.boolean(),
|
|
1133
|
+
includeIgnored: z.boolean(),
|
|
1134
|
+
maxMatches: z.number(),
|
|
1135
|
+
maxEntries: z.number(),
|
|
1136
|
+
maxMs: z.number()
|
|
1095
1137
|
})
|
|
1096
1138
|
]);
|
|
1097
1139
|
async function bridgeDrive(event, context) {
|
|
@@ -1128,7 +1170,7 @@ function answerQuestion(event, { askUser, reply }) {
|
|
|
1128
1170
|
options: Array.isArray(event.options) ? event.options.map(String) : undefined
|
|
1129
1171
|
}))
|
|
1130
1172
|
.then((answer) => reply({ type: 'question-result', callId, answer: answer ?? '' }), (err) => reply({ type: 'question-result', callId, message: errorMessage(err) }))
|
|
1131
|
-
.catch((err) =>
|
|
1173
|
+
.catch((err) => HarnessLog.warn('question reply failed', { callId, message: errorMessage(err) }));
|
|
1132
1174
|
}
|
|
1133
1175
|
async function bridgeRunLog({ event, context, runId, generation }) {
|
|
1134
1176
|
if (!context.runLog || !generation) {
|
|
@@ -1167,7 +1209,7 @@ function releaseLateHostLease(pending, runLog, runId) {
|
|
|
1167
1209
|
}
|
|
1168
1210
|
await runLog.release(runId, lease.generation);
|
|
1169
1211
|
})
|
|
1170
|
-
.catch((err) =>
|
|
1212
|
+
.catch((err) => HarnessLog.info('aborted run-log begin cleanup failed', {
|
|
1171
1213
|
runId,
|
|
1172
1214
|
message: errorMessage(err)
|
|
1173
1215
|
}));
|
|
@@ -1256,15 +1298,15 @@ async function* frames(stream) {
|
|
|
1256
1298
|
let error = null;
|
|
1257
1299
|
stream.on('data', (frame) => queue.push(frame));
|
|
1258
1300
|
stream.on('end', () => {
|
|
1259
|
-
|
|
1301
|
+
HarnessLog.debug('client stream event', { event: 'end' });
|
|
1260
1302
|
queue.end();
|
|
1261
1303
|
});
|
|
1262
1304
|
stream.on('close', () => {
|
|
1263
|
-
|
|
1305
|
+
HarnessLog.debug('client stream event', { event: 'close' });
|
|
1264
1306
|
queue.end();
|
|
1265
1307
|
});
|
|
1266
1308
|
stream.on('error', (err) => {
|
|
1267
|
-
|
|
1309
|
+
HarnessLog.warn('client stream event', { event: 'error', err: err.message });
|
|
1268
1310
|
error = err;
|
|
1269
1311
|
queue.end();
|
|
1270
1312
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Message } from './contract/index.ts';
|
|
2
2
|
export declare const TOOL_RESULT_TRUNCATION_MARKER = "\n[tool result truncated for context]\n";
|
|
3
|
+
export declare const TOOL_SEARCH_RESULT = "{\"tool_search\":";
|
|
3
4
|
export declare function compactedFrom(message: Message): Message | undefined;
|
|
4
5
|
export interface ContextCandidate {
|
|
5
6
|
history: Message[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { Fold } from './fold/index.js';
|
|
1
2
|
export const TOOL_RESULT_TRUNCATION_MARKER = '\n[tool result truncated for context]\n';
|
|
2
|
-
const TOOL_SEARCH_RESULT = '{"tool_search":';
|
|
3
|
+
export const TOOL_SEARCH_RESULT = '{"tool_search":';
|
|
3
4
|
const compactedSources = new WeakMap();
|
|
4
5
|
export function compactedFrom(message) {
|
|
5
6
|
return compactedSources.get(message);
|
|
6
7
|
}
|
|
7
8
|
export function contextCandidates(history, ...nudges) {
|
|
8
|
-
const isBoundary = (message) => message
|
|
9
|
-
!nudges.some((nudge) => message.content === nudge || message.content.startsWith(`${nudge}\nPlan:\n`));
|
|
9
|
+
const isBoundary = (message) => Fold.isTurn(message, nudges);
|
|
10
10
|
const { prefix, turns } = splitTurns(history, isBoundary);
|
|
11
11
|
if (!turns.length) {
|
|
12
12
|
return [{ history, droppedTurns: 0 }];
|
|
@@ -2,6 +2,7 @@ import type { LlmGenerationParams } from '../models/llm-presets.ts';
|
|
|
2
2
|
import type { DriveRoot } from '../tools/fs/scope.ts';
|
|
3
3
|
import type { CliValidator } from '../tools/skills/cli-schema-types.ts';
|
|
4
4
|
import type { AgentConfig, ResponseFormat, ToolDefinition } from './completion.ts';
|
|
5
|
+
import type { CompiledPolicy } from './policy.ts';
|
|
5
6
|
import type { Message } from './run.ts';
|
|
6
7
|
export type { LlmGenerationParams };
|
|
7
8
|
export interface AgentSkill {
|
|
@@ -22,7 +23,6 @@ export interface SkillActivation {
|
|
|
22
23
|
loadedSkills: ReadonlySet<string>;
|
|
23
24
|
}
|
|
24
25
|
export interface AgentPolicy {
|
|
25
|
-
readonly sandbox: boolean;
|
|
26
26
|
readonly skipApprovals: boolean;
|
|
27
27
|
}
|
|
28
28
|
export interface AgentPorts<Skill extends AgentSkill = AgentSkill> {
|
|
@@ -32,16 +32,18 @@ export interface AgentPorts<Skill extends AgentSkill = AgentSkill> {
|
|
|
32
32
|
toolNames: readonly string[];
|
|
33
33
|
skills: readonly Skill[];
|
|
34
34
|
}): SystemPromptParts;
|
|
35
|
-
mention(
|
|
36
|
-
implicitSkill(
|
|
35
|
+
mention(text: string, skills: readonly Skill[]): Skill | null;
|
|
36
|
+
implicitSkill(text: string, skills: readonly Skill[]): Skill | null;
|
|
37
37
|
}
|
|
38
38
|
export interface AgentRequest<Skill extends AgentSkill = AgentSkill> {
|
|
39
39
|
readonly agent: AgentConfig | undefined;
|
|
40
40
|
readonly model: string | undefined;
|
|
41
|
+
readonly capabilityProfile?: string | undefined;
|
|
41
42
|
readonly thinkingDefault?: string | undefined;
|
|
42
43
|
readonly generationParams?: LlmGenerationParams | undefined;
|
|
43
44
|
readonly responseFormat?: ResponseFormat | undefined;
|
|
44
45
|
readonly messages: readonly Message[];
|
|
46
|
+
readonly userText: string;
|
|
45
47
|
readonly tools: readonly ToolDefinition[];
|
|
46
48
|
readonly skills: readonly Skill[];
|
|
47
49
|
readonly loadedSkills: ReadonlySet<string>;
|
|
@@ -49,6 +51,7 @@ export interface AgentRequest<Skill extends AgentSkill = AgentSkill> {
|
|
|
49
51
|
readonly fsWriteRoots: readonly DriveRoot[];
|
|
50
52
|
readonly planning?: boolean;
|
|
51
53
|
readonly planMode?: boolean;
|
|
54
|
+
readonly policy?: CompiledPolicy;
|
|
52
55
|
}
|
|
53
56
|
export interface ResolvedAgent<Skill extends AgentSkill = AgentSkill> {
|
|
54
57
|
readonly enabled: ToolDefinition[];
|
|
@@ -62,4 +65,5 @@ export interface ResolvedAgent<Skill extends AgentSkill = AgentSkill> {
|
|
|
62
65
|
readonly generationParams: LlmGenerationParams | undefined;
|
|
63
66
|
readonly policy: AgentPolicy;
|
|
64
67
|
select(loadedSkills: ReadonlySet<string>): ToolDefinition[];
|
|
68
|
+
systemFor(loadedSkills: ReadonlySet<string>): SystemPromptParts;
|
|
65
69
|
}
|