@elevasis/ui 2.31.0 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/{CoreAuthKitInner-KSEGSB67.js → CoreAuthKitInner-QC62UHTZ.js} +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/app/index.css +38 -0
  4. package/dist/app/index.d.ts +69 -9
  5. package/dist/app/index.js +7 -6
  6. package/dist/auth/context.js +1 -1
  7. package/dist/auth/index.js +1 -1
  8. package/dist/charts/index.js +5 -6
  9. package/dist/{chunk-JKSUN5GN.js → chunk-2GMF5IRF.js} +81 -746
  10. package/dist/{chunk-XQHZBA65.js → chunk-2RJMVWFJ.js} +1 -6
  11. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  12. package/dist/{chunk-HQGF4ATG.js → chunk-52NLZN6Z.js} +118 -141
  13. package/dist/chunk-AHCKOU2M.js +13 -0
  14. package/dist/chunk-CLDCYJQT.js +1 -0
  15. package/dist/chunk-DWXDNT7P.js +145 -0
  16. package/dist/chunk-E4T2N7P7.js +124 -0
  17. package/dist/{chunk-HYNYEBHM.js → chunk-E7C4XEWH.js} +3 -3
  18. package/dist/{chunk-L3BVJWML.js → chunk-EPTHX4VZ.js} +1 -1
  19. package/dist/{chunk-QDEETKYT.js → chunk-FFPHJBJC.js} +9 -9
  20. package/dist/chunk-GNRMB6DC.js +5126 -0
  21. package/dist/{chunk-DZTG5IAC.js → chunk-I2KLQ2HA.js} +1 -7
  22. package/dist/{chunk-Q6OYNEGR.js → chunk-IUKFNASA.js} +5 -6
  23. package/dist/{chunk-QHEWXU7I.js → chunk-JFL3GRD4.js} +1 -1
  24. package/dist/{chunk-T3IPHEYJ.js → chunk-JHT5JIJ3.js} +4410 -566
  25. package/dist/{chunk-L2NVFLXU.js → chunk-MHLZ4F4N.js} +4 -4
  26. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  27. package/dist/{chunk-TOIXUWR6.js → chunk-ND5TDV2J.js} +1 -1
  28. package/dist/{chunk-5LJAEZMA.js → chunk-NOIRGGW2.js} +5 -6
  29. package/dist/{chunk-7KC4P3AU.js → chunk-QNOVUCSV.js} +2 -12
  30. package/dist/{chunk-3BAPR3KA.js → chunk-RQA2EVN3.js} +5 -15
  31. package/dist/{chunk-ND42LPY4.js → chunk-TKF5S4XP.js} +6 -6
  32. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  33. package/dist/{chunk-Y4FWCG7Y.js → chunk-UVFOURXR.js} +8 -7
  34. package/dist/chunk-UW7IV2Y3.js +447 -0
  35. package/dist/{chunk-P55BJZZW.js → chunk-V6SZ4ECN.js} +20 -5
  36. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  37. package/dist/chunk-XG57WXOL.js +85 -0
  38. package/dist/{chunk-SHQXMW4F.js → chunk-XOFSMJLF.js} +46 -28
  39. package/dist/{chunk-7HMCB26R.js → chunk-XZGSCABI.js} +1 -1
  40. package/dist/chunk-YAQ25UNM.js +2126 -0
  41. package/dist/chunk-ZGTDKH3P.js +467 -0
  42. package/dist/components/chat/index.js +1 -1
  43. package/dist/components/index.css +38 -0
  44. package/dist/components/index.d.ts +262 -51
  45. package/dist/components/index.js +37 -39
  46. package/dist/components/navigation/index.css +38 -0
  47. package/dist/components/navigation/index.js +5 -3
  48. package/dist/execution/index.d.ts +11 -2
  49. package/dist/execution/index.js +1 -1
  50. package/dist/features/auth/index.css +38 -0
  51. package/dist/features/auth/index.d.ts +91 -14
  52. package/dist/features/auth/index.js +42 -10
  53. package/dist/features/clients/index.css +38 -0
  54. package/dist/features/clients/index.d.ts +1 -1
  55. package/dist/features/clients/index.js +17 -15
  56. package/dist/features/crm/index.css +38 -0
  57. package/dist/features/crm/index.d.ts +80 -18
  58. package/dist/features/crm/index.js +17 -15
  59. package/dist/features/dashboard/index.css +38 -0
  60. package/dist/features/dashboard/index.d.ts +174 -25
  61. package/dist/features/dashboard/index.js +17 -16
  62. package/dist/features/delivery/index.css +38 -0
  63. package/dist/features/delivery/index.d.ts +80 -18
  64. package/dist/features/delivery/index.js +16 -15
  65. package/dist/features/knowledge/index.css +38 -0
  66. package/dist/features/knowledge/index.d.ts +20 -18
  67. package/dist/features/knowledge/index.js +114 -609
  68. package/dist/features/lead-gen/index.css +38 -0
  69. package/dist/features/lead-gen/index.d.ts +45 -43
  70. package/dist/features/lead-gen/index.js +17 -16
  71. package/dist/features/monitoring/index.css +38 -0
  72. package/dist/features/monitoring/index.d.ts +20 -18
  73. package/dist/features/monitoring/index.js +18 -17
  74. package/dist/features/monitoring/requests/index.css +38 -0
  75. package/dist/features/monitoring/requests/index.d.ts +23 -21
  76. package/dist/features/monitoring/requests/index.js +16 -14
  77. package/dist/features/operations/index.css +38 -0
  78. package/dist/features/operations/index.d.ts +1299 -66
  79. package/dist/features/operations/index.js +22 -24
  80. package/dist/features/seo/index.d.ts +20 -18
  81. package/dist/features/seo/index.js +2 -2
  82. package/dist/features/settings/index.css +38 -0
  83. package/dist/features/settings/index.d.ts +80 -18
  84. package/dist/features/settings/index.js +17 -15
  85. package/dist/graph/index.js +1 -1
  86. package/dist/hooks/delivery/index.css +38 -0
  87. package/dist/hooks/delivery/index.d.ts +60 -0
  88. package/dist/hooks/delivery/index.js +3 -3
  89. package/dist/hooks/index.css +38 -0
  90. package/dist/hooks/index.d.ts +492 -89
  91. package/dist/hooks/index.js +15 -13
  92. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +332 -33
  93. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
  94. package/dist/hooks/published.css +38 -0
  95. package/dist/hooks/published.d.ts +492 -89
  96. package/dist/hooks/published.js +15 -13
  97. package/dist/index.css +38 -0
  98. package/dist/index.d.ts +1353 -1349
  99. package/dist/index.js +16 -14
  100. package/dist/initialization/index.d.ts +60 -0
  101. package/dist/initialization/index.js +1 -1
  102. package/dist/knowledge/index.d.ts +1217 -1292
  103. package/dist/knowledge/index.js +6538 -2198
  104. package/dist/knowledge-search-index-P7PR626V.js +1514 -0
  105. package/dist/layout/index.js +3 -4
  106. package/dist/organization/index.css +38 -0
  107. package/dist/organization/index.js +1 -1
  108. package/dist/profile/index.d.ts +60 -0
  109. package/dist/profile/index.js +1 -1
  110. package/dist/provider/ElevasisServiceContext.js +1 -1
  111. package/dist/provider/index.css +38 -0
  112. package/dist/provider/index.d.ts +1068 -1246
  113. package/dist/provider/index.js +12 -10
  114. package/dist/provider/published.css +38 -0
  115. package/dist/provider/published.d.ts +1065 -1243
  116. package/dist/provider/published.js +9 -7
  117. package/dist/router/context.js +1 -1
  118. package/dist/router/index.js +1 -1
  119. package/dist/sse/index.js +1 -1
  120. package/dist/supabase/index.d.ts +117 -0
  121. package/dist/supabase/index.js +1 -1
  122. package/dist/test-utils/index.d.ts +16 -9
  123. package/dist/test-utils/index.js +40 -33
  124. package/dist/test-utils/setup-integration.js +1 -1
  125. package/dist/test-utils/setup.js +1 -1
  126. package/dist/theme/index.js +3 -3
  127. package/dist/theme/presets/index.js +1 -1
  128. package/dist/typeform/index.js +1 -1
  129. package/dist/typeform/schemas.js +1 -1
  130. package/dist/types/index.d.ts +394 -35
  131. package/dist/utils/index.d.ts +174 -25
  132. package/dist/utils/index.js +2 -2
  133. package/dist/vite/index.js +1 -1
  134. package/dist/vite-plugin-knowledge/index.js +1 -1
  135. package/dist/zustand/index.js +1 -1
  136. package/package.json +10 -9
  137. package/src/README.md +29 -29
  138. package/src/api/README.md +18 -18
  139. package/src/app/README.md +24 -24
  140. package/src/auth/README.md +18 -18
  141. package/src/components/README.md +24 -24
  142. package/src/execution/README.md +16 -16
  143. package/src/features/README.md +28 -28
  144. package/src/graph/README.md +16 -16
  145. package/src/hooks/README.md +23 -23
  146. package/src/initialization/README.md +19 -19
  147. package/src/knowledge/README.md +31 -31
  148. package/src/organization/README.md +18 -18
  149. package/src/profile/README.md +19 -19
  150. package/src/provider/README.md +32 -32
  151. package/src/router/README.md +18 -18
  152. package/src/sse/README.md +13 -13
  153. package/src/test-utils/README.md +7 -7
  154. package/src/theme/README.md +23 -23
  155. package/src/theme/presets/README.md +19 -19
  156. package/src/types/README.md +16 -16
  157. package/src/utils/README.md +18 -18
  158. package/src/zustand/README.md +18 -18
  159. package/dist/chunk-542WPQU2.js +0 -413
  160. package/dist/chunk-6IXOKUBC.js +0 -347
  161. package/dist/chunk-CQZ3DNQY.js +0 -740
  162. package/dist/chunk-ECNNI3NT.js +0 -6
  163. package/dist/chunk-GRDLB6LM.js +0 -160
  164. package/dist/chunk-JDNEWB5F.js +0 -10
  165. package/dist/chunk-MVFCLZSK.js +0 -4337
  166. package/dist/chunk-O2QOPJI5.js +0 -2235
  167. package/dist/chunk-OAVTMITG.js +0 -13
  168. package/dist/chunk-TVRQ6AQI.js +0 -476
  169. package/dist/chunk-WF227UBV.js +0 -48
