@tailor-platform/sdk 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/{application-B8vok3w2.mjs → application-CfAom-vi.mjs} +38 -29
  3. package/dist/application-CfAom-vi.mjs.map +1 -0
  4. package/dist/application-ChVyhwe-.mjs +12 -0
  5. package/dist/{brand-GZnI4eYb.mjs → brand-0SscafcY.mjs} +2 -1
  6. package/dist/{brand-GZnI4eYb.mjs.map → brand-0SscafcY.mjs.map} +1 -1
  7. package/dist/{chunk-DEt8GZDa.mjs → chunk-COzJYswC.mjs} +1 -0
  8. package/dist/cli/index.d.mts +1 -0
  9. package/dist/cli/index.mjs +30 -29
  10. package/dist/cli/index.mjs.map +1 -1
  11. package/dist/cli/lib.d.mts +10 -6
  12. package/dist/cli/lib.mjs +14 -13
  13. package/dist/cli/lib.mjs.map +1 -1
  14. package/dist/cli/skills.d.mts +1 -0
  15. package/dist/cli/skills.mjs +2 -1
  16. package/dist/cli/skills.mjs.map +1 -1
  17. package/dist/{client-DfdgRZlQ.mjs → client-D5P1myz0.mjs} +6 -5
  18. package/dist/{client-DfdgRZlQ.mjs.map → client-D5P1myz0.mjs.map} +1 -1
  19. package/dist/{client-B0wrLUVK.mjs → client-gpRgZl1b.mjs} +5 -4
  20. package/dist/configure/index.d.mts +6 -5
  21. package/dist/configure/index.mjs +85 -14
  22. package/dist/configure/index.mjs.map +1 -1
  23. package/dist/crash-report-Cm9vFmTN.mjs +7 -0
  24. package/dist/{crash-report-wNxS0IUJ.mjs → crash-report-DnwITWeV.mjs} +5 -4
  25. package/dist/{crash-report-wNxS0IUJ.mjs.map → crash-report-DnwITWeV.mjs.map} +1 -1
  26. package/dist/{enum-constants-D1nfn0qD.mjs → enum-constants-Piv_E-2M.mjs} +3 -1
  27. package/dist/{enum-constants-D1nfn0qD.mjs.map → enum-constants-Piv_E-2M.mjs.map} +1 -1
  28. package/dist/{env-BgdHfWDn.d.mts → env-CSZ9CKg7.d.mts} +3 -2
  29. package/dist/{file-utils-Bctuzn3x.mjs → file-utils-B7xME5IK.mjs} +3 -1
  30. package/dist/{file-utils-Bctuzn3x.mjs.map → file-utils-B7xME5IK.mjs.map} +1 -1
  31. package/dist/{index-BAud4CE7.d.mts → index-BdlrrjvD.d.mts} +145 -35
  32. package/dist/{index-D4Y81vh1.d.mts → index-Dlpe_4Nd.d.mts} +4 -2
  33. package/dist/{index-FZMBoUWm.d.mts → index-IHl7P_9I.d.mts} +4 -2
  34. package/dist/{index-CxgBnxKM.d.mts → index-dg3Sf-No.d.mts} +4 -2
  35. package/dist/{index-CdDzh-T2.d.mts → index-uNv9YJgx.d.mts} +4 -2
  36. package/dist/{interceptor-DgQNmwWJ.mjs → interceptor-1LL1gBsF.mjs} +3 -2
  37. package/dist/{interceptor-DgQNmwWJ.mjs.map → interceptor-1LL1gBsF.mjs.map} +1 -1
  38. package/dist/{job-DdfW7vH3.mjs → job-CPKYCk_e.mjs} +3 -2
  39. package/dist/{job-DdfW7vH3.mjs.map → job-CPKYCk_e.mjs.map} +1 -1
  40. package/dist/kysely/index.d.mts +1 -0
  41. package/dist/kysely/index.mjs +2 -1
  42. package/dist/kysely/index.mjs.map +1 -1
  43. package/dist/{kysely-type-B_IecdK9.mjs → kysely-type-t5MbP7iJ.mjs} +3 -1
  44. package/dist/{kysely-type-B_IecdK9.mjs.map → kysely-type-t5MbP7iJ.mjs.map} +1 -1
  45. package/dist/{logger-CqezTedh.mjs → logger-qz-Y4sBV.mjs} +2 -1
  46. package/dist/{logger-CqezTedh.mjs.map → logger-qz-Y4sBV.mjs.map} +1 -1
  47. package/dist/package-json-88x7bPKC.mjs +5 -0
  48. package/dist/{package-json-D3x2nBPB.mjs → package-json-VqyFvGiP.mjs} +2 -1
  49. package/dist/{package-json-D3x2nBPB.mjs.map → package-json-VqyFvGiP.mjs.map} +1 -1
  50. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -1
  51. package/dist/plugin/builtin/enum-constants/index.mjs +3 -2
  52. package/dist/plugin/builtin/file-utils/index.d.mts +2 -1
  53. package/dist/plugin/builtin/file-utils/index.mjs +3 -2
  54. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -1
  55. package/dist/plugin/builtin/kysely-type/index.mjs +3 -2
  56. package/dist/plugin/builtin/seed/index.d.mts +2 -1
  57. package/dist/plugin/builtin/seed/index.mjs +3 -2
  58. package/dist/plugin/index.d.mts +3 -2
  59. package/dist/plugin/index.mjs +2 -1
  60. package/dist/plugin/index.mjs.map +1 -1
  61. package/dist/{plugin-DyVYXZWz.d.mts → plugin-BC7WQrjm.d.mts} +25 -13
  62. package/dist/{runtime-DbX_UxlC.mjs → runtime-3P9JFpe9.mjs} +1036 -321
  63. package/dist/runtime-3P9JFpe9.mjs.map +1 -0
  64. package/dist/{schema-CNWt2FKQ.mjs → schema-D27cW0Ca.mjs} +4 -2
  65. package/dist/{schema-CNWt2FKQ.mjs.map → schema-D27cW0Ca.mjs.map} +1 -1
  66. package/dist/seed/index.d.mts +1 -0
  67. package/dist/seed/index.mjs +2 -1
  68. package/dist/seed/index.mjs.map +1 -1
  69. package/dist/{seed-CWkIDWMb.mjs → seed-DtYgudLq.mjs} +12 -3
  70. package/dist/seed-DtYgudLq.mjs.map +1 -0
  71. package/dist/{telemetry-BSUlYTs-.mjs → telemetry-B4sp-dD2.mjs} +3 -2
  72. package/dist/{telemetry-BSUlYTs-.mjs.map → telemetry-B4sp-dD2.mjs.map} +1 -1
  73. package/dist/telemetry-DXIGGa6A.mjs +5 -0
  74. package/dist/utils/test/index.d.mts +3 -2
  75. package/dist/utils/test/index.mjs +4 -3
  76. package/dist/utils/test/index.mjs.map +1 -1
  77. package/dist/{workflow.generated-DMQ-cjyT.d.mts → workflow.generated-Cd5dsFnf.d.mts} +3 -2
  78. package/docs/cli/application.md +17 -0
  79. package/docs/generator/builtin.md +0 -8
  80. package/docs/services/executor.md +54 -0
  81. package/package.json +18 -17
  82. package/dist/application-B8vok3w2.mjs.map +0 -1
  83. package/dist/application-DHifc-oA.mjs +0 -11
  84. package/dist/crash-report-BMEhRxeg.mjs +0 -6
  85. package/dist/package-json-DiZWrkIA.mjs +0 -4
  86. package/dist/runtime-DbX_UxlC.mjs.map +0 -1
  87. package/dist/seed-CWkIDWMb.mjs.map +0 -1
  88. package/dist/telemetry-BtN2l0f1.mjs +0 -4
