@tailor-platform/sdk 2.0.0-next.9 → 2.0.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 (170) hide show
  1. package/CHANGELOG.md +611 -0
  2. package/dist/{application-D_oSqto2.mjs → application-CM6hKnSK.mjs} +489 -118
  3. package/dist/application-CM6hKnSK.mjs.map +1 -0
  4. package/dist/application-CXNaUNhv.mjs +3 -0
  5. package/dist/cli/commands/deploy/aigateway.d.mts +1 -1
  6. package/dist/cli/commands/deploy/application.d.mts +1 -1
  7. package/dist/cli/commands/deploy/auth.d.mts +1 -1
  8. package/dist/cli/commands/deploy/deploy.d.mts +1 -0
  9. package/dist/cli/commands/deploy/executor.d.mts +1 -1
  10. package/dist/cli/commands/deploy/function-registry.d.mts +1 -2
  11. package/dist/cli/commands/deploy/idp.d.mts +1 -1
  12. package/dist/cli/commands/deploy/label.d.mts +2 -0
  13. package/dist/cli/commands/deploy/resolver.d.mts +1 -1
  14. package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -1
  15. package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -1
  16. package/dist/cli/commands/deploy/types.d.mts +2 -1
  17. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -2
  18. package/dist/cli/commands/deploy/workflow.d.mts +1 -1
  19. package/dist/cli/commands/executor/get.d.mts +1 -10
  20. package/dist/cli/commands/executor/jobs.d.mts +1 -38
  21. package/dist/cli/commands/executor/trigger.d.mts +1 -11
  22. package/dist/cli/commands/generate/seed/bundler.d.mts +2 -1
  23. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -2
  24. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -1
  25. package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +5 -0
  26. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
  27. package/dist/cli/commands/workflow/executions.d.mts +1 -13
  28. package/dist/cli/commands/workflow/get.d.mts +1 -10
  29. package/dist/cli/commands/workflow/start.d.mts +2 -14
  30. package/dist/cli/index.mjs +12 -6561
  31. package/dist/cli/lib.d.mts +9 -12
  32. package/dist/cli/lib.mjs +99 -42
  33. package/dist/cli/lib.mjs.map +1 -1
  34. package/dist/cli/{index.d.mts → main.d.mts} +1 -1
  35. package/dist/cli/main.mjs +6777 -0
  36. package/dist/cli/main.mjs.map +1 -0
  37. package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
  38. package/dist/cli/services/workflow/bundler.d.mts +2 -1
  39. package/dist/cli/shared/client.d.mts +28 -3
  40. package/dist/cli/shared/config-loader.d.mts +11 -4
  41. package/dist/cli/shared/error-json.d.mts +23 -0
  42. package/dist/cli/shared/tsconfig-paths-plugin.d.mts +2 -0
  43. package/dist/cli/shared/type-generator.d.mts +4 -3
  44. package/dist/completion/zsh-worker.zsh +85 -22
  45. package/dist/configure/config/types.d.mts +29 -4
  46. package/dist/configure/index.d.mts +4 -3
  47. package/dist/configure/index.mjs +183 -6
  48. package/dist/configure/index.mjs.map +1 -1
  49. package/dist/configure/services/executor/index.d.mts +2 -2
  50. package/dist/configure/services/executor/trigger/event.d.mts +245 -2
  51. package/dist/configure/services/executor/trigger/index.d.mts +3 -3
  52. package/dist/configure/services/idp/index.d.mts +2 -2
  53. package/dist/configure/services/idp/permission.d.mts +1 -16
  54. package/dist/configure/services/idp/types.d.mts +5 -1
  55. package/dist/configure/services/index.d.mts +4 -3
  56. package/dist/configure/services/resolver/index.d.mts +2 -1
  57. package/dist/configure/services/resolver/permission.d.mts +64 -0
  58. package/dist/configure/services/resolver/resolver.d.mts +14 -2
  59. package/dist/configure/services/tailordb/index.d.mts +0 -1
  60. package/dist/configure/services/tailordb/permission.d.mts +1 -16
  61. package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
  62. package/dist/configure/services/workflow/execution-policy.types.d.mts +1 -1
  63. package/dist/configure/services/workflow/job.d.mts +11 -2
  64. package/dist/configure/services/workflow/workflow.d.mts +10 -0
  65. package/dist/configure/types/permission-operand.types.d.mts +20 -0
  66. package/dist/{crashreport-CxHne11E.mjs → crashreport-B5LqCTfF.mjs} +2 -2
  67. package/dist/{crashreport-CxHne11E.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
  68. package/dist/{crashreport-0ioNRZ4K.mjs → crashreport-eI7ty7ok.mjs} +1 -1
  69. package/dist/{errors-DfnF4ibq.mjs → errors-D7583Zz7.mjs} +2 -44
  70. package/dist/errors-D7583Zz7.mjs.map +1 -0
  71. package/dist/{globals-CBZ0egXT.mjs → globals-TfAVItuK.mjs} +21 -5
  72. package/dist/globals-TfAVItuK.mjs.map +1 -0
  73. package/dist/logger-BtX0suGY.mjs +48 -0
  74. package/dist/logger-BtX0suGY.mjs.map +1 -0
  75. package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
  76. package/dist/logger-CXQq9YIp.mjs.map +1 -0
  77. package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
  78. package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
  79. package/dist/plugin/builtin/enum-constants/index.mjs +115 -2
  80. package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -0
  81. package/dist/plugin/builtin/file-utils/index.mjs +149 -2
  82. package/dist/plugin/builtin/file-utils/index.mjs.map +1 -0
  83. package/dist/plugin/builtin/kysely-type/index.mjs +274 -2
  84. package/dist/plugin/builtin/kysely-type/index.mjs.map +1 -0
  85. package/dist/plugin/builtin/seed/index.mjs +1 -1
  86. package/dist/plugin/builtin/seed/seed-type-processor.d.mts +2 -0
  87. package/dist/{register-ts-hook-DgnmGTCt.mjs → register-ts-hook-LYV7zH-e.mjs} +2949 -1001
  88. package/dist/register-ts-hook-LYV7zH-e.mjs.map +1 -0
  89. package/dist/{registry-i7EdJ-D5.mjs → registry-BIGVUrMB.mjs} +3 -3
  90. package/dist/registry-BIGVUrMB.mjs.map +1 -0
  91. package/dist/runtime/globals.d.mts +7 -0
  92. package/dist/runtime/index.d.mts +3 -1
  93. package/dist/runtime/index.mjs +3 -2
  94. package/dist/runtime/logger.d.mts +98 -0
  95. package/dist/runtime/logger.mjs +3 -0
  96. package/dist/runtime/workflow.d.mts +15 -7
  97. package/dist/runtime/workflow.mjs +1 -1
  98. package/dist/{seed-LUVr7jHL.mjs → seed-B-yckgQY.mjs} +42 -3
  99. package/dist/seed-B-yckgQY.mjs.map +1 -0
  100. package/dist/{service-DaeJlBoH.mjs → service-B5WynBHQ.mjs} +3 -3
  101. package/dist/{service-DaeJlBoH.mjs.map → service-B5WynBHQ.mjs.map} +1 -1
  102. package/dist/service-M7OYziQP.mjs +3 -0
  103. package/dist/{service-CXFce28G.mjs → service-k1xy_A5G.mjs} +30 -3
  104. package/dist/{service-CXFce28G.mjs.map → service-k1xy_A5G.mjs.map} +1 -1
  105. package/dist/{service_pb-BoLM0X4K.mjs → service_pb-D5--My_M.mjs} +5 -5
  106. package/dist/service_pb-D5--My_M.mjs.map +1 -0
  107. package/dist/{service_pb-r1T7kpJc.mjs → service_pb-i8CmnQP4.mjs} +1 -1
  108. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +106 -1
  109. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -1
  110. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +49 -1
  111. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +89 -6
  112. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +26 -1
  113. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +101 -1
  114. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +22 -1
  115. package/dist/types/auth.generated.d.mts +14 -2
  116. package/dist/types/executor.generated.d.mts +45 -3
  117. package/dist/types/http-adapter.generated.d.mts +5 -0
  118. package/dist/types/idp.generated.d.mts +31 -1
  119. package/dist/types/resolver.generated.d.mts +30 -2
  120. package/dist/types/tailordb.generated.d.mts +15 -1
  121. package/dist/utils/test/index.d.mts +1 -2
  122. package/dist/utils/test/index.mjs +1 -169
  123. package/dist/utils/test/index.mjs.map +1 -1
  124. package/dist/vitest/environment.mjs +1 -1
  125. package/dist/vitest/index.d.mts +6 -4
  126. package/dist/vitest/index.mjs +112 -62
  127. package/dist/vitest/index.mjs.map +1 -1
  128. package/dist/vitest/mock.d.mts +2 -1
  129. package/dist/vitest/mocks/logger.d.mts +45 -0
  130. package/dist/vitest/mocks/workflow.d.mts +8 -8
  131. package/dist/vitest/setup.mjs +1 -1
  132. package/dist/{workflow-CsBvRE3g.mjs → workflow-Bamae_Yc.mjs} +5 -5
  133. package/dist/workflow-Bamae_Yc.mjs.map +1 -0
  134. package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-DXnO2AT-.mjs} +13 -8
  135. package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
  136. package/docs/cli/application.md +5 -1
  137. package/docs/cli/tailordb.md +47 -13
  138. package/docs/cli-reference.md +31 -30
  139. package/docs/configuration.md +53 -1
  140. package/docs/github-actions.md +2 -2
  141. package/docs/migration/v2.md +307 -10
  142. package/docs/runtime.md +5 -1
  143. package/docs/services/executor.md +83 -3
  144. package/docs/services/idp.md +8 -6
  145. package/docs/services/resolver.md +60 -4
  146. package/docs/services/tailordb-migration.md +31 -7
  147. package/docs/services/tailordb.md +7 -5
  148. package/docs/services/workflow.md +33 -3
  149. package/docs/testing.md +34 -7
  150. package/package.json +31 -24
  151. package/dist/application-CtuzFhg8.mjs +0 -3
  152. package/dist/application-D_oSqto2.mjs.map +0 -1
  153. package/dist/cli/index.mjs.map +0 -1
  154. package/dist/enum-constants-j9QBF0cB.mjs +0 -116
  155. package/dist/enum-constants-j9QBF0cB.mjs.map +0 -1
  156. package/dist/errors-DfnF4ibq.mjs.map +0 -1
  157. package/dist/file-utils-yEiIS4nJ.mjs +0 -150
  158. package/dist/file-utils-yEiIS4nJ.mjs.map +0 -1
  159. package/dist/globals-CBZ0egXT.mjs.map +0 -1
  160. package/dist/kysely-type-DqIRgDYR.mjs +0 -275
  161. package/dist/kysely-type-DqIRgDYR.mjs.map +0 -1
  162. package/dist/logger-BwS4ppwO.mjs.map +0 -1
  163. package/dist/register-ts-hook-DgnmGTCt.mjs.map +0 -1
  164. package/dist/registry-i7EdJ-D5.mjs.map +0 -1
  165. package/dist/seed-LUVr7jHL.mjs.map +0 -1
  166. package/dist/service-DjhjpJpm.mjs +0 -3
  167. package/dist/service_pb-BoLM0X4K.mjs.map +0 -1
  168. package/dist/utils/test/mock.d.mts +0 -86
  169. package/dist/workflow-CsBvRE3g.mjs.map +0 -1
  170. package/dist/workspace_resource_pb-Db3fv68L.mjs.map +0 -1
@@ -8,6 +8,7 @@ import { LoadedConfig, loadConfig } from "./shared/config-loader.mjs";
8
8
  import { AuthInvoker } from "../tailor-proto/src/tailor/v1/auth_resource_pb.mjs";
