@tailor-platform/sdk 2.22.0 → 2.24.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 (103) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/aigateway-DsWDjzk4.mjs.map +1 -1
  3. package/dist/application-BDqze-wy.mjs +1 -0
  4. package/dist/application-CfqvzV3I.mjs +200 -0
  5. package/dist/application-CfqvzV3I.mjs.map +1 -0
  6. package/dist/assert-WeXvmG4j.mjs.map +1 -1
  7. package/dist/authconnection-CynFBIv8.mjs.map +1 -1
  8. package/dist/brand-C8nMKhJC.mjs.map +1 -1
  9. package/dist/cli/cache/bundle-cache.d.mts +1 -0
  10. package/dist/cli/lib.mjs +1 -1
  11. package/dist/cli/lib.mjs.map +1 -1
  12. package/dist/cli/main.mjs +40 -40
  13. package/dist/cli/main.mjs.map +1 -1
  14. package/dist/cli/services/application.d.mts +1 -0
  15. package/dist/cli/services/workflow/bundler.d.mts +2 -1
  16. package/dist/cli/shared/client.d.mts +17 -2
  17. package/dist/cli/shared/forbidden-runtime-globals.d.mts +1 -0
  18. package/dist/cli/shared/start-context.d.mts +1 -0
  19. package/dist/cli/ts-hook.mjs +3 -3
  20. package/dist/completion/zsh-worker.zsh +13 -7
  21. package/dist/configure/config/types.d.mts +42 -2
  22. package/dist/configure/index.mjs +1 -1
  23. package/dist/configure/index.mjs.map +1 -1
  24. package/dist/context-D0QjfxzD.mjs.map +1 -1
  25. package/dist/crashreport-DFpRn-LS.mjs.map +1 -1
  26. package/dist/date-Dri6Yas-.mjs.map +1 -1
  27. package/dist/errors-CpvSChyL.mjs +7 -0
  28. package/dist/errors-CpvSChyL.mjs.map +1 -0
  29. package/dist/es-builtins-SfvXRVoG.mjs.map +1 -1
  30. package/dist/field-parse-DhnFs9WG.mjs.map +1 -1
  31. package/dist/file-DKBOj5q4.mjs.map +1 -1
  32. package/dist/globals-BCmGX05J.mjs.map +1 -1
  33. package/dist/guards-yDXyKC9F.mjs.map +1 -1
  34. package/dist/iconv-DlFMt2gW.mjs.map +1 -1
  35. package/dist/idp-G_ojPBB5.mjs.map +1 -1
  36. package/dist/interceptor-DQg3cR_9.mjs.map +1 -1
  37. package/dist/kysely/index.mjs.map +1 -1
  38. package/dist/kysely-type-C-iyFFH7.mjs.map +1 -1
  39. package/dist/logger-DP2BjQ93.mjs.map +1 -1
  40. package/dist/logger-Db-YRTwK.mjs.map +1 -1
  41. package/dist/manager-8-JOvuLl.mjs.map +1 -1
  42. package/dist/multiline-EyzjEwn9.mjs.map +1 -1
  43. package/dist/node-builtins-DYfhPBnz.mjs.map +1 -1
  44. package/dist/package-json-C690ceex.mjs.map +1 -1
  45. package/dist/platform-serialize-DkiTdHOt.mjs.map +1 -1
  46. package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
  47. package/dist/plugin/builtin/file-utils/index.mjs.map +1 -1
  48. package/dist/plugin/index.mjs.map +1 -1
  49. package/dist/{register-ts-hook-z7ggXQy4.mjs → register-ts-hook-CVlI9Jzl.mjs} +57 -57
  50. package/dist/register-ts-hook-CVlI9Jzl.mjs.map +1 -0
  51. package/dist/registry-BijIDRVA.mjs.map +1 -1
  52. package/dist/repl-editor-DGJBfIt1.mjs.map +1 -1
  53. package/dist/schema-CRtAmDcl.mjs.map +1 -1
  54. package/dist/secret-file-C9wp_FCX.mjs.map +1 -1
  55. package/dist/secretmanager-5olfnI1b.mjs.map +1 -1
  56. package/dist/secretmanager-vHQoXdQz.mjs.map +1 -1
  57. package/dist/seed/index.mjs.map +1 -1
  58. package/dist/seed-C3P_T_Eh.mjs.map +1 -1
  59. package/dist/service-CL1Bp4It.mjs.map +1 -1
  60. package/dist/{service-DHVuH7-X.mjs → service-DFmt9UJP.mjs} +2 -2
  61. package/dist/service-DFmt9UJP.mjs.map +1 -0
  62. package/dist/service_pb-ZClWtj1X.mjs +2 -0
  63. package/dist/service_pb-ZClWtj1X.mjs.map +1 -0
  64. package/dist/service_pb-dB3RrGeh.mjs +1 -0
  65. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +83 -1
  66. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +7 -1
  67. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +79 -7
  68. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +40 -1
  69. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +119 -2
  70. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +7 -0
  71. package/dist/tailordb-ddl-DqInYupv.mjs.map +1 -1
  72. package/dist/telemetry-Bklv9kQY.mjs.map +1 -1
  73. package/dist/type-source--ZNcV8RJ.mjs.map +1 -1
  74. package/dist/user-agent-vdHYF3QL.mjs.map +1 -1
  75. package/dist/utils/test/index.mjs.map +1 -1
  76. package/dist/vitest/environment.mjs.map +1 -1
  77. package/dist/vitest/index.mjs.map +1 -1
  78. package/dist/vitest/mocks/file.d.mts +1 -1
  79. package/dist/vitest/setup.mjs.map +1 -1
  80. package/dist/wait-point-invoker-eiP-IIux.mjs.map +1 -1
  81. package/dist/wait-point-registry-B-ESkTZX.mjs.map +1 -1
  82. package/dist/workflow-Cs9ISw6j.mjs.map +1 -1
  83. package/dist/{workspace_resource_pb-D2njwgsE.mjs → workspace_resource_pb-CxR_6fyN.mjs} +2 -2
  84. package/dist/workspace_resource_pb-CxR_6fyN.mjs.map +1 -0
  85. package/docs/cli/application.md +23 -5
  86. package/docs/cli/function.md +2 -2
  87. package/docs/configuration.md +28 -3
  88. package/docs/github-actions.md +167 -52
  89. package/docs/migration/v3.md +46 -0
  90. package/docs/multi-environment.md +3 -1
  91. package/docs/services/workflow.md +3 -0
  92. package/package.json +6 -6
  93. package/dist/application-BE4vehXW.mjs +0 -1
  94. package/dist/application-BzO9ywXQ.mjs +0 -199
  95. package/dist/application-BzO9ywXQ.mjs.map +0 -1
  96. package/dist/errors-C9zGf4nz.mjs +0 -7
  97. package/dist/errors-C9zGf4nz.mjs.map +0 -1
  98. package/dist/register-ts-hook-z7ggXQy4.mjs.map +0 -1
  99. package/dist/service-DHVuH7-X.mjs.map +0 -1
  100. package/dist/service_pb-DNskuJQC.mjs +0 -1
  101. package/dist/service_pb-y2GYIgfs.mjs +0 -2
  102. package/dist/service_pb-y2GYIgfs.mjs.map +0 -1
  103. package/dist/workspace_resource_pb-D2njwgsE.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 2.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2459](https://github.com/tailor-platform/sdk/pull/2459) [`72e295b`](https://github.com/tailor-platform/sdk/commit/72e295b422d243fef6e39f73590c34f2f10b68f5) Thanks [@toiroakr](https://github.com/toiroakr)! - When a resolver, executor, or workflow job fails to build with `FORBIDDEN_RUNTIME_GLOBAL` because it references a Node-only global such as `process` or `Buffer`, the error now names where the reference is: the file in your own code, or the installed package (code under `node_modules`). A reference from an installed package can be allowed with the new `buildOptions.allowedRuntimeGlobals` option of `defineConfig()`, keyed by package name, with the globals to allow or `true` for all of them — for example `buildOptions: { allowedRuntimeGlobals: { "@ai-sdk/gateway": ["Buffer"] } }` — once you have confirmed that the package's code referencing it never runs for your use. The error's suggestion shows the entry to add. `buildOptions.allowedRuntimeGlobals` has no effect on your own code.
8
+
9
+ - [#2463](https://github.com/tailor-platform/sdk/pull/2463) [`f708521`](https://github.com/tailor-platform/sdk/commit/f708521ecc5c6e77fa5731d5256bbd483b49dc66) Thanks [@toiroakr](https://github.com/toiroakr)! - `defineConfig()` accepts `buildOptions`, which groups the settings that control how resolvers, executors, workflow jobs, and other functions are bundled: `inlineSourcemap`, `logLevel`, and `allowedRuntimeGlobals`. The top-level `inlineSourcemap` and `logLevel` still work but are deprecated and will be removed in v3; `tailor upgrade` moves them into `buildOptions` with the `v3/define-config-build-options` codemod. Setting the same option both at the top level and in `buildOptions` fails config validation instead of silently using one of them.
10
+
11
+ ```ts
12
+ export default defineConfig({
13
+ name: "my-app",
14
+ buildOptions: {
15
+ inlineSourcemap: false,
16
+ logLevel: "WARN",
17
+ },
18
+ });
19
+ ```
20
+
21
+ ### Patch Changes
22
+
23
+ - [#2475](https://github.com/tailor-platform/sdk/pull/2475) [`10ab737`](https://github.com/tailor-platform/sdk/commit/10ab73789d9865ec2e2fb6658e76b15841219834) Thanks [@toiroakr](https://github.com/toiroakr)! - Generated deploy jobs now expose the deployed workspace as job outputs, so a job of your own can use `needs:` to run tests or deploy extra assets against it:
24
+
25
+ - `tailor setup ci preview`: the `tailor-preview-deploy` job exposes `workspace-id`, `workspace-name`, and `app-url` of the per-PR workspace.
26
+ - `tailor setup ci branch` and `tailor setup ci tag`: the `tailor-deploy` job exposes `workspace-id` and `app-url`.
27
+
28
+ `tailor setup check` reports the template as outdated; run `tailor setup update` to regenerate every target.
29
+
30
+ - [#2464](https://github.com/tailor-platform/sdk/pull/2464) [`978c332`](https://github.com/tailor-platform/sdk/commit/978c332fa0ae0d9256fd2f80d858fb68e0e8c76d) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update secretlint monorepo to v13.0.6
31
+
32
+ - [#2465](https://github.com/tailor-platform/sdk/pull/2465) [`d8222e4`](https://github.com/tailor-platform/sdk/commit/d8222e40ab8f9668d19707bcc76fc7b134a08c26) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @​types/node to v24.19.0
33
+
34
+ - [#2458](https://github.com/tailor-platform/sdk/pull/2458) [`e982853`](https://github.com/tailor-platform/sdk/commit/e98285358692428fbc07a3713a0cc056f04baffa) Thanks [@toiroakr](https://github.com/toiroakr)! - Deploying a resolver, executor, or workflow no longer fails with `FORBIDDEN_RUNTIME_GLOBAL` for a Node-only global such as `process` that is only used after checking that it exists — for example `if (typeof process !== "undefined") { ... process.env.FOO ... }`, an early exit such as `if (typeof process === "undefined") return;` followed by `process.env.FOO`, or `typeof process < "u" && process.emitWarning(message)`. A global used without such a check is still reported — for example the `Buffer.from(...)` inside `@ai-sdk/gateway`, which the Vercel AI SDK (`ai`) depends on.
35
+
36
+ - [#2457](https://github.com/tailor-platform/sdk/pull/2457) [`be6ffb2`](https://github.com/tailor-platform/sdk/commit/be6ffb2acea8fec95c9b7e90d52d35960cb7be14) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix `workflow.start()` and job `.start()` calls that built and deployed but threw "workflow.start() is rewritten at build time and unavailable in the bundle" at runtime. These calls are now rewritten when:
37
+
38
+ - the workflow file is imported through a `tsconfig.json` `compilerOptions.paths` alias (e.g. `import workflow from "@/workflow/syncGLBalances"`)
39
+ - the workflow is default-exported as the result of a helper function that calls `createWorkflow()` (e.g. `export default module.workflows.syncGLBalances.create(mainJob)`); wrapping the helper result in another `createWorkflow({ ...helperResult, name: "..." })` call is no longer needed
40
+ - the workflow file is imported as a namespace (`import * as wf from "./workflows/sync"; wf.default.start(...)`)
41
+
42
+ A `.start()` call on an import from a workflow file that still cannot be rewritten — such as a helper-created workflow exported under a named export — now fails the build instead of deploying code that throws at runtime. The runtime error for an unrewritten `workflow.start()` also names the workflow.
43
+
44
+ ## 2.23.0
45
+
46
+ ### Minor Changes
47
+
48
+ - [#2440](https://github.com/tailor-platform/sdk/pull/2440) [`e2df6cf`](https://github.com/tailor-platform/sdk/commit/e2df6cfa8acd4acf1cbd46418855aa93127b70d3) Thanks [@dqn](https://github.com/dqn)! - `tailor deploy` now marks updates that show no configuration difference and are applied again only because the application's resources were last deployed with a different SDK version. The plan lists them with `[forced by SDK version]` and the summary counts them (`12 to update (11 forced by SDK version)`), so after an SDK upgrade you can tell them apart from real configuration changes. With `--json`, such changes carry `forcedBySdkVersion: true` and `summary.forcedBySdkVersion` counts them.
49
+
50
+ ### Patch Changes
51
+
52
+ - [#2442](https://github.com/tailor-platform/sdk/pull/2442) [`4a974b1`](https://github.com/tailor-platform/sdk/commit/4a974b1a16a5e2b9ff9e1e130962053b055a96af) Thanks [@dqn](https://github.com/dqn)! - Fix the `tailor deploy` plan leaving out workflow execution policies: their changes are now listed in the Workflow section, and unmanaged or conflicting execution policies and applications now appear in the plan's warnings and owner conflicts, including `--json` output.
53
+
54
+ - [#2462](https://github.com/tailor-platform/sdk/pull/2462) [`551179a`](https://github.com/tailor-platform/sdk/commit/551179ac9b0b44c3bfc46eca44b2507cad7c1511) Thanks [@k1LoW](https://github.com/k1LoW)! - Function execution logs are now read from the platform's structured log entries instead of the deprecated flat `logs` field. The `logs` string that `function run`, `function logs --json`, `workflow executions --logs`, `executor jobs --logs`, TailorDB migrations, and `executeScript()` return joins the messages of those entries with newlines, and `function logs` no longer falls back to the flat string when an execution has no structured entries.
55
+
56
+ - [#2448](https://github.com/tailor-platform/sdk/pull/2448) [`317ba1e`](https://github.com/tailor-platform/sdk/commit/317ba1eb287ad650ae59b16e000911da484edf47) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency rolldown to v1.2.11
57
+
58
+ - [#2438](https://github.com/tailor-platform/sdk/pull/2438) [`feb8b23`](https://github.com/tailor-platform/sdk/commit/feb8b2365c202a732be2d552dcb4a5d841101e2d) Thanks [@dqn](https://github.com/dqn)! - On Windows, a suggested follow-up command whose arguments cmd.exe and PowerShell read differently (for example a profile named `dev$1`, a config path containing `%`, or the webhook trigger's JSON body) is now shown as one command to copy into PowerShell and one to copy into cmd.exe, instead of an `argv [...]` array or a double-quoted line that PowerShell misreads. The `tailor profile update` suggestions shown for a read-only profile or a denied machine-user override now quote the profile name instead of pasting it into the command unquoted. On every platform, these suggested follow-up commands are now set off in backticks.
59
+
60
+ - [#2462](https://github.com/tailor-platform/sdk/pull/2462) [`0dcbed6`](https://github.com/tailor-platform/sdk/commit/0dcbed6f3c4f1847e8864febb1c43d0d00fdffae) Thanks [@k1LoW](https://github.com/k1LoW)! - Workflow commands now recognize canceled workflow executions. `workflow start --wait`, `workflow wait`, `workflow executions <id> --wait`, and `executor jobs --wait` over a workflow stop at a canceled execution and fail with `WORKFLOW_EXECUTION_CANCELED` instead of polling until they time out, a TailorDB migration whose workflow is canceled fails instead of waiting indefinitely, the status is shown as `CANCELED` rather than `UNSPECIFIED`, and `workflow executions --status CANCELED` is accepted.
61
+
3
62
  ## 2.22.0
4
63
 
5
64
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"aigateway-DsWDjzk4.mjs","names":[],"sources":["../src/runtime/aigateway.ts"],"sourcesContent":["/**\n * AI Gateway utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.aigateway` runtime API.\n * At runtime this delegates to `globalThis.tailor.aigateway`. Use `mockAigateway`\n * from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n *\n * `name` is narrowed to the AI Gateway names defined via `defineAIGateway()`\n * once `tailor.d.ts` has been generated (via `tailor deploy`/`generate`).\n * @example\n * import { aigateway } from \"@tailor-platform/sdk/runtime\";\n *\n * const { url } = await aigateway.get(\"my-aigateway\");\n */\n\n// Import from the public entry (not `#/configure/types/aigateway-name`) so this d.ts\n// references `@tailor-platform/sdk` externally instead of inlining the registry — the\n// same generated `declare module \"@tailor-platform/sdk\"` that narrows\n// `authconnection.getConnectionToken` then also narrows this entry.\nimport type { AIGatewayName } from \"@tailor-platform/sdk\";\n\n/** Result of {@link TailorAigatewayAPI.get}. */\nexport interface GetAIGatewayResult {\n /** The platform-assigned URL of the AI Gateway. */\n url: string;\n}\n\n/**\n * Platform API surface for `tailor.aigateway`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.aigateway`.\n */\nexport interface TailorAigatewayAPI {\n /**\n * Resolves an AI Gateway defined in the caller's own workspace.\n * @param name - AI Gateway name, as passed to `defineAIGateway()`\n * @returns The resolved AI Gateway's platform-assigned URL\n */\n get(name: AIGatewayName): Promise<GetAIGatewayResult>;\n}\n\nconst api = (): TailorAigatewayAPI =>\n (globalThis as unknown as { tailor: { aigateway: TailorAigatewayAPI } }).tailor.aigateway;\n\nconst get: TailorAigatewayAPI[\"get\"] = (...args) => api().get(...args);\n\n/** Runtime wrapper namespace for `tailor.aigateway`. */\nexport const aigateway = { get } as const satisfies TailorAigatewayAPI;\n"],"mappings":"AAwCA,MAAM,QACH,WAAwE,OAAO,UAKrE,EAAY,CAAE,KAHa,GAAG,IAAS,IAAI,CAAC,CAAC,IAAI,GAAG,CAAI,CAGtC"}
1
+ {"version":3,"file":"aigateway-DsWDjzk4.mjs","names":["aigateway","args"],"sources":["../src/runtime/aigateway.ts"],"sourcesContent":["/**\n * AI Gateway utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.aigateway` runtime API.\n * At runtime this delegates to `globalThis.tailor.aigateway`. Use `mockAigateway`\n * from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n *\n * `name` is narrowed to the AI Gateway names defined via `defineAIGateway()`\n * once `tailor.d.ts` has been generated (via `tailor deploy`/`generate`).\n * @example\n * import { aigateway } from \"@tailor-platform/sdk/runtime\";\n *\n * const { url } = await aigateway.get(\"my-aigateway\");\n */\n\n// Import from the public entry (not `#/configure/types/aigateway-name`) so this d.ts\n// references `@tailor-platform/sdk` externally instead of inlining the registry — the\n// same generated `declare module \"@tailor-platform/sdk\"` that narrows\n// `authconnection.getConnectionToken` then also narrows this entry.\nimport type { AIGatewayName } from \"@tailor-platform/sdk\";\n\n/** Result of {@link TailorAigatewayAPI.get}. */\nexport interface GetAIGatewayResult {\n /** The platform-assigned URL of the AI Gateway. */\n url: string;\n}\n\n/**\n * Platform API surface for `tailor.aigateway`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.aigateway`.\n */\nexport interface TailorAigatewayAPI {\n /**\n * Resolves an AI Gateway defined in the caller's own workspace.\n * @param name - AI Gateway name, as passed to `defineAIGateway()`\n * @returns The resolved AI Gateway's platform-assigned URL\n */\n get(name: AIGatewayName): Promise<GetAIGatewayResult>;\n}\n\nconst api = (): TailorAigatewayAPI =>\n (globalThis as unknown as { tailor: { aigateway: TailorAigatewayAPI } }).tailor.aigateway;\n\nconst get: TailorAigatewayAPI[\"get\"] = (...args) => api().get(...args);\n\n/** Runtime wrapper namespace for `tailor.aigateway`. */\nexport const aigateway = { get } as const satisfies TailorAigatewayAPI;\n"],"mappings":"AAwCA,MAAM,QACH,WAAwE,OAAO,UAKrEA,EAAY,CAAE,KAHa,GAAGC,IAAS,IAAI,CAAC,CAAC,IAAI,GAAGA,CAAI,CAGtC"}
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./application-CfqvzV3I.mjs";export{t as defineApplication,e as generatePluginFilesIfNeeded};