@qvac/harness 0.1.0 → 0.1.1
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/dist/harness.bundle +8 -59
- package/dist/prebuilds-manifest.json +0 -8
- package/dist-lib/index.d.ts +240 -0
- package/dist-lib/index.js +1063 -0
- package/dist-lib/lib/audio-transcode-bare.d.ts +2 -0
- package/dist-lib/lib/audio-transcode-bare.js +145 -0
- package/dist-lib/lib/audio-transcode-node.d.ts +2 -0
- package/dist-lib/lib/audio-transcode-node.js +6 -0
- package/dist-lib/lib/capabilities/audio-resample.d.ts +14 -0
- package/dist-lib/lib/capabilities/audio-resample.js +72 -0
- package/dist-lib/lib/capabilities/completion.d.ts +288 -0
- package/dist-lib/lib/capabilities/completion.js +1077 -0
- package/dist-lib/lib/capabilities/download.d.ts +46 -0
- package/dist-lib/lib/capabilities/download.js +124 -0
- package/dist-lib/lib/capabilities/embed.d.ts +20 -0
- package/dist-lib/lib/capabilities/embed.js +13 -0
- package/dist-lib/lib/capabilities/kv-cache.d.ts +13 -0
- package/dist-lib/lib/capabilities/kv-cache.js +21 -0
- package/dist-lib/lib/capabilities/prompt-prefix.d.ts +6 -0
- package/dist-lib/lib/capabilities/prompt-prefix.js +10 -0
- package/dist-lib/lib/capabilities/speech-lexicon.d.ts +5 -0
- package/dist-lib/lib/capabilities/speech-lexicon.js +32 -0
- package/dist-lib/lib/capabilities/speech-text.d.ts +6 -0
- package/dist-lib/lib/capabilities/speech-text.js +79 -0
- package/dist-lib/lib/capabilities/tool-names.d.ts +3 -0
- package/dist-lib/lib/capabilities/tool-names.js +3 -0
- package/dist-lib/lib/capabilities/tool-selection.d.ts +43 -0
- package/dist-lib/lib/capabilities/tool-selection.js +60 -0
- package/dist-lib/lib/capabilities/tool-turns.d.ts +9 -0
- package/dist-lib/lib/capabilities/tool-turns.js +101 -0
- package/dist-lib/lib/capabilities/usage-breakdown.d.ts +27 -0
- package/dist-lib/lib/capabilities/usage-breakdown.js +44 -0
- package/dist-lib/lib/capabilities/vision-history.d.ts +3 -0
- package/dist-lib/lib/capabilities/vision-history.js +21 -0
- package/dist-lib/lib/capabilities/voice.d.ts +78 -0
- package/dist-lib/lib/capabilities/voice.js +189 -0
- package/dist-lib/lib/connect.d.ts +76 -0
- package/dist-lib/lib/connect.js +789 -0
- package/dist-lib/lib/context-window.d.ts +7 -0
- package/dist-lib/lib/context-window.js +90 -0
- package/dist-lib/lib/contract-types.d.ts +210 -0
- package/dist-lib/lib/contract-types.js +1 -0
- package/dist-lib/lib/diagram-repair.d.ts +21 -0
- package/dist-lib/lib/diagram-repair.js +58 -0
- package/dist-lib/lib/dns-lookup.d.ts +1 -0
- package/dist-lib/lib/dns-lookup.js +13 -0
- package/dist-lib/lib/error-fields.d.ts +2 -0
- package/dist-lib/lib/error-fields.js +8 -0
- package/dist-lib/lib/fetch-node.d.ts +1 -0
- package/dist-lib/lib/fetch-node.js +1 -0
- package/dist-lib/lib/hardware/capability-probe.d.ts +9 -0
- package/dist-lib/lib/hardware/capability-probe.js +99 -0
- package/dist-lib/lib/hardware/gpu-classify.d.ts +2 -0
- package/dist-lib/lib/hardware/gpu-classify.js +32 -0
- package/dist-lib/lib/hardware/gpu-probe-addon.d.ts +2 -0
- package/dist-lib/lib/hardware/gpu-probe-addon.js +42 -0
- package/dist-lib/lib/hardware/gpu-stats.bare.d.ts +1 -0
- package/dist-lib/lib/hardware/gpu-stats.bare.js +24 -0
- package/dist-lib/lib/hardware/gpu-stats.stub.d.ts +1 -0
- package/dist-lib/lib/hardware/gpu-stats.stub.js +3 -0
- package/dist-lib/lib/hardware/memory-budget.d.ts +8 -0
- package/dist-lib/lib/hardware/memory-budget.js +1 -0
- package/dist-lib/lib/hardware/parsers.d.ts +7 -0
- package/dist-lib/lib/hardware/parsers.js +41 -0
- package/dist-lib/lib/headers-bare.d.ts +1 -0
- package/dist-lib/lib/headers-bare.js +1 -0
- package/dist-lib/lib/headers-node.d.ts +4 -0
- package/dist-lib/lib/headers-node.js +1 -0
- package/dist-lib/lib/helpers/buffer-burst.d.ts +1 -0
- package/dist-lib/lib/helpers/buffer-burst.js +20 -0
- package/dist-lib/lib/helpers/control-tokens.d.ts +7 -0
- package/dist-lib/lib/helpers/control-tokens.js +32 -0
- package/dist-lib/lib/helpers/join-guard.d.ts +6 -0
- package/dist-lib/lib/helpers/join-guard.js +46 -0
- package/dist-lib/lib/helpers/markup-stream-filter.d.ts +5 -0
- package/dist-lib/lib/helpers/markup-stream-filter.js +75 -0
- package/dist-lib/lib/helpers/race-abort.d.ts +5 -0
- package/dist-lib/lib/helpers/race-abort.js +18 -0
- package/dist-lib/lib/helpers/retry-memo.d.ts +5 -0
- package/dist-lib/lib/helpers/retry-memo.js +12 -0
- package/dist-lib/lib/helpers/run-outcome.d.ts +33 -0
- package/dist-lib/lib/helpers/run-outcome.js +204 -0
- package/dist-lib/lib/helpers/spawn-path.d.ts +5 -0
- package/dist-lib/lib/helpers/spawn-path.js +57 -0
- package/dist-lib/lib/helpers/text-coalescer.d.ts +15 -0
- package/dist-lib/lib/helpers/text-coalescer.js +34 -0
- package/dist-lib/lib/helpers/thinking.d.ts +8 -0
- package/dist-lib/lib/helpers/thinking.js +95 -0
- package/dist-lib/lib/helpers/tool-call-markup.d.ts +20 -0
- package/dist-lib/lib/helpers/tool-call-markup.js +201 -0
- package/dist-lib/lib/helpers/tool-intent.d.ts +7 -0
- package/dist-lib/lib/helpers/tool-intent.js +21 -0
- package/dist-lib/lib/helpers/tool-label.d.ts +8 -0
- package/dist-lib/lib/helpers/tool-label.js +131 -0
- package/dist-lib/lib/hooks/built-in/arg-repair.d.ts +5 -0
- package/dist-lib/lib/hooks/built-in/arg-repair.js +88 -0
- package/dist-lib/lib/hooks/built-in/egress.d.ts +5 -0
- package/dist-lib/lib/hooks/built-in/egress.js +29 -0
- package/dist-lib/lib/hooks/built-in/index.d.ts +3 -0
- package/dist-lib/lib/hooks/built-in/index.js +3 -0
- package/dist-lib/lib/hooks/built-in/skill-catalog.d.ts +10 -0
- package/dist-lib/lib/hooks/built-in/skill-catalog.js +17 -0
- package/dist-lib/lib/hooks/pipeline.d.ts +20 -0
- package/dist-lib/lib/hooks/pipeline.js +49 -0
- package/dist-lib/lib/hooks/registry.d.ts +2 -0
- package/dist-lib/lib/hooks/registry.js +6 -0
- package/dist-lib/lib/hooks/run.d.ts +5 -0
- package/dist-lib/lib/hooks/run.js +83 -0
- package/dist-lib/lib/hooks/types.d.ts +57 -0
- package/dist-lib/lib/hooks/types.js +1 -0
- package/dist-lib/lib/log.d.ts +5 -0
- package/dist-lib/lib/log.js +37 -0
- package/dist-lib/lib/model-download-progress.d.ts +22 -0
- package/dist-lib/lib/model-download-progress.js +95 -0
- package/dist-lib/lib/models/context.d.ts +5 -0
- package/dist-lib/lib/models/context.js +12 -0
- package/dist-lib/lib/models/embed-config.d.ts +14 -0
- package/dist-lib/lib/models/embed-config.js +31 -0
- package/dist-lib/lib/models/gpu-selection.d.ts +3 -0
- package/dist-lib/lib/models/gpu-selection.js +26 -0
- package/dist-lib/lib/models/kv-cache.d.ts +4 -0
- package/dist-lib/lib/models/kv-cache.js +6 -0
- package/dist-lib/lib/models/llm-presets.d.ts +10 -0
- package/dist-lib/lib/models/llm-presets.js +58 -0
- package/dist-lib/lib/models/model-catalog-constants.d.ts +29 -0
- package/dist-lib/lib/models/model-catalog-constants.js +103 -0
- package/dist-lib/lib/models/model-catalog.d.ts +125 -0
- package/dist-lib/lib/models/model-catalog.js +371 -0
- package/dist-lib/lib/models/model-delete.d.ts +18 -0
- package/dist-lib/lib/models/model-delete.js +47 -0
- package/dist-lib/lib/models/model-handle.d.ts +18 -0
- package/dist-lib/lib/models/model-handle.js +33 -0
- package/dist-lib/lib/models/model-list.d.ts +42 -0
- package/dist-lib/lib/models/model-list.js +123 -0
- package/dist-lib/lib/models/model-pool.d.ts +116 -0
- package/dist-lib/lib/models/model-pool.js +356 -0
- package/dist-lib/lib/models/model-source.d.ts +6 -0
- package/dist-lib/lib/models/model-source.js +21 -0
- package/dist-lib/lib/models/music-catalog.d.ts +12 -0
- package/dist-lib/lib/models/music-catalog.js +26 -0
- package/dist-lib/lib/models/opencl-cache.d.ts +5 -0
- package/dist-lib/lib/models/opencl-cache.js +50 -0
- package/dist-lib/lib/models/sdk-faults.d.ts +21 -0
- package/dist-lib/lib/models/sdk-faults.js +66 -0
- package/dist-lib/lib/models/tool-dialect.d.ts +2 -0
- package/dist-lib/lib/models/tool-dialect.js +19 -0
- package/dist-lib/lib/models/tts-model-default.d.ts +3 -0
- package/dist-lib/lib/models/tts-model-default.js +13 -0
- package/dist-lib/lib/no-redirect-fetch-bare.d.ts +15 -0
- package/dist-lib/lib/no-redirect-fetch-bare.js +59 -0
- package/dist-lib/lib/no-redirect-fetch-impl.d.ts +39 -0
- package/dist-lib/lib/no-redirect-fetch-impl.js +80 -0
- package/dist-lib/lib/no-redirect-fetch-node.d.ts +4 -0
- package/dist-lib/lib/no-redirect-fetch-node.js +52 -0
- package/dist-lib/lib/prompt.d.ts +22 -0
- package/dist-lib/lib/prompt.js +77 -0
- package/dist-lib/lib/queue.d.ts +9 -0
- package/dist-lib/lib/queue.js +48 -0
- package/dist-lib/lib/resolution-detector.d.ts +5 -0
- package/dist-lib/lib/resolution-detector.js +100 -0
- package/dist-lib/lib/rpc-session.d.ts +8 -0
- package/dist-lib/lib/rpc-session.js +20 -0
- package/dist-lib/lib/sdk-config-loader.node.d.ts +1 -0
- package/dist-lib/lib/sdk-config-loader.node.js +1 -0
- package/dist-lib/lib/sdk-loader.d.ts +30 -0
- package/dist-lib/lib/sdk-loader.js +53 -0
- package/dist-lib/lib/sdk-storage.d.ts +8 -0
- package/dist-lib/lib/sdk-storage.js +24 -0
- package/dist-lib/lib/serve.d.ts +3 -0
- package/dist-lib/lib/serve.js +612 -0
- package/dist-lib/lib/spawn.d.ts +62 -0
- package/dist-lib/lib/spawn.js +71 -0
- package/dist-lib/lib/staging.d.ts +4 -0
- package/dist-lib/lib/staging.js +28 -0
- package/dist-lib/lib/storage.d.ts +18 -0
- package/dist-lib/lib/storage.js +26 -0
- package/dist-lib/lib/tmp-path.d.ts +7 -0
- package/dist-lib/lib/tmp-path.js +17 -0
- package/dist-lib/lib/tool-call-display.d.ts +21 -0
- package/dist-lib/lib/tool-call-display.js +1 -0
- package/dist-lib/lib/tools/catalog.d.ts +13 -0
- package/dist-lib/lib/tools/catalog.js +13 -0
- package/dist-lib/lib/tools/create-documents.d.ts +3 -0
- package/dist-lib/lib/tools/create-documents.js +87 -0
- package/dist-lib/lib/tools/edit-documents.d.ts +3 -0
- package/dist-lib/lib/tools/edit-documents.js +122 -0
- package/dist-lib/lib/tools/edit-image.d.ts +25 -0
- package/dist-lib/lib/tools/edit-image.js +271 -0
- package/dist-lib/lib/tools/exec/adapters/adapter.d.ts +27 -0
- package/dist-lib/lib/tools/exec/adapters/adapter.js +1 -0
- package/dist-lib/lib/tools/exec/adapters/python/attachments.d.ts +26 -0
- package/dist-lib/lib/tools/exec/adapters/python/attachments.js +160 -0
- package/dist-lib/lib/tools/exec/adapters/python/create-effect.d.ts +7 -0
- package/dist-lib/lib/tools/exec/adapters/python/create-effect.js +290 -0
- package/dist-lib/lib/tools/exec/adapters/python/loader.d.ts +11 -0
- package/dist-lib/lib/tools/exec/adapters/python/loader.js +94 -0
- package/dist-lib/lib/tools/exec/adapters/python/memfs.d.ts +47 -0
- package/dist-lib/lib/tools/exec/adapters/python/memfs.js +85 -0
- package/dist-lib/lib/tools/exec/adapters/python/output-policy.d.ts +13 -0
- package/dist-lib/lib/tools/exec/adapters/python/output-policy.js +129 -0
- package/dist-lib/lib/tools/exec/adapters/python/pyodide.d.ts +19 -0
- package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +107 -0
- package/dist-lib/lib/tools/exec/adapters/python/python-adapter.d.ts +75 -0
- package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +1094 -0
- package/dist-lib/lib/tools/exec/adapters/python/run-session.d.ts +75 -0
- package/dist-lib/lib/tools/exec/adapters/python/run-session.js +273 -0
- package/dist-lib/lib/tools/exec/adapters/python/wheels.d.ts +38 -0
- package/dist-lib/lib/tools/exec/adapters/python/wheels.js +102 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/client.d.ts +7 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +188 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/entry.d.ts +1 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +105 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.d.ts +38 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/protocol.js +41 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.d.ts +2 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-bare.js +30 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.d.ts +13 -0
- package/dist-lib/lib/tools/exec/adapters/python/worker/spawn-node.js +45 -0
- package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.d.ts +12 -0
- package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +20 -0
- package/dist-lib/lib/tools/exec/obsidian/cli-process.d.ts +8 -0
- package/dist-lib/lib/tools/exec/obsidian/cli-process.js +74 -0
- package/dist-lib/lib/tools/exec/obsidian/cli.d.ts +18 -0
- package/dist-lib/lib/tools/exec/obsidian/cli.js +153 -0
- package/dist-lib/lib/tools/exec/obsidian/command.d.ts +5 -0
- package/dist-lib/lib/tools/exec/obsidian/command.js +18 -0
- package/dist-lib/lib/tools/exec/obsidian/guidance.d.ts +5 -0
- package/dist-lib/lib/tools/exec/obsidian/guidance.js +18 -0
- package/dist-lib/lib/tools/exec/obsidian/note-name.d.ts +1 -0
- package/dist-lib/lib/tools/exec/obsidian/note-name.js +6 -0
- package/dist-lib/lib/tools/exec/obsidian/output.d.ts +1 -0
- package/dist-lib/lib/tools/exec/obsidian/output.js +31 -0
- package/dist-lib/lib/tools/exec/obsidian/route.d.ts +19 -0
- package/dist-lib/lib/tools/exec/obsidian/route.js +85 -0
- package/dist-lib/lib/tools/exec/obsidian/safe-path.d.ts +3 -0
- package/dist-lib/lib/tools/exec/obsidian/safe-path.js +56 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-create.d.ts +1 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-create.js +40 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-fs.d.ts +3 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-fs.js +57 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-paths.d.ts +20 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-paths.js +171 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-read.d.ts +11 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-read.js +119 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-write.d.ts +7 -0
- package/dist-lib/lib/tools/exec/obsidian/vault-write.js +134 -0
- package/dist-lib/lib/tools/exec/runner.d.ts +62 -0
- package/dist-lib/lib/tools/exec/runner.js +87 -0
- package/dist-lib/lib/tools/exec/scope.d.ts +3 -0
- package/dist-lib/lib/tools/exec/scope.js +97 -0
- package/dist-lib/lib/tools/exec/shell-argv.d.ts +2 -0
- package/dist-lib/lib/tools/exec/shell-argv.js +48 -0
- package/dist-lib/lib/tools/exec.d.ts +29 -0
- package/dist-lib/lib/tools/exec.js +459 -0
- package/dist-lib/lib/tools/file-glob.d.ts +15 -0
- package/dist-lib/lib/tools/file-glob.js +112 -0
- package/dist-lib/lib/tools/fs/drive.d.ts +26 -0
- package/dist-lib/lib/tools/fs/drive.js +1 -0
- package/dist-lib/lib/tools/fs/glob.d.ts +1 -0
- package/dist-lib/lib/tools/fs/glob.js +34 -0
- package/dist-lib/lib/tools/fs/local.d.ts +2 -0
- package/dist-lib/lib/tools/fs/local.js +29 -0
- package/dist-lib/lib/tools/fs/read.d.ts +2 -0
- package/dist-lib/lib/tools/fs/read.js +17 -0
- package/dist-lib/lib/tools/fs/remote-protocol.d.ts +40 -0
- package/dist-lib/lib/tools/fs/remote-protocol.js +1 -0
- package/dist-lib/lib/tools/fs/remote.d.ts +17 -0
- package/dist-lib/lib/tools/fs/remote.js +131 -0
- package/dist-lib/lib/tools/fs/scope.d.ts +37 -0
- package/dist-lib/lib/tools/fs/scope.js +130 -0
- package/dist-lib/lib/tools/fs/walk.d.ts +15 -0
- package/dist-lib/lib/tools/fs/walk.js +38 -0
- package/dist-lib/lib/tools/fs/write.d.ts +4 -0
- package/dist-lib/lib/tools/fs/write.js +5 -0
- package/dist-lib/lib/tools/generate-image.d.ts +111 -0
- package/dist-lib/lib/tools/generate-image.js +369 -0
- package/dist-lib/lib/tools/generate-music.d.ts +124 -0
- package/dist-lib/lib/tools/generate-music.js +522 -0
- package/dist-lib/lib/tools/grep.d.ts +5 -0
- package/dist-lib/lib/tools/grep.js +158 -0
- package/dist-lib/lib/tools/http-methods.d.ts +1 -0
- package/dist-lib/lib/tools/http-methods.js +1 -0
- package/dist-lib/lib/tools/http-request/encode-fields.d.ts +2 -0
- package/dist-lib/lib/tools/http-request/encode-fields.js +69 -0
- package/dist-lib/lib/tools/http-request/truncate-response.d.ts +1 -0
- package/dist-lib/lib/tools/http-request/truncate-response.js +83 -0
- package/dist-lib/lib/tools/http-request/utils.d.ts +27 -0
- package/dist-lib/lib/tools/http-request/utils.js +84 -0
- package/dist-lib/lib/tools/http-request.d.ts +20 -0
- package/dist-lib/lib/tools/http-request.js +177 -0
- package/dist-lib/lib/tools/mcp/utils.d.ts +47 -0
- package/dist-lib/lib/tools/mcp/utils.js +172 -0
- package/dist-lib/lib/tools/mcp-call.d.ts +14 -0
- package/dist-lib/lib/tools/mcp-call.js +155 -0
- package/dist-lib/lib/tools/model-args.d.ts +1 -0
- package/dist-lib/lib/tools/model-args.js +4 -0
- package/dist-lib/lib/tools/operations/builders.d.ts +17 -0
- package/dist-lib/lib/tools/operations/builders.js +179 -0
- package/dist-lib/lib/tools/operations/compile.d.ts +7 -0
- package/dist-lib/lib/tools/operations/compile.js +92 -0
- package/dist-lib/lib/tools/operations/gmail-message.d.ts +15 -0
- package/dist-lib/lib/tools/operations/gmail-message.js +62 -0
- package/dist-lib/lib/tools/operations/manifest.d.ts +60 -0
- package/dist-lib/lib/tools/operations/manifest.js +50 -0
- package/dist-lib/lib/tools/outbound-guard.d.ts +10 -0
- package/dist-lib/lib/tools/outbound-guard.js +127 -0
- package/dist-lib/lib/tools/private-ip.d.ts +4 -0
- package/dist-lib/lib/tools/private-ip.js +126 -0
- package/dist-lib/lib/tools/rag-search.d.ts +2 -0
- package/dist-lib/lib/tools/rag-search.js +98 -0
- package/dist-lib/lib/tools/read-files.d.ts +5 -0
- package/dist-lib/lib/tools/read-files.js +153 -0
- package/dist-lib/lib/tools/skill.d.ts +10 -0
- package/dist-lib/lib/tools/skill.js +123 -0
- package/dist-lib/lib/tools/skills/auth-resolver.d.ts +43 -0
- package/dist-lib/lib/tools/skills/auth-resolver.js +121 -0
- package/dist-lib/lib/tools/skills/bin-check.d.ts +9 -0
- package/dist-lib/lib/tools/skills/bin-check.js +56 -0
- package/dist-lib/lib/tools/skills/bundled-dir.d.ts +2 -0
- package/dist-lib/lib/tools/skills/bundled-dir.js +117 -0
- package/dist-lib/lib/tools/skills/bundled-hash.d.ts +4 -0
- package/dist-lib/lib/tools/skills/bundled-hash.js +12 -0
- package/dist-lib/lib/tools/skills/catalog.d.ts +60 -0
- package/dist-lib/lib/tools/skills/catalog.js +203 -0
- package/dist-lib/lib/tools/skills/cli-argv.d.ts +9 -0
- package/dist-lib/lib/tools/skills/cli-argv.js +147 -0
- package/dist-lib/lib/tools/skills/cli-schema-check.d.ts +3 -0
- package/dist-lib/lib/tools/skills/cli-schema-check.js +62 -0
- package/dist-lib/lib/tools/skills/cli-schema-load.d.ts +4 -0
- package/dist-lib/lib/tools/skills/cli-schema-load.js +90 -0
- package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +30 -0
- package/dist-lib/lib/tools/skills/cli-schema-types.js +1 -0
- package/dist-lib/lib/tools/skills/cli-schema.d.ts +7 -0
- package/dist-lib/lib/tools/skills/cli-schema.js +35 -0
- package/dist-lib/lib/tools/skills/credential-check.d.ts +20 -0
- package/dist-lib/lib/tools/skills/credential-check.js +94 -0
- package/dist-lib/lib/tools/skills/credential-grants.d.ts +9 -0
- package/dist-lib/lib/tools/skills/credential-grants.js +25 -0
- package/dist-lib/lib/tools/skills/credential-health.d.ts +8 -0
- package/dist-lib/lib/tools/skills/credential-health.js +51 -0
- package/dist-lib/lib/tools/skills/credential-slots.d.ts +7 -0
- package/dist-lib/lib/tools/skills/credential-slots.js +8 -0
- package/dist-lib/lib/tools/skills/frontmatter-parser.d.ts +23 -0
- package/dist-lib/lib/tools/skills/frontmatter-parser.js +68 -0
- package/dist-lib/lib/tools/skills/index.d.ts +5 -0
- package/dist-lib/lib/tools/skills/index.js +5 -0
- package/dist-lib/lib/tools/skills/manifest-parse.d.ts +12 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +199 -0
- package/dist-lib/lib/tools/skills/manifest.d.ts +47 -0
- package/dist-lib/lib/tools/skills/manifest.js +1 -0
- package/dist-lib/lib/tools/skills/mention-name.d.ts +1 -0
- package/dist-lib/lib/tools/skills/mention-name.js +4 -0
- package/dist-lib/lib/tools/skills/mention.d.ts +6 -0
- package/dist-lib/lib/tools/skills/mention.js +42 -0
- package/dist-lib/lib/tools/skills/obsidian-readiness.d.ts +16 -0
- package/dist-lib/lib/tools/skills/obsidian-readiness.js +95 -0
- package/dist-lib/lib/tools/skills/overlay-crud.d.ts +18 -0
- package/dist-lib/lib/tools/skills/overlay-crud.js +98 -0
- package/dist-lib/lib/tools/skills/overlay-dir.d.ts +2 -0
- package/dist-lib/lib/tools/skills/overlay-dir.js +22 -0
- package/dist-lib/lib/tools/skills/overlay-watch.d.ts +13 -0
- package/dist-lib/lib/tools/skills/overlay-watch.js +44 -0
- package/dist-lib/lib/tools/skills/scope-key.d.ts +7 -0
- package/dist-lib/lib/tools/skills/scope-key.js +7 -0
- package/dist-lib/lib/tools/skills/setup-routes.d.ts +4 -0
- package/dist-lib/lib/tools/skills/setup-routes.js +14 -0
- package/dist-lib/lib/tools/skills/skill-settings.d.ts +16 -0
- package/dist-lib/lib/tools/skills/skill-settings.js +33 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.d.ts +12 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.js +14 -0
- package/dist-lib/lib/tools/skills/skill-state.d.ts +40 -0
- package/dist-lib/lib/tools/skills/skill-state.js +117 -0
- package/dist-lib/lib/tools/skills/tool-grants.d.ts +5 -0
- package/dist-lib/lib/tools/skills/tool-grants.js +14 -0
- package/dist-lib/lib/tools/toolsets.d.ts +8 -0
- package/dist-lib/lib/tools/toolsets.js +20 -0
- package/dist-lib/lib/tools/url-guard.d.ts +8 -0
- package/dist-lib/lib/tools/url-guard.js +40 -0
- package/dist-lib/lib/tools/web-fetch.d.ts +8 -0
- package/dist-lib/lib/tools/web-fetch.js +302 -0
- package/dist-lib/lib/tools/web-search.d.ts +6 -0
- package/dist-lib/lib/tools/web-search.js +55 -0
- package/dist-lib/lib/transport.d.ts +12 -0
- package/dist-lib/lib/transport.js +59 -0
- package/dist-lib/lib/user-agent.d.ts +1 -0
- package/dist-lib/lib/user-agent.js +1 -0
- package/dist-lib/lib/validating-lookup.d.ts +17 -0
- package/dist-lib/lib/validating-lookup.js +25 -0
- package/dist-lib/lib/wav-encode.d.ts +5 -0
- package/dist-lib/lib/wav-encode.js +24 -0
- package/dist-lib/lib/web-fetch/embedded-state.d.ts +1 -0
- package/dist-lib/lib/web-fetch/embedded-state.js +131 -0
- package/dist-lib/lib/web-fetch/extract.d.ts +6 -0
- package/dist-lib/lib/web-fetch/extract.js +65 -0
- package/dist-lib/lib/web-fetch/images.d.ts +3 -0
- package/dist-lib/lib/web-fetch/images.js +43 -0
- package/dist-lib/lib/web-fetch/video.d.ts +5 -0
- package/dist-lib/lib/web-fetch/video.js +42 -0
- package/dist-lib/lib/web-search/engine-registry.d.ts +7 -0
- package/dist-lib/lib/web-search/engine-registry.js +17 -0
- package/dist-lib/lib/web-search/engines/aol.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/aol.js +81 -0
- package/dist-lib/lib/web-search/engines/bing.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/bing.js +111 -0
- package/dist-lib/lib/web-search/engines/brave.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/brave.js +59 -0
- package/dist-lib/lib/web-search/engines/duckduckgo.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/duckduckgo.js +112 -0
- package/dist-lib/lib/web-search/engines/google.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/google.js +92 -0
- package/dist-lib/lib/web-search/engines/wikipedia.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/wikipedia.js +37 -0
- package/dist-lib/lib/web-search/engines/yahoo.d.ts +3 -0
- package/dist-lib/lib/web-search/engines/yahoo.js +81 -0
- package/dist-lib/lib/web-search/fetch-html.d.ts +25 -0
- package/dist-lib/lib/web-search/fetch-html.js +97 -0
- package/dist-lib/lib/web-search/format-results.d.ts +3 -0
- package/dist-lib/lib/web-search/format-results.js +14 -0
- package/dist-lib/lib/web-search/html-helpers.d.ts +3 -0
- package/dist-lib/lib/web-search/html-helpers.js +24 -0
- package/dist-lib/lib/web-search/merge-results.d.ts +2 -0
- package/dist-lib/lib/web-search/merge-results.js +53 -0
- package/dist-lib/lib/web-search/orchestrator.d.ts +14 -0
- package/dist-lib/lib/web-search/orchestrator.js +50 -0
- package/dist-lib/lib/web-search/types.d.ts +34 -0
- package/dist-lib/lib/web-search/types.js +1 -0
- package/dist-lib/lib/web-search/url-helpers.d.ts +1 -0
- package/dist-lib/lib/web-search/url-helpers.js +11 -0
- package/dist-lib/lib/web-search/url-normalize.d.ts +1 -0
- package/dist-lib/lib/web-search/url-normalize.js +25 -0
- package/dist-lib/lib/web-search/user-agents.d.ts +3 -0
- package/dist-lib/lib/web-search/user-agents.js +3 -0
- package/dist-lib/lib/wire.d.ts +50 -0
- package/dist-lib/lib/wire.js +145 -0
- package/dist-lib/schema/baseline.d.ts +8 -0
- package/dist-lib/schema/baseline.js +35 -0
- package/dist-lib/schema/build.d.ts +1 -0
- package/dist-lib/schema/build.js +39 -0
- package/dist-lib/schema/generate.d.ts +20 -0
- package/dist-lib/schema/generate.js +149 -0
- package/dist-lib/schema/harness.d.ts +2 -0
- package/dist-lib/schema/harness.js +745 -0
- package/dist-lib/schema/release-tags.d.ts +5 -0
- package/dist-lib/schema/release-tags.js +58 -0
- package/dist-lib/spec/bind.d.ts +2 -0
- package/dist-lib/spec/bind.js +124 -0
- package/dist-lib/spec/calls.d.ts +3 -0
- package/dist-lib/spec/calls.js +41 -0
- package/dist-lib/spec/hrpc/hrpc.json +356 -0
- package/dist-lib/spec/hrpc/index.d.ts +3 -0
- package/dist-lib/spec/hrpc/index.js +463 -0
- package/dist-lib/spec/hrpc/messages.d.ts +4 -0
- package/dist-lib/spec/hrpc/messages.js +3102 -0
- package/dist-lib/spec/hyperschema/index.js +3102 -0
- package/dist-lib/spec/hyperschema/schema.json +2290 -0
- package/dist-lib/spec/hyperschema/types.d.ts +554 -0
- package/dist-lib/spec/index.d.ts +8 -0
- package/dist-lib/spec/index.js +1 -0
- package/package.json +239 -64
- package/.gitattributes +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import ffmpeg from 'bare-ffmpeg';
|
|
2
|
+
import { hlog } from "./log.js";
|
|
3
|
+
import { buildWavBuffer, TARGET_SAMPLE_RATE } from "./wav-encode.js";
|
|
4
|
+
function bufferReadIO(input) {
|
|
5
|
+
let offset = 0;
|
|
6
|
+
return new ffmpeg.IOContext(Buffer.alloc(4096), {
|
|
7
|
+
onread: (buffer, requested) => {
|
|
8
|
+
const remaining = input.length - offset;
|
|
9
|
+
if (remaining <= 0)
|
|
10
|
+
return 0;
|
|
11
|
+
const n = Math.min(requested, remaining);
|
|
12
|
+
buffer.set(input.subarray(offset, offset + n));
|
|
13
|
+
offset += n;
|
|
14
|
+
return n;
|
|
15
|
+
},
|
|
16
|
+
onseek: (o, whence) => {
|
|
17
|
+
if (whence === ffmpeg.constants.seek.SIZE)
|
|
18
|
+
return input.length;
|
|
19
|
+
if (whence === ffmpeg.constants.seek.SET) {
|
|
20
|
+
offset = o;
|
|
21
|
+
}
|
|
22
|
+
else if (whence === ffmpeg.constants.seek.CUR) {
|
|
23
|
+
offset += o;
|
|
24
|
+
}
|
|
25
|
+
else if (whence === ffmpeg.constants.seek.END) {
|
|
26
|
+
offset = input.length + o;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return -1;
|
|
30
|
+
}
|
|
31
|
+
return offset;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function makeOutFrame(capacity) {
|
|
36
|
+
const out = new ffmpeg.Frame();
|
|
37
|
+
out.format = ffmpeg.constants.sampleFormats.S16;
|
|
38
|
+
out.channelLayout = ffmpeg.constants.channelLayouts.MONO;
|
|
39
|
+
out.sampleRate = TARGET_SAMPLE_RATE;
|
|
40
|
+
out.nbSamples = capacity;
|
|
41
|
+
out.alloc();
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
function readChunk(samples, outFrame, produced) {
|
|
45
|
+
if (produced <= 0)
|
|
46
|
+
return null;
|
|
47
|
+
samples.read(outFrame);
|
|
48
|
+
return Buffer.from(samples.data.subarray(0, produced * 2));
|
|
49
|
+
}
|
|
50
|
+
function createResampler(frame) {
|
|
51
|
+
return new ffmpeg.Resampler(frame.sampleRate, frame.channelLayout, frame.format, TARGET_SAMPLE_RATE, ffmpeg.constants.channelLayouts.MONO, ffmpeg.constants.sampleFormats.S16);
|
|
52
|
+
}
|
|
53
|
+
function convertFrame(resampler, frame, samples) {
|
|
54
|
+
const capacity = Math.ceil((frame.nbSamples * TARGET_SAMPLE_RATE) / frame.sampleRate) + 1024;
|
|
55
|
+
const outFrame = makeOutFrame(capacity);
|
|
56
|
+
const chunk = readChunk(samples, outFrame, resampler.convert(frame, outFrame));
|
|
57
|
+
outFrame.destroy();
|
|
58
|
+
return chunk;
|
|
59
|
+
}
|
|
60
|
+
function flushResampler(resampler, samples) {
|
|
61
|
+
if (!resampler)
|
|
62
|
+
return [];
|
|
63
|
+
const chunks = [];
|
|
64
|
+
let flushed = 0;
|
|
65
|
+
do {
|
|
66
|
+
const outFrame = makeOutFrame(TARGET_SAMPLE_RATE);
|
|
67
|
+
flushed = resampler.flush(outFrame);
|
|
68
|
+
const chunk = readChunk(samples, outFrame, flushed);
|
|
69
|
+
if (chunk)
|
|
70
|
+
chunks.push(chunk);
|
|
71
|
+
outFrame.destroy();
|
|
72
|
+
} while (flushed > 0);
|
|
73
|
+
return chunks;
|
|
74
|
+
}
|
|
75
|
+
function drainDecodedFrames(decoder, frame, samples, resampler, chunks) {
|
|
76
|
+
let current = resampler;
|
|
77
|
+
while (decoder.receiveFrame(frame)) {
|
|
78
|
+
current ??= createResampler(frame);
|
|
79
|
+
const chunk = convertFrame(current, frame, samples);
|
|
80
|
+
if (chunk)
|
|
81
|
+
chunks.push(chunk);
|
|
82
|
+
}
|
|
83
|
+
return current;
|
|
84
|
+
}
|
|
85
|
+
const YIELD_EVERY_PACKETS = 32;
|
|
86
|
+
function yieldToLoop() {
|
|
87
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
88
|
+
}
|
|
89
|
+
async function decodeToPcmChunks(inputFormat, stream, decoder) {
|
|
90
|
+
const chunks = [];
|
|
91
|
+
const packet = new ffmpeg.Packet();
|
|
92
|
+
const flush = new ffmpeg.Packet();
|
|
93
|
+
const frame = new ffmpeg.Frame();
|
|
94
|
+
const samples = new ffmpeg.Samples();
|
|
95
|
+
let resampler = null;
|
|
96
|
+
let packets = 0;
|
|
97
|
+
try {
|
|
98
|
+
while (inputFormat.readFrame(packet)) {
|
|
99
|
+
if (packet.streamIndex === stream.index && decoder.sendPacket(packet)) {
|
|
100
|
+
resampler = drainDecodedFrames(decoder, frame, samples, resampler, chunks);
|
|
101
|
+
}
|
|
102
|
+
packet.unref();
|
|
103
|
+
if (++packets % YIELD_EVERY_PACKETS === 0)
|
|
104
|
+
await yieldToLoop();
|
|
105
|
+
}
|
|
106
|
+
decoder.sendPacket(flush);
|
|
107
|
+
resampler = drainDecodedFrames(decoder, frame, samples, resampler, chunks);
|
|
108
|
+
chunks.push(...flushResampler(resampler, samples));
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
resampler?.destroy();
|
|
112
|
+
frame.destroy();
|
|
113
|
+
flush.destroy();
|
|
114
|
+
packet.destroy();
|
|
115
|
+
}
|
|
116
|
+
return chunks;
|
|
117
|
+
}
|
|
118
|
+
async function decodeInputToPcm(input) {
|
|
119
|
+
let inputFormat = null;
|
|
120
|
+
let decoder = null;
|
|
121
|
+
try {
|
|
122
|
+
inputFormat = new ffmpeg.InputFormatContext(bufferReadIO(input));
|
|
123
|
+
const stream = inputFormat.getBestStream(ffmpeg.constants.mediaTypes.AUDIO);
|
|
124
|
+
decoder = stream.decoder();
|
|
125
|
+
decoder.open();
|
|
126
|
+
const chunks = await decodeToPcmChunks(inputFormat, stream, decoder);
|
|
127
|
+
return chunks.length === 0 ? null : Buffer.concat(chunks);
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
hlog('audio decode/resample failed', { error: e instanceof Error ? e.message : String(e) });
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
if (decoder)
|
|
135
|
+
decoder.destroy();
|
|
136
|
+
inputFormat?.destroy();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export async function transcodeToWav16kMono(input) {
|
|
140
|
+
const pcm = await decodeInputToPcm(input);
|
|
141
|
+
return pcm ? buildWavBuffer(pcm) : null;
|
|
142
|
+
}
|
|
143
|
+
export async function transcodeToPcm16kMono(input) {
|
|
144
|
+
return decodeInputToPcm(input);
|
|
145
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface WavFormat {
|
|
2
|
+
readonly formatCode: number;
|
|
3
|
+
readonly channels: number;
|
|
4
|
+
readonly sampleRate: number;
|
|
5
|
+
readonly bitsPerSample: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function wavFormat(bytes: Buffer): WavFormat | null;
|
|
8
|
+
export declare function needsResample(bytes: Buffer): boolean;
|
|
9
|
+
export declare function resampleForTranscription(bytes: Buffer): Promise<{
|
|
10
|
+
readonly bytes: Buffer;
|
|
11
|
+
readonly transcoded: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function pcmForTranscription(bytes: Buffer): Promise<Buffer | null>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { transcodeToPcm16kMono, transcodeToWav16kMono } from '#audio-transcode';
|
|
2
|
+
const TARGET_SAMPLE_RATE = 16000;
|
|
3
|
+
const TARGET_CHANNELS = 1;
|
|
4
|
+
const TARGET_BITS_PER_SAMPLE = 16;
|
|
5
|
+
const WAV_PCM_FORMAT = 1;
|
|
6
|
+
export function wavFormat(bytes) {
|
|
7
|
+
if (bytes.length < 44)
|
|
8
|
+
return null;
|
|
9
|
+
if (bytes.toString('ascii', 0, 4) !== 'RIFF')
|
|
10
|
+
return null;
|
|
11
|
+
if (bytes.toString('ascii', 8, 12) !== 'WAVE')
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
formatCode: bytes.readUInt16LE(20),
|
|
15
|
+
channels: bytes.readUInt16LE(22),
|
|
16
|
+
sampleRate: bytes.readUInt32LE(24),
|
|
17
|
+
bitsPerSample: bytes.readUInt16LE(34)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function wavNeedsResample(bytes) {
|
|
21
|
+
const fmt = wavFormat(bytes);
|
|
22
|
+
if (!fmt)
|
|
23
|
+
return true;
|
|
24
|
+
return (fmt.formatCode !== WAV_PCM_FORMAT ||
|
|
25
|
+
fmt.channels !== TARGET_CHANNELS ||
|
|
26
|
+
fmt.sampleRate !== TARGET_SAMPLE_RATE ||
|
|
27
|
+
fmt.bitsPerSample !== TARGET_BITS_PER_SAMPLE);
|
|
28
|
+
}
|
|
29
|
+
export function needsResample(bytes) {
|
|
30
|
+
if (bytes.length < 12)
|
|
31
|
+
return false;
|
|
32
|
+
if (bytes.toString('ascii', 0, 4) === 'RIFF' && bytes.toString('ascii', 8, 12) === 'WAVE') {
|
|
33
|
+
return wavNeedsResample(bytes);
|
|
34
|
+
}
|
|
35
|
+
if (bytes.toString('ascii', 4, 8) === 'ftyp')
|
|
36
|
+
return true;
|
|
37
|
+
if (bytes.toString('ascii', 0, 3) === 'ID3')
|
|
38
|
+
return true;
|
|
39
|
+
if (bytes[0] === 0xff && ((bytes[1] ?? 0) & 0xe0) === 0xe0)
|
|
40
|
+
return true;
|
|
41
|
+
if (bytes.toString('ascii', 0, 4) === 'OggS')
|
|
42
|
+
return true;
|
|
43
|
+
if (bytes.toString('ascii', 0, 4) === 'fLaC')
|
|
44
|
+
return true;
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
export async function resampleForTranscription(bytes) {
|
|
48
|
+
if (!needsResample(bytes))
|
|
49
|
+
return { bytes, transcoded: false };
|
|
50
|
+
const wav = await transcodeToWav16kMono(bytes);
|
|
51
|
+
return wav ? { bytes: wav, transcoded: true } : { bytes, transcoded: false };
|
|
52
|
+
}
|
|
53
|
+
function wavPcmData(bytes) {
|
|
54
|
+
let offset = 12;
|
|
55
|
+
while (offset + 8 <= bytes.length) {
|
|
56
|
+
const id = bytes.toString('ascii', offset, offset + 4);
|
|
57
|
+
const size = bytes.readUInt32LE(offset + 4);
|
|
58
|
+
const start = offset + 8;
|
|
59
|
+
if (id === 'data')
|
|
60
|
+
return bytes.subarray(start, Math.min(start + size, bytes.length));
|
|
61
|
+
offset = start + size + (size & 1);
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
export async function pcmForTranscription(bytes) {
|
|
66
|
+
if (wavFormat(bytes) && !needsResample(bytes)) {
|
|
67
|
+
const pcm = wavPcmData(bytes);
|
|
68
|
+
if (pcm)
|
|
69
|
+
return pcm;
|
|
70
|
+
}
|
|
71
|
+
return transcodeToPcm16kMono(bytes);
|
|
72
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
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 { ToolCallDisplay } from '../tool-call-display.ts';
|
|
5
|
+
import { type LlmGenerationParams } from '../models/llm-presets.ts';
|
|
6
|
+
import type { DriveRoot } from '../tools/fs/scope.ts';
|
|
7
|
+
import { type UsageBreakdown } from './usage-breakdown.ts';
|
|
8
|
+
import { type TrustedSource } from '../tools/outbound-guard.ts';
|
|
9
|
+
import type { SkillCatalogEntry } from '../tools/skills/catalog.ts';
|
|
10
|
+
import { type SkillState } from '../tools/skills/skill-state-constants.ts';
|
|
11
|
+
import type { CliValidator } from '../tools/skills/cli-schema.ts';
|
|
12
|
+
import { type Toolset } from '../tools/toolsets.ts';
|
|
13
|
+
export interface Message {
|
|
14
|
+
role: string;
|
|
15
|
+
content: string;
|
|
16
|
+
attachments?: {
|
|
17
|
+
path: string;
|
|
18
|
+
}[];
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface Agent {
|
|
22
|
+
id?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
bio?: string;
|
|
25
|
+
enabledTools?: string[] | null;
|
|
26
|
+
enabledSkills?: string[] | null;
|
|
27
|
+
toolsScope?: 'all' | 'selected' | null;
|
|
28
|
+
skillsScope?: 'all' | 'selected' | null;
|
|
29
|
+
reasoning?: 'inherit' | 'enabled' | 'disabled' | null;
|
|
30
|
+
ctxSize?: number | null;
|
|
31
|
+
kvCacheK?: string | null;
|
|
32
|
+
kvCacheV?: string | null;
|
|
33
|
+
imageModelChoice?: string | null;
|
|
34
|
+
imageSteps?: number | null;
|
|
35
|
+
imageWidth?: number | null;
|
|
36
|
+
imageHeight?: number | null;
|
|
37
|
+
approvalMode?: 'ask' | 'skip-all' | null;
|
|
38
|
+
disabledToolsets?: string[] | null;
|
|
39
|
+
}
|
|
40
|
+
export interface ImageSettings {
|
|
41
|
+
modelChoice?: string;
|
|
42
|
+
steps?: number;
|
|
43
|
+
width?: number;
|
|
44
|
+
height?: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function imageSettingsFrom(agent?: Agent): ImageSettings | undefined;
|
|
47
|
+
export interface MusicSettings {
|
|
48
|
+
modelChoice?: string;
|
|
49
|
+
steps?: number;
|
|
50
|
+
duration?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface ResourceDescriptor {
|
|
53
|
+
kind: string;
|
|
54
|
+
label: string;
|
|
55
|
+
}
|
|
56
|
+
export type ToolEffect = 'read' | 'write';
|
|
57
|
+
export type ApproveFn = (call: {
|
|
58
|
+
name: string;
|
|
59
|
+
arguments: Record<string, unknown>;
|
|
60
|
+
resource?: ResourceDescriptor | null;
|
|
61
|
+
effect?: ToolEffect;
|
|
62
|
+
intent?: string | null;
|
|
63
|
+
display?: ToolCallDisplay | null;
|
|
64
|
+
}) => Promise<boolean>;
|
|
65
|
+
export type ToolDecision = 'auto' | 'allowed' | 'denied' | 'skip-all' | 'blocked';
|
|
66
|
+
export type ToolActivityFn = (entry: ToolActivityEvent) => void;
|
|
67
|
+
export interface AttachInput {
|
|
68
|
+
fileName: string;
|
|
69
|
+
mimeType: string;
|
|
70
|
+
bytes: Uint8Array;
|
|
71
|
+
raw?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface AttachmentRecord {
|
|
74
|
+
id: string;
|
|
75
|
+
fileName: string;
|
|
76
|
+
mimeType: string;
|
|
77
|
+
byteLength: number;
|
|
78
|
+
}
|
|
79
|
+
export type AttachFn = (input: AttachInput) => Promise<AttachmentRecord>;
|
|
80
|
+
export interface AttachmentMeta {
|
|
81
|
+
id: string;
|
|
82
|
+
fileName: string;
|
|
83
|
+
mimeType: string;
|
|
84
|
+
byteLength: number;
|
|
85
|
+
}
|
|
86
|
+
export interface FetchedAttachment extends AttachmentMeta {
|
|
87
|
+
bytes: Uint8Array;
|
|
88
|
+
}
|
|
89
|
+
export type FetchAttachmentFn = (query: {
|
|
90
|
+
attachmentId?: string;
|
|
91
|
+
signal?: BareAbortSignal;
|
|
92
|
+
meta?: boolean;
|
|
93
|
+
}) => Promise<FetchedAttachment | AttachmentMeta | null>;
|
|
94
|
+
export type ProgressFn = (update: {
|
|
95
|
+
percentage: number;
|
|
96
|
+
} | null) => void;
|
|
97
|
+
export type RagSearchFn = (input: {
|
|
98
|
+
query: string;
|
|
99
|
+
limit?: number;
|
|
100
|
+
}) => Promise<RagSearchResult>;
|
|
101
|
+
export interface RagSearchResult {
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
indexEmpty: boolean;
|
|
104
|
+
hasKnowledge: boolean;
|
|
105
|
+
pendingReferenced?: boolean;
|
|
106
|
+
errorMessage?: string | null;
|
|
107
|
+
hits: ReadonlyArray<{
|
|
108
|
+
content: string;
|
|
109
|
+
metadataJson?: string | null;
|
|
110
|
+
score: number;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
export type AskUserFn = (question: {
|
|
114
|
+
question: string;
|
|
115
|
+
options?: string[];
|
|
116
|
+
}) => Promise<string | null>;
|
|
117
|
+
export interface RunBudget {
|
|
118
|
+
readonly deadlineMs: number;
|
|
119
|
+
outputBytesUsed: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ToolExecuteContext {
|
|
122
|
+
agentId?: string | null | undefined;
|
|
123
|
+
skills?: readonly string[] | undefined;
|
|
124
|
+
ctxSize?: number | undefined;
|
|
125
|
+
image?: ImageSettings | undefined;
|
|
126
|
+
settings?: Record<string, unknown> | undefined;
|
|
127
|
+
turnImages?: {
|
|
128
|
+
path: string;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
attach?: AttachFn | undefined;
|
|
131
|
+
fetchAttachment?: FetchAttachmentFn | undefined;
|
|
132
|
+
ragSearch?: RagSearchFn | undefined;
|
|
133
|
+
progress?: ProgressFn | undefined;
|
|
134
|
+
askUser?: AskUserFn | undefined;
|
|
135
|
+
signal?: BareAbortSignal | undefined;
|
|
136
|
+
fsRoots?: readonly DriveRoot[] | undefined;
|
|
137
|
+
fsWriteRoots?: readonly DriveRoot[] | undefined;
|
|
138
|
+
toolOps?: ReadonlyMap<string, readonly CliValidator[]> | undefined;
|
|
139
|
+
runBudget?: RunBudget | undefined;
|
|
140
|
+
reportBackend?: ((use: RunBackendUse) => void) | undefined;
|
|
141
|
+
}
|
|
142
|
+
export interface RunBackendUse {
|
|
143
|
+
tool: string;
|
|
144
|
+
requestedGpu: boolean;
|
|
145
|
+
device: 'gpu' | 'cpu' | 'unknown';
|
|
146
|
+
backend: string;
|
|
147
|
+
}
|
|
148
|
+
export type ToolParameterType = 'string' | 'number' | 'boolean' | 'object' | 'integer' | 'array' | 'null';
|
|
149
|
+
export interface ToolParameterSchema {
|
|
150
|
+
type: ToolParameterType | readonly ToolParameterType[];
|
|
151
|
+
description?: string;
|
|
152
|
+
enum?: string[];
|
|
153
|
+
items?: ToolParameterSchema;
|
|
154
|
+
properties?: Record<string, ToolParameterSchema>;
|
|
155
|
+
required?: string[];
|
|
156
|
+
}
|
|
157
|
+
export interface ToolParameters {
|
|
158
|
+
type: 'object';
|
|
159
|
+
properties: Record<string, ToolParameterSchema>;
|
|
160
|
+
required?: string[];
|
|
161
|
+
}
|
|
162
|
+
export interface ToolDefinition {
|
|
163
|
+
name: string;
|
|
164
|
+
description: string;
|
|
165
|
+
parameters: ToolParameters;
|
|
166
|
+
autoApprove?: boolean;
|
|
167
|
+
skillGated?: boolean;
|
|
168
|
+
rootsRequired?: boolean;
|
|
169
|
+
writeRootsRequired?: boolean;
|
|
170
|
+
externalWrite?: boolean;
|
|
171
|
+
owningSkill?: string;
|
|
172
|
+
toolset: Toolset | null;
|
|
173
|
+
validate?: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => string | null;
|
|
174
|
+
effect: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => ToolEffect;
|
|
175
|
+
resource?: (args: Record<string, unknown>) => ResourceDescriptor | null;
|
|
176
|
+
compiled?: true;
|
|
177
|
+
execute: (args: Record<string, unknown>, ctx?: ToolExecuteContext) => Promise<unknown>;
|
|
178
|
+
}
|
|
179
|
+
export type ToolCallEvent = {
|
|
180
|
+
type: 'tool-call';
|
|
181
|
+
name: string;
|
|
182
|
+
args: Record<string, unknown>;
|
|
183
|
+
rawCall?: string | undefined;
|
|
184
|
+
effect?: ToolEffect | undefined;
|
|
185
|
+
display?: ToolCallDisplay | undefined;
|
|
186
|
+
};
|
|
187
|
+
export type ToolResultEvent = {
|
|
188
|
+
type: 'tool-result';
|
|
189
|
+
name: string;
|
|
190
|
+
result: unknown;
|
|
191
|
+
};
|
|
192
|
+
export type ToolActivityEvent = {
|
|
193
|
+
type: 'tool-activity';
|
|
194
|
+
name: string;
|
|
195
|
+
args: Record<string, unknown>;
|
|
196
|
+
resource: ResourceDescriptor | null;
|
|
197
|
+
effect: ToolEffect;
|
|
198
|
+
decision: ToolDecision;
|
|
199
|
+
};
|
|
200
|
+
export type ErrorEvent = {
|
|
201
|
+
type: 'error';
|
|
202
|
+
message: string;
|
|
203
|
+
};
|
|
204
|
+
export type AbortedEvent = {
|
|
205
|
+
type: 'aborted';
|
|
206
|
+
};
|
|
207
|
+
export type MetricsEvent = {
|
|
208
|
+
type: 'metrics';
|
|
209
|
+
totalTokens: number;
|
|
210
|
+
durationMs: number;
|
|
211
|
+
timeToFirstToken?: number | undefined;
|
|
212
|
+
tokensPerSecond?: number | undefined;
|
|
213
|
+
promptTokensPerSecond?: number | undefined;
|
|
214
|
+
promptTokens?: number | undefined;
|
|
215
|
+
cacheTokens?: number | undefined;
|
|
216
|
+
ctxSize?: number | undefined;
|
|
217
|
+
backends?: RunBackendUse[] | undefined;
|
|
218
|
+
usage?: UsageBreakdown | undefined;
|
|
219
|
+
};
|
|
220
|
+
export type CompletionEvent = TextEvent | ToolCallEvent | ToolResultEvent | ToolActivityEvent | ErrorEvent | AbortedEvent | MetricsEvent;
|
|
221
|
+
export interface CompletionSdkResult {
|
|
222
|
+
requestId?: string;
|
|
223
|
+
tokenStream: AsyncIterable<string>;
|
|
224
|
+
final: Promise<CompletionFinal>;
|
|
225
|
+
}
|
|
226
|
+
export type ResponseFormat = {
|
|
227
|
+
type: 'text';
|
|
228
|
+
} | {
|
|
229
|
+
type: 'json_object';
|
|
230
|
+
} | {
|
|
231
|
+
type: 'json_schema';
|
|
232
|
+
json_schema: {
|
|
233
|
+
name: string;
|
|
234
|
+
description?: string;
|
|
235
|
+
schema: Record<string, unknown>;
|
|
236
|
+
strict?: boolean;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
export interface CompletionSdk {
|
|
240
|
+
completion(params: {
|
|
241
|
+
modelId: string;
|
|
242
|
+
history: Message[];
|
|
243
|
+
stream: true;
|
|
244
|
+
tools?: SdkTool[] | undefined;
|
|
245
|
+
generationParams?: LlmGenerationParams | undefined;
|
|
246
|
+
responseFormat?: ResponseFormat | undefined;
|
|
247
|
+
toolDialect?: ToolDialect | undefined;
|
|
248
|
+
kvCache?: string | boolean;
|
|
249
|
+
}): CompletionSdkResult;
|
|
250
|
+
cancel?(params: {
|
|
251
|
+
requestId: string;
|
|
252
|
+
}): Promise<void>;
|
|
253
|
+
}
|
|
254
|
+
export interface RoundModelLease {
|
|
255
|
+
modelId: string;
|
|
256
|
+
release: () => void;
|
|
257
|
+
}
|
|
258
|
+
interface CompletionArgs {
|
|
259
|
+
modelId: string;
|
|
260
|
+
acquireRound?: () => Promise<RoundModelLease>;
|
|
261
|
+
model?: string;
|
|
262
|
+
agent?: Agent;
|
|
263
|
+
ctxSize?: number;
|
|
264
|
+
cacheKey?: string;
|
|
265
|
+
thinkingDefault?: string;
|
|
266
|
+
generationParams?: LlmGenerationParams;
|
|
267
|
+
responseFormat?: ResponseFormat;
|
|
268
|
+
messages: Message[];
|
|
269
|
+
tools?: ToolDefinition[];
|
|
270
|
+
skillCatalog?: readonly CompletionSkillEntry[];
|
|
271
|
+
approve?: ApproveFn;
|
|
272
|
+
attach?: AttachFn;
|
|
273
|
+
fetchAttachment?: FetchAttachmentFn;
|
|
274
|
+
ragSearch?: RagSearchFn;
|
|
275
|
+
progress?: ProgressFn;
|
|
276
|
+
askUser?: AskUserFn;
|
|
277
|
+
signal?: BareAbortSignal;
|
|
278
|
+
toolConfigs?: Record<string, Record<string, unknown>>;
|
|
279
|
+
fsRoots?: readonly DriveRoot[];
|
|
280
|
+
fsWriteRoots?: readonly DriveRoot[];
|
|
281
|
+
}
|
|
282
|
+
export declare function trustedSourcesFrom(history: readonly Message[]): TrustedSource[];
|
|
283
|
+
export declare function toSdkTool(tool: ToolDefinition): SdkTool;
|
|
284
|
+
export type CompletionSkillEntry = SkillCatalogEntry & {
|
|
285
|
+
readonly status?: SkillState;
|
|
286
|
+
};
|
|
287
|
+
export declare function completion(sdk: CompletionSdk, { modelId, acquireRound, model, agent, ctxSize, cacheKey, thinkingDefault, generationParams: generationParamsOverride, responseFormat, messages: storedMessages, tools: allTools, skillCatalog, approve, attach, fetchAttachment, ragSearch, progress, askUser, signal, toolConfigs, fsRoots, fsWriteRoots }: CompletionArgs): AsyncGenerator<CompletionEvent>;
|
|
288
|
+
export {};
|