@@ -1,440 +1,66 @@
1
- import { KnowledgeSearchBar, KnowledgeTree, getKnowledgeIconToken, byKind } from '../../chunk-O2QOPJI5.js';
2
- import { CommandViewSidebarContent, OrganizationModelSchema, buildOrganizationGraph, DEFAULT_ORGANIZATION_MODEL_OPERATIONS, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_IDENTITY, DEFAULT_ORGANIZATION_MODEL_PROJECTS, DEFAULT_ORGANIZATION_MODEL_BRANDING } from '../../chunk-MVFCLZSK.js';
3
- import '../../chunk-ZTWA5H77.js';
4
- import { SemanticIcon } from '../../chunk-GRDLB6LM.js';
5
- import '../../chunk-XQQEKWTL.js';
6
- import { KNOWLEDGE_FEATURE_ID } from '../../chunk-ECNNI3NT.js';
7
- import { DEFAULT_ORGANIZATION_MODEL_PROSPECTING } from '../../chunk-TVRQ6AQI.js';
8
- import '../../chunk-CW3UNAF2.js';
1
+ import { getSharedOrganizationGraph, KnowledgeSearchBar, KnowledgeTree, getKnowledgeIconToken, getKnowledgeNodeReadCommand } from '../../chunk-YAQ25UNM.js';
2
+ import { ORGANIZATION_GRAPH_NODE_KIND_LABELS } from '../../chunk-E4T2N7P7.js';
3
+ import '../../chunk-CLDCYJQT.js';
9
4
  import { SubshellSidebarSection } from '../../chunk-IIMU5YAJ.js';
