@scarn/sdk 0.8.20 → 0.8.22

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 (102) hide show
  1. package/dist/auth/api-token-cache.d.ts +24 -0
  2. package/dist/auth/api-token-source.d.ts +39 -0
  3. package/dist/auth/authenticated-fetch.d.ts +10 -0
  4. package/dist/auth/index.d.ts +3 -0
  5. package/dist/auth/index.js +19 -0
  6. package/dist/automations/index.js +14 -17
  7. package/dist/{chunk-habmdf89.js → chunk-0bwsjn0b.js} +29 -29
  8. package/dist/{chunk-mzj1j0p5.js → chunk-0w13kxkr.js} +34 -31
  9. package/dist/{chunk-qgkx89eg.js → chunk-3j5wf2t5.js} +44 -43
  10. package/dist/{chunk-0y2fy5en.js → chunk-4361gxk0.js} +7 -7
  11. package/dist/{chunk-n3ywwx7n.js → chunk-52520csz.js} +15 -14
  12. package/dist/chunk-5dnfgyx8.js +159 -0
  13. package/dist/{chunk-tr3v83cn.js → chunk-5fa4arn1.js} +18 -11
  14. package/dist/{chunk-ngy1fdcx.js → chunk-631ffb6r.js} +10 -10
  15. package/dist/{chunk-01nfqm18.js → chunk-7anj08zc.js} +11 -9
  16. package/dist/{chunk-yq0sf8sb.js → chunk-7dr4kybf.js} +483 -451
  17. package/dist/chunk-7mhr5aex.js +171 -0
  18. package/dist/chunk-7rywbqzz.js +27 -0
  19. package/dist/{chunk-yf15kdte.js → chunk-9ct3xypr.js} +2636 -3864
  20. package/dist/chunk-9geh4c3v.js +1034 -0
  21. package/dist/{chunk-19brnwkp.js → chunk-9qf0eg7m.js} +19 -19
  22. package/dist/{chunk-y11p1q7r.js → chunk-aqqywy8g.js} +4 -4
  23. package/dist/chunk-bcvx11fn.js +174 -0
  24. package/dist/{chunk-z4smq8qd.js → chunk-cyfeaz43.js} +86 -86
  25. package/dist/chunk-czq37rrt.js +286 -0
  26. package/dist/chunk-ec5z8bbq.js +126 -0
  27. package/dist/{chunk-rt9tq4j6.js → chunk-h9yxx0hd.js} +7 -7
  28. package/dist/{chunk-t1dq2c2s.js → chunk-hma87efq.js} +40 -40
  29. package/dist/{chunk-5dny5jg1.js → chunk-hpv234hf.js} +11 -11
  30. package/dist/{chunk-rq5k7m33.js → chunk-k7xnsmp5.js} +182 -97
  31. package/dist/{chunk-91f5gm5z.js → chunk-kbpkpxcn.js} +22 -21
  32. package/dist/{chunk-6tra3gw8.js → chunk-kjn1knb9.js} +7 -7
  33. package/dist/{chunk-g4j5cfpc.js → chunk-p3s7cjfc.js} +17 -16
  34. package/dist/chunk-pq6hrtnb.js +49 -0
  35. package/dist/{chunk-mp2rqtcj.js → chunk-ptpy7nnm.js} +8 -8
  36. package/dist/{chunk-xqfj56m9.js → chunk-vn1rfxma.js} +8 -8
  37. package/dist/chunk-vyv8kvkv.js +113 -0
  38. package/dist/{chunk-0c60x3v8.js → chunk-xe2zgyz7.js} +35 -35
  39. package/dist/chunk-y4dwmhn2.js +14 -0
  40. package/dist/{chunk-098740f7.js → chunk-yypj3zn0.js} +8 -8
  41. package/dist/chunk-yzj1mfpr.js +1515 -0
  42. package/dist/client.d.ts +5 -1
  43. package/dist/client.js +62 -61
  44. package/dist/connectors/index.js +36 -37
  45. package/dist/contracts/artifact-markers.js +11 -12
  46. package/dist/contracts/artifacts.js +21 -23
  47. package/dist/contracts/automation-document/index.js +28 -30
  48. package/dist/contracts/pipeline-document/built-ins.d.ts +1 -1
  49. package/dist/contracts/pipeline-document/index.js +95 -97
  50. package/dist/contracts/step-artifact-submissions.js +20 -17
  51. package/dist/contracts/work-item-changes.js +8 -6
  52. package/dist/create-api-client.d.ts +11 -0
  53. package/dist/defaults/index.js +44 -884
  54. package/dist/defaults/load-push-defaults.d.ts +11 -4
  55. package/dist/defaults/project-ref.d.ts +2 -4
  56. package/dist/definitions/automations/automations-client.d.ts +2 -1
  57. package/dist/definitions/automations/index.js +6 -8
  58. package/dist/definitions/environments/environments-client.d.ts +2 -1
  59. package/dist/definitions/environments/index.js +37 -38
  60. package/dist/definitions/pipelines/index.js +12 -14
  61. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +2 -1
  62. package/dist/definitions/steps/define-mcp.d.ts +2 -2
  63. package/dist/definitions/steps/index.js +93 -95
  64. package/dist/definitions/steps/mcp-server-config.d.ts +13 -3
  65. package/dist/definitions/steps/step-definitions-client.d.ts +20 -1
  66. package/dist/definitions/validation/index.js +17 -18
  67. package/dist/devcontainer-config-path.js +9 -11
  68. package/dist/env-vars.js +37 -39
  69. package/dist/environment.js +41 -42
  70. package/dist/eslint.js +0 -2
  71. package/dist/generated/index.d.ts +2 -2
  72. package/dist/generated/sdk.gen.d.ts +41 -1
  73. package/dist/generated/types.gen.d.ts +1801 -0
  74. package/dist/git-url/git-repo-identity.js +0 -2
  75. package/dist/health-checks.js +15 -17
  76. package/dist/index.js +364 -358
  77. package/dist/jsonc.js +7 -8
  78. package/dist/managed-connections.d.ts +16 -0
  79. package/dist/managed-connections.js +9 -0
  80. package/dist/managed-runtimes.js +9 -11
  81. package/dist/opencode-mcp.d.ts +55 -1
  82. package/dist/opencode-mcp.js +33 -28
  83. package/dist/pipelines/index.js +78 -81
  84. package/dist/push/code-step-lookup.js +9 -10
  85. package/dist/push/index.d.ts +1 -0
  86. package/dist/push/index.js +109 -79
  87. package/dist/push/push-from-directory.d.ts +9 -1
  88. package/dist/push/pushed-mcp-servers.d.ts +28 -0
  89. package/dist/repo-config.js +41 -43
  90. package/dist/resolve-environment.js +14 -15
  91. package/dist/scarn-config-parser.js +5 -6
  92. package/dist/task-plane-client.d.ts +143 -1
  93. package/package.json +11 -3
  94. package/dist/chunk-46wmsgv7.js +0 -14
  95. package/dist/chunk-a56zc4s5.js +0 -119
  96. package/dist/chunk-aemxz9r7.js +0 -107
  97. package/dist/chunk-b9ja6ss5.js +0 -275
  98. package/dist/chunk-e0pt5x0e.js +0 -167
  99. package/dist/chunk-pqtd0hr7.js +0 -96
  100. package/dist/chunk-rphfy0fj.js +0 -167
  101. package/dist/chunk-y34zsgsw.js +0 -39
  102. package/dist/chunk-y64skrwp.js +0 -17
