@qvac/harness 1.0.0-rc.2 → 1.0.0-rc.20
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 +3050 -1485
- package/README.md +110 -46
- package/dist-lib/index.d.ts +60 -15
- package/dist-lib/index.js +228 -35
- package/dist-lib/lib/agent/delegate.d.ts +3 -2
- package/dist-lib/lib/agent/delegate.js +6 -4
- package/dist-lib/lib/agent/follow.d.ts +5 -0
- package/dist-lib/lib/agent/follow.js +11 -2
- package/dist-lib/lib/agent/resolve.js +29 -17
- package/dist-lib/lib/agent/tool-selection.d.ts +4 -2
- package/dist-lib/lib/agent/tool-selection.js +5 -6
- package/dist-lib/lib/agent/tools.d.ts +2 -0
- package/dist-lib/lib/agent/tools.js +2 -1
- package/dist-lib/lib/capabilities/agent-ports.d.ts +1 -1
- package/dist-lib/lib/capabilities/agent-ports.js +11 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/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.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/executing.js +129 -12
- package/dist-lib/lib/capabilities/completion-engine/actors/execution-plan.js +10 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/inspect-prepare.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/inspecting.js +54 -10
- package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.d.ts +1 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/loading-skill.js +10 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/preparing.js +137 -50
- package/dist-lib/lib/capabilities/completion-engine/actors/rejecting.js +10 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/resolving.js +69 -17
- package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/retrieving.js +33 -16
- package/dist-lib/lib/capabilities/completion-engine/actors/run-prepare.js +36 -22
- package/dist-lib/lib/capabilities/completion-engine/actors/skill-step.js +50 -12
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.d.ts +10 -4
- package/dist-lib/lib/capabilities/completion-engine/actors/stream.js +80 -3
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.d.ts +5 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/streaming.js +95 -35
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.d.ts +2 -1
- package/dist-lib/lib/capabilities/completion-engine/actors/wrap-up.js +55 -16
- package/dist-lib/lib/capabilities/completion-engine/driver.js +58 -15
- package/dist-lib/lib/capabilities/completion-engine/durable.d.ts +3 -1
- package/dist-lib/lib/capabilities/completion-engine/durable.js +12 -2
- package/dist-lib/lib/capabilities/completion-engine/engine.d.ts +4 -1
- package/dist-lib/lib/capabilities/completion-engine/engine.js +14 -1
- package/dist-lib/lib/capabilities/completion-engine/index.d.ts +5 -1
- package/dist-lib/lib/capabilities/completion-engine/index.js +5 -2
- package/dist-lib/lib/capabilities/completion-engine/loop.d.ts +25 -3
- package/dist-lib/lib/capabilities/completion-engine/loop.js +13 -2
- package/dist-lib/lib/capabilities/completion-engine/metrics.d.ts +9 -2
- package/dist-lib/lib/capabilities/completion-engine/metrics.js +28 -7
- package/dist-lib/lib/capabilities/completion-engine/model-round.d.ts +63 -0
- package/dist-lib/lib/capabilities/completion-engine/model-round.js +99 -0
- package/dist-lib/lib/capabilities/completion-engine/operations.js +30 -10
- package/dist-lib/lib/capabilities/completion-engine/ports.js +6 -9
- package/dist-lib/lib/capabilities/completion-engine/prepare-step.d.ts +4 -1
- package/dist-lib/lib/capabilities/completion-engine/round.d.ts +38 -6
- package/dist-lib/lib/capabilities/completion-engine/round.js +393 -116
- package/dist-lib/lib/capabilities/completion-engine/session.d.ts +12 -4
- package/dist-lib/lib/capabilities/completion-engine/session.js +31 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-caller.js +3 -2
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.d.ts +5 -4
- package/dist-lib/lib/capabilities/completion-engine/tool-execution.js +32 -12
- package/dist-lib/lib/capabilities/completion-engine/tool-sets.d.ts +24 -0
- package/dist-lib/lib/capabilities/completion-engine/tool-sets.js +15 -0
- package/dist-lib/lib/capabilities/completion-engine/turns.d.ts +17 -9
- package/dist-lib/lib/capabilities/completion-engine/turns.js +96 -87
- package/dist-lib/lib/capabilities/detect-language.d.ts +2 -1
- package/dist-lib/lib/capabilities/detect-language.js +14 -2
- package/dist-lib/lib/capabilities/download.d.ts +10 -8
- package/dist-lib/lib/capabilities/download.js +1 -1
- package/dist-lib/lib/capabilities/enhance.d.ts +1 -1
- package/dist-lib/lib/capabilities/enhance.js +23 -11
- package/dist-lib/lib/capabilities/kv-cache.d.ts +1 -1
- package/dist-lib/lib/capabilities/preview-model-source.d.ts +7 -0
- package/dist-lib/lib/capabilities/preview-model-source.js +83 -23
- package/dist-lib/lib/capabilities/prompt-prefix.d.ts +3 -1
- package/dist-lib/lib/capabilities/prompt-prefix.js +8 -0
- package/dist-lib/lib/capabilities/sdk-tool.d.ts +13 -4
- package/dist-lib/lib/capabilities/sdk-tool.js +59 -7
- package/dist-lib/lib/capabilities/skill-entry.d.ts +13 -1
- package/dist-lib/lib/capabilities/skill-entry.js +33 -2
- package/dist-lib/lib/capabilities/tool-failed-note.d.ts +1 -0
- package/dist-lib/lib/capabilities/tool-failed-note.js +1 -0
- package/dist-lib/lib/capabilities/tool-plan.d.ts +5 -1
- package/dist-lib/lib/capabilities/tool-plan.js +20 -5
- package/dist-lib/lib/capabilities/tool-prompt-log.d.ts +1 -1
- package/dist-lib/lib/capabilities/tool-prompt-log.js +3 -3
- package/dist-lib/lib/capabilities/tool-turns.d.ts +20 -9
- package/dist-lib/lib/capabilities/tool-turns.js +77 -49
- package/dist-lib/lib/capabilities/usage-breakdown.d.ts +1 -0
- package/dist-lib/lib/capabilities/usage-breakdown.js +4 -1
- package/dist-lib/lib/client/index.d.ts +19 -0
- package/dist-lib/lib/client/index.js +263 -0
- package/dist-lib/lib/connect.d.ts +19 -10
- package/dist-lib/lib/connect.js +239 -32
- package/dist-lib/lib/context-window.d.ts +2 -0
- package/dist-lib/lib/context-window.js +9 -3
- package/dist-lib/lib/contract/agent.d.ts +13 -3
- package/dist-lib/lib/contract/completion.d.ts +77 -31
- 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 +4 -3
- package/dist-lib/lib/contract/hooks.d.ts +4 -1
- package/dist-lib/lib/contract/index.d.ts +4 -0
- package/dist-lib/lib/contract/knowledge.d.ts +10 -0
- package/dist-lib/lib/contract/managed-skills.d.ts +1 -0
- package/dist-lib/lib/contract/managed-skills.js +1 -0
- package/dist-lib/lib/contract/media.d.ts +58 -0
- package/dist-lib/lib/contract/media.js +1 -0
- package/dist-lib/lib/contract/models.d.ts +12 -6
- package/dist-lib/lib/contract/ocr.d.ts +13 -0
- package/dist-lib/lib/contract/ocr.js +1 -0
- package/dist-lib/lib/contract/policy.d.ts +75 -0
- package/dist-lib/lib/contract/policy.js +1 -0
- package/dist-lib/lib/contract/run.d.ts +28 -3
- package/dist-lib/lib/contract/sandbox.d.ts +3 -1
- package/dist-lib/lib/contract/speech.d.ts +1 -1
- package/dist-lib/lib/contract/translation.d.ts +20 -0
- package/dist-lib/lib/contract/translation.js +1 -0
- package/dist-lib/lib/contract-types.d.ts +46 -16
- package/dist-lib/lib/embeddings/index.d.ts +7 -1
- package/dist-lib/lib/embeddings/index.js +26 -5
- package/dist-lib/lib/errors.d.ts +278 -0
- package/dist-lib/lib/errors.js +212 -0
- package/dist-lib/lib/fold/index.d.ts +26 -1
- package/dist-lib/lib/fold/index.js +76 -9
- package/dist-lib/lib/guarded-fetch.js +11 -7
- package/dist-lib/lib/guards.d.ts +2 -0
- package/dist-lib/lib/guards.js +7 -0
- package/dist-lib/lib/hardware/capability-probe.js +10 -7
- package/dist-lib/lib/hardware/cpu-placement.d.ts +8 -0
- package/dist-lib/lib/hardware/cpu-placement.js +48 -0
- package/dist-lib/lib/hardware/gpu-probe-addon.js +26 -11
- package/dist-lib/lib/hardware/gpu-probe.js +10 -1
- package/dist-lib/lib/hardware/gpu-stats.native.cjs +17 -1
- package/dist-lib/lib/helpers/completion-params.d.ts +7 -2
- package/dist-lib/lib/helpers/completion-params.js +26 -2
- package/dist-lib/lib/helpers/control-tokens.d.ts +3 -0
- package/dist-lib/lib/helpers/control-tokens.js +25 -0
- package/dist-lib/lib/helpers/engine-error.d.ts +2 -1
- package/dist-lib/lib/helpers/engine-error.js +12 -12
- package/dist-lib/lib/helpers/goal-check.d.ts +44 -0
- package/dist-lib/lib/helpers/goal-check.js +407 -0
- package/dist-lib/lib/helpers/head-tail.js +1 -1
- package/dist-lib/lib/helpers/html-helpers.js +9 -6
- package/dist-lib/lib/helpers/load-stall.d.ts +1 -1
- package/dist-lib/lib/helpers/load-stall.js +2 -2
- package/dist-lib/lib/helpers/markup-stream-filter.d.ts +4 -1
- package/dist-lib/lib/helpers/markup-stream-filter.js +20 -6
- package/dist-lib/lib/helpers/repeated-reply.js +24 -16
- package/dist-lib/lib/helpers/require-peers.d.ts +3 -0
- package/dist-lib/lib/helpers/require-peers.js +23 -0
- package/dist-lib/lib/helpers/run-outcome.d.ts +2 -0
- package/dist-lib/lib/helpers/run-outcome.js +6 -2
- package/dist-lib/lib/helpers/spawn-path.d.ts +1 -0
- package/dist-lib/lib/helpers/spawn-path.js +2 -1
- package/dist-lib/lib/helpers/thinking.d.ts +3 -2
- package/dist-lib/lib/helpers/thinking.js +19 -0
- package/dist-lib/lib/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 +11 -6
- package/dist-lib/lib/machine/completion/actions/completion.js +251 -35
- package/dist-lib/lib/machine/completion/actions/prepare.js +1 -1
- package/dist-lib/lib/machine/completion/actions/tools.js +122 -6
- package/dist-lib/lib/machine/completion/context.js +11 -1
- package/dist-lib/lib/machine/completion/guards/retry.d.ts +3 -1
- package/dist-lib/lib/machine/completion/guards/retry.js +9 -2
- package/dist-lib/lib/machine/completion/implementations.d.ts +16 -7
- package/dist-lib/lib/machine/completion/implementations.js +59 -15
- package/dist-lib/lib/machine/completion/machine.d.ts +36 -7
- package/dist-lib/lib/machine/completion/machine.js +58 -9
- package/dist-lib/lib/machine/completion/rules.d.ts +23 -2
- package/dist-lib/lib/machine/completion/rules.js +91 -6
- package/dist-lib/lib/machine/completion/types.d.ts +77 -1
- package/dist-lib/lib/machine/index.d.ts +48 -9
- package/dist-lib/lib/machine/index.js +11 -1
- package/dist-lib/lib/media-host.d.ts +12 -0
- package/dist-lib/lib/media-host.js +52 -0
- package/dist-lib/lib/media-port.d.ts +20 -0
- package/dist-lib/lib/media-port.js +77 -0
- package/dist-lib/lib/media-wire.d.ts +8 -0
- package/dist-lib/lib/media-wire.js +111 -0
- package/dist-lib/lib/models/context-choice.d.ts +15 -0
- package/dist-lib/lib/models/context-choice.js +62 -0
- package/dist-lib/lib/models/context.d.ts +1 -1
- package/dist-lib/lib/models/custom-model-cache.d.ts +1 -0
- package/dist-lib/lib/models/custom-model-cache.js +3 -0
- package/dist-lib/lib/models/download-gate.d.ts +20 -0
- package/dist-lib/lib/models/download-gate.js +73 -0
- package/dist-lib/lib/models/gguf-header.d.ts +11 -0
- package/dist-lib/lib/models/gguf-header.js +203 -15
- package/dist-lib/lib/models/gpu-selection.d.ts +6 -1
- package/dist-lib/lib/models/gpu-selection.js +29 -5
- package/dist-lib/lib/models/kv-cache.d.ts +2 -0
- package/dist-lib/lib/models/kv-cache.js +8 -0
- package/dist-lib/lib/models/llm-presets.d.ts +6 -1
- package/dist-lib/lib/models/llm-presets.js +33 -6
- package/dist-lib/lib/models/load-requests.d.ts +9 -0
- package/dist-lib/lib/models/load-requests.js +42 -0
- package/dist-lib/lib/models/memory-cap.d.ts +13 -0
- package/dist-lib/lib/models/memory-cap.js +21 -0
- package/dist-lib/lib/models/model-catalog-constants.d.ts +2 -2
- package/dist-lib/lib/models/model-catalog-constants.js +3 -4
- package/dist-lib/lib/models/model-catalog.d.ts +7 -3
- package/dist-lib/lib/models/model-catalog.js +44 -11
- package/dist-lib/lib/models/model-delete.d.ts +1 -1
- package/dist-lib/lib/models/model-fit.d.ts +2 -2
- package/dist-lib/lib/models/model-fit.js +5 -6
- package/dist-lib/lib/models/model-handle.d.ts +9 -2
- package/dist-lib/lib/models/model-handle.js +14 -3
- package/dist-lib/lib/models/model-list.d.ts +9 -2
- package/dist-lib/lib/models/model-list.js +23 -0
- package/dist-lib/lib/models/model-pool.d.ts +42 -7
- package/dist-lib/lib/models/model-pool.js +139 -49
- package/dist-lib/lib/models/model-source.d.ts +3 -2
- package/dist-lib/lib/models/model-source.js +23 -5
- package/dist-lib/lib/models/opencl-cache.js +2 -2
- package/dist-lib/lib/models/sdk-faults.d.ts +1 -0
- package/dist-lib/lib/models/sdk-faults.js +9 -0
- package/dist-lib/lib/models/tool-dialect.d.ts +1 -1
- package/dist-lib/lib/models/tts-model-default.d.ts +2 -1
- package/dist-lib/lib/models/tts-model-default.js +8 -6
- package/dist-lib/lib/no-redirect-fetch-bare.js +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.d.ts +2 -1
- package/dist-lib/lib/no-redirect-fetch-impl.js +46 -8
- package/dist-lib/lib/office/engine/pptx/picture-area.d.ts +23 -0
- package/dist-lib/lib/office/engine/pptx/picture-area.js +84 -0
- package/dist-lib/lib/office/engine/pptx/presentation.d.ts +2 -0
- package/dist-lib/lib/office/engine/pptx/presentation.js +64 -21
- package/dist-lib/lib/office/engine/pptx/types.d.ts +1 -0
- package/dist-lib/lib/office/engine/xlsx/sheet.js +10 -4
- package/dist-lib/lib/office/engine/xlsx/workbook.d.ts +1 -0
- package/dist-lib/lib/office/engine/xlsx/workbook.js +34 -3
- package/dist-lib/lib/office/extract.js +4 -3
- package/dist-lib/lib/office/index.js +2 -1
- package/dist-lib/lib/plugins/registry.d.ts +15 -0
- package/dist-lib/lib/plugins/registry.js +91 -22
- package/dist-lib/lib/plugins/require-bare.d.ts +1 -0
- package/dist-lib/lib/plugins/require-bare.js +13 -0
- package/dist-lib/lib/policy/index.d.ts +11 -0
- package/dist-lib/lib/policy/index.js +235 -0
- package/dist-lib/lib/prompt.d.ts +9 -4
- package/dist-lib/lib/prompt.js +95 -32
- package/dist-lib/lib/residency/completion-runtime.d.ts +15 -5
- package/dist-lib/lib/residency/completion-runtime.js +47 -36
- package/dist-lib/lib/residency/index.d.ts +56 -4
- package/dist-lib/lib/residency/index.js +442 -40
- package/dist-lib/lib/resolution-detector.js +3 -3
- package/dist-lib/lib/round-host.d.ts +12 -0
- package/dist-lib/lib/round-host.js +57 -0
- package/dist-lib/lib/round-port.d.ts +24 -0
- package/dist-lib/lib/round-port.js +81 -0
- package/dist-lib/lib/rpc-session.js +2 -1
- package/dist-lib/lib/run-log/request-codec.js +2 -2
- package/dist-lib/lib/sdk-loader.d.ts +1 -1
- package/dist-lib/lib/sdk-loader.js +47 -17
- package/dist-lib/lib/sdk-storage.d.ts +1 -0
- package/dist-lib/lib/sdk-storage.js +18 -2
- package/dist-lib/lib/serve.js +242 -50
- package/dist-lib/lib/sidecar/index.d.ts +39 -0
- package/dist-lib/lib/sidecar/index.js +205 -0
- package/dist-lib/lib/sidecar/user-plugins.d.ts +9 -0
- package/dist-lib/lib/sidecar/user-plugins.js +119 -0
- package/dist-lib/lib/skills-host/index.d.ts +3 -1
- package/dist-lib/lib/skills-host/index.js +27 -14
- package/dist-lib/lib/spawn.d.ts +6 -4
- package/dist-lib/lib/spawn.js +22 -20
- package/dist-lib/lib/spill.d.ts +1 -0
- package/dist-lib/lib/spill.js +12 -8
- package/dist-lib/lib/tools/ask-user.d.ts +2 -0
- package/dist-lib/lib/tools/ask-user.js +137 -0
- package/dist-lib/lib/tools/attachments/delivered.d.ts +5 -0
- package/dist-lib/lib/tools/attachments/delivered.js +16 -0
- package/dist-lib/lib/tools/attachments/fetched-file.d.ts +32 -0
- package/dist-lib/lib/tools/attachments/fetched-file.js +134 -0
- package/dist-lib/lib/tools/attachments/staging.d.ts +1 -0
- package/dist-lib/lib/tools/attachments/staging.js +19 -8
- package/dist-lib/lib/tools/exec/runner.d.ts +4 -0
- package/dist-lib/lib/tools/exec/runner.js +20 -2
- package/dist-lib/lib/tools/exec/scope.d.ts +0 -1
- package/dist-lib/lib/tools/exec/scope.js +23 -114
- package/dist-lib/lib/tools/exec/shell-guidance.js +4 -4
- package/dist-lib/lib/tools/exec/shell-line.d.ts +26 -0
- package/dist-lib/lib/tools/exec/shell-line.js +334 -0
- package/dist-lib/lib/tools/exec.d.ts +4 -1
- package/dist-lib/lib/tools/exec.js +89 -27
- package/dist-lib/lib/tools/files/edit-file.d.ts +6 -0
- package/dist-lib/lib/tools/files/edit-file.js +266 -0
- package/dist-lib/lib/tools/files/glob.d.ts +3 -0
- package/dist-lib/lib/tools/files/glob.js +65 -0
- package/dist-lib/lib/tools/files/grep.d.ts +6 -0
- package/dist-lib/lib/tools/files/grep.js +212 -0
- package/dist-lib/lib/tools/files/index.d.ts +3 -0
- package/dist-lib/lib/tools/files/index.js +25 -0
- package/dist-lib/lib/tools/files/list-dir.d.ts +6 -0
- package/dist-lib/lib/tools/files/list-dir.js +136 -0
- package/dist-lib/lib/tools/files/make-dir.d.ts +3 -0
- package/dist-lib/lib/tools/files/make-dir.js +48 -0
- package/dist-lib/lib/tools/files/read-file.d.ts +3 -0
- package/dist-lib/lib/tools/files/read-file.js +224 -0
- package/dist-lib/lib/tools/files/transfer.d.ts +4 -0
- package/dist-lib/lib/tools/files/transfer.js +83 -0
- package/dist-lib/lib/tools/files/trash-file.d.ts +4 -0
- package/dist-lib/lib/tools/files/trash-file.js +62 -0
- package/dist-lib/lib/tools/files/write-file.d.ts +3 -0
- package/dist-lib/lib/tools/files/write-file.js +56 -0
- package/dist-lib/lib/tools/fs/document-text.d.ts +8 -0
- package/dist-lib/lib/tools/fs/document-text.js +22 -0
- package/dist-lib/lib/tools/fs/drive.d.ts +10 -14
- package/dist-lib/lib/tools/fs/drive.js +9 -1
- package/dist-lib/lib/tools/fs/edit-match.d.ts +33 -0
- package/dist-lib/lib/tools/fs/edit-match.js +445 -0
- package/dist-lib/lib/tools/fs/ignore.d.ts +13 -0
- package/dist-lib/lib/tools/fs/ignore.js +104 -0
- package/dist-lib/lib/tools/fs/local.js +28 -5
- package/dist-lib/lib/tools/fs/remote-protocol.d.ts +45 -3
- package/dist-lib/lib/tools/fs/remote-protocol.js +1 -1
- package/dist-lib/lib/tools/fs/remote.d.ts +3 -11
- package/dist-lib/lib/tools/fs/remote.js +24 -14
- package/dist-lib/lib/tools/fs/scope.d.ts +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 +383 -0
- package/dist-lib/lib/tools/{file-glob.d.ts → fs/targets.d.ts} +1 -5
- package/dist-lib/lib/tools/fs/targets.js +32 -0
- package/dist-lib/lib/tools/fs/tool-path.d.ts +27 -0
- package/dist-lib/lib/tools/fs/tool-path.js +70 -0
- package/dist-lib/lib/tools/fs/walk.d.ts +16 -3
- package/dist-lib/lib/tools/fs/walk.js +119 -24
- package/dist-lib/lib/tools/http-request/request.d.ts +4 -2
- package/dist-lib/lib/tools/http-request/request.js +2 -1
- package/dist-lib/lib/tools/http-request/truncate-response.d.ts +16 -1
- package/dist-lib/lib/tools/http-request/truncate-response.js +56 -11
- package/dist-lib/lib/tools/http-request.d.ts +1 -0
- package/dist-lib/lib/tools/http-request.js +101 -16
- package/dist-lib/lib/tools/index.d.ts +4 -1
- package/dist-lib/lib/tools/index.js +8 -12
- package/dist-lib/lib/tools/office/ops.d.ts +1 -0
- package/dist-lib/lib/tools/office/ops.js +5 -1
- package/dist-lib/lib/tools/office.d.ts +2 -1
- package/dist-lib/lib/tools/office.js +273 -56
- package/dist-lib/lib/tools/operations/builders.d.ts +4 -3
- package/dist-lib/lib/tools/operations/builders.js +41 -3
- package/dist-lib/lib/tools/operations/calendar-range.d.ts +16 -0
- package/dist-lib/lib/tools/operations/calendar-range.js +40 -0
- package/dist-lib/lib/tools/operations/compile.js +8 -6
- package/dist-lib/lib/tools/operations/manifest.d.ts +4 -0
- package/dist-lib/lib/tools/pdf/build.d.ts +15 -1
- package/dist-lib/lib/tools/pdf/build.js +77 -16
- package/dist-lib/lib/tools/pdf/pages.d.ts +12 -0
- package/dist-lib/lib/tools/pdf/pages.js +31 -0
- package/dist-lib/lib/tools/pdf/recognize.d.ts +13 -0
- package/dist-lib/lib/tools/pdf/recognize.js +59 -0
- package/dist-lib/lib/tools/pdf.js +56 -12
- package/dist-lib/lib/tools/skill.js +10 -7
- package/dist-lib/lib/tools/skills/bundled-dir.d.ts +5 -1
- package/dist-lib/lib/tools/skills/bundled-dir.js +27 -24
- package/dist-lib/lib/tools/skills/catalog.d.ts +3 -1
- package/dist-lib/lib/tools/skills/catalog.js +7 -3
- package/dist-lib/lib/tools/skills/cli-argv.js +25 -5
- package/dist-lib/lib/tools/skills/cli-schema-check.d.ts +1 -0
- package/dist-lib/lib/tools/skills/cli-schema-check.js +3 -0
- package/dist-lib/lib/tools/skills/cli-schema-load.js +10 -0
- package/dist-lib/lib/tools/skills/cli-schema-types.d.ts +2 -0
- package/dist-lib/lib/tools/skills/cli-schema.js +6 -3
- package/dist-lib/lib/tools/skills/credential-check.d.ts +1 -0
- package/dist-lib/lib/tools/skills/credential-check.js +3 -0
- package/dist-lib/lib/tools/skills/credential-health.js +3 -3
- package/dist-lib/lib/tools/skills/frontmatter-parser.d.ts +3 -0
- package/dist-lib/lib/tools/skills/frontmatter-parser.js +5 -0
- package/dist-lib/lib/tools/skills/manifest-parse.d.ts +1 -0
- package/dist-lib/lib/tools/skills/manifest-parse.js +39 -3
- package/dist-lib/lib/tools/skills/manifest.d.ts +1 -0
- package/dist-lib/lib/tools/skills/mention-name.d.ts +6 -0
- package/dist-lib/lib/tools/skills/mention-name.js +6 -0
- package/dist-lib/lib/tools/skills/mention.d.ts +2 -2
- package/dist-lib/lib/tools/skills/mention.js +11 -4
- package/dist-lib/lib/tools/skills/overlay-crud.d.ts +3 -3
- package/dist-lib/lib/tools/skills/overlay-crud.js +7 -6
- package/dist-lib/lib/tools/skills/overlay-watch.d.ts +2 -2
- package/dist-lib/lib/tools/skills/overlay-watch.js +4 -3
- package/dist-lib/lib/tools/skills/scope-key.d.ts +1 -0
- package/dist-lib/lib/tools/skills/scope-key.js +4 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.d.ts +1 -0
- package/dist-lib/lib/tools/skills/skill-state-constants.js +4 -0
- package/dist-lib/lib/tools/url-guard.d.ts +6 -1
- package/dist-lib/lib/tools/url-guard.js +8 -2
- package/dist-lib/lib/tools/web-fetch.js +50 -133
- package/dist-lib/lib/wire.d.ts +13 -0
- package/dist-lib/lib/wire.js +78 -6
- package/dist-lib/plugins/coding/index.d.ts +1 -1
- package/dist-lib/plugins/coding/index.js +2 -4
- package/dist-lib/plugins/coding/read-only.d.ts +1 -0
- package/dist-lib/plugins/coding/read-only.js +264 -0
- package/dist-lib/plugins/coding/session.d.ts +6 -4
- package/dist-lib/plugins/coding/session.js +45 -16
- package/dist-lib/plugins/coding-guards/index.d.ts +25 -0
- package/dist-lib/plugins/coding-guards/index.js +126 -0
- package/dist-lib/plugins/command-hooks/index.js +5 -3
- package/dist-lib/plugins/egress-proxy/index.d.ts +53 -0
- package/dist-lib/plugins/egress-proxy/index.js +184 -0
- package/dist-lib/plugins/image/edit-image.d.ts +3 -22
- package/dist-lib/plugins/image/edit-image.js +23 -46
- package/dist-lib/plugins/image/fit.d.ts +31 -0
- package/dist-lib/plugins/image/fit.js +28 -0
- package/dist-lib/plugins/image/generate-image.d.ts +27 -6
- package/dist-lib/plugins/image/generate-image.js +201 -74
- package/dist-lib/plugins/image/index.d.ts +2 -1
- package/dist-lib/plugins/image/index.js +29 -12
- package/dist-lib/plugins/knowledge/index.d.ts +3 -0
- package/dist-lib/plugins/knowledge/index.js +5 -0
- package/dist-lib/plugins/knowledge/manifest.d.ts +53 -0
- package/dist-lib/plugins/knowledge/manifest.js +86 -0
- package/dist-lib/plugins/knowledge/search-tool.js +8 -8
- package/dist-lib/plugins/knowledge/store.d.ts +45 -8
- package/dist-lib/plugins/knowledge/store.js +428 -166
- package/dist-lib/plugins/language-hint/index.d.ts +15 -0
- package/dist-lib/plugins/language-hint/index.js +54 -0
- package/dist-lib/plugins/lsp/tool.js +2 -2
- package/dist-lib/plugins/mcp/call.js +15 -4
- package/dist-lib/plugins/mcp/index.js +6 -3
- package/dist-lib/plugins/mcp/protocol.d.ts +10 -2
- package/dist-lib/plugins/mcp/protocol.js +13 -12
- package/dist-lib/plugins/mcp/server.js +1 -1
- package/dist-lib/plugins/mcp/tool-listing.d.ts +6 -0
- package/dist-lib/plugins/mcp/tool-listing.js +97 -0
- package/dist-lib/plugins/music/generate-music.d.ts +24 -5
- package/dist-lib/plugins/music/generate-music.js +170 -64
- package/dist-lib/plugins/music/index.d.ts +2 -1
- package/dist-lib/plugins/music/index.js +23 -11
- package/dist-lib/plugins/obsidian/command.js +2 -2
- package/dist-lib/plugins/obsidian/index.js +14 -4
- package/dist-lib/plugins/obsidian/note-name.js +2 -1
- package/dist-lib/plugins/obsidian/readiness.js +2 -2
- package/dist-lib/plugins/obsidian/safe-path.js +5 -4
- package/dist-lib/plugins/obsidian/vault-create.js +3 -2
- package/dist-lib/plugins/obsidian/vault-fs.js +2 -2
- package/dist-lib/plugins/obsidian/vault-paths.js +3 -2
- package/dist-lib/plugins/obsidian/vault-read.js +20 -18
- package/dist-lib/plugins/obsidian/vault-write.js +13 -12
- package/dist-lib/plugins/ocr/bmp.d.ts +2 -0
- package/dist-lib/plugins/ocr/bmp.js +27 -0
- package/dist-lib/plugins/ocr/index.d.ts +12 -0
- package/dist-lib/plugins/ocr/index.js +20 -0
- package/dist-lib/plugins/ocr/ocr-runtime.d.ts +23 -0
- package/dist-lib/plugins/ocr/ocr-runtime.js +82 -0
- package/dist-lib/plugins/ocr/reading-order.d.ts +5 -0
- package/dist-lib/plugins/ocr/reading-order.js +218 -0
- package/dist-lib/plugins/python/bare-floor.d.ts +1 -0
- package/dist-lib/plugins/python/bare-floor.js +2 -0
- package/dist-lib/plugins/python/guarded-fetch.d.ts +2 -1
- package/dist-lib/plugins/python/guarded-fetch.js +5 -1
- package/dist-lib/plugins/python/index.d.ts +4 -1
- package/dist-lib/plugins/python/index.js +6 -1
- package/dist-lib/plugins/python/interrupt-timer.js +2 -2
- package/dist-lib/plugins/python/language.js +11 -10
- package/dist-lib/plugins/python/loader.d.ts +1 -0
- package/dist-lib/plugins/python/loader.js +76 -3
- package/dist-lib/plugins/python/memfs.js +2 -2
- package/dist-lib/plugins/python/pyodide.d.ts +1 -0
- package/dist-lib/plugins/python/pyodide.js +9 -8
- package/dist-lib/plugins/python/python-adapter.d.ts +6 -1
- package/dist-lib/plugins/python/python-adapter.js +37 -2
- package/dist-lib/plugins/python/run-session.d.ts +1 -0
- package/dist-lib/plugins/python/run-session.js +19 -8
- package/dist-lib/plugins/python/wheels.js +8 -6
- package/dist-lib/plugins/python/worker/active.js +2 -2
- package/dist-lib/plugins/python/worker/client.js +10 -9
- package/dist-lib/plugins/python/worker/entry.js +2 -8
- package/dist-lib/plugins/python/worker/preload.d.ts +1 -0
- package/dist-lib/plugins/python/worker/preload.js +2 -0
- package/dist-lib/plugins/python/worker/protocol.d.ts +2 -0
- package/dist-lib/plugins/python/worker/serve.js +23 -4
- package/dist-lib/plugins/python/worker/spawn.d.ts +2 -1
- package/dist-lib/plugins/python/worker/spawn.js +3 -2
- package/dist-lib/plugins/quickjs/index.js +4 -0
- package/dist-lib/plugins/quickjs/runtime.js +8 -3
- package/dist-lib/plugins/run-report/chain.d.ts +2 -0
- package/dist-lib/plugins/run-report/chain.js +73 -0
- package/dist-lib/plugins/run-report/flow-view.js +2 -1
- package/dist-lib/plugins/run-report/flow.d.ts +1 -1
- package/dist-lib/plugins/run-report/flow.js +66 -14
- package/dist-lib/plugins/run-report/index.d.ts +23 -2
- package/dist-lib/plugins/run-report/index.js +32 -13
- package/dist-lib/plugins/run-report/layout.js +1 -1
- package/dist-lib/plugins/run-report/model.d.ts +10 -1
- package/dist-lib/plugins/run-report/model.js +12 -6
- package/dist-lib/plugins/run-report/page.d.ts +9 -0
- package/dist-lib/plugins/run-report/page.js +55 -15
- package/dist-lib/plugins/run-report/script.js +317 -43
- package/dist-lib/plugins/run-report/story.d.ts +2 -1
- package/dist-lib/plugins/run-report/story.js +7 -4
- package/dist-lib/plugins/run-report/style.d.ts +1 -1
- package/dist-lib/plugins/run-report/style.js +126 -0
- package/dist-lib/plugins/run-report/why.js +1 -1
- package/dist-lib/plugins/sandbox-linux/index.d.ts +62 -0
- package/dist-lib/plugins/sandbox-linux/index.js +354 -0
- package/dist-lib/plugins/sandbox-linux/seccomp.d.ts +2 -0
- package/dist-lib/plugins/sandbox-linux/seccomp.js +74 -0
- package/dist-lib/plugins/sandbox-macos/index.d.ts +25 -11
- package/dist-lib/plugins/sandbox-macos/index.js +244 -49
- package/dist-lib/plugins/sandbox-vm/index.d.ts +2 -1
- package/dist-lib/plugins/sandbox-vm/index.js +5 -2
- package/dist-lib/plugins/sandbox-vm/vm-shell.d.ts +7 -3
- package/dist-lib/plugins/sandbox-vm/vm-shell.js +54 -20
- package/dist-lib/plugins/sandbox-windows/helper/qvac-sandbox.c +554 -0
- package/dist-lib/plugins/sandbox-windows/index.d.ts +53 -0
- package/dist-lib/plugins/sandbox-windows/index.js +205 -0
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-arm64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/sandbox-windows/prebuilds/win32-x64/qvac-sandbox.exe +0 -0
- package/dist-lib/plugins/speech/audio-resample.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-resample.js +8 -8
- package/dist-lib/plugins/speech/audio-transcode-bare.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-transcode-bare.js +23 -26
- package/dist-lib/plugins/speech/audio-transcode-node.d.ts +1 -1
- package/dist-lib/plugins/speech/audio-transcode-node.js +1 -3
- package/dist-lib/plugins/speech/index.d.ts +1 -0
- package/dist-lib/plugins/speech/index.js +8 -1
- package/dist-lib/plugins/speech/speech-engine.d.ts +1 -1
- package/dist-lib/plugins/speech/speech-engine.js +10 -5
- package/dist-lib/plugins/speech/speech-runtime.js +37 -37
- package/dist-lib/plugins/speech/speech-text.d.ts +1 -0
- package/dist-lib/plugins/speech/speech-text.js +9 -4
- package/dist-lib/plugins/speech/voice.d.ts +5 -1
- package/dist-lib/plugins/speech/voice.js +107 -33
- package/dist-lib/plugins/translation/index.d.ts +2 -1
- package/dist-lib/plugins/translation/index.js +21 -10
- package/dist-lib/plugins/translation/translate.d.ts +9 -5
- package/dist-lib/plugins/translation/translate.js +69 -64
- package/dist-lib/plugins/walkie-talkie/index.d.ts +4 -2
- package/dist-lib/plugins/walkie-talkie/index.js +19 -6
- package/dist-lib/plugins/walkie-talkie/wire.d.ts +5 -0
- package/dist-lib/plugins/walkie-talkie/wire.js +6 -5
- package/dist-lib/plugins/weather/geocode.js +2 -1
- package/dist-lib/plugins/weather/lookup.js +6 -4
- package/dist-lib/plugins/web-search/engines/bing.js +2 -1
- package/dist-lib/plugins/web-search/engines/google.js +2 -1
- package/dist-lib/plugins/web-search/fetch-html.d.ts +5 -5
- package/dist-lib/plugins/web-search/fetch-html.js +12 -15
- package/dist-lib/plugins/web-search/tool.js +1 -0
- package/dist-lib/schema/generate.js +8 -1
- package/dist-lib/schema/harness.js +91 -12
- package/dist-lib/spec/bind.js +12 -0
- package/dist-lib/spec/calls.js +4 -0
- package/dist-lib/spec/hrpc/hrpc.json +55 -3
- package/dist-lib/spec/hrpc/index.js +58 -10
- package/dist-lib/spec/hrpc/messages.js +461 -209
- package/dist-lib/spec/hyperschema/index.js +461 -209
- package/dist-lib/spec/hyperschema/schema.json +285 -85
- package/dist-lib/spec/hyperschema/types.d.ts +41 -5
- package/package.json +264 -64
- package/patches/pyodide@314.0.2.patch +37 -8
- package/scripts/addon-externals.cjs +16 -5
- package/worker/harness-sidecar.mjs +23 -154
- package/dist-lib/lib/tools/create-documents.d.ts +0 -3
- package/dist-lib/lib/tools/create-documents.js +0 -95
- package/dist-lib/lib/tools/edit-documents.d.ts +0 -3
- package/dist-lib/lib/tools/edit-documents.js +0 -132
- package/dist-lib/lib/tools/exec/shell-argv.d.ts +0 -2
- package/dist-lib/lib/tools/exec/shell-argv.js +0 -61
- package/dist-lib/lib/tools/file-glob.js +0 -118
- package/dist-lib/lib/tools/grep.d.ts +0 -5
- package/dist-lib/lib/tools/grep.js +0 -184
- package/dist-lib/lib/tools/read-files.d.ts +0 -5
- package/dist-lib/lib/tools/read-files.js +0 -160
- package/dist-lib/plugins/coding/write-file.d.ts +0 -3
- package/dist-lib/plugins/coding/write-file.js +0 -52
- package/patches/@qvac%2Finference@0.21.0.patch +0 -67
- package/patches/bare-stow@0.1.5.patch +0 -68
- package/patches/hypercore-blob-server@1.15.0.patch +0 -15
- package/patches/localwatch@1.4.3.patch +0 -13
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { HarnessError } from '../errors.js';
|
|
2
|
+
import { Policy } from '../policy/index.js';
|
|
1
3
|
import { canonicalDenyRoots, defaultRealpath } from '../tools/fs/scope.js';
|
|
2
4
|
import { TOOLSETS } from '../tools/toolsets.js';
|
|
3
5
|
import { loadAddons } from './addons.js';
|
|
6
|
+
import { requireBare } from './require-bare.js';
|
|
7
|
+
import { requirePeers } from '../helpers/require-peers.js';
|
|
4
8
|
import { PluginRuntime } from './runtime.js';
|
|
5
9
|
const API_VERSION = 1;
|
|
6
10
|
const EXEC_TOOL = 'exec';
|
|
@@ -55,7 +59,8 @@ function startOrder(plugins, providers, core) {
|
|
|
55
59
|
const placed = new Set();
|
|
56
60
|
const pending = [...plugins];
|
|
57
61
|
while (pending.length > 0) {
|
|
58
|
-
const index = pending.findIndex((plugin) => (plugin.needs ?? []).every((service) => core.has(service) || placed.has(providers.get(service) ?? ''))
|
|
62
|
+
const index = pending.findIndex((plugin) => (plugin.needs ?? []).every((service) => core.has(service) || placed.has(providers.get(service) ?? '')) &&
|
|
63
|
+
(plugin.wants ?? []).every((service) => !providers.has(service) || placed.has(providers.get(service) ?? '')));
|
|
59
64
|
if (index === -1) {
|
|
60
65
|
fail(pending[0].name, 'is part of a dependency cycle');
|
|
61
66
|
}
|
|
@@ -76,7 +81,11 @@ function contextFor(plugin, ctx, { onDispose, fetch, deniedRoots }) {
|
|
|
76
81
|
}
|
|
77
82
|
function servicesFor(plugin, ctx) {
|
|
78
83
|
const view = {};
|
|
79
|
-
for (const name of [
|
|
84
|
+
for (const name of [
|
|
85
|
+
...(plugin.needs ?? []),
|
|
86
|
+
...(plugin.wants ?? []),
|
|
87
|
+
...(plugin.provides ?? [])
|
|
88
|
+
]) {
|
|
80
89
|
view[name] = { enumerable: true, get: () => Reflect.get(ctx, name) };
|
|
81
90
|
}
|
|
82
91
|
return Object.create(null, view);
|
|
@@ -100,10 +109,10 @@ function ruledTool(tool, plugin, policy) {
|
|
|
100
109
|
effect: granted ? tool.effect : () => 'write'
|
|
101
110
|
};
|
|
102
111
|
}
|
|
103
|
-
const offline = () => Promise.reject(new
|
|
104
|
-
const unfetched = () => Promise.reject(new
|
|
112
|
+
const offline = () => Promise.reject(new HarnessError('FETCH_REFUSED', ['the run has the network off']));
|
|
113
|
+
const unfetched = () => Promise.reject(new HarnessError('FETCH_REFUSED', ['the host gave the plugins no fetch']));
|
|
105
114
|
const anywhere = () => Promise.resolve(true);
|
|
106
|
-
function declaredHosts(targets) {
|
|
115
|
+
function declaredHosts(targets, allowed) {
|
|
107
116
|
const hostnames = new Set();
|
|
108
117
|
for (const target of typeof targets === 'string' ? [targets] : (targets ?? [])) {
|
|
109
118
|
try {
|
|
@@ -112,7 +121,7 @@ function declaredHosts(targets) {
|
|
|
112
121
|
catch {
|
|
113
122
|
}
|
|
114
123
|
}
|
|
115
|
-
return (host) => Promise.resolve(hostnames.has(host));
|
|
124
|
+
return (host) => Promise.resolve(hostnames.has(host) && (!allowed || Policy.allowsHost(allowed, host)));
|
|
116
125
|
}
|
|
117
126
|
function withFetch(tool, fetchFor) {
|
|
118
127
|
const { egress, execute } = tool;
|
|
@@ -123,7 +132,9 @@ function withFetch(tool, fetchFor) {
|
|
|
123
132
|
...tool,
|
|
124
133
|
execute: (args, ctx = {}) => execute(args, {
|
|
125
134
|
...ctx,
|
|
126
|
-
fetch: ctx.
|
|
135
|
+
fetch: ctx.policy?.network.mode === 'off'
|
|
136
|
+
? offline
|
|
137
|
+
: fetchFor(ctx.signal, declaredHosts(egress(args), Policy.hostsOf(ctx.policy)))
|
|
127
138
|
})
|
|
128
139
|
};
|
|
129
140
|
}
|
|
@@ -239,6 +250,8 @@ export class PluginRegistry {
|
|
|
239
250
|
_buildsExec;
|
|
240
251
|
_deniedRoots;
|
|
241
252
|
_loaded = [];
|
|
253
|
+
_order;
|
|
254
|
+
_addons = new Map();
|
|
242
255
|
_held = [];
|
|
243
256
|
_services = new Map();
|
|
244
257
|
_cleanupErrors = [];
|
|
@@ -246,6 +259,7 @@ export class PluginRegistry {
|
|
|
246
259
|
_fetch = undefined;
|
|
247
260
|
_publish = undefined;
|
|
248
261
|
_revision = 0;
|
|
262
|
+
_served = false;
|
|
249
263
|
_holds = 0;
|
|
250
264
|
_drained = null;
|
|
251
265
|
_swapping = null;
|
|
@@ -261,6 +275,7 @@ export class PluginRegistry {
|
|
|
261
275
|
for (const plugin of order) {
|
|
262
276
|
validated(plugin);
|
|
263
277
|
}
|
|
278
|
+
this._order = order;
|
|
264
279
|
const runtime = new PluginRuntime(order.map((plugin) => this._plugin(plugin, 0, (loaded) => this._loaded.push(loaded))));
|
|
265
280
|
for (const [name, value] of core) {
|
|
266
281
|
provideService(runtime.ctx, name, value);
|
|
@@ -274,6 +289,12 @@ export class PluginRegistry {
|
|
|
274
289
|
static loadAddons(owner, addons) {
|
|
275
290
|
return loadAddons(owner, addons);
|
|
276
291
|
}
|
|
292
|
+
static requirePeers(plugin, peers) {
|
|
293
|
+
requirePeers(`@qvac/harness/plugins/${plugin}`, peers);
|
|
294
|
+
}
|
|
295
|
+
static requireBare(plugin, floor) {
|
|
296
|
+
requireBare(`@qvac/harness/plugins/${plugin}`, floor);
|
|
297
|
+
}
|
|
277
298
|
start(reserved, { fetch, publish } = {}) {
|
|
278
299
|
if (this._closing) {
|
|
279
300
|
return Promise.reject(new Error('Plugin registry is closing or closed'));
|
|
@@ -283,14 +304,20 @@ export class PluginRegistry {
|
|
|
283
304
|
this._reserved = new Set(reserved);
|
|
284
305
|
this._fetch = fetch;
|
|
285
306
|
this._publish = publish;
|
|
307
|
+
for (const plugin of this._order) {
|
|
308
|
+
const loading = loadAddons(`plugin '${plugin.name}'`, plugin.addons);
|
|
309
|
+
loading.catch(noop);
|
|
310
|
+
this._addons.set(plugin, loading);
|
|
311
|
+
}
|
|
286
312
|
this._starting = this._runtime.ready().then(() => this._started());
|
|
287
313
|
return this._starting;
|
|
288
314
|
}
|
|
289
315
|
add(plugin) {
|
|
290
316
|
return this._swap(() => {
|
|
291
317
|
this._check(plugin);
|
|
318
|
+
const revision = this._served ? ++this._revision : 0;
|
|
292
319
|
return async () => {
|
|
293
|
-
await this._setUp(plugin, (loaded) => this._loaded.push(loaded));
|
|
320
|
+
await this._setUp(plugin, revision, (loaded) => this._loaded.push(loaded));
|
|
294
321
|
};
|
|
295
322
|
});
|
|
296
323
|
}
|
|
@@ -311,11 +338,12 @@ export class PluginRegistry {
|
|
|
311
338
|
this._check(plugin, name);
|
|
312
339
|
return async () => {
|
|
313
340
|
const index = await this._drop(name);
|
|
314
|
-
await this._setUp(plugin, (loaded) => this._loaded.splice(index, 0, loaded));
|
|
341
|
+
await this._setUp(plugin, ++this._revision, (loaded) => this._loaded.splice(index, 0, loaded));
|
|
315
342
|
};
|
|
316
343
|
});
|
|
317
344
|
}
|
|
318
345
|
async hold(join = false) {
|
|
346
|
+
this._served = true;
|
|
319
347
|
while (this._swapping && !(join && this._holds > 0)) {
|
|
320
348
|
await this._swapping;
|
|
321
349
|
}
|
|
@@ -331,8 +359,16 @@ export class PluginRegistry {
|
|
|
331
359
|
}
|
|
332
360
|
};
|
|
333
361
|
}
|
|
334
|
-
unload() {
|
|
335
|
-
|
|
362
|
+
async unload() {
|
|
363
|
+
const setups = [...this._held];
|
|
364
|
+
const outcomes = await Promise.allSettled(setups.map((setup) => setup.unload?.()));
|
|
365
|
+
outcomes.forEach((outcome, index) => {
|
|
366
|
+
if (outcome.status === 'fulfilled' &&
|
|
367
|
+
!this._loaded.some((loaded) => loaded.setup === setups[index])) {
|
|
368
|
+
this._forget(setups[index]);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
return outcomes;
|
|
336
372
|
}
|
|
337
373
|
unloadIdle() {
|
|
338
374
|
return Promise.allSettled(this._held.map(async (setup) => setup.unloadIdle?.()));
|
|
@@ -371,7 +407,9 @@ export class PluginRegistry {
|
|
|
371
407
|
for (const name of plugin.needs ?? []) {
|
|
372
408
|
readService(ctx, name);
|
|
373
409
|
}
|
|
374
|
-
|
|
410
|
+
const loading = this._addons.get(plugin) ?? loadAddons(`plugin '${plugin.name}'`, plugin.addons);
|
|
411
|
+
this._addons.delete(plugin);
|
|
412
|
+
await loading;
|
|
375
413
|
const onDispose = (dispose) => this._ownDispose(ctx, plugin.name, dispose);
|
|
376
414
|
const fetch = this._fetch ? this._fetch(undefined, anywhere) : unfetched;
|
|
377
415
|
const deniedRoots = Object.freeze(await canonicalDenyRoots(this._deniedRoots, defaultRealpath));
|
|
@@ -426,33 +464,64 @@ export class PluginRegistry {
|
|
|
426
464
|
}
|
|
427
465
|
});
|
|
428
466
|
}
|
|
429
|
-
async _setUp(plugin, place) {
|
|
467
|
+
async _setUp(plugin, revision, place) {
|
|
430
468
|
const setups = this._held.length;
|
|
431
469
|
try {
|
|
432
|
-
await this._runtime.add(this._plugin(plugin,
|
|
470
|
+
await this._runtime.add(this._plugin(plugin, revision, place));
|
|
433
471
|
}
|
|
434
472
|
catch (error) {
|
|
435
|
-
|
|
436
|
-
|
|
473
|
+
const acquired = this._held.slice(setups);
|
|
474
|
+
const outcomes = await Promise.allSettled(acquired.map((setup) => setup.unload?.()));
|
|
475
|
+
const failures = [error];
|
|
476
|
+
outcomes.forEach((outcome, index) => {
|
|
477
|
+
if (outcome.status === 'fulfilled') {
|
|
478
|
+
this._forget(acquired[index]);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
failures.push(outcome.reason);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
throw failures.length === 1
|
|
485
|
+
? error
|
|
486
|
+
: new AggregateError(failures, 'Plugin setup and model cleanup failed', { cause: error });
|
|
437
487
|
}
|
|
438
488
|
}
|
|
439
489
|
async _drop(name) {
|
|
440
490
|
const index = this._loaded.findIndex((loaded) => loaded.plugin.name === name);
|
|
441
491
|
const [{ plugin, setup }] = this._loaded.splice(index, 1);
|
|
442
|
-
this._held.splice(this._held.indexOf(setup), 1);
|
|
443
492
|
const errors = this._cleanupErrors.length;
|
|
493
|
+
const failures = [];
|
|
444
494
|
try {
|
|
445
495
|
await this._runtime.remove(name);
|
|
446
496
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
497
|
+
catch (error) {
|
|
498
|
+
failures.push(error);
|
|
499
|
+
}
|
|
500
|
+
this._cleanupErrors.length = errors;
|
|
501
|
+
for (const service of plugin.provides ?? []) {
|
|
502
|
+
this._services.delete(service);
|
|
503
|
+
}
|
|
504
|
+
try {
|
|
452
505
|
await setup.unload?.();
|
|
506
|
+
this._forget(setup);
|
|
507
|
+
}
|
|
508
|
+
catch (error) {
|
|
509
|
+
failures.push(error);
|
|
510
|
+
}
|
|
511
|
+
if (failures.length === 1) {
|
|
512
|
+
throw failures[0];
|
|
513
|
+
}
|
|
514
|
+
if (failures.length > 1) {
|
|
515
|
+
throw new AggregateError(failures, `Plugin '${name}' removal and model cleanup failed`);
|
|
453
516
|
}
|
|
454
517
|
return index;
|
|
455
518
|
}
|
|
519
|
+
_forget(setup) {
|
|
520
|
+
const index = this._held.indexOf(setup);
|
|
521
|
+
if (index !== -1) {
|
|
522
|
+
this._held.splice(index, 1);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
456
525
|
_check(plugin, replacing) {
|
|
457
526
|
const others = this._loaded
|
|
458
527
|
.map((loaded) => loaded.plugin)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function requireBare(subject: string, floor: string): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function requireBare(subject, floor) {
|
|
2
|
+
const running = globalThis.Bare?.version;
|
|
3
|
+
if (running === undefined || !olderThan(running.replace(/^v/, ''), floor)) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
throw new Error(`${subject} needs Bare ${floor} or later, and this is Bare ${running}`);
|
|
7
|
+
}
|
|
8
|
+
function olderThan(version, floor) {
|
|
9
|
+
const have = version.split('.').map((part) => parseInt(part, 10));
|
|
10
|
+
const need = floor.split('.').map((part) => parseInt(part, 10));
|
|
11
|
+
const differs = need.findIndex((part, i) => have[i] !== part);
|
|
12
|
+
return differs !== -1 && have[differs] < need[differs];
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AccessPolicy, CompiledPolicy, PolicyGrants, PolicyProvider, PolicyRoot, RunRoots } from '../contract/policy.ts';
|
|
2
|
+
export declare class Policy {
|
|
3
|
+
static narrow(...layers: readonly (AccessPolicy | null | undefined)[]): AccessPolicy;
|
|
4
|
+
static compile(policy: AccessPolicy | null | undefined, grants?: PolicyGrants): CompiledPolicy;
|
|
5
|
+
static enforceable(policy: CompiledPolicy, { enforces }: PolicyProvider): string | null;
|
|
6
|
+
static refusal(policy: CompiledPolicy, providers: readonly PolicyProvider[]): string | null;
|
|
7
|
+
static forRun(layers: readonly (AccessPolicy | null | undefined)[], { fsRoots, fsWriteRoots, deny }: RunRoots, providers: readonly PolicyProvider[]): CompiledPolicy | undefined;
|
|
8
|
+
static withWrites(policy: CompiledPolicy, roots: readonly PolicyRoot[]): CompiledPolicy;
|
|
9
|
+
static hostsOf(policy: CompiledPolicy | undefined): readonly string[] | undefined;
|
|
10
|
+
static allowsHost(hosts: readonly string[], host: string): boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
const PRESETS = {
|
|
3
|
+
'read-only': { files: { write: [] }, network: { mode: 'off' } },
|
|
4
|
+
'workspace-write': { network: { mode: 'off' } },
|
|
5
|
+
full: {}
|
|
6
|
+
};
|
|
7
|
+
const ORDER = ['off', 'hosts', 'on'];
|
|
8
|
+
const DECISIONS = ['allow', 'ask', 'deny'];
|
|
9
|
+
const RULE_KEYS = ['decision', 'tool', 'command', 'paths', 'hosts'];
|
|
10
|
+
const UNBOUNDED = bounds({});
|
|
11
|
+
export class Policy {
|
|
12
|
+
static narrow(...layers) {
|
|
13
|
+
return policyOf(layers.reduce((acc, layer) => (layer ? intersect(acc, bounds(layer)) : acc), UNBOUNDED));
|
|
14
|
+
}
|
|
15
|
+
static compile(policy, grants = {}) {
|
|
16
|
+
const own = bounds(policy ?? {});
|
|
17
|
+
const outside = (grant, roots) => roots !== null && !roots.some((root) => inside(grant, root));
|
|
18
|
+
const read = (grants.read ?? []).find((grant) => outside(grant, own.read));
|
|
19
|
+
if (read !== undefined) {
|
|
20
|
+
throw new Error(`a granted folder is outside the policy's files.read: ${read}`);
|
|
21
|
+
}
|
|
22
|
+
const write = (grants.write ?? []).find((grant) => outside(grant, own.write));
|
|
23
|
+
if (write !== undefined) {
|
|
24
|
+
throw new Error(`a granted write folder is outside the policy's files.write: ${write}`);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
files: {
|
|
28
|
+
read: own.read ?? 'all',
|
|
29
|
+
write: unique(grants.write ?? []),
|
|
30
|
+
deny: unique([...own.deny, ...(grants.deny ?? [])])
|
|
31
|
+
},
|
|
32
|
+
network: networkOf(own),
|
|
33
|
+
sockets: own.sockets ?? 'all',
|
|
34
|
+
exec: { allow: own.allow ?? 'all', deny: own.execDeny },
|
|
35
|
+
env: own.env ?? 'all',
|
|
36
|
+
rules: own.rules
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static enforceable(policy, { enforces }) {
|
|
40
|
+
if ((policy.exec.allow !== 'all' || policy.exec.deny.length > 0) && !enforces?.exec) {
|
|
41
|
+
return 'cannot enforce exec.allow or exec.deny';
|
|
42
|
+
}
|
|
43
|
+
if (policy.env !== 'all' && !enforces?.env) {
|
|
44
|
+
return 'cannot enforce an env allowlist';
|
|
45
|
+
}
|
|
46
|
+
if (enforces?.files === 'workspace-only' && policy.files.read !== 'all') {
|
|
47
|
+
return 'confines writes only, so it cannot enforce a files.read list';
|
|
48
|
+
}
|
|
49
|
+
if (policy.network.mode === 'hosts' && !enforces) {
|
|
50
|
+
return 'runs lines on the host, so it cannot enforce network.mode hosts';
|
|
51
|
+
}
|
|
52
|
+
if (enforces?.network === 'on-off' && policy.network.mode === 'hosts') {
|
|
53
|
+
return 'cannot enforce network.mode hosts without the egress-proxy plugin';
|
|
54
|
+
}
|
|
55
|
+
const { localhost, bind } = policy.network;
|
|
56
|
+
const partial = !localhost || !bind || policy.sockets !== 'all';
|
|
57
|
+
const bounded = enforces?.network === 'on-off' || enforces?.network === 'hosts';
|
|
58
|
+
if (bounded && policy.network.mode === 'on' && partial) {
|
|
59
|
+
return 'turns the network on or off, so it cannot enforce localhost, bind or sockets under network.mode on';
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
static refusal(policy, providers) {
|
|
64
|
+
if (!ORDER.includes(policy.network.mode)) {
|
|
65
|
+
return `network.mode ${policy.network.mode} is refused: it is not off, hosts or on`;
|
|
66
|
+
}
|
|
67
|
+
for (const provider of providers) {
|
|
68
|
+
const refused = Policy.enforceable(policy, provider);
|
|
69
|
+
if (refused) {
|
|
70
|
+
return `${provider.name} ${refused}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const malformed = policy.rules.findIndex((rule) => !wellFormed(rule));
|
|
74
|
+
return malformed === -1
|
|
75
|
+
? null
|
|
76
|
+
: `policy rule ${malformed} is malformed: it needs a decision (allow, ask or deny), a non-empty tool, command, paths or hosts, and no other key`;
|
|
77
|
+
}
|
|
78
|
+
static forRun(layers, { fsRoots = [], fsWriteRoots = [], deny = [] }, providers) {
|
|
79
|
+
if (!layers.some(Boolean)) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const access = Policy.compile(Policy.narrow(...layers), {
|
|
83
|
+
read: local(fsRoots),
|
|
84
|
+
write: local(fsWriteRoots),
|
|
85
|
+
deny
|
|
86
|
+
});
|
|
87
|
+
const refused = Policy.refusal(access, providers);
|
|
88
|
+
if (refused) {
|
|
89
|
+
throw new Error(`the run's policy is refused: ${refused}`);
|
|
90
|
+
}
|
|
91
|
+
return access;
|
|
92
|
+
}
|
|
93
|
+
static withWrites(policy, roots) {
|
|
94
|
+
if (roots.length === 0) {
|
|
95
|
+
return policy;
|
|
96
|
+
}
|
|
97
|
+
return { ...policy, files: { ...policy.files, write: [...policy.files.write, ...roots] } };
|
|
98
|
+
}
|
|
99
|
+
static hostsOf(policy) {
|
|
100
|
+
return policy?.network.mode === 'hosts' ? policy.network.hosts : undefined;
|
|
101
|
+
}
|
|
102
|
+
static allowsHost(hosts, host) {
|
|
103
|
+
const name = hostName(host);
|
|
104
|
+
return hosts.some((entry) => covers(hostName(entry), name));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function wellFormed(rule) {
|
|
108
|
+
if (typeof rule !== 'object' || rule === null || !DECISIONS.includes(rule.decision)) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (Object.keys(rule).some((key) => !RULE_KEYS.includes(key))) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
const { tool, command, paths, hosts } = rule;
|
|
115
|
+
const lists = [command, paths, hosts];
|
|
116
|
+
if (tool === undefined && lists.every((list) => list === undefined)) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return ((tool === undefined || (typeof tool === 'string' && tool !== '')) &&
|
|
120
|
+
lists.every((list) => list === undefined || strings(list)));
|
|
121
|
+
}
|
|
122
|
+
function strings(list) {
|
|
123
|
+
return (Array.isArray(list) &&
|
|
124
|
+
list.length > 0 &&
|
|
125
|
+
list.every((each) => typeof each === 'string' && each !== ''));
|
|
126
|
+
}
|
|
127
|
+
function local(roots) {
|
|
128
|
+
return roots.flatMap((root) => (root.kind === 'local' ? [root.root] : []));
|
|
129
|
+
}
|
|
130
|
+
function bounds(layer) {
|
|
131
|
+
const preset = layer.preset ? PRESETS[layer.preset] : {};
|
|
132
|
+
const read = layer.files?.read ?? preset.files?.read ?? 'all';
|
|
133
|
+
const write = layer.files?.write ?? preset.files?.write;
|
|
134
|
+
const network = layer.network ?? preset.network ?? { mode: 'on' };
|
|
135
|
+
const mode = ORDER.includes(network.mode) ? network.mode : 'off';
|
|
136
|
+
const open = mode === 'on';
|
|
137
|
+
return {
|
|
138
|
+
read: read === 'all' ? null : unique(read.map(normal)),
|
|
139
|
+
write: write ? unique(write.map(normal)) : null,
|
|
140
|
+
deny: unique((layer.files?.deny ?? preset.files?.deny ?? []).map(normal)),
|
|
141
|
+
mode,
|
|
142
|
+
hosts: open ? null : unique((network.hosts ?? []).map(hostName)),
|
|
143
|
+
localhost: network.localhost ?? open,
|
|
144
|
+
bind: network.bind ?? open,
|
|
145
|
+
sockets: socketsOf(layer.sockets, open),
|
|
146
|
+
allow: layer.exec?.allow ? unique(layer.exec.allow) : null,
|
|
147
|
+
execDeny: unique(layer.exec?.deny ?? []),
|
|
148
|
+
env: layer.env ? unique(layer.env) : null,
|
|
149
|
+
rules: layer.rules ?? []
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function socketsOf(sockets, open) {
|
|
153
|
+
if (sockets) {
|
|
154
|
+
return unique(sockets.map(normal));
|
|
155
|
+
}
|
|
156
|
+
return open ? null : [];
|
|
157
|
+
}
|
|
158
|
+
function intersect(a, b) {
|
|
159
|
+
return {
|
|
160
|
+
read: within(a.read, b.read),
|
|
161
|
+
write: within(a.write, b.write),
|
|
162
|
+
deny: unique([...a.deny, ...b.deny]),
|
|
163
|
+
mode: ORDER[Math.min(ORDER.indexOf(a.mode), ORDER.indexOf(b.mode))],
|
|
164
|
+
hosts: coveredHosts(a.hosts, b.hosts),
|
|
165
|
+
localhost: a.localhost && b.localhost,
|
|
166
|
+
bind: a.bind && b.bind,
|
|
167
|
+
sockets: within(a.sockets, b.sockets),
|
|
168
|
+
allow: common(a.allow, b.allow),
|
|
169
|
+
execDeny: unique([...a.execDeny, ...b.execDeny]),
|
|
170
|
+
env: common(a.env, b.env),
|
|
171
|
+
rules: [...a.rules, ...b.rules]
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function policyOf(own) {
|
|
175
|
+
return {
|
|
176
|
+
files: { read: own.read ?? 'all', write: own.write ?? undefined, deny: own.deny },
|
|
177
|
+
network: networkOf(own),
|
|
178
|
+
sockets: own.sockets ?? undefined,
|
|
179
|
+
exec: { allow: own.allow ?? undefined, deny: own.execDeny },
|
|
180
|
+
env: own.env ?? undefined,
|
|
181
|
+
rules: own.rules
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function networkOf(own) {
|
|
185
|
+
return {
|
|
186
|
+
mode: own.mode,
|
|
187
|
+
hosts: own.mode === 'hosts' ? (own.hosts ?? []) : [],
|
|
188
|
+
localhost: own.localhost,
|
|
189
|
+
bind: own.bind
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function within(a, b) {
|
|
193
|
+
if (a === null || b === null) {
|
|
194
|
+
return a ?? b;
|
|
195
|
+
}
|
|
196
|
+
return unique([
|
|
197
|
+
...a.filter((each) => b.some((root) => inside(each, root))),
|
|
198
|
+
...b.filter((each) => a.some((root) => inside(each, root)))
|
|
199
|
+
]).sort();
|
|
200
|
+
}
|
|
201
|
+
function coveredHosts(a, b) {
|
|
202
|
+
if (a === null || b === null) {
|
|
203
|
+
return a ?? b;
|
|
204
|
+
}
|
|
205
|
+
return unique([
|
|
206
|
+
...a.filter((each) => b.some((entry) => covers(entry, each))),
|
|
207
|
+
...b.filter((each) => a.some((entry) => covers(entry, each)))
|
|
208
|
+
]).sort();
|
|
209
|
+
}
|
|
210
|
+
function covers(entry, host) {
|
|
211
|
+
return host === entry || (entry.startsWith('*.') && host.endsWith(entry.slice(1)));
|
|
212
|
+
}
|
|
213
|
+
function hostName(host) {
|
|
214
|
+
return host
|
|
215
|
+
.toLowerCase()
|
|
216
|
+
.replace(/^\[(.*)\]$/, '$1')
|
|
217
|
+
.replace(/\.$/, '');
|
|
218
|
+
}
|
|
219
|
+
function common(a, b) {
|
|
220
|
+
if (a === null || b === null) {
|
|
221
|
+
return a ?? b;
|
|
222
|
+
}
|
|
223
|
+
return a.filter((each) => b.includes(each));
|
|
224
|
+
}
|
|
225
|
+
function inside(child, root) {
|
|
226
|
+
const relative = path.relative(normal(root), normal(child));
|
|
227
|
+
return (relative === '' ||
|
|
228
|
+
(relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)));
|
|
229
|
+
}
|
|
230
|
+
function normal(root) {
|
|
231
|
+
return path.resolve(root);
|
|
232
|
+
}
|
|
233
|
+
function unique(items) {
|
|
234
|
+
return [...new Set(items)];
|
|
235
|
+
}
|
package/dist-lib/lib/prompt.d.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import type { Message, SystemPromptParts } from './contract/index.ts';
|
|
1
|
+
import type { GuidelineWording, Message, SystemPromptParts } from './contract/index.ts';
|
|
2
2
|
export declare const RAG_CITATION_LINE = "After your answer, add one final line naming the files you used, written exactly as [Sources: file-a.pdf, file-b.md] - or [Sources: none] if the excerpts did not answer the question. This line is required, it is the only place square brackets belong, and it is removed before the user sees it.";
|
|
3
3
|
export declare function currentTimeAnnotation(now?: Date): string;
|
|
4
4
|
export declare function lastUserContent(messages: Message[]): string;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function annotateUserTimes<T extends {
|
|
6
6
|
role: string;
|
|
7
7
|
content: string;
|
|
8
|
+
sentAt?: number | undefined;
|
|
8
9
|
}>(turns: ReadonlyArray<T>, now?: Date): T[];
|
|
10
|
+
export declare function toolGuidelines(name: string, wording?: GuidelineWording): string[];
|
|
9
11
|
export interface SystemPromptInput {
|
|
10
12
|
bio?: string | null | undefined;
|
|
11
13
|
toolNames?: ReadonlyArray<string>;
|
|
12
14
|
skillsSection?: string | null;
|
|
15
|
+
platform?: string | null | undefined;
|
|
16
|
+
guidelines?: GuidelineWording | undefined;
|
|
13
17
|
}
|
|
14
|
-
export declare function systemPromptParts({ bio, toolNames, skillsSection }: SystemPromptInput): SystemPromptParts;
|
|
18
|
+
export declare function systemPromptParts({ bio, toolNames, skillsSection, platform, guidelines }: SystemPromptInput): SystemPromptParts;
|
|
15
19
|
export declare function buildSystemPrompt(input: SystemPromptInput): string;
|
|
16
20
|
export interface PromptSkill {
|
|
17
21
|
readonly name: string;
|
|
18
22
|
readonly description: string;
|
|
23
|
+
readonly note?: string | undefined;
|
|
19
24
|
}
|
|
20
|
-
export declare function skillsPromptSection(
|
|
25
|
+
export declare function skillsPromptSection(skills: ReadonlyArray<PromptSkill>, wording?: GuidelineWording): string | null;
|