@m-kopa/launchpad-cli 0.73.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
21
  // src/version.ts
22
- var CLI_VERSION = "0.73.0";
22
+ var CLI_VERSION = "0.74.0";
23
23
 
24
24
  // src/config.ts
25
25
  import { readFileSync } from "node:fs";
@@ -2599,7 +2599,7 @@ import { join as join6 } from "node:path";
2599
2599
  import { parse as parseYaml2 } from "yaml";
2600
2600
 
2601
2601
  // ../launchpad-engine/dist/schema.js
2602
- import { z as z2 } from "zod";
2602
+ import { z as z3 } from "zod";
2603
2603
 
2604
2604
  // ../launchpad-engine/dist/audience.js
2605
2605
  import { z } from "zod";
@@ -2611,11 +2611,89 @@ function validateAudience(access, ctx) {
2611
2611
  ctx.addIssue({ code: "custom", path: ["audience"], message: "Private access requires a verified private_owner, no groups, and employee identity; group access requires at least one group and no private_owner." });
2612
2612
  }
2613
2613
 
2614
+ // ../launchpad-engine/dist/integrations.js
2615
+ import { z as z2 } from "zod";
2616
+ var INTEGRATION_METHODS = ["POST", "PUT", "PATCH", "DELETE"];
2617
+ var MAX_INTEGRATIONS = 10;
2618
+ var INTEGRATION_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,62}$/;
2619
+ var INTEGRATION_KEY_SHA256_REGEX = /^[0-9a-f]{64}$/;
2620
+ var PATH_CHARS = /^[A-Za-z0-9/_.~-]+$/;
2621
+ var IP_REGEX = /^(?:\d{1,3}(?:\.\d{1,3}){3}|[0-9A-Fa-f:.]*:[0-9A-Fa-f:.]*)$/;
2622
+ function integrationPathProblem(path7) {
2623
+ if (path7 === "/")
2624
+ return null;
2625
+ if (!path7.startsWith("/"))
2626
+ return "must start with '/'";
2627
+ if (path7.length > 256)
2628
+ return "must be at most 256 characters";
2629
+ if (!PATH_CHARS.test(path7))
2630
+ return "may only contain A-Z a-z 0-9 / _ . ~ -";
2631
+ if (path7.endsWith("/"))
2632
+ return "must not end with '/'";
2633
+ const badSegment = path7.slice(1).split("/").some((seg) => seg === "" || seg === "." || seg === "..");
2634
+ return badSegment ? "must not contain '//', '.' or '..' segments" : null;
2635
+ }
2636
+ var IntegrationNameSchema = z2.string().regex(INTEGRATION_NAME_REGEX, "integration name must match ^[a-z0-9][a-z0-9-]{0,62}$");
2637
+ var IntegrationPathSchema = z2.string().superRefine((path7, ctx) => {
2638
+ const problem = integrationPathProblem(path7);
2639
+ if (problem !== null)
2640
+ ctx.addIssue({ code: "custom", message: `integration path ${problem}` });
2641
+ });
2642
+ var IntegrationMethodsSchema = z2.array(z2.enum(INTEGRATION_METHODS)).min(1, "integration methods must not be empty").refine((m) => new Set(m).size === m.length, "integration methods must not repeat");
2643
+ var IntegrationSchema = z2.object({
2644
+ name: IntegrationNameSchema,
2645
+ path: IntegrationPathSchema,
2646
+ methods: IntegrationMethodsSchema
2647
+ }).strict();
2648
+ function uniqueNames(entries, ctx, scope) {
2649
+ const seen = new Set;
2650
+ entries.forEach((entry, i) => {
2651
+ if (seen.has(entry.name)) {
2652
+ ctx.addIssue({ code: "custom", path: [i, "name"], message: `duplicate integration name '${entry.name}' ${scope}` });
2653
+ }
2654
+ seen.add(entry.name);
2655
+ });
2656
+ }
2657
+ var IntegrationsSchema = z2.array(IntegrationSchema).max(MAX_INTEGRATIONS, `at most ${MAX_INTEGRATIONS} integrations per app`).superRefine((entries, ctx) => uniqueNames(entries, ctx, "in this manifest"));
2658
+ var IntegrationKeySha256Schema = z2.string().regex(INTEGRATION_KEY_SHA256_REGEX, "key_sha256 must be 64 lowercase hex chars");
2659
+ var IntegrationIpSchema = z2.string().regex(IP_REGEX, "allowed_ips entries must be exact IPv4 or IPv6 addresses");
2660
+ var IntegrationApprovalSchema = z2.object({
2661
+ host: z2.string().min(1),
2662
+ name: IntegrationNameSchema,
2663
+ path: IntegrationPathSchema,
2664
+ methods: IntegrationMethodsSchema,
2665
+ key_sha256: z2.array(IntegrationKeySha256Schema).refine((k) => new Set(k).size === k.length, "key_sha256 must not repeat"),
2666
+ allowed_ips: z2.array(IntegrationIpSchema).optional(),
2667
+ approved_by: z2.string().min(1),
2668
+ approved_at: z2.string().regex(/^\d{4}-\d{2}-\d{2}$/, "approved_at must be YYYY-MM-DD")
2669
+ }).strict();
2670
+ var IntegrationsFileSchema = z2.object({
2671
+ version: z2.literal(1),
2672
+ integrations: z2.array(IntegrationApprovalSchema)
2673
+ }).strict().superRefine((file, ctx) => {
2674
+ const perHost = new Map;
2675
+ const seen = new Set;
2676
+ file.integrations.forEach((entry, i) => {
2677
+ const id = `${entry.host}
2678
+ ${entry.name}`;
2679
+ if (seen.has(id)) {
2680
+ ctx.addIssue({ code: "custom", path: ["integrations", i], message: `duplicate integration '${entry.name}' for ${entry.host}` });
2681
+ }
2682
+ seen.add(id);
2683
+ perHost.set(entry.host, (perHost.get(entry.host) ?? 0) + 1);
2684
+ });
2685
+ for (const [host, count] of perHost) {
2686
+ if (count > MAX_INTEGRATIONS) {
2687
+ ctx.addIssue({ code: "custom", path: ["integrations"], message: `${host} has ${count} integrations; at most ${MAX_INTEGRATIONS}` });
2688
+ }
2689
+ }
2690
+ });
2691
+
2614
2692
  // ../launchpad-engine/dist/schema.js
2615
2693
  var APP_TYPES2 = ["static", "react", "react+api", "container"];
2616
2694
  var AUTH_MODES = ["access", "gateway"];
2617
2695
  var IDENTITY_TYPES = ["employee", "dsr"];
