@scarn/sdk 0.8.17 → 0.8.19

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 (62) hide show
  1. package/dist/{chunk-g2mzg278.js → chunk-0c60x3v8.js} +51 -59
  2. package/dist/{chunk-dhqeg0wf.js → chunk-2tmrw253.js} +1 -1
  3. package/dist/{chunk-r03knh9j.js → chunk-3zp2qtf8.js} +80 -1
  4. package/dist/{chunk-ar6hcj1r.js → chunk-6tra3gw8.js} +7 -1
  5. package/dist/{chunk-a04phj60.js → chunk-833ef6dg.js} +121 -260
  6. package/dist/{chunk-2ekz6tr5.js → chunk-aemxz9r7.js} +18 -2
  7. package/dist/chunk-e0pt5x0e.js +167 -0
  8. package/dist/chunk-mmy80pec.js +64 -0
  9. package/dist/chunk-mzj1j0p5.js +116 -0
  10. package/dist/{chunk-cdj0yqgs.js → chunk-pqtd0hr7.js} +12 -2
  11. package/dist/chunk-qgkx89eg.js +210 -0
  12. package/dist/chunk-rphfy0fj.js +167 -0
  13. package/dist/chunk-t1dq2c2s.js +224 -0
  14. package/dist/{chunk-qs7p11rp.js → chunk-tvjcfh6s.js} +5 -1
  15. package/dist/{chunk-1wnv6rb2.js → chunk-ymywp5ht.js} +1 -1
  16. package/dist/client.js +8 -2
  17. package/dist/connectors/catalog.d.ts +49 -0
  18. package/dist/connectors/index.d.ts +45 -0
  19. package/dist/connectors/index.js +41 -0
  20. package/dist/defaults/index.js +2 -2
  21. package/dist/definitions/automations/index.js +2 -2
  22. package/dist/definitions/environments/define-environment.d.ts +39 -0
  23. package/dist/definitions/environments/environments-client.d.ts +50 -0
  24. package/dist/definitions/environments/index.d.ts +6 -0
  25. package/dist/definitions/environments/index.js +97 -0
  26. package/dist/definitions/pipelines/index.js +2 -2
  27. package/dist/definitions/steps/compile-mcps.d.ts +8 -12
  28. package/dist/definitions/steps/define-code-step.d.ts +18 -11
  29. package/dist/definitions/steps/define-step.d.ts +14 -25
  30. package/dist/definitions/steps/env.d.ts +30 -8
  31. package/dist/definitions/steps/index.js +30 -13
  32. package/dist/definitions/steps/mcp-server-config.d.ts +19 -9
  33. package/dist/definitions/steps/repo.d.ts +56 -28
  34. package/dist/definitions/steps/runtime.d.ts +54 -39
  35. package/dist/definitions/steps/step-definitions-client.d.ts +222 -63
  36. package/dist/definitions/steps/step-handle.d.ts +8 -1
  37. package/dist/definitions/validation/index.js +6 -3
  38. package/dist/definitions/validation/validate-repo.d.ts +3 -7
  39. package/dist/definitions/validation/validate-runtime.d.ts +2 -7
  40. package/dist/env-vars.d.ts +57 -1
  41. package/dist/env-vars.js +7 -1
  42. package/dist/environment.d.ts +564 -0
  43. package/dist/environment.js +46 -0
  44. package/dist/generated/index.d.ts +2 -2
  45. package/dist/generated/sdk.gen.d.ts +27 -2
  46. package/dist/generated/types.gen.d.ts +2141 -187
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.js +94 -28
  49. package/dist/opencode-mcp.d.ts +75 -4
  50. package/dist/opencode-mcp.js +2 -1
  51. package/dist/push/code-step-lookup.d.ts +6 -0
  52. package/dist/push/code-step-lookup.js +3 -1
  53. package/dist/push/collect-definitions.d.ts +13 -0
  54. package/dist/push/index.js +127 -15
  55. package/dist/push/push-from-directory.d.ts +11 -2
  56. package/dist/repo-config.d.ts +88 -30
  57. package/dist/repo-config.js +21 -5
  58. package/dist/resolve-environment.d.ts +19 -0
  59. package/dist/resolve-environment.js +19 -0
  60. package/dist/task-plane-client.d.ts +132 -22
  61. package/package.json +17 -1
  62. package/dist/chunk-2sk92cnd.js +0 -103
