@tailor-platform/sdk 1.19.0 → 1.20.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 (42) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{application-A6PZjujv.mjs → application-Bli2ieqY.mjs} +97952 -97659
  3. package/dist/application-Bli2ieqY.mjs.map +1 -0
  4. package/dist/{application-nPS5veK6.mjs → application-CZdieD3K.mjs} +2 -2
  5. package/dist/cli/index.mjs +117 -62
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +116 -58
  8. package/dist/cli/lib.mjs +6 -6
  9. package/dist/cli/lib.mjs.map +1 -1
  10. package/dist/cli/skills.mjs +1 -1
  11. package/dist/cli/skills.mjs.map +1 -1
  12. package/dist/configure/index.d.mts +4 -4
  13. package/dist/configure/index.mjs.map +1 -1
  14. package/dist/{index-B91ZpOcd.d.mts → index-B86CIKCW.d.mts} +2 -2
  15. package/dist/{index-B6pvy1MK.d.mts → index-CGjiOz_W.d.mts} +2 -2
  16. package/dist/{index-CPzbMghQ.d.mts → index-CIXOwe6g.d.mts} +2 -2
  17. package/dist/{index-ClLZCbcm.d.mts → index-DcY0e3S5.d.mts} +4 -43
  18. package/dist/{index-DDqKNFh4.d.mts → index-i6QUsr5p.d.mts} +2 -2
  19. package/dist/{package-json-DUY2kB6z.mjs → package-json-3H5gfhA4.mjs} +2 -2
  20. package/dist/package-json-3H5gfhA4.mjs.map +1 -0
  21. package/dist/package-json-DTDAqRRJ.mjs +3 -0
  22. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -2
  23. package/dist/plugin/builtin/file-utils/index.d.mts +2 -2
  24. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -2
  25. package/dist/plugin/builtin/seed/index.d.mts +2 -2
  26. package/dist/plugin/index.d.mts +1 -1
  27. package/dist/telemetry-Dhzj9Ncm.mjs +3 -0
  28. package/dist/{telemetry-rFq0QdvJ.mjs → telemetry-DuBhnd0X.mjs} +2 -2
  29. package/dist/telemetry-DuBhnd0X.mjs.map +1 -0
  30. package/dist/{types-CJF3Y1x8.d.mts → types-C14GuyPI.d.mts} +87 -3
  31. package/dist/{types-CblXasFV.d.mts → types-CNw4p8V7.d.mts} +2 -2
  32. package/dist/{update-Cr5c7h1r.mjs → update-DkpWgrzL.mjs} +338 -160
  33. package/dist/update-DkpWgrzL.mjs.map +1 -0
  34. package/dist/utils/test/index.d.mts +3 -3
  35. package/docs/cli/application.md +2 -0
  36. package/package.json +1 -1
  37. package/dist/application-A6PZjujv.mjs.map +0 -1
  38. package/dist/package-json-DUY2kB6z.mjs.map +0 -1
  39. package/dist/package-json-Dd1AnA5F.mjs +0 -3
  40. package/dist/telemetry-9A1BZqbl.mjs +0 -3
  41. package/dist/telemetry-rFq0QdvJ.mjs.map +0 -1
  42. package/dist/update-Cr5c7h1r.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { t as db } from "./schema-D5Cpd8fQ.mjs";
2
- import { $ as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, A as TailorDBGQLPermission_Operator, B as ExecutorTargetType, C as platformBaseUrl, D as WorkflowExecution_Status, E as WorkspacePlatformUserRole, F as PipelineResolver_OperationType, G as AuthOAuth2Client_GrantType, H as AuthIDPConfig_AuthType, I as IdPLang, J as AuthSCIMAttribute_Uniqueness, K as AuthSCIMAttribute_Mutability, L as FunctionExecution_Status, M as TailorDBType_Permission_Operator, N as TailorDBType_Permission_Permit, O as WorkflowJobExecution_Status, P as TailorDBType_PermitAction, Q as UserProfileProviderConfig_UserProfileProviderType, S as initOperatorClient, T as userAgent, U as AuthInvokerSchema, V as ExecutorTriggerType, W as AuthOAuth2Client_ClientType, Y as AuthSCIMConfig_AuthorizationType, Z as TenantProviderConfig_TenantProviderType, _ as writePlatformConfig, a as buildExecutorArgsExpr, at as Subgraph_ServiceType, c as createExecutorService, ct as symbols, et as ConditionSchema, f as loadAccessToken, g as readPlatformConfig, h as loadWorkspaceId, i as loadConfig, it as ApplicationSchemaUpdateAttemptStatus, j as TailorDBGQLPermission_Permit, k as TailorDBGQLPermission_Action, l as OAuth2ClientSchema, m as loadOrganizationId, n as generatePluginFilesIfNeeded, nt as FilterSchema, o as buildResolverOperationHookExpr, ot as logger, p as loadFolderId, q as AuthSCIMAttribute_Type, r as loadApplication, rt as PageDirection, s as getDistDir, st as styles, t as defineApplication, tt as Condition_Operator, u as stringifyFunction, v as fetchAll, w as resolveStaticWebsiteUrls, y as fetchMachineUserToken, z as ExecutorJobStatus } from "./application-A6PZjujv.mjs";
3
- import { t as readPackageJson } from "./package-json-DUY2kB6z.mjs";
4
- import { r as withSpan } from "./telemetry-rFq0QdvJ.mjs";
2
+ import { $ as TenantProviderConfig_TenantProviderType, A as WorkflowJobExecution_Status, D as userAgent, E as resolveStaticWebsiteUrls, F as TailorDBType_Permission_Permit, G as AuthInvokerSchema, H as ExecutorTargetType, I as TailorDBType_PermitAction, J as AuthSCIMAttribute_Mutability, K as AuthOAuth2Client_ClientType, L as PipelineResolver_OperationType, M as TailorDBGQLPermission_Operator, N as TailorDBGQLPermission_Permit, O as WorkspacePlatformUserRole, P as TailorDBType_Permission_Operator, R as IdPLang, T as platformBaseUrl, U as ExecutorTriggerType, V as ExecutorJobStatus, W as AuthIDPConfig_AuthType, X as AuthSCIMAttribute_Uniqueness, Y as AuthSCIMAttribute_Type, Z as AuthSCIMConfig_AuthorizationType, _ as loadWorkspaceId, a as buildExecutorArgsExpr, at as PageDirection, b as fetchAll, c as OAuth2ClientSchema, ct as logger, d as getDistDir, et as UserProfileProviderConfig_UserProfileProviderType, f as hashFile, g as loadOrganizationId, h as loadFolderId, i as loadConfig, it as FilterSchema, j as TailorDBGQLPermission_Action, k as WorkflowExecution_Status, l as stringifyFunction, lt as styles, m as loadAccessToken, n as generatePluginFilesIfNeeded, nt as ConditionSchema, o as buildResolverOperationHookExpr, ot as ApplicationSchemaUpdateAttemptStatus, q as AuthOAuth2Client_GrantType, r as loadApplication, rt as Condition_Operator, s as createExecutorService, st as Subgraph_ServiceType, t as defineApplication, tt as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, u as createBundleCache, ut as symbols, v as readPlatformConfig, w as initOperatorClient, x as fetchMachineUserToken, y as writePlatformConfig, z as FunctionExecution_Status } from "./application-Bli2ieqY.mjs";
3
+ import { t as readPackageJson } from "./package-json-3H5gfhA4.mjs";
4
+ import { r as withSpan } from "./telemetry-DuBhnd0X.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import { arg, defineCommand, runCommand } from "politty";
7
7
  import { z } from "zod";
