@elevasis/ui 2.31.0 → 2.32.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 (144) 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-XQHZBA65.js → chunk-2RJMVWFJ.js} +1 -6
  10. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  11. package/dist/{chunk-HQGF4ATG.js → chunk-4MFNGNHF.js} +118 -141
  12. package/dist/{chunk-ND42LPY4.js → chunk-4QK76KIF.js} +6 -6
  13. package/dist/chunk-5FJJ72HU.js +13 -0
  14. package/dist/chunk-5J4PDX26.js +112 -0
  15. package/dist/{chunk-QDEETKYT.js → chunk-6DWD423K.js} +9 -9
  16. package/dist/{chunk-SHQXMW4F.js → chunk-7KZINJLP.js} +46 -28
  17. package/dist/{chunk-L3BVJWML.js → chunk-EPTHX4VZ.js} +1 -1
  18. package/dist/{chunk-JKSUN5GN.js → chunk-GCOQ3TBG.js} +81 -746
  19. package/dist/{chunk-DZTG5IAC.js → chunk-I2KLQ2HA.js} +1 -7
  20. package/dist/{chunk-L2NVFLXU.js → chunk-IQHU7O5Y.js} +4 -4
  21. package/dist/{chunk-P55BJZZW.js → chunk-IZWTVFJ2.js} +16 -4
  22. package/dist/{chunk-QHEWXU7I.js → chunk-JFL3GRD4.js} +1 -1
  23. package/dist/{chunk-Q6OYNEGR.js → chunk-LLRXA7D7.js} +5 -6
  24. package/dist/{chunk-7KC4P3AU.js → chunk-MOY4VOHF.js} +2 -12
  25. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  26. package/dist/{chunk-TOIXUWR6.js → chunk-ND5TDV2J.js} +1 -1
  27. package/dist/{chunk-WF227UBV.js → chunk-QQHOKTJA.js} +4 -4
  28. package/dist/{chunk-T3IPHEYJ.js → chunk-QTI3KC7D.js} +4335 -554
  29. package/dist/chunk-QXCDKE2O.js +486 -0
  30. package/dist/{chunk-3BAPR3KA.js → chunk-RQA2EVN3.js} +5 -15
  31. package/dist/{chunk-HYNYEBHM.js → chunk-RQTWIXJ5.js} +3 -3
  32. package/dist/chunk-T35FWDAB.js +4342 -0
  33. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  34. package/dist/{chunk-GRDLB6LM.js → chunk-UROTM5OR.js} +13 -1
  35. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  36. package/dist/{chunk-5LJAEZMA.js → chunk-VRNMNB3O.js} +5 -6
  37. package/dist/chunk-WQPX44YM.js +1626 -0
  38. package/dist/{chunk-7HMCB26R.js → chunk-XZGSCABI.js} +1 -1
  39. package/dist/chunk-YLQEVSOR.js +299 -0
  40. package/dist/{chunk-Y4FWCG7Y.js → chunk-ZQOKIGZP.js} +8 -7
  41. package/dist/components/chat/index.js +1 -1
  42. package/dist/components/index.css +38 -0
  43. package/dist/components/index.d.ts +152 -50
  44. package/dist/components/index.js +36 -39
  45. package/dist/components/navigation/index.css +38 -0
  46. package/dist/components/navigation/index.js +4 -3
  47. package/dist/execution/index.d.ts +7 -2
  48. package/dist/execution/index.js +1 -1
  49. package/dist/features/auth/index.css +38 -0
  50. package/dist/features/auth/index.d.ts +91 -14
  51. package/dist/features/auth/index.js +42 -10
  52. package/dist/features/clients/index.css +38 -0
  53. package/dist/features/clients/index.d.ts +1 -1
  54. package/dist/features/clients/index.js +16 -15
  55. package/dist/features/crm/index.css +38 -0
  56. package/dist/features/crm/index.d.ts +80 -18
  57. package/dist/features/crm/index.js +16 -15
  58. package/dist/features/dashboard/index.css +38 -0
  59. package/dist/features/dashboard/index.d.ts +65 -25
  60. package/dist/features/dashboard/index.js +16 -16
  61. package/dist/features/delivery/index.css +38 -0
  62. package/dist/features/delivery/index.d.ts +80 -18
  63. package/dist/features/delivery/index.js +15 -15
  64. package/dist/features/knowledge/index.css +38 -0
  65. package/dist/features/knowledge/index.d.ts +20 -18
  66. package/dist/features/knowledge/index.js +112 -597
  67. package/dist/features/lead-gen/index.css +38 -0
  68. package/dist/features/lead-gen/index.d.ts +45 -43
  69. package/dist/features/lead-gen/index.js +16 -16
  70. package/dist/features/monitoring/index.css +38 -0
  71. package/dist/features/monitoring/index.d.ts +20 -18
  72. package/dist/features/monitoring/index.js +17 -17
  73. package/dist/features/monitoring/requests/index.css +38 -0
  74. package/dist/features/monitoring/requests/index.d.ts +21 -19
  75. package/dist/features/monitoring/requests/index.js +15 -14
  76. package/dist/features/operations/index.css +38 -0
  77. package/dist/features/operations/index.d.ts +930 -66
  78. package/dist/features/operations/index.js +21 -24
  79. package/dist/features/seo/index.d.ts +20 -18
  80. package/dist/features/seo/index.js +2 -2
  81. package/dist/features/settings/index.css +38 -0
  82. package/dist/features/settings/index.d.ts +80 -18
  83. package/dist/features/settings/index.js +16 -15
  84. package/dist/graph/index.js +1 -1
  85. package/dist/hooks/delivery/index.css +38 -0
  86. package/dist/hooks/delivery/index.d.ts +60 -0
  87. package/dist/hooks/delivery/index.js +3 -3
  88. package/dist/hooks/index.css +38 -0
  89. package/dist/hooks/index.d.ts +301 -87
  90. package/dist/hooks/index.js +14 -13
  91. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +143 -33
  92. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
  93. package/dist/hooks/published.css +38 -0
  94. package/dist/hooks/published.d.ts +301 -87
  95. package/dist/hooks/published.js +14 -13
  96. package/dist/index.css +38 -0
  97. package/dist/index.d.ts +976 -1341
  98. package/dist/index.js +15 -14
  99. package/dist/initialization/index.d.ts +60 -0
  100. package/dist/initialization/index.js +1 -1
  101. package/dist/knowledge/index.d.ts +809 -1160
  102. package/dist/knowledge/index.js +5988 -2140
  103. package/dist/{chunk-O2QOPJI5.js → knowledge-search-index-5KYPO746.js} +96 -852
  104. package/dist/layout/index.js +3 -4
  105. package/dist/organization/index.css +38 -0
  106. package/dist/organization/index.js +1 -1
  107. package/dist/profile/index.d.ts +60 -0
  108. package/dist/profile/index.js +1 -1
  109. package/dist/provider/ElevasisServiceContext.js +1 -1
  110. package/dist/provider/index.css +38 -0
  111. package/dist/provider/index.d.ts +786 -1249
  112. package/dist/provider/index.js +11 -10
  113. package/dist/provider/published.css +38 -0
  114. package/dist/provider/published.d.ts +783 -1246
  115. package/dist/provider/published.js +8 -7
  116. package/dist/router/context.js +1 -1
  117. package/dist/router/index.js +1 -1
  118. package/dist/sse/index.js +1 -1
  119. package/dist/supabase/index.d.ts +117 -0
  120. package/dist/supabase/index.js +1 -1
  121. package/dist/test-utils/index.d.ts +16 -9
  122. package/dist/test-utils/index.js +40 -33
  123. package/dist/test-utils/setup-integration.js +1 -1
  124. package/dist/test-utils/setup.js +1 -1
  125. package/dist/theme/index.js +3 -3
  126. package/dist/theme/presets/index.js +1 -1
  127. package/dist/typeform/index.js +1 -1
  128. package/dist/typeform/schemas.js +1 -1
  129. package/dist/types/index.d.ts +205 -35
  130. package/dist/utils/index.d.ts +65 -25
  131. package/dist/utils/index.js +2 -2
  132. package/dist/vite/index.js +1 -1
  133. package/dist/vite-plugin-knowledge/index.js +1 -1
  134. package/dist/zustand/index.js +1 -1
  135. package/package.json +39 -38
  136. package/src/provider/README.md +5 -5
  137. package/dist/chunk-542WPQU2.js +0 -413
  138. package/dist/chunk-6IXOKUBC.js +0 -347
  139. package/dist/chunk-CQZ3DNQY.js +0 -740
  140. package/dist/chunk-ECNNI3NT.js +0 -6
  141. package/dist/chunk-JDNEWB5F.js +0 -10
  142. package/dist/chunk-MVFCLZSK.js +0 -4337
  143. package/dist/chunk-OAVTMITG.js +0 -13
  144. package/dist/chunk-TVRQ6AQI.js +0 -476
