@halonicjs/testing 0.0.0 → 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 +41 -1
- 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 +34 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** The value types a collection field can hold. */
|
|
3
|
+
export declare const FIELD_TYPES: readonly ["text", "number", "money", "date", "month", "choice", "boolean", "ref"];
|
|
4
|
+
/** One field of a collection's records. */
|
|
5
|
+
export declare const CollectionField: import("zod").ZodObject<{
|
|
6
|
+
type: import("zod").ZodEnum<{
|
|
7
|
+
boolean: "boolean";
|
|
8
|
+
choice: "choice";
|
|
9
|
+
date: "date";
|
|
10
|
+
money: "money";
|
|
11
|
+
month: "month";
|
|
12
|
+
number: "number";
|
|
13
|
+
ref: "ref";
|
|
14
|
+
text: "text";
|
|
15
|
+
}>;
|
|
16
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
required: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
18
|
+
values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
19
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
21
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
+
default: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
23
|
+
compute: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
}, import("zod/v4/core").$strict>;
|
|
25
|
+
/** A named, filtered list of records, with an optional total. */
|
|
26
|
+
export declare const CollectionView: import("zod").ZodObject<{
|
|
27
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
28
|
+
where: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull]>>, import("zod").ZodObject<{
|
|
29
|
+
gt: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
30
|
+
gte: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
31
|
+
lt: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
32
|
+
lte: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
33
|
+
not: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
34
|
+
}, import("zod/v4/core").$strict>]>>>;
|
|
35
|
+
total: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
sort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
37
|
+
}, import("zod/v4/core").$strict>;
|
|
38
|
+
/**
|
|
39
|
+
* `library/collections/<id>.collection.yaml`: a typed list of records agents
|
|
40
|
+
* read and write. The file defines it; the records are runtime data.
|
|
41
|
+
*/
|
|
42
|
+
export declare const Collection: import("zod").ZodObject<{
|
|
43
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
44
|
+
id: import("zod").ZodString;
|
|
45
|
+
name: import("zod").ZodString;
|
|
46
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
implements: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
48
|
+
fields: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
49
|
+
type: import("zod").ZodEnum<{
|
|
50
|
+
boolean: "boolean";
|
|
51
|
+
choice: "choice";
|
|
52
|
+
date: "date";
|
|
53
|
+
money: "money";
|
|
54
|
+
month: "month";
|
|
55
|
+
number: "number";
|
|
56
|
+
ref: "ref";
|
|
57
|
+
text: "text";
|
|
58
|
+
}>;
|
|
59
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
required: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
61
|
+
values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
62
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
64
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
65
|
+
default: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
66
|
+
compute: import("zod").ZodOptional<import("zod").ZodString>;
|
|
67
|
+
}, import("zod/v4/core").$strict>>;
|
|
68
|
+
views: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
69
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
+
where: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull]>>, import("zod").ZodObject<{
|
|
71
|
+
gt: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
72
|
+
gte: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
73
|
+
lt: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
74
|
+
lte: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
75
|
+
not: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
76
|
+
}, import("zod/v4/core").$strict>]>>>;
|
|
77
|
+
total: import("zod").ZodOptional<import("zod").ZodString>;
|
|
78
|
+
sort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
}, import("zod/v4/core").$strict>>>;
|
|
80
|
+
seed: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodIntersection<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>, import("zod").ZodObject<{
|
|
81
|
+
id: import("zod").ZodString;
|
|
82
|
+
}, import("zod/v4/core").$strip>>>>;
|
|
83
|
+
}, import("zod/v4/core").$strict>;
|
|
84
|
+
/** A collection definition, with defaults filled in. */
|
|
85
|
+
export type Collection = Infer<typeof Collection>;
|
|
86
|
+
/** One field of a collection. */
|
|
87
|
+
export type CollectionField = Infer<typeof CollectionField>;
|
|
88
|
+
/** A named view of a collection. */
|
|
89
|
+
export type CollectionView = Infer<typeof CollectionView>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { collectionId } from "../../shared/fields.js";
|
|
3
|
+
/** The value types a collection field can hold. */
|
|
4
|
+
export const FIELD_TYPES = [
|
|
5
|
+
"text",
|
|
6
|
+
"number",
|
|
7
|
+
"money",
|
|
8
|
+
"date",
|
|
9
|
+
"month",
|
|
10
|
+
"choice",
|
|
11
|
+
"boolean",
|
|
12
|
+
"ref",
|
|
13
|
+
];
|
|
14
|
+
const fieldName = s.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/, "Field names: letters, digits and _");
|
|
15
|
+
/** One field of a collection's records. */
|
|
16
|
+
export const CollectionField = s
|
|
17
|
+
.object({
|
|
18
|
+
type: s.enum(FIELD_TYPES),
|
|
19
|
+
description: s.string().optional(),
|
|
20
|
+
required: s.boolean().default(false),
|
|
21
|
+
/** choice: the allowed values. */
|
|
22
|
+
values: s.array(s.string()).optional(),
|
|
23
|
+
/** ref: the collection whose record ids the value holds. */
|
|
24
|
+
collection: collectionId.optional(),
|
|
25
|
+
min: s.number().optional(),
|
|
26
|
+
max: s.number().optional(),
|
|
27
|
+
default: s.unknown().optional(),
|
|
28
|
+
/** Computed from other fields, such as "amount * sharePct / 100". Never set by an agent. */
|
|
29
|
+
compute: s.string().optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict()
|
|
32
|
+
.superRefine((field, context) => {
|
|
33
|
+
if (field.type === "choice" && !field.values?.length) {
|
|
34
|
+
context.addIssue({ code: "custom", message: "A choice field needs values" });
|
|
35
|
+
}
|
|
36
|
+
if (field.type === "ref" && !field.collection) {
|
|
37
|
+
context.addIssue({ code: "custom", message: "A ref field needs a collection" });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const scalar = () => s.union([s.string(), s.number(), s.boolean(), s.null()]);
|
|
41
|
+
/** A filter value: equal to, one of a list, null for empty, or a comparison. "today" is today's date. */
|
|
42
|
+
const WhereValue = s.union([
|
|
43
|
+
s.string(),
|
|
44
|
+
s.number(),
|
|
45
|
+
s.boolean(),
|
|
46
|
+
s.null(),
|
|
47
|
+
s.array(scalar()),
|
|
48
|
+
s
|
|
49
|
+
.object({
|
|
50
|
+
gt: s.unknown(),
|
|
51
|
+
gte: s.unknown(),
|
|
52
|
+
lt: s.unknown(),
|
|
53
|
+
lte: s.unknown(),
|
|
54
|
+
not: s.unknown(),
|
|
55
|
+
})
|
|
56
|
+
.partial()
|
|
57
|
+
.strict(),
|
|
58
|
+
]);
|
|
59
|
+
/** A named, filtered list of records, with an optional total. */
|
|
60
|
+
export const CollectionView = s
|
|
61
|
+
.object({
|
|
62
|
+
description: s.string().optional(),
|
|
63
|
+
where: s.record(s.string(), WhereValue).default({}),
|
|
64
|
+
/** A number or money field summed over the view. */
|
|
65
|
+
total: s.string().optional(),
|
|
66
|
+
sort: s.string().optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
/**
|
|
70
|
+
* `library/collections/<id>.collection.yaml`: a typed list of records agents
|
|
71
|
+
* read and write. The file defines it; the records are runtime data.
|
|
72
|
+
*/
|
|
73
|
+
export const Collection = s
|
|
74
|
+
.object({
|
|
75
|
+
version: s.literal(1).default(1),
|
|
76
|
+
id: collectionId,
|
|
77
|
+
name: s.string().min(1),
|
|
78
|
+
description: s.string().optional(),
|
|
79
|
+
/** Requirement ids this collection serves. */
|
|
80
|
+
implements: s.array(s.string()).default([]),
|
|
81
|
+
fields: s
|
|
82
|
+
.record(fieldName, CollectionField)
|
|
83
|
+
.refine((fields) => Object.keys(fields).length > 0, "A collection needs fields"),
|
|
84
|
+
views: s.record(s.string(), CollectionView).default({}),
|
|
85
|
+
/** Records added once when no record with their id exists yet. */
|
|
86
|
+
seed: s
|
|
87
|
+
.array(s.record(s.string(), s.unknown()).and(s.object({ id: s.string().min(1) })))
|
|
88
|
+
.default([]),
|
|
89
|
+
})
|
|
90
|
+
.strict();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Connector } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a connector counts as local for `privacy.localOnly`: its own
|
|
4
|
+
* `local` setting when it has one, otherwise true for a program on this
|
|
5
|
+
* machine (stdio) and for an HTTP server on a loopback address.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* connectorIsLocal(connector); // true for { transport: { http: { url: "http://127.0.0.1:3000" } } }
|
|
9
|
+
*/
|
|
10
|
+
export declare function connectorIsLocal(connector: Connector): boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a connector counts as local for `privacy.localOnly`: its own
|
|
3
|
+
* `local` setting when it has one, otherwise true for a program on this
|
|
4
|
+
* machine (stdio) and for an HTTP server on a loopback address.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* connectorIsLocal(connector); // true for { transport: { http: { url: "http://127.0.0.1:3000" } } }
|
|
8
|
+
*/
|
|
9
|
+
export function connectorIsLocal(connector) {
|
|
10
|
+
if (connector.local !== undefined) {
|
|
11
|
+
return connector.local;
|
|
12
|
+
}
|
|
13
|
+
const transport = connector.transport;
|
|
14
|
+
if ("stdio" in transport) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if ("google" in transport) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const host = hostOf(transport.http.url);
|
|
21
|
+
if (host === undefined) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return (host === "localhost" || host.endsWith(".localhost") || host === "::1" || /^127\./.test(host));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The host of an absolute URL, lowercased and without brackets, port or user
|
|
28
|
+
* info. The core has no `URL` class (plan 4.1), so this reads it by hand.
|
|
29
|
+
*/
|
|
30
|
+
function hostOf(url) {
|
|
31
|
+
const afterScheme = /^[a-z][a-z0-9+.-]*:\/\/([^/?#]*)/i.exec(url);
|
|
32
|
+
if (afterScheme === null) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const authority = afterScheme[1] ?? "";
|
|
36
|
+
const hostAndPort = authority.slice(authority.lastIndexOf("@") + 1).toLowerCase();
|
|
37
|
+
if (hostAndPort.startsWith("[")) {
|
|
38
|
+
const end = hostAndPort.indexOf("]");
|
|
39
|
+
return end === -1 ? undefined : hostAndPort.slice(1, end);
|
|
40
|
+
}
|
|
41
|
+
const colon = hostAndPort.indexOf(":");
|
|
42
|
+
return colon === -1 ? hostAndPort : hostAndPort.slice(0, colon);
|
|
43
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { checkKeysIn } from "../../shared/key-in-value.js";
|
|
2
|
+
import { checkSecretName, looksLikeKey } from "../../shared/secret-name.js";
|
|
3
|
+
import { approveAll, Connector } from "./schema.js";
|
|
4
|
+
/** `library/connectors/<id>.connector.yaml`, shared at the root or a hub's own. */
|
|
5
|
+
export const connectorKind = {
|
|
6
|
+
name: "connector",
|
|
7
|
+
about: "Tools for agents from an MCP server or a built-in service such as Google.",
|
|
8
|
+
syntax: "yaml",
|
|
9
|
+
schema: Connector,
|
|
10
|
+
places: [
|
|
11
|
+
{ scope: "workspace-and-hub", folder: "library/connectors", name: "<id>.connector.yaml" },
|
|
12
|
+
],
|
|
13
|
+
idFromPlace: "fallback",
|
|
14
|
+
check: (connector) => [
|
|
15
|
+
...checkSecretNames(connector),
|
|
16
|
+
...checkGoogleValues(connector),
|
|
17
|
+
...checkPastedKeys(connector),
|
|
18
|
+
...checkApprovedTools(connector),
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Every value the connector gives as a secret's name: its own `secret` (the
|
|
23
|
+
* HTTP bearer token) and, for a local program, each `secretEnv` value. A
|
|
24
|
+
* Google connector names no secret: see {@link checkGoogleValues}.
|
|
25
|
+
*/
|
|
26
|
+
function secretNames(connector) {
|
|
27
|
+
const names = [];
|
|
28
|
+
if (connector.secret !== undefined && !("google" in connector.transport)) {
|
|
29
|
+
names.push([connector.secret, ["secret"]]);
|
|
30
|
+
}
|
|
31
|
+
if ("stdio" in connector.transport) {
|
|
32
|
+
for (const [variable, name] of Object.entries(connector.transport.stdio.secretEnv ?? {})) {
|
|
33
|
+
names.push([name, ["transport", "stdio", "secretEnv", variable]]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return names;
|
|
37
|
+
}
|
|
38
|
+
/** The secrets are named in the file, so a bad name or a pasted key is caught here, not at run time. */
|
|
39
|
+
function checkSecretNames(connector) {
|
|
40
|
+
return secretNames(connector).flatMap(([name, path]) => checkSecretName(name, path) ?? []);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A Google connector's `client` and `secret` name no secret. The account's
|
|
44
|
+
* Google setup decides which OAuth client a sign-in uses and keeps the
|
|
45
|
+
* refresh token as `google-account-<accountRef>` (`google-setup.store-names`).
|
|
46
|
+
* Both stay so older files still read, and both are refused only when they
|
|
47
|
+
* hold a pasted key, since the file may be committed or shared.
|
|
48
|
+
*/
|
|
49
|
+
function checkGoogleValues(connector) {
|
|
50
|
+
if (!("google" in connector.transport)) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
const values = [
|
|
54
|
+
[connector.transport.google.client, ["transport", "google", "client"]],
|
|
55
|
+
[connector.secret, ["secret"]],
|
|
56
|
+
];
|
|
57
|
+
return values.flatMap(([value, path]) => value !== undefined && looksLikeKey(value) ? (checkSecretName(value, path) ?? []) : []);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* HTTP headers and a local program's `env` and `args` take any text, so a
|
|
61
|
+
* key pasted there would be saved in the file. The connector's `secret` and
|
|
62
|
+
* `secretEnv` name the secrets instead.
|
|
63
|
+
*/
|
|
64
|
+
function checkPastedKeys(connector) {
|
|
65
|
+
const { transport } = connector;
|
|
66
|
+
if ("http" in transport) {
|
|
67
|
+
return checkKeysIn(transport.http.headers, ["transport", "http", "headers"], "header");
|
|
68
|
+
}
|
|
69
|
+
if ("stdio" in transport) {
|
|
70
|
+
const path = ["transport", "stdio"];
|
|
71
|
+
return [
|
|
72
|
+
...checkKeysIn(transport.stdio.env, [...path, "env"], "env"),
|
|
73
|
+
...transport.stdio.args.flatMap((arg, index) => {
|
|
74
|
+
const [name, value] = argument(arg, transport.stdio.args[index - 1]);
|
|
75
|
+
return checkKeysIn(value, [...path, "args", index], "arg", name);
|
|
76
|
+
}),
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* An argument's value and the option it belongs to: `--api-key=…` and
|
|
83
|
+
* `--api-key …` both name the value, so a key without a known format is
|
|
84
|
+
* still caught after a flag that says it is one.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* argument("--token=abc", undefined); // ["--token", "abc"]
|
|
88
|
+
* argument("abc", "--token"); // ["--token", "abc"]
|
|
89
|
+
*/
|
|
90
|
+
function argument(arg, before) {
|
|
91
|
+
const equals = arg.indexOf("=");
|
|
92
|
+
if (arg.startsWith("-") && equals > 0) {
|
|
93
|
+
return [arg.slice(0, equals), arg.slice(equals + 1)];
|
|
94
|
+
}
|
|
95
|
+
return [before?.startsWith("-") ? before : undefined, arg];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A tool that needs approval but isn't in `tools.allow` is never offered, so
|
|
99
|
+
* say so. `approve: all` names no tool, so there is nothing to compare.
|
|
100
|
+
*/
|
|
101
|
+
function checkApprovedTools(connector) {
|
|
102
|
+
const { allow, approve } = connector.tools;
|
|
103
|
+
const problems = [];
|
|
104
|
+
if (allow === undefined || approve === approveAll) {
|
|
105
|
+
return problems;
|
|
106
|
+
}
|
|
107
|
+
approve.forEach((tool, index) => {
|
|
108
|
+
if (allow.includes(tool)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
problems.push({
|
|
112
|
+
severity: "warning",
|
|
113
|
+
code: "approved-tool-not-allowed",
|
|
114
|
+
path: ["tools", "approve", index],
|
|
115
|
+
message: `Connector "${connector.id}": "${tool}" needs approval but is not in tools.allow, so agents never see it`,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
return problems;
|
|
119
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** The `tools.approve` value that makes every tool of the connector ask a person first. */
|
|
3
|
+
export declare const approveAll = "all";
|
|
4
|
+
/**
|
|
5
|
+
* `library/connectors/<id>.connector.yaml`: tools for agents from an MCP
|
|
6
|
+
* server or a built-in service. Secrets are referenced by name only.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Connector: import("zod").ZodObject<{
|
|
9
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
10
|
+
id: import("zod").ZodString;
|
|
11
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
|
+
transport: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
14
|
+
http: import("zod").ZodObject<{
|
|
15
|
+
url: import("zod").ZodString;
|
|
16
|
+
headers: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
17
|
+
}, import("zod/v4/core").$strict>;
|
|
18
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
19
|
+
stdio: import("zod").ZodObject<{
|
|
20
|
+
command: import("zod").ZodString;
|
|
21
|
+
args: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
22
|
+
env: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
23
|
+
secretEnv: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
24
|
+
cwd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
}, import("zod/v4/core").$strict>;
|
|
26
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
27
|
+
google: import("zod").ZodObject<{
|
|
28
|
+
account: import("zod").ZodString;
|
|
29
|
+
client: import("zod").ZodDefault<import("zod").ZodString>;
|
|
30
|
+
}, import("zod/v4/core").$strict>;
|
|
31
|
+
}, import("zod/v4/core").$strict>]>;
|
|
32
|
+
secret: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
tools: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
34
|
+
allow: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
35
|
+
approve: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodArray<import("zod").ZodString>, import("zod").ZodLiteral<"all">]>>;
|
|
36
|
+
}, import("zod/v4/core").$strict>>;
|
|
37
|
+
local: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
38
|
+
}, import("zod/v4/core").$strict>;
|
|
39
|
+
/** A connector, with defaults filled in. */
|
|
40
|
+
export type Connector = Infer<typeof Connector>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether every call to `tool` waits for a person, as the connector's
|
|
43
|
+
* `tools.approve` says: the tool is listed there, or it says `all`.
|
|
44
|
+
* `tool` is the name the server lists the tool under.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* needsApproval({ approve: "all" }, "delete_file"); // true
|
|
48
|
+
* needsApproval({ approve: ["send_mail"] }, "read_mail"); // false
|
|
49
|
+
*/
|
|
50
|
+
export declare function needsApproval(tools: Pick<Connector["tools"], "approve">, tool: string): boolean;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { id, version } from "../../shared/fields.js";
|
|
3
|
+
/** A remote MCP server over HTTP. */
|
|
4
|
+
const HttpTransport = s
|
|
5
|
+
.object({
|
|
6
|
+
http: s
|
|
7
|
+
.object({ url: s.string().url(), headers: s.record(s.string(), s.string()).optional() })
|
|
8
|
+
.strict(),
|
|
9
|
+
})
|
|
10
|
+
.strict();
|
|
11
|
+
/** A local MCP program over standard input and output. */
|
|
12
|
+
const StdioTransport = s
|
|
13
|
+
.object({
|
|
14
|
+
stdio: s
|
|
15
|
+
.object({
|
|
16
|
+
command: s.string().min(1),
|
|
17
|
+
args: s.array(s.string()).default([]),
|
|
18
|
+
/** Plain environment variables; secrets go in `secretEnv`. */
|
|
19
|
+
env: s.record(s.string(), s.string()).optional(),
|
|
20
|
+
/** Environment variable → secret name. */
|
|
21
|
+
secretEnv: s.record(s.string(), s.string()).optional(),
|
|
22
|
+
/** Working directory, relative to the workspace root. */
|
|
23
|
+
cwd: s.string().optional(),
|
|
24
|
+
})
|
|
25
|
+
.strict(),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
/** Built-in Gmail and Google Drive for one Google account. */
|
|
29
|
+
const GoogleTransport = s
|
|
30
|
+
.object({
|
|
31
|
+
google: s
|
|
32
|
+
.object({
|
|
33
|
+
/** The Google account the connector acts as. */
|
|
34
|
+
account: s.string().email(),
|
|
35
|
+
/**
|
|
36
|
+
* Kept so older files still read. It names no secret: the OAuth
|
|
37
|
+
* client's ID and secret come from the account's Google setup, which
|
|
38
|
+
* only the host's setup routes write (`@halonicjs/google-setup`).
|
|
39
|
+
*/
|
|
40
|
+
client: s.string().default("google"),
|
|
41
|
+
})
|
|
42
|
+
.strict(),
|
|
43
|
+
})
|
|
44
|
+
.strict();
|
|
45
|
+
/** The `tools.approve` value that makes every tool of the connector ask a person first. */
|
|
46
|
+
export const approveAll = "all";
|
|
47
|
+
/**
|
|
48
|
+
* `library/connectors/<id>.connector.yaml`: tools for agents from an MCP
|
|
49
|
+
* server or a built-in service. Secrets are referenced by name only.
|
|
50
|
+
*/
|
|
51
|
+
export const Connector = s
|
|
52
|
+
.object({
|
|
53
|
+
version,
|
|
54
|
+
id,
|
|
55
|
+
name: s.string().optional(),
|
|
56
|
+
description: s.string().optional(),
|
|
57
|
+
transport: s.union([HttpTransport, StdioTransport, GoogleTransport]),
|
|
58
|
+
/**
|
|
59
|
+
* HTTP: the secret sent as a bearer token. Google: kept so older files
|
|
60
|
+
* still read, but it names no secret: the account's Google setup keeps
|
|
61
|
+
* the refresh token (`@halonicjs/google-setup`).
|
|
62
|
+
*/
|
|
63
|
+
secret: s.string().optional(),
|
|
64
|
+
tools: s
|
|
65
|
+
.object({
|
|
66
|
+
/** Only these tools are offered to agents. Leave out to offer every tool. */
|
|
67
|
+
allow: s.array(s.string()).optional(),
|
|
68
|
+
/**
|
|
69
|
+
* Every call to these tools waits for a person to approve or reject
|
|
70
|
+
* it. `all` means every tool the server offers, including tools it
|
|
71
|
+
* adds later: a new MCP connector starts with it.
|
|
72
|
+
*/
|
|
73
|
+
approve: s.union([s.array(s.string()), s.literal(approveAll)]).default([]),
|
|
74
|
+
})
|
|
75
|
+
.strict()
|
|
76
|
+
.default({ approve: [] }),
|
|
77
|
+
/** Runs on this machine or your own network. Default: true for stdio and localhost URLs. */
|
|
78
|
+
local: s.boolean().optional(),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
/**
|
|
82
|
+
* Whether every call to `tool` waits for a person, as the connector's
|
|
83
|
+
* `tools.approve` says: the tool is listed there, or it says `all`.
|
|
84
|
+
* `tool` is the name the server lists the tool under.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* needsApproval({ approve: "all" }, "delete_file"); // true
|
|
88
|
+
* needsApproval({ approve: ["send_mail"] }, "read_mail"); // false
|
|
89
|
+
*/
|
|
90
|
+
export function needsApproval(tools, tool) {
|
|
91
|
+
return tools.approve === approveAll || tools.approve.includes(tool);
|
|
92
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Deployments } from "./schema.js";
|
|
2
|
+
/** `deployments.yaml` at the workspace root. */
|
|
3
|
+
export const deploymentsKind = {
|
|
4
|
+
name: "deployments",
|
|
5
|
+
about: "The places the workspace runs, each with its own runtime data.",
|
|
6
|
+
syntax: "yaml",
|
|
7
|
+
schema: Deployments,
|
|
8
|
+
places: [{ scope: "workspace", folder: "", name: "deployments.yaml" }],
|
|
9
|
+
idFromPlace: "none",
|
|
10
|
+
check: checkDeployments,
|
|
11
|
+
};
|
|
12
|
+
/** The default deployment, when one is named, must be one of the listed ones. */
|
|
13
|
+
function checkDeployments(file) {
|
|
14
|
+
if (file.default === undefined || Object.hasOwn(file.deployments, file.default)) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
severity: "error",
|
|
20
|
+
code: "default-deployment-not-listed",
|
|
21
|
+
path: ["default"],
|
|
22
|
+
message: `The default deployment "${file.default}" is not listed`,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** One place the workspace runs, with its own data (runs, Inbox, records, simulations). */
|
|
3
|
+
export declare const Deployment: import("zod").ZodObject<{
|
|
4
|
+
name: import("zod").ZodString;
|
|
5
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
host: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
7
|
+
cloudflare: "cloudflare";
|
|
8
|
+
local: "local";
|
|
9
|
+
}>>;
|
|
10
|
+
stage: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
11
|
+
development: "development";
|
|
12
|
+
production: "production";
|
|
13
|
+
}>>;
|
|
14
|
+
shadow: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
15
|
+
}, import("zod/v4/core").$strict>;
|
|
16
|
+
/** `deployments.yaml`: the places the workspace runs. */
|
|
17
|
+
export declare const Deployments: import("zod").ZodObject<{
|
|
18
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
19
|
+
default: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
deployments: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
21
|
+
name: import("zod").ZodString;
|
|
22
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
host: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
24
|
+
cloudflare: "cloudflare";
|
|
25
|
+
local: "local";
|
|
26
|
+
}>>;
|
|
27
|
+
stage: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
28
|
+
development: "development";
|
|
29
|
+
production: "production";
|
|
30
|
+
}>>;
|
|
31
|
+
shadow: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
32
|
+
}, import("zod/v4/core").$strict>>;
|
|
33
|
+
}, import("zod/v4/core").$strict>;
|
|
34
|
+
/** One deployment, with defaults filled in. */
|
|
35
|
+
export type Deployment = Infer<typeof Deployment>;
|
|
36
|
+
/** The content of `deployments.yaml`, with defaults filled in. */
|
|
37
|
+
export type Deployments = Infer<typeof Deployments>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { deploymentId, version } from "../../shared/fields.js";
|
|
3
|
+
/** One place the workspace runs, with its own data (runs, Inbox, records, simulations). */
|
|
4
|
+
export const Deployment = s
|
|
5
|
+
.object({
|
|
6
|
+
name: s.string().min(1),
|
|
7
|
+
description: s.string().optional(),
|
|
8
|
+
/** Where it runs: `halonic serve` on a machine, or Cloudflare. */
|
|
9
|
+
host: s.enum(["local", "cloudflare"]).default("local"),
|
|
10
|
+
stage: s.enum(["development", "production"]).default("development"),
|
|
11
|
+
/** Every write a connector would make is only recorded, never done. */
|
|
12
|
+
shadow: s.boolean().default(false),
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
15
|
+
/** `deployments.yaml`: the places the workspace runs. */
|
|
16
|
+
export const Deployments = s
|
|
17
|
+
.object({
|
|
18
|
+
version,
|
|
19
|
+
/** The deployment `halonic serve` runs when none is named. */
|
|
20
|
+
default: s.string().optional(),
|
|
21
|
+
deployments: s
|
|
22
|
+
.record(deploymentId, Deployment, { error: deploymentIdProblem })
|
|
23
|
+
.refine((named) => Object.keys(named).length > 0, "Name at least one deployment"),
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
/**
|
|
27
|
+
* Says why a deployment id was refused. Without it a refused key only reads
|
|
28
|
+
* "Invalid key in record", which doesn't tell the person what to change.
|
|
29
|
+
*/
|
|
30
|
+
function deploymentIdProblem(issue) {
|
|
31
|
+
if (issue.code !== "invalid_key" || !Array.isArray(issue.issues)) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const reasons = issue.issues.flatMap((keyIssue) => {
|
|
35
|
+
const isMessage = typeof keyIssue === "object" &&
|
|
36
|
+
keyIssue !== null &&
|
|
37
|
+
"message" in keyIssue &&
|
|
38
|
+
typeof keyIssue.message === "string";
|
|
39
|
+
return isMessage ? [keyIssue.message] : [];
|
|
40
|
+
});
|
|
41
|
+
return `Not a deployment id: ${reasons.join("; ")}`;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Hub } from "./schema.js";
|
|
2
|
+
/** `hub.yaml` in each `hubs/<id>/` folder; the folder name is the hub's id when the file has none. */
|
|
3
|
+
export const hubKind = {
|
|
4
|
+
name: "hub",
|
|
5
|
+
about: "A hub: a group of agents and workflows with its own defaults.",
|
|
6
|
+
syntax: "yaml",
|
|
7
|
+
schema: Hub,
|
|
8
|
+
places: [{ scope: "hub", folder: "", name: "hub.yaml" }],
|
|
9
|
+
idFromPlace: "fallback",
|
|
10
|
+
};
|