10
- import '../../chunk-7M2VOCYN.js';
11
- import '../../chunk-JKSUN5GN.js';
12
- import '../../chunk-6YT4IKJ7.js';
13
- import '../../chunk-7HMCB26R.js';
14
- import '../../chunk-BRXELOHC.js';
15
- import '../../chunk-3ZMAGTWF.js';
16
- import '../../chunk-OAVTMITG.js';
17
- import '../../chunk-HYNYEBHM.js';
18
- import '../../chunk-3BAPR3KA.js';
19
- import '../../chunk-3FV6HBXS.js';
20
- import '../../chunk-WLOQ4IBG.js';
21
- import '../../chunk-QDEETKYT.js';
22
- import { useElevasisFeatures } from '../../chunk-6IXOKUBC.js';
23
- import '../../chunk-L3BVJWML.js';
24
- import '../../chunk-3KMDHCAR.js';
25
- import { DEFAULT_ORGANIZATION_MODEL_SALES } from '../../chunk-CQZ3DNQY.js';
26
- import '../../chunk-SZHARWKU.js';
27
- import '../../chunk-TKAYX2SP.js';
28
- import '../../chunk-NYBEU5TE.js';
29
- import '../../chunk-TOIXUWR6.js';
5
+ import { useElevasisSystems } from '../../chunk-ZGTDKH3P.js';
6
+ import { SemanticIcon } from '../../chunk-DWXDNT7P.js';
7
+ import { resolveOrganizationModel } from '../../chunk-GNRMB6DC.js';
30
8
  import '../../chunk-2IFYDILW.js';
31
9
  import { useRouterContext } from '../../chunk-Q7DJKLEN.js';
32
10
  import '../../chunk-JA5ECJJB.js';
33
11
  import '../../chunk-HUJCU55S.js';
34
- import '../../chunk-E565XMTQ.js';
35
12
  import '../../chunk-JBWJ6WHZ.js';
36
13
  import '../../chunk-DT3QYZVU.js';
37
14
  import '../../chunk-RNP5R5I3.js';
38
- import '../../chunk-XQHZBA65.js';
39
- import '../../chunk-KRWALB24.js';
40
- import '../../chunk-VKIZUUPM.js';
41
15
  import '../../chunk-533DUEQY.js';
42
16
  import '../../chunk-DD3CCMCZ.js';
43
17
  import '../../chunk-2Q2JQSQO.js';
44
18
  import '../../chunk-KJ3QUBNU.js';
45
19
  import '../../chunk-BRJ3QZ4E.js';
46
- import '../../chunk-DZTG5IAC.js';
47
- import { IconBrain, IconCheck, IconCopy } from '@tabler/icons-react';
48
- import { Stack, Box, SegmentedControl, Text, UnstyledButton, Group, Badge } from '@mantine/core';
20
+ import '../../chunk-I2KLQ2HA.js';
21
+ import { IconBrain, IconCircleCheckFilled, IconCircleDashed, IconCheck, IconCopy } from '@tabler/icons-react';
22
+ import { Stack, Box, Group, Popover, Button, Badge, Divider, Text, UnstyledButton } from '@mantine/core';
49
23
  import { useClipboard } from '@mantine/hooks';
50
24
  import { useMemo, useState } from 'react';
51
25
  import { jsx, jsxs } from 'react/jsx-runtime';
52
26
 