@@ -1,440 +1,65 @@
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 } from '../../chunk-WQPX44YM.js';
2
+ import { ORGANIZATION_GRAPH_NODE_KIND_LABELS } from '../../chunk-5J4PDX26.js';
3
+ import { SemanticIcon } from '../../chunk-UROTM5OR.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-QXCDKE2O.js';
6
+ import { resolveOrganizationModel } from '../../chunk-T35FWDAB.js';
30
7
  import '../../chunk-2IFYDILW.js';
31
8
  import { useRouterContext } from '../../chunk-Q7DJKLEN.js';
32
9
  import '../../chunk-JA5ECJJB.js';
33
10
  import '../../chunk-HUJCU55S.js';
34
- import '../../chunk-E565XMTQ.js';
35
11
  import '../../chunk-JBWJ6WHZ.js';
36
12
  import '../../chunk-DT3QYZVU.js';
37
13
  import '../../chunk-RNP5R5I3.js';
38
- import '../../chunk-XQHZBA65.js';
39
- import '../../chunk-KRWALB24.js';
40
- import '../../chunk-VKIZUUPM.js';
41
14
  import '../../chunk-533DUEQY.js';
42
15
  import '../../chunk-DD3CCMCZ.js';
43
16
  import '../../chunk-2Q2JQSQO.js';