@@ -0,0 +1,12 @@
1
+
2
+ import "./chunk-COzJYswC.mjs";
3
+ import "./brand-0SscafcY.mjs";
4
+ import "./logger-qz-Y4sBV.mjs";
5
+ import "./client-D5P1myz0.mjs";
6
+ import "./package-json-VqyFvGiP.mjs";
7
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-CfAom-vi.mjs";
8
+ import "./seed-DtYgudLq.mjs";
9
+ import "./file-utils-B7xME5IK.mjs";
10
+ import "./kysely-type-t5MbP7iJ.mjs";
11
+
12
+ export { defineApplication };
@@ -1,3 +1,4 @@
1
+
1
2
  //#region src/utils/brand.ts
2
3
  const SDK_BRAND = Symbol.for("tailor-platform/sdk");
3
4
  /**
@@ -33,4 +34,4 @@ function isSdkBranded(value, kind) {
33
34
 
34
35
  //#endregion
35
36
  export { isSdkBranded as n, brandValue as t };
36
- //# sourceMappingURL=brand-GZnI4eYb.mjs.map
37
+ //# sourceMappingURL=brand-0SscafcY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"brand-GZnI4eYb.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind = \"tailordb-type\" | \"resolver\" | \"executor\" | \"workflow\" | \"workflow-job\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";AAEA,MAAa,YAA2B,OAAO,IAAI,sBAAsB;;;;;;;;;AAYzE,SAAgB,WAA6B,OAAU,MAAuB;AAC5E,QAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;EACX,CAAC;AACF,QAAO;;;;;;;;;;AAWT,SAAgB,aACd,OACA,MACS;AACT,KAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,OAAQ,QAAO;CACjF,MAAM,SAAU,MAAkC;AAElD,QACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,KAAK,GAAG,KAAK,SAAS,OAAuB,GAAG,WAAW"}
1
+ {"version":3,"file":"brand-0SscafcY.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind = \"tailordb-type\" | \"resolver\" | \"executor\" | \"workflow\" | \"workflow-job\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";;AAEA,MAAa,YAA2B,OAAO,IAAI,sBAAsB;;;;;;;;;AAYzE,SAAgB,WAA6B,OAAU,MAAuB;AAC5E,QAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;EACX,CAAC;AACF,QAAO;;;;;;;;;;AAWT,SAAgB,aACd,OACA,MACS;AACT,KAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,OAAQ,QAAO;CACjF,MAAM,SAAU,MAAkC;AAElD,QACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,KAAK,GAAG,KAAK,SAAS,OAAuB,GAAG,WAAW"}
@@ -1,3 +1,4 @@
1
+
1
2
  import { createRequire } from "node:module";
2
3
 
3
4
  //#region \0rolldown/runtime.js
@@ -1,3 +1,4 @@
1
+ /// <reference types="@tailor-platform/function-types" />
1
2
  import * as politty from "politty";
2
3
 
3
4
  //#region src/cli/index.d.ts
@@ -1,17 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import "../chunk-DEt8GZDa.mjs";
3
- import "../schema-CNWt2FKQ.mjs";
4
- import "../brand-GZnI4eYb.mjs";
5
- import { n as logger, r as styles } from "../logger-CqezTedh.mjs";
6
- import { At as functionExecutionStatusToString, B as updateCommand$3, Ct as startCommand, D as resumeCommand, Dt as executionsCommand, E as healthCommand, Ft as executeScript, I as showCommand, J as updateCommand$2, Jt as formatMigrationNumber, K as getCommand$4, L as logBetaWarning, M as truncateCommand, Mt as getCommand$1, P as generateCommand$1, Pt as apply, Q as getCommand$3, Qt as getMigrationFiles, Rt as parseMigrationLabelNumber, Tt as getCommand$5, U as treeCommand, W as listCommand$10, X as listCommand$9, Zt as getMigrationFilePath, _ as getCommand$6, _n as isVerbose, _t as listCommand$6, a as updateCommand$4, bt as jobsCommand, cn as sdkNameLabelKey, d as inviteCommand, en as isValidMigrationNumber, et as deleteCommand$3, fn as apiCommand, ft as generate, gn as deploymentArgs, h as listCommand$14, hn as confirmationArgs, ht as triggerCommand, i as isCLIError, it as listCommand$8, jt as formatKeyValueTable, k as listCommand$11, l as listCommand$13, ln as trnPrefix, lt as tokenCommand, mn as commonArgs, mt as webhookCommand, nt as createCommand$3, on as getNamespacesWithMigrations, ot as getCommand$2, p as restoreCommand, pn as defineAppCommand, r as queryCommand, s as removeCommand, sn as prompt, t as isNativeTypeScriptRuntime, tn as loadDiff, ut as listCommand$7, vn as workspaceArgs, w as listCommand$12, x as createCommand$4, y as deleteCommand$4, z as removeCommand$1 } from "../runtime-DbX_UxlC.mjs";
7
- import { B as PATScope, D as FunctionExecution_Type, N as AuthInvokerSchema, i as fetchAll, l as initOAuth2Client, m as userAgent, n as closeConnectionPool, o as fetchPlatformMachineUserToken, s as fetchUserInfo, u as initOperatorClient } from "../client-DfdgRZlQ.mjs";
8
- import { t as readPackageJson } from "../package-json-D3x2nBPB.mjs";
9
- import { C as resolveTokens, S as readPlatformConfig, T as writePlatformConfig, a as loadConfig, b as loadAccessToken, c as ExecutorSchema, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, u as ResolverSchema, v as deleteUserTokens, w as saveUserTokens, x as loadWorkspaceId, y as fetchLatestToken } from "../application-B8vok3w2.mjs";
10
- import "../seed-CWkIDWMb.mjs";
11
- import "../file-utils-Bctuzn3x.mjs";
12
- import "../kysely-type-B_IecdK9.mjs";
13
- import "../telemetry-BSUlYTs-.mjs";
14
- import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-wNxS0IUJ.mjs";
2
+
3
+ import "../chunk-COzJYswC.mjs";
4
+ import "../schema-D27cW0Ca.mjs";
5
+ import "../brand-0SscafcY.mjs";
6
+ import { n as logger, r as styles } from "../logger-qz-Y4sBV.mjs";
7
+ import { At as functionExecutionStatusToString, B as updateCommand$3, Ct as startCommand, D as resumeCommand, Dt as executionsCommand, E as healthCommand, Ft as executeScript, I as showCommand, J as updateCommand$2, Jt as formatMigrationNumber, K as getCommand$4, L as logBetaWarning, M as truncateCommand, Mt as getCommand$1, P as generateCommand$1, Pt as apply, Q as getCommand$3, Qt as getMigrationFiles, Rt as parseMigrationLabelNumber, Tt as getCommand$5, U as treeCommand, W as listCommand$10, X as listCommand$9, Zt as getMigrationFilePath, _ as getCommand$6, _n as isVerbose, _t as listCommand$6, a as updateCommand$4, bt as jobsCommand, cn as sdkNameLabelKey, d as inviteCommand, en as isValidMigrationNumber, et as deleteCommand$3, fn as apiCommand, ft as generate, gn as deploymentArgs, h as listCommand$14, hn as confirmationArgs, ht as triggerCommand, i as isCLIError, it as listCommand$8, jt as formatKeyValueTable, k as listCommand$11, l as listCommand$13, ln as trnPrefix, lt as tokenCommand, mn as commonArgs, mt as webhookCommand, nt as createCommand$3, on as getNamespacesWithMigrations, ot as getCommand$2, p as restoreCommand, pn as defineAppCommand, r as queryCommand, s as removeCommand, sn as prompt, t as isNativeTypeScriptRuntime, tn as loadDiff, ut as listCommand$7, vn as workspaceArgs, w as listCommand$12, x as createCommand$4, y as deleteCommand$4, z as removeCommand$1 } from "../runtime-3P9JFpe9.mjs";
8
+ import { B as PATScope, D as FunctionExecution_Type, N as AuthInvokerSchema, i as fetchAll, l as initOAuth2Client, m as userAgent, n as closeConnectionPool, o as fetchPlatformMachineUserToken, s as fetchUserInfo, u as initOperatorClient } from "../client-D5P1myz0.mjs";
9
+ import { t as readPackageJson } from "../package-json-VqyFvGiP.mjs";
10
+ import { C as resolveTokens, S as readPlatformConfig, T as writePlatformConfig, a as loadConfig, b as loadAccessToken, c as ExecutorSchema, g as getDistDir, i as resolveInlineSourcemap, o as WorkflowJobSchema, u as ResolverSchema, v as deleteUserTokens, w as saveUserTokens, x as loadWorkspaceId, y as fetchLatestToken } from "../application-CfAom-vi.mjs";
11
+ import "../seed-DtYgudLq.mjs";
12
+ import "../file-utils-B7xME5IK.mjs";
13
+ import "../kysely-type-t5MbP7iJ.mjs";
14
+ import "../telemetry-B4sp-dD2.mjs";
15
+ import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crash-report-DnwITWeV.mjs";
15
16
  import { createRequire } from "node:module";
16
17
  import { arg, defineCommand, runCommand, runMain } from "politty";
17
18
  import { withCompletionCommand } from "politty/completion";
@@ -51,7 +52,7 @@ const applyCommand = defineAppCommand({
51
52
  "clean-cache": arg(z.boolean().optional(), { description: "Clean the bundle cache before building" })
52
53
  }).strict(),
53
54
  run: async (args) => {
54
- const { initTelemetry } = await import("../telemetry-BtN2l0f1.mjs");
55
+ const { initTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
55
56
  await initTelemetry();
56
57
  await apply({
57
58
  workspaceId: args["workspace-id"],
@@ -803,7 +804,7 @@ const generateCommand = defineAppCommand({
803
804
  })
804
805
  }).strict(),
805
806
  run: async (args) => {
806
- const { initTelemetry } = await import("../telemetry-BtN2l0f1.mjs");
807
+ const { initTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
807
808
  await initTelemetry();
808
809
  await generate({
809
810
  configPath: args.config,
@@ -1284,7 +1285,7 @@ async function checkVaultManaged(params) {
1284
1285
  existingLabels: {}
1285
1286
  };
1286
1287
  let owner;
1287
- let allLabels = {};
1288
+ let allLabels;
1288
1289
  try {
1289
1290
  const { metadata } = await client.getMetadata({ trn });
1290
1291
  allLabels = metadata?.labels ?? {};
@@ -1304,9 +1305,9 @@ async function checkVaultManaged(params) {
1304
1305
  * Release ownership of a managed vault by removing SDK labels from metadata.
1305
1306
  * Call this after the user has confirmed they want to proceed with a CLI operation on a managed vault.
1306
1307
  * @param params - Client, TRN, and existing labels from checkVaultManaged result
1307
- * @param params.client
1308
- * @param params.trn
1309
- * @param params.existingLabels
1308
+ * @param params.client - Operator client used to update vault metadata
1309
+ * @param params.trn - TRN of the vault resource
1310
+ * @param params.existingLabels - Existing metadata labels on the vault before release
1310
1311
  */
