@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
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { A as WorkflowResolutionError, a as ui, g as getHttpStatus, h as getApiErrorCode } from "./keystroke.mjs";
4
4
  import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
5
- import { a as readManifestsFromOutDir } from "./dist-BGrWr5fp.mjs";
6
- import { t as requireWorkflowsDir } from "./resolve-project-CWP2fji3.mjs";
7
- import { t as createSpinnerProgress } from "./spinner-progress-DV28G4tP.mjs";
8
- import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-IGYhEC8Y.mjs";
5
+ import { a as readManifestsFromOutDir } from "./dist-Br4m3sFZ.mjs";
6
+ import { t as requireWorkflowsDir } from "./resolve-project-Cj3MFnU0.mjs";
7
+ import { t as createSpinnerProgress } from "./spinner-progress-BtEIJRX4.mjs";
8
+ import { a as runWorkflowBuild, n as renderBuildFailure } from "./workflow-build-Bi1Aacc5.mjs";
9
9
  //#region src/commands/workflows/_shared/current-deployment-workflow.ts
10
10
  /**
11
11
  * Lightweight resolution: gets projectId from keystroke.config.ts and authoredWorkflowId
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { a as ui } from "./keystroke.mjs";
4
- import { i as requireClient } from "./context-BUzxM3QI.mjs";
4
+ import { i as requireClient } from "./context-B2cQ-Nt3.mjs";
5
5
  //#region src/commands/org/current.handler.ts
6
6
  async function handleOrgCurrent(_options, ctx) {
7
7
  if (!ctx.organizationId) {
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+
3
+ import "zod";
4
+ import { createHash } from "node:crypto";
5
+ //#region ../../packages/workflow-build-contracts/src/schema-fingerprint.ts
6
+ /**
7
+ * schema-fingerprint.ts
8
+ *
9
+ * Computes a deterministic fingerprint (hash) of a credential set's schema.
10
+ * Used as a persistence-layer identity stamp: the workflow-builder stamps each
11
+ * credential requirement with its fingerprint at build time, the server stamps
12
+ * each vault row with the fingerprint at upload time, and the executor's
13
+ * credential resolver compares the two at read time so schema drift surfaces
14
+ * as a `CredentialSchemaMismatchError` rather than a silent decode into a
15
+ * stale shape.
16
+ *
17
+ * The fingerprint is deterministic: identical JSON schemas always produce the
18
+ * same hash regardless of property ordering, timestamps, or other
19
+ * non-structural differences.
20
+ *
21
+ * @remarks
22
+ * This is the *persistence* fingerprint. The construction-time registry in
23
+ * `credential-set/registry.ts` uses a different (Zod-structural) fingerprint
24
+ * purely for in-process identity collision detection; the two fingerprints
25
+ * serve different purposes and do not need to match.
26
+ */
27
+ /**
28
+ * Compute a deterministic fingerprint for a JSON schema object.
29
+ *
30
+ * The schema is the output of `schemaToJsonSchema(zodSchema)` — a plain JSON
31
+ * object describing the shape of the Zod schema.
32
+ *
33
+ * Properties are sorted recursively before hashing to ensure deterministic
34
+ * output regardless of insertion order.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const auth = schemaToJsonSchema(credentialSet.auth);
39
+ * const stored = credentialSet.stored ? schemaToJsonSchema(credentialSet.stored) : undefined;
40
+ * const fingerprint = computeSchemaFingerprint(auth, stored);
41
+ * ```
42
+ *
43
+ * @see CredentialSchemaMismatchError
44
+ */
45
+ function computeSchemaFingerprint(authSchema, storedSchema) {
46
+ const normalized = sortDeep({
47
+ auth: authSchema,
48
+ ...storedSchema ? { stored: storedSchema } : {}
49
+ });
50
+ const json = JSON.stringify(normalized);
51
+ return createHash("sha256").update(json).digest("hex").substring(0, 16);
52
+ }
53
+ function sortDeep(value) {
54
+ if (value === null || value === void 0) return value;
55
+ if (Array.isArray(value)) return value.map(sortDeep);
56
+ if (typeof value === "object") {
57
+ const sorted = {};
58
+ for (const key of Object.keys(value).sort()) sorted[key] = sortDeep(value[key]);
59
+ return sorted;
60
+ }
61
+ return value;
62
+ }
63
+ //#endregion
64
+ //#region ../../packages/workflow-build-contracts/src/declared-credential-requirements.ts
65
+ function readSchemaKeys(schema, propertyKey) {
66
+ if (schema === null || typeof schema !== "object") return [];
67
+ const candidate = schema[propertyKey];
68
+ if (candidate === null || typeof candidate !== "object" || Array.isArray(candidate)) return [];
69
+ return Object.keys(candidate).sort();
70
+ }
71
+ /**
72
+ * Returns sorted keys that are NOT listed in the JSON Schema `required` array.
73
+ */
74
+ function readOptionalJsonSchemaKeys(schema) {
75
+ if (schema === null || typeof schema !== "object") return [];
76
+ const record = schema;
77
+ const properties = record.properties;
78
+ if (properties === null || typeof properties !== "object" || Array.isArray(properties)) return [];
79
+ const requiredSet = new Set(Array.isArray(record.required) ? record.required : []);
80
+ return Object.keys(properties).filter((key) => !requiredSet.has(key)).sort();
81
+ }
82
+ function manifestToDeclaredCredentialRequirement(credentialSet) {
83
+ const authKeys = readSchemaKeys(credentialSet.auth, "properties");
84
+ const optionalAuthKeys = readOptionalJsonSchemaKeys(credentialSet.auth);
85
+ const storedSchema = credentialSet.auth;
86
+ const storedKeys = readSchemaKeys(storedSchema, "properties");
87
+ const optionalStoredKeys = readOptionalJsonSchemaKeys(storedSchema);
88
+ const schemaFingerprint = credentialSet.auth ? computeSchemaFingerprint(credentialSet.auth) : void 0;
89
+ const onCredentialRevoked = credentialSet.onCredentialRevoked;
90
+ return {
91
+ credentialSetId: credentialSet.id,
92
+ credentialKeys: authKeys,
93
+ ...optionalAuthKeys.length > 0 ? { optionalCredentialKeys: optionalAuthKeys } : {},
94
+ storedCredentialKeys: storedKeys,
95
+ ...optionalStoredKeys.length > 0 ? { optionalStoredCredentialKeys: optionalStoredKeys } : {},
96
+ ...schemaFingerprint ? { schemaFingerprint } : {},
97
+ ...onCredentialRevoked ? { onCredentialRevoked } : {},
98
+ ...credentialSet.proxy ? { proxy: credentialSet.proxy } : {},
99
+ ...credentialSet.needsRawSecret === true ? { needsRawSecret: true } : {}
100
+ };
101
+ }
102
+ //#endregion
103
+ export { readOptionalJsonSchemaKeys as n, manifestToDeclaredCredentialRequirement as t };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { a as ui, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
4
- import { i as requireClient } from "./context-BUzxM3QI.mjs";
4
+ import { i as requireClient } from "./context-B2cQ-Nt3.mjs";
5
5
  //#region src/commands/api-keys/delete.handler.ts
6
6
  async function handleApiKeysDelete(options, ctx) {
7
7
  const client = requireClient(ctx);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { a as createKyInstance, n as auth, r as bundles, s as getClientEnv, t as projects } from "./projects-s5ehKLil.mjs";
3
+ import { a as createKyInstance, n as auth, r as bundles, s as getClientEnv, t as projects } from "./projects-ZNcKwds2.mjs";
4
4
  //#region ../../packages/workflow-sdk/src/deploy.ts
5
5
  function createDeployClient(config = {}) {
6
6
  const env = getClientEnv();
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { t as createTypedCommand } from "./commander-DQLrBSIW.mjs";
3
+ import { t as createTypedCommand } from "./commander-9Kro0Dl3.mjs";
4
4
  import { z } from "zod";
5
5
  //#region src/commands/deploy/deploy.command.ts
6
6
  /**
@@ -64,7 +64,7 @@ function createDeployCommand() {
64
64
  schema: DeployOptionsSchema,
65
65
  optionsConfig: DEPLOY_OPTIONS_CONFIG,
66
66
  contextMode: "auth",
67
- loadHandler: async () => (await import("./deploy.handler-TnPNBYXZ.mjs")).handleDeploy
67
+ loadHandler: async () => (await import("./deploy.handler-Bg0dpSTj.mjs")).handleDeploy
68
68
  });
69
69
  cmd.enablePositionalOptions();
70
70
  cmd.passThroughOptions();
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { a as ui } from "./keystroke.mjs";
4
- import { t as createSpinnerProgress } from "./spinner-progress-DV28G4tP.mjs";
4
+ import { t as createSpinnerProgress } from "./spinner-progress-BtEIJRX4.mjs";
5
5
  //#region src/lib/deploy-progress.ts
6
6
  function renderItemFailure(event, kind, spinner) {
7
7
  if (event.result === "failure") spinner.fail(`${kind} failed (${event.name})`, void 0, event.error);
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { D as CliExitError, P as logger, a as ui, l as isLocalMode, n as style, t as ANSI } from "./keystroke.mjs";
4
- import { i as projects } from "./dist-CIInPRGh.mjs";
4
+ import { i as projects } from "./dist-DuJjDZIf.mjs";
5
5
  import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
6
- import { r as requireAuthOptions, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-BUzxM3QI.mjs";
7
- import { i as readAgentManifestsFromOutDir, o as readWorkflowsFromDisk } from "./dist-BGrWr5fp.mjs";
8
- import { t as requireWorkflowsDir } from "./resolve-project-CWP2fji3.mjs";
9
- import { n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-IGYhEC8Y.mjs";
10
- import { t as createBuildProgress } from "./build-progress-BVwDg6lC.mjs";
11
- import { t as createDeployProgress } from "./deploy-progress-CyolzjRB.mjs";
12
- import { t as withErrorBoundary } from "./error-boundary-GtRvP2oP.mjs";
13
- import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-pyBoobIm.mjs";
14
- import { t as computeWorkflowDiff } from "./diff-utils-x5pi8SrL.mjs";
6
+ import { r as requireAuthOptions, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-B2cQ-Nt3.mjs";
7
+ import { i as readAgentManifestsFromOutDir, o as readWorkflowsFromDisk } from "./dist-Br4m3sFZ.mjs";
8
+ import { t as requireWorkflowsDir } from "./resolve-project-Cj3MFnU0.mjs";
9
+ import { n as renderBuildFailure, r as renderBuildHeader } from "./workflow-build-Bi1Aacc5.mjs";
10
+ import { t as createBuildProgress } from "./build-progress-nYa14iBP.mjs";
11
+ import { t as createDeployProgress } from "./deploy-progress-Dlp9aBDW.mjs";
12
+ import { t as withErrorBoundary } from "./error-boundary-DVZipk-A.mjs";
13
+ import { t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-qMfOrRIu.mjs";
14
+ import { t as computeWorkflowDiff } from "./diff-utils-CXKNQUXO.mjs";
15
15
  import path from "node:path";
16
16
  import { access } from "node:fs/promises";
17
17
  //#region src/commands/deploy/deploy-diff.ts
@@ -198,7 +198,7 @@ async function handleDeploy(options, ctx) {
198
198
  let outDir;
199
199
  let artifactFilter;
200
200
  try {
201
- const { runWorkflowBuild } = await import("./workflow-build-IGYhEC8Y.mjs").then((n) => n.o);
201
+ const { runWorkflowBuild } = await import("./workflow-build-Bi1Aacc5.mjs").then((n) => n.o);
202
202
  const buildOutcome = await runWorkflowBuild({
203
203
  workflowsDir,
204
204
  verbose: options.verbose,
@@ -233,7 +233,7 @@ async function handleDeploy(options, ctx) {
233
233
  const progress = createDeployProgress();
234
234
  let result;
235
235
  try {
236
- result = await (deployHandlerDependencies.deployFromDir ?? (await import("./dist-BGrWr5fp.mjs").then((n) => n.r)).deployFromDir)({
236
+ result = await (deployHandlerDependencies.deployFromDir ?? (await import("./dist-Br4m3sFZ.mjs").then((n) => n.r)).deployFromDir)({
237
237
  outDir,
238
238
  workflowsDir,
239
239
  client,
@@ -271,7 +271,7 @@ function emitNewWebhookCredentials(result) {
271
271
  }
272
272
  async function handleTaskTargetDeploy(options) {
273
273
  renderBuildHeader(void 0);
274
- const buildResult = await (deployHandlerDependencies.buildTaskTargets ?? (await import("./task-target-build-B0HF2_At.mjs")).buildTaskTargets)({
274
+ const buildResult = await (deployHandlerDependencies.buildTaskTargets ?? (await import("./task-target-build-CTgl4L42.mjs")).buildTaskTargets)({
275
275
  projectRoot: options.workflowsDir,
276
276
  targetFiles: options.targetFiles,
277
277
  disableSourcemaps: options.options.disableSourcemaps
@@ -289,7 +289,7 @@ async function handleTaskTargetDeploy(options) {
289
289
  const progress = createDeployProgress();
290
290
  let result;
291
291
  try {
292
- result = await (deployHandlerDependencies.deployTaskTargets ?? (await import("./task-target-deploy-ClbwKJ8K.mjs")).deployTaskTargets)({
292
+ result = await (deployHandlerDependencies.deployTaskTargets ?? (await import("./task-target-deploy-DeUyfi9H.mjs")).deployTaskTargets)({
293
293
  preparedTasks: buildResult.preparedTasks,
294
294
  client,
295
295
  organizationId: options.projectConfig.organizationId,
@@ -312,7 +312,7 @@ async function handleTaskTargetDeploy(options) {
312
312
  }
313
313
  async function createFullDeployClient(ctx) {
314
314
  const authOptions = requireAuthOptions(ctx);
315
- const { createClient } = await import("./src-BYQwp8Ig.mjs");
315
+ const { createClient } = await import("./src-DNhUmpSl.mjs");
316
316
  return createClient({
317
317
  ...authOptions,
318
318
  onRequest: (info) => logger.debug(`-> ${info.method} ${info.url}`, {
@@ -327,7 +327,7 @@ async function createFullDeployClient(ctx) {
327
327
  }
328
328
  async function createTaskDeployClient(ctx) {
329
329
  const authOptions = requireAuthOptions(ctx);
330
- return (deployHandlerDependencies.createDeployClient ?? (await import("./deploy-BKjcO_sm.mjs")).createDeployClient)(authOptions);
330
+ return (deployHandlerDependencies.createDeployClient ?? (await import("./deploy-BURTx92e.mjs")).createDeployClient)(authOptions);
331
331
  }
332
332
  function renderSuccessSummary(result) {
333
333
  const tasks = result.tasks || [];
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { n as __exportAll } from "./chunk-DYxdGL9S.mjs";
4
- import { t as __exportAll$1 } from "./rolldown-runtime-twds-ZHy-BoF7MLzP.mjs";
3
+ import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
4
+ import { t as __exportAll$1 } from "./rolldown-runtime-twds-ZHy-RuJszab7.mjs";
5
5
  import path from "node:path";
6
6
  //#region ../../packages/workflow-builder/dist/detect-env-access-CwkOYeYM.mjs
7
7
  var detect_env_access_CwkOYeYM_exports = /* @__PURE__ */ __exportAll({
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { D as CliExitError, a as ui, j as throwReportedCliExit, y as toErrorMessage } from "./keystroke.mjs";
4
- import { i as projects } from "./dist-CIInPRGh.mjs";
4
+ import { i as projects } from "./dist-DuJjDZIf.mjs";
5
5
  import { i as writeJson } from "./output-BWcVRt-T.mjs";
6
- import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-BUzxM3QI.mjs";
7
- import { n as resolveLocalWorkflowManifest, t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-pyBoobIm.mjs";
8
- import { n as renderDiff, t as computeWorkflowDiff } from "./diff-utils-x5pi8SrL.mjs";
6
+ import { i as requireClient, t as assertProjectConfigMatchesAuthenticatedOrg } from "./context-B2cQ-Nt3.mjs";
7
+ import { n as resolveLocalWorkflowManifest, t as lookupCurrentDeploymentWorkflow } from "./current-deployment-workflow-qMfOrRIu.mjs";
8
+ import { n as renderDiff, t as computeWorkflowDiff } from "./diff-utils-CXKNQUXO.mjs";
9
9
  //#region src/commands/workflows/diff/diff.handler.ts
10
10
  async function handleWorkflowsDiff(options, ctx) {
11
11
  const resolved = await resolveLocalWorkflowManifest(options.workflow, options.path, { jsonMode: ctx.jsonMode });
@@ -1,16 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { n as __exportAll } from "./chunk-DYxdGL9S.mjs";
3
+ import { n as __exportAll } from "./chunk-CH6r78ws.mjs";
4
4
  import { t as assertWorkflowProjectRoot } from "./project-config-DudGRFPO.mjs";
5
- import { i as WorkflowBuildManifestSchema, o as FlowGraphSchema, t as src_exports, u as SHA256HashSchema } from "./src-BHTjsZ9V.mjs";
6
- import { t as AgentVersionManifestSchema } from "./agent-manifest-CZ7BeUSG.mjs";
7
- import { n as TaskBuildManifestSchema } from "./task-BSCN9cU4.mjs";
8
- import { n as FileMetadataSchema } from "./file-metadata-B8c7Y5yg.mjs";
9
- import { t as computeProjectSnapshotHash } from "./task-target-deploy-dQYnMO8n-CeTmRcDw.mjs";
10
- import { a as MANIFEST_FILE_NAME, d as getMetadataRoot, f as getTriggersDir, m as getWorkflowManifestPath, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-DRf9qUf8.mjs";
11
- import { n as resolveProjectBuildOutputDir } from "./utils-Ddltm1sR.mjs";
12
- import { t as TriggerBuildManifestSchema } from "./trigger-manifest-DTni4NaZ.mjs";
13
- import { t as batchUpload } from "./upload-CJWApEgz.mjs";
5
+ import { n as SHA256HashSchema } from "./common-AK0q0Oz0.mjs";
6
+ import { f as collectCredentialRequirementEntries, u as TriggerUploadDataSchema } from "./credential-requirements-D0mavK8j-CFMf0Xwu.mjs";
7
+ import { a as FlowGraphSchema, r as WorkflowBuildManifestSchema } from "./workflow-build-manifest-1sC52TIG.mjs";
8
+ import { t as AgentVersionManifestSchema } from "./agent-manifest-Pg0aURo7.mjs";
9
+ import { n as TaskBuildManifestSchema } from "./task-BWuIKWh4.mjs";
10
+ import { n as FileMetadataSchema } from "./file-metadata-DQVDjr7M.mjs";
11
+ import { t as computeProjectSnapshotHash } from "./task-target-deploy-dQYnMO8n-d2vdeqXH.mjs";
12
+ import { a as MANIFEST_FILE_NAME, d as getMetadataRoot, f as getTriggersDir, m as getWorkflowManifestPath, p as getWorkflowArtifactPaths, t as BUILD_DIR_NAME } from "./layout-B95Tku8F.mjs";
13
+ import { n as resolveProjectBuildOutputDir } from "./utils-BaxDlCsW.mjs";
14
+ import { t as TriggerBuildManifestSchema } from "./trigger-manifest-C07EM-b2.mjs";
15
+ import { t as batchUpload } from "./upload-CE4H5R1h.mjs";
14
16
  import * as path$1 from "node:path";
15
17
  import path from "node:path";
16
18
  import * as fs from "node:fs/promises";
@@ -120,7 +122,7 @@ function collectSchemaFingerprintsFromAgentManifest(manifest) {
120
122
  */
121
123
  async function collectCredentialFingerprintMapFromProjectDist(projectRoot) {
122
124
  const map = /* @__PURE__ */ new Map();
123
- for (const { manifest } of await readManifestsFromOutDir(projectRoot)) for (const entry of (0, src_exports.collectCredentialRequirementEntries)(manifest.credentials)) if (entry.schemaFingerprint && !map.has(entry.credentialSetId)) map.set(entry.credentialSetId, entry.schemaFingerprint);
125
+ for (const { manifest } of await readManifestsFromOutDir(projectRoot)) for (const entry of collectCredentialRequirementEntries(manifest.credentials)) if (entry.schemaFingerprint && !map.has(entry.credentialSetId)) map.set(entry.credentialSetId, entry.schemaFingerprint);
124
126
  for (const { manifest } of await readAgentManifestsFromOutDir(projectRoot)) for (const [resolvedId, fp] of collectSchemaFingerprintsFromAgentManifest(manifest)) if (!map.has(resolvedId)) map.set(resolvedId, fp);
125
127
  return map;
126
128
  }
@@ -595,7 +597,7 @@ async function readTriggersFromBuildOutput(buildDir, options) {
595
597
  const manifest = TriggerBuildManifestSchema.parse(JSON.parse(raw));
596
598
  const pollExports = manifest.functions && Object.keys(manifest.functions).length > 0 ? Object.fromEntries(Object.entries(manifest.functions).map(([key, value]) => [key, value.export])) : void 0;
597
599
  const pollBundlePath = manifest.functions ? Object.values(manifest.functions)[0]?.js : void 0;
598
- const trigger = src_exports.TriggerUploadDataSchema.parse({
600
+ const trigger = TriggerUploadDataSchema.parse({
599
601
  id: manifest.id,
600
602
  authoredTriggerId: manifest.authoredTriggerId,
601
603
  type: manifest.type,
@@ -140,7 +140,30 @@ var KeychainVault = class {
140
140
  return (await this.createEntry(this.service, account)).getPassword();
141
141
  }
142
142
  async set(account, secret) {
143
- (await this.createEntry(this.service, account)).setPassword(secret);
143
+ const entry = await this.createEntry(this.service, account);
144
+ try {
145
+ entry.setPassword(secret);
146
+ return;
147
+ } catch (error) {
148
+ try {
149
+ await this.verifyWritableKeychain(account);
150
+ entry.deleteCredential();
151
+ (await this.createEntry(this.service, account)).setPassword(secret);
152
+ } catch (replacementError) {
153
+ throw new AggregateError([error, replacementError], "Could not replace the existing keychain credential.");
154
+ }
155
+ }
156
+ }
157
+ async verifyWritableKeychain(account) {
158
+ const probeAccount = `${account}:replacement-probe:${process.pid}:${Date.now()}`;
159
+ const probeEntry = await this.createEntry(this.service, probeAccount);
160
+ try {
161
+ probeEntry.setPassword("probe");
162
+ } finally {
163
+ try {
164
+ probeEntry.deleteCredential();
165
+ } catch {}
166
+ }
144
167
  }
145
168
  async delete(account) {
146
169
  return (await this.createEntry(this.service, account)).deleteCredential();
@@ -699,11 +722,11 @@ var Credentials = class {
699
722
  secretStorage,
700
723
  orgs: [input.org]
701
724
  };
702
- await this.metadata.write(newMeta);
703
725
  await this.secrets.setApiKey({
704
726
  orgId: input.org.organizationId,
705
727
  serverUrl: input.serverUrl
706
728
  }, input.apiKey, secretStorage.kind);
729
+ await this.metadata.write(newMeta);
707
730
  if (existing) {
708
731
  const previousOrg = existing.orgs.find((org) => org.organizationId === input.org.organizationId);
709
732
  const serverUrlChanged = normalizeCredentialServerUrl(existing.serverUrl) !== normalizeCredentialServerUrl(input.serverUrl);
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { D as CliExitError, _ as isAuthError, a as ui, j as throwReportedCliExit, m as REAUTH_HINT, n as style, t as ANSI, v as isNetworkError, y as toErrorMessage } from "./keystroke.mjs";
4
- import { i as projects } from "./dist-CIInPRGh.mjs";
4
+ import { i as projects } from "./dist-DuJjDZIf.mjs";
5
5
  import { i as writeJson } from "./output-BWcVRt-T.mjs";
6
- import { i as requireClient } from "./context-BUzxM3QI.mjs";
7
- import { n as CredentialConnectionIdSchema, r as CredentialScopeSchema, t as ConnectionStatusSchema } from "./schema-CvSZqa3t.mjs";
8
- import { a as readManifestsFromOutDir } from "./dist-BGrWr5fp.mjs";
9
- import { t as requireWorkflowsDir } from "./resolve-project-CWP2fji3.mjs";
10
- import { t as getIntegrationCatalog } from "./integration-catalog-BrJsBkfx.mjs";
11
- import { t as groupCredentialRequirements } from "./credentials-xPtLFTjW.mjs";
6
+ import { i as requireClient } from "./context-B2cQ-Nt3.mjs";
7
+ import { n as CredentialConnectionIdSchema, r as CredentialScopeSchema, t as ConnectionStatusSchema } from "./schema-DFJiNWyd.mjs";
8
+ import { a as readManifestsFromOutDir } from "./dist-Br4m3sFZ.mjs";
9
+ import { t as requireWorkflowsDir } from "./resolve-project-Cj3MFnU0.mjs";
10
+ import { t as getIntegrationCatalog } from "./integration-catalog-cYlTmOSb.mjs";
11
+ import { t as groupCredentialRequirements } from "./credentials-DQW8xxof.mjs";
12
12
  import { z } from "zod";
13
13
  import Table from "cli-table3";
14
14
  //#region ../../packages/shared-types/src/credentials/api/responses.ts
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { D as CliExitError, P as logger, a as ui, v as isNetworkError, y as toErrorMessage } from "./keystroke.mjs";
4
4
  import { r as isJsonMode } from "./output-BWcVRt-T.mjs";
5
- import { n as renderCredentialSchemaMismatchText, r as writeCredentialSchemaMismatchJson, t as isCredentialSchemaMismatchErrorLike } from "./credential-schema-mismatch-BHI_B-U-.mjs";
5
+ import { n as renderCredentialSchemaMismatchText, r as writeCredentialSchemaMismatchJson, t as isCredentialSchemaMismatchErrorLike } from "./credential-schema-mismatch-kfGeiSB1.mjs";
6
6
  //#region src/lib/error-boundary.ts
7
7
  async function withErrorBoundary(commandName, fn, options = {}) {
8
8
  const jsonMode = options.json ?? isJsonMode({});
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { r as CapturedVariableSchema, s as SourceLocationSchema } from "./source-analysis-BMMPIHN9.mjs";
3
+ import { a as SourceLocationSchema, r as CapturedVariableSchema } from "./source-analysis-z2RSZw6X.mjs";
4
4
  import { z } from "zod";
5
5
  z.enum([
6
6
  "pending",