@elevasis/sdk 1.23.0 → 1.25.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/cli.cjs +5927 -6985
- package/dist/index.d.ts +4893 -4759
- package/dist/index.js +1444 -3870
- package/dist/node/index.d.ts +3059 -2
- package/dist/node/index.js +163 -1
- package/dist/test-utils/index.d.ts +4413 -4439
- package/dist/test-utils/index.js +1766 -4753
- package/dist/types/worker/index.d.ts +5 -2
- package/dist/types/worker/platform.d.ts +2 -2
- package/dist/types/worker/utils.d.ts +9 -0
- package/dist/worker/index.js +427 -3708
- package/package.json +5 -4
- package/reference/_navigation.md +1 -0
- package/reference/claude-config/rules/active-change-index.md +11 -80
- package/reference/claude-config/rules/agent-start-here.md +11 -277
- package/reference/claude-config/rules/deployment.md +11 -57
- package/reference/claude-config/rules/error-handling.md +11 -56
- package/reference/claude-config/rules/execution.md +11 -40
- package/reference/claude-config/rules/frontend.md +11 -43
- package/reference/claude-config/rules/observability.md +11 -31
- package/reference/claude-config/rules/operations.md +11 -80
- package/reference/claude-config/rules/organization-model.md +5 -110
- package/reference/claude-config/rules/organization-os.md +7 -111
- package/reference/claude-config/rules/package-taxonomy.md +11 -33
- package/reference/claude-config/rules/platform.md +11 -42
- package/reference/claude-config/rules/shared-types.md +10 -48
- package/reference/claude-config/rules/task-tracking.md +11 -47
- package/reference/claude-config/rules/ui.md +11 -200
- package/reference/claude-config/rules/vibe.md +5 -229
- package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
- package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +2 -2
- package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +33 -0
- package/reference/cli.mdx +1107 -808
- package/reference/rules/active-change-index.md +83 -0
- package/reference/rules/agent-start-here.md +280 -0
- package/reference/rules/deployment.md +60 -0
- package/reference/rules/error-handling.md +59 -0
- package/reference/rules/execution.md +43 -0
- package/reference/rules/frontend.md +46 -0
- package/reference/rules/observability.md +34 -0
- package/reference/rules/operations.md +85 -0
- package/reference/rules/organization-model.md +119 -0
- package/reference/rules/organization-os.md +118 -0
- package/reference/rules/package-taxonomy.md +36 -0
- package/reference/rules/platform.md +45 -0
- package/reference/rules/shared-types.md +52 -0
- package/reference/rules/task-tracking.md +50 -0
- package/reference/rules/ui.md +203 -0
- package/reference/rules/vibe.md +238 -0
- package/reference/scaffold/core/organization-graph.mdx +4 -5
- package/reference/scaffold/core/organization-model.mdx +1 -1
- package/reference/scaffold/recipes/customize-crm-actions.md +45 -46
- package/reference/scaffold/recipes/extend-crm.md +253 -255
- package/reference/scaffold/recipes/index.md +43 -44
- package/reference/scaffold/reference/contracts.md +990 -1065
package/dist/node/index.js
CHANGED
|
@@ -511,4 +511,166 @@ async function runKnowledgeCodegen(layout) {
|
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
-
|
|
514
|
+
// ../core/src/organization-model/helpers.ts
|
|
515
|
+
function childSystemsOf(system) {
|
|
516
|
+
return system.systems ?? system.subsystems ?? {};
|
|
517
|
+
}
|
|
518
|
+
function listAllSystems(model) {
|
|
519
|
+
const results = [];
|
|
520
|
+
function walk(map, prefix) {
|
|
521
|
+
for (const [localId, system] of Object.entries(map)) {
|
|
522
|
+
const fullPath = prefix ? `${prefix}.${localId}` : localId;
|
|
523
|
+
results.push({ path: fullPath, system });
|
|
524
|
+
const childSystems = childSystemsOf(system);
|
|
525
|
+
if (Object.keys(childSystems).length > 0) {
|
|
526
|
+
walk(childSystems, fullPath);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
walk(model.systems, "");
|
|
531
|
+
return results;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// src/project-deployment-spec.ts
|
|
535
|
+
function toSdkResourceDescriptor(resource, getResourceOntologyBinding) {
|
|
536
|
+
const ontologyBinding = getResourceOntologyBinding?.(resource.id);
|
|
537
|
+
return {
|
|
538
|
+
...resource,
|
|
539
|
+
...ontologyBinding ?? {},
|
|
540
|
+
systemId: resource.systemPath
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function withPlatformResourceDescriptor(workflow, getWorkflowResourceDescriptor, getResourceOntologyBinding) {
|
|
544
|
+
const resource = getWorkflowResourceDescriptor(workflow.config.resourceId);
|
|
545
|
+
const sdkResource = toSdkResourceDescriptor(resource, getResourceOntologyBinding);
|
|
546
|
+
return {
|
|
547
|
+
...workflow,
|
|
548
|
+
config: {
|
|
549
|
+
...workflow.config,
|
|
550
|
+
resource: sdkResource,
|
|
551
|
+
resourceId: sdkResource.id,
|
|
552
|
+
type: sdkResource.kind
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
function withPlatformResourceDescriptors(workflows, getWorkflowResourceDescriptor, getResourceOntologyBinding) {
|
|
557
|
+
return workflows.map(
|
|
558
|
+
(workflow) => withPlatformResourceDescriptor(workflow, getWorkflowResourceDescriptor, getResourceOntologyBinding)
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
function withPlatformIntegrationResourceDescriptor(integration, getIntegrationResourceDescriptor, getResourceOntologyBinding) {
|
|
562
|
+
const resource = getIntegrationResourceDescriptor(integration.resourceId);
|
|
563
|
+
const sdkResource = toSdkResourceDescriptor(resource, getResourceOntologyBinding);
|
|
564
|
+
return {
|
|
565
|
+
...integration,
|
|
566
|
+
resource: sdkResource,
|
|
567
|
+
resourceId: sdkResource.id,
|
|
568
|
+
type: sdkResource.kind
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
function withPlatformIntegrationResourceDescriptors(integrations, getIntegrationResourceDescriptor, getResourceOntologyBinding) {
|
|
572
|
+
return integrations.map(
|
|
573
|
+
(integration) => withPlatformIntegrationResourceDescriptor(integration, getIntegrationResourceDescriptor, getResourceOntologyBinding)
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
function projectTopologyRelationships(model) {
|
|
577
|
+
const projected = {};
|
|
578
|
+
function ensure(sourceId) {
|
|
579
|
+
projected[sourceId] ??= {};
|
|
580
|
+
return projected[sourceId];
|
|
581
|
+
}
|
|
582
|
+
for (const relationship of Object.values(model.topology.relationships)) {
|
|
583
|
+
if (relationship.from.kind === "humanCheckpoint") continue;
|
|
584
|
+
if (relationship.kind === "triggers" && relationship.to.kind === "resource") {
|
|
585
|
+
const target = model.resources[relationship.to.id];
|
|
586
|
+
if (target?.kind !== "workflow" && target?.kind !== "agent") continue;
|
|
587
|
+
const source = ensure(relationship.from.id);
|
|
588
|
+
source.triggers ??= {};
|
|
589
|
+
if (target.kind === "workflow") {
|
|
590
|
+
source.triggers.workflows ??= [];
|
|
591
|
+
source.triggers.workflows.push(target.id);
|
|
592
|
+
} else {
|
|
593
|
+
source.triggers.agents ??= [];
|
|
594
|
+
source.triggers.agents.push(target.id);
|
|
595
|
+
}
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
if (relationship.kind === "uses" && relationship.from.kind === "resource" && relationship.to.kind === "resource") {
|
|
599
|
+
const target = model.resources[relationship.to.id];
|
|
600
|
+
if (target?.kind !== "integration") continue;
|
|
601
|
+
const source = ensure(relationship.from.id);
|
|
602
|
+
source.uses ??= {};
|
|
603
|
+
source.uses.integrations ??= [];
|
|
604
|
+
source.uses.integrations.push(target.id);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return projected;
|
|
608
|
+
}
|
|
609
|
+
function projectDeploymentSpec(options) {
|
|
610
|
+
const workflows = withPlatformResourceDescriptors(
|
|
611
|
+
options.workflows,
|
|
612
|
+
options.getWorkflowResourceDescriptor,
|
|
613
|
+
options.getResourceOntologyBinding
|
|
614
|
+
);
|
|
615
|
+
const integrations = withPlatformIntegrationResourceDescriptors(
|
|
616
|
+
options.integrations ?? [],
|
|
617
|
+
options.getIntegrationResourceDescriptor,
|
|
618
|
+
options.getResourceOntologyBinding
|
|
619
|
+
);
|
|
620
|
+
const workflowResourceIds = new Set(workflows.map((workflow) => workflow.config.resourceId));
|
|
621
|
+
const integrationResourceIds = new Set(integrations.map((integration) => integration.resourceId));
|
|
622
|
+
const resources = projectDeploymentResources(
|
|
623
|
+
options.organizationModel.resources,
|
|
624
|
+
workflowResourceIds,
|
|
625
|
+
integrationResourceIds,
|
|
626
|
+
options.getResourceOntologyBinding
|
|
627
|
+
);
|
|
628
|
+
return {
|
|
629
|
+
version: options.version,
|
|
630
|
+
organizationModel: {
|
|
631
|
+
systems: projectDeploymentSystems(options.organizationModel),
|
|
632
|
+
resources
|
|
633
|
+
},
|
|
634
|
+
workflows,
|
|
635
|
+
agents: options.agents ?? [],
|
|
636
|
+
triggers: options.triggers,
|
|
637
|
+
integrations,
|
|
638
|
+
humanCheckpoints: options.humanCheckpoints,
|
|
639
|
+
relationships: projectTopologyRelationships(options.organizationModel),
|
|
640
|
+
...options.externalResources ? { externalResources: options.externalResources } : {}
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
function projectDeploymentResources(resources, workflowResourceIds, integrationResourceIds, getResourceOntologyBinding) {
|
|
644
|
+
return Object.fromEntries(
|
|
645
|
+
Object.values(resources).filter((resource) => workflowResourceIds.has(resource.id) || integrationResourceIds.has(resource.id)).map((resource) => {
|
|
646
|
+
const sdkResource = toSdkResourceDescriptor(resource, getResourceOntologyBinding);
|
|
647
|
+
return [sdkResource.id, sdkResource];
|
|
648
|
+
})
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
function projectDeploymentSystems(model) {
|
|
652
|
+
return Object.fromEntries(
|
|
653
|
+
listAllSystems(model).map(({ path, system }, index) => {
|
|
654
|
+
const lifecycle = system.lifecycle === "archived" ? "archived" : system.lifecycle === "deprecated" ? "deprecated" : "active";
|
|
655
|
+
return [
|
|
656
|
+
system.id,
|
|
657
|
+
{
|
|
658
|
+
id: system.id,
|
|
659
|
+
order: system.order ?? (index + 1) * 10,
|
|
660
|
+
title: system.label ?? system.title ?? system.id,
|
|
661
|
+
description: system.description ?? "",
|
|
662
|
+
kind: system.kind ?? "product",
|
|
663
|
+
...system.parentSystemId ? { parentSystemId: system.parentSystemId } : {},
|
|
664
|
+
...path !== system.id ? { systemPath: path } : {},
|
|
665
|
+
governedByKnowledge: system.governedByKnowledge ?? [],
|
|
666
|
+
drivesGoals: system.drivesGoals ?? [],
|
|
667
|
+
lifecycle,
|
|
668
|
+
status: lifecycle,
|
|
669
|
+
...system.responsibleRoleId ? { responsibleRoleId: system.responsibleRoleId } : {}
|
|
670
|
+
}
|
|
671
|
+
];
|
|
672
|
+
})
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export { generateKnowledgeBodies, generateKnowledgeNodes, generateKnowledgeNodesTs, projectDeploymentSpec, projectTopologyRelationships, readKnowledgeNodeMdx, runKnowledgeCodegen, toSdkResourceDescriptor, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
|