@tailor-platform/sdk-codemod 0.4.0-next.10 → 0.4.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 (2) hide show
  1. package/CHANGELOG.md +222 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,227 @@
1
1
  # @tailor-platform/sdk-codemod
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`23904bc`](https://github.com/tailor-platform/sdk/commit/23904bcb1807f96ecd3026e72d9b4de44eb8705f) Thanks [@toiroakr](https://github.com/toiroakr)! - Add the `v2/principal-unify` codemod so `tailor-sdk upgrade` can migrate SDK principal APIs to `TailorPrincipal`.
8
+
9
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`20aa5a9`](https://github.com/tailor-platform/sdk/commit/20aa5a95167d370b4b3cc7352cb60a22a695d673) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove the APIs that were marked `@deprecated` on the way to v2, so 2.0.0 ships without deprecated aliases. Each removal has migration coverage in `tailor upgrade`:
10
+
11
+ - `@tailor-platform/sdk/cli` no longer re-exports `kyselyTypePlugin`, `enumConstantsPlugin`, `fileUtilsPlugin`, and `seedPlugin`. Import them from `@tailor-platform/sdk/plugin/kysely-type`, `/plugin/enum-constants`, `/plugin/file-utils`, and `/plugin/seed` (codemod `v2/plugin-cli-import`).
12
+ - `tailor.workflow.startJobFunction` and the `StartJobFunctionOptions` type are removed; use the canonical `execJobFunction` / `ExecJobFunctionOptions` (new codemod `v2/exec-job-function-rename`). `mockWorkflow()` no longer exposes the `startJobFunction` alias — assert on its `execJobFunction` mock instead — and `v2/workflow-trigger-rename` now rewrites `triggerJobFunction` straight to `execJobFunction`.
13
+ - `@tailor-platform/sdk/test` no longer exports the platform-global mocks `setupTailordbMock`, `setupWorkflowMock`, `setupWaitPointMock`, `setupInvokerMock`, and `setupTailorErrorsMock`, nor the bundled-output helper `createImportMain`. Use the `tailor-runtime` environment from `@tailor-platform/sdk/vitest` with `mockTailordb` / `mockWorkflow` (migration guidance: `v2/sdk-test-mocks-to-vitest`). `createTailorDBHook`, `createStandardSchema`, and `unauthenticatedTailorUser` are unchanged.
14
+ - The programmatic CLI functions no longer accept name-keyed options: `GetWorkflowOptions`, `StartWorkflowOptions`, `ListWorkflowExecutionsOptions`, `GetExecutorOptions`, `TriggerExecutorOptions`, `ListExecutorJobsOptions`, `GetExecutorJobOptions`, and `WatchExecutorJobOptions` are removed along with the overloads that took them. Pass the definition itself — `startWorkflow({ workflow: myWorkflow, invoker: "admin" })`, `watchExecutorJob({ executor: myExecutor, jobId })` — which also types `arg` and `payload` from the definition (migration guidance: `v2/cli-typed-options`). The name-keyed entry points remain available as CLI commands (`tailor workflow start <name>`, `tailor executor trigger <name>`).
15
+
16
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`b3ff0b4`](https://github.com/tailor-platform/sdk/commit/b3ff0b43bfbfc69eea797541292eff840e1d8f87) Thanks [@toiroakr](https://github.com/toiroakr)! - The `v2/seed-exec-to-cli-plugin` migration now rewrites generated seed runner invocations automatically. `node <distPath>/exec.mjs [options] [types...]` becomes `tailor seed apply [options] [types...]` and `node <distPath>/exec.mjs validate` becomes `tailor seed validate`, in package.json scripts, shell scripts, CI configs, docs, and TypeScript sources, carrying node's `--env-file` / `--env-file-if-exists` over to the CLI flag form in both the `=` and space-separated spellings. Each invocation must sit on one line, so a command split across YAML sequence items or markdown bullets is reported for review rather than rewritten. Files that `fork()` the runner are left untouched and reported with their exact line, because replacing the forked child with a CLI call also unwinds the surrounding `await`/Promise plumbing; the migration prompt now covers that rewrite and the stale `exec.mjs` deletion.
17
+
18
+ ### Patch Changes
19
+
20
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`0379fe8`](https://github.com/tailor-platform/sdk/commit/0379fe8c2e7acb927d94f56204b39cf58fa4ac2a) Thanks [@toiroakr](https://github.com/toiroakr)! - Rewrite `tailor-sdk apply` to `tailor-sdk deploy` in source files that contain embedded CLI command strings.
21
+
22
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`6519a54`](https://github.com/tailor-platform/sdk/commit/6519a5434f0cc664a609ef2cae2398b19cad4673) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename auth attribute module augmentation from `AttributeMap` to `Attributes`.
23
+
24
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`5e35c59`](https://github.com/tailor-platform/sdk/commit/5e35c59032156eadeb45ac4c1b1453ecad79163c) Thanks [@toiroakr](https://github.com/toiroakr)! - Add LLM-assisted review support to the codemod runner. A codemod can declare `suspiciousPatterns` plus a `prompt`; after running, files whose post-transform content still matches a suspicious pattern are reported as `llmReviews` (in the JSON output and on stderr) together with the codemod's migration prompt. This surfaces the cases a deterministic transform cannot safely complete (e.g. a value reached through a variable) so they can be finished with an LLM. The `auth.invoker(...)` codemod adopts this for its non-literal-argument cases.
25
+
26
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`8b918f6`](https://github.com/tailor-platform/sdk/commit/8b918f68867240b5713c5f8340836971d1c30882) Thanks [@toiroakr](https://github.com/toiroakr)! - Generate the v2 migration guide (`packages/sdk/docs/migration/v2.md`) from the codemod registry, which is the single source of truth. Each entry renders its name, automation level (Automatic / Partially automatic / Manual), description, optional before/after `examples`, and — for changes the codemods cannot fully migrate on their own — the LLM/manual migration prompt. Run `pnpm codemod:docs:update` to regenerate and `pnpm codemod:docs:check` (wired into `pnpm check`) to verify it is in sync.
27
+
28
+ `scriptPath` is now optional, so the registry can also describe codemod-less ("manual") migrations that ship only guidance (`examples` / `prompt` / `suspiciousPatterns`) with no automatic transform. A manual entry with a `prompt` but no scoping pattern is surfaced as a project-wide `llmReviews` entry at runtime.
29
+
30
+ Add a `sdk-codemod list` command that prints every registered rule (id, name, kind, version range).
31
+
32
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`bfb9451`](https://github.com/tailor-platform/sdk/commit/bfb945122720cec94be23484e23d7ce7607257d8) Thanks [@toiroakr](https://github.com/toiroakr)! - Reduce false-positive v2 codemod warnings and LLM-review prompts from source comments, string literals, and identifier substring matches.
33
+
34
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`752ca9d`](https://github.com/tailor-platform/sdk/commit/752ca9dea12c7ba56ac1ed8091efc3fb6e7812be) Thanks [@toiroakr](https://github.com/toiroakr)! - Report the codemod runner identity in the JSON summary, including the source checkout commit and local build command when run from a branch build, so prerelease migration validation can distinguish exact npm packages from branch-head behavior.
35
+
36
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`1a055c9`](https://github.com/tailor-platform/sdk/commit/1a055c9909ac951f807fc2249c9abc1d5805398f) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename the TailorDB schema builder from `db.type()` to `db.table()`.
37
+
38
+ Update TailorDB definitions:
39
+
40
+ ```diff
41
+ import { db } from "@tailor-platform/sdk";
42
+
43
+ -export const user = db.type("User", {
44
+ +export const user = db.table("User", {
45
+ name: db.string(),
46
+ });
47
+ ```
48
+
49
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`982dee1`](https://github.com/tailor-platform/sdk/commit/982dee1bb73d8ca1faf35f7d256eba0c5ed86957) Thanks [@toiroakr](https://github.com/toiroakr)! - Make the deprecation process mechanical: an `@deprecated` tag in the SDK now states the version it shipped in and the codemod that migrates callers off it (`@deprecated since 2.1.0 — use {@link newApi} instead. codemod: v2/old-to-new`), and `pnpm check:deprecations` fails when a tag misses either half, names a codemod that is not registered, or outlives its codemod's boundary — so the release PR that bumps to a major turns red while an API due for removal is still declared, instead of the alias shipping and being noticed releases later. While the shipping version is still undecided the tag carries the literal `NEXT_RELEASE`, which the release workflow rewrites to the version the release PR bumps to — the same step that already resolves `prereleaseUntil: V2_NEXT_PENDING` codemod boundaries.
50
+
51
+ Registered codemods are validated more strictly too: a `since` that is not valid semver, or that is not older than `until`, now fails fast instead of surfacing as a semver error partway through `tailor upgrade` or as a codemod whose empty version range silently matches nothing.
52
+
53
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`039389d`](https://github.com/tailor-platform/sdk/commit/039389d17ddf3014fc53ffdb756ec6ea1425826c) Thanks [@toiroakr](https://github.com/toiroakr)! - Generate the `Env` interface in `tailor.d.ts` from the type of each `defineConfig({ env })` value instead of the value itself. The resolved value used to be written in as a literal type, so running `generate` or `deploy` with real environment variables loaded stamped those values into a file that is normally committed.
54
+
55
+ ```diff
56
+ interface Env {
57
+ - API_BASE: "https://api.example.com";
58
+ - RETRIES: 3;
59
+ - VERBOSE: true;
60
+ + API_BASE: string;
61
+ + RETRIES: number;
62
+ + VERBOSE: boolean;
63
+ }
64
+ ```
65
+
66
+ `env` keys that aren't valid TypeScript identifiers (for example `"API-BASE"`) are now quoted as well; previously they were emitted bare and produced a `tailor.d.ts` that failed to parse.
67
+
68
+ Run `tailor generate` after upgrading to refresh the file. Code that relied on the literal narrowing — comparing `env.STAGE` against a literal union, for example — has to widen its own types or read the value through a local narrowing check. If a `tailor.d.ts` you already committed contains a sensitive value, treat that value as exposed and rotate it; keep secrets in [Secret Manager](https://github.com/tailor-platform/sdk/blob/main/packages/sdk/docs/services/secret.md) rather than `env`.
69
+
70
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`a6038e2`](https://github.com/tailor-platform/sdk/commit/a6038e25151bf32694cc2d20fd3845b1ed959ccc) Thanks [@toiroakr](https://github.com/toiroakr)! - Move the TailorDB `erdSite` setting out of the core config schema into the ERD plugin's own configuration. `db.<namespace>.erdSite` is no longer accepted in `tailor.config.ts`; configure the ERD deploy target on the plugin instead:
71
+
72
+ ```ts
73
+ import { definePlugins } from "@tailor-platform/sdk";
74
+ import { tailordbErdPlugin } from "@tailor-platform/sdk-plugin-tailordb-erd";
75
+
76
+ export const plugins = definePlugins(
77
+ // TailorDB namespace name → static website name
78
+ tailordbErdPlugin({ sites: { tailordb: "my-erd-site" } }),
79
+ );
80
+ ```
81
+
82
+ The `tailor tailordb erd` commands resolve deploy targets from `tailordbErdPlugin({ sites })` and now validate each namespace against `config.db` and each site name against `staticWebsites`, so typos surface when the config is loaded instead of at deploy time. The `v2/erd-site-to-plugin` codemod migrates existing configs automatically. For programmatic users, `loadTailorDBNamespaces()` additionally returns the config module's registered `plugins`, and namespace selector callbacks receive them as a second argument.
83
+
84
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`4022203`](https://github.com/tailor-platform/sdk/commit/40222035a5de08e1d0d3e7b8d96047fdbd2b2d19) Thanks [@toiroakr](https://github.com/toiroakr)! - `executeScript` now takes its `arg` as a JSON-serializable value instead of a pre-serialized JSON string. Pass the value directly (e.g. `arg: { a: 1 }`) instead of `arg: JSON.stringify({ a: 1 })`.
85
+
86
+ Add the `v2/execute-script-arg` codemod, which unwraps `JSON.stringify(...)` passed as the `executeScript` `arg` option. Indirect forms (a stringified value held in a variable, etc.) cannot be rewritten automatically and are surfaced as an LLM-assisted review task with a migration prompt.
87
+
88
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`078418a`](https://github.com/tailor-platform/sdk/commit/078418afde150fc971aa7fec7eb87ffff014e134) Thanks [@toiroakr](https://github.com/toiroakr)! - Reduce noisy `executeScript` LLM-review prompts by flagging files only when unresolved `arg` stringification remains likely.
89
+
90
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`54f4d08`](https://github.com/tailor-platform/sdk/commit/54f4d085e077913ae3a923bcb520362b9e57d876) Thanks [@toiroakr](https://github.com/toiroakr)! - `seedPlugin` no longer generates the `exec.mjs` seed runner. Seeding and validation move to the `tailor seed` commands provided by the `@tailor-platform/sdk-plugin-seed` CLI plugin: install it with `npm install -D @tailor-platform/sdk-plugin-seed`, replace `node <distPath>/exec.mjs` with `tailor seed apply` and `node <distPath>/exec.mjs validate` with `tailor seed validate`, and delete the stale generated `exec.mjs`. Seed data and schema generation (`data/*.jsonl`, `data/*.schema.ts`) is unchanged. Because the plugin reads the config at run time, `machineUserName` changes in seedPlugin options now take effect without regenerating. `@tailor-platform/sdk/cli` gains `loadSeedContext` (and `SeedContext` types) for this, `SeedData` is now JSON-typed, and `executeScript` accepts a plain object `invoker` (`ScriptInvoker`).
91
+
92
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`c8778f2`](https://github.com/tailor-platform/sdk/commit/c8778f22b4306705b085602b7c221f4166c31447) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix `tailor upgrade` reporting zero codemods across several v2 prerelease boundaries. `v2/db-type-to-table` and `v2/runtime-subpath-namespace` now trigger at `2.0.0-next.4` (where they actually shipped) instead of `2.0.0-next.3`, and `v2/forward-relation-name`, `v2/tailordb-validate-simplify`, and `v2/tailordb-hook-redesign` now trigger at `2.0.0-next.5` instead of `2.0.0-next.4`.
93
+
94
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`e79dc3f`](https://github.com/tailor-platform/sdk/commit/e79dc3fd6862f7f00df08ef8f2b8721f562afa8c) Thanks [@toiroakr](https://github.com/toiroakr)! - Apply the v2 `rename-bin` codemod to SDK CLI command strings in TypeScript and JavaScript source files.
95
+
96
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`d69add3`](https://github.com/tailor-platform/sdk/commit/d69add3f24e944dd7153eef9da6e0c36a5e4a989) Thanks [@toiroakr](https://github.com/toiroakr)! - Run v2 codemods when the target version is a v2 prerelease.
97
+
98
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`b6340d0`](https://github.com/tailor-platform/sdk/commit/b6340d086822fbf5bd6fffa16a7dba47ccc3a59a) Thanks [@toiroakr](https://github.com/toiroakr)! - Derive default TailorDB forward relation names from the relation field name by removing a trailing `ID`, `Id`, or `id`, instead of deriving them from the target table name.
99
+
100
+ The v2 migration review identifies non-self relations without `toward.as`. Add an explicit name to preserve the v1 GraphQL field name, or update consumers to use the new field-based name.
101
+
102
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`8cb5bcd`](https://github.com/tailor-platform/sdk/commit/8cb5bcdfe4d2494790b2b9ad72c7e1c43715f9e8) Thanks [@toiroakr](https://github.com/toiroakr)! - Flag `tailor generate --watch` / `-W` invocations and programmatic `generate({ watch })` usage for manual review as part of the v2 migration (the flag and its dependency watcher are removed in `@tailor-platform/sdk` v2).
103
+
104
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`d1405c0`](https://github.com/tailor-platform/sdk/commit/d1405c0b0dbd6205c1817c79b239fe980906c19b) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename the `defineIdp` option `publishUserEvents` to `publishEvents`, so all four services that publish events use one field name. A codemod rewrites the option key on `defineIdp` calls, including aliased and namespace imports, and rewrites a shorthand `{ publishUserEvents }` to `{ publishEvents: publishUserEvents }` so it keeps reading the same local. Occurrences it cannot rewrite — an options object built outside the call, a computed key, or a type declaration of the option — are reported for manual migration.
105
+
106
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`cd48fda`](https://github.com/tailor-platform/sdk/commit/cd48fdab46746aa2e8f5d8dd43073e3b4832c07c) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename resolver, executor, workflow trigger, and typed workflow start machine-user options from `authInvoker` to `invoker`.
107
+
108
+ Update create-sdk templates and the v2 auth invoker codemod to generate the new `invoker` option.
109
+
110
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`28c0dde`](https://github.com/tailor-platform/sdk/commit/28c0dde9a33e4db39b04b083e22feb837e3605a7) Thanks [@toiroakr](https://github.com/toiroakr)! - Limit the `openDownloadStream` migration review prompt to files that reference deprecated download stream APIs.
111
+
112
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`6374ec6`](https://github.com/tailor-platform/sdk/commit/6374ec64f3602c35ed2b2e45ba2260591327fafb) Thanks [@toiroakr](https://github.com/toiroakr)! - Replace `tailor skills install` with project-local `tailor skills add`, `list`, `remove`, and `sync` commands for bundled Tailor SDK agent skills.
113
+
114
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`d9d9c49`](https://github.com/tailor-platform/sdk/commit/d9d9c49ab4c98034c64b0e5c6ba9cf106341a6c3) Thanks [@toiroakr](https://github.com/toiroakr)! - Flag files that need project-specific review after the v2 principal migration, including resolver helper adapters and nullable `caller` follow-ups.
115
+
116
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`244fe8d`](https://github.com/tailor-platform/sdk/commit/244fe8d703b35f4aceaf31f918f94fc84e3be789) Thanks [@toiroakr](https://github.com/toiroakr)! - Report precise file-local findings for `principal-unify` review follow-ups, including nullable caller call sites and `context.user` helper adapters.
117
+
118
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`5059c27`](https://github.com/tailor-platform/sdk/commit/5059c273d3f14c92239a17d3a7eeb44e0822ed99) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix `v2/principal-unify` review findings for nested SDK field parser invoker values and destructured context helper messages.
119
+
120
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`7240c25`](https://github.com/tailor-platform/sdk/commit/7240c252546dc69989755a6f5af26c6062c36883) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove the deprecated `auth.getConnectionToken()` helper from values returned by `defineAuth()`. Use `authconnection.getConnectionToken(...)` from `@tailor-platform/sdk/runtime` in resolvers, executors, and workflows instead. The v2 codemod rewrites direct `auth.getConnectionToken(...)` calls when the `auth` binding is imported from `tailor.config`.
121
+
122
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`304a24a`](https://github.com/tailor-platform/sdk/commit/304a24af51cc130268a7f8145a10dc6b165f8d46) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove the v1 runtime globals compatibility layer. Importing from `@tailor-platform/sdk` no longer activates the ambient `tailor.*` / `tailordb.*` declarations; opt into globals with `@tailor-platform/sdk/runtime/globals` or use the typed wrappers from `@tailor-platform/sdk/runtime`.
123
+
124
+ The capital-cased `Tailordb.*` namespace is removed. If your project still references `Tailordb.QueryResult`, `Tailordb.CommandType`, `Tailordb.Client`, or `typeof Tailordb.Client`, migrate before upgrading: run `pnpm dlx @tailor-platform/sdk-codemod v2/tailordb-namespace` to rewrite them to lowercase `tailordb.*`, then add `import "@tailor-platform/sdk/runtime/globals"` so the rewritten references resolve.
125
+
126
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`88db10e`](https://github.com/tailor-platform/sdk/commit/88db10ef57fa575731e1ed557ea74b86edcf5c5c) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove deprecated CLI aliases for the v2 command surface. Use `tailor-sdk deploy` instead of `tailor-sdk apply`, `tailor-sdk crashreport` instead of `tailor-sdk crash-report`, and the hyphenated `--machine-user` option instead of the hidden `--machineuser` alias.
127
+
128
+ Fix the v2 CLI rename codemod to migrate the hidden `--machineuser` option to `--machine-user`.
129
+
130
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`160b406`](https://github.com/tailor-platform/sdk/commit/160b4061ee38675df85dd74af23b7041fe8e4944) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename the CLI binary from `tailor-sdk` to `tailor`.
131
+
132
+ The output directory default changes from `.tailor-sdk` to `.tailor`, and the GitHub Actions lock file path changes from `.github/tailor-sdk.lock` to `.github/tailor.lock`.
133
+
134
+ Run the `v2/rename-bin` codemod to migrate `tailor-sdk` invocations in package.json scripts, shell scripts, CI workflows, and documentation:
135
+
136
+ ```sh
137
+ npx @tailor-platform/sdk-codemod --from 1.x --to 2.0.0
138
+ ```
139
+
140
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`8b03f82`](https://github.com/tailor-platform/sdk/commit/8b03f827642e64f3b3af5a05ecdef405028a803a) Thanks [@toiroakr](https://github.com/toiroakr)! - Standardize SDK-owned environment variables on the `TAILOR_*` namespace.
141
+
142
+ Replace the removed SDK-specific environment variables with their new names: `TAILOR_CONFIG_PATH`, `TAILOR_DTS_PATH`, `TAILOR_CI_ALLOW_ID_INJECTION`, `TAILOR_DEPLOY_BUILD_ONLY`, `TAILOR_BUILD_OUTPUT_DIR`, `TAILOR_SKILLS_SOURCE`, `TAILOR_TEMPLATE_SDK_VERSION`, `TAILOR_PLATFORM_URL`, `TAILOR_PLATFORM_OAUTH2_CLIENT_ID`, `TAILOR_INLINE_SOURCEMAP`, `TAILOR_QUERY_NEWLINE_ON_ENTER`, and `TAILOR_APP_LOG_LEVEL`. The deprecated `TAILOR_TOKEN` fallback is removed; use `TAILOR_PLATFORM_TOKEN`. The v2 codemod rewrites unambiguous removed SDK environment variable names and flags generic names such as `LOG_LEVEL` and `PLATFORM_URL` for manual review.
143
+
144
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`1a8945d`](https://github.com/tailor-platform/sdk/commit/1a8945d183b990aaf1dfb1dd9ca9813a7277a118) Thanks [@toiroakr](https://github.com/toiroakr)! - Add a `V2_NEXT_PENDING` placeholder `prereleaseUntil` for codemods whose exact `2.0.0-next.N` release boundary isn't known yet at implementation time, plus a `pnpm codemod:resolve-pending` step (wired into the release workflow) that resolves it to the real version constant once the release PR bumps `@tailor-platform/sdk`'s version. Prevents codemod boundaries from drifting out of sync with the version they actually ship in, which previously required a manual follow-up fix after each release.
145
+
146
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`3dcd82d`](https://github.com/tailor-platform/sdk/commit/3dcd82d54d6c059df90f2dc4788a7059fe4004ab) Thanks [@toiroakr](https://github.com/toiroakr)! - Restore Tailor field outputs for UUID, date, datetime, time, and decimal fields to plain string-compatible types and remove the strict scalar string migration guidance.
147
+
148
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`fe1721e`](https://github.com/tailor-platform/sdk/commit/fe1721efa04f15d3d1ac3287c30c4c550220403e) Thanks [@toiroakr](https://github.com/toiroakr)! - Flag JavaScript files and embedded code strings that still reference ambient Tailor runtime globals during v2 migration review.
149
+
150
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`5fc3a1d`](https://github.com/tailor-platform/sdk/commit/5fc3a1d027767d60e8a427adf1ff7e5f43dab331) Thanks [@toiroakr](https://github.com/toiroakr)! - Flag files that still reference ambient Tailor runtime globals so the v2 migration can opt them into `@tailor-platform/sdk/runtime/globals`.
151
+
152
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`df3a772`](https://github.com/tailor-platform/sdk/commit/df3a77257823e9e8e7b7c89e418b3113964e9b20) Thanks [@toiroakr](https://github.com/toiroakr)! - Automatically migrate simple direct `tailor.idp.Client` runtime global usage to the typed `idp.Client` wrapper during v2 upgrades.
153
+
154
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`04ca361`](https://github.com/tailor-platform/sdk/commit/04ca3619c4d2d88afe8ee3b25d4ba47ac799de51) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove flat value and default exports from `@tailor-platform/sdk/runtime/*` subpath modules. Import each subpath through its self-named namespace export instead, for example `import { iconv } from "@tailor-platform/sdk/runtime/iconv"`.
155
+
156
+ The aggregate `@tailor-platform/sdk/runtime` entry remains named-only, and its deprecated `file.deleteFile` alias is removed in favor of `file.delete`. The v2 codemod rewrites straightforward namespace-star subpath imports, flat named value imports, and aggregate `file.deleteFile` calls to the new namespace-object style.
157
+
158
+ `TailorContextAPI` and `TailorWorkflowAPI` now describe the SDK wrapper objects. Code that types the platform-provided `globalThis.tailor.context` or `globalThis.tailor.workflow` objects directly must use `PlatformContextAPI` or `PlatformWorkflowAPI` instead.
159
+
160
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`c051dab`](https://github.com/tailor-platform/sdk/commit/c051dab12c233de65313c4fcee96a26c604ec5da) Thanks [@toiroakr](https://github.com/toiroakr)! - Mention the `--upsert` flag in the `v2/seed-exec-to-cli-plugin` migration guide's `tailor seed apply` option list.
161
+
162
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`eba2728`](https://github.com/tailor-platform/sdk/commit/eba2728a7b473da7caa134cbfdfc53a714d9d328) Thanks [@toiroakr](https://github.com/toiroakr)! - Keep v2 codemods from reusing type-only runtime helper imports when adding runtime value imports.
163
+
164
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`add2079`](https://github.com/tailor-platform/sdk/commit/add2079f4c89bcb950c0c7f55312880993b3dc7b) Thanks [@toiroakr](https://github.com/toiroakr)! - Add the `v2/tailor-output-ignore-dir` codemod so SDK upgrades rewrite exact `.tailor-sdk/` ignore-file entries to `.tailor/` while leaving other `.tailor-sdk` paths unchanged.
165
+
166
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`b5a0d70`](https://github.com/tailor-platform/sdk/commit/b5a0d70f8e29d58f77809ef2514be9065e0a954f) Thanks [@toiroakr](https://github.com/toiroakr)! - Unify function principal context around `TailorPrincipal`.
167
+
168
+ Resolver contexts now use `caller` and `invoker` as `TailorPrincipal | null`, workflow and executor invokers also use `TailorPrincipal | null`, and event executor `actor` uses `TailorPrincipal | null` with `id`/`type` fields. The legacy `TailorUser`, `TailorInvoker`, `TailorActor`, `TailorActorType`, and `unauthenticatedTailorUser` exports are removed.
169
+
170
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`f1ec5b5`](https://github.com/tailor-platform/sdk/commit/f1ec5b5fbedce73d217830e2c6ac4a243b830a2d) Thanks [@toiroakr](https://github.com/toiroakr)! - Redesign TailorDB hooks and validators with several breaking changes:
171
+
172
+ - Add shared `now` timestamp to all hooks — multiple fields stamped with the same `Date`
173
+ - Field-level hooks: `{ value, data, invoker }` → create `{ input, invoker, now }` / update `{ input, oldValue, invoker, now }` (`data` removed, `oldValue` added for update only)
174
+ - Type-level hooks: per-field mapping (`Hooks<F>`) → single `{ create, update }` object (`TypeHook<F>`) returning partial field overrides
175
+ - Type-level create hooks no longer receive `oldRecord`; update hooks receive non-nullable `oldRecord`
176
+ - Field-level validators: return type changed from `boolean` to `string | void` (return error message or void to pass); `[fn, message]` tuple form removed
177
+ - Type-level validators: `Validators<F>` per-field record → `TypeValidateFn<F>` single function with `issues(field, message)` callback
178
+ - Add `.default(value)` on fields to set a create-time default (makes required fields optional in create input)
179
+ - Remove exported types: `Hooks<F>`, `Validators<F>`, `ValidateConfig`
180
+
181
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`bf11bf8`](https://github.com/tailor-platform/sdk/commit/bf11bf8d3bad6195c86ed289c764490dc6d680ee) Thanks [@toiroakr](https://github.com/toiroakr)! - Update politty to v0.11.3
182
+
183
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`eeb235d`](https://github.com/tailor-platform/sdk/commit/eeb235debe910c05f755f036486878e7c763cb7e) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename `defineWaitPoint` and `defineWaitPoints` to `createWaitPoint` and `createWaitPoints`.
184
+
185
+ These functions create runtime instances with `.wait()` and `.resolve()` methods that call the platform API at runtime, so the `create*` prefix is more accurate. Update any usages:
186
+
187
+ ```diff
188
+ -import { defineWaitPoint, defineWaitPoints } from "@tailor-platform/sdk";
189
+ +import { createWaitPoint, createWaitPoints } from "@tailor-platform/sdk";
190
+
191
+ -export const approval = defineWaitPoint<Payload, Result>("approval");
192
+ +export const approval = createWaitPoint<Payload, Result>("approval");
193
+
194
+ -export const waitPoints = defineWaitPoints((define) => ({ ... }));
195
+ +export const waitPoints = createWaitPoints((define) => ({ ... }));
196
+ ```
197
+
198
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`93b68ac`](https://github.com/tailor-platform/sdk/commit/93b68ace83dcb0af2a8b0afa8aa3336cb18c818b) Thanks [@toiroakr](https://github.com/toiroakr)! - Rename `Workflow.trigger()` (returned by `createWorkflow()`) and `WorkflowJob.trigger()` (returned by `createWorkflowJob()`) to `.start()`, aligning the SDK's ergonomic verb with the platform's `start*` RPC vocabulary:
199
+
200
+ ```diff
201
+ const inventory = checkInventory.trigger({ orderId: input.orderId });
202
+ +const inventory = checkInventory.start({ orderId: input.orderId });
203
+
204
+ -const workflowRunId = await orderProcessingWorkflow.trigger(args, { invoker: "manager" });
205
+ +const workflowRunId = await orderProcessingWorkflow.start(args, { invoker: "manager" });
206
+ ```
207
+
208
+ `mockWorkflow()`'s `wf.job(definition)` / `wf.workflow(definition)` now return a mock of the `.start` method, and `wf.setTriggerHandler` / `wf.triggeredJobs` are renamed to `wf.setStartHandler` / `wf.startedJobs`. No codemod ships for the `.trigger()` → `.start()` call-site rename itself — see the `v2/workflow-start-rename` migration guide entry for manual migration steps.
209
+
210
+ - [#1808](https://github.com/tailor-platform/sdk/pull/1808) [`93b68ac`](https://github.com/tailor-platform/sdk/commit/93b68ace83dcb0af2a8b0afa8aa3336cb18c818b) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove the pre-alignment `tailor.workflow` names `triggerWorkflow`, `triggerJobFunction`, and `resumeWorkflow` (and their `TriggerWorkflowOptions` / `TriggerJobFunctionOptions` option types) from `@tailor-platform/sdk/runtime`, the ambient `@tailor-platform/sdk/runtime/globals` types, and the `mockWorkflow()` test facade. Use the canonical names instead:
211
+
212
+ ```diff
213
+ import { workflow } from "@tailor-platform/sdk/runtime";
214
+
215
+ -await workflow.triggerWorkflow("myWorkflow", { data: "value" });
216
+ +await workflow.startWorkflow("myWorkflow", { data: "value" });
217
+ -workflow.triggerJobFunction("myJob", { data: "value" });
218
+ +workflow.startJobFunction("myJob", { data: "value" });
219
+ -await workflow.resumeWorkflow("execution-id");
220
+ +await workflow.resumeWorkflowExecution("execution-id");
221
+ ```
222
+
223
+ Run the `v2/workflow-trigger-rename` codemod to migrate call sites automatically.
224
+
3
225
  ## 0.4.0-next.10
4
226
 
5
227
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk-codemod",
3
- "version": "0.4.0-next.10",
3
+ "version": "0.4.0",
4
4
  "description": "Codemod runner for Tailor Platform SDK upgrades",
5
5
  "license": "MIT",
6
6
  "repository": {