1311
1312
  async function releaseVaultOwnership(params) {
1312
1313
  const { client, trn, existingLabels } = params;
@@ -1357,8 +1358,8 @@ const createSecretCommand = defineAppCommand({
1357
1358
  });
1358
1359
  } catch (error) {
1359
1360
  if (error instanceof ConnectError) {
1360
- if (error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`);
1361
- if (error.code === Code.AlreadyExists) throw new Error(`Secret "${args.name}" already exists.`);
1361
+ if (error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`, { cause: error });
1362
+ if (error.code === Code.AlreadyExists) throw new Error(`Secret "${args.name}" already exists.`, { cause: error });
1362
1363
  }
1363
1364
  throw error;
1364
1365
  }
@@ -1407,7 +1408,7 @@ const deleteSecretCommand = defineAppCommand({
1407
1408
  secretmanagerSecretName: args.name
1408
1409
  });
1409
1410
  } catch (error) {
1410
- if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`);
1411
+ if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`, { cause: error });
1411
1412
  throw error;
1412
1413
  }
1413
1414
  if (managed.isManaged) await releaseVaultOwnership({
@@ -1467,7 +1468,7 @@ const listSecretCommand = defineAppCommand({
1467
1468
  });
1468
1469
  logger.out(secrets);
1469
1470
  } catch (error) {
1470
- if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`);
1471
+ if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args["vault-name"]}" not found.`, { cause: error });
1471
1472
  throw error;
1472
1473
  }