@@ -1,7 +1,12 @@
1
+ import { type FetchLike } from "../auth";
1
2
  export interface PushDefaults {
2
3
  baseUrl: string;
3
4
  projectId: string | undefined;
4
- accessToken: string | undefined;
5
+ /**
6
+ * Authenticates requests to `baseUrl` with API tokens minted from the
7
+ * session token; undefined when there is no session token.
8
+ */
9
+ fetch: FetchLike | undefined;
5
10
  }
6
11
  export interface LoadPushDefaultsOptions {
7
12
  /**
@@ -13,12 +18,14 @@ export interface LoadPushDefaultsOptions {
13
18
  /**
14
19
  * Reads the conventional defaults for a `scarn pipelines push` run:
15
20
  * - `baseUrl`: from `SCARN_BASE_URL` env var or the built-in default.
16
- * - `accessToken`: from `SCARN_ACCESS_TOKEN` env var or the saved auth
17
- * profile for the resolved `baseUrl`.
21
+ * - `fetch`: authenticated with the session token from the
22
+ * `SCARN_ACCESS_TOKEN` env var or the saved auth profile for the resolved
23
+ * `baseUrl`. It mints short-lived API tokens from that session token,
24
+ * sharing `~/.scarn/api-tokens.jsonc` with the CLI.
18
25
  * - `projectId`: from `SCARN_PROJECT_ID` env var (a project id, which
19
26
  * `scarn pipelines push` sets after resolving the ref), or else the
20
27
  * `"project"` ref in the nearest ancestor `.scarn/scarn.jsonc` of
21
- * `opts.dir`, resolved against the server. Resolution needs `accessToken`;
28
+ * `opts.dir`, resolved against the server. Resolution needs a session token;
22
29
  * without one `projectId` is left undefined. A ref the server rejects throws
23
30
  * a `ProjectRefError` naming the ref.
24
31
  */
@@ -14,10 +14,8 @@ export declare class ProjectRefError extends Error {
14
14
  readonly ref: string;
15
15
  constructor(kind: ProjectRefErrorKind, ref: string, message: string);
16
16
  }
17
+ /** `client` authenticates its own requests (see `createScarnClient`'s `fetch`). */
17
18
  export interface ResolveProjectRefOptions {
18
- headers: {
19
- Authorization: string;
20
- };
21
19
  /**
22
20
  * What the caller is about to do, phrased to complete "You don't have
23
21
  * permission to …" — e.g. `"push pipelines to"`, `"run work for"`.
@@ -31,4 +29,4 @@ export declare const PROJECT_REF_FORMAT_HINT = "Expected \"<owner>/<project-slug
31
29
  * `GET /api/projects/resolve`. Every command that takes a project calls this
32
30
  * once, up front, and passes the id downstream.
33
31
  */
34
- export declare function resolveProjectRef(client: ScarnClient, ref: string, { headers, action }: ResolveProjectRefOptions): Promise<ResolvedProjectRef>;
32
+ export declare function resolveProjectRef(client: ScarnClient, ref: string, { action }?: ResolveProjectRefOptions): Promise<ResolvedProjectRef>;
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import type { ScarnClientOptions } from "../../client";
2
3
  import { Automations } from "../../generated/sdk.gen";
3
4
  import type { PutApiProjectsByProjectIdAutomationsByKeyResponses } from "../../generated/types.gen";
4
5
  type RequestOptions = {
@@ -31,7 +32,7 @@ export declare class AutomationsApiError extends Error {
31
32
  readonly issues: readonly AutomationDocumentIssue[];
32
33
  constructor(error: ApiError);
33
34
  }
34
- export declare function createAutomationsClient(baseUrl: string): ReturnType<typeof buildAutomationsClient>;
35
+ export declare function createAutomationsClient(baseUrl: string, options?: ScarnClientOptions): ReturnType<typeof buildAutomationsClient>;
35
36
  declare const buildAutomationsClient: (automations: Automations) => {
36
37
  listByProjectId: (projectId: string, options?: RequestOptions) => Promise<{
37
38
  id: string;
@@ -1,12 +1,10 @@
1
1
  // @bun
2
2
  import {
3
- AutomationsApiError,
4
- createAutomationsClient
5
- } from "../../chunk-g4j5cfpc.js";
6
- import"../../chunk-rq5k7m33.js";
7
- import"../../chunk-yf15kdte.js";
8
- import"../../chunk-y64skrwp.js";
3
+ AutomationsApiError2,
4
+ createAutomationsClient2
5
+ } from "../../chunk-p3s7cjfc.js";
6
+ import"../../chunk-k7xnsmp5.js";
9
7
  export {
10
- AutomationsApiError,
11
- createAutomationsClient
8
+ AutomationsApiError2 as AutomationsApiError,
9
+ createAutomationsClient2 as createAutomationsClient
12
10
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import type { ScarnClientOptions } from "../../client";
2
3
  import { Environments } from "../../generated/sdk.gen";
3
4
  import type { GetApiProjectsByProjectIdEnvironmentsByNameResponses, GetApiProjectsByProjectIdEnvironmentsResponses, PutApiProjectsByProjectIdEnvironmentsByNameData, PutApiProjectsByProjectIdEnvironmentsByNameResponses } from "../../generated/types.gen";
4
5
  type RequestOptions = {
@@ -32,7 +33,7 @@ export declare class EnvironmentsApiError extends Error {
32
33
  constructor(error: ApiError);
33
34
  }
34
35
  export type EnvironmentsClient = ReturnType<typeof buildEnvironmentsClient>;
35
- export declare function createEnvironmentsClient(baseUrl: string): EnvironmentsClient;
36
+ export declare function createEnvironmentsClient(baseUrl: string, options?: ScarnClientOptions): EnvironmentsClient;
36
37
  declare const buildEnvironmentsClient: (environments: Environments) => {
37
38
  listByProjectId: (projectId: string, options?: RequestOptions) => Promise<EnvironmentSummary[]>;
38
39
  /** The latest version's content, or version `options.version` when given. */
@@ -1,52 +1,51 @@
1
1
  // @bun
2
2
  import {
3
- EnvironmentsApiError,
4
- createEnvironmentsClient
5
- } from "../../chunk-n3ywwx7n.js";
3
+ containsInputToken2
4
+ } from "../../chunk-vyv8kvkv.js";
5
+ import"../../chunk-7rywbqzz.js";
6
+ import"../../chunk-5dnfgyx8.js";
6
7
  import {
7
- Env,
8
- Runtime,
9
- assertNoSetupVarsOnHost,
10
- compileConnectors,
11
- normalizeEnv
12
- } from "../../chunk-t1dq2c2s.js";
8
+ findMissingConnectorVars2
9
+ } from "../../chunk-3j5wf2t5.js";
10
+ import"../../chunk-yypj3zn0.js";
11
+ import"../../chunk-y4dwmhn2.js";
13
12
  import {
14
- isEnvironmentHandle
15
- } from "../../chunk-6tra3gw8.js";
13
+ environmentNameSchema2,
14
+ environmentContentSchema2
15
+ } from "../../chunk-bcvx11fn.js";
16
16
  import {
17
- environmentContentSchema,
18
- environmentNameSchema
19
- } from "../../chunk-e0pt5x0e.js";
20
- import"../../chunk-098740f7.js";
21
- import"../../chunk-46wmsgv7.js";
17
+ Env2,
18
+ normalizeEnv2,
19
+ Runtime2,
20
+ assertNoSetupVarsOnHost2,
21
+ compileConnectors2
22
+ } from "../../chunk-hma87efq.js";
22
23
  import {
23
- findMissingConnectorVars
24
- } from "../../chunk-qgkx89eg.js";
25
- import"../../chunk-pqtd0hr7.js";
24
+ isEnvironmentHandle2
25
+ } from "../../chunk-kjn1knb9.js";
26
+ import"../../chunk-k7xnsmp5.js";
26
27
  import {
27
- containsInputToken
28
- } from "../../chunk-aemxz9r7.js";
29
- import"../../chunk-rq5k7m33.js";
30
- import"../../chunk-yf15kdte.js";
31
- import"../../chunk-y64skrwp.js";
28
+ EnvironmentsApiError2,
29
+ createEnvironmentsClient2
30
+ } from "../../chunk-52520csz.js";
32
31
 
33
32
  // src/definitions/environments/define-environment.ts
34
33
  function compileContent(owner, config) {
35
34
  if (typeof config.vars === "function") {
36
35
  throw new Error(`${owner}: vars must be a record; an environment is shared across steps with different inputs, so it has no function form.`);
37
36
  }
38
- const vars = normalizeEnv(config.vars);
37
+ const vars = normalizeEnv2(config.vars);
39
38
  const tokenVar = (vars ?? []).find((entry) => [
40
39
  entry.source === "value" ? entry.value : undefined,
41
40
  entry.source === "inherit" ? entry.default : undefined
42
- ].some((value) => value !== undefined && containsInputToken(value)));
41
+ ].some((value) => value !== undefined && containsInputToken2(value)));
43
42
  if (tokenVar !== undefined) {
44
43
  throw new Error(`${owner} env "${tokenVar.name}": an environment is shared across steps with different inputs, so it cannot use {{input.\u2026}} tokens. Put input-dependent vars on the step's inline environment.`);
45
44
  }
