@halonicjs/testing 0.0.0-stage → 0.1.0
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 +1 -0
- package/README.md +40 -2
- 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 +2 -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/declaration.d.ts +14 -0
- package/dist/adapters/integration-kit/src/declaration.js +77 -0
- package/dist/adapters/integration-kit/src/host.d.ts +28 -0
- package/dist/adapters/integration-kit/src/host.js +30 -0
- package/dist/adapters/integration-kit/src/index.d.ts +14 -0
- package/dist/adapters/integration-kit/src/index.js +21 -0
- package/dist/adapters/integration-kit/src/leak-attempt.d.ts +14 -0
- package/dist/adapters/integration-kit/src/leak-attempt.js +16 -0
- package/dist/adapters/integration-kit/src/limited-http.d.ts +49 -0
- package/dist/adapters/integration-kit/src/limited-http.js +182 -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 +104 -0
- package/dist/adapters/integration-kit/src/loader.js +219 -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 +55 -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 +23 -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 +205 -0
- package/dist/adapters/integration-kit/src/secret-in-request.d.ts +59 -0
- package/dist/adapters/integration-kit/src/secret-in-request.js +133 -0
- package/dist/adapters/integration-kit/src/secret-placement.d.ts +36 -0
- package/dist/adapters/integration-kit/src/secret-placement.js +190 -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/home-path.d.ts +13 -0
- package/dist/core/events/src/home-path.js +26 -0
- package/dist/core/events/src/index.d.ts +13 -0
- package/dist/core/events/src/index.js +7 -0
- package/dist/core/events/src/run-basics.d.ts +205 -0
- package/dist/core/events/src/run-basics.js +1 -0
- package/dist/core/events/src/run-event.d.ts +434 -0
- package/dist/core/events/src/run-event.js +1 -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 +188 -0
- package/dist/core/events/src/timeline-entry.d.ts +21 -0
- package/dist/core/events/src/timeline-entry.js +105 -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 +37 -0
- package/dist/core/format/src/index.js +23 -0
- package/dist/core/format/src/integration/index.d.ts +6 -0
- package/dist/core/format/src/integration/index.js +9 -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 +89 -0
- package/dist/core/format/src/kinds/agent/sandbox-fields.js +197 -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 +119 -0
- package/dist/core/format/src/kinds/connector/schema.d.ts +50 -0
- package/dist/core/format/src/kinds/connector/schema.js +92 -0
- package/dist/core/format/src/kinds/deployments/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/deployments/kind.js +25 -0
- package/dist/core/format/src/kinds/deployments/schema.d.ts +37 -0
- package/dist/core/format/src/kinds/deployments/schema.js +42 -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/kind.d.ts +16 -0
- package/dist/core/format/src/kinds/integration/kind.js +138 -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 +67 -0
- package/dist/core/format/src/kinds/integration/policy.js +268 -0
- package/dist/core/format/src/kinds/integration/schema.d.ts +233 -0
- package/dist/core/format/src/kinds/integration/schema.js +233 -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 +131 -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 +542 -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 +94 -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 +25 -0
- package/dist/core/format/src/kinds/routine/schema.d.ts +84 -0
- package/dist/core/format/src/kinds/routine/schema.js +93 -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 +37 -0
- package/dist/core/format/src/shared/fields.js +54 -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/blob-store.d.ts +33 -0
- package/dist/core/ports/src/blob-store.js +2 -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 +259 -0
- package/dist/core/ports/src/connector-client.js +2 -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 +208 -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 +189 -0
- package/dist/core/ports/src/harness-bridge-server.js +37 -0
- package/dist/core/ports/src/harness.d.ts +250 -0
- package/dist/core/ports/src/harness.js +45 -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 +37 -0
- package/dist/core/ports/src/index.js +36 -0
- package/dist/core/ports/src/integration.d.ts +178 -0
- package/dist/core/ports/src/integration.js +13 -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 +184 -0
- package/dist/core/ports/src/llm-provider.js +136 -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 +47 -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 +44 -0
- package/dist/core/ports/src/port-versions.js +74 -0
- package/dist/core/ports/src/program-probe.d.ts +46 -0
- package/dist/core/ports/src/program-probe.js +2 -0
- package/dist/core/ports/src/record-store.d.ts +62 -0
- package/dist/core/ports/src/record-store.js +38 -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 +302 -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/sandbox.d.ts +247 -0
- package/dist/core/ports/src/sandbox.js +34 -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 +128 -0
- package/dist/core/ports/src/secrets.js +144 -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 +211 -0
- package/dist/core/ports/src/tool-approval-store.js +57 -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.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/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/ids.d.ts +45 -0
- package/dist/core/std/src/ids.js +49 -0
- package/dist/core/std/src/index.d.ts +25 -0
- package/dist/core/std/src/index.js +26 -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/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/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/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 +45 -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 +35 -4
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lower-case words joined by `-`: the integration's id and its secret and
|
|
4
|
+
* token names. The same rule as the kit's `namePattern`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const INTEGRATION_NAME_PATTERN: RegExp;
|
|
7
|
+
/**
|
|
8
|
+
* A host name in lower case, with at least one dot and a top-level name of
|
|
9
|
+
* letters, and an optional `:port`. No scheme, no path, no wildcards and no
|
|
10
|
+
* IP addresses: a host the user picks is `{ fromSetting }` instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HOST_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Where the host of a `{ fromSetting }` URL may be, which the sheet declares
|
|
15
|
+
* so the trust check can say it before the setting is filled in:
|
|
16
|
+
* - `loopback`: only on this computer (`localhost`, `127.0.0.0/8`, `::1`);
|
|
17
|
+
* - `private`: only on the home network, as a private IP address;
|
|
18
|
+
* - `public`: any public host name, over `https`.
|
|
19
|
+
*
|
|
20
|
+
* `integrationPolicy` refuses a setting whose URL is outside the class.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ADDRESS_CLASSES: readonly ["loopback", "private", "public"];
|
|
23
|
+
/** One of {@link ADDRESS_CLASSES}. */
|
|
24
|
+
export type AddressClass = (typeof ADDRESS_CLASSES)[number];
|
|
25
|
+
/** A fixed host, or the host of the URL in one of the integration's settings, with its class. */
|
|
26
|
+
declare const Host: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
27
|
+
fromSetting: import("zod").ZodString;
|
|
28
|
+
class: import("zod").ZodEnum<{
|
|
29
|
+
loopback: "loopback";
|
|
30
|
+
private: "private";
|
|
31
|
+
public: "public";
|
|
32
|
+
}>;
|
|
33
|
+
}, import("zod/v4/core").$strict>]>;
|
|
34
|
+
/** A host as the sheet writes it in `hosts`. */
|
|
35
|
+
export type IntegrationHost = Infer<typeof Host>;
|
|
36
|
+
/**
|
|
37
|
+
* A host a secret may go to: a fixed host, or a `{ fromSetting }` host from
|
|
38
|
+
* `hosts`, named by its setting. The class stays with the one in `hosts`.
|
|
39
|
+
*/
|
|
40
|
+
declare const SecretHost: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
41
|
+
fromSetting: import("zod").ZodString;
|
|
42
|
+
}, import("zod/v4/core").$strict>]>;
|
|
43
|
+
/** A host as the sheet writes it in a secret's `hosts`. */
|
|
44
|
+
export type IntegrationSecretHost = Infer<typeof SecretHost>;
|
|
45
|
+
/**
|
|
46
|
+
* What every secret says, wherever the kit puts it. A plugin's local tool
|
|
47
|
+
* declares its secrets with these fields, without `as`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const secretFields: {
|
|
50
|
+
/** Why the integration needs it, in words the user understands. */
|
|
51
|
+
purpose: import("zod").ZodString;
|
|
52
|
+
/** The hosts it may go to. Each must be in the sheet's `hosts`. */
|
|
53
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
54
|
+
fromSetting: import("zod").ZodString;
|
|
55
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
56
|
+
/** Sent only when the workspace has set it up; without it the request goes out bare. */
|
|
57
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
58
|
+
};
|
|
59
|
+
/** One secret and where the kit puts it, as `SecretPlacement` in the ports says. */
|
|
60
|
+
declare const Secret: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
61
|
+
purpose: import("zod").ZodString;
|
|
62
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
63
|
+
fromSetting: import("zod").ZodString;
|
|
64
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
65
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
66
|
+
as: import("zod").ZodLiteral<"bearer">;
|
|
67
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
68
|
+
purpose: import("zod").ZodString;
|
|
69
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
70
|
+
fromSetting: import("zod").ZodString;
|
|
71
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
72
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
73
|
+
as: import("zod").ZodLiteral<"header">;
|
|
74
|
+
header: import("zod").ZodString;
|
|
75
|
+
prefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
77
|
+
purpose: import("zod").ZodString;
|
|
78
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
79
|
+
fromSetting: import("zod").ZodString;
|
|
80
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
81
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
82
|
+
as: import("zod").ZodLiteral<"form">;
|
|
83
|
+
field: import("zod").ZodString;
|
|
84
|
+
}, import("zod/v4/core").$strict>], "as">;
|
|
85
|
+
/** A secret, with `optional` filled in. */
|
|
86
|
+
export type IntegrationSecret = Infer<typeof Secret>;
|
|
87
|
+
/** A tool as a sheet declares it; a plugin's local tools declare theirs the same way. */
|
|
88
|
+
export declare const IntegrationTool: import("zod").ZodObject<{
|
|
89
|
+
name: import("zod").ZodString;
|
|
90
|
+
description: import("zod").ZodString;
|
|
91
|
+
arguments: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
92
|
+
risk: import("zod").ZodEnum<{
|
|
93
|
+
read: "read";
|
|
94
|
+
send: "send";
|
|
95
|
+
write: "write";
|
|
96
|
+
}>;
|
|
97
|
+
noun: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
98
|
+
one: import("zod").ZodString;
|
|
99
|
+
many: import("zod").ZodString;
|
|
100
|
+
}, import("zod/v4/core").$strict>>;
|
|
101
|
+
untrusted: import("zod").ZodBoolean;
|
|
102
|
+
}, import("zod/v4/core").$strict>;
|
|
103
|
+
/** A sheet's tool. */
|
|
104
|
+
export type IntegrationTool = Infer<typeof IntegrationTool>;
|
|
105
|
+
/** The secret of Halonic's own Google sign-in; only a sheet with it may have the Google fields. */
|
|
106
|
+
export declare const GOOGLE_SECRET = "google-account";
|
|
107
|
+
/**
|
|
108
|
+
* A Google scope: `https://www.googleapis.com/auth/<name>`, or one of the
|
|
109
|
+
* sign-in scopes Google names without a URL.
|
|
110
|
+
*/
|
|
111
|
+
export declare const GOOGLE_SCOPE_PATTERN: RegExp;
|
|
112
|
+
/** A Google API's service name, as the Cloud Console uses it, such as `gmail.googleapis.com`. */
|
|
113
|
+
export declare const GOOGLE_API_PATTERN: RegExp;
|
|
114
|
+
/**
|
|
115
|
+
* Google's name for an API, such as `Gmail API` or `Cloud Pub/Sub API`: up to
|
|
116
|
+
* 80 letters, digits, spaces and `( ) & ' / . , -`, starting with a letter or
|
|
117
|
+
* digit. No `:`, so no link with a scheme fits. The Google setup record keeps
|
|
118
|
+
* this name with the same rule, so a check result for a name this takes is
|
|
119
|
+
* never refused when it is saved.
|
|
120
|
+
*/
|
|
121
|
+
export declare const GOOGLE_API_NAME_PATTERN: RegExp;
|
|
122
|
+
/**
|
|
123
|
+
* An `https` URL to a lower-case host without a port, user name, password
|
|
124
|
+
* or `#fragment`. The host is the first group, so the sheet's checks can
|
|
125
|
+
* hold it against `hosts`. The core has no `URL` class (plan 4.1).
|
|
126
|
+
*/
|
|
127
|
+
export declare const GOOGLE_CHECK_URL_PATTERN: RegExp;
|
|
128
|
+
/** One hour, the most a timeout may be. */
|
|
129
|
+
export declare const MAX_TIMEOUT_MS = 3600000;
|
|
130
|
+
/** One GiB, the largest response a sheet may allow. */
|
|
131
|
+
export declare const MAX_RESPONSE_BYTES = 1073741824;
|
|
132
|
+
/**
|
|
133
|
+
* A field that holds the user's own content, as the recorder reads it:
|
|
134
|
+
* `request.body` or `response.body`, then `.name`, `.*`, `[*]` or `[n]`
|
|
135
|
+
* steps; or `request.query.<name>`, one query parameter.
|
|
136
|
+
*/
|
|
137
|
+
export declare const CONTENT_PATH_PATTERN: RegExp;
|
|
138
|
+
/**
|
|
139
|
+
* `integration.yaml`: what an integration may do, which the user approves
|
|
140
|
+
* before it runs. The kit enforces its hosts and secrets.
|
|
141
|
+
*/
|
|
142
|
+
export declare const IntegrationSheet: import("zod").ZodObject<{
|
|
143
|
+
id: import("zod").ZodString;
|
|
144
|
+
version: import("zod").ZodString;
|
|
145
|
+
kit: import("zod").ZodNumber;
|
|
146
|
+
provides: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
147
|
+
connector: "connector";
|
|
148
|
+
knowledge: "knowledge";
|
|
149
|
+
llm: "llm";
|
|
150
|
+
}>>;
|
|
151
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
152
|
+
fromSetting: import("zod").ZodString;
|
|
153
|
+
class: import("zod").ZodEnum<{
|
|
154
|
+
loopback: "loopback";
|
|
155
|
+
private: "private";
|
|
156
|
+
public: "public";
|
|
157
|
+
}>;
|
|
158
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
159
|
+
secrets: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
160
|
+
purpose: import("zod").ZodString;
|
|
161
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
162
|
+
fromSetting: import("zod").ZodString;
|
|
163
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
164
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
165
|
+
as: import("zod").ZodLiteral<"bearer">;
|
|
166
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
167
|
+
purpose: import("zod").ZodString;
|
|
168
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
169
|
+
fromSetting: import("zod").ZodString;
|
|
170
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
171
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
172
|
+
as: import("zod").ZodLiteral<"header">;
|
|
173
|
+
header: import("zod").ZodString;
|
|
174
|
+
prefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
175
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
176
|
+
purpose: import("zod").ZodString;
|
|
177
|
+
hosts: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
178
|
+
fromSetting: import("zod").ZodString;
|
|
179
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
180
|
+
optional: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
181
|
+
as: import("zod").ZodLiteral<"form">;
|
|
182
|
+
field: import("zod").ZodString;
|
|
183
|
+
}, import("zod/v4/core").$strict>], "as">>>;
|
|
184
|
+
googleScopes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
185
|
+
scope: import("zod").ZodString;
|
|
186
|
+
reason: import("zod").ZodString;
|
|
187
|
+
restricted: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
|
|
188
|
+
}, import("zod/v4/core").$strict>>>;
|
|
189
|
+
googleApis: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
190
|
+
api: import("zod").ZodString;
|
|
191
|
+
name: import("zod").ZodString;
|
|
192
|
+
}, import("zod/v4/core").$strict>>>;
|
|
193
|
+
googleCheck: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
194
|
+
method: import("zod").ZodLiteral<"GET">;
|
|
195
|
+
url: import("zod").ZodString;
|
|
196
|
+
}, import("zod/v4/core").$strict>>;
|
|
197
|
+
tokens: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
198
|
+
name: import("zod").ZodString;
|
|
199
|
+
purpose: import("zod").ZodString;
|
|
200
|
+
}, import("zod/v4/core").$strict>>>;
|
|
201
|
+
tools: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
202
|
+
name: import("zod").ZodString;
|
|
203
|
+
description: import("zod").ZodString;
|
|
204
|
+
arguments: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
205
|
+
risk: import("zod").ZodEnum<{
|
|
206
|
+
read: "read";
|
|
207
|
+
send: "send";
|
|
208
|
+
write: "write";
|
|
209
|
+
}>;
|
|
210
|
+
noun: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
211
|
+
one: import("zod").ZodString;
|
|
212
|
+
many: import("zod").ZodString;
|
|
213
|
+
}, import("zod/v4/core").$strict>>;
|
|
214
|
+
untrusted: import("zod").ZodBoolean;
|
|
215
|
+
}, import("zod/v4/core").$strict>>>;
|
|
216
|
+
needs: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
217
|
+
process: "process";
|
|
218
|
+
}>>>;
|
|
219
|
+
limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
220
|
+
timeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
221
|
+
headersTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
222
|
+
idleTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
223
|
+
maxResponseBytes: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
224
|
+
}, import("zod/v4/core").$strict>>;
|
|
225
|
+
recording: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
226
|
+
userContent: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
227
|
+
secretFields: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
228
|
+
allowContentTypes: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
229
|
+
}, import("zod/v4/core").$strict>>;
|
|
230
|
+
}, import("zod/v4/core").$strict>;
|
|
231
|
+
/** A permission sheet, with defaults filled in. */
|
|
232
|
+
export type IntegrationSheet = Infer<typeof IntegrationSheet>;
|
|
233
|
+
export {};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// The permission sheet, `integration.yaml`. This folder imports only
|
|
2
|
+
// schema-kit, so the integration kit and the conformance suite can use the
|
|
3
|
+
// sheet without the YAML reader.
|
|
4
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Lower-case words joined by `-`: the integration's id and its secret and
|
|
7
|
+
* token names. The same rule as the kit's `namePattern`.
|
|
8
|
+
*/
|
|
9
|
+
export const INTEGRATION_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
10
|
+
const name = s
|
|
11
|
+
.string()
|
|
12
|
+
.regex(INTEGRATION_NAME_PATTERN, "use lower-case words joined by '-', such as 'weather-key'");
|
|
13
|
+
/**
|
|
14
|
+
* A host name in lower case, with at least one dot and a top-level name of
|
|
15
|
+
* letters, and an optional `:port`. No scheme, no path, no wildcards and no
|
|
16
|
+
* IP addresses: a host the user picks is `{ fromSetting }` instead.
|
|
17
|
+
*/
|
|
18
|
+
export const HOST_PATTERN = /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])?(?::(?:[1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5]))?$/;
|
|
19
|
+
const fixedHost = s
|
|
20
|
+
.string()
|
|
21
|
+
.regex(HOST_PATTERN, "use an exact lower-case host name with an optional :port, such as 'api.example.com'");
|
|
22
|
+
/**
|
|
23
|
+
* Where the host of a `{ fromSetting }` URL may be, which the sheet declares
|
|
24
|
+
* so the trust check can say it before the setting is filled in:
|
|
25
|
+
* - `loopback`: only on this computer (`localhost`, `127.0.0.0/8`, `::1`);
|
|
26
|
+
* - `private`: only on the home network, as a private IP address;
|
|
27
|
+
* - `public`: any public host name, over `https`.
|
|
28
|
+
*
|
|
29
|
+
* `integrationPolicy` refuses a setting whose URL is outside the class.
|
|
30
|
+
*/
|
|
31
|
+
export const ADDRESS_CLASSES = ["loopback", "private", "public"];
|
|
32
|
+
/** A fixed host, or the host of the URL in one of the integration's settings, with its class. */
|
|
33
|
+
const Host = s.union([
|
|
34
|
+
fixedHost,
|
|
35
|
+
s.object({ fromSetting: s.string().min(1), class: s.enum(ADDRESS_CLASSES) }).strict(),
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* A host a secret may go to: a fixed host, or a `{ fromSetting }` host from
|
|
39
|
+
* `hosts`, named by its setting. The class stays with the one in `hosts`.
|
|
40
|
+
*/
|
|
41
|
+
const SecretHost = s.union([fixedHost, s.object({ fromSetting: s.string().min(1) }).strict()]);
|
|
42
|
+
/**
|
|
43
|
+
* What every secret says, wherever the kit puts it. A plugin's local tool
|
|
44
|
+
* declares its secrets with these fields, without `as`.
|
|
45
|
+
*/
|
|
46
|
+
export const secretFields = {
|
|
47
|
+
/** Why the integration needs it, in words the user understands. */
|
|
48
|
+
purpose: s.string().min(1),
|
|
49
|
+
/** The hosts it may go to. Each must be in the sheet's `hosts`. */
|
|
50
|
+
hosts: s.array(SecretHost).min(1),
|
|
51
|
+
/** Sent only when the workspace has set it up; without it the request goes out bare. */
|
|
52
|
+
optional: s.boolean().default(false),
|
|
53
|
+
};
|
|
54
|
+
/** An HTTP header name. */
|
|
55
|
+
const headerName = s.string().regex(/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/, "use an HTTP header name");
|
|
56
|
+
/** One secret and where the kit puts it, as `SecretPlacement` in the ports says. */
|
|
57
|
+
const Secret = s.discriminatedUnion("as", [
|
|
58
|
+
s.object({ ...secretFields, as: s.literal("bearer") }).strict(),
|
|
59
|
+
s
|
|
60
|
+
.object({
|
|
61
|
+
...secretFields,
|
|
62
|
+
as: s.literal("header"),
|
|
63
|
+
header: headerName,
|
|
64
|
+
prefix: s.string().optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict(),
|
|
67
|
+
s.object({ ...secretFields, as: s.literal("form"), field: s.string().min(1) }).strict(),
|
|
68
|
+
]);
|
|
69
|
+
const Token = s.object({ name, purpose: s.string().min(1) }).strict();
|
|
70
|
+
/**
|
|
71
|
+
* A plain noun in lower case: letters, with single spaces between words. No
|
|
72
|
+
* digits or other marks, so it can't carry a secret or an argument value.
|
|
73
|
+
*/
|
|
74
|
+
const TOOL_NOUN_PATTERN = /^[a-z]+(?: [a-z]+)*$/;
|
|
75
|
+
const nounWord = s
|
|
76
|
+
.string()
|
|
77
|
+
.regex(TOOL_NOUN_PATTERN, "use a lower-case noun of letters and spaces, such as 'email'");
|
|
78
|
+
/**
|
|
79
|
+
* What one call of a tool sends, in the singular and the plural, so a run can
|
|
80
|
+
* say "Sent 1 email" or "Sent 3 emails".
|
|
81
|
+
*/
|
|
82
|
+
const ToolNoun = s.object({ one: nounWord, many: nounWord }).strict();
|
|
83
|
+
/** A tool as a sheet declares it; a plugin's local tools declare theirs the same way. */
|
|
84
|
+
export const IntegrationTool = s
|
|
85
|
+
.object({
|
|
86
|
+
name: s.string().min(1),
|
|
87
|
+
/** Word for word the code's text: it is what the user approves and the model reads. */
|
|
88
|
+
description: s.string().min(1),
|
|
89
|
+
/** Each argument's description, word for word as in the code. */
|
|
90
|
+
arguments: s.record(s.string().min(1), s.string().min(1)).optional(),
|
|
91
|
+
/** `read` changes nothing, `write` changes data, `send` reaches people outside. */
|
|
92
|
+
risk: s.enum(["read", "write", "send"]),
|
|
93
|
+
/** What a `send` tool sends, such as `{ one: email, many: emails }`. */
|
|
94
|
+
noun: ToolNoun.optional(),
|
|
95
|
+
/** Whether the result carries outside content, such as mail. Always stated. */
|
|
96
|
+
untrusted: s.boolean(),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
/** The secret of Halonic's own Google sign-in; only a sheet with it may have the Google fields. */
|
|
100
|
+
export const GOOGLE_SECRET = "google-account";
|
|
101
|
+
/**
|
|
102
|
+
* A Google scope: `https://www.googleapis.com/auth/<name>`, or one of the
|
|
103
|
+
* sign-in scopes Google names without a URL.
|
|
104
|
+
*/
|
|
105
|
+
export const GOOGLE_SCOPE_PATTERN = /^(?:https:\/\/www\.googleapis\.com\/auth\/[a-z][a-z0-9._-]*|openid|email|profile)$/;
|
|
106
|
+
/** A Google API's service name, as the Cloud Console uses it, such as `gmail.googleapis.com`. */
|
|
107
|
+
export const GOOGLE_API_PATTERN = /^[a-z][a-z0-9-]*\.googleapis\.com$/;
|
|
108
|
+
/**
|
|
109
|
+
* Google's name for an API, such as `Gmail API` or `Cloud Pub/Sub API`: up to
|
|
110
|
+
* 80 letters, digits, spaces and `( ) & ' / . , -`, starting with a letter or
|
|
111
|
+
* digit. No `:`, so no link with a scheme fits. The Google setup record keeps
|
|
112
|
+
* this name with the same rule, so a check result for a name this takes is
|
|
113
|
+
* never refused when it is saved.
|
|
114
|
+
*/
|
|
115
|
+
export const GOOGLE_API_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9 ()&'/.,-]{0,79}$/;
|
|
116
|
+
/**
|
|
117
|
+
* An `https` URL to a lower-case host without a port, user name, password
|
|
118
|
+
* or `#fragment`. The host is the first group, so the sheet's checks can
|
|
119
|
+
* hold it against `hosts`. The core has no `URL` class (plan 4.1).
|
|
120
|
+
*/
|
|
121
|
+
export const GOOGLE_CHECK_URL_PATTERN = /^https:\/\/((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])?)(?:[/?][^\s#]*)?$/;
|
|
122
|
+
/** One scope the `google-account` token gets, and why, in words the user reads. */
|
|
123
|
+
const GoogleScope = s
|
|
124
|
+
.object({
|
|
125
|
+
scope: s
|
|
126
|
+
.string()
|
|
127
|
+
.regex(GOOGLE_SCOPE_PATTERN, "use a full Google scope URL, such as 'https://www.googleapis.com/auth/drive', or openid, email or profile"),
|
|
128
|
+
/** Shown to the user as it is. */
|
|
129
|
+
reason: s.string().regex(/\S/, "say why the integration needs the scope"),
|
|
130
|
+
/**
|
|
131
|
+
* Only `true`, for a scope Google calls restricted: a scope that isn't
|
|
132
|
+
* leaves the key out, so a `false` can't hide a typo.
|
|
133
|
+
*/
|
|
134
|
+
restricted: s.literal(true).optional(),
|
|
135
|
+
})
|
|
136
|
+
.strict();
|
|
137
|
+
/** One API the user switches on in the Google Cloud Console. */
|
|
138
|
+
const GoogleApi = s
|
|
139
|
+
.object({
|
|
140
|
+
api: s
|
|
141
|
+
.string()
|
|
142
|
+
.regex(GOOGLE_API_PATTERN, "use the API's service name, such as 'drive.googleapis.com'"),
|
|
143
|
+
/** Google's name for the API, shown to the user as it is. */
|
|
144
|
+
name: s
|
|
145
|
+
.string()
|
|
146
|
+
.regex(GOOGLE_API_NAME_PATTERN, "use Google's name for the API, such as 'Google Drive API', with no ':' and at most 80 characters"),
|
|
147
|
+
})
|
|
148
|
+
.strict();
|
|
149
|
+
/**
|
|
150
|
+
* The one read the host sends after sign-in to see that the API is on. It
|
|
151
|
+
* only looks, so it is a `GET` without a body.
|
|
152
|
+
*/
|
|
153
|
+
const GoogleCheck = s
|
|
154
|
+
.object({
|
|
155
|
+
method: s.literal("GET"),
|
|
156
|
+
url: s
|
|
157
|
+
.string()
|
|
158
|
+
.regex(GOOGLE_CHECK_URL_PATTERN, "use an https URL without a port, user name, password or #fragment, such as 'https://gmail.googleapis.com/gmail/v1/users/me/profile'"),
|
|
159
|
+
})
|
|
160
|
+
.strict();
|
|
161
|
+
/** One hour, the most a timeout may be. */
|
|
162
|
+
export const MAX_TIMEOUT_MS = 3_600_000;
|
|
163
|
+
/** One GiB, the largest response a sheet may allow. */
|
|
164
|
+
export const MAX_RESPONSE_BYTES = 1_073_741_824;
|
|
165
|
+
const timeout = s.number().int().positive().max(MAX_TIMEOUT_MS);
|
|
166
|
+
/** The kit's request limits; each has an upper bound, so a sheet can't switch one off. */
|
|
167
|
+
const Limits = s
|
|
168
|
+
.object({
|
|
169
|
+
/** The whole request, reading the body included. */
|
|
170
|
+
timeoutMs: timeout.optional(),
|
|
171
|
+
/** Waiting for the response headers, redirects included. */
|
|
172
|
+
headersTimeoutMs: timeout.optional(),
|
|
173
|
+
/** Waiting for the next piece of the body. */
|
|
174
|
+
idleTimeoutMs: timeout.optional(),
|
|
175
|
+
maxResponseBytes: s.number().int().positive().max(MAX_RESPONSE_BYTES).optional(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
/**
|
|
179
|
+
* A field that holds the user's own content, as the recorder reads it:
|
|
180
|
+
* `request.body` or `response.body`, then `.name`, `.*`, `[*]` or `[n]`
|
|
181
|
+
* steps; or `request.query.<name>`, one query parameter.
|
|
182
|
+
*/
|
|
183
|
+
export const CONTENT_PATH_PATTERN = /^(?:(?:request|response)\.body(?:\.[^.[\]*\s]+|\.\*|\[(?:\*|\d+)\])*|request\.query\.[^.[\]*\s]+)$/;
|
|
184
|
+
/** What the recorder must scrub beyond the rules every integration gets. */
|
|
185
|
+
const Recording = s
|
|
186
|
+
.object({
|
|
187
|
+
userContent: s
|
|
188
|
+
.array(s
|
|
189
|
+
.string()
|
|
190
|
+
.regex(CONTENT_PATH_PATTERN, "use a path from request.body, response.body or request.query, such as 'response.body.items[*].text'"))
|
|
191
|
+
.optional(),
|
|
192
|
+
/** Query parameters, form fields and JSON field names that carry a secret. */
|
|
193
|
+
secretFields: s.array(s.string().min(1)).optional(),
|
|
194
|
+
/** Content types, such as `text/plain`, that may be saved as plain text. */
|
|
195
|
+
allowContentTypes: s
|
|
196
|
+
.array(s
|
|
197
|
+
.string()
|
|
198
|
+
.regex(/^[a-z0-9][\w!#$&^.+-]*\/[a-z0-9][\w!#$&^.+-]*$/i, "use type/subtype, such as 'text/plain'"))
|
|
199
|
+
.default([]),
|
|
200
|
+
})
|
|
201
|
+
.strict();
|
|
202
|
+
/**
|
|
203
|
+
* `integration.yaml`: what an integration may do, which the user approves
|
|
204
|
+
* before it runs. The kit enforces its hosts and secrets.
|
|
205
|
+
*/
|
|
206
|
+
export const IntegrationSheet = s
|
|
207
|
+
.object({
|
|
208
|
+
/** The integration's name. */
|
|
209
|
+
id: name,
|
|
210
|
+
version: s.string().regex(/^\d+\.\d+\.\d+$/, "use major.minor.patch, such as '1.0.0'"),
|
|
211
|
+
/** The `Integration` port version it was built against. */
|
|
212
|
+
kit: s.number().int().positive(),
|
|
213
|
+
provides: s.array(s.enum(["connector", "llm", "knowledge"])).min(1),
|
|
214
|
+
hosts: s.array(Host),
|
|
215
|
+
/** Secret name → why, where it may go and how the kit puts it in. */
|
|
216
|
+
secrets: s.record(name, Secret).default({}),
|
|
217
|
+
// Studio builds the Google setup steps from the three Google fields
|
|
218
|
+
// (`@halonicjs/google-setup`). Only a sheet with the `google-account`
|
|
219
|
+
// secret may have them.
|
|
220
|
+
/** Each scope the `google-account` token gets, and why. */
|
|
221
|
+
googleScopes: s.array(GoogleScope).optional(),
|
|
222
|
+
/** The APIs to switch on; at least one whenever `googleScopes` is set. */
|
|
223
|
+
googleApis: s.array(GoogleApi).optional(),
|
|
224
|
+
googleCheck: GoogleCheck.optional(),
|
|
225
|
+
/** Values the integration itself writes and reads back later. */
|
|
226
|
+
tokens: s.array(Token).default([]),
|
|
227
|
+
tools: s.array(IntegrationTool).default([]),
|
|
228
|
+
/** Capabilities beyond HTTP. `process` starts a local program. */
|
|
229
|
+
needs: s.array(s.enum(["process"])).default([]),
|
|
230
|
+
limits: Limits.optional(),
|
|
231
|
+
recording: Recording.optional(),
|
|
232
|
+
})
|
|
233
|
+
.strict();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { checkKeysIn } from "../../shared/key-in-value.js";
|
|
2
|
+
import { KnowledgeSource } from "./schema.js";
|
|
3
|
+
/** `library/knowledge/<id>.yaml`, shared at the root or a hub's own. */
|
|
4
|
+
export const knowledgeKind = {
|
|
5
|
+
name: "knowledge",
|
|
6
|
+
about: "A knowledge source agents can search, and with files also write notes to.",
|
|
7
|
+
syntax: "yaml",
|
|
8
|
+
schema: KnowledgeSource,
|
|
9
|
+
places: [{ scope: "workspace-and-hub", folder: "library/knowledge", name: "<id>.yaml" }],
|
|
10
|
+
idFromPlace: "fallback",
|
|
11
|
+
/** `config` takes any setting, so a key pasted there is caught here. */
|
|
12
|
+
check: (source) => checkKeysIn(source.config, ["config"], "setting"),
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** `library/knowledge/<id>.yaml`: a source agents can search. */
|
|
3
|
+
export declare const KnowledgeSource: import("zod").ZodObject<{
|
|
4
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
5
|
+
id: import("zod").ZodString;
|
|
6
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
summary: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
10
|
+
auto: "auto";
|
|
11
|
+
tools: "tools";
|
|
12
|
+
}>>;
|
|
13
|
+
provider: import("zod").ZodString;
|
|
14
|
+
writable: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
15
|
+
config: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
16
|
+
}, import("zod/v4/core").$strict>;
|
|
17
|
+
/** A knowledge source, with defaults filled in. */
|
|
18
|
+
export type KnowledgeSource = Infer<typeof KnowledgeSource>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { id, version } from "../../shared/fields.js";
|
|
3
|
+
/** `library/knowledge/<id>.yaml`: a source agents can search. */
|
|
4
|
+
export const KnowledgeSource = s
|
|
5
|
+
.object({
|
|
6
|
+
version,
|
|
7
|
+
id,
|
|
8
|
+
name: s.string().optional(),
|
|
9
|
+
description: s.string().optional(),
|
|
10
|
+
/** What the source covers, written or approved by a person. Agents see it in their prompt. */
|
|
11
|
+
summary: s.string().optional(),
|
|
12
|
+
/**
|
|
13
|
+
* `tools` (the default): agents search when they decide to. `auto`: the
|
|
14
|
+
* task text is also searched before the first model call and the top
|
|
15
|
+
* passages go into the prompt.
|
|
16
|
+
*/
|
|
17
|
+
mode: s.enum(["tools", "auto"]).optional(),
|
|
18
|
+
/** Knowledge provider type, such as files, mcp or vector. */
|
|
19
|
+
provider: s.string().min(1),
|
|
20
|
+
/** Files only: agents that list the source may also write notes to it. */
|
|
21
|
+
writable: s.boolean().optional(),
|
|
22
|
+
/** Settings the knowledge provider checks against its own schema. */
|
|
23
|
+
config: s.record(s.string(), s.unknown()).default({}),
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Models } from "./schema.js";
|
|
2
|
+
/** `models.yaml` at the workspace root. */
|
|
3
|
+
export const modelsKind = {
|
|
4
|
+
name: "models",
|
|
5
|
+
about: "The model aliases agents use, each a provider's model with fallbacks and a price.",
|
|
6
|
+
syntax: "yaml",
|
|
7
|
+
schema: Models,
|
|
8
|
+
places: [{ scope: "workspace", folder: "", name: "models.yaml" }],
|
|
9
|
+
idFromPlace: "none",
|
|
10
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** Price per million tokens, in the workspace's budget currency. */
|
|
3
|
+
export declare const ModelPrice: import("zod").ZodObject<{
|
|
4
|
+
input: import("zod").ZodNumber;
|
|
5
|
+
output: import("zod").ZodNumber;
|
|
6
|
+
cacheRead: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
7
|
+
cacheWrite: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
8
|
+
cacheWrite1h: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
9
|
+
}, import("zod/v4/core").$strict>;
|
|
10
|
+
/** A model at a provider, with its tuning and price. */
|
|
11
|
+
export declare const ModelTarget: import("zod").ZodObject<{
|
|
12
|
+
provider: import("zod").ZodString;
|
|
13
|
+
model: import("zod").ZodString;
|
|
14
|
+
params: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
15
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
16
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
17
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
18
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
19
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
20
|
+
high: "high";
|
|
21
|
+
low: "low";
|
|
22
|
+
medium: "medium";
|
|
23
|
+
}>>;
|
|
24
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
25
|
+
}, import("zod/v4/core").$strict>>;
|
|
26
|
+
price: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
27
|
+
input: import("zod").ZodNumber;
|
|
28
|
+
output: import("zod").ZodNumber;
|
|
29
|
+
cacheRead: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
30
|
+
cacheWrite: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
31
|
+
cacheWrite1h: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
32
|
+
}, import("zod/v4/core").$strict>>;
|
|
33
|
+
}, import("zod/v4/core").$strict>;
|
|
34
|
+
/** An alias ("fast", "smart", "local"): a target plus the aliases to try when it fails. */
|
|
35
|
+
export declare const ModelAlias: import("zod").ZodObject<{
|
|
36
|
+
provider: import("zod").ZodString;
|
|
37
|
+
model: import("zod").ZodString;
|
|
38
|
+
params: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
39
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
40
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
41
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
42
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
43
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
44
|
+
high: "high";
|
|
45
|
+
low: "low";
|
|
46
|
+
medium: "medium";
|
|
47
|
+
}>>;
|
|
48
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
49
|
+
}, import("zod/v4/core").$strict>>;
|
|
50
|
+
price: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
51
|
+
input: import("zod").ZodNumber;
|
|
52
|
+
output: import("zod").ZodNumber;
|
|
53
|
+
cacheRead: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
54
|
+
cacheWrite: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
55
|
+
cacheWrite1h: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
56
|
+
}, import("zod/v4/core").$strict>>;
|
|
57
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
58
|
+
fallback: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
59
|
+
}, import("zod/v4/core").$strict>;
|
|
60
|
+
/** `models.yaml`: the workspace's model aliases. */
|
|
61
|
+
export declare const Models: import("zod").ZodObject<{
|
|
62
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
63
|
+
aliases: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
64
|
+
provider: import("zod").ZodString;
|
|
65
|
+
model: import("zod").ZodString;
|
|
66
|
+
params: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
67
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
68
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
69
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
70
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
71
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
72
|
+
high: "high";
|
|
73
|
+
low: "low";
|
|
74
|
+
medium: "medium";
|
|
75
|
+
}>>;
|
|
76
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
77
|
+
}, import("zod/v4/core").$strict>>;
|
|
78
|
+
price: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
79
|
+
input: import("zod").ZodNumber;
|
|
80
|
+
output: import("zod").ZodNumber;
|
|
81
|
+
cacheRead: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
82
|
+
cacheWrite: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
83
|
+
cacheWrite1h: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
84
|
+
}, import("zod/v4/core").$strict>>;
|
|
85
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
86
|
+
fallback: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
87
|
+
}, import("zod/v4/core").$strict>>;
|
|
88
|
+
}, import("zod/v4/core").$strict>;
|
|
89
|
+
/** A model alias, with defaults filled in. */
|
|
90
|
+
export type ModelAlias = Infer<typeof ModelAlias>;
|
|
91
|
+
/** The content of `models.yaml`, with defaults filled in. */
|
|
92
|
+
export type Models = Infer<typeof Models>;
|