@elevasis/sdk 1.10.0 → 1.12.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.
Files changed (40) hide show
  1. package/dist/cli.cjs +52 -149
  2. package/dist/index.d.ts +468 -198
  3. package/dist/index.js +225 -147
  4. package/dist/test-utils/index.d.ts +272 -99
  5. package/dist/test-utils/index.js +4756 -125
  6. package/dist/types/worker/adapters/llm.d.ts +1 -1
  7. package/dist/worker/index.js +14 -6
  8. package/package.json +2 -2
  9. package/reference/claude-config/rules/agent-start-here.md +14 -14
  10. package/reference/claude-config/skills/configure/SKILL.md +3 -3
  11. package/reference/claude-config/skills/setup/SKILL.md +6 -6
  12. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -0
  13. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +101 -0
  14. package/reference/cli.mdx +57 -0
  15. package/reference/deployment/provided-features.mdx +40 -267
  16. package/reference/examples/organization-model.ts +99 -564
  17. package/reference/packages/core/src/organization-model/README.md +102 -97
  18. package/reference/resources/types.mdx +72 -163
  19. package/reference/scaffold/core/organization-graph.mdx +92 -272
  20. package/reference/scaffold/core/organization-model.mdx +155 -320
  21. package/reference/scaffold/index.mdx +3 -0
  22. package/reference/scaffold/operations/propagation-pipeline.md +4 -1
  23. package/reference/scaffold/operations/scaffold-maintenance.md +3 -0
  24. package/reference/scaffold/operations/workflow-recipes.md +13 -10
  25. package/reference/scaffold/recipes/add-a-feature.md +105 -158
  26. package/reference/scaffold/recipes/add-a-resource.md +88 -158
  27. package/reference/scaffold/recipes/customize-organization-model.md +144 -400
  28. package/reference/scaffold/recipes/extend-a-base-entity.md +11 -8
  29. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +117 -158
  30. package/reference/scaffold/recipes/index.md +3 -0
  31. package/reference/scaffold/reference/contracts.md +107 -435
  32. package/reference/scaffold/reference/feature-registry.md +11 -8
  33. package/reference/scaffold/reference/glossary.md +74 -105
  34. package/reference/scaffold/ui/composition-extensibility.mdx +3 -0
  35. package/reference/scaffold/ui/customization.md +3 -0
  36. package/reference/scaffold/ui/feature-flags-and-gating.md +29 -231
  37. package/reference/scaffold/ui/feature-shell.mdx +53 -219
  38. package/reference/scaffold/ui/recipes.md +65 -397
  39. package/reference/claude-config/logs/pre-edit-vibe-gate.log +0 -40
  40. package/reference/claude-config/logs/scaffold-registry-reminder.log +0 -38
package/dist/index.d.ts CHANGED
@@ -340,74 +340,6 @@ interface FormSchema {
340
340
  fields: FormField[];
341
341
  }
342
342
 
343
- /**
344
- * Command View Types
345
- *
346
- * Unified type definitions for the Command View graph visualization.
347
- * These types are used by both backend serialization and frontend rendering.
348
- *
349
- * Command View shows the resource graph: agents, workflows, triggers, integrations,
350
- * external resources, and human checkpoints with their relationships.
351
- */
352
-
353
- /**
354
- * Extended agent metadata for Command View
355
- * Includes model and capability information for graph display
356
- */
357
- interface CommandViewAgent extends ResourceDefinition {
358
- type: 'agent';
359
- modelProvider: string;
360
- modelId: string;
361
- toolCount: number;
362
- hasKnowledgeMap: boolean;
363
- hasMemory: boolean;
364
- sessionCapable: boolean;
365
- }
366
- /**
367
- * Extended workflow metadata for Command View
368
- * Includes step information for graph display
369
- */
370
- interface CommandViewWorkflow extends ResourceDefinition {
371
- type: 'workflow';
372
- stepCount: number;
373
- entryPoint: string;
374
- }
375
- /**
376
- * Relationship types between resources
377
- *
378
- * - triggers: Resource initiates/starts another resource (orange)
379
- * - uses: Resource uses an integration (teal)
380
- * - approval: Resource requires human approval (yellow)
381
- */
382
- type RelationshipType = 'triggers' | 'uses' | 'approval';
383
- /**
384
- * Command View edge (relationship between resources)
385
- */
386
- interface CommandViewEdge {
387
- id: string;
388
- source: string;
389
- target: string;
390
- relationship: RelationshipType;
391
- label?: string;
392
- }
393
- /**
394
- * Command View data structure
395
- * Complete graph data for visualization
396
- *
397
- * Backend serializes this once at startup and serves it via /command-view endpoint.
398
- * Frontend consumes this directly for graph rendering.
399
- */
400
- interface CommandViewData {
401
- workflows: CommandViewWorkflow[];
402
- agents: CommandViewAgent[];
403
- triggers: TriggerDefinition[];
404
- integrations: IntegrationDefinition[];
405
- externalResources: ExternalResourceDefinition[];
406
- humanCheckpoints: HumanCheckpointDefinition[];
407
- edges: CommandViewEdge[];
408
- domainDefinitions?: DomainDefinition[];
409
- }
410
-
411
343
  /**
412
344
  * Serialized Registry Types
413
345
  *
@@ -488,6 +420,8 @@ interface SerializedAgentDefinition {
488
420
  version: string;
489
421
  type: 'agent';
490
422
  status: 'dev' | 'prod';
423
+ links?: ResourceLink[];
424
+ category?: ResourceCategory;
491
425
  /** Whether this resource is archived and should be excluded from registration and deployment */
492
426
  archived?: boolean;
493
427
  systemPrompt: string;
@@ -543,6 +477,8 @@ interface SerializedWorkflowDefinition {
543
477
  version: string;
544
478
  type: 'workflow';
545
479
  status: 'dev' | 'prod';
480
+ links?: ResourceLink[];
481
+ category?: ResourceCategory;
546
482
  /** Whether this resource is archived and should be excluded from registration and deployment */
547
483
  archived?: boolean;
548
484
  };
