@scarn/sdk 0.8.21 → 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 (91) hide show
  1. package/dist/auth/index.js +15 -16
  2. package/dist/automations/index.js +14 -17
  3. package/dist/{chunk-6p340dd4.js → chunk-0bwsjn0b.js} +29 -29
  4. package/dist/{chunk-r3sbp2wn.js → chunk-0w13kxkr.js} +34 -31
  5. package/dist/{chunk-nkm31g10.js → chunk-3j5wf2t5.js} +44 -43
  6. package/dist/{chunk-0y2fy5en.js → chunk-4361gxk0.js} +7 -7
  7. package/dist/{chunk-8tmsvkmj.js → chunk-52520csz.js} +13 -12
  8. package/dist/chunk-5dnfgyx8.js +159 -0
  9. package/dist/{chunk-k57h6qke.js → chunk-5fa4arn1.js} +12 -8
  10. package/dist/{chunk-ngy1fdcx.js → chunk-631ffb6r.js} +10 -10
  11. package/dist/{chunk-01nfqm18.js → chunk-7anj08zc.js} +11 -9
  12. package/dist/{chunk-p74r4y6j.js → chunk-7dr4kybf.js} +481 -449
  13. package/dist/chunk-7mhr5aex.js +171 -0
  14. package/dist/chunk-7rywbqzz.js +27 -0
  15. package/dist/{chunk-xhpp6qz8.js → chunk-9ct3xypr.js} +2552 -3780
  16. package/dist/{chunk-azss2d1n.js → chunk-9geh4c3v.js} +153 -155
  17. package/dist/{chunk-8hsk6f6b.js → chunk-9qf0eg7m.js} +19 -19
  18. package/dist/{chunk-y11p1q7r.js → chunk-aqqywy8g.js} +4 -4
  19. package/dist/chunk-bcvx11fn.js +174 -0
  20. package/dist/{chunk-59arcerk.js → chunk-cyfeaz43.js} +86 -86
  21. package/dist/chunk-czq37rrt.js +286 -0
  22. package/dist/chunk-ec5z8bbq.js +126 -0
  23. package/dist/{chunk-rt9tq4j6.js → chunk-h9yxx0hd.js} +7 -7
  24. package/dist/{chunk-gasw078g.js → chunk-hma87efq.js} +40 -40
  25. package/dist/{chunk-5dny5jg1.js → chunk-hpv234hf.js} +11 -11
  26. package/dist/{chunk-y81cr6tp.js → chunk-k7xnsmp5.js} +158 -87
  27. package/dist/{chunk-zxzvketc.js → chunk-kbpkpxcn.js} +20 -19
  28. package/dist/{chunk-6tra3gw8.js → chunk-kjn1knb9.js} +7 -7
  29. package/dist/{chunk-0he2dx5n.js → chunk-p3s7cjfc.js} +15 -14
  30. package/dist/chunk-pq6hrtnb.js +49 -0
  31. package/dist/{chunk-mp2rqtcj.js → chunk-ptpy7nnm.js} +8 -8
  32. package/dist/{chunk-xqfj56m9.js → chunk-vn1rfxma.js} +8 -8
  33. package/dist/chunk-vyv8kvkv.js +113 -0
  34. package/dist/{chunk-h1v6w1fh.js → chunk-xe2zgyz7.js} +35 -35
  35. package/dist/chunk-y4dwmhn2.js +14 -0
  36. package/dist/{chunk-8kzaxz52.js → chunk-yypj3zn0.js} +8 -8
  37. package/dist/chunk-yzj1mfpr.js +1515 -0
  38. package/dist/client.js +62 -61
  39. package/dist/connectors/index.js +36 -37
  40. package/dist/contracts/artifact-markers.js +11 -12
  41. package/dist/contracts/artifacts.js +21 -23
  42. package/dist/contracts/automation-document/index.js +28 -30
  43. package/dist/contracts/pipeline-document/built-ins.d.ts +1 -1
  44. package/dist/contracts/pipeline-document/index.js +95 -97
  45. package/dist/contracts/step-artifact-submissions.js +20 -17
  46. package/dist/contracts/work-item-changes.js +8 -6
  47. package/dist/defaults/index.js +22 -23
  48. package/dist/definitions/automations/index.js +6 -8
  49. package/dist/definitions/environments/index.js +37 -38
  50. package/dist/definitions/pipelines/index.js +12 -14
  51. package/dist/definitions/steps/define-mcp.d.ts +2 -2
  52. package/dist/definitions/steps/index.js +93 -95
  53. package/dist/definitions/steps/mcp-server-config.d.ts +13 -3
  54. package/dist/definitions/steps/step-definitions-client.d.ts +18 -0
  55. package/dist/definitions/validation/index.js +17 -18
  56. package/dist/devcontainer-config-path.js +9 -11
  57. package/dist/env-vars.js +37 -39
  58. package/dist/environment.js +41 -42
  59. package/dist/eslint.js +0 -2
  60. package/dist/generated/index.d.ts +2 -2
  61. package/dist/generated/sdk.gen.d.ts +41 -1
  62. package/dist/generated/types.gen.d.ts +1801 -0
  63. package/dist/git-url/git-repo-identity.js +0 -2
  64. package/dist/health-checks.js +15 -17
  65. package/dist/index.js +364 -358
  66. package/dist/jsonc.js +7 -8
  67. package/dist/managed-connections.d.ts +16 -0
  68. package/dist/managed-connections.js +9 -0
  69. package/dist/managed-runtimes.js +9 -11
  70. package/dist/opencode-mcp.d.ts +55 -1
  71. package/dist/opencode-mcp.js +33 -28
  72. package/dist/pipelines/index.js +78 -81
  73. package/dist/push/code-step-lookup.js +9 -10
  74. package/dist/push/index.d.ts +1 -0
  75. package/dist/push/index.js +88 -59
  76. package/dist/push/push-from-directory.d.ts +3 -0
  77. package/dist/push/pushed-mcp-servers.d.ts +28 -0
  78. package/dist/repo-config.js +41 -43
  79. package/dist/resolve-environment.js +14 -15
  80. package/dist/scarn-config-parser.js +5 -6
  81. package/dist/task-plane-client.d.ts +137 -1
  82. package/package.json +6 -2
  83. package/dist/chunk-08gcnrzh.js +0 -96
  84. package/dist/chunk-5say64w8.js +0 -14
  85. package/dist/chunk-aph2js2v.js +0 -167
  86. package/dist/chunk-mrzn5tq4.js +0 -107
  87. package/dist/chunk-pwyj6qf3.js +0 -119
  88. package/dist/chunk-qt81x1pm.js +0 -275
  89. package/dist/chunk-vsp708vw.js +0 -167
  90. package/dist/chunk-y64skrwp.js +0 -17
  91. package/dist/chunk-y7ac1t9c.js +0 -39