@@ -14,20 +14,21 @@ import { getBorderCharacters, table } from "table";
14
14
  import { ValueSchema, timestampDate } from "@bufbuild/protobuf/wkt";
15
15
  import { Code, ConnectError } from "@connectrpc/connect";
16
16
  import { resolveTSConfig } from "pkg-types";
17
+ import { findUpSync } from "find-up-simple";
17
18
  import ml from "multiline-ts";
19
+ import * as crypto from "node:crypto";
18
20
  import * as inflection from "inflection";
19
21
  import * as fs$1 from "node:fs/promises";
20
22
  import { glob } from "node:fs/promises";
21
23
  import * as rolldown from "rolldown";
22
24
  import { create, fromJson, toJson } from "@bufbuild/protobuf";
23
- import * as crypto from "node:crypto";
24
25
  import ora from "ora";
25
26
  import { setTimeout as setTimeout$1 } from "timers/promises";
26
27
  import { spawn } from "node:child_process";
27
28
  import { watch } from "chokidar";
28
29
  import * as madgeModule from "madge";
29
30
 
30
- //#region src/cli/utils/errors.ts
31
+ //#region src/cli/shared/errors.ts
31
32
  /**
32
33
  * Type guard to check if an error is a CLIError
33
34
  * @param error - Error to check
@@ -38,7 +39,7 @@ function isCLIError(error) {
38
39
  }
39
40
 
40
41
  //#endregion
41
- //#region src/cli/args.ts
42
+ //#region src/cli/shared/args.ts
42
43
  const unitToMs = {
43
44
  ms: 1,
44
45
  s: 1e3,
@@ -161,7 +162,7 @@ const withCommonArgs = (handler) => async (args) => {
161
162
  try {
162
163
  if ("json" in args && typeof args.json === "boolean") logger.jsonMode = args.json;
163
164
  loadEnvFiles(args["env-file"], args["env-file-if-exists"]);
164
- const { initTelemetry } = await import("./telemetry-9A1BZqbl.mjs");
165
+ const { initTelemetry } = await import("./telemetry-Dhzj9Ncm.mjs");
165
166
  await initTelemetry();
166
167
  await handler(args);
167
168
  } catch (error) {
@@ -174,14 +175,14 @@ const withCommonArgs = (handler) => async (args) => {
174
175
  } else logger.error(`Unknown error: ${error}`);
175
176
  process.exit(1);
176
177
  } finally {
177
- const { shutdownTelemetry } = await import("./telemetry-9A1BZqbl.mjs");
178
+ const { shutdownTelemetry } = await import("./telemetry-Dhzj9Ncm.mjs");
178
179
  await shutdownTelemetry();
179
180
  }
180
181
  process.exit(0);
181
182
  };
182
183
 
183
184
  //#endregion
184
- //#region src/cli/api.ts
185
+ //#region src/cli/commands/api.ts
185
186
  /**
186
187
  * Call Tailor Platform API endpoints directly.
187
188
  * If the endpoint doesn't contain "/", it defaults to `tailor.v1.OperatorService/{endpoint}`.
@@ -241,7 +242,190 @@ const apiCommand = defineCommand({
241
242
  });
242
243
 
243
244
  //#endregion
244
- //#region src/cli/type-generator.ts
245
+ //#region src/cli/cache/types.ts
246
+ const cacheOutputFileSchema = z.object({
247
+ outputPath: z.string(),
248
+ contentHash: z.string()
249
+ });
250
+ const cacheEntrySchema = z.object({
251
+ kind: z.literal("bundle"),
252
+ inputHash: z.string(),
253
+ dependencyPaths: z.array(z.string()),
254
+ outputFiles: z.array(cacheOutputFileSchema),
255
+ createdAt: z.string()
256
+ });
257
+ const cacheManifestSchema = z.object({
258
+ version: z.literal(1),
259
+ sdkVersion: z.string(),
260
+ lockfileHash: z.string().optional(),
261
+ entries: z.record(z.string(), cacheEntrySchema)
262
+ });
263
+
264
+ //#endregion
265
+ //#region src/cli/cache/store.ts
266
+ const MANIFEST_FILENAME = "manifest.json";
267
+ const BUNDLES_DIR = "bundles";
268
+ /**
269
+ * Create a cache store for manifest persistence and bundle output storage.
270
+ * @param config - Cache configuration specifying the cache directory
271
+ * @returns A CacheStore instance
272
+ */
273
+ function createCacheStore(config) {
274
+ let cachedManifest = null;
275
+ function manifestPath() {
276
+ return path.join(config.cacheDir, MANIFEST_FILENAME);
277
+ }
278
+ function bundlesDir() {
279
+ return path.join(config.cacheDir, BUNDLES_DIR);
280
+ }
281
+ function bundlePath(cacheKey) {
282
+ return path.join(bundlesDir(), `${cacheKey.replaceAll(":", "_")}.js`);
283
+ }
284
+ function loadManifest() {
285
+ try {
286
+ const raw = fs$2.readFileSync(manifestPath(), "utf-8");
287
+ const result = cacheManifestSchema.safeParse(JSON.parse(raw));
288
+ if (!result.success) {
289
+ cachedManifest = void 0;
290
+ return;
291
+ }
292
+ cachedManifest = result.data;
293
+ return cachedManifest;
294
+ } catch {
295
+ cachedManifest = void 0;
296
+ return;
297
+ }
298
+ }
299
+ function getCurrentManifest() {
300
+ if (cachedManifest === null) loadManifest();
301
+ return cachedManifest ?? void 0;
302
+ }
303
+ function ensureManifestLoaded() {
304
+ if (cachedManifest === null) loadManifest();
305
+ if (cachedManifest == null) cachedManifest = {
306
+ version: 1,
307
+ sdkVersion: "",
308
+ entries: {}
309
+ };
310
+ return cachedManifest;
311
+ }
312
+ function saveManifest(manifest) {
313
+ fs$2.mkdirSync(config.cacheDir, { recursive: true });
314
+ const target = manifestPath();
315
+ const tmpFile = path.join(config.cacheDir, `.manifest.${process.pid}.tmp`);
316
+ try {
317
+ fs$2.writeFileSync(tmpFile, JSON.stringify(manifest, null, 2), "utf-8");
318
+ fs$2.renameSync(tmpFile, target);
319
+ } catch (e) {
320
+ try {
321
+ fs$2.rmSync(tmpFile, { force: true });
322
+ } catch {}
323
+ throw e;
324
+ }
325
+ cachedManifest = manifest;
326
+ }
327
+ function getEntry(key) {
328
+ return ensureManifestLoaded().entries[key];
329
+ }
330
+ function setEntry(key, entry) {
331
+ const manifest = ensureManifestLoaded();
332
+ manifest.entries[key] = entry;
333
+ }
334
+ function deleteEntry(key) {
335
+ const manifest = ensureManifestLoaded();
336
+ delete manifest.entries[key];
337
+ }
338
+ function storeBundleOutput(cacheKey, sourcePath) {
339
+ const dir = bundlesDir();
340
+ fs$2.mkdirSync(dir, { recursive: true });
341
+ fs$2.copyFileSync(sourcePath, bundlePath(cacheKey));
342
+ const mapSource = `${sourcePath}.map`;
343
+ const cachedMapPath = `${bundlePath(cacheKey)}.map`;
344
+ if (fs$2.existsSync(mapSource)) fs$2.copyFileSync(mapSource, cachedMapPath);
345
+ else fs$2.rmSync(cachedMapPath, { force: true });
346
+ }
347
+ function restoreBundleOutput(cacheKey, targetPath) {
348
+ const cached = bundlePath(cacheKey);
349
+ const targetDir = path.dirname(targetPath);
350
+ fs$2.mkdirSync(targetDir, { recursive: true });
351
+ try {
352
+ fs$2.copyFileSync(cached, targetPath);
353
+ } catch (e) {
354
+ if (e.code === "ENOENT") return false;
355
+ throw e;
356
+ }
357
+ const cachedMap = `${cached}.map`;
358
+ if (fs$2.existsSync(cachedMap)) fs$2.copyFileSync(cachedMap, `${targetPath}.map`);
359
+ return true;
360
+ }
361
+ function clean() {
362
+ fs$2.rmSync(config.cacheDir, {
363
+ recursive: true,
364
+ force: true
365
+ });
366
+ cachedManifest = null;
367
+ }
368
+ return {
369
+ loadManifest,
370
+ getCurrentManifest,
371
+ saveManifest,
372
+ getEntry,
373
+ setEntry,
374
+ deleteEntry,
375
+ storeBundleOutput,
376
+ restoreBundleOutput,
377
+ clean
378
+ };
379
+ }
380
+
381
+ //#endregion
382
+ //#region src/cli/cache/manager.ts
383
+ /**
384
+ * Create a CacheManager that orchestrates cache operations.
385
+ * @param options - Configuration for the cache manager
386
+ * @returns A CacheManager instance
387
+ */
388
+ function createCacheManager(options) {
389
+ if (!(options.enabled ?? true)) return {
390
+ enabled: false,
391
+ bundleCache: {
392
+ tryRestore() {
393
+ return false;
394
+ },
395
+ save() {}
396
+ },
397
+ finalize() {}
398
+ };
399
+ const store = createCacheStore({ cacheDir: options.cacheDir ?? path.resolve(getDistDir(), "cache") });
400
+ const existingManifest = store.loadManifest();
401
+ if (existingManifest) {
402
+ if (existingManifest.sdkVersion !== options.sdkVersion) {
403
+ logger.debug(`Cache invalidated: SDK version changed from ${existingManifest.sdkVersion} to ${options.sdkVersion}`);
404
+ store.clean();
405
+ } else if (existingManifest.lockfileHash !== options.lockfileHash) {
406
+ logger.debug("Cache invalidated: lockfile changed");
407
+ store.clean();
408
+ }
409
+ }
410
+ return {
411
+ enabled: true,
412
+ bundleCache: createBundleCache(store),
413
+ finalize() {
414
+ const manifest = store.getCurrentManifest() ?? {
415
+ version: 1,
416
+ sdkVersion: options.sdkVersion,
417
+ lockfileHash: options.lockfileHash,
418
+ entries: {}
419
+ };
420
+ manifest.sdkVersion = options.sdkVersion;
421
+ manifest.lockfileHash = options.lockfileHash;
422
+ store.saveManifest(manifest);
423
+ }
424
+ };
425
+ }
426
+
427
+ //#endregion
428
+ //#region src/cli/shared/type-generator.ts
245
429
  /**
246
430
  * Extract attribute definitions from the app config for user-defined typing.
247
431
  * @param config - Application config to inspect
@@ -696,38 +880,7 @@ function copyMetadataToExtendedType(original, extended) {
696
880
  }
697
881
 
698
882
  //#endregion
699
- //#region src/cli/apply/services/label.ts
700
- /**
701
- * Build TRN prefix for a workspace.
702
- * @param workspaceId - Workspace ID
703
- * @returns TRN prefix string
704
- */
705
- function trnPrefix(workspaceId) {
706
- return `trn:v1:workspace:${workspaceId}`;
707
- }
708
- const sdkNameLabelKey = "sdk-name";
709
- /**
710
- * Build metadata request with SDK labels.
711
- * @param trn - Target TRN
712
- * @param appName - Application name label
713
- * @param existingLabels - Existing labels to preserve (optional)
714
- * @returns Metadata request
715
- */
716
- async function buildMetaRequest(trn$7, appName, existingLabels) {
717
- const packageJson = await readPackageJson();
718
- const sdkVersion = packageJson.version ? `v${packageJson.version.replace(/\./g, "-")}` : "unknown";
719
- return {
720
- trn: trn$7,
721
- labels: {
722
- ...existingLabels ?? {},
723
- [sdkNameLabelKey]: appName,
724
- "sdk-version": sdkVersion
725
- }
726
- };
727
- }
728
-
729
- //#endregion
730
- //#region src/cli/apply/services/index.ts
883
+ //#region src/cli/commands/apply/change-set.ts
731
884
  /**
732
885
  * Create a new ChangeSet for tracking resource changes.
733
886
  * @param title - Title for the change set
@@ -758,7 +911,38 @@ function createChangeSet(title) {
758
911
  }
759
912
 
760
913
  //#endregion
761
- //#region src/cli/apply/services/application.ts
914
+ //#region src/cli/commands/apply/label.ts
915
+ /**
916
+ * Build TRN prefix for a workspace.
917
+ * @param workspaceId - Workspace ID
918
+ * @returns TRN prefix string
919
+ */
920
+ function trnPrefix(workspaceId) {
921
+ return `trn:v1:workspace:${workspaceId}`;
922
+ }
923
+ const sdkNameLabelKey = "sdk-name";
924
+ /**
925
+ * Build metadata request with SDK labels.
926
+ * @param trn - Target TRN
927
+ * @param appName - Application name label
928
+ * @param existingLabels - Existing labels to preserve (optional)
929
+ * @returns Metadata request
930
+ */
931
+ async function buildMetaRequest(trn$7, appName, existingLabels) {
932
+ const packageJson = await readPackageJson();
933
+ const sdkVersion = packageJson.version ? `v${packageJson.version.replace(/\./g, "-")}` : "unknown";
934
+ return {
935
+ trn: trn$7,
936
+ labels: {
937
+ ...existingLabels ?? {},
938
+ [sdkNameLabelKey]: appName,
939
+ "sdk-version": sdkVersion
940
+ }
941
+ };
942
+ }
943
+
944
+ //#endregion
945
+ //#region src/cli/commands/apply/application.ts
762
946
  /**
763
947
  * Apply application changes for the given phase.
764
948
  * @param client - Operator client instance
@@ -895,7 +1079,7 @@ function protoSubgraph(subgraph) {
895
1079
  }
896
1080
 
897
1081
  //#endregion
898
- //#region src/cli/apply/services/idp.ts
1082
+ //#region src/cli/commands/apply/idp.ts
899
1083
  /**
900
1084
  * Build the vault name for an IdP client.
901
1085
  * @param namespaceName - IdP namespace name
@@ -1066,7 +1250,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
1066
1250
  authorization,
1067
1251
  lang,
1068
1252
  userAuthPolicy,
1069
- publishUserEvents: idp.publishUserEvents
1253
+ publishUserEvents: idp.publishUserEvents,
1254
+ disableGqlOperations: convertGqlOperationsToDisable(idp.gqlOperations)
1070
1255
  },
1071
1256
  metaRequest
1072
1257
  });
@@ -1079,7 +1264,8 @@ async function planServices$3(client, workspaceId, appName, idps) {
1079
1264
  authorization,
1080
1265
  lang,
1081
1266
  userAuthPolicy,
1082
- publishUserEvents: idp.publishUserEvents
1267
+ publishUserEvents: idp.publishUserEvents,
1268
+ disableGqlOperations: convertGqlOperationsToDisable(idp.gqlOperations)
1083
1269
  },
1084
1270
  metaRequest
1085
1271
  });
@@ -1179,9 +1365,19 @@ function convertLang(lang) {
1179
1365
  default: return IdPLang.UNSPECIFIED;
1180
1366
  }
1181
1367
  }
1368
+ function convertGqlOperationsToDisable(gqlOperations) {
1369
+ if (!gqlOperations) return;
1370
+ return {
1371
+ create: gqlOperations.create === false,
1372
+ update: gqlOperations.update === false,
1373
+ delete: gqlOperations.delete === false,
1374
+ read: gqlOperations.read === false,
1375
+ sendPasswordResetEmail: gqlOperations.sendPasswordResetEmail === false
1376
+ };
1377
+ }
1182
1378
 
1183
1379
  //#endregion
1184
- //#region src/cli/apply/services/auth.ts
1380
+ //#region src/cli/commands/apply/auth.ts
1185
1381
  /**
1186
1382
  * Apply auth-related changes for the given phase.
1187
1383
  * @param client - Operator client instance
@@ -2072,7 +2268,7 @@ function protoSCIMAttribute(attr) {
2072
2268
  }
2073
2269
 
2074
2270
  //#endregion
2075
- //#region src/cli/apply/services/confirm.ts
2271
+ //#region src/cli/commands/apply/confirm.ts
2076
2272
  /**
2077
2273
  * Confirm reassignment of resources when owner conflicts are detected.
2078
2274
  * @param conflicts - Detected owner conflicts
@@ -2157,7 +2353,7 @@ async function confirmImportantResourceDeletion(resources, yes) {
2157
2353
  }
2158
2354
 
2159
2355
  //#endregion
2160
- //#region src/cli/apply/services/function-registry.ts
2356
+ //#region src/cli/commands/apply/function-registry.ts
2161
2357
  const CHUNK_SIZE = 64 * 1024;
2162
2358
  /**
2163
2359
  * Compute SHA-256 content hash for a script string.
@@ -2399,7 +2595,7 @@ async function applyFunctionRegistry(client, workspaceId, result, phase = "creat
2399
2595
  }
2400
2596
 
2401
2597
  //#endregion
2402
- //#region src/cli/apply/services/executor.ts
2598
+ //#region src/cli/commands/apply/executor.ts
2403
2599
  /**
2404
2600
  * Apply executor-related changes for the given phase.
2405
2601
  * @param client - Operator client instance
@@ -2658,7 +2854,7 @@ function protoExecutor(appName, executor, env) {
2658
2854
  }
2659
2855
 
2660
2856
  //#endregion
2661
- //#region src/cli/apply/services/resolver.ts
2857
+ //#region src/cli/commands/apply/resolver.ts
2662
2858
  const SCALAR_TYPE_MAP = {
2663
2859
  uuid: {
2664
2860
  kind: "ScalarType",
@@ -2952,7 +3148,7 @@ function protoFields(fields, baseName, isInput) {
2952
3148
  }
2953
3149
 
2954
3150
  //#endregion
2955
- //#region src/cli/apply/services/staticwebsite.ts
3151
+ //#region src/cli/commands/apply/staticwebsite.ts
2956
3152
  /**
2957
3153
  * Apply static website changes for the given phase.
2958
3154
  * @param client - Operator client instance
@@ -3069,7 +3265,7 @@ async function planStaticWebsite(context) {
3069
3265
  }
3070
3266
 
3071
3267
  //#endregion
3072
- //#region src/cli/tailordb/migrate/config.ts
3268
+ //#region src/cli/commands/tailordb/migrate/config.ts
3073
3269
  /**
3074
3270
  * Migration configuration utilities
3075
3271
  */
