@tailor-platform/sdk 1.50.1 → 1.51.1

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 (150) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +1 -0
  3. package/agent-skills/tailor-sdk/SKILL.md +2 -0
  4. package/dist/{actor-BeIEiPYM.d.mts → actor-Nag62ZDM.d.mts} +2 -3
  5. package/dist/application-Bcx-FbDE.mjs +4 -0
  6. package/dist/{application-CZMzt9jL.mjs → application-Z-fNwyZB.mjs} +50 -14
  7. package/dist/application-Z-fNwyZB.mjs.map +1 -0
  8. package/dist/authconnection-BDFTabLQ.d.mts +39 -0
  9. package/dist/authconnection-BUko4V6H.mjs +16 -0
  10. package/dist/authconnection-BUko4V6H.mjs.map +1 -0
  11. package/dist/{brand-D-d15jx3.mjs → brand-Ll48SMXe.mjs} +1 -1
  12. package/dist/{brand-D-d15jx3.mjs.map → brand-Ll48SMXe.mjs.map} +1 -1
  13. package/dist/chunk-DLeslSnM.mjs +21 -0
  14. package/dist/cli/index.d.mts +0 -1
  15. package/dist/cli/index.mjs +16 -16
  16. package/dist/cli/lib.d.mts +6 -7
  17. package/dist/cli/lib.mjs +8 -8
  18. package/dist/cli/skills.d.mts +0 -1
  19. package/dist/cli/skills.mjs +1 -1
  20. package/dist/{client-_kHh0Pip.mjs → client-BwV17byk.mjs} +4 -4
  21. package/dist/{client-_kHh0Pip.mjs.map → client-BwV17byk.mjs.map} +1 -1
  22. package/dist/{client-CPW1N1Rs.mjs → client-D_a50aIg.mjs} +1 -1
  23. package/dist/configure/index.d.mts +5 -5
  24. package/dist/configure/index.mjs +4 -4
  25. package/dist/configure/index.mjs.map +1 -1
  26. package/dist/context-BP5BUdcq.mjs +25 -0
  27. package/dist/context-BP5BUdcq.mjs.map +1 -0
  28. package/dist/context-BXDgEQK9.d.mts +68 -0
  29. package/dist/{crashreport-DHJuSmUc.mjs → crashreport-C4EbRoku.mjs} +1 -1
  30. package/dist/{crashreport-CvmdFs4i.mjs → crashreport-DauPOrKn.mjs} +5 -5
  31. package/dist/{crashreport-CvmdFs4i.mjs.map → crashreport-DauPOrKn.mjs.map} +1 -1
  32. package/dist/{enum-constants-C3KSpsYj.mjs → enum-constants-DI85-fPE.mjs} +1 -1
  33. package/dist/{enum-constants-C3KSpsYj.mjs.map → enum-constants-DI85-fPE.mjs.map} +1 -1
  34. package/dist/{errors-pMPXghkO.mjs → errors-C4cJ0M2K.mjs} +1 -1
  35. package/dist/{errors-pMPXghkO.mjs.map → errors-C4cJ0M2K.mjs.map} +1 -1
  36. package/dist/{field-DLSIuMTu.mjs → field-BY2vbJ8f.mjs} +1 -1
  37. package/dist/{field-DLSIuMTu.mjs.map → field-BY2vbJ8f.mjs.map} +1 -1
  38. package/dist/file-BE5Sy7lP.mjs +54 -0
  39. package/dist/file-BE5Sy7lP.mjs.map +1 -0
  40. package/dist/file-Dc4_QrlQ.d.mts +206 -0
  41. package/dist/{file-utils-DjNi_3U_.mjs → file-utils-BM8t5jCy.mjs} +20 -10
  42. package/dist/file-utils-BM8t5jCy.mjs.map +1 -0
  43. package/dist/iconv-BFNfdlIS.d.mts +122 -0
  44. package/dist/iconv-D0yL88Il.mjs +64 -0
  45. package/dist/iconv-D0yL88Il.mjs.map +1 -0
  46. package/dist/idp-B1b4O7ia.d.mts +161 -0
  47. package/dist/idp-CM7N7iID.mjs +76 -0
  48. package/dist/idp-CM7N7iID.mjs.map +1 -0
  49. package/dist/{index-C--7W0UO.d.mts → index-BD99GoHO.d.mts} +4 -5
  50. package/dist/{index-nV4ZC_Ve.d.mts → index-BXwAT_oE.d.mts} +2 -3
  51. package/dist/{index-BQ4oi0AI.d.mts → index-CYAZkd4b.d.mts} +2 -3
  52. package/dist/{index-BjXN1SdY.d.mts → index-CfSjuxzK.d.mts} +2 -3
  53. package/dist/index-Dy3ZH5Wm.d.mts +46 -0
  54. package/dist/{index-VJW98BSy.d.mts → index-aiIbrFGw.d.mts} +2 -3
  55. package/dist/{interceptor-DTNS0EtF.mjs → interceptor-Cr3kZWMc.mjs} +1 -1
  56. package/dist/{interceptor-DTNS0EtF.mjs.map → interceptor-Cr3kZWMc.mjs.map} +1 -1
  57. package/dist/{job-M3Avv_SV.mjs → job-4GOnasfT.mjs} +2 -2
  58. package/dist/{job-M3Avv_SV.mjs.map → job-4GOnasfT.mjs.map} +1 -1
  59. package/dist/kysely/index.d.mts +0 -1
  60. package/dist/{kysely-type-B8aRz_oC.mjs → kysely-type-BUoVDC5r.mjs} +2 -2
  61. package/dist/{kysely-type-B8aRz_oC.mjs.map → kysely-type-BUoVDC5r.mjs.map} +1 -1
  62. package/dist/{logger-DTNAMYGy.mjs → logger-B1g4I9wT.mjs} +1 -1
  63. package/dist/{logger-DTNAMYGy.mjs.map → logger-B1g4I9wT.mjs.map} +1 -1
  64. package/dist/{mock-BfL09ULZ.mjs → mock-B2t5gDMl.mjs} +11 -5
  65. package/dist/mock-B2t5gDMl.mjs.map +1 -0
  66. package/dist/{multiline-e3IpANmS.mjs → multiline-G1yF18OH.mjs} +1 -1
  67. package/dist/{multiline-e3IpANmS.mjs.map → multiline-G1yF18OH.mjs.map} +1 -1
  68. package/dist/package-json-CAGKAJff.mjs +4 -0
  69. package/dist/{package-json-6Px8bDpG.mjs → package-json-ZL0MkZOO.mjs} +1 -1
  70. package/dist/{package-json-6Px8bDpG.mjs.map → package-json-ZL0MkZOO.mjs.map} +1 -1
  71. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -2
  72. package/dist/plugin/builtin/enum-constants/index.mjs +1 -1
  73. package/dist/plugin/builtin/file-utils/index.d.mts +1 -2
  74. package/dist/plugin/builtin/file-utils/index.mjs +1 -1
  75. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -2
  76. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  77. package/dist/plugin/builtin/seed/index.d.mts +1 -2
  78. package/dist/plugin/builtin/seed/index.mjs +1 -1
  79. package/dist/plugin/index.d.mts +2 -3
  80. package/dist/{repl-editor-jZ493eQI.mjs → repl-editor-yAjwS5_M.mjs} +1 -1
  81. package/dist/{repl-editor-jZ493eQI.mjs.map → repl-editor-yAjwS5_M.mjs.map} +1 -1
  82. package/dist/runtime/authconnection.d.mts +2 -0
  83. package/dist/runtime/authconnection.mjs +4 -0
  84. package/dist/runtime/context.d.mts +2 -0
  85. package/dist/runtime/context.mjs +4 -0
  86. package/dist/runtime/file.d.mts +2 -0
  87. package/dist/runtime/file.mjs +4 -0
  88. package/dist/runtime/globals.d.mts +103 -0
  89. package/dist/runtime/globals.mjs +2 -0
  90. package/dist/runtime/iconv.d.mts +2 -0
  91. package/dist/runtime/iconv.mjs +4 -0
  92. package/dist/runtime/idp.d.mts +2 -0
  93. package/dist/runtime/idp.mjs +4 -0
  94. package/dist/runtime/index.d.mts +9 -0
  95. package/dist/runtime/index.mjs +10 -0
  96. package/dist/runtime/secretmanager.d.mts +2 -0
  97. package/dist/runtime/secretmanager.mjs +4 -0
  98. package/dist/runtime/workflow.d.mts +2 -0
  99. package/dist/runtime/workflow.mjs +4 -0
  100. package/dist/{runtime-DgsMnMrO.mjs → runtime-CyX4zeod.mjs} +55 -32
  101. package/dist/runtime-CyX4zeod.mjs.map +1 -0
  102. package/dist/{schema-C5QjYEc-.mjs → schema-DBq6hr6h.mjs} +3 -3
  103. package/dist/{schema-C5QjYEc-.mjs.map → schema-DBq6hr6h.mjs.map} +1 -1
  104. package/dist/{secret-file-BHpxGyNf.mjs → secret-file-DnbmTWec.mjs} +1 -1
  105. package/dist/{secret-file-BHpxGyNf.mjs.map → secret-file-DnbmTWec.mjs.map} +1 -1
  106. package/dist/secretmanager-CQTTuCmn.mjs +25 -0
  107. package/dist/secretmanager-CQTTuCmn.mjs.map +1 -0
  108. package/dist/secretmanager-Cjq3s2aU.d.mts +55 -0
  109. package/dist/seed/index.d.mts +0 -1
  110. package/dist/{seed-DjfAn0BC.mjs → seed-kNk-xLoB.mjs} +7 -2
  111. package/dist/{seed-DjfAn0BC.mjs.map → seed-kNk-xLoB.mjs.map} +1 -1
  112. package/dist/{service-DCgJxdg1.mjs → service-DHgJ4YEF.mjs} +3 -3
  113. package/dist/{service-DCgJxdg1.mjs.map → service-DHgJ4YEF.mjs.map} +1 -1
  114. package/dist/{tailor-db-field-4bMLe25-.d.mts → tailor-db-field-BhWvOyky.d.mts} +1 -2
  115. package/dist/{telemetry-C1Y56L5E.mjs → telemetry-C8xKz3GM.mjs} +2 -2
  116. package/dist/{telemetry-C1Y56L5E.mjs.map → telemetry-C8xKz3GM.mjs.map} +1 -1
  117. package/dist/telemetry-DQl47E1s.mjs +4 -0
  118. package/dist/types-BnphjkIJ.mjs +5 -0
  119. package/dist/{types-sir9UPht.mjs → types-Duhhsx3R.mjs} +2 -2
  120. package/dist/{types-sir9UPht.mjs.map → types-Duhhsx3R.mjs.map} +1 -1
  121. package/dist/utils/test/index.d.mts +3 -4
  122. package/dist/utils/test/index.mjs +1 -1
  123. package/dist/utils/test/index.mjs.map +1 -1
  124. package/dist/vitest/environment.d.mts +0 -1
  125. package/dist/vitest/environment.mjs +1 -1
  126. package/dist/vitest/index.d.mts +2 -3
  127. package/dist/vitest/index.mjs +3 -3
  128. package/dist/vitest/index.mjs.map +1 -1
  129. package/dist/vitest/setup.d.mts +0 -1
  130. package/dist/vitest/setup.mjs +1 -1
  131. package/dist/workflow-DJRr-0nl.mjs +39 -0
  132. package/dist/workflow-DJRr-0nl.mjs.map +1 -0
  133. package/dist/workflow-DV_88JEf.d.mts +96 -0
  134. package/dist/{workflow.generated-OYAu_6zX.d.mts → workflow.generated-DV87DJfO.d.mts} +2 -3
  135. package/docs/cli/application.md +1 -1
  136. package/docs/cli/tailordb.md +9 -8
  137. package/docs/cli-reference.md +17 -16
  138. package/docs/configuration.md +1 -0
  139. package/docs/generator/builtin.md +2 -0
  140. package/docs/runtime.md +113 -0
  141. package/docs/testing.md +21 -0
  142. package/package.json +53 -9
  143. package/dist/application-CZMzt9jL.mjs.map +0 -1
  144. package/dist/application-v_E2W-Fz.mjs +0 -4
  145. package/dist/file-utils-DjNi_3U_.mjs.map +0 -1
  146. package/dist/mock-BfL09ULZ.mjs.map +0 -1
  147. package/dist/package-json-7sRXVndJ.mjs +0 -4
  148. package/dist/runtime-DgsMnMrO.mjs.map +0 -1
  149. package/dist/telemetry-C13VIFpT.mjs +0 -4
  150. package/dist/types-DoIG6Nij.mjs +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.51.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1241](https://github.com/tailor-platform/sdk/pull/1241) [`4c40f74`](https://github.com/tailor-platform/sdk/commit/4c40f741318cdbc940a1b7db288751de50e8f680) Thanks [@remiposo](https://github.com/remiposo)! - `tailor-sdk deploy` now waits for the application's GraphQL schema composition to succeed before returning. Composition errors that previously only surfaced via `tailor-sdk workspace app health` are now raised by `deploy` itself.
8
+
9
+ - [#1216](https://github.com/tailor-platform/sdk/pull/1216) [`7f3aa30`](https://github.com/tailor-platform/sdk/commit/7f3aa308732ac4cac4c8671ce57733a8328d37d9) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @clack/prompts to v1.4.0
10
+
11
+ - [#1219](https://github.com/tailor-platform/sdk/pull/1219) [`77bf0b7`](https://github.com/tailor-platform/sdk/commit/77bf0b71a1f92be4987be5ab344cecc9985c88a2) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency globals to v17.6.0
12
+
13
+ - [#1220](https://github.com/tailor-platform/sdk/pull/1220) [`36b3bce`](https://github.com/tailor-platform/sdk/commit/36b3bceca39899c8fb0d57b4c0d467c2f0fe491e) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency graphql to v16.14.0
14
+
15
+ - [#1249](https://github.com/tailor-platform/sdk/pull/1249) [`2e11bc2`](https://github.com/tailor-platform/sdk/commit/2e11bc28e76fca4874b9d35454e86253ca53b920) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency zod to v4.4.3
16
+
17
+ - [#1246](https://github.com/tailor-platform/sdk/pull/1246) [`4d3f2d4`](https://github.com/tailor-platform/sdk/commit/4d3f2d4eb7d5f1a7bdcd3a078075f89d4b2048ab) Thanks [@toiroakr](https://github.com/toiroakr)! - Cap parallel bundling of resolvers, executors, and workflow jobs to avoid OOM/SIGTERM on CI runners with many resolvers. Concurrency defaults to `os.cpus().length` and can be overridden via the `TAILOR_BUNDLE_CONCURRENCY` env var.
18
+
19
+ ## 1.51.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#1131](https://github.com/tailor-platform/sdk/pull/1131) [`c62c3b0`](https://github.com/tailor-platform/sdk/commit/c62c3b0a78761cff859ccac5af23d2e8dd0f996a) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `@tailor-platform/sdk/runtime` — typed wrappers for the Tailor Platform Function runtime APIs (`tailor.iconv`, `tailor.secretmanager`, `tailor.authconnection`, `tailor.idp`, `tailor.workflow`, `tailor.context`, and `tailordb.file`). The wrappers and their types are fully self-contained, so you can use them without activating any ambient globals.
24
+
25
+ ```ts
26
+ import {
27
+ iconv,
28
+ secretmanager,
29
+ idp,
30
+ file,
31
+ } from "@tailor-platform/sdk/runtime";
32
+
33
+ const utf8 = iconv.convert(sjisBuffer, "Shift_JIS", "UTF-8");
34
+ const apiKey = await secretmanager.getSecret("my-vault", "API_KEY");
35
+ const client = new idp.Client({ namespace: "my-namespace" });
36
+ const { metadata } = await file.upload(
37
+ "ns",
38
+ "Document",
39
+ "attachment",
40
+ recordId,
41
+ bytes
42
+ );
43
+ ```
44
+
45
+ The SDK no longer depends on the external `@tailor-platform/function-types` package; its declarations are now vendored inside the SDK. For backwards compatibility the ambient `tailor.*` / `tailordb.*` types are still activated automatically when you import from `@tailor-platform/sdk`, so existing code keeps type-checking with no changes. This implicit activation will be removed in v2.0 — new code is encouraged to use the typed wrappers from `@tailor-platform/sdk/runtime`, or to opt into the globals explicitly via `import "@tailor-platform/sdk/runtime/globals"` (or by listing the entry in `tsconfig.json`'s `compilerOptions.types`).
46
+
47
+ The capital-cased `Tailordb` ambient namespace (`Tailordb.QueryResult`, `Tailordb.CommandType`, `Tailordb.Client`) is preserved as a `@deprecated` alias of the new lowercase `tailordb.*` namespace for source-level compatibility with `@tailor-platform/function-types`. It will be removed in v2.0; run `pnpm dlx @tailor-platform/sdk-codemod v2/tailordb-namespace` to migrate. The `@tailor-platform/function-types` declarations are vendored inside the SDK and activated automatically, so you can simply remove `@tailor-platform/function-types` from your `package.json` (and from `tsconfig.json` `compilerOptions.types` if listed) once you've upgraded.
48
+
49
+ Other test-mock changes from `@tailor-platform/sdk/vitest`:
50
+
51
+ - Breaking: when an `openDownloadStream` (or `toFileStream()`) call consumes a queued mock result, raw `Uint8Array` / `ArrayBuffer` payloads are now rejected. Enqueue a structured iterable of `StreamValue` items (`{ type: "metadata" }`, `{ type: "chunk", data, position }`, `{ type: "complete" }`) so test streams stay aligned with the platform's structured stream contract. The shorthand `Uint8Array` enqueue is still accepted by `download` / `downloadAsBase64`.
52
+
53
+ ### Patch Changes
54
+
55
+ - [#1215](https://github.com/tailor-platform/sdk/pull/1215) [`65ffd8a`](https://github.com/tailor-platform/sdk/commit/65ffd8a84c377fe91f7632784716a6322fab4c33) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @opentelemetry
56
+
57
+ - [#1199](https://github.com/tailor-platform/sdk/pull/1199) [`1b6d0d8`](https://github.com/tailor-platform/sdk/commit/1b6d0d8678d02ed6f6ea79dad48fc3ba23978fbe) Thanks [@toiroakr](https://github.com/toiroakr)! - **Fix**: `tailor-sdk tailordb truncate` and the `exec.mjs` generated by the built-in `seedPlugin` no longer touch namespaces declared with `{ external: true }`.
58
+
59
+ - `tailor-sdk tailordb truncate --all` now only truncates namespaces the current app actually owns; namespaces declared with `{ external: true }` are skipped. This also covers the `--truncate` path of `seed/exec.mjs`, so its `seed:reset` no longer wipes a sibling app's data.
60
+ - `tailor-sdk tailordb truncate --namespace <name>` now rejects an external namespace with a dedicated error pointing the user to the owning app, instead of the generic "not found in config" message.
61
+ - The generated `seed/exec.mjs` now starts with an `@generated` header to discourage hand-edits, since the entire file is regenerated on every `sdk generate`.
62
+
3
63
  ## 1.50.1
4
64
 
5
65
  ### Patch Changes
package/README.md CHANGED
@@ -85,6 +85,7 @@ the installed SDK version. Files are copied (not symlinked) so they survive
85
85
 
86
86
  ### Guides
87
87
 
88
+ - [Runtime API](./docs/runtime.md) - Typed wrappers for `tailor.iconv`, `tailor.secretmanager`, `tailor.idp`, `tailor.workflow`, `tailor.context`, `tailor.authconnection`, and `tailordb.file`
88
89
  - [Testing Guide](./docs/testing.md) - Unit and E2E testing patterns
89
90
  - [CLI Reference](./docs/cli-reference.md) - Command-line interface documentation
90
91
 
@@ -17,6 +17,7 @@ Use these files as the single source of truth:
17
17
  - `node_modules/@tailor-platform/sdk/docs/cli-reference.md`
18
18
  - `node_modules/@tailor-platform/sdk/docs/cli/*.md`
19
19
  - `node_modules/@tailor-platform/sdk/docs/testing.md`
20
+ - `node_modules/@tailor-platform/sdk/docs/runtime.md`
20
21
 
21
22
  ## Working Rules
22
23
 
@@ -32,3 +33,4 @@ Use these files as the single source of truth:
32
33
  - Service details: `docs/services/*.md`
33
34
  - CLI commands: `docs/cli-reference.md` and `docs/cli/*.md`
34
35
  - Testing patterns: `docs/testing.md`
36
+ - Runtime API wrappers (`tailor.iconv`, `tailor.secretmanager`, `tailor.idp`, `tailor.workflow`, `tailor.context`, `tailor.authconnection`, `tailordb.file`): `docs/runtime.md`
@@ -1,5 +1,4 @@
1
- /// <reference types="@tailor-platform/function-types" />
2
- import { Bt as InferredAttributeMap, zt as InferredAttributeList } from "./tailor-db-field-4bMLe25-.mjs";
1
+ import { Bt as InferredAttributeMap, zt as InferredAttributeList } from "./tailor-db-field-BhWvOyky.mjs";
3
2
 
4
3
  //#region src/types/env.d.ts
5
4
  interface Env {}
@@ -27,4 +26,4 @@ type TailorActor = {
27
26
  };
28
27
  //#endregion
29
28
  export { Env as n, TailorEnv as r, TailorActor as t };
30
- //# sourceMappingURL=actor-BeIEiPYM.d.mts.map
29
+ //# sourceMappingURL=actor-Nag62ZDM.d.mts.map
@@ -0,0 +1,4 @@
1
+
2
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-Z-fNwyZB.mjs";
3
+
4
+ export { defineApplication };
@@ -1,14 +1,14 @@
1
1
 
2
- import { n as isSdkBranded } from "./brand-D-d15jx3.mjs";
3
- import { u as initOAuth2Client } from "./client-_kHh0Pip.mjs";
4
- import { a as parseBoolean, n as logger, r as styles } from "./logger-DTNAMYGy.mjs";
5
- import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-C3KSpsYj.mjs";
6
- import { t as multiline } from "./multiline-e3IpANmS.mjs";
7
- import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-DjNi_3U_.mjs";
8
- import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-B8aRz_oC.mjs";
9
- import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-DjfAn0BC.mjs";
10
- import { t as readPackageJson } from "./package-json-6Px8bDpG.mjs";
11
- import { n as tightenSecretFilePermissions, r as writeSecretFile } from "./secret-file-BHpxGyNf.mjs";
2
+ import { n as isSdkBranded } from "./brand-Ll48SMXe.mjs";
3
+ import { u as initOAuth2Client } from "./client-BwV17byk.mjs";
4
+ import { a as parseBoolean, n as logger, r as styles } from "./logger-B1g4I9wT.mjs";
5
+ import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-DI85-fPE.mjs";
6
+ import { t as multiline } from "./multiline-G1yF18OH.mjs";
7
+ import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-BM8t5jCy.mjs";
8
+ import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-BUoVDC5r.mjs";
9
+ import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-kNk-xLoB.mjs";
10
+ import { t as readPackageJson } from "./package-json-ZL0MkZOO.mjs";
11
+ import { n as tightenSecretFilePermissions, r as writeSecretFile } from "./secret-file-DnbmTWec.mjs";
12
12
  import { createRequire } from "node:module";
13
13
  import { z } from "zod";
14
14
  import * as fs$1 from "node:fs";
@@ -28,6 +28,7 @@ import * as fs from "node:fs/promises";
28
28
  import { parseSync } from "oxc-parser";
29
29
  import * as inflection from "inflection";
30
30
  import * as globals from "globals";
31
+ import pLimit from "p-limit";
31
32
 
32
33
  //#region src/parser/app-config/schema.ts
33
34
  const envValueSchema = z.union([
@@ -3754,6 +3755,41 @@ function createAuthService(config, tailorDBServices, externalTailorDBNamespaces)
3754
3755
  };
3755
3756
  }
3756
3757
 
3758
+ //#endregion
3759
+ //#region src/cli/shared/bundle-concurrency.ts
3760
+ /**
3761
+ * Resolve the maximum number of bundle operations to run in parallel.
3762
+ *
3763
+ * Resolution order:
3764
+ * 1. `TAILOR_BUNDLE_CONCURRENCY` env var (positive integer)
3765
+ * 2. `os.cpus().length`, clamped to at least 1
3766
+ *
3767
+ * Each `rolldown.build` invocation drives its own module graph and Rust thread
3768
+ * pool, so unbounded parallelism can exhaust native memory on constrained
3769
+ * runners (e.g. ubuntu-latest GitHub Actions runners with hundreds of
3770
+ * resolvers). Capping at CPU count keeps the worst case predictable.
3771
+ * @returns Concurrency cap (always >= 1)
3772
+ */
3773
+ function resolveBundleConcurrency() {
3774
+ const envValue = process.env.TAILOR_BUNDLE_CONCURRENCY;
3775
+ if (envValue !== void 0) {
3776
+ const trimmed = envValue.trim();
3777
+ if (trimmed !== "" && /^[1-9]\d*$/.test(trimmed)) return Number.parseInt(trimmed, 10);
3778
+ }
3779
+ return Math.max(1, os.cpus().length);
3780
+ }
3781
+ /**
3782
+ * Run an async worker over each item with the bundle-concurrency cap applied.
3783
+ * Results are returned in the same order as the input items.
3784
+ * @param items - Items to process
3785
+ * @param worker - Async worker function
3786
+ * @returns Worker results in input order
3787
+ */
3788
+ function withBundleConcurrency(items, worker) {
3789
+ const limit = pLimit(resolveBundleConcurrency());
3790
+ return Promise.all(items.map((item) => limit(() => worker(item))));
3791
+ }
3792
+
3757
3793
  //#endregion
3758
3794
  //#region src/cli/shared/runtime-exprs.ts
3759
3795
  /**
@@ -3994,7 +4030,7 @@ async function bundleExecutors(options) {
3994
4030
  } catch {
3995
4031
  tsconfig = void 0;
3996
4032
  }
3997
- const results = await Promise.all(executors.map((executor) => bundleSingleExecutor(executor, outputDir, tsconfig, triggerContext, cache, inlineSourcemap)));
4033
+ const results = await withBundleConcurrency(executors, (executor) => bundleSingleExecutor(executor, outputDir, tsconfig, triggerContext, cache, inlineSourcemap));
3998
4034
  for (const [name, code] of results) bundledCode.set(name, code);
3999
4035
  logger.log(`${styles.success("Bundled")} ${styles.info("\"executor\"")}`);
4000
4036
  return bundledCode;
@@ -4191,7 +4227,7 @@ async function bundleResolvers(namespace, config, triggerContext, cache, inlineS
4191
4227
  } catch {
4192
4228
  tsconfig = void 0;
4193
4229
  }
4194
- const results = await Promise.all(resolvers.map((resolver) => bundleSingleResolver(resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap)));
4230
+ const results = await withBundleConcurrency(resolvers, (resolver) => bundleSingleResolver(resolver, outputDir, tsconfig, triggerContext, cache, inlineSourcemap));
4195
4231
  for (const [name, code] of results) bundledCode.set(name, code);
4196
4232
  logger.log(`${styles.success("Bundled")} ${styles.info(`"${namespace}"`)}`);
4197
4233
  return bundledCode;
@@ -4514,7 +4550,7 @@ async function bundleWorkflowJobs(allJobs, mainJobNames, env = {}, triggerContex
4514
4550
  } catch {
4515
4551
  tsconfig = void 0;
4516
4552
  }
4517
- const results = await Promise.all(usedJobs.map((job) => bundleSingleJob(job, usedJobs, outputDir, tsconfig, env, triggerContext, cache, inlineSourcemap)));
4553
+ const results = await withBundleConcurrency(usedJobs, (job) => bundleSingleJob(job, usedJobs, outputDir, tsconfig, env, triggerContext, cache, inlineSourcemap));
4518
4554
  const bundledCode = /* @__PURE__ */ new Map();
4519
4555
  for (const [name, code] of results) bundledCode.set(name, code);
4520
4556
  logger.log(`${styles.success("Bundled")} ${styles.info("\"workflow-job\"")}`);
@@ -5345,4 +5381,4 @@ async function loadApplication(params) {
5345
5381
 
5346
5382
  //#endregion
5347
5383
  export { loadConfigPath as C, saveUserTokens as D, resolveTokens as E, writePlatformConfig as O, loadAccessToken as S, readPlatformConfig as T, getDistDir as _, WorkflowJobSchema as a, deleteUserTokens as b, ExecutorSchema as c, buildResolverOperationHookExpr as d, OAuth2ClientSchema as f, createBundleCache as g, loadFilesWithIgnores as h, resolveInlineSourcemap as i, INVOKER_EXPR as l, stringifyFunction as m, generatePluginFilesIfNeeded as n, ResolverSchema as o, TailorDBTypeSchema as p, loadApplication as r, createExecutorService as s, defineApplication as t, buildExecutorArgsExpr as u, hashFile as v, loadWorkspaceId as w, fetchLatestToken as x, loadConfig as y };
5348
- //# sourceMappingURL=application-CZMzt9jL.mjs.map
5384
+ //# sourceMappingURL=application-Z-fNwyZB.mjs.map