@keystrokehq/cli 0.0.20 → 0.0.21

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 (142) hide show
  1. package/dist/{accept.handler-CiqqUxKN.mjs → accept.handler-C6KBLKmW.mjs} +1 -1
  2. package/dist/{admin-B0U2Aghv.mjs → admin-D2CQoZAN.mjs} +9 -9
  3. package/dist/{agent-bundle-package-DWV6B_5q-BsbCEeMw.mjs → agent-bundle-package-DWV6B_5q-B-qzc3zC.mjs} +1 -1
  4. package/dist/{agents-DBebUEwk.mjs → agents-Bn0g5o0o.mjs} +7 -7
  5. package/dist/{api-BjBpWWlm.mjs → api-J9UL8pqZ.mjs} +1 -1
  6. package/dist/{api-keys-BHAgmC4E.mjs → api-keys-BixCnZJW.mjs} +5 -5
  7. package/dist/{auth-D-PZAjdd.mjs → auth-yCNMT8sJ.mjs} +14 -7
  8. package/dist/{auth.handler-CxTDSO6O.mjs → auth.handler-BedGpKh1.mjs} +7 -12
  9. package/dist/{build-agents-DseUtzd4-BNtZrqoY.mjs → build-agents-DseUtzd4-DFh2e5Cn.mjs} +5 -5
  10. package/dist/{build-metadata-BB_L45ZS-d5-QLDZ5.mjs → build-metadata-BB_L45ZS-BtGGjHIV.mjs} +7 -7
  11. package/dist/{build-progress-BVwDg6lC.mjs → build-progress-nYa14iBP.mjs} +1 -1
  12. package/dist/{build-tasks-C09SdfjC-DxKcmENc.mjs → build-tasks-C09SdfjC-B0F7BZZG.mjs} +3 -3
  13. package/dist/{build-workflows-BZ_m97Pr-DwcnRlyh.mjs → build-workflows-BZ_m97Pr-DKANy85L.mjs} +9 -8
  14. package/dist/{build.handler-CTX80S1K.mjs → build.handler-CyDc8jiZ.mjs} +5 -5
  15. package/dist/{chunk-DYxdGL9S.mjs → chunk-CH6r78ws.mjs} +1 -2
  16. package/dist/{clear-cache.handler-8RFmjHoo.mjs → clear-cache.handler-FmJPHdWG.mjs} +1 -1
  17. package/dist/{clear.handler-Bksm2HI4.mjs → clear.handler-Cvb9chs4.mjs} +27 -13
  18. package/dist/{commander-DQLrBSIW.mjs → commander-9Kro0Dl3.mjs} +4 -7
  19. package/dist/common-AK0q0Oz0.mjs +20 -0
  20. package/dist/{connect-DV_EztVs.mjs → connect-DzVxjeYr.mjs} +2 -2
  21. package/dist/{connect.handler-DbuGt3Xb.mjs → connect.handler-DFQdxkWZ.mjs} +3 -3
  22. package/dist/{context-BUzxM3QI.mjs → context-B2cQ-Nt3.mjs} +30 -4
  23. package/dist/{create.handler-CQCRk-Na.mjs → create.handler-v9B0Z9Yf.mjs} +1 -1
  24. package/dist/{credential-env-map-qLCR_QbO.mjs → credential-env-map-Dvp00a4M.mjs} +1 -1
  25. package/dist/credential-requirements-D0mavK8j-CFMf0Xwu.mjs +619 -0
  26. package/dist/{credentials-xPtLFTjW.mjs → credentials-DQW8xxof.mjs} +2 -2
  27. package/dist/{credentials-m18a1_hw.mjs → credentials-Dr5lD7Hm.mjs} +6 -6
  28. package/dist/{current-deployment-workflow-pyBoobIm.mjs → current-deployment-workflow-qMfOrRIu.mjs} +4 -4
  29. package/dist/{current.handler-BJGJgdGP.mjs → current.handler-Cm_-JLyZ.mjs} +1 -1
  30. package/dist/declared-credential-requirements-B6h4WRv4.mjs +103 -0
  31. package/dist/{delete.handler-DNoehdOH.mjs → delete.handler-DtP_zUaq.mjs} +1 -1
  32. package/dist/{deploy-BKjcO_sm.mjs → deploy-BURTx92e.mjs} +1 -1
  33. package/dist/{deploy-3tHCBGky.mjs → deploy-CB6pfCuB.mjs} +2 -2
  34. package/dist/{deploy-progress-CyolzjRB.mjs → deploy-progress-Dlp9aBDW.mjs} +1 -1
  35. package/dist/{deploy.handler-TnPNBYXZ.mjs → deploy.handler-Bg0dpSTj.mjs} +16 -16
  36. package/dist/{detect-env-access-CwkOYeYM-D8-hxij0.mjs → detect-env-access-CwkOYeYM-D4aTZv4R.mjs} +2 -2
  37. package/dist/{diff.handler-DO2WzdGB.mjs → diff.handler-CJPrszL1.mjs} +4 -4
  38. package/dist/{dist-BGrWr5fp.mjs → dist-Br4m3sFZ.mjs} +14 -12
  39. package/dist/{dist-CIInPRGh.mjs → dist-DuJjDZIf.mjs} +25 -2
  40. package/dist/{env.handler-C5GNyiJt.mjs → env.handler-6TrLd3fo.mjs} +7 -7
  41. package/dist/{error-boundary-GtRvP2oP.mjs → error-boundary-DVZipk-A.mjs} +1 -1
  42. package/dist/{file-metadata-B8c7Y5yg.mjs → file-metadata-DQVDjr7M.mjs} +1 -1
  43. package/dist/{import-module-y0glInUe-CfNsQNia.mjs → import-module-y0glInUe-DxX0-BRO.mjs} +274 -28
  44. package/dist/{init-D9RIT2CY.mjs → init-DBMtY3eO.mjs} +3 -3
  45. package/dist/{init.handler-0TJY1YNy.mjs → init.handler-BoYbE-6H.mjs} +3 -3
  46. package/dist/{inspect.handler-BrYFfN4H.mjs → inspect.handler-Juu2vGbB.mjs} +4 -4
  47. package/dist/{integration-catalog-BrJsBkfx.mjs → integration-catalog-cYlTmOSb.mjs} +1 -1
  48. package/dist/{integrations-vSyAQ6HA.mjs → integrations-cwRfplNG.mjs} +5 -5
  49. package/dist/{invites-BASM4PJr.mjs → invites-DHyHZOY_.mjs} +4 -4
  50. package/dist/{invites.list.handler-c-aw6g5o.mjs → invites.list.handler-C-QpsG2J.mjs} +1 -1
  51. package/dist/{invites.resend.handler-MnMEjP_Z.mjs → invites.resend.handler-KFKbSPzR.mjs} +1 -1
  52. package/dist/{invites.revoke.handler-CHX6Z8kj.mjs → invites.revoke.handler-Cuz7jrGC.mjs} +1 -1
  53. package/dist/keystroke.mjs +21 -21
  54. package/dist/{list-enrichment-DcplcioC.mjs → list-enrichment-CCRHYslm.mjs} +1 -1
  55. package/dist/{list.handler-DJNtXw7C.mjs → list.handler-6x3GVumu.mjs} +1 -1
  56. package/dist/{list2.handler-BdE1k2kl.mjs → list.handler-BWsl4iYw.mjs} +4 -4
  57. package/dist/{list.handler-BsgCd1oF.mjs → list.handler-CLGQDuo5.mjs} +5 -5
  58. package/dist/{list.handler-CynN-ezD.mjs → list.handler-Cc-V1TNz.mjs} +1 -1
  59. package/dist/{list.handler-DXwKdfIv.mjs → list.handler-DRe38pAj.mjs} +2 -2
  60. package/dist/{list.handler-CDtjm-6d.mjs → list.handler-Do2tVOnu.mjs} +1 -1
  61. package/dist/{list.handler-BBzB1_1l.mjs → list.handler-RtHhrTZ3.mjs} +1 -1
  62. package/dist/{listen-Ca9KdiB2.mjs → listen-DZdSevsB.mjs} +2 -2
  63. package/dist/{listen.handler-KWPN03S8.mjs → listen.handler-BccHe1jh.mjs} +2 -2
  64. package/dist/{logs-BEDf7hZ0.mjs → logs-Bh_PBnu6.mjs} +3 -3
  65. package/dist/{logs.handler-mk1lcZbU.mjs → logs.handler-DItDS1zw.mjs} +2 -2
  66. package/dist/{members.add.handler-CTvlxBZU.mjs → members.add.handler-D3nQ_Ln6.mjs} +1 -1
  67. package/dist/{members.invite.handler-wFO0r7Pi.mjs → members.invite.handler-rKhg5n_C.mjs} +1 -1
  68. package/dist/{members.list.handler-PPdqs4nI.mjs → members.list.handler-C9Yh469k.mjs} +1 -1
  69. package/dist/{members.remove.handler-a5WI6zE4.mjs → members.remove.handler-Dnrck-E6.mjs} +1 -1
  70. package/dist/{members.update.handler-3xblTzmz.mjs → members.update.handler-qo5r6arJ.mjs} +1 -1
  71. package/dist/{metadata-layout-Bv-B0nHj-DtMWZ7Cc.mjs → metadata-layout-Bv-B0nHj-CO8mjjSl.mjs} +1 -1
  72. package/dist/{normalize-path-CojS-CgQ-CRqBc6D6.mjs → normalize-path-CojS-CgQ-aOM0agxS.mjs} +1 -1
  73. package/dist/{org-CzLw3neZ.mjs → org-DnES84sS.mjs} +15 -15
  74. package/dist/{orgs.create.handler-CcPpDweZ.mjs → orgs.create.handler-DF4eEL-2.mjs} +1 -1
  75. package/dist/{orgs.get.handler-BACPg7vR.mjs → orgs.get.handler-BmJnseQa.mjs} +1 -1
  76. package/dist/{orgs.list.handler-DEF8OyvM.mjs → orgs.list.handler-DDVvSbsT.mjs} +1 -1
  77. package/dist/{paused.handler-D4j8_Za4.mjs → paused.handler-BLUchSMD.mjs} +1 -1
  78. package/dist/{projects-CJCKxG2u.mjs → projects-Cv14bBGy.mjs} +4 -4
  79. package/dist/{projects-s5ehKLil.mjs → projects-ZNcKwds2.mjs} +2 -2
  80. package/dist/{requirements.handler-Bk-sAE9C.mjs → requirements.handler-BKFocUof.mjs} +5 -5
  81. package/dist/{resolve-cli-credentials-DytxgMwn.mjs → resolve-cli-credentials-DaMDaamj.mjs} +1 -1
  82. package/dist/{resolve-project-CWP2fji3.mjs → resolve-project-Cj3MFnU0.mjs} +1 -1
  83. package/dist/{run-polling-DKclfet-.mjs → run-polling-3XOGl4hh.mjs} +3 -3
  84. package/dist/{run.handler-x0B-CjNF.mjs → run.handler-DZuUx0fi.mjs} +5 -5
  85. package/dist/{runs-DoMVOCNj.mjs → runs-BOo3j297.mjs} +2 -2
  86. package/dist/schemas-D2zfmyC-.mjs +671 -0
  87. package/dist/{skills-sync.handler-CYkCeuQn.mjs → skills-sync.handler-09mDbx5q.mjs} +1 -1
  88. package/dist/{skills.command-DeAgMGGw.mjs → skills.command-B-MhRN3J.mjs} +4 -4
  89. package/dist/{source-analysis-BBg2E_6G-BJTRqWrQ.mjs → source-analysis-BBg2E_6G-wPP9mjQx.mjs} +3 -3
  90. package/dist/{source-analysis-BMMPIHN9.mjs → source-analysis-z2RSZw6X.mjs} +1 -1
  91. package/dist/{src-BYQwp8Ig.mjs → src-DNhUmpSl.mjs} +1 -1
  92. package/dist/{switch.handler-CV4ZBXAu.mjs → switch.handler-BFGvj5c6.mjs} +2 -2
  93. package/dist/{sync-KCVM02IY.mjs → sync-CZ3iUPTA.mjs} +2 -2
  94. package/dist/{sync.handler-Cuw89341.mjs → sync.handler-B1L8I9lF.mjs} +7 -7
  95. package/dist/{task-BSCN9cU4.mjs → task-BWuIKWh4.mjs} +2 -392
  96. package/dist/{task-target-build-B0HF2_At.mjs → task-target-build-CTgl4L42.mjs} +5 -5
  97. package/dist/{task-target-deploy-ClbwKJ8K.mjs → task-target-deploy-DeUyfi9H.mjs} +1 -1
  98. package/dist/{task-target-deploy-dQYnMO8n-CeTmRcDw.mjs → task-target-deploy-dQYnMO8n-d2vdeqXH.mjs} +1 -1
  99. package/dist/task-target-deploy-runner.mjs +6 -6
  100. package/dist/{test-Rm3thni3.mjs → test-Byq4hG3C.mjs} +2 -2
  101. package/dist/{test.handler-CTd-heRS.mjs → test.handler-BsrMMj5O.mjs} +9 -9
  102. package/dist/{test.handler-DhhcsvHN.mjs → test.handler-CAsVgOpT.mjs} +1 -1
  103. package/dist/{tool.handler-C3LNyQbc.mjs → tool.handler-BHS5Z4J_.mjs} +63 -9
  104. package/dist/{trigger-artifacts-BcRScRSp-DqFgzl_B.mjs → trigger-artifacts-BcRScRSp-C-JBJ6y8.mjs} +4 -4
  105. package/dist/{trigger-manifest-DTni4NaZ.mjs → trigger-manifest-C07EM-b2.mjs} +6 -5
  106. package/dist/{upgrade-Cf7y38xR.mjs → upgrade-bZVjVXnu.mjs} +2 -2
  107. package/dist/{upload-CJWApEgz.mjs → upload-CE4H5R1h.mjs} +1 -1
  108. package/dist/{upload.handler-BHIWYPph.mjs → upload.handler-DXVx2u3A.mjs} +7 -7
  109. package/dist/{users.get.handler-spWaHG8h.mjs → users.get.handler-DqD2ELK2.mjs} +1 -1
  110. package/dist/{users.list.handler-DLuU7cd_.mjs → users.list.handler-DZSPvpGF.mjs} +1 -1
  111. package/dist/{users.set-role.handler-CojFmpcD.mjs → users.set-role.handler-73smNUVF.mjs} +1 -1
  112. package/dist/{utils-Ddltm1sR.mjs → utils-BaxDlCsW.mjs} +1 -1
  113. package/dist/{validate.handler-DIJBuX1P.mjs → validate.handler-CmfcMX0t.mjs} +4 -4
  114. package/dist/{workflow-build-IGYhEC8Y.mjs → workflow-build-Bi1Aacc5.mjs} +20 -20
  115. package/dist/workflow-build-manifest-1sC52TIG.mjs +259 -0
  116. package/dist/{workflow-bundler-BzHk73PM-Cs-4Ml-p.mjs → workflow-bundler-BzHk73PM-xQwAF08W.mjs} +2 -2
  117. package/dist/{workflows-MANdvLft.mjs → workflows-C_C13Zr0.mjs} +16 -14
  118. package/dist/{writer-byNNUjRm-w5O7-VT_.mjs → writer-byNNUjRm-B-on1n6c.mjs} +6 -6
  119. package/package.json +7 -7
  120. package/dist/schemas-U2OzP9gP.mjs +0 -281
  121. package/dist/src-BHTjsZ9V.mjs +0 -456
  122. /package/dist/{agent-manifest-CZ7BeUSG.mjs → agent-manifest-Pg0aURo7.mjs} +0 -0
  123. /package/dist/{browser-Cu4k-wT_.mjs → browser-Dvv5OQrt.mjs} +0 -0
  124. /package/dist/{clear.handler-mfNmIUYP.mjs → clear.handler-BdR56Cok.mjs} +0 -0
  125. /package/dist/{concurrency-gXn9Rw8x-BSBbRfVp.mjs → concurrency-gXn9Rw8x-CnBnF2cg.mjs} +0 -0
  126. /package/dist/{credential-schema-mismatch-BHI_B-U-.mjs → credential-schema-mismatch-kfGeiSB1.mjs} +0 -0
  127. /package/dist/{diff-utils-x5pi8SrL.mjs → diff-utils-CXKNQUXO.mjs} +0 -0
  128. /package/dist/{layout-DRf9qUf8.mjs → layout-B95Tku8F.mjs} +0 -0
  129. /package/dist/{logs.handler-CcA1UzJm.mjs → logs.handler-Bs1DVMaO.mjs} +0 -0
  130. /package/dist/{oxc-B3KI3rf_-Cnk0L10M.mjs → oxc-B3KI3rf_-B9omBIuN.mjs} +0 -0
  131. /package/dist/{read-credential-keys-77a91T8M-CzXPGxdU.mjs → read-credential-keys-77a91T8M-aLuQvlIq.mjs} +0 -0
  132. /package/dist/{register.handler-CSvlOMF6.mjs → register.handler-C_NqMLir.mjs} +0 -0
  133. /package/dist/{rolldown-runtime-twds-ZHy-BoF7MLzP.mjs → rolldown-runtime-twds-ZHy-RuJszab7.mjs} +0 -0
  134. /package/dist/{run-polling-CzyVv7Ba.mjs → run-polling-DKWPGLyF.mjs} +0 -0
  135. /package/dist/{schema-CvSZqa3t.mjs → schema-DFJiNWyd.mjs} +0 -0
  136. /package/dist/{schema-display-DxLA3j5H.mjs → schema-display-XrRCdFL0.mjs} +0 -0
  137. /package/dist/{skill-installer-CYFshTBy.mjs → skill-installer-Cm9hF6OB.mjs} +0 -0
  138. /package/dist/{skills.handler-Bma-MJX-.mjs → skills.handler-KEUkV5NH.mjs} +0 -0
  139. /package/dist/{spinner-progress-DV28G4tP.mjs → spinner-progress-BtEIJRX4.mjs} +0 -0
  140. /package/dist/{status.handler-BOV0eX3J.mjs → status.handler-CW-EFhy3.mjs} +0 -0
  141. /package/dist/{types-DamInJD6.mjs → types-D1cVpE7_.mjs} +0 -0
  142. /package/dist/{upgrade.handler-Bz_oQcAw.mjs → upgrade.handler-C7KvNL0x.mjs} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { a as ui, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
4
4
  import { i as writeJson } from "./output-BWcVRt-T.mjs";
5
- import { i as requireClient } from "./context-BUzxM3QI.mjs";
5
+ import { i as requireClient } from "./context-B2cQ-Nt3.mjs";
6
6
  //#region src/commands/api-keys/create.handler.ts
7
7
  async function handleApiKeysCreate(options, ctx) {
8
8
  const client = requireClient(ctx);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { r as getKeystrokeProjectPath } from "./paths-JzzFkXQA-CEipIeVl.mjs";
4
- import "./dist-CIInPRGh.mjs";
4
+ import "./dist-DuJjDZIf.mjs";
5
5
  import * as fs from "node:fs/promises";
6
6
  import { z } from "zod";
7
7
  //#region src/lib/credential-env-map.ts
@@ -0,0 +1,619 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { z } from "zod";
4
+ //#region ../../packages/core/dist/chunks/schema-DsHGh6YT.mjs
5
+ const MAX_JSON_DEPTH = 20;
6
+ function buildJsonValueSchema(depth) {
7
+ const primitives = z.union([
8
+ z.string(),
9
+ z.number(),
10
+ z.boolean(),
11
+ z.null()
12
+ ]);
13
+ if (depth <= 0) return primitives;
14
+ const nested = buildJsonValueSchema(depth - 1);
15
+ return z.union([
16
+ primitives,
17
+ z.array(nested),
18
+ z.record(z.string(), nested)
19
+ ]);
20
+ }
21
+ const jsonValueSchema = buildJsonValueSchema(MAX_JSON_DEPTH);
22
+ const jsonSchemaObject = z.record(z.string(), jsonValueSchema);
23
+ const anyZodSchemaSchema = z.custom((value) => value instanceof z.ZodType, "Expected a Zod schema");
24
+ const zodObjectSchema = z.custom((value) => value instanceof z.ZodObject, "Expected a Zod object schema");
25
+ /**
26
+ * Creates a Zod schema that validates an object structurally by checking
27
+ * for required properties. This avoids `instanceof` checks which fail
28
+ * when class definitions are duplicated across bundle boundaries.
29
+ */
30
+ function createStructuralSchema(requiredKeys, label) {
31
+ return z.custom((value) => value != null && (typeof value === "object" || typeof value === "function") && requiredKeys.every((key) => key in value), `Expected ${label}`);
32
+ }
33
+ function trimmedNonEmptyString(fieldName) {
34
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` });
35
+ }
36
+ /**
37
+ * Non-empty trimmed string for credential definition ids.
38
+ * Allows namespaced ids such as `keystroke:slack` plus letters, numbers,
39
+ * hyphens, and underscores.
40
+ */
41
+ function credentialSetIdString(fieldName) {
42
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(255, { error: `${fieldName} cannot exceed 255 characters` }).refine((s) => /^[a-zA-Z0-9_:-]+$/.test(s), { error: `${fieldName} must only contain letters, numbers, hyphens, underscores, and colons` });
43
+ }
44
+ function optionalTrimmedNonEmptyString(fieldName) {
45
+ return trimmedNonEmptyString(fieldName).optional();
46
+ }
47
+ function descriptionString(fieldName) {
48
+ return z.string().trim().min(1, { error: `${fieldName} cannot be empty` }).max(1024, { error: `${fieldName} cannot exceed 1024 characters` });
49
+ }
50
+ function optionalDescriptionString(fieldName) {
51
+ return descriptionString(fieldName).optional();
52
+ }
53
+ //#endregion
54
+ //#region ../../packages/core/dist/chunks/schemas-BhQu9ko9.mjs
55
+ /**
56
+ * Shared constants for the credential/connection system.
57
+ * Defined in core (bottom of dependency chain) so all packages can import them.
58
+ */
59
+ const CREDENTIAL_EXPOSURES = {
60
+ "user-runtime": "user-runtime",
61
+ "platform-only": "platform-only"
62
+ };
63
+ const credentialSetProxyInjectionSchema = z.object({
64
+ /** Substitute placeholder in HTTP headers (default: true). */
65
+ headers: z.boolean().optional(),
66
+ /** Substitute placeholder in the HTTP Basic Auth credential (default: true). */
67
+ basicAuth: z.boolean().optional(),
68
+ /** Substitute placeholder in URL query params (default: false).
69
+ * Use for APIs that authenticate via `?api_key=...` (Google Maps, OWM, etc.). */
70
+ queryParams: z.boolean().optional(),
71
+ /** Substitute placeholder in the HTTP request body (default: false).
72
+ * Use for form-encoded auth payloads (Stripe, AWS SigV4 query, etc.). */
73
+ body: z.boolean().optional()
74
+ });
75
+ const credentialSetProxyConfigSchema = z.object({
76
+ /** Exact-match host allowlist (forwarded to SecretBuilder.allowHost). */
77
+ hosts: z.array(z.string().min(1)).optional(),
78
+ /** Wildcard host allowlist (forwarded to SecretBuilder.allowHostPattern).
79
+ * Example: `["*.browserbase.com"]` covers any subdomain. */
80
+ hostPatterns: z.array(z.string().min(1)).optional(),
81
+ /** Per-scope substitution toggles. Omit to use SDK defaults. */
82
+ injection: credentialSetProxyInjectionSchema.optional()
83
+ });
84
+ const onCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
85
+ const credentialExposureSchema = z.enum([CREDENTIAL_EXPOSURES["user-runtime"], CREDENTIAL_EXPOSURES["platform-only"]]);
86
+ const connectionMetadataConfigSchema = z.object({
87
+ id: credentialSetIdString("Credential connection id").optional(),
88
+ label: optionalTrimmedNonEmptyString("Credential connection label"),
89
+ description: optionalDescriptionString("Credential connection description"),
90
+ recommended: z.boolean().optional(),
91
+ advanced: z.boolean().optional(),
92
+ needsRawSecret: z.boolean().optional()
93
+ });
94
+ const connectionMetadataManifestSchema = connectionMetadataConfigSchema;
95
+ const registeredDescriptorSchema = z.object({
96
+ id: trimmedNonEmptyString("Registered descriptor id"),
97
+ config: z.record(z.string(), z.unknown()).optional()
98
+ });
99
+ const registeredResolverDescriptorSchema = registeredDescriptorSchema.extend({ cacheMs: z.number().int().nonnegative().optional() });
100
+ const manualConnectionConfigSchema = connectionMetadataConfigSchema.extend({
101
+ kind: z.literal("manual"),
102
+ input: zodObjectSchema.optional(),
103
+ instructions: z.string().min(1).optional(),
104
+ validate: z.function().optional()
105
+ });
106
+ const manualConnectionFieldManifestSchema = z.object({
107
+ key: z.string().min(1),
108
+ label: z.string().min(1),
109
+ description: z.string().min(1).optional(),
110
+ optional: z.boolean(),
111
+ secret: z.literal(true)
112
+ });
113
+ const manualConnectionConfigManifestSchema = connectionMetadataManifestSchema.extend({
114
+ kind: z.literal("manual"),
115
+ input: jsonSchemaObject.optional(),
116
+ fields: z.array(manualConnectionFieldManifestSchema).optional(),
117
+ generated: z.boolean().optional(),
118
+ instructions: z.string().min(1).optional()
119
+ });
120
+ /** Declarative form of `Vault` — strings typed against the credential set's
121
+ * stored/auth schema keys at the {@link CredentialSetConfig} boundary; the Zod
122
+ * schema here enforces non-empty strings only. `CredentialSet` itself performs
123
+ * the schema-key membership check at construction time. */
124
+ const vaultMappingSchema = z.object({
125
+ accessToken: z.string().min(1),
126
+ refreshToken: z.string().min(1).optional(),
127
+ instanceUrl: z.string().min(1).optional(),
128
+ raw: z.record(z.string().min(1), z.string().min(1)).optional()
129
+ });
130
+ /** Function form of `Vault` — an object pairing the access-token vault key
131
+ * (`accessTokenKey`) with the `build` function that computes the full vault
132
+ * write map. The explicit key keeps the disconnect path's revocation read
133
+ * reliable even when `build` transforms the access token. */
134
+ const vaultMappingFnSchema = z.object({
135
+ accessTokenKey: z.string().min(1),
136
+ build: z.custom((val) => typeof val === "function", { message: "vault.build must be a function." })
137
+ });
138
+ /** Runtime shape of `Vault`. Accepts either the declarative mapping or the
139
+ * function-form object `{ accessTokenKey, build }`. */
140
+ const vaultConfigSchema = z.union([vaultMappingSchema, vaultMappingFnSchema], { error: "vault must be a declarative mapping object or a `{ accessTokenKey, build }` object." });
141
+ /** Manifest projection of `Vault` — declarative mappings serialize verbatim;
142
+ * function-form mappings serialize as `{ kind: 'function', accessTokenKey }`
143
+ * since closures are not manifest-safe but the access-token key is. */
144
+ const vaultManifestSchema = z.discriminatedUnion("kind", [z.object({
145
+ kind: z.literal("declarative"),
146
+ accessToken: z.string().min(1),
147
+ refreshToken: z.string().min(1).optional(),
148
+ instanceUrl: z.string().min(1).optional(),
149
+ raw: z.record(z.string().min(1), z.string().min(1)).optional()
150
+ }), z.object({
151
+ kind: z.literal("function"),
152
+ accessTokenKey: z.string().min(1)
153
+ })]);
154
+ const oauthConnectionConfigBaseSchema = z.object({
155
+ kind: z.literal("oauth"),
156
+ authUrl: z.string().url(),
157
+ tokenUrl: z.string().url(),
158
+ scopes: z.array(z.string()).readonly(),
159
+ revokeUrl: z.string().url().nullable().optional(),
160
+ tokenType: z.enum(["long-lived", "refreshable"]),
161
+ pkce: z.boolean().optional(),
162
+ /** Fallback token lifetime when the provider omits `expires_in`. Positive
163
+ * integer seconds. Shared between config + manifest schemas (both extend
164
+ * this base). */
165
+ defaultExpiresInSeconds: z.number().int().positive().optional()
166
+ });
167
+ const oauthConnectionConfigSchema = oauthConnectionConfigBaseSchema.extend({
168
+ ...connectionMetadataConfigSchema.shape,
169
+ vault: vaultConfigSchema,
170
+ oauth: registeredDescriptorSchema.optional(),
171
+ buildAuthUrl: z.function().optional(),
172
+ exchangeCode: z.function().optional(),
173
+ refreshToken: z.function().optional(),
174
+ extractInstallationInfo: z.function().optional(),
175
+ validate: z.function().optional()
176
+ });
177
+ const oauthConnectionConfigManifestSchema = oauthConnectionConfigBaseSchema.extend({
178
+ ...connectionMetadataManifestSchema.shape,
179
+ vault: vaultManifestSchema,
180
+ oauth: registeredDescriptorSchema.optional()
181
+ });
182
+ const credentialsExchangeConnectionConfigSchema = connectionMetadataConfigSchema.extend({
183
+ kind: z.literal("credentials-exchange"),
184
+ instructions: z.string().min(1).optional(),
185
+ input: zodObjectSchema
186
+ }).extend({
187
+ exchange: z.function(),
188
+ rotate: z.function().optional(),
189
+ validate: z.function().optional()
190
+ });
191
+ /** Manifest projection of `CredentialsExchangeConnectionConfig` — only the
192
+ * declarative `input` schema (rendered as JSON Schema) and `instructions`
193
+ * copy survive serialization. The three hooks (`exchange`, `rotate`,
194
+ * `validate`) are runtime closures and are stripped. */
195
+ const credentialsExchangeConnectionConfigManifestSchema = z.object({
196
+ kind: z.literal("credentials-exchange"),
197
+ ...connectionMetadataManifestSchema.shape,
198
+ instructions: z.string().min(1).optional(),
199
+ input: jsonSchemaObject
200
+ });
201
+ const exchangeCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
202
+ kind: z.literal("exchange"),
203
+ input: zodObjectSchema,
204
+ exchange: registeredDescriptorSchema
205
+ });
206
+ const exchangeCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
207
+ kind: z.literal("exchange"),
208
+ input: jsonSchemaObject,
209
+ exchange: registeredDescriptorSchema
210
+ });
211
+ const dynamicCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({
212
+ kind: z.literal("dynamic"),
213
+ input: zodObjectSchema.optional(),
214
+ resolver: registeredResolverDescriptorSchema
215
+ });
216
+ const dynamicCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({
217
+ kind: z.literal("dynamic"),
218
+ input: jsonSchemaObject.optional(),
219
+ resolver: registeredResolverDescriptorSchema
220
+ });
221
+ const platformCredentialConnectionConfigSchema = connectionMetadataConfigSchema.extend({ kind: z.literal("platform") });
222
+ const platformCredentialConnectionManifestSchema = connectionMetadataManifestSchema.extend({ kind: z.literal("platform") });
223
+ const connectionConfigSchema = z.discriminatedUnion("kind", [
224
+ manualConnectionConfigSchema,
225
+ oauthConnectionConfigSchema,
226
+ credentialsExchangeConnectionConfigSchema,
227
+ exchangeCredentialConnectionConfigSchema,
228
+ dynamicCredentialConnectionConfigSchema,
229
+ platformCredentialConnectionConfigSchema
230
+ ]);
231
+ /** Manifest projection of `ConnectionConfig` — declarative metadata only. */
232
+ const connectionConfigManifestSchema = z.discriminatedUnion("kind", [
233
+ manualConnectionConfigManifestSchema,
234
+ oauthConnectionConfigManifestSchema,
235
+ credentialsExchangeConnectionConfigManifestSchema,
236
+ exchangeCredentialConnectionManifestSchema,
237
+ dynamicCredentialConnectionManifestSchema,
238
+ platformCredentialConnectionManifestSchema
239
+ ]);
240
+ const CredentialSetManifestSchema = z.object({
241
+ manifestVersion: z.literal(1),
242
+ type: z.literal("credentialSet"),
243
+ id: credentialSetIdString("Credential set id"),
244
+ name: trimmedNonEmptyString("Credential set name"),
245
+ description: optionalDescriptionString("Credential set description"),
246
+ auth: jsonSchemaObject,
247
+ exposure: credentialExposureSchema.optional(),
248
+ proxy: credentialSetProxyConfigSchema.optional(),
249
+ /** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
250
+ needsRawSecret: z.boolean().optional(),
251
+ /** Policy when a step throws `CredentialRevokedError` against this credential set. */
252
+ onCredentialRevoked: onCredentialRevokedSchema.optional(),
253
+ connections: z.array(connectionConfigManifestSchema).optional()
254
+ });
255
+ z.object({
256
+ id: credentialSetIdString("Credential set id"),
257
+ name: optionalTrimmedNonEmptyString("Credential set name"),
258
+ description: optionalDescriptionString("Credential set description"),
259
+ auth: zodObjectSchema,
260
+ exposure: credentialExposureSchema.optional(),
261
+ proxy: credentialSetProxyConfigSchema.optional(),
262
+ /** When true, resolved values are passed into execution as raw secrets (no ref-token proxy). */
263
+ needsRawSecret: z.boolean().optional(),
264
+ onCredentialRevoked: onCredentialRevokedSchema.optional(),
265
+ connections: z.array(connectionConfigSchema).readonly().optional()
266
+ });
267
+ z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
268
+ const JsonSchemaSchema = z.record(z.string(), z.unknown());
269
+ z.object({
270
+ constant: z.object({
271
+ attempts: z.number().int().min(1).max(10),
272
+ seconds: z.number().positive()
273
+ }).optional(),
274
+ exponential: z.object({
275
+ attempts: z.number().int().min(1).max(10),
276
+ base: z.number().min(1).optional(),
277
+ multiplier: z.number().positive().optional()
278
+ }).optional()
279
+ }).refine((data) => {
280
+ return data.constant !== void 0 !== (data.exponential !== void 0);
281
+ }, { error: "Retry config must specify exactly one of constant or exponential strategy" });
282
+ //#endregion
283
+ //#region ../../packages/core/dist/chunks/credential-requirements-D0mavK8j.mjs
284
+ const SourceLocationSchema = z.object({
285
+ filePath: z.string().min(1),
286
+ absoluteFilePath: z.string().min(1).optional(),
287
+ line: z.number().int().positive(),
288
+ column: z.number().int().positive(),
289
+ position: z.number().int().nonnegative().optional(),
290
+ endLine: z.number().int().positive(),
291
+ endColumn: z.number().int().positive(),
292
+ endPosition: z.number().int().nonnegative().optional(),
293
+ synthetic: z.boolean().optional()
294
+ });
295
+ z.string().min(1);
296
+ const ImportSourceSchema = z.object({
297
+ kind: z.enum([
298
+ "local",
299
+ "module-import",
300
+ "namespace-import",
301
+ "dynamic"
302
+ ]),
303
+ moduleSpecifier: z.string().min(1).optional(),
304
+ importName: z.string().min(1).optional(),
305
+ localName: z.string().min(1).optional(),
306
+ resolvedPath: z.string().min(1).optional()
307
+ });
308
+ const CallKindSchema = z.enum([
309
+ "workflow-step",
310
+ "agent",
311
+ "tool",
312
+ "hook",
313
+ "child-workflow",
314
+ "function-call",
315
+ "method-call",
316
+ "dynamic-call",
317
+ "parallel-call",
318
+ "process-exit",
319
+ "iife",
320
+ "expression"
321
+ ]);
322
+ const CapturedVariableSourceKindSchema = z.enum([
323
+ "local-const",
324
+ "relative-import",
325
+ "package-import"
326
+ ]);
327
+ const CapturedVariableValueTypeSchema = z.enum([
328
+ "string",
329
+ "number",
330
+ "boolean",
331
+ "object",
332
+ "array",
333
+ "function",
334
+ "unknown"
335
+ ]);
336
+ z.object({
337
+ name: z.string().min(1),
338
+ value: z.union([
339
+ z.string(),
340
+ z.number(),
341
+ z.boolean()
342
+ ]).optional(),
343
+ sourceText: z.string().optional(),
344
+ valueType: CapturedVariableValueTypeSchema,
345
+ resolvable: z.boolean(),
346
+ source: CapturedVariableSourceKindSchema,
347
+ importPath: z.string().optional(),
348
+ declaration: z.object({
349
+ filePath: z.string().min(1),
350
+ line: z.number().int().positive()
351
+ })
352
+ });
353
+ const IntegrationScopeSchema = z.enum([
354
+ "organization",
355
+ "project",
356
+ "user_provided_credential"
357
+ ]);
358
+ const IntegrationCredentialRefSchema = z.discriminatedUnion("type", [z.object({
359
+ type: z.literal("id"),
360
+ id: z.string().startsWith("cset_")
361
+ }), z.object({
362
+ type: z.literal("name"),
363
+ name: z.string().trim().min(1)
364
+ })]);
365
+ function hasProjectOrOrganizationScope(scope) {
366
+ return scope === "organization" || scope === "project";
367
+ }
368
+ const CredentialRefTokenKeyNameSchema = z.string().regex(/^[A-Za-z0-9_]+$/, "Credential key must contain only letters, digits, and underscores (required for ref-token proxying)");
369
+ /** Shared enum for top-level credential-set `onCredentialRevoked` policy. */
370
+ const OnCredentialRevokedSchema = z.enum(["fail", "retry-once"]);
371
+ /** A credential set after resolution in a built manifest. Contains definition id, scope, alias, and credential keys.*/
372
+ const ResolvedCredentialSetSchema = z.object({
373
+ resolvedId: z.string(),
374
+ scope: IntegrationScopeSchema.optional(),
375
+ alias: z.string().optional(),
376
+ credentialRef: IntegrationCredentialRefSchema.optional(),
377
+ /** Auth-shape keys expected post-resolve. */
378
+ credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
379
+ /** Subset of `credentialKeys` that are optional in the auth shape. */
380
+ optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
381
+ /** Auth-shaped vault keys required for vault reads and upload flows. */
382
+ storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
383
+ /** Subset of auth-shaped vault keys that may be absent from the vault without
384
+ * failing resolution. Derived from the credential set's `auth` schema. */
385
+ optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
386
+ proxy: credentialSetProxyConfigSchema.optional(),
387
+ /** When true, resolved values are passed raw (no ref-token proxy) for this set. */
388
+ needsRawSecret: z.boolean().optional(),
389
+ /** When true, this requirement uses a registered dynamic resolver phase. */
390
+ needsDynamicResolution: z.boolean().optional(),
391
+ /** Cache TTL in milliseconds for registered dynamic resolver output.
392
+ * `0` or absence means no cache hint. */
393
+ dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
394
+ /** Policy when a step throws `CredentialRevokedError` against this credential set. */
395
+ onCredentialRevoked: OnCredentialRevokedSchema.optional(),
396
+ /** Persistence-layer schema fingerprint stamped at build time. The
397
+ * resolver's phase 2 compares this against the vault row's stored
398
+ * fingerprint and raises `CredentialSchemaMismatchError` on drift.
399
+ * Optional here so pre-fingerprint artifacts still parse; the
400
+ * workflow builder populates it for every authored credential set
401
+ * that has a resolvable fingerprint. */
402
+ schemaFingerprint: z.string().optional()
403
+ }).superRefine((value, ctx) => {
404
+ if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
405
+ code: z.ZodIssueCode.custom,
406
+ path: ["credentialRef"],
407
+ message: "credentialRef requires scope to be \"project\" or \"organization\""
408
+ });
409
+ });
410
+ const DeclaredCredentialRequirementSchema = z.object({
411
+ credentialSetId: z.string(),
412
+ /** Auth-shape keys expected post-resolve. */
413
+ credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
414
+ /** Optional subset of the auth-shape keys. */
415
+ optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
416
+ /** Stored-shape keys required for vault reads. */
417
+ storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
418
+ /** Optional subset of the stored-shape keys. */
419
+ optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
420
+ schemaFingerprint: z.string().optional(),
421
+ needsDynamicResolution: z.boolean().optional(),
422
+ /** Cache TTL in milliseconds for registered dynamic resolver output.
423
+ * `0` or absence means no cache hint. */
424
+ dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
425
+ /** Policy when a step throws `CredentialRevokedError` against this credential set. */
426
+ onCredentialRevoked: OnCredentialRevokedSchema.optional(),
427
+ proxy: credentialSetProxyConfigSchema.optional(),
428
+ needsRawSecret: z.boolean().optional(),
429
+ requiredOAuthScopes: z.array(z.string()).optional()
430
+ });
431
+ const CredentialRequirementEntrySchema = z.object({
432
+ credentialSetId: z.string(),
433
+ scope: IntegrationScopeSchema.optional(),
434
+ alias: z.string().optional(),
435
+ credentialRef: IntegrationCredentialRefSchema.optional(),
436
+ /** Auth-shape keys expected post-resolve. */
437
+ credentialKeys: z.array(CredentialRefTokenKeyNameSchema),
438
+ /** Optional subset of the auth-shape keys. */
439
+ optionalCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
440
+ /** Auth-shaped vault keys required for vault reads. */
441
+ storedCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
442
+ /** Optional subset of the stored-shape keys. */
443
+ optionalStoredCredentialKeys: z.array(CredentialRefTokenKeyNameSchema).optional(),
444
+ schemaFingerprint: z.string().optional(),
445
+ proxy: credentialSetProxyConfigSchema.optional(),
446
+ needsRawSecret: z.boolean().optional(),
447
+ /** When true, this requirement uses a registered dynamic resolver phase. */
448
+ needsDynamicResolution: z.boolean().optional(),
449
+ /** Cache TTL in milliseconds for registered dynamic resolver output.
450
+ * `0` or absence means no cache hint. */
451
+ dynamicResolutionCacheMs: z.number().int().nonnegative().optional(),
452
+ /** Policy when a step throws `CredentialRevokedError` against this credential set. */
453
+ onCredentialRevoked: OnCredentialRevokedSchema.optional(),
454
+ requiredOAuthScopes: z.array(z.string()).optional()
455
+ }).superRefine((value, ctx) => {
456
+ if (value.credentialRef && !hasProjectOrOrganizationScope(value.scope)) ctx.addIssue({
457
+ code: z.ZodIssueCode.custom,
458
+ path: ["credentialRef"],
459
+ message: "credentialRef requires scope to be \"project\" or \"organization\""
460
+ });
461
+ });
462
+ const CredentialRequirementsSchema = z.object({
463
+ required: z.array(z.string()),
464
+ byStep: z.record(z.string(), z.array(CredentialRequirementEntrySchema))
465
+ });
466
+ const TriggerPollExportNameSchema = z.enum(["poll"]);
467
+ const TriggerCredentialRequirementEntrySchema = CredentialRequirementEntrySchema;
468
+ const TriggerCredentialRequirementsSchema = z.object({
469
+ required: z.array(z.string()),
470
+ byPollExport: z.partialRecord(TriggerPollExportNameSchema, z.array(TriggerCredentialRequirementEntrySchema))
471
+ });
472
+ function buildCredentialRequirementEntryKey(entry) {
473
+ const credentialRefKey = entry.credentialRef ? entry.credentialRef.type === "id" ? `id:${entry.credentialRef.id}` : `name:${entry.credentialRef.name}` : "";
474
+ return [
475
+ entry.credentialSetId,
476
+ entry.scope ?? "",
477
+ entry.alias ?? "",
478
+ credentialRefKey,
479
+ entry.schemaFingerprint ?? "",
480
+ [...entry.credentialKeys].sort().join(","),
481
+ [...entry.optionalCredentialKeys ?? []].sort().join(","),
482
+ [...entry.storedCredentialKeys ?? []].sort().join(","),
483
+ [...entry.optionalStoredCredentialKeys ?? []].sort().join(","),
484
+ entry.needsRawSecret === true ? "1" : "0",
485
+ entry.needsDynamicResolution === true ? "1" : "0",
486
+ typeof entry.dynamicResolutionCacheMs === "number" ? String(entry.dynamicResolutionCacheMs) : "",
487
+ entry.onCredentialRevoked ?? "",
488
+ entry.proxy ? JSON.stringify(entry.proxy) : ""
489
+ ].join("|");
490
+ }
491
+ function deduplicateCredentialRequirementEntries(entries) {
492
+ const deduped = /* @__PURE__ */ new Map();
493
+ for (const entry of entries) {
494
+ const key = buildCredentialRequirementEntryKey(entry);
495
+ const existing = deduped.get(key);
496
+ if (!existing) deduped.set(key, {
497
+ ...entry,
498
+ credentialKeys: [...entry.credentialKeys].sort(),
499
+ ...entry.optionalCredentialKeys ? { optionalCredentialKeys: [...entry.optionalCredentialKeys].sort() } : {},
500
+ ...entry.storedCredentialKeys ? { storedCredentialKeys: [...entry.storedCredentialKeys].sort() } : {},
501
+ ...entry.optionalStoredCredentialKeys ? { optionalStoredCredentialKeys: [...entry.optionalStoredCredentialKeys].sort() } : {}
502
+ });
503
+ else if (entry.requiredOAuthScopes?.length) {
504
+ const merged = new Set([...existing.requiredOAuthScopes ?? [], ...entry.requiredOAuthScopes]);
505
+ deduped.set(key, {
506
+ ...existing,
507
+ requiredOAuthScopes: [...merged].sort()
508
+ });
509
+ }
510
+ }
511
+ return [...deduped.values()];
512
+ }
513
+ function collectCredentialRequirementEntries(credentialRequirements) {
514
+ if (!credentialRequirements) return [];
515
+ return deduplicateCredentialRequirementEntries(Object.values(credentialRequirements.byStep ?? {}).flat());
516
+ }
517
+ const ExecutionIdentityPolicySchema = z.object({ subjectMode: z.enum(["never", "requiredWhenUserProvidedCredential"]) });
518
+ /** A step's entry within a WorkflowManifest. Describes how a step is used in a workflow, not what the step itself is. */
519
+ const WorkflowStepEntrySchema = z.object({
520
+ nodeId: z.string().min(1),
521
+ stepName: z.string().min(1),
522
+ label: z.string().min(1),
523
+ callKind: CallKindSchema,
524
+ stepId: z.string().min(1).optional(),
525
+ source: SourceLocationSchema.optional(),
526
+ astKind: z.string().min(1).optional(),
527
+ importSource: ImportSourceSchema.optional(),
528
+ outputBinding: z.string().min(1).optional(),
529
+ scopeOverride: IntegrationScopeSchema.optional(),
530
+ description: z.string().optional(),
531
+ sourceCode: z.string().optional(),
532
+ exportName: z.string().optional(),
533
+ inputSchema: JsonSchemaSchema.optional(),
534
+ outputSchema: JsonSchemaSchema.optional(),
535
+ credentialSets: z.array(ResolvedCredentialSetSchema).optional()
536
+ });
537
+ const TriggerTypeSchema = z.enum([
538
+ "webhook",
539
+ "cron",
540
+ "polling"
541
+ ]);
542
+ /**
543
+ * Persisted on `deployment_triggers.trigger_source`. Mirrors the
544
+ * `webhookTrigger({ source: { type } })` discriminator so the server
545
+ * can index-filter app-source rows during provider-webhook fanout.
546
+ */
547
+ const TriggerSourceSchema = z.enum(["custom", "app"]);
548
+ z.enum([
549
+ "GET",
550
+ "POST",
551
+ "PUT",
552
+ "PATCH"
553
+ ]);
554
+ const TriggerPollBundleUploadSchema = z.object({
555
+ code: z.string(),
556
+ hash: z.string(),
557
+ size: z.number()
558
+ });
559
+ /** Declarative idempotency-key spec resolved server-side (no VM). */
560
+ const IdempotencyKeyConfigSchema = z.union([
561
+ z.object({
562
+ from: z.literal("payload"),
563
+ strategy: z.literal("hash")
564
+ }),
565
+ z.object({
566
+ from: z.literal("payload"),
567
+ path: z.string().trim().min(1)
568
+ }),
569
+ z.object({
570
+ from: z.literal("header"),
571
+ strategy: z.literal("hash")
572
+ }),
573
+ z.object({
574
+ from: z.literal("header"),
575
+ name: z.string().trim().min(1)
576
+ })
577
+ ]);
578
+ const TriggerPollExportsSchema = z.object({ poll: z.string().min(1).optional() });
579
+ const TriggerUploadDataSchema = z.object({
580
+ id: z.string(),
581
+ /**
582
+ * Authored trigger name from `xxxTrigger({ name: ... })`. Used by the workflow
583
+ * VM to look up the bound `transform`. Follows the `authoredWorkflowId` /
584
+ * `authoredAgentId` naming convention.
585
+ */
586
+ authoredTriggerId: z.string().min(1),
587
+ type: TriggerTypeSchema,
588
+ /**
589
+ * Source-of-truth discriminator for webhook triggers. `'custom'` means
590
+ * the trigger owns its own HTTP path; `'app'` means it is fanned out by
591
+ * a Keystroke-managed provider app. Undefined for non-webhook triggers.
592
+ */
593
+ triggerSource: TriggerSourceSchema.optional(),
594
+ /**
595
+ * Root-trigger name for `.narrow()` lineage so narrowed custom webhooks share
596
+ * the same `webhookSecretHash`/`webhookPublicId`. Equals `authoredTriggerId`
597
+ * for root triggers. Omitted for non-webhook triggers.
598
+ */
599
+ webhookAuthGroupKey: z.string().min(1).optional(),
600
+ enabled: z.boolean(),
601
+ schedule: z.string().optional(),
602
+ timezone: z.string().optional(),
603
+ config: z.record(z.string(), z.unknown()).optional(),
604
+ requiredCredentials: TriggerCredentialRequirementsSchema.optional(),
605
+ /** Hex-encoded sha-256 of the Keystroke-issued webhook secret. */
606
+ webhookSecretHash: z.string().min(1).optional(),
607
+ /** Public id surfaced in the webhook URL (header-mode auth). */
608
+ webhookPublicId: z.string().min(1).optional(),
609
+ /** JSON Schema applied at the server before any VM hop. Built from a
610
+ * pure Zod schema declared on the trigger primitive. */
611
+ filterSchema: JsonSchemaSchema.optional(),
612
+ /** Declarative idempotency-key resolver. Webhook-only. */
613
+ idempotencyConfig: IdempotencyKeyConfigSchema.optional(),
614
+ pollStoragePath: z.string().min(1).optional(),
615
+ pollBundle: TriggerPollBundleUploadSchema.optional(),
616
+ pollExports: TriggerPollExportsSchema.optional()
617
+ });
618
+ //#endregion
619
+ export { descriptionString as _, IntegrationScopeSchema as a, trimmedNonEmptyString as b, TriggerSourceSchema as c, WorkflowStepEntrySchema as d, collectCredentialRequirementEntries as f, createStructuralSchema as g, anyZodSchemaSchema as h, IdempotencyKeyConfigSchema as i, TriggerTypeSchema as l, CredentialSetManifestSchema as m, DeclaredCredentialRequirementSchema as n, ResolvedCredentialSetSchema as o, deduplicateCredentialRequirementEntries as p, ExecutionIdentityPolicySchema as r, TriggerCredentialRequirementsSchema as s, CredentialRequirementsSchema as t, TriggerUploadDataSchema as u, jsonSchemaObject as v, jsonValueSchema as y };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { t as src_exports } from "./src-BHTjsZ9V.mjs";
3
+ import { f as collectCredentialRequirementEntries } from "./credential-requirements-D0mavK8j-CFMf0Xwu.mjs";
4
4
  //#region ../../packages/workflow-deploy/dist/credentials/index.mjs
5
5
  /**
6
6
  * Resolves credential values from environment using KEYSTROKE_<KEY> convention.
@@ -39,7 +39,7 @@ function addEntriesToGroups(groups, entries) {
39
39
  }
40
40
  function groupCredentialRequirements(manifest) {
41
41
  const groups = /* @__PURE__ */ new Map();
42
- addEntriesToGroups(groups, (0, src_exports.collectCredentialRequirementEntries)(manifest.credentials));
42
+ addEntriesToGroups(groups, collectCredentialRequirementEntries(manifest.credentials));
43
43
  return [...groups.values()];
44
44
  }
45
45
  function buildScopes(params) {