@elevasis/core 0.15.0 → 0.16.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 +1718 -19
- package/dist/index.js +369 -25
- package/dist/organization-model/index.d.ts +1718 -19
- package/dist/organization-model/index.js +369 -25
- package/dist/test-utils/index.d.ts +1108 -371
- package/dist/test-utils/index.js +357 -17
- package/package.json +5 -1
- package/src/__tests__/publish.test.ts +14 -13
- package/src/__tests__/template-core-compatibility.test.ts +4 -4
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +1109 -882
- package/src/auth/multi-tenancy/index.ts +3 -0
- package/src/auth/multi-tenancy/theme-presets.ts +45 -0
- package/src/auth/multi-tenancy/types.ts +57 -83
- package/src/auth/multi-tenancy/users/api-schemas.ts +165 -194
- package/src/business/acquisition/activity-events.ts +13 -4
- package/src/business/acquisition/api-schemas.test.ts +315 -4
- package/src/business/acquisition/api-schemas.ts +122 -8
- package/src/business/acquisition/build-templates.ts +44 -0
- package/src/business/acquisition/crm-next-action.test.ts +262 -0
- package/src/business/acquisition/crm-next-action.ts +220 -0
- package/src/business/acquisition/crm-priority.test.ts +216 -0
- package/src/business/acquisition/crm-priority.ts +349 -0
- package/src/business/acquisition/crm-state-actions.test.ts +151 -160
- package/src/business/acquisition/deal-ownership.test.ts +351 -0
- package/src/business/acquisition/deal-ownership.ts +120 -0
- package/src/business/acquisition/derive-actions.test.ts +101 -37
- package/src/business/acquisition/derive-actions.ts +102 -87
- package/src/business/acquisition/index.ts +10 -0
- package/src/business/acquisition/types.ts +400 -366
- package/src/business/crm/api-schemas.ts +40 -0
- package/src/business/crm/index.ts +1 -0
- package/src/business/deals/api-schemas.ts +79 -0
- package/src/business/deals/index.ts +1 -0
- package/src/business/projects/types.ts +124 -88
- package/src/execution/core/runner-types.ts +61 -80
- package/src/execution/engine/index.ts +4 -3
- package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-tools.ts +105 -104
- package/src/execution/engine/tools/integration/server/adapters/instantly/instantly-tools.ts +1474 -1473
- package/src/execution/engine/tools/integration/server/adapters/millionverifier/millionverifier-tools.ts +103 -102
- package/src/execution/engine/tools/integration/server/adapters/signature-api/signature-api-tools.ts +182 -179
- package/src/execution/engine/tools/integration/server/adapters/stripe/stripe-tools.ts +310 -309
- package/src/execution/engine/tools/integration/tool.ts +255 -253
- package/src/execution/engine/tools/lead-service-types.ts +939 -924
- package/src/execution/engine/tools/messages.ts +43 -0
- package/src/execution/engine/tools/platform/acquisition/list-tools.ts +6 -5
- package/src/execution/engine/tools/platform/acquisition/types.ts +5 -2
- package/src/execution/engine/tools/platform/email/types.ts +97 -96
- package/src/execution/engine/tools/registry.ts +4 -3
- package/src/execution/engine/tools/tool-maps.ts +3 -1
- package/src/execution/engine/tools/types.ts +234 -233
- package/src/execution/engine/workflow/types.ts +195 -193
- package/src/execution/external/api-schemas.ts +40 -0
- package/src/execution/external/index.ts +1 -0
- package/src/knowledge/README.md +32 -0
- package/src/knowledge/__tests__/queries.test.ts +504 -0
- package/src/knowledge/format.ts +99 -0
- package/src/knowledge/index.ts +5 -0
- package/src/knowledge/queries.ts +256 -0
- package/src/organization-model/__tests__/defaults.test.ts +172 -172
- package/src/organization-model/__tests__/foundation.test.ts +7 -7
- package/src/organization-model/__tests__/icons.test.ts +27 -0
- package/src/organization-model/__tests__/knowledge.test.ts +214 -0
- package/src/organization-model/contracts.ts +17 -15
- package/src/organization-model/defaults.ts +74 -19
- package/src/organization-model/domains/knowledge.ts +53 -0
- package/src/organization-model/domains/navigation.ts +416 -399
- package/src/organization-model/domains/prospecting.ts +204 -1
- package/src/organization-model/domains/sales.test.ts +29 -0
- package/src/organization-model/domains/sales.ts +102 -0
- package/src/organization-model/domains/shared.ts +6 -5
- package/src/organization-model/foundation.ts +10 -6
- package/src/organization-model/graph/build.ts +209 -182
- package/src/organization-model/graph/schema.ts +37 -34
- package/src/organization-model/graph/types.ts +47 -31
- package/src/organization-model/icons.ts +81 -0
- package/src/organization-model/index.ts +8 -3
- package/src/organization-model/organization-model.mdx +1 -1
- package/src/organization-model/published.ts +103 -86
- package/src/organization-model/schema.ts +90 -85
- package/src/organization-model/types.ts +42 -35
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/index.ts +23 -27
- package/src/platform/registry/index.ts +0 -4
- package/src/platform/registry/resource-registry.ts +0 -77
- package/src/platform/registry/serialized-types.ts +148 -219
- package/src/platform/registry/stats-types.ts +60 -60
- package/src/reference/_generated/contracts.md +829 -595
- package/src/supabase/database.types.ts +2978 -2958
package/dist/test-utils/index.js
CHANGED
|
@@ -19416,11 +19416,82 @@ function makeTask(overrides = {}) {
|
|
|
19416
19416
|
...overrides
|
|
19417
19417
|
});
|
|
19418
19418
|
}
|
|
19419
|
+
var ORGANIZATION_MODEL_ICON_TOKENS = [
|
|
19420
|
+
"nav.dashboard",
|
|
19421
|
+
"nav.sales",
|
|
19422
|
+
"nav.crm",
|
|
19423
|
+
"nav.lead-gen",
|
|
19424
|
+
"nav.projects",
|
|
19425
|
+
"nav.operations",
|
|
19426
|
+
"nav.monitoring",
|
|
19427
|
+
"nav.knowledge",
|
|
19428
|
+
"nav.settings",
|
|
19429
|
+
"nav.admin",
|
|
19430
|
+
"nav.archive",
|
|
19431
|
+
"knowledge.playbook",
|
|
19432
|
+
"knowledge.strategy",
|
|
19433
|
+
"knowledge.reference",
|
|
19434
|
+
"feature.dashboard",
|
|
19435
|
+
"feature.sales",
|
|
19436
|
+
"feature.crm",
|
|
19437
|
+
"feature.finance",
|
|
19438
|
+
"feature.lead-gen",
|
|
19439
|
+
"feature.platform",
|
|
19440
|
+
"feature.projects",
|
|
19441
|
+
"feature.operations",
|
|
19442
|
+
"feature.knowledge",
|
|
19443
|
+
"feature.monitoring",
|
|
19444
|
+
"feature.settings",
|
|
19445
|
+
"feature.admin",
|
|
19446
|
+
"feature.archive",
|
|
19447
|
+
"feature.seo",
|
|
19448
|
+
"resource.agent",
|
|
19449
|
+
"resource.workflow",
|
|
19450
|
+
"resource.integration",
|
|
19451
|
+
"resource.database",
|
|
19452
|
+
"resource.user",
|
|
19453
|
+
"resource.team",
|
|
19454
|
+
"integration.gmail",
|
|
19455
|
+
"integration.google-sheets",
|
|
19456
|
+
"integration.attio",
|
|
19457
|
+
"surface.dashboard",
|
|
19458
|
+
"surface.overview",
|
|
19459
|
+
"surface.command-view",
|
|
19460
|
+
"surface.command-queue",
|
|
19461
|
+
"surface.pipeline",
|
|
19462
|
+
"surface.lists",
|
|
19463
|
+
"surface.resources",
|
|
19464
|
+
"surface.settings",
|
|
19465
|
+
"status.success",
|
|
19466
|
+
"status.error",
|
|
19467
|
+
"status.warning",
|
|
19468
|
+
"status.info",
|
|
19469
|
+
"status.pending",
|
|
19470
|
+
"action.approve",
|
|
19471
|
+
"action.reject",
|
|
19472
|
+
"action.retry",
|
|
19473
|
+
"action.edit",
|
|
19474
|
+
"action.view",
|
|
19475
|
+
"action.launch",
|
|
19476
|
+
"action.message",
|
|
19477
|
+
"action.escalate",
|
|
19478
|
+
"action.promote",
|
|
19479
|
+
"action.submit",
|
|
19480
|
+
"action.email"
|
|
19481
|
+
];
|
|
19482
|
+
var CustomIconTokenSchema = z.string().trim().max(80).regex(/^custom\.[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "Custom icon tokens must start with custom.");
|
|
19483
|
+
var OrganizationModelBuiltinIconTokenSchema = z.enum(ORGANIZATION_MODEL_ICON_TOKENS);
|
|
19484
|
+
var OrganizationModelIconTokenSchema = z.union([
|
|
19485
|
+
OrganizationModelBuiltinIconTokenSchema,
|
|
19486
|
+
CustomIconTokenSchema
|
|
19487
|
+
]);
|
|
19488
|
+
|
|
19489
|
+
// src/organization-model/domains/shared.ts
|
|
19419
19490
|
var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
|
|
19420
19491
|
var LabelSchema = z.string().trim().min(1).max(120);
|
|
19421
19492
|
var DescriptionSchema = z.string().trim().min(1).max(2e3);
|
|
19422
19493
|
var ColorTokenSchema = z.string().trim().min(1).max(50);
|
|
19423
|
-
var IconNameSchema =
|
|
19494
|
+
var IconNameSchema = OrganizationModelIconTokenSchema;
|
|
19424
19495
|
var PathSchema = z.string().trim().startsWith("/").max(300);
|
|
19425
19496
|
var ReferenceIdsSchema = z.array(ModelIdSchema).default([]);
|
|
19426
19497
|
var DisplayMetadataSchema = z.object({
|
|
@@ -19608,7 +19679,7 @@ var DEFAULT_ORGANIZATION_MODEL_PROJECTS = {
|
|
|
19608
19679
|
]
|
|
19609
19680
|
};
|
|
19610
19681
|
var NodeIdPathSchema = z.string().trim().min(1).max(100).regex(/^([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node IDs must be lowercase dotted paths");
|
|
19611
|
-
z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
|
|
19682
|
+
var NodeIdStringSchema = z.string().trim().min(1).max(200).regex(/^[a-z]+:([a-z0-9-]+)(\.[a-z0-9-]+)*$/, "Node references must use kind:dotted-path");
|
|
19612
19683
|
var UiPositionSchema = z.enum(["sidebar-primary", "sidebar-bottom"]);
|
|
19613
19684
|
var FeatureSchema = z.object({
|
|
19614
19685
|
id: NodeIdPathSchema,
|
|
@@ -19626,13 +19697,33 @@ var ProspectingLifecycleStageSchema = DisplayMetadataSchema.extend({
|
|
|
19626
19697
|
id: ModelIdSchema,
|
|
19627
19698
|
order: z.number().int().min(0)
|
|
19628
19699
|
});
|
|
19700
|
+
var ProspectingBuildTemplateStepSchema = DisplayMetadataSchema.extend({
|
|
19701
|
+
id: ModelIdSchema,
|
|
19702
|
+
primaryEntity: z.enum(["company", "contact"]),
|
|
19703
|
+
outputs: z.array(z.enum(["company", "contact", "export"])).min(1),
|
|
19704
|
+
stageKey: ModelIdSchema,
|
|
19705
|
+
dependsOn: z.array(ModelIdSchema).optional(),
|
|
19706
|
+
dependencyMode: z.literal("per-record-eligibility"),
|
|
19707
|
+
capabilityKey: ModelIdSchema,
|
|
19708
|
+
defaultBatchSize: z.number().int().positive(),
|
|
19709
|
+
maxBatchSize: z.number().int().positive()
|
|
19710
|
+
}).refine((step) => step.defaultBatchSize <= step.maxBatchSize, {
|
|
19711
|
+
message: "defaultBatchSize must be less than or equal to maxBatchSize",
|
|
19712
|
+
path: ["defaultBatchSize"]
|
|
19713
|
+
});
|
|
19714
|
+
var ProspectingBuildTemplateSchema = DisplayMetadataSchema.extend({
|
|
19715
|
+
id: ModelIdSchema,
|
|
19716
|
+
steps: z.array(ProspectingBuildTemplateStepSchema).min(1)
|
|
19717
|
+
});
|
|
19629
19718
|
var OrganizationModelProspectingSchema = z.object({
|
|
19630
19719
|
listEntityId: ModelIdSchema,
|
|
19631
19720
|
companyEntityId: ModelIdSchema,
|
|
19632
19721
|
contactEntityId: ModelIdSchema,
|
|
19633
19722
|
description: DescriptionSchema.optional(),
|
|
19634
19723
|
companyStages: z.array(ProspectingLifecycleStageSchema).min(1),
|
|
19635
|
-
contactStages: z.array(ProspectingLifecycleStageSchema).min(1)
|
|
19724
|
+
contactStages: z.array(ProspectingLifecycleStageSchema).min(1),
|
|
19725
|
+
defaultBuildTemplateId: ModelIdSchema,
|
|
19726
|
+
buildTemplates: z.array(ProspectingBuildTemplateSchema).min(1)
|
|
19636
19727
|
});
|
|
19637
19728
|
var DEFAULT_ORGANIZATION_MODEL_PROSPECTING = {
|
|
19638
19729
|
listEntityId: "leadgen.list",
|
|
@@ -19648,6 +19739,183 @@ var DEFAULT_ORGANIZATION_MODEL_PROSPECTING = {
|
|
|
19648
19739
|
{ id: "verified", label: "Verified", order: 2 },
|
|
19649
19740
|
{ id: "personalized", label: "Personalized", order: 3 },
|
|
19650
19741
|
{ id: "uploaded", label: "Uploaded", order: 4 }
|
|
19742
|
+
],
|
|
19743
|
+
defaultBuildTemplateId: "local-services",
|
|
19744
|
+
buildTemplates: [
|
|
19745
|
+
{
|
|
19746
|
+
id: "local-services",
|
|
19747
|
+
label: "Local Services Prospecting",
|
|
19748
|
+
description: "Curated local-services list build using company sourcing, website analysis, qualification, contact discovery, verification, personalization, and review.",
|
|
19749
|
+
steps: [
|
|
19750
|
+
{
|
|
19751
|
+
id: "source-companies",
|
|
19752
|
+
label: "Source companies",
|
|
19753
|
+
primaryEntity: "company",
|
|
19754
|
+
outputs: ["company"],
|
|
19755
|
+
stageKey: "populated",
|
|
19756
|
+
dependencyMode: "per-record-eligibility",
|
|
19757
|
+
capabilityKey: "lead-gen.company.source",
|
|
19758
|
+
defaultBatchSize: 100,
|
|
19759
|
+
maxBatchSize: 250
|
|
19760
|
+
},
|
|
19761
|
+
{
|
|
19762
|
+
id: "analyze-websites",
|
|
19763
|
+
label: "Analyze websites",
|
|
19764
|
+
primaryEntity: "company",
|
|
19765
|
+
outputs: ["company"],
|
|
19766
|
+
stageKey: "extracted",
|
|
19767
|
+
dependsOn: ["source-companies"],
|
|
19768
|
+
dependencyMode: "per-record-eligibility",
|
|
19769
|
+
capabilityKey: "lead-gen.company.website-extract",
|
|
19770
|
+
defaultBatchSize: 50,
|
|
19771
|
+
maxBatchSize: 100
|
|
19772
|
+
},
|
|
19773
|
+
{
|
|
19774
|
+
id: "qualify-companies",
|
|
19775
|
+
label: "Qualify companies",
|
|
19776
|
+
primaryEntity: "company",
|
|
19777
|
+
outputs: ["company"],
|
|
19778
|
+
stageKey: "qualified",
|
|
19779
|
+
dependsOn: ["analyze-websites"],
|
|
19780
|
+
dependencyMode: "per-record-eligibility",
|
|
19781
|
+
capabilityKey: "lead-gen.company.qualify",
|
|
19782
|
+
defaultBatchSize: 100,
|
|
19783
|
+
maxBatchSize: 250
|
|
19784
|
+
},
|
|
19785
|
+
{
|
|
19786
|
+
id: "find-contacts",
|
|
19787
|
+
label: "Find contacts",
|
|
19788
|
+
primaryEntity: "contact",
|
|
19789
|
+
outputs: ["contact"],
|
|
19790
|
+
stageKey: "discovered",
|
|
19791
|
+
dependsOn: ["qualify-companies"],
|
|
19792
|
+
dependencyMode: "per-record-eligibility",
|
|
19793
|
+
capabilityKey: "lead-gen.contact.discover",
|
|
19794
|
+
defaultBatchSize: 50,
|
|
19795
|
+
maxBatchSize: 100
|
|
19796
|
+
},
|
|
19797
|
+
{
|
|
19798
|
+
id: "verify-emails",
|
|
19799
|
+
label: "Verify emails",
|
|
19800
|
+
primaryEntity: "contact",
|
|
19801
|
+
outputs: ["contact"],
|
|
19802
|
+
stageKey: "verified",
|
|
19803
|
+
dependsOn: ["find-contacts"],
|
|
19804
|
+
dependencyMode: "per-record-eligibility",
|
|
19805
|
+
capabilityKey: "lead-gen.contact.verify-email",
|
|
19806
|
+
defaultBatchSize: 100,
|
|
19807
|
+
maxBatchSize: 500
|
|
19808
|
+
},
|
|
19809
|
+
{
|
|
19810
|
+
id: "personalize",
|
|
19811
|
+
label: "Personalize",
|
|
19812
|
+
primaryEntity: "contact",
|
|
19813
|
+
outputs: ["contact"],
|
|
19814
|
+
stageKey: "personalized",
|
|
19815
|
+
dependsOn: ["verify-emails"],
|
|
19816
|
+
dependencyMode: "per-record-eligibility",
|
|
19817
|
+
capabilityKey: "lead-gen.contact.personalize",
|
|
19818
|
+
defaultBatchSize: 25,
|
|
19819
|
+
maxBatchSize: 100
|
|
19820
|
+
},
|
|
19821
|
+
{
|
|
19822
|
+
id: "review",
|
|
19823
|
+
label: "Review",
|
|
19824
|
+
primaryEntity: "contact",
|
|
19825
|
+
outputs: ["export"],
|
|
19826
|
+
stageKey: "uploaded",
|
|
19827
|
+
dependsOn: ["personalize"],
|
|
19828
|
+
dependencyMode: "per-record-eligibility",
|
|
19829
|
+
capabilityKey: "lead-gen.review.outreach-ready",
|
|
19830
|
+
defaultBatchSize: 25,
|
|
19831
|
+
maxBatchSize: 100
|
|
19832
|
+
}
|
|
19833
|
+
]
|
|
19834
|
+
},
|
|
19835
|
+
{
|
|
19836
|
+
id: "dtc-subscription-apollo-clickup",
|
|
19837
|
+
label: "DTC Subscription Apollo Export",
|
|
19838
|
+
description: "Prospecting pipeline for DTC subscription or subscription-ready brands where Apollo is the source and contact-enrichment layer, Elevasis handles company research and fit scoring, and approved leads export as an approved lead list.",
|
|
19839
|
+
steps: [
|
|
19840
|
+
{
|
|
19841
|
+
id: "import-apollo-search",
|
|
19842
|
+
label: "Import Apollo search",
|
|
19843
|
+
description: "Pull companies and seed contact data from a predefined Apollo search or list.",
|
|
19844
|
+
primaryEntity: "company",
|
|
19845
|
+
outputs: ["company", "contact"],
|
|
19846
|
+
stageKey: "populated",
|
|
19847
|
+
dependencyMode: "per-record-eligibility",
|
|
19848
|
+
capabilityKey: "lead-gen.company.apollo-import",
|
|
19849
|
+
defaultBatchSize: 250,
|
|
19850
|
+
maxBatchSize: 1e3
|
|
19851
|
+
},
|
|
19852
|
+
{
|
|
19853
|
+
id: "analyze-websites",
|
|
19854
|
+
label: "Analyze websites",
|
|
19855
|
+
description: "Extract subscription, product, retention, and tech-stack signals from each brand website.",
|
|
19856
|
+
primaryEntity: "company",
|
|
19857
|
+
outputs: ["company"],
|
|
19858
|
+
stageKey: "extracted",
|
|
19859
|
+
dependsOn: ["import-apollo-search"],
|
|
19860
|
+
dependencyMode: "per-record-eligibility",
|
|
19861
|
+
capabilityKey: "lead-gen.company.website-extract",
|
|
19862
|
+
defaultBatchSize: 50,
|
|
19863
|
+
maxBatchSize: 100
|
|
19864
|
+
},
|
|
19865
|
+
{
|
|
19866
|
+
id: "score-dtc-fit",
|
|
19867
|
+
label: "Score DTC fit",
|
|
19868
|
+
description: "Classify subscription potential, consumable-product fit, retention maturity, and disqualifiers.",
|
|
19869
|
+
primaryEntity: "company",
|
|
19870
|
+
outputs: ["company"],
|
|
19871
|
+
stageKey: "qualified",
|
|
19872
|
+
dependsOn: ["analyze-websites"],
|
|
19873
|
+
dependencyMode: "per-record-eligibility",
|
|
19874
|
+
capabilityKey: "lead-gen.company.dtc-subscription-qualify",
|
|
19875
|
+
defaultBatchSize: 100,
|
|
19876
|
+
maxBatchSize: 250
|
|
19877
|
+
},
|
|
19878
|
+
{
|
|
19879
|
+
id: "enrich-decision-makers",
|
|
19880
|
+
label: "Enrich decision-makers",
|
|
19881
|
+
description: "Use Apollo to find qualified contacts such as founders, retention leads, lifecycle leads, and marketing owners.",
|
|
19882
|
+
primaryEntity: "contact",
|
|
19883
|
+
outputs: ["contact"],
|
|
19884
|
+
stageKey: "discovered",
|
|
19885
|
+
dependsOn: ["score-dtc-fit"],
|
|
19886
|
+
dependencyMode: "per-record-eligibility",
|
|
19887
|
+
capabilityKey: "lead-gen.contact.apollo-decision-maker-enrich",
|
|
19888
|
+
defaultBatchSize: 100,
|
|
19889
|
+
maxBatchSize: 250
|
|
19890
|
+
},
|
|
19891
|
+
{
|
|
19892
|
+
id: "verify-emails",
|
|
19893
|
+
label: "Verify emails",
|
|
19894
|
+
description: "Verify deliverability before the QC and handoff step.",
|
|
19895
|
+
primaryEntity: "contact",
|
|
19896
|
+
outputs: ["contact"],
|
|
19897
|
+
stageKey: "verified",
|
|
19898
|
+
dependsOn: ["enrich-decision-makers"],
|
|
19899
|
+
dependencyMode: "per-record-eligibility",
|
|
19900
|
+
capabilityKey: "lead-gen.contact.verify-email",
|
|
19901
|
+
defaultBatchSize: 250,
|
|
19902
|
+
maxBatchSize: 500
|
|
19903
|
+
},
|
|
19904
|
+
{
|
|
19905
|
+
id: "review-and-export",
|
|
19906
|
+
label: "Review and export",
|
|
19907
|
+
description: "Operator QC approves or rejects leads, then approved records are exported as a lead list.",
|
|
19908
|
+
primaryEntity: "company",
|
|
19909
|
+
outputs: ["export"],
|
|
19910
|
+
stageKey: "uploaded",
|
|
19911
|
+
dependsOn: ["verify-emails"],
|
|
19912
|
+
dependencyMode: "per-record-eligibility",
|
|
19913
|
+
capabilityKey: "lead-gen.export.list",
|
|
19914
|
+
defaultBatchSize: 100,
|
|
19915
|
+
maxBatchSize: 250
|
|
19916
|
+
}
|
|
19917
|
+
]
|
|
19918
|
+
}
|
|
19651
19919
|
]
|
|
19652
19920
|
};
|
|
19653
19921
|
var SurfaceTypeSchema = z.enum(["page", "dashboard", "graph", "detail", "list", "settings"]);
|
|
@@ -20071,6 +20339,31 @@ var DEFAULT_ORGANIZATION_MODEL_STATUSES = {
|
|
|
20071
20339
|
{ id: "request.wont_fix", label: "Won't Fix", semanticClass: "request", category: "request" }
|
|
20072
20340
|
]
|
|
20073
20341
|
};
|
|
20342
|
+
var KnowledgeLinkSchema = z.object({
|
|
20343
|
+
nodeId: NodeIdStringSchema
|
|
20344
|
+
});
|
|
20345
|
+
var OrgKnowledgeKindSchema = z.enum(["playbook", "strategy", "reference"]);
|
|
20346
|
+
var OrgKnowledgeNodeSchema = z.object({
|
|
20347
|
+
id: ModelIdSchema,
|
|
20348
|
+
kind: OrgKnowledgeKindSchema,
|
|
20349
|
+
title: z.string().trim().min(1).max(200),
|
|
20350
|
+
summary: z.string().trim().min(1).max(1e3),
|
|
20351
|
+
icon: IconNameSchema.optional(),
|
|
20352
|
+
/** Raw MDX string. Phase 2 will introduce a structured block format. */
|
|
20353
|
+
body: z.string().trim().min(1),
|
|
20354
|
+
/**
|
|
20355
|
+
* Graph links to other OM nodes this knowledge node governs.
|
|
20356
|
+
* Each link emits a `governs` edge: knowledge-node -> target node.
|
|
20357
|
+
*/
|
|
20358
|
+
links: z.array(KnowledgeLinkSchema).default([]),
|
|
20359
|
+
/** Identifiers of the roles or members who own this knowledge node. */
|
|
20360
|
+
ownerIds: z.array(ModelIdSchema).default([]),
|
|
20361
|
+
/** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
|
|
20362
|
+
updatedAt: z.string().trim().min(1).max(50)
|
|
20363
|
+
});
|
|
20364
|
+
var KnowledgeDomainSchema = z.object({
|
|
20365
|
+
nodes: z.array(OrgKnowledgeNodeSchema).default([])
|
|
20366
|
+
});
|
|
20074
20367
|
|
|
20075
20368
|
// src/organization-model/schema.ts
|
|
20076
20369
|
var OrganizationModelSchemaBase = z.object({
|
|
@@ -20087,7 +20380,8 @@ var OrganizationModelSchemaBase = z.object({
|
|
|
20087
20380
|
roles: RolesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ROLES),
|
|
20088
20381
|
goals: GoalsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_GOALS),
|
|
20089
20382
|
statuses: StatusesDomainSchema.default({ entries: [] }),
|
|
20090
|
-
operations: OperationsDomainSchema.default({ entries: [] })
|
|
20383
|
+
operations: OperationsDomainSchema.default({ entries: [] }),
|
|
20384
|
+
knowledge: KnowledgeDomainSchema.default({ nodes: [] })
|
|
20091
20385
|
});
|
|
20092
20386
|
function addIssue(ctx, path, message) {
|
|
20093
20387
|
ctx.addIssue({
|
|
@@ -20122,7 +20416,11 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
20122
20416
|
if (segments.length > 1) {
|
|
20123
20417
|
const parentId = segments.slice(0, -1).join(".");
|
|
20124
20418
|
if (!featuresById.has(parentId)) {
|
|
20125
|
-
addIssue(
|
|
20419
|
+
addIssue(
|
|
20420
|
+
ctx,
|
|
20421
|
+
["features", featureIndex, "id"],
|
|
20422
|
+
`Feature "${feature.id}" references unknown parent "${parentId}"`
|
|
20423
|
+
);
|
|
20126
20424
|
}
|
|
20127
20425
|
}
|
|
20128
20426
|
const hasChildren = model.features.some(
|
|
@@ -20182,6 +20480,9 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine((model, ct
|
|
|
20182
20480
|
});
|
|
20183
20481
|
|
|
20184
20482
|
// src/organization-model/defaults.ts
|
|
20483
|
+
var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {
|
|
20484
|
+
nodes: []
|
|
20485
|
+
};
|
|
20185
20486
|
var DEFAULT_ORGANIZATION_MODEL = {
|
|
20186
20487
|
version: 1,
|
|
20187
20488
|
features: [
|
|
@@ -20190,16 +20491,39 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20190
20491
|
label: "Dashboard",
|
|
20191
20492
|
enabled: true,
|
|
20192
20493
|
path: "/",
|
|
20193
|
-
icon: "dashboard",
|
|
20494
|
+
icon: "feature.dashboard",
|
|
20194
20495
|
uiPosition: "sidebar-primary"
|
|
20195
20496
|
},
|
|
20497
|
+
{
|
|
20498
|
+
id: "identity",
|
|
20499
|
+
label: "Identity",
|
|
20500
|
+
description: "Company identity, positioning, and market context",
|
|
20501
|
+
enabled: true,
|
|
20502
|
+
color: "indigo"
|
|
20503
|
+
},
|
|
20504
|
+
{
|
|
20505
|
+
id: "platform",
|
|
20506
|
+
label: "Platform",
|
|
20507
|
+
description: "Elevasis platform architecture, capabilities, and implementation patterns",
|
|
20508
|
+
enabled: true,
|
|
20509
|
+
color: "cyan",
|
|
20510
|
+
icon: "feature.platform"
|
|
20511
|
+
},
|
|
20512
|
+
{
|
|
20513
|
+
id: "finance",
|
|
20514
|
+
label: "Finance",
|
|
20515
|
+
description: "Finance operations, accounting, billing, reconciliation, and tax prep",
|
|
20516
|
+
enabled: true,
|
|
20517
|
+
color: "green",
|
|
20518
|
+
icon: "feature.finance"
|
|
20519
|
+
},
|
|
20196
20520
|
{
|
|
20197
20521
|
id: "sales",
|
|
20198
20522
|
label: "Sales",
|
|
20199
20523
|
description: "Revenue workflows and customer acquisition",
|
|
20200
20524
|
enabled: true,
|
|
20201
20525
|
color: "blue",
|
|
20202
|
-
icon: "
|
|
20526
|
+
icon: "feature.sales",
|
|
20203
20527
|
uiPosition: "sidebar-primary"
|
|
20204
20528
|
},
|
|
20205
20529
|
{
|
|
@@ -20208,7 +20532,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20208
20532
|
description: "Relationship pipeline and deal management",
|
|
20209
20533
|
enabled: true,
|
|
20210
20534
|
color: "blue",
|
|
20211
|
-
icon: "crm",
|
|
20535
|
+
icon: "feature.crm",
|
|
20212
20536
|
path: "/crm"
|
|
20213
20537
|
},
|
|
20214
20538
|
{
|
|
@@ -20217,7 +20541,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20217
20541
|
description: "Prospecting, qualification, and outreach preparation",
|
|
20218
20542
|
enabled: true,
|
|
20219
20543
|
color: "cyan",
|
|
20220
|
-
icon: "lead-gen",
|
|
20544
|
+
icon: "feature.lead-gen",
|
|
20221
20545
|
path: "/lead-gen"
|
|
20222
20546
|
},
|
|
20223
20547
|
{
|
|
@@ -20226,7 +20550,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20226
20550
|
description: "Projects, milestones, and client work execution",
|
|
20227
20551
|
enabled: true,
|
|
20228
20552
|
color: "orange",
|
|
20229
|
-
icon: "projects",
|
|
20553
|
+
icon: "feature.projects",
|
|
20230
20554
|
path: "/projects",
|
|
20231
20555
|
uiPosition: "sidebar-primary"
|
|
20232
20556
|
},
|
|
@@ -20236,14 +20560,14 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20236
20560
|
description: "Operational resources, topology, and orchestration visibility",
|
|
20237
20561
|
enabled: true,
|
|
20238
20562
|
color: "violet",
|
|
20239
|
-
icon: "operations",
|
|
20563
|
+
icon: "feature.operations",
|
|
20240
20564
|
uiPosition: "sidebar-primary"
|
|
20241
20565
|
},
|
|
20242
20566
|
{
|
|
20243
|
-
id: "
|
|
20567
|
+
id: "knowledge.command-view",
|
|
20244
20568
|
label: "Command View",
|
|
20245
20569
|
enabled: true,
|
|
20246
|
-
path: "/
|
|
20570
|
+
path: "/knowledge/command-view",
|
|
20247
20571
|
devOnly: true
|
|
20248
20572
|
},
|
|
20249
20573
|
{
|
|
@@ -20322,7 +20646,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20322
20646
|
id: "settings",
|
|
20323
20647
|
label: "Settings",
|
|
20324
20648
|
enabled: true,
|
|
20325
|
-
icon: "settings",
|
|
20649
|
+
icon: "feature.settings",
|
|
20326
20650
|
uiPosition: "sidebar-bottom"
|
|
20327
20651
|
},
|
|
20328
20652
|
{
|
|
@@ -20378,7 +20702,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20378
20702
|
label: "Admin",
|
|
20379
20703
|
enabled: true,
|
|
20380
20704
|
path: "/admin",
|
|
20381
|
-
icon: "
|
|
20705
|
+
icon: "feature.admin",
|
|
20382
20706
|
uiPosition: "sidebar-bottom",
|
|
20383
20707
|
requiresAdmin: true
|
|
20384
20708
|
},
|
|
@@ -20417,7 +20741,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20417
20741
|
label: "Archive",
|
|
20418
20742
|
enabled: true,
|
|
20419
20743
|
path: "/archive",
|
|
20420
|
-
icon: "archive",
|
|
20744
|
+
icon: "feature.archive",
|
|
20421
20745
|
uiPosition: "sidebar-bottom",
|
|
20422
20746
|
devOnly: true
|
|
20423
20747
|
},
|
|
@@ -20438,6 +20762,21 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20438
20762
|
label: "SEO",
|
|
20439
20763
|
enabled: false,
|
|
20440
20764
|
path: "/seo"
|
|
20765
|
+
},
|
|
20766
|
+
{
|
|
20767
|
+
id: "knowledge",
|
|
20768
|
+
label: "Knowledge",
|
|
20769
|
+
description: "Operational knowledge, playbooks, and strategy docs",
|
|
20770
|
+
enabled: true,
|
|
20771
|
+
color: "teal",
|
|
20772
|
+
icon: "feature.knowledge",
|
|
20773
|
+
uiPosition: "sidebar-primary"
|
|
20774
|
+
},
|
|
20775
|
+
{
|
|
20776
|
+
id: "knowledge.base",
|
|
20777
|
+
label: "Knowledge Base",
|
|
20778
|
+
enabled: true,
|
|
20779
|
+
path: "/knowledge"
|
|
20441
20780
|
}
|
|
20442
20781
|
],
|
|
20443
20782
|
branding: DEFAULT_ORGANIZATION_MODEL_BRANDING,
|
|
@@ -20451,7 +20790,8 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
20451
20790
|
roles: DEFAULT_ORGANIZATION_MODEL_ROLES,
|
|
20452
20791
|
goals: DEFAULT_ORGANIZATION_MODEL_GOALS,
|
|
20453
20792
|
statuses: DEFAULT_ORGANIZATION_MODEL_STATUSES,
|
|
20454
|
-
operations: DEFAULT_ORGANIZATION_MODEL_OPERATIONS
|
|
20793
|
+
operations: DEFAULT_ORGANIZATION_MODEL_OPERATIONS,
|
|
20794
|
+
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
20455
20795
|
};
|
|
20456
20796
|
|
|
20457
20797
|
// src/organization-model/resolve.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Minimal shared constants across Elevasis monorepo",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"./entities": {
|
|
28
28
|
"types": "./dist/business/entities-published.d.ts",
|
|
29
29
|
"import": "./dist/business/entities-published.js"
|
|
30
|
+
},
|
|
31
|
+
"./knowledge": {
|
|
32
|
+
"types": "./dist/knowledge/index.d.ts",
|
|
33
|
+
"import": "./dist/knowledge/index.js"
|
|
30
34
|
}
|
|
31
35
|
},
|
|
32
36
|
"devDependencies": {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { describe, expect, it } from 'vitest'
|
|
4
|
-
|
|
5
|
-
const packageJsonPath = path.resolve(__dirname, '../../package.json')
|
|
6
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {
|
|
7
|
-
publishConfig?: {
|
|
8
|
-
name?: string
|
|
9
|
-
exports?: Record<string, unknown>
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
|
|
5
|
+
const packageJsonPath = path.resolve(__dirname, '../../package.json')
|
|
6
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {
|
|
7
|
+
publishConfig?: {
|
|
8
|
+
name?: string
|
|
9
|
+
exports?: Record<string, unknown>
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
13
|
describe('core publish surface', () => {
|
|
14
14
|
it('publishes the curated @elevasis/core organization-model wrapper', () => {
|
|
15
15
|
expect(packageJson.publishConfig?.name).toBe('@elevasis/core')
|
|
@@ -17,7 +17,8 @@ describe('core publish surface', () => {
|
|
|
17
17
|
'.',
|
|
18
18
|
'./test-utils',
|
|
19
19
|
'./organization-model',
|
|
20
|
-
'./entities'
|
|
20
|
+
'./entities',
|
|
21
|
+
'./knowledge'
|
|
21
22
|
])
|
|
22
23
|
})
|
|
23
24
|
})
|
|
@@ -27,28 +27,28 @@ describe('template core compatibility', () => {
|
|
|
27
27
|
id: 'operations',
|
|
28
28
|
label: 'Operations',
|
|
29
29
|
surfaceType: 'dashboard',
|
|
30
|
-
expectedIcon: 'operations',
|
|
30
|
+
expectedIcon: 'feature.operations',
|
|
31
31
|
expectedPath: '/operations',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: PROJECTS_FEATURE_ID,
|
|
35
35
|
label: 'Projects',
|
|
36
36
|
surfaceType: 'list',
|
|
37
|
-
expectedIcon: 'projects',
|
|
37
|
+
expectedIcon: 'feature.projects',
|
|
38
38
|
expectedPath: '/projects',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
id: 'lead-gen',
|
|
42
42
|
label: 'Lead Gen',
|
|
43
43
|
surfaceType: 'list',
|
|
44
|
-
expectedIcon: 'lead-gen',
|
|
44
|
+
expectedIcon: 'feature.lead-gen',
|
|
45
45
|
expectedPath: '/lead-gen',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: 'crm',
|
|
49
49
|
label: 'CRM',
|
|
50
50
|
surfaceType: 'graph',
|
|
51
|
-
expectedIcon: 'crm',
|
|
51
|
+
expectedIcon: 'feature.crm',
|
|
52
52
|
expectedPath: '/crm',
|
|
53
53
|
}
|
|
54
54
|
] as const
|