@tailor-platform/sdk 1.39.0 → 1.40.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 (94) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +7 -10
  3. package/dist/{env-CgI46oPS.d.mts → actor-B2oEmlTc.d.mts} +9 -9
  4. package/dist/application-CEeKm4R-.mjs +4 -0
  5. package/dist/{application-DhQrXEld.mjs → application-C_LFXkKJ.mjs} +148 -148
  6. package/dist/application-C_LFXkKJ.mjs.map +1 -0
  7. package/dist/{brand-D-d15jx3.mjs → brand-Ll48SMXe.mjs} +1 -1
  8. package/dist/{brand-D-d15jx3.mjs.map → brand-Ll48SMXe.mjs.map} +1 -1
  9. package/dist/cli/index.mjs +163 -42
  10. package/dist/cli/index.mjs.map +1 -1
  11. package/dist/cli/lib.d.mts +43 -9
  12. package/dist/cli/lib.mjs +4 -4
  13. package/dist/cli/skills.mjs +13 -43
  14. package/dist/cli/skills.mjs.map +1 -1
  15. package/dist/{client-xzPXtc_e.mjs → client-DjGFRjH4.mjs} +105 -47
  16. package/dist/client-DjGFRjH4.mjs.map +1 -0
  17. package/dist/client-Dtf48x0o.mjs +4 -0
  18. package/dist/configure/index.d.mts +4 -4
  19. package/dist/configure/index.mjs +55 -4
  20. package/dist/configure/index.mjs.map +1 -1
  21. package/dist/{crash-report-BEAiCSCl.mjs → crash-report-CEIXtw4D.mjs} +1 -1
  22. package/dist/{crash-report-DXhPL8Ue.mjs → crash-report-CSWITsTz.mjs} +4 -4
  23. package/dist/{crash-report-DXhPL8Ue.mjs.map → crash-report-CSWITsTz.mjs.map} +1 -1
  24. package/dist/{errors-D9f2UJpT.mjs → errors-ChWX5ZG8.mjs} +1 -1
  25. package/dist/{errors-D9f2UJpT.mjs.map → errors-ChWX5ZG8.mjs.map} +1 -1
  26. package/dist/field-BY2vbJ8f.mjs +23 -0
  27. package/dist/field-BY2vbJ8f.mjs.map +1 -0
  28. package/dist/{index-DbzopC7M.d.mts → index-BtXZdz-F.d.mts} +2 -2
  29. package/dist/{index-y5790SX_.d.mts → index-Chvw1Eod.d.mts} +2 -2
  30. package/dist/{index-B2tsEXdh.d.mts → index-CiNNNpuH.d.mts} +2 -2
  31. package/dist/{index-31hm0Fq7.d.mts → index-D_ezppY7.d.mts} +133 -30
  32. package/dist/{index-DeBFa7oc.d.mts → index-reFAYSX7.d.mts} +2 -2
  33. package/dist/{interceptor-CzaH2Ur6.mjs → interceptor-4UC-KTno.mjs} +1 -1
  34. package/dist/{interceptor-CzaH2Ur6.mjs.map → interceptor-4UC-KTno.mjs.map} +1 -1
  35. package/dist/{job-DkAklmE4.mjs → job-p6zf8Qpg.mjs} +2 -2
  36. package/dist/job-p6zf8Qpg.mjs.map +1 -0
  37. package/dist/{logger-5_JMzHmw.mjs → logger-DTNAMYGy.mjs} +1 -1
  38. package/dist/{logger-5_JMzHmw.mjs.map → logger-DTNAMYGy.mjs.map} +1 -1
  39. package/dist/package-json-CPR7s5hf.mjs +4 -0
  40. package/dist/{package-json-BHViVisJ.mjs → package-json-CWp8s9dE.mjs} +1 -1
  41. package/dist/{package-json-BHViVisJ.mjs.map → package-json-CWp8s9dE.mjs.map} +1 -1
  42. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  43. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  44. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  45. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  46. package/dist/plugin/builtin/seed/index.mjs +1 -1
  47. package/dist/plugin/index.d.mts +2 -2
  48. package/dist/repl-editor-DjycioU-.mjs +255 -0
  49. package/dist/repl-editor-DjycioU-.mjs.map +1 -0
  50. package/dist/{runtime-DtSOnOHh.mjs → runtime-im7Sq4jO.mjs} +313 -182
  51. package/dist/runtime-im7Sq4jO.mjs.map +1 -0
  52. package/dist/{schema-CnwUqPyM.mjs → schema-CEcfEyPN.mjs} +4 -44
  53. package/dist/schema-CEcfEyPN.mjs.map +1 -0
  54. package/dist/{seed-DrbB1VXd.mjs → seed-CyYPhvNL.mjs} +12 -12
  55. package/dist/seed-CyYPhvNL.mjs.map +1 -0
  56. package/dist/{service-Bcp6JB3w.mjs → service-SrG26B9T.mjs} +3 -3
  57. package/dist/{service-Bcp6JB3w.mjs.map → service-SrG26B9T.mjs.map} +1 -1
  58. package/dist/{plugin-_K3ZfP8B.d.mts → tailor-db-field-CoFKRCYW.d.mts} +695 -1187
  59. package/dist/{telemetry-DwHuiNiR.mjs → telemetry-BuDto_2q.mjs} +2 -2
  60. package/dist/{telemetry-DwHuiNiR.mjs.map → telemetry-BuDto_2q.mjs.map} +1 -1
  61. package/dist/telemetry-C1hzFaiV.mjs +4 -0
  62. package/dist/types-BnphjkIJ.mjs +5 -0
  63. package/dist/{types-B9ZMosul.mjs → types-Duhhsx3R.mjs} +3 -32
  64. package/dist/types-Duhhsx3R.mjs.map +1 -0
  65. package/dist/utils/test/index.d.mts +2 -2
  66. package/dist/utils/test/index.mjs +1 -1
  67. package/dist/workflow.generated-Btz6srLR.d.mts +1207 -0
  68. package/docs/cli/application.md +21 -5
  69. package/docs/cli/auth.md +20 -14
  70. package/docs/cli/executor.md +17 -14
  71. package/docs/cli/function.md +6 -4
  72. package/docs/cli/query.md +45 -0
  73. package/docs/cli/secret.md +13 -9
  74. package/docs/cli/skills.md +75 -0
  75. package/docs/cli/staticwebsite.md +6 -4
  76. package/docs/cli/user.md +9 -1
  77. package/docs/cli/workflow.md +17 -13
  78. package/docs/cli-reference.md +16 -0
  79. package/docs/services/idp.md +4 -4
  80. package/docs/services/workflow.md +1 -1
  81. package/package.json +12 -9
  82. package/dist/application-C1ipG5Q6.mjs +0 -4
  83. package/dist/application-DhQrXEld.mjs.map +0 -1
  84. package/dist/client-BWAbbA1C.mjs +0 -4
  85. package/dist/client-xzPXtc_e.mjs.map +0 -1
  86. package/dist/job-DkAklmE4.mjs.map +0 -1
  87. package/dist/package-json--6dmp6-h.mjs +0 -4
  88. package/dist/runtime-DtSOnOHh.mjs.map +0 -1
  89. package/dist/schema-CnwUqPyM.mjs.map +0 -1
  90. package/dist/seed-DrbB1VXd.mjs.map +0 -1
  91. package/dist/telemetry-4IOPW6wE.mjs +0 -4
  92. package/dist/types-B9ZMosul.mjs.map +0 -1
  93. package/dist/types-C45jRrCM.mjs +0 -4
  94. package/dist/workflow.generated-BxbnuzAE.d.mts +0 -414
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1012](https://github.com/tailor-platform/sdk/pull/1012) [`d5f1659`](https://github.com/tailor-platform/sdk/commit/d5f1659f3c53aa1b1839d9198bcd7e7071886daa) Thanks [@dqn](https://github.com/dqn)! - Add `tailor-sdk skills install` subcommand for installing the `tailor-sdk` agent skill from the locally installed SDK package, replacing the standalone `tailor-sdk-skills` binary that fetched `main` from GitHub. The skill version now always matches the installed SDK version, and files are copied (not symlinked) so they persist across `pnpm install`.
8
+
9
+ The `tailor-sdk-skills` binary is kept as a deprecated shim that prints a runtime warning and delegates to `tailor-sdk skills install`. It will be removed in v2.
10
+
11
+ - [#1011](https://github.com/tailor-platform/sdk/pull/1011) [`6711bf8`](https://github.com/tailor-platform/sdk/commit/6711bf8cb2ce122594406d429c7b0b256a5dea1f) Thanks [@dqn](https://github.com/dqn)! - Add `--order` and `--limit` options to CLI list commands for consistent pagination. Time-series log commands (`function logs`, `workflow executions`, `executor jobs`) default to newest-first (`--order desc`) and the most recent 50 items (`--limit 50`); pass `--order asc` or `--limit 0` to opt out. Other list commands (`workflow list`, `executor list`, `staticwebsite list`, `oauth2client list`, `secret list`, `secret vault list`, `user pat list`, `machineuser list`, `authconnection list`) also default to `--order desc` and accept `--limit N` (unlimited when omitted or set to `0`); pass `--order asc` to restore ascending order.
12
+
13
+ - [#895](https://github.com/tailor-platform/sdk/pull/895) [`a4b134d`](https://github.com/tailor-platform/sdk/commit/a4b134d796a335941c83f49cb572f82ea3fc522a) Thanks [@dqn](https://github.com/dqn)! - Replace query REPL input with a multiline editor supporting inline editing, undo/redo, persistent history, syntax highlighting (SQL and GraphQL), and auto-closing brackets with auto-indent. The submit/newline key binding is configurable via `--newline-on-enter` / `--no-newline-on-enter`, or the `TAILOR_PLATFORM_QUERY_NEWLINE_ON_ENTER` environment variable (default: newline on Enter, submit on Shift+Enter). Persistent history is now scoped per profile and workspace ID so statements from one environment are not replayed against another; the previous single shared history file is no longer read.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#1024](https://github.com/tailor-platform/sdk/pull/1024) [`98cf36f`](https://github.com/tailor-platform/sdk/commit/98cf36f45df1b4d7f01f8e4bdfa13d7b798e3068) Thanks [@haru0017](https://github.com/haru0017)! - Fix `executor webhook list` to return correct webhook URLs
18
+
19
+ - [#996](https://github.com/tailor-platform/sdk/pull/996) [`cbb0638`](https://github.com/tailor-platform/sdk/commit/cbb06385578fd37427d73e1602358344a63646f9) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix broken link to `example/resolvers/triggerWorkflow.ts` in the workflow service docs. The link used a relative path that escaped the `docs/` directory and 404'd on https://docs.tailor.tech; it now points to the GitHub source URL so it resolves on both the docs site and GitHub.
20
+
21
+ - [#1007](https://github.com/tailor-platform/sdk/pull/1007) [`d74dc27`](https://github.com/tailor-platform/sdk/commit/d74dc2741c048cb94c00d8bd4125cb64b6468dea) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update oxc
22
+
23
+ - [#1015](https://github.com/tailor-platform/sdk/pull/1015) [`a2bace2`](https://github.com/tailor-platform/sdk/commit/a2bace2537cbcf2ff826f184ea48db6eb9d7b67d) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.101
24
+
25
+ - [#1016](https://github.com/tailor-platform/sdk/pull/1016) [`c480bcb`](https://github.com/tailor-platform/sdk/commit/c480bcb895a5d28bc72c41eebd0937f75e47f154) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency bufbuild/buf to v1.68.2
26
+
27
+ ## 1.39.1
28
+
29
+ ### Patch Changes
30
+
31
+ - [#885](https://github.com/tailor-platform/sdk/pull/885) [`c67000f`](https://github.com/tailor-platform/sdk/commit/c67000fae7fcfe394e27bae8e12431fac2dc47d0) Thanks [@toiroakr](https://github.com/toiroakr)! - Auto-inject workspaceId and namespaceName into `api` command request body based on proto schema introspection and SDK config
32
+
33
+ - [#1017](https://github.com/tailor-platform/sdk/pull/1017) [`ab445c4`](https://github.com/tailor-platform/sdk/commit/ab445c494acc3ec1b1f7f135d97f06126902043a) Thanks [@k1LoW](https://github.com/k1LoW)! - Make `authorization` field optional in `defineIdp()` for migration to permission-based access control
34
+
35
+ - [#930](https://github.com/tailor-platform/sdk/pull/930) [`3bfeec3`](https://github.com/tailor-platform/sdk/commit/3bfeec37db1f28071ac0eeb201f9eea14f0f0d8e) Thanks [@toiroakr](https://github.com/toiroakr)! - Internal refactoring of type layer boundaries. No changes to public API.
36
+
37
+ - [#1014](https://github.com/tailor-platform/sdk/pull/1014) [`faa3301`](https://github.com/tailor-platform/sdk/commit/faa3301b7ff341ff3ddb52d387ae466381d267e2) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): lock file maintenance
38
+
3
39
  ## 1.39.0
4
40
 
5
41
  ### Minor Changes
package/README.md CHANGED
@@ -50,22 +50,19 @@ For more details, see the [Quickstart Guide](./docs/quickstart.md).
50
50
 
51
51
  ## Agent Skill
52
52
 
53
- Install the `tailor-sdk` skill with the open `skills` CLI:
53
+ Install the `tailor-sdk` skill from the locally installed SDK package:
54
54
 
55
55
  ```bash
56
- npx skills add https://github.com/tailor-platform/sdk/tree/main/packages/sdk/skills --skill tailor-sdk
57
- ```
58
-
59
- Use the SDK-provided shorthand command (internally uses `skills add`):
60
-
61
- ```bash
62
- npx tailor-sdk-skills
56
+ npx tailor-sdk skills install
63
57
 
64
58
  # Example: install to Codex in non-interactive mode
65
- npx tailor-sdk-skills -a codex -y
59
+ npx tailor-sdk skills install -a codex -y
66
60
  ```
67
61
 
68
- `npx tailor-sdk-skills` requires an environment where the `@tailor-platform/sdk` package binary is available.
62
+ This uses the `skills` CLI under the hood, sourcing the skill from
63
+ `node_modules/@tailor-platform/sdk/skills` so the skill version always matches
64
+ the installed SDK version. Files are copied (not symlinked) so they survive
65
+ `pnpm install` wiping `node_modules`.
69
66
 
70
67
  ## Learn More
71
68
 
@@ -1,7 +1,12 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { dt as InferredAttributeMap, ut as InferredAttributeList } from "./plugin-_K3ZfP8B.mjs";
2
+ import { Bt as InferredAttributeMap, zt as InferredAttributeList } from "./tailor-db-field-CoFKRCYW.mjs";
3
3
 
4
- //#region src/configure/types/actor.d.ts
4
+ //#region src/types/env.d.ts
5
+ interface Env {}
6
+ /** Represents environment variables in the Tailor platform. */
7
+ type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
8
+ //#endregion
9
+ //#region src/types/actor.d.ts
5
10
  /** User type enum values from the Tailor Platform server. */
6
11
  type TailorActorType = "USER_TYPE_USER" | "USER_TYPE_MACHINE_USER" | "USER_TYPE_UNSPECIFIED";
7
12
  /** Represents an actor in event triggers. */
@@ -21,10 +26,5 @@ type TailorActor = {
21
26
  userType: TailorActorType;
22
27
  };
23
28
  //#endregion
24
- //#region src/configure/types/env.d.ts
25
- interface Env {}
26
- /** Represents environment variables in the Tailor platform. */
27
- type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
28
- //#endregion
29
- export { TailorEnv as n, TailorActor as r, Env as t };
30
- //# sourceMappingURL=env-CgI46oPS.d.mts.map
29
+ export { Env as n, TailorEnv as r, TailorActor as t };
30
+ //# sourceMappingURL=actor-B2oEmlTc.d.mts.map
@@ -0,0 +1,4 @@
1
+
2
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-C_LFXkKJ.mjs";
3
+
4
+ export { defineApplication };
@@ -1,12 +1,12 @@
1
1
 
2
- import { l as initOAuth2Client } from "./client-xzPXtc_e.mjs";
3
- import { n as isSdkBranded } from "./brand-D-d15jx3.mjs";
4
- import { a as parseBoolean, n as logger, r as styles } from "./logger-5_JMzHmw.mjs";
5
- import { t as readPackageJson } from "./package-json-BHViVisJ.mjs";
6
- import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-DrbB1VXd.mjs";
2
+ import { u as initOAuth2Client } from "./client-DjGFRjH4.mjs";
3
+ import { n as isSdkBranded } from "./brand-Ll48SMXe.mjs";
4
+ import { a as parseBoolean, n as logger, r as styles } from "./logger-DTNAMYGy.mjs";
5
+ import { t as readPackageJson } from "./package-json-CWp8s9dE.mjs";
7
6
  import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "./enum-constants-Dx82rSjf.mjs";
8
7
  import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "./file-utils-DeWpvq3T.mjs";
9
8
  import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "./kysely-type-CwtvQuxh.mjs";
9
+ import { n as seedPlugin, r as isPluginGeneratedType, t as SeedGeneratorID } from "./seed-CyYPhvNL.mjs";
10
10
  import { createRequire } from "node:module";
11
11
  import { z } from "zod";
12
12
  import * as fs$1 from "node:fs";
@@ -16,10 +16,10 @@ import { join, resolve } from "pathe";
16
16
  import * as crypto from "node:crypto";
17
17
  import { pathToFileURL } from "node:url";
18
18
  import { resolveTSConfig } from "pkg-types";
19
+ import ml from "multiline-ts";
19
20
  import * as os from "node:os";
20
21
  import { parseTOML, parseYAML, stringifyYAML } from "confbox";
21
22
  import { findUpSync } from "find-up-simple";
22
- import ml from "multiline-ts";
23
23
  import { lt } from "semver";
24
24
  import { xdgConfig } from "xdg-basedir";
25
25
  import * as rolldown from "rolldown";
@@ -28,6 +28,69 @@ import { parseSync } from "oxc-parser";
28
28
  import * as inflection from "inflection";
29
29
  import * as globals from "globals";
30
30
 
31
+ //#region src/parser/generator-config/schema.ts
32
+ const DependencyKindSchema = z.enum([
33
+ "tailordb",
34
+ "resolver",
35
+ "executor"
36
+ ]);
37
+ const KyselyTypeConfigSchema = z.tuple([z.literal("@tailor-platform/kysely-type"), z.object({ distPath: z.string() })]);
38
+ const SeedConfigSchema = z.tuple([z.literal("@tailor-platform/seed"), z.object({
39
+ distPath: z.string(),
40
+ machineUserName: z.string().optional()
41
+ })]);
42
+ const EnumConstantsConfigSchema = z.tuple([z.literal("@tailor-platform/enum-constants"), z.object({ distPath: z.string() })]);
43
+ const FileUtilsConfigSchema = z.tuple([z.literal("@tailor-platform/file-utils"), z.object({ distPath: z.string() })]);
44
+ const CodeGeneratorSchema = z.object({
45
+ id: z.string(),
46
+ description: z.string(),
47
+ dependencies: z.array(DependencyKindSchema),
48
+ processType: z.function().optional(),
49
+ processResolver: z.function().optional(),
50
+ processExecutor: z.function().optional(),
51
+ processTailorDBNamespace: z.function().optional(),
52
+ processResolverNamespace: z.function().optional(),
53
+ aggregate: z.function({ output: z.any() })
54
+ });
55
+ const BaseGeneratorConfigSchema = z.union([
56
+ KyselyTypeConfigSchema,
57
+ SeedConfigSchema,
58
+ EnumConstantsConfigSchema,
59
+ FileUtilsConfigSchema,
60
+ CodeGeneratorSchema
61
+ ]);
62
+
63
+ //#endregion
64
+ //#region src/parser/service/common.ts
65
+ const functionSchema = z.custom((val) => typeof val === "function");
66
+
67
+ //#endregion
68
+ //#region src/parser/plugin-config/schema.ts
69
+ const PluginConfigSchema = z.object({
70
+ id: z.string(),
71
+ description: z.string(),
72
+ importPath: z.string().optional(),
73
+ pluginConfig: z.unknown().optional(),
74
+ typeConfigRequired: z.union([z.boolean(), functionSchema]).optional(),
75
+ onTypeLoaded: functionSchema.optional(),
76
+ onNamespaceLoaded: functionSchema.optional(),
77
+ onTailorDBReady: functionSchema.optional(),
78
+ onResolverReady: functionSchema.optional(),
79
+ onExecutorReady: functionSchema.optional()
80
+ }).passthrough().refine((p) => {
81
+ return !(p.onTypeLoaded || p.onNamespaceLoaded) || !!p.importPath;
82
+ }, { message: "importPath is required when plugin has definition-time hooks (onTypeLoaded/onNamespaceLoaded)" }).transform((plugin) => plugin);
83
+
84
+ //#endregion
85
+ //#region src/plugin/builtin/registry.ts
86
+ const builtinPlugins = new Map([
87
+ [KyselyGeneratorID, (options) => kyselyTypePlugin(options)],
88
+ [SeedGeneratorID, (options) => seedPlugin(options)],
89
+ [EnumConstantsGeneratorID, (options) => enumConstantsPlugin(options)],
90
+ [FileUtilsGeneratorID, (options) => fileUtilsPlugin(options)]
91
+ ]);
92
+
93
+ //#endregion
31
94
  //#region src/cli/shared/token-store.ts
32
95
  const SERVICE_NAME = "tailor-platform-cli";
33
96
  let entryClass;
@@ -443,6 +506,82 @@ function loadConfigPath(configPath) {
443
506
  return findUpSync(DEFAULT_CONFIG_FILENAME);
444
507
  }
445
508
 
509
+ //#endregion
510
+ //#region src/cli/shared/mock.ts
511
+ globalThis.tailordb = { Client: class {
512
+ constructor(_config) {}
513
+ async connect() {}
514
+ async end() {}
515
+ async queryObject() {
516
+ return {};
517
+ }
518
+ } };
519
+
520
+ //#endregion
521
+ //#region src/cli/shared/config-loader.ts
522
+ const GeneratorConfigSchema = CodeGeneratorSchema.brand("CodeGenerator");
523
+ /**
524
+ * Load Tailor configuration file and associated generators and plugins.
525
+ * @param configPath - Optional explicit config path
526
+ * @returns Loaded config, generators, plugins, and config path
527
+ */
528
+ async function loadConfig(configPath) {
529
+ const foundPath = loadConfigPath(configPath);
530
+ if (!foundPath) throw new Error("Configuration file not found: tailor.config.ts not found in current or parent directories");
531
+ const resolvedPath = path.resolve(process.cwd(), foundPath);
532
+ if (!fs$1.existsSync(resolvedPath)) throw new Error(`Configuration file not found: ${configPath}`);
533
+ const configModule = await import(pathToFileURL(resolvedPath).href);
534
+ if (!configModule || !configModule.default) throw new Error("Invalid Tailor config module: default export not found");
535
+ const allGenerators = [];
536
+ const allPlugins = [];
537
+ for (const value of Object.values(configModule)) if (Array.isArray(value)) {
538
+ const generatorParsed = value.reduce((acc, item) => {
539
+ if (!acc.success) return acc;
540
+ const baseResult = BaseGeneratorConfigSchema.safeParse(item);
541
+ if (baseResult.success && Array.isArray(baseResult.data)) {
542
+ const [id, options] = baseResult.data;
543
+ const pluginFactory = builtinPlugins.get(id);
544
+ if (pluginFactory) {
545
+ acc.convertedPlugins.push(pluginFactory(options));
546
+ return acc;
547
+ }
548
+ }
549
+ const result = GeneratorConfigSchema.safeParse(item);
550
+ if (result.success) acc.items.push(result.data);
551
+ else acc.success = false;
552
+ return acc;
553
+ }, {
554
+ success: true,
555
+ items: [],
556
+ convertedPlugins: []
557
+ });
558
+ if (generatorParsed.success && (generatorParsed.items.length > 0 || generatorParsed.convertedPlugins.length > 0)) {
559
+ allGenerators.push(...generatorParsed.items);
560
+ allPlugins.push(...generatorParsed.convertedPlugins);
561
+ continue;
562
+ }
563
+ const pluginParsed = value.reduce((acc, item) => {
564
+ if (!acc.success) return acc;
565
+ const result = PluginConfigSchema.safeParse(item);
566
+ if (result.success) acc.items.push(result.data);
567
+ else acc.success = false;
568
+ return acc;
569
+ }, {
570
+ success: true,
571
+ items: []
572
+ });
573
+ if (pluginParsed.success && pluginParsed.items.length > 0) allPlugins.push(...pluginParsed.items);
574
+ }
575
+ return {
576
+ config: {
577
+ ...configModule.default,
578
+ path: resolvedPath
579
+ },
580
+ generators: allGenerators,
581
+ plugins: allPlugins
582
+ };
583
+ }
584
+
446
585
  //#endregion
447
586
  //#region src/cli/cache/hasher.ts
448
587
  /**
@@ -2410,10 +2549,6 @@ function validatePluralFormUniqueness(types, namespace, typeSourceInfo) {
2410
2549
  if (errors.length > 0) throw new Error(`GraphQL field name conflicts detected in TailorDB service "${namespace}".\n${errors.map((e) => ` - ${e}`).join("\n")}`);
2411
2550
  }
2412
2551
 
2413
- //#endregion
2414
- //#region src/parser/service/common.ts
2415
- const functionSchema = z.custom((val) => typeof val === "function");
2416
-
2417
2552
  //#endregion
2418
2553
  //#region src/parser/service/tailordb/schema.ts
2419
2554
  /**
@@ -4453,141 +4588,6 @@ async function loadFileContent(filePath) {
4453
4588
  };
4454
4589
  }
4455
4590
 
4456
- //#endregion
4457
- //#region src/parser/generator-config/index.ts
4458
- const DependencyKindSchema = z.enum([
4459
- "tailordb",
4460
- "resolver",
4461
- "executor"
4462
- ]);
4463
- const KyselyTypeConfigSchema = z.tuple([z.literal("@tailor-platform/kysely-type"), z.object({ distPath: z.string() })]);
4464
- const SeedConfigSchema = z.tuple([z.literal("@tailor-platform/seed"), z.object({
4465
- distPath: z.string(),
4466
- machineUserName: z.string().optional()
4467
- })]);
4468
- const EnumConstantsConfigSchema = z.tuple([z.literal("@tailor-platform/enum-constants"), z.object({ distPath: z.string() })]);
4469
- const FileUtilsConfigSchema = z.tuple([z.literal("@tailor-platform/file-utils"), z.object({ distPath: z.string() })]);
4470
- const CodeGeneratorSchema = z.object({
4471
- id: z.string(),
4472
- description: z.string(),
4473
- dependencies: z.array(DependencyKindSchema),
4474
- processType: z.function().optional(),
4475
- processResolver: z.function().optional(),
4476
- processExecutor: z.function().optional(),
4477
- processTailorDBNamespace: z.function().optional(),
4478
- processResolverNamespace: z.function().optional(),
4479
- aggregate: z.function({ output: z.any() })
4480
- });
4481
- const BaseGeneratorConfigSchema = z.union([
4482
- KyselyTypeConfigSchema,
4483
- SeedConfigSchema,
4484
- EnumConstantsConfigSchema,
4485
- FileUtilsConfigSchema,
4486
- CodeGeneratorSchema
4487
- ]);
4488
-
4489
- //#endregion
4490
- //#region src/parser/plugin-config/schema.ts
4491
- const PluginConfigSchema = z.object({
4492
- id: z.string(),
4493
- description: z.string(),
4494
- importPath: z.string().optional(),
4495
- pluginConfig: z.unknown().optional(),
4496
- typeConfigRequired: z.union([z.boolean(), functionSchema]).optional(),
4497
- onTypeLoaded: functionSchema.optional(),
4498
- onNamespaceLoaded: functionSchema.optional(),
4499
- onTailorDBReady: functionSchema.optional(),
4500
- onResolverReady: functionSchema.optional(),
4501
- onExecutorReady: functionSchema.optional()
4502
- }).passthrough().refine((p) => {
4503
- return !(p.onTypeLoaded || p.onNamespaceLoaded) || !!p.importPath;
4504
- }, { message: "importPath is required when plugin has definition-time hooks (onTypeLoaded/onNamespaceLoaded)" }).transform((plugin) => plugin);
4505
-
4506
- //#endregion
4507
- //#region src/plugin/builtin/registry.ts
4508
- const builtinPlugins = new Map([
4509
- [KyselyGeneratorID, (options) => kyselyTypePlugin(options)],
4510
- [SeedGeneratorID, (options) => seedPlugin(options)],
4511
- [EnumConstantsGeneratorID, (options) => enumConstantsPlugin(options)],
4512
- [FileUtilsGeneratorID, (options) => fileUtilsPlugin(options)]
4513
- ]);
4514
-
4515
- //#endregion
4516
- //#region src/cli/shared/mock.ts
4517
- globalThis.tailordb = { Client: class {
4518
- constructor(_config) {}
4519
- async connect() {}
4520
- async end() {}
4521
- async queryObject() {
4522
- return {};
4523
- }
4524
- } };
4525
-
4526
- //#endregion
4527
- //#region src/cli/shared/config-loader.ts
4528
- const GeneratorConfigSchema = CodeGeneratorSchema.brand("CodeGenerator");
4529
- /**
4530
- * Load Tailor configuration file and associated generators and plugins.
4531
- * @param configPath - Optional explicit config path
4532
- * @returns Loaded config, generators, plugins, and config path
4533
- */
4534
- async function loadConfig(configPath) {
4535
- const foundPath = loadConfigPath(configPath);
4536
- if (!foundPath) throw new Error("Configuration file not found: tailor.config.ts not found in current or parent directories");
4537
- const resolvedPath = path.resolve(process.cwd(), foundPath);
4538
- if (!fs$1.existsSync(resolvedPath)) throw new Error(`Configuration file not found: ${configPath}`);
4539
- const configModule = await import(pathToFileURL(resolvedPath).href);
4540
- if (!configModule || !configModule.default) throw new Error("Invalid Tailor config module: default export not found");
4541
- const allGenerators = [];
4542
- const allPlugins = [];
4543
- for (const value of Object.values(configModule)) if (Array.isArray(value)) {
4544
- const generatorParsed = value.reduce((acc, item) => {
4545
- if (!acc.success) return acc;
4546
- const baseResult = BaseGeneratorConfigSchema.safeParse(item);
4547
- if (baseResult.success && Array.isArray(baseResult.data)) {
4548
- const [id, options] = baseResult.data;
4549
- const pluginFactory = builtinPlugins.get(id);
4550
- if (pluginFactory) {
4551
- acc.convertedPlugins.push(pluginFactory(options));
4552
- return acc;
4553
- }
4554
- }
4555
- const result = GeneratorConfigSchema.safeParse(item);
4556
- if (result.success) acc.items.push(result.data);
4557
- else acc.success = false;
4558
- return acc;
4559
- }, {
4560
- success: true,
4561
- items: [],
4562
- convertedPlugins: []
4563
- });
4564
- if (generatorParsed.success && (generatorParsed.items.length > 0 || generatorParsed.convertedPlugins.length > 0)) {
4565
- allGenerators.push(...generatorParsed.items);
4566
- allPlugins.push(...generatorParsed.convertedPlugins);
4567
- continue;
4568
- }
4569
- const pluginParsed = value.reduce((acc, item) => {
4570
- if (!acc.success) return acc;
4571
- const result = PluginConfigSchema.safeParse(item);
4572
- if (result.success) acc.items.push(result.data);
4573
- else acc.success = false;
4574
- return acc;
4575
- }, {
4576
- success: true,
4577
- items: []
4578
- });
4579
- if (pluginParsed.success && pluginParsed.items.length > 0) allPlugins.push(...pluginParsed.items);
4580
- }
4581
- return {
4582
- config: {
4583
- ...configModule.default,
4584
- path: resolvedPath
4585
- },
4586
- generators: allGenerators,
4587
- plugins: allPlugins
4588
- };
4589
- }
4590
-
4591
4591
  //#endregion
4592
4592
  //#region src/cli/shared/inline-sourcemap.ts
4593
4593
  /**
@@ -4751,7 +4751,7 @@ const IdPSchema = z.object({
4751
4751
  z.literal("insecure"),
4752
4752
  z.literal("loggedIn"),
4753
4753
  z.object({ cel: z.string() })
4754
- ]).describe("Authorization mode for IdP API access"),
4754
+ ]).optional().describe("Authorization mode for IdP API access"),
4755
4755
  clients: z.array(z.string()).describe("OAuth2 client names that can use this IdP"),
4756
4756
  lang: IdPLangSchema.optional().describe("UI language for IdP pages"),
4757
4757
  userAuthPolicy: IdPUserAuthPolicySchema.transform((input) => IdPUserAuthPolicySchema.parse(input ?? {})).optional().describe("User authentication policy configuration"),
@@ -5087,5 +5087,5 @@ async function loadApplication(params) {
5087
5087
  }
5088
5088
 
5089
5089
  //#endregion
5090
- export { resolveTokens as C, readPlatformConfig as S, writePlatformConfig as T, hashFile as _, loadConfig as a, loadAccessToken as b, createExecutorService as c, TailorDBTypeSchema as d, stringifyFunction as f, getDistDir as g, createBundleCache as h, resolveInlineSourcemap as i, ExecutorSchema as l, loadFilesWithIgnores as m, generatePluginFilesIfNeeded as n, WorkflowJobSchema as o, tailorUserMap as p, loadApplication as r, ResolverSchema as s, defineApplication as t, OAuth2ClientSchema as u, deleteUserTokens as v, saveUserTokens as w, loadWorkspaceId as x, fetchLatestToken as y };
5091
- //# sourceMappingURL=application-DhQrXEld.mjs.map
5090
+ export { resolveTokens as C, readPlatformConfig as S, writePlatformConfig as T, loadConfig as _, WorkflowJobSchema as a, loadAccessToken as b, ExecutorSchema as c, stringifyFunction as d, tailorUserMap as f, hashFile as g, getDistDir as h, resolveInlineSourcemap as i, OAuth2ClientSchema as l, createBundleCache as m, generatePluginFilesIfNeeded as n, ResolverSchema as o, loadFilesWithIgnores as p, loadApplication as r, createExecutorService as s, defineApplication as t, TailorDBTypeSchema as u, deleteUserTokens as v, saveUserTokens as w, loadWorkspaceId as x, fetchLatestToken as y };
5091
+ //# sourceMappingURL=application-C_LFXkKJ.mjs.map