@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;
@@ -2878,44 +2854,355 @@ type Database = {
2878
2854
  completed_by?: string | null;
2879
2855
  context?: Json;
2880
2856
  created_at?: string;
2881
- description?: string | null;
2882
- expires_at?: string | null;
2883
- human_checkpoint?: string | null;
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: {
3172
+ created_at?: string;
3173
+ duration_seconds?: number | null;
3174
+ external_url?: string | null;
3175
+ id?: string;
3176
+ kind: string;
3177
+ metadata?: Json;
3178
+ organization_id: string;
3179
+ payload?: Json;
3180
+ processing_state?: Json;
3181
+ storage_path?: string | null;
3182
+ title: string;
3183
+ updated_at?: string;
3184
+ };
3185
+ Update: {
3186
+ created_at?: string;
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;
@@ -5335,6 +5655,31 @@ declare const DataModeSchema: z.ZodEnum<{
5335
5655
  mock: "mock";
5336
5656
  live: "live";
5337
5657
  }>;
5658
+ declare const AcqArtifactOwnerKindSchema: z.ZodEnum<{
5659
+ company: "company";
5660
+ contact: "contact";
5661
+ list: "list";
5662
+ organization: "organization";
5663
+ deal: "deal";
5664
+ list_member: "list_member";
5665
+ }>;
5666
+ declare const AcqArtifactResponseSchema: z.ZodObject<{
5667
+ id: z.ZodString;
5668
+ organizationId: z.ZodString;
5669
+ ownerKind: z.ZodString;
5670
+ ownerId: z.ZodNullable<z.ZodString>;
5671
+ kind: z.ZodString;
5672
+ pipelineId: z.ZodNullable<z.ZodString>;
5673
+ content: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5674
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
5675
+ createdBy: z.ZodNullable<z.ZodString>;
5676
+ createdAt: z.ZodString;
5677
+ updatedAt: z.ZodString;
5678
+ isActive: z.ZodBoolean;
5679
+ version: z.ZodNumber;
5680
+ }, z.core.$strip>;
5681
+ type AcqArtifactOwnerKind = z.infer<typeof AcqArtifactOwnerKindSchema>;
5682
+ type AcqArtifactResponse = z.infer<typeof AcqArtifactResponseSchema>;
5338
5683
  type PipelineStage = z.infer<typeof PipelineStageSchema>;
5339
5684
  type DataMode = z.infer<typeof DataModeSchema>;
5340
5685
  type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
@@ -6343,7 +6688,6 @@ interface SystemEntry {
6343
6688
  path: string;
6344
6689
  surfaces: string[];
6345
6690
  icon?: string;
6346
- order?: number;
6347
6691
  };
6348
6692
  lifecycle?: 'draft' | 'beta' | 'active' | 'deprecated' | 'archived';
6349
6693
  responsibleRoleId?: string;
@@ -6353,17 +6697,12 @@ interface SystemEntry {
6353
6697
  intent: 'exposes' | 'consumes';
6354
6698
  invocation?: unknown;
6355
6699
  }[];
6356
- policies?: string[];
6357
6700
  drivesGoals?: string[];
6358
6701
  apiInterface?: z.infer<typeof SystemApiInterfaceSchema>;
6359
- /** @deprecated Use lifecycle. Accepted for one publish cycle. */
6360
- status?: 'active' | 'deprecated' | 'archived';
6361
6702
  path?: string;
6362
6703
  icon?: string;
6363
6704
  uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
6364
6705
  enabled?: boolean;
6365
- devOnly?: boolean;
6366
- requiresAdmin?: boolean;
6367
6706
  order: number;
6368
6707
  config?: Record<string, JsonValue>;
6369
6708
  ontology?: OntologyScope;
@@ -6486,10 +6825,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6486
6825
  version: z.ZodDefault<z.ZodLiteral<1>>;
6487
6826
  lastModified: z.ZodString;
6488
6827
  }, z.core.$strip>>;
6489
- policies: z.ZodOptional<z.ZodObject<{
6490
- version: z.ZodDefault<z.ZodLiteral<1>>;
6491
- lastModified: z.ZodString;
6492
- }, z.core.$strip>>;
6493
6828
  knowledge: z.ZodOptional<z.ZodObject<{
6494
6829
  version: z.ZodDefault<z.ZodLiteral<1>>;
6495
6830
  lastModified: z.ZodString;
@@ -6547,10 +6882,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6547
6882
  version: 1;
6548
6883
  lastModified: string;
6549
6884
  };
6550
- policies: {
6551
- version: 1;
6552
- lastModified: string;
6553
- };
6554
6885
  knowledge: {
6555
6886
  version: 1;
6556
6887
  lastModified: string;
@@ -6608,10 +6939,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
6608
6939
  version: 1;
6609
6940
  lastModified: string;
6610
6941
  } | undefined;
6611
- policies?: {
6612
- version: 1;
6613
- lastModified: string;
6614
- } | undefined;
6615
6942
  knowledge?: {
6616
6943
  version: 1;
6617
6944
  lastModified: string;
@@ -7205,9 +7532,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7205
7532
  }, z.core.$strip>, z.ZodObject<{
7206
7533
  kind: z.ZodLiteral<"ontology">;
7207
7534
  id: z.ZodString;
7208
- }, z.core.$strip>, z.ZodObject<{
7209
- kind: z.ZodLiteral<"policy">;
7210
- id: z.ZodString;
7211
7535
  }, z.core.$strip>, z.ZodObject<{
7212
7536
  kind: z.ZodLiteral<"role">;
7213
7537
  id: z.ZodString;
@@ -7235,9 +7559,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7235
7559
  }, z.core.$strip>, z.ZodObject<{
7236
7560
  kind: z.ZodLiteral<"ontology">;
7237
7561
  id: z.ZodString;
7238
- }, z.core.$strip>, z.ZodObject<{
7239
- kind: z.ZodLiteral<"policy">;
7240
- id: z.ZodString;
7241
7562
  }, z.core.$strip>, z.ZodObject<{
7242
7563
  kind: z.ZodLiteral<"role">;
7243
7564
  id: z.ZodString;
@@ -7319,66 +7640,6 @@ declare const OrganizationModelSchema: z.ZodObject<{
7319
7640
  label: z.ZodOptional<z.ZodString>;
7320
7641
  }, z.core.$strip>>>;
7321
7642
  }, z.core.$strip>>>>;
7322
- policies: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7323
- id: z.ZodString;
7324
- order: z.ZodNumber;
7325
- label: z.ZodString;
7326
- description: z.ZodOptional<z.ZodString>;
7327
- trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
7328
- kind: z.ZodLiteral<"event">;
7329
- eventId: z.ZodString;
7330
- }, z.core.$strip>, z.ZodObject<{
7331
- kind: z.ZodLiteral<"action-invocation">;
7332
- actionId: z.ZodString;
7333
- }, z.core.$strip>, z.ZodObject<{
7334
- kind: z.ZodLiteral<"schedule">;
7335
- cron: z.ZodString;
7336
- }, z.core.$strip>, z.ZodObject<{
7337
- kind: z.ZodLiteral<"manual">;
7338
- }, z.core.$strip>], "kind">;
7339
- predicate: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
7340
- kind: z.ZodLiteral<"always">;
7341
- }, z.core.$strip>, z.ZodObject<{
7342
- kind: z.ZodLiteral<"expression">;
7343
- expression: z.ZodString;
7344
- }, z.core.$strip>, z.ZodObject<{
7345
- kind: z.ZodLiteral<"threshold">;
7346
- metric: z.ZodString;
7347
- operator: z.ZodEnum<{
7348
- lt: "lt";
7349
- lte: "lte";
7350
- eq: "eq";
7351
- gte: "gte";
7352
- gt: "gt";
7353
- }>;
7354
- value: z.ZodNumber;
7355
- }, z.core.$strip>], "kind">>;
7356
- actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
7357
- kind: z.ZodLiteral<"require-approval">;
7358
- roleId: z.ZodOptional<z.ZodString>;
7359
- }, z.core.$strip>, z.ZodObject<{
7360
- kind: z.ZodLiteral<"invoke-action">;
7361
- actionId: z.ZodString;
7362
- }, z.core.$strip>, z.ZodObject<{
7363
- kind: z.ZodLiteral<"notify-role">;
7364
- roleId: z.ZodString;
7365
- }, z.core.$strip>, z.ZodObject<{
7366
- kind: z.ZodLiteral<"block">;
7367
- }, z.core.$strip>], "kind">>;
7368
- appliesTo: z.ZodDefault<z.ZodObject<{
7369
- systemIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7370
- actionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7371
- resourceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7372
- roleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
7373
- }, z.core.$strip>>;
7374
- lifecycle: z.ZodDefault<z.ZodEnum<{
7375
- active: "active";
7376
- deprecated: "deprecated";
7377
- draft: "draft";
7378
- beta: "beta";
7379
- archived: "archived";
7380
- }>>;
7381
- }, z.core.$strip>>>>;
7382
7643
  knowledge: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7383
