@tailor-platform/sdk 2.37.0 → 2.39.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 (113) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/{application-83WVdH85.mjs → application-OeNMQzOC.mjs} +1 -1
  3. package/dist/application-mNOJx9Y2.mjs +207 -0
  4. package/dist/application-mNOJx9Y2.mjs.map +1 -0
  5. package/dist/cli/commands/deploy/deploy.d.mts +1 -0
  6. package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +2 -0
  7. package/dist/cli/commands/executor/trigger.d.mts +1 -0
  8. package/dist/cli/commands/generate/seed/bundler.d.mts +7 -5
  9. package/dist/cli/commands/workspace/transform.d.mts +1 -2
  10. package/dist/cli/lib.d.mts +5 -3
  11. package/dist/cli/lib.mjs +1 -1
  12. package/dist/cli/lib.mjs.map +1 -1
  13. package/dist/cli/main.mjs +67 -61
  14. package/dist/cli/main.mjs.map +1 -1
  15. package/dist/cli/shared/args.d.mts +14 -5
  16. package/dist/cli/shared/build-options.d.mts +13 -0
  17. package/dist/cli/shared/client.d.mts +15 -3
  18. package/dist/cli/shared/error-json.d.mts +12 -26
  19. package/dist/cli/shared/script-workflow.d.mts +65 -0
  20. package/dist/cli/shared/seed-chunker.d.mts +3 -3
  21. package/dist/client-CqiPQgMG.mjs +2 -0
  22. package/dist/client-CqiPQgMG.mjs.map +1 -0
  23. package/dist/client-DO2_Xz_z.mjs +1 -0
  24. package/dist/completion/zsh-worker.zsh +193 -74
  25. package/dist/configure/index.mjs +1 -1
  26. package/dist/configure/index.mjs.map +1 -1
  27. package/dist/configure/services/auth/types.d.mts +20 -3
  28. package/dist/configure/services/executor/operation.d.mts +5 -4
  29. package/dist/configure/services/executor/trigger/webhook.d.mts +8 -1
  30. package/dist/configure/services/http-adapter/http-adapter.d.mts +1 -1
  31. package/dist/configure/services/index.d.mts +0 -1
  32. package/dist/configure/services/tailordb/types.d.mts +9 -0
  33. package/dist/context-CYBcQZyO.mjs +1 -0
  34. package/dist/context-aAgFGDBD.mjs +23 -0
  35. package/dist/context-aAgFGDBD.mjs.map +1 -0
  36. package/dist/{crashreport-D_wf4GZh.mjs → crashreport-CQTAlnbA.mjs} +2 -2
  37. package/dist/{crashreport-D_wf4GZh.mjs.map → crashreport-CQTAlnbA.mjs.map} +1 -1
  38. package/dist/crashreport-GRnWyDnF.mjs +1 -0
  39. package/dist/{errors-Dmdnq0zi.mjs → errors-9OOL3xOM.mjs} +6 -5
  40. package/dist/errors-9OOL3xOM.mjs.map +1 -0
  41. package/dist/field_behavior_pb-B196sUx6.mjs +2 -0
  42. package/dist/field_behavior_pb-B196sUx6.mjs.map +1 -0
  43. package/dist/{kysely-type-DVL90_oX.mjs → kysely-type-DhAZqdQg.mjs} +14 -10
  44. package/dist/kysely-type-DhAZqdQg.mjs.map +1 -0
  45. package/dist/notification_resource_pb-BZ0hCA01.mjs +1 -0
  46. package/dist/notification_resource_pb-Dwzah7gO.mjs +2 -0
  47. package/dist/notification_resource_pb-Dwzah7gO.mjs.map +1 -0
  48. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  49. package/dist/register-ts-hook-CORbtrSN.mjs +1105 -0
  50. package/dist/register-ts-hook-CORbtrSN.mjs.map +1 -0
  51. package/dist/repl-editor-Bposemei.mjs +2 -0
  52. package/dist/repl-editor-Bposemei.mjs.map +1 -0
  53. package/dist/resource_pb-elY668ZB.mjs +2 -0
  54. package/dist/resource_pb-elY668ZB.mjs.map +1 -0
  55. package/dist/{secret-file-DiuEcLFP.mjs → secret-file-CSXzcg4c.mjs} +2 -2
  56. package/dist/{secret-file-DiuEcLFP.mjs.map → secret-file-CSXzcg4c.mjs.map} +1 -1
  57. package/dist/service-B2vx6CGM.mjs +2 -0
  58. package/dist/{service-DDrbdyd-.mjs.map → service-B2vx6CGM.mjs.map} +1 -1
  59. package/dist/service-Bkz_TB5v.mjs +9 -0
  60. package/dist/service-Bkz_TB5v.mjs.map +1 -0
  61. package/dist/service-Dffd4how.mjs +1 -0
  62. package/dist/service_pb-Bethc2NW.mjs +1 -0
  63. package/dist/service_pb-CfpSriCy.mjs +2 -0
  64. package/dist/service_pb-CfpSriCy.mjs.map +1 -0
  65. package/dist/syntax-diagnostic-BQgOV8Fz.mjs +2 -0
  66. package/dist/syntax-diagnostic-BQgOV8Fz.mjs.map +1 -0
  67. package/dist/validation-errors-ChvCG6wT.mjs +3 -0
  68. package/dist/validation-errors-ChvCG6wT.mjs.map +1 -0
  69. package/{LICENSE → dist/vendor/graphql/LICENSE} +6 -6
  70. package/dist/vendor/graphql/language/KindTypeMap.d.mts +3 -0
  71. package/dist/vendor/graphql/language/ast.d.mts +784 -0
  72. package/dist/vendor/graphql/language/kinds_.d.mts +203 -0
  73. package/dist/vendor/graphql/language/source.d.mts +46 -0
  74. package/dist/vendor/graphql/language/tokenKind.d.mts +35 -0
  75. package/dist/vitest/index.mjs +1 -1
  76. package/dist/vitest/index.mjs.map +1 -1
  77. package/dist/workspace_resource_pb-Cow7mrJY.mjs +2 -0
  78. package/dist/workspace_resource_pb-Cow7mrJY.mjs.map +1 -0
  79. package/docs/cli/application.md +16 -12
  80. package/docs/cli/executor.md +13 -17
  81. package/docs/cli/function.md +1 -1
  82. package/docs/cli/notification.md +128 -0
  83. package/docs/cli/tailordb.md +26 -57
  84. package/docs/cli/workspace.md +3 -4
  85. package/docs/cli-reference.md +228 -48
  86. package/docs/configuration.md +28 -0
  87. package/docs/github-actions.md +241 -38
  88. package/docs/migration/v2.md +5 -3
  89. package/docs/services/auth.md +5 -0
  90. package/docs/services/executor.md +2 -0
  91. package/docs/services/tailordb/index.md +6 -2
  92. package/docs/services/tailordb/migration.md +54 -57
  93. package/docs/testing.md +0 -1
  94. package/package.json +25 -21
  95. package/dist/application-Cida-j1g.mjs +0 -207
  96. package/dist/application-Cida-j1g.mjs.map +0 -1
  97. package/dist/configure/services/http-adapter/index.d.mts +0 -2
  98. package/dist/crashreport-C2AcQNTe.mjs +0 -1
  99. package/dist/errors-Dmdnq0zi.mjs.map +0 -1
  100. package/dist/kysely-type-DVL90_oX.mjs.map +0 -1
  101. package/dist/register-ts-hook-Ht4zCseV.mjs +0 -1115
  102. package/dist/register-ts-hook-Ht4zCseV.mjs.map +0 -1
  103. package/dist/repl-editor-DkrCZmmg.mjs +0 -2
  104. package/dist/repl-editor-DkrCZmmg.mjs.map +0 -1
  105. package/dist/service-CZ0EdD2-.mjs +0 -10
  106. package/dist/service-CZ0EdD2-.mjs.map +0 -1
  107. package/dist/service-DDrbdyd-.mjs +0 -2
  108. package/dist/service-WhSyhaho.mjs +0 -1
  109. package/dist/service_pb-BMHhVot2.mjs +0 -1
  110. package/dist/service_pb-BxMSK0gg.mjs +0 -2
  111. package/dist/service_pb-BxMSK0gg.mjs.map +0 -1
  112. package/dist/workspace_resource_pb-7smKERdZ.mjs +0 -2
  113. package/dist/workspace_resource_pb-7smKERdZ.mjs.map +0 -1