@@ -3102,7 +3298,7 @@ function getNamespacesWithMigrations(config, configDir) {
3102
3298
  }
3103
3299
 
3104
3300
  //#endregion
3105
- //#region src/cli/tailordb/migrate/diff-calculator.ts
3301
+ //#region src/cli/commands/tailordb/migrate/diff-calculator.ts
3106
3302
  /**
3107
3303
  * Current schema snapshot format version
3108
3304
  */
@@ -3260,7 +3456,7 @@ function formatDiffSummary(diff) {
3260
3456
  }
3261
3457
 
3262
3458
  //#endregion
3263
- //#region src/cli/tailordb/migrate/snapshot.ts
3459
+ //#region src/cli/commands/tailordb/migrate/snapshot.ts
3264
3460
  /**
3265
3461
  * Schema snapshot management for TailorDB migrations
3266
3462
  */
@@ -4350,7 +4546,7 @@ function formatSchemaDrifts(drifts) {
4350
4546
  }
4351
4547
 
4352
4548
  //#endregion
4353
- //#region src/cli/bundler/migration/migration-bundler.ts
4549
+ //#region src/cli/commands/tailordb/migrate/bundler.ts
4354
4550
  /**
4355
4551
  * Migration script bundler for TailorDB migrations
4356
4552
  *
@@ -4428,7 +4624,7 @@ async function bundleMigrationScript(sourceFile, namespace, migrationNumber) {
4428
4624
  }
4429
4625
 
4430
4626
  //#endregion
4431
- //#region src/cli/tailordb/migrate/types.ts
4627
+ //#region src/cli/commands/tailordb/migrate/types.ts
4432
4628
  /**
4433
4629
  * Prefix added to migration numbers in labels (required because migration names start with numbers)
4434
4630
  */
