@elevasis/ui 2.25.6 → 2.26.1

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 (105) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +15 -5
  3. package/dist/app/index.d.ts +61 -14
  4. package/dist/app/index.js +6 -6
  5. package/dist/charts/index.js +6 -5
  6. package/dist/chunk-3MEXPLWT.js +265 -0
  7. package/dist/{chunk-BDKM56TP.js → chunk-4KTLOK7K.js} +1 -1
  8. package/dist/{chunk-KMAXFJPH.js → chunk-CW3UNAF2.js} +5 -409
  9. package/dist/{chunk-HKBEURCV.js → chunk-G26INIF3.js} +1 -1
  10. package/dist/{chunk-7F3IQMLI.js → chunk-G66QFZXD.js} +11 -214
  11. package/dist/{chunk-QIW6OCEI.js → chunk-HLFFKKT3.js} +27 -373
  12. package/dist/chunk-JDNEWB5F.js +10 -0
  13. package/dist/{chunk-L7D6KNHV.js → chunk-JKBGDFX2.js} +890 -749
  14. package/dist/{chunk-YRKQNPK2.js → chunk-JPGX3533.js} +4 -3
  15. package/dist/chunk-KEFWANZY.js +155 -0
  16. package/dist/chunk-LH4GPYDX.js +448 -0
  17. package/dist/{chunk-JXSBOG2R.js → chunk-LWKZ3BCC.js} +5 -4
  18. package/dist/chunk-MYEOTM7D.js +92 -0
  19. package/dist/chunk-OGXKOMUT.js +412 -0
  20. package/dist/chunk-OHXU5WWK.js +3731 -0
  21. package/dist/chunk-ONFKASZI.js +2004 -0
  22. package/dist/{chunk-U36X6NZM.js → chunk-RIFTUOPE.js} +2 -14
  23. package/dist/{chunk-T6INEVX6.js → chunk-SGS4CQ2B.js} +1 -1
  24. package/dist/{chunk-C7IBFI5B.js → chunk-UPMX5GJI.js} +5 -5
  25. package/dist/{chunk-ARJPZ66V.js → chunk-UY5I2KOZ.js} +208 -3124
  26. package/dist/chunk-W2ZTLH7Y.js +662 -0
  27. package/dist/{chunk-KNISO652.js → chunk-WUVR4QY6.js} +9 -9
  28. package/dist/{chunk-Q5BEODAT.js → chunk-X2SUMO3P.js} +2 -1
  29. package/dist/{chunk-SNHGSCKH.js → chunk-XBMCDGHA.js} +1 -1
  30. package/dist/{chunk-N55DVMAG.js → chunk-XQQEKWTL.js} +2 -6
  31. package/dist/{chunk-SBQ4MYQV.js → chunk-XZSEPJZQ.js} +5 -6
  32. package/dist/{chunk-CPAJXBTL.js → chunk-YHBPR67D.js} +490 -676
  33. package/dist/{chunk-QARSVM7Q.js → chunk-YO2YORW4.js} +4 -4
  34. package/dist/{chunk-TAIX4NO3.js → chunk-ZFLM2YVW.js} +2 -2
  35. package/dist/components/index.css +15 -5
  36. package/dist/components/index.d.ts +202 -383
  37. package/dist/components/index.js +43 -429
  38. package/dist/components/navigation/index.css +25 -15
  39. package/dist/execution/index.d.ts +0 -73
  40. package/dist/features/auth/index.css +25 -15
  41. package/dist/features/crm/index.css +25 -15
  42. package/dist/features/crm/index.d.ts +49 -49
  43. package/dist/features/crm/index.js +14 -15
  44. package/dist/features/dashboard/index.css +25 -15
  45. package/dist/features/dashboard/index.js +18 -16
  46. package/dist/features/delivery/index.css +15 -5
  47. package/dist/features/delivery/index.js +14 -15
  48. package/dist/features/knowledge/index.css +611 -0
  49. package/dist/features/knowledge/index.js +375 -72
  50. package/dist/features/lead-gen/index.css +25 -15
  51. package/dist/features/lead-gen/index.d.ts +60 -21
  52. package/dist/features/lead-gen/index.js +16 -16
  53. package/dist/features/monitoring/index.css +15 -5
  54. package/dist/features/monitoring/index.js +17 -17
  55. package/dist/features/monitoring/requests/index.css +25 -15
  56. package/dist/features/monitoring/requests/index.js +13 -14
  57. package/dist/features/operations/index.css +25 -15
  58. package/dist/features/operations/index.d.ts +16 -98
  59. package/dist/features/operations/index.js +26 -22
  60. package/dist/features/settings/index.css +25 -15
  61. package/dist/features/settings/index.d.ts +1 -0
  62. package/dist/features/settings/index.js +15 -16
  63. package/dist/hooks/delivery/index.css +25 -15
  64. package/dist/hooks/delivery/index.js +2 -2
  65. package/dist/hooks/index.css +15 -5
  66. package/dist/hooks/index.d.ts +172 -380
  67. package/dist/hooks/index.js +13 -14
  68. package/dist/hooks/published.css +15 -5
  69. package/dist/hooks/published.d.ts +172 -380
  70. package/dist/hooks/published.js +13 -14
  71. package/dist/index.css +15 -5
  72. package/dist/index.d.ts +988 -403
  73. package/dist/index.js +15 -15
  74. package/dist/initialization/index.d.ts +1 -0
  75. package/dist/knowledge/index.d.ts +981 -41
  76. package/dist/knowledge/index.js +5449 -294
  77. package/dist/layout/index.d.ts +2 -0
  78. package/dist/layout/index.js +3 -2
  79. package/dist/organization/index.css +25 -15
  80. package/dist/organization/index.d.ts +1 -0
  81. package/dist/provider/index.css +25 -15
  82. package/dist/provider/index.d.ts +818 -26
  83. package/dist/provider/index.js +11 -11
  84. package/dist/provider/published.css +25 -15
  85. package/dist/provider/published.d.ts +817 -25
  86. package/dist/provider/published.js +8 -9
  87. package/dist/test-utils/index.js +2 -2
  88. package/dist/test-utils/setup.js +1 -1
  89. package/dist/theme/index.js +3 -2
  90. package/dist/theme/presets/index.d.ts +97 -0
  91. package/dist/theme/presets/index.js +3 -0
  92. package/dist/types/index.d.ts +71 -126
  93. package/dist/utils/index.js +1 -1
  94. package/dist/vite/index.d.ts +7 -0
  95. package/dist/vite/index.js +10 -0
  96. package/dist/vite-plugin-knowledge/index.d.ts +1 -33
  97. package/dist/vite-plugin-knowledge/index.js +1 -66
  98. package/package.json +16 -3
  99. package/src/knowledge/README.md +8 -8
  100. package/src/theme/presets/README.md +19 -0
  101. package/dist/chunk-5RLYII6P.js +0 -314
  102. package/dist/chunk-6U7AIIHF.js +0 -880
  103. package/dist/chunk-HAEJ4M54.js +0 -94
  104. package/dist/chunk-LPM7O6XM.js +0 -293
  105. /package/dist/{chunk-SGXXJE52.js → chunk-QD4X4H5A.js} +0 -0
