@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,394 @@
|
|
|
1
|
+
/** Version of the {@link Vcs} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export declare const vcsVersion = 2;
|
|
3
|
+
/**
|
|
4
|
+
* Refuses a version that isn't a full commit id, the only kind of version a
|
|
5
|
+
* {@link Vcs} method takes. A branch name, `HEAD`, `@{-1}` or a short id would
|
|
6
|
+
* be resolved by git against whatever the repository holds at that moment,
|
|
7
|
+
* and a name starting with `-` would be read as an option; a caller only ever
|
|
8
|
+
* holds ids that `snapshot`, `commit` or `log` gave it.
|
|
9
|
+
*
|
|
10
|
+
* @throws RangeError naming the version
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkCommitId(version: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Refuses a ref that isn't a proposal ref, the only kind of ref
|
|
15
|
+
* `commitWorktreeTo`, `readRef` and `deleteRef` take:
|
|
16
|
+
* `refs/halonic/proposals/<id>`, with the id as {@link proposalIdPattern}
|
|
17
|
+
* says. Any other name could be a branch, `HEAD` or a tag, which these
|
|
18
|
+
* methods must never move or delete.
|
|
19
|
+
*
|
|
20
|
+
* @throws RangeError naming the ref
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkProposalRef(ref: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Folders Create version always leaves out, whatever `.gitignore` says:
|
|
25
|
+
* `.halonic/review/` holds the assistant's review records, which are per
|
|
26
|
+
* device (HAL-3277). Workspaces made before `init` ignored it don't have the
|
|
27
|
+
* line, so the port can't count on `.gitignore`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const unversionedFolders: readonly string[];
|
|
30
|
+
/** How a file differs from the last commit. */
|
|
31
|
+
export type VcsFileStatus = "modified" | "added" | "deleted" | "renamed" | "untracked" | "conflicted";
|
|
32
|
+
/** One changed file. */
|
|
33
|
+
export interface VcsChange {
|
|
34
|
+
/** Path relative to the workspace root, "/" separated. */
|
|
35
|
+
path: string;
|
|
36
|
+
/** How it differs from the last commit. */
|
|
37
|
+
status: VcsFileStatus;
|
|
38
|
+
/** In the index (will be committed) or only in the working tree. */
|
|
39
|
+
staged: boolean;
|
|
40
|
+
/** Renames: the old path. */
|
|
41
|
+
from?: string;
|
|
42
|
+
}
|
|
43
|
+
/** The state of the workspace folder's repository. */
|
|
44
|
+
export interface VcsStatus {
|
|
45
|
+
/** Whether the folder is a repository at all; when not, the other fields are empty. */
|
|
46
|
+
isRepo: boolean;
|
|
47
|
+
/** Current branch; null when detached or not a repo. */
|
|
48
|
+
branch: string | null;
|
|
49
|
+
/** The branch it tracks, such as "origin/main", or `null` when none. */
|
|
50
|
+
upstream: string | null;
|
|
51
|
+
/** Commits on the branch that the upstream doesn't have. */
|
|
52
|
+
ahead: number;
|
|
53
|
+
/** Commits on the upstream that the branch doesn't have. */
|
|
54
|
+
behind: number;
|
|
55
|
+
/** Every changed file, staged or not. */
|
|
56
|
+
changes: VcsChange[];
|
|
57
|
+
}
|
|
58
|
+
/** One commit in the history. */
|
|
59
|
+
export interface VcsCommit {
|
|
60
|
+
/** The full commit hash. */
|
|
61
|
+
hash: string;
|
|
62
|
+
/** The author's name. */
|
|
63
|
+
author: string;
|
|
64
|
+
/** ISO date. */
|
|
65
|
+
date: string;
|
|
66
|
+
/** The first line of the commit message. */
|
|
67
|
+
message: string;
|
|
68
|
+
}
|
|
69
|
+
/** A worktree: a version checked out, detached, into its own folder outside the workspace. */
|
|
70
|
+
export interface VcsWorktree {
|
|
71
|
+
/** The adapter's id for it, as `removeWorktree` and `diffBetween` take it. */
|
|
72
|
+
id: string;
|
|
73
|
+
/** Its folder: an absolute path outside the workspace folder for a git adapter. */
|
|
74
|
+
path: string;
|
|
75
|
+
/** The commit it was added at. */
|
|
76
|
+
version: string;
|
|
77
|
+
}
|
|
78
|
+
/** How a file in a worktree differs from the version it is compared with. */
|
|
79
|
+
export type VcsDiffStatus = "added" | "modified" | "deleted";
|
|
80
|
+
/** One file that differs between a version and a worktree. */
|
|
81
|
+
export interface VcsFileDiff {
|
|
82
|
+
/** Path relative to the worktree's root, "/" separated. */
|
|
83
|
+
path: string;
|
|
84
|
+
status: VcsDiffStatus;
|
|
85
|
+
/** Unified diff of the file, in git's format. */
|
|
86
|
+
diff: string;
|
|
87
|
+
}
|
|
88
|
+
/** How `applyPatch` applies a patch. */
|
|
89
|
+
export interface VcsApplyOptions {
|
|
90
|
+
/** Undo the patch instead: what discarding one hunk does. */
|
|
91
|
+
reverse?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** What `commitVersion` commits. */
|
|
94
|
+
export interface VcsCommitVersionOptions {
|
|
95
|
+
/** The commit message, committed as written. */
|
|
96
|
+
message: string;
|
|
97
|
+
/** Files and folders whose changes to commit; every change when absent. Never empty. */
|
|
98
|
+
include?: string[];
|
|
99
|
+
/** Files and folders whose changes to leave out, even under `include`. */
|
|
100
|
+
exclude: string[];
|
|
101
|
+
}
|
|
102
|
+
/** How `commitWorktreeTo` commits a worktree. */
|
|
103
|
+
export interface VcsCommitWorktreeOptions {
|
|
104
|
+
/** The new commit's only parent: a full commit id (see {@link checkCommitId}). */
|
|
105
|
+
parent: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Version control of one workspace folder (git today). Paths are relative to that folder.
|
|
109
|
+
*
|
|
110
|
+
* The folder is a repository only when it is a repository's root. A folder
|
|
111
|
+
* inside another repository is not one: its status says so, and `init`
|
|
112
|
+
* makes it a repository of its own. So no method ever reads or changes a
|
|
113
|
+
* file outside the folder, such as a parent repository's staged changes or
|
|
114
|
+
* the files a checkout there would rewrite.
|
|
115
|
+
*
|
|
116
|
+
* **Nothing a caller passes is ever read as an option or as the
|
|
117
|
+
* repository's own files.** The old desktop app kept a blocklist of git
|
|
118
|
+
* options, which a unique prefix such as `--upload-pac=` could get around.
|
|
119
|
+
* So every adapter, before anything runs:
|
|
120
|
+
*
|
|
121
|
+
* - refuses with a `RangeError` every **path the `DefinitionSource` port
|
|
122
|
+
* refuses**: an unsafe one (absolute, a `.`, `..` or empty segment, a
|
|
123
|
+
* backslash or NUL) and a private one, matched the same way (`.git`,
|
|
124
|
+
* `.studio`, `.env`, `.envrc` and `.env.*` in any case, with trailing dots
|
|
125
|
+
* or spaces or the code points HFS+ ignores, and any segment with a `:`
|
|
126
|
+
* or an 8.3 short name such as `GIT~1`);
|
|
127
|
+
* - treats **every path as a literal file name**: never an option (one that
|
|
128
|
+
* starts with `-`) and never a pattern (`*`, `?`, `[` or `:(…)`), so a git
|
|
129
|
+
* adapter passes paths after `--` with `--literal-pathspecs` (or
|
|
130
|
+
* `GIT_LITERAL_PATHSPECS=1`), or `discard(["*.yaml"])` would wipe every
|
|
131
|
+
* `.yaml` file;
|
|
132
|
+
* - refuses with a `RangeError` a **branch name** that starts with `-`, that
|
|
133
|
+
* `git check-ref-format --branch` refuses, the name `HEAD`, and `@` or any
|
|
134
|
+
* name with `@{`, which git expands (`@{-1}` is the previous branch);
|
|
135
|
+
* - in a git adapter, refuses a path that goes through a symbolic link, such
|
|
136
|
+
* as `link/config` with `link -> .git` or a link out of the folder, which
|
|
137
|
+
* the path rules above can't see;
|
|
138
|
+
* - commits a message as the message, whatever it starts with.
|
|
139
|
+
*
|
|
140
|
+
* Remotes and upstreams come from the repository, never from a caller.
|
|
141
|
+
*
|
|
142
|
+
* **An adapter that drives git always runs it hardened**, whether the
|
|
143
|
+
* workspace is trusted or not (plan section 11). Anyone who can write the
|
|
144
|
+
* workspace folder can write `.git/config` and `.git/info/attributes`, so
|
|
145
|
+
* no program named there ever runs. Every call:
|
|
146
|
+
*
|
|
147
|
+
* - points `core.hooksPath` at an empty folder and passes
|
|
148
|
+
* `-c core.fsmonitor=false` (hooks and fsmonitor);
|
|
149
|
+
* - blanks the `clean`, `smudge` and `process` commands of every
|
|
150
|
+
* `filter.<name>` driver the repository's config has, and the config of
|
|
151
|
+
* every repository nested in it as a gitlink, which `add`, `status` and
|
|
152
|
+
* `diff` look into (filters);
|
|
153
|
+
* - diffs and logs with `--no-ext-diff --no-textconv` (`diff.external`,
|
|
154
|
+
* `diff.<name>.command` and `diff.<name>.textconv`), and with
|
|
155
|
+
* `-c diff.submodule=short`, so no submodule's own diff programs run;
|
|
156
|
+
* - commits with the message it is given (`commit.template`, which can name
|
|
157
|
+
* any file whose text would otherwise become the message);
|
|
158
|
+
* - passes `-c core.alternateRefsCommand=true`, since `pull` would run it
|
|
159
|
+
* locally for every alternate, and blanks `fetch.bundleURI`, which would
|
|
160
|
+
* read objects and refs from any local file;
|
|
161
|
+
* - passes `-c maintenance.auto=false -c gc.auto=0`, so no automatic `gc`
|
|
162
|
+
* runs `gc.recentObjectsHook`;
|
|
163
|
+
* - passes `-c commit.gpgSign=false -c push.gpgSign=false
|
|
164
|
+
* -c log.showSignature=false` (`gpg.program`, `gpg.ssh.defaultKeyCommand`
|
|
165
|
+
* and the other signing programs);
|
|
166
|
+
* - passes `-c submodule.recurse=false -c fetch.recurseSubmodules=false`, so
|
|
167
|
+
* git never fetches, checks out or pushes inside a submodule, where that
|
|
168
|
+
* submodule's own config applies;
|
|
169
|
+
* - fetches and pushes with `--upload-pack=git-upload-pack` and
|
|
170
|
+
* `--receive-pack=git-receive-pack` (`remote.<name>.uploadpack` and
|
|
171
|
+
* `receivepack`), `-c credential.helper=` followed only by Halonic's own
|
|
172
|
+
* helper, if any (`credential.helper`), `GIT_SSH_COMMAND=ssh`
|
|
173
|
+
* (`core.sshCommand`), `GIT_ASKPASS` set (`core.askPass`) and
|
|
174
|
+
* `GIT_ALLOW_PROTOCOL=https:ssh` (`protocol.*.allow`, so no `ext::` URL
|
|
175
|
+
* runs a command). No `file`: a local remote such as `./planted.git` runs
|
|
176
|
+
* its own hooks and config on push and pull, out of reach of every
|
|
177
|
+
* setting here, so local remotes are refused;
|
|
178
|
+
* - starts from an environment with every inherited `GIT_*` variable
|
|
179
|
+
* removed (such as `GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE` and
|
|
180
|
+
* `GIT_CONFIG_PARAMETERS`), and sets `GIT_TERMINAL_PROMPT=0`,
|
|
181
|
+
* `GIT_EDITOR=true` and `GIT_PAGER=cat`, so nothing waits on a prompt;
|
|
182
|
+
* - never sets `safe.directory=*`.
|
|
183
|
+
*
|
|
184
|
+
* Out of scope, because no port method reaches them: merge drivers
|
|
185
|
+
* (`pull` is fast-forward only), `submodule.*.update` (no submodule
|
|
186
|
+
* command), and a remote server's own config, which runs on another
|
|
187
|
+
* machine. Where a
|
|
188
|
+
* workspace's config would make a program run, the adapter neutralises it
|
|
189
|
+
* as above rather than refusing the workspace, so a cloned repository that
|
|
190
|
+
* names one still works.
|
|
191
|
+
*/
|
|
192
|
+
export interface Vcs {
|
|
193
|
+
/** The branch, its upstream and the changed files. */
|
|
194
|
+
status(): Promise<VcsStatus>;
|
|
195
|
+
/** Unified diff of one file: staged = index vs HEAD, otherwise working tree vs index. Empty when they are the same. */
|
|
196
|
+
diff(path: string, staged: boolean): Promise<string>;
|
|
197
|
+
/** Adds the files' changes to the index. */
|
|
198
|
+
stage(paths: string[]): Promise<void>;
|
|
199
|
+
/** Takes the files' changes out of the index, leaving the working tree as it is. */
|
|
200
|
+
unstage(paths: string[]): Promise<void>;
|
|
201
|
+
/** Throw away working-tree changes: tracked files go back to the index, untracked files are deleted. */
|
|
202
|
+
discard(paths: string[]): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* Commits what is staged; returns the new commit hash.
|
|
205
|
+
*
|
|
206
|
+
* @throws when nothing is staged, or the message is empty
|
|
207
|
+
*/
|
|
208
|
+
commit(message: string): Promise<string>;
|
|
209
|
+
/**
|
|
210
|
+
* At most `limit` commits on the current branch, newest first.
|
|
211
|
+
*
|
|
212
|
+
* @throws RangeError when `limit` isn't a whole number of at least 1
|
|
213
|
+
*/
|
|
214
|
+
log(limit: number): Promise<VcsCommit[]>;
|
|
215
|
+
/** The local branch names; a branch with no commits yet isn't listed. */
|
|
216
|
+
branches(): Promise<string[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Switches to a local branch. Refuses, and changes nothing, when that would
|
|
219
|
+
* overwrite an untracked file, or while a tracked file has changes: an
|
|
220
|
+
* adapter may refuse any such change, as the memory one does, though git
|
|
221
|
+
* refuses only those the branch would touch.
|
|
222
|
+
*
|
|
223
|
+
* A name is only ever a branch, never a path: `git checkout a.yaml` with no
|
|
224
|
+
* such branch would throw away the changes to `a.yaml`, so a git adapter
|
|
225
|
+
* uses `git switch` or `git checkout <branch> --`.
|
|
226
|
+
*
|
|
227
|
+
* @throws when there is no such branch, or the switch would lose changes
|
|
228
|
+
*/
|
|
229
|
+
checkout(branch: string): Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Creates a branch from the current commit and switches to it.
|
|
232
|
+
*
|
|
233
|
+
* @throws when a branch of that name already exists, or it would sit next
|
|
234
|
+
* to `x` as `x/y` or the other way round, which git refuses
|
|
235
|
+
*/
|
|
236
|
+
createBranch(name: string): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Commits the workspace's files as they are on disk now, new files
|
|
239
|
+
* included, and returns the commit's id. Files the repository ignores and
|
|
240
|
+
* private entries (see `DefinitionSource`) are left out, so a `.env` with
|
|
241
|
+
* a key never reaches a worktree. The commit's parent is the current
|
|
242
|
+
* commit, if any. Neither HEAD, the branch, the index nor the working tree
|
|
243
|
+
* changes: the commit is on no branch.
|
|
244
|
+
*
|
|
245
|
+
* @throws when the folder isn't a repository
|
|
246
|
+
*/
|
|
247
|
+
snapshot(): Promise<string>;
|
|
248
|
+
/**
|
|
249
|
+
* A file's text at a commit, or `null` when the commit has no such file.
|
|
250
|
+
* Never reads the working tree or the index.
|
|
251
|
+
*
|
|
252
|
+
* @throws RangeError for a version that isn't a full commit id (see
|
|
253
|
+
* {@link checkCommitId}) or a path the port refuses
|
|
254
|
+
* @throws when the repository has no such commit: `Unknown version <id>`
|
|
255
|
+
*/
|
|
256
|
+
readAt(version: string, path: string): Promise<string | null>;
|
|
257
|
+
/**
|
|
258
|
+
* Every file under `dir` at a commit (the whole workspace without one),
|
|
259
|
+
* recursively, as sorted paths relative to the workspace folder, private
|
|
260
|
+
* entries left out; `null` when the commit has no file under `dir`.
|
|
261
|
+
*
|
|
262
|
+
* @throws as {@link Vcs.readAt}
|
|
263
|
+
*/
|
|
264
|
+
listAt(version: string, dir?: string): Promise<string[] | null>;
|
|
265
|
+
/**
|
|
266
|
+
* Moves a file or folder in the working tree and, where the repository
|
|
267
|
+
* tracks it, in the index too (`git mv`), so its history follows it. An
|
|
268
|
+
* untracked file just moves.
|
|
269
|
+
*
|
|
270
|
+
* @throws when `from` doesn't exist or `to` already does; nothing changes
|
|
271
|
+
*/
|
|
272
|
+
rename(from: string, to: string): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Checks a commit out, detached, into a new folder of its own, where the
|
|
275
|
+
* assistant or an agent can change files without touching the workspace.
|
|
276
|
+
* The folder is never inside the workspace folder, so the Studio's file
|
|
277
|
+
* tree and watcher never see it. A git adapter takes the folder that
|
|
278
|
+
* holds its worktrees (in the app's data folder) when it is made.
|
|
279
|
+
*
|
|
280
|
+
* @throws as {@link Vcs.readAt} for the version
|
|
281
|
+
*/
|
|
282
|
+
addWorktree(version: string): Promise<VcsWorktree>;
|
|
283
|
+
/**
|
|
284
|
+
* Deletes a worktree's folder, changed files and all, and the
|
|
285
|
+
* repository's record of it.
|
|
286
|
+
*
|
|
287
|
+
* @throws when there is no worktree with that id: `Unknown worktree <id>`
|
|
288
|
+
*/
|
|
289
|
+
removeWorktree(id: string): Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* The worktrees this adapter added that still exist, oldest first.
|
|
292
|
+
*
|
|
293
|
+
* @throws when the folder isn't a repository
|
|
294
|
+
*/
|
|
295
|
+
listWorktrees(): Promise<VcsWorktree[]>;
|
|
296
|
+
/**
|
|
297
|
+
* Every file that differs between a commit and a worktree's files as they
|
|
298
|
+
* are on disk, new files included, private entries left out, sorted by
|
|
299
|
+
* path. Changes neither the worktree nor the workspace. A git adapter
|
|
300
|
+
* finds the worktree's repository through its own record of it, never
|
|
301
|
+
* through the `.git` file in the worktree folder, which whatever ran there
|
|
302
|
+
* could have rewritten.
|
|
303
|
+
*
|
|
304
|
+
* @throws as {@link Vcs.readAt} for the version, and as
|
|
305
|
+
* {@link Vcs.removeWorktree} for the id
|
|
306
|
+
*/
|
|
307
|
+
diffBetween(version: string, worktreeId: string): Promise<VcsFileDiff[]>;
|
|
308
|
+
/**
|
|
309
|
+
* Applies a unified diff to the workspace's working tree, not the index;
|
|
310
|
+
* with `reverse`, undoes it instead. Discarding one hunk of a change is
|
|
311
|
+
* `applyPatch(hunk, { reverse: true })`. All or nothing: when any part of
|
|
312
|
+
* it doesn't apply cleanly, nothing changes.
|
|
313
|
+
*
|
|
314
|
+
* @throws RangeError for a patch that would be refused whatever the files
|
|
315
|
+
* hold: one that names a path the port refuses, one that does more than
|
|
316
|
+
* edit, create or delete a plain text file's lines (a binary change, a
|
|
317
|
+
* mode change, a symbolic link, a gitlink, a rename or a copy), or one
|
|
318
|
+
* that can't be read
|
|
319
|
+
* @throws when it is fine but no longer applies cleanly: `The change no
|
|
320
|
+
* longer matches the file.` The Studio offers to refresh only this one.
|
|
321
|
+
*/
|
|
322
|
+
applyPatch(patch: string, options?: VcsApplyOptions): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Create version: commits the changes on disk under `include` (the whole
|
|
325
|
+
* workspace when absent), new, changed and deleted files alike, except
|
|
326
|
+
* those under `exclude`, on the current branch, and returns the commit's
|
|
327
|
+
* id. A path names a file or everything in a folder; a renamed item is
|
|
328
|
+
* left out by naming both its paths.
|
|
329
|
+
*
|
|
330
|
+
* A path left out keeps its content at HEAD in the new commit, even when
|
|
331
|
+
* the repository tracks it and it changed on disk (unlike
|
|
332
|
+
* `git commit -- <path>`, which commits what is on disk for every tracked
|
|
333
|
+
* path it names). Files the repository ignores are left out, and so are
|
|
334
|
+
* private entries and {@link unversionedFolders}, even where `.gitignore`
|
|
335
|
+
* doesn't name them; one HEAD already tracks keeps its content at HEAD. The working tree is never touched.
|
|
336
|
+
* The index takes the new commit's content for the paths it committed;
|
|
337
|
+
* every other path stays as it was, staged changes and all, so the
|
|
338
|
+
* changes left out are still changes afterwards.
|
|
339
|
+
*
|
|
340
|
+
* @throws RangeError for a path the port refuses in `include` or
|
|
341
|
+
* `exclude`, or an empty `include`
|
|
342
|
+
* @throws when the message is empty, or there is nothing to commit
|
|
343
|
+
* because every change is left out; nothing changes
|
|
344
|
+
*/
|
|
345
|
+
commitVersion(options: VcsCommitVersionOptions): Promise<string>;
|
|
346
|
+
/**
|
|
347
|
+
* Commits a worktree's files as they are on disk, new files included,
|
|
348
|
+
* ignored files and private entries left out, with `parent` as the only
|
|
349
|
+
* parent, and points the proposal ref `ref` at it (see
|
|
350
|
+
* {@link checkProposalRef}). Returns the commit's id. HEAD, the branches,
|
|
351
|
+
* the index, the working tree and the worktree don't change, and
|
|
352
|
+
* `branches` never lists the ref. Nothing pushes it.
|
|
353
|
+
*
|
|
354
|
+
* @throws RangeError for a ref that isn't a proposal ref, or a parent
|
|
355
|
+
* that isn't a full commit id
|
|
356
|
+
* @throws when the ref already exists, so a proposal is never
|
|
357
|
+
* overwritten; as {@link Vcs.readAt} for the parent; and as
|
|
358
|
+
* {@link Vcs.removeWorktree} for the id
|
|
359
|
+
*/
|
|
360
|
+
commitWorktreeTo(worktreeId: string, ref: string, options: VcsCommitWorktreeOptions): Promise<string>;
|
|
361
|
+
/**
|
|
362
|
+
* The commit a proposal ref points at, or `null` when there is no such
|
|
363
|
+
* ref, even when a branch has the same name.
|
|
364
|
+
*
|
|
365
|
+
* @throws RangeError for a ref that isn't a proposal ref
|
|
366
|
+
* @throws when the folder isn't a repository
|
|
367
|
+
*/
|
|
368
|
+
readRef(ref: string): Promise<string | null>;
|
|
369
|
+
/**
|
|
370
|
+
* Deletes a proposal ref. The commit stays until git's own `gc` removes it.
|
|
371
|
+
*
|
|
372
|
+
* @throws RangeError for a ref that isn't a proposal ref
|
|
373
|
+
* @throws when there is no such ref
|
|
374
|
+
*/
|
|
375
|
+
deleteRef(ref: string): Promise<void>;
|
|
376
|
+
/** Make the folder a repository, ignoring `.studio`, the folder Halonic keeps its runtime data in. */
|
|
377
|
+
init(): Promise<void>;
|
|
378
|
+
/** The remote names, such as "origin". */
|
|
379
|
+
remotes(): Promise<string[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Brings in the upstream's commits, fast-forward only. Like `checkout`, it
|
|
382
|
+
* refuses to overwrite an untracked file or to switch over changes.
|
|
383
|
+
*
|
|
384
|
+
* @throws when the branch and its upstream have both moved on; nothing is merged
|
|
385
|
+
*/
|
|
386
|
+
pull(): Promise<void>;
|
|
387
|
+
/**
|
|
388
|
+
* Sends the branch's commits to its upstream, or to the first remote (which
|
|
389
|
+
* becomes the upstream) when it has none.
|
|
390
|
+
*
|
|
391
|
+
* @throws when the remote has commits the branch doesn't (no force push), or there is no remote
|
|
392
|
+
*/
|
|
393
|
+
push(): Promise<void>;
|
|
394
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Version of the {@link Vcs} port. A breaking change bumps it and comes with an ADR. */
|
|
2
|
+
export const vcsVersion = 2;
|
|
3
|
+
/** A full commit id: 40 (SHA-1) or 64 (SHA-256) lowercase hex characters. */
|
|
4
|
+
const commitIdPattern = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u;
|
|
5
|
+
/**
|
|
6
|
+
* Refuses a version that isn't a full commit id, the only kind of version a
|
|
7
|
+
* {@link Vcs} method takes. A branch name, `HEAD`, `@{-1}` or a short id would
|
|
8
|
+
* be resolved by git against whatever the repository holds at that moment,
|
|
9
|
+
* and a name starting with `-` would be read as an option; a caller only ever
|
|
10
|
+
* holds ids that `snapshot`, `commit` or `log` gave it.
|
|
11
|
+
*
|
|
12
|
+
* @throws RangeError naming the version
|
|
13
|
+
*/
|
|
14
|
+
export function checkCommitId(version) {
|
|
15
|
+
if (!commitIdPattern.test(version)) {
|
|
16
|
+
throw new RangeError(`Invalid version ${JSON.stringify(version)}: give a full commit id (40 or 64 lowercase hex characters).`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Where every proposal ref lives. */
|
|
20
|
+
const proposalRefPrefix = "refs/halonic/proposals/";
|
|
21
|
+
/**
|
|
22
|
+
* A proposal ref's id: ASCII letters, digits, `-` and `_`, at most 64 of
|
|
23
|
+
* them, not starting with `-`. No `/`, `.`, `@`, `~`, `^` or `:`, so git
|
|
24
|
+
* never reads one as a path, a revision expression or an option.
|
|
25
|
+
*/
|
|
26
|
+
const proposalIdPattern = /^[A-Za-z0-9_][A-Za-z0-9_-]{0,63}$/u;
|
|
27
|
+
/**
|
|
28
|
+
* Refuses a ref that isn't a proposal ref, the only kind of ref
|
|
29
|
+
* `commitWorktreeTo`, `readRef` and `deleteRef` take:
|
|
30
|
+
* `refs/halonic/proposals/<id>`, with the id as {@link proposalIdPattern}
|
|
31
|
+
* says. Any other name could be a branch, `HEAD` or a tag, which these
|
|
32
|
+
* methods must never move or delete.
|
|
33
|
+
*
|
|
34
|
+
* @throws RangeError naming the ref
|
|
35
|
+
*/
|
|
36
|
+
export function checkProposalRef(ref) {
|
|
37
|
+
const id = ref.startsWith(proposalRefPrefix) ? ref.slice(proposalRefPrefix.length) : null;
|
|
38
|
+
if (id === null || !proposalIdPattern.test(id)) {
|
|
39
|
+
throw new RangeError(`Invalid proposal ref ${JSON.stringify(ref)}: give ${proposalRefPrefix}<id>, with an id of up to 64 letters, digits, - and _, not starting with -.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Folders Create version always leaves out, whatever `.gitignore` says:
|
|
44
|
+
* `.halonic/review/` holds the assistant's review records, which are per
|
|
45
|
+
* device (HAL-3277). Workspaces made before `init` ignored it don't have the
|
|
46
|
+
* line, so the port can't count on `.gitignore`.
|
|
47
|
+
*/
|
|
48
|
+
export const unversionedFolders = Object.freeze([".halonic/review"]);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Builds schemas. These are Zod's own builders, limited to the ones the file
|
|
4
|
+
* format uses, so the rest of the code never imports Zod. The
|
|
5
|
+
* schemas they return have Zod's methods, such as `.min()`, `.optional()`,
|
|
6
|
+
* `.default()`, `.strict()`, `.extend()` and `.superRefine()`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const Deployment = s.object({
|
|
10
|
+
* name: s.string().min(1),
|
|
11
|
+
* host: s.enum(["local", "cloudflare"]).default("local"),
|
|
12
|
+
* }).strict();
|
|
13
|
+
* type Deployment = Infer<typeof Deployment>;
|
|
14
|
+
*/
|
|
15
|
+
export declare const s: {
|
|
16
|
+
/** Text. Add `.min()`, `.max()`, `.regex()`, `.email()` or `.url()`. */
|
|
17
|
+
readonly string: typeof z.string;
|
|
18
|
+
/** A finite number. Add `.min()`, `.max()`, `.positive()` or `.int()`. */
|
|
19
|
+
readonly number: typeof z.number;
|
|
20
|
+
/** `true` or `false`. */
|
|
21
|
+
readonly boolean: typeof z.boolean;
|
|
22
|
+
/** Only `null`. */
|
|
23
|
+
readonly null: typeof z.null;
|
|
24
|
+
/** Anything. In an object the key must still be there unless you add `.optional()`. */
|
|
25
|
+
readonly unknown: typeof z.unknown;
|
|
26
|
+
/** Exactly one value, such as `s.literal(1)` or `s.literal("text")`. */
|
|
27
|
+
readonly literal: typeof z.literal;
|
|
28
|
+
/** One of a fixed list of texts, such as `s.enum(["low", "medium", "high"])`. */
|
|
29
|
+
readonly enum: typeof z.enum;
|
|
30
|
+
/** A map with these keys. Unknown keys are dropped; add `.strict()` to refuse or `.passthrough()` to keep them. */
|
|
31
|
+
readonly object: typeof z.object;
|
|
32
|
+
/** A list whose items all match one schema. Add `.min()` or `.max()` for its length. */
|
|
33
|
+
readonly array: typeof z.array;
|
|
34
|
+
/** A list with one schema per position. */
|
|
35
|
+
readonly tuple: typeof z.tuple;
|
|
36
|
+
/** A map with any keys: every key matches the key schema and every value the value schema. */
|
|
37
|
+
readonly record: typeof z.record;
|
|
38
|
+
/** A value that matches any of the options. */
|
|
39
|
+
readonly union: typeof z.union;
|
|
40
|
+
/** A map whose value at one key picks one of the object schemas. */
|
|
41
|
+
readonly discriminatedUnion: typeof z.discriminatedUnion;
|
|
42
|
+
/** A value that matches both schemas; maps are merged. */
|
|
43
|
+
readonly intersection: typeof z.intersection;
|
|
44
|
+
/** A schema that refers to itself. */
|
|
45
|
+
readonly lazy: typeof z.lazy;
|
|
46
|
+
/** Any JSON value: null, a boolean, a finite number, text, or a list or map of JSON values. */
|
|
47
|
+
readonly json: typeof z.json;
|
|
48
|
+
/** An absolute `http` or `https` URL as `URL` writes it; see `URL_PATTERN`. */
|
|
49
|
+
readonly url: () => z.ZodString;
|
|
50
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** An IPv4 octet as `URL` writes it: 0 to 255, without leading zeros. */
|
|
3
|
+
const ipv4Octet = String.raw `(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)`;
|
|
4
|
+
/** One lower-case name label. */
|
|
5
|
+
const nameLabel = String.raw `[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`;
|
|
6
|
+
/**
|
|
7
|
+
* A host as `URL` writes it: a dotted IPv4 address, lower-case name labels or a
|
|
8
|
+
* bracketed IPv6 address. `URL` reads a name whose last label is a number, such
|
|
9
|
+
* as `999.999.999.999` or `1.2.3`, as an IPv4 address and refuses or rewrites
|
|
10
|
+
* it, so a name's last label may not be digits or `0x` with hex digits.
|
|
11
|
+
*/
|
|
12
|
+
const urlHost = String.raw `(?:${ipv4Octet}(?:\.${ipv4Octet}){3}|(?:${nameLabel}\.)*(?!(?:\d+|0x[0-9a-f]*)(?![a-z0-9-]))${nameLabel}|\[[0-9a-f:.]+\])`;
|
|
13
|
+
/** A port as `URL` writes it: 0 to 65535, without leading zeros. */
|
|
14
|
+
const urlPort = String.raw `(?:6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)`;
|
|
15
|
+
/** What may follow the host: RFC 3986's unreserved and reserved characters and `%` with two hex digits. */
|
|
16
|
+
const urlRest = String.raw `(?:[A-Za-z0-9\-._~:/?#\[\]@!$&'()*+,;=]|%[0-9A-Fa-f]{2})*`;
|
|
17
|
+
/**
|
|
18
|
+
* An absolute `http` or `https` URL as `URL` writes it. The core has no `URL`
|
|
19
|
+
* class (plan 4.1), so this is a pattern, and stricter than Zod's `z.url()`:
|
|
20
|
+
* lower-case scheme and host, no user or password, no spaces or other
|
|
21
|
+
* characters `URL` would escape. Anything else, such as `mailto:` or `file:`, is refused.
|
|
22
|
+
*/
|
|
23
|
+
const URL_PATTERN = new RegExp(String.raw `^https?://${urlHost}(?::${urlPort})?(?:[/?#]${urlRest})?$`);
|
|
24
|
+
/**
|
|
25
|
+
* Builds schemas. These are Zod's own builders, limited to the ones the file
|
|
26
|
+
* format uses, so the rest of the code never imports Zod. The
|
|
27
|
+
* schemas they return have Zod's methods, such as `.min()`, `.optional()`,
|
|
28
|
+
* `.default()`, `.strict()`, `.extend()` and `.superRefine()`.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const Deployment = s.object({
|
|
32
|
+
* name: s.string().min(1),
|
|
33
|
+
* host: s.enum(["local", "cloudflare"]).default("local"),
|
|
34
|
+
* }).strict();
|
|
35
|
+
* type Deployment = Infer<typeof Deployment>;
|
|
36
|
+
*/
|
|
37
|
+
export const s = {
|
|
38
|
+
/** Text. Add `.min()`, `.max()`, `.regex()`, `.email()` or `.url()`. */
|
|
39
|
+
string: z.string,
|
|
40
|
+
/** A finite number. Add `.min()`, `.max()`, `.positive()` or `.int()`. */
|
|
41
|
+
number: z.number,
|
|
42
|
+
/** `true` or `false`. */
|
|
43
|
+
boolean: z.boolean,
|
|
44
|
+
/** Only `null`. */
|
|
45
|
+
null: z.null,
|
|
46
|
+
/** Anything. In an object the key must still be there unless you add `.optional()`. */
|
|
47
|
+
unknown: z.unknown,
|
|
48
|
+
/** Exactly one value, such as `s.literal(1)` or `s.literal("text")`. */
|
|
49
|
+
literal: z.literal,
|
|
50
|
+
/** One of a fixed list of texts, such as `s.enum(["low", "medium", "high"])`. */
|
|
51
|
+
enum: z.enum,
|
|
52
|
+
/** A map with these keys. Unknown keys are dropped; add `.strict()` to refuse or `.passthrough()` to keep them. */
|
|
53
|
+
object: z.object,
|
|
54
|
+
/** A list whose items all match one schema. Add `.min()` or `.max()` for its length. */
|
|
55
|
+
array: z.array,
|
|
56
|
+
/** A list with one schema per position. */
|
|
57
|
+
tuple: z.tuple,
|
|
58
|
+
/** A map with any keys: every key matches the key schema and every value the value schema. */
|
|
59
|
+
record: z.record,
|
|
60
|
+
/** A value that matches any of the options. */
|
|
61
|
+
union: z.union,
|
|
62
|
+
/** A map whose value at one key picks one of the object schemas. */
|
|
63
|
+
discriminatedUnion: z.discriminatedUnion,
|
|
64
|
+
/** A value that matches both schemas; maps are merged. */
|
|
65
|
+
intersection: z.intersection,
|
|
66
|
+
/** A schema that refers to itself. */
|
|
67
|
+
lazy: z.lazy,
|
|
68
|
+
/** Any JSON value: null, a boolean, a finite number, text, or a list or map of JSON values. */
|
|
69
|
+
json: z.json,
|
|
70
|
+
/** An absolute `http` or `https` URL as `URL` writes it; see `URL_PATTERN`. */
|
|
71
|
+
url: () => z.string().regex(URL_PATTERN, "must be an http or https URL as URL writes it"),
|
|
72
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Issue } from "./issue.js";
|
|
2
|
+
/**
|
|
3
|
+
* How many keys and indexes deep an input may go. Workspace files are
|
|
4
|
+
* nowhere near it. Deeper input, or a value that contains itself, would
|
|
5
|
+
* otherwise overflow the call stack inside Zod.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_DEPTH = 256;
|
|
8
|
+
/**
|
|
9
|
+
* Finds the first value nested deeper than `MAX_DEPTH`, without recursion,
|
|
10
|
+
* and describes it as a `too_deep` issue at its path.
|
|
11
|
+
*
|
|
12
|
+
* It walks shared sub-objects once per reference, so `core/yaml` must keep
|
|
13
|
+
* its alias limit on: YAML aliases are the only way a file can share them.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findTooDeep(input: unknown): Issue | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How many keys and indexes deep an input may go. Workspace files are
|
|
3
|
+
* nowhere near it. Deeper input, or a value that contains itself, would
|
|
4
|
+
* otherwise overflow the call stack inside Zod.
|
|
5
|
+
*/
|
|
6
|
+
export const MAX_DEPTH = 256;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the first value nested deeper than `MAX_DEPTH`, without recursion,
|
|
9
|
+
* and describes it as a `too_deep` issue at its path.
|
|
10
|
+
*
|
|
11
|
+
* It walks shared sub-objects once per reference, so `core/yaml` must keep
|
|
12
|
+
* its alias limit on: YAML aliases are the only way a file can share them.
|
|
13
|
+
*/
|
|
14
|
+
export function findTooDeep(input) {
|
|
15
|
+
const pending = [{ value: input, path: [] }];
|
|
16
|
+
for (let next = pending.pop(); next !== undefined; next = pending.pop()) {
|
|
17
|
+
if (next.path.length > MAX_DEPTH) {
|
|
18
|
+
return {
|
|
19
|
+
code: "too_deep",
|
|
20
|
+
path: next.path,
|
|
21
|
+
message: `Nested more than ${MAX_DEPTH} levels deep`,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
for (const [key, child] of childrenOf(next.value)) {
|
|
25
|
+
pending.push({ value: child, path: [...next.path, key] });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
function childrenOf(value) {
|
|
31
|
+
// Array.from, unlike map, also visits the holes of a sparse list.
|
|
32
|
+
if (Array.isArray(value))
|
|
33
|
+
return Array.from(value, (item, index) => [index, item]);
|
|
34
|
+
if (typeof value === "object" && value !== null)
|
|
35
|
+
return Object.entries(value);
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { s } from "./builders.js";
|
|
2
|
+
export { MAX_DEPTH } from "./depth.js";
|
|
3
|
+
export { formatPath, type Issue, type IssueCode, type Path, type PathSegment } from "./issue.js";
|
|
4
|
+
export { JSON_SCHEMA_DRAFT, type JsonSchema, type JsonValue, toJsonSchema } from "./json-schema.js";
|
|
5
|
+
export { parse } from "./parse.js";
|
|
6
|
+
export type { Infer, InferInput, Schema } from "./schema.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// The public API of @halonicjs/schema-kit. Internal code imports by relative path.
|
|
2
|
+
export { s } from "./builders.js";
|
|
3
|
+
export { MAX_DEPTH } from "./depth.js";
|
|
4
|
+
export { formatPath } from "./issue.js";
|
|
5
|
+
export { JSON_SCHEMA_DRAFT, toJsonSchema } from "./json-schema.js";
|
|
6
|
+
export { parse } from "./parse.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
/** One step in the path to a value: an object key or a list index. */
|
|
3
|
+
export type PathSegment = string | number;
|
|
4
|
+
/** Where a value sits inside the parsed input, from the root down. `[]` is the root itself. */
|
|
5
|
+
export type Path = readonly PathSegment[];
|
|
6
|
+
/**
|
|
7
|
+
* What kind of problem an issue reports. All but `too_deep` are Zod's codes.
|
|
8
|
+
* The codes are stable; the messages are for people and may be reworded.
|
|
9
|
+
*/
|
|
10
|
+
export type IssueCode = "invalid_type" | "too_big" | "too_small" | "invalid_format" | "not_multiple_of" | "unrecognized_keys" | "invalid_union" | "invalid_key" | "invalid_element" | "invalid_value" | "custom" | "too_deep";
|
|
11
|
+
/** One problem found while parsing. The YAML layer turns `path` into a line and column. */
|
|
12
|
+
export interface Issue {
|
|
13
|
+
readonly code: IssueCode;
|
|
14
|
+
readonly path: Path;
|
|
15
|
+
readonly message: string;
|
|
16
|
+
/** For `unrecognized_keys`: the keys the object doesn't allow. The path is the object's. */
|
|
17
|
+
readonly keys?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/** Formats a path for messages: `deployments.prod.name`, `cases[0].events[2]`. */
|
|
20
|
+
export declare function formatPath(path: Path): string;
|
|
21
|
+
/** Turns one of Zod's issues into ours. */
|
|
22
|
+
export declare function fromZodIssue(issue: z.core.$ZodIssue): Issue;
|