@@ -16,12 +16,12 @@ tailor <command> [options]
16
16
 
17
17
  <a id="global-options"></a>
18
18
 
19
- | Option | Alias | Description | Required | Default | Env |
20
- | ------------------------------------------- | ----- | --------------------------------------------------- | -------- | ------- | -------------------- |
21
- | `--env-file <ENV_FILE>` | `-e` | Path to the environment file (error if not found) | No | - | - |
22
- | `--env-file-if-exists <ENV_FILE_IF_EXISTS>` | - | Path to the environment file (ignored if not found) | No | - | - |
23
- | `--verbose` / `--no-verbose` | - | Enable verbose logging | No | `false` | - |
24
- | `--json` / `--no-json` | `-j` | Output as JSON | No | `false` | `TAILOR_JSON_OUTPUT` |
19
+ | Option | Alias | Description | Required | Default | Env |
20
+ | ------------------------------------------- | ----- | -------------------------------------------------------------- | -------- | ------- | -------------------- |
21
+ | `--env-file <ENV_FILE>` | `-e` | Path to an environment file, repeatable (error if not found) | No | - | - |
22
+ | `--env-file-if-exists <ENV_FILE_IF_EXISTS>` | - | Path to an environment file, repeatable (ignored if not found) | No | - | - |
23
+ | `--verbose` / `--no-verbose` | - | Enable verbose logging | No | `false` | - |
24
+ | `--json` / `--no-json` | `-j` | Output as JSON | No | `false` | `TAILOR_JSON_OUTPUT` |
25
25
 
