@scarn/sdk 0.0.0-stage → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/chunk-4361gxk0.js +166 -0
  2. package/dist/chunk-4vehh3dq.js +333 -0
  3. package/dist/chunk-56e4kp0a.js +162 -0
  4. package/dist/chunk-5mmj03ah.js +1074 -0
  5. package/dist/chunk-631ffb6r.js +57 -0
  6. package/dist/chunk-91p9vzcs.js +1453 -0
  7. package/dist/chunk-9s07v9r1.js +30 -0
  8. package/dist/chunk-b21233rt.js +78 -0
  9. package/dist/chunk-dnn39qt4.js +13539 -0
  10. package/dist/chunk-eg1hcvhb.js +300 -0
  11. package/dist/chunk-g0rdnn0r.js +95 -0
  12. package/dist/chunk-h9yxx0hd.js +116 -0
  13. package/dist/chunk-njd6npf0.js +35 -0
  14. package/dist/chunk-ny07ncb9.js +330 -0
  15. package/dist/chunk-p6kc9wq8.js +97 -0
  16. package/dist/chunk-qpw5wt1p.js +257 -0
  17. package/dist/chunk-rq3q8vg7.js +1094 -0
  18. package/dist/chunk-s0gap8r8.js +14 -0
  19. package/dist/chunk-tfm5hjzm.js +100 -0
  20. package/dist/chunk-ynk2bjae.js +1686 -0
  21. package/dist/chunk-zpqyjgb4.js +49 -0
  22. package/dist/client.d.ts +4 -0
  23. package/dist/client.js +57 -0
  24. package/dist/contracts/artifact-markers.d.ts +42 -0
  25. package/dist/contracts/artifact-markers.js +15 -0
  26. package/dist/contracts/artifacts.d.ts +67 -0
  27. package/dist/contracts/artifacts.js +25 -0
  28. package/dist/contracts/pipeline-document/built-ins.d.ts +23 -0
  29. package/dist/contracts/pipeline-document/conditions/operators.d.ts +8 -0
  30. package/dist/contracts/pipeline-document/index.d.ts +11 -0
  31. package/dist/contracts/pipeline-document/index.js +97 -0
  32. package/dist/contracts/pipeline-document/json.d.ts +35 -0
  33. package/dist/contracts/pipeline-document/routes.d.ts +16 -0
  34. package/dist/contracts/pipeline-document/schema.d.ts +780 -0
  35. package/dist/contracts/pipeline-document/step-contract.d.ts +11 -0
  36. package/dist/contracts/step-artifact-submissions.d.ts +71 -0
  37. package/dist/contracts/step-artifact-submissions.js +174 -0
  38. package/dist/defaults/atomic-json-file.d.ts +10 -0
  39. package/dist/defaults/auth-file.d.ts +14 -0
  40. package/dist/defaults/base-url.d.ts +1 -0
  41. package/dist/defaults/config-file.d.ts +46 -0
  42. package/dist/defaults/home-dir.d.ts +3 -0
  43. package/dist/defaults/index.d.ts +12 -0
  44. package/dist/defaults/index.js +1239 -0
  45. package/dist/defaults/legacy-config-migration.d.ts +27 -0
  46. package/dist/defaults/load-push-defaults.d.ts +25 -0
  47. package/dist/defaults/project-config.d.ts +32 -0
  48. package/dist/defaults/project-ref.d.ts +34 -0
  49. package/dist/definitions/artifacts/artifact.d.ts +62 -0
  50. package/dist/definitions/artifacts/index.d.ts +1 -0
  51. package/dist/definitions/pipelines/define-default-pipeline-assignment.d.ts +263 -0
  52. package/dist/definitions/pipelines/index.d.ts +3 -0
  53. package/dist/definitions/pipelines/index.js +24 -0
  54. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +208 -0
  55. package/dist/definitions/pipelines/work-item-fields.d.ts +93 -0
  56. package/dist/definitions/steps/compile-mcps.d.ts +34 -0
  57. package/dist/definitions/steps/define-code-step.d.ts +84 -0
  58. package/dist/definitions/steps/define-mcp.d.ts +79 -0
  59. package/dist/definitions/steps/define-step.d.ts +137 -0
  60. package/dist/definitions/steps/env.d.ts +136 -0
  61. package/dist/definitions/steps/index.d.ts +14 -0
  62. package/dist/definitions/steps/index.js +73 -0
  63. package/dist/definitions/steps/mcp-server-config.d.ts +102 -0
  64. package/dist/definitions/steps/prompt-template.d.ts +24 -0
  65. package/dist/definitions/steps/repo.d.ts +67 -0
  66. package/dist/definitions/steps/runtime.d.ts +115 -0
  67. package/dist/definitions/steps/step-definitions-client.d.ts +400 -0
  68. package/dist/definitions/steps/step-features.d.ts +109 -0
  69. package/dist/definitions/steps/step-handle.d.ts +25 -0
  70. package/dist/definitions/steps/step-ref.d.ts +19 -0
  71. package/dist/definitions/validation/index.d.ts +2 -0
  72. package/dist/definitions/validation/index.js +17 -0
  73. package/dist/definitions/validation/validate-artifact-markers.d.ts +3 -0
  74. package/dist/definitions/validation/validate-artifacts.d.ts +7 -0
  75. package/dist/definitions/validation/validate-definition-specs.d.ts +16 -0
  76. package/dist/definitions/validation/validate-env.d.ts +15 -0
  77. package/dist/definitions/validation/validate-repo.d.ts +13 -0
  78. package/dist/definitions/validation/validate-runtime.d.ts +12 -0
  79. package/dist/definitions/validation/validation-issue.d.ts +11 -0
  80. package/dist/devcontainer-config-path.d.ts +21 -0
  81. package/dist/devcontainer-config-path.js +13 -0
  82. package/dist/env-vars.d.ts +136 -0
  83. package/dist/env-vars.js +35 -0
  84. package/dist/eslint.d.ts +42 -0
  85. package/dist/eslint.js +125 -0
  86. package/dist/generated/client/client.gen.d.ts +2 -0
  87. package/dist/generated/client/index.d.ts +8 -0
  88. package/dist/generated/client/types.gen.d.ts +117 -0
  89. package/dist/generated/client/utils.gen.d.ts +33 -0
  90. package/dist/generated/client.gen.d.ts +12 -0
  91. package/dist/generated/core/auth.gen.d.ts +18 -0
  92. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  93. package/dist/generated/core/params.gen.d.ts +43 -0
  94. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  95. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  96. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  97. package/dist/generated/core/types.gen.d.ts +78 -0
  98. package/dist/generated/core/utils.gen.d.ts +19 -0
  99. package/dist/generated/index.d.ts +2 -0
  100. package/dist/generated/sdk.gen.d.ts +302 -0
  101. package/dist/generated/types.gen.d.ts +18368 -0
  102. package/dist/git-url/git-remote.d.ts +30 -0
  103. package/dist/git-url/git-repo-identity.d.ts +44 -0
  104. package/dist/git-url/git-repo-identity.js +159 -0
  105. package/dist/git-url/parse-git-host.d.ts +23 -0
  106. package/dist/health-checks.d.ts +169 -0
  107. package/dist/health-checks.js +19 -0
  108. package/dist/index.d.ts +11 -0
  109. package/dist/index.js +293 -0
  110. package/dist/jsonc.d.ts +3 -0
  111. package/dist/jsonc.js +11 -0
  112. package/dist/managed-runtimes.d.ts +20 -0
  113. package/dist/managed-runtimes.js +13 -0
  114. package/dist/opencode-mcp.d.ts +313 -0
  115. package/dist/opencode-mcp.js +29 -0
  116. package/dist/pipelines/chain.d.ts +7 -0
  117. package/dist/pipelines/compile-args.d.ts +12 -0
  118. package/dist/pipelines/compile-chain.d.ts +9 -0
  119. package/dist/pipelines/compile-checks.d.ts +16 -0
  120. package/dist/pipelines/compile-state.d.ts +30 -0
  121. package/dist/pipelines/condition-data.d.ts +78 -0
  122. package/dist/pipelines/conditions.d.ts +47 -0
  123. package/dist/pipelines/context.d.ts +16 -0
  124. package/dist/pipelines/define-pipeline.d.ts +32 -0
  125. package/dist/pipelines/each.d.ts +5 -0
  126. package/dist/pipelines/errors.d.ts +26 -0
  127. package/dist/pipelines/handles.d.ts +29 -0
  128. package/dist/pipelines/index.d.ts +18 -0
  129. package/dist/pipelines/index.js +80 -0
  130. package/dist/pipelines/model.d.ts +103 -0
  131. package/dist/pipelines/nodes.d.ts +54 -0
  132. package/dist/pipelines/ref-types.d.ts +54 -0
  133. package/dist/pipelines/refs.d.ts +80 -0
  134. package/dist/pipelines/registry.d.ts +12 -0
  135. package/dist/pipelines/source.d.ts +17 -0
  136. package/dist/pipelines/types.d.ts +160 -0
  137. package/dist/push/code-step-lookup.d.ts +32 -0
  138. package/dist/push/code-step-lookup.js +11 -0
  139. package/dist/push/collect-definitions.d.ts +70 -0
  140. package/dist/push/collect-pipeline-documents.d.ts +14 -0
  141. package/dist/push/index.d.ts +6 -0
  142. package/dist/push/index.js +328 -0
  143. package/dist/push/push-from-directory.d.ts +37 -0
  144. package/dist/repo-config.d.ts +80 -0
  145. package/dist/repo-config.js +23 -0
  146. package/dist/scarn-config-parser.d.ts +29 -0
  147. package/dist/scarn-config-parser.js +9 -0
  148. package/dist/task-plane-client.d.ts +489 -0
  149. package/dist/z.d.ts +7 -0
  150. package/package.json +132 -4
  151. package/README.md +0 -3
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Internal remote-URL parsing shared by the `git-url` helpers. Not exported
3
+ * from the SDK entry. No `node:` imports: Next client components use it.
4
+ *
5
+ * Scp form (`git@host:path`), `ssh://`, `git+ssh://`, `ssh+git://`, `git://`,
6
+ * `http://` and `https://` are accepted; local paths, `file://` and anything
7
+ * else unrecognised yield `null`. The host is lowercased; the path is kept
8
+ * verbatim apart from dropping any query and fragment.
9
+ *
10
+ * Parsing follows `packages/worker/src/runtime/runtime-service/domain/git-mirror-key.ts`,
11
+ * which deliberately keeps the scheme and is not shared.
12
+ */
13
+ export declare const DEFAULT_PORTS: Readonly<Record<string, string>>;
14
+ export type ParsedRemote = {
15
+ scheme: string;
16
+ host: string;
17
+ port: string | null;
18
+ path: string;
19
+ };
20
+ export type UrlFormParts = {
21
+ scheme: string;
22
+ prefix: string;
23
+ userinfo: string | null;
24
+ hostPort: string;
25
+ remainder: string;
26
+ };
27
+ export declare function parseRemote(rawUrl: string): ParsedRemote | null;
28
+ export declare function hasDefaultPort(remote: ParsedRemote): boolean;
29
+ export declare function splitUrlForm(value: string): UrlFormParts | null;
30
+ export declare function normalisePath(path: string): string;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Pure helpers for comparing and displaying git remote URLs. No `node:`
3
+ * imports: Next client components use this module.
4
+ *
5
+ * A repository's **identity key** is `host[:port]/path`, so every spelling of
6
+ * the same remote compares equal:
7
+ * - scp form (`git@host:path`), `ssh://`, `git+ssh://`, `ssh+git://`,
8
+ * `git://`, `http://` and `https://` are accepted;
9
+ * - the scheme, userinfo, query, fragment and default ports are dropped;
10
+ * - the host is lowercased, and a trailing `/` and `.git` are stripped;
11
+ * - the path is lowercased for `github.com` only, whose paths are
12
+ * case-insensitive;
13
+ * - local paths, `file://` and anything else unrecognised yield `null`.
14
+ *
15
+ * The identity key is for comparison only. A stored `gitUrl` is never
16
+ * rewritten to it, because workers clone the stored URL verbatim.
17
+ */
18
+ export { parseGitHost } from "./parse-git-host";
19
+ export type { GitHost, GitHostKind } from "./parse-git-host";
20
+ /**
21
+ * The identity key for `rawUrl` (e.g. `"github.com/acme/repo"`), or `null`
22
+ * when it is a local path, a `file://` URL, or not a recognised remote.
23
+ */
24
+ export declare function gitRepoIdentity(rawUrl: string): string | null;
25
+ /**
26
+ * Whether two remote URLs point at the same repository: their identity keys
27
+ * match, or — when either has no identity key — the raw strings are equal.
28
+ */
29
+ export declare function isSameGitRepo(a: string, b: string): boolean;
30
+ /**
31
+ * `rawUrl` with any credential removed, safe to print or put in a link. For
32
+ * `http(s)` the whole userinfo goes, since a bare username there is often a
33
+ * token; for other URL schemes only a `:password` part goes, keeping an
34
+ * ssh-style `git@`. Anything not in URL form is returned unchanged.
35
+ */
36
+ export declare function stripGitUrlCredentials(rawUrl: string): string;
37
+ /**
38
+ * The GitHub `owner`/`name` of `rawUrl`, in the casing the URL uses, or `null`
39
+ * when it is not a `github.com/<owner>/<name>` remote.
40
+ */
41
+ export declare function parseGitHubRepo(rawUrl: string): {
42
+ owner: string;
43
+ name: string;
44
+ } | null;
@@ -0,0 +1,159 @@
1
+ // @bun
2
+ // src/git-url/git-remote.ts
3
+ var DEFAULT_PORTS = {
4
+ http: "80",
5
+ https: "443",
6
+ ssh: "22",
7
+ "git+ssh": "22",
8
+ "ssh+git": "22",
9
+ git: "9418"
10
+ };
11
+ var URL_FORM = /^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/(.*)$/s;
12
+ var SCP_FORM = /^(?:([^@/:\s]+)@)?([^@/:\s[\]]+):(?!:)(.+)$/;
13
+ var HOST_PORT = /^(\[[^\]]+\]|[^:[\]]+)(?::(\d*))?$/;
14
+ function parseRemote(rawUrl) {
15
+ const trimmed = rawUrl.trim();
16
+ if (trimmed === "") {
17
+ return null;
18
+ }
19
+ const urlForm = splitUrlForm(trimmed);
20
+ if (urlForm !== null) {
21
+ return parseUrlForm(urlForm);
22
+ }
23
+ if (URL_FORM.test(trimmed) || trimmed.startsWith("/")) {
24
+ return null;
25
+ }
26
+ return parseScpForm(trimmed);
27
+ }
28
+ function hasDefaultPort(remote) {
29
+ return remote.port === null || remote.port === DEFAULT_PORTS[remote.scheme];
30
+ }
31
+ function splitUrlForm(value) {
32
+ const match = URL_FORM.exec(value);
33
+ if (!match) {
34
+ return null;
35
+ }
36
+ const [, rawScheme = "", rest = ""] = match;
37
+ const scheme = rawScheme.toLowerCase();
38
+ if (!(scheme in DEFAULT_PORTS)) {
39
+ return null;
40
+ }
41
+ const authorityEnd = rest.search(/[/?#]/);
42
+ const authority = authorityEnd === -1 ? rest : rest.slice(0, authorityEnd);
43
+ const remainder = authorityEnd === -1 ? "" : rest.slice(authorityEnd);
44
+ const at = authority.lastIndexOf("@");
45
+ return {
46
+ scheme,
47
+ prefix: `${rawScheme}://`,
48
+ userinfo: at === -1 ? null : authority.slice(0, at),
49
+ hostPort: at === -1 ? authority : authority.slice(at + 1),
50
+ remainder
51
+ };
52
+ }
53
+ function normalisePath(path) {
54
+ return path.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\.git$/, "").replace(/\/+$/, "");
55
+ }
56
+ function parseUrlForm(parts) {
57
+ const match = HOST_PORT.exec(parts.hostPort);
58
+ if (!match) {
59
+ return null;
60
+ }
61
+ const [, host = "", port = ""] = match;
62
+ return {
63
+ scheme: parts.scheme,
64
+ host: host.toLowerCase(),
65
+ port: port === "" ? null : port,
66
+ path: parts.remainder.replace(/[?#].*$/s, "")
67
+ };
68
+ }
69
+ function parseScpForm(value) {
70
+ const match = SCP_FORM.exec(value);
71
+ if (!match) {
72
+ return null;
73
+ }
74
+ const [, , host = "", path = ""] = match;
75
+ if (host.length === 1) {
76
+ return null;
77
+ }
78
+ return { scheme: "ssh", host: host.toLowerCase(), port: null, path };
79
+ }
80
+
81
+ // src/git-url/parse-git-host.ts
82
+ var OTHER = { host: "other" };
83
+ function parseGitHost(rawUrl) {
84
+ const parsed = parseRemote(rawUrl);
85
+ if (parsed === null || !hasDefaultPort(parsed)) {
86
+ return OTHER;
87
+ }
88
+ const segments = normalisePath(parsed.path).split("/");
89
+ if (segments.length !== 2) {
90
+ return OTHER;
91
+ }
92
+ const [first = "", second = ""] = segments;
93
+ if (first === "" || second === "") {
94
+ return OTHER;
95
+ }
96
+ switch (parsed.host) {
97
+ case "github.com":
98
+ return {
99
+ host: "github",
100
+ owner: first,
101
+ name: second,
102
+ webUrl: `https://github.com/${first}/${second}`
103
+ };
104
+ case "bitbucket.org":
105
+ return {
106
+ host: "bitbucket",
107
+ workspace: first,
108
+ slug: second,
109
+ webUrl: `https://bitbucket.org/${first}/${second}`
110
+ };
111
+ default:
112
+ return OTHER;
113
+ }
114
+ }
115
+
116
+ // src/git-url/git-repo-identity.ts
117
+ var HTTP_SCHEMES = new Set(["http", "https"]);
118
+ var CASE_INSENSITIVE_PATH_HOSTS = new Set(["github.com"]);
119
+ function gitRepoIdentity(rawUrl) {
120
+ const parsed = parseRemote(rawUrl);
121
+ if (parsed === null) {
122
+ return null;
123
+ }
124
+ const path = normalisePath(parsed.path);
125
+ if (path === "") {
126
+ return null;
127
+ }
128
+ const port = parsed.port === null || hasDefaultPort(parsed) ? "" : `:${parsed.port}`;
129
+ const caseFoldedPath = CASE_INSENSITIVE_PATH_HOSTS.has(parsed.host) ? path.toLowerCase() : path;
130
+ return `${parsed.host}${port}/${caseFoldedPath}`;
131
+ }
132
+ function isSameGitRepo(a, b) {
133
+ const left = gitRepoIdentity(a);
134
+ const right = gitRepoIdentity(b);
135
+ if (left === null || right === null) {
136
+ return a === b;
137
+ }
138
+ return left === right;
139
+ }
140
+ function stripGitUrlCredentials(rawUrl) {
141
+ const parts = splitUrlForm(rawUrl.trim());
142
+ if (parts === null || parts.userinfo === null) {
143
+ return rawUrl;
144
+ }
145
+ const keptUser = HTTP_SCHEMES.has(parts.scheme) ? "" : parts.userinfo.split(":")[0] ?? "";
146
+ const userPart = keptUser === "" ? "" : `${keptUser}@`;
147
+ return `${parts.prefix}${userPart}${parts.hostPort}${parts.remainder}`;
148
+ }
149
+ function parseGitHubRepo(rawUrl) {
150
+ const repo = parseGitHost(rawUrl);
151
+ return repo.host === "github" ? { owner: repo.owner, name: repo.name } : null;
152
+ }
153
+ export {
154
+ gitRepoIdentity,
155
+ isSameGitRepo,
156
+ parseGitHost,
157
+ parseGitHubRepo,
158
+ stripGitUrlCredentials
159
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Detects which supported repo host a git remote URL points at. No `node:`
3
+ * imports: Next client components use this module.
4
+ *
5
+ * Only `github.com/<owner>/<name>` and `bitbucket.org/<workspace>/<slug>` on
6
+ * the default port are recognised; every other remote, local path or
7
+ * unparseable string is `other`. Path segments keep the casing the URL uses.
8
+ */
9
+ export type GitHost = {
10
+ host: "github";
11
+ owner: string;
12
+ name: string;
13
+ webUrl: string;
14
+ } | {
15
+ host: "bitbucket";
16
+ workspace: string;
17
+ slug: string;
18
+ webUrl: string;
19
+ } | {
20
+ host: "other";
21
+ };
22
+ export type GitHostKind = GitHost["host"];
23
+ export declare function parseGitHost(rawUrl: string): GitHost;
@@ -0,0 +1,169 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Severity of a step-declared health check.
4
+ *
5
+ * `required` (default) fails the step immediately if the check fails.
6
+ * `warn` is advisory — it is reported but never fails the step.
7
+ */
8
+ export declare const healthCheckSeverityValues: readonly ["required", "warn"];
9
+ export type HealthCheckSeverity = (typeof healthCheckSeverityValues)[number];
10
+ /**
11
+ * A health check verified by forcing a real OpenCode tool call against the
12
+ * launched environment before the agent starts working.
13
+ *
14
+ * `tool` is a bare tool name when `mcp` is set (resolved at runtime to
15
+ * `${mcp}_${tool}`, matching OpenCode's MCP tool-naming convention), or a flat
16
+ * tool id otherwise (plugin tools, standalone tools, built-ins already share
17
+ * one flat namespace, so no qualifier applies).
18
+ */
19
+ export declare const toolHealthCheckSchema: z.ZodObject<{
20
+ name: z.ZodOptional<z.ZodString>;
21
+ severity: z.ZodDefault<z.ZodEnum<{
22
+ required: "required";
23
+ warn: "warn";
24
+ }>>;
25
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
26
+ serialGroup: z.ZodOptional<z.ZodString>;
27
+ kind: z.ZodDefault<z.ZodLiteral<"tool">>;
28
+ tool: z.ZodString;
29
+ mcp: z.ZodOptional<z.ZodString>;
30
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ }, z.core.$strict>;
32
+ /**
33
+ * A health check verified by running a command through OpenCode's `bash`
34
+ * tool inside the step's actual execution environment, and reading the real
35
+ * exit code back out of the tool result (not just call-completion status —
36
+ * see `force-and-verify-cli-health-check.ts`).
37
+ */
38
+ export declare const cliHealthCheckSchema: z.ZodObject<{
39
+ name: z.ZodOptional<z.ZodString>;
40
+ severity: z.ZodDefault<z.ZodEnum<{
41
+ required: "required";
42
+ warn: "warn";
43
+ }>>;
44
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
45
+ serialGroup: z.ZodOptional<z.ZodString>;
46
+ kind: z.ZodLiteral<"cli">;
47
+ command: z.ZodArray<z.ZodString>;
48
+ expectExitCode: z.ZodDefault<z.ZodInt>;
49
+ }, z.core.$strict>;
50
+ export declare const healthCheckSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
51
+ name: z.ZodOptional<z.ZodString>;
52
+ severity: z.ZodDefault<z.ZodEnum<{
53
+ required: "required";
54
+ warn: "warn";
55
+ }>>;
56
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
57
+ serialGroup: z.ZodOptional<z.ZodString>;
58
+ kind: z.ZodDefault<z.ZodLiteral<"tool">>;
59
+ tool: z.ZodString;
60
+ mcp: z.ZodOptional<z.ZodString>;
61
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
+ }, z.core.$strict>, z.ZodObject<{
63
+ name: z.ZodOptional<z.ZodString>;
64
+ severity: z.ZodDefault<z.ZodEnum<{
65
+ required: "required";
66
+ warn: "warn";
67
+ }>>;
68
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
69
+ serialGroup: z.ZodOptional<z.ZodString>;
70
+ kind: z.ZodLiteral<"cli">;
71
+ command: z.ZodArray<z.ZodString>;
72
+ expectExitCode: z.ZodDefault<z.ZodInt>;
73
+ }, z.core.$strict>], "kind">>;
74
+ /**
75
+ * The full value of a step's `healthChecks` field.
76
+ */
77
+ export declare const healthChecksSchema: z.ZodArray<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ name: z.ZodOptional<z.ZodString>;
79
+ severity: z.ZodDefault<z.ZodEnum<{
80
+ required: "required";
81
+ warn: "warn";
82
+ }>>;
83
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
84
+ serialGroup: z.ZodOptional<z.ZodString>;
85
+ kind: z.ZodDefault<z.ZodLiteral<"tool">>;
86
+ tool: z.ZodString;
87
+ mcp: z.ZodOptional<z.ZodString>;
88
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ }, z.core.$strict>, z.ZodObject<{
90
+ name: z.ZodOptional<z.ZodString>;
91
+ severity: z.ZodDefault<z.ZodEnum<{
92
+ required: "required";
93
+ warn: "warn";
94
+ }>>;
95
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
96
+ serialGroup: z.ZodOptional<z.ZodString>;
97
+ kind: z.ZodLiteral<"cli">;
98
+ command: z.ZodArray<z.ZodString>;
99
+ expectExitCode: z.ZodDefault<z.ZodInt>;
100
+ }, z.core.$strict>], "kind">>>;
101
+ export type ToolHealthCheck = z.infer<typeof toolHealthCheckSchema>;
102
+ export type CliHealthCheck = z.infer<typeof cliHealthCheckSchema>;
103
+ export type HealthCheck = z.infer<typeof healthCheckSchema>;
104
+ export type HealthChecks = z.infer<typeof healthChecksSchema>;
105
+ /**
106
+ * The pre-parse authoring shape of a single health check — what a step
107
+ * author actually writes in `defineStep({ healthChecks: [...] })` — as
108
+ * opposed to `HealthCheck`, the post-parse output shape `packages/worker`'s
109
+ * runner narrows on (`kind` always present, defaulted).
110
+ *
111
+ * Derived from the two arm schemas directly (`z.input<typeof
112
+ * toolHealthCheckSchema | typeof cliHealthCheckSchema>`), not from
113
+ * `healthCheckSchema`/`healthChecksSchema` — those are `z.preprocess`-wrapped,
114
+ * and a preprocessed schema's `z.input` type collapses to `unknown` (the
115
+ * preprocess function's own input is unconstrained), so it can't back a
116
+ * real authoring-time type. `kind` is optional on the tool arm (it
117
+ * defaults to `"tool"` — decision ledger #2's "omit `kind` for a tool
118
+ * check" ergonomics apply at the authoring layer too, not just to legacy
119
+ * persisted rows) and a required literal `"cli"` on the cli arm (no
120
+ * default exists for it).
121
+ */
122
+ export type HealthCheckInput = z.input<typeof toolHealthCheckSchema> | z.input<typeof cliHealthCheckSchema>;
123
+ /** The pre-parse authoring shape of a step's `healthChecks` field. */
124
+ export type HealthChecksInput = HealthCheckInput[];
125
+ /**
126
+ * A `tool` check as written in `defineStep({ healthChecks })`: a plugin or
127
+ * built-in tool, never an MCP tool. MCP health checks are declared on the
128
+ * server with `defineMcp`, which compiles them to wire checks carrying `mcp`.
129
+ */
130
+ export declare const stepToolHealthCheckSchema: z.ZodObject<{
131
+ name: z.ZodOptional<z.ZodString>;
132
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
133
+ kind: z.ZodDefault<z.ZodLiteral<"tool">>;
134
+ severity: z.ZodDefault<z.ZodEnum<{
135
+ required: "required";
136
+ warn: "warn";
137
+ }>>;
138
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
139
+ serialGroup: z.ZodOptional<z.ZodString>;
140
+ tool: z.ZodString;
141
+ }, z.core.$strict>;
142
+ /** The value of `defineStep({ healthChecks })`: `cli` and non-MCP `tool` checks. */
143
+ export declare const stepHealthChecksInputSchema: z.ZodArray<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
144
+ name: z.ZodOptional<z.ZodString>;
145
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
146
+ kind: z.ZodDefault<z.ZodLiteral<"tool">>;
147
+ severity: z.ZodDefault<z.ZodEnum<{
148
+ required: "required";
149
+ warn: "warn";
150
+ }>>;
151
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
152
+ serialGroup: z.ZodOptional<z.ZodString>;
153
+ tool: z.ZodString;
154
+ }, z.core.$strict>, z.ZodObject<{
155
+ name: z.ZodOptional<z.ZodString>;
156
+ severity: z.ZodDefault<z.ZodEnum<{
157
+ required: "required";
158
+ warn: "warn";
159
+ }>>;
160
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
161
+ serialGroup: z.ZodOptional<z.ZodString>;
162
+ kind: z.ZodLiteral<"cli">;
163
+ command: z.ZodArray<z.ZodString>;
164
+ expectExitCode: z.ZodDefault<z.ZodInt>;
165
+ }, z.core.$strict>], "kind">>>;
166
+ /** The pre-parse authoring shape of one `defineStep({ healthChecks })` entry. */
167
+ export type StepHealthCheckInput = z.input<typeof stepToolHealthCheckSchema> | z.input<typeof cliHealthCheckSchema>;
168
+ /** The pre-parse authoring shape of `defineStep({ healthChecks })`. */
169
+ export type StepHealthChecksInput = StepHealthCheckInput[];
@@ -0,0 +1,19 @@
1
+ // @bun
2
+ import {
3
+ healthCheckSeverityValues2,
4
+ toolHealthCheckSchema2,
5
+ cliHealthCheckSchema2,
6
+ healthCheckSchema2,
7
+ healthChecksSchema2,
8
+ stepToolHealthCheckSchema2,
9
+ stepHealthChecksInputSchema2
10
+ } from "./chunk-zpqyjgb4.js";
11
+ export {
12
+ cliHealthCheckSchema2 as cliHealthCheckSchema,
13
+ healthCheckSchema2 as healthCheckSchema,
14
+ healthCheckSeverityValues2 as healthCheckSeverityValues,
15
+ healthChecksSchema2 as healthChecksSchema,
16
+ stepHealthChecksInputSchema2 as stepHealthChecksInputSchema,
17
+ stepToolHealthCheckSchema2 as stepToolHealthCheckSchema,
18
+ toolHealthCheckSchema2 as toolHealthCheckSchema
19
+ };
@@ -0,0 +1,11 @@
1
+ export * as z from "./z";
2
+ export * from "./client";
3
+ export * from "./contracts/artifacts";
4
+ export * from "./contracts/artifact-markers";
5
+ export * from "./definitions/steps";
6
+ export * from "./definitions/pipelines";
7
+ export * from "./pipelines";
8
+ export type { PipelineDefinition } from "./pipelines";
9
+ export * from "./opencode-mcp";
10
+ export * from "./jsonc";
11
+ export * from "./scarn-config-parser";