@@ -4450,7 +4646,7 @@ function parseMigrationLabelNumber(label) {
4450
4646
  }
4451
4647
 
4452
4648
  //#endregion
4453
- //#region src/cli/utils/script-executor.ts
4649
+ //#region src/cli/shared/script-executor.ts
4454
4650
  /**
4455
4651
  * Script execution service for TestExecScript API
4456
4652
  *
@@ -4525,7 +4721,7 @@ async function executeScript(options) {
4525
4721
  }
4526
4722
 
4527
4723
  //#endregion
4528
- //#region src/cli/apply/services/tailordb/migration.ts
4724
+ //#region src/cli/commands/apply/tailordb/migration.ts
4529
4725
  /**
4530
4726
  * Migration execution service for TailorDB migrations
4531
4727
  *
@@ -4703,7 +4899,7 @@ function groupMigrationsByNamespace(migrations) {
4703
4899
  }
4704
4900
 
4705
4901
  //#endregion
4706
- //#region src/cli/apply/services/tailordb/index.ts
4902
+ //#region src/cli/commands/apply/tailordb/index.ts
4707
4903
  /**
4708
4904
  * Fetch all TailorDB types from remote for a namespace
4709
4905
  * @param {OperatorClient} client - Operator client instance
@@ -5811,7 +6007,7 @@ function formatMigrationCheckResults(results) {
5811
6007
  }
5812
6008
 
5813
6009
  //#endregion
5814
- //#region src/cli/apply/services/workflow.ts
6010
+ //#region src/cli/commands/apply/workflow.ts
5815
6011
  /**
5816
6012
  * Apply workflow changes for the given phase.
5817
6013
  * @param client - Operator client instance
@@ -6001,7 +6197,7 @@ async function planWorkflow(client, workspaceId, appName, workflows, mainJobDeps
6001
6197
  }
6002
6198
 
6003
6199
  //#endregion
6004
- //#region src/cli/apply/index.ts
6200
+ //#region src/cli/commands/apply/apply.ts
6005
6201
  /**
6006
6202
  * Apply the configured application to the Tailor platform.
6007
6203
  * @param options - Options for apply execution
@@ -6014,16 +6210,43 @@ async function apply(options) {
6014
6210
  const { config: config$1, plugins } = await withSpan("build.loadConfig", () => loadConfig(options?.configPath));
6015
6211
  const dryRun$1 = options?.dryRun ?? false;
6016
6212
  const buildOnly$1 = options?.buildOnly ?? process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY === "true";
6213
+ const noCache = options?.noCache ?? false;
6214
+ const packageJson = await readPackageJson();
6215
+ const cacheDir = path.resolve(getDistDir(), "cache");
6216
+ if (options?.cleanCache) {
6217
+ fs$2.rmSync(cacheDir, {
6218
+ recursive: true,
6219
+ force: true
6220
+ });
6221
+ logger.info("Bundle cache cleaned");
6222
+ }
6223
+ const configDir = path.dirname(config$1.path);
6224
+ const lockfilePath = findUpSync("pnpm-lock.yaml", { cwd: configDir }) ?? findUpSync("package-lock.json", { cwd: configDir }) ?? findUpSync("yarn.lock", { cwd: configDir }) ?? findUpSync("bun.lock", { cwd: configDir });
6225
+ const cacheManager = createCacheManager({
6226
+ enabled: !noCache,
6227
+ cacheDir,
6228
+ sdkVersion: packageJson.version ?? "unknown",
6229
+ lockfileHash: lockfilePath ? hashFile(lockfilePath) : void 0
6230
+ });
6017
6231
  let pluginManager;
6018
6232
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
6019
6233
  await withSpan("build.generateUserTypes", () => generateUserTypes({
6020
6234
  config: config$1,
6021
6235
  configPath: config$1.path
6022
6236
  }));
6023
- const { application: application$1, workflowBuildResult: workflowBuildResult$1 } = await withSpan("build.loadApplication", () => loadApplication({
6024
- config: config$1,
6025
- pluginManager
6026
- }));
6237
+ let application$1;
6238
+ let workflowBuildResult$1;
6239
+ try {
6240
+ const result = await withSpan("build.loadApplication", () => loadApplication({
6241
+ config: config$1,
6242
+ pluginManager,
6243
+ bundleCache: cacheManager.bundleCache
6244
+ }));
6245
+ application$1 = result.application;
6246
+ workflowBuildResult$1 = result.workflowBuildResult;
6247
+ } finally {
6248
+ cacheManager.finalize();
6249
+ }
6027
6250
  return {
6028
6251
  config: config$1,
6029
6252
  plugins,
@@ -6177,33 +6400,9 @@ async function apply(options) {
6177
6400
  logger.success("Successfully applied changes.");
6178
6401
  });
6179
6402
  }
6180
- const applyCommand = defineCommand({
6181
- name: "apply",
6182
- description: "Apply Tailor configuration to deploy your application.",
6183
- args: z.object({
6184
- ...commonArgs,
6185
- ...deploymentArgs,
6186
- ...confirmationArgs,
6187
- "dry-run": arg(z.boolean().optional(), {
6188
- alias: "d",
6189
- description: "Run the command without making any changes"
6190
- }),
6191
- "no-schema-check": arg(z.boolean().optional(), { description: "Skip schema diff check against migration snapshots" })
6192
- }),
6193
- run: withCommonArgs(async (args) => {
6194
- await apply({
6195
- workspaceId: args["workspace-id"],
6196
- profile: args.profile,
6197
- configPath: args.config,
6198
- dryRun: args["dry-run"],
6199
- yes: args.yes,
6200
- noSchemaCheck: args["no-schema-check"]
6201
- });
6202
- })
6203
- });
6204
6403
 
6205
6404
  //#endregion
6206
- //#region src/cli/executor/status.ts
6405
+ //#region src/cli/commands/executor/status.ts
6207
6406
  /**
6208
6407
  * Colorize executor job status string.
6209
6408
  * @param status - Executor job status string
@@ -6293,7 +6492,7 @@ function executorTriggerTypeToString(triggerType) {
6293
6492
  }
6294
6493
 
6295
6494
  //#endregion
6296
- //#region src/cli/executor/transform.ts
6495
+ //#region src/cli/commands/executor/transform.ts
6297
6496
  function executorJobStatusToString(status) {
6298
6497
  switch (status) {
6299
6498
  case ExecutorJobStatus.PENDING: return "PENDING";
@@ -6460,7 +6659,7 @@ function toExecutorInfo(executor) {
6460
6659
  }
6461
6660
 
6462
6661
  //#endregion
6463
- //#region src/cli/executor/get.ts
6662
+ //#region src/cli/commands/executor/get.ts
6464
6663
  const nameArgs$1 = { name: arg(z.string(), {
6465
6664
  positional: true,
6466
6665
  description: "Executor name"
@@ -6520,7 +6719,7 @@ const getCommand$3 = defineCommand({
6520
6719
  });
6521
6720
 
6522
6721
  //#endregion
6523
- //#region src/cli/utils/format.ts
6722
+ //#region src/cli/shared/format.ts
6524
6723
  /**
6525
6724
  * Format a protobuf Timestamp to ISO string.
6526
6725
  * @param timestamp - Protobuf timestamp
@@ -6566,7 +6765,7 @@ function humanizeRelativeTime(value) {
6566
6765
  }
6567
6766
 
6568
6767
  //#endregion
6569
- //#region src/cli/utils/function-execution.ts
6768
+ //#region src/cli/shared/function-execution.ts
6570
6769
  /**
6571
6770
  * Convert function execution status enum to string.
6572
6771
  * @param status - Function execution status enum value
@@ -6582,7 +6781,7 @@ function functionExecutionStatusToString(status) {
6582
6781
  }
6583
6782
 
6584
6783
  //#endregion
6585
- //#region src/cli/workflow/args.ts
6784
+ //#region src/cli/commands/workflow/args.ts
6586
6785
  const nameArgs = { name: arg(z.string(), {
6587
6786
  positional: true,
6588
6787
  description: "Workflow name"
@@ -6603,7 +6802,7 @@ const waitArgs = {
6603
6802
  };
6604
6803
 
6605
6804
  //#endregion
6606
- //#region src/cli/workflow/status.ts
6805
+ //#region src/cli/commands/workflow/status.ts
6607
6806
  /**
6608
6807
  * Check if workflow execution status is terminal.
6609
6808
  * @param status - Workflow execution status enum value
@@ -6614,7 +6813,7 @@ function isWorkflowExecutionTerminalStatus(status) {
6614
6813
  }
6615
6814
 
6616
6815
  //#endregion
6617
- //#region src/cli/workflow/transform.ts
6816
+ //#region src/cli/commands/workflow/transform.ts
6618
6817
  /**
6619
6818
  * Convert a workflow execution status enum to a string.
6620
6819
  * @param status - Workflow execution status
@@ -6706,7 +6905,7 @@ function toWorkflowExecutionInfo(execution) {
6706
6905
  }
6707
6906
 
6708
6907
  //#endregion
6709
- //#region src/cli/workflow/executions.ts
6908
+ //#region src/cli/commands/workflow/executions.ts
6710
6909
  function sleep$1(ms) {
6711
6910
  return new Promise((resolve) => setTimeout(resolve, ms));
6712
6911
  }
@@ -6951,7 +7150,7 @@ const executionsCommand = defineCommand({
6951
7150
  });
6952
7151
 
6953
7152
  //#endregion
6954
- //#region src/cli/workflow/get.ts
7153
+ //#region src/cli/commands/workflow/get.ts
6955
7154
  /**
6956
7155
  * Resolve a workflow definition by name.
6957
7156
  * @param client - Operator client
@@ -7004,7 +7203,7 @@ const getCommand$2 = defineCommand({
7004
7203
  });
7005
7204
 
7006
7205
  //#endregion
7007
- //#region src/cli/workflow/start.ts
7206
+ //#region src/cli/commands/workflow/start.ts
7008
7207
  function sleep(ms) {
7009
7208
  return new Promise((resolve) => setTimeout(resolve, ms));
7010
7209
  }
@@ -7206,7 +7405,7 @@ const startCommand = defineCommand({
7206
7405
  });
7207
7406
 
7208
7407
  //#endregion
7209
- //#region src/cli/executor/jobs.ts
7408
+ //#region src/cli/commands/executor/jobs.ts
7210
7409
  function formatTime(date) {
7211
7410
  return date.toLocaleTimeString("en-US", { hour12: false });
7212
7411
  }
@@ -7585,7 +7784,7 @@ const jobsCommand = defineCommand({
7585
7784
  });
7586
7785
 
7587
7786
  //#endregion
7588
- //#region src/cli/executor/list.ts
7787
+ //#region src/cli/commands/executor/list.ts
7589
7788
  /**
7590
7789
  * List executors in the workspace and return CLI-friendly info.
7591
7790
  * @param options - Executor listing options
@@ -7634,7 +7833,7 @@ const listCommand$6 = defineCommand({
7634
7833
  });
7635
7834
 
7636
7835
  //#endregion
7637
- //#region src/cli/executor/trigger.ts
7836
+ //#region src/cli/commands/executor/trigger.ts
7638
7837
  /**
7639
7838
  * Schema for JSON string validation (object only)
7640
7839
  * Transforms the string to a parsed object
@@ -7847,7 +8046,7 @@ The \`--logs\` option displays logs from the downstream execution when available
7847
8046
  });
7848
8047
 
7849
8048
  //#endregion
7850
- //#region src/cli/executor/webhook.ts
8049
+ //#region src/cli/commands/executor/webhook.ts
7851
8050
  /**
7852
8051
  * Build the webhook URL for an executor.
7853
8052
  * @param workspaceId - Workspace ID
@@ -7915,7 +8114,7 @@ const webhookCommand = defineCommand({
7915
8114
  });
7916
8115
 
7917
8116
  //#endregion
7918
- //#region src/cli/generator/types.ts
8117
+ //#region src/cli/commands/generate/types.ts
7919
8118
  /**
7920
8119
  * Type guard to check if a generator has a specific dependency.
7921
8120
  * @template D
@@ -7928,7 +8127,7 @@ function hasDependency(generator, dependency) {
7928
8127
  }
7929
8128
 
7930
8129
  //#endregion
7931
- //#region src/cli/generator/watch/index.ts
8130
+ //#region src/cli/commands/generate/watch/index.ts
7932
8131
  /**
7933
8132
  * Error codes.
7934
8133
  */