@@ -1,48 +1,52 @@
1
1
  // @bun
2
+ import"../chunk-aqqywy8g.js";
2
3
  import {
3
- EnvironmentsApiError,
4
- createEnvironmentsClient
5
- } from "../chunk-8tmsvkmj.js";
4
+ isStepDefinitionSpec2,
5
+ isEnvironmentHandle2,
6
+ stepsInModule2
7
+ } from "../chunk-kjn1knb9.js";
8
+ import"../chunk-k7xnsmp5.js";
6
9
  import {
7
- AutomationsApiError,
8
- createAutomationsClient
9
- } from "../chunk-0he2dx5n.js";
10
+ AutomationsApiError2,
11
+ createAutomationsClient2
12
+ } from "../chunk-p3s7cjfc.js";
10
13
  import {
11
- assertValidDefinitionSpecs
12
- } from "../chunk-h1v6w1fh.js";
14
+ PipelineDefinitionsApiError2,
15
+ createPipelineDefinitionsClient2
16
+ } from "../chunk-kbpkpxcn.js";
13
17
  import {
14
- PipelineDefinitionsApiError,
15
- createPipelineDefinitionsClient
16
- } from "../chunk-zxzvketc.js";
18
+ EnvironmentsApiError2,
19
+ createEnvironmentsClient2
20
+ } from "../chunk-52520csz.js";
21
+ import"../chunk-9qf0eg7m.js";
22
+ import"../chunk-631ffb6r.js";
23
+ import"../chunk-pq6hrtnb.js";
24
+ import"../chunk-yypj3zn0.js";
25
+ import"../chunk-vyv8kvkv.js";
26
+ import"../chunk-y4dwmhn2.js";
27
+ import"../chunk-7rywbqzz.js";
28
+ import"../chunk-5dnfgyx8.js";
29
+ import"../chunk-3j5wf2t5.js";
30
+ import"../chunk-bcvx11fn.js";
31
+ import"../chunk-hma87efq.js";
32
+ import"../chunk-7mhr5aex.js";
17
33
  import {
18
- createStepDefinitionsClient,
19
- stepEnvironmentHandle,
20
- toStepSpec
21
- } from "../chunk-p74r4y6j.js";
22
- import"../chunk-y7ac1t9c.js";
23
- import"../chunk-gasw078g.js";
34
+ stepEnvironmentHandle2,
35
+ toStepSpec2,
36
+ createStepDefinitionsClient2
37
+ } from "../chunk-7dr4kybf.js";
24
38
  import {
25
- isEnvironmentHandle,
26
- isStepDefinitionSpec,
27
- stepsInModule
28
- } from "../chunk-6tra3gw8.js";
29
- import"../chunk-xqfj56m9.js";
30
- import"../chunk-y11p1q7r.js";
31
- import"../chunk-vsp708vw.js";
32
- import"../chunk-aph2js2v.js";
33
- import"../chunk-8kzaxz52.js";
34
- import"../chunk-5say64w8.js";
35
- import"../chunk-nkm31g10.js";
36
- import"../chunk-08gcnrzh.js";
37
- import"../chunk-mrzn5tq4.js";
38
- import"../chunk-y81cr6tp.js";
39
- import"../chunk-ngy1fdcx.js";
40
- import"../chunk-8hsk6f6b.js";
41
- import"../chunk-01nfqm18.js";
39
+ assertValidDefinitionSpecs2
40
+ } from "../chunk-xe2zgyz7.js";
41
+ import"../chunk-vn1rfxma.js";
42
42
  import {
43
- exports_external
44
- } from "../chunk-xhpp6qz8.js";
45
- import"../chunk-y64skrwp.js";
43
+ string,
44
+ number,
45
+ unknown,
46
+ object,
47
+ looseObject,
48
+ literal
49
+ } from "../chunk-9ct3xypr.js";
46
50
 
