@elementumai/edk 0.8.0-preview.11 → 0.8.2-alpha.5

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 (180) hide show
  1. package/README.md +510 -324
  2. package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
  3. package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
  4. package/dist-sdk/src/catalog/factories.d.ts +56 -3
  5. package/dist-sdk/src/catalog/factories.js +83 -4
  6. package/dist-sdk/src/catalog/from-authoring.js +19 -2
  7. package/dist-sdk/src/catalog/index.d.ts +3 -2
  8. package/dist-sdk/src/catalog/index.js +3 -2
  9. package/dist-sdk/src/catalog/org.d.ts +1 -1
  10. package/dist-sdk/src/catalog/org.js +134 -50
  11. package/dist-sdk/src/catalog/render.d.ts +13 -1
  12. package/dist-sdk/src/catalog/render.js +21 -4
  13. package/dist-sdk/src/catalog/token.js +18 -0
  14. package/dist-sdk/src/catalog/types.d.ts +75 -3
  15. package/dist-sdk/src/catalog/types.js +3 -0
  16. package/dist-sdk/src/core/system-fields.d.ts +2 -0
  17. package/dist-sdk/src/core/system-fields.js +2 -0
  18. package/dist-sdk/src/core/types/ai-provider.d.ts +10 -23
  19. package/dist-sdk/src/core/types/ai-provider.js +1 -25
  20. package/dist-sdk/src/core/types/app.d.ts +26 -1
  21. package/dist-sdk/src/engine/build/context.d.ts +58 -0
  22. package/dist-sdk/src/engine/build/context.js +11 -1
  23. package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
  24. package/dist-sdk/src/engine/build/source-context.js +23 -0
  25. package/dist-sdk/src/engine/pull/context.d.ts +15 -0
  26. package/dist-sdk/src/engine/pull/org.d.ts +10 -0
  27. package/dist-sdk/src/engine/pull/org.js +34 -4
  28. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  29. package/dist-sdk/src/engine/tf/index.js +2 -2
  30. package/dist-sdk/src/engine/tf/labels.d.ts +54 -0
  31. package/dist-sdk/src/engine/tf/labels.js +75 -0
  32. package/dist-sdk/src/engine/tf/parse.d.ts +15 -0
  33. package/dist-sdk/src/engine/tf/parse.js +162 -0
  34. package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
  35. package/dist-sdk/src/entities/access-policy/build.js +7 -0
  36. package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
  37. package/dist-sdk/src/entities/access-policy/filter.js +83 -0
  38. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +66 -0
  39. package/dist-sdk/src/entities/access-policy/from-tf.js +187 -0
  40. package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
  41. package/dist-sdk/src/entities/access-policy/module.js +17 -0
  42. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +43 -0
  43. package/dist-sdk/src/entities/access-policy/to-tf.js +164 -0
  44. package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
  45. package/dist-sdk/src/entities/access-policy/types.js +10 -0
  46. package/dist-sdk/src/entities/agent/build.d.ts +2 -0
  47. package/dist-sdk/src/entities/agent/build.js +1 -0
  48. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +38 -3
  49. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +257 -32
  50. package/dist-sdk/src/entities/agent/from-tf.d.ts +29 -9
  51. package/dist-sdk/src/entities/agent/from-tf.js +146 -19
  52. package/dist-sdk/src/entities/agent/index.d.ts +1 -1
  53. package/dist-sdk/src/entities/agent/module.js +14 -4
  54. package/dist-sdk/src/entities/agent/to-tf.d.ts +46 -1
  55. package/dist-sdk/src/entities/agent/to-tf.js +160 -14
  56. package/dist-sdk/src/entities/agent/tools.d.ts +88 -9
  57. package/dist-sdk/src/entities/agent/tools.js +46 -7
  58. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.d.ts +17 -0
  59. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +64 -0
  60. package/dist-sdk/src/entities/agent-a2a-skill/module.d.ts +4 -0
  61. package/dist-sdk/src/entities/agent-a2a-skill/module.js +14 -0
  62. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.d.ts +40 -0
  63. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +47 -0
  64. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +51 -4
  65. package/dist-sdk/src/entities/agent-tool/from-tf.js +131 -35
  66. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +11 -4
  67. package/dist-sdk/src/entities/agent-tool/to-tf.js +176 -30
  68. package/dist-sdk/src/entities/agent-tool/types.d.ts +5 -4
  69. package/dist-sdk/src/entities/agent-tool/types.js +38 -6
  70. package/dist-sdk/src/entities/app/build.d.ts +91 -13
  71. package/dist-sdk/src/entities/app/build.js +63 -5
  72. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +3 -0
  73. package/dist-sdk/src/entities/app/from-tf.d.ts +1 -1
  74. package/dist-sdk/src/entities/app/from-tf.js +32 -22
  75. package/dist-sdk/src/entities/app/index.d.ts +4 -1
  76. package/dist-sdk/src/entities/app/index.js +2 -1
  77. package/dist-sdk/src/entities/app/module.js +10 -2
  78. package/dist-sdk/src/entities/app/to-tf.d.ts +5 -0
  79. package/dist-sdk/src/entities/app/to-tf.js +45 -4
  80. package/dist-sdk/src/entities/automation/build.d.ts +57 -13
  81. package/dist-sdk/src/entities/automation/build.js +62 -42
  82. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +25 -8
  83. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +16 -1
  84. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +206 -47
  85. package/dist-sdk/src/entities/automation/filter.d.ts +37 -3
  86. package/dist-sdk/src/entities/automation/filter.js +54 -3
  87. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -27
  88. package/dist-sdk/src/entities/automation/from-tf.js +1344 -222
  89. package/dist-sdk/src/entities/automation/index.d.ts +4 -0
  90. package/dist-sdk/src/entities/automation/index.js +4 -0
  91. package/dist-sdk/src/entities/automation/module.js +29 -32
  92. package/dist-sdk/src/entities/automation/operators.d.ts +29 -2
  93. package/dist-sdk/src/entities/automation/operators.js +27 -1
  94. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
  95. package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
  96. package/dist-sdk/src/entities/automation/script-code.d.ts +10 -21
  97. package/dist-sdk/src/entities/automation/script-code.js +272 -5
  98. package/dist-sdk/src/entities/automation/tasks.d.ts +125 -19
  99. package/dist-sdk/src/entities/automation/tasks.js +83 -15
  100. package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -29
  101. package/dist-sdk/src/entities/automation/to-tf.js +1291 -230
  102. package/dist-sdk/src/entities/automation/triggers.d.ts +9 -1
  103. package/dist-sdk/src/entities/automation/types.d.ts +29 -4
  104. package/dist-sdk/src/entities/automation/types.js +76 -46
  105. package/dist-sdk/src/entities/element/build.d.ts +44 -13
  106. package/dist-sdk/src/entities/element/build.js +45 -3
  107. package/dist-sdk/src/entities/element/from-tf.d.ts +1 -1
  108. package/dist-sdk/src/entities/element/from-tf.js +28 -14
  109. package/dist-sdk/src/entities/element/index.d.ts +4 -1
  110. package/dist-sdk/src/entities/element/index.js +2 -1
  111. package/dist-sdk/src/entities/element/module.js +4 -1
  112. package/dist-sdk/src/entities/element/to-tf.js +26 -3
  113. package/dist-sdk/src/entities/field/build.d.ts +61 -14
  114. package/dist-sdk/src/entities/field/build.js +10 -0
  115. package/dist-sdk/src/entities/field/calc/runtime.js +4 -0
  116. package/dist-sdk/src/entities/field/from-tf.d.ts +5 -3
  117. package/dist-sdk/src/entities/field/from-tf.js +118 -7
  118. package/dist-sdk/src/entities/field/module.js +3 -2
  119. package/dist-sdk/src/entities/field/to-tf.d.ts +46 -11
  120. package/dist-sdk/src/entities/field/to-tf.js +166 -17
  121. package/dist-sdk/src/entities/field/types.d.ts +26 -0
  122. package/dist-sdk/src/entities/field/types.js +34 -12
  123. package/dist-sdk/src/entities/file-reader/build.d.ts +108 -50
  124. package/dist-sdk/src/entities/file-reader/build.js +23 -23
  125. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
  126. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
  127. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
  128. package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
  129. package/dist-sdk/src/entities/file-reader/index.d.ts +8 -3
  130. package/dist-sdk/src/entities/file-reader/index.js +7 -2
  131. package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
  132. package/dist-sdk/src/entities/file-reader/module.js +115 -0
  133. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
  134. package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
  135. package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
  136. package/dist-sdk/src/entities/file-reader/types.js +30 -0
  137. package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
  138. package/dist-sdk/src/entities/org/ai-provider.js +46 -0
  139. package/dist-sdk/src/entities/org/connector.d.ts +8 -1
  140. package/dist-sdk/src/entities/org/connector.js +12 -14
  141. package/dist-sdk/src/entities/org/group.js +10 -1
  142. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  143. package/dist-sdk/src/entities/org/index.js +1 -0
  144. package/dist-sdk/src/entities/org/user.js +10 -1
  145. package/dist-sdk/src/entities/shared/filters/ast.d.ts +59 -9
  146. package/dist-sdk/src/entities/shared/filters/types.d.ts +1 -1
  147. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
  148. package/dist-sdk/src/entities/shared/tool-field-ref.js +46 -0
  149. package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -1
  150. package/dist-sdk/src/entities/shared/types/field-types.js +9 -0
  151. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +19 -0
  152. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +128 -11
  153. package/dist-sdk/src/entities/skill/from-tf.js +4 -3
  154. package/dist-sdk/src/entities/skill/index.d.ts +1 -1
  155. package/dist-sdk/src/entities/skill/module.js +7 -1
  156. package/dist-sdk/src/entities/skill/to-tf.d.ts +26 -0
  157. package/dist-sdk/src/entities/skill/to-tf.js +65 -4
  158. package/dist-sdk/src/entities/skill/tools.d.ts +37 -8
  159. package/dist-sdk/src/entities/skill/tools.js +43 -1
  160. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +34 -4
  161. package/dist-sdk/src/entities/skill-tool/from-tf.js +128 -18
  162. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +13 -1
  163. package/dist-sdk/src/entities/skill-tool/to-tf.js +164 -25
  164. package/dist-sdk/src/entities/skill-tool/types.d.ts +5 -7
  165. package/dist-sdk/src/entities/skill-tool/types.js +47 -11
  166. package/dist-sdk/src/entities/view/from-tf.d.ts +6 -2
  167. package/dist-sdk/src/entities/view/from-tf.js +11 -9
  168. package/dist-sdk/src/entities/view/to-tf.d.ts +9 -7
  169. package/dist-sdk/src/entities/view/to-tf.js +39 -18
  170. package/dist-sdk/src/entities/view/types.d.ts +1 -1
  171. package/dist-sdk/src/entities/view/types.js +1 -1
  172. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +0 -5
  173. package/dist-sdk/src/graph/deferred-catalog-render.js +1 -20
  174. package/dist-sdk/src/graph/index.d.ts +8 -0
  175. package/dist-sdk/src/graph/index.js +13 -9
  176. package/dist-sdk/src/graph/modules.js +8 -1
  177. package/dist-sdk/src/graph/types.d.ts +98 -4
  178. package/package.json +49 -16
  179. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +0 -76
  180. package/dist-sdk/src/entities/automation/value-ref-tf.js +0 -190
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Which LLM models are valid under each AI provider family. Hand-maintained
3
+ * against the platform's authoritative AiProviderType enum — not derivable
4
+ * from `provider/schema.graphql`'s flat `AiLlmModel` enum, whose naming
5
+ * doesn't cleanly partition by provider (e.g. unprefixed `CLAUDE_4_6_OPUS`
6
+ * is valid under `snowflake` with no per-provider naming convention to lean
7
+ * on). This list WILL drift as the platform ships new models — update it by
8
+ * hand when that happens (a live pull surfacing an unrecognized model is
9
+ * the usual signal), the same cadence as regenerating the live-captured
10
+ * `.hcl` test fixtures.
11
+ *
12
+ * Deepgram/ElevenLab are speech providers (their models are speech-to-text/
13
+ * text-to-speech, a different model space entirely) — left empty, which
14
+ * makes `AiProviderLlmModel<"deepgram" | "elevenlab">` resolve to `never`.
15
+ */
16
+ export type AiProviderType = "anthropic" | "bedrock" | "custom" | "deepgram" | "elevenlab" | "gemini" | "openai" | "snowflake" | "xai" | "managed";
17
+ export declare const AI_PROVIDER_LLM_MODELS: {
18
+ readonly anthropic: readonly ["ANTHROPIC_CLAUDE_4_5_SONNET", "ANTHROPIC_CLAUDE_4_6_SONNET", "ANTHROPIC_CLAUDE_5_SONNET", "ANTHROPIC_CLAUDE_HAIKU_4_5", "ANTHROPIC_CLAUDE_4_6_OPUS", "ANTHROPIC_CLAUDE_4_7_OPUS", "ANTHROPIC_CLAUDE_4_8_OPUS"];
19
+ readonly bedrock: readonly ["BEDROCK_CLAUDE_4_5_SONNET", "BEDROCK_CLAUDE_4_6_SONNET", "BEDROCK_CLAUDE_5_SONNET", "BEDROCK_CLAUDE_4_6_OPUS", "BEDROCK_CLAUDE_4_7_OPUS", "BEDROCK_CLAUDE_4_8_OPUS", "BEDROCK_CLAUDE_HAIKU_4_5", "TITAN_EMBED_V1", "TITAN_EMBED_V2"];
20
+ readonly custom: readonly ["ANTHROPIC_CLAUDE_4_5_SONNET", "ANTHROPIC_CLAUDE_4_6_SONNET", "ANTHROPIC_CLAUDE_5_SONNET", "ANTHROPIC_CLAUDE_HAIKU_4_5", "ANTHROPIC_CLAUDE_4_6_OPUS", "ANTHROPIC_CLAUDE_4_7_OPUS", "ANTHROPIC_CLAUDE_4_8_OPUS", "GPT_5", "GPT_5_MINI", "GPT_5_NANO", "GPT_5_1", "GPT_5_2", "GPT_5_3", "GPT_5_3_CODEX", "GPT_5_4", "GPT_5_4_MINI", "GPT_5_4_NANO", "GPT_5_5", "GPT_5_6_SOL", "GPT_5_6_TERRA", "GPT_5_6_LUNA"];
21
+ readonly deepgram: readonly [];
22
+ readonly elevenlab: readonly [];
23
+ readonly gemini: readonly ["GEMINI_2_0_FLASH", "GEMINI_2_0_FLASH_LITE", "GEMINI_1_5_PRO", "GEMINI_2_5_PRO", "GEMINI_2_5_FLASH", "GEMINI_3_PRO"];
24
+ readonly managed: readonly ["MISTRAL_7B"];
25
+ readonly openai: readonly ["GPT_3_5_TURBO", "GPT_3_5_TURBO_1106", "GPT_4", "GPT_4_TURBO_PREVIEW", "GPT_4_OMNI", "GPT_4_OMNI_MINI", "GPT_4_OMNI_MINI_TTS", "GPT_4_OMNI_TRANSCRIBE", "GPT_4_OMNI_MINI_TRANSCRIBE", "OPEN_AI_O1_MINI", "OPEN_AI_O3_MINI", "GPT_4_1", "GPT_4_1_MINI", "GPT_4_1_NANO", "GPT_5", "GPT_5_MINI", "GPT_5_NANO", "GPT_5_1", "GPT_5_2", "GPT_5_3", "GPT_5_3_CODEX", "GPT_5_4", "GPT_5_4_MINI", "GPT_5_4_NANO", "GPT_5_5", "GPT_5_6_SOL", "GPT_5_6_TERRA", "GPT_5_6_LUNA"];
26
+ readonly snowflake: readonly ["CLAUDE_3_5_SONNET", "CLAUDE_3_7_SONNET", "CLAUDE_4_SONNET", "CLAUDE_4_5_SONNET", "CLAUDE_4_6_SONNET", "CLAUDE_5_SONNET", "CLAUDE_HAIKU_4_5", "CLAUDE_4_OPUS", "CLAUDE_4_6_OPUS", "CLAUDE_4_7_OPUS", "CLAUDE_4_8_OPUS", "DEEPSEEK_R1", "MISTRAL_LARGE", "MISTRAL_LARGE_2", "GEMMA_7B", "JAMBA_INSTRUCT", "MISTRAL_7B", "LLAMA2_70B_CHAT", "LLAMA3_8B", "LLAMA3_70B", "LLAMA3_405B", "LLAMA3_1_8B", "LLAMA3_1_70B", "LLAMA3_2_1B", "LLAMA3_2_3B", "LLAMA3_3_70B", "MIXTRAL_8X7B", "SNOWFLAKE_ARCTIC", "SNOWFLAKE_ARCTIC_M_V1_5", "SNOWFLAKE_ARCTIC_L_V2_0", "REKA_FLASH", "REKA_CORE", "CORTEX_GPT_4_1", "CORTEX_OPEN_AI_O4_MINI", "CORTEX_GPT_5", "CORTEX_GPT_5_MINI", "CORTEX_GPT_5_NANO", "CORTEX_GPT_5_CHAT", "CORTEX_GPT_5_6_SOL", "CORTEX_GPT_5_6_TERRA", "CORTEX_GPT_5_6_LUNA"];
27
+ readonly xai: readonly ["GROK_4_FAST_NON_REASONING", "GROK_4_FAST_REASONING", "GROK_4_1_FAST_NON_REASONING", "GROK_4_1_FAST_REASONING"];
28
+ };
29
+ /** Valid LLM model identifiers for provider type `T` (all types if omitted). `never` for a provider with no LLM models (deepgram/elevenlab today). */
30
+ export type AiProviderLlmModel<T extends AiProviderType = AiProviderType> = (typeof AI_PROVIDER_LLM_MODELS)[T][number];
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Which LLM models are valid under each AI provider family. Hand-maintained
3
+ * against the platform's authoritative AiProviderType enum — not derivable
4
+ * from `provider/schema.graphql`'s flat `AiLlmModel` enum, whose naming
5
+ * doesn't cleanly partition by provider (e.g. unprefixed `CLAUDE_4_6_OPUS`
6
+ * is valid under `snowflake` with no per-provider naming convention to lean
7
+ * on). This list WILL drift as the platform ships new models — update it by
8
+ * hand when that happens (a live pull surfacing an unrecognized model is
9
+ * the usual signal), the same cadence as regenerating the live-captured
10
+ * `.hcl` test fixtures.
11
+ *
12
+ * Deepgram/ElevenLab are speech providers (their models are speech-to-text/
13
+ * text-to-speech, a different model space entirely) — left empty, which
14
+ * makes `AiProviderLlmModel<"deepgram" | "elevenlab">` resolve to `never`.
15
+ */
16
+ export const AI_PROVIDER_LLM_MODELS = {
17
+ anthropic: [
18
+ "ANTHROPIC_CLAUDE_4_5_SONNET", "ANTHROPIC_CLAUDE_4_6_SONNET", "ANTHROPIC_CLAUDE_5_SONNET",
19
+ "ANTHROPIC_CLAUDE_HAIKU_4_5", "ANTHROPIC_CLAUDE_4_6_OPUS", "ANTHROPIC_CLAUDE_4_7_OPUS",
20
+ "ANTHROPIC_CLAUDE_4_8_OPUS",
21
+ ],
22
+ bedrock: [
23
+ "BEDROCK_CLAUDE_4_5_SONNET", "BEDROCK_CLAUDE_4_6_SONNET", "BEDROCK_CLAUDE_5_SONNET",
24
+ "BEDROCK_CLAUDE_4_6_OPUS", "BEDROCK_CLAUDE_4_7_OPUS", "BEDROCK_CLAUDE_4_8_OPUS",
25
+ "BEDROCK_CLAUDE_HAIKU_4_5", "TITAN_EMBED_V1", "TITAN_EMBED_V2",
26
+ ],
27
+ custom: [
28
+ "ANTHROPIC_CLAUDE_4_5_SONNET", "ANTHROPIC_CLAUDE_4_6_SONNET", "ANTHROPIC_CLAUDE_5_SONNET",
29
+ "ANTHROPIC_CLAUDE_HAIKU_4_5", "ANTHROPIC_CLAUDE_4_6_OPUS", "ANTHROPIC_CLAUDE_4_7_OPUS",
30
+ "ANTHROPIC_CLAUDE_4_8_OPUS", "GPT_5", "GPT_5_MINI", "GPT_5_NANO", "GPT_5_1", "GPT_5_2",
31
+ "GPT_5_3", "GPT_5_3_CODEX", "GPT_5_4", "GPT_5_4_MINI", "GPT_5_4_NANO", "GPT_5_5",
32
+ "GPT_5_6_SOL", "GPT_5_6_TERRA", "GPT_5_6_LUNA",
33
+ ],
34
+ deepgram: [],
35
+ elevenlab: [],
36
+ gemini: [
37
+ "GEMINI_2_0_FLASH", "GEMINI_2_0_FLASH_LITE", "GEMINI_1_5_PRO", "GEMINI_2_5_PRO",
38
+ "GEMINI_2_5_FLASH", "GEMINI_3_PRO",
39
+ ],
40
+ managed: ["MISTRAL_7B"],
41
+ openai: [
42
+ "GPT_3_5_TURBO", "GPT_3_5_TURBO_1106", "GPT_4", "GPT_4_TURBO_PREVIEW", "GPT_4_OMNI",
43
+ "GPT_4_OMNI_MINI", "GPT_4_OMNI_MINI_TTS", "GPT_4_OMNI_TRANSCRIBE", "GPT_4_OMNI_MINI_TRANSCRIBE",
44
+ "OPEN_AI_O1_MINI", "OPEN_AI_O3_MINI", "GPT_4_1", "GPT_4_1_MINI", "GPT_4_1_NANO", "GPT_5",
45
+ "GPT_5_MINI", "GPT_5_NANO", "GPT_5_1", "GPT_5_2", "GPT_5_3", "GPT_5_3_CODEX", "GPT_5_4",
46
+ "GPT_5_4_MINI", "GPT_5_4_NANO", "GPT_5_5", "GPT_5_6_SOL", "GPT_5_6_TERRA", "GPT_5_6_LUNA",
47
+ ],
48
+ snowflake: [
49
+ "CLAUDE_3_5_SONNET", "CLAUDE_3_7_SONNET", "CLAUDE_4_SONNET", "CLAUDE_4_5_SONNET",
50
+ "CLAUDE_4_6_SONNET", "CLAUDE_5_SONNET", "CLAUDE_HAIKU_4_5", "CLAUDE_4_OPUS", "CLAUDE_4_6_OPUS",
51
+ "CLAUDE_4_7_OPUS", "CLAUDE_4_8_OPUS", "DEEPSEEK_R1", "MISTRAL_LARGE", "MISTRAL_LARGE_2",
52
+ "GEMMA_7B", "JAMBA_INSTRUCT", "MISTRAL_7B", "LLAMA2_70B_CHAT", "LLAMA3_8B", "LLAMA3_70B",
53
+ "LLAMA3_405B", "LLAMA3_1_8B", "LLAMA3_1_70B", "LLAMA3_2_1B", "LLAMA3_2_3B", "LLAMA3_3_70B",
54
+ "MIXTRAL_8X7B", "SNOWFLAKE_ARCTIC", "SNOWFLAKE_ARCTIC_M_V1_5", "SNOWFLAKE_ARCTIC_L_V2_0",
55
+ "REKA_FLASH", "REKA_CORE", "CORTEX_GPT_4_1", "CORTEX_OPEN_AI_O4_MINI", "CORTEX_GPT_5",
56
+ "CORTEX_GPT_5_MINI", "CORTEX_GPT_5_NANO", "CORTEX_GPT_5_CHAT", "CORTEX_GPT_5_6_SOL",
57
+ "CORTEX_GPT_5_6_TERRA", "CORTEX_GPT_5_6_LUNA",
58
+ ],
59
+ xai: [
60
+ "GROK_4_FAST_NON_REASONING", "GROK_4_FAST_REASONING", "GROK_4_1_FAST_NON_REASONING",
61
+ "GROK_4_1_FAST_REASONING",
62
+ ],
63
+ };
@@ -18,7 +18,37 @@
18
18
  * the object satisfies `CatalogRef`'s structural shape before bag-level stamping;