@@ -1,15 +1,10 @@
1
- import { type RepoConfigInput, type RepoGitCredentials } from "../../repo-config";
1
+ import { type BaseBranchEnvVar, type RepoConfigInput, type RepoGitCredentials, type RepoWorkBranch } from "../../repo-config";
2
2
  import { type PromptInputProxy } from "./prompt-template";
3
- import type { RuntimeSpec } from "./runtime";
4
3
  /**
5
- * Authoring helpers for a step's `environment.repo` option, and the
4
+ * Authoring helpers for a step's top-level `repo` option, and the
6
5
  * definition-time compilation that turns it into the `repo` wire field
7
6
  * (`../../repo-config.ts`).
8
7
  */
9
- /** The step gets no repository: no clone, branch, commit or push. */
10
- export type NoneRepoSpec = {
11
- readonly mode: "none";
12
- };
13
8
  type GitCredentialsOpt = {
14
9
  /**
15
10
  * Defaults to `"auto"`: git inside the container gets credentials (for
@@ -19,10 +14,21 @@ type GitCredentialsOpt = {
19
14
  */
20
15
  readonly gitCredentials?: RepoGitCredentials;
21
16
  };
17
+ type BranchOpts = {
18
+ /**
19
+ * The branch to start from, a single-line template: `{{input.…}}`,
20
+ * `{{env.NAME}}` (a variable declared in the step's environment) and
21
+ * `{{workItem.platformKey}}` tokens only. Without tokens it must be a valid
22
+ * branch name. When set, it beats the previous step's work branch. Unset,
23
+ * the step starts from the previous step's work branch, else the worker's
24
+ * or project's base branch, else the remote's default branch.
25
+ */
26
+ readonly baseBranch?: string;
27
+ };
22
28
  /** Clones and checks out the base branch; creates no branch, commits and pushes nothing. */
23
29
  export type ReadOnlyRepoSpec = {
24
30
  readonly mode: "readOnly";
25
- } & GitCredentialsOpt;
31
+ } & GitCredentialsOpt & BranchOpts;
26
32
  export type ReadWriteRepoSpec = {
27
33
  readonly mode: "readWrite";
28
34
  /**
@@ -33,33 +39,36 @@ export type ReadWriteRepoSpec = {
33
39
  readonly message?: string;
34
40
  /** Defaults to `"fail"`: a failed push fails the step. */
35
41
  readonly onPushFailure?: "fail" | "warn";
36
- } & GitCredentialsOpt;
37
- export type RepoSpec = NoneRepoSpec | ReadOnlyRepoSpec | ReadWriteRepoSpec;
38
- /** What `Runtime.devcontainer()` and `Runtime.managed.<id>()` accept. */
39
- export type DevcontainerRepoSpec = ReadOnlyRepoSpec | ReadWriteRepoSpec;
40
- /** What `Runtime.host()` accepts. */
41
- export type HostRepoSpec = NoneRepoSpec;
42
- /** Runs once at definition time, against the same proxies `agentPrompt` and `vars` use. */
42
+ /**
43
+ * Defaults to `WorkBranch.create()`, a new `scarn/<key>-<id>` branch.
44
+ * `WorkBranch.base()` commits onto the branch the step started from.
45
+ */
46
+ readonly workBranch?: RepoWorkBranch;
47
+ } & GitCredentialsOpt & BranchOpts;
48
+ export type RepoSpec = ReadOnlyRepoSpec | ReadWriteRepoSpec;
43
49
  /** The work item values a commit message may name, read live at commit time. */
44
50
  export type CommitMessageWorkItem = {
45
51
  title: string;
46
52
  platformKey: string;
47
53
  };