1473
1474
  }
@@ -1511,7 +1512,7 @@ const updateSecretCommand = defineAppCommand({
1511
1512
  secretmanagerSecretValue: args.value
1512
1513
  });
1513
1514
  } catch (error) {
1514
- if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`);
1515
+ if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Secret "${args.name}" not found in vault "${args["vault-name"]}".`, { cause: error });
1515
1516
  throw error;
1516
1517
  }
1517
1518
  if (managed.isManaged) await releaseVaultOwnership({
@@ -1553,7 +1554,7 @@ const createCommand$1 = defineAppCommand({
1553
1554
  secretmanagerVaultName: args.name
1554
1555
  });
1555
1556
  } catch (error) {
1556
- if (error instanceof ConnectError && error.code === Code.AlreadyExists) throw new Error(`Vault "${args.name}" already exists.`);
1557
+ if (error instanceof ConnectError && error.code === Code.AlreadyExists) throw new Error(`Vault "${args.name}" already exists.`, { cause: error });
1557
1558
  throw error;
1558
1559
  }
1559
1560
  logger.success(`Vault: ${args.name} created`);
@@ -1596,7 +1597,7 @@ const deleteCommand$1 = defineAppCommand({
1596
1597
  secretmanagerVaultName: args.name
1597
1598
  });
1598
1599
  } catch (error) {
1599
- if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args.name}" not found.`);
1600
+ if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(`Vault "${args.name}" not found.`, { cause: error });
1600
1601
  throw error;
