@trilogy-data/trilogy-studio-components 0.1.25 → 0.1.26

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 (114) hide show
  1. package/dist/AssetAutoImporter-CBzvBaOt.js +405 -0
  2. package/dist/ChatCreatorModal-CL-jBnc3.js +218 -0
  3. package/dist/ChatModelSelect-Do-VRUFc.js +40 -0
  4. package/dist/{CommunityModels-D7zWnHgG.js → CommunityModels-Cmro0hV3.js} +101 -70
  5. package/dist/{Dashboard-D1ZCTw5r.js → Dashboard-BH9ZwMVJ.js} +8 -8
  6. package/dist/{DashboardCreatorInline-LWvf--2x.js → DashboardCreatorInline-CDU7kLy3.js} +3 -3
  7. package/dist/{DashboardImportSelector-CNxibXlS.js → DashboardImportSelector-DQSvu9T-.js} +1 -1
  8. package/dist/{DashboardMobile-D_m0xv17.js → DashboardMobile-BUPtdN2V.js} +4 -4
  9. package/dist/{Editor-DhsP18KE.js → Editor-DQsYpkwl.js} +6 -6
  10. package/dist/{GlobalChatPanel-DFx9A4yP.js → GlobalChatPanel-DhnOaige.js} +155 -119
  11. package/dist/{IDE-BRMLxTfP.js → IDE-HLa8vybk.js} +9 -9
  12. package/dist/{JobsView-C9PYS6pZ.js → JobsView-B97HBoIE.js} +8 -8
  13. package/dist/{LLMChat-Cqg6pTgC.js → LLMChat-CxJcPLEG.js} +1 -1
  14. package/dist/{LLMView-VkJpP-49.js → LLMView-C1MUf0c2.js} +21 -21
  15. package/dist/{MobileIDE-CHGJoh05.js → MobileIDE-BpqXoaMR.js} +258 -253
  16. package/dist/{ModelCard-D8tKkK9-.js → ModelCard-BhN25jaV.js} +10 -10
  17. package/dist/{ModelCreator-DrxLxeyH.js → ModelCreator-CCdC7EXt.js} +1 -1
  18. package/dist/{ModelView-rAurf9n8.js → ModelView-DUDA_PtZ.js} +3 -3
  19. package/dist/{PageLoading-I6mr-7NB.js → PageLoading-BzniJM0C.js} +622 -619
  20. package/dist/{ResultComponent-_-1qZCfv.js → ResultComponent-CAn_r3BL.js} +3 -3
  21. package/dist/{Results-CQGpFmPQ.js → Results-BJtlwebY.js} +3 -3
  22. package/dist/{SymbolsPane-BpmL___H.js → SymbolsPane-KYSwN9Sv.js} +1 -1
  23. package/dist/{TutorialPage-CZGBRJdq.js → TutorialPage-NRcee6Dx.js} +8 -8
  24. package/dist/{VegaLiteChart-CmkOw6yD.js → VegaLiteChart-D1slfOUY.js} +11227 -11195
  25. package/dist/{WelcomePage-CLKvAvk-.js → WelcomePage-D5mU2x1L.js} +1 -1
  26. package/dist/components/AssetAutoImporter.vue.d.ts.map +1 -1
  27. package/dist/components/TipsCTA.vue.d.ts +1 -1
  28. package/dist/components/VegaLiteChart.vue.d.ts.map +1 -1
  29. package/dist/components/chartHelpers.d.ts +9 -1
  30. package/dist/components/chartHelpers.d.ts.map +1 -1
  31. package/dist/components/chartRenderManager.d.ts +4 -1
  32. package/dist/components/chartRenderManager.d.ts.map +1 -1
  33. package/dist/components/community/AddStoreModal.vue.d.ts +1 -1
  34. package/dist/components/community/AddStoreModal.vue.d.ts.map +1 -1
  35. package/dist/components/community/CommunityModelCard.vue.d.ts.map +1 -1
  36. package/dist/components/editor/Editor.vue.d.ts.map +1 -1
  37. package/dist/components/jobs/JobsAddStoreModal.vue.d.ts.map +1 -1
  38. package/dist/components/llm/ChatCreatorModal.vue.d.ts +17 -1
  39. package/dist/components/llm/ChatCreatorModal.vue.d.ts.map +1 -1
  40. package/dist/components/llm/ChatModelSelect.vue.d.ts +13 -0
  41. package/dist/components/llm/ChatModelSelect.vue.d.ts.map +1 -0
  42. package/dist/components/llm/GlobalChatPanel.vue.d.ts.map +1 -1
  43. package/dist/components/sidebar/CommunityModelList.vue.d.ts +33 -50
  44. package/dist/components/sidebar/CommunityModelList.vue.d.ts.map +1 -1
  45. package/dist/components/sidebar/CommunityModelListItem.vue.d.ts.map +1 -1
  46. package/dist/components/sidebar/EditorList.vue.d.ts +32 -49
  47. package/dist/components/sidebar/EditorList.vue.d.ts.map +1 -1
  48. package/dist/components/sidebar/Sidebar.vue.d.ts +65 -99
  49. package/dist/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  50. package/dist/dashboard.js +52 -52
  51. package/dist/{dashboardStore-CNkWQ4r7.js → dashboardStore-ppM6nGks.js} +33 -33
  52. package/dist/dashboards/layerSpec.d.ts +38 -4
  53. package/dist/dashboards/layerSpec.d.ts.map +1 -1
  54. package/dist/dashboards/lineAreaSpec.d.ts +8 -80
  55. package/dist/dashboards/lineAreaSpec.d.ts.map +1 -1
  56. package/dist/dashboards/mapSpec.d.ts +1 -0
  57. package/dist/dashboards/mapSpec.d.ts.map +1 -1
  58. package/dist/dashboards/spec.d.ts.map +1 -1
  59. package/dist/data/tutorial/documentation.d.ts.map +1 -1
  60. package/dist/data/tutorial/startupScripts.d.ts +3 -0
  61. package/dist/data/tutorial/startupScripts.d.ts.map +1 -0
  62. package/dist/{demoSetup-DiW3ROFQ.js → demoSetup-mwa-RDC6.js} +19 -18
  63. package/dist/{editorRefinementRuntime-C_YmXRy4.js → editorRefinementRuntime-DoP9P5J2.js} +892 -871
  64. package/dist/{editorRefinementToolExecutor-mX8ClQ63.js → editorRefinementToolExecutor-CVY3FA7k.js} +389 -263
  65. package/dist/{editorStore-Ch7k-gse.js → editorStore-BhhmXbi-.js} +230 -183
  66. package/dist/entry.dashboard.d.ts +1 -0
  67. package/dist/entry.dashboard.d.ts.map +1 -1
  68. package/dist/{globalChatRuntime-oMLiPLNC.js → globalChatRuntime-DWZxeS57.js} +13 -13
  69. package/dist/{helpers-DcWCa6bX.js → helpers-BLQAgX3C.js} +17 -16
  70. package/dist/llm/data/constants.d.ts +1 -1
  71. package/dist/llm/data/constants.d.ts.map +1 -1
  72. package/dist/llm/data/trilogySyntax.generated.d.ts +7 -1
  73. package/dist/llm/data/trilogySyntax.generated.d.ts.map +1 -1
  74. package/dist/llm/docsIndex.d.ts.map +1 -1
  75. package/dist/llm/openai.d.ts +2 -1
  76. package/dist/llm/openai.d.ts.map +1 -1
  77. package/dist/{llm-_807I79k.js → llm-BBOVWb-F.js} +7 -5
  78. package/dist/llm.js +3 -3
  79. package/dist/{llmStore-CSzM1IZd.js → llmStore-DJM2JhzY.js} +2 -2
  80. package/dist/{localStorage-CSuYS7QE.js → localStorage-D9uyOFEO.js} +14 -14
  81. package/dist/models/helpers.d.ts.map +1 -1
  82. package/dist/monaco.js +1 -1
  83. package/dist/{reconcile-Bk7M797_.js → reconcile-Dyf4UZmj.js} +1 -1
  84. package/dist/{remoteStoreSync-CLvZJrTK.js → remoteStoreSync-Z-yjlYtI.js} +1 -1
  85. package/dist/remotes/displayHelpers.d.ts.map +1 -1
  86. package/dist/remotes/genericStoreMetadata.d.ts +1 -0
  87. package/dist/remotes/genericStoreMetadata.d.ts.map +1 -1
  88. package/dist/remotes/models.d.ts +37 -5
  89. package/dist/remotes/models.d.ts.map +1 -1
  90. package/dist/remotes/staticStorePresets.d.ts +22 -0
  91. package/dist/remotes/staticStorePresets.d.ts.map +1 -0
  92. package/dist/remotes/storeService.d.ts +25 -4
  93. package/dist/remotes/storeService.d.ts.map +1 -1
  94. package/dist/stores/communityApiStore.d.ts +32 -60
  95. package/dist/stores/communityApiStore.d.ts.map +1 -1
  96. package/dist/stores/connectionStore.d.ts.map +1 -1
  97. package/dist/stores/resolver.d.ts +5 -0
  98. package/dist/stores/resolver.d.ts.map +1 -1
  99. package/dist/stores/urlStore.d.ts +1 -0
  100. package/dist/stores/urlStore.d.ts.map +1 -1
  101. package/dist/{stores-C1wUWiFm.js → stores-BT9hTLny.js} +47 -47
  102. package/dist/stores.js +7 -7
  103. package/dist/trilogy-studio-components.css +1 -1
  104. package/dist/{urlStore-Dgmwx1YI.js → urlStore-52HG6lsX.js} +1 -0
  105. package/dist/{useChatWithTools-GV1ufcqw.js → useChatWithTools-B0HZ_DVh.js} +1 -1
  106. package/dist/{useDashboard-OoBKkkuQ.js → useDashboard-CdSnPe_6.js} +186 -186
  107. package/dist/{useGlobalChatPanel-CIeUyZba.js → useGlobalChatPanel-D_0luajQ.js} +2 -2
  108. package/dist/views/MobileIDE.vue.d.ts.map +1 -1
  109. package/dist/views/TutorialPage.vue.d.ts +32 -49
  110. package/dist/views/TutorialPage.vue.d.ts.map +1 -1
  111. package/dist/views.js +16 -16
  112. package/package.json +1 -1
  113. package/dist/AssetAutoImporter-DfMd_DSk.js +0 -403
  114. package/dist/ChatCreatorModal-BTqY06B6.js +0 -177