53
- // ../core/src/organization-model/defaults.ts
54
- var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {
55
- nodes: []
56
- };
57
- var DEFAULT_ORGANIZATION_MODEL = {
58
- version: 1,
59
- features: [
60
- {
61
- id: "dashboard",
62
- label: "Dashboard",
63
- enabled: true,
64
- path: "/",
65
- icon: "feature.dashboard",
66
- uiPosition: "sidebar-primary"
67
- },
68
- {
69
- id: "identity",
70
- label: "Identity",
71
- description: "Company identity, positioning, and market context",
72
- enabled: true,
73
- color: "indigo"
74
- },
75
- {
76
- id: "platform",
77
- label: "Platform",
78
- description: "Elevasis platform architecture, capabilities, and implementation patterns",
79
- enabled: true,
80
- color: "cyan",
81
- icon: "feature.platform"
82
- },
83
- {
84
- id: "finance",
85
- label: "Finance",
86
- description: "Finance operations, accounting, billing, reconciliation, and tax prep",
87
- enabled: true,
88
- color: "green",
89
- icon: "feature.finance"
90
- },
91
- {
92
- id: "business",
93
- label: "Business",
94
- description: "Revenue, client relationships, and project delivery",
95
- enabled: true,
96
- color: "blue",
97
- icon: "feature.business",
98
- uiPosition: "sidebar-primary"
99
- },
100
- {
101
- id: "sales",
102
- label: "Sales",
103
- description: "Revenue workflows and customer acquisition",
104
- enabled: true,
105
- color: "blue",
106
- icon: "feature.sales",
107
- path: "/sales"
108
- },
109
- {
110
- id: "sales.crm",
111
- label: "CRM",
112
- description: "Relationship pipeline and deal management",
113
- enabled: true,
114
- color: "blue",
115
- icon: "feature.crm",
116
- path: "/crm"
117
- },
118
- {
119
- id: "sales.lead-gen",
120
- label: "Lead Gen",
121
- description: "Prospecting, qualification, and outreach preparation",
122
- enabled: true,
123
- color: "cyan",
124
- icon: "feature.lead-gen",
125
- path: "/lead-gen"
126
- },
127
- {
128
- id: "projects",
129
- label: "Projects",
130
- description: "Projects, milestones, and client work execution",
131
- enabled: true,
132
- color: "orange",
133
- icon: "feature.projects",
134
- path: "/projects"
135
- },
136
- {
137
- id: "clients",
138
- label: "Clients",
139
- description: "Client relationships, accounts, and business context",
140
- enabled: true,
141
- color: "orange",
142
- icon: "feature.projects",
143
- path: "/business/clients"
144
- },
145
- {
146
- id: "operations",
147
- label: "Operations",
148
- description: "Operational resources, topology, and orchestration visibility",
149
- enabled: true,
150
- color: "violet",
151
- icon: "feature.operations",
152
- uiPosition: "sidebar-primary"
153
- },
154
- {
155
- id: "knowledge.command-view",
156
- label: "Command View",
157
- enabled: true,
158
- path: "/knowledge/command-view",
159
- devOnly: true
160
- },
161
- {
162
- id: "operations.overview",
163
- label: "Overview",
164
- enabled: true,
165
- path: "/operations"
166
- },
167
- {
168
- id: "operations.resources",
169
- label: "Resources",
170
- enabled: true,
171
- path: "/operations/resources"
172
- },
173
- {
174
- id: "operations.command-queue",
175
- label: "Command Queue",
176
- enabled: true,
177
- path: "/operations/command-queue"
178
- },
179
- {
180
- id: "operations.sessions",
181
- label: "Sessions",
182
- enabled: false,
183
- path: "/operations/sessions"
184
- },
185
- {
186
- id: "operations.task-scheduler",
187
- label: "Task Scheduler",
188
- enabled: true,
189
- path: "/operations/task-scheduler"
190
- },
191
- {
192
- id: "monitoring",
193
- label: "Monitoring",
194
- enabled: true,
195
- uiPosition: "sidebar-primary"
196
- },
197
- {
198
- id: "monitoring.calendar",
199
- label: "Calendar",
200
- description: "Google Calendar events and agenda views",
201
- enabled: true,
202
- path: "/monitoring/calendar",
203
- icon: "feature.calendar"
204
- },
205
- {
206
- id: "monitoring.activity-log",
207
- label: "Activity Log",
208
- enabled: true,
209
- path: "/monitoring/activity-log"
210
- },
211
- {
212
- id: "monitoring.execution-logs",
213
- label: "Execution Logs",
214
- enabled: true,
215
- path: "/monitoring/execution-logs"
216
- },
217
- {
218
- id: "monitoring.execution-health",
219
- label: "Execution Health",
220
- enabled: true,
221
- path: "/monitoring/execution-health"
222
- },
223
- {
224
- id: "monitoring.cost-analytics",
225
- label: "Cost Analytics",
226
- enabled: false,
227
- path: "/monitoring/cost-analytics"
228
- },
229
- {
230
- id: "monitoring.notifications",
231
- label: "Notifications",
232
- enabled: true,
233
- path: "/monitoring/notifications"
234
- },
235
- {
236
- id: "monitoring.submitted-requests",
237
- label: "Submitted Requests",
238
- enabled: true,
239
- path: "/monitoring/requests"
240
- },
241
- {
242
- id: "settings",
243
- label: "Settings",
244
- enabled: true,
245
- icon: "feature.settings",
246
- uiPosition: "sidebar-bottom"
247
- },
248
- {
249
- id: "settings.account",
250
- label: "Account",
251
- enabled: true,
252
- path: "/settings/account"
253
- },
254
- {
255
- id: "settings.appearance",
256
- label: "Appearance",
257
- enabled: true,
258
- path: "/settings/appearance"
259
- },
260
- {
261
- id: "settings.roles",
262
- label: "My Roles",
263
- enabled: true,
264
- path: "/settings/roles"
265
- },
266
- {
267
- id: "settings.organization",
268
- label: "Organization",
269
- enabled: true,
270
- path: "/settings/organization"
271
- },
272
- {
273
- id: "settings.credentials",
274
- label: "Credentials",
275
- enabled: true,
276
- path: "/settings/credentials"
277
- },
278
- {
279
- id: "settings.api-keys",
280
- label: "API Keys",
281
- enabled: true,
282
- path: "/settings/api-keys"
283
- },
284
- {
285
- id: "settings.webhooks",
286
- label: "Webhooks",
287
- enabled: true,
288
- path: "/settings/webhooks"
289
- },
290
- {
291
- id: "settings.deployments",
292
- label: "Deployments",
293
- enabled: true,
294
- path: "/settings/deployments"
295
- },
296
- {
297
- id: "admin",
298
- label: "Admin",
299
- enabled: true,
300
- path: "/admin",
301
- icon: "feature.admin",
302
- uiPosition: "sidebar-bottom",
303
- requiresAdmin: true
304
- },
305
- {
306
- id: "admin.system-health",
307
- label: "System Health",
308
- enabled: true,
309
- path: "/admin/system-health"
310
- },
311
- {
312
- id: "admin.organizations",
313
- label: "Organizations",
314
- enabled: true,
315
- path: "/admin/organizations"
316
- },
317
- {
318
- id: "admin.users",
319
- label: "Users",
320
- enabled: true,
321
- path: "/admin/users"
322
- },
323
- {
324
- id: "admin.design-showcase",
325
- label: "Design Showcase",
326
- enabled: true,
327
- path: "/admin/design-showcase"
328
- },
329
- {
330
- id: "admin.debug",
331
- label: "Debug",
332
- enabled: true,
333
- path: "/admin/debug"
334
- },
335
- {
336
- id: "archive",
337
- label: "Archive",
338
- enabled: true,
339
- path: "/archive",
340
- icon: "feature.archive",
341
- uiPosition: "sidebar-bottom",
342
- devOnly: true
343
- },
344
- {
345
- id: "archive.agent-chat",
346
- label: "Agent Chat",
347
- enabled: true,
348
- path: "/archive/agent-chat"
349
- },
350
- {
351
- id: "archive.execution-runner",
352
- label: "Execution Runner",
353
- enabled: true,
354
- path: "/archive/execution-runner"
355
- },
356
- {
357
- id: "seo",
358
- label: "SEO",
359
- enabled: false,
360
- path: "/seo"
361
- },
362
- {
363
- id: "knowledge",
364
- label: "Knowledge",
365
- description: "Operational knowledge, playbooks, and strategy docs",
366
- enabled: true,
367
- color: "teal",
368
- icon: "feature.knowledge",
369
- uiPosition: "sidebar-primary"
370
- },
371
- {
372
- id: "knowledge.base",
373
- label: "Knowledge Base",
374
- enabled: true,
375
- path: "/knowledge"
376
- }
377
- ],
378
- branding: DEFAULT_ORGANIZATION_MODEL_BRANDING,
379
- navigation: { surfaces: [], groups: [] },
380
- sales: DEFAULT_ORGANIZATION_MODEL_SALES,
381
- prospecting: DEFAULT_ORGANIZATION_MODEL_PROSPECTING,
382
- projects: DEFAULT_ORGANIZATION_MODEL_PROJECTS,
383
- identity: DEFAULT_ORGANIZATION_MODEL_IDENTITY,
384
- customers: DEFAULT_ORGANIZATION_MODEL_CUSTOMERS,
385
- offerings: DEFAULT_ORGANIZATION_MODEL_OFFERINGS,
386
- roles: DEFAULT_ORGANIZATION_MODEL_ROLES,
387
- goals: DEFAULT_ORGANIZATION_MODEL_GOALS,
388
- systems: DEFAULT_ORGANIZATION_MODEL_SYSTEMS,
389
- resources: DEFAULT_ORGANIZATION_MODEL_RESOURCES,
390
- statuses: DEFAULT_ORGANIZATION_MODEL_STATUSES,
391
- operations: DEFAULT_ORGANIZATION_MODEL_OPERATIONS,
392
- knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
393
- };
394
- function deepMerge(base, override) {
395
- {
396
- return base;
397
- }
27
+ var WIRING_FACET_KINDS = ["action", "entity", "event", "resource"];
28
+ function isKnowledgeHidden(state) {
29
+ return state === "exclude";
398
30
  }
399
- function resolveOrganizationModel(override, organizationId) {
400
- const merged = deepMerge(DEFAULT_ORGANIZATION_MODEL);
401
- const model = OrganizationModelSchema.parse(merged);
402
- if (!model.sales?.pipelines || model.sales.pipelines.length === 0) {
403
- const orgLabel = "Organization";
404
- throw new Error(
405
- `${orgLabel} has no sales pipeline configuration. This indicates an incomplete provisioning state. Run org provisioning to seed defaults.`
406
- );
407
- }
408
- return model;
31
+ function isWiringFacetActive(state) {
32
+ return state === "include";
409
33
  }
410
- var SEGMENT_DATA = [
411
- { label: "By Feature", value: "by-feature" },
412
- { label: "By Kind", value: "by-kind" },
413
- { label: "Config", value: "config" }
414
- ];
415
34
  var SIDEBAR_TREE_ACCENT_COLOR = "var(--color-primary)";
416
- var SIDEBAR_TREE_ACCENT_SURFACE = "var(--surface-primary-subtle)";
417
- var SIDEBAR_TREE_ACCENT_BORDER = "color-mix(in srgb, var(--color-primary) 28%, var(--color-border))";
418
35
  var KnowledgeSidebarMiddle = () => {
419
36
  const { navigate, currentPath } = useRouterContext();
420
- const { timeRange = "30d", organizationModel } = useElevasisFeatures();
37
+ const { organizationModel } = useElevasisSystems();
421
38
  if (currentPath.startsWith("/knowledge/command-view")) {
422
- return /* @__PURE__ */ jsx(CommandViewSidebarContent, { timeRange });
39
+ return null;
423
40
  }
424
41
  const orgModel = organizationModel ?? resolveOrganizationModel();
425
42
  return /* @__PURE__ */ jsx(KnowledgeBaseSidebarBody, { navigate, currentPath, organizationModel: orgModel });
426
43
  };
427
44
  function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel }) {
428
- const knowledgeNodes = useMemo(() => organizationModel.knowledge.nodes, [organizationModel]);
429
- const graph = useMemo(() => buildOrganizationGraph({ organizationModel }), [organizationModel]);
45
+ const knowledgeNodes = useMemo(() => Object.values(organizationModel.knowledge), [organizationModel]);
46
+ const graph = useMemo(() => getSharedOrganizationGraph(organizationModel), [organizationModel]);
430
47
  const [searchResults, setSearchResults] = useState(null);
431
- const [axis, setAxis] = useState("by-feature");
48
+ const [facetStates, setFacetStates] = useState({ knowledge: "include" });
49
+ const [facetsOpen, setFacetsOpen] = useState(false);
50
+ const activeFacetCount = useMemo(() => {
51
+ let count = 0;
52
+ if (isKnowledgeHidden(facetStates.knowledge)) count += 1;
53
+ for (const kind of WIRING_FACET_KINDS) {
54
+ if (isWiringFacetActive(facetStates[kind])) count += 1;
55
+ }
56
+ return count;
57
+ }, [facetStates]);
432
58
  const selectedNodeId = useMemo(() => {
433
59
  const match = currentPath.match(/^\/knowledge\/([^/]+)/);
434
60
  if (!match) return void 0;
435
61
  const segment = match[1];
436
- if (["by-feature", "by-kind", "config", "graph", "command-view"].includes(segment)) return void 0;
437
- return segment;
62
+ if (["system", "entity", "resource", "graph", "command-view"].includes(segment)) return void 0;
63
+ return decodeURIComponent(segment);
438
64
  }, [currentPath]);
439
65
  const handleSelect = (node) => {
440
66
  navigate(`/knowledge/${node.id}`);
@@ -442,29 +68,49 @@ function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel })
442
68
  const handleSelectGraphNode = (node) => {
443
69
  navigate(`/knowledge/${node.id}`);
444
70
  };