48
- export type RepoFn<TInput, TResult, TSpec extends RepoSpec> = (context: {
54
+ /** The default `env` of a repo function: any variable, as a token. */
55
+ export type RepoEnvDefault = PromptInputProxy<Record<string, string | undefined>>;
56
+ /**
57
+ * Runs once at definition time, against the same proxies `agentPrompt` and
58
+ * `vars` use. `env` is typed as `agentPrompt`'s is (`PromptEnvContext`).
59
+ */
60
+ export type RepoFn<TInput, TResult, TSpec extends RepoSpec, TEnv = RepoEnvDefault> = (context: {
49
61
  input: PromptInputProxy<TInput>;
50
62
  result: PromptInputProxy<TResult>;
51
63
  /** The Task's work item: `{{workItem.title}}` and `{{workItem.platformKey}}`. */
52
64
  workItem: PromptInputProxy<CommitMessageWorkItem>;
65
+ /** The step's environment variables, for `baseBranch`: `{{env.NAME}}`. */
66
+ env: TEnv;
53
67
  }) => TSpec;
54
- export type RepoField<TInput, TResult, TSpec extends RepoSpec> = TSpec | RepoFn<TInput, TResult, TSpec>;
68
+ export type RepoField<TInput, TResult, TSpec extends RepoSpec, TEnv = RepoEnvDefault> = TSpec | RepoFn<TInput, TResult, TSpec, TEnv>;
55
69
  export type ReadOnlyRepoOpts = Omit<ReadOnlyRepoSpec, "mode">;
56
70
  export type ReadWriteRepoOpts = Omit<ReadWriteRepoSpec, "mode">;
57
71
  export declare const Repo: {
58
- /**
59
- * The step gets no repository. What `Runtime.host()` already implies, stated
60
- * as a value. Only valid with `Runtime.host()`.
61
- */
62
- readonly none: () => NoneRepoSpec;
63
72
  /**
64
73
  * Clones and checks out the base branch, but creates no work branch, commits
65
74
  * nothing, pushes nothing and reports no `workBranch`. A policy, not a
@@ -68,19 +77,38 @@ export declare const Repo: {
68
77
  readonly readOnly: (opts?: ReadOnlyRepoOpts) => ReadOnlyRepoSpec;
69
78
  /**
70
79
  * Creates a work branch, then commits and pushes it when the step succeeds.
71
- * This is the default for a devcontainer step.
80
+ * This is the shared default for every runtime.
72
81
  */
73
82
  readonly readWrite: (opts?: ReadWriteRepoOpts) => ReadWriteRepoSpec;
74
83
  };
84
+ /** Which branch a `Repo.readWrite()` step commits to (its `workBranch`). */
85
+ export declare const WorkBranch: {
86
+ /** A new `scarn/<key>-<id>` branch. The default. */
87
+ readonly create: () => RepoWorkBranch;
88
+ /**
89
+ * The branch the step started from: the rendered `baseBranch`, else the
90
+ * previous step's work branch. Pushed without force, so a moved origin fails
91
+ * the push. Needs an explicit `baseBranch`; a worker, project or remote
92
+ * default base is rejected at startup.
93
+ */
94
+ readonly base: () => RepoWorkBranch;
95
+ };
75
96
  export type CompileRepoContext = {
76
97
  /** Named in error messages. */
77
98
  readonly stepKey?: string;
78
99
  };
79
100
  /**
80
- * Runs the authored `environment.repo` once (the function form against `input`
81
- * and `result` proxies) and returns the wire shape, or `undefined` when the step
82
- * declares no `repo`. Throws when the mode does not fit the runtime or breaks
83
- * the `repoConfigInputSchema` rules.
101
+ * Runs the authored `repo` once (the function form against `input`, `result`,
102
+ * `workItem` and `env` proxies) and returns the wire shape, or `undefined`
103
+ * when the step declares no `repo`. Throws when it breaks the
104
+ * `repoConfigInputSchema` rules, e.g. a `{{result.…}}` token in `baseBranch`.
105
+ */
106
+ export declare function compileRepo<TInput, TResult, TEnv = RepoEnvDefault>(repo: RepoField<TInput, TResult, RepoSpec, TEnv> | undefined, ctx?: CompileRepoContext): RepoConfigInput | undefined;
107
+ /**
108
+ * Throws when the compiled `repo.baseBranch` has an `{{env.X}}` token the
109
+ * step's environment doesn't allow (undeclared, or secret). `vars` is the
110
+ * environment's var list, or `undefined` for an environment known only by
111
+ * name: the server checks that one at publish.
84
112
  */
85
- export declare function compileRepo<TInput, TResult>(repo: RepoField<TInput, TResult, RepoSpec> | undefined, runtime: RuntimeSpec | undefined, ctx?: CompileRepoContext): RepoConfigInput | undefined;
113
+ export declare function assertBaseBranchFitsEnvironment(repo: RepoConfigInput | undefined, vars: readonly BaseBranchEnvVar[] | undefined, ctx?: CompileRepoContext): void;
86
114
  export {};
@@ -1,12 +1,11 @@
1
1
  import type { EnvVarsInput } from "../../env-vars";
2
2
  import { type ManagedRuntimeId } from "../../managed-runtimes";
3
- import type { RepoConfigInput } from "../../repo-config";
4
3
  import { type EnvFn, type EnvRecord } from "./env";
5
- import { type CompileRepoContext, type DevcontainerRepoSpec, type HostRepoSpec, type RepoField } from "./repo";
4
+ import type { CompileRepoContext } from "./repo";
5
+ import type { EnvironmentHandle } from "../environments/define-environment";
6
6
  /**
7
7
  * Authoring helpers for a step's `environment` option, and the definition-time
8
- * compilation that turns it into the wire fields `executionMode`,
9
- * `managedRuntime`, `devcontainerConfigPath`, `envJson` and `repo`.
8
+ * compilation that turns it into a named or inline environment reference.
10
9
  */
11
10
  /** Where a step runs. Build one with `Runtime.devcontainer()`, `Runtime.host()` or `Runtime.managed.<id>()`. */
12
11
  export type DevcontainerRuntimeSpec = {
@@ -26,39 +25,39 @@ export type ManagedRuntimeSpec<TId extends ManagedRuntimeId = ManagedRuntimeId>
26
25
  };
27
26
  export type RuntimeSpec = DevcontainerRuntimeSpec | HostRuntimeSpec | ManagedRuntimeSpec;
28
27
  /**
29
- * How a step runs: its `runtime`, its environment `vars` and its `repo` access.
30
- * A union on the runtime kind, so a `repo` the runtime cannot honor is a type
31
- * error: a host step takes only `Repo.none()`, a devcontainer or managed step
32
- * takes `Repo.readOnly()` or `Repo.readWrite()`.
28
+ * A named environment, by name or by `defineEnvironment` handle, or an inline
29
+ * runtime, vars and connectors.
33
30
  *
34
- * Declare `vars` before `agentPrompt` so `TEnv` is inferred into the prompt's
35
- * `env`, which is then strict: only declared, non-secret keys.
31
+ * For inline environments, declare `vars` before `agentPrompt` so `TEnv` is
32
+ * inferred into the prompt's `env`: only declared, non-secret keys. A handle
33
+ * types the prompt's `env` from its own `vars` the same way.
36
34
  */
37
- export type StepEnvironment<TInput, TEnv extends EnvRecord = EnvRecord, TResult = unknown> = {
38
- /** Defaults to `Runtime.devcontainer()`. */
39
- runtime?: DevcontainerRuntimeSpec | ManagedRuntimeSpec;
40
- vars?: EnvFn<TInput, TEnv>;
41
- /** Defaults to `Repo.readWrite()`. */
42
- repo?: RepoField<TInput, TResult, DevcontainerRepoSpec>;
43
- } | {
44
- runtime: HostRuntimeSpec;
45
- vars?: EnvFn<TInput, TEnv>;
46
- /** Defaults to `Repo.none()`. */
47
- repo?: RepoField<TInput, TResult, HostRepoSpec>;
35
+ export type StepEnvironment<TInput, TEnv extends EnvRecord = EnvRecord> = string | EnvironmentHandle<TEnv> | InlineStepEnvironment<TInput, TEnv>;
36
+ /** A named environment: its name, or its `defineEnvironment` handle. */
37
+ export type NamedStepEnvironment = string | EnvironmentHandle;
38
+ export type InlineStepEnvironment<TInput, TEnv extends EnvRecord = EnvRecord> = {
39
+ /** Defaults to the repository's runtime. */
40
+ runtime?: RuntimeSpec;
41
+ vars?: EnvFn<TInput, TEnv> | TEnv;
42
+ /**
43
+ * Scarn catalog connectors to turn on, e.g. `["datadog"]`. `vars` must
44
+ * provide each connector's required variables.
45
+ */
46
+ connectors?: readonly string[];
48
47
  };
49
48
  /**
50
49
  * `codeStep`'s environment: `StepEnvironment`'s workspace variant. A code step
51
- * runs repo code, which needs a clone, and the host runtime has none.
50
+ * currently requires a devcontainer or managed runtime.
52
51
  */
53
- export type CodeStepEnvironment<TInput, TResult = unknown> = {
52
+ export type CodeStepEnvironment<TInput, TEnv extends EnvRecord = EnvRecord> = NamedStepEnvironment | InlineCodeStepEnvironment<TInput, TEnv>;
53
+ /** `codeStep`'s inline environment. */
54
+ export type InlineCodeStepEnvironment<TInput, TEnv extends EnvRecord = EnvRecord> = {
54
55
  /**
55
56
  * Defaults to `Runtime.managed.bun1()`. `Runtime.devcontainer()` opts into the
56
57
  * project's own container. `Runtime.host()` is not supported.
57
58
  */
58
59
  runtime?: DevcontainerRuntimeSpec | ManagedRuntimeSpec;
59
- vars?: EnvFn<TInput>;
60
- /** Defaults to `Repo.readWrite()`. */
61
- repo?: RepoField<TInput, TResult, DevcontainerRepoSpec>;
60
+ vars?: EnvFn<TInput, TEnv> | TEnv;
62
61
  };
63
62
  export type DevcontainerRuntimeOpts = {
64
63
  /**
@@ -87,28 +86,44 @@ export declare const Runtime: {
87
86
  */
88
87
  readonly devcontainer: (opts?: DevcontainerRuntimeOpts) => DevcontainerRuntimeSpec;
89
88
  /**
90
- * Runs the step on the worker host, with no clone and no container. Takes no
89
+ * Runs the step on the worker host, without a container. Takes no
91
90
  * options, so a config path cannot be combined with it. Not supported for
92
- * `codeStep`, which needs a workspace.
91
+ * `codeStep`, which needs a container.
93
92
  */
94
93
  readonly host: () => HostRuntimeSpec;
95
94
  };
96
- export type CompiledEnvironment = {
97
- executionMode: "workspace" | "no_workspace";
98
- devcontainerConfigPath: string | null;
99
- managedRuntime: ManagedRuntimeId | null;
95
+ export type CompiledInlineEnvironment = {
96
+ kind: "inline";
97
+ runtime?: RuntimeSpec;
100
98
  envJson: EnvVarsInput | null;
101
- /** `undefined` when the author wrote no `repo`; the server resolves the default. */
102
- repo: RepoConfigInput | undefined;
99
+ connectors?: string[];
103
100
  };
101
+ export type CompiledEnvironment = CompiledInlineEnvironment | {
102
+ kind: "named";
103
+ name: string;
104
+ } | null;
104
105
  export type CompileEnvironmentContext = CompileRepoContext & {
105
106
  /** Used when the environment declares no `runtime`. `codeStep` passes the default managed runtime. */
106
107
  readonly defaultRuntime?: ManagedRuntimeSpec;
107
108
  };
108
109
  /**
109
- * Turns the authored `environment` into its wire fields. Runs `vars` and `repo`
110
- * once. Throws on a static secret, or a static literal on a secret-looking name,
111
- * on a setup variable on the host runtime, and on a `repo` the runtime cannot
112
- * honor or that breaks the commit message rules.
110
+ * A host step has no container, so nothing runs `devcontainer up`. `owner`
111
+ * prefixes the error, e.g. `Step "fix-bug"` or `Environment "frontend"`.
112
+ */
113
+ export declare function assertNoSetupVarsOnHost(envJson: EnvVarsInput | null, runtime: RuntimeSpec | undefined, owner: string | undefined): void;
114
+ /** Checks connector ids against the catalog. `owner` prefixes the error. */
115
+ export declare function compileConnectors(connectors: readonly string[] | undefined, owner: string | undefined): string[] | undefined;
116
+ /**
117
+ * The vars a step's environment declares, as definition time knows them: a
118
+ * handle's content vars, or the compiled inline vars (none when the step has
119
+ * no environment). `undefined` for an environment named by string, which the
120
+ * server checks at publish.
121
+ */
122
+ export declare function knownEnvironmentVars<TInput, TEnv extends EnvRecord>(environment: StepEnvironment<TInput, TEnv> | CodeStepEnvironment<TInput> | undefined, compiled: CompiledEnvironment): EnvVarsInput | undefined;
123
+ /**
124
+ * Turns the authored `environment` into a reference. Named environments are
125
+ * resolved by the worker; inline environments run `vars` once and reject static
126
+ * secrets and setup variables on the host runtime.
113
127
  */
114
- export declare function compileEnvironment<TInput, TEnv extends EnvRecord, TResult>(environment: StepEnvironment<TInput, TEnv, TResult> | CodeStepEnvironment<TInput, TResult> | undefined, ctx?: CompileEnvironmentContext): CompiledEnvironment;
128
+ export declare function compileEnvironment<TInput, TEnv extends EnvRecord>(environment: InlineStepEnvironment<TInput, TEnv> | Exclude<CodeStepEnvironment<TInput>, string | EnvironmentHandle> | undefined, ctx?: CompileEnvironmentContext): CompiledInlineEnvironment | null;
129
+ export declare function compileEnvironment<TInput, TEnv extends EnvRecord>(environment: StepEnvironment<TInput, TEnv> | CodeStepEnvironment<TInput> | undefined, ctx?: CompileEnvironmentContext): CompiledEnvironment;
@@ -20,7 +20,43 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
20
20
  entrypointJson: {
21
21
  sourceFile: string;
22
22
  } | null;
23
- executionMode: "workspace" | "no_workspace";
23
+ environment: {
24
+ kind: "named";
25
+ name: string;
26
+ } | {
27
+ kind: "inline";
28
+ runtime?: {
29
+ kind: "devcontainer";
30
+ config?: string;
31
+ } | {
32
+ kind: "managed";
33
+ id: "bun1" | "node24";
34
+ } | {
35
+ kind: "host";
36
+ };
37
+ envJson?: Array<{
38
+ name: string;
39
+ source: "value";
40
+ value: string;
41
+ secret: boolean;
42
+ applies: "agent" | "setup" | "both";
43
+ } | {
44
+ name: string;
45
+ source: "inherit";
46
+ from: string;
47
+ secret: boolean;
48
+ optional: boolean;
49
+ default?: string;
50
+ mcp?: string;
51
+ applies: "agent" | "setup" | "both";
52
+ } | {
53
+ name: string;
54
+ source: "secret";
55
+ secretName: string;
56
+ applies: "agent" | "setup" | "both";
57
+ }> | null;
58
+ connectors?: Array<string>;
59
+ } | null;
24
60
  inputSchemaJson: {
25
61
  [key: string]: unknown;
26
62
  };
@@ -84,6 +120,16 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
84
120
  execution?: number;
85
121
  };
86
122
  protocol?: "legacy" | "auto" | "2026-07-28";
123
+ workerVars?: Array<{
124
+ name: string;
125
+ source: "inherit";
126
+ from: string;
127
+ secret: boolean;
128
+ optional: boolean;
129
+ default?: string;
130
+ mcp?: string;
131
+ applies: "agent";
132
+ }>;
87
133
  } | {
88
134
  type: "remote";
89
135
  url: string;
@@ -106,9 +152,29 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
106
152
  execution?: number;
107
153
  };
108
154
  protocol?: "legacy" | "auto" | "2026-07-28";
155
+ workerVars?: Array<{
156
+ name: string;
157
+ source: "inherit";
158
+ from: string;
159
+ secret: boolean;
160
+ optional: boolean;
161
+ default?: string;
162
+ mcp?: string;
163
+ applies: "agent";
164
+ }>;
109
165
  } | {
110
166
  type: "ref";
111
167
  name?: string;
168
+ workerVars?: Array<{
169
+ name: string;
170
+ source: "inherit";
171
+ from: string;
172
+ secret: boolean;
173
+ optional: boolean;
174
+ default?: string;
175
+ mcp?: string;
176
+ applies: "agent";
177
+ }>;
112
178
  disabled?: boolean;
113
179
  codemode?: boolean;
114
180
  timeout?: {
@@ -139,34 +205,21 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
139
205
  command: Array<string>;
140
206
  expectExitCode: number;
141
207
  }> | null;
142
- envJson: Array<{
143
- name: string;
144
- source: "value";
145
- value: string;
146
- secret: boolean;
147
- applies: "agent" | "setup" | "both";
148
- } | {
149
- name: string;
150
- source: "inherit";
151
- from: string;
152
- secret: boolean;
153
- optional: boolean;
154
- default?: string;
155
- mcp?: string;
156
- applies: "agent" | "setup" | "both";
157
- }> | null;
158
- devcontainerConfigPath: string | null;
159
- managedRuntime: "bun1" | "node24" | null;
160
208
  repo: {
161
- mode: "none";
162
- } | {
163
209
  mode: "readOnly";
164
210
  gitCredentials: "auto" | "none";
211
+ baseBranch: string | null;
165
212
  } | {
166
213
  mode: "readWrite";
167
214
  message: string | null;
168
215
  onPushFailure: "fail" | "warn";
169
216
  gitCredentials: "auto" | "none";
217
+ baseBranch: string | null;
218
+ workBranch: {
219
+ kind: "create";
220
+ } | {
221
+ kind: "base";
222
+ };
170
223
  };
171
224
  status: "draft" | "active" | "archived";
172
225
  createdAt: string;
@@ -184,7 +237,43 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
184
237
  entrypointJson: {
185
238
  sourceFile: string;
186
239
  } | null;
187
- executionMode: "workspace" | "no_workspace";
240
+ environment: {
241
+ kind: "named";
242
+ name: string;
243
+ } | {
244
+ kind: "inline";
245
+ runtime?: {
246
+ kind: "devcontainer";
247
+ config?: string;
248
+ } | {
249
+ kind: "managed";
250
+ id: "bun1" | "node24";
251
+ } | {
252
+ kind: "host";
253
+ };
254
+ envJson?: Array<{
255
+ name: string;
256
+ source: "value";
257
+ value: string;
258
+ secret: boolean;
259
+ applies: "agent" | "setup" | "both";
260
+ } | {
261
+ name: string;
262
+ source: "inherit";
263
+ from: string;
264
+ secret: boolean;
265
+ optional: boolean;
266
+ default?: string;
267
+ mcp?: string;
268
+ applies: "agent" | "setup" | "both";
269
+ } | {
270
+ name: string;
271
+ source: "secret";
272
+ secretName: string;
273
+ applies: "agent" | "setup" | "both";
274
+ }> | null;
275
+ connectors?: Array<string>;
276
+ } | null;
188
277
  inputSchemaJson: {
189
278
  [key: string]: unknown;
190
279
  };
@@ -248,6 +337,16 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
248
337
  execution?: number;
249
338
  };
250
339
  protocol?: "legacy" | "auto" | "2026-07-28";
340
+ workerVars?: Array<{
341
+ name: string;
342
+ source: "inherit";
343
+ from: string;
344
+ secret: boolean;
345
+ optional: boolean;
346
+ default?: string;
347
+ mcp?: string;
348
+ applies: "agent";
349
+ }>;
251
350
  } | {
252
351
  type: "remote";
253
352
  url: string;
@@ -270,9 +369,29 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
270
369
  execution?: number;
271
370
  };
272
371
  protocol?: "legacy" | "auto" | "2026-07-28";
372
+ workerVars?: Array<{
373
+ name: string;
374
+ source: "inherit";
375
+ from: string;
376
+ secret: boolean;
377
+ optional: boolean;
378
+ default?: string;
379
+ mcp?: string;
380
+ applies: "agent";
381
+ }>;
273
382
  } | {
274
383
  type: "ref";
275
384
  name?: string;
385
+ workerVars?: Array<{
386
+ name: string;
387
+ source: "inherit";
388
+ from: string;
389
+ secret: boolean;
390
+ optional: boolean;
391
+ default?: string;
392
+ mcp?: string;
393
+ applies: "agent";
394
+ }>;
276
395
  disabled?: boolean;
277
396
  codemode?: boolean;
278
397
  timeout?: {
@@ -303,34 +422,21 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
303
422
  command: Array<string>;
304
423
  expectExitCode: number;
305
424
  }> | null;
306
- envJson: Array<{
307
- name: string;
308
- source: "value";
309
- value: string;
310
- secret: boolean;
311
- applies: "agent" | "setup" | "both";
312
- } | {
313
- name: string;
314
- source: "inherit";
315
- from: string;
316
- secret: boolean;
317
- optional: boolean;
318
- default?: string;
319
- mcp?: string;
320
- applies: "agent" | "setup" | "both";
321
- }> | null;
322
- devcontainerConfigPath: string | null;
323
- managedRuntime: "bun1" | "node24" | null;
324
425
  repo: {
325
- mode: "none";
326
- } | {
327
426
  mode: "readOnly";
328
427
  gitCredentials: "auto" | "none";
428
+ baseBranch: string | null;
329
429
  } | {
330
430
  mode: "readWrite";
331
431
  message: string | null;
332
432
  onPushFailure: "fail" | "warn";
333
433
  gitCredentials: "auto" | "none";
434
+ baseBranch: string | null;
435
+ workBranch: {
436
+ kind: "create";
437
+ } | {
438
+ kind: "base";
439
+ };
334
440
  };
335
441
  status: "draft" | "active" | "archived";
336
442
  createdAt: string;
@@ -358,7 +464,43 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
358
464
  entrypointJson: {
359
465
  sourceFile: string;
360
466
  } | null;
361
- executionMode: "workspace" | "no_workspace";
467
+ environment: {
468
+ kind: "named";
469
+ name: string;
470
+ } | {
471
+ kind: "inline";
472
+ runtime?: {
473
+ kind: "devcontainer";
474
+ config?: string;
475
+ } | {
476
+ kind: "managed";
477
+ id: "bun1" | "node24";
478
+ } | {
479
+ kind: "host";
480
+ };
481
+ envJson?: Array<{
482
+ name: string;
483
+ source: "value";
484
+ value: string;
485
+ secret: boolean;
486
+ applies: "agent" | "setup" | "both";
487
+ } | {
488
+ name: string;
489
+ source: "inherit";
490
+ from: string;
491
+ secret: boolean;
492
+ optional: boolean;
493
+ default?: string;
494
+ mcp?: string;
495
+ applies: "agent" | "setup" | "both";
496
+ } | {
497
+ name: string;
498
+ source: "secret";
499
+ secretName: string;
500
+ applies: "agent" | "setup" | "both";
501
+ }> | null;
502
+ connectors?: Array<string>;
503
+ } | null;
362
504
  inputSchemaJson: {
363
505
  [key: string]: unknown;
364
506
  };
@@ -422,6 +564,16 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
422
564
  execution?: number;
423
565
  };