26
26
  ### Progress and Detailed Logs
27
27
 
@@ -61,16 +61,17 @@ guide for the agent. The CLI recognizes an agent by the environment variables it
61
61
  commands it runs; a non-blank `AI_AGENT` also counts as one. An explicit `--json` or
62
62
  `TAILOR_JSON_OUTPUT` still wins, so `--json=false` or `TAILOR_JSON_OUTPUT=false` keeps table output
63
63
  under an agent, and setting `POLITTY_NO_AGENT` to any non-empty value, such as `1`, turns agent
64
- detection off. Set these variables in the environment itself: values loaded with `--env-file` do not
65
- change the default. CLI plugins keep table output under an agent unless they receive `--json` or
66
- `TAILOR_JSON_OUTPUT`, and their `--help` does not include the guide.
64
+ detection off. Set `AI_AGENT` and `POLITTY_NO_AGENT` in the environment itself: values loaded with
65
+ `--env-file` do not change agent detection. CLI plugins keep table output under an agent unless they
66
+ receive `--json` or `TAILOR_JSON_OUTPUT`, and their `--help` does not include the guide.
67
67
 
68
68
  Errors, warnings, progress, and diagnostic messages are written to stderr. A command failure under
69
69
  `--json` or `TAILOR_JSON_OUTPUT` emits a JSON error envelope to stderr, including a failure while
70
70
  parsing arguments: an unknown option or subcommand, or an option value that fails validation, is
71
71
  reported as `INVALID_ARGUMENTS`. Failures you can act on — an invalid or missing option, a resource
72
72
  that does not exist, an invalid configuration, or an unmet precondition — carry a stable `error.code`
