@elevasis/sdk 1.45.0 → 1.47.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 +36454 -31490
  2. package/dist/index.d.ts +964 -358
  3. package/dist/index.js +59 -59
  4. package/dist/node/index.d.ts +0 -84
  5. package/dist/node/index.js +2 -2
  6. package/dist/test-utils/index.d.ts +993 -301
  7. package/dist/test-utils/index.js +177 -134
  8. package/dist/worker/index.d.ts +1043 -277
  9. package/dist/worker/index.js +74 -35
  10. package/package.json +2 -2
  11. package/reference/_navigation.md +12 -3
  12. package/reference/_reference-manifest.json +42 -0
  13. package/reference/core/exports.mdx +2 -0
  14. package/reference/packages/core/src/business/README.md +4 -1
  15. package/reference/packages/core/src/content/README.md +24 -0
  16. package/reference/packages/core/src/organization-model/README.md +148 -149
  17. package/reference/packages/core/src/organization-model/readiness/README.md +42 -0
  18. package/reference/packages/ui/src/features/README.md +28 -28
  19. package/reference/rules/shared-types.md +21 -0
  20. package/reference/scaffold/core/organization-graph.mdx +2 -3
  21. package/reference/scaffold/core/organization-model.mdx +2 -6
  22. package/reference/scaffold/operations/propagation-pipeline.md +15 -16
  23. package/reference/scaffold/operations/scaffold-maintenance.md +3 -2
  24. package/reference/scaffold/operations/workflow-recipes.md +2 -2
  25. package/reference/scaffold/recipes/customize-crm-actions.md +5 -5
  26. package/reference/scaffold/recipes/extend-content.md +301 -0
  27. package/reference/scaffold/recipes/extend-lead-gen.md +14 -16
  28. package/reference/scaffold/recipes/index.md +4 -1
  29. package/reference/scaffold/reference/contracts.md +18 -55
  30. package/reference/scaffold/reference/feature-registry.md +3 -0
  31. package/reference/scaffold/reference/glossary.md +1 -1
  32. package/reference/scaffold/ui/customization.md +2 -2
  33. package/reference/scaffold/ui/feature-shell.mdx +1 -3
  34. package/reference/sdk/cli-management.mdx +199 -30
  35. package/reference/sdk/cli.mdx +90 -13
  36. package/reference/sdk/framework/agent.mdx +6 -0
  37. package/reference/sdk/platform-tools/adapters-platform.mdx +3 -1
  38. package/reference/sdk/platform-tools/index.mdx +0 -2
  39. package/reference/sdk/resources/patterns.mdx +14 -6
  40. package/reference/ui/exports.mdx +1 -0