44
17
  import '../../chunk-KJ3QUBNU.js';
45
18
  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';
19
+ import '../../chunk-I2KLQ2HA.js';
20
+ import { IconBrain, IconCircleCheckFilled, IconCircleDashed, IconCheck, IconCopy } from '@tabler/icons-react';
21
+ import { Stack, Box, Group, Popover, Button, Badge, Divider, Text, UnstyledButton } from '@mantine/core';
49
22
  import { useClipboard } from '@mantine/hooks';
50
23
  import { useMemo, useState } from 'react';
51
24
  import { jsx, jsxs } from 'react/jsx-runtime';
52
25
 
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
- }
26
+ var WIRING_FACET_KINDS = ["action", "entity", "event", "resource"];
27
+ function isKnowledgeHidden(state) {
28
+ return state === "exclude";
398
29
  }
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;
30
+ function isWiringFacetActive(state) {
31
+ return state === "include";
409
32
  }
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
33
  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
34
  var KnowledgeSidebarMiddle = () => {
419
35
  const { navigate, currentPath } = useRouterContext();
420
- const { timeRange = "30d", organizationModel } = useElevasisFeatures();
36
+ const { organizationModel } = useElevasisSystems();
421
37
  if (currentPath.startsWith("/knowledge/command-view")) {
422
- return /* @__PURE__ */ jsx(CommandViewSidebarContent, { timeRange });
38
+ return null;
423
39
  }
424
40
  const orgModel = organizationModel ?? resolveOrganizationModel();
425
41
  return /* @__PURE__ */ jsx(KnowledgeBaseSidebarBody, { navigate, currentPath, organizationModel: orgModel });
426
42
  };
