run402 3.7.4 → 3.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/email.mjs CHANGED
@@ -73,7 +73,7 @@ Usage:
73
73
  run402 email <subcommand> [args...]
74
74
 
75
75
  Subcommands:
76
- create <slug> [--project <id>] Create a mailbox (<slug>@mail.run402.com)
76
+ create <slug> [--project <id>] Create a project-scoped mailbox local part
77
77
  mailboxes [--project <id>] List mailboxes with default-role metadata
78
78
  and gateway next_actions
79
79
  defaults [--outbound <slug|id>] [--auth-sender <slug|id>] [--project <id>]
@@ -238,14 +238,15 @@ Usage:
238
238
 
239
239
  Arguments:
240
240
  <slug> Mailbox slug (3-63 chars, lowercase alphanumeric +
241
- hyphens, no consecutive hyphens). Becomes
242
- <slug>@mail.run402.com.
241
+ hyphens, no consecutive hyphens). The response's
242
+ managed_address is
243
+ <slug>@<project-mail-host>.mail.run402.com.
243
244
 
244
245
  Options:
245
246
  --project <id> Project ID (defaults to the active project)
246
247
 
247
248
  Notes:
248
- - Up to 5 mailboxes per project (create distinct slugs, e.g. sign, support)
249
+ - Up to 5 mailboxes per project; the same slug may be used by another project
249
250
 
250
251
  Examples:
251
252
  run402 email create my-app
