@tailor-platform/sdk 2.26.0 → 2.28.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 (222) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/agent-skills/tailor/SKILL.md +4 -2
  3. package/dist/application-CgJLyJaF.mjs +200 -0
  4. package/dist/application-CgJLyJaF.mjs.map +1 -0
  5. package/dist/application-CvmKh5WT.mjs +1 -0
  6. package/dist/cli/commands/deploy/deploy.d.mts +2 -0
  7. package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +2 -1
  8. package/dist/cli/commands/executor/get.d.mts +2 -1
  9. package/dist/cli/commands/executor/jobs.d.mts +2 -1
  10. package/dist/cli/commands/executor/trigger.d.mts +2 -1
  11. package/dist/cli/commands/function/get.d.mts +2 -1
  12. package/dist/cli/commands/function/list.d.mts +2 -1
  13. package/dist/cli/commands/organization/folder/create.d.mts +2 -1
  14. package/dist/cli/commands/organization/folder/delete.d.mts +2 -1
  15. package/dist/cli/commands/organization/folder/get.d.mts +2 -1
  16. package/dist/cli/commands/organization/folder/list.d.mts +2 -1
  17. package/dist/cli/commands/organization/folder/update.d.mts +2 -1
  18. package/dist/cli/commands/organization/get.d.mts +2 -1
  19. package/dist/cli/commands/organization/tree.d.mts +2 -1
  20. package/dist/cli/commands/organization/update.d.mts +2 -1
  21. package/dist/cli/commands/show.d.mts +2 -1
  22. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +4 -6
  23. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +8 -1
  24. package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +1 -0
  25. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +3 -1
  26. package/dist/cli/commands/workflow/executions.d.mts +2 -1
  27. package/dist/cli/commands/workflow/get.d.mts +2 -1
  28. package/dist/cli/commands/workflow/start.d.mts +2 -1
  29. package/dist/cli/commands/workspace/app/health.d.mts +2 -1
  30. package/dist/cli/commands/workspace/app/list.d.mts +2 -1
  31. package/dist/cli/commands/workspace/create.d.mts +5 -2
  32. package/dist/cli/commands/workspace/delete.d.mts +2 -1
  33. package/dist/cli/commands/workspace/get.d.mts +2 -1
  34. package/dist/cli/commands/workspace/restore.d.mts +2 -1
  35. package/dist/cli/commands/workspace/user/invite.d.mts +2 -1
  36. package/dist/cli/commands/workspace/user/list.d.mts +2 -1
  37. package/dist/cli/commands/workspace/user/remove.d.mts +2 -1
  38. package/dist/cli/commands/workspace/user/update.d.mts +2 -1
  39. package/dist/cli/lib.d.mts +3 -3
  40. package/dist/cli/lib.mjs +1 -1
  41. package/dist/cli/lib.mjs.map +1 -1
  42. package/dist/cli/main.d.mts +2 -0
  43. package/dist/cli/main.mjs +68 -55
  44. package/dist/cli/main.mjs.map +1 -1
  45. package/dist/cli/query/index.d.mts +2 -1
  46. package/dist/cli/shared/args.d.mts +4 -2
  47. package/dist/cli/shared/client.d.mts +6 -1
  48. package/dist/cli/shared/context.d.mts +2 -1
  49. package/dist/cli/shared/logger.d.mts +5 -2
  50. package/dist/cli/shared/readonly-guard.d.mts +2 -1
  51. package/dist/cli/shared/seed-context.d.mts +5 -0
  52. package/dist/cli/shared/type-generator.d.mts +2 -1
  53. package/dist/cli/shared/workspace-name.d.mts +2 -0
  54. package/dist/completion/zsh-worker.zsh +220 -19
  55. package/dist/configure/config/types.d.mts +34 -1
  56. package/dist/configure/index.d.mts +6 -6
  57. package/dist/configure/index.mjs +1 -1
  58. package/dist/configure/index.mjs.map +1 -1
  59. package/dist/configure/services/aigateway/types.d.mts +2 -1
  60. package/dist/configure/services/auth/types.d.mts +8 -2
  61. package/dist/configure/services/executor/executor.d.mts +2 -1
  62. package/dist/configure/services/executor/operation.d.mts +2 -1
  63. package/dist/configure/services/executor/trigger/event.d.mts +3 -2
  64. package/dist/configure/services/executor/trigger/schedule.d.mts +2 -1
  65. package/dist/configure/services/executor/trigger/webhook.d.mts +1 -1
  66. package/dist/configure/services/http-adapter/http-adapter.d.mts +2 -1
  67. package/dist/configure/services/idp/permission.d.mts +4 -3
  68. package/dist/configure/services/idp/types.d.mts +2 -1
  69. package/dist/configure/services/resolver/permission.d.mts +2 -1
  70. package/dist/configure/services/resolver/resolver.d.mts +3 -2
  71. package/dist/configure/services/secrets/types.d.mts +2 -1
  72. package/dist/configure/services/staticwebsite/types.d.mts +2 -1
  73. package/dist/configure/services/tailordb/permission.d.mts +2 -1
  74. package/dist/configure/services/tailordb/schema.d.mts +5 -4
  75. package/dist/configure/services/tailordb/types.d.mts +13 -2
  76. package/dist/configure/services/workflow/execution-policy.types.d.mts +2 -1
  77. package/dist/configure/services/workflow/job.d.mts +3 -2
  78. package/dist/configure/services/workflow/wait-point.d.mts +2 -1
  79. package/dist/configure/types/field.types.d.mts +50 -12
  80. package/dist/configure/types/permission-operand.types.d.mts +2 -1
  81. package/dist/configure/types/type.d.mts +3 -2
  82. package/dist/{crashreport-DFpRn-LS.mjs → crashreport-BAG8c7hB.mjs} +4 -4
  83. package/dist/{crashreport-DFpRn-LS.mjs.map → crashreport-BAG8c7hB.mjs.map} +1 -1
  84. package/dist/crashreport-BcXuocwI.mjs +1 -0
  85. package/dist/date-CgP7gMG_.mjs +2 -0
  86. package/dist/date-CgP7gMG_.mjs.map +1 -0
  87. package/dist/{secretmanager-5olfnI1b.mjs → date-representation-Cr7W7Pn2.mjs} +2 -2
  88. package/dist/date-representation-Cr7W7Pn2.mjs.map +1 -0
  89. package/dist/{errors-CpvSChyL.mjs → errors-D3qpNHR6.mjs} +2 -2
  90. package/dist/{errors-CpvSChyL.mjs.map → errors-D3qpNHR6.mjs.map} +1 -1
  91. package/dist/{field-parse-DhnFs9WG.mjs → field-parse-C41e3UAF.mjs} +2 -2
  92. package/dist/{field-parse-DhnFs9WG.mjs.map → field-parse-C41e3UAF.mjs.map} +1 -1
  93. package/dist/idp-G_ojPBB5.mjs.map +1 -1
  94. package/dist/kysely-type-BWMfV301.mjs +48 -0
  95. package/dist/kysely-type-BWMfV301.mjs.map +1 -0
  96. package/dist/logger-DuaT2zY3.mjs +9 -0
  97. package/dist/logger-DuaT2zY3.mjs.map +1 -0
  98. package/dist/{manager-8-JOvuLl.mjs → manager-Bk-7vkwd.mjs} +2 -2
  99. package/dist/{manager-8-JOvuLl.mjs.map → manager-Bk-7vkwd.mjs.map} +1 -1
  100. package/dist/migration-steps-C6F3zNdQ.mjs +3 -0
  101. package/dist/migration-steps-C6F3zNdQ.mjs.map +1 -0
  102. package/dist/package-json-D1BRkjtr.mjs +1 -0
  103. package/dist/parser/service/tailordb/types.d.mts +3 -1
  104. package/dist/plugin/builtin/enum-constants/index.d.mts +2 -1
  105. package/dist/plugin/builtin/file-utils/index.d.mts +2 -1
  106. package/dist/plugin/builtin/kysely-type/index.d.mts +2 -1
  107. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  108. package/dist/plugin/builtin/seed/index.d.mts +11 -1
  109. package/dist/plugin/builtin/seed/index.mjs +1 -1
  110. package/dist/plugin/index.mjs +1 -1
  111. package/dist/register-ts-hook-yxshv0LV.mjs +1013 -0
  112. package/dist/register-ts-hook-yxshv0LV.mjs.map +1 -0
  113. package/dist/runtime/aigateway.mjs +1 -1
  114. package/dist/runtime/authconnection.mjs +1 -1
  115. package/dist/runtime/context.d.mts +2 -1
  116. package/dist/runtime/context.mjs +1 -1
  117. package/dist/runtime/date.d.mts +2 -1
  118. package/dist/runtime/field-parse.d.mts +2 -1
  119. package/dist/runtime/file.d.mts +2 -1
  120. package/dist/runtime/file.mjs +1 -1
  121. package/dist/runtime/globals.d.mts +2 -1
  122. package/dist/runtime/iconv.mjs +1 -1
  123. package/dist/runtime/idp.d.mts +6 -0
  124. package/dist/runtime/idp.mjs +1 -1
  125. package/dist/runtime/index.mjs +1 -1
  126. package/dist/runtime/logger.mjs +1 -1
  127. package/dist/runtime/secretmanager.mjs +1 -1
  128. package/dist/runtime/types.d.mts +7 -1
  129. package/dist/runtime/workflow.d.mts +2 -1
  130. package/dist/runtime/workflow.mjs +1 -1
  131. package/dist/{schema-CRtAmDcl.mjs → schema-B6hJQWp6.mjs} +2 -2
  132. package/dist/schema-B6hJQWp6.mjs.map +1 -0
  133. package/dist/seed/index.d.mts +19 -4
  134. package/dist/seed/index.mjs +7 -9
  135. package/dist/seed/index.mjs.map +1 -1
  136. package/dist/seed-C3P_T_Eh.mjs.map +1 -1
  137. package/dist/service-CETr0AKY.mjs +7 -0
  138. package/dist/service-CETr0AKY.mjs.map +1 -0
  139. package/dist/service-DREWLYxD.mjs +1 -0
  140. package/dist/{service-DFmt9UJP.mjs → service-b1g22NN9.mjs} +2 -2
  141. package/dist/{service-DFmt9UJP.mjs.map → service-b1g22NN9.mjs.map} +1 -1
  142. package/dist/service_pb-Bbu2QSIr.mjs +2 -0
  143. package/dist/service_pb-Bbu2QSIr.mjs.map +1 -0
  144. package/dist/service_pb-urxAIYHT.mjs +1 -0
  145. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +53 -1
  146. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +33 -0
  147. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +0 -8
  148. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +18 -1
  149. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +4 -0
  150. package/dist/telemetry-DpkFGBmu.mjs +1 -0
  151. package/dist/{telemetry-Bklv9kQY.mjs → telemetry-Xk7J829P.mjs} +2 -2
  152. package/dist/{telemetry-Bklv9kQY.mjs.map → telemetry-Xk7J829P.mjs.map} +1 -1
  153. package/dist/types/field.generated.d.mts +2 -2
  154. package/dist/types/tailordb.generated.d.mts +2 -0
  155. package/dist/utils/test/index.mjs +1 -1
  156. package/dist/vitest/date-representation.d.mts +23 -0
  157. package/dist/vitest/index.d.mts +3 -1
  158. package/dist/vitest/index.mjs +1 -1
  159. package/dist/vitest/index.mjs.map +1 -1
  160. package/dist/vitest/migration-steps.d.mts +45 -0
  161. package/dist/vitest/mock-kysely.d.mts +2 -1
  162. package/dist/vitest/mocks/aigateway.d.mts +2 -1
  163. package/dist/vitest/mocks/authconnection.d.mts +2 -1
  164. package/dist/vitest/mocks/file.d.mts +2 -1
  165. package/dist/vitest/mocks/iconv.d.mts +2 -1
  166. package/dist/vitest/mocks/idp.d.mts +3 -1
  167. package/dist/vitest/mocks/logger.d.mts +2 -1
  168. package/dist/vitest/mocks/secretmanager.d.mts +2 -1
  169. package/dist/vitest/mocks/tailordb-pglite.d.mts +2 -1
  170. package/dist/vitest/mocks/tailordb.d.mts +2 -1
  171. package/dist/vitest/mocks/workflow.d.mts +3 -1
  172. package/dist/vitest/pglite-kysely.d.mts +2 -1
  173. package/dist/vitest/setup.d.mts +3 -1
  174. package/dist/vitest/setup.mjs +1 -1
  175. package/dist/vitest/setup.mjs.map +1 -1
  176. package/dist/vitest/workflow-local.d.mts +2 -1
  177. package/dist/{workspace_resource_pb-CxR_6fyN.mjs → workspace_resource_pb-CaoM2npP.mjs} +2 -2
  178. package/dist/workspace_resource_pb-CaoM2npP.mjs.map +1 -0
  179. package/docs/cli/application.md +37 -16
  180. package/docs/cli/data.md +105 -0
  181. package/docs/cli/function.md +2 -0
  182. package/docs/cli/secret.md +6 -6
  183. package/docs/cli/tailordb.md +18 -16
  184. package/docs/cli/user.md +37 -7
  185. package/docs/cli/workspace.md +10 -2
  186. package/docs/cli-reference.md +25 -3
  187. package/docs/configuration.md +28 -6
  188. package/docs/github-actions.md +212 -63
  189. package/docs/multi-environment.md +24 -0
  190. package/docs/plugin/custom.md +2 -1
  191. package/docs/services/auth.md +20 -0
  192. package/docs/services/executor.md +2 -2
  193. package/docs/services/idp.md +6 -1
  194. package/docs/services/resolver.md +3 -1
  195. package/docs/services/staticwebsite.md +5 -5
  196. package/docs/services/tailordb-migration.md +222 -41
  197. package/docs/services/tailordb.md +17 -4
  198. package/docs/testing.md +4 -0
  199. package/package.json +18 -18
  200. package/dist/application-ChqHuhZW.mjs +0 -1
  201. package/dist/application-DS0XKBtK.mjs +0 -200
  202. package/dist/application-DS0XKBtK.mjs.map +0 -1
  203. package/dist/crashreport-CBaRJl5h.mjs +0 -1
  204. package/dist/date-Dri6Yas-.mjs +0 -2
  205. package/dist/date-Dri6Yas-.mjs.map +0 -1
  206. package/dist/kysely-type-RDX59E1j.mjs +0 -48
  207. package/dist/kysely-type-RDX59E1j.mjs.map +0 -1
  208. package/dist/logger-Db-YRTwK.mjs +0 -9
  209. package/dist/logger-Db-YRTwK.mjs.map +0 -1
  210. package/dist/package-json-CmqhDJ__.mjs +0 -1
  211. package/dist/register-ts-hook-BuwkLuxC.mjs +0 -925
  212. package/dist/register-ts-hook-BuwkLuxC.mjs.map +0 -1
  213. package/dist/schema-CRtAmDcl.mjs.map +0 -1
  214. package/dist/secretmanager-5olfnI1b.mjs.map +0 -1
  215. package/dist/service-Bx-7Lz06.mjs +0 -1
  216. package/dist/service-CL1Bp4It.mjs +0 -7
  217. package/dist/service-CL1Bp4It.mjs.map +0 -1
  218. package/dist/service_pb-ZClWtj1X.mjs +0 -2
  219. package/dist/service_pb-ZClWtj1X.mjs.map +0 -1
  220. package/dist/service_pb-dB3RrGeh.mjs +0 -1
  221. package/dist/telemetry-DXHP3VVi.mjs +0 -1
  222. package/dist/workspace_resource_pb-CxR_6fyN.mjs.map +0 -1