73
- such as `PROFILE_NOT_FOUND`, `TAILORDB_NAMESPACE_NOT_FOUND`, or `MIGRATION_SCRIPT_REQUIRED`. Where a
73
+ such as `PROFILE_NOT_FOUND`, `TAILORDB_NAMESPACE_NOT_FOUND`, or `MIGRATION_SCRIPT_REQUIRED`
74
+ ([Migration Error Codes](#migration-error-codes-beta) lists the codes for migrations). Where a
74
75
  remediation exists, the envelope also includes
75
76
  `error.suggestion`, `error.help` (the `--help` invocation for the failing command), `error.next` (a
76
77
  runnable command), or `error.context`. `UNEXPECTED_ERROR` marks failures without a dedicated code,
@@ -103,6 +104,172 @@ Generation hook failures use `PLUGIN_GENERATION_FAILED`. The error includes the
103
104
  and each failing plugin's ID and error in `error.context.failures`; successful plugins are
104
105
  excluded from that list.
105
106
 
107
+ #### Migration Error Codes (Beta)
108
+
109
+ `tailor deploy` and the `tailor tailordb migration` commands report these codes when migration
110
+ files, the migration state of a namespace, or a migration run stops them. Each entry says what
111
+ happened; the next step, where one exists, is in `error.suggestion` and `error.next`. `tailor
112
+ tailordb migration test` deploys the pending migrations to a test workspace, so it can also report
113
+ the `tailor deploy` codes. See [TailorDB Migrations](./services/tailordb/migration.md) for the terms
114
+ used here.
115
+
116
+ Migration files, reported by `tailor deploy` and by the `tailor tailordb migration` commands that
117
+ read them:
118
+
119
+ - `MIGRATION_DIRECTORY_CONFLICT`: two or more namespaces use the same migrations directory.
120
+ - `MIGRATION_FILES_INVALID`: a migrations directory has no `0000/schema.json`, a gap or a duplicate
121
+ in its numbering, or a migration without `diff.json`.
122
+ - `MIGRATION_FILE_INVALID`: a `schema.json` or `diff.json` is not valid JSON or does not have the
123
+ expected structure.
124
+ - `MIGRATION_FILE_VERSION_UNSUPPORTED`: a migration file uses a format version that this SDK version
125
+ does not support.
126
+
127
+ `tailor deploy`, checked while planning, so `--dry-run` reports them too:
128
+
129
+ - `MIGRATION_SCHEMA_CHECK_FAILED`: the local table definitions have changes that no migration file
130
+ records.
131
+ - `MIGRATION_REMOTE_DRIFT`: the workspace's tables differ from the schema of the migration that its
132
+ checkpoint records.
133
+ - `MIGRATION_CHECKPOINT_UNKNOWN`: the workspace's checkpoint is not in the local migration history:
134
+ it is past the latest local migration, or it belongs to another migration history.
135
+ - `MIGRATION_SCRIPT_REQUIRED`: a pending migration requires a `migrate.ts`, and it has neither one
136
+ nor a recorded `--no-script` acknowledgment.
137
+ - `MIGRATION_SCRIPT_SKIP_CONFLICT`: a pending migration has both a `migrate.ts` and a recorded
138
+ `--no-script` acknowledgment.
139
+ - `MIGRATION_SCRIPT_REVIEW_REQUIRED`: a pending migration's `migrate.ts` still has a `TODO()` call
140
+ or review marker that the generated script left.
141
+ - `MIGRATION_SCRIPT_INVALID`: a pending migration's `migrate.ts` cannot be parsed, or its exports or
142
+ `steps` are not valid.
143
+ - `MIGRATION_SCRIPT_BUNDLE_FAILED`: a pending migration's `migrate.ts` could not be bundled.
144
+ - `AUTH_CONFIG_REQUIRED`: a pending migration has a `migrate.ts`, but the config defines no auth to
145
+ run it.
146
+ - `MACHINE_USER_REQUIRED`: a pending migration has a `migrate.ts`, but no machine user is selected
147
+ to run the scripts of its namespace.
148
+ - `MACHINE_USER_NOT_FOUND`: the machine user selected to run a pending migration's `migrate.ts` is
149
+ not defined in auth.
150
+ - `MIGRATION_OUTCOME_UNSETTLED`: an earlier deploy could not confirm whether a migration's script
151
+ ran, and the migration has not been settled since.
152
+ - `MIGRATION_IN_PROGRESS_INVALID`: the migration recorded as in progress cannot be read, is not the
153
+ next pending migration, or no longer exports `steps` although some of its steps ran.
154
+ - `MIGRATION_IN_PROGRESS_CONFLICT`: a namespace whose checkpoint the deploy would reset to `0000`
155
+ has a migration in progress.
156
+ - `MIGRATION_SKIP_STEPS_FORMAT_INVALID`: a `--migration-skip-steps` entry is not in the form
157
+ `<namespace>/<step>`.
158
+ - `MIGRATION_SKIP_STEPS_INVALID`: a `--migration-skip-steps` entry names a namespace that no
159
+ deployed config defines or that has no partially applied migration, or a step that is not in the
160
+ migration, that has no earlier run, or that did not succeed in the earlier run.
161
+ - `MIGRATION_SKIP_STEPS_UNVERIFIED`: the step results of the earlier run could not be read, so the
162
+ steps passed to `--migration-skip-steps` could not be checked.
163
+
164
+ `tailor deploy`, while applying:
165
+
166
+ - `DEPLOY_PLAN_STALE`: the migration files, a checkpoint reset, or the tables to delete changed
167
+ after the deploy was planned. `tailor tailordb migration test` reports it when the migration
168
+ files changed after it planned its deploy.
169
+ - `MIGRATION_HISTORY_INVALID`: the schema before a pending migration could not be rebuilt from the
170
+ migration files.
171
+ - `MIGRATION_CHECKPOINT_CONFLICT`: a namespace's checkpoint or migration history changed while the
172
+ deploy ran, for example because another deploy moved it.
173
+ - `MIGRATION_CHECKPOINT_UNVERIFIED`: the deploy could not read a namespace's checkpoint to confirm
174
+ that it had not changed.
175
+ - `MIGRATION_FAILED`: a migration's script failed, and the deploy rolled the migration back to the
176
+ previous checkpoint.
177
+ - `MIGRATION_ROLLED_BACK`: a migration whose `migrate.ts` exports `steps` and
178
+ `onFailure = "rollback"` failed, and the deploy rolled it back to the previous checkpoint.
179
+ - `MIGRATION_PARTIALLY_APPLIED`: a migration stopped partway and stays in progress: a `steps`
180
+ migration failed after some of its steps may have been applied, or the deploy could not clear
181
+ the in-progress record of a failed migration, so its schema was not rolled back.
182
+ - `MIGRATION_OUTCOME_UNKNOWN`: the deploy could not confirm whether a migration's script started or
183
+ finished, or whether an earlier run of the script is still running.
184
+ - `MIGRATION_LOCAL_DEFINITIONS_FAILED`: with `--no-schema-check`, a local table definition that the
185
+ pending migrations do not include could not be applied after the migrations completed.
186
+ - `MIGRATION_RESTORE_FAILED`: the settings of some tables, such as their maintenance mode, could not
187
+ be restored after the migrations. When a migration had already failed, the deploy reports that
188
+ failure instead and puts this error in its `error.context.restoration`.
189
+
190
+ `tailor tailordb migration` commands:
191
+
192
+ - `MIGRATION_CONFIG_NOT_FOUND`: no TailorDB namespace in the config has `migration` configured.
193
+ - `MIGRATION_VALIDATION_FAILED`: `validate` found a problem in at least one namespace. Its result
194
+ lists the problems of each namespace, including the migration file and deploy checks above.
195
+ - `MIGRATION_STATUS_FAILED`: `status` could not report at least one namespace, for example because
196
+ its migration files are invalid, its migration history differs from the workspace's, or its
197
+ checkpoint is past the latest local migration.
198
+ - `MIGRATION_IN_PROGRESS`: `rebaseline`, `sync`, or `test` found a migration in progress in the
199
+ namespace: partially applied steps, a script run that is not settled, or an in-progress record
200
+ that cannot be read.
201
+ - `MIGRATION_HISTORY_MISMATCH`: replaying the local migration files does not reproduce the current
202
+ local table definitions (`rebaseline`, `sync`, `resolve`).
203
+ - `MIGRATION_BASELINE_NOT_FOUND`: the namespace has no `0000` migration to rebuild its schema from.
204
+ - `MIGRATION_HISTORY_NOT_FOUND`: `rebaseline` found no migrations for the namespace.
205
+ - `MIGRATION_NAMESPACE_NOT_DEPLOYED`: the namespace does not exist in the workspace (`sync`,
206
+ `resolve`).
207
+ - `MIGRATION_NOT_FOUND`: the migration that `sync` was given, or that `resolve` would return the
208
+ namespace to, is not in the local migration files.
209
+ - `MIGRATION_SYNC_HISTORY_MISMATCH`: the namespace records a different migration history ID, or one
210
+ that cannot be read, and `sync` was run without `--force`.
211
+ - `MIGRATION_SYNC_CANCELLED`: the `sync` confirmation was declined.
212
+ - `MIGRATION_RESOLVE_DIRECTION_REQUIRED`: `resolve` was given neither or both of `--rollback` and
213
+ `--complete`.
214
+ - `MIGRATION_RESOLVE_NO_IN_PROGRESS`: `resolve` found nothing to settle: no migration is in
215
+ progress in the namespace, and with `--rollback`, no interrupted deploy left the pre-migration
216
+ schema of a migration either.
217
+ - `MIGRATION_RESOLVE_RECORD_UNREADABLE`: the namespace's in-progress record cannot be read.
218
+ - `MIGRATION_RESOLVE_RECORD_INVALID`: the migration recorded as in progress is not the one after
219
+ the checkpoint.
220
+ - `MIGRATION_RESOLVE_HISTORY_MISMATCH`: the namespace records a different migration history ID from
221
+ the local migration files.
222
+ - `MIGRATION_EXECUTION_ACTIVE`: the script run of the migration that `resolve` would settle is still
223
+ running.
224
+ - `MIGRATION_RESOLVE_STATE_CHANGED`: the namespace's checkpoint, migration history, or in-progress
225
+ record changed while `resolve` was running.
226
+ - `MIGRATION_RESOLVE_CANCELLED`: the `resolve` confirmation was declined.
227
+ - `REBASELINE_CHECKPOINT_BEHIND`: the workspace's checkpoint is not the latest local migration.
228
+ - `REBASELINE_REMOTE_HISTORY_INVALID`: the workspace's migration history ID cannot be read.
229
+ - `REBASELINE_REMOTE_HISTORY_MISMATCH`: the workspace records a different migration history ID from
230
+ the local migration files.
231
+ - `REBASELINE_REMOTE_SCHEMA_MISMATCH`: the workspace's tables do not match the latest migration.
232
+ - `REBASELINE_STATE_CHANGED`: the workspace's migration history ID, the migration files, or the
233
+ local table or config files changed while `rebaseline` waited for confirmation.
234
+ - `REBASELINE_CANCELLED`: the `rebaseline` confirmation was declined.
235
+ - `REBASELINE_CHECKPOINT_UPDATE_FAILED`: the local migration history was replaced, but resetting
236
+ the workspace's checkpoint to `0000` failed.
237
+ - `MIGRATION_TEST_OPTIONS_INVALID`: the options of `test` conflict, for example `--keep-ttl`
238
+ without `--keep`, or `--organization-id` or `--folder-id` does not match the target workspace.
239
+ - `MIGRATION_TEST_TARGET_INVALID`: the target workspace is the source workspace.
240
+ - `MIGRATION_TEST_REGION_MISMATCH`: with `--data clone`, the target workspace is in a different
241
+ region from the source.
242
+ - `MIGRATION_TEST_ASSERT_NAMESPACE_REQUIRED`: `--assert` was given, the pending migrations span
243
+ several namespaces, and `--assert-namespace` was not given.
244
+ - `MIGRATION_TEST_NO_PENDING_MIGRATIONS`: the source workspace has no pending migration, or the
245
+ `--assert-namespace` has none.
246
+ - `MIGRATION_TEST_SOURCE_CHECKPOINT_MISSING`: a namespace has not been deployed to the source
247
+ workspace.
248
+ - `MIGRATION_TEST_SOURCE_INVALID`: a source namespace's tables do not match its checkpoint, or,
249
+ without a checkpoint, do not match `0000`.
250
+ - `MIGRATION_TEST_SOURCE_AHEAD`: a source namespace's checkpoint is past the latest local migration.
251
+ - `MIGRATION_TEST_SOURCE_REPAIR_PENDING`: a source namespace's checkpoint is waiting for the reset
252
+ to `0000` that a deploy applies after a re-baseline.
253
+ - `MIGRATION_TEST_SOURCE_CLEANUP_PENDING`: a source namespace still has tables that the migration
254
+ at its checkpoint removed.
255
+ - `MIGRATION_TEST_SOURCE_CHANGED`: with `--data clone`, the source workspace changed between
256
+ preparing the test and cloning its data.
257
+ - `MIGRATION_TEST_SNAPSHOT_NOT_FOUND`: the schema of the latest migration could not be rebuilt from
258
+ the migration files.
259
+ - `MIGRATION_TEST_SNAPSHOT_INVALID`: the migration schemas to deploy to the target name a namespace
260
+ that is not in the config, or define the same table name in two namespaces.
261
+ - `MIGRATION_TEST_CLONE_UNAVAILABLE`: data cloning is not enabled on the Platform.
262
+ - `MIGRATION_TEST_CLONE_FAILED`: cloning the source data failed.
263
+ - `MIGRATION_TEST_CLONE_TIMEOUT`: cloning the source data did not finish within `--clone-timeout`.
264
+ - `MIGRATION_TEST_SEED_FAILED`: the seed script failed.
265
+ - `MIGRATION_TEST_ASSERTION_FAILED`: the assertion script failed.
266
+ - `MIGRATION_TEST_WORKSPACE_CLEANUP_FAILED`: the test passed, but deleting its temporary workspace
267
+ failed.
268
+
269
+ Codes of `tailor tailordb migration generate` and `tailor tailordb migration script`, and other
270
+ codes for options or arguments that cannot be used, such as a namespace or migration number that
271
+ does not exist, are not listed; their messages name the cause.
272
+
106
273
  ### Verbose Output
107
274
 
108
275
  Use `--verbose` to include debug diagnostics and error stack traces. `DEBUG=true` or
@@ -174,6 +341,7 @@ Both `--env-file` and `--env-file-if-exists` can be specified multiple times and
174
341
  - Variables already set in the environment are **not** overwritten
175
342
  - Later files override earlier files
176
343
  - `--env-file` files are loaded first, then `--env-file-if-exists` files
344
+ - Loaded values fill options backed by an environment variable, such as `--config` from `TAILOR_CONFIG_PATH`
177
345
 
178
346
  ```bash
179
347
  # Load .env (required) and .env.local (optional, if exists)
@@ -187,27 +355,28 @@ tailor deploy --env-file .env --env-file .env.production
187
355
 
188
356
  You can use environment variables to configure workspace and authentication:
189
357
 
190
- | Variable | Description |
191
- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
192
- | `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
193
- | `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
194
- | `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
195
- | `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
196
- | `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
197
- | `TAILOR_CONFIG_PATH` | Path to Tailor config file |
198
- | `TAILOR_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
199
- | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
200
- | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
201
- | `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function run`, `machineuser token` |
202
- | `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
203
- | `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
204
- | `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
205
- | `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
206
- | `TAILOR_APPLY_CONCURRENCY` | Max concurrent platform RPCs during `apply`/`deploy`. Defaults to 16 |
207
- | `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
208
- | `TAILOR_GITHUB_ACTIONS_ANNOTATIONS` | GitHub Actions failure annotations: `on` (default) or `off` |
209
- | `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
210
- | `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
358
+ | Variable | Description |
359
+ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
360
+ | `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
361
+ | `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
362
+ | `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
363
+ | `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
364
+ | `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
365
+ | `TAILOR_CONFIG_PATH` | Path to Tailor config file |
366
+ | `TAILOR_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
367
+ | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
368
+ | `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
369
+ | `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function run`, `machineuser token` |
370
+ | `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
371
+ | `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
372
+ | `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
373
+ | `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
374
+ | `TAILOR_APPLY_CONCURRENCY` | Max concurrent platform RPCs during `apply`/`deploy`. Defaults to 16 |
375
+ | `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
376
+ | `TAILOR_GITHUB_ACTIONS_ANNOTATIONS` | GitHub Actions failure annotations: `on` (default) or `off` |
377
+ | `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
378
+ | `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
379
+ | `TAILOR_NOTIFICATION_BANNER` | Unread WARNING/CRITICAL notifications listed after a command in an interactive terminal: `on` (default) or `off` |
211
380
 
212
381
  ### Authentication Token Priority
213
382
 
@@ -271,9 +440,10 @@ Resolution rules:
271
440
  - **Global flags reach the plugin from either side.** `tailor --json tailordb erd export` and
272
441
  `tailor tailordb erd export --json` both forward `--json`, and likewise `--verbose` and the
273
442
  `--env-file` options. A flag typed before the plugin name is consumed by the host CLI first and
274
- then forwarded, so when the same flag appears on both sides the later one wins. A flag the host
275
- does not define — including one only some commands declare, such as `--profile` — still has to be
276
- typed after the plugin's own subcommand. `--help` and `--version` are answered by the host CLI and
443
+ then forwarded, so when the same flag appears on both sides the later one wins; every
444
+ `--env-file` and `--env-file-if-exists` still loads. A flag the host does not define — including
445
+ one only some commands declare, such as `--profile` — still has to be typed after the plugin's own
446
+ subcommand. `--help` and `--version` are answered by the host CLI and
277
447
  never dispatch a plugin. Setting `TAILOR_JSON_OUTPUT=true` also works, which plugins inherit from
278
448
  the environment.
279
449
 
@@ -328,20 +498,19 @@ Commands for managing Tailor Platform applications (work with `tailor.config.ts`
328
498
 
329
499
  Commands for managing TailorDB tables, data, and schema migrations.
330
500
 
331
- | Command | Description |
332
- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
333
- | [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
334
- | [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
335
- | [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations (beta). |
336
- | [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot. |
337
- | [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
338
- | [tailordb migration resolve](./cli/tailordb.md#tailordb-migration-resolve) | Settle a migration that a failed deploy left partially applied, or whose run a deploy could not confirm. |
339
- | [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
340
- | [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
341
- | [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
342
- | [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history. |
343
- | [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
344
- | [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. |
501
+ | Command | Description |
502
+ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
503
+ | [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
504
+ | [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
505
+ | [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations (beta). |
506
+ | [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot. |
507
+ | [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
508
+ | [tailordb migration resolve](./cli/tailordb.md#tailordb-migration-resolve) | Settle a migration that a failed deploy left partially applied, or whose run a deploy could not confirm. |
509
+ | [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
510
+ | [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
511
+ | [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history. |
512
+ | [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
513
+ | [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Run the migration and schema-drift checks that 'deploy' runs before changing anything, without deploying, and exit with a non-zero code when issues are found. |
345
514
 
346
515
  ### [Data Commands](./cli/data.md)
347
516
 
@@ -532,6 +701,17 @@ Commands for managing crash reports.
532
701
  | [crashreport list](./cli/crashreport.md#crashreport-list) | List local crash report files. |
533
702
  | [crashreport send](./cli/crashreport.md#crashreport-send) | Submit a crash report to help improve the SDK. |
534
703
 
704
+ ### [Notification Commands](./cli/notification.md)
705
+
706
+ Commands for reading platform notifications.
707
+
708
+ | Command | Description |
709
+ | ------------------------------------------------------------------ | -------------------------------------------- |
710
+ | [notification](./cli/notification.md#notification) | Read the platform notifications sent to you. |
711
+ | [notification dismiss](./cli/notification.md#notification-dismiss) | Remove a notification from your inbox. |
712
+ | [notification list](./cli/notification.md#notification-list) | List the notifications in your inbox. |
713
+ | [notification read](./cli/notification.md#notification-read) | Show a notification and mark it as read. |
714
+
535
715
  ### [Upgrade Commands](./cli/upgrade.md)
536
716
 
537
717
  Commands for upgrading SDK versions with automated code migration.
@@ -265,6 +265,34 @@ When using external resources:
265
265
  - Destructive operations like `tailordb truncate` (and `tailor seed apply --truncate`) automatically exclude external resources to prevent accidental data loss in shared resources
266
266
  - Subscribing an executor to an external resource's events requires the config that owns the resource in the same `deploy`. Publishing is then enabled automatically, and `deploy` records the dependency so a later deploy without that config asks for confirmation instead of silently turning publishing off
267
267
 
268
+ #### Referencing another app's Auth with `asExternal()`
269
+
270
+ When the other app is in the same repository, import its `defineAuth` result and call `asExternal()` instead of writing the name by hand.
271
+
272
+ ```typescript
273
+ // core/auth.ts
274
+ export const auth = defineAuth("core-auth", {
275
+ machineUsers: { portal: { attributes: { role: "STAFF" } } },
276
+ // ...
277
+ });
278
+ ```
279
+
280
+ ```typescript
281
+ // portal/tailor.config.ts
282
+ import { auth as coreAuth } from "../core/auth";
283
+
284
+ export default defineConfig({
285
+ name: "portal",
286
+ auth: coreAuth.asExternal(),
287
+ });
288
+ ```
289
+
290
+ - The reference follows renames of the Auth service and of its machine users.
291
+ - The machine user names reach the generated `tailor.d.ts`, so a misspelled `invoker` is a type error in the referencing app, including when it is written as an expression such as `flag ? "portal" : "other"`.
292
+ - Only the name and the machine users are taken over. Hooks, OAuth2 clients, and the rest of the definition stay with the app that owns the Auth service, so this project does not deploy them a second time.
293
+ - Put the `defineAuth` call in its own file, as above. Importing the other app's `tailor.config.ts` also runs the rest of that file.
294
+ - An Auth service defined in another repository cannot be imported. Reference it with `{ name: "...", external: true }`; `invoker` then accepts any string.
295
+
268
296
  ### Built-in IdP
269
297
 
270
298
  Configure the Built-in IdP service using `defineIdp()`. See [IdP](./services/idp.md) for full documentation.