19
19
  * nothing reads those interim values.
20
20
  */
21
- import type { AgentRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, CloudLinkRef, ConnectorRef, GroupRef, FileReaderCatalogRef, DocumentModelFieldRef, FieldRef, FlowRef, OutputPropertyRef, SearchTableRef, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
21
+ import type { AiProviderLlmModel, AiProviderType } from "./ai-provider-models.js";
22
+ import type { AgentRef, AiProviderRef, ApprovalChainRef, AutomationCatalogRef, CatalogRef, CategoryRef, CloudLinkRef, ConnectorRef, GroupRef, FileReaderCatalogRef, DocumentModelFieldRef, FieldRef, FlowRef, OutputPropertyRef, SearchTableRef, SkillRef, TableColumnRef, TableRef, TriggerParameterRef } from "./types.js";
23
+ /** Fixed platform user-directory schema used by userSearch filters. */
24
+ export declare const usersCatalog: {
25
+ readonly fields: {
26
+ readonly firstName: {
27
+ readonly __kind: "userField";
28
+ readonly refName: "firstName";
29
+ readonly name: "firstName";
30
+ readonly fieldType: "TEXT";
31
+ };
32
+ readonly email: {
33
+ readonly __kind: "userField";
34
+ readonly refName: "email";
35
+ readonly name: "email";
36
+ readonly fieldType: "TEXT";
37
+ };
38
+ readonly jobTitle: {
39
+ readonly __kind: "userField";
40
+ readonly refName: "jobTitle";
41
+ readonly name: "jobTitle";
42
+ readonly fieldType: "TEXT";
43
+ };
44
+ readonly lastName: {
45
+ readonly __kind: "userField";
46
+ readonly refName: "lastName";
47
+ readonly name: "lastName";
48
+ readonly fieldType: "TEXT";
49
+ };
50
+ };
51
+ };
22
52
  /** An app/element catalog's bags: reference-only kinds plus behavioral kinds sourced from authoring files. */
23
53
  interface AppCatalogBags {
24
54
  readonly fields?: Record<string, FieldRef>;
@@ -68,6 +98,7 @@ export declare const triggerParameterRef: <const T extends {
68
98
  export declare function documentModelRef<F extends Readonly<Record<string, DocumentModelFieldRef>> | undefined = undefined>(opts: {
69
99
  readonly name: string;
70
100
  readonly parent?: string;
101
+ readonly readerType: FileReaderCatalogRef["readerType"];
71
102
  readonly fields?: F;
72
103
  }): FileReaderCatalogRef & {
73
104
  readonly fields: F;
@@ -114,6 +145,28 @@ export declare const connectorRef: (opts: Omit<ConnectorRef, "refName" | "__kind
114
145
  readonly __kind: "connector";
115
146
  readonly refName: string;
116
147
  };
148
+ /**
149
+ * AI provider ref — reference only, the provider must already exist on the
150
+ * platform (never created/deployed). Accepts an optional `models` bag whose
151
+ * entries are either connector refs (`connectorRef({ name })`, what `pull
152
+ * org` always emits) or a bare model literal naming a connector to create
153
+ * for that model — type-checked against `type`'s valid models
154
+ * (`AiProviderLlmModel`). `handle` is injected by the enclosing
155
+ * `orgCatalog`, which also stamps each nested ref-shaped model's `.parent`
156
+ * to this provider's own key.
157
+ *
158
+ * A hand-rolled generic (not built through `refFactory`, which fixes its
159
+ * type parameter once at definition time and would widen `type` away from
160
+ * its literal) — same `const T extends ...` trick as {@link fieldRef} so
161
+ * `type: "anthropic"` narrows which models are valid at each call site.
162
+ */
163
+ export declare function defineAiProvider<T extends AiProviderType, M extends Readonly<Record<string, ConnectorRef | AiProviderLlmModel<T>>> | undefined = undefined>(opts: {
164
+ readonly name: string;
165
+ readonly type: T;
166
+ readonly models?: M;
167
+ }): AiProviderRef<T> & {
168
+ readonly models: M;
169
+ };
117
170
  export declare const cloudLinkRef: (opts: Omit<CloudLinkRef, "refName" | "__kind">) => Omit<CloudLinkRef, "refName" | "__kind"> & {
118
171
  readonly __kind: "cloudLink";
119
172
  readonly refName: string;
@@ -171,13 +224,13 @@ export declare function elementCatalog<B extends AppCatalogBags>(identity: {
171
224
  /**
172
225
  * Assemble the org catalog object. Produces `{ handle: "org", name: "Org", ...bags }`.
173
226
  * No `__kind` — the org is not a `CatalogRef` kind and is referenced only as
174
- * a namespace (`org.connectors.X`, `org.cloudLinks.Y`), never passed as a ref.
227
+ * a namespace (`org.aiProviders.X.models.Y`, `org.cloudLinks.Y`), never passed as a ref.
175
228
  * `"org"` is a fixed singleton namespace, not derived from any entity's name —
176
229
  * unlike every other identity in this file, it's not a ref name. Bag entries'
177
230
  * `.handle` are stamped from their own key, same as `appCatalog`.
178
231
  */
179
232
  export declare function orgCatalog<B extends {
180
- connectors?: Record<string, ConnectorRef>;
233
+ aiProviders?: Record<string, AiProviderRef>;
181
234
  cloudLinks?: Record<string, CloudLinkRef>;
182
235
  categories?: Record<string, CategoryRef>;
183
236
  groups?: Record<string, GroupRef>;
@@ -1,3 +1,12 @@
1
+ /** Fixed platform user-directory schema used by userSearch filters. */
2
+ export const usersCatalog = {
3
+ fields: {
4
+ firstName: { __kind: "userField", refName: "firstName", name: "firstName", fieldType: "TEXT" },
5
+ email: { __kind: "userField", refName: "email", name: "email", fieldType: "TEXT" },
6
+ jobTitle: { __kind: "userField", refName: "jobTitle", name: "jobTitle", fieldType: "TEXT" },
7
+ lastName: { __kind: "userField", refName: "lastName", name: "lastName", fieldType: "TEXT" },
8
+ },
9
+ };
1
10
  /** Build a ref-kind factory: no identity parameter, `.refName` defaults to `name` (stamped over by the enclosing bag). */
2
11
  function refFactory(kind) {
3
12
  return (opts) => ({ __kind: kind, refName: opts.name, ...opts });
@@ -39,6 +48,7 @@ export function documentModelRef(opts) {
39
48
  __kind: "documentModel",
40
49
  refName: opts.name,
41
50
  name: opts.name,
51
+ readerType: opts.readerType,
42
52
  ...(opts.parent !== undefined ? { parent: opts.parent } : {}),
43
53
  ...(opts.fields !== undefined ? { fields: opts.fields } : {}),
44
54
  };
@@ -69,6 +79,30 @@ export const flowRef = refFactory("flow");
69
79
  export const approvalChainRef = refFactory("approvalChain");
70
80
  export const searchTableRef = refFactory("searchTable");
71
81
  export const connectorRef = refFactory("connector");
82
+ /**
83
+ * AI provider ref — reference only, the provider must already exist on the
84
+ * platform (never created/deployed). Accepts an optional `models` bag whose
85
+ * entries are either connector refs (`connectorRef({ name })`, what `pull
86
+ * org` always emits) or a bare model literal naming a connector to create
87
+ * for that model — type-checked against `type`'s valid models
88
+ * (`AiProviderLlmModel`). `handle` is injected by the enclosing
89
+ * `orgCatalog`, which also stamps each nested ref-shaped model's `.parent`
90
+ * to this provider's own key.
91
+ *
92
+ * A hand-rolled generic (not built through `refFactory`, which fixes its
93
+ * type parameter once at definition time and would widen `type` away from
94
+ * its literal) — same `const T extends ...` trick as {@link fieldRef} so
95
+ * `type: "anthropic"` narrows which models are valid at each call site.
96
+ */
97
+ export function defineAiProvider(opts) {
98
+ return {
99
+ __kind: "aiProvider",
100
+ refName: opts.name,
101
+ name: opts.name,
102
+ type: opts.type,
103
+ ...(opts.models !== undefined ? { models: opts.models } : {}),
104
+ };
105
+ }
72
106
  export const cloudLinkRef = refFactory("cloudLink");
73
107
  export const categoryRef = refFactory("category");
74
108
  export const groupRef = refFactory("group");
@@ -122,6 +156,22 @@ function withOwnKeyAsHandle(bag, injectParent) {
122
156
  }
123
157
  return out;
124
158
  }
159
+ /**
160
+ * Same as {@link withOwnKeyAsHandle} for a catalog root's `fields` bag, but
161
+ * also stamps `parentKind`/`parentName` (see `FieldRef`'s doc comment) — the
162
+ * two extra facts a cross-app field ref needs to resolve its owner's
163
+ * `data.elementum_app`/`data.elementum_element` lookup that `parent` (a bare
164
+ * refName) alone can't carry.
165
+ */
166
+ function stampFieldRefs(bag, identity, parentKind) {
167
+ if (bag === undefined)
168
+ return undefined;
169
+ const out = {};
170
+ for (const [refName, ref] of Object.entries(bag)) {
171
+ out[refName] = { ...ref, refName, parent: identity.refName, parentKind, parentName: identity.name };
172
+ }
173
+ return out;
174
+ }
125
175
  function stampTableRefs(bag) {
126
176
  if (bag === undefined)
127
177
  return undefined;
@@ -157,7 +207,7 @@ export function appCatalog(identity, bags) {
157
207
  refName: identity.refName,
158
208
  name: identity.name,
159
209
  ...bags,
160
- fields: withOwnKeyAsHandle(bags.fields, identity.refName) ?? {},
210
+ fields: stampFieldRefs(bags.fields, identity, "app") ?? {},
161
211
  searchTables: withOwnKeyAsHandle(bags.searchTables, identity.refName) ?? {},
162
212
  fileReaders: withOwnKeyAsHandle(bags.fileReaders, identity.refName) ?? {},
163
213
  automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
@@ -172,7 +222,7 @@ export function elementCatalog(identity, bags) {
172
222
  refName: identity.refName,
173
223
  name: identity.name,
174
224
  ...bags,
175
- fields: withOwnKeyAsHandle(bags.fields, identity.refName) ?? {},
225
+ fields: stampFieldRefs(bags.fields, identity, "element") ?? {},
176
226
  searchTables: withOwnKeyAsHandle(bags.searchTables, identity.refName) ?? {},
177
227
  fileReaders: withOwnKeyAsHandle(bags.fileReaders, identity.refName) ?? {},
178
228
  automations: withOwnKeyAsHandle(bags.automations, identity.refName) ?? {},
@@ -183,7 +233,7 @@ export function elementCatalog(identity, bags) {
183
233
  /**
184
234
  * Assemble the org catalog object. Produces `{ handle: "org", name: "Org", ...bags }`.
185
235
  * No `__kind` — the org is not a `CatalogRef` kind and is referenced only as
186
- * a namespace (`org.connectors.X`, `org.cloudLinks.Y`), never passed as a ref.
236
+ * a namespace (`org.aiProviders.X.models.Y`, `org.cloudLinks.Y`), never passed as a ref.
187
237
  * `"org"` is a fixed singleton namespace, not derived from any entity's name —
188
238
  * unlike every other identity in this file, it's not a ref name. Bag entries'
189
239
  * `.handle` are stamped from their own key, same as `appCatalog`.
@@ -193,10 +243,39 @@ export function orgCatalog(bags) {
193
243
  handle: "org",
194
244
  name: "Org",
195
245
  ...bags,
196
- connectors: withOwnKeyAsHandle(bags.connectors) ?? {},
246
+ aiProviders: stampAiProviders(bags.aiProviders),
197
247
  cloudLinks: withOwnKeyAsHandle(bags.cloudLinks) ?? {},
198
248
  categories: withOwnKeyAsHandle(bags.categories) ?? {},
199
249
  groups: withOwnKeyAsHandle(bags.groups) ?? {},
200
250
  tables: stampTableRefs(bags.tables) ?? {},
201
251
  };
202
252
  }
253
+ /**
254
+ * Stamp each provider's own `.refName`/`.handle` from its bag key (same as
255
+ * `withOwnKeyAsHandle`), and — since a provider's `models` bag is nested
256
+ * one level deeper than every other org bag — also stamp each ref-shaped
257
+ * model's `.parent` to the owning provider's key, so a connector ref
258
+ * self-describes which provider it came from. A bare model-literal entry
259
+ * (a create-intent, not yet a ref) has nothing to stamp and passes through
260
+ * unchanged — `withOwnKeyAsHandle` can't be reused here since its generic
261
+ * constraint requires every entry to already be a `CatalogRef`.
262
+ */
263
+ function stampAiProviders(bag) {
264
+ const stamped = withOwnKeyAsHandle(bag);
265
+ if (stamped === undefined)
266
+ return {};
267
+ const out = {};
268
+ for (const [providerKey, provider] of Object.entries(stamped)) {
269
+ out[providerKey] = { ...provider, models: stampAiProviderModels(provider.models, providerKey) };
270
+ }
271
+ return out;
272
+ }
273
+ function stampAiProviderModels(models, providerKey) {
274
+ if (models === undefined)
275
+ return {};
276
+ const out = {};
277
+ for (const [modelKey, model] of Object.entries(models)) {
278
+ out[modelKey] = typeof model === "string" ? model : { ...model, refName: modelKey, parent: providerKey };
279
+ }
280
+ return out;
281
+ }
@@ -363,7 +363,12 @@ export async function writeAppCatalogFromAuthoring(appDir, appRefName, appName,
363
363
  fromBags.push(...Object.values(bag));
364
364
  }
365
365
  const flatRefs = dedupeCatalogRefs([...Object.values(fields), ...fromBags, ...extraRefs]);
366
- const source = renderCatalog({ kind: refs.__kind, refName: appRefName, name: appName }, flatRefs);
366
+ // Fields resolve live off the app's own file (see `renderCatalog`'s `ownFile`
367
+ // param) — never baked, so adding/editing/removing a field never requires
368
+ // re-running this writer. `flatRefs`' field entries still flow through
369
+ // (extraRefs/dedupe), but rendering ignores them when `ownFile` is set.
370
+ const ownFile = { importPath: `../${basename(appFile).replace(/\.ts$/, ".js")}`, identifier: `${appRefName}Own` };
371
+ const source = renderCatalog({ kind: refs.__kind, refName: appRefName, name: appName }, flatRefs, undefined, ownFile);
367
372
  const generatedDir = join(appDir, "generated");
368
373
  const catalogPath = join(generatedDir, CATALOG_FILENAME);
369
374
  await mkdir(generatedDir, { recursive: true });
@@ -436,9 +441,21 @@ export async function writeAppCatalog(appDir, appRefName, appName, appFile, impo
436
441
  */
437
442
  export async function regenerateAppCatalogsUnder(pathOrPaths, tenant) {
438
443
  const paths = typeof pathOrPaths === "string" ? [pathOrPaths] : pathOrPaths;
439
- const jiti = authoringJiti();
440
444
  const out = [];
441
445
  for (const file of await listEntityFilesFromPaths(paths, tenant)) {
446
+ // A root app/element file may itself `import catalog from "@catalog"`
447
+ // (e.g. a relation field referencing another workspace entity by
448
+ // token) — without this alias that import fails to resolve and the
449
+ // file is silently skipped below, exactly as if it were broken. Root
450
+ // stream-root files are always `<orgRoot>/apps|elements/<ref>/<ref>.ts`
451
+ // (two directories below the org root), so this derivation is only
452
+ // guaranteed correct for THOSE files — but that's exactly the shape
453
+ // this function's own output depends on; a wrong guess for a deeper
454
+ // own-file child (agents/, skills/, …) is harmless, since such a
455
+ // file's `ref.__kind` is never "app"/"element" and its result is
456
+ // discarded below regardless of whether it loaded at all.
457
+ const orgRoot = dirname(dirname(dirname(file)));
458
+ const jiti = authoringJiti(join(orgRoot, "generated", CATALOG_FILENAME));
442
459
  let mod;
443
460
  try {
444
461
  mod = (await jiti.import(file));
@@ -3,9 +3,10 @@
3
3
  * the typed app catalog. Handles (from `src/handles`) key the fragments; no
4
4
  * ids appear here (identity lives in `src/deploy/state`).
5
5
  */
6
- export { REF_SCOPE, REF_UPDATABLE, type AgentRef, type ApprovalChainRef, type AspectRef, type AutomationCatalogRef, type AutomationRef, type CatalogRef, type CatalogRefKind, type CategoryRef, type CloudLinkRef, type ConnectorRef, type GroupRef, type FileReaderCatalogRef, type DocumentModelFieldRef, type FieldRef, type FlowRef, type OutputPropertyRef, type SearchTableRef, type SkillRef, type TableColumnRef, type TableRef, type TriggerParameterRef, } from "./types.js";
6
+ export { AI_PROVIDER_LLM_MODELS, type AiProviderLlmModel, type AiProviderType } from "./ai-provider-models.js";
7
+ export { REF_SCOPE, REF_UPDATABLE, type AgentRef, type AiProviderRef, type ApprovalChainRef, type AspectRef, type AutomationCatalogRef, type AutomationRef, type CatalogRef, type CatalogRefKind, type CategoryRef, type CloudLinkRef, type ConnectorRef, type GroupRef, type FileReaderCatalogRef, type DocumentModelFieldRef, type FieldRef, type FlowRef, type OutputPropertyRef, type SearchTableRef, type SkillRef, type TableColumnRef, type TableRef, type TriggerParameterRef, USER_FIELD_KEYS, type UserFieldKey, type UserFieldRef, } from "./types.js";
7
8
  export { renderBarrel, renderCatalog, renderFragment, type BarrelEntry, type BarrelRoot, } from "./render.js";
8
9
  export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, type CatalogTarget, } from "./write.js";
9
10
  export { isCatalogToken, slimToken, slimTokens } from "./token.js";
10
11
  export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, type AppAuthoringCatalog, type AppCatalogRegenResult, type ConfiguredEntity, } from "./from-authoring.js";
11
- export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, } from "./factories.js";
12
+ export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
@@ -3,9 +3,10 @@
3
3
  * the typed app catalog. Handles (from `src/handles`) key the fragments; no
4
4
  * ids appear here (identity lives in `src/deploy/state`).
5
5
  */
6
- export { REF_SCOPE, REF_UPDATABLE, } from "./types.js";
6
+ export { AI_PROVIDER_LLM_MODELS } from "./ai-provider-models.js";
7
+ export { REF_SCOPE, REF_UPDATABLE, USER_FIELD_KEYS, } from "./types.js";
7
8
  export { renderBarrel, renderCatalog, renderFragment, } from "./render.js";
8
9
  export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, } from "./write.js";
9
10
  export { isCatalogToken, slimToken, slimTokens } from "./token.js";
10
11
  export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, } from "./from-authoring.js";
11
- export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, } from "./factories.js";
12
+ export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
@@ -1,4 +1,4 @@
1
- import type { OrgExtract } from "../engine/pull/org.js";
1
+ import { type OrgExtract } from "../engine/pull/org.js";
2
2
  export declare function writeOrgCatalogFromExtract(root: string, extract: OrgExtract): Promise<{
3
3
  catalogPath: string;
4
4
  orgPath: string;