71
+ const handleSelectDomain = (domainKey) => {
72
+ navigate(`/knowledge/domain:${domainKey}`);
73
+ };
74
+ const handleSelectGroup = (groupKey) => {
75
+ navigate(`/knowledge/group:${groupKey}`);
76
+ };
77
+ const handleSelectItem = (domainKey, itemId) => {
78
+ navigate(`/knowledge/item:${domainKey}:${encodeURIComponent(itemId)}`);
79
+ };
445
80
  return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: [
446
81
  /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconBrain, label: "Knowledge", withTopBorder: false }),
447
- /* @__PURE__ */ jsx(Box, { px: "sm", pt: "sm", pb: 0, children: /* @__PURE__ */ jsx(
448
- SegmentedControl,
449
- {
450
- "data-testid": "knowledge-axis-control",
451
- fullWidth: true,
452
- size: "xs",
453
- value: axis,
454
- onChange: (v) => setAxis(v),
455
- data: SEGMENT_DATA
456
- }
457
- ) }),
458
- /* @__PURE__ */ jsx(Box, { p: "sm", pb: 0, children: /* @__PURE__ */ jsx(KnowledgeSearchBar, { knowledgeNodes, onResults: setSearchResults }) }),
82
+ /* @__PURE__ */ jsx(Box, { p: "sm", pb: 0, children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
83
+ /* @__PURE__ */ jsx(Box, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(KnowledgeSearchBar, { knowledgeNodes, onResults: setSearchResults }) }),
84
+ /* @__PURE__ */ jsxs(Popover, { position: "right-start", withArrow: true, shadow: "md", opened: facetsOpen, onChange: setFacetsOpen, offset: 6, children: [
85
+ /* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
86
+ Button,
87
+ {
88
+ size: "xs",
89
+ variant: activeFacetCount > 0 ? "light" : "subtle",
90
+ color: activeFacetCount > 0 ? "blue" : "gray",
91
+ onClick: () => setFacetsOpen((o) => !o),
92
+ "aria-expanded": facetsOpen,
93
+ rightSection: activeFacetCount > 0 ? /* @__PURE__ */ jsx(Badge, { size: "xs", circle: true, variant: "filled", color: "blue", children: activeFacetCount }) : null,
94
+ children: "Filter"
95
+ }
96
+ ) }),
97
+ /* @__PURE__ */ jsx(Popover.Dropdown, { p: 6, children: /* @__PURE__ */ jsx(FacetPanel, { value: facetStates, onChange: setFacetStates }) })
98
+ ] })
99
+ ] }) }),
459
100
  /* @__PURE__ */ jsx(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: searchResults ? /* @__PURE__ */ jsx(SearchResultsList, { searchResults, selectedNodeId, onSelect: handleSelect }) : /* @__PURE__ */ jsx(
460
- AxisBody,
101
+ KnowledgeTree,
461
102
  {
462
- axis,
463
103
  graph,
464
104
  knowledgeNodes,
465
- selectedNodeId,
466
- onSelect: handleSelect,
467
- onSelectGraphNode: handleSelectGraphNode
105
+ organizationModel,
106
+ omRooted: true,
107
+ facetStates,
108
+ onSelectNode: handleSelect,
109
+ onSelectGraphNode: handleSelectGraphNode,
110
+ onSelectDomain: handleSelectDomain,
111
+ onSelectGroup: handleSelectGroup,
112
+ onSelectItem: handleSelectItem,
113
+ selectedNodeId
468
114
  }
469
115
  ) })