@@ -56,24 +56,30 @@ tailor deploy [options]
56
56
 
57
57
  **Options**
58
58
 
59
- | Option | Alias | Description | Required | Default | Env |
60
- | --------------------------------------- | ----- | ------------------------------------------------------------------------------------ | -------- | -------------------- | --------------------------------- |
61
- | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
62
- | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
63
- | `--config <CONFIG>` | `-c` | Path to SDK config file. Use comma-separated paths to deploy multiple apps together. | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |
64
- | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
65
- | `--create-workspace` | - | Create a workspace when the account has none | No | - | - |
66
- | `--workspace-name <WORKSPACE_NAME>` | - | Name for a workspace created during deploy | No | - | - |
67
- | `--workspace-region <WORKSPACE_REGION>` | - | Region for a workspace created during deploy | No | - | - |
68
- | `--organization-id <ORGANIZATION_ID>` | - | Organization ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_ORGANIZATION_ID` |
69
- | `--folder-id <FOLDER_ID>` | - | Folder ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
70
- | `--dry-run` | `-d` | Run the command without making any changes | No | - | - |
71
- | `--no-schema-check` | - | Skip schema diff check against migration snapshots | No | - | - |
72
- | `--no-validate` | - | Skip client-side validation against platform resource constraints | No | - | - |
73
- | `--no-cache` | - | Disable bundle caching for this run | No | - | - |
74
- | `--clean-cache` | - | Clean the bundle cache before building | No | - | - |
59
+ | Option | Alias | Description | Required | Default | Env |
60
+ | ----------------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | --------------------------------- |
61
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
62
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
63
+ | `--config <CONFIG>` | `-c` | Path to SDK config file. Use comma-separated paths to deploy multiple apps together. | No | `"tailor.config.ts"` | `TAILOR_PLATFORM_SDK_CONFIG_PATH` |
64
+ | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
65
+ | `--create-workspace` | - | Create a workspace when the account has none | No | - | - |
66
+ | `--workspace-name <WORKSPACE_NAME>` | - | Name for a workspace created during deploy | No | - | - |
67
+ | `--workspace-region <WORKSPACE_REGION>` | - | Region for a workspace created during deploy | No | - | - |
68
+ | `--organization-id <ORGANIZATION_ID>` | - | Organization ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_ORGANIZATION_ID` |
69
+ | `--folder-id <FOLDER_ID>` | - | Folder ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
70
+ | `--dry-run` | `-d` | Run the command without making any changes | No | - | - |
71
+ | `--no-schema-check` | - | Skip schema diff check against migration snapshots | No | - | - |
72
+ | `--migration-skip-steps <MIGRATION_SKIP_STEPS>` | - | Skip steps of a partially applied multi-step migration that already succeeded (comma-separated namespace/step entries) | No | - | - |
73
+ | `--no-validate` | - | Skip client-side validation against platform resource constraints | No | - | - |
74
+ | `--no-cache` | - | Disable bundle caching for this run | No | - | - |
75
+ | `--clean-cache` | - | Clean the bundle cache before building | No | - | - |
75
76
 