2618
- var IdentityTypesSchema = z2.array(z2.enum(IDENTITY_TYPES)).min(1).refine((values) => new Set(values).size === values.length, {
2696
+ var IdentityTypesSchema = z3.array(z3.enum(IDENTITY_TYPES)).min(1).refine((values) => new Set(values).size === values.length, {
2619
2697
  message: "identity_types must not contain duplicates"
2620
2698
  }).refine((values) => values.includes("employee"), {
2621
2699
  message: "identity_types must include employee"
@@ -2627,36 +2705,36 @@ var PRIMARY_TARGET = "primary";
2627
2705
  var SLUG_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
2628
2706
  var ENV_NAME_REGEX = /^[A-Z][A-Z0-9_]*$/;
2629
2707
  var SESSION_DURATION_REGEX = /^[0-9]+(s|m|h)$/;
2630
- var MetadataSchema = z2.object({
2631
- name: z2.string().min(2).max(63).regex(SLUG_REGEX, "must be lowercase letters, digits, and hyphens; start/end alphanumeric"),
2632
- team: z2.string().min(1),
2633
- owner: z2.string().email(),
2634
- description: z2.string().max(280).optional()
2708
+ var MetadataSchema = z3.object({
2709
+ name: z3.string().min(2).max(63).regex(SLUG_REGEX, "must be lowercase letters, digits, and hyphens; start/end alphanumeric"),
2710
+ team: z3.string().min(1),
2711
+ owner: z3.string().email(),
2712
+ description: z3.string().max(280).optional()
2635
2713
  }).strict();
2636
- var DeploymentSchema = z2.object({
2637
- type: z2.enum(APP_TYPES2),
2638
- runtime: z2.enum(RUNTIMES).optional()
2714
+ var DeploymentSchema = z3.object({
2715
+ type: z3.enum(APP_TYPES2),
2716
+ runtime: z3.enum(RUNTIMES).optional()
2639
2717
  }).strict();
2640
- var AccessSchema = z2.object({
2641
- audience: z2.literal("private").optional(),
2718
+ var AccessSchema = z3.object({
2719
+ audience: z3.literal("private").optional(),
2642
2720
  private_owner: PrivateOwnerSchema.optional(),
2643
- allowed_entra_group: z2.string().min(1).optional(),
2644
- allowed_entra_groups: z2.array(z2.string().min(1)).refine((arr) => new Set(arr).size === arr.length, { message: "allowed_entra_groups must not contain duplicates" }).optional(),
2645
- session_duration: z2.string().regex(SESSION_DURATION_REGEX, "must match Go duration format, e.g. 24h / 30m / 60s").optional(),
2721
+ allowed_entra_group: z3.string().min(1).optional(),
2722
+ allowed_entra_groups: z3.array(z3.string().min(1)).refine((arr) => new Set(arr).size === arr.length, { message: "allowed_entra_groups must not contain duplicates" }).optional(),
2723
+ session_duration: z3.string().regex(SESSION_DURATION_REGEX, "must match Go duration format, e.g. 24h / 30m / 60s").optional(),
2646
2724
  identity_types: IdentityTypesSchema.optional()
2647
2725
  }).strict().superRefine((access, ctx) => {
2648
2726
  const hasSingular = access.allowed_entra_group !== undefined;
2649
2727
  const hasPlural = access.allowed_entra_groups !== undefined;
2650
2728
  if (!hasSingular && !hasPlural && access.audience !== "private") {
2651
2729
  ctx.addIssue({
2652
- code: z2.ZodIssueCode.custom,
2730
+ code: z3.ZodIssueCode.custom,
2653
2731
  message: "either `allowed_entra_group` (singular, legacy) or `allowed_entra_groups` (plural, preferred) must be set",
2654
2732
  path: ["allowed_entra_groups"]
2655
2733
  });
2656
2734
  }
2657
2735
  if (hasSingular && hasPlural) {
2658
2736
  ctx.addIssue({
2659
- code: z2.ZodIssueCode.custom,
2737
+ code: z3.ZodIssueCode.custom,
2660
2738
  message: "`allowed_entra_group` (singular) and `allowed_entra_groups` (plural) are mutually exclusive; use the plural form",
2661
2739
  path: ["allowed_entra_groups"]
2662
2740
  });
@@ -2670,72 +2748,73 @@ function allowedEntraGroups(access) {
2670
2748
  }
2671
2749
  return [access.allowed_entra_group];
2672
2750
  }
2673
- var ContainerSchema = z2.object({
2674
- name: z2.string().min(2).max(32).regex(SLUG_REGEX, "container name must be lowercase letters, digits, and hyphens"),
2675
- image: z2.string().min(1),
2676
- port: z2.number().int().min(1).max(65535),
2677
- ingress: z2.boolean().optional(),
2678
- healthcheck: z2.string().default("/health"),
2679
- env: z2.array(z2.string().regex(ENV_NAME_REGEX, "env entries must be UPPER_SNAKE_CASE")).optional(),
2680
- max_instances: z2.number().int().min(1).max(100).optional()
2751
+ var ContainerSchema = z3.object({
2752
+ name: z3.string().min(2).max(32).regex(SLUG_REGEX, "container name must be lowercase letters, digits, and hyphens"),
2753
+ image: z3.string().min(1),
2754
+ port: z3.number().int().min(1).max(65535),
2755
+ ingress: z3.boolean().optional(),
2756
+ healthcheck: z3.string().default("/health"),
2757
+ env: z3.array(z3.string().regex(ENV_NAME_REGEX, "env entries must be UPPER_SNAKE_CASE")).optional(),
2758
+ max_instances: z3.number().int().min(1).max(100).optional()
2681
2759
  }).strict();
2682
- var TargetSchema = z2.object({
2683
- kind: z2.enum(TARGET_KINDS),
2684
- script: z2.string().min(2).max(63).regex(SLUG_REGEX, "target script must be lowercase letters, digits, and hyphens").optional(),
2685
- schedule: z2.array(z2.string().min(1).max(120)).min(1).max(20).optional(),
2686
- d1_binding: z2.string().min(1).max(64).regex(ENV_NAME_REGEX, "d1_binding must be an UPPER_SNAKE_CASE binding name").optional()
2760
+ var TargetSchema = z3.object({
2761
+ kind: z3.enum(TARGET_KINDS),
2762
+ script: z3.string().min(2).max(63).regex(SLUG_REGEX, "target script must be lowercase letters, digits, and hyphens").optional(),
2763
+ schedule: z3.array(z3.string().min(1).max(120)).min(1).max(20).optional(),
2764
+ d1_binding: z3.string().min(1).max(64).regex(ENV_NAME_REGEX, "d1_binding must be an UPPER_SNAKE_CASE binding name").optional()
2687
2765
  }).strict();
2688
- var SecretBindingSchema = z2.object({
2689
- name: z2.string().min(1).max(64).regex(ENV_NAME_REGEX, "secret binding name must be UPPER_SNAKE_CASE"),
2690
- source: z2.enum(SECRET_SOURCES),
2691
- description: z2.string().max(200).optional(),
2692
- targets: z2.union([z2.literal("all"), z2.array(z2.string().min(1)).min(1)]).optional()
2766
+ var SecretBindingSchema = z3.object({
2767
+ name: z3.string().min(1).max(64).regex(ENV_NAME_REGEX, "secret binding name must be UPPER_SNAKE_CASE"),
2768
+ source: z3.enum(SECRET_SOURCES),
2769
+ description: z3.string().max(200).optional(),
2770
+ targets: z3.union([z3.literal("all"), z3.array(z3.string().min(1)).min(1)]).optional()
2693
2771
  }).strict();
2694
- var SecretsSchema = z2.object({
2695
- bindings: z2.array(SecretBindingSchema).optional()
2772
+ var SecretsSchema = z3.object({
2773
+ bindings: z3.array(SecretBindingSchema).optional()
2696
2774
  }).strict();
2697
- var BuildSchema = z2.object({
2698
- command: z2.string().min(1).optional(),
2699
- destination_dir: z2.string().min(1),
2700
- root_dir: z2.string()
2775
+ var BuildSchema = z3.object({
2776
+ command: z3.string().min(1).optional(),
2777
+ destination_dir: z3.string().min(1),
2778
+ root_dir: z3.string()
2701
2779
  }).strict();
2702
2780
  var STATIC_SERVE_DIR = "static";
2703
2781
  function staticNoBuild() {
2704
2782
  return { destination_dir: STATIC_SERVE_DIR, root_dir: "" };
2705
2783
  }
2706
- var AppBoundarySchema = z2.object({
2707
- root: z2.string().min(1).optional(),
2708
- include: z2.array(z2.string().min(1)).min(1).optional(),
2709
- exclude: z2.array(z2.string().min(1)).optional()
2784
+ var AppBoundarySchema = z3.object({
2785
+ root: z3.string().min(1).optional(),
2786
+ include: z3.array(z3.string().min(1)).min(1).optional(),
2787
+ exclude: z3.array(z3.string().min(1)).optional()
2710
2788
  }).strict();
2711
- var ProductionEnvSchema = z2.record(z2.string().regex(ENV_NAME_REGEX, "production_env keys must be UPPER_SNAKE_CASE"), z2.string());
2712
- var VerifySchema = z2.object({
2713
- protected_path: z2.string().min(1).regex(/^\//, "verify.protected_path must be a root-relative path beginning with '/'")
2789
+ var ProductionEnvSchema = z3.record(z3.string().regex(ENV_NAME_REGEX, "production_env keys must be UPPER_SNAKE_CASE"), z3.string());
2790
+ var VerifySchema = z3.object({
2791
+ protected_path: z3.string().min(1).regex(/^\//, "verify.protected_path must be a root-relative path beginning with '/'")
2714
2792
  }).strict();
2715
- var ManifestSchema = z2.object({
2716
- apiVersion: z2.literal("launchpad.m-kopa.us/v1alpha1"),
2717
- kind: z2.literal("App"),
2793
+ var ManifestSchema = z3.object({
2794
+ apiVersion: z3.literal("launchpad.m-kopa.us/v1alpha1"),
2795
+ kind: z3.literal("App"),
2718
2796
  metadata: MetadataSchema,
2719
2797
  deployment: DeploymentSchema,
2720
2798
  access: AccessSchema,
2721
- auth: z2.enum(AUTH_MODES).optional(),
2722
- hostnames: z2.array(z2.string().min(1)).optional(),
2723
- containers: z2.array(ContainerSchema).min(1).optional(),
2799
+ auth: z3.enum(AUTH_MODES).optional(),
2800
+ hostnames: z3.array(z3.string().min(1)).optional(),
2801
+ containers: z3.array(ContainerSchema).min(1).optional(),
2724
2802
  secrets: SecretsSchema.optional(),
2725
- targets: z2.array(TargetSchema).optional(),
2803
+ targets: z3.array(TargetSchema).optional(),
2726
2804
  build: BuildSchema.optional(),
2727
2805
  production_env: ProductionEnvSchema.optional(),
2728
2806
  app: AppBoundarySchema.optional(),
2729
2807
  verify: VerifySchema.optional(),
2730
- confine_origin: z2.boolean().optional(),
2731
- origin: z2.enum(["pages", "dispatch"]).optional(),
2732
- catalogue: z2.object({ listed: z2.boolean().default(true) }).strict().optional(),
2733
- sensitive: z2.boolean().optional()
2808
+ confine_origin: z3.boolean().optional(),
2809
+ origin: z3.enum(["pages", "dispatch"]).optional(),
2810
+ catalogue: z3.object({ listed: z3.boolean().default(true) }).strict().optional(),
2811
+ sensitive: z3.boolean().optional(),
2812
+ integrations: IntegrationsSchema.optional()
2734
2813
  }).strict().superRefine((m, ctx) => {
2735
2814
  const isContainer = m.deployment.type === "container";
2736
2815
  if (m.access.identity_types !== undefined && (m.auth ?? "access") !== "gateway") {
2737
2816
  ctx.addIssue({
2738
- code: z2.ZodIssueCode.custom,
2817
+ code: z3.ZodIssueCode.custom,
2739
2818
  path: ["access", "identity_types"],
2740
2819
  message: "access.identity_types is only valid with auth: gateway"
2741
2820
  });
@@ -2743,19 +2822,19 @@ var ManifestSchema = z2.object({
2743
2822
  if (m.confine_origin !== undefined) {
2744
2823
  if (isContainer) {
2745
2824
  ctx.addIssue({
2746
- code: z2.ZodIssueCode.custom,
2825
+ code: z3.ZodIssueCode.custom,
2747
2826
  path: ["confine_origin"],
2748
2827
  message: "confine_origin is only valid for gateway pages apps (static/react/react+api); container apps have no pages.dev surface."
2749
2828
  });
2750
2829
  } else if (m.auth === "access") {
2751
2830
  ctx.addIssue({
2752
- code: z2.ZodIssueCode.custom,
2831
+ code: z3.ZodIssueCode.custom,
2753
2832
  path: ["confine_origin"],
2754
2833
  message: "confine_origin applies to gateway-fronted apps (auth: gateway); it has no meaning under Cloudflare Access."
2755
2834
  });
2756
2835
  } else if (m.deployment.type === "static" && m.confine_origin === false) {
2757
2836
  ctx.addIssue({
2758
- code: z2.ZodIssueCode.custom,
2837
+ code: z3.ZodIssueCode.custom,
2759
2838
  path: ["confine_origin"],
2760
2839
  message: "confine_origin: false is not allowed for static apps — they have no verifier, so an unconfined apex would be world-readable (ADR 0031)."
2761
2840
  });
@@ -2763,35 +2842,35 @@ var ManifestSchema = z2.object({
2763
2842
  }
2764
2843
  if (isContainer && m.containers === undefined) {
2765
2844
  ctx.addIssue({
2766
- code: z2.ZodIssueCode.custom,
2845
+ code: z3.ZodIssueCode.custom,
2767
2846
  path: ["containers"],
2768
2847
  message: "containers[] is required when deployment.type is 'container'"
2769
2848
  });
2770
2849
  }
2771
2850
  if (!isContainer && m.containers !== undefined) {
2772
2851
  ctx.addIssue({
2773
- code: z2.ZodIssueCode.custom,
2852
+ code: z3.ZodIssueCode.custom,
2774
2853
  path: ["containers"],
2775
2854
  message: `containers[] is only allowed when deployment.type is 'container' (current type: '${m.deployment.type}')`
2776
2855
  });
2777
2856
  }
2778
2857
  if (!isContainer && m.deployment.runtime !== undefined) {
2779
2858
  ctx.addIssue({
2780
- code: z2.ZodIssueCode.custom,
2859
+ code: z3.ZodIssueCode.custom,
2781
2860
  path: ["deployment", "runtime"],
2782
2861
  message: "deployment.runtime is only meaningful when deployment.type is 'container'"
2783
2862
  });
2784
2863
  }
2785
2864
  if (isContainer && m.build !== undefined) {
2786
2865
  ctx.addIssue({
2787
- code: z2.ZodIssueCode.custom,
2866
+ code: z3.ZodIssueCode.custom,
2788
2867
  path: ["build"],
2789
2868
  message: "build is only allowed for pages-app deployments (static/react/react+api). Container builds live in the Dockerfile."
2790
2869
  });
2791
2870
  }
2792
2871
  if (isContainer && m.production_env !== undefined) {
2793
2872
  ctx.addIssue({
2794
- code: z2.ZodIssueCode.custom,
2873
+ code: z3.ZodIssueCode.custom,
2795
2874
  path: ["production_env"],
2796
2875
  message: "production_env is only allowed for pages-app deployments. Container env vars use containers[].env (names only) + the bot's secrets pipeline for values."
2797
2876
  });
@@ -2800,7 +2879,7 @@ var ManifestSchema = z2.object({
2800
2879
  const ingressContainers = m.containers.filter((c) => c.ingress === true);
2801
2880
  if (ingressContainers.length !== 1) {
2802
2881
  ctx.addIssue({
2803
- code: z2.ZodIssueCode.custom,
2882
+ code: z3.ZodIssueCode.custom,
2804
2883
  path: ["containers"],
2805
2884
  message: `multi-container apps must mark exactly one container ingress: true (found ${ingressContainers.length})`
2806
2885
  });
@@ -2813,7 +2892,7 @@ var ManifestSchema = z2.object({
2813
2892
  for (const envName of c.env ?? []) {
2814
2893
  if (!declaredBindings.has(envName)) {
2815
2894
  ctx.addIssue({
2816
- code: z2.ZodIssueCode.custom,
2895
+ code: z3.ZodIssueCode.custom,
2817
2896
  path: ["containers", i, "env"],
2818
2897
  message: `env reference '${envName}' has no matching entry in secrets.bindings[]`
2819
2898
  });
@@ -2829,7 +2908,7 @@ var ManifestSchema = z2.object({
2829
2908
  continue;
2830
2909
  if (seen.has(name)) {
2831
2910
  ctx.addIssue({
2832
- code: z2.ZodIssueCode.custom,
2911
+ code: z3.ZodIssueCode.custom,
2833
2912
  path: ["containers", i, "name"],
2834
2913
  message: `duplicate container name '${name}' — names become DO class identifiers and must be unique`
2835
2914
  });
@@ -2846,7 +2925,7 @@ var ManifestSchema = z2.object({
2846
2925
  continue;
2847
2926
  if (seen.has(name)) {
2848
2927
  ctx.addIssue({
2849
- code: z2.ZodIssueCode.custom,
2928
+ code: z3.ZodIssueCode.custom,
2850
2929
  path: ["secrets", "bindings", i, "name"],
2851
2930
  message: `duplicate secret binding name '${name}' — names become env-var keys and must be unique`
2852
2931
  });
@@ -2859,21 +2938,21 @@ var ManifestSchema = z2.object({
2859
2938
  const t = targets[i];
2860
2939
  if (t.kind === "worker" && t.script === undefined) {
2861
2940
  ctx.addIssue({
2862
- code: z2.ZodIssueCode.custom,
2941
+ code: z3.ZodIssueCode.custom,
2863
2942
  path: ["targets", i, "script"],
2864
2943
  message: "a worker target must declare a script (the sibling Workers script name)"
2865
2944
  });
2866
2945
  }
2867
2946
  if (t.kind === "pages" && t.script !== undefined) {
2868
2947
  ctx.addIssue({
2869
- code: z2.ZodIssueCode.custom,
2948
+ code: z3.ZodIssueCode.custom,
2870
2949
  path: ["targets", i, "script"],
2871
2950
  message: "a pages target must not declare a script — the primary Pages project is the app slug"
2872
2951
  });
2873
2952
  }
2874
2953
  if (t.kind === "pages" && t.schedule !== undefined) {
2875
2954
  ctx.addIssue({
2876
- code: z2.ZodIssueCode.custom,
2955
+ code: z3.ZodIssueCode.custom,
2877
2956
  path: ["targets", i, "schedule"],
2878
2957
  message: "schedule is only valid on a worker target (the cron deploy contract — ADR 0022)"
2879
2958
  });
@@ -2887,7 +2966,7 @@ var ManifestSchema = z2.object({
2887
2966
  pagesTargets++;
2888
2967
  if (pagesTargets > 1) {
2889
2968
  ctx.addIssue({
2890
- code: z2.ZodIssueCode.custom,
2969
+ code: z3.ZodIssueCode.custom,
2891
2970
  path: ["targets", i, "kind"],
2892
2971
  message: "at most one pages target may be declared (the primary Pages project is singular)"
2893
2972
  });
@@ -2898,7 +2977,7 @@ var ManifestSchema = z2.object({
2898
2977
  continue;
2899
2978
  if (t.script === PRIMARY_TARGET || t.script === "pages") {
2900
2979
  ctx.addIssue({
2901
- code: z2.ZodIssueCode.custom,
2980
+ code: z3.ZodIssueCode.custom,
2902
2981
  path: ["targets", i, "script"],
2903
2982
  message: `worker target script '${t.script}' is a reserved selector token — use a different script name`
2904
2983
  });
@@ -2906,7 +2985,7 @@ var ManifestSchema = z2.object({
2906
2985
  }
2907
2986
  if (seenScripts.has(t.script)) {
2908
2987
  ctx.addIssue({
2909
- code: z2.ZodIssueCode.custom,
2988
+ code: z3.ZodIssueCode.custom,
2910
2989
  path: ["targets", i, "script"],
2911
2990
  message: `duplicate worker target script '${t.script}' — target scripts must be unique`
2912
2991
  });
@@ -2924,7 +3003,7 @@ var ManifestSchema = z2.object({
2924
3003
  for (const ref of sel) {
2925
3004
  if (!validRefs.has(ref)) {
2926
3005
  ctx.addIssue({
2927
- code: z2.ZodIssueCode.custom,
3006
+ code: z3.ZodIssueCode.custom,
2928
3007
  path: ["secrets", "bindings", bi, "targets"],
2929
3008
  message: `secret binding '${b?.name}' references unknown target '${ref}' — declare it in targets[] or use "primary"`
2930
3009
  });
@@ -3340,49 +3419,50 @@ var STATUS_STATUS_KEYS = new Set([
3340
3419
  "status.generated_at"
3341
3420
  ]);
3342
3421
  // ../launchpad-engine/dist/schema-v2.js
3343
- import { z as z3 } from "zod";
3344
- var EnvVarSchema = z3.discriminatedUnion("type", [
3345
- z3.object({ type: z3.literal("secret_text"), secret_ref: z3.string().min(1) }).strict(),
3346
- z3.object({ type: z3.literal("plain_text"), value: z3.string() }).strict()
3422
+ import { z as z4 } from "zod";
3423
+ var EnvVarSchema = z4.discriminatedUnion("type", [
3424
+ z4.object({ type: z4.literal("secret_text"), secret_ref: z4.string().min(1) }).strict(),
3425
+ z4.object({ type: z4.literal("plain_text"), value: z4.string() }).strict()
3347
3426
  ]);
3348
3427
  var MIGRATION_STAGES = ["staged", "flipped"];
3349
- var SpecSchema = z3.object({
3350
- appType: z3.enum(APP_TYPES2),
3351
- display: z3.object({
3352
- name: z3.string().min(1),
3353
- description: z3.string().max(280).optional(),
3354
- team: z3.string().min(1)
3428
+ var SpecSchema = z4.object({
3429
+ appType: z4.enum(APP_TYPES2),
3430
+ display: z4.object({
3431
+ name: z4.string().min(1),
3432
+ description: z4.string().max(280).optional(),
3433
+ team: z4.string().min(1)
3355
3434
  }).strict(),
3356
- owner: z3.object({ email: z3.string().email() }).strict(),
3357
- access: z3.object({
3358
- audience: z3.literal("private").optional(),
3435
+ owner: z4.object({ email: z4.string().email() }).strict(),
3436
+ access: z4.object({
3437
+ audience: z4.literal("private").optional(),
3359
3438
  private_owner: PrivateOwnerSchema.optional(),
3360
- allowed_entra_groups: z3.array(z3.string().min(1)).refine((a) => new Set(a).size === a.length, {
3439
+ allowed_entra_groups: z4.array(z4.string().min(1)).refine((a) => new Set(a).size === a.length, {
3361
3440
  message: "allowed_entra_groups must not contain duplicates"
3362
3441
  }),
3363
- require_email_domain: z3.string().min(1).optional(),
3442
+ require_email_domain: z4.string().min(1).optional(),
3364
3443
  identity_types: IdentityTypesSchema.optional()
3365
3444
  }).strict().superRefine(validateAudience),
3366
- auth: z3.enum(AUTH_MODES).optional(),
3445
+ auth: z4.enum(AUTH_MODES).optional(),
3367
3446
  build: BuildSchema.optional(),
3368
3447
  app: AppBoundarySchema.optional(),
3369
3448
  verify: VerifySchema.optional(),
3370
- confine_origin: z3.boolean().optional(),
3371
- origin: z3.enum(["pages", "dispatch"]).optional(),
3372
- sensitive: z3.boolean().optional(),
3373
- catalogue: z3.object({ listed: z3.boolean().default(true) }).strict().optional(),
3374
- env_vars: z3.record(z3.string().regex(ENV_NAME_REGEX, "env_vars keys must be UPPER_SNAKE_CASE"), EnvVarSchema).optional(),
3375
- containers: z3.array(ContainerSchema).min(1).optional(),
3449
+ confine_origin: z4.boolean().optional(),
3450
+ origin: z4.enum(["pages", "dispatch"]).optional(),
3451
+ sensitive: z4.boolean().optional(),
3452
+ integrations: IntegrationsSchema.optional(),
3453
+ catalogue: z4.object({ listed: z4.boolean().default(true) }).strict().optional(),
3454
+ env_vars: z4.record(z4.string().regex(ENV_NAME_REGEX, "env_vars keys must be UPPER_SNAKE_CASE"), EnvVarSchema).optional(),
3455
+ containers: z4.array(ContainerSchema).min(1).optional(),
3376
3456
  secrets: SecretsSchema.optional(),
3377
- fronted_by_concierge: z3.boolean().optional(),
3378
- migration: z3.object({ stage: z3.enum(MIGRATION_STAGES) }).strict().optional(),
3379
- bindings: z3.object({
3380
- d1: z3.string().min(1).max(64).regex(ENV_NAME_REGEX, "bindings.d1 must be an UPPER_SNAKE_CASE binding name").optional()
3457
+ fronted_by_concierge: z4.boolean().optional(),
3458
+ migration: z4.object({ stage: z4.enum(MIGRATION_STAGES) }).strict().optional(),
3459
+ bindings: z4.object({
3460
+ d1: z4.string().min(1).max(64).regex(ENV_NAME_REGEX, "bindings.d1 must be an UPPER_SNAKE_CASE binding name").optional()
3381
3461
  }).strict().optional()
3382
3462
  }).strict().superRefine((s, ctx) => {
3383
3463
  if (s.access.identity_types !== undefined && (s.auth ?? "access") !== "gateway") {
3384
3464
  ctx.addIssue({
3385
- code: z3.ZodIssueCode.custom,
3465
+ code: z4.ZodIssueCode.custom,
3386
3466
  path: ["access", "identity_types"],
3387
3467
  message: "access.identity_types is only valid with auth: gateway"
3388
3468
  });
@@ -3390,7 +3470,7 @@ var SpecSchema = z3.object({
3390
3470
  for (const [k, v] of Object.entries(s.env_vars ?? {})) {
3391
3471
  if (/_(TOKEN|SECRET)$/.test(k) && v.type !== "secret_text") {
3392
3472
  ctx.addIssue({
3393
- code: z3.ZodIssueCode.custom,
3473
+ code: z4.ZodIssueCode.custom,
3394
3474
  path: ["env_vars", k],
3395
3475
  message: `env var '${k}' is secret-bearing (*_TOKEN/*_SECRET) and must be type secret_text, not '${v.type}'`
3396
3476
  });
@@ -3399,7 +3479,7 @@ var SpecSchema = z3.object({
3399
3479
  const isContainer = s.appType === "container";
3400
3480
  if (isContainer && s.containers === undefined) {
3401
3481
  ctx.addIssue({
3402
- code: z3.ZodIssueCode.custom,
3482
+ code: z4.ZodIssueCode.custom,
3403
3483
  path: ["containers"],
3404
3484
  message: "containers[] is required when appType is 'container'"
3405
3485
  });
@@ -3407,19 +3487,19 @@ var SpecSchema = z3.object({
3407
3487
  if (s.confine_origin !== undefined) {
3408
3488
  if (isContainer) {
3409
3489
  ctx.addIssue({
3410
- code: z3.ZodIssueCode.custom,
3490
+ code: z4.ZodIssueCode.custom,
3411
3491
  path: ["confine_origin"],
3412
3492
  message: "confine_origin is only valid for gateway pages apps; container apps have no pages.dev surface."
3413
3493
  });
3414
3494
  } else if (s.auth === "access") {
3415
3495
  ctx.addIssue({
3416
- code: z3.ZodIssueCode.custom,
3496
+ code: z4.ZodIssueCode.custom,
3417
3497
  path: ["confine_origin"],
3418
3498
  message: "confine_origin applies to gateway-fronted apps (auth: gateway); it has no meaning under Cloudflare Access."
3419
3499
  });
3420
3500
  } else if (s.appType === "static" && s.confine_origin === false) {
3421
3501
  ctx.addIssue({
3422
- code: z3.ZodIssueCode.custom,
3502
+ code: z4.ZodIssueCode.custom,
3423
3503
  path: ["confine_origin"],
3424
3504
  message: "confine_origin: false is not allowed for static apps — an unconfined apex with no verifier is world-readable (ADR 0031)."
3425
3505
  });
@@ -3428,21 +3508,21 @@ var SpecSchema = z3.object({
3428
3508
  if (s.origin === "dispatch") {
3429
3509
  if (isContainer) {
3430
3510
  ctx.addIssue({
3431
- code: z3.ZodIssueCode.custom,
3511
+ code: z4.ZodIssueCode.custom,
3432
3512
  path: ["origin"],
3433
3513
  message: "origin: dispatch is not available for container apps — they run on the container runtime (ADR 0015/0016), not in a Workers dispatch namespace."
3434
3514
  });
3435
3515
  }
3436
3516
  if ((s.auth ?? "access") !== "gateway") {
3437
3517
  ctx.addIssue({
3438
- code: z3.ZodIssueCode.custom,
3518
+ code: z4.ZodIssueCode.custom,
3439
3519
  path: ["origin"],
3440
3520
  message: "origin: dispatch requires an explicit auth: gateway (auth defaults to 'access' when omitted). A dispatch-namespace Worker has no public hostname for Cloudflare Access to gate, so the gateway must be the sole gate."
3441
3521
  });
3442
3522
  }
3443
3523
  if (s.confine_origin !== undefined && s.migration === undefined) {
3444
3524
  ctx.addIssue({
3445
- code: z3.ZodIssueCode.custom,
3525
+ code: z4.ZodIssueCode.custom,
3446
3526
  path: ["confine_origin"],
3447
3527
  message: "confine_origin has no meaning with origin: dispatch — there is no public pages.dev apex to confine. Remove it."
3448
3528
  });
@@ -3451,14 +3531,14 @@ var SpecSchema = z3.object({
3451
3531
  if (s.migration !== undefined) {
3452
3532
  if (s.origin !== "dispatch") {
3453
3533
  ctx.addIssue({
3454
- code: z3.ZodIssueCode.custom,
3534
+ code: z4.ZodIssueCode.custom,
3455
3535
  path: ["migration"],
3456
3536
  message: "migration is only valid with origin: dispatch; the portal-bot writes it while moving a live app."
3457
3537
  });
3458
3538
  }
3459
3539
  if (s.appType !== "static" && s.appType !== "react" && s.appType !== "react+api") {
3460
3540
  ctx.addIssue({
3461
- code: z3.ZodIssueCode.custom,
3541
+ code: z4.ZodIssueCode.custom,
3462
3542
  path: ["migration"],
3463
3543
  message: `migration is only valid for static, react and react+api apps (current appType: '${s.appType}')`
3464
3544
  });
@@ -3467,20 +3547,20 @@ var SpecSchema = z3.object({
3467
3547
  if (s.bindings?.d1 !== undefined) {
3468
3548
  if (s.origin !== "dispatch") {
3469
3549
  ctx.addIssue({
3470
- code: z3.ZodIssueCode.custom,
3550
+ code: z4.ZodIssueCode.custom,
3471
3551
  path: ["bindings", "d1"],
3472
3552
  message: "bindings.d1 requires origin: dispatch. A pages-origin app declares its database with a v1 pages target d1_binding."
3473
3553
  });
3474
3554
  } else if (s.appType !== "react+api") {
3475
3555
  ctx.addIssue({
3476
- code: z3.ZodIssueCode.custom,
3556
+ code: z4.ZodIssueCode.custom,
3477
3557
  path: ["bindings", "d1"],
3478
3558
  message: `bindings.d1 requires appType 'react+api' (current appType: '${s.appType}'); only a react+api app ships the Worker code that can read a database.`
3479
3559
  });
3480
3560
  }
3481
3561
  if (s.env_vars?.[s.bindings.d1] !== undefined) {
3482
3562
  ctx.addIssue({
3483
- code: z3.ZodIssueCode.custom,
3563
+ code: z4.ZodIssueCode.custom,
3484
3564
  path: ["env_vars", s.bindings.d1],
3485
3565
  message: `env var '${s.bindings.d1}' has the same name as bindings.d1. Rename one of them.`
3486
3566
  });
@@ -3488,86 +3568,86 @@ var SpecSchema = z3.object({
3488
3568
  }
3489
3569
  if (!isContainer && s.containers !== undefined) {
3490
3570
  ctx.addIssue({
3491
- code: z3.ZodIssueCode.custom,
3571
+ code: z4.ZodIssueCode.custom,
3492
3572
  path: ["containers"],
3493
3573
  message: `containers[] is only allowed when appType is 'container' (current appType: '${s.appType}')`
3494
3574
  });
3495
3575
  }
3496
3576
  if (isContainer && s.build !== undefined) {
3497
3577
  ctx.addIssue({
3498
- code: z3.ZodIssueCode.custom,
3578
+ code: z4.ZodIssueCode.custom,
3499
3579
  path: ["build"],
3500
3580
  message: "build is not allowed when appType is 'container' (container build lives in the Dockerfile)"
3501
3581
  });
3502
3582
  }
3503
3583
  if (!isContainer && s.fronted_by_concierge === true) {
3504
3584
  ctx.addIssue({
3505
- code: z3.ZodIssueCode.custom,
3585
+ code: z4.ZodIssueCode.custom,
3506
3586
  path: ["fronted_by_concierge"],
3507
3587
  message: `fronted_by_concierge is only allowed when appType is 'container' (current appType: '${s.appType}')`
3508
3588
  });
3509
3589
  }
3510
3590
  });
3511
- var nonEmpty = z3.string().min(1);
3512
- var StatusSchema = z3.object({
3513
- schemaVersion: z3.literal(2),
3591
+ var nonEmpty = z4.string().min(1);
3592
+ var StatusSchema = z4.object({
3593
+ schemaVersion: z4.literal(2),
3514
3594
  manifest_spec_sha: nonEmpty,
3515
- cloudflare: z3.object({
3516
- access: z3.object({
3595
+ cloudflare: z4.object({
3596
+ access: z4.object({
3517
3597
  app_id: nonEmpty,
3518
3598
  app_aud: nonEmpty,
3519
3599
  team_domain: nonEmpty,
3520
3600
  policy_id: nonEmpty
3521
3601
  }).strict(),
3522
- pages: z3.object({
3602
+ pages: z4.object({
3523
3603
  project_name: nonEmpty,
3524
3604
  subdomain: nonEmpty,
3525
3605
  latest_deployment_id: nonEmpty
3526
3606
  }).strict().optional(),
3527
- worker: z3.object({
3607
+ worker: z4.object({
3528
3608
  dev_url: nonEmpty,
3529
3609
  script_name: nonEmpty
3530
3610
  }).strict().optional()
3531
3611
  }).strict(),
3532
- dns: z3.object({ custom_hostname: nonEmpty, cname_target: nonEmpty }).strict().optional(),
3533
- terraform: z3.object({
3612
+ dns: z4.object({ custom_hostname: nonEmpty, cname_target: nonEmpty }).strict().optional(),
3613
+ terraform: z4.object({
3534
3614
  workspace_state_key: nonEmpty,
3535
3615
  last_applied_at: nonEmpty,
3536
3616
  last_applied_sha: nonEmpty
3537
3617
  }).strict(),
3538
- registry: z3.object({ record_present: z3.boolean(), lifecycle: nonEmpty }).strict(),
3618
+ registry: z4.object({ record_present: z4.boolean(), lifecycle: nonEmpty }).strict(),
3539
3619
  generated_at: nonEmpty
3540
3620
  }).strict().superRefine((s, ctx) => {
3541
3621
  const hasPages = s.cloudflare.pages !== undefined;
3542
3622
  const hasWorker = s.cloudflare.worker !== undefined;
3543
3623
  if (hasPages === hasWorker) {
3544
3624
  ctx.addIssue({
3545
- code: z3.ZodIssueCode.custom,
3625
+ code: z4.ZodIssueCode.custom,
3546
3626
  path: ["cloudflare"],
3547
3627
  message: "status.cloudflare must carry exactly one of `pages` (pages apps) or `worker` (container apps)"
3548
3628
  });
3549
3629
  }
3550
3630
  if (hasPages && s.dns === undefined) {
3551
3631
  ctx.addIssue({
3552
- code: z3.ZodIssueCode.custom,
3632
+ code: z4.ZodIssueCode.custom,
3553
3633
  path: ["dns"],
3554
3634
  message: "status.dns is required for a pages-shape status (cloudflare.pages present)"
3555
3635
  });
3556
3636
  }
3557
3637
  if (hasWorker && s.dns !== undefined) {
3558
3638
  ctx.addIssue({
3559
- code: z3.ZodIssueCode.custom,
3639
+ code: z4.ZodIssueCode.custom,
3560
3640
  path: ["dns"],
3561
3641
  message: "status.dns must be absent for a workers_dev_only container status (no custom hostname)"
3562
3642
  });
3563
3643
  }
3564
3644
  });
3565
- var ManifestV2Schema = z3.object({
3566
- apiVersion: z3.literal("launchpad.m-kopa.us/v2"),
3567
- kind: z3.literal("App"),
3568
- metadata: z3.object({
3569
- slug: z3.string().min(2).max(63).regex(SLUG_REGEX, "must be lowercase letters, digits, and hyphens; start/end alphanumeric"),
3570
- schemaVersion: z3.literal(2)
3645
+ var ManifestV2Schema = z4.object({
3646
+ apiVersion: z4.literal("launchpad.m-kopa.us/v2"),
3647
+ kind: z4.literal("App"),
3648
+ metadata: z4.object({
3649
+ slug: z4.string().min(2).max(63).regex(SLUG_REGEX, "must be lowercase letters, digits, and hyphens; start/end alphanumeric"),
3650
+ schemaVersion: z4.literal(2)
3571
3651
  }).strict(),
3572
3652
  spec: SpecSchema,
3573
3653
  status: StatusSchema.optional()
@@ -4744,7 +4824,7 @@ function assertBroadGroupsWellFormed(list = BROAD_GROUPS) {
4744
4824
  assertBroadGroupsWellFormed();
4745
4825
  var BROAD_UUIDS = new Set(BROAD_GROUPS.map((g) => canonicalUuid(g.uuid)).filter((u) => u !== null));
4746
4826
  // ../launchpad-engine/dist/fleet-manifest.js
4747
- import { z as z4 } from "zod";
4827
+ import { z as z5 } from "zod";
4748
4828
  var UUID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
4749
4829
  var TF_RESIDENCIES = ["per-app-workspace", "main-tf"];
4750
4830
  var APP_SHAPES = [
@@ -4772,22 +4852,22 @@ var FLEET_TIERS = [
4772
4852
  "out-of-scope"
4773
4853
  ];
4774
4854
  var DEVICE_POSTURE = ["gateway-eligible", "retained-access"];
4775
- var GroupId = z4.string().regex(UUID_RE, "Entra group ids are emitted as canonical UUIDs in the JWT groups claim — display names will not match policies.");
4776
- var FleetAppSchema = z4.object({
4777
- slug: z4.string().regex(SLUG_REGEX),
4778
- residency: z4.enum(TF_RESIDENCIES),
4779
- shape: z4.enum(APP_SHAPES),
4780
- declaredAuth: z4.enum(DECLARED_AUTH),
4781
- actualAuth: z4.enum(ACTUAL_AUTH),
4782
- groups: z4.array(GroupId).default([]),
4783
- tier: z4.enum(FLEET_TIERS),
4784
- devicePosture: z4.enum(DEVICE_POSTURE),
4785
- devicePostureReason: z4.string().trim().min(1, "devicePosture is only valid with a non-empty reason — the two-tier determination must be a surveyed output, not a default (AC-T0-3)."),
4786
- notes: z4.string().optional()
4855
+ var GroupId = z5.string().regex(UUID_RE, "Entra group ids are emitted as canonical UUIDs in the JWT groups claim — display names will not match policies.");
4856
+ var FleetAppSchema = z5.object({
4857
+ slug: z5.string().regex(SLUG_REGEX),
4858
+ residency: z5.enum(TF_RESIDENCIES),
4859
+ shape: z5.enum(APP_SHAPES),
4860
+ declaredAuth: z5.enum(DECLARED_AUTH),
4861
+ actualAuth: z5.enum(ACTUAL_AUTH),
4862
+ groups: z5.array(GroupId).default([]),
4863
+ tier: z5.enum(FLEET_TIERS),
4864
+ devicePosture: z5.enum(DEVICE_POSTURE),
4865
+ devicePostureReason: z5.string().trim().min(1, "devicePosture is only valid with a non-empty reason — the two-tier determination must be a surveyed output, not a default (AC-T0-3)."),
4866
+ notes: z5.string().optional()
4787
4867
  }).strict();
4788
- var FleetManifestSchema = z4.object({
4789
- schemaVersion: z4.literal(1),
4790
- apps: z4.array(FleetAppSchema).min(1)
4868
+ var FleetManifestSchema = z5.object({
4869
+ schemaVersion: z5.literal(1),
4870
+ apps: z5.array(FleetAppSchema).min(1)
4791
4871
  }).strict().superRefine((m, ctx) => {
4792
4872
  const seen = new Set;
4793
4873
  for (const app of m.apps) {
@@ -4809,23 +4889,23 @@ var FleetManifestSchema = z4.object({
4809
4889
  }
4810
4890
  });
4811
4891
  // ../launchpad-engine/dist/fleet-secret-sets.js
4812
- import { z as z5 } from "zod";
4892
+ import { z as z6 } from "zod";
4813
4893
  var SET_NAME_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
4814
- var Slug = z5.string().regex(SLUG_REGEX, "member must be a lowercase-kebab app slug");
4815
- var SecretName = z5.string().regex(ENV_NAME_REGEX, "secret name must be UPPER_SNAKE_CASE");
4816
- var SecretSetExcludeSchema = z5.object({
4894
+ var Slug = z6.string().regex(SLUG_REGEX, "member must be a lowercase-kebab app slug");
4895
+ var SecretName = z6.string().regex(ENV_NAME_REGEX, "secret name must be UPPER_SNAKE_CASE");
4896
+ var SecretSetExcludeSchema = z6.object({
4817
4897
  member: Slug,
4818
4898
  secret: SecretName
4819
4899
  }).strict();
4820
- var SecretSetSchema = z5.object({
4821
- name: z5.string().min(1).max(64).regex(SET_NAME_REGEX, "set name must be lowercase-kebab"),
4822
- secrets: z5.array(SecretName).min(1),
4823
- members: z5.array(Slug).min(1),
4824
- exclude: z5.array(SecretSetExcludeSchema).optional()
4900
+ var SecretSetSchema = z6.object({
4901
+ name: z6.string().min(1).max(64).regex(SET_NAME_REGEX, "set name must be lowercase-kebab"),
4902
+ secrets: z6.array(SecretName).min(1),
4903
+ members: z6.array(Slug).min(1),
4904
+ exclude: z6.array(SecretSetExcludeSchema).optional()
4825
4905
  }).strict();
4826
- var FleetSecretSetsSchema = z5.object({
4827
- schemaVersion: z5.literal(1),
4828
- secretSets: z5.array(SecretSetSchema).min(1)
4906
+ var FleetSecretSetsSchema = z6.object({
4907
+ schemaVersion: z6.literal(1),
4908
+ secretSets: z6.array(SecretSetSchema).min(1)
4829
4909
  }).strict().superRefine((m, ctx) => {
4830
4910
  const seenSets = new Set;
4831
4911
  for (let i = 0;i < m.secretSets.length; i++) {
@@ -4964,7 +5044,8 @@ function dispatchManifest(manifest, wrangler = {}) {
4964
5044
  app: manifest.app,
4965
5045
  verify: manifest.verify,
4966
5046
  sensitive: manifest.sensitive,
4967
- catalogue: manifest.catalogue
5047
+ catalogue: manifest.catalogue,
5048
+ integrations: manifest.integrations
4968
5049
  };
4969
5050
  const candidate = {
4970
5051
  apiVersion: "launchpad.m-kopa.us/v2",
@@ -5227,7 +5308,7 @@ import { readFileSync as readFileSync10, existsSync as existsSync4 } from "node:
5227
5308
  import { join as join9 } from "node:path";
5228
5309
 
5229
5310
  // src/deploy/deployment-status.ts
5230
- import { z as z7 } from "zod";
5311
+ import { z as z8 } from "zod";
5231
5312
 
5232
5313
  // src/deploy/redact-diagnostic.ts
5233
5314
  var MAX_DIAGNOSTIC_LEN = 600;
@@ -5245,19 +5326,19 @@ function redactDiagnostic(text, maxLen = MAX_DIAGNOSTIC_LEN) {
5245
5326
  }
5246
5327
 
5247
5328
  // src/notices.ts
5248
- import { z as z6 } from "zod";
5329
+ import { z as z7 } from "zod";
5249
5330
  var NOTICE_COMMAND_ALLOWLIST = new Set([
5250
5331
  "launchpad migrate --origin dispatch --dry-run",
5251
5332
  "launchpad migrate --status",
5252
5333
  "launchpad migrate --finalize"
5253
5334
  ]);
5254
5335
  var MAX_TEXT = 300;
5255
- var NoticeSchema = z6.object({
5256
- id: z6.string().regex(/^[a-z][a-z0-9_]{0,63}$/),
5257
- schema: z6.literal(1),
5258
- level: z6.enum(["info", "warning"]),
5259
- text: z6.string().transform(clean).pipe(z6.string().min(1)),
5260
- command: z6.string().optional().catch(undefined)
5336
+ var NoticeSchema = z7.object({
5337
+ id: z7.string().regex(/^[a-z][a-z0-9_]{0,63}$/),
5338
+ schema: z7.literal(1),
5339
+ level: z7.enum(["info", "warning"]),
5340
+ text: z7.string().transform(clean).pipe(z7.string().min(1)),
5341
+ command: z7.string().optional().catch(undefined)
5261
5342
  });
5262
5343
  function parseNotices(raw) {
5263
5344
  if (!Array.isArray(raw))
@@ -5365,16 +5446,16 @@ function projectV2(value) {
5365
5446
  };
5366
5447
  return { v2 };
5367
5448
  }
5368
- var Sha40 = z7.string().regex(/^[0-9a-f]{40}$/);
5369
- var VerifiedCommitSchema = z7.object({
5449
+ var Sha40 = z8.string().regex(/^[0-9a-f]{40}$/);
5450
+ var VerifiedCommitSchema = z8.object({
5370
5451
  commitSha: Sha40,
5371
- runId: z7.number().int().positive(),
5372
- artifactSha256: z7.string().regex(/^[0-9a-f]{64}$/),
5373
- verifiedAt: z7.string().transform((value) => redactDiagnostic(value)),
5374
- runUrl: z7.unknown().optional()
5452
+ runId: z8.number().int().positive(),
5453
+ artifactSha256: z8.string().regex(/^[0-9a-f]{64}$/),
5454
+ verifiedAt: z8.string().transform((value) => redactDiagnostic(value)),
5455
+ runUrl: z8.unknown().optional()
5375
5456
  });
5376
- var ScriptBindingSchema = z7.object({
5377
- state: z7.enum(["match", "mismatch", "unbound", "unreadable"]),
5457
+ var ScriptBindingSchema = z8.object({
5458
+ state: z8.enum(["match", "mismatch", "unbound", "unreadable"]),
5378
5459
  commitSha: Sha40.optional().catch(undefined)
5379
5460
  });
5380
5461
  function projectVerifiedCommit(value) {
@@ -10875,6 +10956,28 @@ function saveMigration(file, original, converted) {
10875
10956
  }
10876
10957
  }
10877
10958
 
10959
+ // src/integration-status.ts
10960
+ import { z as z9 } from "zod";
10961
+ var EntrySchema = z9.object({
10962
+ name: z9.string().regex(INTEGRATION_NAME_REGEX),
10963
+ status: z9.enum(["approved", "pending", "unavailable"])
10964
+ });
10965
+ function integrationStatusLines(raw) {
10966
+ if (!Array.isArray(raw))
10967
+ return [];
10968
+ const entries = raw.flatMap((item) => {
10969
+ const parsed = EntrySchema.safeParse(item);
10970
+ return parsed.success ? [parsed.data] : [];
10971
+ });
10972
+ if (entries.some((e) => e.status === "unavailable"))
10973
+ return ["integration status unavailable"];
10974
+ return entries.map((e) => e.status === "approved" ? `integration ${e.name}: approved` : `integration ${e.name}: pending platform approval`);
10975
+ }
10976
+ function renderIntegrationStatus(raw, io) {
10977
+ for (const line of integrationStatusLines(raw))
10978
+ io.out(line);
10979
+ }
10980
+
10878
10981
  // src/commands/deploy.ts
10879
10982
  var deployCommand = {
10880
10983
  name: "deploy",
@@ -11605,6 +11708,7 @@ ${w}`, ""), message);
11605
11708
  io.out("");
11606
11709
  io.out(`Your bundle ships with this provisioning run — when lifecycle reaches "live",`);
11607
11710
  io.out("this deploy's content is what's serving. No second deploy needed.");
11711
+ renderIntegrationStatus(success.integrations, io);
11608
11712
  if (appType === "container") {
11609
11713
  const pushed = await pushSecretsWhenCommitted({ slug, manifestPath, timeoutMs: provisionTimeoutMs }, io, realFirstDeploySecretsDeps(cfg));
11610
11714
  if (pushed !== null)
@@ -11651,6 +11755,7 @@ ${w}`, ""), message);
11651
11755
  io.out(` ${botMessage(success.message)}`);
11652
11756
  }
11653
11757
  surfaceDeployExtras(success, io, slug, args.allowStale);
11758
+ renderIntegrationStatus(success.integrations, io);
11654
11759
  io.out("");
11655
11760
  const dispatchOrigin = handoffIsDispatch({
11656
11761
  v2Delivery: success.v2Delivery,
@@ -16451,6 +16556,7 @@ var BUNDLED_SKILLS = [
16451
16556
  "launchpad-status",
16452
16557
  "launchpad-destroy",
16453
16558
  "launchpad-identity",
16559
+ "launchpad-ingest",
16454
16560
  "launchpad-report",
16455
16561
  "marquee-share"
16456
16562
  ];
@@ -18034,6 +18140,139 @@ function describe35(e) {
18034
18140
  var addOwnerCommand = makeOwnerCommand("add");
18035
18141
  var removeOwnerCommand = makeOwnerCommand("remove");
18036
18142
 
18143
+ // src/commands/admin-integrations.ts
18144
+ import { createHash as createHash5, randomBytes as randomBytes6 } from "node:crypto";
18145
+ import { unlink as unlink3, writeFile as writeFile5 } from "node:fs/promises";
18146
+ var APPROVAL_PATH = "/admin/integrations/approval-request";
18147
+ function generateIntegrationKey() {
18148
+ return `lpi_${randomBytes6(32).toString("base64url")}`;
18149
+ }
18150
+ function integrationKeyHash(key) {
18151
+ return createHash5("sha256").update(key).digest("hex");
18152
+ }
18153
+ async function runAdminIntegrations(args, io, config, deps) {
18154
+ const parsed = parseArgs17(args);
18155
+ if (parsed.kind === "usage") {
18156
+ io.err(`launchpad admin integrations: ${parsed.message}`);
18157
+ printIntegrationsUsage(io.err);
18158
+ return 64;
18159
+ }
18160
+ if (parsed.kind === "revoke") {
18161
+ const prUrl = await request(parsed.body, config, io, deps);
18162
+ if (prUrl === null)
18163
+ return 1;
18164
+ io.out(`Revoke PR: ${prUrl}`);
18165
+ io.out("The route closes once a platform admin approves and merges it and the root apply runs.");
18166
+ return 0;
18167
+ }
18168
+ return mint(parsed, config, io, deps);
18169
+ }
18170
+ async function mint(parsed, config, io, deps) {
18171
+ const key = generateIntegrationKey();
18172
+ const hash = integrationKeyHash(key);
18173
+ try {
18174
+ await writeFile5(parsed.out, `${key}
18175
+ `, { flag: "wx", mode: 384 });
18176
+ } catch (error) {
18177
+ const code = error.code;
18178
+ io.err(code === "EEXIST" ? `launchpad admin integrations mint: ${parsed.out} already exists; choose a new --out path` : `launchpad admin integrations mint: cannot write ${parsed.out}: ${code ?? String(error)}`);
18179
+ return 1;
18180
+ }
18181
+ const prUrl = await request({ ...parsed.body, key_sha256: hash }, config, io, deps);
18182
+ if (prUrl === null) {
18183
+ await unlink3(parsed.out).catch(() => {
18184
+ return;
18185
+ });
18186
+ io.err(`launchpad admin integrations mint: removed ${parsed.out}; nothing was requested`);
18187
+ return 1;
18188
+ }
18189
+ io.out(`Approval PR: ${prUrl}`);
18190
+ io.out(`key_sha256: ${hash}`);
18191
+ io.out(`Key written to ${parsed.out} (mode 0600). It is not stored anywhere else.`);
18192
+ io.out("A platform admin other than the PR author must approve the PR before it can merge.");
18193
+ io.out("Hand the key to the caller through their secret store, never chat or tickets.");
18194
+ return 0;
18195
+ }
18196
+ async function request(body, config, io, deps) {
18197
+ try {
18198
+ const res = await deps.apiJson(config, {
18199
+ method: "POST",
18200
+ path: APPROVAL_PATH,
18201
+ jsonBody: body
18202
+ });
18203
+ if (typeof res.pr_url !== "string")
18204
+ throw new Error("bot response had no pr_url");
18205
+ return res.pr_url;
18206
+ } catch (error) {
18207
+ io.err(`launchpad admin integrations ${body.mode}: ${error instanceof Error ? error.message : String(error)}`);
18208
+ return null;
18209
+ }
18210
+ }
18211
+ function parseArgs17(args) {
18212
+ const [sub, slug, name, ...rest] = args;
18213
+ if (sub !== "mint" && sub !== "revoke")
18214
+ return usage("expected `mint` or `revoke`");
18215
+ if (slug === undefined || !SLUG_REGEX.test(slug))
18216
+ return usage("expected a valid app slug");
18217
+ if (name === undefined || !INTEGRATION_NAME_REGEX.test(name)) {
18218
+ return usage("expected an integration name matching ^[a-z0-9][a-z0-9-]{0,62}$");
18219
+ }
18220
+ const flags = parseFlags5(rest);
18221
+ if (typeof flags === "string")
18222
+ return usage(flags);
18223
+ return sub === "revoke" ? parseRevoke(slug, name, flags) : parseMint(slug, name, flags);
18224
+ }
18225
+ function usage(message) {
18226
+ return { kind: "usage", message };
18227
+ }
18228
+ function parseRevoke(slug, name, flags) {
18229
+ if (flags.out !== undefined || flags.rotate || flags.ips.length > 0)
18230
+ return usage("revoke takes only --key-sha256");
18231
+ if (flags.keyHash === undefined)
18232
+ return { kind: "revoke", body: { slug, name, mode: "revoke" } };
18233
+ if (!INTEGRATION_KEY_SHA256_REGEX.test(flags.keyHash))
18234
+ return usage("--key-sha256 must be 64 lowercase hex characters");
18235
+ return { kind: "revoke", body: { slug, name, mode: "drop-key", key_sha256: flags.keyHash } };
18236
+ }
18237
+ function parseMint(slug, name, flags) {
18238
+ if (flags.out === undefined)
18239
+ return usage("mint requires --out <file>");
18240
+ if (flags.keyHash !== undefined)
18241
+ return usage("mint does not take --key-sha256");
18242
+ const badIp = flags.ips.find((ip) => !IntegrationIpSchema.safeParse(ip).success);
18243
+ if (badIp !== undefined)
18244
+ return usage(`--allow-ip '${badIp}' is not an exact IPv4 or IPv6 address`);
18245
+ const ips = flags.ips.length > 0 ? { allowed_ips: flags.ips } : {};
18246
+ return { kind: "mint", out: flags.out, body: { slug, name, mode: flags.rotate ? "add-key" : "approve", ...ips } };
18247
+ }
18248
+ var VALUE_FLAGS = new Map([
18249
+ ["--out", (f, v) => void (f.out = v)],
18250
+ ["--allow-ip", (f, v) => void f.ips.push(v)],
18251
+ ["--key-sha256", (f, v) => void (f.keyHash = v)]
18252
+ ]);
18253
+ function parseFlags5(rest) {
18254
+ const flags = { rotate: false, ips: [] };
18255
+ for (let i = 0;i < rest.length; i++) {
18256
+ const flag = rest[i];
18257
+ if (flag === "--rotate") {
18258
+ flags.rotate = true;
18259
+ continue;
18260
+ }
18261
+ const set = VALUE_FLAGS.get(flag);
18262
+ if (set === undefined)
18263
+ return `unknown option ${flag}`;
18264
+ const value = rest[++i];
18265
+ if (value === undefined || value.startsWith("--"))
18266
+ return `${flag} needs a value`;
18267
+ set(flags, value);
18268
+ }
18269
+ return flags;
18270
+ }
18271
+ function printIntegrationsUsage(print) {
18272
+ print(" launchpad admin integrations mint <slug> <name> --out <file> [--rotate] [--allow-ip <ip>]...");
18273
+ print(" launchpad admin integrations revoke <slug> <name> [--key-sha256 <hex>]");
18274
+ }
18275
+
18037
18276
  // src/commands/admin.ts
18038
18277
  var REAL_DEPS3 = { loadConfig, apiJson };
18039
18278
  var adminCommand = makeAdminCommand();
@@ -18068,6 +18307,9 @@ async function runAdmin(args, io, deps) {
18068
18307
  return 0;
18069
18308
  }
18070
18309
  const config = deps.loadConfig();
18310
+ if (args[0] === "integrations") {
18311
+ return runAdminIntegrations(args.slice(1), io, config, deps);
18312
+ }
18071
18313
  const parsed = parseStatusRevokeArgs(args, config.statusPageHost ?? DEFAULT_STATUS_PAGE_HOST);
18072
18314
  if (parsed.kind === "unknown") {
18073
18315
  io.err(`launchpad admin: unknown subcommand '${parsed.subcommand}'`);
@@ -18112,13 +18354,14 @@ function printHelp6(io) {
18112
18354
  io.out("");
18113
18355
  io.out("Usage:");
18114
18356
  io.out(" launchpad admin status-revoke <status-url>");
18357
+ printIntegrationsUsage(io.out);
18115
18358
  }
18116
18359
 
18117
18360
  // src/commands/list-owners.ts
18118
18361
  function realDeps4() {
18119
18362
  return { loadConfig, apiJson };
18120
18363
  }
18121
- function parseArgs17(args) {
18364
+ function parseArgs18(args) {
18122
18365
  let slug;
18123
18366
  let json = false;
18124
18367
  for (const a of args) {
@@ -18132,7 +18375,7 @@ function parseArgs17(args) {
18132
18375
  return { slug, json };
18133
18376
  }
18134
18377
  async function runListOwners(args, io, deps) {
18135
- const parsed = parseArgs17(args);
18378
+ const parsed = parseArgs18(args);
18136
18379
  if (parsed === null) {
18137
18380
  io.err("usage: launchpad list-owners <slug> [--json]");
18138
18381
  return 64;
@@ -18609,7 +18852,7 @@ function realDeps5() {
18609
18852
  readBreadcrumb
18610
18853
  };
18611
18854
  }
18612
- function parseArgs18(args) {
18855
+ function parseArgs19(args) {
18613
18856
  let title;
18614
18857
  let message;
18615
18858
  const positionalParts = [];
@@ -18640,7 +18883,7 @@ function parseArgs18(args) {
18640
18883
  var NOUN = { bug: "bug report", feature: "feature request" };
18641
18884
  async function runReport(kind, args, io, deps) {
18642
18885
  const verb = kind;
18643
- const parsed = parseArgs18(args);
18886
+ const parsed = parseArgs19(args);
18644
18887
  let message = parsed.message ?? parsed.positional ?? "";
18645
18888
  let title = parsed.title ?? "";
18646
18889
  if (message === "" && deps.isTty()) {
@@ -18843,7 +19086,7 @@ function requiresCliFloorPreflight(verb, args) {
18843
19086
  if (verb === "secrets")
18844
19087
  return args[0] === "push";
18845
19088
  if (verb === "admin")
18846
- return args[0] === "status-revoke";
19089
+ return args[0] === "status-revoke" || args[0] === "integrations";
18847
19090
  return false;
18848
19091
  }
18849
19092
  function printHelp7(io, commands) {