@@ -9,6 +9,7 @@ export { default as DashboardDataSelector } from './components/dashboard/Dashboa
9
9
  export { default as DataTable } from './components/DataTable.vue';
10
10
  export { default as MarkdownRenderer } from './components/MarkdownRenderer.vue';
11
11
  export { default as VegaLiteChart } from './components/VegaLiteChart.vue';
12
+ export { configureCartoBasemapKey } from './dashboards/mapSpec';
12
13
  export { useTrilogyCore } from './composables/useTrilogyCore';
13
14
  export { useTrilogyChat } from './composables/useTrilogyChat';
14
15
  export { useCrossFilterEligibility } from './composables/useCrossFilterEligibility';
@@ -1 +1 @@
1
- {"version":3,"file":"entry.dashboard.d.ts","sourceRoot":"","sources":["../entry.dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AACjC,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AACvF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAA;AACrF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAA;AACrF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAA;AACvF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAC3F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAC3F,OAAO,EAAE,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AuC,EAAE,MAAM,gDAAgD,CAAA;AAE7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EACL,oCAAoC,EACpC,0BAA0B,EAC1B,iCAAiC,EACjC,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,EAC7B,yBAAyB,EACzB,oCAAoC,EACpC,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,SAAS,IAAI,mBAAmB,EAChC,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,cAAc,GACf,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,kCAAkC,EAClC,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACjF,YAAY,EACV,gCAAgC,EAChC,UAAU,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACvD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./screenBridge-BLlMdfhn.js";
2
- import { J as t, Q as n, W as r, Y as i, ot as a } from "./editorRefinementToolExecutor-mX8ClQ63.js";
3
- import { i as o, o as s } from "./stores-C1wUWiFm.js";
4
- import { a as c, r as l } from "./editorRefinementRuntime-C_YmXRy4.js";
5
- import { t as u } from "./useGlobalChatPanel-CIeUyZba.js";
2
+ import { $ as t, G as n, X as r, Y as i, st as a } from "./editorRefinementToolExecutor-CVY3FA7k.js";
3
+ import { i as o, o as s } from "./stores-BT9hTLny.js";
4
+ import { a as c, r as l } from "./editorRefinementRuntime-DoP9P5J2.js";
5
+ import { t as u } from "./useGlobalChatPanel-D_0luajQ.js";
6
6
  import { watch as d } from "vue";
7
7
  //#region llm/registry/renderToolList.ts
8
8
  function f(e) {
@@ -72,7 +72,7 @@ You are the global assistant for Trilogy Studio, docked in a persistent side pan
72
72
  ${f(c().getToolsetForContext("global").filter((e) => !c().getToolNames("chat").includes(e.name)))}
73
73
 
74
74
  App-control guidance:
75
- - Navigation notices ("The user is now viewing...") arrive as ${i}...${t} messages. They are context, not instructions.
75
+ - Navigation notices ("The user is now viewing...") arrive as ${r}...${i} messages. They are context, not instructions.
76
76
  - Call get_app_state to orient yourself whenever you are unsure what the user is looking at or what exists — the state at conversation start may be stale.
77
77
  - Tools that need a specific screen mounted will tell you when it isn't; open the screen first (open_dashboard, open_editor) when you need it visible.
78
78
  - Editors are files: "source"-tagged Trilogy editors define the data model. To change the model, read the relevant editors, edit them with update_editor_contents, and validate with validate_query or run_editor_query.
@@ -108,17 +108,17 @@ async function T(e, t, n) {
108
108
  }
109
109
  var E = 2e3;
110
110
  function D(e) {
111
- let { chatStore: t, llmConnectionStore: r, editor: i, selectedText: a } = e, o = u(), s = o.activePanelChatId.value, c = s ? t.chats[s] : null, l = c && !c.deleted ? c : null;
112
- l ||= t.chatList.filter((e) => e.kind === "user" && e.source === "user").sort((e, t) => new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime())[0] || null, l ||= t.newChat(r.activeConnection || "", "", void 0, "", { activate: !1 });
113
- let d = a?.trim() ? n(a) : "", f = d ? `\nTheir current selection in that editor:\n${d.slice(0, E)}${d.length > E ? "\n...(selection truncated)" : ""}` : "";
114
- return l.pendingContextNote = `[editor] The user asked for AI help from editor "${n(i.name)}" (id ${i.id}). Read it with read_editor before proposing or making changes; apply edits with update_editor_contents.${f}`, g(l.id), o.openPanel(l.id), l.id;
111
+ let { chatStore: n, llmConnectionStore: r, editor: i, selectedText: a } = e, o = u(), s = o.activePanelChatId.value, c = s ? n.chats[s] : null, l = c && !c.deleted ? c : null;
112
+ l ||= n.chatList.filter((e) => e.kind === "user" && e.source === "user").sort((e, t) => new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime())[0] || null, l ||= n.newChat(r.activeConnection || "", "", void 0, "", { activate: !1 });
113
+ let d = a?.trim() ? t(a) : "", f = d ? `\nTheir current selection in that editor:\n${d.slice(0, E)}${d.length > E ? "\n...(selection truncated)" : ""}` : "";
114
+ return l.pendingContextNote = `[editor] The user asked for AI help from editor "${t(i.name)}" (id ${i.id}). Read it with read_editor before proposing or making changes; apply edits with update_editor_contents.${f}`, g(l.id), o.openPanel(l.id), l.id;
115
115
  }
116
116
  async function O(a) {
117
117
  let { chatId: l, message: u, chatStore: d, deps: f } = a, p = d.chats[l];
118
118
  if (!p) return;
119
119
  (p.llmConnectionName || f.llmConnectionStore.activeConnection) && p.pendingContextNote && (d.addMessageToChat(l, {
120
120
  role: "user",
121
- content: `${i}${n(p.pendingContextNote)}${t}`,
121
+ content: `${r}${t(p.pendingContextNote)}${i}`,
122
122
  hidden: !0
123
123
  }), p.pendingContextNote = null);
124
124
  let m = c(), h = {
@@ -144,10 +144,10 @@ async function O(a) {
144
144
  error: "No LLM provider available for compaction."
145
145
  };
146
146
  try {
147
- let n = await r(t, p, { focus: e });
148
- return n ? {
147
+ let r = await n(t, p, { focus: e });
148
+ return r ? {
149
149
  success: !0,
150
- message: `Compacted ${n.archivedCount} earlier messages into a summary. The reduced history applies from the next turn.`
150
+ message: `Compacted ${r.archivedCount} earlier messages into a summary. The reduced history applies from the next turn.`
151
151
  } : {
152
152
  success: !0,
153
153
  message: "The conversation is still small — nothing worth compacting yet."
@@ -1,11 +1,11 @@
1
- import { Dt as e, sn as t } from "./editorRefinementToolExecutor-mX8ClQ63.js";
2
- import { D as n, S as r } from "./editorRefinementRuntime-C_YmXRy4.js";
1
+ import { kt as e, ln as t } from "./editorRefinementToolExecutor-CVY3FA7k.js";
2
+ import { D as n, S as r } from "./editorRefinementRuntime-DoP9P5J2.js";
3
3
  import { s as i } from "./base-C8IuZWqY.js";
4
- import { u as a } from "./editorStore-Ch7k-gse.js";
5
- import "./dashboardStore-CNkWQ4r7.js";
6
- import { n as o } from "./reconcile-Bk7M797_.js";
4
+ import { A as a, p as o } from "./editorStore-BhhmXbi-.js";
5
+ import "./dashboardStore-ppM6nGks.js";
6
+ import { n as s } from "./reconcile-Dyf4UZmj.js";
7
7
  //#region models/helpers.ts
8
- var s = class {
8
+ var c = class {
9
9
  editorStore;
10
10
  modelStore;
11
11
  dashboardStore;
@@ -18,12 +18,13 @@ var s = class {
18
18
  async fetchModelImportBase(e, t) {
19
19
  let n = await fetch(e, this.buildRequestInit(t));
20
20
  if (!n.ok) throw Error(`Failed to fetch model import from ${e}: ${n.statusText}`);
21
- let r = await n.text();
21
+ let r = await n.text(), i;
22
22
  try {
23
- return JSON.parse(r);
23
+ i = JSON.parse(r);
24
24
  } catch (t) {
25
25
  throw Error(`Invalid JSON in model import from ${e}: ${t}`);
26
26
  }
27
+ return a(i, e);
27
28
  }
28
29
  purposeToTag(e) {
29
30
  switch (e) {
@@ -81,19 +82,19 @@ var s = class {
81
82
  if (e.name?.trim()) return this.getRemoteEditorPath(e);
82
83
  if (!t) return null;
83
84
  try {
84
- let n = `${a(t)}/`, r = new URL(n), i = new URL(e.url, r);
85
+ let n = `${o(t)}/`, r = new URL(n), i = new URL(e.url, r);
85
86
  if (i.origin !== r.origin || !i.pathname.startsWith(r.pathname)) return null;
86
- let o = i.pathname.slice(r.pathname.length);
87
- return decodeURIComponent(o);
87
+ let a = i.pathname.slice(r.pathname.length);
88
+ return decodeURIComponent(a);
88
89
  } catch {
89
90
  return null;
90
91
  }
91
92
  }
92
93
  createOrUpdateEditor(e, t, n = {}) {
93
- let r = n.remote ? this.resolveRemotePath(e, n.remoteBaseUrl) : null, i = n.remote && r || e.name, a = this.getComponentEditorType(e), s;
94
+ let r = n.remote ? this.resolveRemotePath(e, n.remoteBaseUrl) : null, i = n.remote && r || e.name, a = this.getComponentEditorType(e), o;
94
95
  if (n.remote && n.remoteStoreId) {
95
96
  let c = r || i;
96
- s = o(this.editorStore, {
97
+ o = s(this.editorStore, {
97
98
  id: `remote:${n.remoteStoreId}:${encodeURIComponent(c)}`,
98
99
  name: i,
99
100
  type: a,
@@ -105,9 +106,9 @@ var s = class {
105
106
  });
106
107
  } else {
107
108
  let n = Object.values(this.editorStore.editors).find((e) => e.name === i && e.connection === t && e.storage !== "remote");
108
- n ? (s = n, this.editorStore.setEditorContents(n.id, e.content)) : s = this.editorStore.newEditor(i, a, t, e.content);
109
+ n ? (o = n, this.editorStore.setEditorContents(n.id, e.content)) : o = this.editorStore.newEditor(i, a, t, e.content);
109
110
  }
110
- return e.purpose && !s.tags.includes(e.purpose) && this.editorStore.editors[s.id].tags.push(e.purpose), s;
111
+ return e.purpose && !o.tags.includes(e.purpose) && this.editorStore.editors[o.id].tags.push(e.purpose), o;
111
112
  }
112
113
  createOrUpdateDashboard(t, n, r, a = {}) {
113
114
  if (!t.content) {
@@ -155,4 +156,4 @@ var s = class {
155
156
  }
156
157
  };
157
158
  //#endregion
158
- export { s as t };
159
+ export { c as t };
@@ -1,2 +1,2 @@
1
- export { pytrilogySyntaxVersion, trilogySyntaxReference, rulesInput, aggFunctions, functions, datatypes, } from './trilogySyntax.generated';
1
+ export { pytrilogySyntaxVersion, trilogySyntaxReference, rulesInput, aggFunctions, functions, datatypes, syntaxExamples, } from './trilogySyntax.generated';
2
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../llm/data/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,GACV,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../llm/data/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,cAAc,GACf,MAAM,2BAA2B,CAAA"}
@@ -1,7 +1,13 @@
1
- export declare const pytrilogySyntaxVersion = "0.3.337";
1
+ export declare const pytrilogySyntaxVersion = "0.3.370";
2
2
  export declare const trilogySyntaxReference = "# Trilogy Syntax\n\nTrilogy statements define a semantic model or a query; collections of statements\nare written as `.preql` files. A statement returns data (SELECT) or defines\nconcepts (key | property | auto | metric), datasources, or parameters.\n\nimport <model> as <alias>; makes a model's fields available. <model> is a DOT-SEPARATED MODULE PATH relative to the project root (where trilogy.toml lives), never a file path: the file `raw/store_sales.preql` is imported as `import raw.store_sales as ss;` \u2014 replace each `/` with `.`, drop the `.preql`, keep the folder segment. When an imported model imports others (a fact with imported dimensions), those are dot paths: `enroll.student.name`. Typical usage imports ONE fact and reaches dimensions through it; nested dimensions carry ALL values (order.customers includes customers without orders).\n\nkey | property | auto | metric; define new concepts. `auto x <- ...` is a DEFINITION, not a precomputed value: each reference expands and re-evaluates in the consuming query's scope.\n\nparameter NAME TYPE [default <literal>]; \u2014 a runtime value supplied via `--param NAME=VALUE` (repeatable); append `?` to the type to allow null.\n\n## Combining models\n\n| Goal | Use |\n|---|---|\n| Typical query | no merge, no join: access all fields through dot-paths |\n| Blend two models on shared keys inside one query | scoped `subset\\|union join` |\n| Make a connection universal to a whole file | `merge` |\n| Stack subsets/channels as rows | `union(...)` |\n| Rows in A but never in B (set difference) | `except(...)` |\n| Rows present in every source (set intersection) | `intersect(...)` |\n\n### Query-scoped join\n\nA typical fact already has its dimensions merged in, so no join is needed. Blending fact models or rowset outputs takes a scoped join, placed right after the select list, which DECLARES how the key domains relate: `subset join a = b` (a's values are contained in b's, a \u2286 b; b authoritative for the key) or `union join a = b` (neither contains the other; the key is the coalesce of both sides and unmatched rows from BOTH sides are kept).\n\nTwo rules decide whether the numbers are right, so apply them before reaching for the example:\n\n- Joins NEVER drop a row and NULL keys match null-safely; there is NO inner join. An intersection is an explicit `where <optional-side attr> is not null`.\n- JOIN ON THE FULL GRAIN: `explore` prints each fact's grain as @<k1, k2>; write one clause PER key. Matching only one key of a multi-key grain causes duplication.\n\nChaining, expression keys, union/subset mixing, multi-key and self-pair shapes: trilogy agent-info syntax example scoped-join.\n\nmerge <a> into ~<b>; is the persistent (whole-file) equivalent of `subset join a = b`; plain `merge a into b;` declares EXACT domain equivalence. Standalone statements; prefer a scoped join unless the connection is universal.\n\n### union / except / intersect (row set operations)\n\n`union(...)` row-stacks self-contained select arms positionally (SQL UNION ALL) into one named rowset (`with combined as union((armA), (armB), ...) -> (out1, out2, ...)`); `except(...)` / `intersect(...)` share that arm shape but are SQL SET operators (DISTINCT rows, null-safe whole-row compare, and except subtracts later arms from the FIRST, so arm order matters). Prefer except over a multi-column `not in` for \"in A but never in B\". Each arm dedups to its own output grain BEFORE stacking, so aggregate INSIDE each arm or the total silently undersums. Examples: trilogy agent-info syntax example union-stack-channels / except-intersect-setops.\n\n## Query structure\n\nTop-level statements first (each `;`-terminated), then a query with clauses in this EXACT order \u2014 all optional except select:\n\n```\n<top-level statements>; # import / key / auto / rowset / merge / def / parameter\nwith <name> as # optional: name the select as a reusable rowset (CTE)\nwhere <row condition> # 1. filters INPUT rows, BEFORE aggregation\nselect <col>, <agg> as name, # 2. projection \u2014 grouping is AUTOMATIC by the\n # non-aggregated columns; never write GROUP BY\n subset|union join a = b (= c)? # 3. blend models; one clause per key, right after the select list\nby rollup|cube|grouping sets (...) # 4. optional multi-level grouping for the whole select\nhaving <result condition> # 5. filters aggregated/joined RESULTS\norder by <col> asc|desc # 6. sort\nlimit <n>; # 7. cap rows\n```\n\nA rowset (`with <name> as where ... select ...;`) is a standalone statement, evaluated in isolation \u2014 it does NOT respond to the consuming query's context. All its outputs are namespaced: output `abc.def` of rowset `foo` is referenced as `foo.abc.def`, and joined back like any concept (`subset join foo.key = other.key`). Alias every reused expression with `as`.\n\nFull annotated example: trilogy agent-info syntax example query-structure.\n\n### Not SQL \u2014 what to never write\n\n- **No FROM, GROUP BY, DISTINCT, SELECT \\*, or SQL-style set operators between selects.** Stack rows with `union(...)`; set difference/intersection with `except(...)`/`intersect(...)`; blend fact models with a scoped join.\n- **Grouping is automatic** by the non-aggregated fields in the SELECT \u2014 never write GROUP BY. Aggregates inherit the select's grain wherever they appear (where/select/having). Override per-aggregate with `agg(x) by <dims>`; `by *` aggregates across all data (single row). To weight a related dimension property once per fact row, project it to the fact grain first: `auto row_birth_year <- group(enroll.student.birth_year) by enroll.student_id, enroll.course_id;` then aggregate that.\n- **Output rows are deduplicated to the select grain.** To preserve legitimate duplicates (one row per matching fact), include the fact's grain keys in the select \u2014 hidden with the PREFIX `--` if they shouldn't appear in the output.\n- **Never write `distinct`.** `count(<key>)` is already distinct because keys are unique; `count_distinct(<property>)` counts distinct values of a non-key property.\n- **Count a COMPOSITE grain with `grain(...)`.** `count(grain(order_id, item.id))` counts order+item combinations; `grain(...)` is NEVER NULL. Never count one column of a multi-key grain \u2014 a coarser key counts its own distinct values and undercounts. `count_distinct(a, b)` is accepted as sugar for `count(grain(a, b))` (distinct combinations, NULL members included).\n- **An aggregate over a group with no qualifying rows is NULL, never 0.** `sum(x ? cond) by k` yields NULL for groups where nothing matches, so `= 0` matches nothing. Test emptiness with `count(key ? cond) by k = 0` or wrap: `coalesce(sum(x ? cond), 0)`.\n- **`count(1)` is invalid** \u2014 a constant does not identify rows. Use the row key, `count(grain(...))`, or `sum(1) by <grain>`.\n- **One-column expression subqueries only.** `(select ...)` is allowed where a scalar or membership set is expected (exactly one projected column) \u2014 never as a SQL-style FROM-subquery. For related-entity filters prefer the dot-path: `where enrollments.student.state = 'TN'`, not a subselect.\n- **`--` is a HIDDEN-field prefix, not a comment** (it still changes query structure). Comments use `#` only.\n- **Aliases**: always use the full dot-path (`enroll.student.id`); alias every new expression with `as`; a select alias is usable in `having`/`order by` but NOT inside other select expressions or `where`, and must not rename a field back to an existing concept name.\n\n## Filtering\n\n`where` filters input rows before aggregation; `having` filters results after aggregation/windows. The inline filter `x ? cond` filters the immediate prior expression: `sum(credits ? enrolled = true)`.\n\nAggregates/windows in WHERE do not filter each other's inputs. Use inline filters, or a staged `then where` chain: each `then where` stage's aggregates compute over only the rows passing earlier stages (`where x = 5 then where sum(y) > 10` \u2261 `where x = 5 and sum(y ? x = 5) > 10`). One rule: the SAME cross-row expression cannot gate two different stages \u2014 give one an inline filter.\n\nWindows need all rows in their range: filter AFTER the window (in `having`) rather than in `where` when the window must see the full set.\n\n## Membership (semijoins)\n\n`in` / `not in` cross models without any declared relationship \u2014 the semijoin IS a scoped intersection. The right side is a concept or expression (never a subselect); build computed sets with an inline filter: `auto big_zip <- student.zip ? (count(student.id ? student.honors = true) by student.zip) > 10; ... where school.zip in big_zip`.\n\nMembership is IDENTITY matching, not SQL three-valued logic: NULL matches NULL; the result is always TRUE or FALSE (safe as a projected flag); `not in` is the exact complement (a NULL in the set never empties the result). For strict SQL behavior, add `x is not null`.\n\nA fact model contains ALL dimensional members, so `where students.id not in enroll.student_id` is typically a tautology \u2014 use `where enroll.id is null` instead. Tuple membership `(a, b) in (m.a, m.b)` requires both right-side concepts to resolve to ONE source (model or rowset); to test against a cross-model pair, stage it through a rowset first. Examples: existence-anti-join, staged-membership.\n\n## Aggregation\n\nAn aggregate without an explicit `by` is RESPONSIVE \u2014 its grain is set where it is consumed, not where it is declared (`auto avg_credits <- avg(enroll.credits);` becomes per-department when selected with `enroll.department`). Pin a grain inline: `sum(metric) by dim1, dim2 as name`; `by` accepts bare identifiers or parenthesized expressions: `avg(price) by (substring(phone, 1, 2))`.\n\nMulti-level grouping (`by rollup|cube|grouping sets (...)`) is a clause of the WHOLE select, placed before `having`: it computes every no-explicit-grain aggregate at every level in one pass (`by rollup (d1, d2)` \u2192 leaf, per-d1 subtotal, grand total). `grouping(<field>)` = 1 on rolled-up rows \u2014 use it to label levels rather than testing for NULL. Full detail: trilogy agent-info syntax example rollup.\n\n## Window functions\n\nDefault to windows for self-referential queries (period-over-period, running totals, rank, share of group). SQL-style syntax: `rank(<key>) over (partition by <g> order by <expr> desc)` (`dense_rank`/`row_number` same shape; multi-key `rank(a, b)`); `sum(x) over (partition by g order by t)` for running totals; `lag(<field>, <offset>) over (...)` / `lead(...)` for offsets (default 1). `partition by` is optional and accepts expressions.\n\n## Data types\n\nScalars: `string`, `bytes`, `bool`, `int`, `bigint`, `float`, `double`, `number`, `numeric(p,s)` (alias `decimal`; use for exact money), `date`, `datetime`, `timestamp`, `geography`, `any`. Composites: `array<T>`, `map<K, V>`, `struct<name: T, ...>`, `enum<T>[v1, v2, ...]`. Cast with `::type` or `cast(x as type)`: `\"2020-01-01\"::date`.\n\n`?` after a type marks it nullable (`property user.middle_name string?;`). `~` prefixing a concept marks the reference as a PARTIAL subset of the concept's domain \u2014 on a select item (`~customer.id`) or in `merge a into ~b` (a \u2286 b); it tells the planner this side is not authoritative.\n\n## Expression gotchas\n\n- `x ? cond` binds to a primary \u2014 wrap arithmetic: `(a - b) ? cond`, NOT `a - b ? cond`.\n- `a || b` is NULL if either side is NULL; `concat(...)` skips NULL arguments; `concat_ws(sep, ...)` joins with sep, skipping NULLs.\n- Date parts are unquoted: `date_part(d, year)`, never `'year'`; prefer `year(d)`. `date_diff(start, end, unit)` = end \u2212 start (a shipping lag is `date_diff(sold_date, ship_date, day)`).\n- Zero-argument functions still take parentheses: `current_date()`.\n- Factor repeated calculations into a `def` macro (invoked `@name(...)`) or reusable `auto` concepts.\n\n\nFunctions (the `aggregate` family doubles as the Aggregate Functions list):\naggregate: count|count_distinct|sum|max|min|avg|stddev|variance|array_agg|bool_or|bool_and|any|grouping(<arg1>) ; grouping_id(<arg1>, <arg2>, ..., <argN>)\nstring: concat|concat_strict|concat_ws(<arg1>, <arg2>, ..., <argN>) ; split|strpos|contains|trim|regexp_contains|format_time|parse_time(<arg1>, <arg2>) ; len|lower|upper|ltrim|rtrim|hex(<arg1>) ; substring|replace|regexp_extract|regexp_replace(<arg1>, <arg2>, <arg3>)\ndate/time: date|datetime|timestamp|second|minute|hour|day|day_of_week|week|month|quarter|year|month_name|day_name|unix_to_timestamp(<arg1>) ; date_spine(<arg1>, <arg2>) ; current_date|current_datetime()\n date_part(<arg1>, <arg2>) e.g. date_part('2020-01-01'::date, year)\n date_truncate(<arg1>, <arg2>) e.g. date_trunc('2020-01-01'::date, month)\n date_add(<arg1>, <arg2>, <arg3>) e.g. date_add('2020-01-01'::date, month, 1)\n date_sub(<arg1>, <arg2>, <arg3>) e.g. date_sub('2020-01-01'::date, day, 1)\n date_diff(<arg1>, <arg2>, <arg3>) e.g. date_diff('2020-01-01'::date, '2020-01-02'::date, day)\n current_timestamp() e.g. now()\narray/map/struct: unnest|array_distinct|array_sum|map_keys|map_values(<arg1>) ; struct|array(<arg1>, <arg2>, ..., <argN>) ; array_sort|array_to_string(<arg1>, <arg2>) ; array_transform|array_filter|generate_array(<arg1>, <arg2>, <arg3>)\nmath: mod|round|log|power|hash(<arg1>, <arg2>) ; abs|sqrt|random|floor|ceil(<arg1>)\nconditional/cast: case|simple_case|coalesce|greatest|least(<arg1>, <arg2>, ..., <argN>) ; cast|nullif(<arg1>, <arg2>) ; isnull(<arg1>)\ngeo: geo_from_text|geo_x|geo_y|geo_centroid(<arg1>) ; geo_point|geo_distance(<arg1>, <arg2>) ; geo_transform(<arg1>, <arg2>, <arg3>)\nother: is_not_distinct(<arg1>, <arg2>)\n\nSome types carry trait metadata that adds meaning: 'latitude', 'longitude' and 'currency' are all 'float' with extra semantics.\n\nAdditional syntax examples:\nThese less-common patterns have complete, copy-pasteable examples. Do NOT guess\nthe syntax \u2014 print the full example on demand with\n`trilogy agent-info syntax example <name>`:\n- `python-datasource` - run a local Python script as a datasource: wrap a function in `trilogy.io.run`, which writes the Arrow IPC stream to stdout for you from a table, dataframe, or list of dicts; declare concepts, map script columns in `datasource (...)`, use `grain (...) file `path.py`;`, then reference locally declared concepts WITHOUT the datasource name as a prefix\n- `query-structure` - the exact clause order of a query, and how to define a rowset\n- `chart` - drawing a result rather than tabulating it: `chart layer <type> ( <role> <- <expr> as <name>, ... )` is a STATEMENT that wraps its own query - the bindings ARE the select; layers, roles, scales, reference lines and `from <select>`\n- `filtered-aggregate` - aggregating only the rows matching a condition, and counting rows correctly\n- `row-level-where-vs-having` - choosing between WHERE and HAVING for a threshold condition\n- `nested-aggregate-group-average` - the \"above 1.2x the group norm\" ask: inner `sum(x) by entity, group`, outer `avg(inner) by group`; use WHERE for the comparison when a separate output-only filter must not narrow the benchmark\n- `pivot-columns` - turn distinct values of a dimension into columns with a reusable `def` macro + filtered aggregate\n- `case-when` - `case when <cond> then <val> ... else <val> end` to relabel codes or bucket a measure into a derived value, then group by it\n- `window-period-over-period` - `lead`/`lag` over (order by ...) to compare a row to an offset period; build a scoped set with `<col> ? <cond>` and filter with `in`\n- `union-stack-channels` - stacking several sources/channels together as rows\n- `except-intersect-setops` - set difference or co-occurrence across sources\n- `scoped-join` - blending a second fact model or rowset into one query\n- `existence-anti-join` - keeping or excluding rows by whether a key matches another model\n- `set-intersect-difference` - count tuples present in / absent from other groups via per-group presence flags - the multi-column INTERSECT/EXCEPT idiom\n- `dedup-before-aggregate` - a `rowset <- select <cols>` collapses identical tuples to one row (SELECT-grain group by) before a downstream sum - the `distinct`/UNION substitute\n- `rollup` - subtotals and a grand total in one pass, and labeling the levels\n- `rank-over-rollup` - rank rollup subtotals/leaves with a SINGLE `rank(a,b) over (partition by level, parent ...)` - not separate ranks per level\n- `staged-membership` - filtering a fine-grain query by a set computed at a coarser grain\n- `correlated-exists-via-grouped-counts` - translate `EXISTS other` / `NOT EXISTS other matching` over the same model into two `count(...) by <grain>` compared in `where` (`> 1` = another exists, `= 1` = no other matches) - pin the correlation grain with `by`";
3
3
  export declare const rulesInput = "# Trilogy Syntax\n\nTrilogy statements define a semantic model or a query; collections of statements\nare written as `.preql` files. A statement returns data (SELECT) or defines\nconcepts (key | property | auto | metric), datasources, or parameters.\n\nimport <model> as <alias>; makes a model's fields available. <model> is a DOT-SEPARATED MODULE PATH relative to the project root (where trilogy.toml lives), never a file path: the file `raw/store_sales.preql` is imported as `import raw.store_sales as ss;` \u2014 replace each `/` with `.`, drop the `.preql`, keep the folder segment. When an imported model imports others (a fact with imported dimensions), those are dot paths: `enroll.student.name`. Typical usage imports ONE fact and reaches dimensions through it; nested dimensions carry ALL values (order.customers includes customers without orders).\n\nkey | property | auto | metric; define new concepts. `auto x <- ...` is a DEFINITION, not a precomputed value: each reference expands and re-evaluates in the consuming query's scope.\n\nparameter NAME TYPE [default <literal>]; \u2014 a runtime value supplied via `--param NAME=VALUE` (repeatable); append `?` to the type to allow null.\n\n## Combining models\n\n| Goal | Use |\n|---|---|\n| Typical query | no merge, no join: access all fields through dot-paths |\n| Blend two models on shared keys inside one query | scoped `subset\\|union join` |\n| Make a connection universal to a whole file | `merge` |\n| Stack subsets/channels as rows | `union(...)` |\n| Rows in A but never in B (set difference) | `except(...)` |\n| Rows present in every source (set intersection) | `intersect(...)` |\n\n### Query-scoped join\n\nA typical fact already has its dimensions merged in, so no join is needed. Blending fact models or rowset outputs takes a scoped join, placed right after the select list, which DECLARES how the key domains relate: `subset join a = b` (a's values are contained in b's, a \u2286 b; b authoritative for the key) or `union join a = b` (neither contains the other; the key is the coalesce of both sides and unmatched rows from BOTH sides are kept).\n\nTwo rules decide whether the numbers are right, so apply them before reaching for the example:\n\n- Joins NEVER drop a row and NULL keys match null-safely; there is NO inner join. An intersection is an explicit `where <optional-side attr> is not null`.\n- JOIN ON THE FULL GRAIN: `explore` prints each fact's grain as @<k1, k2>; write one clause PER key. Matching only one key of a multi-key grain causes duplication.\n\nChaining, expression keys, union/subset mixing, multi-key and self-pair shapes: trilogy agent-info syntax example scoped-join.\n\nmerge <a> into ~<b>; is the persistent (whole-file) equivalent of `subset join a = b`; plain `merge a into b;` declares EXACT domain equivalence. Standalone statements; prefer a scoped join unless the connection is universal.\n\n### union / except / intersect (row set operations)\n\n`union(...)` row-stacks self-contained select arms positionally (SQL UNION ALL) into one named rowset (`with combined as union((armA), (armB), ...) -> (out1, out2, ...)`); `except(...)` / `intersect(...)` share that arm shape but are SQL SET operators (DISTINCT rows, null-safe whole-row compare, and except subtracts later arms from the FIRST, so arm order matters). Prefer except over a multi-column `not in` for \"in A but never in B\". Each arm dedups to its own output grain BEFORE stacking, so aggregate INSIDE each arm or the total silently undersums. Examples: trilogy agent-info syntax example union-stack-channels / except-intersect-setops.\n\n## Query structure\n\nTop-level statements first (each `;`-terminated), then a query with clauses in this EXACT order \u2014 all optional except select:\n\n```\n<top-level statements>; # import / key / auto / rowset / merge / def / parameter\nwith <name> as # optional: name the select as a reusable rowset (CTE)\nwhere <row condition> # 1. filters INPUT rows, BEFORE aggregation\nselect <col>, <agg> as name, # 2. projection \u2014 grouping is AUTOMATIC by the\n # non-aggregated columns; never write GROUP BY\n subset|union join a = b (= c)? # 3. blend models; one clause per key, right after the select list\nby rollup|cube|grouping sets (...) # 4. optional multi-level grouping for the whole select\nhaving <result condition> # 5. filters aggregated/joined RESULTS\norder by <col> asc|desc # 6. sort\nlimit <n>; # 7. cap rows\n```\n\nA rowset (`with <name> as where ... select ...;`) is a standalone statement, evaluated in isolation \u2014 it does NOT respond to the consuming query's context. All its outputs are namespaced: output `abc.def` of rowset `foo` is referenced as `foo.abc.def`, and joined back like any concept (`subset join foo.key = other.key`). Alias every reused expression with `as`.\n\nFull annotated example: trilogy agent-info syntax example query-structure.\n\n### Not SQL \u2014 what to never write\n\n- **No FROM, GROUP BY, DISTINCT, SELECT \\*, or SQL-style set operators between selects.** Stack rows with `union(...)`; set difference/intersection with `except(...)`/`intersect(...)`; blend fact models with a scoped join.\n- **Grouping is automatic** by the non-aggregated fields in the SELECT \u2014 never write GROUP BY. Aggregates inherit the select's grain wherever they appear (where/select/having). Override per-aggregate with `agg(x) by <dims>`; `by *` aggregates across all data (single row). To weight a related dimension property once per fact row, project it to the fact grain first: `auto row_birth_year <- group(enroll.student.birth_year) by enroll.student_id, enroll.course_id;` then aggregate that.\n- **Output rows are deduplicated to the select grain.** To preserve legitimate duplicates (one row per matching fact), include the fact's grain keys in the select \u2014 hidden with the PREFIX `--` if they shouldn't appear in the output.\n- **Never write `distinct`.** `count(<key>)` is already distinct because keys are unique; `count_distinct(<property>)` counts distinct values of a non-key property.\n- **Count a COMPOSITE grain with `grain(...)`.** `count(grain(order_id, item.id))` counts order+item combinations; `grain(...)` is NEVER NULL. Never count one column of a multi-key grain \u2014 a coarser key counts its own distinct values and undercounts. `count_distinct(a, b)` is accepted as sugar for `count(grain(a, b))` (distinct combinations, NULL members included).\n- **An aggregate over a group with no qualifying rows is NULL, never 0.** `sum(x ? cond) by k` yields NULL for groups where nothing matches, so `= 0` matches nothing. Test emptiness with `count(key ? cond) by k = 0` or wrap: `coalesce(sum(x ? cond), 0)`.\n- **`count(1)` is invalid** \u2014 a constant does not identify rows. Use the row key, `count(grain(...))`, or `sum(1) by <grain>`.\n- **One-column expression subqueries only.** `(select ...)` is allowed where a scalar or membership set is expected (exactly one projected column) \u2014 never as a SQL-style FROM-subquery. For related-entity filters prefer the dot-path: `where enrollments.student.state = 'TN'`, not a subselect.\n- **`--` is a HIDDEN-field prefix, not a comment** (it still changes query structure). Comments use `#` only.\n- **Aliases**: always use the full dot-path (`enroll.student.id`); alias every new expression with `as`; a select alias is usable in `having`/`order by` but NOT inside other select expressions or `where`, and must not rename a field back to an existing concept name.\n\n## Filtering\n\n`where` filters input rows before aggregation; `having` filters results after aggregation/windows. The inline filter `x ? cond` filters the immediate prior expression: `sum(credits ? enrolled = true)`.\n\nAggregates/windows in WHERE do not filter each other's inputs. Use inline filters, or a staged `then where` chain: each `then where` stage's aggregates compute over only the rows passing earlier stages (`where x = 5 then where sum(y) > 10` \u2261 `where x = 5 and sum(y ? x = 5) > 10`). One rule: the SAME cross-row expression cannot gate two different stages \u2014 give one an inline filter.\n\nWindows need all rows in their range: filter AFTER the window (in `having`) rather than in `where` when the window must see the full set.\n\n## Membership (semijoins)\n\n`in` / `not in` cross models without any declared relationship \u2014 the semijoin IS a scoped intersection. The right side is a concept or expression (never a subselect); build computed sets with an inline filter: `auto big_zip <- student.zip ? (count(student.id ? student.honors = true) by student.zip) > 10; ... where school.zip in big_zip`.\n\nMembership is IDENTITY matching, not SQL three-valued logic: NULL matches NULL; the result is always TRUE or FALSE (safe as a projected flag); `not in` is the exact complement (a NULL in the set never empties the result). For strict SQL behavior, add `x is not null`.\n\nA fact model contains ALL dimensional members, so `where students.id not in enroll.student_id` is typically a tautology \u2014 use `where enroll.id is null` instead. Tuple membership `(a, b) in (m.a, m.b)` requires both right-side concepts to resolve to ONE source (model or rowset); to test against a cross-model pair, stage it through a rowset first. Examples: existence-anti-join, staged-membership.\n\n## Aggregation\n\nAn aggregate without an explicit `by` is RESPONSIVE \u2014 its grain is set where it is consumed, not where it is declared (`auto avg_credits <- avg(enroll.credits);` becomes per-department when selected with `enroll.department`). Pin a grain inline: `sum(metric) by dim1, dim2 as name`; `by` accepts bare identifiers or parenthesized expressions: `avg(price) by (substring(phone, 1, 2))`.\n\nMulti-level grouping (`by rollup|cube|grouping sets (...)`) is a clause of the WHOLE select, placed before `having`: it computes every no-explicit-grain aggregate at every level in one pass (`by rollup (d1, d2)` \u2192 leaf, per-d1 subtotal, grand total). `grouping(<field>)` = 1 on rolled-up rows \u2014 use it to label levels rather than testing for NULL. Full detail: trilogy agent-info syntax example rollup.\n\n## Window functions\n\nDefault to windows for self-referential queries (period-over-period, running totals, rank, share of group). SQL-style syntax: `rank(<key>) over (partition by <g> order by <expr> desc)` (`dense_rank`/`row_number` same shape; multi-key `rank(a, b)`); `sum(x) over (partition by g order by t)` for running totals; `lag(<field>, <offset>) over (...)` / `lead(...)` for offsets (default 1). `partition by` is optional and accepts expressions.\n\n## Data types\n\nScalars: `string`, `bytes`, `bool`, `int`, `bigint`, `float`, `double`, `number`, `numeric(p,s)` (alias `decimal`; use for exact money), `date`, `datetime`, `timestamp`, `geography`, `any`. Composites: `array<T>`, `map<K, V>`, `struct<name: T, ...>`, `enum<T>[v1, v2, ...]`. Cast with `::type` or `cast(x as type)`: `\"2020-01-01\"::date`.\n\n`?` after a type marks it nullable (`property user.middle_name string?;`). `~` prefixing a concept marks the reference as a PARTIAL subset of the concept's domain \u2014 on a select item (`~customer.id`) or in `merge a into ~b` (a \u2286 b); it tells the planner this side is not authoritative.\n\n## Expression gotchas\n\n- `x ? cond` binds to a primary \u2014 wrap arithmetic: `(a - b) ? cond`, NOT `a - b ? cond`.\n- `a || b` is NULL if either side is NULL; `concat(...)` skips NULL arguments; `concat_ws(sep, ...)` joins with sep, skipping NULLs.\n- Date parts are unquoted: `date_part(d, year)`, never `'year'`; prefer `year(d)`. `date_diff(start, end, unit)` = end \u2212 start (a shipping lag is `date_diff(sold_date, ship_date, day)`).\n- Zero-argument functions still take parentheses: `current_date()`.\n- Factor repeated calculations into a `def` macro (invoked `@name(...)`) or reusable `auto` concepts.";
4
4
  export declare const aggFunctions: string[];
5
5
  export declare const functions: string[];
6
6
  export declare const datatypes: string[];
7
+ export declare const syntaxExamples: {
8
+ name: string;
9
+ title: string;
10
+ summary: string;
11
+ body: string;
12
+ }[];
7
13
  //# sourceMappingURL=trilogySyntax.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trilogySyntax.generated.d.ts","sourceRoot":"","sources":["../../../llm/data/trilogySyntax.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,YAAY,CAAA;AAC/C,eAAO,MAAM,sBAAsB,mjhBAA27gB,CAAA;AAC99gB,eAAO,MAAM,UAAU,+vXAA4oX,CAAA;AACnqX,eAAO,MAAM,YAAY,UAExB,CAAA;AACD,eAAO,MAAM,SAAS,UAerB,CAAA;AACD,eAAO,MAAM,SAAS,UAsBrB,CAAA"}
1
+ {"version":3,"file":"trilogySyntax.generated.d.ts","sourceRoot":"","sources":["../../../llm/data/trilogySyntax.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,YAAY,CAAA;AAC/C,eAAO,MAAM,sBAAsB,mjhBAA27gB,CAAA;AAC99gB,eAAO,MAAM,UAAU,+vXAA4oX,CAAA;AACnqX,eAAO,MAAM,YAAY,UAExB,CAAA;AACD,eAAO,MAAM,SAAS,UAerB,CAAA;AACD,eAAO,MAAM,SAAS,UAsBrB,CAAA;AACD,eAAO,MAAM,cAAc;;;;;GAmH1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"docsIndex.d.ts","sourceRoot":"","sources":["../../llm/docsIndex.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ;IACvB,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,KAAK,GAAG,UAAU,GAAG,UAAU,CAAA;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,QAAQ,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AA0CD,wBAAgB,cAAc,IAAI,QAAQ,EAAE,CA4C3C;AA2CD,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAAO,GACrD,SAAS,EAAE,CAYb;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC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,IAAI,IAAI,CAE7C"}
@@ -16,6 +16,7 @@ export declare function parseOpenAIModelVersion(model: string): {
16
16
  */
17
17
  export declare function compareOpenAIModels(a: string, b: string): number;
18
18
  export declare class OpenAIProvider extends LLMProvider {
19
+ static readonly DEFAULT_MODEL = "gpt-6-luna";
19
20
  private baseCompletionUrl;
20
21
  private baseModelUrl;
21
22
  models: string[];
@@ -37,7 +38,7 @@ export declare class OpenAIProvider extends LLMProvider {
37
38
  static filterModels(models: string[]): string[];
38
39
  /**
39
40
  * Get the default model to use for OpenAI.
40
- * Returns the latest gpt-X.y model (not mini or other variants).
41
+ * Prefer GPT-6 Luna, falling back to the latest non-variant model when unavailable.
41
42
  * @param models - Array of model IDs (already filtered)
42
43
  * @returns The default model ID to use
43
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../llm/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAe,MAAM,QAAQ,CAAA;AACrF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3D;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAoBxE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CA6BhE;AAED,qBAAa,cAAe,SAAQ,WAAW;IAC7C,OAAO,CAAC,iBAAiB,CAAgD;IACzE,OAAO,CAAC,YAAY,CAA6C;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,IAAI,EAAE,MAAM,CAAW;IAC9B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C,OAAO,CAAC,iBAAiB,CAAgD;IACzE,OAAO,CAAC,YAAY,CAA6C;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,IAAI,EAAE,MAAM,CAAW;IAC9B,OAAO,CAAC,YAAY,CAAc;gBAGhC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,OAAe,EAC/B,YAAY,CAAC,EAAE,YAAY;IAiB7B;;;OAGG;WACU,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAY/D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BtB,kBAAkB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,UAAU,EAAE,GAAG,IAAW,GAClC,OAAO,CAAC,WAAW,CAAC;IA2JvB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAS/C;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM;CAYjD"}
@@ -1,5 +1,5 @@
1
1
  import { r as e, t } from "./rolldown-runtime-Dqa2HsxW.js";
2
- import "./editorRefinementToolExecutor-mX8ClQ63.js";
2
+ import "./editorRefinementToolExecutor-CVY3FA7k.js";
3
3
  //#region llm/base.ts
4
4
  function n(e) {
5
5
  return typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.floor(e)) : null;
@@ -494,6 +494,7 @@ function v(e, t) {
494
494
  return o === (r.variant !== null) ? 0 : o ? 1 : -1;
495
495
  }
496
496
  var y = class e extends r {
497
+ static DEFAULT_MODEL = "gpt-6-luna";
497
498
  baseCompletionUrl = "https://api.openai.com/v1/responses";
498
499
  baseModelUrl = "https://api.openai.com/v1/models";
499
500
  models;
@@ -628,12 +629,13 @@ var y = class e extends r {
628
629
  return t !== null && t.major >= 5;
629
630
  }).sort(v);
630
631
  }
631
- static getDefaultModel(e) {
632
- let t = [...e].sort(v);
633
- return t.find((e) => {
632
+ static getDefaultModel(t) {
633
+ if (t.includes(e.DEFAULT_MODEL)) return e.DEFAULT_MODEL;
634
+ let n = [...t].sort(v);
635
+ return n.find((e) => {
634
636
  let t = _(e);
635
637
  return t !== null && t.variant === null;
636
- }) || t[0] || "";
638
+ }) || n[0] || "";
637
639
  }
638
640
  }, b = "fable|mythos|opus|sonnet|haiku";
639
641
  function x(e) {
package/dist/llm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as e, Ct as t, G as n, K as r, Tt as i, U as a, W as o, Z as s, at as c, bt as l, et as u, gt as d, ht as f, it as p, mt as m, nt as h, ot as g, q as _, st as v, t as y, tt as b, wt as x, z as S } from "./editorRefinementToolExecutor-mX8ClQ63.js";
2
- import { a as C, c as w, i as T, n as E, o as D, r as O, t as k } from "./llm-_807I79k.js";
1
+ import { B as e, Dt as t, Et as n, G as r, J as i, K as a, Q as o, St as s, Tt as c, V as l, W as u, _t as d, at as f, ct as p, gt as m, ht as h, nt as g, ot as _, q as v, rt as y, st as b, t as x, tt as S } from "./editorRefinementToolExecutor-CVY3FA7k.js";
2
+ import { a as C, c as w, i as T, n as E, o as D, r as O, t as k } from "./llm-BBOVWb-F.js";
3
3
  import { n as A, t as j } from "./chatHelpers-F_woEbYF.js";
4
- export { O as AnthropicProvider, p as CHAT_TOOLS, l as DEFAULT_COMPACTION_THRESHOLD_TOKENS, a as DEFAULT_KEEP_RECENT_TOKENS, k as DeepSeekProvider, C as DemoProvider, S as EDITOR_REFINEMENT_TOOLS, y as EditorRefinementToolExecutor, E as GoogleProvider, t as KEY_PLACEHOLDERS, w as LLMProvider, T as OpenAIProvider, D as OpenRouterProvider, x as PROVIDERS, i as PROVIDER_LABELS, c as RETURN_TO_USER_TOOL, g as buildChatAgentSystemPrompt, v as buildCustomTrilogyPrompt, e as buildEditorRefinementPrompt, o as compactChat, n as compactHistory, j as createChatNamePrompt, m as createDashboardPrompt, f as createFilterPrompt, d as createPrompt, u as estimateHistoryTokens, b as estimateMessageTokens, h as estimateTextTokens, A as extractChatName, r as maybeCompactChat, s as runToolLoop, _ as shouldCompact };
4
+ export { O as AnthropicProvider, f as CHAT_TOOLS, s as DEFAULT_COMPACTION_THRESHOLD_TOKENS, u as DEFAULT_KEEP_RECENT_TOKENS, k as DeepSeekProvider, C as DemoProvider, e as EDITOR_REFINEMENT_TOOLS, x as EditorRefinementToolExecutor, E as GoogleProvider, c as KEY_PLACEHOLDERS, w as LLMProvider, T as OpenAIProvider, D as OpenRouterProvider, n as PROVIDERS, t as PROVIDER_LABELS, _ as RETURN_TO_USER_TOOL, b as buildChatAgentSystemPrompt, p as buildCustomTrilogyPrompt, l as buildEditorRefinementPrompt, r as compactChat, a as compactHistory, j as createChatNamePrompt, h as createDashboardPrompt, m as createFilterPrompt, d as createPrompt, S as estimateHistoryTokens, g as estimateMessageTokens, y as estimateTextTokens, A as extractChatName, v as maybeCompactChat, o as runToolLoop, i as shouldCompact };
@@ -1,5 +1,5 @@
1
- import { gt as e, ht as t, mt as n } from "./editorRefinementToolExecutor-mX8ClQ63.js";
2
- import { a as r, i, n as a, o, r as s, t as c } from "./llm-_807I79k.js";
1
+ import { _t as e, gt as t, ht as n } from "./editorRefinementToolExecutor-CVY3FA7k.js";
2
+ import { a as r, i, n as a, o, r as s, t as c } from "./llm-BBOVWb-F.js";
3
3
  import { n as l, t as u } from "./chatHelpers-F_woEbYF.js";
4
4
  import { defineStore as d } from "pinia";
5
5
  //#region stores/llmStore.ts
@@ -1,10 +1,10 @@
1
- import { Dt as e, I as t, on as n } from "./editorRefinementToolExecutor-mX8ClQ63.js";
2
- import { s as r } from "./stores-C1wUWiFm.js";
3
- import { x as i } from "./editorRefinementRuntime-C_YmXRy4.js";
1
+ import { L as e, cn as t, kt as n } from "./editorRefinementToolExecutor-CVY3FA7k.js";
2
+ import { s as r } from "./stores-BT9hTLny.js";
3
+ import { x as i } from "./editorRefinementRuntime-DoP9P5J2.js";
4
4
  import { r as a, t as o } from "./connections-CJSb1TZl.js";
5
5
  import { a as s, o as c, s as l, t as u } from "./remoteWorker-Dkv3TJ0j.js";
6
- import { O as d } from "./editorStore-Ch7k-gse.js";
7
- import { a as f, i as p, n as m, o as h, r as g, t as _ } from "./llm-_807I79k.js";
6
+ import { M as d } from "./editorStore-BhhmXbi-.js";
7
+ import { a as f, i as p, n as m, o as h, r as g, t as _ } from "./llm-BBOVWb-F.js";
8
8
  import { reactive as v } from "vue";
9
9
  //#region data/idbKv.ts
10
10
  var y = "trilogy-studio", b = "kv", x = 1, S = null, C = /* @__PURE__ */ new Map();
@@ -173,9 +173,9 @@ var M = [
173
173
  t[e] && (t[e].deleted = !0, this.saveConnections(Object.values(t)));
174
174
  }
175
175
  async loadModelConfig() {
176
- let e = await this.readIdb(this.modelStorageKey), t = e ? JSON.parse(e) : [], r = {};
177
- return t.forEach((e) => {
178
- r[e.name] = v(n.fromJSON(e));
176
+ let e = await this.readIdb(this.modelStorageKey), n = e ? JSON.parse(e) : [], r = {};
177
+ return n.forEach((e) => {
178
+ r[e.name] = v(t.fromJSON(e));
179
179
  }), r;
180
180
  }
181
181
  async saveModelConfig(e) {
@@ -243,8 +243,8 @@ var M = [
243
243
  }), await this.writeIdb(this.dashboardStorageKey, JSON.stringify(Object.values(t).map((e) => e.serialize())));
244
244
  }
245
245
  async loadDashboards() {
246
- let t = await this.readIdb(this.dashboardStorageKey);
247
- return (t ? JSON.parse(t) : []).reduce((t, n) => (e && typeof e.fromSerialized == "function" ? t[n.id] = v(e.fromSerialized(n)) : t[n.id] = v(n), t[n.id].storage = "local", t), {});
246
+ let e = await this.readIdb(this.dashboardStorageKey);
247
+ return (e ? JSON.parse(e) : []).reduce((e, t) => (n && typeof n.fromSerialized == "function" ? e[t.id] = v(n.fromSerialized(t)) : e[t.id] = v(t), e[t.id].storage = "local", e), {});
248
248
  }
249
249
  async deleteDashboard(e) {
250
250
  let t = await this.loadDashboards();
@@ -263,10 +263,10 @@ var M = [
263
263
  }), await this.writeIdb(this.chatStorageKey, JSON.stringify(Object.values(t).map((e) => e.serialize())));
264
264
  }
265
265
  async loadChats() {
266
- let e = await this.readIdb(this.chatStorageKey);
267
- return (e ? JSON.parse(e) : []).reduce((e, n) => {
268
- let r = t.fromSerialized(n);
269
- return e[r.id] = v(r), e[r.id].storage = "local", e;
266
+ let t = await this.readIdb(this.chatStorageKey);
267
+ return (t ? JSON.parse(t) : []).reduce((t, n) => {
268
+ let r = e.fromSerialized(n);
269
+ return t[r.id] = v(r), t[r.id].storage = "local", t;
270
270
  }, {});
271
271
  }
272
272
  async deleteChat(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../models/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,YAAY,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,E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,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAgBpF;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;OAIG;IACU,iBAAiB,CAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,EAAE,CAAC;IAuC3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,oBAAoB;IAoD5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAuE/B;;;;;;OAMG;IACU,WAAW,CACtB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;CA+DhC"}
package/dist/monaco.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./editorStore-Ch7k-gse.js";
1
+ import { t as e } from "./editorStore-BhhmXbi-.js";
2
2
  import { a as t, c as n, i as r, l as i, o as a, r as o, s } from "./vocabulary-CKLGILtR.js";
3
3
  import { o as c, u as l } from "./editor.api2-ClD5pp8H.js";
4
4
  import "./editor.main-Cl8i7rHY.js";
@@ -1,4 +1,4 @@
1
- import { x as e } from "./editorRefinementRuntime-C_YmXRy4.js";
1
+ import { x as e } from "./editorRefinementRuntime-DoP9P5J2.js";
2
2
  import { reactive as t } from "vue";
3
3
  //#region editors/reconcile.ts
4
4
  var n = (e, t, n) => Object.values(e).filter((e) => e.storage === "remote" && e.remoteStoreId === t && e.remotePath === n), r = (r, i) => {
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { t } from "./ModalDialog-D1EOG4rl.js";
3
- import { n } from "./reconcile-Bk7M797_.js";
3
+ import { n } from "./reconcile-Dyf4UZmj.js";
4
4
  import { createBlock as r, createElementVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, withCtx as c } from "vue";
5
5
  //#region components/ConfirmDialog.vue?vue&type=script&setup=true&lang.ts
6
6
  var l = { class: "confirm-message" }, u = ["data-testid"], d = ["data-testid", "disabled"], f = /*#__PURE__*/ e(/* @__PURE__ */ a({
@@ -1 +1 @@
1
- {"version":3,"file":"displayHelpers.d.ts","sourceRoot":"","sources":["../../remotes/displayHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,iBAAiB,EAC9B,SAAQ,aAAa,EAAO,EAC5B,eAAc,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAM,KAC7C,QAAQ,EAuEV,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,SAAS,KAAG,MAEtD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,EAAE,QAAQ,MAAM,KAAG,MAGxE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,SAAS,EACpB,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,MAGF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,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;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,SAAS,KAAG,MAEtD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,EAAE,QAAQ,MAAM,KAAG,MAGxE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,SAAS,EACpB,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,MAGF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAQ,aAAa,EAAO,EAC5B,eAAc,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAM,KAC7C,MAAM,EAuBR,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,QAAQ,EACd,cAAa,MAAW,EACxB,iBAAgB,MAAW,EAC3B,eAAc,KAAK,GAAG,UAAU,GAAG,cAAsB,EACzD,gBAAe,CAAC,IAAI,EAAE,MAAM,KAAK,OAAqB,KACrD,OAyBF,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,QAAQ,EAAE,EAChB,cAAa,MAAW,EACxB,iBAAgB,MAAW,EAC3B,eAAc,KAAK,GAAG,UAAU,GAAG,cAAsB,EACzD,gBAAe,CAAC,IAAI,EAAE,MAAM,KAAK,OAAqB,KACrD,QAAQ,EA0CV,CAAA"}
@@ -2,6 +2,7 @@ import { GenericModelStore } from './models';
2
2
  export declare const normalizeGenericStoreBaseUrl: (baseUrl: string) => string;
3
3
  export declare const buildGenericStoreId: (baseUrl: string) => string;
4
4
  export declare const buildGenericStoreFallbackName: (baseUrl: string) => string;
5
+ export declare const buildGenericStore: (baseUrl: string, name?: string, token?: string) => GenericModelStore;
5
6
  export declare const buildGenericStoreResourceName: (store: GenericModelStore) => string;
6
7
  export declare const buildGenericStoreConnectionName: (store: GenericModelStore) => string;
7
8
  export declare const buildGenericStoreModelName: (store: GenericModelStore) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"genericStoreMetadata.d.ts","sourceRoot":"","sources":["../../remotes/genericStoreMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQjD,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,KAAG,MAAoC,CAAA;AAEnG,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,MAG9B,CAAA;AAExB,eAAO,MAAM,6BAA6B,GAAI,SAAS,MAAM,KAAG,MAO/D,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,OAAO,iBAAiB,KAAG,MACI,CAAA;AAM7E,eAAO,MAAM,+BAA+B,GAAI,OAAO,iBAAiB,KAAG,MACrB,CAAA;AAEtD,eAAO,MAAM,0BAA0B,GAAI,OAAO,iBAAiB,KAAG,MAChC,CAAA"}
1
+ {"version":3,"file":"genericStoreMetadata.d.ts","sourceRoot":"","sources":["../../remotes/genericStoreMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAQjD,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,KAAG,MAAoC,CAAA;AAEnG,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,MAG9B,CAAA;AAExB,eAAO,MAAM,6BAA6B,GAAI,SAAS,MAAM,KAAG,MAO/D,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,SAAS,MAAM,EACf,OAAO,MAAM,EACb,QAAQ,MAAM,KACb,iBASF,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,OAAO,iBAAiB,KAAG,MACI,CAAA;AAM7E,eAAO,MAAM,+BAA+B,GAAI,OAAO,iBAAiB,KAAG,MACrB,CAAA;AAEtD,eAAO,MAAM,0BAA0B,GAAI,OAAO,iBAAiB,KAAG,MAChC,CAAA"}
@@ -1,20 +1,34 @@
1
+ export type ModelStoreType = 'static' | 'generic';
1
2
  export interface ModelStore {
2
- type: 'github' | 'generic';
3
+ type: ModelStoreType;
3
4
  name: string;
4
5
  id: string;
5
6
  }
6
- export interface GithubModelStore extends ModelStore {
7
- type: 'github';
7
+ export interface GithubStoreOrigin {
8
+ kind: 'github';
8
9
  owner: string;
9
10
  repo: string;
10
11
  branch: string;
11
12
  }
13
+ export interface StaticModelStore extends ModelStore {
14
+ type: 'static';
15
+ baseUrl: string;
16
+ origin?: GithubStoreOrigin;
17
+ }
12
18
  export interface GenericModelStore extends ModelStore {
13
19
  type: 'generic';
14
20
  baseUrl: string;
15
21
  token?: string;
16
22
  }
17
- export type AnyModelStore = GithubModelStore | GenericModelStore;
23
+ export type AnyModelStore = StaticModelStore | GenericModelStore;
24
+ export interface LegacyGithubModelStore {
25
+ type: 'github';
26
+ id: string;
27
+ name: string;
28
+ owner: string;
29
+ repo: string;
30
+ branch: string;
31
+ }
18
32
  export interface ModelRoot {
19
33
  owner: string;
20
34
  repo: string;
@@ -53,5 +67,23 @@ export interface StoreIndex {
53
67
  startup_scripts?: string[];
54
68
  }
55
69
  export declare const DEFAULT_MODEL_ROOT: ModelRoot;
56
- export declare const DEFAULT_GITHUB_STORE: GithubModelStore;
70
+ export interface StaticStoreModelRef {
71
+ name: string;
72
+ url: string;
73
+ engine?: string;
74
+ description?: string;
75
+ tags?: string[];
76
+ }
77
+ export interface StaticStoreIndex {
78
+ contract?: {
79
+ kind: 'static';
80
+ version: number;
81
+ };
82
+ name?: string;
83
+ updated_at?: string;
84
+ generation?: number;
85
+ models: StaticStoreModelRef[];
86
+ connection?: StoreConnectionSpec | null;
87
+ }
88
+ export declare const DEFAULT_STATIC_STORE: StaticModelStore;
57
89
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../remotes/models.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,M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AAA;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACvC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;KACZ,EAAE,CAAA;IAIH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B;AAGD,eAAO,MAAM,kBAAkB,EAAE,SAKhC,CAAA;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IAEX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,mBAAmB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACxC;AAID,eAAO,MAAM,oBAAoB,EAAE,gBAWlC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { AnyModelStore, LegacyGithubModelStore, StaticModelStore } from './models';
2
+ /**
3
+ * Where a GitHub repository's `studio/` catalog is served from. The canonical
4
+ * repo goes through GitHub Pages; anything else through raw.githubusercontent,
5
+ * which serves the same bytes with CORS `*` and no API rate limit. Public
6
+ * repositories only — no auth is sent.
7
+ */
8
+ export declare const githubBaseUrl: (owner: string, repo: string, branch: string) => string;
9
+ export declare const buildGithubStoreId: (owner: string, repo: string, branch: string) => string;
10
+ export declare const buildGithubStaticStore: (owner: string, repo: string, branch: string, name?: string) => StaticModelStore;
11
+ export declare const buildUrlStaticStore: (baseUrl: string, name?: string) => StaticModelStore;
12
+ /**
13
+ * Upgrade a persisted store row to the current shape. `github` rows become
14
+ * `static` stores with a derived baseUrl and their id preserved, so anything
15
+ * keyed by `store.id` keeps resolving. Rows of an unknown type are dropped.
16
+ */
17
+ export declare const migrateLegacyStore: (persisted: AnyModelStore | LegacyGithubModelStore | {
18
+ type?: unknown;
19
+ }) => AnyModelStore | null;
20
+ /** Short human label for where a store's files come from. */
21
+ export declare const describeStoreOrigin: (store: AnyModelStore) => string;
22
+ //# sourceMappingURL=staticStorePresets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staticStorePresets.d.ts","sourceRoot":"","sources":["../../remotes/staticStorePresets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,UAAU,CAAA;AAUjB;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAK3E,CAAA;AAID,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MACnD,CAAA;AAE9B,eAAO,MAAM,sBAAsB,GACjC,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,OAAO,MAAM,KACZ,gBASF,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,KAAG,gBAQpE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,WAAW,aAAa,GAAG,sBAAsB,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,KACrE,aAAa,GAAG,IAalB,CAAA;AAED,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,KAAG,MAS1D,CAAA"}