424
566
  protocol?: "legacy" | "auto" | "2026-07-28";
567
+ workerVars?: Array<{
568
+ name: string;
569
+ source: "inherit";
570
+ from: string;
571
+ secret: boolean;
572
+ optional: boolean;
573
+ default?: string;
574
+ mcp?: string;
575
+ applies: "agent";
576
+ }>;
425
577
  } | {
426
578
  type: "remote";
427
579
  url: string;
@@ -444,9 +596,29 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
444
596
  execution?: number;
445
597
  };
446
598
  protocol?: "legacy" | "auto" | "2026-07-28";
599
+ workerVars?: Array<{
600
+ name: string;
601
+ source: "inherit";
602
+ from: string;
603
+ secret: boolean;
604
+ optional: boolean;
605
+ default?: string;
606
+ mcp?: string;
607
+ applies: "agent";
608
+ }>;
447
609
  } | {
448
610
  type: "ref";
449
611
  name?: string;
612
+ workerVars?: Array<{
613
+ name: string;
614
+ source: "inherit";
615
+ from: string;
616
+ secret: boolean;
617
+ optional: boolean;
618
+ default?: string;
619
+ mcp?: string;
620
+ applies: "agent";
621
+ }>;
450
622
  disabled?: boolean;
451
623
  codemode?: boolean;
452
624
  timeout?: {
@@ -477,34 +649,21 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
477
649
  command: Array<string>;
478
650
  expectExitCode: number;
479
651
  }> | null;
480
- envJson: Array<{
481
- name: string;
482
- source: "value";
483
- value: string;
484
- secret: boolean;
485
- applies: "agent" | "setup" | "both";
486
- } | {
487
- name: string;
488
- source: "inherit";
489
- from: string;
490
- secret: boolean;
491
- optional: boolean;
492
- default?: string;
493
- mcp?: string;
494
- applies: "agent" | "setup" | "both";
495
- }> | null;
496
- devcontainerConfigPath: string | null;
497
- managedRuntime: "bun1" | "node24" | null;
498
652
  repo: {
499
- mode: "none";
500
- } | {
501
653
  mode: "readOnly";
502
654
  gitCredentials: "auto" | "none";
655
+ baseBranch: string | null;
503
656
  } | {
504
657
  mode: "readWrite";
505
658
  message: string | null;
506
659
  onPushFailure: "fail" | "warn";
507
660
  gitCredentials: "auto" | "none";
661
+ baseBranch: string | null;
662
+ workBranch: {
663
+ kind: "create";
664
+ } | {
665
+ kind: "base";
666
+ };
508
667
  };
509
668
  status: "draft" | "active" | "archived";
510
669
  createdAt: string;