7644
  id: z.ZodString;
7384
7645
  kind: z.ZodEnum<{
@@ -9543,6 +9804,222 @@ declare const ProjectSchemas: {
9543
9804
  }, z.core.$strip>;
9544
9805
  };
9545
9806
 
9807
+ /**
9808
+ * `'running'` is the only in-flight value; every other member is terminal.
9809
+ * Added 2026-08-14 (the step-state model): a producer writes `'running'`
9810
+ * when it starts a step and patches the same row to a terminal status when
9811
+ * the step finishes (`updateAttempt`) — see `CreateContentItemAttemptRequestSchema`
9812
+ * / `UpdateContentItemAttemptRequestSchema` below.
9813
+ */
9814
+ declare const ContentStepStatusSchema: z.ZodEnum<{
9815
+ error: "error";
9816
+ success: "success";
9817
+ running: "running";
9818
+ no_result: "no_result";
9819
+ skipped: "skipped";
9820
+ }>;
9821
+ /** D18: `pipeline_id` is an OM ontology id (free text), not a UUID. */
9822
+ declare const ContentPipelineIdSchema: z.ZodString;
9823
+ /** `content:catalog/status` entries. Free text, model-owned. */
9824
+ declare const ContentItemStatusSchema: z.ZodString;
9825
+ /** `content:catalog/pillar` entries. */
9826
+ declare const ContentPillarSchema: z.ZodString;
9827
+ /** `content:catalog/platform` entries, applied to `content_distributions.platform` / `.format`. */
9828
+ declare const ContentDistributionPlatformSchema: z.ZodString;
9829
+ declare const ContentDistributionFormatSchema: z.ZodString;
9830
+ declare const ContentDistributionStatusSchema: z.ZodString;
9831
+ /**
9832
+ * D12: the payload gets its own column (`content_items.payload` /
9833
+ * `content_item_attempts.payload`). This is the producer's immutable
9834
+ * emission — never edited; `body` is the human's canonical text and
9835
+ * diverges from it on first edit. The field list within the envelope is
9836
+ * declared per-step by the (not-yet-authored) step catalog; this transport
9837
+ * schema validates JSON-object shape and size only, not field membership.
9838
+ */
9839
+ declare const ContentPayloadEnvelopeSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
9840
+ declare const ContentItemResponseSchema: z.ZodObject<{
9841
+ id: z.ZodString;
9842
+ organizationId: z.ZodString;
9843
+ title: z.ZodString;
9844
+ body: z.ZodNullable<z.ZodString>;
9845
+ payload: z.ZodUnknown;
9846
+ status: z.ZodString;
9847
+ pillar: z.ZodNullable<z.ZodString>;
9848
+ pipelineId: z.ZodNullable<z.ZodString>;
9849
+ clientId: z.ZodNullable<z.ZodString>;
9850
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9851
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9852
+ status: z.ZodEnum<{
9853
+ error: "error";
9854
+ success: "success";
9855
+ running: "running";
9856
+ no_result: "no_result";
9857
+ skipped: "skipped";
9858
+ }>;
9859
+ attemptId: z.ZodString;
9860
+ executionId: z.ZodNullable<z.ZodString>;
9861
+ attemptedAt: z.ZodString;
9862
+ data: z.ZodOptional<z.ZodUnknown>;
9863
+ }, z.core.$loose>>;
9864
+ reviewedAt: z.ZodNullable<z.ZodString>;
9865
+ reviewedBy: z.ZodNullable<z.ZodString>;
9866
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9867
+ rejectReason: z.ZodNullable<z.ZodString>;
9868
+ createdBy: z.ZodNullable<z.ZodString>;
9869
+ updatedBy: z.ZodNullable<z.ZodString>;
9870
+ createdAt: z.ZodString;
9871
+ updatedAt: z.ZodString;
9872
+ }, z.core.$strip>;
9873
+ declare const ContentItemListResponseSchema: z.ZodObject<{
9874
+ data: z.ZodArray<z.ZodObject<{
9875
+ id: z.ZodString;
9876
+ organizationId: z.ZodString;
9877
+ title: z.ZodString;
9878
+ body: z.ZodNullable<z.ZodString>;
9879
+ payload: z.ZodUnknown;
9880
+ status: z.ZodString;
9881
+ pillar: z.ZodNullable<z.ZodString>;
9882
+ pipelineId: z.ZodNullable<z.ZodString>;
9883
+ clientId: z.ZodNullable<z.ZodString>;
9884
+ sourceAssetId: z.ZodNullable<z.ZodString>;
9885
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9886
+ status: z.ZodEnum<{
9887
+ error: "error";
9888
+ success: "success";
9889
+ running: "running";
9890
+ no_result: "no_result";
9891
+ skipped: "skipped";
9892
+ }>;
9893
+ attemptId: z.ZodString;
9894
+ executionId: z.ZodNullable<z.ZodString>;
9895
+ attemptedAt: z.ZodString;
9896
+ data: z.ZodOptional<z.ZodUnknown>;
9897
+ }, z.core.$loose>>;
9898
+ reviewedAt: z.ZodNullable<z.ZodString>;
9899
+ reviewedBy: z.ZodNullable<z.ZodString>;
9900
+ reviewerFeedback: z.ZodNullable<z.ZodString>;
9901
+ rejectReason: z.ZodNullable<z.ZodString>;
9902
+ createdBy: z.ZodNullable<z.ZodString>;
9903
+ updatedBy: z.ZodNullable<z.ZodString>;
9904
+ createdAt: z.ZodString;
9905
+ updatedAt: z.ZodString;
9906
+ }, z.core.$strip>>;
9907
+ total: z.ZodNumber;
9908
+ limit: z.ZodNumber;
9909
+ offset: z.ZodNumber;
9910
+ }, z.core.$strip>;
9911
+ declare const ContentItemAttemptResponseSchema: z.ZodObject<{
9912
+ id: z.ZodString;
9913
+ organizationId: z.ZodString;
9914
+ contentItemId: z.ZodString;
9915
+ attemptNumber: z.ZodNumber;
9916
+ stepKey: z.ZodNullable<z.ZodString>;
9917
+ status: z.ZodEnum<{
9918
+ error: "error";
9919
+ success: "success";
9920
+ running: "running";
9921
+ no_result: "no_result";
9922
+ skipped: "skipped";
9923
+ }>;
9924
+ payload: z.ZodUnknown;
9925
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9926
+ createdBy: z.ZodNullable<z.ZodString>;
9927
+ createdAt: z.ZodString;
9928
+ }, z.core.$strip>;
9929
+ declare const ContentItemAttemptListResponseSchema: z.ZodObject<{
9930
+ data: z.ZodArray<z.ZodObject<{
9931
+ id: z.ZodString;
9932
+ organizationId: z.ZodString;
9933
+ contentItemId: z.ZodString;
9934
+ attemptNumber: z.ZodNumber;
9935
+ stepKey: z.ZodNullable<z.ZodString>;
9936
+ status: z.ZodEnum<{
9937
+ error: "error";
9938
+ success: "success";
9939
+ running: "running";
9940
+ no_result: "no_result";
9941
+ skipped: "skipped";
9942
+ }>;
9943
+ payload: z.ZodUnknown;
9944
+ sourceExecutionId: z.ZodNullable<z.ZodString>;
9945
+ createdBy: z.ZodNullable<z.ZodString>;
9946
+ createdAt: z.ZodString;
9947
+ }, z.core.$strip>>;
9948
+ }, z.core.$strip>;
9949
+ declare const ContentSourceAssetResponseSchema: z.ZodObject<{
9950
+ id: z.ZodString;
9951
+ organizationId: z.ZodString;
9952
+ kind: z.ZodString;
9953
+ title: z.ZodString;
9954
+ externalUrl: z.ZodNullable<z.ZodString>;
9955
+ storagePath: z.ZodNullable<z.ZodString>;
9956
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
9957
+ metadata: z.ZodUnknown;
9958
+ payload: z.ZodUnknown;
9959
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9960
+ status: z.ZodEnum<{
9961
+ error: "error";
9962
+ success: "success";
9963
+ running: "running";
9964
+ no_result: "no_result";
9965
+ skipped: "skipped";
9966
+ }>;
9967
+ attemptId: z.ZodString;
9968
+ executionId: z.ZodNullable<z.ZodString>;
9969
+ attemptedAt: z.ZodString;
9970
+ data: z.ZodOptional<z.ZodUnknown>;
9971
+ }, z.core.$loose>>;
9972
+ createdAt: z.ZodString;
9973
+ updatedAt: z.ZodString;
9974
+ }, z.core.$strip>;
9975
+ declare const ContentDistributionResponseSchema: z.ZodObject<{
9976
+ id: z.ZodString;
9977
+ organizationId: z.ZodString;
9978
+ contentItemId: z.ZodString;
9979
+ platform: z.ZodString;
9980
+ format: z.ZodString;
9981
+ status: z.ZodString;
9982
+ adaptedBody: z.ZodNullable<z.ZodString>;
9983
+ platformContent: z.ZodNullable<z.ZodUnknown>;
9984
+ checklist: z.ZodNullable<z.ZodUnknown>;
9985
+ mediaUrls: z.ZodArray<z.ZodUnknown>;
9986
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9987
+ status: z.ZodEnum<{
9988
+ error: "error";
9989
+ success: "success";
9990
+ running: "running";
9991
+ no_result: "no_result";
9992
+ skipped: "skipped";
9993
+ }>;
9994
+ attemptId: z.ZodString;
9995
+ executionId: z.ZodNullable<z.ZodString>;
9996
+ attemptedAt: z.ZodString;
9997
+ data: z.ZodOptional<z.ZodUnknown>;
9998
+ }, z.core.$loose>>;
9999
+ publishMethod: z.ZodNullable<z.ZodString>;
10000
+ publishedAt: z.ZodNullable<z.ZodString>;
10001
+ platformPostId: z.ZodNullable<z.ZodString>;
10002
+ platformUrl: z.ZodNullable<z.ZodString>;
10003
+ metrics: z.ZodUnknown;
10004
+ metricsUpdatedAt: z.ZodNullable<z.ZodString>;
10005
+ createdAt: z.ZodString;
10006
+ updatedAt: z.ZodString;
10007
+ }, z.core.$strip>;
10008
+ type ContentStepStatus = z.infer<typeof ContentStepStatusSchema>;
10009
+ type ContentPipelineId = z.infer<typeof ContentPipelineIdSchema>;
10010
+ type ContentItemStatus = z.infer<typeof ContentItemStatusSchema>;
10011
+ type ContentPillar = z.infer<typeof ContentPillarSchema>;
10012
+ type ContentDistributionPlatform = z.infer<typeof ContentDistributionPlatformSchema>;
10013
+ type ContentDistributionFormat = z.infer<typeof ContentDistributionFormatSchema>;
10014
+ type ContentDistributionStatus = z.infer<typeof ContentDistributionStatusSchema>;
10015
+ type ContentPayloadEnvelope = z.infer<typeof ContentPayloadEnvelopeSchema>;
10016
+ type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
10017
+ type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
10018
+ type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
10019
+ type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
10020
+ type ContentSourceAssetResponse = z.infer<typeof ContentSourceAssetResponseSchema>;
10021
+ type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
10022
+
9546
10023
  /**
9547
10024
  * Tool Method Maps
9548
10025
  *
@@ -10473,6 +10950,219 @@ type ListToolMap = {
10473
10950
  result: string[];
10474
10951
  };
10475
10952
  };
10953
+ type ArtifactsToolMap = {
10954
+ listArtifacts: {
10955
+ params: {
10956
+ ownerKind: AcqArtifactOwnerKind;
10957
+ ownerId?: string | null;
10958
+ };
10959
+ result: {
10960
+ artifacts: AcqArtifactResponse[];
10961
+ };
10962
+ };
10963
+ createArtifact: {
10964
+ params: {
10965
+ ownerKind: AcqArtifactOwnerKind;
10966
+ ownerId?: string | null;
10967
+ kind: string;
10968
+ content: Record<string, unknown>;
10969
+ sourceExecutionId?: string;
10970
+ pipelineId?: string | null;
10971
+ };
10972
+ result: AcqArtifactResponse;
10973
+ };
10974
+ /**
10975
+ * The active governing document for a given pipeline and kind -- the
10976
+ * two-key lookup (pipeline_id, kind) every producer would otherwise
10977
+ * re-implement. Scoped per (organization, pipelineId, kind); a tenant runs
10978
+ * many pipelines at once, so this is never "the active artifact for the org."
10979
+ */
10980
+ getActive: {
10981
+ params: {
10982
+ pipelineId: string;
10983
+ kind: string;
10984
+ };
10985
+ result: {
10986
+ artifact: AcqArtifactResponse | null;
10987
+ };
10988
+ };
10989
+ };
10990
+ type ContentToolMap = {
10991
+ /** Insert a new `content_items` row -- a producer's entry point for a new piece. */
10992
+ createItem: {
10993
+ params: {
10994
+ title: string;
10995
+ body?: string | null;
10996
+ payload?: ContentPayloadEnvelope;
10997
+ status?: ContentItemStatus;
10998
+ pillar?: ContentPillar | null;
10999
+ pipelineId?: ContentPipelineId | null;
11000
+ clientId?: string | null;
11001
+ sourceAssetId?: string | null;
11002
+ };
11003
+ result: ContentItemResponse;
11004
+ };
11005
+ /** Fetch a single item by id, org-scoped -- read before advancing or reviewing a piece. */
11006
+ getItem: {
11007
+ params: {
11008
+ itemId: string;
11009
+ };
11010
+ result: ContentItemResponse | null;
11011
+ };
11012
+ /** Query items -- how a producer finds pieces awaiting a given step or status. */
11013
+ listItems: {
11014
+ params: {
11015
+ status?: ContentItemStatus;
11016
+ pillar?: ContentPillar;
11017
+ pipelineId?: ContentPipelineId;
11018
+ clientId?: string;
11019
+ limit?: number;
11020
+ offset?: number;
11021
+ };
11022
+ result: ContentItemListResponse;
11023
+ };
11024
+ /**
11025
+ * Update an item's mutable fields as it advances through the pipeline.
11026
+ * Does NOT accept a `processingState` field -- see Decision 4 above.
11027
+ */
11028
+ updateItem: {
11029
+ params: {
11030
+ itemId: string;
11031
+ title?: string;
11032
+ body?: string | null;
11033
+ status?: ContentItemStatus;
11034
+ pillar?: ContentPillar | null;
11035
+ pipelineId?: ContentPipelineId | null;
11036
+ clientId?: string | null;
11037
+ sourceAssetId?: string | null;
11038
+ };
11039
+ result: ContentItemResponse;
11040
+ };
11041
+ /**
11042
+ * Record a pipeline-step attempt against an item. `attemptNumber` is
11043
+ * assigned server-side inside the write (Decision 6) -- never
11044
+ * client-supplied, and never accepted here.
11045
+ */
11046
+ createAttempt: {
11047
+ params: {
11048
+ contentItemId: string;
11049
+ payload: ContentPayloadEnvelope;
11050
+ /** Which step this attempt implements. Stored as-is; NULL when omitted. */
11051
+ stepKey?: string | null;
11052
+ sourceExecutionId?: string | null;
11053
+ /**
11054
+ * The status the row is created with. Optional so a producer starting a
11055
+ * step can write `'running'` before doing the work -- the "write-at-start"
11056
+ * half of write-at-start/patch-at-end. Omitted, the column's own default
11057
+ * applies, which is why a producer that means `'running'` must say so.
11058
+ */
11059
+ status?: ContentStepStatus;
11060
+ };
11061
+ result: ContentItemAttemptResponse;
11062
+ };
11063
+ /** List attempt history for an item -- a producer checks this before retrying a step. */
11064
+ listAttempts: {
11065
+ params: {
11066
+ contentItemId: string;
11067
+ };
11068
+ result: ContentItemAttemptListResponse;
11069
+ };
11070
+ /**
11071
+ * Patch an existing attempt to its terminal status -- the "patch-at-end"
11072
+ * half of write-at-start/patch-at-end (see `ContentStepStatus`'s
11073
+ * `'running'` value). `attemptNumber`, `stepKey`, and `sourceExecutionId`
11074
+ * are immutable once written; only `status` and `payload` change here.
11075
+ */
11076
+ updateAttempt: {
11077
+ params: {
11078
+ attemptId: string;
11079
+ status?: ContentStepStatus;
11080
+ payload?: ContentPayloadEnvelope;
11081
+ };
11082
+ result: ContentItemAttemptResponse;
11083
+ };
11084
+ /**
11085
+ * Insert a new `content_source_assets` row. `payload` is an open envelope
11086
+ * (D5, content-source-asset-write-path.mdx) -- per-`kind` field membership
11087
+ * is declared in the OM catalog, not enforced by this transport type.
11088
+ */
11089
+ createSourceAsset: {
11090
+ params: {
11091
+ kind: string;
11092
+ title: string;
11093
+ externalUrl?: string | null;
11094
+ storagePath?: string | null;
11095
+ durationSeconds?: number | null;
11096
+ metadata?: Record<string, unknown>;
11097
+ payload?: ContentPayloadEnvelope;
11098
+ };
11099
+ result: ContentSourceAssetResponse;
11100
+ };
11101
+ /** Fetch a single source asset by id, org-scoped. */
11102
+ getSourceAsset: {
11103
+ params: {
11104
+ sourceAssetId: string;
11105
+ };
11106
+ result: ContentSourceAssetResponse | null;
11107
+ };
11108
+ /** Query source assets -- e.g. a producer picking material for the next item. */
11109
+ listSourceAssets: {
11110
+ params: {
11111
+ kind?: string;
11112
+ limit?: number;
11113
+ offset?: number;
11114
+ };
11115
+ result: {
11116
+ data: ContentSourceAssetResponse[];
11117
+ };
11118
+ };
11119
+ /** Update a source asset's mutable fields. */
11120
+ updateSourceAsset: {
11121
+ params: {
11122
+ sourceAssetId: string;
11123
+ kind?: string;
11124
+ title?: string;
11125
+ externalUrl?: string | null;
11126
+ storagePath?: string | null;
11127
+ durationSeconds?: number | null;
11128
+ metadata?: Record<string, unknown>;
11129
+ payload?: ContentPayloadEnvelope;
11130
+ };
11131
+ result: ContentSourceAssetResponse;
11132
+ };
11133
+ /** Insert a `content_distributions` row for one platform/format target. */
11134
+ createDistribution: {
11135
+ params: {
11136
+ contentItemId: string;
11137
+ platform: ContentDistributionPlatform;
11138
+ format: ContentDistributionFormat;
11139
+ status?: ContentDistributionStatus;
11140
+ adaptedBody?: string | null;
11141
+ platformContent?: unknown;
11142
+ checklist?: unknown;
11143
+ mediaUrls?: unknown[];
11144
+ };
11145
+ result: ContentDistributionResponse;
11146
+ };
11147
+ /** Update a distribution's status, adapted content, or publish metadata. */
11148
+ updateDistribution: {
11149
+ params: {
11150
+ distributionId: string;
11151
+ status?: ContentDistributionStatus;
11152
+ adaptedBody?: string | null;
11153
+ platformContent?: unknown;
11154
+ checklist?: unknown;
11155
+ mediaUrls?: unknown[];
11156
+ publishMethod?: string | null;
11157
+ publishedAt?: string | null;
11158
+ platformPostId?: string | null;
11159
+ platformUrl?: string | null;
11160
+ metrics?: unknown;
11161
+ metricsUpdatedAt?: string | null;
11162
+ };
11163
+ result: ContentDistributionResponse;
11164
+ };
11165
+ };
10476
11166
  type PdfToolMap = {
10477
11167
  render: {
10478
11168
  params: {
@@ -11920,6 +12610,82 @@ declare const crm: TypedAdapter<CrmToolMap>;
11920
12610
 
11921
12611
  declare const list: TypedAdapter<ListToolMap>;
11922
12612
 
12613
+ /**
12614
+ * Artifacts Platform Tool Adapter
12615
+ *
12616
+ * Focused wrapper for the org-scoped governing-document store (rules
12617
+ * documents, idea banks, ICP docs). Singleton export -- no credential needed
12618
+ * (platform tool).
12619
+ *
12620
+ * `kind` convention: any artifact written for the content pipeline (an
12621
+ * `ownerKind: 'organization'` document -- a selection brief, an idea bank,
12622
+ * brand settings) MUST use a `kind` prefixed with `content:`, e.g.
12623
+ * `content:selection-brief`. The `artifacts_manage_content` RLS policy grants
12624
+ * write access to `content.manage` holders ONLY when `kind LIKE 'content:%'`
12625
+ * -- an unprefixed `kind` is rejected server-side with no compile-time error.
12626
+ * Acquisition's own artifacts (audits, proposals, ICP docs) stay unprefixed.
12627
+ * `createArtifact`'s `pipelineId` is required for a later `getActive` call to
12628
+ * ever find the row it writes.
12629
+ */
12630
+
12631
+ declare const artifacts: TypedAdapter<ArtifactsToolMap>;
12632
+
12633
+ /**
12634
+ * Content Platform Tool Adapter
12635
+ *
12636
+ * Typed wrapper over platform.call() for the content System's producer
12637
+ * surface (`content_items`, `content_item_attempts`, `content_distributions`,
12638
+ * `content_source_assets`). Singleton export -- no credential needed
12639
+ * (platform tool).
12640
+ *
12641
+ * `organizationId` is injected server-side by the dispatcher -- never sent
12642
+ * from the SDK. There is deliberately no `updateProcessingState` method:
12643
+ * `content_items.processing_state` and `content_distributions.processing_state`
12644
+ * are not writable through this adapter (content-pipeline execution plan
12645
+ * Decision 4, enforced by omission).
12646
+ *
12647
+ * `createAttempt.sourceExecutionId` is `string | null | undefined` on the
12648
+ * underlying `ContentToolMap` (it is nullable for a future non-execution
12649
+ * caller), but this adapter narrows it to a **required** `string` for
12650
+ * producer-authored attempts -- the SDK-layer analog of `organizationId`
12651
+ * never appearing in the params type at all. A worker always has its own
12652
+ * `context.executionId` available, so requiring it here is a compile-time
12653
+ * guarantee that a workflow cannot forget it, matching the step-state
12654
+ * model's write-at-start/patch-at-end contract (see `mock-pipeline-shared.ts`).
12655
+ *
12656
+ * `createAttempt.status` is a real field on `ContentToolMap` -- a producer
12657
+ * starting a step sends `'running'` and the dispatcher forwards it. It was
12658
+ * briefly missing from both the tool map and the dispatcher's forward, which
12659
+ * meant a create-time status was accepted by the Zod schema and then dropped,
12660
+ * landing the row on the column default. Both were closed on 2026-08-15.
12661
+ */
12662
+
12663
+ /** The content adapter's public shape -- `TypedAdapter<ContentToolMap>` with `createAttempt` narrowed. */
12664
+ type ContentAdapter = Omit<TypedAdapter<ContentToolMap>, 'createAttempt'> & {
12665
+ createAttempt: (params: Omit<ContentToolMap['createAttempt']['params'], 'sourceExecutionId'> & {
12666
+ sourceExecutionId: string;
12667
+ }) => Promise<ContentToolMap['createAttempt']['result']>;
12668
+ };
12669
+ /**
12670
+ * Typed content adapter for the content pipeline's producer surface.
12671
+ *
12672
+ * @example
12673
+ * ```ts
12674
+ * import { content } from '@elevasis/sdk/worker'
12675
+ *
12676
+ * const item = await content.createItem({ title: 'Draft', pipelineId: 'long-form-to-shorts' })
12677
+ * const attempt = await content.createAttempt({
12678
+ * contentItemId: item.id,
12679
+ * stepKey: 'clip-proposal',
12680
+ * status: 'running',
12681
+ * payload: {},
12682
+ * sourceExecutionId: context.executionId
12683
+ * })
12684
+ * const settled = await content.updateAttempt({ attemptId: attempt.id, status: 'success', payload: { body: '...' } })
12685
+ * ```
12686
+ */
12687
+ declare const content: ContentAdapter;
12688
+
11923
12689
  /**
11924
12690
  * Typed PDF adapter for document rendering.
11925
12691
  *
@@ -12108,5 +12874,5 @@ declare function executeWorkflow(workflow: WorkflowDefinition, input: unknown, c
12108
12874
  }>;
12109
12875
  declare function startWorker(org: DeploymentSpec): void;
12110
12876
 
12111
- export { ListBuilderResultSchema, ListBuilderResultsSchema, PlatformToolError, acqDb, approval, classifyPlatformToolError, createAdapter, createAnymailfinderAdapter, createApifyAdapter, createAttioAdapter, createClickUpAdapter, createDropboxAdapter, createGmailAdapter, createGoogleSheetsAdapter, createInstantlyAdapter, createMillionVerifierAdapter, createResendAdapter, createSignatureApiAdapter, createStripeAdapter, createTombaAdapter, crm, email, executeWorkflow, execution, generateHmacToken, list, listBuilderWorkflow, llm, notifications, pdf, platform, projects, scheduler, startWorker, storage };
12877
+ export { ListBuilderResultSchema, ListBuilderResultsSchema, PlatformToolError, acqDb, approval, artifacts, classifyPlatformToolError, content, createAdapter, createAnymailfinderAdapter, createApifyAdapter, createAttioAdapter, createClickUpAdapter, createDropboxAdapter, createGmailAdapter, createGoogleSheetsAdapter, createInstantlyAdapter, createMillionVerifierAdapter, createResendAdapter, createSignatureApiAdapter, createStripeAdapter, createTombaAdapter, crm, email, executeWorkflow, execution, generateHmacToken, list, listBuilderWorkflow, llm, notifications, pdf, platform, projects, scheduler, startWorker, storage };
12112
12878
  export type { ClassifyPlatformToolErrorOptions, ListBuilderBatch, ListBuilderEnvelope, ListBuilderRecord, ListBuilderResult, ListBuilderWorkflowDefinition, ListBuilderWorkflowOptions, LogEntry, NotificationInput, PlatformCredential, PlatformToolErrorClassification, TypedAdapter };