@@ -320,12 +321,17 @@ function summarizeMailboxForDefaults(m) {
320
321
  mailbox_id: m.mailbox_id,
321
322
  slug: m.slug,
322
323
  address: m.address,
324
+ managed_address: m.managed_address,
323
325
  status: m.status,
324
326
  is_default_outbound: m.is_default_outbound ?? false,
325
327
  is_auth_sender: m.is_auth_sender ?? false,
326
328
  can_send: m.can_send,
329
+ can_receive: m.can_receive,
327
330
  send_blocked_reason: m.send_blocked_reason ?? null,
328
331
  domain_kind: m.domain_kind,
332
+ address_domain: m.address_domain,
333
+ managed_domain: m.managed_domain,
334
+ custom_domain_ready: m.custom_domain_ready,
329
335
  footer_policy: m.footer_policy,
330
336
  effective_footer_policy: m.effective_footer_policy,
331
337
  footer_policy_locked_reason: m.footer_policy_locked_reason ?? null,
@@ -336,13 +342,18 @@ function mailboxInfoPayload(m) {
336
342
  return {
337
343
  mailbox_id: m.mailbox_id,
338
344
  address: m.address,
345
+ managed_address: m.managed_address,
339
346
  slug: m.slug,
340
347
  status: m.status,
341
348
  is_default_outbound: m.is_default_outbound,
342
349
  is_auth_sender: m.is_auth_sender,
343
350
  can_send: m.can_send,
351
+ can_receive: m.can_receive,
344
352
  send_blocked_reason: m.send_blocked_reason,
345
353
  domain_kind: m.domain_kind,
354
+ address_domain: m.address_domain,
355
+ managed_domain: m.managed_domain,
356
+ custom_domain_ready: m.custom_domain_ready,
346
357
  footer_policy: m.footer_policy,
347
358
  effective_footer_policy: m.effective_footer_policy,
348
359
  footer_policy_locked_reason: m.footer_policy_locked_reason,
@@ -428,8 +439,14 @@ async function create(args) {
428
439
  console.log(JSON.stringify({
429
440
  mailbox_id: data.mailbox_id,
430
441
  address: data.address,
442
+ managed_address: data.managed_address,
431
443
  slug: data.slug,
432
444
  status: data.status,
445
+ domain_kind: data.domain_kind,
446
+ address_domain: data.address_domain,
447
+ managed_domain: data.managed_domain,
448
+ custom_domain_ready: data.custom_domain_ready,
449
+ can_receive: data.can_receive,
433
450
  footer_policy: data.footer_policy,
434
451
  effective_footer_policy: data.effective_footer_policy,
435
452
  footer_policy_locked_reason: data.footer_policy_locked_reason,
package/lib/up.mjs CHANGED
@@ -7,9 +7,11 @@ import { assertKnownFlags, flagValue, normalizeArgv, positionalArgs } from "./ar
7
7
  const HELP = `run402 up — Provision/link/deploy the current app
8
8
 
9
9
  Usage:
10
- run402 up [--name <name>] [--project <id>] [--manifest <path>] [--dir <path>] [--tier <tier>] [-y|--yes] [--check|--print-spec|--plan|--require-plan <id>] [--quiet]
10
+ run402 up [repo-or-path] [--name <name>] [--project <id>] [--manifest <path>] [--dir <path>] [--tier <tier>] [-y|--yes] [--check|--print-spec|--plan|--require-plan <id>] [--json|--json-stream] [--quiet]
11
11
 
12
12
  Options:
13
+ repo-or-path Local app directory or public Git repository URL. Defaults
14
+ to the current directory.
13
15
  --name <name> Project display name when up needs to create a project.
14
16
  Not a deploy manifest field and never renames a project.
15
17
  --project <id> Explicit project id. Highest-priority project selector.
@@ -33,6 +35,12 @@ Options:
33
35
  --allow-warning <code>
34
36
  Acknowledge a reviewed deploy warning code (repeatable).
35
37
  --allow-warnings Acknowledge all reviewed deploy warnings.
38
+ --allow-prune Approve destructive managed-resource prune steps for app manifests.
39
+ --max-spend-usd <n> Maximum spend up may approve for app readiness.
40
+ --build-mode <mode> Override app build mode: local, remote, or sandbox.
41
+ --allow-shell-build Approve shell-string build commands in run402.json.
42
+ --json Emit one final JSON object on stdout.
43
+ --json-stream Emit NDJSON progress events on stdout and a final result event.
36
44
  --quiet Suppress action progress events on stderr.
37
45
 
38
46
  Project resolution:
@@ -40,6 +48,7 @@ Project resolution:
40
48
  project creation from --name > approved active-project fallback.
41
49
 
42
50
  Examples:
51
+ run402 up https://github.com/kychee-com/kysigned --name kysigned2 --yes --json
43
52
  run402 up --name my-app -y
44
53
  run402 up --manifest run402.deploy.ts --check
45
54
  run402 up --manifest run402.deploy.ts --plan
@@ -47,6 +56,7 @@ Examples:
47
56
  `;
48
57
 
49
58
  const TIERS = new Set(["prototype", "hobby", "team"]);
59
+ const BUILD_MODES = new Set(["local", "remote", "sandbox"]);
50
60
 
51
61
  export async function run(args = []) {
52
62
  const parsed = normalizeArgv(args);
@@ -56,8 +66,36 @@ export async function run(args = []) {
56
66
  }
57
67
  assertKnownFlags(
58
68
  parsed,
59
- ["--help", "-h", "-y", "--yes", "--dry-run", "--check", "--print-spec", "--plan", "--quiet", "--final-only", "--allow-warnings"],
60
- ["--name", "--project", "--manifest", "--dir", "--tier", "--idempotency-key", "--allow-warning", "--require-plan", "--plan-fingerprint"],
69
+ [
70
+ "--help",
71
+ "-h",
72
+ "-y",
73
+ "--yes",
74
+ "--dry-run",
75
+ "--check",
76
+ "--print-spec",
77
+ "--plan",
78
+ "--quiet",
79
+ "--final-only",
80
+ "--allow-warnings",
81
+ "--allow-prune",
82
+ "--allow-shell-build",
83
+ "--json",
84
+ "--json-stream",
85
+ ],
86
+ [
87
+ "--name",
88
+ "--project",
89
+ "--manifest",
90
+ "--dir",
91
+ "--tier",
92
+ "--idempotency-key",
93
+ "--allow-warning",
94
+ "--require-plan",
95
+ "--plan-fingerprint",
96
+ "--max-spend-usd",
97
+ "--build-mode",
98
+ ],
61
99
  );
62
100
  const extras = positionalArgs(parsed, [
63
101
  "--name",
@@ -69,14 +107,24 @@ export async function run(args = []) {
69
107
  "--allow-warning",
70
108
  "--require-plan",
71
109
  "--plan-fingerprint",
110
+ "--max-spend-usd",
111
+ "--build-mode",
72
112
  ]);
73
- if (extras.length > 0) {
113
+ if (extras.length > 1) {
74
114
  fail({
75
115
  code: "BAD_USAGE",
76
- message: `Unexpected argument for up: ${extras[0]}`,
116
+ message: `Unexpected argument for up: ${extras[1]}`,
77
117
  hint: "Use `run402 up --help`.",
78
118
  });
79
119
  }
120
+ const source = extras[0] ?? undefined;
121
+ if (source && flagValue(parsed, "--dir")) {
122
+ fail({
123
+ code: "BAD_USAGE",
124
+ message: "Pass either a positional repo/path source or --dir, not both.",
125
+ details: { source, dir: flagValue(parsed, "--dir") },
126
+ });
127
+ }
80
128
 
81
129
  const tier = flagValue(parsed, "--tier") ?? undefined;
82
130
  if (tier && !TIERS.has(tier)) {
@@ -87,8 +135,28 @@ export async function run(args = []) {
87
135
  });
88
136
  }
89
137
 
138
+ const buildMode = flagValue(parsed, "--build-mode") ?? undefined;
139
+ if (buildMode && !BUILD_MODES.has(buildMode)) {
140
+ fail({
141
+ code: "BAD_FLAG",
142
+ message: "--build-mode must be one of: local, remote, sandbox",
143
+ details: { flag: "--build-mode", value: buildMode, allowed: [...BUILD_MODES] },
144
+ });
145
+ }
146
+
147
+ const maxSpendRaw = flagValue(parsed, "--max-spend-usd");
148
+ const maxSpendUsd = maxSpendRaw === null ? undefined : Number(maxSpendRaw);
149
+ if (maxSpendRaw !== null && (!Number.isFinite(maxSpendUsd) || maxSpendUsd < 0)) {
150
+ fail({
151
+ code: "BAD_FLAG",
152
+ message: "--max-spend-usd must be a non-negative number",
153
+ details: { flag: "--max-spend-usd", value: maxSpendRaw },
154
+ });
155
+ }
156
+
90
157
  const yes = parsed.includes("-y") || parsed.includes("--yes");
91
- const quiet = parsed.includes("--quiet") || parsed.includes("--final-only");
158
+ const jsonStream = parsed.includes("--json-stream");
159
+ const quiet = parsed.includes("--quiet") || parsed.includes("--final-only") || jsonStream;
92
160
  const mode = parseExecutionMode(parsed);
93
161
  const dryRun = parsed.includes("--dry-run");
94
162
  if (dryRun && mode !== undefined) {
@@ -110,24 +178,39 @@ export async function run(args = []) {
110
178
  try {
111
179
  const sdk = getSdk();
112
180
  const result = await sdk.up({
181
+ source,
113
182
  name: flagValue(parsed, "--name") ?? undefined,
114
183
  projectId: flagValue(parsed, "--project") ?? undefined,
115
184
  manifest: flagValue(parsed, "--manifest") ?? undefined,
116
185
  dir: flagValue(parsed, "--dir") ?? undefined,
117
186
  tier,
118
187
  idempotencyKey: flagValue(parsed, "--idempotency-key") ?? undefined,
188
+ allowPrune: parsed.includes("--allow-prune") ? true : undefined,
189
+ maxSpendUsd,
190
+ buildMode,
191
+ allowShellBuild: parsed.includes("--allow-shell-build") ? true : undefined,
119
192
  allowWarnings: parsed.includes("--allow-warnings") ? true : undefined,
120
193
  allowWarningCodes,
121
194
  }, {
122
195
  ...(mode !== undefined ? { mode } : {}),
123
196
  dryRun,
124
197
  approval: makeApproval(yes),
125
- onEvent: quiet ? undefined : (event) => {
126
- console.error(JSON.stringify(event));
127
- },
198
+ onEvent: jsonStream
199
+ ? (event) => console.log(JSON.stringify({ type: "action.event", event }))
200
+ : quiet
201
+ ? undefined
202
+ : (event) => {
203
+ console.error(JSON.stringify(event));
204
+ },
128
205
  });
129
- if (mode === "printSpec") {
206
+ if (jsonStream) {
207
+ console.log(JSON.stringify({ type: "run402.up.result", result }));
208
+ } else if (mode === "printSpec") {
130
209
  console.log(JSON.stringify(result.result?.spec ?? null, null, 2));
210
+ } else if (result?.result?.app_result && !parsed.includes("--json")) {
211
+ console.log(formatAppUpHuman(result.result.app_result));
212
+ } else if (!parsed.includes("--json") && shouldRenderHumanSuccess(result)) {
213
+ console.log(formatLegacyUpSuccess(result));
131
214
  } else {
132
215
  console.log(JSON.stringify(result, null, 2));
133
216
  }
@@ -207,3 +290,56 @@ function makeApproval(yes) {
207
290
  },
208
291
  };
209
292
  }
293
+
294
+ function shouldRenderHumanSuccess(result) {
295
+ return result?.action === "up" &&
296
+ result?.dry_run === false &&
297
+ result?.mode === "apply" &&
298
+ result?.result?.deploy?.release_id;
299
+ }
300
+
301
+ function formatLegacyUpSuccess(result) {
302
+ const urls = result?.result?.deploy?.urls ?? {};
303
+ const origin = urls.site ?? urls.subdomain ?? urls.deployment;
304
+ const lines = [];
305
+ if (origin) lines.push(`Success! Project is up at: ${origin}`);
306
+ else lines.push("Success! Project is up.");
307
+ const releaseId = result?.result?.deploy?.release_id;
308
+ if (releaseId) lines.push(`Release: ${releaseId}`);
309
+ return lines.join("\n");
310
+ }
311
+
312
+ function formatAppUpHuman(appResult) {
313
+ const lines = [];
314
+ const status = appResult?.status ?? "unknown";
315
+ const origin = appResult?.project?.public_origin;
316
+
317
+ if (status === "succeeded" && origin) {
318
+ lines.push(`Success! Project is up at: ${origin}`);
319
+ } else if (status === "succeeded") {
320
+ lines.push("Success! Project is up.");
321
+ } else if (status === "planned") {
322
+ lines.push("Run402 up plan is ready.");
323
+ if (origin) lines.push(`Planned project URL: ${origin}`);
324
+ } else if (status === "blocked") {
325
+ lines.push("Run402 up is blocked.");
326
+ } else {
327
+ lines.push(`Run402 up status: ${status}`);
328
+ }
329
+
330
+ const diagnostics = Array.isArray(appResult?.diagnostics) ? appResult.diagnostics : [];
331
+ for (const diagnostic of diagnostics) {
332
+ if (diagnostic?.message) lines.push(`- ${diagnostic.message}`);
333
+ }
334
+
335
+ const nextActions = Array.isArray(appResult?.next_actions) ? appResult.next_actions : [];
336
+ if (nextActions.length > 0) {
337
+ lines.push("Next:");
338
+ for (const action of nextActions) {
339
+ if (action?.message) lines.push(`- ${action.message}`);
340
+ if (action?.command) lines.push(` ${action.command}`);
341
+ }
342
+ }
343
+
344
+ return lines.join("\n");
345
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 and MPP micropayments.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,5 @@
1
1
  import type { DeployResult, PlanResponse, ReleaseSpec } from "./namespaces/deploy.types.js";
2
+ import type { Run402AppInstallGraph, Run402AppUpResultEnvelope } from "./app-up.js";
2
3
  import type { ProvisionResult } from "./namespaces/projects.types.js";
3
4
  import type { TierName, TierSetResult } from "./namespaces/tier.js";
4
5
  import type { Run402ExecutionMode } from "./config.js";
@@ -28,6 +29,8 @@ export interface Run402TierSetActionInput {
28
29
  }
29
30
  export interface Run402UpActionInput {
30
31
  type: typeof Run402Action.Up;
32
+ /** Local app path or repository URL. Defaults to `dir` / cwd. */
33
+ source?: string;
31
34
  /** Workspace directory to inspect. Defaults to `process.cwd()` in the Node SDK. */
32
35
  dir?: string;
33
36
  /** Explicit deploy manifest path. Defaults to manifest discovery inside `dir`. */
@@ -45,6 +48,14 @@ export interface Run402UpActionInput {
45
48
  orgId?: string;
46
49
  /** Root idempotency key. Child mutation keys are derived from this value. */
47
50
  idempotencyKey?: string;
51
+ /** Approve destructive managed-resource prune/down operations for app-aware up. */
52
+ allowPrune?: boolean;
53
+ /** Maximum allowed spend in USD for app-aware up. Spend-impacting nodes block above this cap. */
54
+ maxSpendUsd?: number;
55
+ /** Override app build mode for app-aware up. */
56
+ buildMode?: "local" | "remote" | "sandbox";
57
+ /** Stronger approval for shell-string build commands in app-aware up. */
58
+ allowShellBuild?: boolean;
48
59
  /** Continue past deploy-plan warnings, forwarded to `apply()`. */
49
60
  allowWarnings?: boolean;
50
61
  /** Continue past selected deploy-plan warnings, forwarded to `apply()`. */
@@ -61,7 +72,7 @@ export interface Run402ActionApprovalRequest {
61
72
  message: string;
62
73
  mutations: Run402ActionMutation[];
63
74
  }
64
- export type Run402ActionMutation = "allowance.create" | "allowance.faucet" | "tier.set" | "projects.provision" | "workspace.link.write" | "deploy.apply";
75
+ export type Run402ActionMutation = "allowance.create" | "allowance.faucet" | "tier.set" | "projects.provision" | "workspace.link.write" | "app.source.resolve" | "app.install" | "deploy.apply";
65
76
  export interface Run402ActionRunOptions {
66
77
  /**
67
78
  * Canonical execution mode for typed-config workflows.
@@ -120,6 +131,8 @@ export interface Run402UpResult {
120
131
  project_id: string;
121
132
  manifest_path: string;
122
133
  workspace_link_path?: string;
134
+ app_graph?: Run402AppInstallGraph;
135
+ app_result?: Run402AppUpResultEnvelope;
123
136
  spec?: ReleaseSpec;
124
137
  plan?: PlanResponse;
125
138
  deploy?: DeployResult;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GACzB,kCAAkC,GAClC,wBAAwB,GACxB,mBAAmB,C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E,yBAAyB,CAAC;IACvC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,MAAM,mCAAmC,GAC7C,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAEtC,MAAM,MAAM,yBAAyB,GACnC,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAC9B,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,GAAG,CACD,KAAK,EAAE,kCAAkC,EACzC,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAChD,GAAG,CACD,KAAK,EAAE,wBAAwB,EAC/B,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,GAAG,CACD,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,GAAG,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iBAAiB,EAAE,oBAAoB;IACvC,OAAO,EAAE,UAAU;IACnB,EAAE,EAAE,IAAI;CACA,CAAC"}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iBAAiB,EAAE,oBAAoB;IACvC,OAAO,EAAE,UAAU;IACnB,EAAE,EAAE,IAAI;CACA,CAAC"}
@@ -0,0 +1,271 @@
1
+ import type { ReleaseSpec } from "./namespaces/deploy.types.js";
2
+ export declare const RUN402_APP_SCHEMA_ID: "https://run402.com/schemas/run402-app.v1.schema.json";
3
+ export declare const RUN402_APP_MANIFEST_FILENAME: "run402.json";
4
+ export declare const RUN402_RELEASE_MANIFEST_FILENAME: "run402.release.json";
5
+ export declare const RUN402_APP_SPEC_VERSION: 1;
6
+ export declare const RUN402_APP_INSTALL_GRAPH_VERSION: "run402.app_install_graph.v1";
7
+ export declare const RUN402_APP_UP_RESULT_KIND: "run402.up.result";
8
+ export declare const RUN402_APP_UP_RESULT_SCHEMA_VERSION: "run402.up.result.v1";
9
+ export declare const RUN402_APP_UP_RESULT_SCHEMA_URL: "https://run402.com/schemas/run402-up-result.v1.schema.json";
10
+ export declare const RUN402_BINDING_CLASSES: readonly ["generated_config_binding", "generated_secret_binding", "user_secret"];
11
+ export declare const RUN402_BINDING_SCOPES: readonly ["build", "runtime", "client", "verify", "template"];
12
+ export interface Run402AppSpec {
13
+ $schema: typeof RUN402_APP_SCHEMA_ID;
14
+ spec_version: typeof RUN402_APP_SPEC_VERSION;
15
+ app: {
16
+ id: string;
17
+ display_name?: string;
18
+ description?: string;
19
+ };
20
+ project: {
21
+ name?: string;
22
+ id?: string;
23
+ origin?: {
24
+ subdomain?: string;
25
+ };
26
+ };
27
+ resources?: {
28
+ mailboxes?: Record<string, Run402AppMailboxSpec>;
29
+ webhooks?: Record<string, Run402AppWebhookSpec>;
30
+ };
31
+ secrets?: Record<string, Run402AppSecretSpec>;
32
+ build?: Run402AppBuildSpec;
33
+ release: Run402AppReleaseSpec;
34
+ lifecycle?: {
35
+ project?: "per_app" | "shared";
36
+ prune?: "approval_required" | "disabled";
37
+ };
38
+ verify?: {
39
+ http?: Run402AppHttpVerifySpec[];
40
+ };
41
+ }
42
+ export interface Run402AppMailboxSpec {
43
+ slug?: string;
44
+ roles?: ("default_outbound" | "auth_sender")[];
45
+ description?: string;
46
+ }
47
+ export interface Run402AppWebhookSpec {
48
+ mailbox: string;
49
+ url: string;
50
+ events: string[];
51
+ enabled?: boolean;
52
+ signing?: {
53
+ required?: boolean;
54
+ };
55
+ }
56
+ export interface Run402AppSecretSpec {
57
+ required?: boolean;
58
+ source_env?: string;
59
+ description?: string;
60
+ }
61
+ export interface Run402AppBuildSpec {
62
+ mode?: "local" | "remote" | "sandbox";
63
+ commands?: Run402AppBuildCommand[];
64
+ }
65
+ export interface Run402AppBuildCommand {
66
+ id: string;
67
+ argv?: string[];
68
+ shell?: string;
69
+ cwd?: string;
70
+ }
71
+ export type Run402AppReleaseSpec = Omit<Partial<ReleaseSpec>, "project"> & {
72
+ project?: never;
73
+ };
74
+ export interface Run402AppHttpVerifySpec {
75
+ id: string;
76
+ path?: string;
77
+ url?: string;
78
+ expect: {
79
+ status: number;
80
+ };
81
+ retries?: number;
82
+ }
83
+ export type Run402AppSourceMetadata = {
84
+ kind: "local";
85
+ path: string;
86
+ commit?: string;
87
+ } | {
88
+ kind: "repo";
89
+ repo_url: string;
90
+ commit?: string;
91
+ };
92
+ export interface CompileRun402AppInstallGraphOptions {
93
+ source?: Run402AppSourceMetadata;
94
+ name?: string;
95
+ root_idempotency_key?: string;
96
+ }
97
+ export type Run402AppInstallNodeStatus = "planned" | "running" | "succeeded" | "blocked" | "failed" | "skipped";
98
+ export type Run402AppInstallMutation = "none" | "local" | "remote" | "destructive";
99
+ export type Run402AppUpStatus = "planned" | "running" | "succeeded" | "blocked" | "failed" | "partial" | "deployed_unverified";
100
+ export type Run402AppUpErrorCode = "APP_SPEC_INVALID" | "PROJECT_REQUIRED" | "PROJECT_CONFLICT" | "TIER_REQUIRED" | "SPEND_APPROVAL_REQUIRED" | "BUILD_APPROVAL_REQUIRED" | "BUILD_FAILED" | "MISSING_SECRET" | "RESOURCE_CONFLICT" | "RESOURCE_PRUNE_REQUIRES_APPROVAL" | "UNSUPPORTED_RESOURCE_KIND" | "RELEASE_APPLY_FAILED" | "VERIFY_FAILED" | "CONCURRENT_UP_IN_PROGRESS" | "APP_INSTALL_STATE_UNAVAILABLE" | "REMOTE_BUILD_UNSUPPORTED";
101
+ export type Run402BindingClass = typeof RUN402_BINDING_CLASSES[number];
102
+ export type Run402BindingScope = typeof RUN402_BINDING_SCOPES[number];
103
+ export interface Run402AppUpSpendImpact {
104
+ amount_usd_micros?: number;
105
+ currency?: "USD";
106
+ description?: string;
107
+ }
108
+ export interface Run402AppUpNextAction {
109
+ type: string;
110
+ code?: Run402AppUpErrorCode;
111
+ message?: string;
112
+ command?: string;
113
+ argv?: string[];
114
+ field_path?: string;
115
+ node_id?: string;
116
+ spend?: Run402AppUpSpendImpact;
117
+ docs_url?: string;
118
+ }
119
+ export interface Run402AppUpDiagnostic {
120
+ code: Run402AppUpErrorCode;
121
+ message: string;
122
+ severity: "info" | "warning" | "error";
123
+ node_id?: string;
124
+ field_path?: string;
125
+ details?: Record<string, unknown>;
126
+ }
127
+ export interface Run402AppBinding {
128
+ env: string;
129
+ binding_class: Run402BindingClass;
130
+ scopes: Run402BindingScope[];
131
+ source: string;
132
+ value?: string;
133
+ redacted?: boolean;
134
+ }
135
+ export interface Run402AppUpApprovalPolicy {
136
+ yes: boolean;
137
+ allow_prune: boolean;
138
+ max_spend_usd: number | null;
139
+ build_mode: "local" | "remote" | "sandbox" | null;
140
+ shell_build_approved: boolean;
141
+ }
142
+ export interface Run402AppUpStep {
143
+ id: string;
144
+ kind: string;
145
+ status: Run402AppInstallNodeStatus;
146
+ mutation: Run402AppInstallMutation;
147
+ destructive: boolean;
148
+ spend: boolean;
149
+ idempotent: boolean;
150
+ ensure_key?: string;
151
+ input_digest: `sha256:${string}`;
152
+ depends_on: string[];
153
+ diagnostics?: Run402AppUpDiagnostic[];
154
+ next_actions?: Run402AppUpNextAction[];
155
+ }
156
+ export interface Run402AppUpResourceSummary {
157
+ mailboxes: Record<string, {
158
+ id: string | null;
159
+ address: string | null;
160
+ bindings: Run402AppBinding[];
161
+ }>;
162
+ webhooks: Record<string, {
163
+ id: string | null;
164
+ mailbox: string;
165
+ url: string;
166
+ events: string[];
167
+ enabled: boolean;
168
+ }>;
169
+ bindings: Run402AppBinding[];
170
+ user_secrets: Record<string, {
171
+ required: boolean;
172
+ source_env: string | null;
173
+ satisfied: boolean;
174
+ }>;
175
+ }
176
+ export interface Run402AppUpResultEnvelope {
177
+ kind: typeof RUN402_APP_UP_RESULT_KIND;
178
+ schema_version: typeof RUN402_APP_UP_RESULT_SCHEMA_VERSION;
179
+ schema_url: typeof RUN402_APP_UP_RESULT_SCHEMA_URL;
180
+ status: Run402AppUpStatus;
181
+ operation_id: string | null;
182
+ install_id: string | null;
183
+ spec_digest: `sha256:${string}`;
184
+ graph_digest: `sha256:${string}`;
185
+ source: Run402AppSourceMetadata | null;
186
+ manifest_path: string;
187
+ started_at: string;
188
+ ended_at: string;
189
+ duration_ms: number;
190
+ approval_policy: Run402AppUpApprovalPolicy;
191
+ dry_run: boolean;
192
+ project: {
193
+ id: string | null;
194
+ name: string | null;
195
+ public_origin: string | null;
196
+ };
197
+ steps: Run402AppUpStep[];
198
+ resources: Run402AppUpResourceSummary;
199
+ release: {
200
+ operation_id: string | null;
201
+ release_id: string | null;
202
+ spec: Run402AppReleaseSpec;
203
+ };
204
+ verification: {
205
+ http: Array<{
206
+ id: string;
207
+ status: Run402AppInstallNodeStatus;
208
+ path?: string;
209
+ url?: string;
210
+ expected_status: number;
211
+ actual_status?: number | null;
212
+ }>;
213
+ };
214
+ diagnostics: Run402AppUpDiagnostic[];
215
+ next_actions: Run402AppUpNextAction[];
216
+ graph: Run402AppInstallGraph;
217
+ }
218
+ export interface Run402AppInstallGraphNode {
219
+ id: string;
220
+ kind: string;
221
+ depends_on: string[];
222
+ input_digest: `sha256:${string}`;
223
+ status: Run402AppInstallNodeStatus;
224
+ mutation: Run402AppInstallMutation;
225
+ idempotent: boolean;
226
+ ensure_key?: string;
227
+ destructive: boolean;
228
+ spend: boolean;
229
+ details?: Record<string, unknown>;
230
+ }
231
+ export interface Run402GeneratedMailboxBindings {
232
+ id: string;
233
+ address: string;
234
+ }
235
+ export interface Run402AppInstallBindings {
236
+ mailboxes: Record<string, Run402GeneratedMailboxBindings>;
237
+ }
238
+ export interface Run402AppInstallGraph {
239
+ schema_version: typeof RUN402_APP_INSTALL_GRAPH_VERSION;
240
+ app_id: string;
241
+ source: Run402AppSourceMetadata | null;
242
+ spec_digest: `sha256:${string}`;
243
+ graph_digest: `sha256:${string}`;
244
+ nodes: Run402AppInstallGraphNode[];
245
+ release_spec: Run402AppReleaseSpec;
246
+ bindings: Run402AppInstallBindings;
247
+ }
248
+ export declare function compileRun402AppInstallGraph(spec: Run402AppSpec, opts?: CompileRun402AppInstallGraphOptions): Promise<Run402AppInstallGraph>;
249
+ export declare function generatedMailboxBindings(logicalName: string): Run402GeneratedMailboxBindings;
250
+ export declare function mailboxRuntimeBindings(logicalName: string): Run402AppBinding[];
251
+ export declare function platformMetadataBindings(opts?: {
252
+ publicOriginKnown?: boolean;
253
+ }): Run402AppBinding[];
254
+ export declare function createRun402AppUpResult(input: {
255
+ graph: Run402AppInstallGraph;
256
+ manifest_path: string;
257
+ status: Run402AppUpStatus;
258
+ started_at: string;
259
+ ended_at?: string;
260
+ dry_run: boolean;
261
+ project_id?: string | null;
262
+ project_name?: string | null;
263
+ public_origin?: string | null;
264
+ approval_policy?: Partial<Run402AppUpApprovalPolicy>;
265
+ operation_id?: string | null;
266
+ install_id?: string | null;
267
+ diagnostics?: Run402AppUpDiagnostic[];
268
+ next_actions?: Run402AppUpNextAction[];
269
+ blocked_node_id?: string;
270
+ }): Run402AppUpResultEnvelope;
271
+ //# sourceMappingURL=app-up.d.ts.map