@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,261 @@
|
|
|
1
|
+
// `plugin.yaml`: a plugin's manifest (ADR 2026-11-09-plugins, section 1).
|
|
2
|
+
// Like the integration sheet it imports only schema-kit, std and the format's
|
|
3
|
+
// own field rules, so the integration kit and the conformance suite can read
|
|
4
|
+
// it without the YAML reader.
|
|
5
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
6
|
+
import { asciiHost } from "../../../../std/src/index.js";
|
|
7
|
+
import { relativePathProblem } from "../../shared/relative-path.js";
|
|
8
|
+
import { allowedSiteProblem, MAX_ALLOWED_SITES } from "../agent/sandbox-fields.js";
|
|
9
|
+
import { INTEGRATION_NAME_PATTERN, IntegrationSheet, IntegrationTool, MAX_TIMEOUT_MS, secretFields, } from "../integration/schema.js";
|
|
10
|
+
const name = s
|
|
11
|
+
.string()
|
|
12
|
+
.regex(INTEGRATION_NAME_PATTERN, "use lower-case words joined by '-', such as 'weather-key'");
|
|
13
|
+
/**
|
|
14
|
+
* A tool argument's name, as the tool's own schema writes it, such as
|
|
15
|
+
* `city` or `folderId`.
|
|
16
|
+
*/
|
|
17
|
+
export const ARGUMENT_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
18
|
+
const argumentName = s
|
|
19
|
+
.string()
|
|
20
|
+
.regex(ARGUMENT_NAME_PATTERN, "use the tool argument's name, such as 'city' or 'folderId'");
|
|
21
|
+
/** Text a person reads: a title or a label. Studio shows it as untrusted text. */
|
|
22
|
+
const label = s.string().min(1).max(80);
|
|
23
|
+
/**
|
|
24
|
+
* Why a local tool's `network` entry can't be used, or `null` when it can.
|
|
25
|
+
* The list is the sandbox's allow-list for code Halonic doesn't trust, so it
|
|
26
|
+
* takes the agent file's `allowedSites` rules: no address, port, `localhost`
|
|
27
|
+
* or local-network name. It must also be written as the sandbox stores it,
|
|
28
|
+
* lowercase and in Punycode, so a secret's host matches it exactly.
|
|
29
|
+
*
|
|
30
|
+
* @param site - a `network` entry
|
|
31
|
+
* @returns a message, or `null`
|
|
32
|
+
*/
|
|
33
|
+
export function networkSiteProblem(site) {
|
|
34
|
+
const problem = allowedSiteProblem(site);
|
|
35
|
+
if (problem !== null)
|
|
36
|
+
return problem;
|
|
37
|
+
const stored = asciiHost(site);
|
|
38
|
+
return stored === site ? null : `Write the host name as '${stored}'`;
|
|
39
|
+
}
|
|
40
|
+
const networkSite = s.string().superRefine((site, context) => {
|
|
41
|
+
const problem = networkSiteProblem(site);
|
|
42
|
+
if (problem !== null)
|
|
43
|
+
context.addIssue({ code: "custom", message: problem });
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Why a path to a file in the plugin folder can't be used, or `null` when it
|
|
47
|
+
* can: the same rules as an agent's working folder, so it can't point outside
|
|
48
|
+
* the plugin or be read as another name on Windows or macOS.
|
|
49
|
+
*
|
|
50
|
+
* @param path - a path such as `backend/index.js`
|
|
51
|
+
* @returns a message, or `null`
|
|
52
|
+
*/
|
|
53
|
+
export function pluginPathProblem(path) {
|
|
54
|
+
return relativePathProblem(path, { root: "the plugin folder", part: "file or folder name" });
|
|
55
|
+
}
|
|
56
|
+
const pluginPath = s.string().superRefine((path, context) => {
|
|
57
|
+
const problem = pluginPathProblem(path);
|
|
58
|
+
if (problem !== null)
|
|
59
|
+
context.addIssue({ code: "custom", message: problem });
|
|
60
|
+
});
|
|
61
|
+
/** Where a backend's built code is when `entry` doesn't say. */
|
|
62
|
+
export const DEFAULT_BACKEND_ENTRY = "backend/index.js";
|
|
63
|
+
/**
|
|
64
|
+
* The code-free part of an integration sheet: every field of
|
|
65
|
+
* `IntegrationSheet` except `id`, `version` and `kit`, which the plugin's own
|
|
66
|
+
* `id`, `version` and `sdk` give. It is the sheet's schema, not a copy, with
|
|
67
|
+
* `entry` added and `provides` defaulted.
|
|
68
|
+
*/
|
|
69
|
+
const Backend = IntegrationSheet.omit({ id: true, version: true, kit: true })
|
|
70
|
+
.extend({
|
|
71
|
+
/** The built JavaScript module in the plugin folder that exports the `Integration`. */
|
|
72
|
+
entry: pluginPath.default(DEFAULT_BACKEND_ENTRY),
|
|
73
|
+
provides: IntegrationSheet.shape.provides.default(["connector"]),
|
|
74
|
+
})
|
|
75
|
+
.strict();
|
|
76
|
+
/** An exact npm version, `major.minor.patch` with an optional pre-release: never a range or tag. */
|
|
77
|
+
export const NPM_EXACT_VERSION_PATTERN = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
78
|
+
/** An exact PEP 440 version, such as `0.4.1` or `2.0rc1`: never `==`, a range or a wildcard. */
|
|
79
|
+
export const PYPI_EXACT_VERSION_PATTERN = /^(?:\d+!)?\d+(?:\.\d+)*(?:(?:a|b|rc)\d+)?(?:\.post\d+)?(?:\.dev\d+)?$/;
|
|
80
|
+
/** An npm package name, scoped or not. It can't start with `-`, so it is never read as an option. */
|
|
81
|
+
const npmPackage = s
|
|
82
|
+
.string()
|
|
83
|
+
.regex(/^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/, "use an npm package name, such as 'weather-mcp' or '@example/weather-mcp'");
|
|
84
|
+
/** A Python package name. It can't start with `-`, so it is never read as an option. */
|
|
85
|
+
const pypiPackage = s
|
|
86
|
+
.string()
|
|
87
|
+
.regex(/^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/, "use a Python package name, such as 'weather-radar'");
|
|
88
|
+
/**
|
|
89
|
+
* A package registry's base address, such as `https://registry.npmjs.org` or
|
|
90
|
+
* `https://pypi.example.com`; without one the runner's public registry is
|
|
91
|
+
* used. It becomes the pin's `registryUrl`, so it is the base, not an index
|
|
92
|
+
* inside it: the launcher adds `/simple` for PyPI and the pin check reads
|
|
93
|
+
* `/pypi/<name>/<version>/json`. A trailing `/` is fine; both drop it.
|
|
94
|
+
*/
|
|
95
|
+
const registry = s.url().regex(/^https:\/\//, "use an https address for the registry");
|
|
96
|
+
/**
|
|
97
|
+
* A PyPI index ends in `/simple`, and that is the address a mirror's docs
|
|
98
|
+
* give, so it is the likely mistake. It is refused rather than trimmed: the
|
|
99
|
+
* pin in the trust record is then the address the author wrote, and an
|
|
100
|
+
* index that isn't under `<base>/simple` is never guessed at.
|
|
101
|
+
*/
|
|
102
|
+
const pypiRegistry = registry.regex(/^(?!https:\/\/[^/]+\/(?:.*\/)?simple\/*$)/, "use the registry's base address, without '/simple': the launcher adds it");
|
|
103
|
+
/** A pinned package, started by its runner. The pin goes into the trust record. */
|
|
104
|
+
const PackageStart = s.discriminatedUnion("runner", [
|
|
105
|
+
s
|
|
106
|
+
.object({
|
|
107
|
+
runner: s.literal("npx"),
|
|
108
|
+
name: npmPackage,
|
|
109
|
+
version: s
|
|
110
|
+
.string()
|
|
111
|
+
.regex(NPM_EXACT_VERSION_PATTERN, "use an exact version, such as '1.2.3', not a range"),
|
|
112
|
+
registry: registry.optional(),
|
|
113
|
+
})
|
|
114
|
+
.strict(),
|
|
115
|
+
s
|
|
116
|
+
.object({
|
|
117
|
+
runner: s.literal("uvx"),
|
|
118
|
+
name: pypiPackage,
|
|
119
|
+
version: s
|
|
120
|
+
.string()
|
|
121
|
+
.regex(PYPI_EXACT_VERSION_PATTERN, "use an exact version, such as '0.4.1', not a range"),
|
|
122
|
+
registry: pypiRegistry.optional(),
|
|
123
|
+
})
|
|
124
|
+
.strict(),
|
|
125
|
+
]);
|
|
126
|
+
/** A file in the plugin folder, started without a shell by a program the person already has. */
|
|
127
|
+
const ScriptStart = s.object({ program: s.enum(["node", "python"]), path: pluginPath }).strict();
|
|
128
|
+
/**
|
|
129
|
+
* How a local tool's program starts: exactly one of a package and a script.
|
|
130
|
+
* Both are optional keys rather than a union, so a mistake inside one is
|
|
131
|
+
* reported at its own field.
|
|
132
|
+
*/
|
|
133
|
+
const Start = s
|
|
134
|
+
.object({ package: PackageStart.optional(), script: ScriptStart.optional() })
|
|
135
|
+
.strict()
|
|
136
|
+
.superRefine((start, context) => {
|
|
137
|
+
if ((start.package === undefined) === (start.script === undefined)) {
|
|
138
|
+
context.addIssue({
|
|
139
|
+
code: "custom",
|
|
140
|
+
message: "start a local tool with either package or script",
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* The longest a plugin's id may be. Halonic keeps a plugin's secrets under a
|
|
146
|
+
* name made of its id and the secret's name, and a secret name is at most
|
|
147
|
+
* 128 characters (ADR 2026-11-09-plugins, section 3).
|
|
148
|
+
*/
|
|
149
|
+
export const MAX_PLUGIN_ID_LENGTH = 48;
|
|
150
|
+
/** The longest a secret a plugin declares may be named, for the same reason. */
|
|
151
|
+
export const MAX_PLUGIN_SECRET_NAME_LENGTH = 64;
|
|
152
|
+
/** An environment variable's name, such as `ACME_ROOT`. */
|
|
153
|
+
export const ENV_NAME_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
|
|
154
|
+
/** Where an environment value comes from: a setting or a declared secret, never a literal. */
|
|
155
|
+
const EnvValue = s.union([
|
|
156
|
+
s.object({ setting: name }).strict(),
|
|
157
|
+
s.object({ secret: name }).strict(),
|
|
158
|
+
]);
|
|
159
|
+
/** An MCP server over stdio that runs in a `Sandbox` session on the person's computer. */
|
|
160
|
+
const LocalTool = s
|
|
161
|
+
.object({
|
|
162
|
+
/** Unique in the plugin; the trust record keys the pin by it. */
|
|
163
|
+
id: name,
|
|
164
|
+
start: Start,
|
|
165
|
+
args: s.array(s.string()).default([]),
|
|
166
|
+
env: s
|
|
167
|
+
.record(s.string().regex(ENV_NAME_PATTERN, "use an upper-case name, such as 'ACME_ROOT'"), EnvValue)
|
|
168
|
+
.default({}),
|
|
169
|
+
/** The sheet's secret fields, without `as`: a local tool gets them as `env` values. */
|
|
170
|
+
secrets: s.record(name, s.object(secretFields).strict()).default({}),
|
|
171
|
+
/** The hosts the program may reach, beyond the bridge. */
|
|
172
|
+
network: s.array(networkSite).max(MAX_ALLOWED_SITES).default([]),
|
|
173
|
+
/** One tool call; the session's own time limit is Halonic's. */
|
|
174
|
+
callTimeoutMs: s.number().int().positive().max(MAX_TIMEOUT_MS).default(60_000),
|
|
175
|
+
/** Every tool it offers. A tool the server lists but this doesn't is refused. */
|
|
176
|
+
tools: s.array(IntegrationTool).min(1),
|
|
177
|
+
})
|
|
178
|
+
.strict();
|
|
179
|
+
/** What every field says, whatever its type. */
|
|
180
|
+
const fieldBase = {
|
|
181
|
+
label,
|
|
182
|
+
help: s.string().min(1).max(500).optional(),
|
|
183
|
+
required: s.boolean().default(false),
|
|
184
|
+
};
|
|
185
|
+
/** The field types a setting and a command's form share. */
|
|
186
|
+
const inputFields = [
|
|
187
|
+
s.object({ ...fieldBase, type: s.literal("text"), default: s.string().optional() }).strict(),
|
|
188
|
+
s.object({ ...fieldBase, type: s.literal("url"), default: s.url().optional() }).strict(),
|
|
189
|
+
s.object({ ...fieldBase, type: s.literal("number"), default: s.number().optional() }).strict(),
|
|
190
|
+
s.object({ ...fieldBase, type: s.literal("boolean"), default: s.boolean().optional() }).strict(),
|
|
191
|
+
s
|
|
192
|
+
.object({
|
|
193
|
+
...fieldBase,
|
|
194
|
+
type: s.literal("choice"),
|
|
195
|
+
choices: s.array(s.string().min(1)).min(1),
|
|
196
|
+
default: s.string().optional(),
|
|
197
|
+
})
|
|
198
|
+
.strict(),
|
|
199
|
+
];
|
|
200
|
+
/**
|
|
201
|
+
* A setting the person fills in. A `secret` one names a declared secret,
|
|
202
|
+
* goes to Secrets and never has a default.
|
|
203
|
+
*/
|
|
204
|
+
const SettingField = s.discriminatedUnion("type", [
|
|
205
|
+
...inputFields,
|
|
206
|
+
s.object({ ...fieldBase, type: s.literal("secret"), secret: name }).strict(),
|
|
207
|
+
]);
|
|
208
|
+
/** One field of a command's form; its name is the tool argument it fills. */
|
|
209
|
+
const FormField = s.discriminatedUnion("type", inputFields);
|
|
210
|
+
/** How a tool's answer is drawn. */
|
|
211
|
+
const show = s.enum(["text", "markdown", "table"]).default("text");
|
|
212
|
+
/** A command in the palette: an optional form, then the tool's answer in a card. */
|
|
213
|
+
const Command = s
|
|
214
|
+
.object({
|
|
215
|
+
id: name,
|
|
216
|
+
title: label,
|
|
217
|
+
tool: s.string().min(1),
|
|
218
|
+
form: s.record(argumentName, FormField).default({}),
|
|
219
|
+
show,
|
|
220
|
+
})
|
|
221
|
+
.strict();
|
|
222
|
+
/** A card in the plugin's panel, filled by one `read` tool call with fixed arguments. */
|
|
223
|
+
const Card = s
|
|
224
|
+
.object({
|
|
225
|
+
id: name,
|
|
226
|
+
title: label,
|
|
227
|
+
tool: s.string().min(1),
|
|
228
|
+
args: s.record(argumentName, s.union([s.string(), s.number(), s.boolean()])).default({}),
|
|
229
|
+
show,
|
|
230
|
+
})
|
|
231
|
+
.strict();
|
|
232
|
+
/** The plugin's one panel window: its cards, then its commands, in manifest order. */
|
|
233
|
+
const Panel = s.object({ title: label }).strict();
|
|
234
|
+
/** What Studio draws for the plugin. It is data only; no plugin code runs in Studio. */
|
|
235
|
+
const Ui = s
|
|
236
|
+
.object({
|
|
237
|
+
settings: s.record(name, SettingField).default({}),
|
|
238
|
+
commands: s.array(Command).default([]),
|
|
239
|
+
cards: s.array(Card).default([]),
|
|
240
|
+
panel: Panel.optional(),
|
|
241
|
+
})
|
|
242
|
+
.strict();
|
|
243
|
+
/**
|
|
244
|
+
* `plugin.yaml`: a plugin's id and versions and its parts: a backend (an
|
|
245
|
+
* integration sheet), local tools and UI.
|
|
246
|
+
*/
|
|
247
|
+
export const Plugin = s
|
|
248
|
+
.object({
|
|
249
|
+
id: IntegrationSheet.shape.id,
|
|
250
|
+
/** The plugin's own version. */
|
|
251
|
+
version: IntegrationSheet.shape.version,
|
|
252
|
+
/** The plugin SDK version it was built for: the `Integration` port's version, as `kit` is. */
|
|
253
|
+
sdk: IntegrationSheet.shape.kit,
|
|
254
|
+
name: label,
|
|
255
|
+
/** Empty for an `integration.yaml` read as a plugin, which has no description. */
|
|
256
|
+
description: s.string().max(500).default(""),
|
|
257
|
+
backend: Backend.optional(),
|
|
258
|
+
localTools: s.array(LocalTool).min(1).optional(),
|
|
259
|
+
ui: Ui.optional(),
|
|
260
|
+
})
|
|
261
|
+
.strict();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PluginUi } from "./schema.js";
|
|
2
|
+
/** One setting field, as a plugin's `ui.settings` declares it. */
|
|
3
|
+
export type PluginSettingField = PluginUi["settings"][string];
|
|
4
|
+
/** A value saved for a setting. A `secret` setting has none here: its value goes to `Secrets`. */
|
|
5
|
+
export type PluginSettingValue = string | number | boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Why `value` can't be saved for `field`, or `null` when it can. A `secret`
|
|
8
|
+
* field never takes a value here, because its value goes to `Secrets`.
|
|
9
|
+
*
|
|
10
|
+
* @param field - the setting, as the manifest declares it
|
|
11
|
+
* @param value - what the person entered
|
|
12
|
+
* @returns a message for the person, or `null`
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* settingValueProblem({ type: "number", label: "Days", required: false }, "3"); // "use a number"
|
|
16
|
+
*/
|
|
17
|
+
export declare function settingValueProblem(field: PluginSettingField, value: unknown): string | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Whether a value can be saved for one of a plugin's settings, by the rules
|
|
2
|
+
// the manifest's own `default` follows (ADR 2026-11-09-plugins, section 1.4).
|
|
3
|
+
// The app checks every value a person saves with it, so a saved value is
|
|
4
|
+
// always one the manifest could have written.
|
|
5
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
6
|
+
/** An `http` or `https` URL as `URL` writes it, the rule of a `url` field's `default`. */
|
|
7
|
+
const url = s.url();
|
|
8
|
+
/**
|
|
9
|
+
* Why `value` can't be saved for `field`, or `null` when it can. A `secret`
|
|
10
|
+
* field never takes a value here, because its value goes to `Secrets`.
|
|
11
|
+
*
|
|
12
|
+
* @param field - the setting, as the manifest declares it
|
|
13
|
+
* @param value - what the person entered
|
|
14
|
+
* @returns a message for the person, or `null`
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* settingValueProblem({ type: "number", label: "Days", required: false }, "3"); // "use a number"
|
|
18
|
+
*/
|
|
19
|
+
export function settingValueProblem(field, value) {
|
|
20
|
+
switch (field.type) {
|
|
21
|
+
case "secret":
|
|
22
|
+
return "this is a secret, which is kept in Secrets, not with the settings";
|
|
23
|
+
case "text":
|
|
24
|
+
return typeof value === "string" ? null : "use text";
|
|
25
|
+
case "url":
|
|
26
|
+
return url.safeParse(value).success
|
|
27
|
+
? null
|
|
28
|
+
: "use an http or https address, such as 'https://example.com'";
|
|
29
|
+
case "number":
|
|
30
|
+
return typeof value === "number" && Number.isFinite(value) ? null : "use a number";
|
|
31
|
+
case "boolean":
|
|
32
|
+
return typeof value === "boolean" ? null : "use true or false";
|
|
33
|
+
case "choice":
|
|
34
|
+
return typeof value === "string" && field.choices.includes(value)
|
|
35
|
+
? null
|
|
36
|
+
: `use one of ${field.choices.map((choice) => `'${choice}'`).join(", ")}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { KindCheckProblem } from "../../kind.js";
|
|
2
|
+
import type { Plugin } from "./schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* The problems in a plugin's `ui`: an id twice, a secret field for a secret
|
|
5
|
+
* no part declares, a choice default that isn't a choice, a command or card
|
|
6
|
+
* whose tool isn't a declared `read` tool, and cards without a panel.
|
|
7
|
+
*/
|
|
8
|
+
export declare function uiProblems(plugin: Plugin): KindCheckProblem[];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { declaredSecrets, declaredTools, duplicates, problem } from "./problems.js";
|
|
2
|
+
/** How a message says what a tool does, by its risk. */
|
|
3
|
+
const riskVerbs = {
|
|
4
|
+
write: "writes",
|
|
5
|
+
send: "sends",
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The problems in a plugin's `ui`: an id twice, a secret field for a secret
|
|
9
|
+
* no part declares, a choice default that isn't a choice, a command or card
|
|
10
|
+
* whose tool isn't a declared `read` tool, and cards without a panel.
|
|
11
|
+
*/
|
|
12
|
+
export function uiProblems(plugin) {
|
|
13
|
+
const ui = plugin.ui;
|
|
14
|
+
if (ui === undefined) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
return [
|
|
18
|
+
...duplicates(plugin, ui.commands.map((command) => command.id), (index) => ["ui", "commands", index, "id"], "command"),
|
|
19
|
+
...duplicates(plugin, ui.cards.map((card) => card.id), (index) => ["ui", "cards", index, "id"], "card"),
|
|
20
|
+
...fieldProblems(plugin, ui),
|
|
21
|
+
...toolProblems(plugin, ui),
|
|
22
|
+
...panelProblems(plugin, ui),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
/** A secret field names a secret the backend or a local tool declares; a choice default is a choice. */
|
|
26
|
+
function fieldProblems(plugin, ui) {
|
|
27
|
+
const secrets = new Set(declaredSecrets(plugin).map((secret) => secret.name));
|
|
28
|
+
const problems = [];
|
|
29
|
+
for (const [key, field] of Object.entries(ui.settings)) {
|
|
30
|
+
const path = ["ui", "settings", key];
|
|
31
|
+
if (field.type === "secret" && !secrets.has(field.secret)) {
|
|
32
|
+
const message = `the secret field ${key} names the secret ${field.secret}, which neither the backend nor a local tool declares`;
|
|
33
|
+
problems.push(problem(plugin, "secret-not-declared", [...path, "secret"], message));
|
|
34
|
+
}
|
|
35
|
+
if (field.type === "choice") {
|
|
36
|
+
problems.push(...choiceProblems(plugin, key, field, path));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
ui.commands.forEach((command, index) => {
|
|
40
|
+
for (const [key, field] of Object.entries(command.form)) {
|
|
41
|
+
if (field.type === "choice") {
|
|
42
|
+
problems.push(...choiceProblems(plugin, key, field, ["ui", "commands", index, "form", key]));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return problems;
|
|
47
|
+
}
|
|
48
|
+
function choiceProblems(plugin, key, field, path) {
|
|
49
|
+
if (field.default === undefined || field.choices.includes(field.default)) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
const message = `the default of ${key}, ${field.default}, is not one of its choices`;
|
|
53
|
+
return [problem(plugin, "default-not-a-choice", [...path, "default"], message)];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A command or card calls a tool the plugin declares, and in v0.1 one that
|
|
57
|
+
* only reads. Both run outside a run, where `checkOutsideRunCall` refuses
|
|
58
|
+
* every other tool and nothing can wait for approval; cards also refresh on
|
|
59
|
+
* their own. The ADR says this for cards; HAL-1819 adds it for commands.
|
|
60
|
+
*/
|
|
61
|
+
function toolProblems(plugin, ui) {
|
|
62
|
+
const risks = new Map(declaredTools(plugin).map((tool) => [tool.name, tool.risk]));
|
|
63
|
+
const callers = [
|
|
64
|
+
...ui.commands.map((command, index) => ({
|
|
65
|
+
what: "command",
|
|
66
|
+
...command,
|
|
67
|
+
index,
|
|
68
|
+
list: "commands",
|
|
69
|
+
})),
|
|
70
|
+
...ui.cards.map((card, index) => ({ what: "card", ...card, index, list: "cards" })),
|
|
71
|
+
];
|
|
72
|
+
const problems = [];
|
|
73
|
+
for (const caller of callers) {
|
|
74
|
+
const path = ["ui", caller.list, caller.index, "tool"];
|
|
75
|
+
const risk = risks.get(caller.tool);
|
|
76
|
+
if (risk === undefined) {
|
|
77
|
+
const message = `${caller.what} ${caller.id} uses the tool ${caller.tool}, which neither the backend nor a local tool declares`;
|
|
78
|
+
problems.push(problem(plugin, "tool-not-found", path, message));
|
|
79
|
+
}
|
|
80
|
+
else if (risk !== "read") {
|
|
81
|
+
const message = `${caller.what} ${caller.id} uses the tool ${caller.tool}, which ${riskVerbs[risk] ?? risk}; commands and cards may only use tools that read`;
|
|
82
|
+
problems.push(problem(plugin, "tool-not-read", path, message));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return problems;
|
|
86
|
+
}
|
|
87
|
+
/** Cards show only in the plugin's panel, so a plugin with cards has one. */
|
|
88
|
+
function panelProblems(plugin, ui) {
|
|
89
|
+
if (ui.cards.length === 0 || ui.panel !== undefined) {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const message = "cards show only in the plugin's panel; add ui.panel with a title";
|
|
93
|
+
return [problem(plugin, "cards-need-panel", ["ui", "cards"], message)];
|
|
94
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { checkKeysIn } from "../../shared/key-in-value.js";
|
|
2
|
+
import { checkSecretName } from "../../shared/secret-name.js";
|
|
3
|
+
import { Provider } from "./schema.js";
|
|
4
|
+
/** `providers/<id>.yaml` at the workspace root. */
|
|
5
|
+
export const providerKind = {
|
|
6
|
+
name: "provider",
|
|
7
|
+
about: "A connection to something that serves models.",
|
|
8
|
+
syntax: "yaml",
|
|
9
|
+
schema: Provider,
|
|
10
|
+
places: [{ scope: "workspace", folder: "providers", name: "<id>.yaml" }],
|
|
11
|
+
idFromPlace: "fallback",
|
|
12
|
+
check: checkProvider,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The secret is named in the file, so a bad name or a pasted key is caught
|
|
16
|
+
* here, not at run time. A key pasted into `options` is caught too.
|
|
17
|
+
*/
|
|
18
|
+
function checkProvider(provider) {
|
|
19
|
+
const problem = provider.secret === undefined ? undefined : checkSecretName(provider.secret, ["secret"]);
|
|
20
|
+
return [
|
|
21
|
+
...(problem === undefined ? [] : [problem]),
|
|
22
|
+
...checkKeysIn(provider.options, ["options"], "provider-option"),
|
|
23
|
+
];
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* `providers/<id>.yaml`: a connection to something that serves models.
|
|
4
|
+
* Secrets are referenced by name, never stored in the file.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Provider: import("zod").ZodObject<{
|
|
7
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
8
|
+
id: import("zod").ZodString;
|
|
9
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
type: import("zod").ZodString;
|
|
11
|
+
baseUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
secret: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
|
+
local: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
14
|
+
options: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
15
|
+
}, import("zod/v4/core").$strict>;
|
|
16
|
+
/** A model provider, with defaults filled in. */
|
|
17
|
+
export type Provider = Infer<typeof Provider>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { id, version } from "../../shared/fields.js";
|
|
3
|
+
/**
|
|
4
|
+
* `providers/<id>.yaml`: a connection to something that serves models.
|
|
5
|
+
* Secrets are referenced by name, never stored in the file.
|
|
6
|
+
*/
|
|
7
|
+
export const Provider = s
|
|
8
|
+
.object({
|
|
9
|
+
version,
|
|
10
|
+
id,
|
|
11
|
+
name: s.string().optional(),
|
|
12
|
+
/** Adapter type: anthropic, openai, openai-compatible, ollama, lmstudio, or mock (for tests). */
|
|
13
|
+
type: s.string().min(1),
|
|
14
|
+
baseUrl: s.string().url().optional(),
|
|
15
|
+
/** The name of the secret that holds the API key. */
|
|
16
|
+
secret: s.string().optional(),
|
|
17
|
+
/** True when the provider runs on this machine or your own network. */
|
|
18
|
+
local: s.boolean().default(false),
|
|
19
|
+
/** Adapter-specific settings (account id, API version, headers, …). */
|
|
20
|
+
options: s.record(s.string(), s.unknown()).default({}),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FileKind } from "../../kind.js";
|
|
2
|
+
import { Routine } from "./schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* `workflows/routines/<id>.routine.yaml`, at the root or in a hub. Checking
|
|
5
|
+
* the cron text and time zone is `@halonicjs/routines`' job, which sits
|
|
6
|
+
* above this package.
|
|
7
|
+
*/
|
|
8
|
+
export declare const routineKind: FileKind<Routine>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isMap, renameKey } from "../../shared/legacy-keys.js";
|
|
2
|
+
import { Routine } from "./schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* `workflows/routines/<id>.routine.yaml`, at the root or in a hub. Checking
|
|
5
|
+
* the cron text and time zone is `@halonicjs/routines`' job, which sits
|
|
6
|
+
* above this package.
|
|
7
|
+
*/
|
|
8
|
+
export const routineKind = {
|
|
9
|
+
name: "routine",
|
|
10
|
+
about: "When a workflow or an agent runs on its own: a schedule, an interval, a signal or mail.",
|
|
11
|
+
syntax: "yaml",
|
|
12
|
+
schema: Routine,
|
|
13
|
+
places: [{ scope: "workspace-and-hub", folder: "workflows/routines", name: "<id>.routine.yaml" }],
|
|
14
|
+
idFromPlace: "fallback",
|
|
15
|
+
upgradeKeys: upgradeRoutineKeys,
|
|
16
|
+
};
|
|
17
|
+
/** Workflows were called flows and hubs projects: `run.flow` and `run.project` still load. */
|
|
18
|
+
function upgradeRoutineKeys(data) {
|
|
19
|
+
const run = data["run"];
|
|
20
|
+
if (!isMap(run)) {
|
|
21
|
+
return { ...data };
|
|
22
|
+
}
|
|
23
|
+
const upgradedRun = renameKey(renameKey(run, "flow", "workflow"), "project", "hub");
|
|
24
|
+
return { ...data, run: upgradedRun };
|
|
25
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { Guard } from "../../shared/guard.js";
|
|
3
|
+
/** When a routine starts. */
|
|
4
|
+
export declare const RoutineTrigger: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
5
|
+
schedule: import("zod").ZodString;
|
|
6
|
+
timezone: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
8
|
+
every: import("zod").ZodString;
|
|
9
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
10
|
+
manual: import("zod").ZodLiteral<true>;
|
|
11
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
12
|
+
signal: import("zod").ZodObject<{
|
|
13
|
+
name: import("zod").ZodString;
|
|
14
|
+
when: import("zod").ZodOptional<import("../../../../schema-kit/src/index.js").Schema<Guard>>;
|
|
15
|
+
}, import("zod/v4/core").$strict>;
|
|
16
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
17
|
+
mail: import("zod").ZodObject<{
|
|
18
|
+
connector: import("zod").ZodString;
|
|
19
|
+
query: import("zod").ZodDefault<import("zod").ZodString>;
|
|
20
|
+
every: import("zod").ZodDefault<import("zod").ZodString>;
|
|
21
|
+
}, import("zod/v4/core").$strict>;
|
|
22
|
+
}, import("zod/v4/core").$strict>]>;
|
|
23
|
+
/** What a routine runs: a workflow with input, or one agent with a prompt. */
|
|
24
|
+
export declare const RoutineTarget: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
25
|
+
hub: import("zod").ZodOptional<import("zod").ZodString>;
|
|
26
|
+
workflow: import("zod").ZodString;
|
|
27
|
+
input: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
28
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
29
|
+
hub: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
agent: import("zod").ZodString;
|
|
31
|
+
prompt: import("zod").ZodString;
|
|
32
|
+
}, import("zod/v4/core").$strict>]>;
|
|
33
|
+
/** `workflows/routines/<id>.routine.yaml`: when something runs on its own. */
|
|
34
|
+
export declare const Routine: import("zod").ZodObject<{
|
|
35
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
36
|
+
id: import("zod").ZodString;
|
|
37
|
+
name: import("zod").ZodString;
|
|
38
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
40
|
+
trigger: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
41
|
+
schedule: import("zod").ZodString;
|
|
42
|
+
timezone: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
44
|
+
every: import("zod").ZodString;
|
|
45
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
46
|
+
manual: import("zod").ZodLiteral<true>;
|
|
47
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
48
|
+
signal: import("zod").ZodObject<{
|
|
49
|
+
name: import("zod").ZodString;
|
|
50
|
+
when: import("zod").ZodOptional<import("../../../../schema-kit/src/index.js").Schema<Guard>>;
|
|
51
|
+
}, import("zod/v4/core").$strict>;
|
|
52
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
53
|
+
mail: import("zod").ZodObject<{
|
|
54
|
+
connector: import("zod").ZodString;
|
|
55
|
+
query: import("zod").ZodDefault<import("zod").ZodString>;
|
|
56
|
+
every: import("zod").ZodDefault<import("zod").ZodString>;
|
|
57
|
+
}, import("zod/v4/core").$strict>;
|
|
58
|
+
}, import("zod/v4/core").$strict>]>;
|
|
59
|
+
run: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
60
|
+
hub: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
workflow: import("zod").ZodString;
|
|
62
|
+
input: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
63
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
64
|
+
hub: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
agent: import("zod").ZodString;
|
|
66
|
+
prompt: import("zod").ZodString;
|
|
67
|
+
}, import("zod/v4/core").$strict>]>;
|
|
68
|
+
overlap: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
69
|
+
allow: "allow";
|
|
70
|
+
queue: "queue";
|
|
71
|
+
skip: "skip";
|
|
72
|
+
}>>;
|
|
73
|
+
catchUp: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
74
|
+
all: "all";
|
|
75
|
+
last: "last";
|
|
76
|
+
none: "none";
|
|
77
|
+
}>>;
|
|
78
|
+
}, import("zod/v4/core").$strict>;
|
|
79
|
+
/** A routine, with defaults filled in. */
|
|
80
|
+
export type Routine = Infer<typeof Routine>;
|
|
81
|
+
/** When a routine starts. */
|
|
82
|
+
export type RoutineTrigger = Infer<typeof RoutineTrigger>;
|
|
83
|
+
/** What a routine runs. */
|
|
84
|
+
export type RoutineTarget = Infer<typeof RoutineTarget>;
|