47
51
  // src/push/collect-definitions.ts
48
52
  import { readdirSync } from "fs";
@@ -63,12 +67,12 @@ function createCollectionState() {
63
67
  function environmentHandlesInModule(mod) {
64
68
  const found = new Map;
65
69
  for (const [exportName, value] of Object.entries(mod)) {
66
- if (exportName !== "default" && isEnvironmentHandle(value)) {
70
+ if (exportName !== "default" && isEnvironmentHandle2(value)) {
67
71
  found.set(value, true);
68
72
  }
69
73
  }
70
- for (const step of stepsInModule(mod)) {
71
- const handle = stepEnvironmentHandle(step);
74
+ for (const step of stepsInModule2(mod)) {
75
+ const handle = stepEnvironmentHandle2(step);
72
76
  if (handle && !found.has(handle))
73
77
  found.set(handle, false);
74
78
  }
@@ -109,11 +113,11 @@ function registerCodeStep(state, spec, sourceFile) {
109
113
  }
110
114
  function resolveCodeStepEntrypoint(spec, absoluteFilePath, absDir) {
111
115
  if (spec.kind !== "code")
112
- return toStepSpec(spec);
116
+ return toStepSpec2(spec);
113
117
  if (!spec.entrypoint?.fn) {
114
118
  throw new Error(`Code step "${spec.key}" (kind: "code") has no entrypoint.fn. ` + `Build it with codeStep({ fn, ... }) from "@scarn/sdk/definitions/steps".`);
115
119
  }
116
- const resolved = toStepSpec(spec);
120
+ const resolved = toStepSpec2(spec);
117
121
  delete resolved.entrypoint;
118
122
  resolved.entrypointJson = {
119
123
  sourceFile: join(PIPELINE_BUILDER_DIR, relative(absDir, absoluteFilePath))
@@ -133,14 +137,14 @@ function fileNameWithoutExtension(file) {
133
137
  async function collectFile(absoluteFilePath, absDir, state) {
134
138
  const mod = await importModule(absoluteFilePath);
135
139
  const environmentEntries = environmentEntriesForFile(state, environmentHandlesInModule(mod), relative(absDir, absoluteFilePath));
136
- for (const step of stepsInModule(mod)) {
140
+ for (const step of stepsInModule2(mod)) {
137
141
  registerCodeStep(state, step, absoluteFilePath);
138
142
  }
139
143
  for (const entry of environmentEntries) {
140
144
  state.environments.set(entry.handle.name, entry);
141
145
  }
142
146
  for (const [exportName, value] of Object.entries(mod)) {
143
- if (exportName === "default" || !isStepDefinitionSpec(value))
147
+ if (exportName === "default" || !isStepDefinitionSpec2(value))
144
148
  continue;
145
149
  const resolved = resolveCodeStepEntrypoint(value, absoluteFilePath, absDir);
146
150
  state.stepMap.set(`${resolved.key}@v${String(resolved.version)}`, resolved);
@@ -196,13 +200,13 @@ var NON_PIPELINE_JSON = new Set([
196
200
  "jsconfig.json",
197
201
  "deno.json"
198
202
  ]);
199
- var automationDocumentSchema = exports_external.looseObject({
200
- kind: exports_external.literal("automation")
203
+ var automationDocumentSchema = looseObject({
204
+ kind: literal("automation")
201
205
  });
202
- var pipelineDocumentSchema = exports_external.looseObject({ nodes: exports_external.unknown() });
203
- var documentHeaderSchema = exports_external.object({
204
- key: exports_external.string().min(1),
205
- title: exports_external.string().optional()
206
+ var pipelineDocumentSchema = looseObject({ nodes: unknown() });
207
+ var documentHeaderSchema = object({
208
+ key: string().min(1),
209
+ title: string().optional()
206
210
  });
207
211
  function documentKind(value) {
208
212
  if (automationDocumentSchema.safeParse(value).success)
@@ -255,8 +259,32 @@ function parseJsonFile(path, file) {
255
259
  throw new Error(`${file} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
256
260
  }
257
261
  }
262
+ // src/push/pushed-mcp-servers.ts
263
+ function pushedMcpServers(steps) {
264
+ return steps.flatMap((step) => Object.entries(step.opencodeMcpJson ?? {}).flatMap(([key, entry]) => {
265
+ if (entry.type === "local" || entry.disabled === true)
266
+ return [];
267
+ const base = {
268
+ step: step.key,
269
+ key,
270
+ connection: entry.auth?.connection ?? null
271
+ };
272
+ if (entry.type === "remote") {
273
+ return [{ ...base, type: "remote", url: entry.url }];
274
+ }
275
+ return [
276
+ {
277
+ ...base,
278
+ type: "ref",
279
+ name: entry.name ?? key,
280
+ ...entry.disabled === undefined ? {} : { disabled: entry.disabled }
281
+ }
282
+ ];
283
+ }));
284
+ }
285
+
258
286
  // src/push/push-from-directory.ts
259
- var latestVersionSchema = exports_external.object({ version: exports_external.number() });
287
+ var latestVersionSchema = object({ version: number() });
260
288
  async function pushFromDirectory(dir, opts) {
261
289
  const log = opts.log ?? ((msg) => {
262
290
  console.warn(msg);
@@ -267,8 +295,8 @@ async function pushFromDirectory(dir, opts) {
267
295
  const documents = built.filter((file) => file.kind === "pipeline");
268
296
  const automations = built.filter((file) => file.kind === "automation").sort((a, b) => Number(a.document["scope"] === "project") - Number(b.document["scope"] === "project"));
269
297
  log(`Found ${String(environments.length)} environment(s), ${String(steps.length)} step(s), ${String(documents.length)} pipeline document(s) and ${String(automations.length)} automation document(s).`);
270
- assertValidDefinitionSpecs(steps);
271
- const environmentsClient = createEnvironmentsClient(opts.baseUrl, clientOptions);
298
+ assertValidDefinitionSpecs2(steps);
299
+ const environmentsClient = createEnvironmentsClient2(opts.baseUrl, clientOptions);
272
300
  await assertNamedEnvironmentsExist(steps, environments, opts.projectId, environmentsClient);
273
301
  const publishedEnvironments = [];
274
302
  const unchangedEnvironments = [];
@@ -276,12 +304,12 @@ async function pushFromDirectory(dir, opts) {
276
304
  const published = await publishEnvironment(environment, opts.projectId, environmentsClient, log);
277
305
  (published ? publishedEnvironments : unchangedEnvironments).push(environment.name);
278
306
  }
279
- const stepsClient = createStepDefinitionsClient(opts.baseUrl, clientOptions);
307
+ const stepsClient = createStepDefinitionsClient2(opts.baseUrl, clientOptions);
280
308
  for (const spec of steps) {
281
309
  await stepsClient.upsertFromSpec(opts.projectId, spec);
282
310
  log(`\u2713 step ${spec.key} v${String(spec.version)} \u2192 upserted`);
283
311
  }
284
- const pipelinesClient = createPipelineDefinitionsClient(opts.baseUrl, clientOptions);
312
+ const pipelinesClient = createPipelineDefinitionsClient2(opts.baseUrl, clientOptions);
285
313
  const publishedPipelines = [];
286
314
  const unchangedPipelines = [];
287
315
  if (documents.length > 0) {
@@ -292,7 +320,7 @@ async function pushFromDirectory(dir, opts) {
292
320
  (published ? publishedPipelines : unchangedPipelines).push(document.key);
293
321
  }
294
322
  }
295
- const automationsClient = createAutomationsClient(opts.baseUrl, clientOptions);
323
+ const automationsClient = createAutomationsClient2(opts.baseUrl, clientOptions);
296
324
  const publishedAutomations = [];
297
325
  const unchangedAutomations = [];
298
326
  for (const document of automations) {
@@ -306,7 +334,8 @@ async function pushFromDirectory(dir, opts) {
306
334
  publishedPipelines,
307
335
  unchangedPipelines,
308
336
  publishedAutomations,
309
- unchangedAutomations
337
+ unchangedAutomations,
338
+ mcpServers: pushedMcpServers(steps)
310
339
  };
311
340
  }
312
341
  async function assertNamedEnvironmentsExist(steps, environments, projectId, environmentsClient) {
@@ -343,7 +372,7 @@ async function publishEnvironment({ name, content, sourceFile }, projectId, envi
343
372
  log(result.published ? `\u2713 environment ${name} v${version} \u2192 published (${sourceFile})` : `\u2713 environment ${name} v${version} \u2192 unchanged (${sourceFile})`);
344
373
  return result.published;
345
374
  } catch (error) {
346
- if (!(error instanceof EnvironmentsApiError))
375
+ if (!(error instanceof EnvironmentsApiError2))
347
376
  throw error;
348
377
  const issues = error.issues.map((issue) => ` ${issue.path || "/"}: ${issue.message}`);
349
378
  throw new Error([
@@ -385,7 +414,7 @@ async function publishAutomationDocument({ file, key, document }, projectId, aut
385
414
  }
386
415
  }
387
416
  function rethrowPublishError(file, error) {
388
- if (!(error instanceof PipelineDefinitionsApiError) && !(error instanceof AutomationsApiError)) {
417
+ if (!(error instanceof PipelineDefinitionsApiError2) && !(error instanceof AutomationsApiError2)) {
389
418
  throw error;
390
419
  }
391
420
  const issues = error.issues.map((issue) => issue.hint === undefined ? ` ${issue.path || "/"}: ${issue.message}` : ` ${issue.path || "/"}: ${issue.message}. ${issue.hint}`);
@@ -1,4 +1,5 @@
1
1
  import type { FetchLike } from "../auth";
2
+ import { type PushedMcpServer } from "./pushed-mcp-servers";
2
3
  export interface PushFromDirectoryOptions {
3
4
  baseUrl: string;
4
5
  projectId: string;
@@ -24,6 +25,8 @@ export interface PushFromDirectoryResult {
24
25
  publishedAutomations: string[];
25
26
  /** Keys of the automations whose document matched their latest version. */
26
27
  unchangedAutomations: string[];
28
+ /** Every enabled `ref` and `remote` MCP server of the pushed steps. */
29
+ mcpServers: PushedMcpServer[];
27
30
  }
28
31
  /**
29
32
  * Pushes a pipeline-builder directory to the server, in four passes:
@@ -0,0 +1,28 @@
1
+ import type { StepDefinitionSpec } from "../definitions/steps";
2
+ import type { ManagedConnectionName } from "../managed-connections";
3
+ type PushedMcpServerBase = {
4
+ /** The step's key. */
5
+ step: string;
6
+ /** The server's key in the step's MCP config. */
7
+ key: string;
8
+ /** The managed connection named by `auth`, or null when it has none. */
9
+ connection: ManagedConnectionName | null;
10
+ };
11
+ /**
12
+ * An enabled `ref` or `remote` MCP server of a pushed step, for
13
+ * `scarn pipelines push` to check against the project's connections. A
14
+ * remote carries its URL. A ref carries the name it is looked up by in the
15
+ * repository's MCP files, which the push script doesn't read; the CLI does.
16
+ */
17
+ export type PushedMcpServer = (PushedMcpServerBase & {
18
+ type: "remote";
19
+ url: string;
20
+ }) | (PushedMcpServerBase & {
21
+ type: "ref";
22
+ name: string;
23
+ /** The ref's own `disabled`, which overrides the repository's. */
24
+ disabled?: boolean;
25
+ });
26
+ /** Every enabled `ref` or `remote` MCP server of `steps`, in step order. */
27
+ export declare function pushedMcpServers(steps: readonly StepDefinitionSpec[]): PushedMcpServer[];
28
+ export {};
@@ -1,47 +1,45 @@
1
1
  // @bun
2
2
  import {
3
- MAX_REPO_BASE_BRANCH_LENGTH,
4
- MAX_REPO_COMMIT_MESSAGE_LENGTH,
5
- REPO_BASE_BRANCH_TOKEN_ROOTS,
6
- REPO_BASE_BRANCH_WORK_ITEM_KEYS,
7
- REPO_COMMIT_MESSAGE_TOKEN_ROOTS,
8
- REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS,
9
- commitMessageUsesWorkItem,
10
- describeBaseBranchEnvProblem,
11
- findBaseBranchEnvProblems,
12
- findDisallowedBaseBranchTokens,
13
- findDisallowedCommitMessageTokenRoots,
14
- isValidBaseBranchTemplate,
15
- isValidGitBranchName,
16
- repoBaseBranchSchema,
17
- repoCommitMessageSchema,
18
- repoConfigInputSchema,
19
- repoConfigSchema,
20
- repoGitCredentialsSchema,
21
- repoWorkBranchSchema,
22
- resolveRepoConfig
23
- } from "./chunk-vsp708vw.js";
24
- import"./chunk-xhpp6qz8.js";
25
- import"./chunk-y64skrwp.js";
3
+ MAX_REPO_COMMIT_MESSAGE_LENGTH2,
4
+ REPO_COMMIT_MESSAGE_TOKEN_ROOTS2,
5
+ REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS2,
6
+ commitMessageUsesWorkItem2,
7
+ findDisallowedCommitMessageTokenRoots2,
8
+ MAX_REPO_BASE_BRANCH_LENGTH2,
9
+ REPO_BASE_BRANCH_TOKEN_ROOTS2,
10
+ REPO_BASE_BRANCH_WORK_ITEM_KEYS2,
11
+ findDisallowedBaseBranchTokens2,
12
+ findBaseBranchEnvProblems2,
13
+ describeBaseBranchEnvProblem2,
14
+ isValidGitBranchName2,
15
+ isValidBaseBranchTemplate2,
16
+ repoBaseBranchSchema2,
17
+ repoWorkBranchSchema2,
18
+ repoCommitMessageSchema2,
19
+ repoGitCredentialsSchema2,
20
+ repoConfigInputSchema2,
21
+ repoConfigSchema2,
22
+ resolveRepoConfig2
23
+ } from "./chunk-7mhr5aex.js";
26
24
  export {
27
- MAX_REPO_BASE_BRANCH_LENGTH,
28
- MAX_REPO_COMMIT_MESSAGE_LENGTH,
29
- REPO_BASE_BRANCH_TOKEN_ROOTS,
30
- REPO_BASE_BRANCH_WORK_ITEM_KEYS,
31
- REPO_COMMIT_MESSAGE_TOKEN_ROOTS,
32
- REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS,
33
- commitMessageUsesWorkItem,
34
- describeBaseBranchEnvProblem,
35
- findBaseBranchEnvProblems,
36
- findDisallowedBaseBranchTokens,
37
- findDisallowedCommitMessageTokenRoots,
38
- isValidBaseBranchTemplate,
39
- isValidGitBranchName,
40
- repoBaseBranchSchema,
41
- repoCommitMessageSchema,
42
- repoConfigInputSchema,
43
- repoConfigSchema,
44
- repoGitCredentialsSchema,
45
- repoWorkBranchSchema,
46
- resolveRepoConfig
25
+ MAX_REPO_BASE_BRANCH_LENGTH2 as MAX_REPO_BASE_BRANCH_LENGTH,
26
+ MAX_REPO_COMMIT_MESSAGE_LENGTH2 as MAX_REPO_COMMIT_MESSAGE_LENGTH,
27
+ REPO_BASE_BRANCH_TOKEN_ROOTS2 as REPO_BASE_BRANCH_TOKEN_ROOTS,
28
+ REPO_BASE_BRANCH_WORK_ITEM_KEYS2 as REPO_BASE_BRANCH_WORK_ITEM_KEYS,
29
+ REPO_COMMIT_MESSAGE_TOKEN_ROOTS2 as REPO_COMMIT_MESSAGE_TOKEN_ROOTS,
30
+ REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS2 as REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS,
31
+ commitMessageUsesWorkItem2 as commitMessageUsesWorkItem,
32
+ describeBaseBranchEnvProblem2 as describeBaseBranchEnvProblem,
33
+ findBaseBranchEnvProblems2 as findBaseBranchEnvProblems,
34
+ findDisallowedBaseBranchTokens2 as findDisallowedBaseBranchTokens,
35
+ findDisallowedCommitMessageTokenRoots2 as findDisallowedCommitMessageTokenRoots,
36
+ isValidBaseBranchTemplate2 as isValidBaseBranchTemplate,
37
+ isValidGitBranchName2 as isValidGitBranchName,
38
+ repoBaseBranchSchema2 as repoBaseBranchSchema,
39
+ repoCommitMessageSchema2 as repoCommitMessageSchema,
40
+ repoConfigInputSchema2 as repoConfigInputSchema,
41
+ repoConfigSchema2 as repoConfigSchema,
42
+ repoGitCredentialsSchema2 as repoGitCredentialsSchema,
43
+ repoWorkBranchSchema2 as repoWorkBranchSchema,
44
+ resolveRepoConfig2 as resolveRepoConfig
47
45
  };
@@ -1,19 +1,18 @@
1
1
  // @bun
2
2
  import {
3
- readEnvironmentDefinition,
4
- resolveEnvironment,
5
- resolveEnvironmentDefinition
6
- } from "./chunk-r3sbp2wn.js";
7
- import"./chunk-aph2js2v.js";
8
- import"./chunk-8kzaxz52.js";
9
- import"./chunk-5say64w8.js";
10
- import"./chunk-nkm31g10.js";
11
- import"./chunk-08gcnrzh.js";
12
- import"./chunk-mrzn5tq4.js";
13
- import"./chunk-xhpp6qz8.js";
14
- import"./chunk-y64skrwp.js";
3
+ readEnvironmentDefinition2,
4
+ resolveEnvironment2,
5
+ resolveEnvironmentDefinition2
6
+ } from "./chunk-0w13kxkr.js";
7
+ import"./chunk-bcvx11fn.js";
8
+ import"./chunk-yypj3zn0.js";
9
+ import"./chunk-y4dwmhn2.js";
10
+ import"./chunk-3j5wf2t5.js";
11
+ import"./chunk-5dnfgyx8.js";
12
+ import"./chunk-7rywbqzz.js";
13
+ import"./chunk-vyv8kvkv.js";
15
14
  export {
16
- readEnvironmentDefinition,
17
- resolveEnvironment,
18
- resolveEnvironmentDefinition
15
+ readEnvironmentDefinition2 as readEnvironmentDefinition,
16
+ resolveEnvironment2 as resolveEnvironment,
17
+ resolveEnvironmentDefinition2 as resolveEnvironmentDefinition
19
18
  };
@@ -1,10 +1,9 @@
1
1
  // @bun
2
2
  import {
3
- SCARN_CONFIG_RELATIVE_PATH,
4
- parseScarnConfig
5
- } from "./chunk-0y2fy5en.js";
6
- import"./chunk-y64skrwp.js";
3
+ SCARN_CONFIG_RELATIVE_PATH2,
4
+ parseScarnConfig2
5
+ } from "./chunk-4361gxk0.js";
7
6
  export {
8
- SCARN_CONFIG_RELATIVE_PATH,
9
- parseScarnConfig
7
+ SCARN_CONFIG_RELATIVE_PATH2 as SCARN_CONFIG_RELATIVE_PATH,
8
+ parseScarnConfig2 as parseScarnConfig
10
9
  };
@@ -1,5 +1,5 @@
1
1
  import { TaskRuns } from "./generated/sdk.gen";
2
- import type { GetApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdArtifactFailuresData, PostApiTaskRunsByTaskRunIdArtifactUploadUrlData, PostApiTaskRunsByTaskRunIdArtifactsData, PostApiTaskRunsByTaskRunIdBaseCommitData, PostApiTaskRunsByTaskRunIdCompletionsData, PostApiTaskRunsByTaskRunIdEnvironmentData, PostApiTaskRunsByTaskRunIdLogFeedTokenData, PostApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdSessionUploadUrlData, PostApiTaskRunsByTaskRunIdYieldsData, PostApiTaskRunsClaimsData } from "./generated/types.gen";
2
+ import type { GetApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdArtifactFailuresData, PostApiTaskRunsByTaskRunIdArtifactUploadUrlData, PostApiTaskRunsByTaskRunIdArtifactsData, PostApiTaskRunsByTaskRunIdBaseCommitData, PostApiTaskRunsByTaskRunIdCompletionsData, PostApiTaskRunsByTaskRunIdEnvironmentData, PostApiTaskRunsByTaskRunIdLogFeedTokenData, PostApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdManagedLaunchData, PostApiTaskRunsByTaskRunIdSessionUploadUrlData, PostApiTaskRunsByTaskRunIdYieldsData, PostApiTaskRunsClaimsData } from "./generated/types.gen";
3
3
  type TaskRunRef = {
4
4
  taskRunId: string;
5
5
  };
@@ -102,6 +102,9 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
102
102
  sessionRestored: boolean | null;
103
103
  createdAt: string;
104
104
  updatedAt: string;
105
+ managedAuthority: "ok" | {
106
+ lost: "disconnected" | "replaced" | "reconnect_required" | "operation_unknown";
107
+ };
105
108
  }>;
106
109
  getTaskRun: ({ taskRunId }: TaskRunRef) => Promise<{
107
110
  id: string;
@@ -585,6 +588,9 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
585
588
  mcp?: string;
586
589
  applies: "agent";
587
590
  }>;
591
+ auth?: {
592
+ connection: string;
593
+ };
588
594
  } | {
589
595
  type: "ref";
590
596
  name?: string;
@@ -598,6 +604,9 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
598
604
  mcp?: string;
599
605
  applies: "agent";
600
606
  }>;
607
+ auth?: {
608
+ connection: string;
609
+ };
601
610
  disabled?: boolean;
602
611
  codemode?: boolean;
603
612
  timeout?: {
@@ -649,6 +658,133 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
649
658
  };
650
659
  missing: Array<string>;
651
660
  }>;
661
+ /**
662
+ * Registers the run's managed launch: a relay URL and capability per
663
+ * connection-auth MCP server. Not unwrapped: callers read the 409
664
+ * `MANAGED_CONNECTION_NOT_READY` problem.
665
+ */
666
+ registerTaskRunManagedLaunch: ({ taskRunId, ...body }: TaskRunRef & PostApiTaskRunsByTaskRunIdManagedLaunchData["body"]) => Promise<({
667
+ data: {
668
+ entries: {
669
+ [key: string]: {
670
+ relayUrl: string;
671
+ capability: string;
672
+ };
673
+ };
674
+ };
675
+ error: undefined;
676
+ } | {
677
+ data: undefined;
678
+ error: {
679
+ type: string;
680
+ title: string;
681
+ status: number;
682
+ detail?: string;
683
+ instance?: string;
684
+ code?: string;
685
+ errors?: Array<{
686
+ path: string;
687
+ message: string;
688
+ summary?: string;
689
+ }>;
690
+ meta?: {
691
+ [key: string]: unknown;
692
+ };
693
+ } | {
694
+ type: string;
695
+ title: string;
696
+ status: number;
697
+ detail?: string;
698
+ instance?: string;
699
+ code?: string;
700
+ errors?: Array<{
701
+ path: string;
702
+ message: string;
703
+ summary?: string;
704
+ }>;
705
+ meta?: {
706
+ [key: string]: unknown;
707
+ };
708
+ } | {
709
+ type: string;
710
+ title: string;
711
+ status: number;
712
+ detail?: string;
713
+ instance?: string;
714
+ code?: string;
715
+ errors?: Array<{
716
+ path: string;
717
+ message: string;
718
+ summary?: string;
719
+ }>;
720
+ meta?: {
721
+ [key: string]: unknown;
722
+ };
723
+ } | {
724
+ type: string;
725
+ title: string;
726
+ status: number;
727
+ detail?: string;
728
+ instance?: string;
729
+ code?: string;
730
+ errors?: Array<{
731
+ path: string;
732
+ message: string;
733
+ summary?: string;
734
+ }>;
735
+ meta?: {
736
+ [key: string]: unknown;
737
+ };
738
+ } | {
739
+ type: string;
740
+ title: string;
741
+ status: number;
742
+ detail?: string;
743
+ instance?: string;
744
+ code?: string;
745
+ errors?: Array<{
746
+ path: string;
747
+ message: string;
748
+ summary?: string;
749
+ }>;
750
+ meta?: {
751
+ [key: string]: unknown;
752
+ };
753
+ } | {
754
+ type: string;
755
+ title: string;
756
+ status: number;
757
+ detail?: string;
758
+ instance?: string;
759
+ code?: string;
760
+ errors?: Array<{
761
+ path: string;
762
+ message: string;
763
+ summary?: string;
764
+ }>;
765
+ meta?: {
766
+ [key: string]: unknown;
767
+ };
768
+ } | {
769
+ type: string;
770
+ title: string;
771
+ status: number;
772
+ detail?: string;
773
+ instance?: string;
774
+ code?: string;
775
+ errors?: Array<{
776
+ path: string;
777
+ message: string;
778
+ summary?: string;
779
+ }>;
780
+ meta?: {
781
+ [key: string]: unknown;
782
+ };
783
+ };
784
+ }) & {
785
+ request: Request;
786
+ response: Response;
787
+ }>;
652
788
  readTaskRunWorkItem: ({ taskRunId, ...body }: TaskRunRef & {
653
789
  claimToken: string;
654
790
  workItemId: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@scarn/sdk",
4
- "version": "0.8.21",
4
+ "version": "0.8.22",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -112,6 +112,10 @@
112
112
  "import": "./dist/devcontainer-config-path.js",
113
113
  "types": "./dist/devcontainer-config-path.d.ts"
114
114
  },
115
+ "./managed-connections": {
116
+ "import": "./dist/managed-connections.js",
117
+ "types": "./dist/managed-connections.d.ts"
118
+ },
115
119
  "./managed-runtimes": {
116
120
  "import": "./dist/managed-runtimes.js",
117
121
  "types": "./dist/managed-runtimes.d.ts"
@@ -164,7 +168,7 @@
164
168
  "devDependencies": {
165
169
  "@hey-api/openapi-ts": "^0.90.10",
166
170
  "@opencode/client": "2.1.4",
167
- "bun-types": "^1.4.0",
171
+ "bun-types": "^1.4.4",
168
172
  "zod": "^4.6.7"
169
173
  }
170
174
  }