@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,93 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { DURATION_PATTERN, id, version } from "../../shared/fields.js";
|
|
3
|
+
import { Guard } from "../../shared/guard.js";
|
|
4
|
+
/** On a schedule: five-field cron or a shortcut such as @daily, in a time zone. */
|
|
5
|
+
const ScheduleTrigger = s
|
|
6
|
+
.object({
|
|
7
|
+
schedule: s.string().min(1),
|
|
8
|
+
/** IANA time zone, such as Europe/Amsterdam. Default: the machine's zone. */
|
|
9
|
+
timezone: s.string().optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
/** At a fixed interval. */
|
|
13
|
+
const EveryTrigger = s
|
|
14
|
+
.object({
|
|
15
|
+
every: s
|
|
16
|
+
.string()
|
|
17
|
+
.regex(DURATION_PATTERN, 'use a number and a unit, e.g. "15m", "1h", "1d" (runs are placed from midnight UTC)'),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
/** Only when someone starts it. */
|
|
21
|
+
const ManualTrigger = s.object({ manual: s.literal(true) }).strict();
|
|
22
|
+
/** When a workflow step sends a signal; `when` filters on its data. */
|
|
23
|
+
const SignalTrigger = s
|
|
24
|
+
.object({
|
|
25
|
+
signal: s.object({ name: s.string().min(1), when: Guard.optional() }).strict(),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
/** New mail in a Google connector's mailbox, checked without a model; one run per message. */
|
|
29
|
+
const MailTrigger = s
|
|
30
|
+
.object({
|
|
31
|
+
mail: s
|
|
32
|
+
.object({
|
|
33
|
+
/** A connector with `transport: google`. */
|
|
34
|
+
connector: id,
|
|
35
|
+
/** Gmail search for the mail that counts. */
|
|
36
|
+
query: s.string().default("in:inbox"),
|
|
37
|
+
/**
|
|
38
|
+
* How often to look. The old pattern missed a backslash and refused
|
|
39
|
+
* any number of more than one digit, such as "15m"
|
|
40
|
+
* (format.routine-mail-interval).
|
|
41
|
+
*/
|
|
42
|
+
every: s
|
|
43
|
+
.string()
|
|
44
|
+
.regex(DURATION_PATTERN, 'use a number and a unit, e.g. "2m"')
|
|
45
|
+
.default("2m"),
|
|
46
|
+
})
|
|
47
|
+
.strict(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
/** When a routine starts. */
|
|
51
|
+
export const RoutineTrigger = s.union([
|
|
52
|
+
ScheduleTrigger,
|
|
53
|
+
EveryTrigger,
|
|
54
|
+
ManualTrigger,
|
|
55
|
+
SignalTrigger,
|
|
56
|
+
MailTrigger,
|
|
57
|
+
]);
|
|
58
|
+
/** What a routine runs: a workflow with input, or one agent with a prompt. */
|
|
59
|
+
export const RoutineTarget = s.union([
|
|
60
|
+
s
|
|
61
|
+
.object({
|
|
62
|
+
/** The workflow's hub. Required for workspace-level routines. */
|
|
63
|
+
hub: id.optional(),
|
|
64
|
+
workflow: id,
|
|
65
|
+
/** Workflow input; text may use {{trigger.at}}, {{trigger.lastRun}} and {{trigger.message}}. */
|
|
66
|
+
input: s.record(s.string(), s.unknown()).default({}),
|
|
67
|
+
})
|
|
68
|
+
.strict(),
|
|
69
|
+
s
|
|
70
|
+
.object({
|
|
71
|
+
hub: id.optional(),
|
|
72
|
+
agent: id,
|
|
73
|
+
/** The prompt; it may use the same {{trigger.*}} templates. */
|
|
74
|
+
prompt: s.string().min(1),
|
|
75
|
+
})
|
|
76
|
+
.strict(),
|
|
77
|
+
]);
|
|
78
|
+
/** `workflows/routines/<id>.routine.yaml`: when something runs on its own. */
|
|
79
|
+
export const Routine = s
|
|
80
|
+
.object({
|
|
81
|
+
version,
|
|
82
|
+
id,
|
|
83
|
+
name: s.string().min(1),
|
|
84
|
+
description: s.string().optional(),
|
|
85
|
+
enabled: s.boolean().default(true),
|
|
86
|
+
trigger: RoutineTrigger,
|
|
87
|
+
run: RoutineTarget,
|
|
88
|
+
/** A previous run is still going: skip this one, queue it, or start anyway. */
|
|
89
|
+
overlap: s.enum(["skip", "queue", "allow"]).default("skip"),
|
|
90
|
+
/** Scheduled times missed while nothing ran: none, the last one, or all. */
|
|
91
|
+
catchUp: s.enum(["none", "last", "all"]).default("last"),
|
|
92
|
+
})
|
|
93
|
+
.strict();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { checkKeysIn } from "../../shared/key-in-value.js";
|
|
2
|
+
import { Runtime } from "./schema.js";
|
|
3
|
+
/** `runtimes/<id>.yaml` at the workspace root. */
|
|
4
|
+
export const runtimeKind = {
|
|
5
|
+
name: "runtime",
|
|
6
|
+
about: "Where agents run: in the process, or another runtime adapter.",
|
|
7
|
+
syntax: "yaml",
|
|
8
|
+
schema: Runtime,
|
|
9
|
+
places: [{ scope: "workspace", folder: "runtimes", name: "<id>.yaml" }],
|
|
10
|
+
idFromPlace: "fallback",
|
|
11
|
+
/** `options` takes any setting, so a key pasted there is caught here. */
|
|
12
|
+
check: (runtime) => checkKeysIn(runtime.options, ["options"], "setting"),
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** `runtimes/<id>.yaml`: where agents run. */
|
|
3
|
+
export declare const Runtime: import("zod").ZodObject<{
|
|
4
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
5
|
+
id: import("zod").ZodString;
|
|
6
|
+
type: import("zod").ZodString;
|
|
7
|
+
options: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
8
|
+
}, import("zod/v4/core").$strict>;
|
|
9
|
+
/** A runtime, with defaults filled in. */
|
|
10
|
+
export type Runtime = Infer<typeof Runtime>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { id, version } from "../../shared/fields.js";
|
|
3
|
+
/** `runtimes/<id>.yaml`: where agents run. */
|
|
4
|
+
export const Runtime = s
|
|
5
|
+
.object({
|
|
6
|
+
version,
|
|
7
|
+
id,
|
|
8
|
+
/** Adapter type, such as inprocess, flue, cloudflare or rust. */
|
|
9
|
+
type: s.string().min(1),
|
|
10
|
+
options: s.record(s.string(), s.unknown()).default({}),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Skill } from "./schema.js";
|
|
2
|
+
/** `library/skills/<id>/SKILL.md`, shared at the root or a hub's own; the folder is the id. */
|
|
3
|
+
export const skillKind = {
|
|
4
|
+
name: "skill",
|
|
5
|
+
about: "Instructions agents can follow, in the open Agent Skills format.",
|
|
6
|
+
syntax: "front-matter",
|
|
7
|
+
schema: Skill,
|
|
8
|
+
places: [{ scope: "workspace-and-hub", folder: "library/skills", name: "<id>/SKILL.md" }],
|
|
9
|
+
idFromPlace: "always",
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* `library/skills/<id>/SKILL.md`, in the open Agent Skills format: YAML front
|
|
4
|
+
* matter with a name and a description, then Markdown instructions.
|
|
5
|
+
*
|
|
6
|
+
* The schema describes the front matter plus `body`, the Markdown after it,
|
|
7
|
+
* and `id`, the skill's folder. Other front matter keys are allowed by the
|
|
8
|
+
* format and dropped here, as the old loader did.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Skill: import("zod").ZodObject<{
|
|
11
|
+
id: import("zod").ZodString;
|
|
12
|
+
name: import("zod").ZodString;
|
|
13
|
+
description: import("zod").ZodString;
|
|
14
|
+
body: import("zod").ZodString;
|
|
15
|
+
}, import("zod/v4/core").$strip>;
|
|
16
|
+
/** A skill: its id, name, description and Markdown body. */
|
|
17
|
+
export type Skill = Infer<typeof Skill>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* `library/skills/<id>/SKILL.md`, in the open Agent Skills format: YAML front
|
|
4
|
+
* matter with a name and a description, then Markdown instructions.
|
|
5
|
+
*
|
|
6
|
+
* The schema describes the front matter plus `body`, the Markdown after it,
|
|
7
|
+
* and `id`, the skill's folder. Other front matter keys are allowed by the
|
|
8
|
+
* format and dropped here, as the old loader did.
|
|
9
|
+
*/
|
|
10
|
+
export const Skill = s.object({
|
|
11
|
+
/** The skill's folder name. Not checked against the id pattern, as before. */
|
|
12
|
+
id: s.string(),
|
|
13
|
+
name: s.string().min(1),
|
|
14
|
+
description: s.string().min(1),
|
|
15
|
+
/** The Markdown after the front matter, trimmed. */
|
|
16
|
+
body: s.string(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Halonic never runs a file under a skill's `scripts/` folder (HAL-188). The
|
|
3
|
+
* trust gate is the main control; this is the defence behind it, shared by
|
|
4
|
+
* every adapter that starts a program so they all refuse the same starts.
|
|
5
|
+
*/
|
|
6
|
+
import { type ProgramStart } from "../../shared/program-start.js";
|
|
7
|
+
/** Why a start was refused. */
|
|
8
|
+
export declare const skillScriptsRefusal = "Halonic never runs a file under a skill's scripts/ folder";
|
|
9
|
+
/**
|
|
10
|
+
* How to find where a path leads. Core has no file system, so an adapter
|
|
11
|
+
* passes Node's `resolve` (from `node:path`) and `realpath` (from
|
|
12
|
+
* `node:fs/promises`).
|
|
13
|
+
*/
|
|
14
|
+
export interface PathLookup {
|
|
15
|
+
/** The absolute path of `part`, read from `cwd`. */
|
|
16
|
+
resolve(cwd: string, part: string): string;
|
|
17
|
+
/** Where `path` really is, through symbolic links. Rejects when nothing is there. */
|
|
18
|
+
realpath(path: string): Promise<string>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether the folder a start begins in, or a path it names (the program,
|
|
22
|
+
* every path its arguments and `env` values name, read as
|
|
23
|
+
* {@link pathsNamedBy} reads them) points under a skill's `scripts/`
|
|
24
|
+
* folder: as written, resolved against `cwd`, or through symbolic links to
|
|
25
|
+
* where the file really is.
|
|
26
|
+
*/
|
|
27
|
+
export declare function touchesSkillScripts(start: ProgramStart, paths: PathLookup): Promise<boolean>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Halonic never runs a file under a skill's `scripts/` folder (HAL-188). The
|
|
3
|
+
* trust gate is the main control; this is the defence behind it, shared by
|
|
4
|
+
* every adapter that starts a program so they all refuse the same starts.
|
|
5
|
+
*/
|
|
6
|
+
import { pathsNamedBy } from "../../shared/program-start.js";
|
|
7
|
+
/** Why a start was refused. */
|
|
8
|
+
export const skillScriptsRefusal = "Halonic never runs a file under a skill's scripts/ folder";
|
|
9
|
+
/**
|
|
10
|
+
* A path with a `skills/<name>/scripts` part, in either slash style and any
|
|
11
|
+
* letter case, since macOS and Windows file systems ignore case. The part may
|
|
12
|
+
* also follow an `=`, as in `--file=skills/x/scripts/a.js`.
|
|
13
|
+
*/
|
|
14
|
+
const skillScripts = /(^|[\\/=])skills[\\/][^\\/]+[\\/]scripts([\\/]|$)/i;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the folder a start begins in, or a path it names (the program,
|
|
17
|
+
* every path its arguments and `env` values name, read as
|
|
18
|
+
* {@link pathsNamedBy} reads them) points under a skill's `scripts/`
|
|
19
|
+
* folder: as written, resolved against `cwd`, or through symbolic links to
|
|
20
|
+
* where the file really is.
|
|
21
|
+
*/
|
|
22
|
+
export async function touchesSkillScripts(start, paths) {
|
|
23
|
+
const parts = [start.cwd, ...pathsNamedBy(start).map((named) => named.path)];
|
|
24
|
+
for (const part of new Set(parts)) {
|
|
25
|
+
if (await pointsAtSkillScripts(start.cwd, part, paths))
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
async function pointsAtSkillScripts(cwd, part, paths) {
|
|
31
|
+
const path = paths.resolve(cwd, part);
|
|
32
|
+
if (skillScripts.test(part) || skillScripts.test(path))
|
|
33
|
+
return true;
|
|
34
|
+
// A part that isn't a file there (a bare name, a flag) has no link to follow.
|
|
35
|
+
const real = await paths.realpath(path).catch(() => path);
|
|
36
|
+
return skillScripts.test(real);
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FileKind } from "../../kind.js";
|
|
2
|
+
import { Workflow } from "./schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* `workflows/<id>.workflow.yaml`, at the root or in a hub. The rules between
|
|
5
|
+
* states (reachable, no dead ends, timers only on waits) are
|
|
6
|
+
* `@halonicjs/workflow`'s, which sits above this package.
|
|
7
|
+
*/
|
|
8
|
+
export declare const workflowKind: FileKind<Workflow>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Workflow } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* `workflows/<id>.workflow.yaml`, at the root or in a hub. The rules between
|
|
4
|
+
* states (reachable, no dead ends, timers only on waits) are
|
|
5
|
+
* `@halonicjs/workflow`'s, which sits above this package.
|
|
6
|
+
*/
|
|
7
|
+
export const workflowKind = {
|
|
8
|
+
name: "workflow",
|
|
9
|
+
about: "A workflow: a state machine of agent steps, waits, subflows and timers.",
|
|
10
|
+
syntax: "yaml",
|
|
11
|
+
schema: Workflow,
|
|
12
|
+
places: [{ scope: "workspace-and-hub", folder: "workflows", name: "<id>.workflow.yaml" }],
|
|
13
|
+
idFromPlace: "fallback",
|
|
14
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { Guard } from "../../shared/guard.js";
|
|
3
|
+
/** A move from one state to another, on an event, a condition or a timer. */
|
|
4
|
+
export declare const Transition: import("zod").ZodObject<{
|
|
5
|
+
to: import("zod").ZodString;
|
|
6
|
+
event: import("zod").ZodDefault<import("zod").ZodString>;
|
|
7
|
+
when: import("zod").ZodOptional<import("../../../../schema-kit/src/index.js").Schema<Guard>>;
|
|
8
|
+
after: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
10
|
+
}, import("zod/v4/core").$strict>;
|
|
11
|
+
/**
|
|
12
|
+
* task: run an agent. wait: wait for a person. final: end. workflow: run
|
|
13
|
+
* another workflow of the hub as one step. parallel: run several agents at
|
|
14
|
+
* once. foreach: run an agent or a workflow once per item of a list.
|
|
15
|
+
*/
|
|
16
|
+
export declare const StateType: import("zod").ZodEnum<{
|
|
17
|
+
final: "final";
|
|
18
|
+
foreach: "foreach";
|
|
19
|
+
parallel: "parallel";
|
|
20
|
+
task: "task";
|
|
21
|
+
wait: "wait";
|
|
22
|
+
workflow: "workflow";
|
|
23
|
+
}>;
|
|
24
|
+
/** One branch of a parallel state: an agent and its prompt or method. */
|
|
25
|
+
export declare const Branch: import("zod").ZodObject<{
|
|
26
|
+
agent: import("zod").ZodString;
|
|
27
|
+
input: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
28
|
+
method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
with: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
30
|
+
}, import("zod/v4/core").$strict>;
|
|
31
|
+
/** One state of a workflow. Which keys apply depends on its type. */
|
|
32
|
+
export declare const WorkflowState: import("zod").ZodObject<{
|
|
33
|
+
type: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
34
|
+
final: "final";
|
|
35
|
+
foreach: "foreach";
|
|
36
|
+
parallel: "parallel";
|
|
37
|
+
task: "task";
|
|
38
|
+
wait: "wait";
|
|
39
|
+
workflow: "workflow";
|
|
40
|
+
}>>;
|
|
41
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
agent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
workflow: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
|
+
input: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
45
|
+
gets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
46
|
+
output: import("zod").ZodOptional<import("zod").ZodString>;
|
|
47
|
+
conversation: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
format: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
49
|
+
json: "json";
|
|
50
|
+
text: "text";
|
|
51
|
+
}>>;
|
|
52
|
+
signal: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
53
|
+
name: import("zod").ZodString;
|
|
54
|
+
data: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
55
|
+
}, import("zod/v4/core").$strict>>;
|
|
56
|
+
method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
57
|
+
with: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
58
|
+
items: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
as: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
concurrency: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
61
|
+
branches: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
62
|
+
agent: import("zod").ZodString;
|
|
63
|
+
input: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
64
|
+
method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
with: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
66
|
+
}, import("zod/v4/core").$strict>>>;
|
|
67
|
+
join: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
68
|
+
all: "all";
|
|
69
|
+
any: "any";
|
|
70
|
+
}>>;
|
|
71
|
+
continueOnError: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
72
|
+
artifact: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
73
|
+
name: import("zod").ZodString;
|
|
74
|
+
mediaType: import("zod").ZodDefault<import("zod").ZodString>;
|
|
75
|
+
}, import("zod/v4/core").$strict>>;
|
|
76
|
+
on: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
77
|
+
to: import("zod").ZodString;
|
|
78
|
+
event: import("zod").ZodDefault<import("zod").ZodString>;
|
|
79
|
+
when: import("zod").ZodOptional<import("../../../../schema-kit/src/index.js").Schema<Guard>>;
|
|
80
|
+
after: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
82
|
+
}, import("zod/v4/core").$strict>>>;
|
|
83
|
+
}, import("zod/v4/core").$strict>;
|
|
84
|
+
/** `workflows/<id>.workflow.yaml`: a state machine of agent steps, waits and subflows. */
|
|
85
|
+
export declare const Workflow: import("zod").ZodObject<{
|
|
86
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
87
|
+
id: import("zod").ZodString;
|
|
88
|
+
name: import("zod").ZodString;
|
|
89
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
90
|
+
initial: import("zod").ZodString;
|
|
91
|
+
context: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
92
|
+
start: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
93
|
+
label: import("zod").ZodString;
|
|
94
|
+
field: import("zod").ZodString;
|
|
95
|
+
}, import("zod/v4/core").$strict>>;
|
|
96
|
+
states: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
97
|
+
type: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
98
|
+
final: "final";
|
|
99
|
+
foreach: "foreach";
|
|
100
|
+
parallel: "parallel";
|
|
101
|
+
task: "task";
|
|
102
|
+
wait: "wait";
|
|
103
|
+
workflow: "workflow";
|
|
104
|
+
}>>;
|
|
105
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
106
|
+
agent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
107
|
+
workflow: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
input: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
109
|
+
gets: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
110
|
+
output: import("zod").ZodOptional<import("zod").ZodString>;
|
|
111
|
+
conversation: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
format: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
113
|
+
json: "json";
|
|
114
|
+
text: "text";
|
|
115
|
+
}>>;
|
|
116
|
+
signal: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
117
|
+
name: import("zod").ZodString;
|
|
118
|
+
data: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
119
|
+
}, import("zod/v4/core").$strict>>;
|
|
120
|
+
method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
121
|
+
with: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
122
|
+
items: import("zod").ZodOptional<import("zod").ZodString>;
|
|
123
|
+
as: import("zod").ZodOptional<import("zod").ZodString>;
|
|
124
|
+
concurrency: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
125
|
+
branches: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
126
|
+
agent: import("zod").ZodString;
|
|
127
|
+
input: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
128
|
+
method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
129
|
+
with: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
130
|
+
}, import("zod/v4/core").$strict>>>;
|
|
131
|
+
join: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
132
|
+
all: "all";
|
|
133
|
+
any: "any";
|
|
134
|
+
}>>;
|
|
135
|
+
continueOnError: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
136
|
+
artifact: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
137
|
+
name: import("zod").ZodString;
|
|
138
|
+
mediaType: import("zod").ZodDefault<import("zod").ZodString>;
|
|
139
|
+
}, import("zod/v4/core").$strict>>;
|
|
140
|
+
on: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
141
|
+
to: import("zod").ZodString;
|
|
142
|
+
event: import("zod").ZodDefault<import("zod").ZodString>;
|
|
143
|
+
when: import("zod").ZodOptional<import("../../../../schema-kit/src/index.js").Schema<Guard>>;
|
|
144
|
+
after: import("zod").ZodOptional<import("zod").ZodString>;
|
|
145
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
146
|
+
}, import("zod/v4/core").$strict>>>;
|
|
147
|
+
}, import("zod/v4/core").$strict>>;
|
|
148
|
+
layout: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
149
|
+
x: import("zod").ZodNumber;
|
|
150
|
+
y: import("zod").ZodNumber;
|
|
151
|
+
}, import("zod/v4/core").$strip>>>;
|
|
152
|
+
}, import("zod/v4/core").$strict>;
|
|
153
|
+
/** A workflow, with defaults filled in. */
|
|
154
|
+
export type Workflow = Infer<typeof Workflow>;
|
|
155
|
+
/** One state of a workflow. */
|
|
156
|
+
export type WorkflowState = Infer<typeof WorkflowState>;
|
|
157
|
+
/** A transition between states. */
|
|
158
|
+
export type Transition = Infer<typeof Transition>;
|
|
159
|
+
/** One branch of a parallel state. */
|
|
160
|
+
export type Branch = Infer<typeof Branch>;
|
|
161
|
+
/** The type of a workflow state. */
|
|
162
|
+
export type StateType = Infer<typeof StateType>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { DURATION_PATTERN, id, version } from "../../shared/fields.js";
|
|
3
|
+
import { Guard } from "../../shared/guard.js";
|
|
4
|
+
/** A move from one state to another, on an event, a condition or a timer. */
|
|
5
|
+
export const Transition = s
|
|
6
|
+
.object({
|
|
7
|
+
to: id,
|
|
8
|
+
/** The event that triggers it. "done" (the default) fires when the state's work finishes. */
|
|
9
|
+
event: s.string().default("done"),
|
|
10
|
+
when: Guard.optional(),
|
|
11
|
+
/** Wait states only: fire this long after the state was entered ("30m", "4h", "2d"). */
|
|
12
|
+
after: s
|
|
13
|
+
.string()
|
|
14
|
+
.regex(DURATION_PATTERN, 'use a number and a unit, e.g. "30m", "4h", "2d"')
|
|
15
|
+
.optional(),
|
|
16
|
+
label: s.string().optional(),
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
19
|
+
/**
|
|
20
|
+
* task: run an agent. wait: wait for a person. final: end. workflow: run
|
|
21
|
+
* another workflow of the hub as one step. parallel: run several agents at
|
|
22
|
+
* once. foreach: run an agent or a workflow once per item of a list.
|
|
23
|
+
*/
|
|
24
|
+
export const StateType = s.enum(["task", "wait", "final", "workflow", "parallel", "foreach"]);
|
|
25
|
+
const prompt = () => s.union([s.string(), s.record(s.string(), s.unknown())]);
|
|
26
|
+
/** One branch of a parallel state: an agent and its prompt or method. */
|
|
27
|
+
export const Branch = s
|
|
28
|
+
.object({
|
|
29
|
+
agent: s.string(),
|
|
30
|
+
input: prompt().optional(),
|
|
31
|
+
method: s.string().optional(),
|
|
32
|
+
with: s.record(s.string(), s.unknown()).optional(),
|
|
33
|
+
})
|
|
34
|
+
.strict();
|
|
35
|
+
/** One state of a workflow. Which keys apply depends on its type. */
|
|
36
|
+
export const WorkflowState = s
|
|
37
|
+
.object({
|
|
38
|
+
type: StateType.default("task"),
|
|
39
|
+
description: s.string().optional(),
|
|
40
|
+
/** Task states: the agent to run on entry. */
|
|
41
|
+
agent: s.string().optional(),
|
|
42
|
+
/** Workflow states: a workflow id of the same hub. */
|
|
43
|
+
workflow: s.string().optional(),
|
|
44
|
+
/** Agent states: the prompt template. Workflow states: the child's input. */
|
|
45
|
+
input: prompt().optional(),
|
|
46
|
+
/** Task states: the data the agent gets after the prompt, such as [input.message]. */
|
|
47
|
+
gets: s
|
|
48
|
+
.array(s
|
|
49
|
+
.string()
|
|
50
|
+
.regex(/^(input|context)\.[^.\s]+(\.[^.\s]+)*$/, 'use "input.<name>" or "context.<name>"'))
|
|
51
|
+
.optional(),
|
|
52
|
+
/** The context key the output is written to. */
|
|
53
|
+
output: s.string().optional(),
|
|
54
|
+
/** Task states: a context key that keeps the conversation across turns. */
|
|
55
|
+
conversation: s.string().optional(),
|
|
56
|
+
/** Task states: the reply format for this step, instead of the agent's own. */
|
|
57
|
+
format: s.enum(["text", "json"]).optional(),
|
|
58
|
+
/** After this step: a signal routines can start on. */
|
|
59
|
+
signal: s
|
|
60
|
+
.object({ name: s.string().min(1), data: s.record(s.string(), s.unknown()).default({}) })
|
|
61
|
+
.strict()
|
|
62
|
+
.optional(),
|
|
63
|
+
/** Task states: call this method of the agent. */
|
|
64
|
+
method: id.optional(),
|
|
65
|
+
/** The method's arguments, as templates. */
|
|
66
|
+
with: s.record(s.string(), s.unknown()).optional(),
|
|
67
|
+
/** For-each states: the list to go through, a template such as "{{context.emails}}". */
|
|
68
|
+
items: s.string().optional(),
|
|
69
|
+
/** For-each states: the current item's name in templates (default "item"). */
|
|
70
|
+
as: id.optional(),
|
|
71
|
+
/** For-each states: how many items run at the same time (default 1, in order). */
|
|
72
|
+
concurrency: s.number().int().min(1).max(16).optional(),
|
|
73
|
+
/** Parallel states: branches by name. */
|
|
74
|
+
branches: s.record(id, Branch).optional(),
|
|
75
|
+
/** Parallel states: "all" (default) needs every branch to succeed, "any" one. */
|
|
76
|
+
join: s.enum(["all", "any"]).optional(),
|
|
77
|
+
/** Parallel states with join "all": a failed branch gives { error } instead of failing. */
|
|
78
|
+
continueOnError: s.boolean().optional(),
|
|
79
|
+
/** Save the agent's output as an artifact. */
|
|
80
|
+
artifact: s
|
|
81
|
+
.object({ name: s.string(), mediaType: s.string().default("text/markdown") })
|
|
82
|
+
.strict()
|
|
83
|
+
.optional(),
|
|
84
|
+
on: s.array(Transition).default([]),
|
|
85
|
+
})
|
|
86
|
+
.strict();
|
|
87
|
+
/** `workflows/<id>.workflow.yaml`: a state machine of agent steps, waits and subflows. */
|
|
88
|
+
export const Workflow = s
|
|
89
|
+
.object({
|
|
90
|
+
version,
|
|
91
|
+
id,
|
|
92
|
+
name: s.string().min(1),
|
|
93
|
+
description: s.string().optional(),
|
|
94
|
+
initial: id,
|
|
95
|
+
/** Initial context values. */
|
|
96
|
+
context: s.record(s.string(), s.unknown()).default({}),
|
|
97
|
+
/** Offer this workflow in the Inbox as a request: the typed text becomes input[field]. */
|
|
98
|
+
start: s
|
|
99
|
+
.object({ label: s.string().min(1), field: s.string().min(1) })
|
|
100
|
+
.strict()
|
|
101
|
+
.optional(),
|
|
102
|
+
states: s.record(s.string(), WorkflowState),
|
|
103
|
+
/** Editor-only node positions; engines ignore them. */
|
|
104
|
+
layout: s.record(s.string(), s.object({ x: s.number(), y: s.number() })).default({}),
|
|
105
|
+
})
|
|
106
|
+
.strict();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { renameKey } from "../../shared/legacy-keys.js";
|
|
2
|
+
import { WorkflowTest } from "./schema.js";
|
|
3
|
+
/** `workflows/<workflow>.test.yaml`, next to the workflow it tests. */
|
|
4
|
+
export const workflowTestKind = {
|
|
5
|
+
name: "workflowTest",
|
|
6
|
+
about: "Test cases for a workflow, run on scripted model replies.",
|
|
7
|
+
syntax: "yaml",
|
|
8
|
+
schema: WorkflowTest,
|
|
9
|
+
places: [{ scope: "workspace-and-hub", folder: "workflows", name: "<id>.test.yaml" }],
|
|
10
|
+
// The test names its workflow in `workflow`; it has no id of its own.
|
|
11
|
+
idFromPlace: "none",
|
|
12
|
+
// Workflows were called flows: `flow:` still names the workflow.
|
|
13
|
+
upgradeKeys: (data) => renameKey(data, "flow", "workflow"),
|
|
14
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** One test case: the input, the scripted replies, the events and what to expect. */
|
|
3
|
+
export declare const WorkflowTestCase: import("zod").ZodObject<{
|
|
4
|
+
name: import("zod").ZodString;
|
|
5
|
+
input: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
6
|
+
mocks: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
7
|
+
events: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
8
|
+
advance: import("zod").ZodString;
|
|
9
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
10
|
+
event: import("zod").ZodString;
|
|
11
|
+
payload: import("zod").ZodUnknown;
|
|
12
|
+
}, import("zod/v4/core").$strict>]>>>;
|
|
13
|
+
tools: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
14
|
+
programs: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
15
|
+
output: import("zod").ZodUnknown;
|
|
16
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
17
|
+
fails: import("zod").ZodString;
|
|
18
|
+
}, import("zod/v4/core").$strict>]>>>>;
|
|
19
|
+
expect: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
20
|
+
states: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
21
|
+
final: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
23
|
+
completed: "completed";
|
|
24
|
+
failed: "failed";
|
|
25
|
+
waiting: "waiting";
|
|
26
|
+
}>>;
|
|
27
|
+
context: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
28
|
+
artifacts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
29
|
+
}, import("zod/v4/core").$strict>>;
|
|
30
|
+
}, import("zod/v4/core").$strict>;
|
|
31
|
+
/** `workflows/<workflow>.test.yaml`: test cases for one workflow, run on scripted models. */
|
|
32
|
+
export declare const WorkflowTest: import("zod").ZodObject<{
|
|
33
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
34
|
+
workflow: import("zod").ZodString;
|
|
35
|
+
cases: import("zod").ZodArray<import("zod").ZodObject<{
|
|
36
|
+
name: import("zod").ZodString;
|
|
37
|
+
input: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
38
|
+
mocks: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
39
|
+
events: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
40
|
+
advance: import("zod").ZodString;
|
|
41
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
42
|
+
event: import("zod").ZodString;
|
|
43
|
+
payload: import("zod").ZodUnknown;
|
|
44
|
+
}, import("zod/v4/core").$strict>]>>>;
|
|
45
|
+
tools: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
46
|
+
programs: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
47
|
+
output: import("zod").ZodUnknown;
|
|
48
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
49
|
+
fails: import("zod").ZodString;
|
|
50
|
+
}, import("zod/v4/core").$strict>]>>>>;
|
|
51
|
+
expect: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
52
|
+
states: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
53
|
+
final: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
55
|
+
completed: "completed";
|
|
56
|
+
failed: "failed";
|
|
57
|
+
waiting: "waiting";
|
|
58
|
+
}>>;
|
|
59
|
+
context: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
60
|
+
artifacts: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
61
|
+
}, import("zod/v4/core").$strict>>;
|
|
62
|
+
}, import("zod/v4/core").$strict>>;
|
|
63
|
+
}, import("zod/v4/core").$strict>;
|
|
64
|
+
/** A workflow test file, with defaults filled in. */
|
|
65
|
+
export type WorkflowTest = Infer<typeof WorkflowTest>;
|
|
66
|
+
/** One case of a workflow test. */
|
|
67
|
+
export type WorkflowTestCase = Infer<typeof WorkflowTestCase>;
|