470
116
  ] });
@@ -478,109 +124,53 @@ function SearchResultsList({ searchResults, selectedNodeId, onSelect }) {
478
124
  return /* @__PURE__ */ jsx(NodeButton, { node, isActive, onSelect }, node.id);
479
125
  }) });
480
126
  }
481
- function AxisBody({ axis, graph, knowledgeNodes, selectedNodeId, onSelect, onSelectGraphNode }) {
482
- switch (axis) {
483
- case "by-feature":
484
- return /* @__PURE__ */ jsx(
485
- KnowledgeTree,
486
- {
487
- graph,
488
- knowledgeNodes,
489
- onSelectNode: onSelect,
490
- selectedNodeId
491
- }
492
- );
493
- case "by-kind":
494
- return /* @__PURE__ */ jsx(ByKindBody, { graph, knowledgeNodes, selectedNodeId, onSelect });
495
- case "config":
496
- return /* @__PURE__ */ jsx(ConfigBody, { graph, selectedNodeId, onSelect: onSelectGraphNode });
497
- }
498
- }
499
- var KIND_ORDER = ["playbook", "strategy", "reference"];
500
- var KIND_LABELS = {
501
- playbook: "Playbook",
502
- strategy: "Strategy",
503
- reference: "Reference"
504
- };
505
- function ByKindBody({ graph, knowledgeNodes, selectedNodeId, onSelect }) {
506
- const groups = useMemo(() => {
507
- return KIND_ORDER.map((kind) => ({
508
- kind,
509
- nodes: byKind(graph, kind, knowledgeNodes)
510
- })).filter((g) => g.nodes.length > 0);
511
- }, [graph, knowledgeNodes]);
512
- if (groups.length === 0) {
513
- return /* @__PURE__ */ jsx(Box, { p: "md", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No knowledge nodes." }) });
514
- }
515
- return /* @__PURE__ */ jsx(Stack, { gap: "md", style: { padding: "var(--mantine-spacing-sm)" }, children: groups.map(({ kind, nodes }) => /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
516
- /* @__PURE__ */ jsx(
517
- GroupHeader,
518
- {
519
- label: KIND_LABELS[kind],
520
- count: nodes.length,
521
- command: getKnowledgeReadKindFolderCommand(kind)
522
- }
523
- ),
524
- /* @__PURE__ */ jsx(Stack, { gap: 2, children: nodes.map((node) => /* @__PURE__ */ jsx(NodeButton, { node, isActive: node.id === selectedNodeId, onSelect }, node.id)) })
525
- ] }, kind)) });
526
- }
527
- var CONFIG_KIND_ORDER = ["feature", "resource", "capability", "stage", "organization", "entity", "surface"];
528
- var CONFIG_KIND_LABELS = {
529
- feature: "Features",
530
- resource: "Resources",
531
- capability: "Capabilities",
532
- stage: "Stages",
533
- organization: "Organizations",
534
- entity: "Entities",
535
- surface: "Surfaces"
536
- };
537
- function isSelectedConfigNode(selectedNodeId, node) {
538
- if (!selectedNodeId) return false;
539
- return selectedNodeId === node.id || selectedNodeId === node.sourceId || selectedNodeId === node.id.split(":")[1];
540
- }
541
- function ConfigBody({ graph, selectedNodeId, onSelect }) {
542
- const groups = useMemo(() => {
543
- const grouped = /* @__PURE__ */ new Map();
544
- for (const node of graph.nodes) {
545
- if (node.kind === "knowledge") continue;
546
- const nodes = grouped.get(node.kind) ?? [];
547
- nodes.push(node);
548
- grouped.set(node.kind, nodes);
549
- }
550
- const knownGroups = CONFIG_KIND_ORDER.map((kind) => ({
551
- kind,
552
- label: CONFIG_KIND_LABELS[kind],
553
- nodes: grouped.get(kind)?.sort((a, b) => a.label.localeCompare(b.label)) ?? []
554
- })).filter((group) => group.nodes.length > 0);
555
- const unknownGroups = Array.from(grouped.entries()).filter(([kind]) => !CONFIG_KIND_ORDER.includes(kind)).map(([kind, nodes]) => ({
556
- kind,
557
- label: CONFIG_KIND_LABELS[kind] ?? kind,
558
- nodes: nodes.sort((a, b) => a.label.localeCompare(b.label))
559
- })).sort((a, b) => a.label.localeCompare(b.label));
560
- return [...knownGroups, ...unknownGroups];
561
- }, [graph]);
562
- if (groups.length === 0) {
563
- return /* @__PURE__ */ jsx(Box, { p: "md", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No configuration nodes." }) });
564
- }
565
- return /* @__PURE__ */ jsx(Stack, { gap: "md", style: { padding: "var(--mantine-spacing-sm)" }, children: groups.map(({ kind, label, nodes }) => /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
566
- /* @__PURE__ */ jsx(GroupHeader, { label, count: nodes.length }),
567
- /* @__PURE__ */ jsx(Stack, { gap: 2, children: nodes.map((node) => /* @__PURE__ */ jsx(
568
- ConfigNodeButton,
127
+ function FacetPanel({ value, onChange }) {
128
+ const knowledgeHidden = isKnowledgeHidden(value.knowledge);
129
+ const toggleKnowledge = () => {
130
+ onChange({ ...value, knowledge: knowledgeHidden ? "include" : "exclude" });
131
+ };
132
+ const toggleWiring = (kind) => {
133
+ onChange({ ...value, [kind]: isWiringFacetActive(value[kind]) ? "neutral" : "include" });
134
+ };
135
+ return /* @__PURE__ */ jsxs(Stack, { gap: 4, miw: 200, children: [
136
+ /* @__PURE__ */ jsx(FacetRow, { label: "Hide knowledge nodes", active: knowledgeHidden, onClick: toggleKnowledge }),
137
+ /* @__PURE__ */ jsx(Divider, { my: 4 }),
138
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", pl: 6, pb: 2, tt: "uppercase", style: { letterSpacing: "0.05em" }, children: "Show under systems" }),
139
+ WIRING_FACET_KINDS.map((kind) => /* @__PURE__ */ jsx(
140
+ FacetRow,
569
141
  {
570
- node,
571
- isActive: isSelectedConfigNode(selectedNodeId, node),
572
- onSelect
142
+ label: ORGANIZATION_GRAPH_NODE_KIND_LABELS[kind],
143
+ active: isWiringFacetActive(value[kind]),
144
+ onClick: () => toggleWiring(kind)
573
145
  },
574
- node.id
575
- )) })
576
- ] }, kind)) });
146
+ kind
147
+ ))
148
+ ] });
577
149
  }