@@ -1448,53 +1448,6 @@ type Json = string | number | boolean | null | {
1448
1448
  type Database = {
1449
1449
  public: {
1450
1450
  Tables: {
1451
- acq_artifacts: {
1452
- Row: {
1453
- content: Json;
1454
- created_at: string;
1455
- created_by: string | null;
1456
- id: string;
1457
- kind: string;
1458
- organization_id: string;
1459
- owner_id: string;
1460
- owner_kind: string;
1461
- source_execution_id: string | null;
1462
- version: number;
1463
- };
1464
- Insert: {
1465
- content: Json;
1466
- created_at?: string;
1467
- created_by?: string | null;
1468
- id?: string;
1469
- kind: string;
1470
- organization_id: string;
1471
- owner_id: string;
1472
- owner_kind: string;
1473
- source_execution_id?: string | null;
1474
- version?: number;
1475
- };
1476
- Update: {
1477
- content?: Json;
1478
- created_at?: string;
1479
- created_by?: string | null;
1480
- id?: string;
1481
- kind?: string;
1482
- organization_id?: string;
1483
- owner_id?: string;
1484
- owner_kind?: string;
1485
- source_execution_id?: string | null;
1486
- version?: number;
1487
- };
1488
- Relationships: [
1489
- {
1490
- foreignKeyName: "acq_artifacts_organization_id_fkey";
1491
- columns: ["organization_id"];
1492
- isOneToOne: false;
1493
- referencedRelation: "organizations";
1494
- referencedColumns: ["id"];
1495
- }
1496
- ];
1497
- };
1498
1451
  acq_companies: {
1499
1452
  Row: {
1500
1453
  batch_id: string | null;
@@ -1706,122 +1659,6 @@ type Database = {
1706
1659
  }
1707
1660
  ];
1708
1661
  };
1709
- acq_content: {
1710
- Row: {
1711
- body: string | null;
1712
- created_at: string;
1713
- id: string;
1714
- organization_id: string;
1715
- pillar: string;
1716
- status: string;
1717
- title: string;
1718
- updated_at: string;
1719
- };
1720
- Insert: {
1721
- body?: string | null;
1722
- created_at?: string;
1723
- id?: string;
1724
- organization_id: string;
1725
- pillar: string;
1726
- status?: string;
1727
- title: string;
1728
- updated_at?: string;
1729
- };
1730
- Update: {
1731
- body?: string | null;
1732
- created_at?: string;
1733
- id?: string;
1734
- organization_id?: string;
1735
- pillar?: string;
1736
- status?: string;
1737
- title?: string;
1738
- updated_at?: string;
1739
- };
1740
- Relationships: [
1741
- {
1742
- foreignKeyName: "acq_content_organization_id_fkey";
1743
- columns: ["organization_id"];
1744
- isOneToOne: false;
1745
- referencedRelation: "organizations";
1746
- referencedColumns: ["id"];
1747
- }
1748
- ];
1749
- };
1750
- acq_content_distributions: {
1751
- Row: {
1752
- adapted_body: string | null;
1753
- checklist: Json | null;
1754
- content_id: string;
1755
- created_at: string;
1756
- format: string;
1757
- id: string;
1758
- media_urls: Json;
1759
- metrics: Json;
1760
- metrics_updated_at: string | null;
1761
- organization_id: string;
1762
- platform: string;
1763
- platform_content: Json | null;
1764
- platform_post_id: string | null;
1765
- platform_url: string | null;
1766
- published_at: string | null;
1767
- status: string;
1768
- updated_at: string;
1769
- };
1770
- Insert: {
1771
- adapted_body?: string | null;
1772
- checklist?: Json | null;
1773
- content_id: string;
1774
- created_at?: string;
1775
- format: string;
1776
- id?: string;
1777
- media_urls?: Json;
1778
- metrics?: Json;
1779
- metrics_updated_at?: string | null;
1780
- organization_id: string;
1781
- platform: string;
1782
- platform_content?: Json | null;
1783
- platform_post_id?: string | null;
1784
- platform_url?: string | null;
1785
- published_at?: string | null;
1786
- status?: string;
1787
- updated_at?: string;
1788
- };
1789
- Update: {
1790
- adapted_body?: string | null;
1791
- checklist?: Json | null;
1792
- content_id?: string;
1793
- created_at?: string;
1794
- format?: string;
1795
- id?: string;
1796
- media_urls?: Json;
1797
- metrics?: Json;
1798
- metrics_updated_at?: string | null;
1799
- organization_id?: string;
1800
- platform?: string;
1801
- platform_content?: Json | null;
1802
- platform_post_id?: string | null;
1803
- platform_url?: string | null;
1804
- published_at?: string | null;
1805
- status?: string;
1806
- updated_at?: string;
1807
- };
1808
- Relationships: [
1809
- {
1810
- foreignKeyName: "acq_content_distributions_content_id_fkey";
1811
- columns: ["content_id"];
1812
- isOneToOne: false;
1813
- referencedRelation: "acq_content";
1814
- referencedColumns: ["id"];
1815
- },
1816
- {
1817
- foreignKeyName: "acq_content_distributions_organization_id_fkey";
1818
- columns: ["organization_id"];
1819
- isOneToOne: false;
1820
- referencedRelation: "organizations";
1821
- referencedColumns: ["id"];
1822
- }
1823
- ];
1824
- };
1825
1662
  acq_deal_notes: {
1826
1663
  Row: {
1827
1664
  author_user_id: string | null;
@@ -1851,6 +1688,13 @@ type Database = {
1851
1688
  updated_at?: string;
1852
1689
  };
1853
1690
  Relationships: [
1691
+ {
1692
+ foreignKeyName: "acq_deal_notes_author_user_id_fkey";
1693
+ columns: ["author_user_id"];
1694
+ isOneToOne: false;
1695
+ referencedRelation: "users";
1696
+ referencedColumns: ["id"];
1697
+ },
1854
1698
  {
1855
1699
  foreignKeyName: "acq_deal_notes_deal_id_fkey";
1856
1700
  columns: ["deal_id"];
@@ -1914,6 +1758,27 @@ type Database = {
1914
1758
  updated_at?: string;
1915
1759
  };
1916
1760
  Relationships: [
1761
+ {
1762
+ foreignKeyName: "acq_deal_tasks_assignee_user_id_fkey";
1763
+ columns: ["assignee_user_id"];
1764
+ isOneToOne: false;
1765
+ referencedRelation: "users";
1766
+ referencedColumns: ["id"];
1767
+ },
1768
+ {
1769
+ foreignKeyName: "acq_deal_tasks_completed_by_user_id_fkey";
1770
+ columns: ["completed_by_user_id"];
1771
+ isOneToOne: false;
1772
+ referencedRelation: "users";
1773
+ referencedColumns: ["id"];
1774
+ },
1775
+ {
1776
+ foreignKeyName: "acq_deal_tasks_created_by_user_id_fkey";
1777
+ columns: ["created_by_user_id"];
1778
+ isOneToOne: false;
1779
+ referencedRelation: "users";
1780
+ referencedColumns: ["id"];
1781
+ },
1917
1782
  {
1918
1783
  foreignKeyName: "acq_deal_tasks_deal_id_fkey";
1919
1784
  columns: ["deal_id"];
@@ -2070,6 +1935,13 @@ type Database = {
2070
1935
  referencedRelation: "acq_contacts";
2071
1936
  referencedColumns: ["id"];
2072
1937
  },
1938
+ {
1939
+ foreignKeyName: "acq_deals_discovery_submitted_by_fkey";
1940
+ columns: ["discovery_submitted_by"];
1941
+ isOneToOne: false;
1942
+ referencedRelation: "users";
1943
+ referencedColumns: ["id"];
1944
+ },
2073
1945
  {
2074
1946
  foreignKeyName: "acq_deals_organization_id_fkey";
2075
1947
  columns: ["organization_id"];
@@ -2077,6 +1949,13 @@ type Database = {
2077
1949
  referencedRelation: "organizations";
2078
1950
  referencedColumns: ["id"];
2079
1951
  },
1952
+ {
1953
+ foreignKeyName: "acq_deals_proposal_reviewed_by_fkey";
1954
+ columns: ["proposal_reviewed_by"];
1955
+ isOneToOne: false;
1956
+ referencedRelation: "users";
1957
+ referencedColumns: ["id"];
1958
+ },
2080
1959
  {
2081
1960
  foreignKeyName: "acq_deals_source_list_id_fkey";
2082
1961
  columns: ["source_list_id"];
@@ -2130,6 +2009,13 @@ type Database = {
2130
2009
  state_key?: string;
2131
2010
  };
2132
2011
  Relationships: [
2012
+ {
2013
+ foreignKeyName: "acq_list_companies_added_by_fkey";
2014
+ columns: ["added_by"];
2015
+ isOneToOne: false;
2016
+ referencedRelation: "users";
2017
+ referencedColumns: ["id"];
2018
+ },
2133
2019
  {
2134
2020
  foreignKeyName: "acq_list_companies_company_id_fkey";
2135
2021
  columns: ["company_id"];
@@ -2236,6 +2122,13 @@ type Database = {
2236
2122
  state_key?: string;
2237
2123
  };
2238
2124
  Relationships: [
2125
+ {
2126
+ foreignKeyName: "acq_list_members_added_by_fkey";
2127
+ columns: ["added_by"];
2128
+ isOneToOne: false;
2129
+ referencedRelation: "users";
2130
+ referencedColumns: ["id"];
2131
+ },
2239
2132
  {
2240
2133
  foreignKeyName: "acq_list_members_contact_id_fkey";
2241
2134
  columns: ["contact_id"];
@@ -2589,6 +2482,7 @@ type Database = {
2589
2482
  activities: {
2590
2483
  Row: {
2591
2484
  activity_type: string;
2485
+ actor_api_key_id: string | null;
2592
2486
  actor_id: string | null;
2593
2487
  actor_type: string | null;
2594
2488
  created_at: string;
@@ -2605,6 +2499,7 @@ type Database = {
2605
2499
  };
2606
2500
  Insert: {
2607
2501
  activity_type: string;
2502
+ actor_api_key_id?: string | null;
2608
2503
  actor_id?: string | null;
2609
2504
  actor_type?: string | null;
2610
2505
  created_at?: string;
@@ -2621,6 +2516,7 @@ type Database = {
2621
2516
  };
2622
2517
  Update: {
2623
2518
  activity_type?: string;
2519
+ actor_api_key_id?: string | null;
2624
2520
  actor_id?: string | null;
2625
2521
  actor_type?: string | null;
2626
2522
  created_at?: string;
@@ -2636,6 +2532,20 @@ type Database = {
2636
2532
  title?: string;
2637
2533
  };
2638
2534
  Relationships: [
2535
+ {
2536
+ foreignKeyName: "activities_actor_api_key_id_fkey";
2537
+ columns: ["actor_api_key_id"];
2538
+ isOneToOne: false;
2539
+ referencedRelation: "api_keys";
2540
+ referencedColumns: ["id"];
2541
+ },
2542
+ {
2543
+ foreignKeyName: "activities_actor_id_fkey";
2544
+ columns: ["actor_id"];
2545
+ isOneToOne: false;
2546
+ referencedRelation: "users";
2547
+ referencedColumns: ["id"];
2548
+ },
2639
2549
  {
2640
2550
  foreignKeyName: "activities_organization_id_fkey";
2641
2551
  columns: ["organization_id"];
@@ -2716,6 +2626,7 @@ type Database = {
2716
2626
  api_keys: {
2717
2627
  Row: {
2718
2628
  created_at: string | null;
2629
+ created_by: string | null;
2719
2630
  id: string;
2720
2631
  key_hash: string;
2721
2632
  last_used_at: string | null;
@@ -2724,6 +2635,7 @@ type Database = {
2724
2635
  };
2725
2636
  Insert: {
2726
2637
  created_at?: string | null;
2638
+ created_by?: string | null;
2727
2639
  id?: string;
2728
2640
  key_hash: string;
2729
2641
  last_used_at?: string | null;
@@ -2732,6 +2644,7 @@ type Database = {
2732
2644
  };
2733
2645
  Update: {
2734
2646
  created_at?: string | null;
2647
+ created_by?: string | null;
2735
2648
  id?: string;
2736
2649
  key_hash?: string;
2737
2650
  last_used_at?: string | null;
@@ -2739,6 +2652,13 @@ type Database = {
2739
2652
  organization_id?: string;
2740
2653
  };
2741
2654
  Relationships: [
2655
+ {
2656
+ foreignKeyName: "api_keys_created_by_fkey";
2657
+ columns: ["created_by"];
2658
+ isOneToOne: false;
2659
+ referencedRelation: "users";
2660
+ referencedColumns: ["id"];
2661
+ },
2742
2662
  {
2743
2663
  foreignKeyName: "api_keys_organization_id_fkey";
2744
2664
  columns: ["organization_id"];
@@ -2748,6 +2668,62 @@ type Database = {
2748
2668
  }
2749
2669
  ];
2750
2670
  };
2671
+ artifacts: {
2672
+ Row: {
2673
+ content: Json;
2674
+ created_at: string;
2675
+ created_by: string | null;
2676
+ id: string;
2677
+ is_active: boolean;
2678
+ kind: string;
2679
+ organization_id: string;
2680
+ owner_id: string | null;
2681
+ owner_kind: string;
2682
+ pipeline_id: string | null;
2683
+ source_execution_id: string | null;
2684
+ updated_at: string;
2685
+ version: number;
2686
+ };
2687
+ Insert: {
2688
+ content: Json;
2689
+ created_at?: string;
2690
+ created_by?: string | null;
2691
+ id?: string;
2692
+ is_active?: boolean;
2693
+ kind: string;
2694
+ organization_id: string;
2695
+ owner_id?: string | null;
2696
+ owner_kind: string;
2697
+ pipeline_id?: string | null;
2698
+ source_execution_id?: string | null;
2699
+ updated_at?: string;
2700
+ version?: number;
2701
+ };
2702
+ Update: {
2703
+ content?: Json;
2704
+ created_at?: string;
2705
+ created_by?: string | null;
2706
+ id?: string;
2707
+ is_active?: boolean;
2708
+ kind?: string;
2709
+ organization_id?: string;
2710
+ owner_id?: string | null;
2711
+ owner_kind?: string;
2712
+ pipeline_id?: string | null;
2713
+ source_execution_id?: string | null;
2714
+ updated_at?: string;
2715
+ version?: number;
2716
+ };
2717
+ Relationships: [
2718
+ {
2719
+ foreignKeyName: "artifacts_organization_id_fkey";
2720
+ columns: ["organization_id"];
2721
+ isOneToOne: false;
2722
+ referencedRelation: "organizations";
2723
+ referencedColumns: ["id"];
2724
+ }
2725
+ ];
2726
+ };
2751
2727
  clients: {
2752
2728
  Row: {
2753
2729
  converted_at: string | null;
@@ -2848,74 +2824,385 @@ type Database = {
2848
2824
  target_resource_type: string | null;
2849
2825
  };
2850
2826
  Insert: {
2851
- action_payload?: Json | null;
2852
- actions: Json;
2853
- completed_at?: string | null;
2854
- completed_by?: string | null;
2855
- context: Json;
2827
+ action_payload?: Json | null;
2828
+ actions: Json;
2829
+ completed_at?: string | null;
2830
+ completed_by?: string | null;
2831
+ context: Json;
2832
+ created_at?: string;
2833
+ description?: string | null;
2834
+ expires_at?: string | null;
2835
+ human_checkpoint?: string | null;
2836
+ id?: string;
2837
+ idempotency_key?: string | null;
2838
+ metadata?: Json | null;
2839
+ organization_id: string;
2840
+ origin_execution_id: string;
2841
+ origin_resource_id: string;
2842
+ origin_resource_type: string;
2843
+ priority?: number;
2844
+ selected_action?: string | null;
2845
+ status?: string;
2846
+ target_execution_id?: string | null;
2847
+ target_resource_id?: string | null;
2848
+ target_resource_type?: string | null;
2849
+ };
2850
+ Update: {
2851
+ action_payload?: Json | null;
2852
+ actions?: Json;
2853
+ completed_at?: string | null;
2854
+ completed_by?: string | null;
2855
+ context?: Json;
2856
+ created_at?: string;
2857
+ description?: string | null;
2858
+ expires_at?: string | null;
2859
+ human_checkpoint?: string | null;
2860
+ id?: string;
2861
+ idempotency_key?: string | null;
2862
+ metadata?: Json | null;
2863
+ organization_id?: string;
2864
+ origin_execution_id?: string;
2865
+ origin_resource_id?: string;
2866
+ origin_resource_type?: string;
2867
+ priority?: number;
2868
+ selected_action?: string | null;
2869
+ status?: string;
2870
+ target_execution_id?: string | null;
2871
+ target_resource_id?: string | null;
2872
+ target_resource_type?: string | null;
2873
+ };
2874
+ Relationships: [
2875
+ {
2876
+ foreignKeyName: "command_queue_completed_by_fkey";
2877
+ columns: ["completed_by"];
2878
+ isOneToOne: false;
2879
+ referencedRelation: "users";
2880
+ referencedColumns: ["id"];
2881
+ },
2882
+ {
2883
+ foreignKeyName: "command_queue_organization_id_fkey";
2884
+ columns: ["organization_id"];
2885
+ isOneToOne: false;
2886
+ referencedRelation: "organizations";
2887
+ referencedColumns: ["id"];
2888
+ },
2889
+ {
2890
+ foreignKeyName: "command_queue_target_execution_id_fkey";
2891
+ columns: ["target_execution_id"];
2892
+ isOneToOne: false;
2893
+ referencedRelation: "execution_logs";
2894
+ referencedColumns: ["execution_id"];
2895
+ }
2896
+ ];
2897
+ };
2898
+ content_distributions: {
2899
+ Row: {
2900
+ adapted_body: string | null;
2901
+ checklist: Json | null;
2902
+ content_item_id: string;
2903
+ created_at: string;
2904
+ format: string;
2905
+ id: string;
2906
+ media_urls: Json;
2907
+ metrics: Json;
2908
+ metrics_updated_at: string | null;
2909
+ organization_id: string;
2910
+ platform: string;
2911
+ platform_content: Json | null;
2912
+ platform_post_id: string | null;
2913
+ platform_url: string | null;
2914
+ processing_state: Json;
2915
+ publish_method: string | null;
2916
+ published_at: string | null;
2917
+ status: string;
2918
+ updated_at: string;
2919
+ };
2920
+ Insert: {
2921
+ adapted_body?: string | null;
2922
+ checklist?: Json | null;
2923
+ content_item_id: string;
2924
+ created_at?: string;
2925
+ format: string;
2926
+ id?: string;
2927
+ media_urls?: Json;
2928
+ metrics?: Json;
2929
+ metrics_updated_at?: string | null;
2930
+ organization_id: string;
2931
+ platform: string;
2932
+ platform_content?: Json | null;
2933
+ platform_post_id?: string | null;
2934
+ platform_url?: string | null;
2935
+ processing_state?: Json;
2936
+ publish_method?: string | null;
2937
+ published_at?: string | null;
2938
+ status?: string;
2939
+ updated_at?: string;
2940
+ };
2941
+ Update: {
2942
+ adapted_body?: string | null;
2943
+ checklist?: Json | null;
2944
+ content_item_id?: string;
2945
+ created_at?: string;
2946
+ format?: string;
2947
+ id?: string;
2948
+ media_urls?: Json;
2949
+ metrics?: Json;
2950
+ metrics_updated_at?: string | null;
2951
+ organization_id?: string;
2952
+ platform?: string;
2953
+ platform_content?: Json | null;
2954
+ platform_post_id?: string | null;
2955
+ platform_url?: string | null;
2956
+ processing_state?: Json;
2957
+ publish_method?: string | null;
2958
+ published_at?: string | null;
2959
+ status?: string;
2960
+ updated_at?: string;
2961
+ };
2962
+ Relationships: [
2963
+ {
2964
+ foreignKeyName: "content_distributions_content_item_id_fkey";
2965
+ columns: ["content_item_id"];
2966
+ isOneToOne: false;
2967
+ referencedRelation: "content_items";
2968
+ referencedColumns: ["id"];
2969
+ },
2970
+ {
2971
+ foreignKeyName: "content_distributions_organization_id_fkey";
2972
+ columns: ["organization_id"];
2973
+ isOneToOne: false;
2974
+ referencedRelation: "organizations";
2975
+ referencedColumns: ["id"];
2976
+ }
2977
+ ];
2978
+ };
2979
+ content_item_attempts: {
2980
+ Row: {
2981
+ attempt_number: number;
2982
+ content_item_id: string;
2983
+ created_at: string;
2984
+ created_by: string | null;
2985
+ id: string;
2986
+ organization_id: string;
2987
+ payload: Json;
2988
+ source_execution_id: string | null;
2989
+ status: string;
2990
+ step_key: string | null;
2991
+ };
2992
+ Insert: {
2993
+ attempt_number: number;
2994
+ content_item_id: string;
2995
+ created_at?: string;
2996
+ created_by?: string | null;
2997
+ id?: string;
2998
+ organization_id: string;
2999
+ payload?: Json;
3000
+ source_execution_id?: string | null;
3001
+ status: string;
3002
+ step_key?: string | null;
3003
+ };
3004
+ Update: {
3005
+ attempt_number?: number;
3006
+ content_item_id?: string;
3007
+ created_at?: string;
3008
+ created_by?: string | null;
3009
+ id?: string;
3010
+ organization_id?: string;
3011
+ payload?: Json;
3012
+ source_execution_id?: string | null;
3013
+ status?: string;
3014
+ step_key?: string | null;
3015
+ };
3016
+ Relationships: [
3017
+ {
3018
+ foreignKeyName: "content_item_attempts_content_item_id_fkey";
3019
+ columns: ["content_item_id"];
3020
+ isOneToOne: false;
3021
+ referencedRelation: "content_items";
3022
+ referencedColumns: ["id"];
3023
+ },
3024
+ {
3025
+ foreignKeyName: "content_item_attempts_created_by_fkey";
3026
+ columns: ["created_by"];
3027
+ isOneToOne: false;
3028
+ referencedRelation: "users";
3029
+ referencedColumns: ["id"];
3030
+ },
3031
+ {
3032
+ foreignKeyName: "content_item_attempts_organization_id_fkey";
3033
+ columns: ["organization_id"];
3034
+ isOneToOne: false;
3035
+ referencedRelation: "organizations";
3036
+ referencedColumns: ["id"];
3037
+ },
3038
+ {
3039
+ foreignKeyName: "content_item_attempts_source_execution_id_fkey";
3040
+ columns: ["source_execution_id"];
3041
+ isOneToOne: false;
3042
+ referencedRelation: "execution_logs";
3043
+ referencedColumns: ["execution_id"];
3044
+ }
3045
+ ];
3046
+ };
3047
+ content_items: {
3048
+ Row: {
3049
+ body: string | null;
3050
+ client_id: string | null;
3051
+ created_at: string;
3052
+ created_by: string | null;
3053
+ id: string;
3054
+ organization_id: string;
3055
+ payload: Json;
3056
+ pillar: string | null;
3057
+ pipeline_id: string | null;
3058
+ processing_state: Json;
3059
+ reject_reason: string | null;
3060
+ reviewed_at: string | null;
3061
+ reviewed_by: string | null;
3062
+ reviewer_feedback: string | null;
3063
+ source_asset_id: string | null;
3064
+ status: string;
3065
+ title: string;
3066
+ updated_at: string;
3067
+ updated_by: string | null;
3068
+ };
3069
+ Insert: {
3070
+ body?: string | null;
3071
+ client_id?: string | null;
3072
+ created_at?: string;
3073
+ created_by?: string | null;
3074
+ id?: string;
3075
+ organization_id: string;
3076
+ payload?: Json;
3077
+ pillar?: string | null;
3078
+ pipeline_id?: string | null;
3079
+ processing_state?: Json;
3080
+ reject_reason?: string | null;
3081
+ reviewed_at?: string | null;
3082
+ reviewed_by?: string | null;
3083
+ reviewer_feedback?: string | null;
3084
+ source_asset_id?: string | null;
3085
+ status?: string;
3086
+ title: string;
3087
+ updated_at?: string;
3088
+ updated_by?: string | null;
3089
+ };
3090
+ Update: {
3091
+ body?: string | null;
3092
+ client_id?: string | null;
3093
+ created_at?: string;
3094
+ created_by?: string | null;
3095
+ id?: string;
3096
+ organization_id?: string;
3097
+ payload?: Json;
3098
+ pillar?: string | null;
3099
+ pipeline_id?: string | null;
3100
+ processing_state?: Json;
3101
+ reject_reason?: string | null;
3102
+ reviewed_at?: string | null;
3103
+ reviewed_by?: string | null;
3104
+ reviewer_feedback?: string | null;
3105
+ source_asset_id?: string | null;
3106
+ status?: string;
3107
+ title?: string;
3108
+ updated_at?: string;
3109
+ updated_by?: string | null;
3110
+ };
3111
+ Relationships: [
3112
+ {
3113
+ foreignKeyName: "content_items_client_id_fkey";
3114
+ columns: ["client_id"];
3115
+ isOneToOne: false;
3116
+ referencedRelation: "clients";
3117
+ referencedColumns: ["id"];
3118
+ },
3119
+ {
3120
+ foreignKeyName: "content_items_created_by_fkey";
3121
+ columns: ["created_by"];
3122
+ isOneToOne: false;
3123
+ referencedRelation: "users";
3124
+ referencedColumns: ["id"];
3125
+ },
3126
+ {
3127
+ foreignKeyName: "content_items_organization_id_fkey";
3128
+ columns: ["organization_id"];
3129
+ isOneToOne: false;
3130
+ referencedRelation: "organizations";
3131
+ referencedColumns: ["id"];
3132
+ },
3133
+ {
3134
+ foreignKeyName: "content_items_reviewed_by_fkey";
3135
+ columns: ["reviewed_by"];
3136
+ isOneToOne: false;
3137
+ referencedRelation: "users";
3138
+ referencedColumns: ["id"];
3139
+ },
3140
+ {
3141
+ foreignKeyName: "content_items_source_asset_id_fkey";
3142
+ columns: ["source_asset_id"];
3143
+ isOneToOne: false;
3144
+ referencedRelation: "content_source_assets";
3145
+ referencedColumns: ["id"];
3146
+ },
3147
+ {
3148
+ foreignKeyName: "content_items_updated_by_fkey";
3149
+ columns: ["updated_by"];
3150
+ isOneToOne: false;
3151
+ referencedRelation: "users";
3152
+ referencedColumns: ["id"];
3153
+ }
3154
+ ];
3155
+ };
3156
+ content_source_assets: {
3157
+ Row: {
3158
+ created_at: string;
3159
+ duration_seconds: number | null;
3160
+ external_url: string | null;
3161
+ id: string;
3162
+ kind: string;
3163
+ metadata: Json;
3164
+ organization_id: string;
3165
+ payload: Json;
3166
+ processing_state: Json;
3167
+ storage_path: string | null;
3168
+ title: string;
3169
+ updated_at: string;
3170
+ };
3171
+ Insert: {
2856
3172
  created_at?: string;
2857
- description?: string | null;
2858
- expires_at?: string | null;
2859
- human_checkpoint?: string | null;
3173
+ duration_seconds?: number | null;
3174
+ external_url?: string | null;
2860
3175
  id?: string;
2861
- idempotency_key?: string | null;
2862
- metadata?: Json | null;
3176
+ kind: string;
3177
+ metadata?: Json;
2863
3178
  organization_id: string;
2864
- origin_execution_id: string;
2865
- origin_resource_id: string;
2866
- origin_resource_type: string;
2867
- priority?: number;
2868
- selected_action?: string | null;
2869
- status?: string;
2870
- target_execution_id?: string | null;
2871
- target_resource_id?: string | null;
2872
- target_resource_type?: string | null;
3179
+ payload?: Json;
3180
+ processing_state?: Json;
3181
+ storage_path?: string | null;
3182
+ title: string;
3183
+ updated_at?: string;
2873
3184
  };
2874
3185
  Update: {
2875
- action_payload?: Json | null;
2876
- actions?: Json;
2877
- completed_at?: string | null;
2878
- completed_by?: string | null;
2879
- context?: Json;
2880
3186
  created_at?: string;
2881
- description?: string | null;
2882
- expires_at?: string | null;
2883
- human_checkpoint?: string | null;
3187
+ duration_seconds?: number | null;
3188
+ external_url?: string | null;
2884
3189
  id?: string;
2885
- idempotency_key?: string | null;
2886
- metadata?: Json | null;
3190
+ kind?: string;
3191
+ metadata?: Json;
2887
3192
  organization_id?: string;
2888
- origin_execution_id?: string;
2889
- origin_resource_id?: string;
2890
- origin_resource_type?: string;
2891
- priority?: number;
2892
- selected_action?: string | null;
2893
- status?: string;
2894
- target_execution_id?: string | null;
2895
- target_resource_id?: string | null;
2896
- target_resource_type?: string | null;
3193
+ payload?: Json;
3194
+ processing_state?: Json;
3195
+ storage_path?: string | null;
3196
+ title?: string;
3197
+ updated_at?: string;
2897
3198
  };
2898
3199
  Relationships: [
2899
3200
  {
2900
- foreignKeyName: "command_queue_completed_by_fkey";
2901
- columns: ["completed_by"];
2902
- isOneToOne: false;
2903
- referencedRelation: "users";
2904
- referencedColumns: ["id"];
2905
- },
2906
- {
2907
- foreignKeyName: "command_queue_organization_id_fkey";
3201
+ foreignKeyName: "content_source_assets_organization_id_fkey";
2908
3202
  columns: ["organization_id"];
2909
3203
  isOneToOne: false;
2910
3204
  referencedRelation: "organizations";
2911
3205
  referencedColumns: ["id"];
2912
- },
2913
- {
2914
- foreignKeyName: "command_queue_target_execution_id_fkey";
2915
- columns: ["target_execution_id"];
2916
- isOneToOne: false;
2917
- referencedRelation: "execution_logs";
2918
- referencedColumns: ["execution_id"];
2919
3206
  }
2920
3207
  ];
2921
3208
  };
@@ -4535,6 +4822,33 @@ type Database = {
4535
4822
  };
4536
4823
  Returns: boolean;
4537
4824
  };
4825
+ create_artifact_version: {
4826
+ Args: {
4827
+ p_content: Json;
4828
+ p_created_by?: string;
4829
+ p_kind: string;
4830
+ p_organization_id: string;
4831
+ p_owner_id?: string;
4832
+ p_owner_kind: string;
4833
+ p_pipeline_id?: string;
4834
+ p_source_execution_id?: string;
4835
+ };
4836
+ Returns: {
4837
+ content: Json;
4838
+ created_at: string;
4839
+ created_by: string | null;
4840
+ id: string;
4841
+ is_active: boolean;
4842
+ kind: string;
4843
+ organization_id: string;
4844
+ owner_id: string | null;
4845
+ owner_kind: string;
4846
+ pipeline_id: string | null;
4847
+ source_execution_id: string | null;
4848
+ updated_at: string;
4849
+ version: number;
4850
+ };
4851
+ };
4538
4852
  current_user_is_platform_admin: {
4539
4853
  Args: Record<PropertyKey, never>;
4540
4854
  Returns: boolean;
@@ -4641,6 +4955,12 @@ type Database = {
4641
4955
  Args: Record<PropertyKey, never>;
4642
4956
  Returns: Json;
4643
4957
  };
4958
+ purge_stale_test_data: {
4959
+ Args: {
4960
+ p_max_age?: unknown;
4961
+ };
4962
+ Returns: Json;
4963
+ };
4644
4964
  recompute_all_memberships: {
4645
4965
  Args: Record<PropertyKey, never>;
4646
4966
  Returns: undefined;
@@ -5161,6 +5481,31 @@ declare const DataModeSchema: z.ZodEnum<{
5161
5481
  mock: "mock";
5162
5482
  live: "live";
5163
5483
  }>;
5484
+ declare const AcqArtifactOwnerKindSchema: z.ZodEnum<{
5485
+ company: "company";
5486
+ contact: "contact";
5487
+ list: "list";
5488
+ organization: "organization";
5489
+ deal: "deal";
5490
+ list_member: "list_member";
5491
+ }>;
5492
+ declare const AcqArtifactResponseSchema: z.ZodObject<{
5493
+ id: z.ZodString;
5494
+ organizationId: z.ZodString;
5495
+ ownerKind: z.ZodString;
5496
+ ownerId: z.ZodNullable<z.ZodString>;
5497
+ kind: z.ZodString;
5498
+ pipelineId: z.ZodNullable<z.ZodString>;
5499
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5500
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
5501
+ createdBy: z.ZodNullable<z.ZodString>;
5502
+ createdAt: z.ZodString;
5503
+ updatedAt: z.ZodString;
5504
+ isActive: z.ZodBoolean;
5505
+ version: z.ZodNumber;
5506
+ }, z.core.$strip>;
5507
+ type AcqArtifactOwnerKind = z.infer<typeof AcqArtifactOwnerKindSchema>;
5508
+ type AcqArtifactResponse = z.infer<typeof AcqArtifactResponseSchema>;
5164
5509
  type PipelineStage = z.infer<typeof PipelineStageSchema>;
5165
5510
  type DataMode = z.infer<typeof DataModeSchema>;
5166
5511
  type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
@@ -6169,7 +6514,6 @@ interface SystemEntry {
6169
6514
  path: string;
6170
6515
  surfaces: string[];
6171
6516
  icon?: string;
6172
- order?: number;
6173
6517
  };
6174
6518
  lifecycle?: 'draft' | 'beta' | 'active' | 'deprecated' | 'archived';
6175
6519
  responsibleRoleId?: string;
@@ -6179,17 +6523,12 @@ interface SystemEntry {
6179
6523
  intent: 'exposes' | 'consumes';
6180
6524
  invocation?: unknown;
6181
6525
  }[];
6182
- policies?: string[];
6183
6526
  drivesGoals?: string[];
6184
6527
  apiInterface?: z.infer<typeof SystemApiInterfaceSchema>;
6185
- /** @deprecated Use lifecycle. Accepted for one publish cycle. */
6186
- status?: 'active' | 'deprecated' | 'archived';
6187
6528
  path?: string;
6188
6529
  icon?: string;
6189
6530
  uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
6190
6531
  enabled?: boolean;
6191
- devOnly?: boolean;
6192
- requiresAdmin?: boolean;
6193
6532
  order: number;
6194
6533
  config?: Record<string, JsonValue>;
6195
6534
  ontology?: OntologyScope;
@@ -6312,10 +6651,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6312
6651
  version: z.ZodDefault<z.ZodLiteral<1>>;
6313
6652
  lastModified: z.ZodString;
6314
6653
  }, z.core.$strip>>;
6315
- policies: z.ZodOptional<z.ZodObject<{
6316
- version: z.ZodDefault<z.ZodLiteral<1>>;
6317
- lastModified: z.ZodString;
6318
- }, z.core.$strip>>;
6319
6654
  knowledge: z.ZodOptional<z.ZodObject<{
6320
6655
  version: z.ZodDefault<z.ZodLiteral<1>>;
6321
6656
  lastModified: z.ZodString;
@@ -6373,10 +6708,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6373
6708
  version: 1;
6374
6709
  lastModified: string;
6375
6710
  };
6376
- policies: {
6377
- version: 1;
6378
- lastModified: string;
6379
- };
6380
6711
  knowledge: {
6381
6712
  version: 1;
6382
6713
  lastModified: string;
@@ -6434,10 +6765,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6434
6765
  version: 1;
6435
6766
  lastModified: string;
6436
6767
  } | undefined;
6437
- policies?: {
6438
- version: 1;
6439
- lastModified: string;
6440
- } | undefined;
6441
6768
  knowledge?: {
6442
6769
  version: 1;
6443
6770
  lastModified: string;
@@ -7031,9 +7358,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7031
7358
  }, z.core.$strip>, z.ZodObject<{
7032
7359
  kind: z.ZodLiteral<"ontology">;
7033
7360
  id: z.ZodString;
7034
- }, z.core.$strip>, z.ZodObject<{
7035
- kind: z.ZodLiteral<"policy">;
7036
- id: z.ZodString;
7037
7361
  }, z.core.$strip>, z.ZodObject<{
7038
7362
  kind: z.ZodLiteral<"role">;
7039
7363
  id: z.ZodString;
@@ -7061,9 +7385,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7061
7385
  }, z.core.$strip>, z.ZodObject<{
7062
7386
  kind: z.ZodLiteral<"ontology">;
7063
7387
  id: z.ZodString;
7064
- }, z.core.$strip>, z.ZodObject<{
7065
- kind: z.ZodLiteral<"policy">;
7066
- id: z.ZodString;
7067
7388
  }, z.core.$strip>, z.ZodObject<{
7068
7389
  kind: z.ZodLiteral<"role">;
7069
7390
  id: z.ZodString;
@@ -7145,66 +7466,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7145
7466
  label: z.ZodOptional<z.ZodString>;
7146
7467
  }, z.core.$strip>>>;
7147
7468
  }, z.core.$strip>>>>;
7148
- policies: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7149
- id: z.ZodString;
7150
- order: z.ZodNumber;
7151
- label: z.ZodString;
7152
- description: z.ZodOptional<z.ZodString>;
7153
- trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
7154
- kind: z.ZodLiteral<"event">;
7155
- eventId: z.ZodString;
7156
- }, z.core.$strip>, z.ZodObject<{
7157
- kind: z.ZodLiteral<"action-invocation">;
7158
- actionId: z.ZodString;
7159
- }, z.core.$strip>, z.ZodObject<{
7160
- kind: z.ZodLiteral<"schedule">;
7161
- cron: z.ZodString;
7162
- }, z.core.$strip>, z.ZodObject<{
7163
- kind: z.ZodLiteral<"manual">;
7164
- }, z.core.$strip>], "kind">;
7165
- predicate: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
7166
- kind: z.ZodLiteral<"always">;
7167
- }, z.core.$strip>, z.ZodObject<{
7168
- kind: z.ZodLiteral<"expression">;
7169
- expression: z.ZodString;
7170
- }, z.core.$strip>, z.ZodObject<{
7171
- kind: z.ZodLiteral<"threshold">;
7172
- metric: z.ZodString;
7173
- operator: z.ZodEnum<{
7174
- lt: "lt";
7175
- lte: "lte";
7176
- eq: "eq";
7177
- gte: "gte";
7178
- gt: "gt";
7179
- }>;
7180
- value: z.ZodNumber;
7181
- }, z.core.$strip>], "kind">>;
7182
- actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
7183
- kind: z.ZodLiteral<"require-approval">;
7184
- roleId: z.ZodOptional<z.ZodString>;
7185
- }, z.core.$strip>, z.ZodObject<{
7186
- kind: z.ZodLiteral<"invoke-action">;
7187
- actionId: z.ZodString;
7188
- }, z.core.$strip>, z.ZodObject<{
7189
- kind: z.ZodLiteral<"notify-role">;
7190
- roleId: z.ZodString;
7191
- }, z.core.$strip>, z.ZodObject<{
7192
- kind: z.ZodLiteral<"block">;
7193
- }, z.core.$strip>], "kind">>;
7194
- appliesTo: z.ZodDefault<z.ZodObject<{
7195
- systemIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7196
- actionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7197
- resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7198
- roleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7199
- }, z.core.$strip>>;
7200
- lifecycle: z.ZodDefault<z.ZodEnum<{
7201
- active: "active";
7202
- deprecated: "deprecated";
7203
- draft: "draft";
7204
- beta: "beta";
7205
- archived: "archived";
7206
- }>>;
7207
- }, z.core.$strip>>>>;
7208
7469
  knowledge: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7209
7470
  id: z.ZodString;
7210
7471
  kind: z.ZodEnum<{
@@ -9304,6 +9565,222 @@ declare const ProjectSchemas: {
9304
9565
  }, z.core.$strip>;
9305
9566
  };
9306
9567
 
9568
+ /**
9569
+ * `'running'` is the only in-flight value; every other member is terminal.
9570
+ * Added 2026-08-14 (the step-state model): a producer writes `'running'`
9571
+ * when it starts a step and patches the same row to a terminal status when
9572
+ * the step finishes (`updateAttempt`) — see `CreateContentItemAttemptRequestSchema`
9573
+ * / `UpdateContentItemAttemptRequestSchema` below.
9574
+ */
9575
+ declare const ContentStepStatusSchema: z.ZodEnum<{
9576
+ error: "error";
9577
+ success: "success";
9578
+ running: "running";
9579
+ no_result: "no_result";
9580
+ skipped: "skipped";
9581
+ }>;
9582
+ /** D18: `pipeline_id` is an OM ontology id (free text), not a UUID. */
9583
+ declare const ContentPipelineIdSchema: z.ZodString;
9584
+ /** `content:catalog/status` entries. Free text, model-owned. */
9585
+ declare const ContentItemStatusSchema: z.ZodString;
9586
+ /** `content:catalog/pillar` entries. */
9587
+ declare const ContentPillarSchema: z.ZodString;
9588
+ /** `content:catalog/platform` entries, applied to `content_distributions.platform` / `.format`. */
9589
+ declare const ContentDistributionPlatformSchema: z.ZodString;
9590
+ declare const ContentDistributionFormatSchema: z.ZodString;
9591
+ declare const ContentDistributionStatusSchema: z.ZodString;
9592
+ /**
9593
+ * D12: the payload gets its own column (`content_items.payload` /
9594
+ * `content_item_attempts.payload`). This is the producer's immutable
9595
+ * emission — never edited; `body` is the human's canonical text and
9596
+ * diverges from it on first edit. The field list within the envelope is
9597
+ * declared per-step by the (not-yet-authored) step catalog; this transport
9598
+ * schema validates JSON-object shape and size only, not field membership.
9599
+ */
9600
+ declare const ContentPayloadEnvelopeSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
9601
+ declare const ContentItemResponseSchema: z.ZodObject<{
9602
+ id: z.ZodString;
9603
+ organizationId: z.ZodString;
9604
+ title: z.ZodString;
9605
+ body: z.ZodNullable<z.ZodString>;
9606
+ payload: z.ZodUnknown;
9607
+ status: z.ZodString;
9608
+ pillar: z.ZodNullable<z.ZodString>;
9609
+ pipelineId: z.ZodNullable<z.ZodString>;
9610
+ clientId: z.ZodNullable<z.ZodString>;
9611
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9612
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9613
+ status: z.ZodEnum<{
9614
+ error: "error";
9615
+ success: "success";
9616
+ running: "running";
9617
+ no_result: "no_result";
9618
+ skipped: "skipped";
9619
+ }>;
9620
+ attemptId: z.ZodString;
9621
+ executionId: z.ZodNullable<z.ZodString>;
9622
+ attemptedAt: z.ZodString;
9623
+ data: z.ZodOptional<z.ZodUnknown>;
9624
+ }, z.core.$loose>>;
9625
+ reviewedAt: z.ZodNullable<z.ZodString>;
9626
+ reviewedBy: z.ZodNullable<z.ZodString>;
9627
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9628
+ rejectReason: z.ZodNullable<z.ZodString>;
9629
+ createdBy: z.ZodNullable<z.ZodString>;
9630
+ updatedBy: z.ZodNullable<z.ZodString>;
9631
+ createdAt: z.ZodString;
9632
+ updatedAt: z.ZodString;
9633
+ }, z.core.$strip>;
9634
+ declare const ContentItemListResponseSchema: z.ZodObject<{
9635
+ data: z.ZodArray<z.ZodObject<{
9636
+ id: z.ZodString;
9637
+ organizationId: z.ZodString;
9638
+ title: z.ZodString;
9639
+ body: z.ZodNullable<z.ZodString>;
9640
+ payload: z.ZodUnknown;
9641
+ status: z.ZodString;
9642
+ pillar: z.ZodNullable<z.ZodString>;
9643
+ pipelineId: z.ZodNullable<z.ZodString>;
9644
+ clientId: z.ZodNullable<z.ZodString>;
9645
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9646
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9647
+ status: z.ZodEnum<{
9648
+ error: "error";
9649
+ success: "success";
9650
+ running: "running";
9651
+ no_result: "no_result";
9652
+ skipped: "skipped";
9653
+ }>;
9654
+ attemptId: z.ZodString;
9655
+ executionId: z.ZodNullable<z.ZodString>;
9656
+ attemptedAt: z.ZodString;
9657
+ data: z.ZodOptional<z.ZodUnknown>;
9658
+ }, z.core.$loose>>;
9659
+ reviewedAt: z.ZodNullable<z.ZodString>;
9660
+ reviewedBy: z.ZodNullable<z.ZodString>;
9661
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9662
+ rejectReason: z.ZodNullable<z.ZodString>;
9663
+ createdBy: z.ZodNullable<z.ZodString>;
9664
+ updatedBy: z.ZodNullable<z.ZodString>;
9665
+ createdAt: z.ZodString;
9666
+ updatedAt: z.ZodString;
9667
+ }, z.core.$strip>>;
9668
+ total: z.ZodNumber;
9669
+ limit: z.ZodNumber;
9670
+ offset: z.ZodNumber;
9671
+ }, z.core.$strip>;
9672
+ declare const ContentItemAttemptResponseSchema: z.ZodObject<{
9673
+ id: z.ZodString;
9674
+ organizationId: z.ZodString;
9675
+ contentItemId: z.ZodString;
9676
+ attemptNumber: z.ZodNumber;
9677
+ stepKey: z.ZodNullable<z.ZodString>;
9678
+ status: z.ZodEnum<{
9679
+ error: "error";
9680
+ success: "success";
9681
+ running: "running";
9682
+ no_result: "no_result";
9683
+ skipped: "skipped";
9684
+ }>;
9685
+ payload: z.ZodUnknown;
9686
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9687
+ createdBy: z.ZodNullable<z.ZodString>;
9688
+ createdAt: z.ZodString;
9689
+ }, z.core.$strip>;
9690
+ declare const ContentItemAttemptListResponseSchema: z.ZodObject<{
9691
+ data: z.ZodArray<z.ZodObject<{
9692
+ id: z.ZodString;
9693
+ organizationId: z.ZodString;
9694
+ contentItemId: z.ZodString;
9695
+ attemptNumber: z.ZodNumber;
9696
+ stepKey: z.ZodNullable<z.ZodString>;
9697
+ status: z.ZodEnum<{
9698
+ error: "error";
9699
+ success: "success";
9700
+ running: "running";
9701
+ no_result: "no_result";
9702
+ skipped: "skipped";
9703
+ }>;
9704
+ payload: z.ZodUnknown;
9705
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9706
+ createdBy: z.ZodNullable<z.ZodString>;
9707
+ createdAt: z.ZodString;
9708
+ }, z.core.$strip>>;
9709
+ }, z.core.$strip>;
9710
+ declare const ContentSourceAssetResponseSchema: z.ZodObject<{
9711
+ id: z.ZodString;
9712
+ organizationId: z.ZodString;
9713
+ kind: z.ZodString;
9714
+ title: z.ZodString;
9715
+ externalUrl: z.ZodNullable<z.ZodString>;
9716
+ storagePath: z.ZodNullable<z.ZodString>;
9717
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
9718
+ metadata: z.ZodUnknown;
9719
+ payload: z.ZodUnknown;
9720
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9721
+ status: z.ZodEnum<{
9722
+ error: "error";
9723
+ success: "success";
9724
+ running: "running";
9725
+ no_result: "no_result";
9726
+ skipped: "skipped";
9727
+ }>;
9728
+ attemptId: z.ZodString;
9729
+ executionId: z.ZodNullable<z.ZodString>;
9730
+ attemptedAt: z.ZodString;
9731
+ data: z.ZodOptional<z.ZodUnknown>;
9732
+ }, z.core.$loose>>;
9733
+ createdAt: z.ZodString;
9734
+ updatedAt: z.ZodString;
9735
+ }, z.core.$strip>;
9736
+ declare const ContentDistributionResponseSchema: z.ZodObject<{
9737
+ id: z.ZodString;
9738
+ organizationId: z.ZodString;
9739
+ contentItemId: z.ZodString;
9740
+ platform: z.ZodString;
9741
+ format: z.ZodString;
9742
+ status: z.ZodString;
9743
+ adaptedBody: z.ZodNullable<z.ZodString>;
9744
+ platformContent: z.ZodNullable<z.ZodUnknown>;
9745
+ checklist: z.ZodNullable<z.ZodUnknown>;
9746
+ mediaUrls: z.ZodArray<z.ZodUnknown>;
9747
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9748
+ status: z.ZodEnum<{
9749
+ error: "error";
9750
+ success: "success";
9751
+ running: "running";
9752
+ no_result: "no_result";
9753
+ skipped: "skipped";
9754
+ }>;
9755
+ attemptId: z.ZodString;
9756
+ executionId: z.ZodNullable<z.ZodString>;
9757
+ attemptedAt: z.ZodString;
9758
+ data: z.ZodOptional<z.ZodUnknown>;
9759
+ }, z.core.$loose>>;
9760
+ publishMethod: z.ZodNullable<z.ZodString>;
9761
+ publishedAt: z.ZodNullable<z.ZodString>;
9762
+ platformPostId: z.ZodNullable<z.ZodString>;
9763
+ platformUrl: z.ZodNullable<z.ZodString>;
9764
+ metrics: z.ZodUnknown;
9765
+ metricsUpdatedAt: z.ZodNullable<z.ZodString>;
9766
+ createdAt: z.ZodString;
9767
+ updatedAt: z.ZodString;
9768
+ }, z.core.$strip>;
9769
+ type ContentStepStatus = z.infer<typeof ContentStepStatusSchema>;
9770
+ type ContentPipelineId = z.infer<typeof ContentPipelineIdSchema>;
9771
+ type ContentItemStatus = z.infer<typeof ContentItemStatusSchema>;
9772
+ type ContentPillar = z.infer<typeof ContentPillarSchema>;
9773
+ type ContentDistributionPlatform = z.infer<typeof ContentDistributionPlatformSchema>;
9774
+ type ContentDistributionFormat = z.infer<typeof ContentDistributionFormatSchema>;
9775
+ type ContentDistributionStatus = z.infer<typeof ContentDistributionStatusSchema>;
9776
+ type ContentPayloadEnvelope = z.infer<typeof ContentPayloadEnvelopeSchema>;
9777
+ type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
9778
+ type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
9779
+ type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
9780
+ type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
9781
+ type ContentSourceAssetResponse = z.infer<typeof ContentSourceAssetResponseSchema>;
9782
+ type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
9783
+
9307
9784
  /**
9308
9785
  * Tool Method Maps
9309
9786
  *
@@ -10224,6 +10701,219 @@ type ListToolMap = {
10224
10701
  result: string[];
10225
10702
  };
10226
10703
  };
10704
+ type ArtifactsToolMap = {
10705
+ listArtifacts: {
10706
+ params: {
10707
+ ownerKind: AcqArtifactOwnerKind;
10708
+ ownerId?: string | null;
10709
+ };
10710
+ result: {
10711
+ artifacts: AcqArtifactResponse[];
10712
+ };
10713
+ };
10714
+ createArtifact: {
10715
+ params: {
10716
+ ownerKind: AcqArtifactOwnerKind;
10717
+ ownerId?: string | null;
10718
+ kind: string;
10719
+ content: Record<string, unknown>;
10720
+ sourceExecutionId?: string;
10721
+ pipelineId?: string | null;
10722
+ };
10723
+ result: AcqArtifactResponse;
10724
+ };
10725
+ /**
10726
+ * The active governing document for a given pipeline and kind -- the
10727
+ * two-key lookup (pipeline_id, kind) every producer would otherwise
10728
+ * re-implement. Scoped per (organization, pipelineId, kind); a tenant runs
10729
+ * many pipelines at once, so this is never "the active artifact for the org."
10730
+ */
10731
+ getActive: {
10732
+ params: {
10733
+ pipelineId: string;
10734
+ kind: string;
10735
+ };
10736
+ result: {
10737
+ artifact: AcqArtifactResponse | null;
10738
+ };
10739
+ };
10740
+ };
10741
+ type ContentToolMap = {
10742
+ /** Insert a new `content_items` row -- a producer's entry point for a new piece. */
10743
+ createItem: {
10744
+ params: {
10745
+ title: string;
10746
+ body?: string | null;
10747
+ payload?: ContentPayloadEnvelope;
10748
+ status?: ContentItemStatus;
10749
+ pillar?: ContentPillar | null;
10750
+ pipelineId?: ContentPipelineId | null;
10751
+ clientId?: string | null;
10752
+ sourceAssetId?: string | null;
10753
+ };
10754
+ result: ContentItemResponse;
10755
+ };
10756
+ /** Fetch a single item by id, org-scoped -- read before advancing or reviewing a piece. */
10757
+ getItem: {
10758
+ params: {
10759
+ itemId: string;
10760
+ };
10761
+ result: ContentItemResponse | null;
10762
+ };
10763
+ /** Query items -- how a producer finds pieces awaiting a given step or status. */
10764
+ listItems: {
10765
+ params: {
10766
+ status?: ContentItemStatus;
10767
+ pillar?: ContentPillar;
10768
+ pipelineId?: ContentPipelineId;
10769
+ clientId?: string;
10770
+ limit?: number;
10771
+ offset?: number;
10772
+ };
10773
+ result: ContentItemListResponse;
10774
+ };
10775
+ /**
10776
+ * Update an item's mutable fields as it advances through the pipeline.
10777
+ * Does NOT accept a `processingState` field -- see Decision 4 above.
10778
+ */
10779
+ updateItem: {
10780
+ params: {
10781
+ itemId: string;
10782
+ title?: string;
10783
+ body?: string | null;
10784
+ status?: ContentItemStatus;
10785
+ pillar?: ContentPillar | null;
10786
+ pipelineId?: ContentPipelineId | null;
10787
+ clientId?: string | null;
10788
+ sourceAssetId?: string | null;
10789
+ };
10790
+ result: ContentItemResponse;
10791
+ };
10792
+ /**
10793
+ * Record a pipeline-step attempt against an item. `attemptNumber` is
10794
+ * assigned server-side inside the write (Decision 6) -- never
10795
+ * client-supplied, and never accepted here.
10796
+ */
10797
+ createAttempt: {
10798
+ params: {
10799
+ contentItemId: string;
10800
+ payload: ContentPayloadEnvelope;
10801
+ /** Which step this attempt implements. Stored as-is; NULL when omitted. */
10802
+ stepKey?: string | null;
10803
+ sourceExecutionId?: string | null;
10804
+ /**
10805
+ * The status the row is created with. Optional so a producer starting a
10806
+ * step can write `'running'` before doing the work -- the "write-at-start"
10807
+ * half of write-at-start/patch-at-end. Omitted, the column's own default
10808
+ * applies, which is why a producer that means `'running'` must say so.
10809
+ */
10810
+ status?: ContentStepStatus;
10811
+ };
10812
+ result: ContentItemAttemptResponse;
10813
+ };
10814
+ /** List attempt history for an item -- a producer checks this before retrying a step. */
10815
+ listAttempts: {
10816
+ params: {
10817
+ contentItemId: string;
10818
+ };
10819
+ result: ContentItemAttemptListResponse;
10820
+ };
10821
+ /**
10822
+ * Patch an existing attempt to its terminal status -- the "patch-at-end"
10823
+ * half of write-at-start/patch-at-end (see `ContentStepStatus`'s
10824
+ * `'running'` value). `attemptNumber`, `stepKey`, and `sourceExecutionId`
10825
+ * are immutable once written; only `status` and `payload` change here.
10826
+ */
10827
+ updateAttempt: {
10828
+ params: {
10829
+ attemptId: string;
10830
+ status?: ContentStepStatus;
10831
+ payload?: ContentPayloadEnvelope;
10832
+ };
10833
+ result: ContentItemAttemptResponse;
10834
+ };
10835
+ /**
10836
+ * Insert a new `content_source_assets` row. `payload` is an open envelope
10837
+ * (D5, content-source-asset-write-path.mdx) -- per-`kind` field membership
10838
+ * is declared in the OM catalog, not enforced by this transport type.
10839
+ */
10840
+ createSourceAsset: {
10841
+ params: {
10842
+ kind: string;
10843
+ title: string;
10844
+ externalUrl?: string | null;
10845
+ storagePath?: string | null;
10846
+ durationSeconds?: number | null;
10847
+ metadata?: Record<string, unknown>;
10848
+ payload?: ContentPayloadEnvelope;
10849
+ };
10850
+ result: ContentSourceAssetResponse;
10851
+ };
10852
+ /** Fetch a single source asset by id, org-scoped. */
10853
+ getSourceAsset: {
10854
+ params: {
10855
+ sourceAssetId: string;
10856
+ };
10857
+ result: ContentSourceAssetResponse | null;
10858
+ };
10859
+ /** Query source assets -- e.g. a producer picking material for the next item. */
10860
+ listSourceAssets: {
10861
+ params: {
10862
+ kind?: string;
10863
+ limit?: number;
10864
+ offset?: number;
10865
+ };
10866
+ result: {
10867
+ data: ContentSourceAssetResponse[];
10868
+ };
10869
+ };
10870
+ /** Update a source asset's mutable fields. */
10871
+ updateSourceAsset: {
10872
+ params: {
10873
+ sourceAssetId: string;
10874
+ kind?: string;
10875
+ title?: string;
10876
+ externalUrl?: string | null;
10877
+ storagePath?: string | null;
10878
+ durationSeconds?: number | null;
10879
+ metadata?: Record<string, unknown>;
10880
+ payload?: ContentPayloadEnvelope;
10881
+ };
10882
+ result: ContentSourceAssetResponse;
10883
+ };
10884
+ /** Insert a `content_distributions` row for one platform/format target. */
10885
+ createDistribution: {
10886
+ params: {
10887
+ contentItemId: string;
10888
+ platform: ContentDistributionPlatform;
10889
+ format: ContentDistributionFormat;
10890
+ status?: ContentDistributionStatus;
10891
+ adaptedBody?: string | null;
10892
+ platformContent?: unknown;
10893
+ checklist?: unknown;
10894
+ mediaUrls?: unknown[];
10895
+ };
10896
+ result: ContentDistributionResponse;
10897
+ };
10898
+ /** Update a distribution's status, adapted content, or publish metadata. */
10899
+ updateDistribution: {
10900
+ params: {
10901
+ distributionId: string;
10902
+ status?: ContentDistributionStatus;
10903
+ adaptedBody?: string | null;
10904
+ platformContent?: unknown;
10905
+ checklist?: unknown;
10906
+ mediaUrls?: unknown[];
10907
+ publishMethod?: string | null;
10908
+ publishedAt?: string | null;
10909
+ platformPostId?: string | null;
10910
+ platformUrl?: string | null;
10911
+ metrics?: unknown;
10912
+ metricsUpdatedAt?: string | null;
10913
+ };
10914
+ result: ContentDistributionResponse;
10915
+ };
10916
+ };
10227
10917
  type PdfToolMap = {
10228
10918
  render: {
10229
10919
  params: {
@@ -11429,6 +12119,8 @@ declare const mockAcqDb: (overrides?: MockAdapterOverrides<LeadToolMap>) => Type
11429
12119
  declare const mockProjects: (overrides?: MockAdapterOverrides<ProjectsToolMap>) => TypedAdapter<ProjectsToolMap>;
11430
12120
  declare const mockCrm: (overrides?: MockAdapterOverrides<CrmToolMap>) => TypedAdapter<CrmToolMap>;
11431
12121
  declare const mockList: (overrides?: MockAdapterOverrides<ListToolMap>) => TypedAdapter<ListToolMap>;
12122
+ declare const mockArtifacts: (overrides?: MockAdapterOverrides<ArtifactsToolMap>) => TypedAdapter<ArtifactsToolMap>;
12123
+ declare const mockContent: (overrides?: MockAdapterOverrides<ContentToolMap>) => TypedAdapter<ContentToolMap>;
11432
12124
  declare const mockPdf: (overrides?: MockAdapterOverrides<PdfToolMap>) => TypedAdapter<PdfToolMap>;
11433
12125
  declare const mockApproval: (overrides?: MockAdapterOverrides<ApprovalToolMap>) => TypedAdapter<ApprovalToolMap>;
11434
12126
  declare const mockExecution: (overrides?: MockAdapterOverrides<ExecutionToolMap>) => TypedAdapter<ExecutionToolMap>;
@@ -11446,5 +12138,5 @@ declare const createMockStripe: (_credential: string, overrides?: MockAdapterOve
11446
12138
  declare const createMockAnymailfinder: (_credential: string, overrides?: MockAdapterOverrides<AnymailfinderToolMap>) => TypedAdapter<AnymailfinderToolMap>;
11447
12139
  declare const createMockMillionVerifier: (_credential: string, overrides?: MockAdapterOverrides<MillionVerifierToolMap>) => TypedAdapter<MillionVerifierToolMap>;
11448
12140
 
11449
- export { assertResourceRegistry, createMockAnymailfinder, createMockApify, createMockAttio, createMockDropbox, createMockGmail, createMockGoogleSheets, createMockInstantly, createMockMillionVerifier, createMockResend, createMockSignatureApi, createMockStripe, createMockTomba, mockAcqDb, mockApproval, mockCrm, mockEmail, mockExecution, mockList, mockLlm, mockNotifications, mockPdf, mockProjects, mockScheduler, mockStorage, runLinearWorkflow, runWorkflow };
12141
+ export { assertResourceRegistry, createMockAnymailfinder, createMockApify, createMockAttio, createMockDropbox, createMockGmail, createMockGoogleSheets, createMockInstantly, createMockMillionVerifier, createMockResend, createMockSignatureApi, createMockStripe, createMockTomba, mockAcqDb, mockApproval, mockArtifacts, mockContent, mockCrm, mockEmail, mockExecution, mockList, mockLlm, mockNotifications, mockPdf, mockProjects, mockScheduler, mockStorage, runLinearWorkflow, runWorkflow };
11450
12142
  export type { AssertResourceRegistryOptions, LinearWorkflowStepEvent, MockAdapterOverrides, MockLlmAdapter, RunLinearWorkflowContext, RunLinearWorkflowOptions, RunLinearWorkflowResult, RunWorkflowContext, RunWorkflowOptions, RunWorkflowResult, WorkflowStepEvent };