@@ -1,880 +0,0 @@
1
- import { OrganizationModelProspectingSchema } from './chunk-BDKM56TP.js';
2
- import { LabelSchema, DescriptionSchema, DisplayMetadataSchema, ModelIdSchema, ColorTokenSchema, IconNameSchema, PathSchema, ReferenceIdsSchema, OrganizationModelSalesSchema } from './chunk-5RLYII6P.js';
3
- import { z } from 'zod';
4
-
5
- var OrganizationModelBrandingSchema = z.object({
6
- organizationName: LabelSchema,
7
- productName: LabelSchema,
8
- shortName: z.string().trim().min(1).max(40),
9
- description: DescriptionSchema.optional(),
10
- logos: z.object({
11
- light: z.string().trim().min(1).max(2048).optional(),
12
- dark: z.string().trim().min(1).max(2048).optional()
13
- }).default({})
14
- });
15
- var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
16
- organizationName: "Default Organization",
17
- productName: "Elevasis",
18
- shortName: "Elevasis",
19
- logos: {}
20
- };
21
- var ProjectsDomainStateSchema = DisplayMetadataSchema.extend({
22
- id: ModelIdSchema,
23
- order: z.number().int().min(0)
24
- });
25
- var OrganizationModelProjectsSchema = z.object({
26
- projectEntityId: ModelIdSchema,
27
- milestoneEntityId: ModelIdSchema,
28
- taskEntityId: ModelIdSchema,
29
- projectStatuses: z.array(ProjectsDomainStateSchema).min(1),
30
- milestoneStatuses: z.array(ProjectsDomainStateSchema).min(1),
31
- taskStatuses: z.array(ProjectsDomainStateSchema).min(1)
32
- });
33
- var DEFAULT_ORGANIZATION_MODEL_PROJECTS = {
34
- projectEntityId: "delivery.project",
35
- milestoneEntityId: "delivery.milestone",
36
- taskEntityId: "delivery.task",
37
- projectStatuses: [
38
- { id: "active", label: "Active", order: 1 },
39
- { id: "on_track", label: "On Track", order: 2 },
40
- { id: "at_risk", label: "At Risk", order: 3 },
41
- { id: "blocked", label: "Blocked", order: 4 },
42
- { id: "paused", label: "Paused", order: 5 },
43
- { id: "completed", label: "Completed", order: 6 }
44
- ],
45
- milestoneStatuses: [
46
- { id: "upcoming", label: "Upcoming", order: 1 },
47
- { id: "in_progress", label: "In Progress", order: 2 },
48
- { id: "blocked", label: "Blocked", order: 3 },
49
- { id: "overdue", label: "Overdue", order: 4 },
50
- { id: "completed", label: "Completed", order: 5 }
51
- ],
52
- taskStatuses: [
53
- { id: "planned", label: "Planned", order: 1 },
54
- { id: "in_progress", label: "In Progress", order: 2 },
55
- { id: "blocked", label: "Blocked", order: 3 },
56
- { id: "submitted", label: "Submitted", order: 4 },
57
- { id: "approved", label: "Approved", order: 5 },
58
- { id: "revision_requested", label: "Revision Requested", order: 6 },
59
- { id: "rejected", label: "Rejected", order: 7 },
60
- { id: "cancelled", label: "Cancelled", order: 8 },
61
- { id: "completed", label: "Completed", order: 9 }
62
- ]
63
- };
64
- var NodeIdPathSchema = z.string().trim().min(1).max(100).regex(/^([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node IDs must be lowercase dotted paths");
65
- var NodeIdStringSchema = z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
66
- var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]);
67
- var FeatureSchema = z.object({
68
- id: NodeIdPathSchema,
69
- label: LabelSchema,
70
- description: DescriptionSchema.optional(),
71
- enabled: z.boolean().default(true),
72
- path: PathSchema.optional(),
73
- icon: IconNameSchema.optional(),
74
- color: ColorTokenSchema.optional(),
75
- uiPosition: UiPositionSchema.optional(),
76
- requiresAdmin: z.boolean().optional(),
77
- devOnly: z.boolean().optional()
78
- });
79
- var SurfaceTypeSchema = z.enum(["page", "dashboard", "graph", "detail", "list", "settings"]);
80
- var SurfaceDefinitionSchema = z.object({
81
- id: ModelIdSchema,
82
- label: LabelSchema,
83
- path: PathSchema,
84
- surfaceType: SurfaceTypeSchema,
85
- description: DescriptionSchema.optional(),
86
- enabled: z.boolean().default(true),
87
- devOnly: z.boolean().optional(),
88
- icon: IconNameSchema.optional(),
89
- featureId: ModelIdSchema.optional(),
90
- featureIds: ReferenceIdsSchema,
91
- entityIds: ReferenceIdsSchema,
92
- resourceIds: ReferenceIdsSchema,
93
- capabilityIds: ReferenceIdsSchema,
94
- parentId: ModelIdSchema.optional()
95
- });
96
- var NavigationGroupSchema = z.object({
97
- id: ModelIdSchema,
98
- label: LabelSchema,
99
- placement: z.string().trim().min(1).max(50),
100
- surfaceIds: z.array(ModelIdSchema).default([])
101
- });
102
- var OrganizationModelNavigationSchema = z.object({
103
- defaultSurfaceId: ModelIdSchema.optional(),
104
- surfaces: z.array(SurfaceDefinitionSchema).default([]),
105
- groups: z.array(NavigationGroupSchema).default([])
106
- });
107
- var BusinessHoursDaySchema = z.object({
108
- open: z.string().trim().regex(/^\d{2}:\d{2}$/, "Expected HH:MM format"),
109
- close: z.string().trim().regex(/^\d{2}:\d{2}$/, "Expected HH:MM format")
110
- });
111
- var BusinessHoursSchema = z.object({
112
- monday: BusinessHoursDaySchema.optional(),
113
- tuesday: BusinessHoursDaySchema.optional(),
114
- wednesday: BusinessHoursDaySchema.optional(),
115
- thursday: BusinessHoursDaySchema.optional(),
116
- friday: BusinessHoursDaySchema.optional(),
117
- saturday: BusinessHoursDaySchema.optional(),
118
- sunday: BusinessHoursDaySchema.optional()
119
- }).default({});
120
- var IdentityDomainSchema = z.object({
121
- /** Why the organization exists — one or two plain-language sentences. */
122
- mission: z.string().trim().max(1e3).default(""),
123
- /** Long-term direction the organization is moving toward. */
124
- vision: z.string().trim().max(1e3).default(""),
125
- /** Legal registered name of the entity. */
126
- legalName: z.string().trim().max(200).default(""),
127
- /**
128
- * Type of legal entity (e.g. "LLC", "Corporation", "Sole Proprietor",
129
- * "Non-profit"). Free-form string so it covers any jurisdiction.
130
- */
131
- entityType: z.string().trim().max(100).default(""),
132
- /**
133
- * Primary jurisdiction of registration or operation
134
- * (e.g. "United States – Delaware", "Canada – Ontario").
135
- */
136
- jurisdiction: z.string().trim().max(200).default(""),
137
- /**
138
- * Industry category — broad classification (e.g. "Marketing Agency",
139
- * "Software / SaaS", "Professional Services").
140
- */
141
- industryCategory: z.string().trim().max(200).default(""),
142
- /**
143
- * Geographic focus — where the organization primarily operates or serves
144
- * (e.g. "North America", "Global", "Southeast Asia").
145
- */
146
- geographicFocus: z.string().trim().max(200).default(""),
147
- /**
148
- * IANA timezone identifier for the organization's primary operating timezone
149
- * (e.g. "America/Los_Angeles", "Europe/London", "UTC").
150
- */
151
- timeZone: z.string().trim().max(100).default("UTC"),
152
- /** Typical operating hours per day of week. Empty object means not configured. */
153
- businessHours: BusinessHoursSchema,
154
- /**
155
- * Long-form markdown capturing client context, problem narrative, and domain
156
- * background. Populated by /setup; surfaced to agents as organizational context.
157
- * Optional — many projects have no external client.
158
- */
159
- clientBrief: z.string().trim().default("")
160
- });
161
- var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
162
- mission: "",
163
- vision: "",
164
- legalName: "",
165
- entityType: "",
166
- jurisdiction: "",
167
- industryCategory: "",
168
- geographicFocus: "",
169
- timeZone: "UTC",
170
- businessHours: {},
171
- clientBrief: ""
172
- };
173
- var FirmographicsSchema = z.object({
174
- /** Industry vertical (e.g. "Marketing Agency", "Legal", "Real Estate"). */
175
- industry: z.string().trim().max(200).optional(),
176
- /**
177
- * Company headcount band (e.g. "1–10", "11–50", "51–200", "200+").
178
- * Free-form string to accommodate any band notation.
179
- */
180
- companySize: z.string().trim().max(100).optional(),
181
- /**
182
- * Primary geographic region the segment operates in or is targeted from
183
- * (e.g. "North America", "Europe", "Global").
184
- */
185
- region: z.string().trim().max(200).optional()
186
- });
187
- var CustomerSegmentSchema = z.object({
188
- /** Stable unique identifier for the segment (e.g. "segment-smb-agencies"). */
189
- id: z.string().trim().min(1).max(100),
190
- /** Human-readable name shown to agents and in UI (e.g. "SMB Marketing Agencies"). */
191
- name: z.string().trim().max(200).default(""),
192
- /** One or two sentences describing who this segment is. */
193
- description: z.string().trim().max(2e3).default(""),
194
- /**
195
- * The primary job(s) this segment is trying to get done — the goal they hire
196
- * a product/service to accomplish. Plain-language narrative or bullet list.
197
- */
198
- jobsToBeDone: z.string().trim().max(2e3).default(""),
199
- /**
200
- * Pains — frustrations, obstacles, and risks the segment experiences
201
- * when trying to accomplish their jobs-to-be-done.
202
- */
203
- pains: z.array(z.string().trim().max(500)).default([]),
204
- /**
205
- * Gains — outcomes and benefits the segment desires; positive motivators
206
- * beyond merely resolving pains.
207
- */
208
- gains: z.array(z.string().trim().max(500)).default([]),
209
- /** Firmographic profile for targeting and filtering. */
210
- firmographics: FirmographicsSchema.default({}),
211
- /**
212
- * Value proposition — one or two sentences stating why this organization's
213
- * offering is uniquely suited for this segment's needs.
214
- */
215
- valueProp: z.string().trim().max(2e3).default("")
216
- });
217
- var CustomersDomainSchema = z.object({
218
- segments: z.array(CustomerSegmentSchema).default([])
219
- });
220
- var DEFAULT_ORGANIZATION_MODEL_CUSTOMERS = {
221
- segments: []
222
- };
223
- var PricingModelSchema = z.enum(["one-time", "subscription", "usage-based", "custom"]);
224
- var ProductSchema = z.object({
225
- /** Stable unique identifier for the product (e.g. "product-starter-plan"). */
226
- id: z.string().trim().min(1).max(100),
227
- /** Human-readable name shown to agents and in UI (e.g. "Starter Plan"). */
228
- name: z.string().trim().max(200).default(""),
229
- /** One or two sentences describing what this product/service delivers. */
230
- description: z.string().trim().max(2e3).default(""),
231
- /**
232
- * How this product is priced:
233
- * - "one-time" — single purchase (setup fee, project fee)
234
- * - "subscription" — recurring (monthly/annual SaaS, retainer)
235
- * - "usage-based" — metered by consumption (API calls, seats)
236
- * - "custom" — negotiated or bespoke pricing
237
- */
238
- pricingModel: PricingModelSchema.default("custom"),
239
- /** Base price amount (≥ 0). Currency unit defined by `currency`. */
240
- price: z.number().min(0).default(0),
241
- /**
242
- * ISO 4217 currency code (e.g. "USD", "EUR", "GBP").
243
- * Free-form string to accommodate any currency; defaults to "USD".
244
- */
245
- currency: z.string().trim().max(10).default("USD"),
246
- /**
247
- * IDs of customer segments this product targets.
248
- * Each id must reference a declared `customers.segments[].id`.
249
- * Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
250
- */
251
- targetSegmentIds: z.array(z.string().trim().min(1)).default([]),
252
- /**
253
- * Optional: ID of the platform feature responsible for delivering this product.
254
- * When present, must reference a declared `features[].id`.
255
- * Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
256
- */
257
- deliveryFeatureId: z.string().trim().min(1).optional()
258
- });
259
- var OfferingsDomainSchema = z.object({
260
- products: z.array(ProductSchema).default([])
261
- });
262
- var DEFAULT_ORGANIZATION_MODEL_OFFERINGS = {
263
- products: []
264
- };
265
- var RoleSchema = z.object({
266
- /** Stable unique identifier for the role (e.g. "role-ceo", "role-head-of-sales"). */
267
- id: z.string().trim().min(1).max(100),
268
- /** Human-readable title shown to agents and in UI (e.g. "CEO", "Head of Sales"). */
269
- title: z.string().trim().min(1).max(200),
270
- /**
271
- * List of responsibilities this role owns — plain-language descriptions of
272
- * what the person in this role is accountable for delivering.
273
- * Defaults to empty array so minimal role definitions stay concise.
274
- */
275
- responsibilities: z.array(z.string().trim().max(500)).default([]),
276
- /**
277
- * Optional: ID of another role this role reports to.
278
- * When present, must reference another `roles[].id` in the same organization.
279
- * Cross-reference enforced in `OrganizationModelSchema.superRefine()`.
280
- * Absence indicates a top-level role (no reporting line).
281
- */
282
- reportsToId: z.string().trim().min(1).max(100).optional(),
283
- /**
284
- * Optional: name or email of the person currently holding this role.
285
- * Free-form string — supports "Alice Johnson", "alice@example.com", or
286
- * any human-readable identifier. Not validated against any user registry.
287
- */
288
- heldBy: z.string().trim().max(200).optional()
289
- });
290
- var RolesDomainSchema = z.object({
291
- roles: z.array(RoleSchema).default([])
292
- });
293
- var DEFAULT_ORGANIZATION_MODEL_ROLES = {
294
- roles: []
295
- };
296
- var KeyResultSchema = z.object({
297
- /** Stable unique identifier for the measurable outcome (e.g. "kr-revenue-q1"). */
298
- id: z.string().trim().min(1).max(100),
299
- /** Plain-language description of this measurable outcome (e.g. "Increase trial-to-paid conversion"). */
300
- description: z.string().trim().min(1).max(500),
301
- /**
302
- * What is being measured — the metric name (e.g. "monthly revenue", "NPS score",
303
- * "trial-to-paid conversion rate"). Free-form string.
304
- */
305
- targetMetric: z.string().trim().min(1).max(200),
306
- /** Current measured value. Defaults to 0 when not yet tracked. */
307
- currentValue: z.number().default(0),
308
- /**
309
- * Target value to reach for this measurable outcome to be considered achieved.
310
- * Optional — omit if the outcome is directional (e.g. "reduce churn") without
311
- * a hard numeric target.
312
- */
313
- targetValue: z.number().optional()
314
- });
315
- var ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
316
- var ObjectiveSchema = z.object({
317
- /** Stable unique identifier for the goal (e.g. "goal-grow-arr-q1-2026"). */
318
- id: z.string().trim().min(1).max(100),
319
- /** Plain-language description of what the organization wants to achieve. */
320
- description: z.string().trim().min(1).max(1e3),
321
- /**
322
- * Start of the period this goal is active for — ISO 8601 date string (YYYY-MM-DD).
323
- * Must be strictly before `periodEnd`.
324
- */
325
- periodStart: z.string().regex(ISO_DATE_REGEX, "periodStart must be an ISO date string (YYYY-MM-DD)"),
326
- /**
327
- * End of the period this goal is active for — ISO 8601 date string (YYYY-MM-DD).
328
- * Must be strictly after `periodStart`.
329
- * Enforced via `OrganizationModelSchema.superRefine()`.
330
- */
331
- periodEnd: z.string().regex(ISO_DATE_REGEX, "periodEnd must be an ISO date string (YYYY-MM-DD)"),
332
- /**
333
- * List of measurable outcomes that define success for this goal.
334
- * Defaults to empty array so goals can be declared before outcomes are defined.
335
- */
336
- keyResults: z.array(KeyResultSchema).default([])
337
- });
338
- var GoalsDomainSchema = z.object({
339
- objectives: z.array(ObjectiveSchema).default([])
340
- });
341
- var DEFAULT_ORGANIZATION_MODEL_GOALS = {
342
- objectives: []
343
- };
344
- var OperationSemanticClassSchema = z.enum(["queue", "executions", "sessions", "notifications", "schedules"]);
345
- var OperationEntrySchema = z.object({
346
- id: z.string().trim().min(1).max(100),
347
- label: z.string().trim().min(1).max(120),
348
- semanticClass: OperationSemanticClassSchema,
349
- /** Optional reference to the feature that owns this runtime entity. */
350
- featureId: z.string().trim().min(1).max(100).optional(),
351
- /**
352
- * Optional pointer to the status semanticClass values that apply to this
353
- * entity — ties operations back to the statuses domain for vibe rendering.
354
- */
355
- supportedStatusSemanticClass: z.array(z.string().trim().min(1).max(80)).optional()
356
- });
357
- var OperationsDomainSchema = z.object({
358
- entries: z.array(OperationEntrySchema).default([])
359
- });
360
- var DEFAULT_ORGANIZATION_MODEL_OPERATIONS = {
361
- entries: [
362
- // --- queue (HITL command queue) ---
363
- {
364
- id: "operations.queue",
365
- label: "HITL Queue",
366
- semanticClass: "queue",
367
- featureId: "operations",
368
- supportedStatusSemanticClass: ["queue"]
369
- },
370
- // --- executions (workflow / agent executions) ---
371
- {
372
- id: "operations.executions",
373
- label: "Executions",
374
- semanticClass: "executions",
375
- featureId: "operations",
376
- supportedStatusSemanticClass: ["execution"]
377
- },
378
- // --- sessions (agent conversation sessions) ---
379
- {
380
- id: "operations.sessions",
381
- label: "Sessions",
382
- semanticClass: "sessions",
383
- featureId: "operations"
384
- },
385
- // --- notifications (platform in-app notifications) ---
386
- {
387
- id: "operations.notifications",
388
- label: "Notifications",
389
- semanticClass: "notifications",
390
- featureId: "monitoring"
391
- },
392
- // --- schedules (task scheduler) ---
393
- {
394
- id: "operations.schedules",
395
- label: "Schedules",
396
- semanticClass: "schedules",
397
- featureId: "operations",
398
- supportedStatusSemanticClass: ["schedule", "schedule.run"]
399
- }
400
- ]
401
- };
402
- var StatusSemanticClassSchema = z.enum([
403
- "delivery.task",
404
- "delivery.project",
405
- "delivery.milestone",
406
- "queue",
407
- "execution",
408
- "schedule",
409
- "schedule.run",
410
- "request"
411
- ]);
412
- var StatusEntrySchema = z.object({
413
- id: z.string().trim().min(1).max(100),
414
- label: z.string().trim().min(1).max(120),
415
- semanticClass: StatusSemanticClassSchema,
416
- category: z.string().trim().min(1).max(80).optional()
417
- });
418
- var StatusesDomainSchema = z.object({
419
- entries: z.array(StatusEntrySchema).default([])
420
- });
421
- var DEFAULT_ORGANIZATION_MODEL_STATUSES = {
422
- entries: [
423
- // --- delivery.task (TaskStatus — 9 values) ---
424
- { id: "delivery.task.planned", label: "Planned", semanticClass: "delivery.task", category: "delivery" },
425
- { id: "delivery.task.in_progress", label: "In Progress", semanticClass: "delivery.task", category: "delivery" },
426
- { id: "delivery.task.blocked", label: "Blocked", semanticClass: "delivery.task", category: "delivery" },
427
- { id: "delivery.task.submitted", label: "Submitted", semanticClass: "delivery.task", category: "delivery" },
428
- { id: "delivery.task.approved", label: "Approved", semanticClass: "delivery.task", category: "delivery" },
429
- {
430
- id: "delivery.task.revision_requested",
431
- label: "Revision Requested",
432
- semanticClass: "delivery.task",
433
- category: "delivery"
434
- },
435
- { id: "delivery.task.rejected", label: "Rejected", semanticClass: "delivery.task", category: "delivery" },
436
- { id: "delivery.task.cancelled", label: "Cancelled", semanticClass: "delivery.task", category: "delivery" },
437
- { id: "delivery.task.completed", label: "Completed", semanticClass: "delivery.task", category: "delivery" },
438
- // --- delivery.project (ProjectStatus — 6 values) ---
439
- { id: "delivery.project.active", label: "Active", semanticClass: "delivery.project", category: "delivery" },
440
- { id: "delivery.project.on_track", label: "On Track", semanticClass: "delivery.project", category: "delivery" },
441
- { id: "delivery.project.at_risk", label: "At Risk", semanticClass: "delivery.project", category: "delivery" },
442
- { id: "delivery.project.blocked", label: "Blocked", semanticClass: "delivery.project", category: "delivery" },
443
- { id: "delivery.project.paused", label: "Paused", semanticClass: "delivery.project", category: "delivery" },
444
- { id: "delivery.project.completed", label: "Completed", semanticClass: "delivery.project", category: "delivery" },
445
- // --- delivery.milestone (MilestoneStatus — 5 values) ---
446
- {
447
- id: "delivery.milestone.upcoming",
448
- label: "Upcoming",
449
- semanticClass: "delivery.milestone",
450
- category: "delivery"
451
- },
452
- {
453
- id: "delivery.milestone.in_progress",
454
- label: "In Progress",
455
- semanticClass: "delivery.milestone",
456
- category: "delivery"
457
- },
458
- {
459
- id: "delivery.milestone.blocked",
460
- label: "Blocked",
461
- semanticClass: "delivery.milestone",
462
- category: "delivery"
463
- },
464
- { id: "delivery.milestone.overdue", label: "Overdue", semanticClass: "delivery.milestone", category: "delivery" },
465
- {
466
- id: "delivery.milestone.completed",
467
- label: "Completed",
468
- semanticClass: "delivery.milestone",
469
- category: "delivery"
470
- },
471
- // --- queue (QueueTaskStatus — 5 values, maps hitl/command-queue tasks) ---
472
- { id: "queue.pending", label: "Pending", semanticClass: "queue", category: "queue" },
473
- { id: "queue.processing", label: "Processing", semanticClass: "queue", category: "queue" },
474
- { id: "queue.completed", label: "Completed", semanticClass: "queue", category: "queue" },
475
- { id: "queue.failed", label: "Failed", semanticClass: "queue", category: "queue" },
476
- { id: "queue.expired", label: "Expired", semanticClass: "queue", category: "queue" },
477
- // --- execution (ExecutionStatus — 5 values) ---
478
- { id: "execution.pending", label: "Pending", semanticClass: "execution", category: "execution" },
479
- { id: "execution.running", label: "Running", semanticClass: "execution", category: "execution" },
480
- { id: "execution.completed", label: "Completed", semanticClass: "execution", category: "execution" },
481
- { id: "execution.failed", label: "Failed", semanticClass: "execution", category: "execution" },
482
- { id: "execution.warning", label: "Warning", semanticClass: "execution", category: "execution" },
483
- // --- schedule (schedule status — 4 values) ---
484
- { id: "schedule.active", label: "Active", semanticClass: "schedule", category: "schedule" },
485
- { id: "schedule.paused", label: "Paused", semanticClass: "schedule", category: "schedule" },
486
- { id: "schedule.completed", label: "Completed", semanticClass: "schedule", category: "schedule" },
487
- { id: "schedule.cancelled", label: "Cancelled", semanticClass: "schedule", category: "schedule" },
488
- // --- schedule.run (schedule run status — 4 values) ---
489
- { id: "schedule.run.running", label: "Running", semanticClass: "schedule.run", category: "schedule" },
490
- { id: "schedule.run.completed", label: "Completed", semanticClass: "schedule.run", category: "schedule" },
491
- { id: "schedule.run.failed", label: "Failed", semanticClass: "schedule.run", category: "schedule" },
492
- { id: "schedule.run.cancelled", label: "Cancelled", semanticClass: "schedule.run", category: "schedule" },
493
- // --- request (RequestStatus — 4 values, maps reported_requests) ---
494
- { id: "request.open", label: "Open", semanticClass: "request", category: "request" },
495
- { id: "request.investigating", label: "Investigating", semanticClass: "request", category: "request" },
496
- { id: "request.resolved", label: "Resolved", semanticClass: "request", category: "request" },
497
- { id: "request.wont_fix", label: "Won't Fix", semanticClass: "request", category: "request" }
498
- ]
499
- };
500
- var KnowledgeLinkSchema = z.object({
501
- nodeId: NodeIdStringSchema
502
- });
503
- var OrgKnowledgeKindSchema = z.enum(["playbook", "strategy", "reference"]);
504
- var OrgKnowledgeNodeSchema = z.object({
505
- id: ModelIdSchema,
506
- kind: OrgKnowledgeKindSchema,
507
- title: z.string().trim().min(1).max(200),
508
- summary: z.string().trim().min(1).max(1e3),
509
- /** Raw MDX string. Phase 2 will introduce a structured block format. */
510
- body: z.string().trim().min(1),
511
- /**
512
- * Graph links to other OM nodes this knowledge node governs.
513
- * Each link emits a `governs` edge: knowledge-node -> target node.
514
- */
515
- links: z.array(KnowledgeLinkSchema).default([]),
516
- /** Identifiers of the roles or members who own this knowledge node. */
517
- ownerIds: z.array(ModelIdSchema).default([]),
518
- /** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
519
- updatedAt: z.string().trim().min(1).max(50)
520
- });
521
- var KnowledgeDomainSchema = z.object({
522
- nodes: z.array(OrgKnowledgeNodeSchema).default([])
523
- });
524
-
525
- // ../core/src/organization-model/schema.ts
526
- var OrganizationModelSchemaBase = z.object({
527
- version: z.literal(1).default(1),
528
- features: z.array(FeatureSchema).default([]),
529
- branding: OrganizationModelBrandingSchema,
530
- navigation: OrganizationModelNavigationSchema.default({ surfaces: [], groups: [] }),
531
- sales: OrganizationModelSalesSchema,
532
- prospecting: OrganizationModelProspectingSchema,
533
- projects: OrganizationModelProjectsSchema,
534
- identity: IdentityDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_IDENTITY),
535
- customers: CustomersDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_CUSTOMERS),
536
- offerings: OfferingsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_OFFERINGS),
537
- roles: RolesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ROLES),
538
- goals: GoalsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_GOALS),
539
- statuses: StatusesDomainSchema.default({ entries: [] }),
540
- operations: OperationsDomainSchema.default({ entries: [] }),
541
- knowledge: KnowledgeDomainSchema.default({ nodes: [] })
542
- });
543
- function addIssue(ctx, path, message) {
544
- ctx.addIssue({
545
- code: z.ZodIssueCode.custom,
546
- path,
547
- message
548
- });
549
- }
550
- function collectIds(items, ctx, collectionPath, label) {
551
- const itemsById = /* @__PURE__ */ new Map();
552
- items.forEach((item, index) => {
553
- if (itemsById.has(item.id)) {
554
- addIssue(ctx, [...collectionPath, index, "id"], `${label} id "${item.id}" must be unique`);
555
- return;
556
- }
557
- itemsById.set(item.id, item);
558
- });
559
- return itemsById;
560
- }
561
- var LEGACY_FEATURE_ALIASES = /* @__PURE__ */ new Map([
562
- ["crm", "sales.crm"],
563
- ["lead-gen", "sales.lead-gen"],
564
- ["submitted-requests", "monitoring.submitted-requests"]
565
- ]);
566
- function hasFeature(featuresById, featureId) {
567
- return featuresById.has(featureId) || featuresById.has(LEGACY_FEATURE_ALIASES.get(featureId) ?? "");
568
- }
569
- var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ctx) => {
570
- const featuresById = collectIds(model.features, ctx, ["features"], "Feature");
571
- model.features.forEach((feature, featureIndex) => {
572
- const segments = feature.id.split(".");
573
- if (segments.length > 1) {
574
- const parentId = segments.slice(0, -1).join(".");
575
- if (!featuresById.has(parentId)) {
576
- addIssue(
577
- ctx,
578
- ["features", featureIndex, "id"],
579
- `Feature "${feature.id}" references unknown parent "${parentId}"`
580
- );
581
- }
582
- }
583
- const hasChildren = model.features.some(
584
- (candidate) => candidate.id.startsWith(`${feature.id}.`) && candidate.id !== feature.id
585
- );
586
- if (hasChildren && feature.enabled) {
587
- const hasEnabledDescendant = model.features.some(
588
- (candidate) => candidate.id.startsWith(`${feature.id}.`) && candidate.enabled
589
- );
590
- if (!hasEnabledDescendant) {
591
- addIssue(
592
- ctx,
593
- ["features", featureIndex, "enabled"],
594
- `Feature "${feature.id}" is enabled but has no enabled descendants`
595
- );
596
- }
597
- }
598
- });
599
- const segmentsById = new Map(model.customers.segments.map((seg) => [seg.id, seg]));
600
- model.offerings.products.forEach((product, productIndex) => {
601
- product.targetSegmentIds.forEach((segmentId, segmentIndex) => {
602
- if (!segmentsById.has(segmentId)) {
603
- addIssue(
604
- ctx,
605
- ["offerings", "products", productIndex, "targetSegmentIds", segmentIndex],
606
- `Product "${product.id}" references unknown customer segment "${segmentId}"`
607
- );
608
- }
609
- });
610
- if (product.deliveryFeatureId !== void 0 && !hasFeature(featuresById, product.deliveryFeatureId)) {
611
- addIssue(
612
- ctx,
613
- ["offerings", "products", productIndex, "deliveryFeatureId"],
614
- `Product "${product.id}" references unknown delivery feature "${product.deliveryFeatureId}"`
615
- );
616
- }
617
- });
618
- model.goals.objectives.forEach((objective, index) => {
619
- if (objective.periodEnd <= objective.periodStart) {
620
- addIssue(
621
- ctx,
622
- ["goals", "objectives", index, "periodEnd"],
623
- `Goal "${objective.id}" has periodEnd "${objective.periodEnd}" which must be strictly after periodStart "${objective.periodStart}"`
624
- );
625
- }
626
- });
627
- const rolesById = new Map(model.roles.roles.map((role) => [role.id, role]));
628
- model.roles.roles.forEach((role, roleIndex) => {
629
- if (role.reportsToId !== void 0 && !rolesById.has(role.reportsToId)) {
630
- addIssue(
631
- ctx,
632
- ["roles", "roles", roleIndex, "reportsToId"],
633
- `Role "${role.id}" references unknown reportsToId "${role.reportsToId}"`
634
- );
635
- }
636
- });
637
- });
638
-
639
- // ../core/src/organization-model/graph/schema.ts
640
- var OrganizationGraphNodeKindSchema = z.enum([
641
- "organization",
642
- "feature",
643
- "surface",
644
- "entity",
645
- "capability",
646
- "resource",
647
- "knowledge"
648
- ]);
649
- var OrganizationGraphEdgeKindSchema = z.enum([
650
- "contains",
651
- "references",
652
- "exposes",
653
- "maps_to",
654
- "operates-on",
655
- "uses",
656
- "governs"
657
- ]);
658
- var OrganizationGraphNodeSchema = z.object({
659
- id: z.string().trim().min(1).max(200),
660
- kind: OrganizationGraphNodeKindSchema,
661
- label: LabelSchema,
662
- sourceId: z.string().trim().min(1).max(255).optional(),
663
- description: DescriptionSchema.optional(),
664
- enabled: z.boolean().optional(),
665
- featureId: z.string().trim().min(1).max(100).optional(),
666
- resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]).optional()
667
- });
668
- var OrganizationGraphEdgeSchema = z.object({
669
- id: z.string().trim().min(1).max(250),
670
- kind: OrganizationGraphEdgeKindSchema,
671
- sourceId: z.string().trim().min(1).max(200),
672
- targetId: z.string().trim().min(1).max(200),
673
- label: z.string().trim().min(1).max(120).optional(),
674
- relationshipType: z.enum(["triggers", "uses", "approval"]).optional()
675
- });
676
- var OrganizationGraphSchema = z.object({
677
- version: z.literal(1),
678
- organizationModelVersion: OrganizationModelSchema.shape.version,
679
- nodes: z.array(OrganizationGraphNodeSchema),
680
- edges: z.array(OrganizationGraphEdgeSchema)
681
- });
682
- var BuildOrganizationGraphInputSchema = z.object({
683
- organizationModel: OrganizationModelSchema,
684
- commandViewData: z.unknown().optional()
685
- });
686
-
687
- // ../core/src/organization-model/graph/build.ts
688
- function nodeId(kind, sourceId) {
689
- return kind === "organization" ? "organization-model" : `${kind}:${sourceId ?? ""}`;
690
- }
691
- function edgeId(kind, sourceId, targetId, variant) {
692
- return variant ? `edge:${kind}:${variant}:${sourceId}:${targetId}` : `edge:${kind}:${sourceId}:${targetId}`;
693
- }
694
- function pushUniqueNode(nodes, seen, node) {
695
- if (seen.has(node.id)) return;
696
- seen.add(node.id);
697
- nodes.push(node);
698
- }
699
- function pushUniqueEdge(edges, seen, edge) {
700
- if (seen.has(edge.id)) return;
701
- seen.add(edge.id);
702
- edges.push(edge);
703
- }
704
- function upsertResourceNode(nodes, seen, resourceNodesById, node) {
705
- const existing = resourceNodesById.get(node.id);
706
- if (existing) {
707
- if (!existing.label || existing.label === existing.sourceId) {
708
- existing.label = node.label;
709
- }
710
- if (!existing.description && node.description) {
711
- existing.description = node.description;
712
- }
713
- if (!existing.sourceId && node.sourceId) {
714
- existing.sourceId = node.sourceId;
715
- }
716
- if (!existing.resourceType && node.resourceType) {
717
- existing.resourceType = node.resourceType;
718
- }
719
- return existing;
720
- }
721
- resourceNodesById.set(node.id, node);
722
- pushUniqueNode(nodes, seen, node);
723
- return node;
724
- }
725
- function ensureResourceNode(nodes, seen, resourceNodesById, resourceId) {
726
- const existing = resourceNodesById.get(nodeId("resource", resourceId));
727
- if (existing) return existing;
728
- return upsertResourceNode(nodes, seen, resourceNodesById, {
729
- id: nodeId("resource", resourceId),
730
- kind: "resource",
731
- label: resourceId,
732
- sourceId: resourceId
733
- });
734
- }
735
- function normalizeCommandViewResourceType(resourceType) {
736
- return resourceType === "human" ? "human_checkpoint" : resourceType;
737
- }
738
- function collectCommandViewResources(commandViewData) {
739
- return [
740
- ...commandViewData.workflows,
741
- ...commandViewData.agents,
742
- ...commandViewData.triggers,
743
- ...commandViewData.integrations,
744
- ...commandViewData.externalResources,
745
- ...commandViewData.humanCheckpoints
746
- ];
747
- }
748
- function pushResourceLinks(edges, edgeIds, resourceNodeId, links) {
749
- for (const link of links ?? []) {
750
- pushUniqueEdge(edges, edgeIds, {
751
- id: edgeId(link.kind, resourceNodeId, link.nodeId),
752
- kind: link.kind,
753
- sourceId: resourceNodeId,
754
- targetId: link.nodeId
755
- });
756
- }
757
- }
758
- function buildOrganizationGraph(input) {
759
- const parsed = BuildOrganizationGraphInputSchema.parse(input);
760
- const organizationModel = parsed.organizationModel;
761
- const commandViewData = parsed.commandViewData;
762
- const nodes = [];
763
- const edges = [];
764
- const nodeIds = /* @__PURE__ */ new Set();
765
- const edgeIds = /* @__PURE__ */ new Set();
766
- const resourceNodesById = /* @__PURE__ */ new Map();
767
- const organizationNode = {
768
- id: nodeId("organization"),
769
- kind: "organization",
770
- label: "Organization Model"
771
- };
772
- pushUniqueNode(nodes, nodeIds, organizationNode);
773
- for (const feature of [...organizationModel.features].sort((a, b) => a.id.localeCompare(b.id))) {
774
- const id = nodeId("feature", feature.id);
775
- pushUniqueNode(nodes, nodeIds, {
776
- id,
777
- kind: "feature",
778
- label: feature.label,
779
- sourceId: feature.id,
780
- description: feature.description,
781
- enabled: feature.enabled,
782
- featureId: feature.id
783
- });
784
- pushUniqueEdge(edges, edgeIds, {
785
- id: edgeId("contains", organizationNode.id, id),
786
- kind: "contains",
787
- sourceId: organizationNode.id,
788
- targetId: id
789
- });
790
- const parentId = feature.id.includes(".") ? feature.id.slice(0, feature.id.lastIndexOf(".")) : void 0;
791
- if (parentId) {
792
- pushUniqueEdge(edges, edgeIds, {
793
- id: edgeId("contains", nodeId("feature", parentId), id),
794
- kind: "contains",
795
- sourceId: nodeId("feature", parentId),
796
- targetId: id
797
- });
798
- }
799
- }
800
- for (const node of [...organizationModel.knowledge?.nodes ?? []].sort((a, b) => a.id.localeCompare(b.id))) {
801
- const id = nodeId("knowledge", node.id);
802
- pushUniqueNode(nodes, nodeIds, {
803
- id,
804
- kind: "knowledge",
805
- label: node.title,
806
- sourceId: node.id,
807
- description: node.summary
808
- });
809
- pushUniqueEdge(edges, edgeIds, {
810
- id: edgeId("contains", organizationNode.id, id),
811
- kind: "contains",
812
- sourceId: organizationNode.id,
813
- targetId: id
814
- });
815
- for (const link of node.links) {
816
- pushUniqueEdge(edges, edgeIds, {
817
- id: edgeId("governs", id, link.nodeId),
818
- kind: "governs",
819
- sourceId: id,
820
- targetId: link.nodeId
821
- });
822
- }
823
- }
824
- if (commandViewData) {
825
- const commandViewResources = collectCommandViewResources(commandViewData).sort(
826
- (a, b) => a.resourceId.localeCompare(b.resourceId)
827
- );
828
- for (const resource of commandViewResources) {
829
- const id = nodeId("resource", resource.resourceId);
830
- const resourceNode = upsertResourceNode(nodes, nodeIds, resourceNodesById, {
831
- id,
832
- kind: "resource",
833
- label: resource.name,
834
- sourceId: resource.resourceId,
835
- description: resource.description,
836
- resourceType: normalizeCommandViewResourceType(resource.type)
837
- });
838
- pushUniqueEdge(edges, edgeIds, {
839
- id: edgeId("contains", organizationNode.id, resourceNode.id),
840
- kind: "contains",
841
- sourceId: organizationNode.id,
842
- targetId: resourceNode.id
843
- });
844
- pushResourceLinks(edges, edgeIds, resourceNode.id, resource.links);
845
- }
846
- for (const relationship of [...commandViewData.edges].sort((a, b) => a.id.localeCompare(b.id))) {
847
- const sourceNode = ensureResourceNode(nodes, nodeIds, resourceNodesById, relationship.source);
848
- const targetNode = ensureResourceNode(nodes, nodeIds, resourceNodesById, relationship.target);
849
- pushUniqueEdge(edges, edgeIds, {
850
- id: edgeId("contains", organizationNode.id, sourceNode.id),
851
- kind: "contains",
852
- sourceId: organizationNode.id,
853
- targetId: sourceNode.id
854
- });
855
- pushUniqueEdge(edges, edgeIds, {
856
- id: edgeId("contains", organizationNode.id, targetNode.id),
857
- kind: "contains",
858
- sourceId: organizationNode.id,
859
- targetId: targetNode.id
860
- });
861
- pushUniqueEdge(edges, edgeIds, {
862
- id: edgeId("references", sourceNode.id, targetNode.id, relationship.relationship),
863
- kind: "references",
864
- sourceId: sourceNode.id,
865
- targetId: targetNode.id,
866
- label: relationship.relationship,
867
- relationshipType: relationship.relationship
868
- });
869
- }
870
- }
871
- const graph = {
872
- version: 1,
873
- organizationModelVersion: organizationModel.version,
874
- nodes,
875
- edges
876
- };
877
- return OrganizationGraphSchema.parse(graph);
878
- }
879
-
880
- export { DEFAULT_ORGANIZATION_MODEL_BRANDING, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_IDENTITY, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_OPERATIONS, DEFAULT_ORGANIZATION_MODEL_PROJECTS, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, OrganizationModelSchema, buildOrganizationGraph };