@elevasis/sdk 1.45.0 → 1.46.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 (38) hide show
  1. package/dist/cli.cjs +36046 -31587
  2. package/dist/index.d.ts +833 -391
  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 +859 -331
  7. package/dist/test-utils/index.js +166 -134
  8. package/dist/worker/index.d.ts +897 -324
  9. package/dist/worker/index.js +68 -35
  10. package/package.json +4 -4
  11. package/reference/_navigation.md +11 -2
  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 +19 -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 +265 -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 +90 -5
  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/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"];
@@ -2636,6 +2529,13 @@ type Database = {
2636
2529
  title?: string;
2637
2530
  };
2638
2531
  Relationships: [
2532
+ {
2533
+ foreignKeyName: "activities_actor_id_fkey";
2534
+ columns: ["actor_id"];
2535
+ isOneToOne: false;
2536
+ referencedRelation: "users";
2537
+ referencedColumns: ["id"];
2538
+ },
2639
2539
  {
2640
2540
  foreignKeyName: "activities_organization_id_fkey";
2641
2541
  columns: ["organization_id"];
@@ -2748,6 +2648,62 @@ type Database = {
2748
2648
  }
2749
2649
  ];
2750
2650
  };
2651
+ artifacts: {
2652
+ Row: {
2653
+ content: Json;
2654
+ created_at: string;
2655
+ created_by: string | null;
2656
+ id: string;
2657
+ is_active: boolean;
2658
+ kind: string;
2659
+ organization_id: string;
2660
+ owner_id: string | null;
2661
+ owner_kind: string;
2662
+ pipeline_id: string | null;
2663
+ source_execution_id: string | null;
2664
+ updated_at: string;
2665
+ version: number;
2666
+ };
2667
+ Insert: {
2668
+ content: Json;
2669
+ created_at?: string;
2670
+ created_by?: string | null;
2671
+ id?: string;
2672
+ is_active?: boolean;
2673
+ kind: string;
2674
+ organization_id: string;
2675
+ owner_id?: string | null;
2676
+ owner_kind: string;
2677
+ pipeline_id?: string | null;
2678
+ source_execution_id?: string | null;
2679
+ updated_at?: string;
2680
+ version?: number;
2681
+ };
2682
+ Update: {
2683
+ content?: Json;
2684
+ created_at?: string;
2685
+ created_by?: string | null;
2686
+ id?: string;
2687
+ is_active?: boolean;
2688
+ kind?: string;
2689
+ organization_id?: string;
2690
+ owner_id?: string | null;
2691
+ owner_kind?: string;
2692
+ pipeline_id?: string | null;
2693
+ source_execution_id?: string | null;
2694
+ updated_at?: string;
2695
+ version?: number;
2696
+ };
2697
+ Relationships: [
2698
+ {
2699
+ foreignKeyName: "artifacts_organization_id_fkey";
2700
+ columns: ["organization_id"];
2701
+ isOneToOne: false;
2702
+ referencedRelation: "organizations";
2703
+ referencedColumns: ["id"];
2704
+ }
2705
+ ];
2706
+ };
2751
2707
  clients: {
2752
2708
  Row: {
2753
2709
  converted_at: string | null;
@@ -2793,129 +2749,434 @@ type Database = {
2793
2749
  };
2794
2750
  Relationships: [
2795
2751
  {
2796
- foreignKeyName: "clients_organization_id_fkey";
2752
+ foreignKeyName: "clients_organization_id_fkey";
2753
+ columns: ["organization_id"];
2754
+ isOneToOne: false;
2755
+ referencedRelation: "organizations";
2756
+ referencedColumns: ["id"];
2757
+ },
2758
+ {
2759
+ foreignKeyName: "clients_primary_company_id_fkey";
2760
+ columns: ["primary_company_id"];
2761
+ isOneToOne: false;
2762
+ referencedRelation: "acq_companies";
2763
+ referencedColumns: ["id"];
2764
+ },
2765
+ {
2766
+ foreignKeyName: "clients_primary_contact_id_fkey";
2767
+ columns: ["primary_contact_id"];
2768
+ isOneToOne: false;
2769
+ referencedRelation: "acq_contacts";
2770
+ referencedColumns: ["id"];
2771
+ },
2772
+ {
2773
+ foreignKeyName: "clients_source_deal_id_fkey";
2774
+ columns: ["source_deal_id"];
2775
+ isOneToOne: false;
2776
+ referencedRelation: "acq_deals";
2777
+ referencedColumns: ["id"];
2778
+ }
2779
+ ];
2780
+ };
2781
+ command_queue: {
2782
+ Row: {
2783
+ action_payload: Json | null;
2784
+ actions: Json;
2785
+ completed_at: string | null;
2786
+ completed_by: string | null;
2787
+ context: Json;
2788
+ created_at: string;
2789
+ description: string | null;
2790
+ expires_at: string | null;
2791
+ human_checkpoint: string | null;
2792
+ id: string;
2793
+ idempotency_key: string | null;
2794
+ metadata: Json | null;
2795
+ organization_id: string;
2796
+ origin_execution_id: string;
2797
+ origin_resource_id: string;
2798
+ origin_resource_type: string;
2799
+ priority: number;
2800
+ selected_action: string | null;
2801
+ status: string;
2802
+ target_execution_id: string | null;
2803
+ target_resource_id: string | null;
2804
+ target_resource_type: string | null;
2805
+ };
2806
+ Insert: {
2807
+ action_payload?: Json | null;
2808
+ actions: Json;
2809
+ completed_at?: string | null;
2810
+ completed_by?: string | null;
2811
+ context: Json;
2812
+ created_at?: string;
2813
+ description?: string | null;
2814
+ expires_at?: string | null;
2815
+ human_checkpoint?: string | null;
2816
+ id?: string;
2817
+ idempotency_key?: string | null;
2818
+ metadata?: Json | null;
2819
+ organization_id: string;
2820
+ origin_execution_id: string;
2821
+ origin_resource_id: string;
2822
+ origin_resource_type: string;
2823
+ priority?: number;
2824
+ selected_action?: string | null;
2825
+ status?: string;
2826
+ target_execution_id?: string | null;
2827
+ target_resource_id?: string | null;
2828
+ target_resource_type?: string | null;
2829
+ };
2830
+ Update: {
2831
+ action_payload?: Json | null;
2832
+ actions?: Json;
2833
+ completed_at?: string | null;
2834
+ completed_by?: string | null;
2835
+ context?: Json;
2836
+ created_at?: string;
2837
+ description?: string | null;
2838
+ expires_at?: string | null;
2839
+ human_checkpoint?: string | null;
2840
+ id?: string;
2841
+ idempotency_key?: string | null;
2842
+ metadata?: Json | null;
2843
+ organization_id?: string;
2844
+ origin_execution_id?: string;
2845
+ origin_resource_id?: string;
2846
+ origin_resource_type?: string;
2847
+ priority?: number;
2848
+ selected_action?: string | null;
2849
+ status?: string;
2850
+ target_execution_id?: string | null;
2851
+ target_resource_id?: string | null;
2852
+ target_resource_type?: string | null;
2853
+ };
2854
+ Relationships: [
2855
+ {
2856
+ foreignKeyName: "command_queue_completed_by_fkey";
2857
+ columns: ["completed_by"];
2858
+ isOneToOne: false;
2859
+ referencedRelation: "users";
2860
+ referencedColumns: ["id"];
2861
+ },
2862
+ {
2863
+ foreignKeyName: "command_queue_organization_id_fkey";
2864
+ columns: ["organization_id"];
2865
+ isOneToOne: false;
2866
+ referencedRelation: "organizations";
2867
+ referencedColumns: ["id"];
2868
+ },
2869
+ {
2870
+ foreignKeyName: "command_queue_target_execution_id_fkey";
2871
+ columns: ["target_execution_id"];
2872
+ isOneToOne: false;
2873
+ referencedRelation: "execution_logs";
2874
+ referencedColumns: ["execution_id"];
2875
+ }
2876
+ ];
2877
+ };
2878
+ content_distributions: {
2879
+ Row: {
2880
+ adapted_body: string | null;
2881
+ checklist: Json | null;
2882
+ content_item_id: string;
2883
+ created_at: string;
2884
+ format: string;
2885
+ id: string;
2886
+ media_urls: Json;
2887
+ metrics: Json;
2888
+ metrics_updated_at: string | null;
2889
+ organization_id: string;
2890
+ platform: string;
2891
+ platform_content: Json | null;
2892
+ platform_post_id: string | null;
2893
+ platform_url: string | null;
2894
+ processing_state: Json;
2895
+ publish_method: string | null;
2896
+ published_at: string | null;
2897
+ status: string;
2898
+ updated_at: string;
2899
+ };
2900
+ Insert: {
2901
+ adapted_body?: string | null;
2902
+ checklist?: Json | null;
2903
+ content_item_id: string;
2904
+ created_at?: string;
2905
+ format: string;
2906
+ id?: string;
2907
+ media_urls?: Json;
2908
+ metrics?: Json;
2909
+ metrics_updated_at?: string | null;
2910
+ organization_id: string;
2911
+ platform: string;
2912
+ platform_content?: Json | null;
2913
+ platform_post_id?: string | null;
2914
+ platform_url?: string | null;
2915
+ processing_state?: Json;
2916
+ publish_method?: string | null;
2917
+ published_at?: string | null;
2918
+ status?: string;
2919
+ updated_at?: string;
2920
+ };
2921
+ Update: {
2922
+ adapted_body?: string | null;
2923
+ checklist?: Json | null;
2924
+ content_item_id?: string;
2925
+ created_at?: string;
2926
+ format?: string;
2927
+ id?: string;
2928
+ media_urls?: Json;
2929
+ metrics?: Json;
2930
+ metrics_updated_at?: string | null;
2931
+ organization_id?: string;
2932
+ platform?: string;
2933
+ platform_content?: Json | null;
2934
+ platform_post_id?: string | null;
2935
+ platform_url?: string | null;
2936
+ processing_state?: Json;
2937
+ publish_method?: string | null;
2938
+ published_at?: string | null;
2939
+ status?: string;
2940
+ updated_at?: string;
2941
+ };
2942
+ Relationships: [
2943
+ {
2944
+ foreignKeyName: "content_distributions_content_item_id_fkey";
2945
+ columns: ["content_item_id"];
2946
+ isOneToOne: false;
2947
+ referencedRelation: "content_items";
2948
+ referencedColumns: ["id"];
2949
+ },
2950
+ {
2951
+ foreignKeyName: "content_distributions_organization_id_fkey";
2952
+ columns: ["organization_id"];
2953
+ isOneToOne: false;
2954
+ referencedRelation: "organizations";
2955
+ referencedColumns: ["id"];
2956
+ }
2957
+ ];
2958
+ };
2959
+ content_item_attempts: {
2960
+ Row: {
2961
+ attempt_number: number;
2962
+ content_item_id: string;
2963
+ created_at: string;
2964
+ created_by: string | null;
2965
+ id: string;
2966
+ organization_id: string;
2967
+ payload: Json;
2968
+ source_execution_id: string | null;
2969
+ step_key: string | null;
2970
+ };
2971
+ Insert: {
2972
+ attempt_number: number;
2973
+ content_item_id: string;
2974
+ created_at?: string;
2975
+ created_by?: string | null;
2976
+ id?: string;
2977
+ organization_id: string;
2978
+ payload?: Json;
2979
+ source_execution_id?: string | null;
2980
+ step_key?: string | null;
2981
+ };
2982
+ Update: {
2983
+ attempt_number?: number;
2984
+ content_item_id?: string;
2985
+ created_at?: string;
2986
+ created_by?: string | null;
2987
+ id?: string;
2988
+ organization_id?: string;
2989
+ payload?: Json;
2990
+ source_execution_id?: string | null;
2991
+ step_key?: string | null;
2992
+ };
2993
+ Relationships: [
2994
+ {
2995
+ foreignKeyName: "content_item_attempts_content_item_id_fkey";
2996
+ columns: ["content_item_id"];
2997
+ isOneToOne: false;
2998
+ referencedRelation: "content_items";
2999
+ referencedColumns: ["id"];
3000
+ },
3001
+ {
3002
+ foreignKeyName: "content_item_attempts_created_by_fkey";
3003
+ columns: ["created_by"];
3004
+ isOneToOne: false;
3005
+ referencedRelation: "users";
3006
+ referencedColumns: ["id"];
3007
+ },
3008
+ {
3009
+ foreignKeyName: "content_item_attempts_organization_id_fkey";
3010
+ columns: ["organization_id"];
3011
+ isOneToOne: false;
3012
+ referencedRelation: "organizations";
3013
+ referencedColumns: ["id"];
3014
+ },
3015
+ {
3016
+ foreignKeyName: "content_item_attempts_source_execution_id_fkey";
3017
+ columns: ["source_execution_id"];
3018
+ isOneToOne: false;
3019
+ referencedRelation: "execution_logs";
3020
+ referencedColumns: ["execution_id"];
3021
+ }
3022
+ ];
3023
+ };
3024
+ content_items: {
3025
+ Row: {
3026
+ body: string | null;
3027
+ client_id: string | null;
3028
+ created_at: string;
3029
+ created_by: string | null;
3030
+ id: string;
3031
+ organization_id: string;
3032
+ payload: Json;
3033
+ pillar: string | null;
3034
+ pipeline_id: string | null;
3035
+ processing_state: Json;
3036
+ reject_reason: string | null;
3037
+ reviewed_at: string | null;
3038
+ reviewed_by: string | null;
3039
+ reviewer_feedback: string | null;
3040
+ source_asset_id: string | null;
3041
+ status: string;
3042
+ title: string;
3043
+ updated_at: string;
3044
+ updated_by: string | null;
3045
+ };
3046
+ Insert: {
3047
+ body?: string | null;
3048
+ client_id?: string | null;
3049
+ created_at?: string;
3050
+ created_by?: string | null;
3051
+ id?: string;
3052
+ organization_id: string;
3053
+ payload?: Json;
3054
+ pillar?: string | null;
3055
+ pipeline_id?: string | null;
3056
+ processing_state?: Json;
3057
+ reject_reason?: string | null;
3058
+ reviewed_at?: string | null;
3059
+ reviewed_by?: string | null;
3060
+ reviewer_feedback?: string | null;
3061
+ source_asset_id?: string | null;
3062
+ status?: string;
3063
+ title: string;
3064
+ updated_at?: string;
3065
+ updated_by?: string | null;
3066
+ };
3067
+ Update: {
3068
+ body?: string | null;
3069
+ client_id?: string | null;
3070
+ created_at?: string;
3071
+ created_by?: string | null;
3072
+ id?: string;
3073
+ organization_id?: string;
3074
+ payload?: Json;
3075
+ pillar?: string | null;
3076
+ pipeline_id?: string | null;
3077
+ processing_state?: Json;
3078
+ reject_reason?: string | null;
3079
+ reviewed_at?: string | null;
3080
+ reviewed_by?: string | null;
3081
+ reviewer_feedback?: string | null;
3082
+ source_asset_id?: string | null;
3083
+ status?: string;
3084
+ title?: string;
3085
+ updated_at?: string;
3086
+ updated_by?: string | null;
3087
+ };
3088
+ Relationships: [
3089
+ {
3090
+ foreignKeyName: "content_items_client_id_fkey";
3091
+ columns: ["client_id"];
3092
+ isOneToOne: false;
3093
+ referencedRelation: "clients";
3094
+ referencedColumns: ["id"];
3095
+ },
3096
+ {
3097
+ foreignKeyName: "content_items_created_by_fkey";
3098
+ columns: ["created_by"];
3099
+ isOneToOne: false;
3100
+ referencedRelation: "users";
3101
+ referencedColumns: ["id"];
3102
+ },
3103
+ {
3104
+ foreignKeyName: "content_items_organization_id_fkey";
2797
3105
  columns: ["organization_id"];
2798
3106
  isOneToOne: false;
2799
3107
  referencedRelation: "organizations";
2800
3108
  referencedColumns: ["id"];
2801
3109
  },
2802
3110
  {
2803
- foreignKeyName: "clients_primary_company_id_fkey";
2804
- columns: ["primary_company_id"];
3111
+ foreignKeyName: "content_items_reviewed_by_fkey";
3112
+ columns: ["reviewed_by"];
2805
3113
  isOneToOne: false;
2806
- referencedRelation: "acq_companies";
3114
+ referencedRelation: "users";
2807
3115
  referencedColumns: ["id"];
2808
3116
  },
2809
3117
  {
2810
- foreignKeyName: "clients_primary_contact_id_fkey";
2811
- columns: ["primary_contact_id"];
3118
+ foreignKeyName: "content_items_source_asset_id_fkey";
3119
+ columns: ["source_asset_id"];
2812
3120
  isOneToOne: false;
2813
- referencedRelation: "acq_contacts";
3121
+ referencedRelation: "content_source_assets";
2814
3122
  referencedColumns: ["id"];
2815
3123
  },
2816
3124
  {
2817
- foreignKeyName: "clients_source_deal_id_fkey";
2818
- columns: ["source_deal_id"];
3125
+ foreignKeyName: "content_items_updated_by_fkey";
3126
+ columns: ["updated_by"];
2819
3127
  isOneToOne: false;
2820
- referencedRelation: "acq_deals";
3128
+ referencedRelation: "users";
2821
3129
  referencedColumns: ["id"];
2822
3130
  }
2823
3131
  ];
2824
3132
  };
2825
- command_queue: {
3133
+ content_source_assets: {
2826
3134
  Row: {
2827
- action_payload: Json | null;
2828
- actions: Json;
2829
- completed_at: string | null;
2830
- completed_by: string | null;
2831
- context: Json;
2832
3135
  created_at: string;
2833
- description: string | null;
2834
- expires_at: string | null;
2835
- human_checkpoint: string | null;
3136
+ duration_seconds: number | null;
3137
+ external_url: string | null;
2836
3138
  id: string;
2837
- idempotency_key: string | null;
2838
- metadata: Json | null;
3139
+ kind: string;
3140
+ metadata: Json;
2839
3141
  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;
3142
+ processing_state: Json;
3143
+ storage_path: string | null;
3144
+ title: string;
3145
+ updated_at: string;
2849
3146
  };
2850
3147
  Insert: {
2851
- action_payload?: Json | null;
2852
- actions: Json;
2853
- completed_at?: string | null;
2854
- completed_by?: string | null;
2855
- context: Json;
2856
3148
  created_at?: string;
2857
- description?: string | null;
2858
- expires_at?: string | null;
2859
- human_checkpoint?: string | null;
3149
+ duration_seconds?: number | null;
3150
+ external_url?: string | null;
2860
3151
  id?: string;
2861
- idempotency_key?: string | null;
2862
- metadata?: Json | null;
3152
+ kind: string;
3153
+ metadata?: Json;
2863
3154
  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;
3155
+ processing_state?: Json;
3156
+ storage_path?: string | null;
3157
+ title: string;
3158
+ updated_at?: string;
2873
3159
  };
2874
3160
  Update: {
2875
- action_payload?: Json | null;
2876
- actions?: Json;
2877
- completed_at?: string | null;
2878
- completed_by?: string | null;
2879
- context?: Json;
2880
3161
  created_at?: string;
2881
- description?: string | null;
2882
- expires_at?: string | null;
2883
- human_checkpoint?: string | null;
3162
+ duration_seconds?: number | null;
3163
+ external_url?: string | null;
2884
3164
  id?: string;
2885
- idempotency_key?: string | null;
2886
- metadata?: Json | null;
3165
+ kind?: string;
3166
+ metadata?: Json;
2887
3167
  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;
3168
+ processing_state?: Json;
3169
+ storage_path?: string | null;
3170
+ title?: string;
3171
+ updated_at?: string;
2897
3172
  };
2898
3173
  Relationships: [
2899
3174
  {
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";
3175
+ foreignKeyName: "content_source_assets_organization_id_fkey";
2908
3176
  columns: ["organization_id"];
2909
3177
  isOneToOne: false;
2910
3178
  referencedRelation: "organizations";
2911
3179
  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
3180
  }
2920
3181
  ];
2921
3182
  };
@@ -4535,6 +4796,33 @@ type Database = {
4535
4796
  };
4536
4797
  Returns: boolean;
4537
4798
  };
4799
+ create_artifact_version: {
4800
+ Args: {
4801
+ p_content: Json;
4802
+ p_created_by?: string;
4803
+ p_kind: string;
4804
+ p_organization_id: string;
4805
+ p_owner_id?: string;
4806
+ p_owner_kind: string;
4807
+ p_pipeline_id?: string;
4808
+ p_source_execution_id?: string;
4809
+ };
4810
+ Returns: {
4811
+ content: Json;
4812
+ created_at: string;
4813
+ created_by: string | null;
4814
+ id: string;
4815
+ is_active: boolean;
4816
+ kind: string;
4817
+ organization_id: string;
4818
+ owner_id: string | null;
4819
+ owner_kind: string;
4820
+ pipeline_id: string | null;
4821
+ source_execution_id: string | null;
4822
+ updated_at: string;
4823
+ version: number;
4824
+ };
4825
+ };
4538
4826
  current_user_is_platform_admin: {
4539
4827
  Args: Record<PropertyKey, never>;
4540
4828
  Returns: boolean;
@@ -4641,6 +4929,12 @@ type Database = {
4641
4929
  Args: Record<PropertyKey, never>;
4642
4930
  Returns: Json;
4643
4931
  };
4932
+ purge_stale_test_data: {
4933
+ Args: {
4934
+ p_max_age?: unknown;
4935
+ };
4936
+ Returns: Json;
4937
+ };
4644
4938
  recompute_all_memberships: {
4645
4939
  Args: Record<PropertyKey, never>;
4646
4940
  Returns: undefined;
@@ -5161,6 +5455,31 @@ declare const DataModeSchema: z.ZodEnum<{
5161
5455
  mock: "mock";
5162
5456
  live: "live";
5163
5457
  }>;
5458
+ declare const AcqArtifactOwnerKindSchema: z.ZodEnum<{
5459
+ company: "company";
5460
+ contact: "contact";
5461
+ list: "list";
5462
+ organization: "organization";
5463
+ deal: "deal";
5464
+ list_member: "list_member";
5465
+ }>;
5466
+ declare const AcqArtifactResponseSchema: z.ZodObject<{
5467
+ id: z.ZodString;
5468
+ organizationId: z.ZodString;
5469
+ ownerKind: z.ZodString;
5470
+ ownerId: z.ZodNullable<z.ZodString>;
5471
+ kind: z.ZodString;
5472
+ pipelineId: z.ZodNullable<z.ZodString>;
5473
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5474
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
5475
+ createdBy: z.ZodNullable<z.ZodString>;
5476
+ createdAt: z.ZodString;
5477
+ updatedAt: z.ZodString;
5478
+ isActive: z.ZodBoolean;
5479
+ version: z.ZodNumber;
5480
+ }, z.core.$strip>;
5481
+ type AcqArtifactOwnerKind = z.infer<typeof AcqArtifactOwnerKindSchema>;
5482
+ type AcqArtifactResponse = z.infer<typeof AcqArtifactResponseSchema>;
5164
5483
  type PipelineStage = z.infer<typeof PipelineStageSchema>;
5165
5484
  type DataMode = z.infer<typeof DataModeSchema>;
5166
5485
  type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
@@ -6169,7 +6488,6 @@ interface SystemEntry {
6169
6488
  path: string;
6170
6489
  surfaces: string[];
6171
6490
  icon?: string;
6172
- order?: number;
6173
6491
  };
6174
6492
  lifecycle?: 'draft' | 'beta' | 'active' | 'deprecated' | 'archived';
6175
6493
  responsibleRoleId?: string;
@@ -6179,17 +6497,12 @@ interface SystemEntry {
6179
6497
  intent: 'exposes' | 'consumes';
6180
6498
  invocation?: unknown;
6181
6499
  }[];
6182
- policies?: string[];
6183
6500
  drivesGoals?: string[];
6184
6501
  apiInterface?: z.infer<typeof SystemApiInterfaceSchema>;
6185
- /** @deprecated Use lifecycle. Accepted for one publish cycle. */
6186
- status?: 'active' | 'deprecated' | 'archived';
6187
6502
  path?: string;
6188
6503
  icon?: string;
6189
6504
  uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
6190
6505
  enabled?: boolean;
6191
- devOnly?: boolean;
6192
- requiresAdmin?: boolean;
6193
6506
  order: number;
6194
6507
  config?: Record<string, JsonValue>;
6195
6508
  ontology?: OntologyScope;
@@ -6312,10 +6625,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6312
6625
  version: z.ZodDefault<z.ZodLiteral<1>>;
6313
6626
  lastModified: z.ZodString;
6314
6627
  }, 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
6628
  knowledge: z.ZodOptional<z.ZodObject<{
6320
6629
  version: z.ZodDefault<z.ZodLiteral<1>>;
6321
6630
  lastModified: z.ZodString;
@@ -6373,10 +6682,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6373
6682
  version: 1;
6374
6683
  lastModified: string;
6375
6684
  };
6376
- policies: {
6377
- version: 1;
6378
- lastModified: string;
6379
- };
6380
6685
  knowledge: {
6381
6686
  version: 1;
6382
6687
  lastModified: string;
@@ -6434,10 +6739,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6434
6739
  version: 1;
6435
6740
  lastModified: string;
6436
6741
  } | undefined;
6437
- policies?: {
6438
- version: 1;
6439
- lastModified: string;
6440
- } | undefined;
6441
6742
  knowledge?: {
6442
6743
  version: 1;
6443
6744
  lastModified: string;
@@ -7031,9 +7332,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7031
7332
  }, z.core.$strip>, z.ZodObject<{
7032
7333
  kind: z.ZodLiteral<"ontology">;
7033
7334
  id: z.ZodString;
7034
- }, z.core.$strip>, z.ZodObject<{
7035
- kind: z.ZodLiteral<"policy">;
7036
- id: z.ZodString;
7037
7335
  }, z.core.$strip>, z.ZodObject<{
7038
7336
  kind: z.ZodLiteral<"role">;
7039
7337
  id: z.ZodString;
@@ -7061,9 +7359,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7061
7359
  }, z.core.$strip>, z.ZodObject<{
7062
7360
  kind: z.ZodLiteral<"ontology">;
7063
7361
  id: z.ZodString;
7064
- }, z.core.$strip>, z.ZodObject<{
7065
- kind: z.ZodLiteral<"policy">;
7066
- id: z.ZodString;
7067
7362
  }, z.core.$strip>, z.ZodObject<{
7068
7363
  kind: z.ZodLiteral<"role">;
7069
7364
  id: z.ZodString;
@@ -7145,66 +7440,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7145
7440
  label: z.ZodOptional<z.ZodString>;
7146
7441
  }, z.core.$strip>>>;
7147
7442
  }, 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
7443
  knowledge: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7209
7444
  id: z.ZodString;
7210
7445
  kind: z.ZodEnum<{
@@ -9304,6 +9539,154 @@ declare const ProjectSchemas: {
9304
9539
  }, z.core.$strip>;
9305
9540
  };
9306
9541
 
9542
+ /** D18: `pipeline_id` is an OM ontology id (free text), not a UUID. */
9543
+ declare const ContentPipelineIdSchema: z.ZodString;
9544
+ /** `content:catalog/status` entries. Free text, model-owned. */
9545
+ declare const ContentItemStatusSchema: z.ZodString;
9546
+ /** `content:catalog/pillar` entries. */
9547
+ declare const ContentPillarSchema: z.ZodString;
9548
+ /** `content:catalog/platform` entries, applied to `content_distributions.platform` / `.format`. */
9549
+ declare const ContentDistributionPlatformSchema: z.ZodString;
9550
+ declare const ContentDistributionFormatSchema: z.ZodString;
9551
+ declare const ContentDistributionStatusSchema: z.ZodString;
9552
+ /**
9553
+ * D12: the payload gets its own column (`content_items.payload` /
9554
+ * `content_item_attempts.payload`). This is the producer's immutable
9555
+ * emission — never edited; `body` is the human's canonical text and
9556
+ * diverges from it on first edit. The field list within the envelope is
9557
+ * declared per-step by the (not-yet-authored) step catalog; this transport
9558
+ * schema validates JSON-object shape and size only, not field membership.
9559
+ */
9560
+ declare const ContentPayloadEnvelopeSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
9561
+ declare const ContentItemResponseSchema: z.ZodObject<{
9562
+ id: z.ZodString;
9563
+ organizationId: z.ZodString;
9564
+ title: z.ZodString;
9565
+ body: z.ZodNullable<z.ZodString>;
9566
+ payload: z.ZodUnknown;
9567
+ status: z.ZodString;
9568
+ pillar: z.ZodNullable<z.ZodString>;
9569
+ pipelineId: z.ZodNullable<z.ZodString>;
9570
+ clientId: z.ZodNullable<z.ZodString>;
9571
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9572
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9573
+ status: z.ZodEnum<{
9574
+ error: "error";
9575
+ success: "success";
9576
+ no_result: "no_result";
9577
+ skipped: "skipped";
9578
+ }>;
9579
+ data: z.ZodOptional<z.ZodUnknown>;
9580
+ }, z.core.$loose>>;
9581
+ reviewedAt: z.ZodNullable<z.ZodString>;
9582
+ reviewedBy: z.ZodNullable<z.ZodString>;
9583
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9584
+ rejectReason: z.ZodNullable<z.ZodString>;
9585
+ createdBy: z.ZodNullable<z.ZodString>;
9586
+ updatedBy: z.ZodNullable<z.ZodString>;
9587
+ createdAt: z.ZodString;
9588
+ updatedAt: z.ZodString;
9589
+ }, z.core.$strip>;
9590
+ declare const ContentItemListResponseSchema: z.ZodObject<{
9591
+ data: z.ZodArray<z.ZodObject<{
9592
+ id: z.ZodString;
9593
+ organizationId: z.ZodString;
9594
+ title: z.ZodString;
9595
+ body: z.ZodNullable<z.ZodString>;
9596
+ payload: z.ZodUnknown;
9597
+ status: z.ZodString;
9598
+ pillar: z.ZodNullable<z.ZodString>;
9599
+ pipelineId: z.ZodNullable<z.ZodString>;
9600
+ clientId: z.ZodNullable<z.ZodString>;
9601
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9602
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9603
+ status: z.ZodEnum<{
9604
+ error: "error";
9605
+ success: "success";
9606
+ no_result: "no_result";
9607
+ skipped: "skipped";
9608
+ }>;
9609
+ data: z.ZodOptional<z.ZodUnknown>;
9610
+ }, z.core.$loose>>;
9611
+ reviewedAt: z.ZodNullable<z.ZodString>;
9612
+ reviewedBy: z.ZodNullable<z.ZodString>;
9613
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9614
+ rejectReason: z.ZodNullable<z.ZodString>;
9615
+ createdBy: z.ZodNullable<z.ZodString>;
9616
+ updatedBy: z.ZodNullable<z.ZodString>;
9617
+ createdAt: z.ZodString;
9618
+ updatedAt: z.ZodString;
9619
+ }, z.core.$strip>>;
9620
+ total: z.ZodNumber;
9621
+ limit: z.ZodNumber;
9622
+ offset: z.ZodNumber;
9623
+ }, z.core.$strip>;
9624
+ declare const ContentItemAttemptResponseSchema: z.ZodObject<{
9625
+ id: z.ZodString;
9626
+ organizationId: z.ZodString;
9627
+ contentItemId: z.ZodString;
9628
+ attemptNumber: z.ZodNumber;
9629
+ stepKey: z.ZodNullable<z.ZodString>;
9630
+ payload: z.ZodUnknown;
9631
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9632
+ createdBy: z.ZodNullable<z.ZodString>;
9633
+ createdAt: z.ZodString;
9634
+ }, z.core.$strip>;
9635
+ declare const ContentItemAttemptListResponseSchema: z.ZodObject<{
9636
+ data: z.ZodArray<z.ZodObject<{
9637
+ id: z.ZodString;
9638
+ organizationId: z.ZodString;
9639
+ contentItemId: z.ZodString;
9640
+ attemptNumber: z.ZodNumber;
9641
+ stepKey: z.ZodNullable<z.ZodString>;
9642
+ payload: z.ZodUnknown;
9643
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9644
+ createdBy: z.ZodNullable<z.ZodString>;
9645
+ createdAt: z.ZodString;
9646
+ }, z.core.$strip>>;
9647
+ }, z.core.$strip>;
9648
+ declare const ContentDistributionResponseSchema: z.ZodObject<{
9649
+ id: z.ZodString;
9650
+ organizationId: z.ZodString;
9651
+ contentItemId: z.ZodString;
9652
+ platform: z.ZodString;
9653
+ format: z.ZodString;
9654
+ status: z.ZodString;
9655
+ adaptedBody: z.ZodNullable<z.ZodString>;
9656
+ platformContent: z.ZodNullable<z.ZodUnknown>;
9657
+ checklist: z.ZodNullable<z.ZodUnknown>;
9658
+ mediaUrls: z.ZodArray<z.ZodUnknown>;
9659
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9660
+ status: z.ZodEnum<{
9661
+ error: "error";
9662
+ success: "success";
9663
+ no_result: "no_result";
9664
+ skipped: "skipped";
9665
+ }>;
9666
+ data: z.ZodOptional<z.ZodUnknown>;
9667
+ }, z.core.$loose>>;
9668
+ publishMethod: z.ZodNullable<z.ZodString>;
9669
+ publishedAt: z.ZodNullable<z.ZodString>;
9670
+ platformPostId: z.ZodNullable<z.ZodString>;
9671
+ platformUrl: z.ZodNullable<z.ZodString>;
9672
+ metrics: z.ZodUnknown;
9673
+ metricsUpdatedAt: z.ZodNullable<z.ZodString>;
9674
+ createdAt: z.ZodString;
9675
+ updatedAt: z.ZodString;
9676
+ }, z.core.$strip>;
9677
+ type ContentPipelineId = z.infer<typeof ContentPipelineIdSchema>;
9678
+ type ContentItemStatus = z.infer<typeof ContentItemStatusSchema>;
9679
+ type ContentPillar = z.infer<typeof ContentPillarSchema>;
9680
+ type ContentDistributionPlatform = z.infer<typeof ContentDistributionPlatformSchema>;
9681
+ type ContentDistributionFormat = z.infer<typeof ContentDistributionFormatSchema>;
9682
+ type ContentDistributionStatus = z.infer<typeof ContentDistributionStatusSchema>;
9683
+ type ContentPayloadEnvelope = z.infer<typeof ContentPayloadEnvelopeSchema>;
9684
+ type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
9685
+ type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
9686
+ type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
9687
+ type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
9688
+ type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
9689
+
9307
9690
  /**
9308
9691
  * Tool Method Maps
9309
9692
  *
@@ -10224,6 +10607,149 @@ type ListToolMap = {
10224
10607
  result: string[];
10225
10608
  };
10226
10609
  };
10610
+ type ArtifactsToolMap = {
10611
+ listArtifacts: {
10612
+ params: {
10613
+ ownerKind: AcqArtifactOwnerKind;
10614
+ ownerId?: string | null;
10615
+ };
10616
+ result: {
10617
+ artifacts: AcqArtifactResponse[];
10618
+ };
10619
+ };
10620
+ createArtifact: {
10621
+ params: {
10622
+ ownerKind: AcqArtifactOwnerKind;
10623
+ ownerId?: string | null;
10624
+ kind: string;
10625
+ content: Record<string, unknown>;
10626
+ sourceExecutionId?: string;
10627
+ pipelineId?: string | null;
10628
+ };
10629
+ result: AcqArtifactResponse;
10630
+ };
10631
+ /**
10632
+ * The active governing document for a given pipeline and kind -- the
10633
+ * two-key lookup (pipeline_id, kind) every producer would otherwise
10634
+ * re-implement. Scoped per (organization, pipelineId, kind); a tenant runs
10635
+ * many pipelines at once, so this is never "the active artifact for the org."
10636
+ */
10637
+ getActive: {
10638
+ params: {
10639
+ pipelineId: string;
10640
+ kind: string;
10641
+ };
10642
+ result: {
10643
+ artifact: AcqArtifactResponse | null;
10644
+ };
10645
+ };
10646
+ };
10647
+ type ContentToolMap = {
10648
+ /** Insert a new `content_items` row -- a producer's entry point for a new piece. */
10649
+ createItem: {
10650
+ params: {
10651
+ title: string;
10652
+ body?: string | null;
10653
+ payload?: ContentPayloadEnvelope;
10654
+ status?: ContentItemStatus;
10655
+ pillar?: ContentPillar | null;
10656
+ pipelineId?: ContentPipelineId | null;
10657
+ clientId?: string | null;
10658
+ sourceAssetId?: string | null;
10659
+ };
10660
+ result: ContentItemResponse;
10661
+ };
10662
+ /** Fetch a single item by id, org-scoped -- read before advancing or reviewing a piece. */
10663
+ getItem: {
10664
+ params: {
10665
+ itemId: string;
10666
+ };
10667
+ result: ContentItemResponse | null;
10668
+ };
10669
+ /** Query items -- how a producer finds pieces awaiting a given step or status. */
10670
+ listItems: {
10671
+ params: {
10672
+ status?: ContentItemStatus;
10673
+ pillar?: ContentPillar;
10674
+ pipelineId?: ContentPipelineId;
10675
+ clientId?: string;
10676
+ limit?: number;
10677
+ offset?: number;
10678
+ };
10679
+ result: ContentItemListResponse;
10680
+ };
10681
+ /**
10682
+ * Update an item's mutable fields as it advances through the pipeline.
10683
+ * Does NOT accept a `processingState` field -- see Decision 4 above.
10684
+ */
10685
+ updateItem: {
10686
+ params: {
10687
+ itemId: string;
10688
+ title?: string;
10689
+ body?: string | null;
10690
+ status?: ContentItemStatus;
10691
+ pillar?: ContentPillar | null;
10692
+ pipelineId?: ContentPipelineId | null;
10693
+ clientId?: string | null;
10694
+ sourceAssetId?: string | null;
10695
+ };
10696
+ result: ContentItemResponse;
10697
+ };
10698
+ /**
10699
+ * Record a pipeline-step attempt against an item. `attemptNumber` is
10700
+ * assigned server-side inside the write (Decision 6) -- never
10701
+ * client-supplied, and never accepted here.
10702
+ */
10703
+ createAttempt: {
10704
+ params: {
10705
+ contentItemId: string;
10706
+ payload: ContentPayloadEnvelope;
10707
+ /** Which step this attempt implements. Stored as-is; NULL when omitted. */
10708
+ stepKey?: string | null;
10709
+ sourceExecutionId?: string | null;
10710
+ };
10711
+ result: ContentItemAttemptResponse;
10712
+ };
10713
+ /** List attempt history for an item -- a producer checks this before retrying a step. */
10714
+ listAttempts: {
10715
+ params: {
10716
+ contentItemId: string;
10717
+ };
10718
+ result: ContentItemAttemptListResponse;
10719
+ };
10720
+ /** Insert a `content_distributions` row for one platform/format target. */
10721
+ createDistribution: {
10722
+ params: {
10723
+ contentItemId: string;
10724
+ platform: ContentDistributionPlatform;
10725
+ format: ContentDistributionFormat;
10726
+ status?: ContentDistributionStatus;
10727
+ adaptedBody?: string | null;
10728
+ platformContent?: unknown;
10729
+ checklist?: unknown;
10730
+ mediaUrls?: unknown[];
10731
+ };
10732
+ result: ContentDistributionResponse;
10733
+ };
10734
+ /** Update a distribution's status, adapted content, or publish metadata. */
10735
+ updateDistribution: {
10736
+ params: {
10737
+ distributionId: string;
10738
+ status?: ContentDistributionStatus;
10739
+ adaptedBody?: string | null;
10740
+ platformContent?: unknown;
10741
+ checklist?: unknown;
10742
+ mediaUrls?: unknown[];
10743
+ publishMethod?: string | null;
10744
+ publishedAt?: string | null;
10745
+ platformPostId?: string | null;
10746
+ platformUrl?: string | null;
10747
+ metrics?: unknown;
10748
+ metricsUpdatedAt?: string | null;
10749
+ };
10750
+ result: ContentDistributionResponse;
10751
+ };
10752
+ };
10227
10753
  type PdfToolMap = {
10228
10754
  render: {
10229
10755
  params: {
@@ -11429,6 +11955,8 @@ declare const mockAcqDb: (overrides?: MockAdapterOverrides<LeadToolMap>) => Type
11429
11955
  declare const mockProjects: (overrides?: MockAdapterOverrides<ProjectsToolMap>) => TypedAdapter<ProjectsToolMap>;
11430
11956
  declare const mockCrm: (overrides?: MockAdapterOverrides<CrmToolMap>) => TypedAdapter<CrmToolMap>;
11431
11957
  declare const mockList: (overrides?: MockAdapterOverrides<ListToolMap>) => TypedAdapter<ListToolMap>;
11958
+ declare const mockArtifacts: (overrides?: MockAdapterOverrides<ArtifactsToolMap>) => TypedAdapter<ArtifactsToolMap>;
11959
+ declare const mockContent: (overrides?: MockAdapterOverrides<ContentToolMap>) => TypedAdapter<ContentToolMap>;
11432
11960
  declare const mockPdf: (overrides?: MockAdapterOverrides<PdfToolMap>) => TypedAdapter<PdfToolMap>;
11433
11961
  declare const mockApproval: (overrides?: MockAdapterOverrides<ApprovalToolMap>) => TypedAdapter<ApprovalToolMap>;
11434
11962
  declare const mockExecution: (overrides?: MockAdapterOverrides<ExecutionToolMap>) => TypedAdapter<ExecutionToolMap>;
@@ -11446,5 +11974,5 @@ declare const createMockStripe: (_credential: string, overrides?: MockAdapterOve
11446
11974
  declare const createMockAnymailfinder: (_credential: string, overrides?: MockAdapterOverrides<AnymailfinderToolMap>) => TypedAdapter<AnymailfinderToolMap>;
11447
11975
  declare const createMockMillionVerifier: (_credential: string, overrides?: MockAdapterOverrides<MillionVerifierToolMap>) => TypedAdapter<MillionVerifierToolMap>;
11448
11976
 
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 };
11977
+ 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
11978
  export type { AssertResourceRegistryOptions, LinearWorkflowStepEvent, MockAdapterOverrides, MockLlmAdapter, RunLinearWorkflowContext, RunLinearWorkflowOptions, RunLinearWorkflowResult, RunWorkflowContext, RunWorkflowOptions, RunWorkflowResult, WorkflowStepEvent };