9
9
  import { OperatorClient, initOperatorClient } from "./shared/client.mjs";
10
10
  import "./commands/deploy/function-registry.mjs";
11
+ import { NamespaceWithMigrations, getNamespacesWithMigrations } from "./commands/tailordb/migrate/config.mjs";
11
12
  import { NormalizedSchemaSnapshot, SchemaSnapshot, SnapshotFieldConfig, TailorDBSnapshotType } from "./commands/tailordb/migrate/snapshot-types.mjs";
12
13
  import { BreakingChangeInfo, MigrationDiff, formatDiffSummary, formatMigrationDiff, hasChanges } from "./commands/tailordb/migrate/diff-calculator.mjs";
13
14
  import { MIGRATION_LABEL_KEY } from "./commands/tailordb/migrate/types.mjs";
@@ -15,15 +16,12 @@ import { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE
15
16
  import { DeployOptions, deploy } from "./commands/deploy/deploy.mjs";
16
17
  import { GenerateOptions } from "./commands/generate/options.mjs";
17
18
  import { generate } from "./commands/generate/service.mjs";
19
+ import { ErrorToJsonOptions, errorToJson, serializeError } from "./shared/error-json.mjs";
18
20
  import { generateUserTypes } from "./shared/type-generator.mjs";
19
21
  import { LoadTailorDBNamespacesOptions, LoadedTailorDBNamespaces, TailorDBNamespaceSelector, loadTailorDBNamespaces } from "./shared/tailordb-namespaces.mjs";
20
22
  import { DeployResult, deployStaticWebsite } from "./commands/staticwebsite/deploy.mjs";
21
23
  import { assertWritable } from "./shared/readonly-guard.mjs";
22
24
  import { isPluginGeneratedType } from "../parser/service/tailordb/type-source.mjs";
23
- import { kyselyTypePlugin } from "../plugin/builtin/kysely-type/index.mjs";
24
- import { enumConstantsPlugin } from "../plugin/builtin/enum-constants/index.mjs";
25
- import { fileUtilsPlugin } from "../plugin/builtin/file-utils/index.mjs";
26
- import { seedPlugin } from "../plugin/builtin/seed/index.mjs";
27
25
  import { AIGatewayInfo, ApplicationInfo, ShowInfo, ShowOptions, show } from "./commands/show.mjs";
28
26
  import { RemoveOptions, remove } from "./commands/remove.mjs";
29
27
  import { WorkspaceDetails, WorkspaceInfo } from "./commands/workspace/transform.mjs";
@@ -50,17 +48,17 @@ import { GetOAuth2ClientOptions, getOAuth2Client } from "./commands/oauth2client
50
48
  import { ListOAuth2ClientsOptions, listOAuth2Clients } from "./commands/oauth2client/list.mjs";
51
49
  import { WorkflowExecutionInfo, WorkflowInfo, WorkflowJobExecutionInfo, WorkflowListInfo } from "./commands/workflow/transform.mjs";
52
50
  import { ListWorkflowsOptions, listWorkflows } from "./commands/workflow/list.mjs";
53
- import { GetWorkflowOptions, GetWorkflowTypedOptions, getWorkflow } from "./commands/workflow/get.mjs";
51
+ import { GetWorkflowTypedOptions, getWorkflow } from "./commands/workflow/get.mjs";
54
52
  import { WaitWorkflowExecutionOptions, WorkflowWaitResult } from "./commands/workflow/waiter.mjs";
55
- import { StartWorkflowOptions, StartWorkflowResultWithWait, StartWorkflowTypedOptions, WaitOptions, startWorkflow } from "./commands/workflow/start.mjs";
56
- import { GetWorkflowExecutionOptions, GetWorkflowExecutionResult, ListWorkflowExecutionsOptions, ListWorkflowExecutionsTypedOptions, WorkflowExecutionWaitInfo, getWorkflowExecution, listWorkflowExecutions } from "./commands/workflow/executions.mjs";
53
+ import { StartWorkflowResultWithWait, StartWorkflowTypedOptions, WaitOptions, startWorkflow } from "./commands/workflow/start.mjs";
54
+ import { GetWorkflowExecutionOptions, GetWorkflowExecutionResult, ListWorkflowExecutionsTypedOptions, WorkflowExecutionWaitInfo, getWorkflowExecution, listWorkflowExecutions } from "./commands/workflow/executions.mjs";
57
55
  import { WorkflowWaitOutput, waitWorkflowExecution } from "./commands/workflow/wait.mjs";
58
56
  import { ResumeWorkflowOptions, ResumeWorkflowResultWithWait, resumeWorkflow } from "./commands/workflow/resume.mjs";
59
- import { TriggerExecutorOptions, TriggerExecutorResult, TriggerExecutorTypedOptions, triggerExecutor } from "./commands/executor/trigger.mjs";
57
+ import { TriggerExecutorResult, TriggerExecutorTypedOptions, triggerExecutor } from "./commands/executor/trigger.mjs";
60
58
  import { ExecutorInfo, ExecutorJobAttemptInfo, ExecutorJobInfo, ExecutorJobListInfo, ExecutorListInfo } from "./commands/executor/transform.mjs";
61
- import { ExecutorJobDetailInfo, GetExecutorJobOptions, GetExecutorJobTypedOptions, ListExecutorJobsOptions, ListExecutorJobsTypedOptions, WatchExecutorJobOptions, WatchExecutorJobResult, WatchExecutorJobTypedOptions, getExecutorJob, getExecutorWaitFailureMessage, listExecutorJobs, watchExecutorJob } from "./commands/executor/jobs.mjs";
59
+ import { ExecutorJobDetailInfo, GetExecutorJobTypedOptions, ListExecutorJobsTypedOptions, WatchExecutorJobResult, WatchExecutorJobTypedOptions, getExecutorJob, getExecutorWaitFailureMessage, listExecutorJobs, watchExecutorJob } from "./commands/executor/jobs.mjs";
62
60
  import { ListExecutorsOptions, listExecutors } from "./commands/executor/list.mjs";
63
- import { GetExecutorOptions, GetExecutorTypedOptions, getExecutor } from "./commands/executor/get.mjs";
61
+ import { GetExecutorTypedOptions, getExecutor } from "./commands/executor/get.mjs";
64
62
  import { ListWebhookExecutorsOptions, WebhookExecutorInfo, listWebhookExecutors } from "./commands/executor/webhook.mjs";
65
63
  import { FolderInfo, FolderListInfo, OrganizationInfo, UserOrganizationInfo } from "./commands/organization/transform.mjs";
66
64
  import { ListOrganizationsOptions, listOrganizations } from "./commands/organization/list.mjs";
@@ -78,7 +76,6 @@ import "./commands/api/index.mjs";
78
76
  import { query } from "./query/index.mjs";
79
77
  import { TruncateOptions, truncate } from "./commands/tailordb/truncate.mjs";
80
78
  import { GenerateOptions as GenerateOptions$1, generate as generate$1 } from "./commands/tailordb/migrate/generate.mjs";
81
- import { NamespaceWithMigrations, getNamespacesWithMigrations } from "./commands/tailordb/migrate/config.mjs";
82
79
  import { SeedNamespaceConfig } from "../plugin/builtin/seed/seed-type-processor.mjs";
83
80
  import { LoadSeedContextOptions, SeedContext, SeedIdpUserContext, loadSeedContext } from "./shared/seed-context.mjs";
84
81
  import { ChunkSeedDataOptions, SeedChunk, SeedData, chunkSeedData } from "./shared/seed-chunker.mjs";
@@ -86,4 +83,4 @@ import { SeedBundleResult, bundleSeedScript } from "./commands/generate/seed/bun
86
83
  import { MigrationBundleResult, bundleMigrationScript } from "./commands/tailordb/migrate/bundler.mjs";
87
84
  import { ExecutionWaitResult, ScriptExecutionOptions, ScriptExecutionResult, ScriptInvoker, executeScript, waitForExecution } from "./shared/script-executor.mjs";
88
85
  import { MachineUserName } from "@tailor-platform/sdk";
89
- export { type AIGatewayInfo, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type DeployOptions, type ExecutionWaitResult, type Executor, type ExecutorInfo, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobOptions, type GetExecutorJobTypedOptions, type GetExecutorOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadSeedContextOptions, type LoadTailorDBNamespacesOptions, type LoadedConfig, type LoadedTailorDBNamespaces, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserName, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type NamespaceWithMigrations, type NormalizedSchemaSnapshot, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OperatorFieldConfig, type OrganizationInfo, type OrganizationTreeOptions, type ParsedField, type Plugin, type PluginAttachment, type PluginGeneratedTypeSource, type RemoveOptions, type RemoveUserOptions, type Resolver, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type ScriptInvoker, type SeedBundleResult, type SeedChunk, type SeedContext, type SeedData, type SeedIdpUserContext, type SeedNamespaceConfig, type ShowInfo, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowOptions, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type DeployResult as StaticWebsiteDeployResult, type TailorDBNamespaceData, type TailorDBNamespaceSelector, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorOptions, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WaitWorkflowExecutionOptions, type WatchExecutorJobOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, assertWritable, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, deployStaticWebsite, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, isPluginGeneratedType, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadSeedContext, loadTailorDBNamespaces, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
86
+ export { type AIGatewayInfo, type ApiCallOptions, type ApiCallResult, type AppHealthInfo, type AppInfo, type ApplicationInfo, type DeployOptions as ApplyOptions, type AuthInvoker, type BreakingChangeInfo, type BundledScripts, type ChunkSeedDataOptions, type CreateFolderOptions, type CreateWorkspaceOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, type DeleteFolderOptions, type DeleteWorkspaceOptions, type DeployOptions, type ErrorToJsonOptions, type ExecutionWaitResult, type Executor, type ExecutorInfo, type ExecutorJobAttemptInfo, type ExecutorJobDetailInfo, type ExecutorJobInfo, type ExecutorJobListInfo, type ExecutorListInfo, type FolderInfo, type FolderListInfo, type FunctionRegistryInfo, type GenerateOptions, type GeneratorResult, type HealthOptions as GetAppHealthOptions, type GetExecutorJobTypedOptions, type GetExecutorTypedOptions, type GetFolderOptions, type GetFunctionRegistryOptions, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetOrganizationOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowTypedOptions, type GetWorkspaceOptions, INITIAL_SCHEMA_NUMBER, type InviteUserOptions, type ListAppsOptions, type ListExecutorJobsTypedOptions, type ListExecutorsOptions, type ListFoldersOptions, type ListFunctionRegistriesOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListOrganizationsOptions, type ListUsersOptions, type ListWebhookExecutorsOptions, type ListWorkflowExecutionsTypedOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type LoadSeedContextOptions, type LoadTailorDBNamespacesOptions, type LoadedConfig, type LoadedTailorDBNamespaces, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, type MachineUserInfo, type MachineUserName, type MachineUserTokenInfo, type GenerateOptions$1 as MigrateGenerateOptions, type MigrationBundleResult, type MigrationDiff, type NamespaceWithMigrations, type NormalizedSchemaSnapshot, type OAuth2ClientCredentials, type OAuth2ClientInfo, type OperatorClient, type OperatorFieldConfig, type OrganizationInfo, type OrganizationTreeOptions, type ParsedField, type Plugin, type PluginAttachment, type PluginGeneratedTypeSource, type RemoveOptions, type RemoveUserOptions, type Resolver, type RestoreWorkspaceOptions, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, SCHEMA_FILE_NAME, type SchemaSnapshot, type ScriptExecutionOptions, type ScriptExecutionResult, type ScriptInvoker, type SeedBundleResult, type SeedChunk, type SeedContext, type SeedData, type SeedIdpUserContext, type SeedNamespaceConfig, type ShowInfo, type ShowOptions, type SnapshotFieldConfig, type StartWorkflowResultWithWait, type StartWorkflowTypedOptions, type DeployResult as StaticWebsiteDeployResult, type TailorDBNamespaceData, type TailorDBNamespaceSelector, type TailorDBSnapshotType, type TailorDBType, type TriggerExecutorResult, type TriggerExecutorTypedOptions, type TruncateOptions, type TypeSourceInfoEntry, type UpdateFolderOptions, type UpdateOrganizationOptions, type UpdateUserOptions, type UserInfo, type UserOrganizationInfo, type WaitOptions, type WaitWorkflowExecutionOptions, type WatchExecutorJobResult, type WatchExecutorJobTypedOptions, type WebhookExecutorInfo, type WorkflowExecutionInfo, type WorkflowExecutionWaitInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkflowWaitOutput, type WorkflowWaitResult, type WorkspaceDetails, type WorkspaceInfo, apiCall, deploy as apply, assertWritable, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deploy, deployStaticWebsite, errorToJson, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, isPluginGeneratedType, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadSeedContext, loadTailorDBNamespaces, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, serializeError, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
package/dist/cli/lib.mjs CHANGED
@@ -1,12 +1,9 @@
1
1
  import { t as assertDefined } from "../assert-DBxo8jPo.mjs";
2
- import { $ as updateFolder, $t as waitForExecution, A as generate$1, C as waitWorkflowExecution, Cn as reconstructSnapshotFromMigrations, D as listWorkflows, Dn as formatMigrationDiff, Dt as listExecutors, En as formatDiffSummary, Fn as apiCall, G as updateOrganization, H as remove, Hn as loadAccessToken, Ht as getExecutor, In as assertWritable, It as getWorkflow, Jn as loadWorkspaceId, Jt as createWorkspace, K as organizationTree, Kt as listWorkspaces, L as deployStaticWebsite, Ln as loadConfig, Mn as PluginManager, Mt as watchExecutorJob, Nn as generateUserTypes, O as truncate, On as hasChanges, Ot as getExecutorJob, Pt as startWorkflow, Qt as executeScript, R as show, Rt as getWorkflowExecution, St as listWebhookExecutors, T as resumeWorkflow, Tt as triggerExecutor, Ut as deploy, Y as listOrganizations, Z as getOrganization, _ as deleteWorkspace, _n as getMigrationDirPath, _t as getAuthInput, a as updateUser, at as deleteFolder, b as getAppHealth, bn as getNextMigrationNumber, cn as DIFF_FILE_NAME, d as inviteUser, dn as SCHEMA_FILE_NAME, dt as getOAuth2Client, en as bundleMigrationScript, ft as getMachineUserToken, gn as getLatestMigrationNumber, gt as generate, h as getWorkspace, hn as createSnapshotFromLocalTypes, ht as listMachineUsers, jt as listExecutorJobs, kn as getNamespacesWithMigrations, kt as getExecutorWaitFailureMessage, l as listUsers, ln as INITIAL_SCHEMA_NUMBER, lt as listOAuth2Clients, mn as compareSnapshots, n as query, p as restoreWorkspace, pn as compareLocalTypesWithSnapshot, rt as getFolder, s as removeUser, sn as DB_TYPES_FILE_NAME, st as createFolder, t as registerTsHook, tn as MIGRATION_LABEL_KEY, tt as listFolders, un as MIGRATE_FILE_NAME, v as listApps, vn as getMigrationFilePath, xt as getFunctionRegistry, yn as getMigrationFiles, yt as listFunctionRegistries, zt as listWorkflowExecutions } from "../register-ts-hook-DgnmGTCt.mjs";
3
- import { B as initOperatorClient, _ as platformBundleDefinePlugin, m as assertUniqueLocalTailorDBTypeNames, t as defineApplication, w as getDistDir } from "../application-D_oSqto2.mjs";
2
+ import { $ as getOrganization, A as truncate, At as getExecutorJob, B as show, Bt as getWorkflowExecution, Cn as createSnapshotFromLocalTypes, Ct as getFunctionRegistry, D as resumeWorkflow, Dn as getMigrationFilePath, Dt as triggerExecutor, En as getMigrationDirPath, Fn as formatMigrationDiff, Gn as generateUserTypes, Gt as deploy, In as hasChanges, It as startWorkflow, J as organizationTree, Jn as assertWritable, Jt as listWorkspaces, Ln as getNamespacesWithMigrations, M as generate$1, Nt as listExecutorJobs, On as getMigrationFiles, Pn as formatDiffSummary, Pt as watchExecutorJob, Rt as getWorkflow, S as getAppHealth, Sn as compareSnapshots, T as waitWorkflowExecution, Tn as getLatestMigrationNumber, Vt as listWorkflowExecutions, W as remove, Wn as PluginManager, Wt as getExecutor, Xt as createWorkspace, Yn as loadConfig, Z as listOrganizations, _ as getWorkspace, _n as MIGRATE_FILE_NAME, _t as listMachineUsers, at as getFolder, b as listApps, d as listUsers, dt as listOAuth2Clients, en as executeScript, er as loadAccessToken, gn as INITIAL_SCHEMA_NUMBER, h as restoreWorkspace, hn as DIFF_FILE_NAME, i as query, jn as reconstructSnapshotFromMigrations, jt as getExecutorWaitFailureMessage, k as listWorkflows, kn as getNextMigrationNumber, kt as listExecutors, l as removeUser, lt as createFolder, mn as DB_TYPES_FILE_NAME, mt as getMachineUserToken, n as errorToJson, nn as bundleMigrationScript, or as loadWorkspaceId, p as inviteUser, pt as getOAuth2Client, q as updateOrganization, qn as apiCall, r as serializeError, rt as listFolders, s as updateUser, sn as MIGRATION_LABEL_KEY, st as deleteFolder, t as registerTsHook, tn as waitForExecution, tt as updateFolder, vn as SCHEMA_FILE_NAME, vt as generate, wt as listWebhookExecutors, xn as compareLocalTypesWithSnapshot, xt as listFunctionRegistries, y as deleteWorkspace, yt as getAuthInput, z as deployStaticWebsite } from "../register-ts-hook-LYV7zH-e.mjs";
3
+ import { G as initOperatorClient, T as createBundleLog, h as assertUniqueLocalTailorDBTypeNames, k as getDistDir, t as defineApplication, v as createGeneratedEntryResolverPlugin, x as platformBundleDefinePlugin, y as createTsconfigPathsPlugin } from "../application-CM6hKnSK.mjs";
4
4
  import { t as multiline } from "../multiline-sfHpTZZK.mjs";
5
5
  import { t as isPluginGeneratedType } from "../type-source-DH_LH20p.mjs";
6
- import { n as kyselyTypePlugin } from "../kysely-type-DqIRgDYR.mjs";
7
- import { n as enumConstantsPlugin } from "../enum-constants-j9QBF0cB.mjs";
8
- import { n as fileUtilsPlugin } from "../file-utils-yEiIS4nJ.mjs";
9
- import { a as processIdpUser, i as generateIdpTruncateScriptCode, n as seedPlugin, r as generateIdpSeedScriptCode, t as SeedGeneratorID } from "../seed-LUVr7jHL.mjs";
6
+ import { a as generateIdpTruncateScriptCode, i as generateIdpSeedScriptCode, o as processIdpUser, r as processLinesDb, t as SeedGeneratorID } from "../seed-B-yckgQY.mjs";
10
7
  import * as path from "pathe";
11
8
  import { resolveTSConfig } from "pkg-types";
12
9
  import * as fs from "node:fs";
@@ -107,17 +104,21 @@ function buildSeedNamespaceConfigs(tailordb) {
107
104
  const types = [];
108
105
  const dependencies = {};
109
106
  const selfRefTypes = [];
110
- for (const type of Object.values(ns.types)) {
107
+ const requiredFields = {};
108
+ for (const [typeName, type] of Object.entries(ns.types)) {
111
109
  const typeInfo = processSeedTypeInfo(type, ns.namespace);
112
110
  types.push(typeInfo.name);
113
111
  dependencies[typeInfo.name] = typeInfo.dependencies;
114
112
  if (typeInfo.selfRefFields.length > 0) selfRefTypes.push(typeInfo.name);
113
+ const linesDb = processLinesDb(type, assertDefined(ns.sourceInfo.get(typeName), `source info missing for type: ${typeName}`));
114
+ requiredFields[typeInfo.name] = Object.entries(type.fields).filter(([fieldName, field]) => field.config.required !== false && !linesDb.optionalFields.includes(fieldName) && !linesDb.omitFields.includes(fieldName)).map(([fieldName]) => fieldName);
115
115
  }
116
116
  return {
117
117
  namespace: ns.namespace,
118
118
  types,
119
119
  dependencies,
120
- selfRefTypes
120
+ selfRefTypes,
121
+ requiredFields
121
122
  };
122
123
  });
123
124
  }
@@ -310,11 +311,12 @@ function generateSeedScriptContent(namespace) {
310
311
  data: Record<string, Record<string, unknown>[]>;
311
312
  order: string[];
312
313
  selfRefTypes: string[];
314
+ upsert?: boolean;
313
315
  };
314
316
 
315
317
  type SeedResult = {
316
318
  success: boolean;
317
- processed: Record<string, number>;
319
+ processed: Record<string, { inserted: number; updated: number; skipped: number }>;
318
320
  errors: string[];
319
321
  };
320
322
 
@@ -327,9 +329,13 @@ function generateSeedScriptContent(namespace) {
327
329
 
328
330
  export async function main(input: SeedInput): Promise<SeedResult> {
329
331
  const db = getDB("${namespace}");
330
- const processed: Record<string, number> = {};
332
+ const processed: Record<
333
+ string,
334
+ { inserted: number; updated: number; skipped: number }
335
+ > = {};
331
336
  const errors: string[] = [];
332
337
  const BATCH_SIZE = ${String(BATCH_SIZE)};
338
+ const upsert = input.upsert === true;
333
339
 
334
340
  for (const typeName of input.order) {
335
341
  const records = input.data[typeName];
@@ -338,25 +344,68 @@ function generateSeedScriptContent(namespace) {
338
344
  continue;
339
345
  }
340
346
 
341
- processed[typeName] = 0;
347
+ processed[typeName] = { inserted: 0, updated: 0, skipped: 0 };
342
348
  const hasSelfRef = (input.selfRefTypes || []).includes(typeName);
343
349
 
344
350
  try {
351
+ let recordsToInsert = records;
352
+ let recordsToUpdate: Record<string, unknown>[] = [];
353
+ if (upsert) {
354
+ const existing = await db
355
+ .selectFrom(typeName)
356
+ .select("id")
357
+ .where(
358
+ "id",
359
+ "in",
360
+ records.map((record) => record.id),
361
+ )
362
+ .execute();
363
+ const existingIds = new Set(existing.map((record) => record.id));
364
+ recordsToInsert = records.filter((record) => !existingIds.has(record.id));
365
+ recordsToUpdate = records.filter((record) => existingIds.has(record.id));
366
+ }
367
+
345
368
  if (hasSelfRef) {
346
369
  // Insert one-by-one to respect self-referencing foreign key order
347
- for (const record of records) {
370
+ for (const record of recordsToInsert) {
348
371
  await db.insertInto(typeName).values(record).execute();
349
- processed[typeName] += 1;
372
+ processed[typeName].inserted += 1;
373
+ }
374
+ if (!upsert) {
375
+ console.log(
376
+ \`[${namespace}] \${typeName}: \${processed[typeName].inserted}/\${records.length} (one-by-one)\`,
377
+ );
350
378
  }
351
- console.log(\`[${namespace}] \${typeName}: \${processed[typeName]}/\${records.length} (one-by-one)\`);
352
379
  } else {
353
- for (let i = 0; i < records.length; i += BATCH_SIZE) {
354
- const batch = records.slice(i, i + BATCH_SIZE);
380
+ for (let i = 0; i < recordsToInsert.length; i += BATCH_SIZE) {
381
+ const batch = recordsToInsert.slice(i, i + BATCH_SIZE);
355
382
  await db.insertInto(typeName).values(batch).execute();
356
- processed[typeName] += batch.length;
357
- console.log(\`[${namespace}] \${typeName}: \${processed[typeName]}/\${records.length}\`);
383
+ processed[typeName].inserted += batch.length;
384
+ if (!upsert) {
385
+ console.log(
386
+ \`[${namespace}] \${typeName}: \${processed[typeName].inserted}/\${records.length}\`,
387
+ );
388
+ }
358
389
  }
359
390
  }
391
+
392
+ for (const record of recordsToUpdate) {
393
+ const { id, ...values } = record;
394
+ if (Object.keys(values).length === 0) {
395
+ processed[typeName].skipped += 1;
396
+ continue;
397
+ }
398
+ await db.updateTable(typeName).set(values).where("id", "=", id).execute();
399
+ processed[typeName].updated += 1;
400
+ }
401
+
402
+ const counts = processed[typeName];
403
+ if (upsert) {
404
+ const skipped = counts.skipped > 0 ? \`, \${counts.skipped} skipped\` : "";
405
+ console.log(
406
+ \`[${namespace}] \${typeName}: \${counts.inserted} inserted, \${counts.updated} updated\${skipped}\`,
407
+ );
408
+ }
360
409
  } catch (error) {
361
410
  const message = error instanceof Error ? error.message : String(error);
362
411
  errors.push(\`\${typeName}: \${message}\`);
@@ -382,9 +431,10 @@ function generateSeedScriptContent(namespace) {
382
431
  * 4. Exports as main() for TestExecScript
383
432
  * @param namespace - TailorDB namespace
384
433
  * @param typeNames - List of type names to include in the seed
434
+ * @param baseDir - Directory whose dependencies and tsconfig the generated entry uses
385
435
  * @returns Bundled seed script result
386
436
  */
387
- async function bundleSeedScript(namespace, typeNames) {
437
+ async function bundleSeedScript(namespace, typeNames, baseDir = process.cwd()) {
388
438
  const outputDir = path.resolve(getDistDir(), "seed");
389
439
  fs.mkdirSync(outputDir, { recursive: true });
390
440
  const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);
@@ -392,33 +442,40 @@ async function bundleSeedScript(namespace, typeNames) {
392
442
  fs.writeFileSync(entryPath, entryContent);
393
443
  let tsconfig;
394
444
  try {
395
- tsconfig = await resolveTSConfig();
445
+ tsconfig = await resolveTSConfig(baseDir);
396
446
  } catch {
397
447
  tsconfig = void 0;
398
448
  }
449
+ const bundleLog = createBundleLog({ tsconfig });
450
+ const result = await rolldown.build({
451
+ plugins: [
452
+ createGeneratedEntryResolverPlugin(entryPath, baseDir),
453
+ createTsconfigPathsPlugin(),
454
+ platformBundleDefinePlugin
455
+ ],
456
+ input: entryPath,
457
+ write: false,
458
+ output: {
459
+ format: "esm",
460
+ sourcemap: false,
461
+ minify: false,
462
+ codeSplitting: false,
463
+ globals: { tailordb: "tailordb" }
464
+ },
465
+ external: ["tailordb"],
466
+ resolve: { conditionNames: ["node", "import"] },
467
+ tsconfig,
468
+ treeshake: {
469
+ moduleSideEffects: false,
470
+ annotations: true,
471
+ unknownGlobalSideEffects: false
472
+ },
473
+ ...bundleLog.options
474
+ });
475
+ bundleLog.assertAllResolved();
399
476
  return {
400
477
  namespace,
401
- bundledCode: (await rolldown.build({
402
- plugins: [platformBundleDefinePlugin],
403
- input: entryPath,
404
- write: false,
405
- output: {
406
- format: "esm",
407
- sourcemap: false,
408
- minify: false,
409
- codeSplitting: false,
410
- globals: { tailordb: "tailordb" }
411
- },
412
- external: ["tailordb"],
413
- resolve: { conditionNames: ["node", "import"] },
414
- tsconfig,
415
- treeshake: {
416
- moduleSideEffects: false,
417
- annotations: true,
418
- unknownGlobalSideEffects: false
419
- },
420
- logLevel: "silent"
421
- })).output[0].code,
478
+ bundledCode: result.output[0].code,
422
479
  typesIncluded: typeNames
423
480
  };
424
481
  }
@@ -428,5 +485,5 @@ async function bundleSeedScript(namespace, typeNames) {
428
485
  await registerTsHook(new URL("./ts-hook.mjs", import.meta.url));
429
486
 
430
487
  //#endregion
431
- export { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, SCHEMA_FILE_NAME, apiCall, deploy as apply, deploy, assertWritable, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deployStaticWebsite, enumConstantsPlugin, executeScript, fileUtilsPlugin, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, isPluginGeneratedType, kyselyTypePlugin, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadSeedContext, loadTailorDBNamespaces, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, seedPlugin, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
488
+ export { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATION_LABEL_KEY, SCHEMA_FILE_NAME, apiCall, deploy as apply, deploy, assertWritable, bundleMigrationScript, bundleSeedScript, chunkSeedData, compareLocalTypesWithSnapshot, compareSnapshots, createFolder, createSnapshotFromLocalTypes, createWorkspace, deleteFolder, deleteWorkspace, deployStaticWebsite, errorToJson, executeScript, formatDiffSummary, formatMigrationDiff, generate, generateUserTypes, getAppHealth, getExecutor, getExecutorJob, getExecutorWaitFailureMessage, getFolder, getFunctionRegistry, getLatestMigrationNumber, getMachineUserToken, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNamespacesWithMigrations, getNextMigrationNumber, getOAuth2Client, getOrganization, getWorkflow, getWorkflowExecution, getWorkspace, hasChanges, initOperatorClient, inviteUser, isPluginGeneratedType, listApps, listExecutorJobs, listExecutors, listFolders, listFunctionRegistries, listMachineUsers, listOAuth2Clients, listOrganizations, listUsers, listWebhookExecutors, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadSeedContext, loadTailorDBNamespaces, loadWorkspaceId, generate$1 as migrateGenerate, organizationTree, query, reconstructSnapshotFromMigrations, remove, removeUser, restoreWorkspace, resumeWorkflow, serializeError, show, startWorkflow, triggerExecutor, truncate, updateFolder, updateOrganization, updateUser, waitForExecution, waitWorkflowExecution, watchExecutorJob };
432
489
  //# sourceMappingURL=lib.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/shared/tailordb-namespaces.ts","../../src/plugin/builtin/seed/seed-type-processor.ts","../../src/cli/shared/seed-context.ts","../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["import { defineApplication, type Application } from \"#/cli/services/application\";\nimport { PluginManager } from \"#/plugin/manager\";\nimport { loadConfig, type LoadedConfig } from \"./config-loader\";\nimport { generateUserTypes } from \"./type-generator\";\nimport type { Plugin, TailorDBNamespaceData } from \"#/plugin/types\";\n\n/**\n * Namespace selection for {@link loadTailorDBNamespaces}: explicit namespace\n * names, or a selector deriving them from the loaded config and its plugins.\n * Returning `undefined` (or omitting the option) loads all owned namespaces.\n */\nexport type TailorDBNamespaceSelector =\n | string[]\n | ((config: LoadedConfig, plugins: Plugin[]) => string[] | undefined);\n\n/**\n * Options for {@link loadTailorDBNamespaces}.\n */\nexport interface LoadTailorDBNamespacesOptions {\n /** Path to tailor.config.ts. Defaults to searching from the current directory. */\n configPath?: string;\n /** Namespaces to load. Omit to load all owned namespaces. */\n namespaces?: TailorDBNamespaceSelector;\n}\n\n/**\n * Result of {@link loadTailorDBNamespaces}.\n */\nexport interface LoadedTailorDBNamespaces {\n /** The loaded Tailor config. */\n config: LoadedConfig;\n /** Plugins collected from the config module's plugin-array exports (typically `definePlugins()`). */\n plugins: Plugin[];\n /** Loaded TailorDB namespace data, in config order. */\n namespaces: TailorDBNamespaceData[];\n}\n\n/**\n * Result of {@link loadApplicationNamespaces}: the loaded namespaces plus the\n * config plugins and application they were loaded through.\n */\nexport interface LoadedApplicationNamespaces extends LoadedTailorDBNamespaces {\n /** Application defined from the loaded config. */\n application: Application;\n}\n\n/**\n * Load local TailorDB namespaces along with the config plugins and the\n * defined application. Internal superset of {@link loadTailorDBNamespaces}.\n * @param options - Namespace loading options.\n * @returns The loaded config, plugins, application, and TailorDB namespace data.\n */\nexport async function loadApplicationNamespaces(\n options: LoadTailorDBNamespacesOptions = {},\n): Promise<LoadedApplicationNamespaces> {\n const { config, plugins } = await loadConfig(options.configPath);\n\n await generateUserTypes({ config, configPath: config.path });\n\n const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : undefined;\n const application = defineApplication({\n config,\n pluginManager,\n });\n const namespaceNames =\n typeof options.namespaces === \"function\"\n ? options.namespaces(config, plugins)\n : options.namespaces;\n const namespaceFilter = namespaceNames ? new Set(namespaceNames) : undefined;\n const services = namespaceFilter\n ? application.tailorDBServices.filter((db) => namespaceFilter.has(db.namespace))\n : application.tailorDBServices;\n\n if (namespaceFilter && services.length !== namespaceFilter.size) {\n const found = new Set(services.map((db) => db.namespace));\n const missing = [...namespaceFilter].filter((ns) => !found.has(ns)).join(\", \");\n const available = application.tailorDBServices.map((db) => db.namespace).join(\", \");\n throw new Error(\n `TailorDB namespace \"${missing}\" not found in local config.db.` +\n (available ? ` Available owned namespaces: ${available}` : \"\"),\n );\n }\n\n const namespaces: TailorDBNamespaceData[] = [];\n\n for (const db of services) {\n await db.loadTypes();\n await db.processNamespacePlugins();\n namespaces.push({\n namespace: db.namespace,\n types: { ...db.types },\n sourceInfo: new Map(Object.entries(db.typeSourceInfo)),\n pluginAttachments: db.pluginAttachments,\n });\n }\n\n return { config, plugins, application, namespaces };\n}\n\n/**\n * Load local TailorDB namespaces exactly as SDK generation/deploy sees them:\n * the config is loaded, user types are generated, and each selected\n * namespace's types are loaded with namespace plugins applied.\n * @param options - Namespace loading options.\n * @returns The loaded config and TailorDB namespace data.\n */\nexport async function loadTailorDBNamespaces(\n options: LoadTailorDBNamespacesOptions = {},\n): Promise<LoadedTailorDBNamespaces> {\n const { config, plugins, namespaces } = await loadApplicationNamespaces(options);\n return { config, plugins, namespaces };\n}\n","import type { TailorDBType } from \"#/parser/service/tailordb/types\";\nimport type { TailorDBNamespaceData } from \"#/plugin/types\";\nimport type { SeedTypeInfo } from \"./types\";\n\n/**\n * Processes TailorDB types to extract seed type information\n * @param type - Parsed TailorDB type\n * @param namespace - Namespace of the type\n * @returns Seed type information\n */\nexport function processSeedTypeInfo(type: TailorDBType, namespace: string): SeedTypeInfo {\n // Extract dependencies from relations (including keyOnly which only sets foreignKeyType)\n const dependencies: Set<string> = new Set();\n const selfRefFields: string[] = [];\n\n for (const [fieldName, field] of Object.entries(type.fields)) {\n const targetType = field.relation?.targetType ?? field.config.foreignKeyType;\n if (!targetType) continue;\n\n if (targetType === type.name) {\n selfRefFields.push(fieldName);\n } else {\n dependencies.add(targetType);\n }\n }\n\n return {\n name: type.name,\n namespace,\n dependencies: Array.from(dependencies),\n selfRefFields,\n dataFile: `data/${type.name}.jsonl`,\n };\n}\n\n/**\n * Seed ordering information for a TailorDB namespace.\n */\nexport interface SeedNamespaceConfig {\n /** TailorDB namespace name. */\n namespace: string;\n /** Type names in the namespace, in definition order. */\n types: string[];\n /** Seed dependencies (referenced type names) per type. */\n dependencies: Record<string, string[]>;\n /** Types with self-referencing fields, seeded in two passes. */\n selfRefTypes: string[];\n}\n\n/**\n * Build per-namespace seed ordering information from TailorDB namespace data.\n * @param tailordb - TailorDB namespaces with their types\n * @returns Seed namespace configs, in namespace order\n */\nexport function buildSeedNamespaceConfigs(\n tailordb: TailorDBNamespaceData[],\n): SeedNamespaceConfig[] {\n return tailordb.map((ns) => {\n const types: string[] = [];\n const dependencies: Record<string, string[]> = {};\n const selfRefTypes: string[] = [];\n\n for (const type of Object.values(ns.types)) {\n const typeInfo = processSeedTypeInfo(type, ns.namespace);\n types.push(typeInfo.name);\n dependencies[typeInfo.name] = typeInfo.dependencies;\n if (typeInfo.selfRefFields.length > 0) {\n selfRefTypes.push(typeInfo.name);\n }\n }\n\n return { namespace: ns.namespace, types, dependencies, selfRefTypes };\n });\n}\n","import * as path from \"pathe\";\nimport { assertUniqueLocalTailorDBTypeNames } from \"#/cli/services/tailordb/type-name-validation\";\nimport {\n generateIdpSeedScriptCode,\n generateIdpTruncateScriptCode,\n processIdpUser,\n} from \"#/plugin/builtin/seed/idp-user-processor\";\nimport { SeedGeneratorID, type SeedPluginOptions } from \"#/plugin/builtin/seed/index\";\nimport {\n buildSeedNamespaceConfigs,\n type SeedNamespaceConfig,\n} from \"#/plugin/builtin/seed/seed-type-processor\";\nimport { getAuthInput } from \"./auth-input\";\nimport { loadApplicationNamespaces } from \"./tailordb-namespaces\";\nimport type { LoadedConfig } from \"./config-loader\";\n\nexport type { SeedNamespaceConfig };\n\n/**\n * IdP `_User` seeding context, present when the config uses the built-in IdP\n * with a user profile type.\n */\nexport interface SeedIdpUserContext {\n /** IdP namespace the `_User` records belong to. */\n idpNamespace: string;\n /** Server-side script that creates `_User` records from seed rows. */\n seedScriptCode: string;\n /** Server-side script that deletes all `_User` records. */\n truncateScriptCode: string;\n}\n\n/**\n * Everything a seed run needs from the local config: the seed data location,\n * per-namespace seeding order, and IdP user context.\n */\nexport interface SeedContext {\n /** The loaded Tailor config. */\n config: LoadedConfig;\n /** Absolute path to the seedPlugin output directory. */\n distPath: string;\n /** Default machine user name from seedPlugin options, if configured. */\n machineUserName?: string | undefined;\n /** Seed ordering information per TailorDB namespace. */\n namespaces: SeedNamespaceConfig[];\n /** IdP `_User` seeding context, or null when not applicable. */\n idpUser: SeedIdpUserContext | null;\n}\n\n/**\n * Options for {@link loadSeedContext}.\n */\nexport interface LoadSeedContextOptions {\n /** Path to tailor.config.ts. Defaults to searching from the current directory. */\n configPath?: string;\n}\n\n/**\n * Load the seed context from the local config. Requires `seedPlugin` to be\n * configured in the config's plugins. A relative `distPath` in the seedPlugin\n * options is resolved against the current working directory — the same base\n * `tailor generate` writes it to.\n * @param options - Seed context loading options.\n * @returns The seed context computed from the local config.\n */\nexport async function loadSeedContext(options: LoadSeedContextOptions = {}): Promise<SeedContext> {\n const { config, plugins, application, namespaces } = await loadApplicationNamespaces({\n configPath: options.configPath,\n });\n\n // Seed files and type filters identify types by bare name, so enforce the\n // same cross-namespace uniqueness that generation and deploy enforce.\n assertUniqueLocalTailorDBTypeNames({ tailorDBServices: application.tailorDBServices });\n\n const seedPlugin = plugins.find((plugin) => plugin.id === SeedGeneratorID);\n if (!seedPlugin) {\n throw new Error(\n `seedPlugin is not configured in ${config.path}. ` +\n 'Add seedPlugin({ distPath: \"./seed\" }) from \"@tailor-platform/sdk/plugin/seed\" to definePlugins().',\n );\n }\n const pluginOptions = seedPlugin.pluginConfig as SeedPluginOptions | undefined;\n if (typeof pluginOptions?.distPath !== \"string\" || pluginOptions.distPath === \"\") {\n throw new Error(\n `seedPlugin in ${config.path} has no distPath option. ` +\n 'Pass seedPlugin({ distPath: \"./seed\" }) so seed data has a location.',\n );\n }\n\n // userProfile is only populated once auth namespaces are resolved (the\n // generate flow does the same after loading TailorDB namespaces).\n await application.authService?.resolveNamespaces();\n const authInput = getAuthInput(application);\n const idpUserMeta = authInput ? processIdpUser(authInput) : undefined;\n const idpUser: SeedIdpUserContext | null = idpUserMeta\n ? {\n idpNamespace: idpUserMeta.idpNamespace,\n seedScriptCode: generateIdpSeedScriptCode(idpUserMeta.idpNamespace),\n truncateScriptCode: generateIdpTruncateScriptCode(idpUserMeta.idpNamespace),\n }\n : null;\n\n return {\n config,\n distPath: path.resolve(pluginOptions.distPath),\n machineUserName: pluginOptions.machineUserName,\n namespaces: buildSeedNamespaceConfigs(namespaces),\n idpUser,\n };\n}\n","/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"#/utils/assert\";\nimport type { JsonObject } from \"type-fest\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, JsonObject[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: JsonObject[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { getDistDir } from \"#/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"#/cli/shared/platform-bundle-plugin\";\nimport ml from \"#/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, number>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<string, number> = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = 0;\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of records) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName] += 1;\n }\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length} (one-by-one)\\`);\n } else {\n for (let i = 0; i < records.length; i += BATCH_SIZE) {\n const batch = records.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName] += batch.length;\n console.log(\\`[${namespace}] \\${typeName}: \\${processed[typeName]}/\\${records.length}\\`);\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n): Promise<SeedBundleResult> {\n // Output directory in .tailor (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig();\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const result = await rolldown.build({\n plugins: [platformBundleDefinePlugin],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n logLevel: \"silent\",\n } as rolldown.BuildOptions);\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport {\n loadTailorDBNamespaces,\n type TailorDBNamespaceSelector,\n type LoadTailorDBNamespacesOptions,\n type LoadedTailorDBNamespaces,\n} from \"./shared/tailordb-namespaces\";\nexport {\n deployStaticWebsite,\n type DeployResult as StaticWebsiteDeployResult,\n} from \"./commands/staticwebsite/deploy\";\nexport { assertWritable } from \"./shared/readonly-guard\";\nexport { isPluginGeneratedType } from \"#/parser/service/tailordb/type-source\";\nexport type {\n GeneratorResult,\n Plugin,\n PluginAttachment,\n TailorDBNamespaceData,\n} from \"#/plugin/types\";\nexport type {\n TailorDBType,\n TypeSourceInfoEntry,\n ParsedField,\n OperatorFieldConfig,\n PluginGeneratedTypeSource,\n} from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\n/** @deprecated Import from '@tailor-platform/sdk/plugin/kysely-type' instead */\nexport { kyselyTypePlugin } from \"#/plugin/builtin/kysely-type/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/enum-constants' instead */\nexport { enumConstantsPlugin } from \"#/plugin/builtin/enum-constants/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/file-utils' instead */\nexport { fileUtilsPlugin } from \"#/plugin/builtin/file-utils/index\";\n/** @deprecated Import from '@tailor-platform/sdk/plugin/seed' instead */\nexport { seedPlugin } from \"#/plugin/builtin/seed/index\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n} from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport {\n getWorkflow,\n type GetWorkflowOptions,\n type GetWorkflowTypedOptions,\n} from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorOptions,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsOptions,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport {\n getExecutor,\n type GetExecutorOptions,\n type GetExecutorTypedOptions,\n} from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport {\n loadSeedContext,\n type LoadSeedContextOptions,\n type SeedContext,\n type SeedIdpUserContext,\n type SeedNamespaceConfig,\n} from \"./shared/seed-context\";\nexport {\n chunkSeedData,\n type SeedChunk,\n type ChunkSeedDataOptions,\n type SeedData,\n} from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ScriptInvoker,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoDA,eAAsB,0BACpB,UAAyC,CAAC,GACJ;CACtC,MAAM,EAAE,QAAQ,YAAY,MAAM,WAAW,QAAQ,UAAU;CAE/D,MAAM,kBAAkB;EAAE;EAAQ,YAAY,OAAO;CAAK,CAAC;CAG3D,MAAM,cAAc,kBAAkB;EACpC;EACA,eAHoB,QAAQ,SAAS,IAAI,IAAI,cAAc,OAAO,IAAI;CAIxE,CAAC;CACD,MAAM,iBACJ,OAAO,QAAQ,eAAe,aAC1B,QAAQ,WAAW,QAAQ,OAAO,IAClC,QAAQ;CACd,MAAM,kBAAkB,iBAAiB,IAAI,IAAI,cAAc,IAAI;CACnE,MAAM,WAAW,kBACb,YAAY,iBAAiB,QAAQ,OAAO,gBAAgB,IAAI,GAAG,SAAS,CAAC,IAC7E,YAAY;CAEhB,IAAI,mBAAmB,SAAS,WAAW,gBAAgB,MAAM;EA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li/shared/tailordb-namespaces.ts","../../src/plugin/builtin/seed/seed-type-processor.ts","../../src/cli/shared/seed-context.ts","../../src/cli/shared/seed-chunker.ts","../../src/cli/commands/generate/seed/bundler.ts","../../src/cli/lib.ts"],"sourcesContent":["import { defineApplication, type Application } from \"#/cli/services/application\";\nimport { PluginManager } from \"#/plugin/manager\";\nimport { loadConfig, type LoadedConfig } from \"./config-loader\";\nimport { generateUserTypes } from \"./type-generator\";\nimport type { Plugin, TailorDBNamespaceData } from \"#/plugin/types\";\n\n/**\n * Namespace selection for {@link loadTailorDBNamespaces}: explicit namespace\n * names, or a selector deriving them from the loaded config and its plugins.\n * Returning `undefined` (or omitting the option) loads all owned namespaces.\n */\nexport type TailorDBNamespaceSelector =\n | string[]\n | ((config: LoadedConfig, plugins: Plugin[]) => string[] | undefined);\n\n/**\n * Options for {@link loadTailorDBNamespaces}.\n */\nexport interface LoadTailorDBNamespacesOptions {\n /** Path to tailor.config.ts. Defaults to searching from the current directory. */\n configPath?: string;\n /** Namespaces to load. Omit to load all owned namespaces. */\n namespaces?: TailorDBNamespaceSelector;\n}\n\n/**\n * Result of {@link loadTailorDBNamespaces}.\n */\nexport interface LoadedTailorDBNamespaces {\n /** The loaded Tailor config. */\n config: LoadedConfig;\n /** Plugins collected from the config module's plugin-array exports (typically `definePlugins()`). */\n plugins: Plugin[];\n /** Loaded TailorDB namespace data, in config order. */\n namespaces: TailorDBNamespaceData[];\n}\n\n/**\n * Result of {@link loadApplicationNamespaces}: the loaded namespaces plus the\n * config plugins and application they were loaded through.\n */\nexport interface LoadedApplicationNamespaces extends LoadedTailorDBNamespaces {\n /** Application defined from the loaded config. */\n application: Application;\n}\n\n/**\n * Load local TailorDB namespaces along with the config plugins and the\n * defined application. Internal superset of {@link loadTailorDBNamespaces}.\n * @param options - Namespace loading options.\n * @returns The loaded config, plugins, application, and TailorDB namespace data.\n */\nexport async function loadApplicationNamespaces(\n options: LoadTailorDBNamespacesOptions = {},\n): Promise<LoadedApplicationNamespaces> {\n const { config, plugins } = await loadConfig(options.configPath);\n\n await generateUserTypes({ config, configPath: config.path });\n\n const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : undefined;\n const application = defineApplication({\n config,\n pluginManager,\n });\n const namespaceNames =\n typeof options.namespaces === \"function\"\n ? options.namespaces(config, plugins)\n : options.namespaces;\n const namespaceFilter = namespaceNames ? new Set(namespaceNames) : undefined;\n const services = namespaceFilter\n ? application.tailorDBServices.filter((db) => namespaceFilter.has(db.namespace))\n : application.tailorDBServices;\n\n if (namespaceFilter && services.length !== namespaceFilter.size) {\n const found = new Set(services.map((db) => db.namespace));\n const missing = [...namespaceFilter].filter((ns) => !found.has(ns)).join(\", \");\n const available = application.tailorDBServices.map((db) => db.namespace).join(\", \");\n throw new Error(\n `TailorDB namespace \"${missing}\" not found in local config.db.` +\n (available ? ` Available owned namespaces: ${available}` : \"\"),\n );\n }\n\n const namespaces: TailorDBNamespaceData[] = [];\n\n for (const db of services) {\n await db.loadTypes();\n await db.processNamespacePlugins();\n namespaces.push({\n namespace: db.namespace,\n types: { ...db.types },\n sourceInfo: new Map(Object.entries(db.typeSourceInfo)),\n pluginAttachments: db.pluginAttachments,\n });\n }\n\n return { config, plugins, application, namespaces };\n}\n\n/**\n * Load local TailorDB namespaces exactly as SDK generation/deploy sees them:\n * the config is loaded, user types are generated, and each selected\n * namespace's types are loaded with namespace plugins applied.\n * @param options - Namespace loading options.\n * @returns The loaded config and TailorDB namespace data.\n */\nexport async function loadTailorDBNamespaces(\n options: LoadTailorDBNamespacesOptions = {},\n): Promise<LoadedTailorDBNamespaces> {\n const { config, plugins, namespaces } = await loadApplicationNamespaces(options);\n return { config, plugins, namespaces };\n}\n","import { assertDefined } from \"#/utils/assert\";\nimport { processLinesDb } from \"./lines-db-processor\";\nimport type { TailorDBType } from \"#/parser/service/tailordb/types\";\nimport type { TailorDBNamespaceData } from \"#/plugin/types\";\nimport type { SeedTypeInfo } from \"./types\";\n\n/**\n * Processes TailorDB types to extract seed type information\n * @param type - Parsed TailorDB type\n * @param namespace - Namespace of the type\n * @returns Seed type information\n */\nexport function processSeedTypeInfo(type: TailorDBType, namespace: string): SeedTypeInfo {\n // Extract dependencies from relations (including keyOnly which only sets foreignKeyType)\n const dependencies: Set<string> = new Set();\n const selfRefFields: string[] = [];\n\n for (const [fieldName, field] of Object.entries(type.fields)) {\n const targetType = field.relation?.targetType ?? field.config.foreignKeyType;\n if (!targetType) continue;\n\n if (targetType === type.name) {\n selfRefFields.push(fieldName);\n } else {\n dependencies.add(targetType);\n }\n }\n\n return {\n name: type.name,\n namespace,\n dependencies: Array.from(dependencies),\n selfRefFields,\n dataFile: `data/${type.name}.jsonl`,\n };\n}\n\n/**\n * Seed ordering information for a TailorDB namespace.\n */\nexport interface SeedNamespaceConfig {\n /** TailorDB namespace name. */\n namespace: string;\n /** Type names in the namespace, in definition order. */\n types: string[];\n /** Seed dependencies (referenced type names) per type. */\n dependencies: Record<string, string[]>;\n /** Types with self-referencing fields, seeded in two passes. */\n selfRefTypes: string[];\n /** Field names a seed row must supply per type, enforced with `--upsert`. */\n requiredFields: Record<string, string[]>;\n}\n\n/**\n * Build per-namespace seed ordering information from TailorDB namespace data.\n * @param tailordb - TailorDB namespaces with their types\n * @returns Seed namespace configs, in namespace order\n */\nexport function buildSeedNamespaceConfigs(\n tailordb: TailorDBNamespaceData[],\n): SeedNamespaceConfig[] {\n return tailordb.map((ns) => {\n const types: string[] = [];\n const dependencies: Record<string, string[]> = {};\n const selfRefTypes: string[] = [];\n const requiredFields: Record<string, string[]> = {};\n\n for (const [typeName, type] of Object.entries(ns.types)) {\n const typeInfo = processSeedTypeInfo(type, ns.namespace);\n types.push(typeInfo.name);\n dependencies[typeInfo.name] = typeInfo.dependencies;\n if (typeInfo.selfRefFields.length > 0) {\n selfRefTypes.push(typeInfo.name);\n }\n\n const source = assertDefined(\n ns.sourceInfo.get(typeName),\n `source info missing for type: ${typeName}`,\n );\n const linesDb = processLinesDb(type, source);\n requiredFields[typeInfo.name] = Object.entries(type.fields)\n .filter(\n ([fieldName, field]) =>\n field.config.required !== false &&\n !linesDb.optionalFields.includes(fieldName) &&\n !linesDb.omitFields.includes(fieldName),\n )\n .map(([fieldName]) => fieldName);\n }\n\n return {\n namespace: ns.namespace,\n types,\n dependencies,\n selfRefTypes,\n requiredFields,\n };\n });\n}\n","import * as path from \"pathe\";\nimport { assertUniqueLocalTailorDBTypeNames } from \"#/cli/services/tailordb/type-name-validation\";\nimport {\n generateIdpSeedScriptCode,\n generateIdpTruncateScriptCode,\n processIdpUser,\n} from \"#/plugin/builtin/seed/idp-user-processor\";\nimport { SeedGeneratorID, type SeedPluginOptions } from \"#/plugin/builtin/seed/index\";\nimport {\n buildSeedNamespaceConfigs,\n type SeedNamespaceConfig,\n} from \"#/plugin/builtin/seed/seed-type-processor\";\nimport { getAuthInput } from \"./auth-input\";\nimport { loadApplicationNamespaces } from \"./tailordb-namespaces\";\nimport type { LoadedConfig } from \"./config-loader\";\n\nexport type { SeedNamespaceConfig };\n\n/**\n * IdP `_User` seeding context, present when the config uses the built-in IdP\n * with a user profile type.\n */\nexport interface SeedIdpUserContext {\n /** IdP namespace the `_User` records belong to. */\n idpNamespace: string;\n /** Server-side script that creates `_User` records from seed rows. */\n seedScriptCode: string;\n /** Server-side script that deletes all `_User` records. */\n truncateScriptCode: string;\n}\n\n/**\n * Everything a seed run needs from the local config: the seed data location,\n * per-namespace seeding order, and IdP user context.\n */\nexport interface SeedContext {\n /** The loaded Tailor config. */\n config: LoadedConfig;\n /** Absolute path to the seedPlugin output directory. */\n distPath: string;\n /** Default machine user name from seedPlugin options, if configured. */\n machineUserName?: string | undefined;\n /** Seed ordering information per TailorDB namespace. */\n namespaces: SeedNamespaceConfig[];\n /** IdP `_User` seeding context, or null when not applicable. */\n idpUser: SeedIdpUserContext | null;\n}\n\n/**\n * Options for {@link loadSeedContext}.\n */\nexport interface LoadSeedContextOptions {\n /** Path to tailor.config.ts. Defaults to searching from the current directory. */\n configPath?: string;\n}\n\n/**\n * Load the seed context from the local config. Requires `seedPlugin` to be\n * configured in the config's plugins. A relative `distPath` in the seedPlugin\n * options is resolved against the current working directory — the same base\n * `tailor generate` writes it to.\n * @param options - Seed context loading options.\n * @returns The seed context computed from the local config.\n */\nexport async function loadSeedContext(options: LoadSeedContextOptions = {}): Promise<SeedContext> {\n const { config, plugins, application, namespaces } = await loadApplicationNamespaces({\n configPath: options.configPath,\n });\n\n // Seed files and type filters identify types by bare name, so enforce the\n // same cross-namespace uniqueness that generation and deploy enforce.\n assertUniqueLocalTailorDBTypeNames({ tailorDBServices: application.tailorDBServices });\n\n const seedPlugin = plugins.find((plugin) => plugin.id === SeedGeneratorID);\n if (!seedPlugin) {\n throw new Error(\n `seedPlugin is not configured in ${config.path}. ` +\n 'Add seedPlugin({ distPath: \"./seed\" }) from \"@tailor-platform/sdk/plugin/seed\" to definePlugins().',\n );\n }\n const pluginOptions = seedPlugin.pluginConfig as SeedPluginOptions | undefined;\n if (typeof pluginOptions?.distPath !== \"string\" || pluginOptions.distPath === \"\") {\n throw new Error(\n `seedPlugin in ${config.path} has no distPath option. ` +\n 'Pass seedPlugin({ distPath: \"./seed\" }) so seed data has a location.',\n );\n }\n\n // userProfile is only populated once auth namespaces are resolved (the\n // generate flow does the same after loading TailorDB namespaces).\n await application.authService?.resolveNamespaces();\n const authInput = getAuthInput(application);\n const idpUserMeta = authInput ? processIdpUser(authInput) : undefined;\n const idpUser: SeedIdpUserContext | null = idpUserMeta\n ? {\n idpNamespace: idpUserMeta.idpNamespace,\n seedScriptCode: generateIdpSeedScriptCode(idpUserMeta.idpNamespace),\n truncateScriptCode: generateIdpTruncateScriptCode(idpUserMeta.idpNamespace),\n }\n : null;\n\n return {\n config,\n distPath: path.resolve(pluginOptions.distPath),\n machineUserName: pluginOptions.machineUserName,\n namespaces: buildSeedNamespaceConfigs(namespaces),\n idpUser,\n };\n}\n","/**\n * Seed data chunker for splitting large seed data into manageable message sizes.\n *\n * When seed data exceeds the gRPC message size limit, this module splits the data\n * into multiple chunks at type boundaries (or record boundaries for large types).\n */\n\nimport { assertDefined } from \"#/utils/assert\";\nimport type { JsonObject } from \"type-fest\";\n\n/**\n * Seed data keyed by type name, with an array of records per type.\n */\nexport type SeedData = Record<string, JsonObject[]>;\n\n/**\n * A single chunk of seed data with metadata for ordered execution.\n */\nexport type SeedChunk = {\n data: SeedData;\n order: string[];\n index: number;\n total: number;\n};\n\n/**\n * Options for chunking seed data.\n */\nexport type ChunkSeedDataOptions = {\n /** Seed data keyed by type name */\n data: SeedData;\n /** Ordered list of type names (dependency order) */\n order: string[];\n /** Byte size of the bundled seed script code */\n codeByteSize: number;\n /** Maximum gRPC message size in bytes (default: 3.5MB) */\n maxMessageSize?: number;\n};\n\n/** Default maximum message size: 3.5MB (conservative limit for gRPC) */\nexport const DEFAULT_MAX_MESSAGE_SIZE = 3.5 * 1024 * 1024;\n\n/** Reserved bytes for message metadata overhead */\nconst METADATA_OVERHEAD = 1024;\n\n/**\n * Split seed data into chunks that fit within the gRPC message size limit.\n *\n * Algorithm:\n * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead)\n * 2. If all data fits in one message, return a single chunk\n * 3. Otherwise, iterate through types in dependency order:\n * - If a type fits in the current chunk, add it\n * - If adding a type would exceed the budget, finalize the current chunk and start a new one\n * - If a single type exceeds the budget, split its records across multiple chunks\n * - If a single record exceeds the budget, throw an error\n * @param options - Chunking options\n * @returns Array of seed chunks\n */\nexport function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[] {\n const { data, order, codeByteSize, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE } = options;\n\n const argBudget = maxMessageSize - codeByteSize - METADATA_OVERHEAD;\n if (argBudget <= 0) {\n throw new Error(\n `Code size (${codeByteSize} bytes) exceeds the message size limit (${maxMessageSize} bytes). ` +\n `No space left for seed data.`,\n );\n }\n\n // Filter to types that have data\n const typesWithData = order.filter((type) => (data[type]?.length ?? 0) > 0);\n\n if (typesWithData.length === 0) {\n return [];\n }\n\n // Check if all data fits in a single message\n const fullArg = JSON.stringify({ data, order });\n if (byteSize(fullArg) <= argBudget) {\n return [{ data, order, index: 0, total: 1 }];\n }\n\n // Split into multiple chunks\n const chunks: Omit<SeedChunk, \"total\">[] = [];\n let currentData: SeedData = {};\n let currentOrder: string[] = [];\n\n for (const type of typesWithData) {\n const typeRecords = assertDefined(data[type], `seed data missing for type: ${type}`);\n\n // Check if the type fits in the current chunk\n if (currentOrder.length > 0) {\n const testData = { ...currentData, [type]: typeRecords };\n const testOrder = [...currentOrder, type];\n if (byteSize(JSON.stringify({ data: testData, order: testOrder })) > argBudget) {\n // Finalize the current chunk\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n }\n\n // Check if the entire type fits in an empty chunk\n if (byteSize(JSON.stringify({ data: { [type]: typeRecords }, order: [type] })) <= argBudget) {\n currentData[type] = typeRecords;\n currentOrder.push(type);\n continue;\n }\n\n // Type is too large — split by records\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n }\n\n let recordBatch: JsonObject[] = [];\n for (const record of typeRecords) {\n if (byteSize(JSON.stringify({ data: { [type]: [record] }, order: [type] })) > argBudget) {\n const singleRecordSize = byteSize(JSON.stringify(record));\n throw new Error(\n `A single record in type \"${type}\" (${singleRecordSize} bytes) exceeds the message size budget ` +\n `(${argBudget} bytes). Consider increasing maxMessageSize or reducing the record size.`,\n );\n }\n\n const testBatch = [...recordBatch, record];\n const testData = { ...currentData, [type]: testBatch };\n const testOrder = currentOrder.includes(type) ? currentOrder : [...currentOrder, type];\n const testSize = byteSize(JSON.stringify({ data: testData, order: testOrder }));\n\n if (testSize > argBudget && recordBatch.length > 0) {\n // Finalize current chunk with accumulated records\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n currentData = {};\n currentOrder = [];\n recordBatch = [record];\n } else {\n recordBatch = testBatch;\n }\n }\n\n // Add remaining records\n if (recordBatch.length > 0) {\n currentData[type] = recordBatch;\n if (!currentOrder.includes(type)) {\n currentOrder.push(type);\n }\n }\n }\n\n // Finalize the last chunk\n if (currentOrder.length > 0) {\n chunks.push({ data: currentData, order: currentOrder, index: chunks.length });\n }\n\n const total = chunks.length;\n return chunks.map((chunk) => ({ ...chunk, total }));\n}\n\nfunction byteSize(str: string): number {\n return new TextEncoder().encode(str).length;\n}\n","/**\n * Seed script bundler for TailorDB seed data\n *\n * Bundles seed scripts to be executed via TestExecScript API\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { resolveTSConfig } from \"pkg-types\";\nimport * as rolldown from \"rolldown\";\nimport { createBundleLog } from \"#/cli/shared/bundle-log\";\nimport { getDistDir } from \"#/cli/shared/dist-dir\";\nimport { platformBundleDefinePlugin } from \"#/cli/shared/platform-bundle-plugin\";\nimport { createTsconfigPathsPlugin } from \"#/cli/shared/tsconfig-paths-plugin\";\nimport { createGeneratedEntryResolverPlugin } from \"#/cli/shared/virtual-entry\";\nimport ml from \"#/utils/multiline\";\n\nexport type SeedBundleResult = {\n namespace: string;\n bundledCode: string;\n typesIncluded: string[];\n};\n\nconst BATCH_SIZE = 100;\n\n/**\n * Generate seed script content for server-side execution\n * @param namespace - TailorDB namespace\n * @returns Generated seed script content\n */\nfunction generateSeedScriptContent(namespace: string): string {\n return ml /* ts */ `\n import { Kysely, TailordbDialect } from \"@tailor-platform/sdk/kysely\";\n\n type SeedInput = {\n data: Record<string, Record<string, unknown>[]>;\n order: string[];\n selfRefTypes: string[];\n upsert?: boolean;\n };\n\n type SeedResult = {\n success: boolean;\n processed: Record<string, { inserted: number; updated: number; skipped: number }>;\n errors: string[];\n };\n\n function getDB(namespace: string) {\n const client = new tailordb.Client({ namespace });\n return new Kysely<Record<string, Record<string, unknown>>>({\n dialect: new TailordbDialect(client),\n });\n }\n\n export async function main(input: SeedInput): Promise<SeedResult> {\n const db = getDB(\"${namespace}\");\n const processed: Record<\n string,\n { inserted: number; updated: number; skipped: number }\n > = {};\n const errors: string[] = [];\n const BATCH_SIZE = ${String(BATCH_SIZE)};\n const upsert = input.upsert === true;\n\n for (const typeName of input.order) {\n const records = input.data[typeName];\n if (!records || records.length === 0) {\n console.log(\\`[${namespace}] \\${typeName}: skipped (no data)\\`);\n continue;\n }\n\n processed[typeName] = { inserted: 0, updated: 0, skipped: 0 };\n const hasSelfRef = (input.selfRefTypes || []).includes(typeName);\n\n try {\n let recordsToInsert = records;\n let recordsToUpdate: Record<string, unknown>[] = [];\n if (upsert) {\n const existing = await db\n .selectFrom(typeName)\n .select(\"id\")\n .where(\n \"id\",\n \"in\",\n records.map((record) => record.id),\n )\n .execute();\n const existingIds = new Set(existing.map((record) => record.id));\n recordsToInsert = records.filter((record) => !existingIds.has(record.id));\n recordsToUpdate = records.filter((record) => existingIds.has(record.id));\n }\n\n if (hasSelfRef) {\n // Insert one-by-one to respect self-referencing foreign key order\n for (const record of recordsToInsert) {\n await db.insertInto(typeName).values(record).execute();\n processed[typeName].inserted += 1;\n }\n if (!upsert) {\n console.log(\n \\`[${namespace}] \\${typeName}: \\${processed[typeName].inserted}/\\${records.length} (one-by-one)\\`,\n );\n }\n } else {\n for (let i = 0; i < recordsToInsert.length; i += BATCH_SIZE) {\n const batch = recordsToInsert.slice(i, i + BATCH_SIZE);\n await db.insertInto(typeName).values(batch).execute();\n processed[typeName].inserted += batch.length;\n if (!upsert) {\n console.log(\n \\`[${namespace}] \\${typeName}: \\${processed[typeName].inserted}/\\${records.length}\\`,\n );\n }\n }\n }\n\n for (const record of recordsToUpdate) {\n const { id, ...values } = record;\n if (Object.keys(values).length === 0) {\n processed[typeName].skipped += 1;\n continue;\n }\n await db.updateTable(typeName).set(values).where(\"id\", \"=\", id).execute();\n processed[typeName].updated += 1;\n }\n\n const counts = processed[typeName];\n if (upsert) {\n const skipped = counts.skipped > 0 ? \\`, \\${counts.skipped} skipped\\` : \"\";\n console.log(\n \\`[${namespace}] \\${typeName}: \\${counts.inserted} inserted, \\${counts.updated} updated\\${skipped}\\`,\n );\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errors.push(\\`\\${typeName}: \\${message}\\`);\n console.error(\\`[${namespace}] \\${typeName}: failed - \\${message}\\`);\n }\n }\n\n return {\n success: errors.length === 0,\n processed,\n errors,\n };\n }\n `;\n}\n\n/**\n * Bundle a seed script for server-side execution\n *\n * Creates an entry that:\n * 1. Defines getDB() function inline\n * 2. Processes data in batches using Kysely\n * 3. Reports progress via console.log\n * 4. Exports as main() for TestExecScript\n * @param namespace - TailorDB namespace\n * @param typeNames - List of type names to include in the seed\n * @param baseDir - Directory whose dependencies and tsconfig the generated entry uses\n * @returns Bundled seed script result\n */\nexport async function bundleSeedScript(\n namespace: string,\n typeNames: string[],\n baseDir: string = process.cwd(),\n): Promise<SeedBundleResult> {\n // Output directory in .tailor (relative to project root)\n const outputDir = path.resolve(getDistDir(), \"seed\");\n fs.mkdirSync(outputDir, { recursive: true });\n\n // Entry file in output directory\n const entryPath = path.join(outputDir, `seed_${namespace}.entry.ts`);\n\n // Generate seed script content\n const entryContent = generateSeedScriptContent(namespace);\n fs.writeFileSync(entryPath, entryContent);\n\n let tsconfig: string | undefined;\n try {\n tsconfig = await resolveTSConfig(baseDir);\n } catch {\n tsconfig = undefined;\n }\n\n // Bundle with tree-shaking (write: false to avoid unnecessary disk I/O)\n const bundleLog = createBundleLog({ tsconfig });\n const result = await rolldown.build({\n plugins: [\n createGeneratedEntryResolverPlugin(entryPath, baseDir),\n createTsconfigPathsPlugin(),\n platformBundleDefinePlugin,\n ],\n input: entryPath,\n write: false,\n output: {\n format: \"esm\",\n sourcemap: false,\n minify: false,\n codeSplitting: false,\n globals: {\n tailordb: \"tailordb\",\n },\n },\n external: [\"tailordb\"],\n resolve: {\n conditionNames: [\"node\", \"import\"],\n },\n tsconfig,\n treeshake: {\n moduleSideEffects: false,\n annotations: true,\n unknownGlobalSideEffects: false,\n },\n ...bundleLog.options,\n } as rolldown.BuildOptions);\n bundleLog.assertAllResolved();\n\n const bundledCode = result.output[0].code;\n\n return {\n namespace,\n bundledCode,\n typesIncluded: typeNames,\n };\n}\n","// CLI API exports for programmatic usage\nimport { registerTsHook } from \"./shared/register-ts-hook\";\n\nawait registerTsHook(new URL(\"./ts-hook.mjs\", import.meta.url));\n\nexport { deploy, deploy as apply } from \"./commands/deploy/deploy\";\nexport type { DeployOptions, DeployOptions as ApplyOptions } from \"./commands/deploy/deploy\";\nexport type { BundledScripts } from \"./commands/deploy/function-registry\";\nexport { generate } from \"./commands/generate/service\";\nexport type { GenerateOptions } from \"./commands/generate/options\";\nexport { loadConfig, type LoadedConfig } from \"./shared/config-loader\";\nexport { errorToJson, serializeError, type ErrorToJsonOptions } from \"./shared/error-json\";\nexport { generateUserTypes } from \"./shared/type-generator\";\nexport {\n loadTailorDBNamespaces,\n type TailorDBNamespaceSelector,\n type LoadTailorDBNamespacesOptions,\n type LoadedTailorDBNamespaces,\n} from \"./shared/tailordb-namespaces\";\nexport {\n deployStaticWebsite,\n type DeployResult as StaticWebsiteDeployResult,\n} from \"./commands/staticwebsite/deploy\";\nexport { assertWritable } from \"./shared/readonly-guard\";\nexport { isPluginGeneratedType } from \"#/parser/service/tailordb/type-source\";\nexport type {\n GeneratorResult,\n Plugin,\n PluginAttachment,\n TailorDBNamespaceData,\n} from \"#/plugin/types\";\nexport type {\n TailorDBType,\n TypeSourceInfoEntry,\n ParsedField,\n OperatorFieldConfig,\n PluginGeneratedTypeSource,\n} from \"#/parser/service/tailordb/types\";\nexport type { Resolver } from \"#/types/resolver.generated\";\nexport type { Executor } from \"#/types/executor.generated\";\n\nexport {\n show,\n type ShowOptions,\n type ApplicationInfo,\n type ShowInfo,\n type AIGatewayInfo,\n} from \"./commands/show\";\nexport { remove, type RemoveOptions } from \"./commands/remove\";\nexport { createWorkspace, type CreateWorkspaceOptions } from \"./commands/workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./commands/workspace/list\";\nexport { deleteWorkspace, type DeleteWorkspaceOptions } from \"./commands/workspace/delete\";\nexport { getWorkspace, type GetWorkspaceOptions } from \"./commands/workspace/get\";\nexport { restoreWorkspace, type RestoreWorkspaceOptions } from \"./commands/workspace/restore\";\nexport type { WorkspaceInfo, WorkspaceDetails } from \"./commands/workspace/transform\";\nexport { listUsers, type ListUsersOptions } from \"./commands/workspace/user/list\";\nexport { inviteUser, type InviteUserOptions } from \"./commands/workspace/user/invite\";\nexport { updateUser, type UpdateUserOptions } from \"./commands/workspace/user/update\";\nexport { removeUser, type RemoveUserOptions } from \"./commands/workspace/user/remove\";\nexport type { UserInfo } from \"./commands/workspace/user/transform\";\nexport { listApps, type ListAppsOptions } from \"./commands/workspace/app/list\";\nexport {\n getAppHealth,\n type HealthOptions as GetAppHealthOptions,\n} from \"./commands/workspace/app/health\";\nexport type { AppInfo, AppHealthInfo } from \"./commands/workspace/app/transform\";\nexport { getFunctionRegistry, type GetFunctionRegistryOptions } from \"./commands/function/get\";\nexport {\n listFunctionRegistries,\n type ListFunctionRegistriesOptions,\n} from \"./commands/function/list\";\nexport type { FunctionRegistryInfo } from \"./commands/function/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./commands/machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./commands/machineuser/token\";\nexport { getOAuth2Client, type GetOAuth2ClientOptions } from \"./commands/oauth2client/get\";\nexport { listOAuth2Clients, type ListOAuth2ClientsOptions } from \"./commands/oauth2client/list\";\nexport type { OAuth2ClientInfo, OAuth2ClientCredentials } from \"./commands/oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./commands/workflow/list\";\nexport { getWorkflow, type GetWorkflowTypedOptions } from \"./commands/workflow/get\";\nexport type { MachineUserName } from \"@tailor-platform/sdk\";\nexport {\n startWorkflow,\n type StartWorkflowTypedOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./commands/workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsTypedOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n type WorkflowExecutionWaitInfo,\n} from \"./commands/workflow/executions\";\nexport { waitWorkflowExecution, type WorkflowWaitOutput } from \"./commands/workflow/wait\";\nexport type { WaitWorkflowExecutionOptions, WorkflowWaitResult } from \"./commands/workflow/waiter\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./commands/workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./commands/workflow/transform\";\nexport {\n triggerExecutor,\n type TriggerExecutorTypedOptions,\n type TriggerExecutorResult,\n} from \"./commands/executor/trigger\";\nexport {\n listExecutorJobs,\n getExecutorJob,\n getExecutorWaitFailureMessage,\n watchExecutorJob,\n type ListExecutorJobsTypedOptions,\n type GetExecutorJobTypedOptions,\n type WatchExecutorJobTypedOptions,\n type ExecutorJobDetailInfo,\n type WatchExecutorJobResult,\n} from \"./commands/executor/jobs\";\nexport { listExecutors, type ListExecutorsOptions } from \"./commands/executor/list\";\nexport { getExecutor, type GetExecutorTypedOptions } from \"./commands/executor/get\";\nexport {\n listWebhookExecutors,\n type ListWebhookExecutorsOptions,\n type WebhookExecutorInfo,\n} from \"./commands/executor/webhook\";\nexport type {\n ExecutorJobListInfo,\n ExecutorJobInfo,\n ExecutorJobAttemptInfo,\n ExecutorListInfo,\n ExecutorInfo,\n} from \"./commands/executor/transform\";\nexport { listOrganizations, type ListOrganizationsOptions } from \"./commands/organization/list\";\nexport { getOrganization, type GetOrganizationOptions } from \"./commands/organization/get\";\nexport { updateOrganization, type UpdateOrganizationOptions } from \"./commands/organization/update\";\nexport { organizationTree, type OrganizationTreeOptions } from \"./commands/organization/tree\";\nexport type {\n UserOrganizationInfo,\n OrganizationInfo,\n FolderListInfo,\n FolderInfo,\n} from \"./commands/organization/transform\";\nexport { listFolders, type ListFoldersOptions } from \"./commands/organization/folder/list\";\nexport { getFolder, type GetFolderOptions } from \"./commands/organization/folder/get\";\nexport { createFolder, type CreateFolderOptions } from \"./commands/organization/folder/create\";\nexport { updateFolder, type UpdateFolderOptions } from \"./commands/organization/folder/update\";\nexport { deleteFolder, type DeleteFolderOptions } from \"./commands/organization/folder/delete\";\nexport { loadAccessToken, loadWorkspaceId } from \"./shared/context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./commands/api\";\nexport { query } from \"./query\";\nexport { truncate, type TruncateOptions } from \"./commands/tailordb/truncate\";\n\n// Migration exports\nexport {\n generate as migrateGenerate,\n type GenerateOptions as MigrateGenerateOptions,\n} from \"./commands/tailordb/migrate/generate\";\nexport {\n createSnapshotFromLocalTypes,\n reconstructSnapshotFromMigrations,\n compareSnapshots,\n getNextMigrationNumber,\n getLatestMigrationNumber,\n getMigrationFiles,\n compareLocalTypesWithSnapshot,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport {\n getNamespacesWithMigrations,\n type NamespaceWithMigrations,\n} from \"./commands/tailordb/migrate/config\";\nexport {\n hasChanges,\n formatMigrationDiff,\n formatDiffSummary,\n type MigrationDiff,\n type BreakingChangeInfo,\n} from \"./commands/tailordb/migrate/diff-calculator\";\nexport {\n SCHEMA_FILE_NAME,\n DIFF_FILE_NAME,\n MIGRATE_FILE_NAME,\n DB_TYPES_FILE_NAME,\n INITIAL_SCHEMA_NUMBER,\n getMigrationDirPath,\n getMigrationFilePath,\n type SchemaSnapshot,\n type NormalizedSchemaSnapshot,\n type TailorDBSnapshotType,\n type SnapshotFieldConfig,\n} from \"./commands/tailordb/migrate/snapshot\";\nexport { MIGRATION_LABEL_KEY } from \"./commands/tailordb/migrate/types\";\n\n// Seed exports\nexport {\n loadSeedContext,\n type LoadSeedContextOptions,\n type SeedContext,\n type SeedIdpUserContext,\n type SeedNamespaceConfig,\n} from \"./shared/seed-context\";\nexport {\n chunkSeedData,\n type SeedChunk,\n type ChunkSeedDataOptions,\n type SeedData,\n} from \"./shared/seed-chunker\";\nexport { bundleSeedScript, type SeedBundleResult } from \"./commands/generate/seed/bundler\";\nexport {\n bundleMigrationScript,\n type MigrationBundleResult,\n} from \"./commands/tailordb/migrate/bundler\";\nexport {\n executeScript,\n waitForExecution,\n type ScriptExecutionOptions,\n type ScriptExecutionResult,\n type ScriptInvoker,\n type ExecutionWaitResult,\n} from \"./shared/script-executor\";\nexport { initOperatorClient, type OperatorClient } from \"./shared/client\";\nexport type { AuthInvoker } from \"@tailor-platform/tailor-proto/auth_resource_pb\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoDA,eAAsB,0BACpB,UAAyC,CAAC,GACJ;CACtC,MAAM,EAAE,QAAQ,YAAY,MAAM,WAAW,QAAQ,UAAU;CAE/D,MAAM,kBAAkB;EAAE;EAAQ,YAAY,OAAO;CAAK,CAAC;CAG3D,MAAM,cAAc,kBAAkB;EACpC;EACA,eAHoB,QAAQ,SAAS,IAAI,IAAI,cAAc,OAAO,IAAI;CAIxE,CAAC;CACD,MAAM,iBACJ,OAAO,QAAQ,eAAe,aAC1B,QAAQ,WAAW,QAAQ,OAAO,IAClC,QAAQ;CACd,MAAM,kBAAkB,iBAAiB,IAAI,IAAI,cAAc,IAAI;CACnE,MAAM,WAAW,kBACb,YAAY,iBAAiB,QAAQ,OAAO,gBAAgB,IAAI,GAAG,SAAS,CAAC,IAC7E,YAAY;CAEhB,IAAI,mBAAmB,SAAS,WAAW,gBAAgB,MAAM;EAC/D,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,OAAO,GAAG,SAAS,CAAC;EACxD,MAAM,UAAU,CAAC,GAAG,eAAe,CAAC,CAAC,QAAQ,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI;EAC7E,MA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A,UAAU,CAAC,UAAU;EACrB,SAAS,EACP,gBAAgB,CAAC,QAAQ,QAAQ,EACnC;EACA;EACA,WAAW;GACT,mBAAmB;GACnB,aAAa;GACb,0BAA0B;EAC5B;EACA,GAAG,UAAU;CACf,CAA0B;CAC1B,UAAU,kBAAkB;CAI5B,OAAO;EACL;EACA,aAJkB,OAAO,OAAO,EAAE,CAAC;EAKnC,eAAe;CACjB;AACF;;;;AC9NA,MAAM,eAAe,IAAI,IAAI,iBAAiB,OAAO,KAAK,GAAG,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { AnyCommand } from "politty";
2
- //#region src/cli/index.d.ts
2
+ //#region src/cli/main.d.ts
3
3
  declare const mainCommand: {
4
4
  subCommands: {
5
5
  skills: AnyCommand;