@elevasis/core 0.42.1 → 0.44.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/auth/index.d.ts +8 -3
- package/dist/auth/index.js +6 -0
- package/dist/business/entities-published.d.ts +1 -1
- package/dist/index.d.ts +12 -13
- package/dist/index.js +48 -29
- package/dist/knowledge/index.d.ts +94 -6
- package/dist/knowledge/index.js +172 -8
- package/dist/organization-model/index.d.ts +12 -13
- package/dist/organization-model/index.js +48 -29
- package/dist/test-utils/index.d.ts +5 -6
- package/dist/test-utils/index.js +21 -18
- package/package.json +3 -3
- package/src/auth/access-keys.ts +6 -0
- package/src/business/acquisition/api-schemas.ts +1 -1
- package/src/business/base-entities.ts +1 -1
- package/src/knowledge/cli-helpers.ts +211 -0
- package/src/knowledge/index.ts +13 -0
- package/src/knowledge/published.ts +18 -5
- package/src/knowledge/queries.ts +5 -5
- package/src/organization-model/__tests__/cross-ref.test.ts +11 -1
- package/src/organization-model/__tests__/domains/systems.test.ts +34 -8
- package/src/organization-model/__tests__/scaffolders.test.ts +30 -1
- package/src/organization-model/__tests__/schema-refinements.test.ts +178 -0
- package/src/organization-model/cross-ref.ts +43 -7
- package/src/organization-model/defaults.ts +2 -2
- package/src/organization-model/domains/actions.ts +1 -1
- package/src/organization-model/domains/resources.ts +1 -1
- package/src/organization-model/domains/systems.ts +0 -4
- package/src/organization-model/ontology.ts +13 -18
- package/src/organization-model/organization-graph.mdx +9 -8
- package/src/organization-model/published.ts +9 -3
- package/src/organization-model/resolve.ts +9 -7
- package/src/organization-model/scaffolders/helpers.ts +1 -1
- package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +1 -0
- package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +28 -6
- package/src/organization-model/scaffolders/scaffoldResource.ts +1 -0
- package/src/organization-model/scaffolders/scaffoldSystem.ts +2 -1
- package/src/organization-model/schema-refinements.ts +3 -5
- package/src/platform/registry/__tests__/validation.test.ts +28 -0
- package/src/platform/registry/validation.ts +20 -2
- package/src/scaffold-registry/__tests__/index.test.ts +380 -206
- package/src/scaffold-registry/index.ts +392 -381
- package/src/test-utils/mocks/supabase.ts +1 -1
- package/src/test-utils/mocks/workos.ts +2 -2
package/dist/knowledge/index.js
CHANGED
|
@@ -11,16 +11,13 @@ var OntologyKindSchema = z.enum([
|
|
|
11
11
|
"value-type",
|
|
12
12
|
"property",
|
|
13
13
|
"group",
|
|
14
|
-
"
|
|
14
|
+
"endpoint"
|
|
15
15
|
]);
|
|
16
16
|
var SYSTEM_PATH_PATTERN = "[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)*";
|
|
17
17
|
var LOCAL_ID_PATTERN = "[a-z0-9][a-z0-9._-]*";
|
|
18
18
|
var ONTOLOGY_ID_PATTERN = `^(global|${SYSTEM_PATH_PATTERN}):(${OntologyKindSchema.options.join("|")})\\/(${LOCAL_ID_PATTERN})$`;
|
|
19
19
|
var ONTOLOGY_ID_REGEX = new RegExp(ONTOLOGY_ID_PATTERN);
|
|
20
|
-
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(
|
|
21
|
-
ONTOLOGY_ID_REGEX,
|
|
22
|
-
"Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>"
|
|
23
|
-
);
|
|
20
|
+
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(ONTOLOGY_ID_REGEX, "Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>");
|
|
24
21
|
var OntologyReferenceListSchema = z.array(OntologyIdSchema).default([]).optional();
|
|
25
22
|
var OntologyRecordBaseSchema = z.object({
|
|
26
23
|
id: OntologyIdSchema,
|
|
@@ -66,7 +63,7 @@ var OntologySharedPropertySchema = OntologyRecordBaseSchema.extend({
|
|
|
66
63
|
var OntologyGroupSchema = OntologyRecordBaseSchema.extend({
|
|
67
64
|
members: OntologyReferenceListSchema
|
|
68
65
|
});
|
|
69
|
-
var
|
|
66
|
+
var OntologyEndpointTypeSchema = OntologyRecordBaseSchema.extend({
|
|
70
67
|
route: z.string().trim().min(1).max(500).optional()
|
|
71
68
|
});
|
|
72
69
|
z.object({
|
|
@@ -79,12 +76,30 @@ z.object({
|
|
|
79
76
|
valueTypes: z.record(OntologyIdSchema, OntologyValueTypeSchema).default({}).optional(),
|
|
80
77
|
sharedProperties: z.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
|
|
81
78
|
groups: z.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
|
|
82
|
-
|
|
79
|
+
endpoints: z.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
|
|
83
80
|
}).default({});
|
|
84
81
|
function ontologyGraphNodeId(id) {
|
|
85
82
|
return `ontology:${OntologyIdSchema.parse(id)}`;
|
|
86
83
|
}
|
|
87
84
|
|
|
85
|
+
// src/organization-model/helpers.ts
|
|
86
|
+
function childSystemsOf(system) {
|
|
87
|
+
return system.systems ?? system.subsystems ?? {};
|
|
88
|
+
}
|
|
89
|
+
function getSystem(model, path) {
|
|
90
|
+
const flatMatch = model.systems[path];
|
|
91
|
+
if (flatMatch !== void 0) return flatMatch;
|
|
92
|
+
const segments = path.split(".");
|
|
93
|
+
let current = model.systems;
|
|
94
|
+
let node;
|
|
95
|
+
for (const seg of segments) {
|
|
96
|
+
node = current[seg];
|
|
97
|
+
if (node === void 0) return void 0;
|
|
98
|
+
current = childSystemsOf(node);
|
|
99
|
+
}
|
|
100
|
+
return node;
|
|
101
|
+
}
|
|
102
|
+
|
|
88
103
|
// src/knowledge/queries.ts
|
|
89
104
|
function toGraphNodeId(omNodeId) {
|
|
90
105
|
return `knowledge:${omNodeId}`;
|
|
@@ -247,4 +262,153 @@ function formatIdsOnly(results) {
|
|
|
247
262
|
return ids.join("\n");
|
|
248
263
|
}
|
|
249
264
|
|
|
250
|
-
|
|
265
|
+
// src/knowledge/cli-helpers.ts
|
|
266
|
+
var OM_SEARCH_HIT_KINDS = ["system", "resource", "knowledge", "ontology", "role", "policy"];
|
|
267
|
+
function parseKnowledgeSearchLimit(raw, commandName = "knowledge:search") {
|
|
268
|
+
if (raw === void 0) return 10;
|
|
269
|
+
const n = Number.parseInt(raw, 10);
|
|
270
|
+
if (Number.isNaN(n) || n < 0) {
|
|
271
|
+
throw new Error(`${commandName}: --limit must be a non-negative integer (got "${raw}")`);
|
|
272
|
+
}
|
|
273
|
+
return n;
|
|
274
|
+
}
|
|
275
|
+
function parseKnowledgeSearchKinds(raw, commandName = "knowledge:search") {
|
|
276
|
+
if (raw === void 0) return void 0;
|
|
277
|
+
const requested = raw.split(",").map((s) => s.trim().toLowerCase()).filter((s) => s.length > 0);
|
|
278
|
+
const valid = [];
|
|
279
|
+
const invalid = [];
|
|
280
|
+
for (const kind of requested) {
|
|
281
|
+
if (OM_SEARCH_HIT_KINDS.includes(kind)) {
|
|
282
|
+
valid.push(kind);
|
|
283
|
+
} else {
|
|
284
|
+
invalid.push(kind);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (invalid.length > 0) {
|
|
288
|
+
throw new Error(`${commandName}: unknown kind(s) "${invalid.join(", ")}". Valid: ${OM_SEARCH_HIT_KINDS.join(", ")}`);
|
|
289
|
+
}
|
|
290
|
+
return valid.length > 0 ? valid : void 0;
|
|
291
|
+
}
|
|
292
|
+
function formatKnowledgeSystemsList(entries) {
|
|
293
|
+
if (entries.length === 0) return "(no results)";
|
|
294
|
+
const pathWidth = Math.max(...entries.map((e) => e.path.length), 4);
|
|
295
|
+
const header = `${"PATH".padEnd(pathWidth)} LABEL`;
|
|
296
|
+
const divider = "-".repeat(header.length + 20);
|
|
297
|
+
const rows = entries.map((e) => {
|
|
298
|
+
const label = e.system.label ?? e.system.title ?? e.path;
|
|
299
|
+
return `${e.path.padEnd(pathWidth)} ${label}`;
|
|
300
|
+
});
|
|
301
|
+
return [header, divider, ...rows].join("\n");
|
|
302
|
+
}
|
|
303
|
+
function formatKnowledgeResourcesList(resources) {
|
|
304
|
+
if (resources.length === 0) return "(no results)";
|
|
305
|
+
const idWidth = Math.max(...resources.map((r) => r.id.length), 4);
|
|
306
|
+
const kindWidth = Math.max(...resources.map((r) => r.kind.length), 4);
|
|
307
|
+
const header = `${"ID".padEnd(idWidth)} ${"KIND".padEnd(kindWidth)} TITLE`;
|
|
308
|
+
const divider = "-".repeat(header.length + 20);
|
|
309
|
+
const rows = resources.map((r) => {
|
|
310
|
+
const title = r.title ?? r.id;
|
|
311
|
+
return `${r.id.padEnd(idWidth)} ${r.kind.padEnd(kindWidth)} ${title}`;
|
|
312
|
+
});
|
|
313
|
+
return [header, divider, ...rows].join("\n");
|
|
314
|
+
}
|
|
315
|
+
function formatKnowledgeRolesList(roles) {
|
|
316
|
+
if (roles.length === 0) return "(no results)";
|
|
317
|
+
const idWidth = Math.max(...roles.map((r) => r.id.length), 4);
|
|
318
|
+
const header = `${"ID".padEnd(idWidth)} TITLE`;
|
|
319
|
+
const divider = "-".repeat(header.length + 20);
|
|
320
|
+
const rows = roles.map((r) => `${r.id.padEnd(idWidth)} ${r.title}`);
|
|
321
|
+
return [header, divider, ...rows].join("\n");
|
|
322
|
+
}
|
|
323
|
+
function normalizeKnowledgeNodeId(id) {
|
|
324
|
+
return id.startsWith("knowledge:") ? id.slice("knowledge:".length) : id;
|
|
325
|
+
}
|
|
326
|
+
function formatKnowledgeInvocationLabel(invocation) {
|
|
327
|
+
switch (invocation.kind) {
|
|
328
|
+
case "slash-command":
|
|
329
|
+
return invocation.command;
|
|
330
|
+
case "mcp-tool":
|
|
331
|
+
return `${invocation.server}/${invocation.name}`;
|
|
332
|
+
case "api-endpoint":
|
|
333
|
+
return `${invocation.method} ${invocation.path}`;
|
|
334
|
+
case "script-execution":
|
|
335
|
+
return invocation.resourceId;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function pushActionSource(sources, seen, action) {
|
|
339
|
+
if (!action || action.invocations.length === 0) return;
|
|
340
|
+
const key = `action:${action.id}`;
|
|
341
|
+
if (seen.has(key)) return;
|
|
342
|
+
seen.add(key);
|
|
343
|
+
sources.push({
|
|
344
|
+
kind: "action",
|
|
345
|
+
id: action.id,
|
|
346
|
+
label: action.label,
|
|
347
|
+
targetNodeId: `action:${action.id}`,
|
|
348
|
+
invocations: action.invocations
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function pushAgentResourceSource(sources, seen, resource) {
|
|
352
|
+
if (!resource || resource.kind !== "agent" || resource.invocations.length === 0) return;
|
|
353
|
+
const agentResource = resource;
|
|
354
|
+
const key = `agent-resource:${agentResource.id}`;
|
|
355
|
+
if (seen.has(key)) return;
|
|
356
|
+
seen.add(key);
|
|
357
|
+
sources.push({
|
|
358
|
+
kind: "agent-resource",
|
|
359
|
+
id: agentResource.id,
|
|
360
|
+
label: agentResource.id,
|
|
361
|
+
targetNodeId: `resource:${agentResource.id}`,
|
|
362
|
+
invocations: agentResource.invocations
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function resolveKnowledgeInvocationNeighbors(model, id) {
|
|
366
|
+
const normalizedNodeId = normalizeKnowledgeNodeId(id);
|
|
367
|
+
const node = model.knowledge[normalizedNodeId];
|
|
368
|
+
if (!node) return void 0;
|
|
369
|
+
const sources = [];
|
|
370
|
+
const seen = /* @__PURE__ */ new Set();
|
|
371
|
+
for (const link of node.links) {
|
|
372
|
+
const target = link.target;
|
|
373
|
+
if (target.kind === "action") {
|
|
374
|
+
pushActionSource(sources, seen, model.actions[target.id]);
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (target.kind === "resource") {
|
|
378
|
+
pushAgentResourceSource(sources, seen, model.resources[target.id]);
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
if (target.kind === "system") {
|
|
382
|
+
const system = getSystem(model, target.id);
|
|
383
|
+
for (const actionRef of system?.actions ?? []) {
|
|
384
|
+
pushActionSource(sources, seen, model.actions[actionRef.actionId]);
|
|
385
|
+
}
|
|
386
|
+
for (const resource of Object.values(model.resources)) {
|
|
387
|
+
if (resource.systemPath === target.id) {
|
|
388
|
+
pushAgentResourceSource(sources, seen, resource);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
id: node.id,
|
|
395
|
+
title: node.title,
|
|
396
|
+
invocationSources: sources.sort((a, b) => a.targetNodeId.localeCompare(b.targetNodeId))
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function formatKnowledgeInvocationNeighbors(result) {
|
|
400
|
+
const lines = [`Invocation-bearing graph neighbors for ${result.id}`, ""];
|
|
401
|
+
if (result.invocationSources.length === 0) {
|
|
402
|
+
lines.push(" (none)");
|
|
403
|
+
} else {
|
|
404
|
+
for (const source of result.invocationSources) {
|
|
405
|
+
lines.push(`${source.kind}: ${source.id}`);
|
|
406
|
+
for (const invocation of source.invocations) {
|
|
407
|
+
lines.push(` ${invocation.kind}: ${formatKnowledgeInvocationLabel(invocation)}`);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return lines.join("\n");
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export { OM_SEARCH_HIT_KINDS, byKind, byOwner, bySystem, formatIdsOnly, formatJson, formatKnowledgeInvocationLabel, formatKnowledgeInvocationNeighbors, formatKnowledgeResourcesList, formatKnowledgeRolesList, formatKnowledgeSystemsList, formatText, governedBy, governs, normalizeKnowledgeNodeId, parseKnowledgeSearchKinds, parseKnowledgeSearchLimit, parsePath, resolveKnowledgeInvocationNeighbors };
|
|
@@ -3,7 +3,6 @@ import { z, ZodType } from 'zod';
|
|
|
3
3
|
declare const OntologyKindSchema: z.ZodEnum<{
|
|
4
4
|
object: "object";
|
|
5
5
|
action: "action";
|
|
6
|
-
surface: "surface";
|
|
7
6
|
group: "group";
|
|
8
7
|
link: "link";
|
|
9
8
|
catalog: "catalog";
|
|
@@ -11,6 +10,7 @@ declare const OntologyKindSchema: z.ZodEnum<{
|
|
|
11
10
|
interface: "interface";
|
|
12
11
|
"value-type": "value-type";
|
|
13
12
|
property: "property";
|
|
13
|
+
endpoint: "endpoint";
|
|
14
14
|
}>;
|
|
15
15
|
type OntologyKind = z.infer<typeof OntologyKindSchema>;
|
|
16
16
|
declare const OntologyIdSchema: z.ZodString;
|
|
@@ -110,7 +110,7 @@ declare const OntologyGroupSchema: z.ZodObject<{
|
|
|
110
110
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
111
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
112
112
|
}, z.core.$loose>;
|
|
113
|
-
declare const
|
|
113
|
+
declare const OntologyEndpointTypeSchema: z.ZodObject<{
|
|
114
114
|
id: z.ZodString;
|
|
115
115
|
label: z.ZodOptional<z.ZodString>;
|
|
116
116
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -201,7 +201,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
201
201
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
202
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
203
203
|
}, z.core.$loose>>>>;
|
|
204
|
-
|
|
204
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
205
205
|
id: z.ZodString;
|
|
206
206
|
label: z.ZodOptional<z.ZodString>;
|
|
207
207
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -220,7 +220,7 @@ type OntologyInterfaceType = z.infer<typeof OntologyInterfaceTypeSchema>;
|
|
|
220
220
|
type OntologyValueType = z.infer<typeof OntologyValueTypeSchema>;
|
|
221
221
|
type OntologySharedProperty = z.infer<typeof OntologySharedPropertySchema>;
|
|
222
222
|
type OntologyGroup = z.infer<typeof OntologyGroupSchema>;
|
|
223
|
-
type
|
|
223
|
+
type OntologyEndpointType = z.infer<typeof OntologyEndpointTypeSchema>;
|
|
224
224
|
type OntologyScope = z.infer<typeof OntologyScopeSchema>;
|
|
225
225
|
type ResolvedOntologyIndex = {
|
|
226
226
|
objectTypes: Record<OntologyId, ResolvedOntologyRecord<OntologyObjectType>>;
|
|
@@ -232,7 +232,7 @@ type ResolvedOntologyIndex = {
|
|
|
232
232
|
valueTypes: Record<OntologyId, ResolvedOntologyRecord<OntologyValueType>>;
|
|
233
233
|
sharedProperties: Record<OntologyId, ResolvedOntologyRecord<OntologySharedProperty>>;
|
|
234
234
|
groups: Record<OntologyId, ResolvedOntologyRecord<OntologyGroup>>;
|
|
235
|
-
|
|
235
|
+
endpoints: Record<OntologyId, ResolvedOntologyRecord<OntologyEndpointType>>;
|
|
236
236
|
};
|
|
237
237
|
type OntologyRecordOrigin = {
|
|
238
238
|
kind: 'authored' | 'projected';
|
|
@@ -261,7 +261,7 @@ type OntologyCompilation = {
|
|
|
261
261
|
type ResolvedOntologyRecordEntry = {
|
|
262
262
|
id: OntologyId;
|
|
263
263
|
kind: OntologyKind;
|
|
264
|
-
record: ResolvedOntologyRecord<OntologyObjectType | OntologyLinkType | OntologyActionType | OntologyCatalogType | OntologyEventType | OntologyInterfaceType | OntologyValueType | OntologySharedProperty | OntologyGroup |
|
|
264
|
+
record: ResolvedOntologyRecord<OntologyObjectType | OntologyLinkType | OntologyActionType | OntologyCatalogType | OntologyEventType | OntologyInterfaceType | OntologyValueType | OntologySharedProperty | OntologyGroup | OntologyEndpointType>;
|
|
265
265
|
};
|
|
266
266
|
declare function ontologyGraphNodeId(id: OntologyId | string): string;
|
|
267
267
|
declare function ontologyIdFromGraphNodeId(nodeId: string): OntologyId | undefined;
|
|
@@ -918,7 +918,6 @@ interface SystemEntry {
|
|
|
918
918
|
status?: 'active' | 'deprecated' | 'archived';
|
|
919
919
|
path?: string;
|
|
920
920
|
icon?: string;
|
|
921
|
-
color?: string;
|
|
922
921
|
uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
|
|
923
922
|
enabled?: boolean;
|
|
924
923
|
devOnly?: boolean;
|
|
@@ -1091,7 +1090,7 @@ declare const ActionsDomainSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodOb
|
|
|
1091
1090
|
* Generic empty default for the actions domain.
|
|
1092
1091
|
* Elevasis-specific action entries (LEAD_GEN_ACTION_ENTRIES, CRM_ACTION_ENTRIES,
|
|
1093
1092
|
* DEFAULT_ORGANIZATION_MODEL_ACTIONS) have been relocated to
|
|
1094
|
-
*
|
|
1093
|
+
* the tenant-owned organization model package.
|
|
1095
1094
|
* Tenant OM configs supply their own action entries via `resolveOrganizationModel`.
|
|
1096
1095
|
*/
|
|
1097
1096
|
declare const DEFAULT_ORGANIZATION_MODEL_ACTIONS: z.infer<typeof ActionsDomainSchema>;
|
|
@@ -3809,11 +3808,11 @@ declare const SETTINGS_ROLES_SURFACE_ID: "settings.roles";
|
|
|
3809
3808
|
*
|
|
3810
3809
|
* It does NOT contain Elevasis-specific identity, systems, or action entries.
|
|
3811
3810
|
* Runtime consumers that need the full Elevasis canonical model should import
|
|
3812
|
-
* `canonicalOrganizationModel` from
|
|
3811
|
+
* `canonicalOrganizationModel` from the tenant-owned organization model package instead.
|
|
3813
3812
|
*
|
|
3814
3813
|
* Elevasis-specific systems, actions (LEAD_GEN_ACTION_ENTRIES, CRM_ACTION_ENTRIES,
|
|
3815
3814
|
* DEFAULT_ORGANIZATION_MODEL_ACTIONS), and the platform system description have been
|
|
3816
|
-
* relocated to
|
|
3815
|
+
* relocated to the tenant-owned organization model package.
|
|
3817
3816
|
*/
|
|
3818
3817
|
|
|
3819
3818
|
declare const DEFAULT_ORGANIZATION_MODEL: OrganizationModel;
|
|
@@ -4930,7 +4929,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4930
4929
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4931
4930
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
4932
4931
|
}, z.core.$loose>>>>;
|
|
4933
|
-
|
|
4932
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4934
4933
|
id: z.ZodString;
|
|
4935
4934
|
label: z.ZodOptional<z.ZodString>;
|
|
4936
4935
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -5456,5 +5455,5 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
5456
5455
|
}, z.core.$strip>>>>;
|
|
5457
5456
|
}, z.core.$strip>;
|
|
5458
5457
|
|
|
5459
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, 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_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, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema,
|
|
5460
|
-
export type { BaseOmScaffoldSpec, ClientProfile, ClientProfileBranding, ClientProfileIdentity, ClientProfileLinks, ClientProfilePrompts, ClientProfileSource, ClientProfileStatus, ClientProfileWorkspace, DeepPartial, Entity, EntityId, EntityLink, EventDescriptor, EventEmissionDescriptor, EventId, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, KnowledgeLink, KnowledgeNodeScaffoldSpec, KnowledgeTargetKind, KnowledgeTargetRef, LeadGenStageCatalogEntry, NodeIdPath, NodeIdString, OmScaffoldEdit, OmScaffoldIntent, OmScaffoldPlan, OmScaffoldSpec, OmScaffoldWrite, OntologyActionType, OntologyCatalogType, OntologyCompilation, OntologyDiagnostic, OntologyEventType, OntologyGroup, OntologyId, OntologyInterfaceType, OntologyKind, OntologyLinkType, OntologyObjectType, OntologyRecordOrigin, OntologyRecordScaffoldSpec, OntologyScope, OntologySharedProperty,
|
|
5458
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, 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_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, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEndpointTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, 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, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemApiInterfaceSchema, SystemEntrySchema, SystemIdSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SystemInterfaceReadinessProfileSchema, SystemInterfaceRefSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, TopbarActionNodeSchema, TopbarSectionSchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getClientProfile, getClientProfileBySlug, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listClientProfiles, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
5459
|
+
export type { BaseOmScaffoldSpec, ClientProfile, ClientProfileBranding, ClientProfileIdentity, ClientProfileLinks, ClientProfilePrompts, ClientProfileSource, ClientProfileStatus, ClientProfileWorkspace, DeepPartial, Entity, EntityId, EntityLink, EventDescriptor, EventEmissionDescriptor, EventId, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, KnowledgeLink, KnowledgeNodeScaffoldSpec, KnowledgeTargetKind, KnowledgeTargetRef, LeadGenStageCatalogEntry, NodeIdPath, NodeIdString, OmScaffoldEdit, OmScaffoldIntent, OmScaffoldPlan, OmScaffoldSpec, OmScaffoldWrite, OntologyActionType, OntologyCatalogType, OntologyCompilation, OntologyDiagnostic, OntologyEndpointType, OntologyEventType, OntologyGroup, OntologyId, OntologyInterfaceType, OntologyKind, OntologyLinkType, OntologyObjectType, OntologyRecordOrigin, OntologyRecordScaffoldSpec, OntologyScope, OntologySharedProperty, OntologyValueType, OrgKnowledgeKind, OrgKnowledgeNode, OrgKnowledgeNodeInput, OrganizationModel, OrganizationModelAction, OrganizationModelActionId, OrganizationModelActionInvocation, OrganizationModelActionInvocationKind, OrganizationModelActionRef, OrganizationModelActionScope, OrganizationModelActions, OrganizationModelAgentKind, OrganizationModelAgentResourceEntry, OrganizationModelAgentRoleHolder, OrganizationModelBranding, OrganizationModelBuiltinIconToken, OrganizationModelClients, OrganizationModelCodeReference, OrganizationModelCodeReferenceRole, OrganizationModelContractRef, OrganizationModelCustomerFirmographics, OrganizationModelCustomerSegment, OrganizationModelCustomers, OrganizationModelDomainKey, OrganizationModelDomainMetadata, OrganizationModelDomainMetadataByDomain, OrganizationModelEntities, OrganizationModelEntity, OrganizationModelGoals, OrganizationModelHumanRoleHolder, OrganizationModelIconToken, OrganizationModelIntegrationResourceEntry, OrganizationModelKeyResult, OrganizationModelKnowledge, OrganizationModelNavigation, OrganizationModelObjective, OrganizationModelOfferings, OrganizationModelPolicies, OrganizationModelPolicy, OrganizationModelPolicyApplicability, OrganizationModelPolicyEffect, OrganizationModelPolicyId, OrganizationModelPolicyPredicate, OrganizationModelPolicyTrigger, OrganizationModelPricingModel, OrganizationModelProduct, OrganizationModelResourceEntry, OrganizationModelResourceGovernanceStatus, OrganizationModelResourceId, OrganizationModelResourceKind, OrganizationModelResourceOntologyBinding, OrganizationModelResourceOntologyBindingContract, OrganizationModelResources, OrganizationModelRole, OrganizationModelRoleHolder, OrganizationModelRoleId, OrganizationModelRoles, OrganizationModelScriptResourceEntry, OrganizationModelScriptResourceLanguage, OrganizationModelScriptResourceSource, OrganizationModelSidebar, OrganizationModelSidebarGroupNode, OrganizationModelSidebarNode, OrganizationModelSidebarSection, OrganizationModelSidebarSurfaceNode, OrganizationModelSidebarSurfaceTargets, OrganizationModelStatusEntry, OrganizationModelStatusSemanticClass, OrganizationModelStatuses, OrganizationModelSystemApiInterface, OrganizationModelSystemEntry, OrganizationModelSystemId, OrganizationModelSystemInterfaceKey, OrganizationModelSystemInterfaceLifecycle, OrganizationModelSystemInterfaceReadinessProfile, OrganizationModelSystemInterfaceRef, OrganizationModelSystemKind, OrganizationModelSystemLifecycle, OrganizationModelSystemStatus, OrganizationModelSystems, OrganizationModelTeamRoleHolder, OrganizationModelTechStackEntry, OrganizationModelTopbarActionNode, OrganizationModelTopbarSection, OrganizationModelTopology, OrganizationModelTopologyMetadata, OrganizationModelTopologyNodeKind, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelTopologyRelationshipKind, OrganizationModelTopologySystemInterfaceGrant, OrganizationModelTopologySystemInterfaceGrantMetadata, OrganizationModelWorkflowResourceEntry, OrganizationSurfaceProjection, OrganizationSurfaceProjectionIssue, OrganizationSurfaceProjectionIssueCode, ParsedContractRef, ParsedOntologyId, ResolvedOntologyIndex, ResolvedOntologyRecord, ResolvedOntologyRecordEntry, ResolvedOrganizationModel, ResolvedSystemEntry, ResourceScaffoldSpec, SystemEntryWithTree, SystemScaffoldSpec };
|
|
@@ -11,16 +11,13 @@ var OntologyKindSchema = z.enum([
|
|
|
11
11
|
"value-type",
|
|
12
12
|
"property",
|
|
13
13
|
"group",
|
|
14
|
-
"
|
|
14
|
+
"endpoint"
|
|
15
15
|
]);
|
|
16
16
|
var SYSTEM_PATH_PATTERN = "[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)*";
|
|
17
17
|
var LOCAL_ID_PATTERN = "[a-z0-9][a-z0-9._-]*";
|
|
18
18
|
var ONTOLOGY_ID_PATTERN = `^(global|${SYSTEM_PATH_PATTERN}):(${OntologyKindSchema.options.join("|")})\\/(${LOCAL_ID_PATTERN})$`;
|
|
19
19
|
var ONTOLOGY_ID_REGEX = new RegExp(ONTOLOGY_ID_PATTERN);
|
|
20
|
-
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(
|
|
21
|
-
ONTOLOGY_ID_REGEX,
|
|
22
|
-
"Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>"
|
|
23
|
-
);
|
|
20
|
+
var OntologyIdSchema = z.string().trim().min(1).max(300).regex(ONTOLOGY_ID_REGEX, "Ontology IDs must use <system-path>:<kind>/<local-id> or global:<kind>/<local-id>");
|
|
24
21
|
function parseOntologyId(id) {
|
|
25
22
|
const normalized = OntologyIdSchema.parse(id);
|
|
26
23
|
const match = ONTOLOGY_ID_REGEX.exec(normalized);
|
|
@@ -83,7 +80,7 @@ var OntologySharedPropertySchema = OntologyRecordBaseSchema.extend({
|
|
|
83
80
|
var OntologyGroupSchema = OntologyRecordBaseSchema.extend({
|
|
84
81
|
members: OntologyReferenceListSchema
|
|
85
82
|
});
|
|
86
|
-
var
|
|
83
|
+
var OntologyEndpointTypeSchema = OntologyRecordBaseSchema.extend({
|
|
87
84
|
route: z.string().trim().min(1).max(500).optional()
|
|
88
85
|
});
|
|
89
86
|
var OntologyScopeSchema = z.object({
|
|
@@ -96,7 +93,7 @@ var OntologyScopeSchema = z.object({
|
|
|
96
93
|
valueTypes: z.record(OntologyIdSchema, OntologyValueTypeSchema).default({}).optional(),
|
|
97
94
|
sharedProperties: z.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
|
|
98
95
|
groups: z.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
|
|
99
|
-
|
|
96
|
+
endpoints: z.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
|
|
100
97
|
}).default({});
|
|
101
98
|
var DEFAULT_ONTOLOGY_SCOPE = {
|
|
102
99
|
valueTypes: {
|
|
@@ -132,7 +129,7 @@ var SCOPE_KIND = {
|
|
|
132
129
|
valueTypes: "value-type",
|
|
133
130
|
sharedProperties: "property",
|
|
134
131
|
groups: "group",
|
|
135
|
-
|
|
132
|
+
endpoints: "endpoint"
|
|
136
133
|
};
|
|
137
134
|
var SCOPE_KEYS = Object.keys(SCOPE_KIND);
|
|
138
135
|
function ontologyGraphNodeId(id) {
|
|
@@ -176,7 +173,7 @@ function createEmptyIndex() {
|
|
|
176
173
|
valueTypes: {},
|
|
177
174
|
sharedProperties: {},
|
|
178
175
|
groups: {},
|
|
179
|
-
|
|
176
|
+
endpoints: {}
|
|
180
177
|
};
|
|
181
178
|
}
|
|
182
179
|
function sortResolvedOntologyIndex(index) {
|
|
@@ -1101,8 +1098,6 @@ var SystemEntrySchema = z.object({
|
|
|
1101
1098
|
path: PathSchema.optional(),
|
|
1102
1099
|
/** @deprecated Use ui.icon. Kept for one-cycle Feature compatibility. */
|
|
1103
1100
|
icon: IconNameSchema.optional(),
|
|
1104
|
-
/** @deprecated Feature color token, retained for one-cycle compatibility. */
|
|
1105
|
-
color: ColorTokenSchema.optional(),
|
|
1106
1101
|
/** @deprecated UI placement hint, retained for one-cycle compatibility. */
|
|
1107
1102
|
uiPosition: UiPositionSchema.optional(),
|
|
1108
1103
|
/** @deprecated Use lifecycle. */
|
|
@@ -1205,7 +1200,7 @@ var ResourceOntologyBindingSchema = z.object({
|
|
|
1205
1200
|
/**
|
|
1206
1201
|
* Optional typed contract binding for this resource's workflow I/O.
|
|
1207
1202
|
* Each ref is a `package/subpath#ExportName` string that resolves to a
|
|
1208
|
-
* Zod schema in
|
|
1203
|
+
* Zod schema in the tenant-owned organization model package.
|
|
1209
1204
|
*
|
|
1210
1205
|
* Absence of this field preserves all existing behavior — it is additive + optional.
|
|
1211
1206
|
* Tier-1 validation (schema.ts): ref-string shape only (browser-safe, no imports).
|
|
@@ -1800,10 +1795,11 @@ var ONTOLOGY_REFERENCE_KEY_KINDS = {
|
|
|
1800
1795
|
interfaceType: "interface",
|
|
1801
1796
|
propertyType: "property",
|
|
1802
1797
|
groupType: "group",
|
|
1803
|
-
|
|
1798
|
+
endpointType: "endpoint",
|
|
1804
1799
|
stepCatalog: "catalog"
|
|
1805
1800
|
};
|
|
1806
|
-
|
|
1801
|
+
var omCompilationContextCache = /* @__PURE__ */ new WeakMap();
|
|
1802
|
+
function buildOmCrossRefIndexFromOntology(model, ontologyCompilation) {
|
|
1807
1803
|
const systemsById = /* @__PURE__ */ new Map();
|
|
1808
1804
|
for (const { path, system } of listAllSystems(model)) {
|
|
1809
1805
|
systemsById.set(path, system);
|
|
@@ -1817,7 +1813,6 @@ function buildOmCrossRefIndex(model) {
|
|
|
1817
1813
|
const actionIds = new Set(Object.keys(model.actions ?? {}));
|
|
1818
1814
|
const customerSegmentIds = new Set(Object.keys(model.customers ?? {}));
|
|
1819
1815
|
const offeringIds = new Set(Object.keys(model.offerings ?? {}));
|
|
1820
|
-
const ontologyCompilation = compileOrganizationOntology(model);
|
|
1821
1816
|
const ontologyIndexByKind = {
|
|
1822
1817
|
object: ontologyCompilation.ontology.objectTypes,
|
|
1823
1818
|
link: ontologyCompilation.ontology.linkTypes,
|
|
@@ -1828,7 +1823,7 @@ function buildOmCrossRefIndex(model) {
|
|
|
1828
1823
|
"value-type": ontologyCompilation.ontology.valueTypes,
|
|
1829
1824
|
property: ontologyCompilation.ontology.sharedProperties,
|
|
1830
1825
|
group: ontologyCompilation.ontology.groups,
|
|
1831
|
-
|
|
1826
|
+
endpoint: ontologyCompilation.ontology.endpoints
|
|
1832
1827
|
};
|
|
1833
1828
|
const ontologyIds = new Set(Object.values(ontologyIndexByKind).flatMap((index) => Object.keys(index)));
|
|
1834
1829
|
const stageIds = /* @__PURE__ */ new Set();
|
|
@@ -1856,6 +1851,15 @@ function buildOmCrossRefIndex(model) {
|
|
|
1856
1851
|
stageIds
|
|
1857
1852
|
};
|
|
1858
1853
|
}
|
|
1854
|
+
function buildOmCompilationContext(model) {
|
|
1855
|
+
const cached = omCompilationContextCache.get(model);
|
|
1856
|
+
if (cached !== void 0) return cached;
|
|
1857
|
+
const ontologyCompilation = compileOrganizationOntology(model);
|
|
1858
|
+
const crossRefIndex = buildOmCrossRefIndexFromOntology(model, ontologyCompilation);
|
|
1859
|
+
const context = { crossRefIndex, ontologyCompilation };
|
|
1860
|
+
omCompilationContextCache.set(model, context);
|
|
1861
|
+
return context;
|
|
1862
|
+
}
|
|
1859
1863
|
function knowledgeTargetExists(index, kind, id) {
|
|
1860
1864
|
if (kind === "system") return index.systemsById.has(id);
|
|
1861
1865
|
if (kind === "client") return index.clientIds.has(id);
|
|
@@ -2192,9 +2196,8 @@ function refineOrganizationModel(model, ctx) {
|
|
|
2192
2196
|
}
|
|
2193
2197
|
});
|
|
2194
2198
|
});
|
|
2195
|
-
const idx =
|
|
2199
|
+
const { crossRefIndex: idx, ontologyCompilation } = buildOmCompilationContext(model);
|
|
2196
2200
|
const { ontologyIndexByKind, ontologyIds } = idx;
|
|
2197
|
-
const ontologyCompilation = compileOrganizationOntology(model);
|
|
2198
2201
|
function topologyTargetExists(ref) {
|
|
2199
2202
|
if (ref.kind === "system") return systemsById.has(ref.id);
|
|
2200
2203
|
if (ref.kind === "resource") return resourcesById.has(ref.id);
|
|
@@ -3298,7 +3301,7 @@ function ontologyMapName(kind) {
|
|
|
3298
3301
|
"value-type": "valueTypes",
|
|
3299
3302
|
property: "sharedProperties",
|
|
3300
3303
|
group: "groups",
|
|
3301
|
-
|
|
3304
|
+
endpoint: "endpoints"
|
|
3302
3305
|
};
|
|
3303
3306
|
return map[kind];
|
|
3304
3307
|
}
|
|
@@ -3369,12 +3372,34 @@ Capture the durable operating knowledge here.
|
|
|
3369
3372
|
}
|
|
3370
3373
|
|
|
3371
3374
|
// src/organization-model/scaffolders/scaffoldOntologyRecord.ts
|
|
3375
|
+
function kindSpecificFields(spec) {
|
|
3376
|
+
if (spec.kind === "link") {
|
|
3377
|
+
return {
|
|
3378
|
+
from: makeOntologyId(spec.systemPath, "object", "source-object"),
|
|
3379
|
+
to: makeOntologyId(spec.systemPath, "object", "target-object")
|
|
3380
|
+
};
|
|
3381
|
+
}
|
|
3382
|
+
if (spec.kind === "action") {
|
|
3383
|
+
return { actsOn: [] };
|
|
3384
|
+
}
|
|
3385
|
+
if (spec.kind === "group") {
|
|
3386
|
+
return { members: [] };
|
|
3387
|
+
}
|
|
3388
|
+
return {};
|
|
3389
|
+
}
|
|
3372
3390
|
function scaffoldOntologyRecord(model, spec) {
|
|
3373
3391
|
assertSystemExists(model, spec.systemPath);
|
|
3374
3392
|
const localId = spec.localId ?? spec.id;
|
|
3375
3393
|
const ontologyId = makeOntologyId(spec.systemPath, spec.kind, localId);
|
|
3376
3394
|
const label = spec.label ?? titleize(localId);
|
|
3377
3395
|
const mapName = ontologyMapName(spec.kind);
|
|
3396
|
+
const snippetRecord = {
|
|
3397
|
+
id: ontologyId,
|
|
3398
|
+
label,
|
|
3399
|
+
ownerSystemId: spec.systemPath,
|
|
3400
|
+
...spec.description === void 0 ? {} : { description: spec.description },
|
|
3401
|
+
...kindSpecificFields(spec)
|
|
3402
|
+
};
|
|
3378
3403
|
return {
|
|
3379
3404
|
intent: "ontology",
|
|
3380
3405
|
id: ontologyId,
|
|
@@ -3384,12 +3409,7 @@ function scaffoldOntologyRecord(model, spec) {
|
|
|
3384
3409
|
{
|
|
3385
3410
|
path: "packages/elevasis-core/src/organization-model/systems.ts",
|
|
3386
3411
|
description: `Add this record under ${spec.systemPath}.ontology.${mapName}.`,
|
|
3387
|
-
snippet: `${JSON.stringify(ontologyId)}: {
|
|
3388
|
-
id: ${JSON.stringify(ontologyId)},
|
|
3389
|
-
label: ${JSON.stringify(label)},
|
|
3390
|
-
ownerSystemId: ${JSON.stringify(spec.systemPath)}${spec.description === void 0 ? "" : `,
|
|
3391
|
-
description: ${JSON.stringify(spec.description)}`}
|
|
3392
|
-
}`
|
|
3412
|
+
snippet: `${JSON.stringify(ontologyId)}: ${JSON.stringify(snippetRecord, null, 2)}`
|
|
3393
3413
|
}
|
|
3394
3414
|
],
|
|
3395
3415
|
warnings: [],
|
|
@@ -3503,9 +3523,8 @@ function scaffoldSystem(model, spec) {
|
|
|
3503
3523
|
content: `import type { SystemModule } from '@repo/ui'
|
|
3504
3524
|
|
|
3505
3525
|
export const ${featureSlug.replaceAll("-", "_")}Manifest: SystemModule = {
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
routes: []
|
|
3526
|
+
key: ${JSON.stringify(featureSlug)},
|
|
3527
|
+
systemId: ${JSON.stringify(systemPath)}
|
|
3509
3528
|
}
|
|
3510
3529
|
`
|
|
3511
3530
|
},
|
|
@@ -3581,4 +3600,4 @@ function scaffoldOrganizationModel(model, spec) {
|
|
|
3581
3600
|
return scaffoldKnowledgeNode(model, spec);
|
|
3582
3601
|
}
|
|
3583
3602
|
|
|
3584
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, 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_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, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema,
|
|
3603
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, ClientProfileBrandingSchema, ClientProfileIdentitySchema, ClientProfileLinksSchema, ClientProfilePromptsSchema, ClientProfileSchema, ClientProfileSourceSchema, ClientProfileStatusSchema, ClientProfileWorkspaceSchema, ClientProfilesDomainSchema, 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_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, OmTopologySystemInterfaceGrantMetadataSchema, OmTopologySystemInterfaceGrantSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEndpointTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, 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, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemApiInterfaceSchema, SystemEntrySchema, SystemIdSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SystemInterfaceReadinessProfileSchema, SystemInterfaceRefSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, TopbarActionNodeSchema, TopbarSectionSchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getClientProfile, getClientProfileBySlug, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listClientProfiles, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
@@ -3448,7 +3448,7 @@ interface MockSupabaseFixtures {
|
|
|
3448
3448
|
*
|
|
3449
3449
|
* Usage:
|
|
3450
3450
|
* ```typescript
|
|
3451
|
-
* import { createMockSupabaseClient, TEST_USERS, TEST_ORGS } from '@
|
|
3451
|
+
* import { createMockSupabaseClient, TEST_USERS, TEST_ORGS } from '@elevasis/core/test-utils'
|
|
3452
3452
|
*
|
|
3453
3453
|
* const mockClient = createMockSupabaseClient({
|
|
3454
3454
|
* users: [TEST_USERS.admin, TEST_USERS.regularUser],
|
|
@@ -3501,7 +3501,7 @@ interface UserContext {
|
|
|
3501
3501
|
*
|
|
3502
3502
|
* Usage:
|
|
3503
3503
|
* ```typescript
|
|
3504
|
-
* import { createMockWorkOSClient, TEST_USERS } from '@
|
|
3504
|
+
* import { createMockWorkOSClient, TEST_USERS } from '@elevasis/core/test-utils'
|
|
3505
3505
|
*
|
|
3506
3506
|
* const mockWorkOS = createMockWorkOSClient({
|
|
3507
3507
|
* validTokens: {
|
|
@@ -3542,7 +3542,7 @@ declare function createMockWorkOSClient(options?: {
|
|
|
3542
3542
|
*
|
|
3543
3543
|
* Usage:
|
|
3544
3544
|
* ```typescript
|
|
3545
|
-
* import { createMockVerifyJWT, TEST_USERS } from '@
|
|
3545
|
+
* import { createMockVerifyJWT, TEST_USERS } from '@elevasis/core/test-utils'
|
|
3546
3546
|
*
|
|
3547
3547
|
* const mockVerifyJWT = createMockVerifyJWT({
|
|
3548
3548
|
* 'valid-token': {
|
|
@@ -3749,7 +3749,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
3749
3749
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3750
3750
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
3751
3751
|
}, z.core.$loose>>>>;
|
|
3752
|
-
|
|
3752
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3753
3753
|
id: z.ZodString;
|
|
3754
3754
|
label: z.ZodOptional<z.ZodString>;
|
|
3755
3755
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -3843,7 +3843,6 @@ interface SystemEntry {
|
|
|
3843
3843
|
status?: 'active' | 'deprecated' | 'archived';
|
|
3844
3844
|
path?: string;
|
|
3845
3845
|
icon?: string;
|
|
3846
|
-
color?: string;
|
|
3847
3846
|
uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
|
|
3848
3847
|
enabled?: boolean;
|
|
3849
3848
|
devOnly?: boolean;
|
|
@@ -4396,7 +4395,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4396
4395
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4397
4396
|
members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
4398
4397
|
}, z.core.$loose>>>>;
|
|
4399
|
-
|
|
4398
|
+
endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4400
4399
|
id: z.ZodString;
|
|
4401
4400
|
label: z.ZodOptional<z.ZodString>;
|
|
4402
4401
|
description: z.ZodOptional<z.ZodString>;
|