46
- assertNoSetupVarsOnHost(vars, config.runtime, owner);
47
- const connectors = compileConnectors(config.connectors, owner);
45
+ assertNoSetupVarsOnHost2(vars, config.runtime, owner);
46
+ const connectors = compileConnectors2(config.connectors, owner);
48
47
  assertConnectorVars(owner, connectors ?? [], vars ?? []);
49
- const parsed = environmentContentSchema.safeParse({
48
+ const parsed = environmentContentSchema2.safeParse({
50
49
  ...config.description === undefined ? {} : { description: config.description },
51
50
  ...config.runtime === undefined ? {} : { runtime: config.runtime },
52
51
  ...vars === null ? {} : { vars },
@@ -57,14 +56,14 @@ function compileContent(owner, config) {
57
56
  throw new Error(`${owner}: ${parsed.error.issues.map((issue) => issue.path.length > 0 ? `${issue.path.map(String).join(".")}: ${issue.message}` : issue.message).join("; ")}`);
58
57
  }
59
58
  function assertConnectorVars(owner, connectors, vars) {
60
- const missing = findMissingConnectorVars(connectors, vars);
59
+ const missing = findMissingConnectorVars2(connectors, vars);
61
60
  if (missing.length === 0)
62
61
  return;
63
- throw new Error(`${owner} is missing variables its connectors need: ${missing.map(({ connector, vars: vars2 }) => `${connector} needs ${vars2.join(", ")}`).join("; ")}. Add them to the environment's vars.`);
62
+ throw new Error(`${owner} is missing variables its connectors need: ${missing.map(({ connector, vars }) => `${connector} needs ${vars.join(", ")}`).join("; ")}. Add them to the environment's vars.`);
64
63
  }
65
64
  function defineEnvironment(config) {
66
65
  const owner = `Environment "${config.name}"`;
67
- const name = environmentNameSchema.safeParse(config.name);
66
+ const name = environmentNameSchema2.safeParse(config.name);
68
67
  if (!name.success) {
69
68
  throw new Error(`${owner}: name ${name.error.issues.map((issue) => issue.message).join("; ")}`);
70
69
  }
@@ -87,11 +86,11 @@ function defineEnvironment(config) {
87
86
  });
88
87
  }
89
88
  export {
90
- Env,
91
- EnvironmentsApiError,
92
- Runtime,
93
- createEnvironmentsClient,
89
+ Env2 as Env,
90
+ EnvironmentsApiError2 as EnvironmentsApiError,
91
+ Runtime2 as Runtime,
92
+ createEnvironmentsClient2 as createEnvironmentsClient,
94
93
  defineEnvironment,
95
- environmentContentSchema,
96
- isEnvironmentHandle
94
+ environmentContentSchema2 as environmentContentSchema,
95
+ isEnvironmentHandle2 as isEnvironmentHandle
97
96
  };
@@ -1,18 +1,16 @@
1
1
  // @bun
2
2
  import {
3
- PipelineDefinitionsApiError,
4
- WORK_ITEM_FIELDS_PATH_PREFIX,
5
- WORK_ITEM_TOP_LEVEL_FIELDS,
6
- createPipelineDefinitionsClient,
7
- resolveWorkItemFieldPath
8
- } from "../../chunk-91f5gm5z.js";
9
- import"../../chunk-rq5k7m33.js";
10
- import"../../chunk-yf15kdte.js";
11
- import"../../chunk-y64skrwp.js";
3
+ PipelineDefinitionsApiError2,
4
+ createPipelineDefinitionsClient2,
5
+ WORK_ITEM_TOP_LEVEL_FIELDS2,
6
+ WORK_ITEM_FIELDS_PATH_PREFIX2,
7
+ resolveWorkItemFieldPath2
8
+ } from "../../chunk-kbpkpxcn.js";
9
+ import"../../chunk-k7xnsmp5.js";
12
10
  export {
13
- PipelineDefinitionsApiError,
14
- WORK_ITEM_FIELDS_PATH_PREFIX,
15
- WORK_ITEM_TOP_LEVEL_FIELDS,
16
- createPipelineDefinitionsClient,
17
- resolveWorkItemFieldPath
11
+ PipelineDefinitionsApiError2 as PipelineDefinitionsApiError,
12
+ WORK_ITEM_FIELDS_PATH_PREFIX2 as WORK_ITEM_FIELDS_PATH_PREFIX,
13
+ WORK_ITEM_TOP_LEVEL_FIELDS2 as WORK_ITEM_TOP_LEVEL_FIELDS,
14
+ createPipelineDefinitionsClient2 as createPipelineDefinitionsClient,
15
+ resolveWorkItemFieldPath2 as resolveWorkItemFieldPath
18
16
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import type { ScarnClientOptions } from "../../client";
2
3
  import { PipelineDefinitions } from "../../generated/sdk.gen";
3
4
  import type { PostApiPipelineDefinitionsByPipelineDefinitionIdVersionsResponses, PostApiPipelineDefinitionsResponses } from "../../generated/types.gen";
4
5
  type RequestOptions = {
@@ -31,7 +32,7 @@ export declare class PipelineDefinitionsApiError extends Error {
31
32
  readonly issues: readonly PipelineDocumentIssue[];
32
33
  constructor(error: ApiError);
33
34
  }
34
- export declare function createPipelineDefinitionsClient(baseUrl: string): ReturnType<typeof buildPipelineDefinitionsClient>;
35
+ export declare function createPipelineDefinitionsClient(baseUrl: string, options?: ScarnClientOptions): ReturnType<typeof buildPipelineDefinitionsClient>;
35
36
  declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefinitions) => {
36
37
  listByProjectId: (projectId: string, options?: RequestOptions) => Promise<{
37
38
  id: string;
@@ -67,8 +67,8 @@ export type ResolvedMcpCheck = {
67
67
  export declare function isMcpHandle(value: unknown): value is McpHandle;
68
68
  /**
69
69
  * Defines an MCP server once, with its env vars and health checks. Throws on
70
- * an invalid server field, a literal `environment`/`headers` value, or an
71
- * invalid check or env var name.
70
+ * an invalid server field, a literal `environment`/`headers` value, an
71
+ * invalid check or env var name, or env vars beside `auth`.
72
72
  */
73
73
  export declare function defineMcp<TChecks extends Record<string, McpCheckInput> = Record<never, never>>(config: DefineMcpConfig<TChecks>): McpHandle<keyof TChecks & string>;
74
74
  /**
@@ -1,102 +1,100 @@
1
1
  // @bun
2
2
  import {
3
- ARTIFACT_BRAND,
4
- Artifact,
5
- ArtifactTypes,
6
- Features,
7
- Notify,
8
- Repo,
9
- WorkBranch,
10
- artifact,
11
- assertBaseBranchFitsEnvironment,
12
- codeStep,
13
- compileMcps,
14
- compileRepo,
15
- compileStepConcurrency,
16
- compileStepErrors,
17
- compileStepMaxTurns,
18
- compileStepRetry,
19
- createStepDefinitionsClient,
20
- defineMcp,
21
- defineStep,
3
+ ARTIFACT_BRAND2,
4
+ ArtifactTypes2,
5
+ normalizeArtifactAccept2,
6
+ artifact2,
7
+ Artifact2,
22
8
  exports_z,
23
- grantActionValues,
24
- grantScopeValues,
25
- isMcpHandle,
26
- normalizeArtifactAccept,
27
- resolveMcpChecks,
28
- stepEnvironmentHandle,
29
- toStepHandle,
30
- toStepSpec
31
- } from "../../chunk-yq0sf8sb.js";
32
- import"../../chunk-y34zsgsw.js";
9
+ Repo2,
10
+ WorkBranch2,
11
+ compileRepo2,
12
+ assertBaseBranchFitsEnvironment2,
13
+ isMcpHandle2,
14
+ defineMcp2,
15
+ resolveMcpChecks2,
16
+ compileMcps2,
17
+ compileStepErrors2,
18
+ compileStepRetry2,
19
+ compileStepMaxTurns2,
20
+ compileStepConcurrency2,
21
+ toStepHandle2,
22
+ stepEnvironmentHandle2,
23
+ toStepSpec2,
24
+ defineStep2,
25
+ codeStep2,
26
+ createStepDefinitionsClient2,
27
+ grantActionValues2,
28
+ grantScopeValues2,
29
+ Features2,
30
+ Notify2
31
+ } from "../../chunk-7dr4kybf.js";
32
+ import"../../chunk-pq6hrtnb.js";
33
33
  import {
34
- Env,
35
- Runtime,
36
- assertNoSetupVarsOnHost,
37
- compileConnectors,
38
- compileEnvironment,
39
- createPromptInputProxy,
40
- createPromptTemplateContext,
41
- isSecretLookingEnvName,
42
- knownEnvironmentVars,
43
- normalizeEnv,
44
- renderPromptTemplate
45
- } from "../../chunk-t1dq2c2s.js";
46
- import"../../chunk-6tra3gw8.js";
47
- import"../../chunk-xqfj56m9.js";
48
- import"../../chunk-y11p1q7r.js";
49
- import"../../chunk-rphfy0fj.js";
50
- import"../../chunk-e0pt5x0e.js";
51
- import"../../chunk-098740f7.js";
52
- import"../../chunk-46wmsgv7.js";
53
- import"../../chunk-qgkx89eg.js";
54
- import"../../chunk-pqtd0hr7.js";
55
- import"../../chunk-aemxz9r7.js";
56
- import"../../chunk-rq5k7m33.js";
57
- import"../../chunk-ngy1fdcx.js";
58
- import"../../chunk-19brnwkp.js";
59
- import"../../chunk-01nfqm18.js";
60
- import"../../chunk-yf15kdte.js";
61
- import"../../chunk-y64skrwp.js";
34
+ createPromptInputProxy2,
35
+ createPromptTemplateContext2,
36
+ renderPromptTemplate2,
37
+ isSecretLookingEnvName2,
38
+ Env2,
39
+ normalizeEnv2,
40
+ Runtime2,
41
+ assertNoSetupVarsOnHost2,
42
+ compileConnectors2,
43
+ knownEnvironmentVars2,
44
+ compileEnvironment2
45
+ } from "../../chunk-hma87efq.js";
46
+ import"../../chunk-kjn1knb9.js";
47
+ import"../../chunk-vn1rfxma.js";
48
+ import"../../chunk-aqqywy8g.js";
49
+ import"../../chunk-7mhr5aex.js";
50
+ import"../../chunk-bcvx11fn.js";
51
+ import"../../chunk-yypj3zn0.js";
52
+ import"../../chunk-y4dwmhn2.js";
53
+ import"../../chunk-3j5wf2t5.js";
54
+ import"../../chunk-5dnfgyx8.js";
55
+ import"../../chunk-7rywbqzz.js";
56
+ import"../../chunk-vyv8kvkv.js";
57
+ import"../../chunk-k7xnsmp5.js";
58
+ import"../../chunk-631ffb6r.js";
59
+ import"../../chunk-9qf0eg7m.js";
62
60
  export {
63
- ARTIFACT_BRAND,
64
- Artifact,
65
- ArtifactTypes,
66
- Env,
67
- Features,
68
- Notify,
69
- Repo,
70
- Runtime,
71
- WorkBranch,
72
- artifact,
73
- assertBaseBranchFitsEnvironment,
74
- assertNoSetupVarsOnHost,
75
- codeStep,
76
- compileConnectors,
77
- compileEnvironment,
78
- compileMcps,
79
- compileRepo,
80
- compileStepConcurrency,
81
- compileStepErrors,
82
- compileStepMaxTurns,
83
- compileStepRetry,
84
- createPromptInputProxy,
85
- createPromptTemplateContext,
86
- createStepDefinitionsClient,
87
- defineMcp,
88
- defineStep,
89
- grantActionValues,
90
- grantScopeValues,
91
- isMcpHandle,
92
- isSecretLookingEnvName,
93
- knownEnvironmentVars,
94
- normalizeArtifactAccept,
95
- normalizeEnv,
96
- renderPromptTemplate,
97
- resolveMcpChecks,
98
- stepEnvironmentHandle,
99
- toStepHandle,
100
- toStepSpec,
61
+ ARTIFACT_BRAND2 as ARTIFACT_BRAND,
62
+ Artifact2 as Artifact,
63
+ ArtifactTypes2 as ArtifactTypes,
64
+ Env2 as Env,
65
+ Features2 as Features,
66
+ Notify2 as Notify,
67
+ Repo2 as Repo,
68
+ Runtime2 as Runtime,
69
+ WorkBranch2 as WorkBranch,
70
+ artifact2 as artifact,
71
+ assertBaseBranchFitsEnvironment2 as assertBaseBranchFitsEnvironment,
72
+ assertNoSetupVarsOnHost2 as assertNoSetupVarsOnHost,
73
+ codeStep2 as codeStep,
74
+ compileConnectors2 as compileConnectors,
75
+ compileEnvironment2 as compileEnvironment,
76
+ compileMcps2 as compileMcps,
77
+ compileRepo2 as compileRepo,
78
+ compileStepConcurrency2 as compileStepConcurrency,
79
+ compileStepErrors2 as compileStepErrors,
80
+ compileStepMaxTurns2 as compileStepMaxTurns,
81
+ compileStepRetry2 as compileStepRetry,
82
+ createPromptInputProxy2 as createPromptInputProxy,
83
+ createPromptTemplateContext2 as createPromptTemplateContext,
84
+ createStepDefinitionsClient2 as createStepDefinitionsClient,
85
+ defineMcp2 as defineMcp,
86
+ defineStep2 as defineStep,
87
+ grantActionValues2 as grantActionValues,
88
+ grantScopeValues2 as grantScopeValues,
89
+ isMcpHandle2 as isMcpHandle,
90
+ isSecretLookingEnvName2 as isSecretLookingEnvName,
91
+ knownEnvironmentVars2 as knownEnvironmentVars,
92
+ normalizeArtifactAccept2 as normalizeArtifactAccept,
93
+ normalizeEnv2 as normalizeEnv,
94
+ renderPromptTemplate2 as renderPromptTemplate,
95
+ resolveMcpChecks2 as resolveMcpChecks,
96
+ stepEnvironmentHandle2 as stepEnvironmentHandle,
97
+ toStepHandle2 as toStepHandle,
98
+ toStepSpec2 as toStepSpec,
101
99
  exports_z as z
102
100
  };
@@ -1,5 +1,8 @@
1
1
  import type { z } from "zod";
2
2
  declare const refFieldsSchema: z.ZodObject<{
3
+ auth: z.ZodOptional<z.ZodObject<{
4
+ connection: z.ZodString;
5
+ }, z.core.$strict>>;
3
6
  timeout: z.ZodOptional<z.ZodObject<{
4
7
  startup: z.ZodOptional<z.ZodInt>;
5
8
  catalog: z.ZodOptional<z.ZodInt>;
@@ -60,12 +63,18 @@ declare const remoteFieldsSchema: z.ZodObject<{
60
63
  legacy: "legacy";
61
64
  "2026-07-28": "2026-07-28";
62
65
  }>>;
66
+ auth: z.ZodOptional<z.ZodObject<{
67
+ connection: z.ZodString;
68
+ }, z.core.$strict>>;
63
69
  }, z.core.$strict>;
64
70
  /** The shared OpenCode fields a `ref` applies on top of the repo's definition. */
65
71
  export type McpRefServerFields = z.output<typeof refFieldsSchema>;
66
72
  /** A `local` server: `command`, `cwd?`, `environment?` and the shared fields. */
67
73
  export type McpLocalServerFields = z.output<typeof localFieldsSchema>;
68
- /** A `remote` server: `url`, `headers?`, `oauth?` and the shared fields. */
74
+ /**
75
+ * A `remote` server: `url`, `headers?`, `oauth?`, `auth?` and the shared
76
+ * fields.
77
+ */
69
78
  export type McpRemoteServerFields = z.output<typeof remoteFieldsSchema>;
70
79
  export type McpServerType = "ref" | "local" | "remote";
71
80
  /**
@@ -105,8 +114,9 @@ export declare function inferredMcpEnv(definition: McpServerDefinition): string[
105
114
  /**
106
115
  * Validates a `defineMcp` config's server half and returns it with its
107
116
  * OpenCode fields parsed. Throws on an unknown `type`, an invalid field, a
108
- * literal (non-`{env:VAR}`) `environment` or `headers` value, or a
109
- * placeholder naming an invalid or reserved variable.
117
+ * literal (non-`{env:VAR}`) `environment` or `headers` value, a
118
+ * placeholder naming an invalid or reserved variable, or an `auth` the
119
+ * server can't carry (see `remoteConnectionAuthIssues`).
110
120
  */
111
121
  export declare function parseMcpServer(config: McpServerConfig): McpServerDefinition;
112
122
  export {};
@@ -1,3 +1,4 @@
1
+ import type { ScarnClientOptions } from "../../client";
1
2
  import { StepDefinitions } from "../../generated/sdk.gen";
2
3
  import type { PostApiStepDefinitionsData, PutApiStepDefinitionsData } from "../../generated/types.gen";
3
4
  import type { StepDefinitionSpec } from "./define-step";
@@ -6,7 +7,7 @@ type RequestOptions = {
6
7
  };
7
8
  export type CreateStepDefinitionInput = PostApiStepDefinitionsData["body"];
8
9
  export type UpsertStepDefinitionInput = PutApiStepDefinitionsData["body"];
9
- export declare function createStepDefinitionsClient(baseUrl: string): ReturnType<typeof buildStepDefinitionsClient>;
10
+ export declare function createStepDefinitionsClient(baseUrl: string, options?: ScarnClientOptions): ReturnType<typeof buildStepDefinitionsClient>;
10
11
  declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) => {
11
12
  listByProjectId: (projectId: string, options?: RequestOptions) => Promise<{
12
13
  id: string;
@@ -162,6 +163,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
162
163
  mcp?: string;
163
164
  applies: "agent";
164
165
  }>;
166
+ auth?: {
167
+ connection: string;
168
+ };
165
169
  } | {
166
170
  type: "ref";
167
171
  name?: string;
@@ -175,6 +179,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
175
179
  mcp?: string;
176
180
  applies: "agent";
177
181
  }>;
182
+ auth?: {
183
+ connection: string;
184
+ };
178
185
  disabled?: boolean;
179
186
  codemode?: boolean;
180
187
  timeout?: {
@@ -379,6 +386,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
379
386
  mcp?: string;
380
387
  applies: "agent";
381
388
  }>;
389
+ auth?: {
390
+ connection: string;
391
+ };
382
392
  } | {
383
393
  type: "ref";
384
394
  name?: string;
@@ -392,6 +402,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
392
402
  mcp?: string;
393
403
  applies: "agent";
394
404
  }>;
405
+ auth?: {
406
+ connection: string;
407
+ };
395
408
  disabled?: boolean;
396
409
  codemode?: boolean;
397
410
  timeout?: {
@@ -606,6 +619,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
606
619
  mcp?: string;
607
620
  applies: "agent";
608
621
  }>;
622
+ auth?: {
623
+ connection: string;
624
+ };
609
625
  } | {
610
626
  type: "ref";
611
627
  name?: string;
@@ -619,6 +635,9 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
619
635
  mcp?: string;
620
636
  applies: "agent";
621
637
  }>;
638
+ auth?: {
639
+ connection: string;
640
+ };
622
641
  disabled?: boolean;
623
642
  codemode?: boolean;
624
643
  timeout?: {
@@ -1,22 +1,21 @@
1
1
  // @bun
2
2
  import {
3
- assertValidDefinitionSpecs,
4
- listPaths,
5
- validateDefinitionSpecs
6
- } from "../../chunk-0c60x3v8.js";
7
- import"../../chunk-rphfy0fj.js";
8
- import"../../chunk-e0pt5x0e.js";
9
- import"../../chunk-098740f7.js";
10
- import"../../chunk-46wmsgv7.js";
11
- import"../../chunk-qgkx89eg.js";
12
- import"../../chunk-pqtd0hr7.js";
13
- import"../../chunk-aemxz9r7.js";
14
- import"../../chunk-ngy1fdcx.js";
15
- import"../../chunk-19brnwkp.js";
16
- import"../../chunk-yf15kdte.js";
17
- import"../../chunk-y64skrwp.js";
3
+ listPaths2,
4
+ validateDefinitionSpecs2,
5
+ assertValidDefinitionSpecs2
6
+ } from "../../chunk-xe2zgyz7.js";
7
+ import"../../chunk-7mhr5aex.js";
8
+ import"../../chunk-bcvx11fn.js";
9
+ import"../../chunk-yypj3zn0.js";
10
+ import"../../chunk-y4dwmhn2.js";
11
+ import"../../chunk-3j5wf2t5.js";
12
+ import"../../chunk-5dnfgyx8.js";
13
+ import"../../chunk-7rywbqzz.js";
14
+ import"../../chunk-vyv8kvkv.js";
15
+ import"../../chunk-631ffb6r.js";
16
+ import"../../chunk-9qf0eg7m.js";
18
17
  export {
19
- assertValidDefinitionSpecs,
20
- listPaths,
21
- validateDefinitionSpecs
18
+ assertValidDefinitionSpecs2 as assertValidDefinitionSpecs,
19
+ listPaths2 as listPaths,
20
+ validateDefinitionSpecs2 as validateDefinitionSpecs
22
21
  };
@@ -1,15 +1,13 @@
1
1
  // @bun
2
2
  import {
3
- DEVCONTAINER_CONFIG_BASENAMES,
4
- MAX_DEVCONTAINER_CONFIG_PATH_LENGTH,
5
- devcontainerConfigPathSchema,
6
- normalizeDevcontainerConfigPath
7
- } from "./chunk-098740f7.js";
8
- import"./chunk-yf15kdte.js";
9
- import"./chunk-y64skrwp.js";
3
+ MAX_DEVCONTAINER_CONFIG_PATH_LENGTH2,
4
+ DEVCONTAINER_CONFIG_BASENAMES2,
5
+ normalizeDevcontainerConfigPath2,
6
+ devcontainerConfigPathSchema2
7
+ } from "./chunk-yypj3zn0.js";
10
8
  export {
11
- DEVCONTAINER_CONFIG_BASENAMES,
12
- MAX_DEVCONTAINER_CONFIG_PATH_LENGTH,
13
- devcontainerConfigPathSchema,
14
- normalizeDevcontainerConfigPath
9
+ DEVCONTAINER_CONFIG_BASENAMES2 as DEVCONTAINER_CONFIG_BASENAMES,
10
+ MAX_DEVCONTAINER_CONFIG_PATH_LENGTH2 as MAX_DEVCONTAINER_CONFIG_PATH_LENGTH,
11
+ devcontainerConfigPathSchema2 as devcontainerConfigPathSchema,
12
+ normalizeDevcontainerConfigPath2 as normalizeDevcontainerConfigPath
15
13
  };