76
77
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
78
+
79
+ **Notes**
80
+
81
+ Workspace creation uses the selected user's default organization and folder set by `user update` when neither location is given and TAILOR_PLATFORM_TOKEN is not set. Giving --organization-id or --folder-id replaces both defaults. Organization and folder IDs loaded by --env-file also replace the defaults; command-line options take precedence, and empty env-file values are ignored. With --create-workspace, an existing workspace must match the resolved name, region, organization, and folder to be reused.
82
+
77
83
  **JSON result:**
78
84
 
79
85
  After a successful `tailor deploy --json`, stdout includes `status: "applied"`,
@@ -88,11 +94,26 @@ is registered or no resources changed.
88
94
  Plugins that return outputs add entries under `deployedHooks`. For example, the
89
95
  frontend plugin provides upload results in `deployedHooks[].outputs.frontends`.
90
96
 
97
+ When the deploy applied TailorDB migrations with maintenance mode enabled, `tailordbMaintenance` has one entry per
98
+ application whose migrations ran: its `application` name, `namespaces`, `maintenanceMs` (how
99
+ long their tables were in maintenance mode, equal to the sum of `phases`), `phases` in milliseconds
100
+ (`restrict`, `preMigration`, `jobSetup`, `waitingToStart`, `running`, `waitingOrRunning`,
101
+ `jobCleanup`, `postMigration`, `remainingDeploy`, `restore`), and `migrations` with each script's `namespace`,
102
+ `migrationNumber`, `startObserved`, `waitingToStartMs`, `runningMs`, and `waitingOrRunningMs`. See
103
+ [Time spent in maintenance mode](../services/tailordb-migration.md#time-spent-in-maintenance-mode).
104
+
91
105
  ```sh
92
106
  tailor deploy --json > deploy-result.json
93
107
  jq '.applications[] | {name, url, staticWebsites, auth}' deploy-result.json
94
108
  ```
95
109
 
110
+ After a successful apply, stdout is exactly one line: the JSON object. A dry-run writes its
111
+ plan as one JSON object. Progress and diagnostics go to stderr, so the output can be captured
112
+ as it is, for example
113
+ `result=$(tailor deploy --json)`. A failed deploy exits non-zero and writes its error as
114
+ JSON to stderr, leaving stdout empty. A deploy plugin that writes to stdout itself makes
115
+ the output unparseable; plugins report through `ctx.logger` and run commands through `ctx.exec`.
116
+
96
117
  Dry-run and build-only deployments do not return deployed application information.
97
118
  If resources were applied but loading the JSON result fails, the command reports
98
119
  `DEPLOY_RESULT_LOAD_FAILED`; fix the error and run `tailor deploy` again.
@@ -0,0 +1,105 @@
1
+ # Data Commands
2
+
3
+ Commands for managing application data across workspaces.
4
+
5
+ ## data
6
+
7
+ Manage application data across workspaces.
8
+
9
+ **Usage**
10
+
11
+ ```
12
+ tailor data <command>
13
+ ```
14
+
15
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
16
+
17
+ **Commands**
18
+
19
+ | Command | Description |
20
+ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
21
+ | [`data clone`](#data-clone) | Clone the data of an application (TailorDB namespaces registered in its subgraph) from one workspace to another. |
22
+ | [`data operation`](#data-operation) | Inspect asynchronous application data operations. |
23
+
24
+ ### data clone
25
+
26
+ Clone the data of an application (TailorDB namespaces registered in its subgraph) from one workspace to another.
27
+
28
+ **Usage**
29
+
30
+ ```
31
+ tailor data clone [options]
32
+ ```
33
+
34
+ **Options**
35
+
36
+ | Option | Alias | Description | Required | Default | Env |
37
+ | --------------------- | ----- | -------------------------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------- |
38
+ | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
39
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
40
+ | `--from <FROM>` | - | Workspace ID to copy data from | Yes | - | - |
41
+ | `--to <TO>` | - | Workspace ID to copy data to | Yes | - | - |
42
+ | `--name <NAME>` | `-n` | Application name, the same in the source and the target workspace (default: the name in the config file) | No | - | - |
43
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
44
+ | `--copy-files` | - | Also copy TailorDB file content | No | `false` | - |
45
+ | `--copy-idp-users` | - | Also copy IdP users, including their passwords | No | `false` | - |
46
+ | `--no-wait` | - | Start the clone and exit without waiting for it to finish | No | `false` | - |
47
+
48
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
49
+
50
+ **Notes**
51
+
52
+ The platform rejects the clone with a failed precondition unless all of the following hold:
53
+
54
+ - The source and target workspaces are in the same region.
55
+ - The target workspace has the same namespaces as the source.
56
+ - The TailorDB schema of the target matches the source, so deploy the same version to the target first.
57
+ - The target is empty for every namespace and copy type in scope (TailorDB records, plus files and IdP users when `--copy-files` / `--copy-idp-users` are given).
58
+
59
+ The command waits until the clone finishes. Pressing Ctrl+C or passing --no-wait does not stop the clone, which keeps running on the platform. Use `tailor data operation get --wait` with the operation ID printed at the start to keep waiting, or without --wait to check the status once.
60
+
61
+ With --json, the result carries `status`: `completed` once the clone has finished, or `started` with --no-wait.
62
+
63
+ ### data operation
64
+
65
+ Inspect asynchronous application data operations.
66
+
67
+ **Usage**
68
+
69
+ ```
70
+ tailor data operation <command>
71
+ ```
72
+
73
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
74
+
75
+ **Commands**
76
+
77
+ | Command | Description |
78
+ | ------------------------------------------- | ---------------------------------------------------------- |
79
+ | [`data operation get`](#data-operation-get) | Show the status of a data clone, or wait for it to finish. |
80
+
81
+ #### data operation get
82
+
83
+ Show the status of a data clone, or wait for it to finish.
84
+
85
+ **Usage**
86
+
87
+ ```
88
+ tailor data operation get [options]
89
+ ```
90
+
91
+ **Options**
92
+
93
+ | Option | Alias | Description | Required | Default | Env |
94
+ | ------------------------------- | ----- | ------------------------------------------- | -------- | ------- | ------------------------- |
95
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
96
+ | `--from <FROM>` | - | Workspace ID to copy data from | Yes | - | - |
97
+ | `--to <TO>` | - | Workspace ID to copy data to | Yes | - | - |
98
+ | `--operation-id <OPERATION_ID>` | - | Operation ID printed when the clone started | Yes | - | - |
99
+ | `--wait` | - | Wait until the clone completes or fails | No | `false` | - |
100
+
101
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
102
+
103
+ **Notes**
104
+
105
+ Without --wait, the command prints the current status once and exits. With --wait, it waits until the clone completes or fails, and exits with an error if it fails. Pressing Ctrl+C stops waiting; the clone keeps running on the platform.
@@ -129,6 +129,8 @@ $ tailor function logs <execution-id> --follow
129
129
 
130
130
  **Notes**
131
131
 
132
+ Each execution includes `errorKind`, which tells you where a failure came from: `USER_RUNTIME` (your code threw while running, or exceeded its time, memory, or CPU limit), `USER_NON_RUNTIME` (your script failed while loading, before your function was called, such as when its top-level code threw), `PLATFORM` (a failure on the Platform side, or the Platform aborting the run because of its own deadline or cancellation), `NONE` (no error), or `UNSPECIFIED` (not recorded, or a kind this CLI version does not recognize). A workflow job waiting on another job also reports `USER_NON_RUNTIME` when that job fails or is canceled. `errorName` and `errorMessage` hold the error's name and message, or `null` when none was recorded. The list table omits `errorMessage`; use `--json` or the execution details to read it.
133
+
132
134
  Execution details include `logEntries`, the structured log lines (message, severity, timestamp) recorded while the function ran. They are available while the execution is still running. The `logs` string joins their messages with newlines.
133
135
 
134
136
  Use `--follow` to keep polling a running execution and print new log entries as they arrive until it completes. Polling continues while the execution is suspended at a wait point, and indefinitely unless `--timeout` is set. With `--json`, `--follow` waits for completion and then emits the final execution details once.
@@ -154,9 +154,9 @@ tailor secret vault create [options] <name>
154
154
 
155
155
  **Arguments**
156
156
 
157
- | Argument | Description | Required |
158
- | -------- | ----------- | -------- |
159
- | `name` | Vault name | Yes |
157
+ | Argument | Description | Required |
158
+ | ----------------------- | ----------- | -------- |
159
+ | `name`, `--name <NAME>` | Vault name | Yes |
160
160
 
161
161
  **Options**
162
162
 
@@ -179,9 +179,9 @@ tailor secret vault delete [options] <name>
179
179
 
180
180
  **Arguments**
181
181
 
182
- | Argument | Description | Required |
183
- | -------- | ----------- | -------- |
184
- | `name` | Vault name | Yes |
182
+ | Argument | Description | Required |
183
+ | ----------------------- | ----------- | -------- |
184
+ | `name`, `--name <NAME>` | Vault name | Yes |
185
185
 
186
186
  **Options**
187
187
 
@@ -33,9 +33,9 @@ tailor tailordb truncate [options] [tables]
33
33
 
34
34
  **Arguments**
35
35
 
36
- | Argument | Description | Required |
37
- | -------- | ----------------------- | -------- |
38
- | `tables` | Table names to truncate | No |
36
+ | Argument | Description | Required |
37
+ | ----------------------------- | ----------------------- | -------- |
38
+ | `tables`, `--tables <TABLES>` | Table names to truncate | No |
39
39
 
40
40
  **Options**
41
41
 
@@ -290,24 +290,26 @@ tailor tailordb migration test [options]
290
290
 
291
291
  **Options**
292
292
 
293
- | Option | Alias | Description | Required | Default | Env |
294
- | --------------------------------------------- | ----- | ---------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
295
- | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
296
- | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
297
- | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
298
- | `--yes` | `-y` | Acknowledge that a designated target workspace may be overwritten | No | `false` | - |
299
- | `--data <DATA>` | - | Data source for the migration test (seed or clone) | No | `"seed"` | - |
300
- | `--target-workspace-id <TARGET_WORKSPACE_ID>` | - | Existing throwaway workspace to retain after the test (requires --yes) | No | - | - |
301
- | `--keep` | - | Keep the automatically created workspace after the test | No | `false` | - |
302
- | `--assert <ASSERT>` | - | Path to a TypeScript assertion script to run after migrations | No | - | - |
303
- | `--assert-namespace <ASSERT_NAMESPACE>` | - | TailorDB namespace exposed to the assertion script | No | - | - |
304
- | `--machine-user <MACHINE_USER>` | - | Machine user for seed and assertion script execution | No | - | - |
293
+ | Option | Alias | Description | Required | Default | Env |
294
+ | --------------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
295
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
296
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
297
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
298
+ | `--yes` | `-y` | Acknowledge that a designated target workspace may be overwritten | No | `false` | - |
299
+ | `--data <DATA>` | - | Data source for the migration test (seed or clone) | No | `"seed"` | - |
300
+ | `--target-workspace-id <TARGET_WORKSPACE_ID>` | - | Existing throwaway workspace to retain after the test (requires --yes) | No | - | - |
301
+ | `--keep` | - | Keep the automatically created workspace after the test | No | `false` | - |
302
+ | `--assert <ASSERT>` | - | Path to a TypeScript assertion script to run after migrations | No | - | - |
303
+ | `--assert-namespace <ASSERT_NAMESPACE>` | - | TailorDB namespace exposed to the assertion script | No | - | - |
304
+ | `--keep-ttl <KEEP_TTL>` | - | Record an expiry on the kept workspace, e.g. 24h or 7d, so workspace prune --expired can delete it (requires --keep) | No | - | - |
305
+ | `--clone-timeout <CLONE_TIMEOUT>` | - | How long to wait for the clone to finish with --data clone, e.g. 30s or 10m (default: 30m) | No | - | - |
306
+ | `--machine-user <MACHINE_USER>` | - | Machine user for seed and assertion script execution | No | - | - |
305
307
 
306
308
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
307
309
 
308
310
  **Notes**
309
311
 
310
- The source workspace is read-only. Without --target-workspace-id, the command creates a workspace in the source workspace's region and deletes it after success or failure; pass --keep to retain it for inspection. A designated target is retained and requires --yes. Clone mode copies TailorDB records only; it does not copy IdP users or file blobs.
312
+ The source workspace is read-only. Without --target-workspace-id, the command creates a workspace in the source workspace's region and deletes it after success or failure; pass --keep to retain it for inspection. A designated target is retained and requires --yes. Clone mode copies TailorDB records only; it does not copy IdP users or file blobs. With --keep-ttl, the kept workspace records an expiry; it is not deleted automatically, but workspace prune --expired removes it once the expiry has passed.
311
313
 
312
314
  #### tailordb migration validate
313
315
 
package/docs/cli/user.md CHANGED
@@ -28,7 +28,7 @@ _no options_
28
28
 
29
29
  | Option | Alias | Description | Required | Default | Env |
30
30
  | --------------------------------- | ----- | --------------------------------- | -------- | ------- | -------------------------------------------- |
31
- | `--machine-user <MACHINE_USER>` | - | Login as a platform machine user. | Yes | - | - |
31
+ | `--machine-user` | - | Login as a platform machine user. | Yes | - | - |
32
32
  | `--client-id <CLIENT_ID>` | - | Client ID | Yes | - | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` |
33
33
  | `--client-secret <CLIENT_SECRET>` | - | Client secret | No | - | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` |
34
34
 
@@ -121,12 +121,13 @@ See [Global Options](../cli-reference.md#global-options) for options available t
121
121
 
122
122
  **Commands**
123
123
 
124
- | Command | Description |
125
- | ------------------------------- | ------------------------------ |
126
- | [`user current`](#user-current) | Show current user. |
127
- | [`user list`](#user-list) | List all users. |
128
- | [`user switch`](#user-switch) | Set current user. |
129
- | [`user pat`](#user-pat) | Manage personal access tokens. |
124
+ | Command | Description |
125
+ | ------------------------------- | -------------------------------------------------------------------------- |
126
+ | [`user current`](#user-current) | Show current user. |
127
+ | [`user list`](#user-list) | List all users. |
128
+ | [`user switch`](#user-switch) | Set current user. |
129
+ | [`user update`](#user-update) | Set the current user's default organization and folder for new workspaces. |
130
+ | [`user pat`](#user-pat) | Manage personal access tokens. |
130
131
 
131
132
  ### user current
132
133
 
@@ -302,6 +303,35 @@ tailor user switch [options] <user>
302
303
  | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
303
304
 
304
305
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
306
+
307
+ ### user update
308
+
309
+ Set the current user's default organization and folder for new workspaces.
310
+
311
+ **Usage**
312
+
313
+ ```
314
+ tailor user update [options]
315
+ ```
316
+
317
+ **Options**
318
+
319
+ | Option | Alias | Description | Required | Default | Env |
320
+ | ----------------------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------- | -------- | ------- | ------------------------- |
321
+ | `--default-organization-id <DEFAULT_ORGANIZATION_ID>` | `-o` | Organization that `workspace create` uses when no location is given. Pass an empty string to clear the defaults. | No | - | - |
322
+ | `--default-folder-id <DEFAULT_FOLDER_ID>` | `-f` | Folder in the default organization that `workspace create` uses (requires --default-organization-id) | No | - | - |
323
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
324
+
325
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
326
+
327
+ **Notes**
328
+
329
+ `workspace create`, workspace creation during `deploy`, and the programmatic `createWorkspace()` use the default folder, or directly use the default organization when no folder is set. Giving either an organization or a folder replaces both defaults for that run. For the CLI, use --organization-id or --folder-id, or TAILOR_PLATFORM_ORGANIZATION_ID / TAILOR_PLATFORM_FOLDER_ID. The defaults are not used while TAILOR_PLATFORM_TOKEN is set, because that token does not belong to a user logged in here.
330
+
331
+ Each run replaces both defaults: --default-organization-id alone clears the default folder, --default-folder-id is accepted only together with --default-organization-id, and --default-organization-id "" clears both. The IDs are not checked against the Platform here; `workspace create` and `deploy` point back to them when the Platform cannot find them or denies access to them.
332
+
333
+ The defaults belong to this user's login on the selected platform, so `logout` removes them, and older SDK versions drop them when they rewrite the CLI config file.
334
+
305
335
  When no subcommand is provided, defaults to `list`.
306
336
 
307
337
  **Output (default):**
@@ -103,7 +103,7 @@ tailor workspace create [options]
103
103
  | Option | Alias | Description | Required | Default | Env |
104
104
  | ------------------------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------- | --------------------------------- |
105
105
  | `--name <NAME>` | `-n` | Workspace name | Yes | - | - |
106
- | `--region <REGION>` | `-r` | Workspace region (us-west, asia-northeast) | Yes | - | - |
106
+ | `--region <REGION>` | `-r` | Workspace region (asia-northeast, us-west) | Yes | - | - |
107
107
  | `--delete-protection` | `-d` | Enable delete protection | No | `false` | - |
108
108
  | `--organization-id <ORGANIZATION_ID>` | `-o` | Organization ID to workspace associate with | No | - | `TAILOR_PLATFORM_ORGANIZATION_ID` |
109
109
  | `--folder-id <FOLDER_ID>` | `-f` | Folder ID to workspace associate with | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
@@ -115,6 +115,12 @@ tailor workspace create [options]
115
115
 
116
116
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
117
117
 
118
+ **Notes**
119
+
120
+ Without --organization-id and --folder-id, on the command line or through TAILOR_PLATFORM_ORGANIZATION_ID / TAILOR_PLATFORM_FOLDER_ID, the workspace is created in the default organization and folder that the logged-in user set with `user update`, unless TAILOR_PLATFORM_TOKEN is set. Giving either option replaces both defaults, and --folder-id requires --organization-id.
121
+
122
+ TAILOR_PLATFORM_ORGANIZATION_ID and TAILOR_PLATFORM_FOLDER_ID are also read from --env-file. Command-line options take precedence over the corresponding environment variables. Empty values in the env file are treated as not given.
123
+
118
124
  ### workspace delete
119
125
 
120
126
  Delete a Tailor Platform workspace.
@@ -207,7 +213,9 @@ Use this to reclaim workspaces left behind by CI runs, preview deployments, or i
207
213
 
208
214
  With --expired the workspaces select themselves instead: each one is deleted only once the --ttl expiry it recorded at creation has passed, so callers need no --name or --older-than. A workspace that records no expiry is never deleted this way, and neither is one whose recorded expiry cannot be read. Because that expiry is recorded on the workspace rather than derived from its name, anything able to write the workspace's metadata can bring its deletion forward -- and writing a workspace's metadata is a lesser permission than deleting it. --expired therefore requires at least one location, and --name still applies on top.
209
215
 
210
- Every workspace lives in exactly one location, and the location options name them explicitly: --organization-root selects the workspaces directly under an organization and none inside its folders, --folder-id selects the workspaces in one folder, and --personal selects the workspaces belonging to no organization and no folder. Each option can be given more than once, they combine as a union, and none of them is read from the environment -- a sweep covers exactly the locations spelled out on the command line. Selecting --personal is a deliberate choice to accept, for every organization-less workspace visible to this login, the expiry that anyone able to write a workspace's metadata may have recorded. Without any location option, a --name / --older-than sweep considers every visible workspace.
216
+ Every workspace lives in exactly one location, and the location options name them explicitly: --organization-root selects the workspaces directly under an organization and none inside its folders, --folder-id selects the workspaces in one folder, and --personal selects the workspaces belonging to no organization and no folder. Each option can be given more than once, they combine as a union, and none of them is read from the environment or from the default organization/folder set by `user update` -- a sweep covers exactly the locations spelled out on the command line. Selecting --personal is a deliberate choice to accept, for every organization-less workspace visible to this login, the expiry that anyone able to write a workspace's metadata may have recorded. Without any location option, a --name / --older-than sweep considers every visible workspace.
217
+
218
+ Without a location option, prune warns before listing workspaces that every workspace visible to this login is a candidate for the name and age filters, even with --yes or --dry-run. The default organization/folder set by `tailor user update` is not used.
211
219
 
212
220
  Restoring a workspace does not clear its recorded expiry, so a workspace restored after expiring is deleted again by the next --expired run. Restore it, then run `workspace ttl set` or `workspace ttl clear` before the next run — or keep it out of that run with --exclude.
213
221
 
@@ -50,6 +50,16 @@ keep table output. Other values are rejected. JSON mode also disables interactiv
50
50
  variable per invocation or per job rather than exporting it from a shell profile; a command that
51
51
  needed a prompt names what selected JSON when it refuses.
52
52
 
53
+ When an AI coding agent such as Claude Code, Codex, Cursor, or Gemini CLI runs the CLI, every
54
+ command defaults to JSON as if `TAILOR_JSON_OUTPUT=true` were set, and `--help` starts with a short
55
+ guide for the agent. The CLI recognizes an agent by the environment variables it sets for the
56
+ commands it runs; a non-blank `AI_AGENT` also counts as one. An explicit `--json` or
57
+ `TAILOR_JSON_OUTPUT` still wins, so `--json=false` or `TAILOR_JSON_OUTPUT=false` keeps table output
58
+ under an agent, and setting `POLITTY_NO_AGENT` to any non-empty value, such as `1`, turns agent
59
+ detection off. Set these variables in the environment itself: values loaded with `--env-file` do not
60
+ change the default. CLI plugins keep table output under an agent unless they receive `--json` or
61
+ `TAILOR_JSON_OUTPUT`, and their `--help` does not include the guide.
62
+
53
63
  Errors, warnings, progress, and diagnostic messages are written to stderr. A command failure under
54
64
  `--json` or `TAILOR_JSON_OUTPUT` emits a JSON error envelope to stderr, including a failure while
55
65
  parsing arguments: an unknown option or subcommand, or an option value that fails validation, is
@@ -107,9 +117,9 @@ without reporting through the CLI's error path, such as one relaying a failed re
107
117
  writes no annotation.
108
118
 
109
119
  Set `TAILOR_GITHUB_ACTIONS_ANNOTATIONS=false` (also `off`, `no`, or `0`) to turn annotations off.
110
- Passing `--json` or setting `TAILOR_JSON_OUTPUT` also suppresses them, so a workflow step that parses
111
- JSON output gets only the error envelope on stderr, even when the command fails during argument
112
- parsing.
120
+ Passing `--json`, setting `TAILOR_JSON_OUTPUT`, or the JSON default under an AI coding agent also
121
+ suppresses them, so a workflow step that parses JSON output gets only the error envelope on stderr,
122
+ even when the command fails during argument parsing.
113
123
 
114
124
  An annotation does not by itself fail a step: the step still fails on the CLI's exit code, which
115
125
  is unchanged. Workflows that already echo their own `::error::` around the CLI keep working;
@@ -314,6 +324,17 @@ Commands for managing TailorDB tables, data, and schema migrations.
314
324
  | [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
315
325
  | [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local tables vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
316
326
 
327
+ ### [Data Commands](./cli/data.md)
328
+
329
+ Commands for managing application data across workspaces.
330
+
331
+ | Command | Description |
332
+ | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
333
+ | [data](./cli/data.md#data) | Manage application data across workspaces. |
334
+ | [data clone](./cli/data.md#data-clone) | Clone the data of an application (TailorDB namespaces registered in its subgraph) from one workspace to another. |
335
+ | [data operation](./cli/data.md#data-operation) | Inspect asynchronous application data operations. |
336
+ | [data operation get](./cli/data.md#data-operation-get) | Show the status of a data clone, or wait for it to finish. |
337
+
317
338
  ### [Query Commands](./cli/query.md)
318
339
 
319
340
  Run ad-hoc SQL/GraphQL queries or enter the interactive REPL.
@@ -342,6 +363,7 @@ Commands for authentication and user management.
342
363
  | [user pat list](./cli/user.md#user-pat-list) | List all personal access tokens. |
343
364
  | [user pat update](./cli/user.md#user-pat-update) | Update a personal access token (delete and recreate). |
344
365
  | [user switch](./cli/user.md#user-switch) | Set current user. |
366
+ | [user update](./cli/user.md#user-update) | Set the current user's default organization and folder for new workspaces. |
345
367
 
346
368
  ### [Organization Commands](./cli/organization.md)
347
369
 
@@ -77,6 +77,28 @@ This is a bundle-time setting. Changing `TAILOR_APP_LOG_LEVEL` affects newly bun
77
77
 
78
78
  Only `logger.*` calls made through the SDK's `logger` wrapper (from `@tailor-platform/sdk/runtime` or its `@tailor-platform/sdk/runtime/logger` subpath), or written as `globalThis.tailor.logger.*`, are covered. Other equivalent forms — such as the bare `tailor.logger.*` global or `self.tailor.logger.*` — are not affected by `logLevel`.
79
79
 
80
+ **Date Representation** (`defaultDateRepresentation`): Sets the value representation of `t.date()`, `t.datetime()`, and `t.time()` fields that omit `as`. With `"temporal"`, those fields carry `Temporal.PlainDate`, `Temporal.Instant`, and `Temporal.PlainTime` values instead of strings, so a project that uses Temporal everywhere does not have to repeat `as: "temporal"` on every field; with `"date"`, they carry `Date` values, as `as: "date"` gives them. A field's own `as` still wins, including `as: "string"`. Run `tailor generate` after changing the setting so `tailor.d.ts` updates the field types.
81
+
82
+ ```typescript
83
+ export default defineConfig({
84
+ name: "my-app",
85
+ defaultDateRepresentation: "temporal",
86
+ });
87
+ ```
88
+
89
+ The default applies wherever the SDK parses or serializes `t` fields on your behalf: resolver input and output in deployed functions and in `tailor function run`, `.parse()` and `parseDateFields` inside any bundled function (resolvers, executors, workflow jobs, auth hooks, TailorDB hooks and validators, migration scripts), and the [`tailor-runtime` Vitest environment](./testing.md#loading-secrets-from-config) when `tailorRuntime({ config })` points at the config. It does not apply to `db.*` fields, or to `t` fields parsed outside those places, such as a plain Node.js script or a module that runs while `tailor.config.ts` itself is being loaded; there the fields keep string values. A migration script keeps the representation that was in effect when it was generated, recorded in its `diff.json`, so changing the setting later does not alter migrations a new workspace has yet to run. That record covers the values at run time only; the TypeScript types of `t` fields follow the current `tailor.d.ts` everywhere, so a `t` date field declared inside a migration script should set `as` explicitly to keep its type and its values aligned after the setting changes.
90
+
91
+ The setting is per `tailor.config.ts`, but the field types are declared through `tailor.d.ts`, which TypeScript merges across every file in a program. If one `tsconfig.json` includes the `tailor.d.ts` of several applications, they must agree on `defaultDateRepresentation`. When they differ, `t.date()`, `t.datetime()`, and `t.time()` called without `as` fail to type-check in that program until the configs are aligned or each application gets its own `tsconfig.json`.
92
+
93
+ **Maintenance Mode** (`maintenanceMode`): Whether `deploy` restricts the TailorDB namespaces it migrates while it applies pending migrations: `"migration"` (the default) restricts them until the migrations complete, `"deploy"` until the whole deploy completes, and `false` does not restrict them. See [Maintenance mode](./services/tailordb-migration.md#maintenance-mode) for what is restricted and what concurrent requests can observe without it.
94
+
95
+ ```typescript
96
+ export default defineConfig({
97
+ name: "my-app",
98
+ maintenanceMode: "migration",
99
+ });
100
+ ```
101
+
80
102
  ### Service Configuration
81
103
 
82
104
  Specify glob patterns to load service files:
@@ -185,11 +207,11 @@ import { defineIdp } from "@tailor-platform/sdk";
185
207
  const idp = defineIdp("my-idp", {
186
208
  clients: ["my-client"],
187
209
  permission: {
188
- create: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
189
- read: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
190
- update: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
191
- delete: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
192
- sendPasswordResetEmail: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
210
+ create: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
211
+ read: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
212
+ update: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
213
+ delete: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
214
+ sendPasswordResetEmail: [{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true }],
193
215
  },
194
216
  });
195
217
 
@@ -310,7 +332,7 @@ When the SDK deploys application code or runs detected service code with `functi
310
332
  | Executor callbacks | `body: ({ env }) => ...`, `url: ({ env }) => String(env.bar)`, `variables: ({ env }) => ({ enabled: env.baz })`, or similar callback args |
311
333
  | Workflow job body | `body: (input, { env }) => ...` |
312
334
  | Auth before-login hook | `handler: async ({ env }) => ...` |
313
- | TailorDB migration script | `main(trx, { env }: MigrationContext)` |
335
+ | TailorDB migration script | `main(trx, { env }: MigrationContext)`, or each step's `run(trx, { env })` |
314
336
  | `function run` | Same `env` argument shape as the detected resolver, executor, or workflow job |
315
337
 
316
338
  ```typescript