@halonicjs/testing 0.0.0 → 0.1.1
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 +5 -0
- package/README.md +41 -1
- package/dist/adapters/http-kit/src/address-checking.d.ts +19 -0
- package/dist/adapters/http-kit/src/address-checking.js +1 -0
- 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 +3 -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/auth-placement.d.ts +40 -0
- package/dist/adapters/integration-kit/src/auth-placement.js +102 -0
- package/dist/adapters/integration-kit/src/current-secret-forms.d.ts +28 -0
- package/dist/adapters/integration-kit/src/current-secret-forms.js +60 -0
- package/dist/adapters/integration-kit/src/declaration.d.ts +15 -0
- package/dist/adapters/integration-kit/src/declaration.js +78 -0
- package/dist/adapters/integration-kit/src/host.d.ts +34 -0
- package/dist/adapters/integration-kit/src/host.js +31 -0
- package/dist/adapters/integration-kit/src/index.d.ts +16 -0
- package/dist/adapters/integration-kit/src/index.js +22 -0
- package/dist/adapters/integration-kit/src/leak-attempt.d.ts +16 -0
- package/dist/adapters/integration-kit/src/leak-attempt.js +19 -0
- package/dist/adapters/integration-kit/src/limited-http.d.ts +55 -0
- package/dist/adapters/integration-kit/src/limited-http.js +225 -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 +131 -0
- package/dist/adapters/integration-kit/src/loader.js +251 -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 +83 -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 +27 -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 +220 -0
- package/dist/adapters/integration-kit/src/secret-in-request.d.ts +62 -0
- package/dist/adapters/integration-kit/src/secret-in-request.js +139 -0
- package/dist/adapters/integration-kit/src/secret-placement.d.ts +46 -0
- package/dist/adapters/integration-kit/src/secret-placement.js +160 -0
- package/dist/adapters/integration-kit/src/sign-in-placement.d.ts +29 -0
- package/dist/adapters/integration-kit/src/sign-in-placement.js +92 -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/blocked-sites.d.ts +57 -0
- package/dist/core/events/src/blocked-sites.js +89 -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 +17 -0
- package/dist/core/events/src/index.js +10 -0
- package/dist/core/events/src/run-basics.d.ts +228 -0
- package/dist/core/events/src/run-basics.js +1 -0
- package/dist/core/events/src/run-event.d.ts +478 -0
- package/dist/core/events/src/run-event.js +1 -0
- package/dist/core/events/src/run-reads.d.ts +25 -0
- package/dist/core/events/src/run-reads.js +44 -0
- package/dist/core/events/src/run-sends.d.ts +47 -0
- package/dist/core/events/src/run-sends.js +68 -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 +192 -0
- package/dist/core/events/src/timeline-entry.d.ts +21 -0
- package/dist/core/events/src/timeline-entry.js +106 -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 +39 -0
- package/dist/core/format/src/index.js +25 -0
- package/dist/core/format/src/integration/index.d.ts +7 -0
- package/dist/core/format/src/integration/index.js +10 -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 +99 -0
- package/dist/core/format/src/kinds/agent/sandbox-fields.js +216 -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 +218 -0
- package/dist/core/format/src/kinds/connector/schema.d.ts +74 -0
- package/dist/core/format/src/kinds/connector/schema.js +143 -0
- package/dist/core/format/src/kinds/deployments/kind.d.ts +4 -0
- package/dist/core/format/src/kinds/deployments/kind.js +49 -0
- package/dist/core/format/src/kinds/deployments/schema.d.ts +77 -0
- package/dist/core/format/src/kinds/deployments/schema.js +94 -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/approved-sign-ins.d.ts +62 -0
- package/dist/core/format/src/kinds/integration/approved-sign-ins.js +125 -0
- package/dist/core/format/src/kinds/integration/host-key.d.ts +7 -0
- package/dist/core/format/src/kinds/integration/host-key.js +8 -0
- package/dist/core/format/src/kinds/integration/kind.d.ts +18 -0
- package/dist/core/format/src/kinds/integration/kind.js +175 -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 +112 -0
- package/dist/core/format/src/kinds/integration/policy.js +327 -0
- package/dist/core/format/src/kinds/integration/schema.d.ts +410 -0
- package/dist/core/format/src/kinds/integration/schema.js +359 -0
- package/dist/core/format/src/kinds/integration/sign-in-checks.d.ts +13 -0
- package/dist/core/format/src/kinds/integration/sign-in-checks.js +120 -0
- package/dist/core/format/src/kinds/integration/sign-in-urls.d.ts +19 -0
- package/dist/core/format/src/kinds/integration/sign-in-urls.js +47 -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 +137 -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 +672 -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 +85 -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 +62 -0
- package/dist/core/format/src/kinds/routine/schema.d.ts +94 -0
- package/dist/core/format/src/kinds/routine/schema.js +115 -0
- package/dist/core/format/src/kinds/routine/webhook-headers.d.ts +9 -0
- package/dist/core/format/src/kinds/routine/webhook-headers.js +26 -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 +34 -0
- package/dist/core/format/src/shared/fields.js +74 -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/agent-runs-not-available.d.ts +21 -0
- package/dist/core/ports/src/agent-runs-not-available.js +25 -0
- package/dist/core/ports/src/blob-store.d.ts +45 -0
- package/dist/core/ports/src/blob-store.js +24 -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 +303 -0
- package/dist/core/ports/src/connector-client.js +19 -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 +229 -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 +198 -0
- package/dist/core/ports/src/harness-bridge-server.js +37 -0
- package/dist/core/ports/src/harness-sign-in-command.d.ts +27 -0
- package/dist/core/ports/src/harness-sign-in-command.js +31 -0
- package/dist/core/ports/src/harness.d.ts +283 -0
- package/dist/core/ports/src/harness.js +45 -0
- package/dist/core/ports/src/host-settings-store.d.ts +116 -0
- package/dist/core/ports/src/host-settings-store.js +106 -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 +45 -0
- package/dist/core/ports/src/index.js +44 -0
- package/dist/core/ports/src/instruction-trust-store.d.ts +81 -0
- package/dist/core/ports/src/instruction-trust-store.js +43 -0
- package/dist/core/ports/src/integration.d.ts +242 -0
- package/dist/core/ports/src/integration.js +31 -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 +186 -0
- package/dist/core/ports/src/llm-provider.js +139 -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 +63 -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 +47 -0
- package/dist/core/ports/src/port-versions.js +80 -0
- package/dist/core/ports/src/program-probe.d.ts +69 -0
- package/dist/core/ports/src/program-probe.js +2 -0
- package/dist/core/ports/src/provider-default-base-url.d.ts +10 -0
- package/dist/core/ports/src/provider-default-base-url.js +18 -0
- package/dist/core/ports/src/record-store.d.ts +79 -0
- package/dist/core/ports/src/record-store.js +108 -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 +303 -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/run-target-not-found.d.ts +34 -0
- package/dist/core/ports/src/run-target-not-found.js +41 -0
- package/dist/core/ports/src/sandbox-setting-store.d.ts +68 -0
- package/dist/core/ports/src/sandbox-setting-store.js +33 -0
- package/dist/core/ports/src/sandbox.d.ts +364 -0
- package/dist/core/ports/src/sandbox.js +70 -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 +201 -0
- package/dist/core/ports/src/secrets.js +200 -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 +253 -0
- package/dist/core/ports/src/tool-approval-store.js +116 -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-status.d.ts +8 -0
- package/dist/core/ports/src/vcs-status.js +90 -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/amount.d.ts +13 -0
- package/dist/core/std/src/amount.js +22 -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/hidden-characters.d.ts +19 -0
- package/dist/core/std/src/hidden-characters.js +54 -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 +30 -0
- package/dist/core/std/src/index.js +31 -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/public-suffixes.generated.d.ts +9 -0
- package/dist/core/std/src/public-suffixes.generated.js +10429 -0
- package/dist/core/std/src/registrable-domain.d.ts +10 -0
- package/dist/core/std/src/registrable-domain.js +62 -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/secret-variable-name.d.ts +12 -0
- package/dist/core/std/src/secret-variable-name.js +34 -0
- package/dist/core/std/src/site-name.d.ts +35 -0
- package/dist/core/std/src/site-name.js +111 -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/url-host.d.ts +35 -0
- package/dist/core/std/src/url-host.js +170 -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 +47 -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,216 @@
|
|
|
1
|
+
// The agent fields that say how a harness agent runs: which program, the one
|
|
2
|
+
// folder it writes to and the sites it may reach (requirement
|
|
3
|
+
// format.agent-sandbox-fields). They decide what a program on the person's
|
|
4
|
+
// computer can touch, so the checks refuse anything that could reach past
|
|
5
|
+
// the workspace or past the named sites.
|
|
6
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
7
|
+
import { asciiHost, posixPath } from "../../../../std/src/index.js";
|
|
8
|
+
import { foldName, relativePathProblem } from "../../shared/relative-path.js";
|
|
9
|
+
/**
|
|
10
|
+
* The harnesses an agent can run in: Halonic's own loop, Claude Code or
|
|
11
|
+
* Codex. A closed list, so a typo fails `halonic validate`; each new harness
|
|
12
|
+
* adds a value here.
|
|
13
|
+
*/
|
|
14
|
+
export const AgentHarness = s.enum(["halonic", "claude-code", "codex"]);
|
|
15
|
+
/** The ids of the harnesses an agent can run in, for a caller that checks one outside an agent's file. */
|
|
16
|
+
export const AGENT_HARNESSES = AgentHarness.options;
|
|
17
|
+
/** The most sites one agent may name (Julian's cap, HAL-1708). */
|
|
18
|
+
export const MAX_ALLOWED_SITES = 50;
|
|
19
|
+
/**
|
|
20
|
+
* The first parts of a workspace path that hold definition files or data
|
|
21
|
+
* that isn't the agent's to write: git's own folder, Halonic's reserved
|
|
22
|
+
* folder, every kind's folder, the hubs and the kind files in the workspace
|
|
23
|
+
* root. A test checks that every kind's place is covered, so a new kind
|
|
24
|
+
* can't be missed. They are compared after {@link foldName}.
|
|
25
|
+
*/
|
|
26
|
+
export const PROTECTED_TOP_NAMES = [
|
|
27
|
+
".git",
|
|
28
|
+
".halonic",
|
|
29
|
+
"agents",
|
|
30
|
+
"deployments.yaml",
|
|
31
|
+
"hub.yaml",
|
|
32
|
+
"hubs",
|
|
33
|
+
"library",
|
|
34
|
+
"models.yaml",
|
|
35
|
+
"providers",
|
|
36
|
+
"runtimes",
|
|
37
|
+
"workflows",
|
|
38
|
+
"workspace.yaml",
|
|
39
|
+
];
|
|
40
|
+
/**
|
|
41
|
+
* The working folder an agent gets when its file names none.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* defaultWorkingFolder("writer"); // "files/agents/writer"
|
|
45
|
+
*/
|
|
46
|
+
export function defaultWorkingFolder(agentId) {
|
|
47
|
+
return `files/agents/${agentId}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Why a working folder can't be used, or `null` when it can. It must be a
|
|
51
|
+
* path relative to the workspace with `/` between its parts, that stays in
|
|
52
|
+
* the workspace and doesn't point into a {@link PROTECTED_TOP_NAMES} entry
|
|
53
|
+
* or, at any depth, a folder whose name starts with `.`: tools such as git,
|
|
54
|
+
* Claude Code, Codex and editors read hooks, commands and tasks from those
|
|
55
|
+
* (`.git`, `.claude`, `.codex`, `.vscode`), and would run them outside the
|
|
56
|
+
* sandbox. Any depth, because a nested clone such as `vendor/lib` has a
|
|
57
|
+
* `.git` of its own (HAL-5951). Parts that Windows or macOS would read as
|
|
58
|
+
* another name are refused too, in fullwidth forms as well (see
|
|
59
|
+
* {@link relativePathProblem}). Symlinks are resolved later, when the
|
|
60
|
+
* sandbox profile is built.
|
|
61
|
+
*
|
|
62
|
+
* @param path - the `workingFolder` value
|
|
63
|
+
* @returns a message, or `null`
|
|
64
|
+
*/
|
|
65
|
+
export function workingFolderProblem(path) {
|
|
66
|
+
const pathProblem = relativePathProblem(path, { root: "the workspace", part: "folder name" });
|
|
67
|
+
if (pathProblem !== null)
|
|
68
|
+
return pathProblem;
|
|
69
|
+
const shownParts = path.split("/");
|
|
70
|
+
const parts = foldName(path).split("/");
|
|
71
|
+
if (PROTECTED_TOP_NAMES.includes(parts[0] ?? "")) {
|
|
72
|
+
return `The agent can't write in '${shownParts[0]}': it holds definitions or Halonic's own data`;
|
|
73
|
+
}
|
|
74
|
+
const dotPart = parts.findIndex((part) => part.startsWith("."));
|
|
75
|
+
if (dotPart !== -1) {
|
|
76
|
+
const shown = shownParts.slice(0, dotPart + 1).join("/");
|
|
77
|
+
return `The agent can't write in '${shown}': tools read settings and hooks from folders that start with '.'`;
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether a workspace path is a working folder or inside it, as a file
|
|
83
|
+
* system that ignores case sees it. Both are relative to the workspace root.
|
|
84
|
+
* `path` may be written loosely, as a program's folder or argument is: with
|
|
85
|
+
* `\`, `.` or `..` parts, or a part that ends in `.` or a space, which
|
|
86
|
+
* Windows drops. An absolute path, or one that leaves the workspace, is
|
|
87
|
+
* never inside: who checks those must know where the workspace is.
|
|
88
|
+
*
|
|
89
|
+
* @param path - a path relative to the workspace root
|
|
90
|
+
* @param workingFolder - a `workingFolder` that passed {@link workingFolderProblem}
|
|
91
|
+
* @returns `true` when the path is the folder or inside it
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* isInWorkingFolder("Scripts\\mail.sh", "scripts"); // true
|
|
95
|
+
* isInWorkingFolder("scripts-old/mail.sh", "scripts"); // false
|
|
96
|
+
*/
|
|
97
|
+
export function isInWorkingFolder(path, workingFolder) {
|
|
98
|
+
const parts = comparableParts(path);
|
|
99
|
+
const folder = comparableParts(workingFolder);
|
|
100
|
+
if (parts === null || folder === null || parts.length < folder.length)
|
|
101
|
+
return false;
|
|
102
|
+
return folder.every((part, index) => parts[index] === part);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The parts of a relative path as a file system that ignores case reads
|
|
106
|
+
* them, or `null` for an absolute path or one that leaves the workspace.
|
|
107
|
+
*/
|
|
108
|
+
function comparableParts(path) {
|
|
109
|
+
const slashed = foldName(path).replaceAll("\\", "/");
|
|
110
|
+
if (slashed.startsWith("/") || /^[a-z]:/.test(slashed))
|
|
111
|
+
return null;
|
|
112
|
+
const normalized = posixPath.normalize(slashed.split("/").map(windowsName).join("/"));
|
|
113
|
+
if (normalized === ".." || normalized.startsWith("../"))
|
|
114
|
+
return null;
|
|
115
|
+
return normalized.split("/").filter((part) => part !== "" && part !== ".");
|
|
116
|
+
}
|
|
117
|
+
/** A part as Windows reads it: without trailing dots and spaces, so `scripts.` is `scripts`. */
|
|
118
|
+
function windowsName(part) {
|
|
119
|
+
const trimmed = part.replace(/[. ]+$/, "");
|
|
120
|
+
return part === "." || part === ".." || trimmed === "" ? part : trimmed;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The last labels that name this computer or the local network, not a site
|
|
124
|
+
* on the internet.
|
|
125
|
+
*/
|
|
126
|
+
const LOCAL_TOP_LABELS = [
|
|
127
|
+
"arpa",
|
|
128
|
+
"internal",
|
|
129
|
+
"local",
|
|
130
|
+
"localdomain",
|
|
131
|
+
"localhost",
|
|
132
|
+
];
|
|
133
|
+
/**
|
|
134
|
+
* Why an allowed site can't be used, or `null` when it can. A site is a host
|
|
135
|
+
* name with at least two labels, such as `api.example.com`, or `*.` and a
|
|
136
|
+
* domain with at least two labels, such as `*.example.com`. No address in any
|
|
137
|
+
* notation (a last label starting with a digit, so `127.0x1` too), port,
|
|
138
|
+
* scheme or path, no bare `*`, and no `localhost`, `local`, `localdomain`,
|
|
139
|
+
* `internal` or `arpa` names, which would reach this computer or the local
|
|
140
|
+
* network. Fullwidth forms, ideographic dots, control characters and
|
|
141
|
+
* invisible code points are refused, since a URL parser would map them to
|
|
142
|
+
* another name.
|
|
143
|
+
*
|
|
144
|
+
* @param site - an `allowedSites` entry, in any case and in Unicode or ASCII
|
|
145
|
+
* @returns a message, or `null`
|
|
146
|
+
*/
|
|
147
|
+
export function allowedSiteProblem(site) {
|
|
148
|
+
if (/[\p{Cc}\p{Default_Ignorable_Code_Point}\u3002]/u.test(site) ||
|
|
149
|
+
site.normalize("NFKC") !== site.normalize("NFC")) {
|
|
150
|
+
return "Write the host name in plain characters, without fullwidth forms or invisible characters";
|
|
151
|
+
}
|
|
152
|
+
const host = asciiHost(site);
|
|
153
|
+
const wildcard = host.startsWith("*.");
|
|
154
|
+
const name = wildcard ? host.slice(2) : host;
|
|
155
|
+
if (host === "*")
|
|
156
|
+
return "Name a domain after '*.', such as '*.example.com'";
|
|
157
|
+
if (/[:/@?#\s[\]]/.test(name) || name.includes("*")) {
|
|
158
|
+
return "Write only a host name, such as 'api.example.com', without a scheme, port or path";
|
|
159
|
+
}
|
|
160
|
+
const labels = name.split(".");
|
|
161
|
+
if (!labels.every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label))) {
|
|
162
|
+
return "Use a host name of letters, digits, '-' and '.'";
|
|
163
|
+
}
|
|
164
|
+
if (name.length > 253)
|
|
165
|
+
return "Use a host name of at most 253 characters";
|
|
166
|
+
const last = labels.at(-1) ?? "";
|
|
167
|
+
if (/^\d/.test(last))
|
|
168
|
+
return "Use a host name, not an address";
|
|
169
|
+
if (labels.length < 2) {
|
|
170
|
+
return wildcard
|
|
171
|
+
? "Name at least two labels after '*.', such as '*.example.com'"
|
|
172
|
+
: "Use a full host name, such as 'api.example.com'";
|
|
173
|
+
}
|
|
174
|
+
if (LOCAL_TOP_LABELS.includes(last)) {
|
|
175
|
+
return `A '.${last}' name would reach this computer or the local network`;
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The allowed sites in the form the sandbox and the trust prompt use:
|
|
181
|
+
* lowercase, in ASCII (Punycode) and each once, in the order first named.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* asciiAllowedSites(["API.Example.com", "bücher.example", "api.example.com"]);
|
|
185
|
+
* // => ["api.example.com", "xn--bcher-kva.example"]
|
|
186
|
+
*/
|
|
187
|
+
export function asciiAllowedSites(sites) {
|
|
188
|
+
return [...new Set(sites.map(asciiHost))];
|
|
189
|
+
}
|
|
190
|
+
/** The `workingFolder` field: a folder in the workspace the agent may write to. */
|
|
191
|
+
export const WorkingFolder = s.string().superRefine((path, context) => {
|
|
192
|
+
const problem = workingFolderProblem(path);
|
|
193
|
+
if (problem !== null)
|
|
194
|
+
context.addIssue({ code: "custom", message: problem });
|
|
195
|
+
});
|
|
196
|
+
/** One `allowedSites` entry: a host name, or `*.` and a domain. */
|
|
197
|
+
export const AllowedSite = s.string().superRefine((site, context) => {
|
|
198
|
+
const problem = allowedSiteProblem(site);
|
|
199
|
+
if (problem !== null)
|
|
200
|
+
context.addIssue({ code: "custom", message: problem });
|
|
201
|
+
});
|
|
202
|
+
/**
|
|
203
|
+
* A list of {@link AllowedSite}s, at most {@link MAX_ALLOWED_SITES}, for a
|
|
204
|
+
* field inside a union, such as a connector's `transport`. The cap is a
|
|
205
|
+
* refinement rather than `max`, because a union reports a list that's too
|
|
206
|
+
* long only as its whole input being wrong, not at the list. The JSON
|
|
207
|
+
* Schema still shows the cap as `maxItems`, so editors know it too.
|
|
208
|
+
*/
|
|
209
|
+
export const AllowedSitesInUnion = s
|
|
210
|
+
.array(AllowedSite)
|
|
211
|
+
.superRefine((sites, context) => {
|
|
212
|
+
if (sites.length > MAX_ALLOWED_SITES) {
|
|
213
|
+
context.addIssue({ code: "custom", message: `Name at most ${MAX_ALLOWED_SITES} sites` });
|
|
214
|
+
}
|
|
215
|
+
})
|
|
216
|
+
.meta({ maxItems: MAX_ALLOWED_SITES });
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { type Infer } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
/** The shape of an agent's reply: free text, one of a list of options, or JSON. */
|
|
3
|
+
export declare const AgentOutput: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
4
|
+
type: import("zod").ZodLiteral<"text">;
|
|
5
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
6
|
+
type: import("zod").ZodLiteral<"choice">;
|
|
7
|
+
options: import("zod").ZodArray<import("zod").ZodString>;
|
|
8
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
9
|
+
type: import("zod").ZodLiteral<"json">;
|
|
10
|
+
schema: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
11
|
+
}, import("zod/v4/core").$strict>], "type">;
|
|
12
|
+
/** A field of a method's answer; a trailing "?" makes it optional. */
|
|
13
|
+
export declare const MethodField: import("zod").ZodEnum<{
|
|
14
|
+
boolean: "boolean";
|
|
15
|
+
"boolean?": "boolean?";
|
|
16
|
+
list: "list";
|
|
17
|
+
"list?": "list?";
|
|
18
|
+
number: "number";
|
|
19
|
+
"number?": "number?";
|
|
20
|
+
object: "object";
|
|
21
|
+
"object?": "object?";
|
|
22
|
+
string: "string";
|
|
23
|
+
"string?": "string?";
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* A named task an agent can do, called by workflow steps
|
|
27
|
+
* (`agent: finance, method: extract-invoice, with: { … }`).
|
|
28
|
+
*/
|
|
29
|
+
export declare const AgentMethod: import("zod").ZodObject<{
|
|
30
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
input: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
32
|
+
instructions: import("zod").ZodString;
|
|
33
|
+
tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
34
|
+
model: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
|
+
maxSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
36
|
+
output: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"text">, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
|
|
37
|
+
boolean: "boolean";
|
|
38
|
+
"boolean?": "boolean?";
|
|
39
|
+
list: "list";
|
|
40
|
+
"list?": "list?";
|
|
41
|
+
number: "number";
|
|
42
|
+
"number?": "number?";
|
|
43
|
+
object: "object";
|
|
44
|
+
"object?": "object?";
|
|
45
|
+
string: "string";
|
|
46
|
+
"string?": "string?";
|
|
47
|
+
}>>]>>;
|
|
48
|
+
}, import("zod/v4/core").$strict>;
|
|
49
|
+
/** How the agent's character looks; colours default to a pair taken from the agent id. */
|
|
50
|
+
export declare const AgentCharacter: import("zod").ZodObject<{
|
|
51
|
+
style: import("zod").ZodDefault<import("zod").ZodLiteral<"buddy">>;
|
|
52
|
+
surface: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
53
|
+
glossy: "glossy";
|
|
54
|
+
soft: "soft";
|
|
55
|
+
}>>;
|
|
56
|
+
body: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
57
|
+
elastic: "elastic";
|
|
58
|
+
firm: "firm";
|
|
59
|
+
}>>;
|
|
60
|
+
top: import("zod").ZodDefault<import("zod").ZodLiteral<"none">>;
|
|
61
|
+
colors: import("zod").ZodOptional<import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>>;
|
|
62
|
+
}, import("zod/v4/core").$strict>;
|
|
63
|
+
/** `agents/<id>.agent.yaml`: an agent's model, instructions, tools and methods. */
|
|
64
|
+
export declare const Agent: import("zod").ZodObject<{
|
|
65
|
+
version: import("zod").ZodDefault<import("zod").ZodLiteral<1>>;
|
|
66
|
+
id: import("zod").ZodString;
|
|
67
|
+
name: import("zod").ZodString;
|
|
68
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
69
|
+
model: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
+
params: import("zod").ZodDefault<import("zod").ZodObject<{
|
|
71
|
+
temperature: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
72
|
+
topP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
73
|
+
maxTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
+
stop: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
75
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
76
|
+
high: "high";
|
|
77
|
+
low: "low";
|
|
78
|
+
medium: "medium";
|
|
79
|
+
}>>;
|
|
80
|
+
extra: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
81
|
+
}, import("zod/v4/core").$strict>>;
|
|
82
|
+
instructions: import("zod").ZodDefault<import("zod").ZodString>;
|
|
83
|
+
skills: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
84
|
+
knowledge: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
85
|
+
connectors: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
86
|
+
runLogs: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
87
|
+
collections: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
88
|
+
subagents: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
89
|
+
methods: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
90
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
input: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
|
|
92
|
+
instructions: import("zod").ZodString;
|
|
93
|
+
tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
94
|
+
model: import("zod").ZodOptional<import("zod").ZodString>;
|
|
95
|
+
maxSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
96
|
+
output: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"text">, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
|
|
97
|
+
boolean: "boolean";
|
|
98
|
+
"boolean?": "boolean?";
|
|
99
|
+
list: "list";
|
|
100
|
+
"list?": "list?";
|
|
101
|
+
number: "number";
|
|
102
|
+
"number?": "number?";
|
|
103
|
+
object: "object";
|
|
104
|
+
"object?": "object?";
|
|
105
|
+
string: "string";
|
|
106
|
+
"string?": "string?";
|
|
107
|
+
}>>]>>;
|
|
108
|
+
}, import("zod/v4/core").$strict>>>;
|
|
109
|
+
output: import("zod").ZodDefault<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
110
|
+
type: import("zod").ZodLiteral<"text">;
|
|
111
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
112
|
+
type: import("zod").ZodLiteral<"choice">;
|
|
113
|
+
options: import("zod").ZodArray<import("zod").ZodString>;
|
|
114
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
115
|
+
type: import("zod").ZodLiteral<"json">;
|
|
116
|
+
schema: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
117
|
+
}, import("zod/v4/core").$strict>], "type">>;
|
|
118
|
+
maxSteps: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
119
|
+
character: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
120
|
+
style: import("zod").ZodDefault<import("zod").ZodLiteral<"buddy">>;
|
|
121
|
+
surface: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
122
|
+
glossy: "glossy";
|
|
123
|
+
soft: "soft";
|
|
124
|
+
}>>;
|
|
125
|
+
body: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
126
|
+
elastic: "elastic";
|
|
127
|
+
firm: "firm";
|
|
128
|
+
}>>;
|
|
129
|
+
top: import("zod").ZodDefault<import("zod").ZodLiteral<"none">>;
|
|
130
|
+
colors: import("zod").ZodOptional<import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>>;
|
|
131
|
+
}, import("zod/v4/core").$strict>>;
|
|
132
|
+
harness: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
133
|
+
"claude-code": "claude-code";
|
|
134
|
+
codex: "codex";
|
|
135
|
+
halonic: "halonic";
|
|
136
|
+
}>>;
|
|
137
|
+
workingFolder: import("zod").ZodOptional<import("zod").ZodString>;
|
|
138
|
+
allowedSites: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
139
|
+
}, import("zod/v4/core").$strict>;
|
|
140
|
+
/** An agent, with defaults filled in. */
|
|
141
|
+
export type Agent = Infer<typeof Agent>;
|
|
142
|
+
/** One of an agent's methods. */
|
|
143
|
+
export type AgentMethod = Infer<typeof AgentMethod>;
|
|
144
|
+
/** The shape of an agent's reply. */
|
|
145
|
+
export type AgentOutput = Infer<typeof AgentOutput>;
|
|
146
|
+
/** A field type of a method's JSON answer. */
|
|
147
|
+
export type MethodField = Infer<typeof MethodField>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { s } from "../../../../schema-kit/src/index.js";
|
|
2
|
+
import { agentId, collectionId, id, ModelParams, version } from "../../shared/fields.js";
|
|
3
|
+
import { AgentHarness, AllowedSite, MAX_ALLOWED_SITES, WorkingFolder } from "./sandbox-fields.js";
|
|
4
|
+
/** The shape of an agent's reply: free text, one of a list of options, or JSON. */
|
|
5
|
+
export const AgentOutput = s.discriminatedUnion("type", [
|
|
6
|
+
s.object({ type: s.literal("text") }).strict(),
|
|
7
|
+
s
|
|
8
|
+
.object({
|
|
9
|
+
type: s.literal("choice"),
|
|
10
|
+
/**
|
|
11
|
+
* The reply must be exactly one of these values, case-sensitively, once
|
|
12
|
+
* the whitespace around it is trimmed. Any other reply fails the step
|
|
13
|
+
* with `answer-not-an-option`.
|
|
14
|
+
*/
|
|
15
|
+
options: s.array(s.string()).min(1),
|
|
16
|
+
})
|
|
17
|
+
.strict(),
|
|
18
|
+
s
|
|
19
|
+
.object({
|
|
20
|
+
type: s.literal("json"),
|
|
21
|
+
/** A JSON Schema the reply must satisfy. */
|
|
22
|
+
schema: s.record(s.string(), s.unknown()).optional(),
|
|
23
|
+
})
|
|
24
|
+
.strict(),
|
|
25
|
+
]);
|
|
26
|
+
/** A field of a method's answer; a trailing "?" makes it optional. */
|
|
27
|
+
export const MethodField = s.enum([
|
|
28
|
+
"string",
|
|
29
|
+
"number",
|
|
30
|
+
"boolean",
|
|
31
|
+
"list",
|
|
32
|
+
"object",
|
|
33
|
+
"string?",
|
|
34
|
+
"number?",
|
|
35
|
+
"boolean?",
|
|
36
|
+
"list?",
|
|
37
|
+
"object?",
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* A named task an agent can do, called by workflow steps
|
|
41
|
+
* (`agent: finance, method: extract-invoice, with: { … }`).
|
|
42
|
+
*/
|
|
43
|
+
export const AgentMethod = s
|
|
44
|
+
.object({
|
|
45
|
+
description: s.string().optional(),
|
|
46
|
+
/** Argument names; the instructions use them as {{name}}. */
|
|
47
|
+
input: s.array(s.string()).default([]),
|
|
48
|
+
instructions: s.string().min(1),
|
|
49
|
+
/** Only these tools; leave out for all of the agent's tools, [] for none. */
|
|
50
|
+
tools: s.array(s.string()).optional(),
|
|
51
|
+
/** Model alias for this method; the agent's model otherwise. */
|
|
52
|
+
model: s.string().optional(),
|
|
53
|
+
/** Most model calls for one call of this method; the agent's maxSteps otherwise. */
|
|
54
|
+
maxSteps: s.number().int().min(1).max(200).optional(),
|
|
55
|
+
/** "text", or the fields of a JSON answer: { vendor: string, note: string? }. */
|
|
56
|
+
output: s.union([s.literal("text"), s.record(s.string(), MethodField)]).default("text"),
|
|
57
|
+
})
|
|
58
|
+
.strict();
|
|
59
|
+
const colour = () => s.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
60
|
+
/** How the agent's character looks; colours default to a pair taken from the agent id. */
|
|
61
|
+
export const AgentCharacter = s
|
|
62
|
+
.object({
|
|
63
|
+
style: s.literal("buddy").default("buddy"),
|
|
64
|
+
/** Soft: matte with a little grain. Glossy: a highlight. */
|
|
65
|
+
surface: s.enum(["soft", "glossy"]).default("soft"),
|
|
66
|
+
/** Elastic: wobbles and springs back. Firm: keeps its shape. */
|
|
67
|
+
body: s.enum(["elastic", "firm"]).default("elastic"),
|
|
68
|
+
top: s.literal("none").default("none"),
|
|
69
|
+
/** Two colours, such as ["#3B82F6", "#8B5CF6"]. */
|
|
70
|
+
colors: s.tuple([colour(), colour()]).optional(),
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
73
|
+
/** `agents/<id>.agent.yaml`: an agent's model, instructions, tools and methods. */
|
|
74
|
+
export const Agent = s
|
|
75
|
+
.object({
|
|
76
|
+
version,
|
|
77
|
+
id: agentId,
|
|
78
|
+
name: s.string().min(1),
|
|
79
|
+
description: s.string().optional(),
|
|
80
|
+
/** Model alias (preferred) or "provider/model". */
|
|
81
|
+
model: s.string().optional(),
|
|
82
|
+
params: ModelParams.default({}),
|
|
83
|
+
instructions: s.string().default(""),
|
|
84
|
+
skills: s.array(s.string()).default([]),
|
|
85
|
+
knowledge: s.array(s.string()).default([]),
|
|
86
|
+
/** Connector ids whose tools this agent may use. */
|
|
87
|
+
connectors: s.array(s.string()).default([]),
|
|
88
|
+
/** Read-only access to the run history of earlier runs. Never sees secrets. */
|
|
89
|
+
runLogs: s.boolean().default(false),
|
|
90
|
+
/** Collections this agent may read and write. */
|
|
91
|
+
collections: s.array(collectionId).default([]),
|
|
92
|
+
/** Agents of the same hub this agent may hand a task to. */
|
|
93
|
+
subagents: s.array(s.string()).default([]),
|
|
94
|
+
/** Named tasks workflow steps can call. */
|
|
95
|
+
methods: s.record(id, AgentMethod).default({}),
|
|
96
|
+
output: AgentOutput.default({ type: "text" }),
|
|
97
|
+
/** Most model calls per invocation (tool loops). */
|
|
98
|
+
maxSteps: s.number().int().min(1).max(200).default(6),
|
|
99
|
+
character: AgentCharacter.optional(),
|
|
100
|
+
/** The program the agent runs in; Halonic's own loop when left out. */
|
|
101
|
+
harness: AgentHarness.optional(),
|
|
102
|
+
/** The one workspace folder a harness agent writes to; `files/agents/<id>` when left out. */
|
|
103
|
+
workingFolder: WorkingFolder.optional(),
|
|
104
|
+
/** Sites a harness agent may reach besides Halonic: host names or `*.` and a domain. */
|
|
105
|
+
allowedSites: s.array(AllowedSite).max(MAX_ALLOWED_SITES).optional(),
|
|
106
|
+
})
|
|
107
|
+
.strict();
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A harness agent writes in its working folder from inside the sandbox. A
|
|
3
|
+
* local connector's program runs outside it, with the connector's secrets.
|
|
4
|
+
* The workspace check `workspace.working-folders` refuses a working folder
|
|
5
|
+
* that holds what a connector names, but it only sees paths as written. This
|
|
6
|
+
* is the same rule again on the real file system, right before a program
|
|
7
|
+
* starts (HAL-4739, HAL-4759): through symbolic links and Windows short
|
|
8
|
+
* names, for absolute paths into the workspace, for the program as found on
|
|
9
|
+
* `PATH`, for packages linked into `node_modules`, and for the files a
|
|
10
|
+
* program loads from next to its script without naming them.
|
|
11
|
+
*/
|
|
12
|
+
import { type ProgramStart } from "../../shared/program-start.js";
|
|
13
|
+
import type { PathLookup } from "../skill/scripts-folder.js";
|
|
14
|
+
/** What a connector starts, with the environment its program gets. */
|
|
15
|
+
export interface ConnectorStart extends ProgramStart {
|
|
16
|
+
readonly env: Readonly<Record<string, string>>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* How to look at the file system. Core has none, so an adapter passes Node's
|
|
20
|
+
* `resolve`, `realpath`, `readdir` and `stat`.
|
|
21
|
+
*/
|
|
22
|
+
export interface FolderLookup extends PathLookup {
|
|
23
|
+
/** The names in a folder, through links. Empty when it isn't a folder. Never rejects. */
|
|
24
|
+
list(folder: string): Promise<readonly string[]>;
|
|
25
|
+
/** Whether a file, not a folder, is there, through links. Never rejects. */
|
|
26
|
+
isFile(path: string): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
/** Where a start's program would load what an agent may write. */
|
|
29
|
+
export interface WorkingFolderReach {
|
|
30
|
+
/** The working folder, as given. */
|
|
31
|
+
readonly folder: string;
|
|
32
|
+
/** How the start reaches it, worded to follow "it", such as "runs 'tools/mail.js'". */
|
|
33
|
+
readonly how: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The message for a start that was refused because of `reach`.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* workingFolderRefusal({ folder: "/w/tools", how: "runs '/w/tools/mail.js'" });
|
|
40
|
+
* // "Halonic didn't start the program: it runs '/w/tools/mail.js', in the agent working folder '/w/tools'. …"
|
|
41
|
+
*/
|
|
42
|
+
export declare function workingFolderRefusal(reach: WorkingFolderReach): string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a start would run or load a file from a harness agent's working
|
|
45
|
+
* folder, checked on real paths. It looks at:
|
|
46
|
+
*
|
|
47
|
+
* 1. the start folder, the program and every path its arguments and `env`
|
|
48
|
+
* values name, as resolved from the start folder and through symbolic
|
|
49
|
+
* links (a path that doesn't exist yet is followed as far as it does);
|
|
50
|
+
* 2. the program as given, so the caller checks again with the absolute
|
|
51
|
+
* path it found on `PATH`;
|
|
52
|
+
* 3. every package in the `node_modules` folders from the start folder and
|
|
53
|
+
* from the folder of each script it runs up to the workspace root, where
|
|
54
|
+
* `npx` and `require()` look without being told: npm and pnpm workspaces
|
|
55
|
+
* link these to folders in the workspace. A package that is such a
|
|
56
|
+
* workspace folder has its own `node_modules` folders looked at too;
|
|
57
|
+
* 4. the folder of each script it runs and the folder it starts in, unless
|
|
58
|
+
* that is the workspace root: a program loads files from there without
|
|
59
|
+
* naming them. A script is the program, an argument or a piece of one
|
|
60
|
+
* that is a file, an argument that is a file once Node or Python add an
|
|
61
|
+
* ending (`node server`, `python -m mail`), or an argument that is a
|
|
62
|
+
* folder, which Node and Python run from inside (`node .`).
|
|
63
|
+
*
|
|
64
|
+
* Paths are compared without regard to case, with `\` as `/`, as Windows
|
|
65
|
+
* and macOS read them. Reading too much as a path only makes it stricter.
|
|
66
|
+
* Inline code (`node -e`) isn't read, and packages in pnpm's store aren't
|
|
67
|
+
* followed into their own `node_modules`: see the requirement's limits.
|
|
68
|
+
*
|
|
69
|
+
* @param start - the start, with absolute `cwd`
|
|
70
|
+
* @param workspaceRoot - the workspace's absolute path
|
|
71
|
+
* @param workingFolders - the absolute working folder of every harness agent in the workspace
|
|
72
|
+
* @returns the first reach found, or `null` when the start reaches none
|
|
73
|
+
*/
|
|
74
|
+
export declare function touchesWorkingFolder(start: ConnectorStart, workspaceRoot: string, workingFolders: readonly string[], lookup: FolderLookup): Promise<WorkingFolderReach | null>;
|