427
43
  function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel }) {
428
- const knowledgeNodes = useMemo(() => organizationModel.knowledge.nodes, [organizationModel]);
429
- const graph = useMemo(() => buildOrganizationGraph({ organizationModel }), [organizationModel]);
44
+ const knowledgeNodes = useMemo(() => Object.values(organizationModel.knowledge), [organizationModel]);
45
+ const graph = useMemo(() => getSharedOrganizationGraph(organizationModel), [organizationModel]);
430
46
  const [searchResults, setSearchResults] = useState(null);
431
- const [axis, setAxis] = useState("by-feature");
47
+ const [facetStates, setFacetStates] = useState({ knowledge: "include" });
48
+ const [facetsOpen, setFacetsOpen] = useState(false);
49
+ const activeFacetCount = useMemo(() => {
50
+ let count = 0;
51
+ if (isKnowledgeHidden(facetStates.knowledge)) count += 1;
52
+ for (const kind of WIRING_FACET_KINDS) {
53
+ if (isWiringFacetActive(facetStates[kind])) count += 1;
54
+ }
55
+ return count;
56
+ }, [facetStates]);
432
57
  const selectedNodeId = useMemo(() => {
433
58
  const match = currentPath.match(/^\/knowledge\/([^/]+)/);
434
59
  if (!match) return void 0;
435
60
  const segment = match[1];
436
- if (["by-feature", "by-kind", "config", "graph", "command-view"].includes(segment)) return void 0;
437
- return segment;
61
+ if (["system", "entity", "resource", "graph", "command-view"].includes(segment)) return void 0;
62
+ return decodeURIComponent(segment);
438
63
  }, [currentPath]);
439
64
  const handleSelect = (node) => {
440
65
  navigate(`/knowledge/${node.id}`);
@@ -442,29 +67,49 @@ function KnowledgeBaseSidebarBody({ navigate, currentPath, organizationModel })
442
67
  const handleSelectGraphNode = (node) => {
443
68
  navigate(`/knowledge/${node.id}`);
444
69
  };
70
+ const handleSelectDomain = (domainKey) => {
71
+ navigate(`/knowledge/domain:${domainKey}`);
72
+ };
73
+ const handleSelectGroup = (groupKey) => {
74
+ navigate(`/knowledge/group:${groupKey}`);
75
+ };
76
+ const handleSelectItem = (domainKey, itemId) => {
77
+ navigate(`/knowledge/item:${domainKey}:${encodeURIComponent(itemId)}`);
78
+ };
445
79
  return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: [
446
80
  /* @__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 }) }),
81
+ /* @__PURE__ */ jsx(Box, { p: "sm", pb: 0, children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
82
+ /* @__PURE__ */ jsx(Box, { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsx(KnowledgeSearchBar, { knowledgeNodes, onResults: setSearchResults }) }),
83
+ /* @__PURE__ */ jsxs(Popover, { position: "right-start", withArrow: true, shadow: "md", opened: facetsOpen, onChange: setFacetsOpen, offset: 6, children: [
84
+ /* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
85
+ Button,
86
+ {
87
+ size: "xs",
88
+ variant: activeFacetCount > 0 ? "light" : "subtle",
89
+ color: activeFacetCount > 0 ? "blue" : "gray",
90
+ onClick: () => setFacetsOpen((o) => !o),
91
+ "aria-expanded": facetsOpen,
92
+ rightSection: activeFacetCount > 0 ? /* @__PURE__ */ jsx(Badge, { size: "xs", circle: true, variant: "filled", color: "blue", children: activeFacetCount }) : null,
93
+ children: "Filter"
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ jsx(Popover.Dropdown, { p: 6, children: /* @__PURE__ */ jsx(FacetPanel, { value: facetStates, onChange: setFacetStates }) })
97
+ ] })
98
+ ] }) }),
459
99
  /* @__PURE__ */ jsx(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: searchResults ? /* @__PURE__ */ jsx(SearchResultsList, { searchResults, selectedNodeId, onSelect: handleSelect }) : /* @__PURE__ */ jsx(
460
- AxisBody,
100
+ KnowledgeTree,
461
101
  {
462
- axis,
463
102
  graph,
464
103
  knowledgeNodes,
465
- selectedNodeId,
466
- onSelect: handleSelect,
467
- onSelectGraphNode: handleSelectGraphNode
104
+ organizationModel,
105
+ omRooted: true,
106
+ facetStates,
107
+ onSelectNode: handleSelect,
108
+ onSelectGraphNode: handleSelectGraphNode,
109
+ onSelectDomain: handleSelectDomain,
110
+ onSelectGroup: handleSelectGroup,
111
+ onSelectItem: handleSelectItem,
112
+ selectedNodeId
468
113
  }
469
114
  ) })
470
115
  ] });
@@ -478,109 +123,53 @@ function SearchResultsList({ searchResults, selectedNodeId, onSelect }) {
478
123
  return /* @__PURE__ */ jsx(NodeButton, { node, isActive, onSelect }, node.id);
479
124
  }) });
