@keystrokehq/cli 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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-O5tdGdzc.mjs} +30 -4
  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-_l7Lkfxi.mjs} +26 -2
  21. package/dist/{connect.handler-DbuGt3Xb.mjs → connect.handler-tqk-DOv8.mjs} +39 -4
  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-Cdq7iSLj.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 +6 -6
  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
@@ -1,456 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { n as __exportAll, r as __reExport } from "./chunk-DYxdGL9S.mjs";
4
- import { a as CapturedVariableValueTypeSchema, i as CapturedVariableSourceKindSchema, n as CallsiteFingerprintSchema, o as ImportSourceSchema, r as CapturedVariableSchema, s as SourceLocationSchema, t as CallKindSchema } from "./source-analysis-BMMPIHN9.mjs";
5
- import { z } from "zod";
6
- import { createHash } from "node:crypto";
7
- const SHA256HashSchema = z.string().length(64, "Must be 64 characters").regex(/^[a-f0-9]{64}$/i, "Must be hexadecimal").transform((value) => value);
8
- const JsonSchemaSchema = z.record(z.string(), z.unknown());
9
- const RetryConfigSchema = z.object({
10
- constant: z.object({
11
- attempts: z.number().int().min(1).max(10),
12
- seconds: z.number().positive()
13
- }).optional(),
14
- exponential: z.object({
15
- attempts: z.number().int().min(1).max(10),
16
- base: z.number().min(1).optional(),
17
- multiplier: z.number().positive().optional()
18
- }).optional()
19
- }).refine((data) => {
20
- return data.constant !== void 0 !== (data.exponential !== void 0);
21
- }, { error: "Retry config must specify exactly one of constant or exponential strategy" });
22
- //#endregion
23
- //#region ../../packages/workflow-build-contracts/src/credential-requirements.ts
24
- var credential_requirements_exports = /* @__PURE__ */ __exportAll({});
25
- import * as import__keystrokehq_core_artifacts from "@keystrokehq/core/artifacts";
26
- __reExport(credential_requirements_exports, import__keystrokehq_core_artifacts);
27
- //#endregion
28
- //#region ../../packages/workflow-build-contracts/src/schema-fingerprint.ts
29
- /**
30
- * schema-fingerprint.ts
31
- *
32
- * Computes a deterministic fingerprint (hash) of a credential set's schema.
33
- * Used as a persistence-layer identity stamp: the workflow-builder stamps each
34
- * credential requirement with its fingerprint at build time, the server stamps
35
- * each vault row with the fingerprint at upload time, and the executor's
36
- * credential resolver compares the two at read time so schema drift surfaces
37
- * as a `CredentialSchemaMismatchError` rather than a silent decode into a
38
- * stale shape.
39
- *
40
- * The fingerprint is deterministic: identical JSON schemas always produce the
41
- * same hash regardless of property ordering, timestamps, or other
42
- * non-structural differences.
43
- *
44
- * @remarks
45
- * This is the *persistence* fingerprint. The construction-time registry in
46
- * `credential-set/registry.ts` uses a different (Zod-structural) fingerprint
47
- * purely for in-process identity collision detection; the two fingerprints
48
- * serve different purposes and do not need to match.
49
- */
50
- /**
51
- * Compute a deterministic fingerprint for a JSON schema object.
52
- *
53
- * The schema is the output of `schemaToJsonSchema(zodSchema)` — a plain JSON
54
- * object describing the shape of the Zod schema.
55
- *
56
- * Properties are sorted recursively before hashing to ensure deterministic
57
- * output regardless of insertion order.
58
- *
59
- * @example
60
- * ```ts
61
- * const auth = schemaToJsonSchema(credentialSet.auth);
62
- * const stored = credentialSet.stored ? schemaToJsonSchema(credentialSet.stored) : undefined;
63
- * const fingerprint = computeSchemaFingerprint(auth, stored);
64
- * ```
65
- *
66
- * @see CredentialSchemaMismatchError
67
- */
68
- function computeSchemaFingerprint(authSchema, storedSchema) {
69
- const normalized = sortDeep({
70
- auth: authSchema,
71
- ...storedSchema ? { stored: storedSchema } : {}
72
- });
73
- const json = JSON.stringify(normalized);
74
- return createHash("sha256").update(json).digest("hex").substring(0, 16);
75
- }
76
- function sortDeep(value) {
77
- if (value === null || value === void 0) return value;
78
- if (Array.isArray(value)) return value.map(sortDeep);
79
- if (typeof value === "object") {
80
- const sorted = {};
81
- for (const key of Object.keys(value).sort()) sorted[key] = sortDeep(value[key]);
82
- return sorted;
83
- }
84
- return value;
85
- }
86
- //#endregion
87
- //#region ../../packages/workflow-build-contracts/src/declared-credential-requirements.ts
88
- function schemaToJsonSchema(schema) {
89
- return JsonSchemaSchema.parse({ ...z.toJSONSchema(schema, { unrepresentable: "any" }) });
90
- }
91
- function readSchemaKeys(schema, propertyKey) {
92
- if (schema === null || typeof schema !== "object") return [];
93
- const candidate = schema[propertyKey];
94
- if (candidate === null || typeof candidate !== "object" || Array.isArray(candidate)) return [];
95
- return Object.keys(candidate).sort();
96
- }
97
- /**
98
- * Returns sorted keys whose Zod schema field is wrapped in `z.optional()` or `z.default()`.
99
- * Both mean the vault can omit the key at runtime.
100
- */
101
- function readOptionalSchemaKeys(schema) {
102
- if (schema === null || typeof schema !== "object") return [];
103
- const shape = schema.shape;
104
- if (shape === null || typeof shape !== "object" || Array.isArray(shape)) return [];
105
- return Object.entries(shape).filter(([, field]) => field instanceof z.ZodOptional || field instanceof z.ZodDefault).map(([key]) => key).sort();
106
- }
107
- /**
108
- * Returns sorted keys that are NOT listed in the JSON Schema `required` array.
109
- */
110
- function readOptionalJsonSchemaKeys(schema) {
111
- if (schema === null || typeof schema !== "object") return [];
112
- const record = schema;
113
- const properties = record.properties;
114
- if (properties === null || typeof properties !== "object" || Array.isArray(properties)) return [];
115
- const requiredSet = new Set(Array.isArray(record.required) ? record.required : []);
116
- return Object.keys(properties).filter((key) => !requiredSet.has(key)).sort();
117
- }
118
- function toDeclaredCredentialRequirement(credentialSet) {
119
- const optionalAuthKeys = credentialSet.optionalCredentialKeys;
120
- const optionalStoredKeys = credentialSet.optionalStoredCredentialKeys;
121
- const schemaFingerprint = computeSchemaFingerprint(schemaToJsonSchema(credentialSet.auth));
122
- const onCredentialRevoked = credentialSet.onCredentialRevoked;
123
- return {
124
- credentialSetId: credentialSet.id,
125
- credentialKeys: [...credentialSet.credentialKeys],
126
- ...optionalAuthKeys.length > 0 ? { optionalCredentialKeys: [...optionalAuthKeys] } : {},
127
- storedCredentialKeys: [...credentialSet.storedCredentialKeys],
128
- ...optionalStoredKeys.length > 0 ? { optionalStoredCredentialKeys: [...optionalStoredKeys] } : {},
129
- schemaFingerprint,
130
- ...onCredentialRevoked ? { onCredentialRevoked } : {},
131
- ...credentialSet.proxy ? { proxy: credentialSet.proxy } : {},
132
- ...credentialSet.needsRawSecret === true ? { needsRawSecret: true } : {}
133
- };
134
- }
135
- function toDeclaredCredentialRequirements(credentialSets) {
136
- return credentialSets.map(toDeclaredCredentialRequirement);
137
- }
138
- function manifestToDeclaredCredentialRequirement(credentialSet) {
139
- const authKeys = readSchemaKeys(credentialSet.auth, "properties");
140
- const optionalAuthKeys = readOptionalJsonSchemaKeys(credentialSet.auth);
141
- const storedSchema = credentialSet.auth;
142
- const storedKeys = readSchemaKeys(storedSchema, "properties");
143
- const optionalStoredKeys = readOptionalJsonSchemaKeys(storedSchema);
144
- const schemaFingerprint = credentialSet.auth ? computeSchemaFingerprint(credentialSet.auth) : void 0;
145
- const onCredentialRevoked = credentialSet.onCredentialRevoked;
146
- return {
147
- credentialSetId: credentialSet.id,
148
- credentialKeys: authKeys,
149
- ...optionalAuthKeys.length > 0 ? { optionalCredentialKeys: optionalAuthKeys } : {},
150
- storedCredentialKeys: storedKeys,
151
- ...optionalStoredKeys.length > 0 ? { optionalStoredCredentialKeys: optionalStoredKeys } : {},
152
- ...schemaFingerprint ? { schemaFingerprint } : {},
153
- ...onCredentialRevoked ? { onCredentialRevoked } : {},
154
- ...credentialSet.proxy ? { proxy: credentialSet.proxy } : {},
155
- ...credentialSet.needsRawSecret === true ? { needsRawSecret: true } : {}
156
- };
157
- }
158
- function manifestsToDeclaredCredentialRequirements(credentialSets) {
159
- return credentialSets.map(manifestToDeclaredCredentialRequirement);
160
- }
161
- //#endregion
162
- //#region ../../packages/workflow-build-contracts/src/flow-graph-schema.ts
163
- const DecisionKindSchema = z.enum([
164
- "if",
165
- "switch",
166
- "ternary"
167
- ]);
168
- const ParallelKindSchema = z.enum([
169
- "all",
170
- "race",
171
- "allSettled",
172
- "any"
173
- ]);
174
- const LoopKindSchema = z.enum([
175
- "for",
176
- "for-of",
177
- "for-in",
178
- "while",
179
- "do-while"
180
- ]);
181
- const ExitKindSchema = z.enum(["return", "throw"]);
182
- const FlowBranchKindSchema = z.enum([
183
- "then",
184
- "else",
185
- "parallel-branch"
186
- ]);
187
- const FlowNodeTypeSchema = z.enum([
188
- "entry",
189
- "step",
190
- "code-block",
191
- "decision",
192
- "merge",
193
- "fork",
194
- "join",
195
- "parallel-map",
196
- "loop",
197
- "exit"
198
- ]);
199
- const FlowEdgeTypeSchema = z.enum([
200
- "default",
201
- "true-branch",
202
- "false-branch",
203
- "merge",
204
- "loop-entry",
205
- "loop-back",
206
- "parallel",
207
- "return"
208
- ]);
209
- const FlowStatementSchema = z.object({
210
- kind: z.string().min(1),
211
- label: z.string().min(1),
212
- sourceText: z.string().min(1)
213
- });
214
- const EntryNodeDataSchema = z.object({ kind: z.literal("entry") });
215
- const StepNodeDataSchema = z.object({
216
- kind: z.literal("call"),
217
- callKind: CallKindSchema,
218
- stepName: z.string().min(1),
219
- callsiteFingerprint: CallsiteFingerprintSchema.optional(),
220
- exportName: z.string().min(1).optional(),
221
- stepId: z.string().min(1).optional(),
222
- awaited: z.boolean().optional(),
223
- dynamic: z.boolean().optional(),
224
- recursive: z.boolean().optional(),
225
- importSource: ImportSourceSchema.optional(),
226
- outputBinding: z.string().min(1).optional(),
227
- description: z.string().optional(),
228
- inputSchema: JsonSchemaSchema.optional(),
229
- outputSchema: JsonSchemaSchema.optional(),
230
- source: SourceLocationSchema.optional(),
231
- astKind: z.string().min(1).optional(),
232
- scopeOverride: credential_requirements_exports.IntegrationScopeSchema.optional(),
233
- credentialSets: z.array(credential_requirements_exports.ResolvedCredentialSetSchema).optional(),
234
- requiredOAuthScopes: z.array(z.string()).optional()
235
- });
236
- const CodeBlockNodeDataSchema = z.object({
237
- kind: z.literal("code-block"),
238
- statements: z.array(FlowStatementSchema)
239
- });
240
- const DecisionNodeDataSchema = z.object({
241
- kind: z.literal("decision"),
242
- decisionKind: DecisionKindSchema.optional(),
243
- source: SourceLocationSchema.optional(),
244
- astKind: z.string().min(1).optional(),
245
- conditionText: z.string().optional()
246
- });
247
- const MergeNodeDataSchema = z.object({
248
- kind: z.literal("merge"),
249
- source: SourceLocationSchema.optional()
250
- });
251
- const ForkNodeDataSchema = z.object({
252
- kind: z.literal("fork"),
253
- parallelKind: ParallelKindSchema.optional(),
254
- preStatements: z.array(FlowStatementSchema).optional(),
255
- source: SourceLocationSchema.optional(),
256
- astKind: z.string().min(1).optional()
257
- });
258
- const JoinNodeDataSchema = z.object({
259
- kind: z.literal("join"),
260
- outputBinding: z.string().min(1).optional(),
261
- source: SourceLocationSchema.optional()
262
- });
263
- const ParallelMapNodeDataSchema = z.object({
264
- kind: z.literal("parallel-map"),
265
- parallelKind: ParallelKindSchema.optional(),
266
- iterationExpression: z.string().optional(),
267
- stepNames: z.array(z.string()).optional(),
268
- outputBinding: z.string().min(1).optional(),
269
- preStatements: z.array(FlowStatementSchema).optional(),
270
- source: SourceLocationSchema.optional(),
271
- astKind: z.string().min(1).optional()
272
- });
273
- const LoopNodeDataSchema = z.object({
274
- kind: z.literal("loop"),
275
- loopKind: LoopKindSchema.optional(),
276
- source: SourceLocationSchema.optional(),
277
- astKind: z.string().min(1).optional(),
278
- conditionText: z.string().optional()
279
- });
280
- const ExitNodeDataSchema = z.object({
281
- kind: z.literal("exit"),
282
- exitKind: ExitKindSchema,
283
- sourceText: z.string().optional(),
284
- source: SourceLocationSchema.optional(),
285
- astKind: z.string().min(1).optional()
286
- });
287
- const FlowNodeDataSchema = z.discriminatedUnion("kind", [
288
- EntryNodeDataSchema,
289
- StepNodeDataSchema,
290
- CodeBlockNodeDataSchema,
291
- DecisionNodeDataSchema,
292
- MergeNodeDataSchema,
293
- ForkNodeDataSchema,
294
- JoinNodeDataSchema,
295
- ParallelMapNodeDataSchema,
296
- LoopNodeDataSchema,
297
- ExitNodeDataSchema
298
- ]);
299
- const FlowEdgeDataSchema = z.object({ branchKind: FlowBranchKindSchema.optional() }).catchall(z.unknown());
300
- const FlowPositionSchema = z.object({
301
- x: z.number().finite(),
302
- y: z.number().finite()
303
- });
304
- const FlowNodeSchema = z.object({
305
- id: z.string().min(1),
306
- type: FlowNodeTypeSchema,
307
- label: z.string(),
308
- position: FlowPositionSchema,
309
- data: FlowNodeDataSchema
310
- });
311
- const FlowEdgeSchema = z.object({
312
- id: z.string().min(1),
313
- source: z.string().min(1),
314
- target: z.string().min(1),
315
- type: FlowEdgeTypeSchema,
316
- label: z.string().optional(),
317
- data: FlowEdgeDataSchema.optional()
318
- });
319
- const FlowGraphSchema = z.object({
320
- nodes: z.array(FlowNodeSchema),
321
- edges: z.array(FlowEdgeSchema),
322
- entryPoint: z.string().min(1),
323
- exitPoints: z.array(z.string().min(1)),
324
- generatedAt: z.iso.datetime(),
325
- diagnostics: z.array(z.string())
326
- });
327
- //#endregion
328
- //#region ../../packages/workflow-build-contracts/src/workflow-build-manifest.ts
329
- const WORKFLOW_MANIFEST_GENERATOR = "local-build";
330
- const WORKFLOW_MANIFEST_SCHEMA_VERSION = "1.0.0";
331
- const WORKFLOW_MANIFEST_GENERATOR_VERSION = "1.1.0";
332
- const WorkflowIdentitySchema = z.object({
333
- name: z.string().trim().min(1).max(255),
334
- description: z.string().trim().min(1).optional(),
335
- tags: z.array(z.string()).optional()
336
- });
337
- const StepIdentitySchema = z.object({
338
- name: z.string().trim().min(1).max(255),
339
- description: z.string().trim().min(1).optional(),
340
- tags: z.array(z.string()).optional()
341
- });
342
- const WorkflowIOSchema = z.object({
343
- input: JsonSchemaSchema.nullable(),
344
- output: JsonSchemaSchema.nullable()
345
- });
346
- const BuildInfoSchema = z.object({
347
- timestamp: z.iso.datetime(),
348
- builderVersion: z.string().min(1),
349
- generatedBy: z.literal(WORKFLOW_MANIFEST_GENERATOR),
350
- gitCommit: z.string().optional(),
351
- gitBranch: z.string().optional(),
352
- gitIsDirty: z.boolean().optional(),
353
- nodeVersion: z.string().min(1),
354
- platform: z.string().min(1),
355
- sourceChecksumAlgorithm: z.enum(["sha256"]),
356
- sourceChecksum: z.string().length(64),
357
- generatedFiles: z.array(z.string().min(1))
358
- });
359
- const ManifestDependenciesSchema = z.object({
360
- localFiles: z.record(z.string(), z.string()),
361
- packages: z.record(z.string(), z.string()),
362
- workspacePackages: z.record(z.string(), z.string()),
363
- builtins: z.array(z.string())
364
- });
365
- const DurationSchema = z.union([z.number().int().positive().finite(), z.string().regex(/^[1-9]\d*[smhdwy]$/)]);
366
- const WorkflowTriggerBindingSchema = z.object({
367
- /** Authored trigger name (from `xxxTrigger({ name: ... })`). */
368
- authoredTriggerId: z.string().min(1),
369
- triggerType: z.enum([
370
- "webhook",
371
- "cron",
372
- "polling"
373
- ]),
374
- hasTransform: z.boolean(),
375
- narrowedFrom: z.string().optional(),
376
- lineage: z.array(z.string()).optional()
377
- });
378
- const WorkflowCoreManifestSchema = z.object({
379
- schemaVersion: z.literal(WORKFLOW_MANIFEST_SCHEMA_VERSION),
380
- id: z.string().min(1),
381
- name: z.string().trim().min(1).max(255),
382
- description: z.string().trim().min(1).optional(),
383
- tags: z.array(z.string()).optional(),
384
- exportName: z.string().min(1),
385
- workflowSchemas: WorkflowIOSchema,
386
- workflowGlobals: JsonSchemaSchema.optional(),
387
- timeout: DurationSchema.optional(),
388
- triggers: z.array(WorkflowTriggerBindingSchema).optional()
389
- });
390
- const WorkflowBuildManifestSchema = WorkflowCoreManifestSchema.extend({
391
- workflowSource: SourceLocationSchema.optional(),
392
- buildInfo: BuildInfoSchema,
393
- dependencies: ManifestDependenciesSchema,
394
- hasCycles: z.boolean().optional(),
395
- credentials: credential_requirements_exports.CredentialRequirementsSchema.optional(),
396
- sandboxes: z.array(z.record(z.string(), z.unknown())).optional(),
397
- steps: z.record(z.string(), credential_requirements_exports.WorkflowStepEntrySchema)
398
- });
399
- const UploadBundleOptionsSchema = z.object({
400
- organizationId: z.string(),
401
- workflowId: z.string(),
402
- bundle: z.instanceof(Uint8Array).optional(),
403
- manifest: WorkflowBuildManifestSchema,
404
- sourcePath: z.string().optional(),
405
- triggers: z.array(credential_requirements_exports.TriggerUploadDataSchema).optional(),
406
- bundleSize: z.number().optional(),
407
- bundleHash: SHA256HashSchema.optional(),
408
- skipVersionBump: z.boolean().optional(),
409
- projectRoot: z.string().optional(),
410
- projectId: z.uuid(),
411
- flowJson: FlowGraphSchema.optional(),
412
- deploymentSnapshotOnly: z.boolean().optional()
413
- });
414
- //#endregion
415
- //#region ../../packages/workflow-build-contracts/src/index.ts
416
- var src_exports = /* @__PURE__ */ __exportAll({
417
- BuildInfoSchema: () => BuildInfoSchema,
418
- CallKindSchema: () => CallKindSchema,
419
- CallsiteFingerprintSchema: () => CallsiteFingerprintSchema,
420
- CapturedVariableSchema: () => CapturedVariableSchema,
421
- CapturedVariableSourceKindSchema: () => CapturedVariableSourceKindSchema,
422
- CapturedVariableValueTypeSchema: () => CapturedVariableValueTypeSchema,
423
- FlowBranchKindSchema: () => FlowBranchKindSchema,
424
- FlowEdgeDataSchema: () => FlowEdgeDataSchema,
425
- FlowEdgeSchema: () => FlowEdgeSchema,
426
- FlowEdgeTypeSchema: () => FlowEdgeTypeSchema,
427
- FlowGraphSchema: () => FlowGraphSchema,
428
- FlowNodeDataSchema: () => FlowNodeDataSchema,
429
- FlowNodeSchema: () => FlowNodeSchema,
430
- FlowNodeTypeSchema: () => FlowNodeTypeSchema,
431
- ImportSourceSchema: () => ImportSourceSchema,
432
- JsonSchemaSchema: () => JsonSchemaSchema,
433
- ManifestDependenciesSchema: () => ManifestDependenciesSchema,
434
- RetryConfigSchema: () => RetryConfigSchema,
435
- SHA256HashSchema: () => SHA256HashSchema,
436
- SourceLocationSchema: () => SourceLocationSchema,
437
- StepIdentitySchema: () => StepIdentitySchema,
438
- UploadBundleOptionsSchema: () => UploadBundleOptionsSchema,
439
- WORKFLOW_MANIFEST_GENERATOR: () => WORKFLOW_MANIFEST_GENERATOR,
440
- WORKFLOW_MANIFEST_GENERATOR_VERSION: () => WORKFLOW_MANIFEST_GENERATOR_VERSION,
441
- WORKFLOW_MANIFEST_SCHEMA_VERSION: () => WORKFLOW_MANIFEST_SCHEMA_VERSION,
442
- WorkflowBuildManifestSchema: () => WorkflowBuildManifestSchema,
443
- WorkflowCoreManifestSchema: () => WorkflowCoreManifestSchema,
444
- WorkflowIOSchema: () => WorkflowIOSchema,
445
- WorkflowIdentitySchema: () => WorkflowIdentitySchema,
446
- computeSchemaFingerprint: () => computeSchemaFingerprint,
447
- manifestToDeclaredCredentialRequirement: () => manifestToDeclaredCredentialRequirement,
448
- manifestsToDeclaredCredentialRequirements: () => manifestsToDeclaredCredentialRequirements,
449
- readOptionalJsonSchemaKeys: () => readOptionalJsonSchemaKeys,
450
- readOptionalSchemaKeys: () => readOptionalSchemaKeys,
451
- toDeclaredCredentialRequirement: () => toDeclaredCredentialRequirement,
452
- toDeclaredCredentialRequirements: () => toDeclaredCredentialRequirements
453
- });
454
- __reExport(src_exports, credential_requirements_exports);
455
- //#endregion
456
- export { WorkflowCoreManifestSchema as a, readOptionalJsonSchemaKeys as c, WorkflowBuildManifestSchema as i, JsonSchemaSchema as l, WORKFLOW_MANIFEST_GENERATOR as n, FlowGraphSchema as o, WORKFLOW_MANIFEST_SCHEMA_VERSION as r, manifestToDeclaredCredentialRequirement as s, src_exports as t, SHA256HashSchema as u };
File without changes