@@ -8306,7 +8505,7 @@ function createDependencyWatcher(options = {}) {
8306
8505
  }
8307
8506
 
8308
8507
  //#endregion
8309
- //#region src/cli/generator/index.ts
8508
+ //#region src/cli/commands/generate/service.ts
8310
8509
  /**
8311
8510
  * Creates a generation manager.
8312
8511
  * @param params - Parameters for creating the generation manager
@@ -8752,30 +8951,9 @@ async function generate$1(options) {
8752
8951
  await manager.generate(watch$1);
8753
8952
  if (watch$1) await manager.watch();
8754
8953
  }
8755
- const generateCommand$1 = defineCommand({
8756
- name: "generate",
8757
- description: "Generate files using Tailor configuration.",
8758
- args: z.object({
8759
- ...commonArgs,
8760
- config: arg(z.string().default("tailor.config.ts"), {
8761
- alias: "c",
8762
- description: "Path to SDK config file"
8763
- }),
8764
- watch: arg(z.boolean().default(false), {
8765
- alias: "W",
8766
- description: "Watch for type/resolver changes and regenerate"
8767
- })
8768
- }),
8769
- run: withCommonArgs(async (args) => {
8770
- await generate$1({
8771
- configPath: args.config,
8772
- watch: args.watch
8773
- });
8774
- })
8775
- });
8776
8954
 
8777
8955
  //#endregion
8778
- //#region src/cli/machineuser/list.ts
8956
+ //#region src/cli/commands/machineuser/list.ts
8779
8957
  /**
8780
8958
  * Map a MachineUser protobuf message to CLI-friendly info.
8781
8959
  * @param user - Machine user resource
@@ -8843,7 +9021,7 @@ const listCommand$5 = defineCommand({
8843
9021
  });
8844
9022
 
8845
9023
  //#endregion
8846
- //#region src/cli/machineuser/token.ts
9024
+ //#region src/cli/commands/machineuser/token.ts
8847
9025
  /**
8848
9026
  * Get a machine user access token for the current application.
8849
9027
  * @param options - Token retrieval options
@@ -8908,7 +9086,7 @@ const tokenCommand = defineCommand({
8908
9086
  });
8909
9087
 
8910
9088
  //#endregion
8911
- //#region src/cli/oauth2client/transform.ts
9089
+ //#region src/cli/commands/oauth2client/transform.ts
8912
9090
  const grantTypeToString = (grantType) => {
8913
9091
  switch (grantType) {
8914
9092
  case AuthOAuth2Client_GrantType.AUTHORIZATION_CODE: return "authorization_code";
@@ -8949,7 +9127,7 @@ function toOAuth2ClientCredentials(client) {
8949
9127
  }
8950
9128
 
8951
9129
  //#endregion
8952
- //#region src/cli/oauth2client/get.ts
9130
+ //#region src/cli/commands/oauth2client/get.ts
8953
9131
  /**
8954
9132
  * Get OAuth2 client credentials for the current application.
8955
9133
  * @param options - OAuth2 client lookup options
@@ -9006,7 +9184,7 @@ const getCommand$1 = defineCommand({
9006
9184
  });
9007
9185
 
9008
9186
  //#endregion
9009
- //#region src/cli/oauth2client/list.ts
9187
+ //#region src/cli/commands/oauth2client/list.ts
9010
9188
  /**
9011
9189
  * List OAuth2 clients for the current application.
9012
9190
  * @param options - OAuth2 client listing options
@@ -9056,7 +9234,7 @@ const listCommand$4 = defineCommand({
9056
9234
  });
9057
9235
 
9058
9236
  //#endregion
9059
- //#region src/cli/remove.ts
9237
+ //#region src/cli/commands/remove.ts
9060
9238
  async function loadOptions$9(options) {
9061
9239
  const client = await initOperatorClient(await loadAccessToken({
9062
9240
  useProfile: true,
@@ -9148,7 +9326,7 @@ const removeCommand$1 = defineCommand({
9148
9326
  });
9149
9327
 
9150
9328
  //#endregion
9151
- //#region src/cli/show.ts
9329
+ //#region src/cli/commands/show.ts
9152
9330
  function applicationInfo(app) {
9153
9331
  return {
9154
9332
  name: app.name,
@@ -9209,7 +9387,7 @@ const showCommand = defineCommand({
9209
9387
  });
9210
9388
 
9211
9389
  //#endregion
9212
- //#region src/cli/utils/beta.ts
9390
+ //#region src/cli/shared/beta.ts
9213
9391
  /**
9214
9392
  * Warn that a feature is in beta.
9215
9393
  * @param {string} featureName - Name of the beta feature (e.g., "tailordb erd", "tailordb migration")
@@ -9220,7 +9398,7 @@ function logBetaWarning(featureName) {
9220
9398
  }
9221
9399
 
9222
9400
  //#endregion
9223
- //#region src/cli/tailordb/migrate/db-types-generator.ts
9401
+ //#region src/cli/commands/tailordb/migrate/db-types-generator.ts
9224
9402
  /**
9225
9403
  * DB types generator for TailorDB migrations
9226
9404
  *
@@ -9463,7 +9641,7 @@ async function writeDbTypesFile(snapshot, migrationsDir, migrationNumber, diff)
9463
9641
  }
9464
9642
 
9465
9643
  //#endregion
9466
- //#region src/cli/tailordb/migrate/template-generator.ts
9644
+ //#region src/cli/commands/tailordb/migrate/template-generator.ts
9467
9645
  /**
9468
9646
  * Template generator for TailorDB migrations
9469
9647
  *
@@ -9663,7 +9841,7 @@ function generateChangeScript(change) {
9663
9841
  }
9664
9842
 
9665
9843
  //#endregion
9666
- //#region src/cli/tailordb/migrate/generate.ts
9844
+ //#region src/cli/commands/tailordb/migrate/generate.ts
9667
9845
  /**
9668
9846
  * Generate command for TailorDB migrations
9669
9847
  *
@@ -9728,7 +9906,7 @@ async function generate(options) {
9728
9906
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
9729
9907
  let pluginManager;
9730
9908
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
9731
- const { defineApplication: defineApplication$1 } = await import("./application-nPS5veK6.mjs");
9909
+ const { defineApplication: defineApplication$1 } = await import("./application-CZdieD3K.mjs");
9732
9910
  const application = defineApplication$1({
9733
9911
  config,
9734
9912
  pluginManager
@@ -9885,7 +10063,7 @@ const generateCommand = defineCommand({
9885
10063
  });
9886
10064
 
9887
10065
  //#endregion
9888
- //#region src/cli/tailordb/truncate.ts
10066
+ //#region src/cli/commands/tailordb/truncate.ts
9889
10067
  async function truncateSingleType(options, client) {
9890
10068
  await client.truncateTailorDBType({
9891
10069
  workspaceId: options.workspaceId,
@@ -10051,7 +10229,7 @@ const truncateCommand = defineCommand({
10051
10229
  });
10052
10230
 
10053
10231
  //#endregion
10054
- //#region src/cli/workflow/list.ts
10232
+ //#region src/cli/commands/workflow/list.ts
10055
10233
  /**
10056
10234
  * List workflows in the workspace and return CLI-friendly info.
10057
10235
  * @param options - Workflow listing options
@@ -10097,7 +10275,7 @@ const listCommand$3 = defineCommand({
10097
10275
  });
10098
10276
 
10099
10277
  //#endregion
10100
- //#region src/cli/workflow/resume.ts
10278
+ //#region src/cli/commands/workflow/resume.ts
10101
10279
  /**
10102
10280
  * Resume a suspended workflow execution and return a handle to wait for completion.
10103
10281
  * @param options - Resume options
@@ -10172,7 +10350,7 @@ const resumeCommand = defineCommand({
10172
10350
  });
10173
10351
 
10174
10352
  //#endregion
10175
- //#region src/cli/workspace/app/transform.ts
10353
+ //#region src/cli/commands/workspace/app/transform.ts
10176
10354
  const statusToString = (status) => {
10177
10355
  switch (status) {
10178
10356
  case GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus.OK: return "ok";
@@ -10209,7 +10387,7 @@ const appHealthInfo = (name, health) => {
10209
10387
  };
10210
10388
 
10211
10389
  //#endregion
10212
- //#region src/cli/workspace/app/health.ts
10390
+ //#region src/cli/commands/workspace/app/health.ts
10213
10391
  const healthOptionsSchema = z.object({
10214
10392
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10215
10393
  profile: z.string().optional(),
@@ -10267,7 +10445,7 @@ const healthCommand = defineCommand({
10267
10445
  });
10268
10446
 
10269
10447
  //#endregion
10270
- //#region src/cli/workspace/app/list.ts
10448
+ //#region src/cli/commands/workspace/app/list.ts
10271
10449
  const listAppsOptionsSchema = z.object({
10272
10450
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10273
10451
  profile: z.string().optional(),
@@ -10339,7 +10517,7 @@ const listCommand$2 = defineCommand({
10339
10517
  });
10340
10518
 
10341
10519
  //#endregion
10342
- //#region src/cli/workspace/transform.ts
10520
+ //#region src/cli/commands/workspace/transform.ts
10343
10521
  const workspaceInfo = (workspace) => {
10344
10522
  return {
10345
10523
  id: workspace.id,
@@ -10359,7 +10537,7 @@ const workspaceDetails = (workspace) => {
10359
10537
  };
10360
10538
 
10361
10539
  //#endregion
10362
- //#region src/cli/workspace/create.ts
10540
+ //#region src/cli/commands/workspace/create.ts
10363
10541
  /**
10364
10542
  * Schema for workspace creation options
10365
10543
  * - name: 3-63 chars, lowercase alphanumeric and hyphens, cannot start/end with hyphen
@@ -10474,7 +10652,7 @@ const createCommand = defineCommand({
10474
10652
  });
10475
10653
 
10476
10654
  //#endregion
10477
- //#region src/cli/workspace/delete.ts
10655
+ //#region src/cli/commands/workspace/delete.ts
10478
10656
  const deleteWorkspaceOptionsSchema = z.object({ workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }) });
10479
10657
  async function loadOptions$6(options) {
10480
10658
  const result = deleteWorkspaceOptionsSchema.safeParse(options);
@@ -10531,7 +10709,7 @@ const deleteCommand = defineCommand({
10531
10709
  });
10532
10710
 
10533
10711
  //#endregion
10534
- //#region src/cli/workspace/get.ts
10712
+ //#region src/cli/commands/workspace/get.ts
10535
10713
  const getWorkspaceOptionsSchema = z.object({
10536
10714
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10537
10715
  profile: z.string().optional()
@@ -10581,7 +10759,7 @@ const getCommand = defineCommand({
10581
10759
  });
10582
10760
 
10583
10761
  //#endregion
10584
- //#region src/cli/workspace/list.ts
10762
+ //#region src/cli/commands/workspace/list.ts
10585
10763
  /**
10586
10764
  * List workspaces with an optional limit.
10587
10765
  * @param options - Workspace listing options
@@ -10627,7 +10805,7 @@ const listCommand$1 = defineCommand({
10627
10805
  });
10628
10806
 
10629
10807
  //#endregion
10630
- //#region src/cli/workspace/restore.ts
10808
+ //#region src/cli/commands/workspace/restore.ts
10631
10809
  const restoreWorkspaceOptionsSchema = z.object({ workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }) });
10632
10810
  async function loadOptions$4(options) {
10633
10811
  const result = restoreWorkspaceOptionsSchema.safeParse(options);
@@ -10671,7 +10849,7 @@ const restoreCommand = defineCommand({
10671
10849
  });
10672
10850
 
10673
10851
  //#endregion
10674
- //#region src/cli/workspace/user/transform.ts
10852
+ //#region src/cli/commands/workspace/user/transform.ts
10675
10853
  const roleToString = (role) => {
10676
10854
  switch (role) {
10677
10855
  case WorkspacePlatformUserRole.ADMIN: return "admin";
@@ -10702,7 +10880,7 @@ const validRoles = [
10702
10880
  ];
10703
10881
 
10704
10882
  //#endregion
10705
- //#region src/cli/workspace/user/invite.ts
10883
+ //#region src/cli/commands/workspace/user/invite.ts
10706
10884
  const inviteUserOptionsSchema = z.object({
10707
10885
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10708
10886
  profile: z.string().optional(),
@@ -10759,7 +10937,7 @@ const inviteCommand = defineCommand({
10759
10937
  });
10760
10938
 
10761
10939
  //#endregion
10762
- //#region src/cli/workspace/user/list.ts
10940
+ //#region src/cli/commands/workspace/user/list.ts
10763
10941
  const listUsersOptionsSchema = z.object({
10764
10942
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10765
10943
  profile: z.string().optional(),
@@ -10827,7 +11005,7 @@ const listCommand = defineCommand({
10827
11005
  });
10828
11006
 
10829
11007
  //#endregion
10830
- //#region src/cli/workspace/user/remove.ts
11008
+ //#region src/cli/commands/workspace/user/remove.ts
10831
11009
  const removeUserOptionsSchema = z.object({
10832
11010
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10833
11011
  profile: z.string().optional(),
@@ -10883,7 +11061,7 @@ const removeCommand = defineCommand({
10883
11061
  });
10884
11062
 
10885
11063
  //#endregion
10886
- //#region src/cli/workspace/user/update.ts
11064
+ //#region src/cli/commands/workspace/user/update.ts
10887
11065
  const updateUserOptionsSchema = z.object({
10888
11066
  workspaceId: z.uuid({ message: "workspace-id must be a valid UUID" }).optional(),
10889
11067
  profile: z.string().optional(),
@@ -10940,5 +11118,5 @@ const updateCommand = defineCommand({
10940
11118
  });
10941
11119
 
10942
11120
  //#endregion
10943
- export { jobsCommand as $, generateCommand as A, getMigrationDirPath as At, getMachineUserToken as B, getNamespacesWithMigrations as Bt, resumeCommand as C, MIGRATE_FILE_NAME as Ct, truncate as D, createSnapshotFromLocalTypes as Dt, listWorkflows as E, compareSnapshots as Et, removeCommand$1 as F, loadDiff as Ft, generateCommand$1 as G, commonArgs as Gt, listCommand$5 as H, generateUserTypes as Ht, listCommand$4 as I, reconstructSnapshotFromMigrations as It, triggerCommand as J, jsonArgs as Jt, listWebhookExecutors as K, confirmationArgs as Kt, listOAuth2Clients as L, formatDiffSummary as Lt, show as M, getMigrationFiles as Mt, showCommand as N, getNextMigrationNumber as Nt, truncateCommand as O, formatMigrationNumber as Ot, remove as P, isValidMigrationNumber as Pt, getExecutorJob as Q, getCommand$1 as R, formatMigrationDiff as Rt, healthCommand as S, INITIAL_SCHEMA_NUMBER as St, listCommand$3 as T, compareLocalTypesWithSnapshot as Tt, listMachineUsers as U, apiCall as Ut, tokenCommand as V, trnPrefix as Vt, generate$1 as W, apiCommand as Wt, listCommand$6 as X, workspaceArgs as Xt, triggerExecutor as Y, withCommonArgs as Yt, listExecutors as Z, createCommand as _, MIGRATION_LABEL_KEY as _t, listCommand as a, getWorkflow as at, listCommand$2 as b, DB_TYPES_FILE_NAME as bt, inviteUser as c, listWorkflowExecutions as ct, listCommand$1 as d, getCommand$3 as dt, listExecutorJobs as et, listWorkspaces as f, getExecutor as ft, deleteWorkspace as g, waitForExecution$1 as gt, deleteCommand as h, executeScript as ht, removeUser as i, getCommand$2 as it, logBetaWarning as j, getMigrationFilePath as jt, generate as k, getLatestMigrationNumber as kt, restoreCommand as l, functionExecutionStatusToString as lt, getWorkspace as m, applyCommand as mt, updateUser as n, startCommand as nt, listUsers as o, executionsCommand as ot, getCommand as p, apply as pt, webhookCommand as q, deploymentArgs as qt, removeCommand as r, startWorkflow as rt, inviteCommand as s, getWorkflowExecution as st, updateCommand as t, watchExecutorJob as tt, restoreWorkspace as u, formatKeyValueTable as ut, createWorkspace as v, parseMigrationLabelNumber as vt, resumeWorkflow as w, SCHEMA_FILE_NAME as wt, getAppHealth as x, DIFF_FILE_NAME as xt, listApps as y, bundleMigrationScript as yt, getOAuth2Client as z, hasChanges as zt };
10944
- //# sourceMappingURL=update-Cr5c7h1r.mjs.map
11121
+ export { listExecutorJobs as $, generateCommand as A, getMigrationFiles as At, getMachineUserToken as B, generateUserTypes as Bt, resumeCommand as C, compareLocalTypesWithSnapshot as Ct, truncate as D, getLatestMigrationNumber as Dt, listWorkflows as E, formatMigrationNumber as Et, removeCommand$1 as F, formatDiffSummary as Ft, listWebhookExecutors as G, deploymentArgs as Gt, listCommand$5 as H, apiCommand as Ht, listCommand$4 as I, formatMigrationDiff as It, triggerExecutor as J, workspaceArgs as Jt, webhookCommand as K, jsonArgs as Kt, listOAuth2Clients as L, hasChanges as Lt, show as M, isValidMigrationNumber as Mt, showCommand as N, loadDiff as Nt, truncateCommand as O, getMigrationDirPath as Ot, remove as P, reconstructSnapshotFromMigrations as Pt, jobsCommand as Q, getCommand$1 as R, getNamespacesWithMigrations as Rt, healthCommand as S, SCHEMA_FILE_NAME as St, listCommand$3 as T, createSnapshotFromLocalTypes as Tt, listMachineUsers as U, commonArgs as Ut, tokenCommand as V, apiCall as Vt, generate$1 as W, confirmationArgs as Wt, listExecutors as X, listCommand$6 as Y, getExecutorJob as Z, createCommand as _, bundleMigrationScript as _t, listCommand as a, executionsCommand as at, listCommand$2 as b, INITIAL_SCHEMA_NUMBER as bt, inviteUser as c, functionExecutionStatusToString as ct, listCommand$1 as d, getExecutor as dt, watchExecutorJob as et, listWorkspaces as f, apply as ft, deleteWorkspace as g, parseMigrationLabelNumber as gt, deleteCommand as h, MIGRATION_LABEL_KEY as ht, removeUser as i, getWorkflow as it, logBetaWarning as j, getNextMigrationNumber as jt, generate as k, getMigrationFilePath as kt, restoreCommand as l, formatKeyValueTable as lt, getWorkspace as m, waitForExecution$1 as mt, updateUser as n, startWorkflow as nt, listUsers as o, getWorkflowExecution as ot, getCommand as p, executeScript as pt, triggerCommand as q, withCommonArgs as qt, removeCommand as r, getCommand$2 as rt, inviteCommand as s, listWorkflowExecutions as st, updateCommand as t, startCommand as tt, restoreWorkspace as u, getCommand$3 as ut, createWorkspace as v, DB_TYPES_FILE_NAME as vt, resumeWorkflow as w, compareSnapshots as wt, getAppHealth as x, MIGRATE_FILE_NAME as xt, listApps as y, DIFF_FILE_NAME as yt, getOAuth2Client as z, trnPrefix as zt };
11122
+ //# sourceMappingURL=update-DkpWgrzL.mjs.map