578
- function GroupHeader({ label, count, command }) {
150
+ function FacetRow({ label, active, onClick }) {
579
151
  const [hovered, setHovered] = useState(false);
580
- return /* @__PURE__ */ jsxs(Group, { gap: "xs", onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [
581
- /* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, tt: "uppercase", c: "dimmed", style: { letterSpacing: "0.05em" }, children: label }),
582
- /* @__PURE__ */ jsx(TrailingCopySlot, { count, command, label: "Copy group knowledge commands", showCopy: hovered })
583
- ] });
152
+ const StatusIcon = active ? IconCircleCheckFilled : IconCircleDashed;
153
+ const iconColor = active ? "var(--color-primary)" : "var(--color-text-subtle)";
154
+ return /* @__PURE__ */ jsx(
155
+ UnstyledButton,
156
+ {
157
+ onClick,
158
+ onMouseEnter: () => setHovered(true),
159
+ onMouseLeave: () => setHovered(false),
160
+ "aria-pressed": active,
161
+ "aria-label": `${label} ${active ? "on" : "off"}`,
162
+ style: {
163
+ padding: "6px 10px",
164
+ borderRadius: "var(--mantine-radius-sm)",
165
+ backgroundColor: hovered ? "var(--color-surface-hover)" : "transparent",
166
+ transition: "background-color var(--duration-fast) var(--easing)"
167
+ },
168
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
169
+ /* @__PURE__ */ jsx(StatusIcon, { size: 16, style: { color: iconColor, flexShrink: 0 } }),
170
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: active ? void 0 : "dimmed", children: label })
171
+ ] })
172
+ }
173
+ );
584
174
  }
