@halonicjs/testing 0.0.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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +41 -1
- package/dist/adapters/http-kit/src/address-checking.d.ts +19 -0
- package/dist/adapters/http-kit/src/address-checking.js +1 -0
- package/dist/adapters/http-kit/src/address-class.d.ts +34 -0
- package/dist/adapters/http-kit/src/address-class.js +109 -0
- package/dist/adapters/http-kit/src/index.d.ts +3 -0
- package/dist/adapters/http-kit/src/index.js +2 -0
- package/dist/adapters/http-kit/src/ip-address.d.ts +23 -0
- package/dist/adapters/http-kit/src/ip-address.js +89 -0
- package/dist/adapters/integration-kit/src/auth-placement.d.ts +40 -0
- package/dist/adapters/integration-kit/src/auth-placement.js +102 -0
- package/dist/adapters/integration-kit/src/current-secret-forms.d.ts +28 -0
- package/dist/adapters/integration-kit/src/current-secret-forms.js +60 -0
- package/dist/adapters/integration-kit/src/declaration.d.ts +15 -0
- package/dist/adapters/integration-kit/src/declaration.js +78 -0
- package/dist/adapters/integration-kit/src/host.d.ts +34 -0
- package/dist/adapters/integration-kit/src/host.js +31 -0
- package/dist/adapters/integration-kit/src/index.d.ts +16 -0
- package/dist/adapters/integration-kit/src/index.js +22 -0
- package/dist/adapters/integration-kit/src/leak-attempt.d.ts +16 -0
- package/dist/adapters/integration-kit/src/leak-attempt.js +19 -0
- package/dist/adapters/integration-kit/src/limited-http.d.ts +55 -0
- package/dist/adapters/integration-kit/src/limited-http.js +225 -0
- package/dist/adapters/integration-kit/src/load-problem.d.ts +20 -0
- package/dist/adapters/integration-kit/src/load-problem.js +1 -0
- package/dist/adapters/integration-kit/src/loader.d.ts +131 -0
- package/dist/adapters/integration-kit/src/loader.js +251 -0
- package/dist/adapters/integration-kit/src/local-address.d.ts +15 -0
- package/dist/adapters/integration-kit/src/local-address.js +25 -0
- package/dist/adapters/integration-kit/src/own-request.d.ts +33 -0
- package/dist/adapters/integration-kit/src/own-request.js +36 -0
- package/dist/adapters/integration-kit/src/plugin-load.d.ts +14 -0
- package/dist/adapters/integration-kit/src/plugin-load.js +58 -0
- package/dist/adapters/integration-kit/src/policy.d.ts +83 -0
- package/dist/adapters/integration-kit/src/policy.js +37 -0
- package/dist/adapters/integration-kit/src/request-body.d.ts +38 -0
- package/dist/adapters/integration-kit/src/request-body.js +68 -0
- package/dist/adapters/integration-kit/src/request-log.d.ts +25 -0
- package/dist/adapters/integration-kit/src/request-log.js +17 -0
- package/dist/adapters/integration-kit/src/response-body.d.ts +27 -0
- package/dist/adapters/integration-kit/src/response-body.js +117 -0
- package/dist/adapters/integration-kit/src/scoped-tokens.d.ts +14 -0
- package/dist/adapters/integration-kit/src/scoped-tokens.js +27 -0
- package/dist/adapters/integration-kit/src/secret-filter.d.ts +84 -0
- package/dist/adapters/integration-kit/src/secret-filter.js +220 -0
- package/dist/adapters/integration-kit/src/secret-in-request.d.ts +62 -0
- package/dist/adapters/integration-kit/src/secret-in-request.js +139 -0
- package/dist/adapters/integration-kit/src/secret-placement.d.ts +46 -0
- package/dist/adapters/integration-kit/src/secret-placement.js +160 -0
- package/dist/adapters/integration-kit/src/sign-in-placement.d.ts +29 -0
- package/dist/adapters/integration-kit/src/sign-in-placement.js +92 -0
- package/dist/adapters/integration-kit/src/wait.d.ts +16 -0
- package/dist/adapters/integration-kit/src/wait.js +35 -0
- package/dist/core/events/src/add-usage.d.ts +10 -0
- package/dist/core/events/src/add-usage.js +27 -0
- package/dist/core/events/src/agent-resume.d.ts +24 -0
- package/dist/core/events/src/agent-resume.js +1 -0
- package/dist/core/events/src/blocked-sites.d.ts +57 -0
- package/dist/core/events/src/blocked-sites.js +89 -0
- package/dist/core/events/src/home-path.d.ts +13 -0
- package/dist/core/events/src/home-path.js +26 -0
- package/dist/core/events/src/index.d.ts +17 -0
- package/dist/core/events/src/index.js +10 -0
- package/dist/core/events/src/run-basics.d.ts +228 -0
- package/dist/core/events/src/run-basics.js +1 -0
- package/dist/core/events/src/run-event.d.ts +478 -0
- package/dist/core/events/src/run-event.js +1 -0
- package/dist/core/events/src/run-reads.d.ts +25 -0
- package/dist/core/events/src/run-reads.js +44 -0
- package/dist/core/events/src/run-sends.d.ts +47 -0
- package/dist/core/events/src/run-sends.js +68 -0
- package/dist/core/events/src/run-summary.d.ts +108 -0
- package/dist/core/events/src/run-summary.js +1 -0
- package/dist/core/events/src/sandbox-blocked.d.ts +42 -0
- package/dist/core/events/src/sandbox-blocked.js +26 -0
- package/dist/core/events/src/sandbox-opened-read.d.ts +17 -0
- package/dist/core/events/src/sandbox-opened-read.js +63 -0
- package/dist/core/events/src/sandbox-opened.d.ts +94 -0
- package/dist/core/events/src/sandbox-opened.js +52 -0
- package/dist/core/events/src/summarize.d.ts +14 -0
- package/dist/core/events/src/summarize.js +192 -0
- package/dist/core/events/src/timeline-entry.d.ts +21 -0
- package/dist/core/events/src/timeline-entry.js +106 -0
- package/dist/core/events/src/upgrade.d.ts +23 -0
- package/dist/core/events/src/upgrade.js +49 -0
- package/dist/core/format/src/compact.d.ts +30 -0
- package/dist/core/format/src/compact.js +72 -0
- package/dist/core/format/src/index.d.ts +39 -0
- package/dist/core/format/src/index.js +25 -0
- package/dist/core/format/src/integration/index.d.ts +7 -0
- package/dist/core/format/src/integration/index.js +10 -0
- package/dist/core/format/src/json-schema.d.ts +26 -0
- package/dist/core/format/src/json-schema.js +48 -0
- package/dist/core/format/src/kind.d.ts +65 -0
- package/dist/core/format/src/kind.js +1 -0
- package/dist/core/format/src/kinds/agent/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/agent/kind.js +10 -0
- package/dist/core/format/src/kinds/agent/sandbox-fields.d.ts +99 -0
- package/dist/core/format/src/kinds/agent/sandbox-fields.js +216 -0
- package/dist/core/format/src/kinds/agent/schema.d.ts +147 -0
- package/dist/core/format/src/kinds/agent/schema.js +107 -0
- package/dist/core/format/src/kinds/agent/working-folder-start.d.ts +74 -0
- package/dist/core/format/src/kinds/agent/working-folder-start.js +312 -0
- package/dist/core/format/src/kinds/collection/kind.d.ts +8 -0
- package/dist/core/format/src/kinds/collection/kind.js +14 -0
- package/dist/core/format/src/kinds/collection/schema.d.ts +89 -0
- package/dist/core/format/src/kinds/collection/schema.js +90 -0
- package/dist/core/format/src/kinds/connector/is-local.d.ts +10 -0
- package/dist/core/format/src/kinds/connector/is-local.js +43 -0
- package/dist/core/format/src/kinds/connector/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/connector/kind.js +218 -0
- package/dist/core/format/src/kinds/connector/schema.d.ts +74 -0
- package/dist/core/format/src/kinds/connector/schema.js +143 -0
- package/dist/core/format/src/kinds/deployments/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/deployments/kind.js +49 -0
- package/dist/core/format/src/kinds/deployments/schema.d.ts +77 -0
- package/dist/core/format/src/kinds/deployments/schema.js +94 -0
- package/dist/core/format/src/kinds/hub/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/hub/kind.js +10 -0
- package/dist/core/format/src/kinds/hub/schema.d.ts +54 -0
- package/dist/core/format/src/kinds/hub/schema.js +34 -0
- package/dist/core/format/src/kinds/integration/approved-sign-ins.d.ts +62 -0
- package/dist/core/format/src/kinds/integration/approved-sign-ins.js +125 -0
- package/dist/core/format/src/kinds/integration/host-key.d.ts +7 -0
- package/dist/core/format/src/kinds/integration/host-key.js +8 -0
- package/dist/core/format/src/kinds/integration/kind.d.ts +18 -0
- package/dist/core/format/src/kinds/integration/kind.js +175 -0
- package/dist/core/format/src/kinds/integration/parse-sheet.d.ts +19 -0
- package/dist/core/format/src/kinds/integration/parse-sheet.js +24 -0
- package/dist/core/format/src/kinds/integration/policy.d.ts +112 -0
- package/dist/core/format/src/kinds/integration/policy.js +327 -0
- package/dist/core/format/src/kinds/integration/schema.d.ts +410 -0
- package/dist/core/format/src/kinds/integration/schema.js +359 -0
- package/dist/core/format/src/kinds/integration/sign-in-checks.d.ts +13 -0
- package/dist/core/format/src/kinds/integration/sign-in-checks.js +120 -0
- package/dist/core/format/src/kinds/integration/sign-in-urls.d.ts +19 -0
- package/dist/core/format/src/kinds/integration/sign-in-urls.js +47 -0
- package/dist/core/format/src/kinds/knowledge/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/knowledge/kind.js +13 -0
- package/dist/core/format/src/kinds/knowledge/schema.d.ts +18 -0
- package/dist/core/format/src/kinds/knowledge/schema.js +25 -0
- package/dist/core/format/src/kinds/models/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/models/kind.js +10 -0
- package/dist/core/format/src/kinds/models/schema.d.ts +92 -0
- package/dist/core/format/src/kinds/models/schema.js +38 -0
- package/dist/core/format/src/kinds/plugin/backend.d.ts +22 -0
- package/dist/core/format/src/kinds/plugin/backend.js +31 -0
- package/dist/core/format/src/kinds/plugin/checks.d.ts +13 -0
- package/dist/core/format/src/kinds/plugin/checks.js +137 -0
- package/dist/core/format/src/kinds/plugin/kind.d.ts +8 -0
- package/dist/core/format/src/kinds/plugin/kind.js +16 -0
- package/dist/core/format/src/kinds/plugin/problems.d.ts +24 -0
- package/dist/core/format/src/kinds/plugin/problems.js +65 -0
- package/dist/core/format/src/kinds/plugin/schema.d.ts +672 -0
- package/dist/core/format/src/kinds/plugin/schema.js +261 -0
- package/dist/core/format/src/kinds/plugin/setting-values.d.ts +17 -0
- package/dist/core/format/src/kinds/plugin/setting-values.js +38 -0
- package/dist/core/format/src/kinds/plugin/ui-checks.d.ts +8 -0
- package/dist/core/format/src/kinds/plugin/ui-checks.js +85 -0
- package/dist/core/format/src/kinds/provider/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/provider/kind.js +24 -0
- package/dist/core/format/src/kinds/provider/schema.d.ts +17 -0
- package/dist/core/format/src/kinds/provider/schema.js +22 -0
- package/dist/core/format/src/kinds/routine/kind.d.ts +8 -0
- package/dist/core/format/src/kinds/routine/kind.js +62 -0
- package/dist/core/format/src/kinds/routine/schema.d.ts +94 -0
- package/dist/core/format/src/kinds/routine/schema.js +115 -0
- package/dist/core/format/src/kinds/routine/webhook-headers.d.ts +9 -0
- package/dist/core/format/src/kinds/routine/webhook-headers.js +26 -0
- package/dist/core/format/src/kinds/runtime/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/runtime/kind.js +13 -0
- package/dist/core/format/src/kinds/runtime/schema.d.ts +10 -0
- package/dist/core/format/src/kinds/runtime/schema.js +12 -0
- package/dist/core/format/src/kinds/skill/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/skill/kind.js +10 -0
- package/dist/core/format/src/kinds/skill/schema.d.ts +17 -0
- package/dist/core/format/src/kinds/skill/schema.js +17 -0
- package/dist/core/format/src/kinds/skill/scripts-folder.d.ts +27 -0
- package/dist/core/format/src/kinds/skill/scripts-folder.js +37 -0
- package/dist/core/format/src/kinds/workflow/kind.d.ts +8 -0
- package/dist/core/format/src/kinds/workflow/kind.js +14 -0
- package/dist/core/format/src/kinds/workflow/schema.d.ts +162 -0
- package/dist/core/format/src/kinds/workflow/schema.js +106 -0
- package/dist/core/format/src/kinds/workflow-test/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/workflow-test/kind.js +14 -0
- package/dist/core/format/src/kinds/workflow-test/schema.d.ts +67 -0
- package/dist/core/format/src/kinds/workflow-test/schema.js +59 -0
- package/dist/core/format/src/kinds/workspace/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/workspace/kind.js +10 -0
- package/dist/core/format/src/kinds/workspace/schema.d.ts +72 -0
- package/dist/core/format/src/kinds/workspace/schema.js +66 -0
- package/dist/core/format/src/parse-file.d.ts +69 -0
- package/dist/core/format/src/parse-file.js +105 -0
- package/dist/core/format/src/recording/format.d.ts +81 -0
- package/dist/core/format/src/recording/format.js +102 -0
- package/dist/core/format/src/recording/index.d.ts +1 -0
- package/dist/core/format/src/recording/index.js +3 -0
- package/dist/core/format/src/registry.d.ts +64 -0
- package/dist/core/format/src/registry.js +61 -0
- package/dist/core/format/src/reserved.d.ts +20 -0
- package/dist/core/format/src/reserved.js +30 -0
- package/dist/core/format/src/shared/fields.d.ts +34 -0
- package/dist/core/format/src/shared/fields.js +74 -0
- package/dist/core/format/src/shared/guard.d.ts +32 -0
- package/dist/core/format/src/shared/guard.js +16 -0
- package/dist/core/format/src/shared/key-in-value.d.ts +28 -0
- package/dist/core/format/src/shared/key-in-value.js +82 -0
- package/dist/core/format/src/shared/legacy-keys.d.ts +8 -0
- package/dist/core/format/src/shared/legacy-keys.js +17 -0
- package/dist/core/format/src/shared/program-start.d.ts +60 -0
- package/dist/core/format/src/shared/program-start.js +99 -0
- package/dist/core/format/src/shared/relative-path.d.ts +29 -0
- package/dist/core/format/src/shared/relative-path.js +50 -0
- package/dist/core/format/src/shared/secret-name.d.ts +24 -0
- package/dist/core/format/src/shared/secret-name.js +107 -0
- package/dist/core/format/src/source.d.ts +16 -0
- package/dist/core/format/src/source.js +73 -0
- package/dist/core/ports/src/agent-placement-store.d.ts +74 -0
- package/dist/core/ports/src/agent-placement-store.js +27 -0
- package/dist/core/ports/src/agent-runs-not-available.d.ts +21 -0
- package/dist/core/ports/src/agent-runs-not-available.js +25 -0
- package/dist/core/ports/src/blob-store.d.ts +45 -0
- package/dist/core/ports/src/blob-store.js +24 -0
- package/dist/core/ports/src/cant-try-error.d.ts +35 -0
- package/dist/core/ports/src/cant-try-error.js +44 -0
- package/dist/core/ports/src/chat.d.ts +127 -0
- package/dist/core/ports/src/chat.js +1 -0
- package/dist/core/ports/src/clock.d.ts +7 -0
- package/dist/core/ports/src/clock.js +2 -0
- package/dist/core/ports/src/connection-settings-store.d.ts +57 -0
- package/dist/core/ports/src/connection-settings-store.js +2 -0
- package/dist/core/ports/src/connector-client.d.ts +303 -0
- package/dist/core/ports/src/connector-client.js +19 -0
- package/dist/core/ports/src/coordination.d.ts +84 -0
- package/dist/core/ports/src/coordination.js +2 -0
- package/dist/core/ports/src/definition-store.d.ts +229 -0
- package/dist/core/ports/src/definition-store.js +122 -0
- package/dist/core/ports/src/digest.d.ts +14 -0
- package/dist/core/ports/src/digest.js +2 -0
- package/dist/core/ports/src/folder-reader.d.ts +89 -0
- package/dist/core/ports/src/folder-reader.js +2 -0
- package/dist/core/ports/src/harness-bridge-server.d.ts +198 -0
- package/dist/core/ports/src/harness-bridge-server.js +37 -0
- package/dist/core/ports/src/harness-sign-in-command.d.ts +27 -0
- package/dist/core/ports/src/harness-sign-in-command.js +31 -0
- package/dist/core/ports/src/harness.d.ts +283 -0
- package/dist/core/ports/src/harness.js +45 -0
- package/dist/core/ports/src/host-settings-store.d.ts +116 -0
- package/dist/core/ports/src/host-settings-store.js +106 -0
- package/dist/core/ports/src/http-client.d.ts +27 -0
- package/dist/core/ports/src/http-client.js +2 -0
- package/dist/core/ports/src/id-generator.d.ts +14 -0
- package/dist/core/ports/src/id-generator.js +2 -0
- package/dist/core/ports/src/index.d.ts +45 -0
- package/dist/core/ports/src/index.js +44 -0
- package/dist/core/ports/src/instruction-trust-store.d.ts +81 -0
- package/dist/core/ports/src/instruction-trust-store.js +43 -0
- package/dist/core/ports/src/integration.d.ts +242 -0
- package/dist/core/ports/src/integration.js +31 -0
- package/dist/core/ports/src/knowledge-provider.d.ts +65 -0
- package/dist/core/ports/src/knowledge-provider.js +2 -0
- package/dist/core/ports/src/llm-cache.d.ts +13 -0
- package/dist/core/ports/src/llm-cache.js +2 -0
- package/dist/core/ports/src/llm-provider.d.ts +186 -0
- package/dist/core/ports/src/llm-provider.js +139 -0
- package/dist/core/ports/src/model-price.d.ts +34 -0
- package/dist/core/ports/src/model-price.js +25 -0
- package/dist/core/ports/src/password-hasher.d.ts +63 -0
- package/dist/core/ports/src/password-hasher.js +2 -0
- package/dist/core/ports/src/plugin-folder-writer.d.ts +104 -0
- package/dist/core/ports/src/plugin-folder-writer.js +95 -0
- package/dist/core/ports/src/port-versions.d.ts +47 -0
- package/dist/core/ports/src/port-versions.js +80 -0
- package/dist/core/ports/src/program-probe.d.ts +69 -0
- package/dist/core/ports/src/program-probe.js +2 -0
- package/dist/core/ports/src/provider-default-base-url.d.ts +10 -0
- package/dist/core/ports/src/provider-default-base-url.js +18 -0
- package/dist/core/ports/src/record-store.d.ts +79 -0
- package/dist/core/ports/src/record-store.js +108 -0
- package/dist/core/ports/src/resource-probe.d.ts +59 -0
- package/dist/core/ports/src/resource-probe.js +2 -0
- package/dist/core/ports/src/run-executor.d.ts +303 -0
- package/dist/core/ports/src/run-executor.js +2 -0
- package/dist/core/ports/src/run-failure-error.d.ts +49 -0
- package/dist/core/ports/src/run-failure-error.js +47 -0
- package/dist/core/ports/src/run-store.d.ts +194 -0
- package/dist/core/ports/src/run-store.js +131 -0
- package/dist/core/ports/src/run-target-not-found.d.ts +34 -0
- package/dist/core/ports/src/run-target-not-found.js +41 -0
- package/dist/core/ports/src/sandbox-setting-store.d.ts +68 -0
- package/dist/core/ports/src/sandbox-setting-store.js +33 -0
- package/dist/core/ports/src/sandbox.d.ts +364 -0
- package/dist/core/ports/src/sandbox.js +70 -0
- package/dist/core/ports/src/scheduler.d.ts +85 -0
- package/dist/core/ports/src/scheduler.js +2 -0
- package/dist/core/ports/src/secrets.d.ts +201 -0
- package/dist/core/ports/src/secrets.js +200 -0
- package/dist/core/ports/src/token-store.d.ts +19 -0
- package/dist/core/ports/src/token-store.js +2 -0
- package/dist/core/ports/src/tool-approval-store.d.ts +253 -0
- package/dist/core/ports/src/tool-approval-store.js +116 -0
- package/dist/core/ports/src/trust-store.d.ts +72 -0
- package/dist/core/ports/src/trust-store.js +2 -0
- package/dist/core/ports/src/unfenced-run-consent-store.d.ts +43 -0
- package/dist/core/ports/src/unfenced-run-consent-store.js +2 -0
- package/dist/core/ports/src/vcs-status.d.ts +8 -0
- package/dist/core/ports/src/vcs-status.js +90 -0
- package/dist/core/ports/src/vcs.d.ts +394 -0
- package/dist/core/ports/src/vcs.js +48 -0
- package/dist/core/schema-kit/src/builders.d.ts +50 -0
- package/dist/core/schema-kit/src/builders.js +72 -0
- package/dist/core/schema-kit/src/depth.d.ts +15 -0
- package/dist/core/schema-kit/src/depth.js +37 -0
- package/dist/core/schema-kit/src/index.d.ts +6 -0
- package/dist/core/schema-kit/src/index.js +6 -0
- package/dist/core/schema-kit/src/issue.d.ts +22 -0
- package/dist/core/schema-kit/src/issue.js +23 -0
- package/dist/core/schema-kit/src/json-schema.d.ts +23 -0
- package/dist/core/schema-kit/src/json-schema.js +22 -0
- package/dist/core/schema-kit/src/parse.d.ts +17 -0
- package/dist/core/schema-kit/src/parse.js +25 -0
- package/dist/core/schema-kit/src/schema.d.ts +12 -0
- package/dist/core/schema-kit/src/schema.js +1 -0
- package/dist/core/std/src/amount.d.ts +13 -0
- package/dist/core/std/src/amount.js +22 -0
- package/dist/core/std/src/ascii-host.d.ts +18 -0
- package/dist/core/std/src/ascii-host.js +110 -0
- package/dist/core/std/src/assert.d.ts +39 -0
- package/dist/core/std/src/assert.js +59 -0
- package/dist/core/std/src/base64url.d.ts +23 -0
- package/dist/core/std/src/base64url.js +65 -0
- package/dist/core/std/src/canonical-json.d.ts +18 -0
- package/dist/core/std/src/canonical-json.js +56 -0
- package/dist/core/std/src/clock.d.ts +27 -0
- package/dist/core/std/src/clock.js +33 -0
- package/dist/core/std/src/constant-time.d.ts +16 -0
- package/dist/core/std/src/constant-time.js +26 -0
- package/dist/core/std/src/content-digest.d.ts +24 -0
- package/dist/core/std/src/content-digest.js +28 -0
- package/dist/core/std/src/deep-clone.d.ts +15 -0
- package/dist/core/std/src/deep-clone.js +59 -0
- package/dist/core/std/src/deep-equal.d.ts +23 -0
- package/dist/core/std/src/deep-equal.js +64 -0
- package/dist/core/std/src/emitter.d.ts +42 -0
- package/dist/core/std/src/emitter.js +74 -0
- package/dist/core/std/src/error-kind.d.ts +88 -0
- package/dist/core/std/src/error-kind.js +98 -0
- package/dist/core/std/src/hex.d.ts +10 -0
- package/dist/core/std/src/hex.js +16 -0
- package/dist/core/std/src/hidden-characters.d.ts +19 -0
- package/dist/core/std/src/hidden-characters.js +54 -0
- package/dist/core/std/src/ids.d.ts +45 -0
- package/dist/core/std/src/ids.js +49 -0
- package/dist/core/std/src/index.d.ts +30 -0
- package/dist/core/std/src/index.js +31 -0
- package/dist/core/std/src/keyed-queue.d.ts +18 -0
- package/dist/core/std/src/keyed-queue.js +32 -0
- package/dist/core/std/src/line-diff.d.ts +83 -0
- package/dist/core/std/src/line-diff.js +179 -0
- package/dist/core/std/src/line-merge.d.ts +63 -0
- package/dist/core/std/src/line-merge.js +138 -0
- package/dist/core/std/src/plain-data.d.ts +32 -0
- package/dist/core/std/src/plain-data.js +57 -0
- package/dist/core/std/src/posix-path.d.ts +61 -0
- package/dist/core/std/src/posix-path.js +121 -0
- package/dist/core/std/src/public-suffixes.generated.d.ts +9 -0
- package/dist/core/std/src/public-suffixes.generated.js +10429 -0
- package/dist/core/std/src/registrable-domain.d.ts +10 -0
- package/dist/core/std/src/registrable-domain.js +62 -0
- package/dist/core/std/src/result.d.ts +55 -0
- package/dist/core/std/src/result.js +52 -0
- package/dist/core/std/src/secret-scrubber.d.ts +54 -0
- package/dist/core/std/src/secret-scrubber.js +124 -0
- package/dist/core/std/src/secret-shape.d.ts +20 -0
- package/dist/core/std/src/secret-shape.js +53 -0
- package/dist/core/std/src/secret-variable-name.d.ts +12 -0
- package/dist/core/std/src/secret-variable-name.js +34 -0
- package/dist/core/std/src/site-name.d.ts +35 -0
- package/dist/core/std/src/site-name.js +111 -0
- package/dist/core/std/src/stop-signal.d.ts +44 -0
- package/dist/core/std/src/stop-signal.js +77 -0
- package/dist/core/std/src/text.d.ts +28 -0
- package/dist/core/std/src/text.js +54 -0
- package/dist/core/std/src/url-host.d.ts +35 -0
- package/dist/core/std/src/url-host.js +170 -0
- package/dist/core/std/src/utf8.d.ts +23 -0
- package/dist/core/std/src/utf8.js +110 -0
- package/dist/core/std/src/version.d.ts +48 -0
- package/dist/core/std/src/version.js +103 -0
- package/dist/core/yaml/src/depth.d.ts +14 -0
- package/dist/core/yaml/src/depth.js +140 -0
- package/dist/core/yaml/src/edit-data.d.ts +47 -0
- package/dist/core/yaml/src/edit-data.js +286 -0
- package/dist/core/yaml/src/edit-text.d.ts +92 -0
- package/dist/core/yaml/src/edit-text.js +267 -0
- package/dist/core/yaml/src/edit.d.ts +47 -0
- package/dist/core/yaml/src/edit.js +198 -0
- package/dist/core/yaml/src/index.d.ts +5 -0
- package/dist/core/yaml/src/index.js +4 -0
- package/dist/core/yaml/src/problem.d.ts +20 -0
- package/dist/core/yaml/src/problem.js +1 -0
- package/dist/core/yaml/src/read.d.ts +47 -0
- package/dist/core/yaml/src/read.js +130 -0
- package/dist/core/yaml/src/splice-node.d.ts +47 -0
- package/dist/core/yaml/src/splice-node.js +333 -0
- package/dist/core/yaml/src/splice.d.ts +13 -0
- package/dist/core/yaml/src/splice.js +174 -0
- package/dist/core/yaml/src/unsupported.d.ts +26 -0
- package/dist/core/yaml/src/unsupported.js +70 -0
- package/dist/core/yaml/src/write.d.ts +35 -0
- package/dist/core/yaml/src/write.js +44 -0
- package/dist/testing/integration/src/canaries.d.ts +14 -0
- package/dist/testing/integration/src/canaries.js +17 -0
- package/dist/testing/integration/src/checks.d.ts +37 -0
- package/dist/testing/integration/src/checks.js +195 -0
- package/dist/testing/integration/src/describe.d.ts +35 -0
- package/dist/testing/integration/src/describe.js +74 -0
- package/dist/testing/integration/src/failure.d.ts +6 -0
- package/dist/testing/integration/src/failure.js +8 -0
- package/dist/testing/integration/src/fake-wait.d.ts +18 -0
- package/dist/testing/integration/src/fake-wait.js +21 -0
- package/dist/testing/integration/src/index.d.ts +10 -0
- package/dist/testing/integration/src/index.js +11 -0
- package/dist/testing/integration/src/load.d.ts +14 -0
- package/dist/testing/integration/src/load.js +47 -0
- package/dist/testing/integration/src/plugin-folder.d.ts +23 -0
- package/dist/testing/integration/src/plugin-folder.js +59 -0
- package/dist/testing/integration/src/plugin.d.ts +32 -0
- package/dist/testing/integration/src/plugin.js +57 -0
- package/dist/testing/integration/src/recording.d.ts +84 -0
- package/dist/testing/integration/src/recording.js +164 -0
- package/dist/testing/integration/src/run.d.ts +60 -0
- package/dist/testing/integration/src/run.js +81 -0
- package/dist/testing/integration/src/source-scan.d.ts +16 -0
- package/dist/testing/integration/src/source-scan.js +40 -0
- package/package.json +34 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Version of the {@link HttpClient} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export declare const httpClientVersion = 1;
|
|
3
|
+
/**
|
|
4
|
+
* Outbound HTTP for adapters and the host: model APIs, HTTP connectors,
|
|
5
|
+
* Google, webhooks. Replaces the old `FetchLike`. The same signature as the
|
|
6
|
+
* Web `fetch`, so most adapters wrap it directly. Some refuse addresses:
|
|
7
|
+
* the container target refuses loopback, link-local and private addresses
|
|
8
|
+
* unless a connector is explicitly allowed.
|
|
9
|
+
*
|
|
10
|
+
* An adapter that refuses addresses checks every redirect hop, and the
|
|
11
|
+
* address a host name resolves to when it connects, not only the first URL.
|
|
12
|
+
* Otherwise a redirect or a DNS answer that changes between check and
|
|
13
|
+
* connect (DNS rebinding) gets around it.
|
|
14
|
+
*
|
|
15
|
+
* Every adapter passes `init.redirect` and `init.signal` through to the
|
|
16
|
+
* request. Callers rely on both: `redirect: "error"` keeps a bearer token
|
|
17
|
+
* from following a redirect to another address, and `signal` is how they
|
|
18
|
+
* put a time limit on a request.
|
|
19
|
+
*/
|
|
20
|
+
export interface HttpClient {
|
|
21
|
+
/**
|
|
22
|
+
* Sends one request. An HTTP error status still resolves; check `ok`.
|
|
23
|
+
*
|
|
24
|
+
* @throws when the network fails, the request is aborted or the address is refused
|
|
25
|
+
*/
|
|
26
|
+
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Version of the {@link IdGenerator} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export declare const idGeneratorVersion = 1;
|
|
3
|
+
/**
|
|
4
|
+
* Makes unique ids. Passed in, so the core needs no platform randomness and
|
|
5
|
+
* tests can record event logs with fixed ids.
|
|
6
|
+
*
|
|
7
|
+
* Ids are unique, **not secret**: tests make them predictable on purpose.
|
|
8
|
+
* Anything that must be unguessable, such as a session token, uses
|
|
9
|
+
* `crypto.getRandomValues` instead.
|
|
10
|
+
*/
|
|
11
|
+
export interface IdGenerator {
|
|
12
|
+
/** A new id that starts with the prefix, such as "run_…". */
|
|
13
|
+
next(prefix: string): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { type AgentPlacementKey, type AgentPlacementRecord, type AgentPlacementStore, agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
|
|
2
|
+
export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
|
|
3
|
+
export { type BlobRef, type BlobStore, blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
|
|
4
|
+
export { CantTryError, isCantTryError } from "./cant-try-error.js";
|
|
5
|
+
export type { ChatMessage, ChatParams, ChatRequest, ChatResponse, ChatStreamEvent, ProviderReplay, ToolCall, ToolDefinition, } from "./chat.js";
|
|
6
|
+
export { type Clock, clockVersion } from "./clock.js";
|
|
7
|
+
export { type ConnectionKey, type ConnectionSettingsRecord, type ConnectionSettingsStore, connectionSettingsStoreVersion, } from "./connection-settings-store.js";
|
|
8
|
+
export { type ConnectorCallOptions, type ConnectorClient, type ConnectorConfig, type ConnectorFactory, type ConnectorFactoryContext, type ConnectorPin, type ConnectorTool, type ConnectorTransport, connectorClientVersion, passesNameRule, type ToolRisk, type TrustGrant, } from "./connector-client.js";
|
|
9
|
+
export { type Coordination, type CounterResult, coordinationVersion, type Lease, type WindowCount, } from "./coordination.js";
|
|
10
|
+
export { checkPublicWorkspacePath, checkWorkspacePath, type DefinitionSource, type DefinitionStore, type DefinitionWatch, type DefinitionWatchListener, definitionStoreVersion, type ExpectedContent, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, type RemoveOptions, type RemoveResult, segmentAsOpened, UnreadableWorkspaceFolderError, type WorkspaceFileChange, type WriteOptions, type WriteResult, } from "./definition-store.js";
|
|
11
|
+
export { type Digest, digestVersion } from "./digest.js";
|
|
12
|
+
export { type FolderEntriesOptions, type FolderEntry, type FolderReader, folderReaderVersion, } from "./folder-reader.js";
|
|
13
|
+
export { addHarnessEnvironment, type Harness, type HarnessBridge, type HarnessDetection, type HarnessDetectOptions, type HarnessEvent, type HarnessInput, type HarnessRun, type HarnessSignIn, type HarnessTask, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
|
|
14
|
+
export { type BridgeApprovalDecision, type BridgeApprovalRequest, type BridgeApprovals, type BridgeCallCharge, type BridgeEvent, type BridgeProvider, type BridgeProviderAccess, type BridgeRecorder, type BridgeToolCheck, type BridgeToolResult, type BridgeTools, bridgeCallCharge, bridgeCallCost, type HarnessBridgeOptions, type HarnessBridgeServer, harnessBridgeServerVersion, type OpenHarnessBridge, } from "./harness-bridge-server.js";
|
|
15
|
+
export { type SignInShell, signInCommandText } from "./harness-sign-in-command.js";
|
|
16
|
+
export { changeSavedHostSettings, type HostSettingsStore, type HostSettingValue, type HostSettingValues, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, type SavedHostSettingsChange, } from "./host-settings-store.js";
|
|
17
|
+
export { type HttpClient, httpClientVersion } from "./http-client.js";
|
|
18
|
+
export { type IdGenerator, idGeneratorVersion } from "./id-generator.js";
|
|
19
|
+
export { type InstructionChanges, type InstructionPin, type InstructionTrustKey, type InstructionTrustRecord, type InstructionTrustStore, instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
|
|
20
|
+
export { type AuthPlacement, type Integration, type IntegrationConnection, type IntegrationHost, type IntegrationHttpClient, type IntegrationRequestInit, type IntegrationTool, integrationVersion, maxIntegrationWaitMs, type SecretPlacement, SignInNeededError, type SignInPlacement, type SignInTokens, } from "./integration.js";
|
|
21
|
+
export { type KnowledgeCapabilities, type KnowledgeDoc, type KnowledgeHit, type KnowledgeProvider, type KnowledgeProviderContext, type KnowledgeProviderFactory, knowledgeProviderVersion, } from "./knowledge-provider.js";
|
|
22
|
+
export { type LlmCache, llmCacheVersion } from "./llm-cache.js";
|
|
23
|
+
export { isModelCallError, isModelOutOfMemory, isVendorErrorText, type LlmCapabilities, type LlmProvider, type LlmProviderFactory, llmProviderVersion, ModelCallError, type ModelCallErrorReason, modelCallErrorReasons, type ProviderConfig, type ProviderFactoryContext, VendorErrorText, } from "./llm-provider.js";
|
|
24
|
+
export { type ModelPrice, priceOf } from "./model-price.js";
|
|
25
|
+
export { type PasswordHasher, passwordHasherVersion } from "./password-hasher.js";
|
|
26
|
+
export { checkPluginFiles, checkPluginId, type PlacePluginOptions, type PluginFolderWriter, type PluginPlacement, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
|
|
27
|
+
export { type PortName, portVersions } from "./port-versions.js";
|
|
28
|
+
export { type ProgramProbe, type ProgramProbeResult, type ProgramQuestion, type ProgramSettingsFolder, programProbeVersion, } from "./program-probe.js";
|
|
29
|
+
export { defaultBaseUrl } from "./provider-default-base-url.js";
|
|
30
|
+
export { type CurrentRecord, compactedChanges, foldRecords, formatRecordLines, parseRecordLines, type RecordChange, type RecordStore, recordStoreVersion, } from "./record-store.js";
|
|
31
|
+
export { type FolderSize, type ProcessUsage, type ResourceProbe, resourceProbeVersion, } from "./resource-probe.js";
|
|
32
|
+
export { type ChatAgentSettings, type ChatTurnRefusal, type ChatTurnRequest, type ChatTurnResponse, type ChatTurnSkip, type EngineConnection, type EngineConnectionState, type RunEventListener, type RunExecutor, type RunSubscription, runExecutorVersion, type SendOptions, type StartAgentRequest, type StartRunRequest, } from "./run-executor.js";
|
|
33
|
+
export { type AdapterFailure, adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
|
|
34
|
+
export { type AppendOptions, type AppendResult, checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, type RunFilter, type RunLockRecord, type RunSnapshot, type RunStore, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
|
|
35
|
+
export { isRunTargetNotFound, type RunTargetKind, RunTargetNotFound, } from "./run-target-not-found.js";
|
|
36
|
+
export { type Sandbox, type SandboxBlock, type SandboxBlockListener, type SandboxBridge, type SandboxCapabilities, type SandboxCheck, type SandboxCommand, type SandboxExit, type SandboxFence, type SandboxFileAccess, type SandboxFix, type SandboxNetwork, type SandboxPackageManager, type SandboxProcess, type SandboxProfile, type SandboxSession, type SandboxStrength, type SandboxUnavailableReason, sandboxPackageManagers, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
|
|
37
|
+
export { isSandboxSetting, type SandboxBackendId, type SandboxSetting, type SandboxSettingStore, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
|
|
38
|
+
export { type ScheduledTimer, type Scheduler, type SchedulerFactory, type SchedulerListener, schedulerVersion, } from "./scheduler.js";
|
|
39
|
+
export { checkSecretValue, describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, maxSecretValueLength, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, type SecretStore, type Secrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
|
|
40
|
+
export { type TokenStore, tokenStoreVersion } from "./token-store.js";
|
|
41
|
+
export { isUnreadableToolApprovalError, keptWaitingVersions, type ListedToolFingerprint, type ListedToolText, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, type ToolApproval, type ToolApprovalKey, type ToolApprovalStore, type ToolServer, toolApprovalStoreVersion, UnreadableToolApprovalError, type WaitingVersion, type WrittenDigest, waitingVersionKeptMs, } from "./tool-approval-store.js";
|
|
42
|
+
export { type TrustOrigin, type TrustRecord, type TrustStore, trustStoreVersion, } from "./trust-store.js";
|
|
43
|
+
export { type UnfencedRunConsent, type UnfencedRunConsentStore, unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
|
|
44
|
+
export { checkCommitId, checkProposalRef, unversionedFolders, type Vcs, type VcsApplyOptions, type VcsChange, type VcsCommit, type VcsCommitVersionOptions, type VcsCommitWorktreeOptions, type VcsDiffStatus, type VcsFileDiff, type VcsFileStatus, type VcsStatus, type VcsWorktree, vcsVersion, } from "./vcs.js";
|
|
45
|
+
export { parseStatus } from "./vcs-status.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
|
|
2
|
+
export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
|
|
3
|
+
export { blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
|
|
4
|
+
export { CantTryError, isCantTryError } from "./cant-try-error.js";
|
|
5
|
+
export { clockVersion } from "./clock.js";
|
|
6
|
+
export { connectionSettingsStoreVersion, } from "./connection-settings-store.js";
|
|
7
|
+
export { connectorClientVersion, passesNameRule, } from "./connector-client.js";
|
|
8
|
+
export { coordinationVersion, } from "./coordination.js";
|
|
9
|
+
export { checkPublicWorkspacePath, checkWorkspacePath, definitionStoreVersion, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, segmentAsOpened, UnreadableWorkspaceFolderError, } from "./definition-store.js";
|
|
10
|
+
export { digestVersion } from "./digest.js";
|
|
11
|
+
export { folderReaderVersion, } from "./folder-reader.js";
|
|
12
|
+
export { addHarnessEnvironment, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
|
|
13
|
+
export { bridgeCallCharge, bridgeCallCost, harnessBridgeServerVersion, } from "./harness-bridge-server.js";
|
|
14
|
+
export { signInCommandText } from "./harness-sign-in-command.js";
|
|
15
|
+
export { changeSavedHostSettings, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, } from "./host-settings-store.js";
|
|
16
|
+
export { httpClientVersion } from "./http-client.js";
|
|
17
|
+
export { idGeneratorVersion } from "./id-generator.js";
|
|
18
|
+
export { instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
|
|
19
|
+
export { integrationVersion, maxIntegrationWaitMs, SignInNeededError, } from "./integration.js";
|
|
20
|
+
export { knowledgeProviderVersion, } from "./knowledge-provider.js";
|
|
21
|
+
export { llmCacheVersion } from "./llm-cache.js";
|
|
22
|
+
export { isModelCallError, isModelOutOfMemory, isVendorErrorText, llmProviderVersion, ModelCallError, modelCallErrorReasons, VendorErrorText, } from "./llm-provider.js";
|
|
23
|
+
export { priceOf } from "./model-price.js";
|
|
24
|
+
export { passwordHasherVersion } from "./password-hasher.js";
|
|
25
|
+
export { checkPluginFiles, checkPluginId, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
|
|
26
|
+
export { portVersions } from "./port-versions.js";
|
|
27
|
+
export { programProbeVersion, } from "./program-probe.js";
|
|
28
|
+
export { defaultBaseUrl } from "./provider-default-base-url.js";
|
|
29
|
+
export { compactedChanges, foldRecords, formatRecordLines, parseRecordLines, recordStoreVersion, } from "./record-store.js";
|
|
30
|
+
export { resourceProbeVersion, } from "./resource-probe.js";
|
|
31
|
+
export { runExecutorVersion, } from "./run-executor.js";
|
|
32
|
+
export { adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
|
|
33
|
+
export { checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
|
|
34
|
+
export { isRunTargetNotFound, RunTargetNotFound, } from "./run-target-not-found.js";
|
|
35
|
+
export { sandboxPackageManagers, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
|
|
36
|
+
export { isSandboxSetting, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
|
|
37
|
+
export { schedulerVersion, } from "./scheduler.js";
|
|
38
|
+
export { checkSecretValue, describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, maxSecretValueLength, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
|
|
39
|
+
export { tokenStoreVersion } from "./token-store.js";
|
|
40
|
+
export { isUnreadableToolApprovalError, keptWaitingVersions, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, toolApprovalStoreVersion, UnreadableToolApprovalError, waitingVersionKeptMs, } from "./tool-approval-store.js";
|
|
41
|
+
export { trustStoreVersion, } from "./trust-store.js";
|
|
42
|
+
export { unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
|
|
43
|
+
export { checkCommitId, checkProposalRef, unversionedFolders, vcsVersion, } from "./vcs.js";
|
|
44
|
+
export { parseStatus } from "./vcs-status.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Version of the {@link InstructionTrustStore} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export declare const instructionTrustStoreVersion = 1;
|
|
3
|
+
/** What a run's instructions were: a digest per file, and one digest for all of them. */
|
|
4
|
+
export interface InstructionPin {
|
|
5
|
+
/** The digest of the whole set, so two runs with the same instructions share it. */
|
|
6
|
+
readonly digest: string;
|
|
7
|
+
/** Each file's `sha256:` digest, by file name. */
|
|
8
|
+
readonly files: Readonly<Record<string, string>>;
|
|
9
|
+
}
|
|
10
|
+
/** How a set of instructions differs from a trusted pin. */
|
|
11
|
+
export interface InstructionChanges {
|
|
12
|
+
readonly added: readonly string[];
|
|
13
|
+
readonly removed: readonly string[];
|
|
14
|
+
readonly changed: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** Which agent's instructions a trusted pin is for. */
|
|
17
|
+
export interface InstructionTrustKey {
|
|
18
|
+
/** The workspace's resolved real path, as in a `TrustRecord`. */
|
|
19
|
+
location: string;
|
|
20
|
+
/** The agent's id in the workspace. */
|
|
21
|
+
agent: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The instructions a person trusted for one agent (requirement
|
|
25
|
+
* `ports.instruction-trust-store`): the pin of its `AGENTS.md` and skills as
|
|
26
|
+
* they were when the person said yes. Without a record, nothing is trusted
|
|
27
|
+
* and a person is asked.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const trusted: InstructionTrustRecord = {
|
|
31
|
+
* location: "/workspaces/acme",
|
|
32
|
+
* agent: "coder",
|
|
33
|
+
* pin: { digest: "sha256:9f86d0…", files: { "AGENTS.md": "sha256:2c26b4…" } },
|
|
34
|
+
* grantedAt: "2026-11-15T10:00:00.000Z",
|
|
35
|
+
* };
|
|
36
|
+
*/
|
|
37
|
+
export interface InstructionTrustRecord extends InstructionTrustKey {
|
|
38
|
+
/** The instructions the person trusted. */
|
|
39
|
+
pin: InstructionPin;
|
|
40
|
+
/** When the person trusted them, as ISO text. */
|
|
41
|
+
grantedAt: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Each agent's trusted instructions, in the user's profile next to the trust
|
|
45
|
+
* records: the profile folder for the CLI and `serve`, the app data folder
|
|
46
|
+
* for the desktop app, memory for tests and the browser demo. **Never inside
|
|
47
|
+
* a workspace**, so an agent that edits its own instructions can't also trust
|
|
48
|
+
* them.
|
|
49
|
+
*
|
|
50
|
+
* The port only stores pins. `instructionTrust` in `core/app` compares one
|
|
51
|
+
* with the instructions a run has, and the engine asks. Only a person trusts
|
|
52
|
+
* instructions: no tool the model can call reaches this store.
|
|
53
|
+
*
|
|
54
|
+
* A record that exists but can't be read makes `get` throw, never return
|
|
55
|
+
* `null`: the caller then asks the person, never trusts, and says why. The
|
|
56
|
+
* error names the record's key, and `remove` still deletes it.
|
|
57
|
+
*/
|
|
58
|
+
export interface InstructionTrustStore {
|
|
59
|
+
/** The trusted instructions for one agent, or `null` when there are none. */
|
|
60
|
+
get(key: InstructionTrustKey): Promise<InstructionTrustRecord | null>;
|
|
61
|
+
/** Saves trusted instructions, replacing any with the same key. */
|
|
62
|
+
save(record: InstructionTrustRecord): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Deletes the trusted instructions for one agent, even a record that can't
|
|
65
|
+
* be read. Removing a record that isn't there is not an error.
|
|
66
|
+
*/
|
|
67
|
+
remove(key: InstructionTrustKey): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Whether `value`, as read back from a store, is valid trusted instructions
|
|
71
|
+
* for `key`: exactly the fields of an {@link InstructionTrustRecord}, the key
|
|
72
|
+
* asked for, a pin whose `digest` and every file digest are in `sha256:` form,
|
|
73
|
+
* and a time that is text. Anything else is a damaged or borrowed record, such
|
|
74
|
+
* as a hand edit or a file copied from another agent, and must never count as
|
|
75
|
+
* trust. Every adapter checks what it reads with this, and the service in
|
|
76
|
+
* `core/app` checks what an adapter gives back with it again.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* isInstructionTrustFor(key, JSON.parse(text)); // false for `{ ...record, trusted: true }`
|
|
80
|
+
*/
|
|
81
|
+
export declare function isInstructionTrustFor(key: InstructionTrustKey, value: unknown): value is InstructionTrustRecord;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Version of the {@link InstructionTrustStore} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export const instructionTrustStoreVersion = 1;
|
|
3
|
+
const recordFields = ["location", "agent", "pin", "grantedAt"];
|
|
4
|
+
const pinFields = ["digest", "files"];
|
|
5
|
+
const digestPattern = /^sha256:[0-9a-f]{64}$/u;
|
|
6
|
+
/** Whether `value` is a plain object with exactly `fields`, each its own property. */
|
|
7
|
+
function hasExactlyFields(value, fields) {
|
|
8
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
9
|
+
return false;
|
|
10
|
+
return (Object.keys(value).length === fields.length &&
|
|
11
|
+
fields.every((field) => Object.hasOwn(value, field)));
|
|
12
|
+
}
|
|
13
|
+
function isPin(value) {
|
|
14
|
+
if (!hasExactlyFields(value, pinFields))
|
|
15
|
+
return false;
|
|
16
|
+
const digest = value["digest"];
|
|
17
|
+
const files = value["files"];
|
|
18
|
+
if (typeof digest !== "string" || !digestPattern.test(digest))
|
|
19
|
+
return false;
|
|
20
|
+
if (typeof files !== "object" || files === null || Array.isArray(files))
|
|
21
|
+
return false;
|
|
22
|
+
return Object.values(files).every((fileDigest) => typeof fileDigest === "string" && digestPattern.test(fileDigest));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Whether `value`, as read back from a store, is valid trusted instructions
|
|
26
|
+
* for `key`: exactly the fields of an {@link InstructionTrustRecord}, the key
|
|
27
|
+
* asked for, a pin whose `digest` and every file digest are in `sha256:` form,
|
|
28
|
+
* and a time that is text. Anything else is a damaged or borrowed record, such
|
|
29
|
+
* as a hand edit or a file copied from another agent, and must never count as
|
|
30
|
+
* trust. Every adapter checks what it reads with this, and the service in
|
|
31
|
+
* `core/app` checks what an adapter gives back with it again.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* isInstructionTrustFor(key, JSON.parse(text)); // false for `{ ...record, trusted: true }`
|
|
35
|
+
*/
|
|
36
|
+
export function isInstructionTrustFor(key, value) {
|
|
37
|
+
if (!hasExactlyFields(value, recordFields))
|
|
38
|
+
return false;
|
|
39
|
+
return (value["location"] === key.location &&
|
|
40
|
+
value["agent"] === key.agent &&
|
|
41
|
+
typeof value["grantedAt"] === "string" &&
|
|
42
|
+
isPin(value["pin"]));
|
|
43
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type { ConnectorTool, ToolRisk } from "./connector-client.js";
|
|
2
|
+
import type { HttpClient } from "./http-client.js";
|
|
3
|
+
import type { KnowledgeProvider } from "./knowledge-provider.js";
|
|
4
|
+
import type { LlmProvider, ProviderConfig } from "./llm-provider.js";
|
|
5
|
+
import type { TokenStore } from "./token-store.js";
|
|
6
|
+
/**
|
|
7
|
+
* Version of the {@link Integration} and {@link IntegrationHost} ports. A
|
|
8
|
+
* change bumps it and comes with an ADR. An integration's permission sheet
|
|
9
|
+
* names the version it was built against (`kit`), and the loader refuses one
|
|
10
|
+
* built against a newer version than this. Version 2 adds the sheet's
|
|
11
|
+
* `signIns` and {@link SignInPlacement}; an integration built for version 1
|
|
12
|
+
* runs unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare const integrationVersion = 2;
|
|
15
|
+
/**
|
|
16
|
+
* The longest {@link IntegrationHost.wait} waits, in milliseconds (30 s). The
|
|
17
|
+
* host enforces it; it is exported so an integration can tell in advance
|
|
18
|
+
* that a server asks for a longer pause and give up instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare const maxIntegrationWaitMs = 30000;
|
|
21
|
+
/**
|
|
22
|
+
* A tool an integration offers: the {@link ConnectorTool} shape, with its
|
|
23
|
+
* `risk` required. The permission sheet lists the same tools with the same
|
|
24
|
+
* `risk` and `untrusted`, and the conformance suite fails when they differ.
|
|
25
|
+
*/
|
|
26
|
+
export interface IntegrationTool extends ConnectorTool {
|
|
27
|
+
risk: ToolRisk;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Puts a configured secret into one request. The integration names the
|
|
31
|
+
* secret; the host looks up the value and places it, and only when the
|
|
32
|
+
* permission sheet allows that secret to go to the request's host. The
|
|
33
|
+
* integration never sees the value, so it can't put it in a URL, a tool
|
|
34
|
+
* result, an error or a log.
|
|
35
|
+
*/
|
|
36
|
+
export type SecretPlacement =
|
|
37
|
+
/** `Authorization: Bearer <value>`. */
|
|
38
|
+
{
|
|
39
|
+
secret: string;
|
|
40
|
+
as: "bearer";
|
|
41
|
+
}
|
|
42
|
+
/** `<header>: <prefix><value>`, such as `x-api-key`. */
|
|
43
|
+
| {
|
|
44
|
+
secret: string;
|
|
45
|
+
as: "header";
|
|
46
|
+
header: string;
|
|
47
|
+
prefix?: string;
|
|
48
|
+
}
|
|
49
|
+
/** A field in a form body (`application/x-www-form-urlencoded`), such as an OAuth `client_secret`. */
|
|
50
|
+
| {
|
|
51
|
+
secret: string;
|
|
52
|
+
as: "form";
|
|
53
|
+
field: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Puts the access token of one sign-in the permission sheet declares into a
|
|
57
|
+
* request. Like a secret, the integration names the sign-in and the host
|
|
58
|
+
* places the token, only on the hosts the sheet lists for that sign-in. The
|
|
59
|
+
* integration can use the token but never read it. Only the access token can
|
|
60
|
+
* be placed: there is no `form` form.
|
|
61
|
+
*/
|
|
62
|
+
export type SignInPlacement =
|
|
63
|
+
/** `Authorization: Bearer <value>`. */
|
|
64
|
+
{
|
|
65
|
+
signIn: string;
|
|
66
|
+
as: "bearer";
|
|
67
|
+
}
|
|
68
|
+
/** `<header>: <prefix><value>`. */
|
|
69
|
+
| {
|
|
70
|
+
signIn: string;
|
|
71
|
+
as: "header";
|
|
72
|
+
header: string;
|
|
73
|
+
prefix?: string;
|
|
74
|
+
};
|
|
75
|
+
/** A secret or a sign-in's access token, placed by the host. `secret` and `signIn` never appear together. */
|
|
76
|
+
export type AuthPlacement = SecretPlacement | SignInPlacement;
|
|
77
|
+
/** A request as an integration sends it: a Web `RequestInit`, plus where to put a secret or token. */
|
|
78
|
+
export interface IntegrationRequestInit extends RequestInit {
|
|
79
|
+
/** The secrets and sign-in tokens to place in this request. Each must be declared and allowed for the host. */
|
|
80
|
+
auth?: AuthPlacement | readonly AuthPlacement[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Fresh access tokens for one integration's sign-ins, on Halonic's side of
|
|
84
|
+
* the line. The kit asks it for a token to place; it is never given to an
|
|
85
|
+
* integration, so a token can't be read, only used.
|
|
86
|
+
*/
|
|
87
|
+
export interface SignInTokens {
|
|
88
|
+
/**
|
|
89
|
+
* A token valid for at least 60 more seconds, refreshed if needed.
|
|
90
|
+
*
|
|
91
|
+
* @throws {SignInNeededError} when the sign-in isn't signed in, or the
|
|
92
|
+
* server no longer accepts its refresh token, so the user must sign in
|
|
93
|
+
* again. Any other failure, such as a network error, is thrown as it is.
|
|
94
|
+
*/
|
|
95
|
+
access(signIn: string, signal?: AbortSignal): Promise<string>;
|
|
96
|
+
/**
|
|
97
|
+
* The server answered 401 to `value`. Counts only if `value` is the
|
|
98
|
+
* current token of that sign-in.
|
|
99
|
+
*/
|
|
100
|
+
rejected(signIn: string, value: string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Every value the secret filter must remove: access tokens not yet
|
|
103
|
+
* expired, the refresh token and the client secret. Synchronous, so it
|
|
104
|
+
* holds only what has been loaded: before the first `access` for a
|
|
105
|
+
* sign-in it holds nothing for it, and nothing has been placed yet.
|
|
106
|
+
*/
|
|
107
|
+
filterValues(): readonly string[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The user has to sign in (again) before the sign-in's token can be used.
|
|
111
|
+
* {@link SignInTokens.access} throws it when there is no sign-in yet or the
|
|
112
|
+
* server answered `invalid_grant` to the refresh token. The kit turns it into
|
|
113
|
+
* the refusal `sign-in-needed`; a failure that signing in wouldn't fix, such
|
|
114
|
+
* as a network error, is not this error.
|
|
115
|
+
*/
|
|
116
|
+
export declare class SignInNeededError extends Error {
|
|
117
|
+
readonly name = "SignInNeededError";
|
|
118
|
+
/** The sign-in, as the sheet names it. */
|
|
119
|
+
readonly signIn: string;
|
|
120
|
+
constructor(signIn: string, options?: ErrorOptions);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The only way an integration reaches the network. It sends only to the
|
|
124
|
+
* hosts the permission sheet declares (exact host, `https`), checks every
|
|
125
|
+
* redirect hop the same way, and places secrets for the integration.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* const response = await host.http.fetch("https://api.example.com/v1/forecast?city=Ghent", {
|
|
129
|
+
* auth: { secret: "example-key", as: "header", header: "x-api-key" },
|
|
130
|
+
* signal,
|
|
131
|
+
* });
|
|
132
|
+
*/
|
|
133
|
+
export interface IntegrationHttpClient extends HttpClient {
|
|
134
|
+
/**
|
|
135
|
+
* Sends one request. An HTTP error status still resolves; check `ok`.
|
|
136
|
+
*
|
|
137
|
+
* @throws when the host, the scheme or a redirect isn't allowed, a secret
|
|
138
|
+
* isn't declared or isn't allowed for the host, the network fails, the
|
|
139
|
+
* request times out or is aborted, or the response is too large
|
|
140
|
+
*/
|
|
141
|
+
fetch(url: string, init?: IntegrationRequestInit): Promise<Response>;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* What an integration is given, and all it is given. There is no raw
|
|
145
|
+
* `HttpClient`, no `Secrets`, no file system and no timer: an integration
|
|
146
|
+
* reaches the outside world, and waits, only through these.
|
|
147
|
+
*/
|
|
148
|
+
export interface IntegrationHost {
|
|
149
|
+
/** Outbound HTTP, limited to the declared hosts and secrets. */
|
|
150
|
+
readonly http: IntegrationHttpClient;
|
|
151
|
+
/**
|
|
152
|
+
* Tokens this integration writes itself, such as a refresh token. Only the
|
|
153
|
+
* names its permission sheet declares, and only its own: two integrations
|
|
154
|
+
* with a token of the same name never see each other's.
|
|
155
|
+
*/
|
|
156
|
+
readonly tokens: TokenStore;
|
|
157
|
+
/**
|
|
158
|
+
* The settings the workspace gives this integration, such as a `baseUrl`
|
|
159
|
+
* or an account name. Never a secret value.
|
|
160
|
+
*/
|
|
161
|
+
readonly settings: Readonly<Record<string, unknown>>;
|
|
162
|
+
/**
|
|
163
|
+
* Waits `ms` milliseconds, at most {@link maxIntegrationWaitMs}, such as
|
|
164
|
+
* the pause a server asks for with SSE `retry:` or `Retry-After`. The host
|
|
165
|
+
* clamps `ms`: `NaN` and negative values wait 0, `Infinity` waits the
|
|
166
|
+
* maximum. Pass the tool call's own `signal`, so cancelling the call also
|
|
167
|
+
* cancels the pause and a wait never outlives its call.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* await host.wait(retryMs, signal);
|
|
171
|
+
*
|
|
172
|
+
* @throws `signal.reason` when `signal` aborts during the wait or is already aborted
|
|
173
|
+
*/
|
|
174
|
+
wait(ms: number, signal?: AbortSignal): Promise<void>;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* One integration connected through its host. Created by
|
|
178
|
+
* {@link Integration.connect}; the host closes it when the workspace no
|
|
179
|
+
* longer needs it.
|
|
180
|
+
*/
|
|
181
|
+
export interface IntegrationConnection {
|
|
182
|
+
/**
|
|
183
|
+
* Calls one of the integration's tools and returns its text result.
|
|
184
|
+
*
|
|
185
|
+
* @throws when the tool fails, the host refuses a request or `signal` aborts the call
|
|
186
|
+
*/
|
|
187
|
+
callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<string>;
|
|
188
|
+
/**
|
|
189
|
+
* The tools offered now, when they can change while connected (an MCP
|
|
190
|
+
* server). Without it the declared `tools` are the list. The host treats a
|
|
191
|
+
* tool it finds here but not in the declaration as `risk: "write"` unless
|
|
192
|
+
* the workspace sets a lower one.
|
|
193
|
+
*
|
|
194
|
+
* A server the workspace chose wrote such a tool, so the host also rebuilds
|
|
195
|
+
* its parameters from an allow-list, fences off its description, schema
|
|
196
|
+
* texts and results as untrusted text, and refuses tools that are too large
|
|
197
|
+
* or whose names it can't check (requirement
|
|
198
|
+
* `ports.untrusted-tool-listings`). Don't fence them here, and don't mark
|
|
199
|
+
* them trusted. For a declared name, the host uses the declared tool
|
|
200
|
+
* instead of the listed one.
|
|
201
|
+
*/
|
|
202
|
+
listTools?(): Promise<IntegrationTool[]>;
|
|
203
|
+
/** Builds a model provider, for an integration whose sheet `provides` `llm`. */
|
|
204
|
+
createLlmProvider?(config: ProviderConfig): LlmProvider;
|
|
205
|
+
/** Builds a knowledge source, for an integration whose sheet `provides` `knowledge`. */
|
|
206
|
+
createKnowledgeProvider?(source: {
|
|
207
|
+
id: string;
|
|
208
|
+
config: Record<string, unknown>;
|
|
209
|
+
}): KnowledgeProvider;
|
|
210
|
+
/** Releases what the connection holds. Safe to call twice. */
|
|
211
|
+
close(): Promise<void>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* An integration as its package exports it: what it is, which tools it
|
|
215
|
+
* offers, and how to connect it. Its permission sheet (`integration.yaml`)
|
|
216
|
+
* declares the same name, version and tools, plus the hosts, secrets and
|
|
217
|
+
* tokens it may use.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* export const weather: Integration = {
|
|
221
|
+
* name: "weather",
|
|
222
|
+
* version: "1.0.0",
|
|
223
|
+
* tools: [{ name: "forecast", description: "…", parameters: { type: "object" }, risk: "read", untrusted: true }],
|
|
224
|
+
* connect: (host) => ({
|
|
225
|
+
* callTool: async (_name, args, signal) => {
|
|
226
|
+
* const response = await host.http.fetch(`https://api.example.com/v1/forecast?city=${encodeURIComponent(String(args["city"]))}`, { signal });
|
|
227
|
+
* return await response.text();
|
|
228
|
+
* },
|
|
229
|
+
* close: async () => {},
|
|
230
|
+
* }),
|
|
231
|
+
* };
|
|
232
|
+
*/
|
|
233
|
+
export interface Integration {
|
|
234
|
+
/** The integration's name: lower-case words joined by `-`. The sheet's `id`. */
|
|
235
|
+
readonly name: string;
|
|
236
|
+
/** Its version, `major.minor.patch`. The sheet's `version`. */
|
|
237
|
+
readonly version: string;
|
|
238
|
+
/** The tools it offers. Empty for an integration that only provides a model or knowledge. */
|
|
239
|
+
readonly tools: readonly IntegrationTool[];
|
|
240
|
+
/** Connects through the host. Must not send a request before the first call. */
|
|
241
|
+
connect(host: IntegrationHost): IntegrationConnection;
|
|
242
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version of the {@link Integration} and {@link IntegrationHost} ports. A
|
|
3
|
+
* change bumps it and comes with an ADR. An integration's permission sheet
|
|
4
|
+
* names the version it was built against (`kit`), and the loader refuses one
|
|
5
|
+
* built against a newer version than this. Version 2 adds the sheet's
|
|
6
|
+
* `signIns` and {@link SignInPlacement}; an integration built for version 1
|
|
7
|
+
* runs unchanged.
|
|
8
|
+
*/
|
|
9
|
+
export const integrationVersion = 2;
|
|
10
|
+
/**
|
|
11
|
+
* The longest {@link IntegrationHost.wait} waits, in milliseconds (30 s). The
|
|
12
|
+
* host enforces it; it is exported so an integration can tell in advance
|
|
13
|
+
* that a server asks for a longer pause and give up instead.
|
|
14
|
+
*/
|
|
15
|
+
export const maxIntegrationWaitMs = 30_000;
|
|
16
|
+
/**
|
|
17
|
+
* The user has to sign in (again) before the sign-in's token can be used.
|
|
18
|
+
* {@link SignInTokens.access} throws it when there is no sign-in yet or the
|
|
19
|
+
* server answered `invalid_grant` to the refresh token. The kit turns it into
|
|
20
|
+
* the refusal `sign-in-needed`; a failure that signing in wouldn't fix, such
|
|
21
|
+
* as a network error, is not this error.
|
|
22
|
+
*/
|
|
23
|
+
export class SignInNeededError extends Error {
|
|
24
|
+
name = "SignInNeededError";
|
|
25
|
+
/** The sign-in, as the sheet names it. */
|
|
26
|
+
signIn;
|
|
27
|
+
constructor(signIn, options) {
|
|
28
|
+
super(`The sign-in "${signIn}" needs the user to sign in again.`, options);
|
|
29
|
+
this.signIn = signIn;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { DefinitionSource } from "./definition-store.js";
|
|
2
|
+
import type { HttpClient } from "./http-client.js";
|
|
3
|
+
import type { Secrets } from "./secrets.js";
|
|
4
|
+
/** Version of the {@link KnowledgeProvider} and {@link KnowledgeProviderFactory} ports. A breaking change bumps it and comes with an ADR. */
|
|
5
|
+
export declare const knowledgeProviderVersion = 1;
|
|
6
|
+
/** One search result. */
|
|
7
|
+
export interface KnowledgeHit {
|
|
8
|
+
ref: string;
|
|
9
|
+
title: string;
|
|
10
|
+
snippet: string;
|
|
11
|
+
score: number;
|
|
12
|
+
}
|
|
13
|
+
/** One whole document. */
|
|
14
|
+
export interface KnowledgeDoc {
|
|
15
|
+
ref: string;
|
|
16
|
+
title: string;
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
/** What a knowledge source can do. */
|
|
20
|
+
export interface KnowledgeCapabilities {
|
|
21
|
+
search: boolean;
|
|
22
|
+
semantic: boolean;
|
|
23
|
+
ingest: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** A knowledge source agents can search and read. */
|
|
26
|
+
export interface KnowledgeProvider {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly capabilities: KnowledgeCapabilities;
|
|
29
|
+
/**
|
|
30
|
+
* Whether hits and documents may hold text someone outside the workspace
|
|
31
|
+
* wrote, such as a remote server's answers. Halonic fences that text off
|
|
32
|
+
* like an untrusted tool result, so instructions in it aren't followed.
|
|
33
|
+
* Leaving it out counts as `true`: only a source whose content the
|
|
34
|
+
* workspace itself wrote, such as its own files, says `false`.
|
|
35
|
+
*/
|
|
36
|
+
readonly untrusted?: boolean;
|
|
37
|
+
/** The best matches first. */
|
|
38
|
+
search(query: string, options?: {
|
|
39
|
+
limit?: number;
|
|
40
|
+
}): Promise<KnowledgeHit[]>;
|
|
41
|
+
/** The document, or `null` when there is no such ref. */
|
|
42
|
+
get(ref: string): Promise<KnowledgeDoc | null>;
|
|
43
|
+
/** Every document's ref and title, when the provider can list them (for prompts and summaries). */
|
|
44
|
+
list?(): Promise<{
|
|
45
|
+
ref: string;
|
|
46
|
+
title: string;
|
|
47
|
+
}[]>;
|
|
48
|
+
}
|
|
49
|
+
/** What a factory may use to build a knowledge source. */
|
|
50
|
+
export interface KnowledgeProviderContext {
|
|
51
|
+
/** The workspace files; read-only, because a knowledge source never edits them. */
|
|
52
|
+
store: DefinitionSource;
|
|
53
|
+
/** The folder of the hub or workspace the source belongs to, relative to the store. */
|
|
54
|
+
basePath: string;
|
|
55
|
+
http: HttpClient;
|
|
56
|
+
secrets: Secrets;
|
|
57
|
+
}
|
|
58
|
+
/** Creates knowledge sources of one type from their config. */
|
|
59
|
+
export interface KnowledgeProviderFactory {
|
|
60
|
+
readonly type: string;
|
|
61
|
+
create(source: {
|
|
62
|
+
id: string;
|
|
63
|
+
config: Record<string, unknown>;
|
|
64
|
+
}, context: KnowledgeProviderContext): KnowledgeProvider;
|
|
65
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChatResponse } from "./chat.js";
|
|
2
|
+
/** Version of the {@link LlmCache} port. A breaking change bumps it and comes with an ADR. */
|
|
3
|
+
export declare const llmCacheVersion = 1;
|
|
4
|
+
/**
|
|
5
|
+
* Model answers by request: a hash of model, messages, tools and settings.
|
|
6
|
+
* A simulation re-run reuses them instead of calling the model again.
|
|
7
|
+
*/
|
|
8
|
+
export interface LlmCache {
|
|
9
|
+
/** The cached answer, or `null` when there is none. */
|
|
10
|
+
get(key: string): Promise<ChatResponse | null>;
|
|
11
|
+
/** Stores an answer, replacing any answer already stored under the key. */
|
|
12
|
+
set(key: string, response: ChatResponse): Promise<void>;
|
|
13
|
+
}
|