@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,59 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { DURATION_PATTERN, id, version } from "../../shared/fields.js";
|
|
3
|
+
/**
|
|
4
|
+
* One step after the start: an event name (such as "approve"), a move of the
|
|
5
|
+
* test clock ({ advance: "2d" }) that fires the timers then due, or an event
|
|
6
|
+
* with data ({ event: reject, payload: { comment: "Shorter please" } }).
|
|
7
|
+
*/
|
|
8
|
+
const TestEvent = s.union([
|
|
9
|
+
s.string(),
|
|
10
|
+
s.object({ advance: s.string().regex(DURATION_PATTERN) }).strict(),
|
|
11
|
+
s.object({ event: s.string().min(1), payload: s.unknown() }).strict(),
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* One scripted program result: the program's text output, any output value
|
|
15
|
+
* ({ output: { total: 120 } }) or a failure ({ fails: "claude-code exited with code 1" }).
|
|
16
|
+
*/
|
|
17
|
+
const ProgramResult = s.union([
|
|
18
|
+
s.string(),
|
|
19
|
+
s.object({ output: s.unknown() }).strict(),
|
|
20
|
+
s.object({ fails: s.string().regex(/\S/, "say why the program fails") }).strict(),
|
|
21
|
+
]);
|
|
22
|
+
/** One test case: the input, the scripted replies, the events and what to expect. */
|
|
23
|
+
export const WorkflowTestCase = s
|
|
24
|
+
.object({
|
|
25
|
+
name: s.string().min(1),
|
|
26
|
+
input: s.record(s.string(), s.unknown()).default({}),
|
|
27
|
+
/** Scripted model replies per agent id, used in order. */
|
|
28
|
+
mocks: s.record(s.string(), s.array(s.string())).default({}),
|
|
29
|
+
events: s.array(TestEvent).default([]),
|
|
30
|
+
/** Scripted connector tool results, keyed "<connector>.<tool>". Tests never contact real connectors. */
|
|
31
|
+
tools: s.record(s.string(), s.array(s.string())).default({}),
|
|
32
|
+
/**
|
|
33
|
+
* Scripted program results per agent id, used in the order the engine
|
|
34
|
+
* starts that agent's programs. Tests never start programs.
|
|
35
|
+
*/
|
|
36
|
+
programs: s.record(s.string(), s.array(ProgramResult)).optional(),
|
|
37
|
+
expect: s
|
|
38
|
+
.object({
|
|
39
|
+
/** The exact sequence of states visited. */
|
|
40
|
+
states: s.array(s.string()).optional(),
|
|
41
|
+
final: s.string().optional(),
|
|
42
|
+
status: s.enum(["completed", "waiting", "failed"]).optional(),
|
|
43
|
+
/** A partial match on the final context. */
|
|
44
|
+
context: s.record(s.string(), s.unknown()).optional(),
|
|
45
|
+
/** Files the run must have saved; it may save others too. */
|
|
46
|
+
artifacts: s.array(s.string()).optional(),
|
|
47
|
+
})
|
|
48
|
+
.strict()
|
|
49
|
+
.default({}),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
|
52
|
+
/** `workflows/<workflow>.test.yaml`: test cases for one workflow, run on scripted models. */
|
|
53
|
+
export const WorkflowTest = s
|
|
54
|
+
.object({
|
|
55
|
+
version,
|
|
56
|
+
workflow: id,
|
|
57
|
+
cases: s.array(WorkflowTestCase).min(1),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WorkspaceSettings } from "./schema.js";
|
|
2
|
+
/** `workspace.yaml` at the workspace root. */
|
|
3
|
+
export const workspaceKind = {
|
|
4
|
+
name: "workspace",
|
|
5
|
+
about: "The workspace's name, privacy, budget, defaults and session AI.",
|
|
6
|
+
syntax: "yaml",
|
|
7
|
+
schema: WorkspaceSettings,
|
|
8
|
+
places: [{ scope: "workspace", folder: "", name: "workspace.yaml" }],
|
|
9
|
+
idFromPlace: "none",
|
|
10
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* This workspace's own choices for the session AI (chat sessions, Build
|
|
4
|
+
* mode), on top of the global AI agent each person sets. An empty field
|
|
5
|
+
* follows the global agent.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SessionAssistant: import("zod").ZodObject<{
|
|
8
|
+
model: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
params: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
10
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
11
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
12
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
14
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
15
|
+
high: "high";
|
|
16
|
+
low: "low";
|
|
17
|
+
medium: "medium";
|
|
18
|
+
}>>;
|
|
19
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
20
|
+
}, import("zod/v4/core").$strict>>;
|
|
21
|
+
maxSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
+
connectors: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
23
|
+
instructions: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
}, import("zod/v4/core").$strict>;
|
|
25
|
+
/** `workspace.yaml`: the workspace's name, privacy, budget and defaults. */
|
|
26
|
+
export declare const WorkspaceSettings: import("zod").ZodObject<{
|
|
27
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
28
|
+
id: import("zod").ZodString;
|
|
29
|
+
name: import("zod").ZodString;
|
|
30
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
privacy: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
32
|
+
localOnly: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
33
|
+
}, import("zod/v4/core").$strict>>;
|
|
34
|
+
budget: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
35
|
+
currency: import("zod").ZodDefault<import("zod").ZodString>;
|
|
36
|
+
perRun: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
37
|
+
monthly: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
38
|
+
}, import("zod/v4/core").$strict>>;
|
|
39
|
+
defaults: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
40
|
+
runtime: import("zod").ZodDefault<import("zod").ZodString>;
|
|
41
|
+
model: import("zod").ZodDefault<import("zod").ZodString>;
|
|
42
|
+
}, import("zod/v4/core").$strict>>;
|
|
43
|
+
assistant: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
44
|
+
model: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
params: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
46
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
47
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
48
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
49
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
50
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
51
|
+
high: "high";
|
|
52
|
+
low: "low";
|
|
53
|
+
medium: "medium";
|
|
54
|
+
}>>;
|
|
55
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
56
|
+
}, import("zod/v4/core").$strict>>;
|
|
57
|
+
maxSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
58
|
+
connectors: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
59
|
+
instructions: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
}, import("zod/v4/core").$strict>>;
|
|
61
|
+
appearance: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
62
|
+
characters: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
63
|
+
expressive: "expressive";
|
|
64
|
+
minimal: "minimal";
|
|
65
|
+
off: "off";
|
|
66
|
+
}>>;
|
|
67
|
+
}, import("zod/v4/core").$strict>>;
|
|
68
|
+
}, import("zod/v4/core").$strict>;
|
|
69
|
+
/** The settings in `workspace.yaml`, with defaults filled in. */
|
|
70
|
+
export type WorkspaceSettings = Infer<typeof WorkspaceSettings>;
|
|
71
|
+
/** The session AI settings of a workspace. */
|
|
72
|
+
export type SessionAssistant = Infer<typeof SessionAssistant>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { id, ModelParams, version } from "../../shared/fields.js";
|
|
3
|
+
/**
|
|
4
|
+
* This workspace's own choices for the session AI (chat sessions, Build
|
|
5
|
+
* mode), on top of the global AI agent each person sets. An empty field
|
|
6
|
+
* follows the global agent.
|
|
7
|
+
*/
|
|
8
|
+
export const SessionAssistant = s
|
|
9
|
+
.object({
|
|
10
|
+
/** Alias (or "provider/model") new Build sessions start with. */
|
|
11
|
+
model: s.string().min(1).optional(),
|
|
12
|
+
params: ModelParams.optional(),
|
|
13
|
+
/** Model turns one answer may take before it stops and asks to continue. */
|
|
14
|
+
maxSteps: s.number().int().min(1).max(64).optional(),
|
|
15
|
+
/** Whether Build may use the workspace's connector tools that need no approval. */
|
|
16
|
+
connectors: s.boolean().optional(),
|
|
17
|
+
/** Extra instructions, added after the authoring skill and the global agent's. */
|
|
18
|
+
instructions: s.string().optional(),
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
/** `workspace.yaml`: the workspace's name, privacy, budget and defaults. */
|
|
22
|
+
export const WorkspaceSettings = s
|
|
23
|
+
.object({
|
|
24
|
+
version,
|
|
25
|
+
id,
|
|
26
|
+
name: s.string().min(1),
|
|
27
|
+
description: s.string().optional(),
|
|
28
|
+
privacy: s
|
|
29
|
+
.object({
|
|
30
|
+
/** When true, only providers marked `local: true` may be used. */
|
|
31
|
+
localOnly: s.boolean().default(false),
|
|
32
|
+
})
|
|
33
|
+
.strict()
|
|
34
|
+
.default({ localOnly: false }),
|
|
35
|
+
/**
|
|
36
|
+
* Spending limits in `currency`, counted from model prices. Not enforced
|
|
37
|
+
* in 0.1: nothing reads `perRun` or `monthly` yet. `currency` names the
|
|
38
|
+
* currency the prices in `models.yaml` are written in; Halonic doesn't
|
|
39
|
+
* convert between currencies.
|
|
40
|
+
*/
|
|
41
|
+
budget: s
|
|
42
|
+
.object({
|
|
43
|
+
currency: s.string().min(1).default("EUR"),
|
|
44
|
+
perRun: s.number().positive().optional(),
|
|
45
|
+
monthly: s.number().positive().optional(),
|
|
46
|
+
})
|
|
47
|
+
.strict()
|
|
48
|
+
.optional(),
|
|
49
|
+
defaults: s
|
|
50
|
+
.object({
|
|
51
|
+
runtime: s.string().default("inprocess"),
|
|
52
|
+
model: s.string().default("default"),
|
|
53
|
+
})
|
|
54
|
+
.strict()
|
|
55
|
+
.default({ runtime: "inprocess", model: "default" }),
|
|
56
|
+
assistant: SessionAssistant.optional(),
|
|
57
|
+
/** How the app looks for everyone who opens this workspace. */
|
|
58
|
+
appearance: s
|
|
59
|
+
.object({
|
|
60
|
+
/** Agent characters: expressive, minimal (an orb with a status ring) or off (initials). */
|
|
61
|
+
characters: s.enum(["expressive", "minimal", "off"]).optional(),
|
|
62
|
+
})
|
|
63
|
+
.strict()
|
|
64
|
+
.optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict();
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Path } from "../../schema-kit/src/index.js";
|
|
2
|
+
import { type Result } from "../../std/src/index.js";
|
|
3
|
+
import type { FileKind } from "./kind.js";
|
|
4
|
+
import { type KindName, type KindValues } from "./registry.js";
|
|
5
|
+
/**
|
|
6
|
+
* Something wrong with a file, and where. Every problem has a line and a
|
|
7
|
+
* column, so an editor can always point at it.
|
|
8
|
+
*/
|
|
9
|
+
export interface FileProblem {
|
|
10
|
+
/** An error makes the file fail; a warning only informs. */
|
|
11
|
+
readonly severity: "error" | "warning";
|
|
12
|
+
/**
|
|
13
|
+
* `syntax`: the text isn't YAML we read (`code` is the YAML problem kind).
|
|
14
|
+
* `schema`: the data doesn't match the kind's schema (`code` is
|
|
15
|
+
* schema-kit's issue code). `check`: a rule over several fields (`code`
|
|
16
|
+
* names the rule).
|
|
17
|
+
*/
|
|
18
|
+
readonly source: "syntax" | "schema" | "check";
|
|
19
|
+
readonly code: string;
|
|
20
|
+
/** The keys and list indexes to the value; `[]` for the whole file. */
|
|
21
|
+
readonly path: Path;
|
|
22
|
+
/** What is wrong, without the path or position. */
|
|
23
|
+
readonly message: string;
|
|
24
|
+
/** 1-based line and column of the value, or of its nearest parent that exists. */
|
|
25
|
+
readonly line: number;
|
|
26
|
+
readonly col: number;
|
|
27
|
+
/** For `unrecognized_keys`: the keys the map doesn't allow. */
|
|
28
|
+
readonly keys?: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/** A file that parsed: its value with defaults filled in, and any warnings. */
|
|
31
|
+
export interface ParsedFile<Value> {
|
|
32
|
+
readonly value: Value;
|
|
33
|
+
readonly warnings: readonly FileProblem[];
|
|
34
|
+
}
|
|
35
|
+
/** What the caller knows about the file beyond its text. */
|
|
36
|
+
export interface ParseFileOptions {
|
|
37
|
+
/**
|
|
38
|
+
* The id the file's place gives it: its file name without the kind's
|
|
39
|
+
* suffix, or its folder (see `FileKind.places`). Used as the kind's
|
|
40
|
+
* `idFromPlace` says.
|
|
41
|
+
*/
|
|
42
|
+
readonly id?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Reads and checks one workspace file of a known kind.
|
|
46
|
+
*
|
|
47
|
+
* @param kind - the file's kind, such as `agent`
|
|
48
|
+
* @param text - the whole file
|
|
49
|
+
* @param options - the id the file's place gives it
|
|
50
|
+
* @returns the value with defaults and any warnings, or every problem found,
|
|
51
|
+
* each with its path, line and column
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* const parsed = parseFile("agent", text, { id: "clerk" });
|
|
55
|
+
* if (!parsed.ok) {
|
|
56
|
+
* for (const problem of parsed.error) report(problem.line, problem.message);
|
|
57
|
+
* }
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseFile<Name extends KindName>(kind: Name, text: string, options?: ParseFileOptions): Result<ParsedFile<KindValues[Name]>, FileProblem[]>;
|
|
60
|
+
/** The data the kind's schema gets, and whether its id is the place's. */
|
|
61
|
+
export interface Prepared {
|
|
62
|
+
readonly data: unknown;
|
|
63
|
+
readonly idFromPlace: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Old key names read as new ones, then the id from the file's place: the data
|
|
67
|
+
* the kind's schema gets. Exported for the tests, not from the package.
|
|
68
|
+
*/
|
|
69
|
+
export declare function prepare(kind: Pick<FileKind<unknown>, "idFromPlace" | "upgradeKeys">, data: unknown, placeId: string | undefined): Prepared;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { parse } from "../../schema-kit/src/index.js";
|
|
2
|
+
import { err, ok } from "../../std/src/index.js";
|
|
3
|
+
import { fileKinds } from "./registry.js";
|
|
4
|
+
import { isMap } from "./shared/legacy-keys.js";
|
|
5
|
+
import { readSource } from "./source.js";
|
|
6
|
+
/**
|
|
7
|
+
* Reads and checks one workspace file of a known kind.
|
|
8
|
+
*
|
|
9
|
+
* @param kind - the file's kind, such as `agent`
|
|
10
|
+
* @param text - the whole file
|
|
11
|
+
* @param options - the id the file's place gives it
|
|
12
|
+
* @returns the value with defaults and any warnings, or every problem found,
|
|
13
|
+
* each with its path, line and column
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const parsed = parseFile("agent", text, { id: "clerk" });
|
|
17
|
+
* if (!parsed.ok) {
|
|
18
|
+
* for (const problem of parsed.error) report(problem.line, problem.message);
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export function parseFile(kind, text, options = {}) {
|
|
22
|
+
const fileKind = fileKinds[kind];
|
|
23
|
+
const read = readSource(fileKind.syntax, text);
|
|
24
|
+
if (!read.ok) {
|
|
25
|
+
return err([syntaxProblem(read.error)]);
|
|
26
|
+
}
|
|
27
|
+
const source = read.value;
|
|
28
|
+
const prepared = prepare(fileKind, source.data, options.id);
|
|
29
|
+
const parsed = parse(fileKind.schema, prepared.data);
|
|
30
|
+
if (!parsed.ok) {
|
|
31
|
+
const problems = parsed.error.map((issue) => schemaProblem(issue, source));
|
|
32
|
+
return err(prepared.idFromPlace ? problems.map((problem) => namePlaceId(problem, options.id)) : problems);
|
|
33
|
+
}
|
|
34
|
+
const found = fileKind.check?.(parsed.value) ?? [];
|
|
35
|
+
const problems = found.map((problem) => checkProblem(problem, source));
|
|
36
|
+
if (problems.some((problem) => problem.severity === "error")) {
|
|
37
|
+
return err(problems);
|
|
38
|
+
}
|
|
39
|
+
return ok({ value: parsed.value, warnings: problems });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Old key names read as new ones, then the id from the file's place: the data
|
|
43
|
+
* the kind's schema gets. Exported for the tests, not from the package.
|
|
44
|
+
*/
|
|
45
|
+
export function prepare(kind, data, placeId) {
|
|
46
|
+
if (!isMap(data)) {
|
|
47
|
+
return { data, idFromPlace: false };
|
|
48
|
+
}
|
|
49
|
+
const upgraded = kind.upgradeKeys === undefined ? data : kind.upgradeKeys(data);
|
|
50
|
+
if (placeId === undefined) {
|
|
51
|
+
return { data: upgraded, idFromPlace: false };
|
|
52
|
+
}
|
|
53
|
+
if (kind.idFromPlace === "always") {
|
|
54
|
+
return { data: { ...upgraded, id: placeId }, idFromPlace: true };
|
|
55
|
+
}
|
|
56
|
+
if (kind.idFromPlace === "fallback" && !Object.hasOwn(upgraded, "id")) {
|
|
57
|
+
return { data: { id: placeId, ...upgraded }, idFromPlace: true };
|
|
58
|
+
}
|
|
59
|
+
return { data: upgraded, idFromPlace: false };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* An id problem says the id came from the file name when the file has none of
|
|
63
|
+
* its own: its line and column would otherwise point at nothing in particular.
|
|
64
|
+
*/
|
|
65
|
+
function namePlaceId(problem, placeId) {
|
|
66
|
+
if (problem.path.length !== 1 || problem.path[0] !== "id") {
|
|
67
|
+
return problem;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
...problem,
|
|
71
|
+
message: `${problem.message} (the id "${placeId}" comes from the file name)`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function syntaxProblem(problem) {
|
|
75
|
+
return {
|
|
76
|
+
severity: "error",
|
|
77
|
+
source: "syntax",
|
|
78
|
+
code: problem.kind,
|
|
79
|
+
path: [],
|
|
80
|
+
message: problem.message,
|
|
81
|
+
line: problem.line,
|
|
82
|
+
col: problem.col,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function schemaProblem(issue, source) {
|
|
86
|
+
const problem = {
|
|
87
|
+
severity: "error",
|
|
88
|
+
source: "schema",
|
|
89
|
+
code: issue.code,
|
|
90
|
+
path: issue.path,
|
|
91
|
+
message: issue.message,
|
|
92
|
+
...source.positionOf(issue.path),
|
|
93
|
+
};
|
|
94
|
+
return issue.keys === undefined ? problem : { ...problem, keys: issue.keys };
|
|
95
|
+
}
|
|
96
|
+
function checkProblem(problem, source) {
|
|
97
|
+
return {
|
|
98
|
+
severity: problem.severity,
|
|
99
|
+
source: "check",
|
|
100
|
+
code: problem.code,
|
|
101
|
+
path: problem.path,
|
|
102
|
+
message: problem.message,
|
|
103
|
+
...source.positionOf(problem.path),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type Infer } from "../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The recording file: `integrations/<name>/recordings/<scenario>.json`.
|
|
4
|
+
*
|
|
5
|
+
* This is the one contract shared by the recorder and the conformance suite,
|
|
6
|
+
* which both read recordings with `recordingFileSchema`. It is carried over
|
|
7
|
+
* from `tooling/record/src/format.ts` in halonic-com/integrations (155685c)
|
|
8
|
+
* with Zod's builders swapped for schema-kit's. It imports only schema-kit,
|
|
9
|
+
* never `yaml`, so a reader of recordings doesn't load the YAML parser. A
|
|
10
|
+
* change here needs the same change in the suite's reader, or a new
|
|
11
|
+
* `RECORDING_FORMAT`.
|
|
12
|
+
*/
|
|
13
|
+
/** Bumped when the file layout changes in a way old readers can't handle. */
|
|
14
|
+
export declare const RECORDING_FORMAT = "halonic.recording/1";
|
|
15
|
+
export declare const recordingFileSchema: import("zod").ZodObject<{
|
|
16
|
+
format: import("zod").ZodLiteral<"halonic.recording/1">;
|
|
17
|
+
integration: import("zod").ZodString;
|
|
18
|
+
scenario: import("zod").ZodString;
|
|
19
|
+
exchanges: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
20
|
+
transport: import("zod").ZodLiteral<"http">;
|
|
21
|
+
request: import("zod").ZodObject<{
|
|
22
|
+
method: import("zod").ZodString;
|
|
23
|
+
url: import("zod").ZodString;
|
|
24
|
+
headers: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
25
|
+
body: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
26
|
+
kind: import("zod").ZodLiteral<"empty">;
|
|
27
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
28
|
+
kind: import("zod").ZodLiteral<"json">;
|
|
29
|
+
value: import("zod").ZodJSONSchema;
|
|
30
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
31
|
+
kind: import("zod").ZodLiteral<"form">;
|
|
32
|
+
value: import("zod").ZodArray<import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>>;
|
|
33
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
34
|
+
kind: import("zod").ZodLiteral<"text">;
|
|
35
|
+
contentType: import("zod").ZodString;
|
|
36
|
+
value: import("zod").ZodString;
|
|
37
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
38
|
+
kind: import("zod").ZodLiteral<"sse">;
|
|
39
|
+
value: import("zod").ZodArray<import("zod").ZodObject<{
|
|
40
|
+
event: import("zod").ZodString;
|
|
41
|
+
data: import("zod").ZodJSONSchema;
|
|
42
|
+
}, import("zod/v4/core").$strict>>;
|
|
43
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
44
|
+
}, import("zod/v4/core").$strict>;
|
|
45
|
+
response: import("zod").ZodObject<{
|
|
46
|
+
status: import("zod").ZodNumber;
|
|
47
|
+
headers: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
48
|
+
body: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
49
|
+
kind: import("zod").ZodLiteral<"empty">;
|
|
50
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
51
|
+
kind: import("zod").ZodLiteral<"json">;
|
|
52
|
+
value: import("zod").ZodJSONSchema;
|
|
53
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
54
|
+
kind: import("zod").ZodLiteral<"form">;
|
|
55
|
+
value: import("zod").ZodArray<import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>>;
|
|
56
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
57
|
+
kind: import("zod").ZodLiteral<"text">;
|
|
58
|
+
contentType: import("zod").ZodString;
|
|
59
|
+
value: import("zod").ZodString;
|
|
60
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
61
|
+
kind: import("zod").ZodLiteral<"sse">;
|
|
62
|
+
value: import("zod").ZodArray<import("zod").ZodObject<{
|
|
63
|
+
event: import("zod").ZodString;
|
|
64
|
+
data: import("zod").ZodJSONSchema;
|
|
65
|
+
}, import("zod/v4/core").$strict>>;
|
|
66
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
67
|
+
}, import("zod/v4/core").$strict>;
|
|
68
|
+
}, import("zod/v4/core").$strict>], "transport">>;
|
|
69
|
+
scrubReport: import("zod").ZodArray<import("zod").ZodObject<{
|
|
70
|
+
rule: import("zod").ZodString;
|
|
71
|
+
path: import("zod").ZodString;
|
|
72
|
+
count: import("zod").ZodNumber;
|
|
73
|
+
}, import("zod/v4/core").$strict>>;
|
|
74
|
+
}, import("zod/v4/core").$strict>;
|
|
75
|
+
export type RecordingFile = Infer<typeof recordingFileSchema>;
|
|
76
|
+
/**
|
|
77
|
+
* The exact text of a recording file: keys sorted at every level, indented
|
|
78
|
+
* by 2, with a final line break, so the same recording always gives the same
|
|
79
|
+
* text and diffs stay easy to review. Lists keep their order.
|
|
80
|
+
*/
|
|
81
|
+
export declare function formatRecording(file: RecordingFile): string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { s } from "../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The recording file: `integrations/<name>/recordings/<scenario>.json`.
|
|
4
|
+
*
|
|
5
|
+
* This is the one contract shared by the recorder and the conformance suite,
|
|
6
|
+
* which both read recordings with `recordingFileSchema`. It is carried over
|
|
7
|
+
* from `tooling/record/src/format.ts` in halonic-com/integrations (155685c)
|
|
8
|
+
* with Zod's builders swapped for schema-kit's. It imports only schema-kit,
|
|
9
|
+
* never `yaml`, so a reader of recordings doesn't load the YAML parser. A
|
|
10
|
+
* change here needs the same change in the suite's reader, or a new
|
|
11
|
+
* `RECORDING_FORMAT`.
|
|
12
|
+
*/
|
|
13
|
+
/** Bumped when the file layout changes in a way old readers can't handle. */
|
|
14
|
+
export const RECORDING_FORMAT = "halonic.recording/1";
|
|
15
|
+
/** Header names in lower case. Headers that change on every run are left out. */
|
|
16
|
+
const headersSchema = s.record(s.string().regex(/^[a-z0-9!#$%&'*+.^_`|~-]+$/), s.string());
|
|
17
|
+
const streamEventSchema = s
|
|
18
|
+
.object({
|
|
19
|
+
event: s.string(),
|
|
20
|
+
data: s.json(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
/**
|
|
24
|
+
* A body, saved parsed. Anything that isn't one of these kinds was refused
|
|
25
|
+
* when it was recorded. `text` only appears when the integration allows its
|
|
26
|
+
* content type.
|
|
27
|
+
*/
|
|
28
|
+
const bodySchema = s.discriminatedUnion("kind", [
|
|
29
|
+
s.object({ kind: s.literal("empty") }).strict(),
|
|
30
|
+
s.object({ kind: s.literal("json"), value: s.json() }).strict(),
|
|
31
|
+
s.object({ kind: s.literal("form"), value: s.array(s.tuple([s.string(), s.string()])) }).strict(),
|
|
32
|
+
s.object({ kind: s.literal("text"), contentType: s.string(), value: s.string() }).strict(),
|
|
33
|
+
s.object({ kind: s.literal("sse"), value: s.array(streamEventSchema) }).strict(),
|
|
34
|
+
]);
|
|
35
|
+
const httpExchangeSchema = s
|
|
36
|
+
.object({
|
|
37
|
+
transport: s.literal("http"),
|
|
38
|
+
request: s
|
|
39
|
+
.object({
|
|
40
|
+
method: s.string().regex(/^[A-Z]+$/),
|
|
41
|
+
url: s.url(),
|
|
42
|
+
headers: headersSchema,
|
|
43
|
+
body: bodySchema,
|
|
44
|
+
})
|
|
45
|
+
.strict(),
|
|
46
|
+
response: s
|
|
47
|
+
.object({
|
|
48
|
+
status: s.number().int().min(100).max(599),
|
|
49
|
+
headers: headersSchema,
|
|
50
|
+
body: bodySchema,
|
|
51
|
+
})
|
|
52
|
+
.strict(),
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
/**
|
|
56
|
+
* One exchange, tagged by transport. Only `http` today; local MCP programs
|
|
57
|
+
* will add `stdio` (ordered JSON-RPC messages) without a new format version.
|
|
58
|
+
*/
|
|
59
|
+
const exchangeSchema = s.discriminatedUnion("transport", [httpExchangeSchema]);
|
|
60
|
+
/** What the scrubber replaced: the rule, the place and how often. Never a value. */
|
|
61
|
+
const reportEntrySchema = s
|
|
62
|
+
.object({
|
|
63
|
+
rule: s.string(),
|
|
64
|
+
path: s.string(),
|
|
65
|
+
count: s.number().int().positive(),
|
|
66
|
+
})
|
|
67
|
+
.strict();
|
|
68
|
+
export const recordingFileSchema = s
|
|
69
|
+
.object({
|
|
70
|
+
format: s.literal(RECORDING_FORMAT),
|
|
71
|
+
integration: s.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
72
|
+
scenario: s.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
73
|
+
/** In call order: on replay, each call is matched by method, URL and position. */
|
|
74
|
+
exchanges: s.array(exchangeSchema),
|
|
75
|
+
scrubReport: s.array(reportEntrySchema),
|
|
76
|
+
})
|
|
77
|
+
.strict();
|
|
78
|
+
/**
|
|
79
|
+
* The exact text of a recording file: keys sorted at every level, indented
|
|
80
|
+
* by 2, with a final line break, so the same recording always gives the same
|
|
81
|
+
* text and diffs stay easy to review. Lists keep their order.
|
|
82
|
+
*/
|
|
83
|
+
export function formatRecording(file) {
|
|
84
|
+
return `${JSON.stringify(sortKeys(file), null, 2)}\n`;
|
|
85
|
+
}
|
|
86
|
+
function sortKeys(value) {
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
return value.map(sortKeys);
|
|
89
|
+
}
|
|
90
|
+
if (value !== null && typeof value === "object") {
|
|
91
|
+
const entries = Object.entries(value).sort(([a], [b]) => byStringOrder(a, b));
|
|
92
|
+
return Object.fromEntries(entries.map(([key, child]) => [key, sortKeys(child)]));
|
|
93
|
+
}
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
/** Plain string order, the same on every machine (unlike `localeCompare`). */
|
|
97
|
+
function byStringOrder(a, b) {
|
|
98
|
+
if (a === b) {
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
return a < b ? -1 : 1;
|
|
102
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { formatRecording, RECORDING_FORMAT, type RecordingFile, recordingFileSchema, } from "./format.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { FileKind } from "./kind.js";
|
|
2
|
+
import type { Agent } from "./kinds/agent/schema.js";
|
|
3
|
+
import type { Collection } from "./kinds/collection/schema.js";
|
|
4
|
+
import type { Connector } from "./kinds/connector/schema.js";
|
|
5
|
+
import type { Deployments } from "./kinds/deployments/schema.js";
|
|
6
|
+
import type { Hub } from "./kinds/hub/schema.js";
|
|
7
|
+
import type { IntegrationSheet } from "./kinds/integration/schema.js";
|
|
8
|
+
import type { KnowledgeSource } from "./kinds/knowledge/schema.js";
|
|
9
|
+
import type { Models } from "./kinds/models/schema.js";
|
|
10
|
+
import type { Plugin } from "./kinds/plugin/schema.js";
|
|
11
|
+
import type { Provider } from "./kinds/provider/schema.js";
|
|
12
|
+
import type { Routine } from "./kinds/routine/schema.js";
|
|
13
|
+
import type { Runtime } from "./kinds/runtime/schema.js";
|
|
14
|
+
import type { Skill } from "./kinds/skill/schema.js";
|
|
15
|
+
import type { Workflow } from "./kinds/workflow/schema.js";
|
|
16
|
+
import type { WorkflowTest } from "./kinds/workflow-test/schema.js";
|
|
17
|
+
import type { WorkspaceSettings } from "./kinds/workspace/schema.js";
|
|
18
|
+
/** The value each file kind parses to, by kind name. */
|
|
19
|
+
export interface KindValues {
|
|
20
|
+
workspace: WorkspaceSettings;
|
|
21
|
+
deployments: Deployments;
|
|
22
|
+
models: Models;
|
|
23
|
+
provider: Provider;
|
|
24
|
+
runtime: Runtime;
|
|
25
|
+
knowledge: KnowledgeSource;
|
|
26
|
+
collection: Collection;
|
|
27
|
+
connector: Connector;
|
|
28
|
+
skill: Skill;
|
|
29
|
+
hub: Hub;
|
|
30
|
+
agent: Agent;
|
|
31
|
+
workflow: Workflow;
|
|
32
|
+
workflowTest: WorkflowTest;
|
|
33
|
+
routine: Routine;
|
|
34
|
+
integration: IntegrationSheet;
|
|
35
|
+
plugin: Plugin;
|
|
36
|
+
}
|
|
37
|
+
/** The name of a file kind: `workspace`, `agent`, `workflowTest`, … */
|
|
38
|
+
export type KindName = keyof KindValues;
|
|
39
|
+
/**
|
|
40
|
+
* Every file kind, by name. Adding a kind means adding its folder under
|
|
41
|
+
* `kinds/` and one line here; the loader and the tooling read this list
|
|
42
|
+
* instead of switching on kind names.
|
|
43
|
+
*/
|
|
44
|
+
export declare const fileKinds: {
|
|
45
|
+
readonly [Name in KindName]: FileKind<KindValues[Name]>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The names of every file kind, workspace-level kinds first and the
|
|
49
|
+
* integration sheet and the plugin manifest, which sit outside workspaces,
|
|
50
|
+
* last, in a fixed order.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* for (const name of kindNames()) console.log(name, fileKinds[name].about);
|
|
54
|
+
*/
|
|
55
|
+
export declare function kindNames(): readonly KindName[];
|
|
56
|
+
/**
|
|
57
|
+
* Whether a text names a file kind, for input from outside such as a CLI
|
|
58
|
+
* argument.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* isKindName("agent"); // true
|
|
62
|
+
* isKindName("toString"); // false
|
|
63
|
+
*/
|
|
64
|
+
export declare function isKindName(name: string): name is KindName;
|