1601
1602
  }
1602
1603
  if (managed.isManaged) logger.info("Remove this vault from defineSecretManager() in your config to prevent the next apply from re-creating it.");
@@ -2065,7 +2066,7 @@ const getCommand = defineAppCommand({
2065
2066
  };
2066
2067
  logger.out(info);
2067
2068
  } catch (error) {
2068
- if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(notFoundErrorMessage);
2069
+ if (error instanceof ConnectError && error.code === Code.NotFound) throw new Error(notFoundErrorMessage, { cause: error });
2069
2070
  throw error;
2070
2071
  }
2071
2072
  }
@@ -3243,11 +3244,11 @@ runMain(mainCommand, {
3243
3244
  if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
3244
3245
  } else logger.error(`Unknown error: ${error}`);
3245
3246
  if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
3246
- const { reportCrash } = await import("../crash-report-BMEhRxeg.mjs");
3247
+ const { reportCrash } = await import("../crash-report-Cm9vFmTN.mjs");
3247
3248
  await reportCrash(error, "handledError");
3248
3249
  }
3249
3250
  }
3250
- const { shutdownTelemetry } = await import("../telemetry-BtN2l0f1.mjs");
3251
+ const { shutdownTelemetry } = await import("../telemetry-DXIGGa6A.mjs");
3251
3252
  await shutdownTelemetry();
3252
3253
  }
3253
3254
  });