@@ -1572,7 +1508,6 @@ type Database = {
1572
1508
  acq_deals: {
1573
1509
  Row: {
1574
1510
  activity_log: Json;
1575
- cached_stage: string | null;
1576
1511
  closed_lost_at: string | null;
1577
1512
  closed_lost_reason: string | null;
1578
1513
  contact_email: string;
@@ -1587,6 +1522,7 @@ type Database = {
1587
1522
  organization_id: string;
1588
1523
  payment_link_sent_at: string | null;
1589
1524
  payment_received_at: string | null;
1525
+ pipeline_key: string;
1590
1526
  proposal_data: Json | null;
1591
1527
  proposal_generated_at: string | null;
1592
1528
  proposal_pdf_url: string | null;
@@ -1594,10 +1530,11 @@ type Database = {
1594
1530
  proposal_reviewed_by: string | null;
1595
1531
  proposal_sent_at: string | null;
1596
1532
  proposal_signed_at: string | null;
1597
- proposal_status: string | null;
1598
1533
  signature_envelope_id: string | null;
1599
1534
  source_list_id: string | null;
1600
1535
  source_type: string | null;
1536
+ stage_key: string | null;
1537
+ state_key: string | null;
1601
1538
  stripe_payment_id: string | null;
1602
1539
  stripe_payment_link: string | null;
1603
1540
  stripe_payment_link_id: string | null;
@@ -1606,7 +1543,6 @@ type Database = {
1606
1543
  };
1607
1544
  Insert: {
1608
1545
  activity_log?: Json;
1609
- cached_stage?: string | null;
1610
1546
  closed_lost_at?: string | null;
1611
1547
  closed_lost_reason?: string | null;
1612
1548
  contact_email: string;
@@ -1621,6 +1557,7 @@ type Database = {
1621
1557
  organization_id: string;
1622
1558
  payment_link_sent_at?: string | null;
1623
1559
  payment_received_at?: string | null;
1560
+ pipeline_key?: string;
1624
1561
  proposal_data?: Json | null;
1625
1562
  proposal_generated_at?: string | null;
1626
1563
  proposal_pdf_url?: string | null;
@@ -1628,10 +1565,11 @@ type Database = {
1628
1565
  proposal_reviewed_by?: string | null;
1629
1566
  proposal_sent_at?: string | null;
1630
1567
  proposal_signed_at?: string | null;
1631
- proposal_status?: string | null;
1632
1568
  signature_envelope_id?: string | null;
1633
1569
  source_list_id?: string | null;
1634
1570
  source_type?: string | null;
1571
+ stage_key?: string | null;
1572
+ state_key?: string | null;
1635
1573
  stripe_payment_id?: string | null;
1636
1574
  stripe_payment_link?: string | null;
1637
1575
  stripe_payment_link_id?: string | null;
@@ -1640,7 +1578,6 @@ type Database = {
1640
1578
  };
1641
1579
  Update: {
1642
1580
  activity_log?: Json;
1643
- cached_stage?: string | null;
1644
1581
  closed_lost_at?: string | null;
1645
1582
  closed_lost_reason?: string | null;
1646
1583
  contact_email?: string;
@@ -1655,6 +1592,7 @@ type Database = {
1655
1592
  organization_id?: string;
1656
1593
  payment_link_sent_at?: string | null;
1657
1594
  payment_received_at?: string | null;
1595
+ pipeline_key?: string;
1658
1596
  proposal_data?: Json | null;
1659
1597
  proposal_generated_at?: string | null;
1660
1598
  proposal_pdf_url?: string | null;
@@ -1662,10 +1600,11 @@ type Database = {
1662
1600
  proposal_reviewed_by?: string | null;
1663
1601
  proposal_sent_at?: string | null;
1664
1602
  proposal_signed_at?: string | null;
1665
- proposal_status?: string | null;
1666
1603
  signature_envelope_id?: string | null;
1667
1604
  source_list_id?: string | null;
1668
1605
  source_type?: string | null;
1606
+ stage_key?: string | null;
1607
+ state_key?: string | null;
1669
1608
  stripe_payment_id?: string | null;
1670
1609
  stripe_payment_link?: string | null;
1671
1610
  stripe_payment_link_id?: string | null;
@@ -2834,6 +2773,7 @@ type Database = {
2834
2773
  Row: {
2835
2774
  config: Json;
2836
2775
  created_at: string | null;
2776
+ effective_permissions: string[];
2837
2777
  id: string;
2838
2778
  membership_status: string | null;
2839
2779
  organization_id: string;
@@ -2845,6 +2785,7 @@ type Database = {
2845
2785
  Insert: {
2846
2786
  config?: Json;
2847
2787
  created_at?: string | null;
2788
+ effective_permissions?: string[];
2848
2789
  id?: string;
2849
2790
  membership_status?: string | null;
2850
2791
  organization_id: string;
@@ -2856,6 +2797,7 @@ type Database = {
2856
2797
  Update: {
2857
2798
  config?: Json;
2858
2799
  created_at?: string | null;
2800
+ effective_permissions?: string[];
2859
2801
  id?: string;
2860
2802
  membership_status?: string | null;
2861
2803
  organization_id?: string;
@@ -2881,6 +2823,147 @@ type Database = {
2881
2823
  }
2882
2824
  ];
2883
2825
  };
2826
+ org_rol_assignments: {
2827
+ Row: {
2828
+ granted_at: string;
2829
+ granted_by: string | null;
2830
+ membership_id: string;
2831
+ role_id: string;
2832
+ };
2833
+ Insert: {
2834
+ granted_at?: string;
2835
+ granted_by?: string | null;
2836
+ membership_id: string;
2837
+ role_id: string;
2838
+ };
2839
+ Update: {
2840
+ granted_at?: string;
2841
+ granted_by?: string | null;
2842
+ membership_id?: string;
2843
+ role_id?: string;
2844
+ };
2845
+ Relationships: [
2846
+ {
2847
+ foreignKeyName: "org_rol_assignments_granted_by_fkey";
2848
+ columns: ["granted_by"];
2849
+ isOneToOne: false;
2850
+ referencedRelation: "users";
2851
+ referencedColumns: ["id"];
2852
+ },
2853
+ {
2854
+ foreignKeyName: "org_rol_assignments_membership_id_fkey";
2855
+ columns: ["membership_id"];
2856
+ isOneToOne: false;
2857
+ referencedRelation: "org_memberships";
2858
+ referencedColumns: ["id"];
2859
+ },
2860
+ {
2861
+ foreignKeyName: "org_rol_assignments_role_id_fkey";
2862
+ columns: ["role_id"];
2863
+ isOneToOne: false;
2864
+ referencedRelation: "org_rol_definitions";
2865
+ referencedColumns: ["id"];
2866
+ }
2867
+ ];
2868
+ };
2869
+ org_rol_definitions: {
2870
+ Row: {
2871
+ created_at: string;
2872
+ description: string | null;
2873
+ id: string;
2874
+ is_system: boolean;
2875
+ name: string;
2876
+ organization_id: string | null;
2877
+ slug: string;
2878
+ updated_at: string;
2879
+ };
2880
+ Insert: {
2881
+ created_at?: string;
2882
+ description?: string | null;
2883
+ id?: string;
2884
+ is_system?: boolean;
2885
+ name: string;
2886
+ organization_id?: string | null;
2887
+ slug: string;
2888
+ updated_at?: string;
2889
+ };
2890
+ Update: {
2891
+ created_at?: string;
2892
+ description?: string | null;
2893
+ id?: string;
2894
+ is_system?: boolean;
2895
+ name?: string;
2896
+ organization_id?: string | null;
2897
+ slug?: string;
2898
+ updated_at?: string;
2899
+ };
2900
+ Relationships: [
2901
+ {
2902
+ foreignKeyName: "org_rol_definitions_organization_id_fkey";
2903
+ columns: ["organization_id"];
2904
+ isOneToOne: false;
2905
+ referencedRelation: "organizations";
2906
+ referencedColumns: ["id"];
2907
+ }
2908
+ ];
2909
+ };
2910
+ org_rol_grants: {
2911
+ Row: {
2912
+ granted_at: string;
2913
+ permission_key: string;
2914
+ role_id: string;
2915
+ };
2916
+ Insert: {
2917
+ granted_at?: string;
2918
+ permission_key: string;
2919
+ role_id: string;
2920
+ };
2921
+ Update: {
2922
+ granted_at?: string;
2923
+ permission_key?: string;
2924
+ role_id?: string;
2925
+ };
2926
+ Relationships: [
2927
+ {
2928
+ foreignKeyName: "org_rol_grants_permission_key_fkey";
2929
+ columns: ["permission_key"];
2930
+ isOneToOne: false;
2931
+ referencedRelation: "org_rol_permissions";
2932
+ referencedColumns: ["key"];
2933
+ },
2934
+ {
2935
+ foreignKeyName: "org_rol_grants_role_id_fkey";
2936
+ columns: ["role_id"];
2937
+ isOneToOne: false;
2938
+ referencedRelation: "org_rol_definitions";
2939
+ referencedColumns: ["id"];
2940
+ }
2941
+ ];
2942
+ };
2943
+ org_rol_permissions: {
2944
+ Row: {
2945
+ created_at: string;
2946
+ description: string;
2947
+ is_org_grantable: boolean;
2948
+ key: string;
2949
+ updated_at: string;
2950
+ };
2951
+ Insert: {
2952
+ created_at?: string;
2953
+ description: string;
2954
+ is_org_grantable?: boolean;
2955
+ key: string;
2956
+ updated_at?: string;
2957
+ };
2958
+ Update: {
2959
+ created_at?: string;
2960
+ description?: string;
2961
+ is_org_grantable?: boolean;
2962
+ key?: string;
2963
+ updated_at?: string;
2964
+ };
2965
+ Relationships: [];
2966
+ };
2884
2967
  organizations: {
2885
2968
  Row: {
2886
2969
  config: Json;
@@ -3638,7 +3721,8 @@ type Database = {
3638
3721
  created_at: string;
3639
3722
  description: string | null;
3640
3723
  id: string;
3641
- key: string;
3724
+ key_hash: string;
3725
+ key_prefix: string | null;
3642
3726
  last_triggered_at: string | null;
3643
3727
  name: string;
3644
3728
  organization_id: string;
@@ -3651,7 +3735,8 @@ type Database = {
3651
3735
  created_at?: string;
3652
3736
  description?: string | null;
3653
3737
  id?: string;
3654
- key: string;
3738
+ key_hash: string;
3739
+ key_prefix?: string | null;
3655
3740
  last_triggered_at?: string | null;
3656
3741
  name: string;
3657
3742
  organization_id: string;
@@ -3664,7 +3749,8 @@ type Database = {
3664
3749
  created_at?: string;
3665
3750
  description?: string | null;
3666
3751
  id?: string;
3667
- key?: string;
3752
+ key_hash?: string;
3753
+ key_prefix?: string | null;
3668
3754
  last_triggered_at?: string | null;
3669
3755
  name?: string;
3670
3756
  organization_id?: string;
@@ -3710,6 +3796,13 @@ type Database = {
3710
3796
  Args: never;
3711
3797
  Returns: string;
3712
3798
  };
3799
+ can_assign_role_in_org: {
3800
+ Args: {
3801
+ p_role_id: string;
3802
+ p_target_membership_id: string;
3803
+ };
3804
+ Returns: boolean;
3805
+ };
3713
3806
  current_user_is_platform_admin: {
3714
3807
  Args: never;
3715
3808
  Returns: boolean;
@@ -3739,6 +3832,10 @@ type Database = {
3739
3832
  user_id: string;
3740
3833
  }[];
3741
3834
  };
3835
+ get_platform_credential_kek: {
3836
+ Args: never;
3837
+ Returns: string;
3838
+ };
3742
3839
  get_storage_org_id: {
3743
3840
  Args: {
3744
3841
  file_path: string;
@@ -3749,9 +3846,10 @@ type Database = {
3749
3846
  Args: never;
3750
3847
  Returns: string;
3751
3848
  };
3752
- is_org_admin: {
3849
+ has_org_permission: {
3753
3850
  Args: {
3754
3851
  org_id: string;
3852
+ perm_key: string;
3755
3853
  };
3756
3854
  Returns: boolean;
3757
3855
  };
@@ -3781,6 +3879,22 @@ type Database = {
3781
3879
  Args: never;
3782
3880
  Returns: Json;
3783
3881
  };
3882
+ recompute_all_memberships: {
3883
+ Args: never;
3884
+ Returns: undefined;
3885
+ };
3886
+ sync_all_memberships_with_role: {
3887
+ Args: {
3888
+ p_role_id: string;
3889
+ };
3890
+ Returns: undefined;
3891
+ };
3892
+ sync_one_membership: {
3893
+ Args: {
3894
+ p_membership_id: string;
3895
+ };
3896
+ Returns: undefined;
3897
+ };
3784
3898
  upsert_user_profile: {
3785
3899
  Args: never;
3786
3900
  Returns: {
@@ -4240,7 +4354,6 @@ interface UpdateProposalDataParams {
4240
4354
  contactEmail: string;
4241
4355
  proposalData: unknown;
4242
4356
  proposalPdfUrl?: string;
4243
- proposalStatus?: string;
4244
4357
  }
4245
4358
  interface MarkProposalSentParams {
4246
4359
  organizationId: string;
@@ -4264,10 +4377,14 @@ interface UpdateFeesParams {
4264
4377
  initialFee?: number;
4265
4378
  monthlyFee?: number;
4266
4379
  }
4267
- interface SyncDealStageParams {
4380
+ interface TransitionItemParams {
4268
4381
  organizationId: string;
4269
4382
  dealId: string;
4270
- stage: string;
4383
+ pipelineKey: string;
4384
+ stageKey: string;
4385
+ stateKey?: string | null;
4386
+ reason?: string;
4387
+ expectedUpdatedAt?: string;
4271
4388
  }
4272
4389
  interface SetContactNurtureParams {
4273
4390
  organizationId: string;
@@ -4286,7 +4403,7 @@ interface ClearDealFieldsParams {
4286
4403
  organizationId: string;
4287
4404
  contactEmail?: string;
4288
4405
  dealId?: string;
4289
- fields: ('proposalPdfUrl' | 'proposalStatus' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4406
+ fields: ('proposalPdfUrl' | 'proposalGeneratedAt' | 'initialFee' | 'monthlyFee' | 'closedLostReason' | 'closedLostAt' | 'discoveryData' | 'discoverySubmittedAt')[];
4290
4407
  }
4291
4408
  interface DeleteDealParams {
4292
4409
  organizationId: string;
@@ -4332,10 +4449,11 @@ interface AcqDeal {
4332
4449
  id: string;
4333
4450
  organizationId: string;
4334
4451
  contactEmail: string;
4335
- cachedStage?: string | null;
4452
+ pipelineKey: string;
4453
+ stageKey?: string | null;
4454
+ stateKey?: string | null;
4336
4455
  discoveryData?: Json | null;
4337
4456
  proposalData?: Json | null;
4338
- proposalStatus?: string | null;
4339
4457
  proposalSentAt?: string | null;
4340
4458
  proposalPdfUrl?: string | null;
4341
4459
  signatureEnvelopeId?: string | null;
@@ -4413,7 +4531,7 @@ interface DealStageSummary {
4413
4531
  interface StaleDeal {
4414
4532
  id: string;
4415
4533
  contactEmail: string;
4416
- cachedStage: string;
4534
+ stageKey: string;
4417
4535
  updatedAt: string;
4418
4536
  daysStale: number;
4419
4537
  }
@@ -4612,6 +4730,96 @@ interface ProjectDetail extends ProjectRow {
4612
4730
  } | null;
4613
4731
  }
4614
4732
 
4733
+ declare const ActivityEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4734
+ type: z.ZodLiteral<"stage_change">;
4735
+ timestamp: z.ZodString;
4736
+ stageBefore: z.ZodString;
4737
+ stageAfter: z.ZodString;
4738
+ reason: z.ZodOptional<z.ZodString>;
4739
+ }, z.core.$strip>, z.ZodObject<{
4740
+ type: z.ZodLiteral<"state_change">;
4741
+ timestamp: z.ZodString;
4742
+ stateBefore: z.ZodNullable<z.ZodString>;
4743
+ stateAfter: z.ZodNullable<z.ZodString>;
4744
+ reason: z.ZodOptional<z.ZodString>;
4745
+ }, z.core.$strip>, z.ZodObject<{
4746
+ type: z.ZodLiteral<"action_taken">;
4747
+ timestamp: z.ZodString;
4748
+ actionKey: z.ZodString;
4749
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4750
+ }, z.core.$strip>, z.ZodObject<{
4751
+ type: z.ZodLiteral<"approval_created">;
4752
+ timestamp: z.ZodString;
4753
+ commandId: z.ZodString;
4754
+ dealStageBefore: z.ZodOptional<z.ZodString>;
4755
+ dealStageAfter: z.ZodOptional<z.ZodString>;
4756
+ }, z.core.$strip>, z.ZodObject<{
4757
+ type: z.ZodLiteral<"approval_resolved">;
4758
+ timestamp: z.ZodString;
4759
+ commandId: z.ZodString;
4760
+ resolution: z.ZodEnum<{
4761
+ superseded: "superseded";
4762
+ }>;
4763
+ originResourceType: z.ZodOptional<z.ZodString>;
4764
+ }, z.core.$strip>, z.ZodObject<{
4765
+ type: z.ZodLiteral<"approval_stale">;
4766
+ timestamp: z.ZodString;
4767
+ commandId: z.ZodString;
4768
+ dealStageBefore: z.ZodOptional<z.ZodString>;
4769
+ dealStageAfter: z.ZodOptional<z.ZodString>;
4770
+ }, z.core.$strip>, z.ZodObject<{
4771
+ type: z.ZodLiteral<"task_created">;
4772
+ timestamp: z.ZodString;
4773
+ taskId: z.ZodString;
4774
+ }, z.core.$strip>, z.ZodObject<{
4775
+ type: z.ZodLiteral<"deal_created">;
4776
+ timestamp: z.ZodString;
4777
+ }, z.core.$strip>, z.ZodObject<{
4778
+ type: z.ZodLiteral<"reply_received">;
4779
+ timestamp: z.ZodString;
4780
+ messageId: z.ZodOptional<z.ZodString>;
4781
+ source: z.ZodOptional<z.ZodString>;
4782
+ }, z.core.$strip>, z.ZodObject<{
4783
+ type: z.ZodLiteral<"reply_sent_to_lead">;
4784
+ timestamp: z.ZodString;
4785
+ messageId: z.ZodOptional<z.ZodString>;
4786
+ source: z.ZodOptional<z.ZodString>;
4787
+ }, z.core.$strip>, z.ZodObject<{
4788
+ type: z.ZodLiteral<"booking_nudge_sent">;
4789
+ timestamp: z.ZodString;
4790
+ followupDay: z.ZodNumber;
4791
+ }, z.core.$strip>, z.ZodObject<{
4792
+ type: z.ZodLiteral<"reminder_sent">;
4793
+ timestamp: z.ZodString;
4794
+ followupDay: z.ZodOptional<z.ZodNumber>;
4795
+ }, z.core.$strip>, z.ZodObject<{
4796
+ type: z.ZodLiteral<"booking_cancelled">;
4797
+ timestamp: z.ZodString;
4798
+ reason: z.ZodOptional<z.ZodString>;
4799
+ }, z.core.$strip>, z.ZodObject<{
4800
+ type: z.ZodLiteral<"discovery_submitted">;
4801
+ timestamp: z.ZodString;
4802
+ }, z.core.$strip>, z.ZodObject<{
4803
+ type: z.ZodLiteral<"moved_to_nurturing">;
4804
+ timestamp: z.ZodString;
4805
+ }, z.core.$strip>, z.ZodObject<{
4806
+ type: z.ZodLiteral<"no_show">;
4807
+ timestamp: z.ZodString;
4808
+ }, z.core.$strip>, z.ZodObject<{
4809
+ type: z.ZodLiteral<"followup_email_sent">;
4810
+ timestamp: z.ZodString;
4811
+ followupDay: z.ZodOptional<z.ZodNumber>;
4812
+ }, z.core.$strip>], "type">;
4813
+ type ActivityEvent = z.infer<typeof ActivityEventSchema>;
4814
+
4815
+ interface Action {
4816
+ key: string;
4817
+ label: string;
4818
+ kind: 'transition' | 'edit' | 'modal';
4819
+ payload?: Record<string, unknown>;
4820
+ }
4821
+ declare function deriveActions(deal: AcqDealRow): Action[];
4822
+
4615
4823
  declare const DealSchemas: {
4616
4824
  DealIdParams: z.ZodObject<{
4617
4825
  dealId: z.ZodString;
@@ -4622,12 +4830,12 @@ declare const DealSchemas: {
4622
4830
  }, z.core.$strip>;
4623
4831
  ListDealsQuery: z.ZodObject<{
4624
4832
  stage: z.ZodOptional<z.ZodEnum<{
4833
+ nurturing: "nurturing";
4834
+ closed_won: "closed_won";
4835
+ closed_lost: "closed_lost";
4625
4836
  interested: "interested";
4626
4837
  proposal: "proposal";
4627
4838
  closing: "closing";
4628
- closed_won: "closed_won";
4629
- closed_lost: "closed_lost";
4630
- nurturing: "nurturing";
4631
4839
  }>>;
4632
4840
  search: z.ZodOptional<z.ZodString>;
4633
4841
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -4639,10 +4847,10 @@ declare const DealSchemas: {
4639
4847
  }, z.core.$strict>;
4640
4848
  ListDealTasksDueQuery: z.ZodObject<{
4641
4849
  window: z.ZodOptional<z.ZodEnum<{
4850
+ upcoming: "upcoming";
4642
4851
  overdue: "overdue";
4643
4852
  today: "today";
4644
4853
  today_and_overdue: "today_and_overdue";
4645
- upcoming: "upcoming";
4646
4854
  }>>;
4647
4855
  assigneeUserId: z.ZodOptional<z.ZodString>;
4648
4856
  }, z.core.$strict>;
@@ -4661,15 +4869,12 @@ declare const DealSchemas: {
4661
4869
  dueAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4662
4870
  assigneeUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4663
4871
  }, z.core.$strict>;
4664
- SyncDealStageRequest: z.ZodObject<{
4665
- stage: z.ZodEnum<{
4666
- interested: "interested";
4667
- proposal: "proposal";
4668
- closing: "closing";
4669
- closed_won: "closed_won";
4670
- closed_lost: "closed_lost";
4671
- nurturing: "nurturing";
4672
- }>;
4872
+ TransitionItemRequest: z.ZodObject<{
4873
+ pipelineKey: z.ZodString;
4874
+ stageKey: z.ZodString;
4875
+ stateKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4876
+ reason: z.ZodOptional<z.ZodString>;
4877
+ expectedUpdatedAt: z.ZodOptional<z.ZodString>;
4673
4878
  }, z.core.$strict>;
4674
4879
  DealListResponse: z.ZodObject<{
4675
4880
  data: z.ZodArray<z.ZodObject<{
@@ -4677,13 +4882,14 @@ declare const DealSchemas: {
4677
4882
  organization_id: z.ZodString;
4678
4883
  contact_id: z.ZodNullable<z.ZodString>;
4679
4884
  contact_email: z.ZodString;
4680
- cached_stage: z.ZodNullable<z.ZodString>;
4885
+ pipeline_key: z.ZodString;
4886
+ stage_key: z.ZodNullable<z.ZodString>;
4887
+ state_key: z.ZodNullable<z.ZodString>;
4681
4888
  activity_log: z.ZodUnknown;
4682
4889
  discovery_data: z.ZodNullable<z.ZodUnknown>;
4683
4890
  discovery_submitted_at: z.ZodNullable<z.ZodString>;
4684
4891
  discovery_submitted_by: z.ZodNullable<z.ZodString>;
4685
4892
  proposal_data: z.ZodNullable<z.ZodUnknown>;
4686
- proposal_status: z.ZodNullable<z.ZodString>;
4687
4893
  proposal_sent_at: z.ZodNullable<z.ZodString>;
4688
4894
  proposal_pdf_url: z.ZodNullable<z.ZodString>;
4689
4895
  signature_envelope_id: z.ZodNullable<z.ZodString>;
@@ -4738,7 +4944,7 @@ declare const DealSchemas: {
4738
4944
  staleDeals: z.ZodArray<z.ZodObject<{
4739
4945
  id: z.ZodString;
4740
4946
  contactEmail: z.ZodString;
4741
- cachedStage: z.ZodString;
4947
+ stageKey: z.ZodString;
4742
4948
  updatedAt: z.ZodString;
4743
4949
  daysStale: z.ZodNumber;
4744
4950
  }, z.core.$strip>>;
@@ -4746,7 +4952,7 @@ declare const DealSchemas: {
4746
4952
  DealLookupResponse: z.ZodArray<z.ZodObject<{
4747
4953
  id: z.ZodString;
4748
4954
  contactEmail: z.ZodString;
4749
- cachedStage: z.ZodNullable<z.ZodString>;
4955
+ stageKey: z.ZodNullable<z.ZodString>;
4750
4956
  updatedAt: z.ZodString;
4751
4957
  contactName: z.ZodNullable<z.ZodString>;
4752
4958
  companyName: z.ZodNullable<z.ZodString>;
@@ -4757,13 +4963,14 @@ declare const DealSchemas: {
4757
4963
  organization_id: z.ZodString;
4758
4964
  contact_id: z.ZodNullable<z.ZodString>;
4759
4965
  contact_email: z.ZodString;
4760
- cached_stage: z.ZodNullable<z.ZodString>;
4966
+ pipeline_key: z.ZodString;
4967
+ stage_key: z.ZodNullable<z.ZodString>;
4968
+ state_key: z.ZodNullable<z.ZodString>;
4761
4969
  activity_log: z.ZodUnknown;
4762
4970
  discovery_data: z.ZodNullable<z.ZodUnknown>;
4763
4971
  discovery_submitted_at: z.ZodNullable<z.ZodString>;
4764
4972
  discovery_submitted_by: z.ZodNullable<z.ZodString>;
4765
4973
  proposal_data: z.ZodNullable<z.ZodUnknown>;
4766
- proposal_status: z.ZodNullable<z.ZodString>;
4767
4974
  proposal_sent_at: z.ZodNullable<z.ZodString>;
4768
4975
  proposal_pdf_url: z.ZodNullable<z.ZodString>;
4769
4976
  signature_envelope_id: z.ZodNullable<z.ZodString>;
@@ -6562,18 +6769,18 @@ declare const ProjectSchemas: {
6562
6769
  CreateProjectRequest: z.ZodObject<{
6563
6770
  name: z.ZodString;
6564
6771
  kind: z.ZodEnum<{
6772
+ internal: "internal";
6565
6773
  other: "other";
6566
6774
  client_engagement: "client_engagement";
6567
- internal: "internal";
6568
6775
  research: "research";
6569
6776
  }>;
6570
6777
  status: z.ZodOptional<z.ZodEnum<{
6571
- completed: "completed";
6572
6778
  active: "active";
6573
- paused: "paused";
6574
6779
  on_track: "on_track";
6575
6780
  at_risk: "at_risk";
6576
6781
  blocked: "blocked";
6782
+ paused: "paused";
6783
+ completed: "completed";
6577
6784
  }>>;
6578
6785
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6579
6786
  deal_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6586,18 +6793,18 @@ declare const ProjectSchemas: {
6586
6793
  UpdateProjectRequest: z.ZodObject<{
6587
6794
  name: z.ZodOptional<z.ZodString>;
6588
6795
  kind: z.ZodOptional<z.ZodEnum<{
6796
+ internal: "internal";
6589
6797
  other: "other";
6590
6798
  client_engagement: "client_engagement";
6591
- internal: "internal";
6592
6799
  research: "research";
6593
6800
  }>>;
6594
6801
  status: z.ZodOptional<z.ZodEnum<{
6595
- completed: "completed";
6596
6802
  active: "active";
6597
- paused: "paused";
6598
6803
  on_track: "on_track";
6599
6804
  at_risk: "at_risk";
6600
6805
  blocked: "blocked";
6806
+ paused: "paused";
6807
+ completed: "completed";
6601
6808
  }>>;
6602
6809
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6603
6810
  deal_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6610,18 +6817,18 @@ declare const ProjectSchemas: {
6610
6817
  }, z.core.$strict>;
6611
6818
  GetProjectsQuery: z.ZodObject<{
6612
6819
  kind: z.ZodOptional<z.ZodEnum<{
6820
+ internal: "internal";
6613
6821
  other: "other";
6614
6822
  client_engagement: "client_engagement";
6615
- internal: "internal";
6616
6823
  research: "research";
6617
6824
  }>>;
6618
6825
  status: z.ZodOptional<z.ZodEnum<{
6619
- completed: "completed";
6620
6826
  active: "active";
6621
- paused: "paused";
6622
6827
  on_track: "on_track";
6623
6828
  at_risk: "at_risk";
6624
6829
  blocked: "blocked";
6830
+ paused: "paused";
6831
+ completed: "completed";
6625
6832
  }>>;
6626
6833
  search: z.ZodOptional<z.ZodString>;
6627
6834
  }, z.core.$strict>;
@@ -6631,11 +6838,11 @@ declare const ProjectSchemas: {
6631
6838
  CreateMilestoneRequest: z.ZodObject<{
6632
6839
  name: z.ZodString;
6633
6840
  status: z.ZodOptional<z.ZodEnum<{
6841
+ blocked: "blocked";
6634
6842
  completed: "completed";
6635
- overdue: "overdue";
6636
6843
  upcoming: "upcoming";
6637
- blocked: "blocked";
6638
6844
  in_progress: "in_progress";
6845
+ overdue: "overdue";
6639
6846
  }>>;
6640
6847
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6641
6848
  due_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6645,11 +6852,11 @@ declare const ProjectSchemas: {
6645
6852
  UpdateMilestoneRequest: z.ZodObject<{
6646
6853
  name: z.ZodOptional<z.ZodString>;
6647
6854
  status: z.ZodOptional<z.ZodEnum<{
6855
+ blocked: "blocked";
6648
6856
  completed: "completed";
6649
- overdue: "overdue";
6650
6857
  upcoming: "upcoming";
6651
- blocked: "blocked";
6652
6858
  in_progress: "in_progress";
6859
+ overdue: "overdue";
6653
6860
  }>>;
6654
6861
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6655
6862
  due_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6673,25 +6880,25 @@ declare const ProjectSchemas: {
6673
6880
  name: z.ZodString;
6674
6881
  type: z.ZodOptional<z.ZodEnum<{
6675
6882
  code: "code";
6883
+ feature: "feature";
6676
6884
  other: "other";
6677
6885
  research: "research";
6678
6886
  documentation: "documentation";
6679
6887
  report: "report";
6680
6888
  design: "design";
6681
6889
  refactor: "refactor";
6682
- feature: "feature";
6683
6890
  bug: "bug";
6684
6891
  }>>;
6685
6892
  status: z.ZodOptional<z.ZodEnum<{
6686
- completed: "completed";
6687
- cancelled: "cancelled";
6688
6893
  blocked: "blocked";
6894
+ completed: "completed";
6689
6895
  in_progress: "in_progress";
6690
6896
  planned: "planned";
6691
6897
  submitted: "submitted";
6692
6898
  approved: "approved";
6693
- rejected: "rejected";
6694
6899
  revision_requested: "revision_requested";
6900
+ rejected: "rejected";
6901
+ cancelled: "cancelled";
6695
6902
  }>>;
6696
6903
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6697
6904
  milestone_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6709,25 +6916,25 @@ declare const ProjectSchemas: {
6709
6916
  name: z.ZodOptional<z.ZodString>;
6710
6917
  type: z.ZodOptional<z.ZodEnum<{
6711
6918
  code: "code";
6919
+ feature: "feature";
6712
6920
  other: "other";
6713
6921
  research: "research";
6714
6922
  documentation: "documentation";
6715
6923
  report: "report";
6716
6924
  design: "design";
6717
6925
  refactor: "refactor";
6718
- feature: "feature";
6719
6926
  bug: "bug";
6720
6927
  }>>;
6721
6928
  status: z.ZodOptional<z.ZodEnum<{
6722
- completed: "completed";
6723
- cancelled: "cancelled";
6724
6929
  blocked: "blocked";
6930
+ completed: "completed";
6725
6931
  in_progress: "in_progress";
6726
6932
  planned: "planned";
6727
6933
  submitted: "submitted";
6728
6934
  approved: "approved";
6729
- rejected: "rejected";
6730
6935
  revision_requested: "revision_requested";
6936
+ rejected: "rejected";
6937
+ cancelled: "cancelled";
6731
6938
  }>>;
6732
6939
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6733
6940
  milestone_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6746,15 +6953,15 @@ declare const ProjectSchemas: {
6746
6953
  MergeResumeContextRequest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6747
6954
  GetTasksQuery: z.ZodObject<{
6748
6955
  status: z.ZodOptional<z.ZodEnum<{
6749
- completed: "completed";
6750
- cancelled: "cancelled";
6751
6956
  blocked: "blocked";
6957
+ completed: "completed";
6752
6958
  in_progress: "in_progress";
6753
6959
  planned: "planned";
6754
6960
  submitted: "submitted";
6755
6961
  approved: "approved";
6756
- rejected: "rejected";
6757
6962
  revision_requested: "revision_requested";
6963
+ rejected: "rejected";
6964
+ cancelled: "cancelled";
6758
6965
  }>>;
6759
6966
  milestone_id: z.ZodOptional<z.ZodString>;
6760
6967
  parent_task_id: z.ZodOptional<z.ZodString>;
@@ -7059,7 +7266,6 @@ type ProjectsToolMap = {
7059
7266
  type CrmRecentActivityParams = Partial<z.infer<typeof CrmSchemas.GetRecentActivityQuery>>;
7060
7267
  type CrmListDealsParams = Partial<z.infer<typeof DealSchemas.ListDealsQuery>>;
7061
7268
  type CrmGetDealParams = z.infer<typeof DealSchemas.DealIdParams>;
7062
- type CrmUpdateDealStageParams = z.infer<typeof DealSchemas.DealIdParams> & z.infer<typeof DealSchemas.SyncDealStageRequest>;
7063
7269
  type CrmGetDealByEmailParams = {
7064
7270
  email: string;
7065
7271
  };
@@ -7085,10 +7291,6 @@ type CrmToolMap = {
7085
7291
  params: CrmGetDealByEmailParams;
7086
7292
  result: DealDetail | null;
7087
7293
  };
7088
- updateDealStage: {
7089
- params: CrmUpdateDealStageParams;
7090
- result: void;
7091
- };
7092
7294
  createDealNote: {
7093
7295
  params: CrmDealNoteParams;
7094
7296
  result: AcqDealNote;
@@ -7565,8 +7767,8 @@ type LeadToolMap = {
7565
7767
  params: Omit<UpdateFeesParams, 'organizationId'>;
7566
7768
  result: void;
7567
7769
  };
7568
- syncDealStage: {
7569
- params: Omit<SyncDealStageParams, 'organizationId'>;
7770
+ transitionItem: {
7771
+ params: Omit<TransitionItemParams, 'organizationId'>;
7570
7772
  result: void;
7571
7773
  };
7572
7774
  setContactNurture: {
@@ -8089,8 +8291,10 @@ interface ResourceDefinition {
8089
8291
  type: ResourceType;
8090
8292
  /** Environment/deployment status */
8091
8293
  status: ResourceStatus$1;
8092
- /** Domain tags for filtering and organization */
8093
- domains?: ResourceDomain[];
8294
+ /** Graph links to Organization Model nodes */
8295
+ links?: ResourceLink[];
8296
+ /** Infrastructure category for filtering */
8297
+ category?: ResourceCategory;
8094
8298
  /** Whether the agent supports multi-turn sessions (agents only) */
8095
8299
  sessionCapable?: boolean;
8096
8300
  /** Whether the resource is local (monorepo) or remote (externally deployed) */
@@ -8098,33 +8302,6 @@ interface ResourceDefinition {
8098
8302
  /** Whether this resource is archived and should be excluded from registration and deployment */
8099
8303
  archived?: boolean;
8100
8304
  }
8101
- /**
8102
- * Domain definition for Command View filtering
8103
- *
8104
- * Domains are organizational metadata for UI filtering/grouping.
8105
- * No execution impact - purely for visualization.
8106
- *
8107
- * @example
8108
- * {
8109
- * id: 'support',
8110
- * name: 'Customer Support',
8111
- * description: 'Ticket triage, knowledge base, escalations',
8112
- * color: 'green',
8113
- * icon: 'IconHeadset'
8114
- * }
8115
- */
8116
- interface DomainDefinition {
8117
- /** Unique identifier (e.g., 'support') */
8118
- id: string;
8119
- /** Display name (e.g., 'Customer Support') */
8120
- name: string;
8121
- /** Purpose description */
8122
- description: string;
8123
- /** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
8124
- color?: string;
8125
- /** Optional Tabler icon name (e.g., 'IconHeadset') */
8126
- icon?: string;
8127
- }
8128
8305
  /**
8129
8306
  * Resource list for organization
8130
8307
  * Returns ResourceDefinition metadata (not full definitions)
@@ -8172,7 +8349,7 @@ type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTrigger
8172
8349
  * scheduled cron jobs, platform events, or manual user actions.
8173
8350
  *
8174
8351
  * BREAKING CHANGES (2025-11-30):
8175
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
8352
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
8176
8353
  * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
8177
8354
  * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
8178
8355
  * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
@@ -8217,7 +8394,7 @@ interface TriggerDefinition extends ResourceDefinition {
8217
8394
  * stored here (queried at runtime from credentials table).
8218
8395
  *
8219
8396
  * BREAKING CHANGES (2025-11-30):
8220
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
8397
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
8221
8398
  * - Field renames: `id` -> `resourceId` (inherited)
8222
8399
  * - New required field: `status` (inherited) - organizations must add status to all integrations
8223
8400
  * - New required field: `version` (inherited) - organizations must add version to all integrations
@@ -8297,7 +8474,7 @@ type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other';
8297
8474
  * no API integration with external platforms, no status syncing.
8298
8475
  *
8299
8476
  * BREAKING CHANGES (2025-11-30):
8300
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
8477
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
8301
8478
  * - Field renames: `id` -> `resourceId` (inherited)
8302
8479
  * - New required field: `version` (inherited) - organizations must add version to all external resources
8303
8480
  * - New required field: `type: 'external'` (inherited) - resource type discriminator
@@ -8346,7 +8523,7 @@ interface ExternalResourceDefinition extends ResourceDefinition {
8346
8523
  * Tasks with matching command_queue_group are routed to this checkpoint.
8347
8524
  *
8348
8525
  * BREAKING CHANGES (2025-11-30):
8349
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
8526
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
8350
8527
  * - Field renames: `id` -> `resourceId` (inherited)
8351
8528
  * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
8352
8529
  * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
@@ -8384,31 +8561,93 @@ interface HumanCheckpointDefinition extends ResourceDefinition {
8384
8561
  }
8385
8562
 
8386
8563
  /**
8387
- * Standard Domain Definitions
8388
- * Centralized domain constants and definitions for all organization resources.
8564
+ * Command View Types
8565
+ *
8566
+ * Unified type definitions for the Command View graph visualization.
8567
+ * These types are used by both backend serialization and frontend rendering.
8568
+ *
8569
+ * Command View shows the resource graph: agents, workflows, triggers, integrations,
8570
+ * external resources, and human checkpoints with their relationships.
8389
8571
  */
8390
8572
 
8391
- declare const DOMAINS: {
8392
- readonly INBOUND_PIPELINE: "inbound-pipeline";
8393
- readonly LEAD_GEN_PIPELINE: "lead-gen-pipeline";
8394
- readonly SUPPORT: "support";
8395
- readonly CLIENT_SUPPORT: "client-support";
8396
- readonly DELIVERY: "delivery";
8397
- readonly OPERATIONS: "operations";
8398
- readonly FINANCE: "finance";
8399
- readonly EXECUTIVE: "executive";
8400
- readonly INSTANTLY: "instantly";
8401
- readonly TESTING: "testing";
8402
- readonly INTERNAL: "internal";
8403
- readonly INTEGRATION: "integration";
8404
- readonly UTILITY: "utility";
8405
- readonly DIAGNOSTIC: "diagnostic";
8406
- };
8407
8573
  /**
8408
- * ResourceDomain - Strongly typed domain identifier
8409
- * Use this type for all domain references to ensure compile-time validation.
8574
+ * Extended agent metadata for Command View
8575
+ * Includes model and capability information for graph display
8576
+ */
8577
+ interface CommandViewAgent extends ResourceDefinition {
8578
+ type: 'agent';
8579
+ modelProvider: string;
8580
+ modelId: string;
8581
+ toolCount: number;
8582
+ hasKnowledgeMap: boolean;
8583
+ hasMemory: boolean;
8584
+ sessionCapable: boolean;
8585
+ }
8586
+ /**
8587
+ * Extended workflow metadata for Command View
8588
+ * Includes step information for graph display
8589
+ */
8590
+ interface CommandViewWorkflow extends ResourceDefinition {
8591
+ type: 'workflow';
8592
+ stepCount: number;
8593
+ entryPoint: string;
8594
+ }
8595
+ /**
8596
+ * Relationship types between resources
8597
+ *
8598
+ * - triggers: Resource initiates/starts another resource (orange)
8599
+ * - uses: Resource uses an integration (teal)
8600
+ * - approval: Resource requires human approval (yellow)
8410
8601
  */
8411
- type ResourceDomain = (typeof DOMAINS)[keyof typeof DOMAINS];
8602
+ type RelationshipType = 'triggers' | 'uses' | 'approval';
8603
+ /**
8604
+ * Command View edge (relationship between resources)
8605
+ */
8606
+ interface CommandViewEdge {
8607
+ id: string;
8608
+ source: string;
8609
+ target: string;
8610
+ relationship: RelationshipType;
8611
+ label?: string;
8612
+ }
8613
+ /**
8614
+ * Command View data structure
8615
+ * Complete graph data for visualization
8616
+ *
8617
+ * Backend serializes this once at startup and serves it via /command-view endpoint.
8618
+ * Frontend consumes this directly for graph rendering.
8619
+ */
8620
+ interface CommandViewData {
8621
+ workflows: CommandViewWorkflow[];
8622
+ agents: CommandViewAgent[];
8623
+ triggers: TriggerDefinition[];
8624
+ integrations: IntegrationDefinition[];
8625
+ externalResources: ExternalResourceDefinition[];
8626
+ humanCheckpoints: HumanCheckpointDefinition[];
8627
+ edges: CommandViewEdge[];
8628
+ }
8629
+
8630
+ declare const LinkSchema: z.ZodObject<{
8631
+ nodeId: z.ZodString;
8632
+ kind: z.ZodEnum<{
8633
+ contains: "contains";
8634
+ references: "references";
8635
+ exposes: "exposes";
8636
+ maps_to: "maps_to";
8637
+ "operates-on": "operates-on";
8638
+ uses: "uses";
8639
+ }>;
8640
+ }, z.core.$strip>;
8641
+ type Link = z.infer<typeof LinkSchema>;
8642
+
8643
+ declare const ResourceCategorySchema: z.ZodEnum<{
8644
+ production: "production";
8645
+ diagnostic: "diagnostic";
8646
+ internal: "internal";
8647
+ testing: "testing";
8648
+ }>;
8649
+ type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
8650
+ type ResourceLink = Link;
8412
8651
 
8413
8652
  /**
8414
8653
  * ResourceRegistry - Resource discovery and lookup
@@ -8441,6 +8680,19 @@ interface RemoteOrgConfig {
8441
8680
  /** Deployment version (semver) of the deployed bundle */
8442
8681
  deploymentVersion?: string;
8443
8682
  }
8683
+ /**
8684
+ * Configuration for a first-class System resource.
8685
+ *
8686
+ * System resources are owned by the platform, registered under the 'system' org,
8687
+ * and execute via the static-bundle loader mode in executeInWorker(). The moduleId
8688
+ * maps to an entry in the API's STATIC_MODULE_MAP.
8689
+ */
8690
+ interface SystemConfig {
8691
+ kind: 'static';
8692
+ moduleId: string;
8693
+ /** Always undefined for system resources; present for API compatibility with RemoteOrgConfig consumers */
8694
+ sdkVersion?: never;
8695
+ }
8444
8696
  /**
8445
8697
  * Organization-specific resource collection
8446
8698
  *
@@ -8483,6 +8735,12 @@ declare class ResourceRegistry {
8483
8735
  * Static and remote resources coexist in the same org.
8484
8736
  */
8485
8737
  private remoteResources;
8738
+ /**
8739
+ * System configs for first-class platform resources.
8740
+ * Key: "orgName/resourceId", Value: SystemConfig.
8741
+ * Registered at startup alongside registerStaticResources().
8742
+ */
8743
+ private systemConfigs;
8486
8744
  constructor(registry: OrganizationRegistry);
8487
8745
  /**
8488
8746
  * Validates registry on construction
@@ -8602,17 +8860,29 @@ declare class ResourceRegistry {
8602
8860
  */
8603
8861
  unregisterOrganization(orgName: string): void;
8604
8862
  /**
8605
- * Get remote configuration for a specific resource
8863
+ * Get remote configuration for a specific resource.
8606
8864
  *
8607
- * Returns the RemoteOrgConfig if the resource was registered at runtime,
8608
- * or null if it's a static resource or doesn't exist.
8609
- * Used by the execution coordinator to branch between local and worker execution.
8865
+ * Returns RemoteOrgConfig for externally-deployed resources, SystemConfig for
8866
+ * first-class platform resources, or null for static in-process resources.
8867
+ * Used by the execution coordinator to determine the execution path.
8610
8868
  *
8611
8869
  * @param orgName - Organization name
8612
8870
  * @param resourceId - Resource ID
8613
- * @returns Remote config or null
8871
+ * @returns Remote or System config, or null
8872
+ */
8873
+ getRemoteConfig(orgName: string, resourceId: string): RemoteOrgConfig | SystemConfig | null;
8874
+ /**
8875
+ * Register a System config for a first-class platform resource.
8876
+ *
8877
+ * Called at startup alongside registerStaticResources() so that
8878
+ * getRemoteConfig('system', resourceId) returns truthy and the execution
8879
+ * coordinator routes the resource through the worker-thread path.
8880
+ *
8881
+ * @param orgName - Organization name (typically 'system')
8882
+ * @param resourceId - Resource ID
8883
+ * @param config - SystemConfig with kind:'static' and moduleId
8614
8884
  */
8615
- getRemoteConfig(orgName: string, resourceId: string): RemoteOrgConfig | null;
8885
+ registerSystemConfig(orgName: string, resourceId: string, config: SystemConfig): void;
8616
8886
  /**
8617
8887
  * Check if an organization has any remote (externally deployed) resources
8618
8888
  *
@@ -8763,7 +9033,7 @@ declare class RegistryValidationError extends Error {
8763
9033
  * Typed wrapper over platform.call() for LLM generation.
8764
9034
  * Singleton export -- no credential needed (platform tool).
8765
9035
  *
8766
- * Types are shared with the server-side LLM engine via @repo/core/execution.
9036
+ * Types are shared with the server-side LLM engine and inlined for SDK consumers.
8767
9037
  */
8768
9038
 
8769
9039
  type LLMProvider = 'openai' | 'anthropic' | 'openrouter' | 'google';
@@ -8821,5 +9091,5 @@ declare class ToolingError extends ExecutionError {
8821
9091
  constructor(errorType: string, message: string, details?: unknown);
8822
9092
  }
8823
9093
 
8824
- export { ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError };
8825
- export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqList, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmToolMap, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DomainDefinition, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, PaginatedResult, PaginationParams, PdfToolMap, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceDefinition, ResourceDomain, ResourceMetricsConfig, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SyncDealStageParams, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowDefinition, WorkflowStep, WriteSheetParams, WriteSheetResult };
9094
+ export { ActivityEventSchema, ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
9095
+ export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action, ActivityEvent, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmToolMap, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, PaginatedResult, PaginationParams, PdfToolMap, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceCategory, ResourceDefinition, ResourceLink, ResourceMetricsConfig, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TransitionItemParams, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowDefinition, WorkflowStep, WriteSheetParams, WriteSheetResult };