585
175
  function NodeButton({ node, isActive, onSelect }) {
586
176
  const [hovered, setHovered] = useState(false);
@@ -605,72 +195,15 @@ function NodeButton({ node, isActive, onSelect }) {
605
195
  c: isActive ? "var(--color-primary)" : hovered ? "var(--color-text)" : void 0,
606
196
  fw: isActive ? 600 : 400,
607
197
  children: /* @__PURE__ */ jsxs(Group, { component: "span", gap: "xs", wrap: "nowrap", children: [
608
- /* @__PURE__ */ jsx(
609
- SemanticIcon,
610
- {
611
- token: getKnowledgeIconToken(node),
612
- fallbackKind: node.kind,
613
- size: 15,
614
- style: { color: SIDEBAR_TREE_ACCENT_COLOR }
615
- }
616
- ),
617
- /* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: node.title }),
618
- /* @__PURE__ */ jsx(
619
- CopyCommandControl,
620
- {
621
- command: getKnowledgeReadCommand(node.id),
622
- label: "Copy knowledge command",
623
- visible: hovered
624
- }
625
- )
198
+ /* @__PURE__ */ jsx(SemanticIcon, { token: getKnowledgeIconToken(node), size: 15, style: { color: SIDEBAR_TREE_ACCENT_COLOR } }),
199
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: node.title }),
200
+ hovered ? /* @__PURE__ */ jsx(CopyCommandControl, { command: getKnowledgeNodeReadCommand(node.id), label: "Copy knowledge command", visible: true }) : null
626
201
  ] })
627
202
  }
628
203
  )
629
204
  }
630
205
  );
631
206
  }
632
- function ConfigNodeButton({ node, isActive, onSelect }) {
633
- return /* @__PURE__ */ jsx(
634
- UnstyledButton,
635
- {
636
- onClick: () => onSelect(node),
637
- style: {
638
- padding: "6px 10px",
639
- borderRadius: "var(--mantine-radius-sm)",
640
- backgroundColor: isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent",
641
- width: "100%",
642
- textAlign: "left"
643
- },
644
- children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
645
- /* @__PURE__ */ jsx(
646
- SemanticIcon,
647
- {
648
- token: node.icon,
649
- fallbackKind: node.kind === "feature" ? "feature" : node.kind === "knowledge" ? "knowledge" : "unknown",
650
- size: 15,
651
- style: { color: SIDEBAR_TREE_ACCENT_COLOR }
652
- }
653
- ),
654
- /* @__PURE__ */ jsx(
655
- Text,
656
- {
657
- size: "sm",
658
- c: isActive ? "var(--color-primary)" : void 0,
659
- fw: isActive ? 600 : 400,
660
- style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
661
- children: node.label
662
- }
663
- )
664
- ] })
665
- }
666
- );
667
- }
668
- function getKnowledgeReadCommand(nodeId) {
669
- return `/knowledge read ${nodeId}`;
670
- }
671
- function getKnowledgeReadKindFolderCommand(kind) {
672
- return `/knowledge read-folder kind:${kind}`;
673
- }
674
207
  function CopyCommandControl({ command, label, visible }) {
675
208
  const clipboard = useClipboard({ timeout: 1500 });
676
209
  return /* @__PURE__ */ jsx(
@@ -706,34 +239,6 @@ function CopyCommandControl({ command, label, visible }) {
706
239
  }
707
240
  );
708
241
  }
709
- function TrailingCopySlot({ count, command, label, showCopy }) {
710
- return /* @__PURE__ */ jsx(
711
- "span",
712
- {
713
- style: {
714
- display: "inline-flex",
715
- alignItems: "center",
716
- justifyContent: "center",
717
- width: 32,
718
- height: 22,
719
- flexShrink: 0
720
- },
721
- children: showCopy && command ? /* @__PURE__ */ jsx(CopyCommandControl, { command, label, visible: true }) : /* @__PURE__ */ jsx(
722
- Badge,
723
- {
724
- size: "xs",
725
- variant: "light",
726
- style: {
727
- color: SIDEBAR_TREE_ACCENT_COLOR,
728
- backgroundColor: SIDEBAR_TREE_ACCENT_SURFACE,
729
- borderColor: SIDEBAR_TREE_ACCENT_BORDER
730
- },
731
- children: count
732
- }
733
- )
734
- }
735
- );
736
- }
737
242
  var KnowledgeSidebar = () => /* @__PURE__ */ jsx(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(KnowledgeSidebarMiddle, {}) });
738
243
 
739
244
  // src/features/knowledge/manifest.ts
@@ -741,7 +246,7 @@ var knowledgeSidebarWidth = 320;
741
246
  var defaultSidebarWidth = 250;
742
247
  var knowledgeManifest = {
743
248
  key: "knowledge",
744
- featureId: KNOWLEDGE_FEATURE_ID,
249
+ routePrefixes: ["/knowledge"],
745
250
  icon: IconBrain,
746
251
  sidebar: KnowledgeSidebar,
747
252
  sidebarWidth: ({ currentPath }) => {