480
125
  }
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,
126
+ function FacetPanel({ value, onChange }) {
127
+ const knowledgeHidden = isKnowledgeHidden(value.knowledge);
128
+ const toggleKnowledge = () => {
129
+ onChange({ ...value, knowledge: knowledgeHidden ? "include" : "exclude" });
130
+ };
131
+ const toggleWiring = (kind) => {
132
+ onChange({ ...value, [kind]: isWiringFacetActive(value[kind]) ? "neutral" : "include" });
133
+ };
134
+ return /* @__PURE__ */ jsxs(Stack, { gap: 4, miw: 200, children: [
135
+ /* @__PURE__ */ jsx(FacetRow, { label: "Hide knowledge nodes", active: knowledgeHidden, onClick: toggleKnowledge }),
136
+ /* @__PURE__ */ jsx(Divider, { my: 4 }),
137
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", pl: 6, pb: 2, tt: "uppercase", style: { letterSpacing: "0.05em" }, children: "Show under systems" }),
138
+ WIRING_FACET_KINDS.map((kind) => /* @__PURE__ */ jsx(
139
+ FacetRow,
569
140
  {
570
- node,
571
- isActive: isSelectedConfigNode(selectedNodeId, node),
572
- onSelect
141
+ label: ORGANIZATION_GRAPH_NODE_KIND_LABELS[kind],
142
+ active: isWiringFacetActive(value[kind]),
143
+ onClick: () => toggleWiring(kind)
573
144
  },
574
- node.id
575
- )) })
576
- ] }, kind)) });
145
+ kind
146
+ ))
147
+ ] });
577
148
  }
578
- function GroupHeader({ label, count, command }) {
149
+ function FacetRow({ label, active, onClick }) {
579
150
  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
- ] });
151
+ const StatusIcon = active ? IconCircleCheckFilled : IconCircleDashed;
152
+ const iconColor = active ? "var(--color-primary)" : "var(--color-text-subtle)";
153
+ return /* @__PURE__ */ jsx(
154
+ UnstyledButton,
155
+ {
156
+ onClick,
157
+ onMouseEnter: () => setHovered(true),
158
+ onMouseLeave: () => setHovered(false),
159
+ "aria-pressed": active,
160
+ "aria-label": `${label} ${active ? "on" : "off"}`,
161
+ style: {
162
+ padding: "6px 10px",
163
+ borderRadius: "var(--mantine-radius-sm)",
164
+ backgroundColor: hovered ? "var(--color-surface-hover)" : "transparent",
165
+ transition: "background-color var(--duration-fast) var(--easing)"
166
+ },
167
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
168
+ /* @__PURE__ */ jsx(StatusIcon, { size: 16, style: { color: iconColor, flexShrink: 0 } }),
169
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: active ? void 0 : "dimmed", children: label })
170
+ ] })
171
+ }
172
+ );
584
173
  }
585
174
  function NodeButton({ node, isActive, onSelect }) {
586
175
  const [hovered, setHovered] = useState(false);
@@ -614,63 +203,17 @@ function NodeButton({ node, isActive, onSelect }) {
614
203
  style: { color: SIDEBAR_TREE_ACCENT_COLOR }
615
204
  }
616
205
  ),
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
- )
206
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: node.title }),
207
+ hovered ? /* @__PURE__ */ jsx(CopyCommandControl, { command: getKnowledgeReadCommand(node.id), label: "Copy knowledge command", visible: true }) : null
626
208
  ] })
627
209
  }
628
210
  )
629
211
  }
630
212
  );
631
213
  }
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
214
  function getKnowledgeReadCommand(nodeId) {
669
215
  return `/knowledge read ${nodeId}`;
670
216
  }
671
- function getKnowledgeReadKindFolderCommand(kind) {
672
- return `/knowledge read-folder kind:${kind}`;
673
- }
674
217
  function CopyCommandControl({ command, label, visible }) {
675
218
  const clipboard = useClipboard({ timeout: 1500 });
676
219
  return /* @__PURE__ */ jsx(
@@ -706,34 +249,6 @@ function CopyCommandControl({ command, label, visible }) {
706
249
  }
707
250
  );
708
251
  }
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
252
  var KnowledgeSidebar = () => /* @__PURE__ */ jsx(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(KnowledgeSidebarMiddle, {}) });
738
253
 
739
254
  // src/features/knowledge/manifest.ts
@@ -741,7 +256,7 @@ var knowledgeSidebarWidth = 320;
741
256
  var defaultSidebarWidth = 250;
742
257
  var knowledgeManifest = {
743
258
  key: "knowledge",
744
- featureId: KNOWLEDGE_FEATURE_ID,
259
+ routePrefixes: ["/knowledge"],
745
260
  icon: IconBrain,
746
261
  sidebar: KnowledgeSidebar,
747
262
  sidebarWidth: ({ currentPath }) => {