@elevasis/core 0.24.1 → 0.26.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.
- package/dist/index.d.ts +239 -86
- package/dist/index.js +474 -1346
- package/dist/knowledge/index.d.ts +57 -39
- package/dist/knowledge/index.js +1 -1
- package/dist/organization-model/index.d.ts +239 -86
- package/dist/organization-model/index.js +474 -1346
- package/dist/test-utils/index.d.ts +24 -31
- package/dist/test-utils/index.js +76 -1238
- package/package.json +1 -1
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +108 -96
- package/src/business/acquisition/api-schemas.test.ts +70 -77
- package/src/business/acquisition/api-schemas.ts +21 -42
- package/src/business/acquisition/derive-actions.test.ts +11 -21
- package/src/business/acquisition/derive-actions.ts +61 -14
- package/src/business/acquisition/ontology-validation.ts +4 -4
- package/src/business/acquisition/types.ts +7 -8
- package/src/execution/engine/llm/adapters/__tests__/openrouter.integration.test.ts +10 -10
- package/src/knowledge/__tests__/queries.test.ts +960 -546
- package/src/knowledge/format.ts +322 -100
- package/src/knowledge/index.ts +18 -5
- package/src/knowledge/queries.ts +1004 -240
- package/src/organization-model/__tests__/content-kinds-registry.test.ts +35 -210
- package/src/organization-model/__tests__/defaults.test.ts +4 -4
- package/src/organization-model/__tests__/deprecate-helpers.test.ts +71 -0
- package/src/organization-model/__tests__/domains/actions.test.ts +12 -36
- package/src/organization-model/__tests__/domains/offerings.test.ts +13 -6
- package/src/organization-model/__tests__/domains/resources.test.ts +497 -350
- package/src/organization-model/__tests__/domains/systems.test.ts +6 -7
- package/src/organization-model/__tests__/flatten-additive-merge.test.ts +68 -80
- package/src/organization-model/__tests__/foundation.test.ts +81 -14
- package/src/organization-model/__tests__/graph.test.ts +662 -694
- package/src/organization-model/__tests__/knowledge.test.ts +31 -17
- package/src/organization-model/__tests__/lookup-helpers.test.ts +128 -438
- package/src/organization-model/__tests__/migration-helpers.test.ts +362 -591
- package/src/organization-model/__tests__/prospecting-ssot.test.ts +68 -103
- package/src/organization-model/__tests__/published-zero-leak.test.ts +17 -0
- package/src/organization-model/__tests__/recursive-system-schema.test.ts +159 -532
- package/src/organization-model/__tests__/resolve.test.ts +88 -49
- package/src/organization-model/__tests__/scaffolders.test.ts +93 -0
- package/src/organization-model/__tests__/schema.test.ts +65 -56
- package/src/organization-model/catalogs/lead-gen.ts +0 -103
- package/src/organization-model/defaults.ts +17 -702
- package/src/organization-model/domains/actions.ts +116 -333
- package/src/organization-model/domains/knowledge.ts +15 -7
- package/src/organization-model/domains/projects.ts +4 -4
- package/src/organization-model/domains/prospecting.ts +405 -395
- package/src/organization-model/domains/resources.ts +206 -135
- package/src/organization-model/domains/sales.ts +5 -5
- package/src/organization-model/domains/systems.ts +8 -23
- package/src/organization-model/graph/build.ts +223 -294
- package/src/organization-model/graph/schema.ts +2 -3
- package/src/organization-model/graph/types.ts +12 -14
- package/src/organization-model/helpers.ts +120 -141
- package/src/organization-model/icons.ts +1 -0
- package/src/organization-model/index.ts +107 -126
- package/src/organization-model/migration-helpers.ts +211 -249
- package/src/organization-model/ontology.ts +0 -60
- package/src/organization-model/organization-graph.mdx +4 -5
- package/src/organization-model/organization-model.mdx +1 -1
- package/src/organization-model/published.ts +251 -228
- package/src/organization-model/resolve.ts +4 -5
- package/src/organization-model/scaffolders/helpers.ts +84 -0
- package/src/organization-model/scaffolders/index.ts +19 -0
- package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +48 -0
- package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +38 -0
- package/src/organization-model/scaffolders/scaffoldResource.ts +59 -0
- package/src/organization-model/scaffolders/scaffoldSystem.ts +110 -0
- package/src/organization-model/scaffolders/types.ts +81 -0
- package/src/organization-model/schema.ts +610 -704
- package/src/organization-model/types.ts +167 -161
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/registry/__tests__/validation.test.ts +23 -0
- package/src/platform/registry/validation.ts +13 -2
- package/src/reference/_generated/contracts.md +108 -96
- package/src/reference/glossary.md +71 -69
- package/src/organization-model/content-kinds/config.ts +0 -36
- package/src/organization-model/content-kinds/index.ts +0 -78
- package/src/organization-model/content-kinds/pipeline.ts +0 -68
- package/src/organization-model/content-kinds/registry.ts +0 -44
- package/src/organization-model/content-kinds/status.ts +0 -71
- package/src/organization-model/content-kinds/template.ts +0 -83
- package/src/organization-model/content-kinds/types.ts +0 -117
package/dist/index.js
CHANGED
|
@@ -340,40 +340,6 @@ function addLegacyActionProjections(index, diagnostics, sourcesById, actions, en
|
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
function addSystemContentProjections(index, diagnostics, sourcesById, systemPath, system, schemaPath) {
|
|
344
|
-
const content = system.content ?? {};
|
|
345
|
-
for (const [localId, node] of Object.entries(content)) {
|
|
346
|
-
if (node.kind !== "schema") continue;
|
|
347
|
-
const entries = Object.fromEntries(
|
|
348
|
-
Object.entries(content).filter(([, candidate]) => candidate.parentContentId === localId).map(([entryId, candidate]) => [
|
|
349
|
-
entryId,
|
|
350
|
-
{
|
|
351
|
-
label: candidate.label ?? entryId,
|
|
352
|
-
type: candidate.type,
|
|
353
|
-
...candidate.description !== void 0 ? { description: candidate.description } : {},
|
|
354
|
-
...candidate.data !== void 0 ? candidate.data : {}
|
|
355
|
-
}
|
|
356
|
-
])
|
|
357
|
-
);
|
|
358
|
-
const catalogType = {
|
|
359
|
-
id: formatOntologyId({ scope: systemPath, kind: "catalog", localId }),
|
|
360
|
-
label: node.label ?? localId,
|
|
361
|
-
description: node.description,
|
|
362
|
-
ownerSystemId: systemPath,
|
|
363
|
-
kind: node.type,
|
|
364
|
-
...typeof node.data?.["entityId"] === "string" ? { appliesTo: formatOntologyId({ scope: systemPath, kind: "object", localId: node.data["entityId"] }) } : {},
|
|
365
|
-
...Object.keys(entries).length > 0 ? { entries } : {},
|
|
366
|
-
...node.data !== void 0 ? { data: node.data } : {}
|
|
367
|
-
};
|
|
368
|
-
addRecord(index, diagnostics, sourcesById, "catalogTypes", catalogType, {
|
|
369
|
-
source: "legacy.system.content",
|
|
370
|
-
path: [...schemaPath, "content", localId],
|
|
371
|
-
kind: "projected",
|
|
372
|
-
systemPath,
|
|
373
|
-
legacyId: `${systemPath}:${localId}`
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
343
|
function addSystemScopes(index, diagnostics, sourcesById, systems, prefix, schemaPath) {
|
|
378
344
|
for (const [key, system] of Object.entries(systems)) {
|
|
379
345
|
const systemPath = prefix ? `${prefix}.${key}` : key;
|
|
@@ -382,7 +348,6 @@ function addSystemScopes(index, diagnostics, sourcesById, systems, prefix, schem
|
|
|
382
348
|
...currentPath,
|
|
383
349
|
"ontology"
|
|
384
350
|
]);
|
|
385
|
-
addSystemContentProjections(index, diagnostics, sourcesById, systemPath, system, currentPath);
|
|
386
351
|
addSystemScopes(index, diagnostics, sourcesById, childSystemsOf(system), systemPath, [
|
|
387
352
|
...currentPath,
|
|
388
353
|
system.systems !== void 0 ? "systems" : "subsystems"
|
|
@@ -402,190 +367,6 @@ function compileOrganizationOntology(model) {
|
|
|
402
367
|
function getOntologyDiagnostics(model) {
|
|
403
368
|
return compileOrganizationOntology(model).diagnostics;
|
|
404
369
|
}
|
|
405
|
-
|
|
406
|
-
// src/organization-model/content-kinds/registry.ts
|
|
407
|
-
function defineContentType(def) {
|
|
408
|
-
return def;
|
|
409
|
-
}
|
|
410
|
-
var ContentNodeBaseSchema = z.object({
|
|
411
|
-
/** Human-readable label for the content node. */
|
|
412
|
-
label: z.string().trim().min(1).max(120).meta({ label: "Label" }),
|
|
413
|
-
/** Optional one-paragraph description. */
|
|
414
|
-
description: z.string().trim().min(1).max(2e3).optional().meta({ label: "Description" }),
|
|
415
|
-
/** Optional display order within the system content map. */
|
|
416
|
-
order: z.number().int().optional().meta({ label: "Order" }),
|
|
417
|
-
/**
|
|
418
|
-
* Local NodeId of the parent content node within the SAME system.
|
|
419
|
-
* Per B4/L9: MUST resolve to a sibling in the same `system.content` map.
|
|
420
|
-
* Per L19: parent and child MUST share the same `kind` (meta-category).
|
|
421
|
-
*/
|
|
422
|
-
parentContentId: z.string().trim().min(1).max(200).optional().meta({ label: "Parent content id" })
|
|
423
|
-
});
|
|
424
|
-
var ContentNodeSchema = ContentNodeBaseSchema.extend({
|
|
425
|
-
/** Meta-category (e.g. 'schema', 'config', 'knowledge', tenant-defined). */
|
|
426
|
-
kind: z.string().trim().min(1).max(100).meta({ label: "Kind" }),
|
|
427
|
-
/** Specific family within the meta-category (e.g. 'pipeline', 'kv'). */
|
|
428
|
-
type: z.string().trim().min(1).max(100).meta({ label: "Type" }),
|
|
429
|
-
/** Payload data; validated against registered payloadSchema when (kind, type) is known. */
|
|
430
|
-
data: z.record(z.string(), z.unknown()).optional().meta({ label: "Data" })
|
|
431
|
-
});
|
|
432
|
-
z.object({
|
|
433
|
-
/** Meta-category (tenant-defined or registry-shipped). */
|
|
434
|
-
kind: z.string().trim().min(1).max(100).meta({ label: "Kind" }),
|
|
435
|
-
/** Specific family within the meta-category. */
|
|
436
|
-
type: z.string().trim().min(1).max(100).meta({ label: "Type" }),
|
|
437
|
-
/** Human-readable label shown in the KB tree and describe views. */
|
|
438
|
-
label: z.string().trim().min(1).max(120).meta({ label: "Label" }),
|
|
439
|
-
/** Optional description. */
|
|
440
|
-
description: z.string().trim().min(1).max(2e3).optional().meta({ label: "Description" }),
|
|
441
|
-
/**
|
|
442
|
-
* Which KB tree group this extension renders in.
|
|
443
|
-
* Per L6: 'business-model' places it alongside Customers / Offerings / Goals.
|
|
444
|
-
*/
|
|
445
|
-
treeGroup: z.union([z.enum(["profile", "business-model", "systems", "graph", "governance-wiring"]), z.string().min(1).max(100)]).meta({ label: "Tree group" }),
|
|
446
|
-
/** Untyped payload; shape governed by the registered payloadSchema when available. */
|
|
447
|
-
data: z.record(z.string(), z.unknown()).optional().meta({ label: "Data" })
|
|
448
|
-
});
|
|
449
|
-
var PipelinePayloadSchema = z.object({
|
|
450
|
-
/**
|
|
451
|
-
* Local NodeId of the entity this pipeline applies to (e.g. 'crm.deal').
|
|
452
|
-
* `.meta({ ref: 'entity' })` enables SchemaDrivenFieldList to render a
|
|
453
|
-
* clickable graph link to the referenced entity node.
|
|
454
|
-
*/
|
|
455
|
-
entityId: z.string().trim().min(1).max(200).meta({ label: "Entity", ref: "entity", hint: "The entity type this pipeline tracks" }),
|
|
456
|
-
/**
|
|
457
|
-
* Optional Kanban column color token for UI rendering.
|
|
458
|
-
*/
|
|
459
|
-
kanbanColor: z.string().trim().min(1).max(40).optional().meta({ label: "Kanban color", hint: "UI color token" })
|
|
460
|
-
});
|
|
461
|
-
var pipelineKind = defineContentType({
|
|
462
|
-
kind: "schema",
|
|
463
|
-
type: "pipeline",
|
|
464
|
-
label: "Pipeline",
|
|
465
|
-
description: "A named progression pipeline that applies to a specific entity type.",
|
|
466
|
-
payloadSchema: PipelinePayloadSchema,
|
|
467
|
-
parentTypes: []
|
|
468
|
-
});
|
|
469
|
-
var StagePayloadSchema = z.object({
|
|
470
|
-
/**
|
|
471
|
-
* Semantic classification for this stage.
|
|
472
|
-
* Drives color, icon, and CRM-priority logic in consuming views.
|
|
473
|
-
* Optional — prospecting stages use data.entityKind instead.
|
|
474
|
-
* Enum aligned with SalesStageSemanticClassSchema (sales.ts).
|
|
475
|
-
*/
|
|
476
|
-
semanticClass: z.enum(["open", "active", "nurturing", "closed_won", "closed_lost", "won", "lost", "closed"]).optional().meta({ label: "Semantic class", hint: "Semantic meaning of this stage", color: "blue" })
|
|
477
|
-
});
|
|
478
|
-
var stageKind = defineContentType({
|
|
479
|
-
kind: "schema",
|
|
480
|
-
type: "stage",
|
|
481
|
-
label: "Stage",
|
|
482
|
-
description: "A stage within a pipeline. Must be parented under a schema:pipeline content node.",
|
|
483
|
-
payloadSchema: StagePayloadSchema,
|
|
484
|
-
parentTypes: ["schema:pipeline"]
|
|
485
|
-
});
|
|
486
|
-
var TemplatePayloadSchema = z.object({
|
|
487
|
-
/**
|
|
488
|
-
* Optional description surfaced in the KB describe view and tooling.
|
|
489
|
-
*/
|
|
490
|
-
description: z.string().trim().min(1).max(2e3).optional().meta({ label: "Description", hint: "What this template is used for" })
|
|
491
|
-
});
|
|
492
|
-
var templateKind = defineContentType({
|
|
493
|
-
kind: "schema",
|
|
494
|
-
type: "template",
|
|
495
|
-
label: "Template",
|
|
496
|
-
description: "A named build template (e.g. a prospecting pipeline sequence).",
|
|
497
|
-
payloadSchema: TemplatePayloadSchema,
|
|
498
|
-
parentTypes: []
|
|
499
|
-
});
|
|
500
|
-
var TemplateStepPayloadSchema = z.object({
|
|
501
|
-
/**
|
|
502
|
-
* Which entity type this step primarily operates on.
|
|
503
|
-
*/
|
|
504
|
-
primaryEntity: z.enum(["company", "contact"]).meta({ label: "Primary entity", hint: "Entity type this step processes", color: "blue" }),
|
|
505
|
-
/**
|
|
506
|
-
* Action key identifying the workflow action executed by this step.
|
|
507
|
-
* `.meta({ ref: 'action' })` enables SchemaDrivenFieldList to render a
|
|
508
|
-
* clickable graph link.
|
|
509
|
-
*/
|
|
510
|
-
actionKey: z.string().trim().min(1).max(200).meta({ label: "Action", ref: "action", hint: "Workflow action executed by this step" }),
|
|
511
|
-
/**
|
|
512
|
-
* IDs of sibling step local NodeIds this step depends on.
|
|
513
|
-
*/
|
|
514
|
-
dependsOn: z.array(z.string().trim().min(1).max(200)).optional().meta({ label: "Depends on", hint: "Local NodeIds of prerequisite steps" })
|
|
515
|
-
});
|
|
516
|
-
var templateStepKind = defineContentType({
|
|
517
|
-
kind: "schema",
|
|
518
|
-
type: "template-step",
|
|
519
|
-
label: "Template Step",
|
|
520
|
-
description: "A step within a build template. Must be parented under a schema:template content node.",
|
|
521
|
-
payloadSchema: TemplateStepPayloadSchema,
|
|
522
|
-
parentTypes: ["schema:template"]
|
|
523
|
-
});
|
|
524
|
-
var StatusFlowPayloadSchema = z.object({
|
|
525
|
-
/**
|
|
526
|
-
* Which entity scope this status flow governs.
|
|
527
|
-
*/
|
|
528
|
-
appliesTo: z.enum(["project", "milestone", "task"]).meta({ label: "Applies to", hint: "Entity scope governed by this status flow", color: "blue" })
|
|
529
|
-
});
|
|
530
|
-
var statusFlowKind = defineContentType({
|
|
531
|
-
kind: "schema",
|
|
532
|
-
type: "status-flow",
|
|
533
|
-
label: "Status Flow",
|
|
534
|
-
description: "A named set of statuses governing a project, milestone, or task entity.",
|
|
535
|
-
payloadSchema: StatusFlowPayloadSchema,
|
|
536
|
-
parentTypes: []
|
|
537
|
-
});
|
|
538
|
-
var StatusPayloadSchema = z.object({
|
|
539
|
-
/**
|
|
540
|
-
* Semantic classification string for this status.
|
|
541
|
-
* Free-form to allow tenant-defined classifications (e.g. 'active', 'blocked',
|
|
542
|
-
* 'completed'). Used by UI to apply color and icon fallbacks.
|
|
543
|
-
* Optional — status nodes may omit this when the label is self-descriptive.
|
|
544
|
-
*/
|
|
545
|
-
semanticClass: z.string().trim().min(1).max(100).optional().meta({ label: "Semantic class", hint: "Semantic meaning of this status (e.g. active, blocked, completed)" }),
|
|
546
|
-
/**
|
|
547
|
-
* Optional UI color token override for this status.
|
|
548
|
-
*/
|
|
549
|
-
color: z.string().trim().min(1).max(40).optional().meta({ label: "Color", hint: "UI color token" })
|
|
550
|
-
});
|
|
551
|
-
var statusKind = defineContentType({
|
|
552
|
-
kind: "schema",
|
|
553
|
-
type: "status",
|
|
554
|
-
label: "Status",
|
|
555
|
-
description: "A single status within a status flow. Must be parented under a schema:status-flow content node.",
|
|
556
|
-
payloadSchema: StatusPayloadSchema,
|
|
557
|
-
parentTypes: ["schema:status-flow"]
|
|
558
|
-
});
|
|
559
|
-
var ConfigKvPayloadSchema = z.object({
|
|
560
|
-
/**
|
|
561
|
-
* Flat key-value entries. Values are JSON primitives.
|
|
562
|
-
* Keys are short identifiers (e.g. 'maxBatchSize', 'featureEnabled').
|
|
563
|
-
*/
|
|
564
|
-
entries: z.record(z.string().trim().min(1).max(200), z.union([z.string(), z.number(), z.boolean(), z.null()])).meta({ label: "Entries", hint: "Key-value configuration entries (string, number, boolean, or null values)" })
|
|
565
|
-
});
|
|
566
|
-
var configKvKind = defineContentType({
|
|
567
|
-
kind: "config",
|
|
568
|
-
type: "kv",
|
|
569
|
-
label: "Key-Value Config",
|
|
570
|
-
description: "A flat key-value configuration store co-located with a system. Values are JSON primitives.",
|
|
571
|
-
payloadSchema: ConfigKvPayloadSchema,
|
|
572
|
-
parentTypes: []
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
// src/organization-model/content-kinds/index.ts
|
|
576
|
-
var CONTENT_KIND_REGISTRY = {
|
|
577
|
-
"schema:pipeline": pipelineKind,
|
|
578
|
-
"schema:stage": stageKind,
|
|
579
|
-
"schema:template": templateKind,
|
|
580
|
-
"schema:template-step": templateStepKind,
|
|
581
|
-
"schema:status-flow": statusFlowKind,
|
|
582
|
-
"schema:status": statusKind,
|
|
583
|
-
"config:kv": configKvKind
|
|
584
|
-
};
|
|
585
|
-
function lookupContentType(kind, type) {
|
|
586
|
-
const key = `${kind}:${type}`;
|
|
587
|
-
return CONTENT_KIND_REGISTRY[key];
|
|
588
|
-
}
|
|
589
370
|
var ORGANIZATION_MODEL_ICON_TOKENS = [
|
|
590
371
|
// Navigation / app areas
|
|
591
372
|
"dashboard",
|
|
@@ -594,6 +375,7 @@ var ORGANIZATION_MODEL_ICON_TOKENS = [
|
|
|
594
375
|
"crm",
|
|
595
376
|
"lead-gen",
|
|
596
377
|
"projects",
|
|
378
|
+
"clients",
|
|
597
379
|
"operations",
|
|
598
380
|
"monitoring",
|
|
599
381
|
"knowledge",
|
|
@@ -1139,226 +921,7 @@ var ActionSchema = z.object({
|
|
|
1139
921
|
var ActionsDomainSchema = z.record(z.string(), ActionSchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
|
|
1140
922
|
message: "Each action entry id must match its map key"
|
|
1141
923
|
}).default({});
|
|
1142
|
-
var
|
|
1143
|
-
{
|
|
1144
|
-
id: "lead-gen.company.source",
|
|
1145
|
-
order: 10,
|
|
1146
|
-
label: "Source companies",
|
|
1147
|
-
description: "Import source companies from a list provider.",
|
|
1148
|
-
scope: { domain: "sales" },
|
|
1149
|
-
resourceId: "lgn-import-workflow",
|
|
1150
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/source" }]
|
|
1151
|
-
},
|
|
1152
|
-
{
|
|
1153
|
-
id: "lead-gen.company.apollo-import",
|
|
1154
|
-
order: 20,
|
|
1155
|
-
label: "Import from Apollo",
|
|
1156
|
-
description: "Pull companies and seed contact data from an Apollo search or list.",
|
|
1157
|
-
scope: { domain: "sales" },
|
|
1158
|
-
resourceId: "lgn-01c-apollo-import-workflow",
|
|
1159
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/apollo-import" }]
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
id: "lead-gen.contact.discover",
|
|
1163
|
-
order: 30,
|
|
1164
|
-
label: "Discover contact emails",
|
|
1165
|
-
description: "Find email addresses for contacts at qualified companies.",
|
|
1166
|
-
scope: { domain: "sales" },
|
|
1167
|
-
resourceId: "lgn-04-email-discovery-workflow",
|
|
1168
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/contacts/discover" }]
|
|
1169
|
-
},
|
|
1170
|
-
{
|
|
1171
|
-
id: "lead-gen.contact.verify-email",
|
|
1172
|
-
order: 40,
|
|
1173
|
-
label: "Verify emails",
|
|
1174
|
-
description: "Check email deliverability before outreach.",
|
|
1175
|
-
scope: { domain: "sales" },
|
|
1176
|
-
resourceId: "lgn-05-email-verification-workflow",
|
|
1177
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/contacts/verify-email" }]
|
|
1178
|
-
},
|
|
1179
|
-
{
|
|
1180
|
-
id: "lead-gen.company.apify-crawl",
|
|
1181
|
-
order: 50,
|
|
1182
|
-
label: "Crawl websites",
|
|
1183
|
-
description: "Crawl company websites via Apify and store raw page markdown in enrichmentData.websiteCrawl.pages for downstream LLM analysis.",
|
|
1184
|
-
scope: { domain: "sales" },
|
|
1185
|
-
resourceId: "lgn-02a-apify-website-crawl-workflow",
|
|
1186
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/apify-crawl" }]
|
|
1187
|
-
},
|
|
1188
|
-
{
|
|
1189
|
-
id: "lead-gen.company.website-extract",
|
|
1190
|
-
order: 60,
|
|
1191
|
-
label: "Extract website signals",
|
|
1192
|
-
description: "Scrape and analyze company websites for qualification signals.",
|
|
1193
|
-
scope: { domain: "sales" },
|
|
1194
|
-
resourceId: "lgn-02-website-extract-workflow",
|
|
1195
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/website-extract" }]
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
id: "lead-gen.company.qualify",
|
|
1199
|
-
order: 70,
|
|
1200
|
-
label: "Qualify companies",
|
|
1201
|
-
description: "Score and filter companies against the ICP rubric.",
|
|
1202
|
-
scope: { domain: "sales" },
|
|
1203
|
-
resourceId: "lgn-03-company-qualification-workflow",
|
|
1204
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/qualify" }]
|
|
1205
|
-
},
|
|
1206
|
-
{
|
|
1207
|
-
id: "lead-gen.company.dtc-subscription-qualify",
|
|
1208
|
-
order: 80,
|
|
1209
|
-
label: "Qualify DTC subscription fit",
|
|
1210
|
-
description: "Classify subscription potential and consumable-product fit for DTC brands.",
|
|
1211
|
-
scope: { domain: "sales" },
|
|
1212
|
-
resourceId: "lgn-03b-dtc-subscription-score-workflow",
|
|
1213
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/dtc-subscription-qualify" }]
|
|
1214
|
-
},
|
|
1215
|
-
{
|
|
1216
|
-
id: "lead-gen.contact.apollo-decision-maker-enrich",
|
|
1217
|
-
order: 90,
|
|
1218
|
-
label: "Enrich decision-makers",
|
|
1219
|
-
description: "Find and enrich qualified contacts at qualified companies via Apollo.",
|
|
1220
|
-
scope: { domain: "sales" },
|
|
1221
|
-
resourceId: "lgn-04b-apollo-decision-maker-enrich-workflow",
|
|
1222
|
-
invocations: [
|
|
1223
|
-
{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/contacts/apollo-decision-maker-enrich" }
|
|
1224
|
-
]
|
|
1225
|
-
},
|
|
1226
|
-
{
|
|
1227
|
-
id: "lead-gen.contact.personalize",
|
|
1228
|
-
order: 100,
|
|
1229
|
-
label: "Personalize outreach",
|
|
1230
|
-
description: "Generate personalized opening lines for each contact.",
|
|
1231
|
-
scope: { domain: "sales" },
|
|
1232
|
-
resourceId: "ist-personalization-workflow",
|
|
1233
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/contacts/personalize" }]
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
id: "lead-gen.review.outreach-ready",
|
|
1237
|
-
order: 110,
|
|
1238
|
-
label: "Upload to outreach",
|
|
1239
|
-
description: "Upload approved contacts to the outreach sequence after QC review.",
|
|
1240
|
-
scope: { domain: "sales" },
|
|
1241
|
-
resourceId: "ist-upload-contacts-workflow",
|
|
1242
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/review/outreach-ready" }]
|
|
1243
|
-
},
|
|
1244
|
-
{
|
|
1245
|
-
id: "lead-gen.export.list",
|
|
1246
|
-
order: 120,
|
|
1247
|
-
label: "Export lead list",
|
|
1248
|
-
description: "Export approved leads as a downloadable lead list.",
|
|
1249
|
-
scope: { domain: "sales" },
|
|
1250
|
-
resourceId: "lgn-06-export-list-workflow",
|
|
1251
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/export/list" }]
|
|
1252
|
-
},
|
|
1253
|
-
{
|
|
1254
|
-
id: "lead-gen.company.cleanup",
|
|
1255
|
-
order: 130,
|
|
1256
|
-
label: "Clean up companies",
|
|
1257
|
-
description: "Remove disqualified or duplicate companies from the list.",
|
|
1258
|
-
scope: { domain: "sales" },
|
|
1259
|
-
resourceId: "lgn-company-cleanup-workflow",
|
|
1260
|
-
invocations: [{ kind: "api-endpoint", method: "POST", path: "/api/prospecting/companies/cleanup" }]
|
|
1261
|
-
}
|
|
1262
|
-
];
|
|
1263
|
-
var LEAD_GEN_ACTION_ENTRIES = Object.fromEntries(
|
|
1264
|
-
LEAD_GEN_ACTION_ENTRY_INPUTS.map((action) => {
|
|
1265
|
-
const parsed = ActionSchema.parse(action);
|
|
1266
|
-
return [parsed.id, parsed];
|
|
1267
|
-
})
|
|
1268
|
-
);
|
|
1269
|
-
var CRM_ACTION_ENTRY_INPUTS = [
|
|
1270
|
-
{
|
|
1271
|
-
id: "send_reply",
|
|
1272
|
-
order: 210,
|
|
1273
|
-
label: "Send Reply",
|
|
1274
|
-
description: "Send a contextual reply for an active CRM deal.",
|
|
1275
|
-
scope: { domain: "sales" },
|
|
1276
|
-
resourceId: "crm-send-reply-workflow",
|
|
1277
|
-
affects: ["crm.deal"]
|
|
1278
|
-
},
|
|
1279
|
-
{
|
|
1280
|
-
id: "send_link",
|
|
1281
|
-
order: 220,
|
|
1282
|
-
label: "Send Booking Link",
|
|
1283
|
-
description: "Send a booking link to move a deal toward a scheduled call.",
|
|
1284
|
-
scope: { domain: "sales" },
|
|
1285
|
-
resourceId: "crm-send-booking-link-workflow",
|
|
1286
|
-
affects: ["crm.deal"]
|
|
1287
|
-
},
|
|
1288
|
-
{
|
|
1289
|
-
id: "send_nudge",
|
|
1290
|
-
order: 230,
|
|
1291
|
-
label: "Send Nudge",
|
|
1292
|
-
description: "Send a follow-up nudge for a stalled CRM deal.",
|
|
1293
|
-
scope: { domain: "sales" },
|
|
1294
|
-
resourceId: "crm-send-nudge-workflow",
|
|
1295
|
-
affects: ["crm.deal"]
|
|
1296
|
-
},
|
|
1297
|
-
{
|
|
1298
|
-
id: "rebook",
|
|
1299
|
-
order: 240,
|
|
1300
|
-
label: "Rebook",
|
|
1301
|
-
description: "Rebook a missed or rescheduled CRM appointment.",
|
|
1302
|
-
scope: { domain: "sales" },
|
|
1303
|
-
resourceId: "crm-rebook-workflow",
|
|
1304
|
-
affects: ["crm.deal"]
|
|
1305
|
-
},
|
|
1306
|
-
{
|
|
1307
|
-
id: "move_to_proposal",
|
|
1308
|
-
order: 250,
|
|
1309
|
-
label: "Move to Proposal",
|
|
1310
|
-
description: "Advance a qualified CRM deal into the proposal stage.",
|
|
1311
|
-
scope: { domain: "sales" },
|
|
1312
|
-
resourceId: "move_to_proposal-workflow",
|
|
1313
|
-
affects: ["crm.deal"]
|
|
1314
|
-
},
|
|
1315
|
-
{
|
|
1316
|
-
id: "move_to_closing",
|
|
1317
|
-
order: 260,
|
|
1318
|
-
label: "Move to Closing",
|
|
1319
|
-
description: "Advance a proposal-stage CRM deal into closing.",
|
|
1320
|
-
scope: { domain: "sales" },
|
|
1321
|
-
resourceId: "move_to_closing-workflow",
|
|
1322
|
-
affects: ["crm.deal"]
|
|
1323
|
-
},
|
|
1324
|
-
{
|
|
1325
|
-
id: "move_to_closed_won",
|
|
1326
|
-
order: 270,
|
|
1327
|
-
label: "Close Won",
|
|
1328
|
-
description: "Mark a CRM deal as closed won.",
|
|
1329
|
-
scope: { domain: "sales" },
|
|
1330
|
-
resourceId: "move_to_closed_won-workflow",
|
|
1331
|
-
affects: ["crm.deal"]
|
|
1332
|
-
},
|
|
1333
|
-
{
|
|
1334
|
-
id: "move_to_closed_lost",
|
|
1335
|
-
order: 280,
|
|
1336
|
-
label: "Close Lost",
|
|
1337
|
-
description: "Mark a CRM deal as closed lost.",
|
|
1338
|
-
scope: { domain: "sales" },
|
|
1339
|
-
resourceId: "move_to_closed_lost-workflow",
|
|
1340
|
-
affects: ["crm.deal"]
|
|
1341
|
-
},
|
|
1342
|
-
{
|
|
1343
|
-
id: "move_to_nurturing",
|
|
1344
|
-
order: 290,
|
|
1345
|
-
label: "Move to Nurturing",
|
|
1346
|
-
description: "Move a CRM deal into nurturing for future follow-up.",
|
|
1347
|
-
scope: { domain: "sales" },
|
|
1348
|
-
resourceId: "move_to_nurturing-workflow",
|
|
1349
|
-
affects: ["crm.deal"]
|
|
1350
|
-
}
|
|
1351
|
-
];
|
|
1352
|
-
var CRM_ACTION_ENTRIES = Object.fromEntries(
|
|
1353
|
-
CRM_ACTION_ENTRY_INPUTS.map((action) => {
|
|
1354
|
-
const parsed = ActionSchema.parse(action);
|
|
1355
|
-
return [parsed.id, parsed];
|
|
1356
|
-
})
|
|
1357
|
-
);
|
|
1358
|
-
var DEFAULT_ORGANIZATION_MODEL_ACTIONS = {
|
|
1359
|
-
...LEAD_GEN_ACTION_ENTRIES,
|
|
1360
|
-
...CRM_ACTION_ENTRIES
|
|
1361
|
-
};
|
|
924
|
+
var DEFAULT_ORGANIZATION_MODEL_ACTIONS = {};
|
|
1362
925
|
function findOrganizationActionById(id, actions = DEFAULT_ORGANIZATION_MODEL_ACTIONS) {
|
|
1363
926
|
return actions[id];
|
|
1364
927
|
}
|
|
@@ -1376,7 +939,7 @@ var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]).meta({ labe
|
|
|
1376
939
|
var NodeIdPathSchema = SystemIdSchema;
|
|
1377
940
|
var NodeIdStringSchema = z.string().trim().min(1).max(200).regex(
|
|
1378
941
|
/^[a-z][a-z-]*:([a-z0-9-]+)(\.[a-z0-9-]+)*(:[a-z0-9.-]+)*$/,
|
|
1379
|
-
"Node references must use kind:dotted-path (e.g. system:sales.crm or
|
|
942
|
+
"Node references must use kind:dotted-path (e.g. system:sales.crm or resource:lead-gen.company.qualify)"
|
|
1380
943
|
);
|
|
1381
944
|
var SystemUiSchema = z.object({
|
|
1382
945
|
path: PathSchema,
|
|
@@ -1450,13 +1013,6 @@ var SystemEntrySchema = z.object({
|
|
|
1450
1013
|
* shared contract records owned by this system.
|
|
1451
1014
|
*/
|
|
1452
1015
|
ontology: OntologyScopeSchema.optional(),
|
|
1453
|
-
/**
|
|
1454
|
-
* @deprecated Compatibility-only bridge for old tenant content nodes and
|
|
1455
|
-
* migration readers. New schema/catalog authoring belongs in ontology;
|
|
1456
|
-
* new system-local settings belong in config. Bridge nodes are keyed by
|
|
1457
|
-
* local NodeId and may still project to content-node:* graph IDs.
|
|
1458
|
-
*/
|
|
1459
|
-
content: z.record(z.string().trim().min(1).max(200), ContentNodeSchema).optional(),
|
|
1460
1016
|
/**
|
|
1461
1017
|
* Recursive child systems, authored via nesting (per L11).
|
|
1462
1018
|
* The key is the local system id; the full path is computed by joining
|
|
@@ -1467,7 +1023,7 @@ var SystemEntrySchema = z.object({
|
|
|
1467
1023
|
systems: z.lazy(() => z.record(z.string().trim().min(1).max(100), SystemEntrySchema)).optional(),
|
|
1468
1024
|
/** @deprecated Use systems. Accepted as a compatibility alias during the ontology bridge. */
|
|
1469
1025
|
subsystems: z.lazy(() => z.record(z.string().trim().min(1).max(100), SystemEntrySchema)).optional()
|
|
1470
|
-
}).refine((system) => system.label !== void 0 || system.title !== void 0, {
|
|
1026
|
+
}).strict().refine((system) => system.label !== void 0 || system.title !== void 0, {
|
|
1471
1027
|
path: ["label"],
|
|
1472
1028
|
message: "System must provide label or title"
|
|
1473
1029
|
}).transform((system) => {
|
|
@@ -1482,6 +1038,25 @@ var SystemsDomainSchema = z.record(z.string(), SystemEntrySchema).refine((record
|
|
|
1482
1038
|
var DEFAULT_ORGANIZATION_MODEL_SYSTEMS = {};
|
|
1483
1039
|
|
|
1484
1040
|
// src/organization-model/domains/resources.ts
|
|
1041
|
+
var ContractRefSchema = z.string().trim().min(1).max(500).regex(
|
|
1042
|
+
/^[A-Za-z0-9@](?:[A-Za-z0-9_./@-]*[A-Za-z0-9_])?\/?[A-Za-z0-9_./@-]*#[A-Za-z_$][A-Za-z0-9_$]*$/,
|
|
1043
|
+
"ContractRef must be in the format package/subpath#ExportName (e.g. @repo/elevasis-core/contracts/apollo-import#inputSchema)"
|
|
1044
|
+
);
|
|
1045
|
+
function parseContractRef(ref) {
|
|
1046
|
+
const hashIndex = ref.lastIndexOf("#");
|
|
1047
|
+
if (hashIndex === -1) {
|
|
1048
|
+
throw new Error(`ContractRef "${ref}" is missing the required "#ExportName" suffix`);
|
|
1049
|
+
}
|
|
1050
|
+
const moduleSpecifier = ref.slice(0, hashIndex);
|
|
1051
|
+
const exportName = ref.slice(hashIndex + 1);
|
|
1052
|
+
if (!moduleSpecifier) {
|
|
1053
|
+
throw new Error(`ContractRef "${ref}" has an empty module specifier before "#"`);
|
|
1054
|
+
}
|
|
1055
|
+
if (!exportName) {
|
|
1056
|
+
throw new Error(`ContractRef "${ref}" has an empty export name after "#"`);
|
|
1057
|
+
}
|
|
1058
|
+
return { moduleSpecifier, exportName };
|
|
1059
|
+
}
|
|
1485
1060
|
var ResourceKindSchema = z.enum(["workflow", "agent", "integration", "script"]).meta({ label: "Resource kind", color: "orange" });
|
|
1486
1061
|
var ResourceGovernanceStatusSchema = z.enum(["active", "deprecated", "archived"]).meta({ label: "Governance status", color: "teal" });
|
|
1487
1062
|
var AgentKindSchema = z.enum(["orchestrator", "specialist", "utility", "platform"]).meta({ label: "Agent kind", color: "violet" });
|
|
@@ -1510,7 +1085,20 @@ var ResourceOntologyBindingSchema = z.object({
|
|
|
1510
1085
|
reads: z.array(OntologyIdSchema).optional(),
|
|
1511
1086
|
writes: z.array(OntologyIdSchema).optional(),
|
|
1512
1087
|
usesCatalogs: z.array(OntologyIdSchema).optional(),
|
|
1513
|
-
emits: z.array(OntologyIdSchema).optional()
|
|
1088
|
+
emits: z.array(OntologyIdSchema).optional(),
|
|
1089
|
+
/**
|
|
1090
|
+
* Optional typed contract binding for this resource's workflow I/O.
|
|
1091
|
+
* Each ref is a `package/subpath#ExportName` string that resolves to a
|
|
1092
|
+
* Zod schema in `@repo/elevasis-core` (or the consumer's equivalent package).
|
|
1093
|
+
*
|
|
1094
|
+
* Absence of this field preserves all existing behavior — it is additive + optional.
|
|
1095
|
+
* Tier-1 validation (schema.ts): ref-string shape only (browser-safe, no imports).
|
|
1096
|
+
* Tier-2 validation (om:verify): intra-package typed-map resolution asserts ZodType.
|
|
1097
|
+
*/
|
|
1098
|
+
contract: z.object({
|
|
1099
|
+
input: ContractRefSchema.optional(),
|
|
1100
|
+
output: ContractRefSchema.optional()
|
|
1101
|
+
}).optional()
|
|
1514
1102
|
}).superRefine((binding, ctx) => {
|
|
1515
1103
|
if (binding.primaryAction === void 0) return;
|
|
1516
1104
|
if (binding.actions?.includes(binding.primaryAction)) return;
|
|
@@ -1726,13 +1314,10 @@ var KnowledgeTargetKindSchema = z.enum([
|
|
|
1726
1314
|
"goal",
|
|
1727
1315
|
"customer-segment",
|
|
1728
1316
|
"offering",
|
|
1729
|
-
"ontology"
|
|
1730
|
-
// D4: content nodes are a valid knowledge target after compound-domain data moved into system.content
|
|
1731
|
-
"content-node"
|
|
1317
|
+
"ontology"
|
|
1732
1318
|
]).meta({ label: "Target kind" });
|
|
1733
1319
|
var KnowledgeTargetRefSchema = z.object({
|
|
1734
1320
|
kind: KnowledgeTargetKindSchema,
|
|
1735
|
-
// D4: content-node targets use a qualified id format '<system-path>:<local-content-id>'.
|
|
1736
1321
|
// Ontology targets use the canonical '<scope>:<kind>/<local-id>' ontology id format.
|
|
1737
1322
|
// Business-logic validation of target existence is done in OrganizationModelSchema.superRefine.
|
|
1738
1323
|
id: z.string().trim().min(1).max(300)
|
|
@@ -1749,6 +1334,15 @@ var KnowledgeTargetRefSchema = z.object({
|
|
|
1749
1334
|
});
|
|
1750
1335
|
var LegacyKnowledgeLinkSchema = z.object({
|
|
1751
1336
|
nodeId: z.union([NodeIdStringSchema, z.templateLiteral(["ontology:", OntologyIdSchema])])
|
|
1337
|
+
}).superRefine((link, ctx) => {
|
|
1338
|
+
const [kind] = link.nodeId.split(":");
|
|
1339
|
+
if (!KnowledgeTargetKindSchema.safeParse(kind).success) {
|
|
1340
|
+
ctx.addIssue({
|
|
1341
|
+
code: z.ZodIssueCode.custom,
|
|
1342
|
+
path: ["nodeId"],
|
|
1343
|
+
message: `Unknown knowledge target kind "${kind}"`
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1752
1346
|
});
|
|
1753
1347
|
var CanonicalKnowledgeLinkSchema = z.object({
|
|
1754
1348
|
target: KnowledgeTargetRefSchema
|
|
@@ -2158,7 +1752,10 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2158
1752
|
const childSystems = system.systems ?? system.subsystems;
|
|
2159
1753
|
if (childSystems !== void 0) {
|
|
2160
1754
|
result.push(
|
|
2161
|
-
...collectAllSystems(childSystems, path, [
|
|
1755
|
+
...collectAllSystems(childSystems, path, [
|
|
1756
|
+
...currentSchemaPath,
|
|
1757
|
+
system.systems !== void 0 ? "systems" : "subsystems"
|
|
1758
|
+
])
|
|
2162
1759
|
);
|
|
2163
1760
|
}
|
|
2164
1761
|
}
|
|
@@ -2179,7 +1776,9 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2179
1776
|
`System "${system.id}" references unknown parent "${system.parentSystemId}"`
|
|
2180
1777
|
);
|
|
2181
1778
|
}
|
|
2182
|
-
const hasChildren = Object.keys(system.systems ?? system.subsystems ?? {}).length > 0 || allSystems.some(
|
|
1779
|
+
const hasChildren = Object.keys(system.systems ?? system.subsystems ?? {}).length > 0 || allSystems.some(
|
|
1780
|
+
(candidate) => candidate.path.startsWith(`${path}.`) && !candidate.path.slice(path.length + 1).includes(".")
|
|
1781
|
+
);
|
|
2183
1782
|
const contributesRoutePath = system.ui?.path !== void 0 || system.path !== void 0 || !hasChildren;
|
|
2184
1783
|
if (contributesRoutePath) {
|
|
2185
1784
|
const effectivePath = system.ui?.path ?? system.path ?? defaultSystemPathFor(path);
|
|
@@ -2201,11 +1800,7 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2201
1800
|
(candidate) => candidate.path.startsWith(`${path}.`) && !candidate.path.slice(path.length + 1).includes(".") && isLifecycleEnabled(candidate.system.lifecycle, candidate.system.enabled)
|
|
2202
1801
|
);
|
|
2203
1802
|
if (!hasEnabledDescendant) {
|
|
2204
|
-
addIssue(
|
|
2205
|
-
ctx,
|
|
2206
|
-
[...schemaPath, "lifecycle"],
|
|
2207
|
-
`System "${path}" is active but has no active descendants`
|
|
2208
|
-
);
|
|
1803
|
+
addIssue(ctx, [...schemaPath, "lifecycle"], `System "${path}" is active but has no active descendants`);
|
|
2209
1804
|
}
|
|
2210
1805
|
}
|
|
2211
1806
|
});
|
|
@@ -2437,10 +2032,16 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2437
2032
|
}
|
|
2438
2033
|
});
|
|
2439
2034
|
});
|
|
2440
|
-
const stageIds = /* @__PURE__ */ new Set();
|
|
2441
2035
|
const actionIds = new Set(Object.keys(model.actions));
|
|
2442
2036
|
const offeringsById = new Map(Object.entries(model.offerings));
|
|
2443
2037
|
const ontologyCompilation = compileOrganizationOntology(model);
|
|
2038
|
+
const stageIds = /* @__PURE__ */ new Set();
|
|
2039
|
+
for (const catalog of Object.values(ontologyCompilation.ontology.catalogTypes)) {
|
|
2040
|
+
if (catalog.kind !== "stage") continue;
|
|
2041
|
+
for (const stageId of Object.keys(catalog.entries ?? {})) {
|
|
2042
|
+
stageIds.add(stageId);
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2444
2045
|
const ontologyIndexByKind = {
|
|
2445
2046
|
object: ontologyCompilation.ontology.objectTypes,
|
|
2446
2047
|
link: ontologyCompilation.ontology.linkTypes,
|
|
@@ -2616,13 +2217,7 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2616
2217
|
if (ontologyIndexByKind[expectedKind][ontologyId] === void 0) {
|
|
2617
2218
|
addIssue(
|
|
2618
2219
|
ctx,
|
|
2619
|
-
[
|
|
2620
|
-
"resources",
|
|
2621
|
-
resourceId,
|
|
2622
|
-
"ontology",
|
|
2623
|
-
bindingKey,
|
|
2624
|
-
...Array.isArray(ids) ? [ontologyIndex] : []
|
|
2625
|
-
],
|
|
2220
|
+
["resources", resourceId, "ontology", bindingKey, ...Array.isArray(ids) ? [ontologyIndex] : []],
|
|
2626
2221
|
`Resource "${resourceId}" ontology binding "${bindingKey}" references unknown ${expectedKind} ontology ID "${ontologyId}"`
|
|
2627
2222
|
);
|
|
2628
2223
|
}
|
|
@@ -2637,6 +2232,23 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2637
2232
|
validateResourceOntologyBinding(resource.id, "writes", "object", binding.writes);
|
|
2638
2233
|
validateResourceOntologyBinding(resource.id, "usesCatalogs", "catalog", binding.usesCatalogs);
|
|
2639
2234
|
validateResourceOntologyBinding(resource.id, "emits", "event", binding.emits);
|
|
2235
|
+
if (binding.contract !== void 0) {
|
|
2236
|
+
const contractEntries = [
|
|
2237
|
+
["input", binding.contract.input],
|
|
2238
|
+
["output", binding.contract.output]
|
|
2239
|
+
];
|
|
2240
|
+
for (const [side, ref] of contractEntries) {
|
|
2241
|
+
if (ref === void 0) continue;
|
|
2242
|
+
const result = ContractRefSchema.safeParse(ref);
|
|
2243
|
+
if (!result.success) {
|
|
2244
|
+
addIssue(
|
|
2245
|
+
ctx,
|
|
2246
|
+
["resources", resource.id, "ontology", "contract", side],
|
|
2247
|
+
`Resource "${resource.id}" contract.${side} "${ref}" is not a valid ContractRef (expected "package/subpath#ExportName")`
|
|
2248
|
+
);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2640
2252
|
});
|
|
2641
2253
|
Object.values(model.roles).forEach((role) => {
|
|
2642
2254
|
if (role.heldBy === void 0) return;
|
|
@@ -2671,78 +2283,6 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
2671
2283
|
}
|
|
2672
2284
|
});
|
|
2673
2285
|
});
|
|
2674
|
-
function validateSystemContent(system, systemPath) {
|
|
2675
|
-
const childSystems = system.systems ?? system.subsystems;
|
|
2676
|
-
const childKey = system.systems !== void 0 ? "systems" : "subsystems";
|
|
2677
|
-
const content = system.content;
|
|
2678
|
-
if (content === void 0 || Object.keys(content).length === 0) {
|
|
2679
|
-
if (childSystems !== void 0) {
|
|
2680
|
-
Object.entries(childSystems).forEach(([childLocalId, child]) => {
|
|
2681
|
-
validateSystemContent(child, [...systemPath, childKey, childLocalId]);
|
|
2682
|
-
});
|
|
2683
|
-
}
|
|
2684
|
-
return;
|
|
2685
|
-
}
|
|
2686
|
-
Object.entries(content).forEach(([localId, node]) => {
|
|
2687
|
-
if (node.parentContentId !== void 0 && !(node.parentContentId in content)) {
|
|
2688
|
-
addIssue(
|
|
2689
|
-
ctx,
|
|
2690
|
-
[...systemPath, "content", localId, "parentContentId"],
|
|
2691
|
-
`Content node "${localId}" parentContentId "${node.parentContentId}" does not resolve within the same system`
|
|
2692
|
-
);
|
|
2693
|
-
}
|
|
2694
|
-
});
|
|
2695
|
-
Object.entries(content).forEach(([localId, node]) => {
|
|
2696
|
-
const visited = /* @__PURE__ */ new Set();
|
|
2697
|
-
let currentId = node.parentContentId;
|
|
2698
|
-
while (currentId !== void 0) {
|
|
2699
|
-
if (currentId === localId || visited.has(currentId)) {
|
|
2700
|
-
addIssue(
|
|
2701
|
-
ctx,
|
|
2702
|
-
[...systemPath, "content", localId, "parentContentId"],
|
|
2703
|
-
`Content node "${localId}" has a parentContentId cycle`
|
|
2704
|
-
);
|
|
2705
|
-
break;
|
|
2706
|
-
}
|
|
2707
|
-
visited.add(currentId);
|
|
2708
|
-
currentId = content[currentId]?.parentContentId;
|
|
2709
|
-
}
|
|
2710
|
-
});
|
|
2711
|
-
Object.entries(content).forEach(([localId, node]) => {
|
|
2712
|
-
const childDef = lookupContentType(node.kind, node.type);
|
|
2713
|
-
if (childDef !== void 0 && node.data !== void 0) {
|
|
2714
|
-
const result = childDef.payloadSchema.safeParse(node.data);
|
|
2715
|
-
if (!result.success) {
|
|
2716
|
-
addIssue(
|
|
2717
|
-
ctx,
|
|
2718
|
-
[...systemPath, "content", localId, "data"],
|
|
2719
|
-
`Content node "${localId}" (${node.kind}:${node.type}) data failed payload validation: ${result.error.message}`
|
|
2720
|
-
);
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
if (node.parentContentId !== void 0 && childDef !== void 0) {
|
|
2724
|
-
const parentNode = content[node.parentContentId];
|
|
2725
|
-
if (parentNode !== void 0) {
|
|
2726
|
-
const parentDef = lookupContentType(parentNode.kind, parentNode.type);
|
|
2727
|
-
if (parentDef !== void 0 && childDef.kind !== parentDef.kind) {
|
|
2728
|
-
addIssue(
|
|
2729
|
-
ctx,
|
|
2730
|
-
[...systemPath, "content", localId, "parentContentId"],
|
|
2731
|
-
`Content node "${localId}" kind "${childDef.kind}" cannot parent under "${node.parentContentId}" kind "${parentDef.kind}": parentContentId must be same-meta-kind (per L19)`
|
|
2732
|
-
);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
});
|
|
2737
|
-
if (childSystems !== void 0) {
|
|
2738
|
-
Object.entries(childSystems).forEach(([childLocalId, child]) => {
|
|
2739
|
-
validateSystemContent(child, [...systemPath, childKey, childLocalId]);
|
|
2740
|
-
});
|
|
2741
|
-
}
|
|
2742
|
-
}
|
|
2743
|
-
Object.entries(model.systems).forEach(([systemKey, system]) => {
|
|
2744
|
-
validateSystemContent(system, ["systems", systemKey]);
|
|
2745
|
-
});
|
|
2746
2286
|
for (const diagnostic of ontologyCompilation.diagnostics) {
|
|
2747
2287
|
addIssue(ctx, diagnostic.path, diagnostic.message);
|
|
2748
2288
|
}
|
|
@@ -2763,9 +2303,8 @@ var OrganizationGraphNodeKindSchema = z.enum([
|
|
|
2763
2303
|
"goal",
|
|
2764
2304
|
"surface",
|
|
2765
2305
|
"navigation-group",
|
|
2766
|
-
//
|
|
2767
|
-
"ontology"
|
|
2768
|
-
"content-node"
|
|
2306
|
+
// Ontology records are projected from compiled System.ontology scopes.
|
|
2307
|
+
"ontology"
|
|
2769
2308
|
]);
|
|
2770
2309
|
var OrganizationGraphEdgeKindSchema = z.enum([
|
|
2771
2310
|
"contains",
|
|
@@ -2848,311 +2387,11 @@ var SETTINGS_ROLES_SURFACE_ID = "settings.roles";
|
|
|
2848
2387
|
|
|
2849
2388
|
// src/organization-model/defaults.ts
|
|
2850
2389
|
var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
|
|
2851
|
-
var DEFAULT_ORGANIZATION_MODEL_ENTITIES2 =
|
|
2390
|
+
var DEFAULT_ORGANIZATION_MODEL_ENTITIES2 = {};
|
|
2852
2391
|
var DEFAULT_ORGANIZATION_MODEL_NAVIGATION2 = {
|
|
2853
2392
|
sidebar: {
|
|
2854
|
-
primary: {
|
|
2855
|
-
|
|
2856
|
-
type: "surface",
|
|
2857
|
-
label: "Dashboard",
|
|
2858
|
-
path: "/",
|
|
2859
|
-
surfaceType: "dashboard",
|
|
2860
|
-
icon: "dashboard",
|
|
2861
|
-
order: 10,
|
|
2862
|
-
targets: { systems: ["dashboard"] }
|
|
2863
|
-
},
|
|
2864
|
-
business: {
|
|
2865
|
-
type: "group",
|
|
2866
|
-
label: "Business",
|
|
2867
|
-
icon: "business",
|
|
2868
|
-
order: 20,
|
|
2869
|
-
children: {
|
|
2870
|
-
sales: {
|
|
2871
|
-
type: "surface",
|
|
2872
|
-
label: "Sales",
|
|
2873
|
-
path: "/sales",
|
|
2874
|
-
surfaceType: "page",
|
|
2875
|
-
icon: "sales",
|
|
2876
|
-
order: 10,
|
|
2877
|
-
targets: { systems: ["sales"] }
|
|
2878
|
-
},
|
|
2879
|
-
clients: {
|
|
2880
|
-
type: "surface",
|
|
2881
|
-
label: "Clients",
|
|
2882
|
-
path: "/clients",
|
|
2883
|
-
surfaceType: "list",
|
|
2884
|
-
icon: "projects",
|
|
2885
|
-
order: 20,
|
|
2886
|
-
targets: { systems: ["clients"] }
|
|
2887
|
-
},
|
|
2888
|
-
projects: {
|
|
2889
|
-
type: "surface",
|
|
2890
|
-
label: "Projects",
|
|
2891
|
-
path: "/projects",
|
|
2892
|
-
surfaceType: "page",
|
|
2893
|
-
icon: "projects",
|
|
2894
|
-
order: 30,
|
|
2895
|
-
targets: { systems: ["projects"] }
|
|
2896
|
-
}
|
|
2897
|
-
}
|
|
2898
|
-
},
|
|
2899
|
-
operations: {
|
|
2900
|
-
type: "group",
|
|
2901
|
-
label: "Operations",
|
|
2902
|
-
icon: "operations",
|
|
2903
|
-
order: 30,
|
|
2904
|
-
children: {
|
|
2905
|
-
"operations-overview": {
|
|
2906
|
-
type: "surface",
|
|
2907
|
-
label: "Overview",
|
|
2908
|
-
path: "/operations",
|
|
2909
|
-
surfaceType: "page",
|
|
2910
|
-
order: 10,
|
|
2911
|
-
targets: { systems: ["operations.overview"] }
|
|
2912
|
-
},
|
|
2913
|
-
"operations-systems": {
|
|
2914
|
-
type: "surface",
|
|
2915
|
-
label: "Systems",
|
|
2916
|
-
path: "/operations/systems",
|
|
2917
|
-
surfaceType: "page",
|
|
2918
|
-
order: 20,
|
|
2919
|
-
targets: { systems: ["operations"] }
|
|
2920
|
-
},
|
|
2921
|
-
"operations-resources": {
|
|
2922
|
-
type: "surface",
|
|
2923
|
-
label: "Resources",
|
|
2924
|
-
path: "/operations/resources",
|
|
2925
|
-
surfaceType: "list",
|
|
2926
|
-
order: 30,
|
|
2927
|
-
targets: { systems: ["operations.resources"] }
|
|
2928
|
-
},
|
|
2929
|
-
"operations-command-queue": {
|
|
2930
|
-
type: "surface",
|
|
2931
|
-
label: "Command Queue",
|
|
2932
|
-
path: "/operations/command-queue",
|
|
2933
|
-
surfaceType: "list",
|
|
2934
|
-
order: 40,
|
|
2935
|
-
targets: { systems: ["operations.command-queue"] }
|
|
2936
|
-
},
|
|
2937
|
-
"operations-task-scheduler": {
|
|
2938
|
-
type: "surface",
|
|
2939
|
-
label: "Task Scheduler",
|
|
2940
|
-
path: "/operations/task-scheduler",
|
|
2941
|
-
surfaceType: "list",
|
|
2942
|
-
order: 50,
|
|
2943
|
-
targets: { systems: ["operations.task-scheduler"] }
|
|
2944
|
-
}
|
|
2945
|
-
}
|
|
2946
|
-
},
|
|
2947
|
-
monitoring: {
|
|
2948
|
-
type: "group",
|
|
2949
|
-
label: "Monitoring",
|
|
2950
|
-
icon: "monitoring",
|
|
2951
|
-
order: 40,
|
|
2952
|
-
children: {
|
|
2953
|
-
"monitoring-overview": {
|
|
2954
|
-
type: "surface",
|
|
2955
|
-
label: "Overview",
|
|
2956
|
-
path: "/monitoring",
|
|
2957
|
-
surfaceType: "page",
|
|
2958
|
-
order: 10,
|
|
2959
|
-
targets: { systems: ["monitoring"] }
|
|
2960
|
-
},
|
|
2961
|
-
"monitoring-calendar": {
|
|
2962
|
-
type: "surface",
|
|
2963
|
-
label: "Calendar",
|
|
2964
|
-
path: "/monitoring/calendar",
|
|
2965
|
-
surfaceType: "page",
|
|
2966
|
-
order: 20,
|
|
2967
|
-
targets: { systems: ["monitoring.calendar"] }
|
|
2968
|
-
},
|
|
2969
|
-
"monitoring-activity-log": {
|
|
2970
|
-
type: "surface",
|
|
2971
|
-
label: "Activity Log",
|
|
2972
|
-
path: "/monitoring/activity-log",
|
|
2973
|
-
surfaceType: "list",
|
|
2974
|
-
order: 30,
|
|
2975
|
-
targets: { systems: ["monitoring.activity-log"] }
|
|
2976
|
-
},
|
|
2977
|
-
"monitoring-execution-logs": {
|
|
2978
|
-
type: "surface",
|
|
2979
|
-
label: "Execution Logs",
|
|
2980
|
-
path: "/monitoring/execution-logs",
|
|
2981
|
-
surfaceType: "list",
|
|
2982
|
-
order: 40,
|
|
2983
|
-
targets: { systems: ["monitoring.execution-logs"] }
|
|
2984
|
-
},
|
|
2985
|
-
"monitoring-execution-health": {
|
|
2986
|
-
type: "surface",
|
|
2987
|
-
label: "Execution Health",
|
|
2988
|
-
path: "/monitoring/execution-health",
|
|
2989
|
-
surfaceType: "dashboard",
|
|
2990
|
-
order: 50,
|
|
2991
|
-
targets: { systems: ["monitoring.execution-health"] }
|
|
2992
|
-
},
|
|
2993
|
-
"monitoring-notifications": {
|
|
2994
|
-
type: "surface",
|
|
2995
|
-
label: "Notifications",
|
|
2996
|
-
path: "/monitoring/notifications",
|
|
2997
|
-
surfaceType: "list",
|
|
2998
|
-
order: 60,
|
|
2999
|
-
targets: { systems: ["monitoring.notifications"] }
|
|
3000
|
-
},
|
|
3001
|
-
"monitoring-requests": {
|
|
3002
|
-
type: "surface",
|
|
3003
|
-
label: "Requests",
|
|
3004
|
-
path: "/monitoring/requests",
|
|
3005
|
-
surfaceType: "list",
|
|
3006
|
-
order: 70,
|
|
3007
|
-
targets: { systems: ["monitoring.submitted-requests"] }
|
|
3008
|
-
}
|
|
3009
|
-
}
|
|
3010
|
-
},
|
|
3011
|
-
knowledge: {
|
|
3012
|
-
type: "surface",
|
|
3013
|
-
label: "Knowledge Base",
|
|
3014
|
-
path: "/knowledge",
|
|
3015
|
-
surfaceType: "page",
|
|
3016
|
-
icon: "knowledge",
|
|
3017
|
-
order: 50
|
|
3018
|
-
}
|
|
3019
|
-
},
|
|
3020
|
-
bottom: {
|
|
3021
|
-
settings: {
|
|
3022
|
-
type: "group",
|
|
3023
|
-
label: "Settings",
|
|
3024
|
-
icon: "settings",
|
|
3025
|
-
order: 10,
|
|
3026
|
-
children: {
|
|
3027
|
-
"settings-account": {
|
|
3028
|
-
type: "surface",
|
|
3029
|
-
label: "Account",
|
|
3030
|
-
path: "/settings/account",
|
|
3031
|
-
surfaceType: "settings",
|
|
3032
|
-
order: 10,
|
|
3033
|
-
targets: { systems: ["settings.account"] }
|
|
3034
|
-
},
|
|
3035
|
-
"settings-appearance": {
|
|
3036
|
-
type: "surface",
|
|
3037
|
-
label: "Appearance",
|
|
3038
|
-
path: "/settings/appearance",
|
|
3039
|
-
surfaceType: "settings",
|
|
3040
|
-
order: 20,
|
|
3041
|
-
targets: { systems: ["settings.appearance"] }
|
|
3042
|
-
},
|
|
3043
|
-
"settings-roles": {
|
|
3044
|
-
type: "surface",
|
|
3045
|
-
label: "My Roles",
|
|
3046
|
-
path: "/settings/roles",
|
|
3047
|
-
surfaceType: "settings",
|
|
3048
|
-
order: 30,
|
|
3049
|
-
targets: { systems: ["settings.roles"] }
|
|
3050
|
-
},
|
|
3051
|
-
"settings-organization": {
|
|
3052
|
-
type: "surface",
|
|
3053
|
-
label: "Organization",
|
|
3054
|
-
path: "/settings/organization",
|
|
3055
|
-
surfaceType: "settings",
|
|
3056
|
-
order: 40,
|
|
3057
|
-
targets: { systems: ["settings.organization"] }
|
|
3058
|
-
},
|
|
3059
|
-
"settings-credentials": {
|
|
3060
|
-
type: "surface",
|
|
3061
|
-
label: "Credentials",
|
|
3062
|
-
path: "/settings/credentials",
|
|
3063
|
-
surfaceType: "settings",
|
|
3064
|
-
order: 50,
|
|
3065
|
-
targets: { systems: ["settings.credentials"] }
|
|
3066
|
-
},
|
|
3067
|
-
"settings-api-keys": {
|
|
3068
|
-
type: "surface",
|
|
3069
|
-
label: "API Keys",
|
|
3070
|
-
path: "/settings/api-keys",
|
|
3071
|
-
surfaceType: "settings",
|
|
3072
|
-
order: 60,
|
|
3073
|
-
targets: { systems: ["settings.api-keys"] }
|
|
3074
|
-
},
|
|
3075
|
-
"settings-webhooks": {
|
|
3076
|
-
type: "surface",
|
|
3077
|
-
label: "Webhooks",
|
|
3078
|
-
path: "/settings/webhooks",
|
|
3079
|
-
surfaceType: "settings",
|
|
3080
|
-
order: 70,
|
|
3081
|
-
targets: { systems: ["settings.webhooks"] }
|
|
3082
|
-
},
|
|
3083
|
-
"settings-deployments": {
|
|
3084
|
-
type: "surface",
|
|
3085
|
-
label: "Deployments",
|
|
3086
|
-
path: "/settings/deployments",
|
|
3087
|
-
surfaceType: "settings",
|
|
3088
|
-
order: 80,
|
|
3089
|
-
targets: { systems: ["settings.deployments"] }
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3092
|
-
},
|
|
3093
|
-
admin: {
|
|
3094
|
-
type: "group",
|
|
3095
|
-
label: "Admin",
|
|
3096
|
-
icon: "admin",
|
|
3097
|
-
order: 20,
|
|
3098
|
-
children: {
|
|
3099
|
-
"admin-dashboard": {
|
|
3100
|
-
type: "surface",
|
|
3101
|
-
label: "Dashboard",
|
|
3102
|
-
path: "/admin/dashboard",
|
|
3103
|
-
surfaceType: "dashboard",
|
|
3104
|
-
order: 10,
|
|
3105
|
-
targets: { systems: ["admin"] },
|
|
3106
|
-
requiresAdmin: true
|
|
3107
|
-
},
|
|
3108
|
-
"admin-system-health": {
|
|
3109
|
-
type: "surface",
|
|
3110
|
-
label: "System Health",
|
|
3111
|
-
path: "/admin/system-health",
|
|
3112
|
-
surfaceType: "dashboard",
|
|
3113
|
-
order: 20,
|
|
3114
|
-
targets: { systems: ["admin.system-health"] },
|
|
3115
|
-
requiresAdmin: true
|
|
3116
|
-
},
|
|
3117
|
-
"admin-organizations": {
|
|
3118
|
-
type: "surface",
|
|
3119
|
-
label: "Organizations",
|
|
3120
|
-
path: "/admin/organizations",
|
|
3121
|
-
surfaceType: "list",
|
|
3122
|
-
order: 30,
|
|
3123
|
-
targets: { systems: ["admin.organizations"] },
|
|
3124
|
-
requiresAdmin: true
|
|
3125
|
-
},
|
|
3126
|
-
"admin-users": {
|
|
3127
|
-
type: "surface",
|
|
3128
|
-
label: "Users",
|
|
3129
|
-
path: "/admin/users",
|
|
3130
|
-
surfaceType: "list",
|
|
3131
|
-
order: 40,
|
|
3132
|
-
targets: { systems: ["admin.users"] },
|
|
3133
|
-
requiresAdmin: true
|
|
3134
|
-
},
|
|
3135
|
-
"admin-design-showcase": {
|
|
3136
|
-
type: "surface",
|
|
3137
|
-
label: "Design Showcase",
|
|
3138
|
-
path: "/admin/design-showcase",
|
|
3139
|
-
surfaceType: "page",
|
|
3140
|
-
order: 50,
|
|
3141
|
-
targets: { systems: ["admin.design-showcase"] },
|
|
3142
|
-
requiresAdmin: true
|
|
3143
|
-
},
|
|
3144
|
-
"admin-debug": {
|
|
3145
|
-
type: "surface",
|
|
3146
|
-
label: "Debug",
|
|
3147
|
-
path: "/admin/debug",
|
|
3148
|
-
surfaceType: "page",
|
|
3149
|
-
order: 60,
|
|
3150
|
-
targets: { systems: ["admin.debug"] },
|
|
3151
|
-
requiresAdmin: true
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
2393
|
+
primary: {},
|
|
2394
|
+
bottom: {}
|
|
3156
2395
|
}
|
|
3157
2396
|
};
|
|
3158
2397
|
var DEFAULT_ORGANIZATION_MODEL = {
|
|
@@ -3165,406 +2404,19 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
3165
2404
|
offerings: DEFAULT_ORGANIZATION_MODEL_OFFERINGS,
|
|
3166
2405
|
roles: DEFAULT_ORGANIZATION_MODEL_ROLES,
|
|
3167
2406
|
goals: DEFAULT_ORGANIZATION_MODEL_GOALS,
|
|
3168
|
-
systems
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
enabled: true,
|
|
3174
|
-
lifecycle: "active",
|
|
3175
|
-
path: "/",
|
|
3176
|
-
icon: "dashboard"
|
|
3177
|
-
},
|
|
3178
|
-
platform: {
|
|
3179
|
-
id: "platform",
|
|
3180
|
-
order: 30,
|
|
3181
|
-
label: "Platform",
|
|
3182
|
-
description: "Elevasis platform architecture, capabilities, and implementation patterns",
|
|
3183
|
-
enabled: true,
|
|
3184
|
-
lifecycle: "active",
|
|
3185
|
-
color: "cyan",
|
|
3186
|
-
icon: "platform"
|
|
3187
|
-
},
|
|
3188
|
-
finance: {
|
|
3189
|
-
id: "finance",
|
|
3190
|
-
order: 40,
|
|
3191
|
-
label: "Finance",
|
|
3192
|
-
description: "Finance operations, accounting, billing, reconciliation, and tax prep",
|
|
3193
|
-
enabled: true,
|
|
3194
|
-
lifecycle: "active",
|
|
3195
|
-
color: "green",
|
|
3196
|
-
icon: "finance"
|
|
3197
|
-
},
|
|
3198
|
-
sales: {
|
|
3199
|
-
id: "sales",
|
|
3200
|
-
order: 60,
|
|
3201
|
-
label: "Sales",
|
|
3202
|
-
description: "Revenue workflows and customer acquisition",
|
|
3203
|
-
enabled: true,
|
|
3204
|
-
lifecycle: "active",
|
|
3205
|
-
color: "blue",
|
|
3206
|
-
icon: "sales",
|
|
3207
|
-
path: "/sales"
|
|
3208
|
-
},
|
|
3209
|
-
"sales.crm": {
|
|
3210
|
-
id: "sales.crm",
|
|
3211
|
-
order: 70,
|
|
3212
|
-
label: "CRM",
|
|
3213
|
-
description: "Relationship pipeline and deal management",
|
|
3214
|
-
enabled: true,
|
|
3215
|
-
lifecycle: "active",
|
|
3216
|
-
actions: Object.values(CRM_ACTION_ENTRIES).map((action) => ({
|
|
3217
|
-
actionId: action.id,
|
|
3218
|
-
intent: "exposes"
|
|
3219
|
-
})),
|
|
3220
|
-
color: "blue",
|
|
3221
|
-
icon: "crm",
|
|
3222
|
-
path: "/crm"
|
|
3223
|
-
},
|
|
3224
|
-
"sales.lead-gen": {
|
|
3225
|
-
id: "sales.lead-gen",
|
|
3226
|
-
order: 80,
|
|
3227
|
-
label: "Lead Gen",
|
|
3228
|
-
description: "Prospecting, qualification, and outreach preparation",
|
|
3229
|
-
enabled: true,
|
|
3230
|
-
lifecycle: "active",
|
|
3231
|
-
actions: Object.values(LEAD_GEN_ACTION_ENTRIES).map((action) => ({
|
|
3232
|
-
actionId: action.id,
|
|
3233
|
-
intent: "exposes"
|
|
3234
|
-
})),
|
|
3235
|
-
color: "cyan",
|
|
3236
|
-
icon: "lead-gen",
|
|
3237
|
-
path: "/lead-gen"
|
|
3238
|
-
},
|
|
3239
|
-
projects: {
|
|
3240
|
-
id: "projects",
|
|
3241
|
-
order: 90,
|
|
3242
|
-
label: "Projects",
|
|
3243
|
-
description: "Projects, milestones, and client work execution",
|
|
3244
|
-
enabled: true,
|
|
3245
|
-
lifecycle: "active",
|
|
3246
|
-
color: "orange",
|
|
3247
|
-
icon: "projects",
|
|
3248
|
-
path: "/projects"
|
|
3249
|
-
},
|
|
3250
|
-
clients: {
|
|
3251
|
-
id: "clients",
|
|
3252
|
-
order: 100,
|
|
3253
|
-
label: "Clients",
|
|
3254
|
-
description: "Client relationships, accounts, and business context",
|
|
3255
|
-
enabled: true,
|
|
3256
|
-
lifecycle: "active",
|
|
3257
|
-
color: "orange",
|
|
3258
|
-
icon: "projects",
|
|
3259
|
-
path: "/clients"
|
|
3260
|
-
},
|
|
3261
|
-
operations: {
|
|
3262
|
-
id: "operations",
|
|
3263
|
-
order: 110,
|
|
3264
|
-
label: "Operations",
|
|
3265
|
-
description: "Operational resources, topology, and orchestration visibility",
|
|
3266
|
-
enabled: true,
|
|
3267
|
-
lifecycle: "active",
|
|
3268
|
-
color: "violet",
|
|
3269
|
-
icon: "operations"
|
|
3270
|
-
},
|
|
3271
|
-
"knowledge.command-view": {
|
|
3272
|
-
id: "knowledge.command-view",
|
|
3273
|
-
order: 120,
|
|
3274
|
-
label: "Command View",
|
|
3275
|
-
enabled: true,
|
|
3276
|
-
lifecycle: "active",
|
|
3277
|
-
path: "/knowledge/command-view",
|
|
3278
|
-
devOnly: true
|
|
3279
|
-
},
|
|
3280
|
-
"operations.overview": {
|
|
3281
|
-
id: "operations.overview",
|
|
3282
|
-
order: 130,
|
|
3283
|
-
label: "Overview",
|
|
3284
|
-
enabled: true,
|
|
3285
|
-
lifecycle: "active",
|
|
3286
|
-
path: "/operations"
|
|
3287
|
-
},
|
|
3288
|
-
"operations.resources": {
|
|
3289
|
-
id: "operations.resources",
|
|
3290
|
-
order: 140,
|
|
3291
|
-
label: "Resources",
|
|
3292
|
-
enabled: true,
|
|
3293
|
-
lifecycle: "active",
|
|
3294
|
-
path: "/operations/resources"
|
|
3295
|
-
},
|
|
3296
|
-
"operations.command-queue": {
|
|
3297
|
-
id: "operations.command-queue",
|
|
3298
|
-
order: 150,
|
|
3299
|
-
label: "Command Queue",
|
|
3300
|
-
enabled: true,
|
|
3301
|
-
lifecycle: "active",
|
|
3302
|
-
path: "/operations/command-queue"
|
|
3303
|
-
},
|
|
3304
|
-
"operations.sessions": {
|
|
3305
|
-
id: "operations.sessions",
|
|
3306
|
-
order: 160,
|
|
3307
|
-
label: "Sessions",
|
|
3308
|
-
enabled: false,
|
|
3309
|
-
lifecycle: "deprecated",
|
|
3310
|
-
path: "/operations/sessions"
|
|
3311
|
-
},
|
|
3312
|
-
"operations.task-scheduler": {
|
|
3313
|
-
id: "operations.task-scheduler",
|
|
3314
|
-
order: 170,
|
|
3315
|
-
label: "Task Scheduler",
|
|
3316
|
-
enabled: true,
|
|
3317
|
-
lifecycle: "active",
|
|
3318
|
-
path: "/operations/task-scheduler"
|
|
3319
|
-
},
|
|
3320
|
-
monitoring: {
|
|
3321
|
-
id: "monitoring",
|
|
3322
|
-
order: 180,
|
|
3323
|
-
label: "Monitoring",
|
|
3324
|
-
enabled: true,
|
|
3325
|
-
lifecycle: "active"
|
|
3326
|
-
},
|
|
3327
|
-
"monitoring.calendar": {
|
|
3328
|
-
id: "monitoring.calendar",
|
|
3329
|
-
order: 190,
|
|
3330
|
-
label: "Calendar",
|
|
3331
|
-
description: "Google Calendar events and agenda views",
|
|
3332
|
-
enabled: true,
|
|
3333
|
-
lifecycle: "active",
|
|
3334
|
-
path: "/monitoring/calendar",
|
|
3335
|
-
icon: "calendar"
|
|
3336
|
-
},
|
|
3337
|
-
"monitoring.activity-log": {
|
|
3338
|
-
id: "monitoring.activity-log",
|
|
3339
|
-
order: 200,
|
|
3340
|
-
label: "Activity Log",
|
|
3341
|
-
enabled: true,
|
|
3342
|
-
lifecycle: "active",
|
|
3343
|
-
path: "/monitoring/activity-log"
|
|
3344
|
-
},
|
|
3345
|
-
"monitoring.execution-logs": {
|
|
3346
|
-
id: "monitoring.execution-logs",
|
|
3347
|
-
order: 210,
|
|
3348
|
-
label: "Execution Logs",
|
|
3349
|
-
enabled: true,
|
|
3350
|
-
lifecycle: "active",
|
|
3351
|
-
path: "/monitoring/execution-logs"
|
|
3352
|
-
},
|
|
3353
|
-
"monitoring.execution-health": {
|
|
3354
|
-
id: "monitoring.execution-health",
|
|
3355
|
-
order: 220,
|
|
3356
|
-
label: "Execution Health",
|
|
3357
|
-
enabled: true,
|
|
3358
|
-
lifecycle: "active",
|
|
3359
|
-
path: "/monitoring/execution-health"
|
|
3360
|
-
},
|
|
3361
|
-
"monitoring.cost-analytics": {
|
|
3362
|
-
id: "monitoring.cost-analytics",
|
|
3363
|
-
order: 230,
|
|
3364
|
-
label: "Cost Analytics",
|
|
3365
|
-
enabled: false,
|
|
3366
|
-
lifecycle: "deprecated",
|
|
3367
|
-
path: "/monitoring/cost-analytics"
|
|
3368
|
-
},
|
|
3369
|
-
"monitoring.notifications": {
|
|
3370
|
-
id: "monitoring.notifications",
|
|
3371
|
-
order: 240,
|
|
3372
|
-
label: "Notifications",
|
|
3373
|
-
enabled: true,
|
|
3374
|
-
lifecycle: "active",
|
|
3375
|
-
path: "/monitoring/notifications"
|
|
3376
|
-
},
|
|
3377
|
-
"monitoring.submitted-requests": {
|
|
3378
|
-
id: "monitoring.submitted-requests",
|
|
3379
|
-
order: 250,
|
|
3380
|
-
label: "Submitted Requests",
|
|
3381
|
-
enabled: true,
|
|
3382
|
-
lifecycle: "active",
|
|
3383
|
-
path: "/monitoring/requests"
|
|
3384
|
-
},
|
|
3385
|
-
settings: {
|
|
3386
|
-
id: "settings",
|
|
3387
|
-
order: 260,
|
|
3388
|
-
label: "Settings",
|
|
3389
|
-
enabled: true,
|
|
3390
|
-
lifecycle: "active",
|
|
3391
|
-
icon: "settings"
|
|
3392
|
-
},
|
|
3393
|
-
"settings.account": {
|
|
3394
|
-
id: "settings.account",
|
|
3395
|
-
order: 270,
|
|
3396
|
-
label: "Account",
|
|
3397
|
-
enabled: true,
|
|
3398
|
-
lifecycle: "active",
|
|
3399
|
-
path: "/settings/account"
|
|
3400
|
-
},
|
|
3401
|
-
"settings.appearance": {
|
|
3402
|
-
id: "settings.appearance",
|
|
3403
|
-
order: 280,
|
|
3404
|
-
label: "Appearance",
|
|
3405
|
-
enabled: true,
|
|
3406
|
-
lifecycle: "active",
|
|
3407
|
-
path: "/settings/appearance"
|
|
3408
|
-
},
|
|
3409
|
-
"settings.roles": {
|
|
3410
|
-
id: "settings.roles",
|
|
3411
|
-
order: 290,
|
|
3412
|
-
label: "My Roles",
|
|
3413
|
-
enabled: true,
|
|
3414
|
-
lifecycle: "active",
|
|
3415
|
-
path: "/settings/roles"
|
|
3416
|
-
},
|
|
3417
|
-
"settings.organization": {
|
|
3418
|
-
id: "settings.organization",
|
|
3419
|
-
order: 300,
|
|
3420
|
-
label: "Organization",
|
|
3421
|
-
enabled: true,
|
|
3422
|
-
lifecycle: "active",
|
|
3423
|
-
path: "/settings/organization"
|
|
3424
|
-
},
|
|
3425
|
-
"settings.credentials": {
|
|
3426
|
-
id: "settings.credentials",
|
|
3427
|
-
order: 310,
|
|
3428
|
-
label: "Credentials",
|
|
3429
|
-
enabled: true,
|
|
3430
|
-
lifecycle: "active",
|
|
3431
|
-
path: "/settings/credentials"
|
|
3432
|
-
},
|
|
3433
|
-
"settings.api-keys": {
|
|
3434
|
-
id: "settings.api-keys",
|
|
3435
|
-
order: 320,
|
|
3436
|
-
label: "API Keys",
|
|
3437
|
-
enabled: true,
|
|
3438
|
-
lifecycle: "active",
|
|
3439
|
-
path: "/settings/api-keys"
|
|
3440
|
-
},
|
|
3441
|
-
"settings.webhooks": {
|
|
3442
|
-
id: "settings.webhooks",
|
|
3443
|
-
order: 330,
|
|
3444
|
-
label: "Webhooks",
|
|
3445
|
-
enabled: true,
|
|
3446
|
-
lifecycle: "active",
|
|
3447
|
-
path: "/settings/webhooks"
|
|
3448
|
-
},
|
|
3449
|
-
"settings.deployments": {
|
|
3450
|
-
id: "settings.deployments",
|
|
3451
|
-
order: 340,
|
|
3452
|
-
label: "Deployments",
|
|
3453
|
-
enabled: true,
|
|
3454
|
-
lifecycle: "active",
|
|
3455
|
-
path: "/settings/deployments"
|
|
3456
|
-
},
|
|
3457
|
-
admin: {
|
|
3458
|
-
id: "admin",
|
|
3459
|
-
order: 350,
|
|
3460
|
-
label: "Admin",
|
|
3461
|
-
enabled: true,
|
|
3462
|
-
lifecycle: "active",
|
|
3463
|
-
path: "/admin",
|
|
3464
|
-
icon: "admin",
|
|
3465
|
-
requiresAdmin: true
|
|
3466
|
-
},
|
|
3467
|
-
"admin.system-health": {
|
|
3468
|
-
id: "admin.system-health",
|
|
3469
|
-
order: 360,
|
|
3470
|
-
label: "System Health",
|
|
3471
|
-
enabled: true,
|
|
3472
|
-
lifecycle: "active",
|
|
3473
|
-
path: "/admin/system-health"
|
|
3474
|
-
},
|
|
3475
|
-
"admin.organizations": {
|
|
3476
|
-
id: "admin.organizations",
|
|
3477
|
-
order: 370,
|
|
3478
|
-
label: "Organizations",
|
|
3479
|
-
enabled: true,
|
|
3480
|
-
lifecycle: "active",
|
|
3481
|
-
path: "/admin/organizations"
|
|
3482
|
-
},
|
|
3483
|
-
"admin.users": {
|
|
3484
|
-
id: "admin.users",
|
|
3485
|
-
order: 380,
|
|
3486
|
-
label: "Users",
|
|
3487
|
-
enabled: true,
|
|
3488
|
-
lifecycle: "active",
|
|
3489
|
-
path: "/admin/users"
|
|
3490
|
-
},
|
|
3491
|
-
"admin.design-showcase": {
|
|
3492
|
-
id: "admin.design-showcase",
|
|
3493
|
-
order: 390,
|
|
3494
|
-
label: "Design Showcase",
|
|
3495
|
-
enabled: true,
|
|
3496
|
-
lifecycle: "active",
|
|
3497
|
-
path: "/admin/design-showcase"
|
|
3498
|
-
},
|
|
3499
|
-
"admin.debug": {
|
|
3500
|
-
id: "admin.debug",
|
|
3501
|
-
order: 400,
|
|
3502
|
-
label: "Debug",
|
|
3503
|
-
enabled: true,
|
|
3504
|
-
lifecycle: "active",
|
|
3505
|
-
path: "/admin/debug"
|
|
3506
|
-
},
|
|
3507
|
-
archive: {
|
|
3508
|
-
id: "archive",
|
|
3509
|
-
order: 410,
|
|
3510
|
-
label: "Archive",
|
|
3511
|
-
enabled: true,
|
|
3512
|
-
lifecycle: "active",
|
|
3513
|
-
path: "/archive",
|
|
3514
|
-
icon: "archive",
|
|
3515
|
-
devOnly: true
|
|
3516
|
-
},
|
|
3517
|
-
"archive.agent-chat": {
|
|
3518
|
-
id: "archive.agent-chat",
|
|
3519
|
-
order: 420,
|
|
3520
|
-
label: "Agent Chat",
|
|
3521
|
-
enabled: true,
|
|
3522
|
-
lifecycle: "active",
|
|
3523
|
-
path: "/archive/agent-chat"
|
|
3524
|
-
},
|
|
3525
|
-
"archive.execution-runner": {
|
|
3526
|
-
id: "archive.execution-runner",
|
|
3527
|
-
order: 430,
|
|
3528
|
-
label: "Execution Runner",
|
|
3529
|
-
enabled: true,
|
|
3530
|
-
lifecycle: "active",
|
|
3531
|
-
path: "/archive/execution-runner"
|
|
3532
|
-
},
|
|
3533
|
-
seo: {
|
|
3534
|
-
id: "seo",
|
|
3535
|
-
order: 440,
|
|
3536
|
-
label: "SEO",
|
|
3537
|
-
enabled: false,
|
|
3538
|
-
lifecycle: "deprecated",
|
|
3539
|
-
path: "/seo"
|
|
3540
|
-
},
|
|
3541
|
-
knowledge: {
|
|
3542
|
-
id: "knowledge",
|
|
3543
|
-
order: 450,
|
|
3544
|
-
label: "Knowledge",
|
|
3545
|
-
description: "Operational knowledge, playbooks, and strategy docs",
|
|
3546
|
-
enabled: true,
|
|
3547
|
-
lifecycle: "active",
|
|
3548
|
-
color: "teal",
|
|
3549
|
-
icon: "knowledge"
|
|
3550
|
-
},
|
|
3551
|
-
"knowledge.base": {
|
|
3552
|
-
id: "knowledge.base",
|
|
3553
|
-
order: 460,
|
|
3554
|
-
label: "Knowledge Base",
|
|
3555
|
-
enabled: true,
|
|
3556
|
-
lifecycle: "active",
|
|
3557
|
-
path: "/knowledge"
|
|
3558
|
-
}
|
|
3559
|
-
},
|
|
2407
|
+
// Generic empty systems map. Elevasis-specific systems (platform, sales, sales.crm,
|
|
2408
|
+
// sales.lead-gen, monitoring, settings, admin, etc.) have been relocated to
|
|
2409
|
+
// `@repo/elevasis-core/src/organization-model/systems.ts` via `canonicalOrganizationModel`.
|
|
2410
|
+
// Tenant OM configs supply their own systems via `resolveOrganizationModel`.
|
|
2411
|
+
systems: {},
|
|
3560
2412
|
ontology: DEFAULT_ONTOLOGY_SCOPE,
|
|
3561
2413
|
resources: DEFAULT_ORGANIZATION_MODEL_RESOURCES,
|
|
3562
2414
|
topology: DEFAULT_ORGANIZATION_MODEL_TOPOLOGY,
|
|
3563
|
-
actions
|
|
2415
|
+
// Generic empty actions map. Elevasis-specific action entries have been relocated to
|
|
2416
|
+
// `@repo/elevasis-core/src/organization-model/actions.ts`.
|
|
2417
|
+
actions: {},
|
|
3564
2418
|
entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES2,
|
|
3565
2419
|
policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
|
|
3566
|
-
// Phase 4 (D1): statuses top-level field removed; bridge status mirrors may
|
|
3567
|
-
// still project from System.content, but primary authoring belongs in ontology.
|
|
3568
2420
|
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
3569
2421
|
};
|
|
3570
2422
|
var StatusSemanticClassSchema = z.enum([
|
|
@@ -3869,101 +2721,6 @@ var DEFAULT_ORGANIZATION_MODEL_STATUSES = {
|
|
|
3869
2721
|
}
|
|
3870
2722
|
};
|
|
3871
2723
|
|
|
3872
|
-
// src/organization-model/catalogs/lead-gen.ts
|
|
3873
|
-
var LEAD_GEN_STAGE_CATALOG = {
|
|
3874
|
-
// Prospecting - company population
|
|
3875
|
-
scraped: {
|
|
3876
|
-
key: "scraped",
|
|
3877
|
-
label: "Scraped",
|
|
3878
|
-
description: "Company was scraped from a source directory (Apify actor run).",
|
|
3879
|
-
order: 1,
|
|
3880
|
-
entity: "company"
|
|
3881
|
-
},
|
|
3882
|
-
populated: {
|
|
3883
|
-
key: "populated",
|
|
3884
|
-
label: "Companies found",
|
|
3885
|
-
description: "Companies have been found and added to the lead-gen list.",
|
|
3886
|
-
order: 2,
|
|
3887
|
-
entity: "company"
|
|
3888
|
-
},
|
|
3889
|
-
crawled: {
|
|
3890
|
-
key: "crawled",
|
|
3891
|
-
label: "Websites crawled",
|
|
3892
|
-
description: "Company websites have been crawled (e.g. via Apify) and raw page content stored for downstream LLM analysis.",
|
|
3893
|
-
order: 2.5,
|
|
3894
|
-
entity: "company"
|
|
3895
|
-
},
|
|
3896
|
-
extracted: {
|
|
3897
|
-
key: "extracted",
|
|
3898
|
-
label: "Websites analyzed",
|
|
3899
|
-
description: "Company websites have been analyzed for business signals.",
|
|
3900
|
-
order: 3,
|
|
3901
|
-
entity: "company"
|
|
3902
|
-
},
|
|
3903
|
-
enriched: {
|
|
3904
|
-
key: "enriched",
|
|
3905
|
-
label: "Enriched",
|
|
3906
|
-
description: "Company or contact enriched with third-party data (e.g. Tomba, Anymailfinder).",
|
|
3907
|
-
order: 4,
|
|
3908
|
-
entity: "company"
|
|
3909
|
-
},
|
|
3910
|
-
"decision-makers-enriched": {
|
|
3911
|
-
key: "decision-makers-enriched",
|
|
3912
|
-
label: "Decision-makers found",
|
|
3913
|
-
description: "Decision-maker contacts discovered and attached to a qualified company.",
|
|
3914
|
-
order: 6,
|
|
3915
|
-
entity: "company",
|
|
3916
|
-
recordEntity: "contact",
|
|
3917
|
-
recordStageKey: "discovered"
|
|
3918
|
-
},
|
|
3919
|
-
// Prospecting - contact discovery
|
|
3920
|
-
discovered: {
|
|
3921
|
-
key: "discovered",
|
|
3922
|
-
label: "Decision-makers found",
|
|
3923
|
-
description: "Decision-maker contact details have been found.",
|
|
3924
|
-
order: 5,
|
|
3925
|
-
entity: "contact"
|
|
3926
|
-
},
|
|
3927
|
-
verified: {
|
|
3928
|
-
key: "verified",
|
|
3929
|
-
label: "Emails verified",
|
|
3930
|
-
description: "Contact email addresses have been checked for deliverability.",
|
|
3931
|
-
order: 7,
|
|
3932
|
-
entity: "contact"
|
|
3933
|
-
},
|
|
3934
|
-
// Qualification
|
|
3935
|
-
qualified: {
|
|
3936
|
-
key: "qualified",
|
|
3937
|
-
label: "Companies qualified",
|
|
3938
|
-
description: "Companies have been scored against the qualification criteria.",
|
|
3939
|
-
order: 8,
|
|
3940
|
-
entity: "company"
|
|
3941
|
-
},
|
|
3942
|
-
// Outreach
|
|
3943
|
-
personalized: {
|
|
3944
|
-
key: "personalized",
|
|
3945
|
-
label: "Personalized",
|
|
3946
|
-
description: "Outreach message personalized for the contact (Instantly personalization workflow).",
|
|
3947
|
-
order: 9,
|
|
3948
|
-
entity: "contact"
|
|
3949
|
-
},
|
|
3950
|
-
uploaded: {
|
|
3951
|
-
key: "uploaded",
|
|
3952
|
-
label: "Reviewed and exported",
|
|
3953
|
-
description: "Approved records have been reviewed and exported for handoff.",
|
|
3954
|
-
order: 10,
|
|
3955
|
-
entity: "company",
|
|
3956
|
-
additionalEntities: ["contact"]
|
|
3957
|
-
},
|
|
3958
|
-
interested: {
|
|
3959
|
-
key: "interested",
|
|
3960
|
-
label: "Interested",
|
|
3961
|
-
description: "Contact replied with a positive signal (Instantly reply-handler transition).",
|
|
3962
|
-
order: 11,
|
|
3963
|
-
entity: "contact"
|
|
3964
|
-
}
|
|
3965
|
-
};
|
|
3966
|
-
|
|
3967
2724
|
// src/organization-model/helpers.ts
|
|
3968
2725
|
function childSystemsOf2(system) {
|
|
3969
2726
|
return system.systems ?? system.subsystems ?? {};
|
|
@@ -4008,15 +2765,7 @@ function mergeJsonConfig(base, override) {
|
|
|
4008
2765
|
function resolveSystemConfig(model, path) {
|
|
4009
2766
|
const system = getSystem(model, path);
|
|
4010
2767
|
if (system === void 0) return {};
|
|
4011
|
-
|
|
4012
|
-
for (const node of Object.values(system.content ?? {})) {
|
|
4013
|
-
if (node.kind !== "config" || node.type !== "kv") continue;
|
|
4014
|
-
const entries = node.data?.entries;
|
|
4015
|
-
if (isPlainJsonObject(entries)) {
|
|
4016
|
-
resolved = mergeJsonConfig(resolved, entries);
|
|
4017
|
-
}
|
|
4018
|
-
}
|
|
4019
|
-
return mergeJsonConfig(resolved, system.config ?? {});
|
|
2768
|
+
return mergeJsonConfig({}, system.config ?? {});
|
|
4020
2769
|
}
|
|
4021
2770
|
|
|
4022
2771
|
// src/organization-model/resolve.ts
|
|
@@ -4100,6 +2849,9 @@ function resolveOrganizationModelWithResources(override, organizationId) {
|
|
|
4100
2849
|
}
|
|
4101
2850
|
|
|
4102
2851
|
// src/organization-model/surface-projection.ts
|
|
2852
|
+
function normalizePath(path) {
|
|
2853
|
+
return path.length > 1 ? path.replace(/\/+$/, "") : path;
|
|
2854
|
+
}
|
|
4103
2855
|
function collectSystemsById(model) {
|
|
4104
2856
|
const systemsById = /* @__PURE__ */ new Map();
|
|
4105
2857
|
for (const { path, system } of listAllSystems(model)) {
|
|
@@ -4179,6 +2931,55 @@ function projectOrganizationSurfaces(model) {
|
|
|
4179
2931
|
};
|
|
4180
2932
|
});
|
|
4181
2933
|
}
|
|
2934
|
+
function validateOrganizationSurfaceProjection(model) {
|
|
2935
|
+
const issues = [];
|
|
2936
|
+
const systemsById = collectSystemsById(model);
|
|
2937
|
+
const surfaceIds = /* @__PURE__ */ new Set();
|
|
2938
|
+
const surfacePaths = /* @__PURE__ */ new Map();
|
|
2939
|
+
function addIssue2(issue) {
|
|
2940
|
+
issues.push(issue);
|
|
2941
|
+
}
|
|
2942
|
+
getSidebarSurfaces(model).forEach(({ id, surface, path }) => {
|
|
2943
|
+
if (surfaceIds.has(id)) {
|
|
2944
|
+
addIssue2({
|
|
2945
|
+
code: "duplicate-surface-id",
|
|
2946
|
+
message: `Surface id "${id}" must be unique`,
|
|
2947
|
+
path,
|
|
2948
|
+
surfaceId: id,
|
|
2949
|
+
value: id
|
|
2950
|
+
});
|
|
2951
|
+
} else {
|
|
2952
|
+
surfaceIds.add(id);
|
|
2953
|
+
}
|
|
2954
|
+
const normalizedPath = normalizePath(surface.path);
|
|
2955
|
+
const existingSurfaceId = surfacePaths.get(normalizedPath);
|
|
2956
|
+
if (existingSurfaceId !== void 0) {
|
|
2957
|
+
addIssue2({
|
|
2958
|
+
code: "duplicate-surface-path",
|
|
2959
|
+
message: `Surface path "${surface.path}" is already used by surface "${existingSurfaceId}"`,
|
|
2960
|
+
path: [...path, "path"],
|
|
2961
|
+
surfaceId: id,
|
|
2962
|
+
value: surface.path
|
|
2963
|
+
});
|
|
2964
|
+
} else {
|
|
2965
|
+
surfacePaths.set(normalizedPath, id);
|
|
2966
|
+
}
|
|
2967
|
+
surface.targets?.systems?.forEach((systemId, systemIndex) => {
|
|
2968
|
+
if (systemsById.has(systemId)) {
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
addIssue2({
|
|
2972
|
+
code: "unknown-surface-system",
|
|
2973
|
+
message: `Surface "${id}" references unknown system "${systemId}"`,
|
|
2974
|
+
path: [...path, "targets", "systems", systemIndex],
|
|
2975
|
+
surfaceId: id,
|
|
2976
|
+
systemId,
|
|
2977
|
+
value: systemId
|
|
2978
|
+
});
|
|
2979
|
+
});
|
|
2980
|
+
});
|
|
2981
|
+
return issues;
|
|
2982
|
+
}
|
|
4182
2983
|
|
|
4183
2984
|
// src/organization-model/foundation.ts
|
|
4184
2985
|
function createFoundationOrganizationModel(override) {
|
|
@@ -4208,4 +3009,331 @@ function createFoundationOrganizationModel(override) {
|
|
|
4208
3009
|
};
|
|
4209
3010
|
}
|
|
4210
3011
|
|
|
4211
|
-
|
|
3012
|
+
// src/organization-model/scaffolders/helpers.ts
|
|
3013
|
+
function slugify(input) {
|
|
3014
|
+
return input.trim().replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3015
|
+
}
|
|
3016
|
+
function titleize(input) {
|
|
3017
|
+
return input.split(/[-._\s]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3018
|
+
}
|
|
3019
|
+
function assertSystemPathAvailable(model, path) {
|
|
3020
|
+
if (getSystem(model, path) !== void 0) {
|
|
3021
|
+
throw new Error(`system already exists: ${path}`);
|
|
3022
|
+
}
|
|
3023
|
+
const parent = parentPathOf(path);
|
|
3024
|
+
if (parent !== void 0 && getSystem(model, parent) === void 0) {
|
|
3025
|
+
throw new Error(`parent system does not exist: ${parent}`);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
function assertSystemExists(model, path) {
|
|
3029
|
+
if (getSystem(model, path) === void 0) {
|
|
3030
|
+
throw new Error(`system does not exist: ${path}`);
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
function parentPathOf(path) {
|
|
3034
|
+
const index = path.lastIndexOf(".");
|
|
3035
|
+
return index === -1 ? void 0 : path.slice(0, index);
|
|
3036
|
+
}
|
|
3037
|
+
function localIdOf(path) {
|
|
3038
|
+
return path.split(".").at(-1) ?? path;
|
|
3039
|
+
}
|
|
3040
|
+
function nextSystemOrder(model, parentPath) {
|
|
3041
|
+
const siblings = parentPath === void 0 ? listAllSystems(model).filter(({ path }) => !path.includes(".")) : listAllSystems(model).filter(({ path }) => parentPathOf(path) === parentPath);
|
|
3042
|
+
const maxOrder = siblings.reduce((max, { system }) => Math.max(max, system.order), 0);
|
|
3043
|
+
return Math.ceil((maxOrder + 10) / 10) * 10;
|
|
3044
|
+
}
|
|
3045
|
+
function ontologyMapName(kind) {
|
|
3046
|
+
const map = {
|
|
3047
|
+
object: "objectTypes",
|
|
3048
|
+
link: "linkTypes",
|
|
3049
|
+
action: "actionTypes",
|
|
3050
|
+
catalog: "catalogTypes",
|
|
3051
|
+
event: "eventTypes",
|
|
3052
|
+
interface: "interfaceTypes",
|
|
3053
|
+
"value-type": "valueTypes",
|
|
3054
|
+
property: "sharedProperties",
|
|
3055
|
+
group: "groups",
|
|
3056
|
+
surface: "surfaces"
|
|
3057
|
+
};
|
|
3058
|
+
return map[kind];
|
|
3059
|
+
}
|
|
3060
|
+
function makeOntologyId(systemPath, kind, localId) {
|
|
3061
|
+
return formatOntologyId({ scope: systemPath, kind, localId: slugify(localId) });
|
|
3062
|
+
}
|
|
3063
|
+
function addProjectNextStep(plan, enabled, command) {
|
|
3064
|
+
if (!enabled) return plan;
|
|
3065
|
+
return {
|
|
3066
|
+
...plan,
|
|
3067
|
+
projectCommand: command,
|
|
3068
|
+
nextSteps: [...plan.nextSteps, `Run project handoff: ${command}`]
|
|
3069
|
+
};
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
// src/organization-model/scaffolders/scaffoldKnowledgeNode.ts
|
|
3073
|
+
function scaffoldKnowledgeNode(model, spec) {
|
|
3074
|
+
if (spec.systemPath !== void 0) assertSystemExists(model, spec.systemPath);
|
|
3075
|
+
if (model.knowledge?.[spec.id] !== void 0) {
|
|
3076
|
+
throw new Error(`knowledge node already exists: ${spec.id}`);
|
|
3077
|
+
}
|
|
3078
|
+
const title = spec.label ?? titleize(spec.id.replace(/^knowledge\./, ""));
|
|
3079
|
+
const slug = slugify(spec.id.replace(/^knowledge\./, ""));
|
|
3080
|
+
const kind = spec.kind ?? "reference";
|
|
3081
|
+
const links = spec.systemPath === void 0 ? "" : `links:
|
|
3082
|
+
- system:${spec.systemPath}
|
|
3083
|
+
`;
|
|
3084
|
+
const ownerIds = spec.ownerRoleId === void 0 ? "" : `ownerIds:
|
|
3085
|
+
- ${spec.ownerRoleId}
|
|
3086
|
+
`;
|
|
3087
|
+
return {
|
|
3088
|
+
intent: "knowledge",
|
|
3089
|
+
id: spec.id,
|
|
3090
|
+
summary: `Scaffold ${kind} knowledge node "${spec.id}".`,
|
|
3091
|
+
writes: [
|
|
3092
|
+
{
|
|
3093
|
+
path: `packages/elevasis-core/src/knowledge/nodes/${slug}.mdx.stub`,
|
|
3094
|
+
mode: "create",
|
|
3095
|
+
description: "Knowledge node MDX skeleton.",
|
|
3096
|
+
content: `---
|
|
3097
|
+
id: ${spec.id}
|
|
3098
|
+
kind: ${kind}
|
|
3099
|
+
title: ${JSON.stringify(title)}
|
|
3100
|
+
summary: ${JSON.stringify(spec.description ?? `${title} knowledge node.`)}
|
|
3101
|
+
${links}${ownerIds}updatedAt: 2026-05-15
|
|
3102
|
+
---
|
|
3103
|
+
|
|
3104
|
+
## Overview
|
|
3105
|
+
|
|
3106
|
+
Capture the durable operating knowledge here.
|
|
3107
|
+
`
|
|
3108
|
+
}
|
|
3109
|
+
],
|
|
3110
|
+
edits: [
|
|
3111
|
+
{
|
|
3112
|
+
path: "packages/elevasis-core/src/organization-model/knowledge.ts",
|
|
3113
|
+
description: "Register this generated node after replacing the .stub suffix.",
|
|
3114
|
+
snippet: `${JSON.stringify(spec.id)}`
|
|
3115
|
+
}
|
|
3116
|
+
],
|
|
3117
|
+
warnings: [],
|
|
3118
|
+
nextSteps: [
|
|
3119
|
+
"Replace the .stub suffix after the node is ready to become canonical.",
|
|
3120
|
+
spec.systemPath === void 0 ? "Add links to the OM nodes this knowledge governs." : `Run pnpm exec elevasis om:verify --scope ${spec.systemPath}.`
|
|
3121
|
+
],
|
|
3122
|
+
projectCommand: spec.withProject && spec.systemPath !== void 0 ? `pnpm exec elevasis project:create --link-om ${spec.systemPath} --title "Add ${title} knowledge" --kind om-change` : void 0
|
|
3123
|
+
};
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
// src/organization-model/scaffolders/scaffoldOntologyRecord.ts
|
|
3127
|
+
function scaffoldOntologyRecord(model, spec) {
|
|
3128
|
+
assertSystemExists(model, spec.systemPath);
|
|
3129
|
+
const localId = spec.localId ?? spec.id;
|
|
3130
|
+
const ontologyId = makeOntologyId(spec.systemPath, spec.kind, localId);
|
|
3131
|
+
const label = spec.label ?? titleize(localId);
|
|
3132
|
+
const mapName = ontologyMapName(spec.kind);
|
|
3133
|
+
return {
|
|
3134
|
+
intent: "ontology",
|
|
3135
|
+
id: ontologyId,
|
|
3136
|
+
summary: `Scaffold ${spec.kind} ontology record "${ontologyId}".`,
|
|
3137
|
+
writes: [],
|
|
3138
|
+
edits: [
|
|
3139
|
+
{
|
|
3140
|
+
path: "packages/elevasis-core/src/organization-model/systems.ts",
|
|
3141
|
+
description: `Add this record under ${spec.systemPath}.ontology.${mapName}.`,
|
|
3142
|
+
snippet: `${JSON.stringify(ontologyId)}: {
|
|
3143
|
+
id: ${JSON.stringify(ontologyId)},
|
|
3144
|
+
label: ${JSON.stringify(label)},
|
|
3145
|
+
ownerSystemId: ${JSON.stringify(spec.systemPath)}${spec.description === void 0 ? "" : `,
|
|
3146
|
+
description: ${JSON.stringify(spec.description)}`}
|
|
3147
|
+
}`
|
|
3148
|
+
}
|
|
3149
|
+
],
|
|
3150
|
+
warnings: [],
|
|
3151
|
+
nextSteps: [
|
|
3152
|
+
"Wire any cross-references using canonical ontology IDs.",
|
|
3153
|
+
`Run pnpm exec elevasis om:verify --scope ${spec.systemPath}.`
|
|
3154
|
+
],
|
|
3155
|
+
projectCommand: spec.withProject ? `pnpm exec elevasis project:create --link-om ${spec.systemPath} --title "Add ${label} ontology" --kind om-change` : void 0
|
|
3156
|
+
};
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
// src/organization-model/scaffolders/scaffoldResource.ts
|
|
3160
|
+
function scaffoldResource(model, spec) {
|
|
3161
|
+
assertSystemExists(model, spec.systemPath);
|
|
3162
|
+
if (model.resources?.[spec.id] !== void 0) {
|
|
3163
|
+
throw new Error(`resource already exists: ${spec.id}`);
|
|
3164
|
+
}
|
|
3165
|
+
const label = spec.label ?? titleize(spec.id);
|
|
3166
|
+
const kind = spec.kind ?? "workflow";
|
|
3167
|
+
const slug = slugify(spec.id);
|
|
3168
|
+
const writes = spec.withStubWorkflow ? [
|
|
3169
|
+
{
|
|
3170
|
+
path: `packages/elevasis-core/src/workflows/${slug}.stub.ts`,
|
|
3171
|
+
mode: "create",
|
|
3172
|
+
description: "Optional workflow implementation stub. Runtime wiring remains manual.",
|
|
3173
|
+
content: `// Stub only. Replace with a real workflow implementation before registering the resource.
|
|
3174
|
+
export const ${slug.replaceAll("-", "_")}Workflow = {
|
|
3175
|
+
id: ${JSON.stringify(spec.id)}
|
|
3176
|
+
}
|
|
3177
|
+
`
|
|
3178
|
+
}
|
|
3179
|
+
] : [];
|
|
3180
|
+
return {
|
|
3181
|
+
intent: "resource",
|
|
3182
|
+
id: spec.id,
|
|
3183
|
+
summary: `Scaffold ${kind} Resource "${spec.id}" for System "${spec.systemPath}".`,
|
|
3184
|
+
writes,
|
|
3185
|
+
edits: [
|
|
3186
|
+
{
|
|
3187
|
+
path: "packages/elevasis-core/src/organization-model/resources.ts",
|
|
3188
|
+
description: "Add this descriptor to platformResources/platformResourceDescriptors.",
|
|
3189
|
+
snippet: `${JSON.stringify(spec.id)}: {
|
|
3190
|
+
id: ${JSON.stringify(spec.id)},
|
|
3191
|
+
order: 0,
|
|
3192
|
+
kind: ${JSON.stringify(kind)},
|
|
3193
|
+
systemPath: ${JSON.stringify(spec.systemPath)},
|
|
3194
|
+
title: ${JSON.stringify(label)},
|
|
3195
|
+
${spec.description === void 0 ? "" : `description: ${JSON.stringify(spec.description)},
|
|
3196
|
+
`}${spec.ownerRoleId === void 0 ? "" : `ownerRoleId: ${JSON.stringify(spec.ownerRoleId)},
|
|
3197
|
+
`}status: 'active',
|
|
3198
|
+
codeRefs: []
|
|
3199
|
+
}`
|
|
3200
|
+
},
|
|
3201
|
+
{
|
|
3202
|
+
path: "packages/elevasis-core/src/organization-model/topology.ts",
|
|
3203
|
+
description: "Add topology relationships only when this resource triggers, uses, or requires approval from another OM node.",
|
|
3204
|
+
snippet: `// topologyRelationship({ from: topologyRef('resource', ${JSON.stringify(spec.id)}), kind: 'uses', to: ... })`
|
|
3205
|
+
}
|
|
3206
|
+
],
|
|
3207
|
+
warnings: ["Resource ontology bindings are intentionally omitted until action/read/write contracts are known."],
|
|
3208
|
+
nextSteps: [
|
|
3209
|
+
"Bind resource.ontology.actions/reads/writes after the ontology records exist.",
|
|
3210
|
+
`Run pnpm exec elevasis om:verify --scope ${spec.systemPath}.`
|
|
3211
|
+
],
|
|
3212
|
+
projectCommand: spec.withProject ? `pnpm exec elevasis project:create --link-om ${spec.systemPath} --title "Add ${label} resource" --kind om-change` : void 0
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
// src/organization-model/scaffolders/scaffoldSystem.ts
|
|
3217
|
+
function scaffoldSystem(model, spec) {
|
|
3218
|
+
const systemPath = spec.parent !== void 0 && !spec.id.includes(".") ? `${spec.parent}.${spec.id}` : spec.id;
|
|
3219
|
+
assertSystemPathAvailable(model, systemPath);
|
|
3220
|
+
const parentPath = parentPathOf(systemPath);
|
|
3221
|
+
const localId = localIdOf(systemPath);
|
|
3222
|
+
const label = spec.label ?? titleize(localId);
|
|
3223
|
+
const roleId = spec.role ?? "role.ops-lead";
|
|
3224
|
+
const uiPath = spec.uiPath ?? `/${localId}`;
|
|
3225
|
+
const featureSlug = slugify(systemPath.replaceAll(".", "-"));
|
|
3226
|
+
const knowledgeId = `knowledge.${featureSlug}-system-overview`;
|
|
3227
|
+
const order = nextSystemOrder(model, parentPath);
|
|
3228
|
+
const withProject = spec.withProject ?? !spec.noProject;
|
|
3229
|
+
const systemEntry = ` ${JSON.stringify(localId)}: {
|
|
3230
|
+
id: ${JSON.stringify(systemPath)},
|
|
3231
|
+
order: ${order},
|
|
3232
|
+
label: ${JSON.stringify(label)},
|
|
3233
|
+
description: ${JSON.stringify(spec.description ?? `${label} bounded context.`)},
|
|
3234
|
+
kind: ${JSON.stringify(spec.kind ?? "operational")},
|
|
3235
|
+
${parentPath === void 0 ? "" : `parentSystemId: ${JSON.stringify(parentPath)},
|
|
3236
|
+
`}responsibleRoleId: ${JSON.stringify(roleId)},
|
|
3237
|
+
governedByKnowledge: [${JSON.stringify(knowledgeId)}],
|
|
3238
|
+
drivesGoals: [],
|
|
3239
|
+
lifecycle: 'draft',
|
|
3240
|
+
ui: {
|
|
3241
|
+
path: ${JSON.stringify(uiPath)},
|
|
3242
|
+
surfaces: [],
|
|
3243
|
+
${spec.icon === void 0 ? "" : `icon: ${JSON.stringify(spec.icon)},`}
|
|
3244
|
+
}${spec.withOntology ? `,
|
|
3245
|
+
ontology: {
|
|
3246
|
+
objectTypes: {}
|
|
3247
|
+
}` : ""}
|
|
3248
|
+
}`;
|
|
3249
|
+
const plan = {
|
|
3250
|
+
intent: "system",
|
|
3251
|
+
id: systemPath,
|
|
3252
|
+
summary: `Scaffold System "${systemPath}" with nav, role wiring, governing knowledge, and a UI manifest stub.`,
|
|
3253
|
+
writes: [
|
|
3254
|
+
{
|
|
3255
|
+
path: `packages/ui/src/features/${featureSlug}/manifest.stub.ts`,
|
|
3256
|
+
mode: "create",
|
|
3257
|
+
description: "SystemModule manifest stub. Route files are intentionally not generated.",
|
|
3258
|
+
content: `import type { SystemModule } from '@repo/ui'
|
|
3259
|
+
|
|
3260
|
+
export const ${featureSlug.replaceAll("-", "_")}Manifest: SystemModule = {
|
|
3261
|
+
systemId: ${JSON.stringify(systemPath)},
|
|
3262
|
+
label: ${JSON.stringify(label)},
|
|
3263
|
+
routes: []
|
|
3264
|
+
}
|
|
3265
|
+
`
|
|
3266
|
+
},
|
|
3267
|
+
{
|
|
3268
|
+
path: `packages/elevasis-core/src/knowledge/nodes/${featureSlug}-system-overview.mdx.stub`,
|
|
3269
|
+
mode: "create",
|
|
3270
|
+
description: "Governing knowledge skeleton for the new System.",
|
|
3271
|
+
content: `---
|
|
3272
|
+
id: ${knowledgeId}
|
|
3273
|
+
kind: reference
|
|
3274
|
+
title: ${JSON.stringify(`${label} System Overview`)}
|
|
3275
|
+
summary: ${JSON.stringify(`Governing context for the ${label} System.`)}
|
|
3276
|
+
links:
|
|
3277
|
+
- system:${systemPath}
|
|
3278
|
+
ownerIds:
|
|
3279
|
+
- ${roleId}
|
|
3280
|
+
updatedAt: 2026-05-15
|
|
3281
|
+
---
|
|
3282
|
+
|
|
3283
|
+
## Purpose
|
|
3284
|
+
|
|
3285
|
+
Document the operating boundaries, decisions, and ownership for ${label}.
|
|
3286
|
+
`
|
|
3287
|
+
}
|
|
3288
|
+
],
|
|
3289
|
+
edits: [
|
|
3290
|
+
{
|
|
3291
|
+
path: "packages/elevasis-core/src/organization-model/systems.ts",
|
|
3292
|
+
description: parentPath === void 0 ? "Add this entry to platformSystems." : `Add this entry under platformSystems ${parentPath}.systems.`,
|
|
3293
|
+
snippet: systemEntry
|
|
3294
|
+
},
|
|
3295
|
+
{
|
|
3296
|
+
path: "packages/elevasis-core/src/organization-model/navigation.ts",
|
|
3297
|
+
description: "Confirm sidebar placement derives from ui.path or add explicit surface targeting if needed.",
|
|
3298
|
+
snippet: `// System "${systemPath}" declares ui.path ${JSON.stringify(uiPath)}. Do not add route files in /om create.`
|
|
3299
|
+
},
|
|
3300
|
+
{
|
|
3301
|
+
path: "packages/elevasis-core/src/organization-model/roles.ts",
|
|
3302
|
+
description: `Confirm ${roleId} exists or add the owning role before merging.`,
|
|
3303
|
+
snippet: `// responsibleRoleId: ${JSON.stringify(roleId)}`
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
path: "packages/elevasis-core/src/organization-model/assembly.ts",
|
|
3307
|
+
description: "Confirm roleFor()/owner routing covers the new System.",
|
|
3308
|
+
snippet: `case ${JSON.stringify(systemPath)}:
|
|
3309
|
+
return ${JSON.stringify(roleId)}`
|
|
3310
|
+
},
|
|
3311
|
+
{
|
|
3312
|
+
path: "packages/elevasis-core/src/organization-model/knowledge.ts",
|
|
3313
|
+
description: "Register the generated governing knowledge node after replacing the .stub suffix.",
|
|
3314
|
+
snippet: `${JSON.stringify(knowledgeId)}`
|
|
3315
|
+
}
|
|
3316
|
+
],
|
|
3317
|
+
warnings: spec.withOntology ? ["Ontology was requested; the default objectTypes block is intentionally empty until the domain language is known."] : ["Ontology is opt-in. Re-run with --with-ontology when the object/action/catalog language is known."],
|
|
3318
|
+
nextSteps: [
|
|
3319
|
+
"Review the planned OM edits and apply them in the listed source files.",
|
|
3320
|
+
"Replace .stub suffixes only after the System entry is merged.",
|
|
3321
|
+
`Run pnpm exec elevasis om:verify --scope ${systemPath}.`
|
|
3322
|
+
]
|
|
3323
|
+
};
|
|
3324
|
+
return addProjectNextStep(
|
|
3325
|
+
plan,
|
|
3326
|
+
withProject,
|
|
3327
|
+
`pnpm exec elevasis project:create --link-om ${systemPath} --title "Build ${label} System" --kind system-build`
|
|
3328
|
+
);
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
// src/organization-model/scaffolders/index.ts
|
|
3332
|
+
function scaffoldOrganizationModel(model, spec) {
|
|
3333
|
+
if (spec.intent === "system") return scaffoldSystem(model, spec);
|
|
3334
|
+
if (spec.intent === "ontology") return scaffoldOntologyRecord(model, spec);
|
|
3335
|
+
if (spec.intent === "resource") return scaffoldResource(model, spec);
|
|
3336
|
+
return scaffoldKnowledgeNode(model, spec);
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_ENTITIES, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineOrganizationModel, defineResource, defineResourceOntology, defineResources, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|