@elevasis/sdk 1.48.0 → 1.49.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 (46) hide show
  1. package/dist/cli.cjs +742 -231
  2. package/dist/index.d.ts +685 -47
  3. package/dist/index.js +274 -40
  4. package/dist/node/index.d.ts +108 -24
  5. package/dist/test-utils/index.d.ts +647 -34
  6. package/dist/test-utils/index.js +240 -38
  7. package/dist/worker/index.d.ts +663 -39
  8. package/dist/worker/index.js +115 -6
  9. package/package.json +4 -4
  10. package/reference/_navigation.md +4 -4
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/core/index.mdx +6 -4
  13. package/reference/index.mdx +11 -5
  14. package/reference/packages/core/src/README.md +46 -44
  15. package/reference/packages/core/src/content/README.md +13 -12
  16. package/reference/rules/ui.md +1 -1
  17. package/reference/rules/vibe-intents.md +2 -2
  18. package/reference/rules/vibe.md +30 -10
  19. package/reference/scaffold/recipes/extend-content.md +82 -3
  20. package/reference/sdk/cli-management.mdx +184 -41
  21. package/reference/sdk/cli.mdx +103 -64
  22. package/reference/sdk/define-builders.mdx +1 -1
  23. package/reference/sdk/deployment/command-center.mdx +2 -2
  24. package/reference/sdk/deployment/index.mdx +1 -1
  25. package/reference/sdk/exports.mdx +4 -4
  26. package/reference/sdk/framework/agent.mdx +4 -3
  27. package/reference/sdk/framework/index.mdx +1 -1
  28. package/reference/sdk/framework/project-structure.mdx +34 -23
  29. package/reference/sdk/framework/tutorial-system.mdx +1 -1
  30. package/reference/sdk/getting-started.mdx +25 -52
  31. package/reference/sdk/index.mdx +3 -3
  32. package/reference/sdk/platform-tools/adapters-integration.mdx +1 -1
  33. package/reference/sdk/platform-tools/adapters-platform.mdx +1 -1
  34. package/reference/sdk/platform-tools/type-safety.mdx +1 -1
  35. package/reference/sdk/resources/patterns.mdx +10 -11
  36. package/reference/sdk/resources/types.mdx +15 -9
  37. package/reference/sdk/templates/data-enrichment.mdx +1 -1
  38. package/reference/sdk/templates/email-sender.mdx +1 -1
  39. package/reference/sdk/templates/index.mdx +47 -47
  40. package/reference/sdk/templates/lead-scorer.mdx +1 -1
  41. package/reference/sdk/templates/pdf-generator.mdx +42 -24
  42. package/reference/sdk/templates/recurring-job.mdx +20 -15
  43. package/reference/sdk/templates/text-classifier.mdx +1 -1
  44. package/reference/sdk/templates/web-scraper.mdx +9 -5
  45. package/reference/ui/exports.mdx +1 -1
  46. package/reference/ui/index.mdx +2 -2
@@ -812,13 +812,52 @@ interface JsonSchema {
812
812
  * Universal interfaces for LLM interaction across all resource types
813
813
  */
814
814
 
815
+ /**
816
+ * One piece of a multipart `LLMMessage.content`. Modeled close to OpenAI's shape (a single `url`
817
+ * field covers both a hosted URL and a `data:` base64 URL) rather than Anthropic's three-way
818
+ * `source` split, because OpenAI's shape is the one every provider's translation layer can derive
819
+ * the other from -- the Anthropic adapter is the side that branches on the `data:` prefix to
820
+ * recover the split its wire format wants (see `adapters/server/anthropic.ts`).
821
+ */
822
+ type LLMContentPart = {
823
+ type: 'text';
824
+ text: string;
825
+ } | {
826
+ type: 'image';
827
+ /**
828
+ * A `data:<mediaType>;base64,<data>` URL, or an `https://...` URL the provider fetches
829
+ * itself. Base64 is the recommended default: a hosted `url` means the PROVIDER fetches it
830
+ * at call time, so a signed org-storage URL must still be public and unexpired when the
831
+ * provider reaches it, an extra failure mode a caller must manage. Base64 removes that
832
+ * dependency at the cost of payload size -- Anthropic caps a single image at 10 MB.
833
+ */
834
+ url: string;
835
+ /** Overrides the media type parsed off a `data:` URL prefix. Required when `url` is a
836
+ * hosted (non-`data:`) URL and the provider needs it -- Anthropic's `url` source infers
837
+ * the type itself, but callers on a stricter provider should not assume that. */
838
+ mediaType?: string;
839
+ /** OpenAI-only hint for how much detail to preserve when downsampling. Ignored by
840
+ * providers (Anthropic, OpenRouter-as-Anthropic) that do not read it. */
841
+ detail?: 'auto' | 'low' | 'high';
842
+ };
815
843
  /**
816
844
  * Standard chat message format
817
845
  * Compatible with OpenAI, Anthropic, and other providers
818
846
  */
819
847
  interface LLMMessage {
820
848
  role: 'system' | 'user' | 'assistant';
821
- content: string;
849
+ /**
850
+ * A plain string for the common unstructured case, or a parts array to attach an image
851
+ * alongside (or instead of) text -- see `LLMContentPart`. This is a WIDENING, not a
852
+ * replacement: every existing caller passing a bare string keeps compiling and behaving
853
+ * identically.
854
+ *
855
+ * Not every model/adapter can accept an `image` part -- `MockAdapter` throws
856
+ * `LLMUnsupportedContentError` rather than silently ignoring it, and a caller sending an image
857
+ * to a text-only integration should expect the same rather than a plausible-looking
858
+ * text-degraded response. See `llm/errors.ts`.
859
+ */
860
+ content: string | LLMContentPart[];
822
861
  /**
823
862
  * Marks this message as the end of a byte-stable prefix worth an Anthropic cache breakpoint,
824
863
  * beyond the one the system prompt already gets. Anthropic's rule is "everything up to and
@@ -1017,8 +1056,13 @@ interface LLMAdapter {
1017
1056
 
1018
1057
  /**
1019
1058
  * Supported Open AI models (direct SDK access)
1059
+ *
1060
+ * The GPT-5.6 tiers are three separate ids rather than the bare `gpt-5.6` alias. Upstream that
1061
+ * alias routes to Sol, so registering it would put two keys with identical pricing in `MODEL_INFO`
1062
+ * and hide which tier actually ran in `ai_calls`. Leaving it out means a caller who writes
1063
+ * `'gpt-5.6'` is rejected by the dispatcher rather than silently billed at Sol rates.
1020
1064
  */
1021
- type OpenAIModel = 'gpt-5' | 'gpt-5.4-mini' | 'gpt-5.4-nano';
1065
+ type OpenAIModel = 'gpt-5' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna';
1022
1066
  /**
1023
1067
  * Supported OpenRouter models (explicit union for type safety)
1024
1068
  */
@@ -1034,15 +1078,36 @@ type LLMModel = OpenAIModel | OpenRouterModel | AnthropicModel | 'mock';
1034
1078
  */
1035
1079
  declare const GPT5OptionsSchema: z.ZodObject<{
1036
1080
  reasoning_effort: z.ZodOptional<z.ZodEnum<{
1081
+ low: "low";
1082
+ high: "high";
1037
1083
  minimal: "minimal";
1084
+ medium: "medium";
1085
+ }>>;
1086
+ verbosity: z.ZodOptional<z.ZodEnum<{
1038
1087
  low: "low";
1088
+ high: "high";
1039
1089
  medium: "medium";
1090
+ }>>;
1091
+ }, z.core.$strip>;
1092
+ /**
1093
+ * GPT-5.6 model options schema
1094
+ *
1095
+ * NOT the GPT-5 enum. 5.6 removed `minimal` and added `none`, `xhigh`, and `max`, so reusing
1096
+ * `GPT5OptionsSchema` would accept one value 5.6 rejects and reject three it accepts.
1097
+ */
1098
+ declare const GPT56OptionsSchema: z.ZodObject<{
1099
+ reasoning_effort: z.ZodOptional<z.ZodEnum<{
1100
+ none: "none";
1101
+ low: "low";
1040
1102
  high: "high";
1103
+ medium: "medium";
1104
+ xhigh: "xhigh";
1105
+ max: "max";
1041
1106
  }>>;
1042
1107
  verbosity: z.ZodOptional<z.ZodEnum<{
1043
1108
  low: "low";
1044
- medium: "medium";
1045
1109
  high: "high";
1110
+ medium: "medium";
1046
1111
  }>>;
1047
1112
  }, z.core.$strip>;
1048
1113
  /**
@@ -1064,10 +1129,11 @@ declare const AnthropicOptionsSchema: z.ZodObject<{}, z.core.$strict>;
1064
1129
  * Infer TypeScript types from schemas
1065
1130
  */
1066
1131
  type GPT5Options = z.infer<typeof GPT5OptionsSchema>;
1132
+ type GPT56Options = z.infer<typeof GPT56OptionsSchema>;
1067
1133
  type MockOptions = Record<string, never>;
1068
1134
  type OpenRouterOptions = z.infer<typeof OpenRouterOptionsSchema>;
1069
1135
  type AnthropicOptions = z.infer<typeof AnthropicOptionsSchema>;
1070
- type ModelSpecificOptions = GPT5Options | MockOptions | OpenRouterOptions | AnthropicOptions;
1136
+ type ModelSpecificOptions = GPT5Options | GPT56Options | MockOptions | OpenRouterOptions | AnthropicOptions;
1071
1137
  /**
1072
1138
  * Model configuration for LLM execution
1073
1139
  * Belongs in resource definition (AgentDefinition, WorkflowDefinition, etc.)
@@ -3044,6 +3110,63 @@ type Database = {
3044
3110
  }
3045
3111
  ];
3046
3112
  };
3113
+ content_item_source_assets: {
3114
+ Row: {
3115
+ alt_text: string | null;
3116
+ content_item_id: string;
3117
+ created_at: string;
3118
+ crop: Json | null;
3119
+ derivative_crop: Json | null;
3120
+ derivative_path: string | null;
3121
+ derivative_rendered_at: string | null;
3122
+ id: string;
3123
+ organization_id: string;
3124
+ position: number;
3125
+ source_asset_id: string;
3126
+ };
3127
+ Insert: {
3128
+ alt_text?: string | null;
3129
+ content_item_id: string;
3130
+ created_at?: string;
3131
+ crop?: Json | null;
3132
+ derivative_crop?: Json | null;
3133
+ derivative_path?: string | null;
3134
+ derivative_rendered_at?: string | null;
3135
+ id?: string;
3136
+ organization_id: string;
3137
+ position: number;
3138
+ source_asset_id: string;
3139
+ };
3140
+ Update: {
3141
+ alt_text?: string | null;
3142
+ content_item_id?: string;
3143
+ created_at?: string;
3144
+ crop?: Json | null;
3145
+ derivative_crop?: Json | null;
3146
+ derivative_path?: string | null;
3147
+ derivative_rendered_at?: string | null;
3148
+ id?: string;
3149
+ organization_id?: string;
3150
+ position?: number;
3151
+ source_asset_id?: string;
3152
+ };
3153
+ Relationships: [
3154
+ {
3155
+ foreignKeyName: "content_item_source_assets_asset_fkey";
3156
+ columns: ["source_asset_id", "organization_id"];
3157
+ isOneToOne: false;
3158
+ referencedRelation: "content_source_assets";
3159
+ referencedColumns: ["id", "organization_id"];
3160
+ },
3161
+ {
3162
+ foreignKeyName: "content_item_source_assets_item_fkey";
3163
+ columns: ["content_item_id", "organization_id"];
3164
+ isOneToOne: false;
3165
+ referencedRelation: "content_items";
3166
+ referencedColumns: ["id", "organization_id"];
3167
+ }
3168
+ ];
3169
+ };
3047
3170
  content_items: {
3048
3171
  Row: {
3049
3172
  body: string | null;
@@ -4799,6 +4922,25 @@ type Database = {
4799
4922
  };
4800
4923
  Returns: Json;
4801
4924
  };
4925
+ activate_deployment_atomic: {
4926
+ Args: {
4927
+ p_deployment_id: string;
4928
+ p_organization_id: string;
4929
+ };
4930
+ Returns: {
4931
+ created_at: string;
4932
+ deployment_version: string | null;
4933
+ error_message: string | null;
4934
+ id: string;
4935
+ organization_id: string;
4936
+ pid: number | null;
4937
+ port: number | null;
4938
+ sdk_version: string;
4939
+ status: string;
4940
+ tarball_path: string | null;
4941
+ updated_at: string;
4942
+ };
4943
+ };
4802
4944
  append_deal_activity: {
4803
4945
  Args: {
4804
4946
  p_activity: Json;
@@ -6398,7 +6540,9 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6398
6540
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6399
6541
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6400
6542
  storage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6401
- }, z.core.$loose>>>>;
6543
+ rowSchema: z.ZodOptional<z.ZodString>;
6544
+ stateCatalogId: z.ZodOptional<z.ZodString>;
6545
+ }, z.core.$strict>>>>;
6402
6546
  linkTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6403
6547
  id: z.ZodString;
6404
6548
  label: z.ZodOptional<z.ZodString>;
@@ -6409,7 +6553,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6409
6553
  to: z.ZodString;
6410
6554
  cardinality: z.ZodOptional<z.ZodString>;
6411
6555
  via: z.ZodOptional<z.ZodString>;
6412
- }, z.core.$loose>>>>;
6556
+ }, z.core.$strict>>>>;
6413
6557
  actionTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6414
6558
  id: z.ZodString;
6415
6559
  label: z.ZodOptional<z.ZodString>;
@@ -6419,7 +6563,11 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6419
6563
  actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
6420
6564
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6421
6565
  effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
6422
- }, z.core.$loose>>>>;
6566
+ resourceId: z.ZodOptional<z.ZodString>;
6567
+ invocations: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
6568
+ lifecycle: z.ZodOptional<z.ZodString>;
6569
+ legacyActionId: z.ZodOptional<z.ZodString>;
6570
+ }, z.core.$strict>>>>;
6423
6571
  catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6424
6572
  id: z.ZodString;
6425
6573
  label: z.ZodOptional<z.ZodString>;
@@ -6429,7 +6577,10 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6429
6577
  kind: z.ZodOptional<z.ZodString>;
6430
6578
  appliesTo: z.ZodOptional<z.ZodString>;
6431
6579
  entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6432
- }, z.core.$loose>>>>;
6580
+ legacyCatalogKey: z.ZodOptional<z.ZodString>;
6581
+ legacyPipelineKey: z.ZodOptional<z.ZodString>;
6582
+ legacyEntityKey: z.ZodOptional<z.ZodString>;
6583
+ }, z.core.$strict>>>>;
6433
6584
  eventTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6434
6585
  id: z.ZodString;
6435
6586
  label: z.ZodOptional<z.ZodString>;
@@ -6437,7 +6588,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6437
6588
  ownerSystemId: z.ZodOptional<z.ZodString>;
6438
6589
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6439
6590
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6440
- }, z.core.$loose>>>>;
6591
+ }, z.core.$strict>>>>;
6441
6592
  interfaceTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6442
6593
  id: z.ZodString;
6443
6594
  label: z.ZodOptional<z.ZodString>;
@@ -6445,7 +6596,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6445
6596
  ownerSystemId: z.ZodOptional<z.ZodString>;
6446
6597
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6447
6598
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6448
- }, z.core.$loose>>>>;
6599
+ }, z.core.$strict>>>>;
6449
6600
  valueTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6450
6601
  id: z.ZodString;
6451
6602
  label: z.ZodOptional<z.ZodString>;
@@ -6453,7 +6604,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6453
6604
  ownerSystemId: z.ZodOptional<z.ZodString>;
6454
6605
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6455
6606
  primitive: z.ZodOptional<z.ZodString>;
6456
- }, z.core.$loose>>>>;
6607
+ }, z.core.$strict>>>>;
6457
6608
  sharedProperties: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6458
6609
  id: z.ZodString;
6459
6610
  label: z.ZodOptional<z.ZodString>;
@@ -6463,7 +6614,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6463
6614
  valueType: z.ZodOptional<z.ZodString>;
6464
6615
  searchable: z.ZodOptional<z.ZodBoolean>;
6465
6616
  pii: z.ZodOptional<z.ZodBoolean>;
6466
- }, z.core.$loose>>>>;
6617
+ }, z.core.$strict>>>>;
6467
6618
  groups: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6468
6619
  id: z.ZodString;
6469
6620
  label: z.ZodOptional<z.ZodString>;
@@ -6471,7 +6622,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6471
6622
  ownerSystemId: z.ZodOptional<z.ZodString>;
6472
6623
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6473
6624
  members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
6474
- }, z.core.$loose>>>>;
6625
+ }, z.core.$strict>>>>;
6475
6626
  endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
6476
6627
  id: z.ZodString;
6477
6628
  label: z.ZodOptional<z.ZodString>;
@@ -6479,7 +6630,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
6479
6630
  ownerSystemId: z.ZodOptional<z.ZodString>;
6480
6631
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
6481
6632
  route: z.ZodOptional<z.ZodString>;
6482
- }, z.core.$loose>>>>;
6633
+ }, z.core.$strict>>>>;
6483
6634
  }, z.core.$strict>>;
6484
6635
  type OntologyScope = z.infer<typeof OntologyScopeSchema>;
6485
6636
 
@@ -7045,7 +7196,9 @@ declare const OrganizationModelSchema: z.ZodObject<{
7045
7196
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7046
7197
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7047
7198
  storage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7048
- }, z.core.$loose>>>>;
7199
+ rowSchema: z.ZodOptional<z.ZodString>;
7200
+ stateCatalogId: z.ZodOptional<z.ZodString>;
7201
+ }, z.core.$strict>>>>;
7049
7202
  linkTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7050
7203
  id: z.ZodString;
7051
7204
  label: z.ZodOptional<z.ZodString>;
@@ -7056,7 +7209,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7056
7209
  to: z.ZodString;
7057
7210
  cardinality: z.ZodOptional<z.ZodString>;
7058
7211
  via: z.ZodOptional<z.ZodString>;
7059
- }, z.core.$loose>>>>;
7212
+ }, z.core.$strict>>>>;
7060
7213
  actionTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7061
7214
  id: z.ZodString;
7062
7215
  label: z.ZodOptional<z.ZodString>;
@@ -7066,7 +7219,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
7066
7219
  actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
7067
7220
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7068
7221
  effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
7069
- }, z.core.$loose>>>>;
7222
+ resourceId: z.ZodOptional<z.ZodString>;
7223
+ invocations: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
7224
+ lifecycle: z.ZodOptional<z.ZodString>;
7225
+ legacyActionId: z.ZodOptional<z.ZodString>;
7226
+ }, z.core.$strict>>>>;
7070
7227
  catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7071
7228
  id: z.ZodString;
7072
7229
  label: z.ZodOptional<z.ZodString>;
@@ -7076,7 +7233,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
7076
7233
  kind: z.ZodOptional<z.ZodString>;
7077
7234
  appliesTo: z.ZodOptional<z.ZodString>;
7078
7235
  entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7079
- }, z.core.$loose>>>>;
7236
+ legacyCatalogKey: z.ZodOptional<z.ZodString>;
7237
+ legacyPipelineKey: z.ZodOptional<z.ZodString>;
7238
+ legacyEntityKey: z.ZodOptional<z.ZodString>;
7239
+ }, z.core.$strict>>>>;
7080
7240
  eventTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7081
7241
  id: z.ZodString;
7082
7242
  label: z.ZodOptional<z.ZodString>;
@@ -7084,7 +7244,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7084
7244
  ownerSystemId: z.ZodOptional<z.ZodString>;
7085
7245
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7086
7246
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7087
- }, z.core.$loose>>>>;
7247
+ }, z.core.$strict>>>>;
7088
7248
  interfaceTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7089
7249
  id: z.ZodString;
7090
7250
  label: z.ZodOptional<z.ZodString>;
@@ -7092,7 +7252,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7092
7252
  ownerSystemId: z.ZodOptional<z.ZodString>;
7093
7253
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7094
7254
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7095
- }, z.core.$loose>>>>;
7255
+ }, z.core.$strict>>>>;
7096
7256
  valueTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7097
7257
  id: z.ZodString;
7098
7258
  label: z.ZodOptional<z.ZodString>;
@@ -7100,7 +7260,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7100
7260
  ownerSystemId: z.ZodOptional<z.ZodString>;
7101
7261
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7102
7262
  primitive: z.ZodOptional<z.ZodString>;
7103
- }, z.core.$loose>>>>;
7263
+ }, z.core.$strict>>>>;
7104
7264
  sharedProperties: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7105
7265
  id: z.ZodString;
7106
7266
  label: z.ZodOptional<z.ZodString>;
@@ -7110,7 +7270,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7110
7270
  valueType: z.ZodOptional<z.ZodString>;
7111
7271
  searchable: z.ZodOptional<z.ZodBoolean>;
7112
7272
  pii: z.ZodOptional<z.ZodBoolean>;
7113
- }, z.core.$loose>>>>;
7273
+ }, z.core.$strict>>>>;
7114
7274
  groups: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7115
7275
  id: z.ZodString;
7116
7276
  label: z.ZodOptional<z.ZodString>;
@@ -7118,7 +7278,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7118
7278
  ownerSystemId: z.ZodOptional<z.ZodString>;
7119
7279
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7120
7280
  members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
7121
- }, z.core.$loose>>>>;
7281
+ }, z.core.$strict>>>>;
7122
7282
  endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
7123
7283
  id: z.ZodString;
7124
7284
  label: z.ZodOptional<z.ZodString>;
@@ -7126,7 +7286,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
7126
7286
  ownerSystemId: z.ZodOptional<z.ZodString>;
7127
7287
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7128
7288
  route: z.ZodOptional<z.ZodString>;
7129
- }, z.core.$loose>>>>;
7289
+ }, z.core.$strict>>>>;
7130
7290
  }, z.core.$strict>>>;
7131
7291
  resources: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
7132
7292
  id: z.ZodString;
@@ -8143,6 +8303,166 @@ interface CreateFolderResult {
8143
8303
  path_display: string;
8144
8304
  } | null;
8145
8305
  }
8306
+ /**
8307
+ * List folder parameters
8308
+ *
8309
+ * Pass `cursor` (from a previous result) to fetch only what changed since
8310
+ * that cursor -- Dropbox's incremental-sync mechanism, not an optional
8311
+ * convenience.
8312
+ */
8313
+ interface ListFolderParams {
8314
+ path?: string;
8315
+ recursive?: boolean;
8316
+ cursor?: string;
8317
+ }
8318
+ /**
8319
+ * A single file or folder entry returned by listFolder
8320
+ */
8321
+ interface DropboxListFolderEntry {
8322
+ '.tag': 'file' | 'folder' | 'deleted';
8323
+ id: string;
8324
+ name: string;
8325
+ path_lower?: string;
8326
+ path_display?: string;
8327
+ size?: number;
8328
+ content_hash?: string;
8329
+ }
8330
+ /**
8331
+ * List folder result
8332
+ */
8333
+ interface ListFolderResult {
8334
+ entries: DropboxListFolderEntry[];
8335
+ cursor: string;
8336
+ has_more: boolean;
8337
+ }
8338
+ /**
8339
+ * Get metadata parameters
8340
+ */
8341
+ interface GetMetadataParams {
8342
+ id: string;
8343
+ }
8344
+ /**
8345
+ * Photo/video-specific metadata
8346
+ */
8347
+ interface DropboxMediaMetadata {
8348
+ '.tag': 'photo' | 'video';
8349
+ dimensions?: {
8350
+ height: number;
8351
+ width: number;
8352
+ };
8353
+ time_taken?: string;
8354
+ }
8355
+ /**
8356
+ * Wrapper around media metadata, matching Dropbox's tagged-union response shape
8357
+ */
8358
+ interface DropboxMediaInfo {
8359
+ '.tag': 'metadata' | 'absent';
8360
+ metadata?: DropboxMediaMetadata;
8361
+ }
8362
+ /**
8363
+ * Get metadata result
8364
+ */
8365
+ interface GetMetadataResult {
8366
+ id: string;
8367
+ name: string;
8368
+ path_lower?: string;
8369
+ path_display?: string;
8370
+ size?: number;
8371
+ content_hash?: string;
8372
+ media_info?: DropboxMediaInfo;
8373
+ }
8374
+ /**
8375
+ * Get temporary link parameters
8376
+ */
8377
+ interface GetTemporaryLinkParams {
8378
+ id: string;
8379
+ }
8380
+ /**
8381
+ * Get temporary link result (valid four hours, never persist)
8382
+ */
8383
+ interface GetTemporaryLinkResult {
8384
+ link: string;
8385
+ metadata: {
8386
+ id: string;
8387
+ name: string;
8388
+ path_lower?: string;
8389
+ path_display?: string;
8390
+ };
8391
+ }
8392
+ /**
8393
+ * Create shared link parameters
8394
+ */
8395
+ interface CreateSharedLinkParams {
8396
+ id: string;
8397
+ }
8398
+ /**
8399
+ * Create shared link result (url is always the raw, bytes-inline form)
8400
+ */
8401
+ interface CreateSharedLinkResult {
8402
+ url: string;
8403
+ id: string;
8404
+ name: string;
8405
+ }
8406
+ /**
8407
+ * Download parameters
8408
+ */
8409
+ interface DownloadParams {
8410
+ id: string;
8411
+ }
8412
+ /**
8413
+ * Download result (Uint8Array for browser safety)
8414
+ */
8415
+ interface DownloadResult {
8416
+ content: Uint8Array;
8417
+ contentType: string;
8418
+ name: string;
8419
+ }
8420
+ type DropboxThumbnailFormat = 'jpeg' | 'png';
8421
+ type DropboxThumbnailSize = 'w32h32' | 'w64h64' | 'w128h128' | 'w256h256' | 'w480h320' | 'w640h480' | 'w960h640' | 'w1024h768' | 'w2048h1536';
8422
+ /**
8423
+ * Get thumbnail parameters
8424
+ */
8425
+ interface GetThumbnailParams {
8426
+ id: string;
8427
+ format?: DropboxThumbnailFormat;
8428
+ size?: DropboxThumbnailSize;
8429
+ }
8430
+ /**
8431
+ * Get thumbnail result (Uint8Array for browser safety)
8432
+ *
8433
+ * `available: false` is a normal result, not an error -- Dropbox does not
8434
+ * convert every file type (e.g. HEIC) or files over 20MB.
8435
+ */
8436
+ interface GetThumbnailResult {
8437
+ available: boolean;
8438
+ content?: Uint8Array;
8439
+ contentType?: string;
8440
+ }
8441
+ /**
8442
+ * Get thumbnail batch parameters
8443
+ *
8444
+ * Dropbox caps this at 25 ids per request.
8445
+ */
8446
+ interface GetThumbnailBatchParams {
8447
+ ids: string[];
8448
+ format?: DropboxThumbnailFormat;
8449
+ size?: DropboxThumbnailSize;
8450
+ }
8451
+ /**
8452
+ * A single entry in a batch thumbnail result (Uint8Array for browser safety)
8453
+ */
8454
+ interface ThumbnailBatchEntry {
8455
+ id: string;
8456
+ available: boolean;
8457
+ content?: Uint8Array;
8458
+ contentType?: string;
8459
+ }
8460
+ /**
8461
+ * Get thumbnail batch result
8462
+ */
8463
+ interface GetThumbnailBatchResult {
8464
+ entries: ThumbnailBatchEntry[];
8465
+ }
8146
8466
 
8147
8467
  /**
8148
8468
  * Shared Gmail param/result types (browser-safe)
@@ -9598,6 +9918,78 @@ declare const ContentDistributionStatusSchema: z.ZodString;
9598
9918
  * schema validates JSON-object shape and size only, not field membership.
9599
9919
  */
9600
9920
  declare const ContentPayloadEnvelopeSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
9921
+ /** Request-side crop: `.strict()`, the same mass-assignment guard every request schema in this file uses. */
9922
+ declare const ContentAssetCropInputSchema: z.ZodObject<{
9923
+ x: z.ZodNumber;
9924
+ y: z.ZodNumber;
9925
+ width: z.ZodNumber;
9926
+ height: z.ZodNumber;
9927
+ }, z.core.$strict>;
9928
+ declare const ContentItemSourceAssetResponseSchema: z.ZodObject<{
9929
+ id: z.ZodString;
9930
+ organizationId: z.ZodString;
9931
+ contentItemId: z.ZodString;
9932
+ sourceAssetId: z.ZodString;
9933
+ position: z.ZodNumber;
9934
+ crop: z.ZodNullable<z.ZodObject<{
9935
+ x: z.ZodNumber;
9936
+ y: z.ZodNumber;
9937
+ width: z.ZodNumber;
9938
+ height: z.ZodNumber;
9939
+ }, z.core.$strip>>;
9940
+ altText: z.ZodNullable<z.ZodString>;
9941
+ derivativePath: z.ZodNullable<z.ZodString>;
9942
+ derivativeCrop: z.ZodNullable<z.ZodObject<{
9943
+ x: z.ZodNumber;
9944
+ y: z.ZodNumber;
9945
+ width: z.ZodNumber;
9946
+ height: z.ZodNumber;
9947
+ }, z.core.$strip>>;
9948
+ derivativeRenderedAt: z.ZodNullable<z.ZodString>;
9949
+ createdAt: z.ZodString;
9950
+ }, z.core.$strip>;
9951
+ declare const ContentItemSourceAssetListResponseSchema: z.ZodObject<{
9952
+ data: z.ZodArray<z.ZodObject<{
9953
+ id: z.ZodString;
9954
+ organizationId: z.ZodString;
9955
+ contentItemId: z.ZodString;
9956
+ sourceAssetId: z.ZodString;
9957
+ position: z.ZodNumber;
9958
+ crop: z.ZodNullable<z.ZodObject<{
9959
+ x: z.ZodNumber;
9960
+ y: z.ZodNumber;
9961
+ width: z.ZodNumber;
9962
+ height: z.ZodNumber;
9963
+ }, z.core.$strip>>;
9964
+ altText: z.ZodNullable<z.ZodString>;
9965
+ derivativePath: z.ZodNullable<z.ZodString>;
9966
+ derivativeCrop: z.ZodNullable<z.ZodObject<{
9967
+ x: z.ZodNumber;
9968
+ y: z.ZodNumber;
9969
+ width: z.ZodNumber;
9970
+ height: z.ZodNumber;
9971
+ }, z.core.$strip>>;
9972
+ derivativeRenderedAt: z.ZodNullable<z.ZodString>;
9973
+ createdAt: z.ZodString;
9974
+ }, z.core.$strip>>;
9975
+ }, z.core.$strip>;
9976
+ /**
9977
+ * One membership as a caller supplies it. Two callers share it:
9978
+ * `CreateContentItemRequestSchema.sourceAssets` (the ordered set a carousel is
9979
+ * created with, in one transaction) and the body of the `addItemSourceAsset`
9980
+ * write, whose `itemId` arrives as a path param rather than in the body.
9981
+ */
9982
+ declare const ContentItemSourceAssetInputSchema: z.ZodObject<{
9983
+ sourceAssetId: z.ZodString;
9984
+ position: z.ZodNumber;
9985
+ crop: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9986
+ x: z.ZodNumber;
9987
+ y: z.ZodNumber;
9988
+ width: z.ZodNumber;
9989
+ height: z.ZodNumber;
9990
+ }, z.core.$strict>>>;
9991
+ altText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9992
+ }, z.core.$strict>;
9601
9993
  declare const ContentItemResponseSchema: z.ZodObject<{
9602
9994
  id: z.ZodString;
9603
9995
  organizationId: z.ZodString;
@@ -9609,6 +10001,29 @@ declare const ContentItemResponseSchema: z.ZodObject<{
9609
10001
  pipelineId: z.ZodNullable<z.ZodString>;
9610
10002
  clientId: z.ZodNullable<z.ZodString>;
9611
10003
  sourceAssetId: z.ZodNullable<z.ZodString>;
10004
+ sourceAssets: z.ZodOptional<z.ZodArray<z.ZodObject<{
10005
+ id: z.ZodString;
10006
+ organizationId: z.ZodString;
10007
+ contentItemId: z.ZodString;
10008
+ sourceAssetId: z.ZodString;
10009
+ position: z.ZodNumber;
10010
+ crop: z.ZodNullable<z.ZodObject<{
10011
+ x: z.ZodNumber;
10012
+ y: z.ZodNumber;
10013
+ width: z.ZodNumber;
10014
+ height: z.ZodNumber;
10015
+ }, z.core.$strip>>;
10016
+ altText: z.ZodNullable<z.ZodString>;
10017
+ derivativePath: z.ZodNullable<z.ZodString>;
10018
+ derivativeCrop: z.ZodNullable<z.ZodObject<{
10019
+ x: z.ZodNumber;
10020
+ y: z.ZodNumber;
10021
+ width: z.ZodNumber;
10022
+ height: z.ZodNumber;
10023
+ }, z.core.$strip>>;
10024
+ derivativeRenderedAt: z.ZodNullable<z.ZodString>;
10025
+ createdAt: z.ZodString;
10026
+ }, z.core.$strip>>>;
9612
10027
  processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9613
10028
  status: z.ZodEnum<{
9614
10029
  error: "error";
@@ -9643,6 +10058,29 @@ declare const ContentItemListResponseSchema: z.ZodObject<{
9643
10058
  pipelineId: z.ZodNullable<z.ZodString>;
9644
10059
  clientId: z.ZodNullable<z.ZodString>;
9645
10060
  sourceAssetId: z.ZodNullable<z.ZodString>;
10061
+ sourceAssets: z.ZodOptional<z.ZodArray<z.ZodObject<{
10062
+ id: z.ZodString;
10063
+ organizationId: z.ZodString;
10064
+ contentItemId: z.ZodString;
10065
+ sourceAssetId: z.ZodString;
10066
+ position: z.ZodNumber;
10067
+ crop: z.ZodNullable<z.ZodObject<{
10068
+ x: z.ZodNumber;
10069
+ y: z.ZodNumber;
10070
+ width: z.ZodNumber;
10071
+ height: z.ZodNumber;
10072
+ }, z.core.$strip>>;
10073
+ altText: z.ZodNullable<z.ZodString>;
10074
+ derivativePath: z.ZodNullable<z.ZodString>;
10075
+ derivativeCrop: z.ZodNullable<z.ZodObject<{
10076
+ x: z.ZodNumber;
10077
+ y: z.ZodNumber;
10078
+ width: z.ZodNumber;
10079
+ height: z.ZodNumber;
10080
+ }, z.core.$strip>>;
10081
+ derivativeRenderedAt: z.ZodNullable<z.ZodString>;
10082
+ createdAt: z.ZodString;
10083
+ }, z.core.$strip>>>;
9646
10084
  processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9647
10085
  status: z.ZodEnum<{
9648
10086
  error: "error";
@@ -9733,6 +10171,31 @@ declare const ContentSourceAssetResponseSchema: z.ZodObject<{
9733
10171
  createdAt: z.ZodString;
9734
10172
  updatedAt: z.ZodString;
9735
10173
  }, z.core.$strip>;
10174
+ /**
10175
+ * One entry in a distribution's `media_urls`.
10176
+ *
10177
+ * Two kinds genuinely coexist: an object in a Supabase storage bucket, and a
10178
+ * URL that is already fetchable. Both used to be stored as bare strings, so
10179
+ * every reader had to classify an entry by looking for a URI scheme — the same
10180
+ * guess, re-derived in each consumer, wrong the moment a storage key contains
10181
+ * a colon. The entry names its own kind instead.
10182
+ *
10183
+ * A `storage` entry carries its own `bucket` so a reader does not hardcode one;
10184
+ * the bucket is private, so the path is signed at read time rather than stored
10185
+ * as a URL that expires.
10186
+ *
10187
+ * This is deliberately NOT `z.union([z.string(), ...])`. Accepting both shapes
10188
+ * would relocate the heuristic rather than remove it, so existing rows are
10189
+ * migrated instead (`content-distribution-media-entries.sql`).
10190
+ */
10191
+ declare const ContentMediaEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10192
+ kind: z.ZodLiteral<"storage">;
10193
+ bucket: z.ZodString;
10194
+ path: z.ZodString;
10195
+ }, z.core.$strict>, z.ZodObject<{
10196
+ kind: z.ZodLiteral<"url">;
10197
+ url: z.ZodString;
10198
+ }, z.core.$strict>], "kind">;
9736
10199
  declare const ContentDistributionResponseSchema: z.ZodObject<{
9737
10200
  id: z.ZodString;
9738
10201
  organizationId: z.ZodString;
@@ -9743,7 +10206,14 @@ declare const ContentDistributionResponseSchema: z.ZodObject<{
9743
10206
  adaptedBody: z.ZodNullable<z.ZodString>;
9744
10207
  platformContent: z.ZodNullable<z.ZodUnknown>;
9745
10208
  checklist: z.ZodNullable<z.ZodUnknown>;
9746
- mediaUrls: z.ZodArray<z.ZodUnknown>;
10209
+ mediaUrls: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
10210
+ kind: z.ZodLiteral<"storage">;
10211
+ bucket: z.ZodString;
10212
+ path: z.ZodString;
10213
+ }, z.core.$strict>, z.ZodObject<{
10214
+ kind: z.ZodLiteral<"url">;
10215
+ url: z.ZodString;
10216
+ }, z.core.$strict>], "kind">>;
9747
10217
  processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
9748
10218
  status: z.ZodEnum<{
9749
10219
  error: "error";
@@ -9774,11 +10244,16 @@ type ContentDistributionPlatform = z.infer<typeof ContentDistributionPlatformSch
9774
10244
  type ContentDistributionFormat = z.infer<typeof ContentDistributionFormatSchema>;
9775
10245
  type ContentDistributionStatus = z.infer<typeof ContentDistributionStatusSchema>;
9776
10246
  type ContentPayloadEnvelope = z.infer<typeof ContentPayloadEnvelopeSchema>;
10247
+ type ContentAssetCropInput = z.infer<typeof ContentAssetCropInputSchema>;
10248
+ type ContentItemSourceAssetResponse = z.infer<typeof ContentItemSourceAssetResponseSchema>;
10249
+ type ContentItemSourceAssetListResponse = z.infer<typeof ContentItemSourceAssetListResponseSchema>;
10250
+ type ContentItemSourceAssetInput = z.infer<typeof ContentItemSourceAssetInputSchema>;
9777
10251
  type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
9778
10252
  type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
9779
10253
  type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
9780
10254
  type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
9781
10255
  type ContentSourceAssetResponse = z.infer<typeof ContentSourceAssetResponseSchema>;
10256
+ type ContentMediaEntry = z.infer<typeof ContentMediaEntrySchema>;
9782
10257
  type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
9783
10258
 
9784
10259
  /**
@@ -10212,6 +10687,34 @@ type DropboxToolMap = {
10212
10687
  params: CreateFolderParams;
10213
10688
  result: CreateFolderResult;
10214
10689
  };
10690
+ listFolder: {
10691
+ params: ListFolderParams;
10692
+ result: ListFolderResult;
10693
+ };
10694
+ getMetadata: {
10695
+ params: GetMetadataParams;
10696
+ result: GetMetadataResult;
10697
+ };
10698
+ getTemporaryLink: {
10699
+ params: GetTemporaryLinkParams;
10700
+ result: GetTemporaryLinkResult;
10701
+ };
10702
+ createSharedLink: {
10703
+ params: CreateSharedLinkParams;
10704
+ result: CreateSharedLinkResult;
10705
+ };
10706
+ download: {
10707
+ params: DownloadParams;
10708
+ result: DownloadResult;
10709
+ };
10710
+ getThumbnail: {
10711
+ params: GetThumbnailParams;
10712
+ result: GetThumbnailResult;
10713
+ };
10714
+ getThumbnailBatch: {
10715
+ params: GetThumbnailBatchParams;
10716
+ result: GetThumbnailBatchResult;
10717
+ };
10215
10718
  };
10216
10719
  type SignatureApiToolMap = {
10217
10720
  createEnvelope: {
@@ -10739,7 +11242,15 @@ type ArtifactsToolMap = {
10739
11242
  };
10740
11243
  };
10741
11244
  type ContentToolMap = {
10742
- /** Insert a new `content_items` row -- a producer's entry point for a new piece. */
11245
+ /**
11246
+ * Insert a new `content_items` row -- a producer's entry point for a new piece.
11247
+ *
11248
+ * `sourceAssets` is the ordered membership a carousel is created with, in
11249
+ * ONE transaction (Open Decision 11, 2026-08-17 -- hybrid). Index is not
11250
+ * position: each entry names its own `position`, and 0 is the cover. Every
11251
+ * later membership mutation is one of the four dedicated methods below --
11252
+ * `updateItem` never touches membership.
11253
+ */
10743
11254
  createItem: {
10744
11255
  params: {
10745
11256
  title: string;
@@ -10750,6 +11261,7 @@ type ContentToolMap = {
10750
11261
  pipelineId?: ContentPipelineId | null;
10751
11262
  clientId?: string | null;
10752
11263
  sourceAssetId?: string | null;
11264
+ sourceAssets?: ContentItemSourceAssetInput[];
10753
11265
  };
10754
11266
  result: ContentItemResponse;
10755
11267
  };
@@ -10775,6 +11287,13 @@ type ContentToolMap = {
10775
11287
  /**
10776
11288
  * Update an item's mutable fields as it advances through the pipeline.
10777
11289
  * Does NOT accept a `processingState` field -- see Decision 4 above.
11290
+ *
11291
+ * STANDING CONVENTION -- Open Decision 11 (enforced by omission): there is no
11292
+ * `sourceAssets` field here and there must not be one. A wholesale-replace
11293
+ * array would force every partial item update to say something about the
11294
+ * asset list, and once omission means "leave alone" there is no way to clear
11295
+ * membership at all. The four methods below own every membership mutation
11296
+ * after creation.
10778
11297
  */
10779
11298
  updateItem: {
10780
11299
  params: {
@@ -10789,6 +11308,72 @@ type ContentToolMap = {
10789
11308
  };
10790
11309
  result: ContentItemResponse;
10791
11310
  };
11311
+ /**
11312
+ * Link one source asset into an item at a given slide position (0 is the
11313
+ * cover). `organizationId` is never a parameter here or on the three methods
11314
+ * below: both foreign keys on `content_item_source_assets` are COMPOSITE
11315
+ * against `(id, organization_id)`, so the database refuses a cross-org link
11316
+ * structurally rather than by convention.
11317
+ *
11318
+ * There is deliberately no `listItemSourceAssets` method -- membership comes
11319
+ * back on `getItem` / `listItems` as `ContentItemResponse.sourceAssets`.
11320
+ */
11321
+ addItemSourceAsset: {
11322
+ params: {
11323
+ itemId: string;
11324
+ sourceAssetId: string;
11325
+ /** Slide order, 0 is the cover. Unique within the item. */
11326
+ position: number;
11327
+ /** Per-MEMBERSHIP crop box in normalized fractions -- the same photo crops differently per item. */
11328
+ crop?: ContentAssetCropInput | null;
11329
+ altText?: string | null;
11330
+ };
11331
+ result: ContentItemSourceAssetResponse;
11332
+ };
11333
+ /**
11334
+ * Unlink one source asset from an item. The asset row itself is untouched --
11335
+ * `content_item_source_assets.source_asset_id` is `ON DELETE RESTRICT`
11336
+ * precisely so a used asset cannot vanish out from under a published post.
11337
+ */
11338
+ removeItemSourceAsset: {
11339
+ params: {
11340
+ itemId: string;
11341
+ sourceAssetId: string;
11342
+ };
11343
+ result: void;
11344
+ };
11345
+ /**
11346
+ * Reorder an item's slides. `orderedAssetIds` is the item's COMPLETE
11347
+ * membership in its new order -- index becomes `position`, so index 0 is the
11348
+ * new cover, and a list that does not name exactly the current membership is
11349
+ * rejected.
11350
+ *
11351
+ * `UNIQUE (content_item_id, position)` is DEFERRABLE INITIALLY DEFERRED, so
11352
+ * this is plain per-row updates inside one transaction. An implementation
11353
+ * that shuffles through a temporary offset is a sign the deferrable
11354
+ * constraint was not used.
11355
+ */
11356
+ reorderItemSourceAssets: {
11357
+ params: {
11358
+ itemId: string;
11359
+ orderedAssetIds: string[];
11360
+ };
11361
+ result: ContentItemSourceAssetListResponse;
11362
+ };
11363
+ /**
11364
+ * Patch one membership's per-slide attributes. `position` is not here --
11365
+ * moving a slide is `reorderItemSourceAssets` -- and neither is
11366
+ * `sourceAssetId`: swapping the asset is a remove plus an add.
11367
+ */
11368
+ updateItemSourceAsset: {
11369
+ params: {
11370
+ itemId: string;
11371
+ sourceAssetId: string;
11372
+ crop?: ContentAssetCropInput | null;
11373
+ altText?: string | null;
11374
+ };
11375
+ result: ContentItemSourceAssetResponse;
11376
+ };
10792
11377
  /**
10793
11378
  * Record a pipeline-step attempt against an item. `attemptNumber` is
10794
11379
  * assigned server-side inside the write (Decision 6) -- never
@@ -10881,6 +11466,30 @@ type ContentToolMap = {
10881
11466
  };
10882
11467
  result: ContentSourceAssetResponse;
10883
11468
  };
11469
+ /**
11470
+ * Fetch a single distribution by id, org-scoped -- lets a producer read back
11471
+ * a distribution it just wrote before writing to it again, the idempotency
11472
+ * check `createDistribution`/`updateDistribution` alone cannot provide.
11473
+ */
11474
+ getDistribution: {
11475
+ params: {
11476
+ distributionId: string;
11477
+ };
11478
+ result: ContentDistributionResponse | null;
11479
+ };
11480
+ /** Query distributions -- e.g. a producer checking what's already been created for an item. */
11481
+ listDistributions: {
11482
+ params: {
11483
+ contentItemId?: string;
11484
+ platform?: ContentDistributionPlatform;
11485
+ status?: ContentDistributionStatus;
11486
+ limit?: number;
11487
+ offset?: number;
11488
+ };
11489
+ result: {
11490
+ data: ContentDistributionResponse[];
11491
+ };
11492
+ };
10884
11493
  /** Insert a `content_distributions` row for one platform/format target. */
10885
11494
  createDistribution: {
10886
11495
  params: {
@@ -10891,7 +11500,7 @@ type ContentToolMap = {
10891
11500
  adaptedBody?: string | null;
10892
11501
  platformContent?: unknown;
10893
11502
  checklist?: unknown;
10894
- mediaUrls?: unknown[];
11503
+ mediaUrls?: ContentMediaEntry[];
10895
11504
  };
10896
11505
  result: ContentDistributionResponse;
10897
11506
  };
@@ -10903,7 +11512,7 @@ type ContentToolMap = {
10903
11512
  adaptedBody?: string | null;
10904
11513
  platformContent?: unknown;
10905
11514
  checklist?: unknown;
10906
- mediaUrls?: unknown[];
11515
+ mediaUrls?: ContentMediaEntry[];
10907
11516
  publishMethod?: string | null;
10908
11517
  publishedAt?: string | null;
10909
11518
  platformPostId?: string | null;
@@ -11975,14 +12584,18 @@ interface DeploymentSpec {
11975
12584
  type LLMProvider = 'openai' | 'anthropic' | 'openrouter';
11976
12585
  /**
11977
12586
  * SDK LLM generate params.
11978
- * Extends LLMGenerateRequest with required provider/model for worker→platform dispatch.
11979
- * Provider and model must always be specified explicitly no implicit fallback.
12587
+ *
12588
+ * `provider` and `model` are optional, and omitting them is a real choice rather than a shorthand:
12589
+ * the platform then resolves the pair from the resource's own `modelConfig`, and failing that from
12590
+ * the `DEFAULT_LLM_MODEL` environment variable. A call that names a model always wins, so a
12591
+ * resource that states its model keeps stating it. Supply both or neither — a half-supplied pair is
12592
+ * rejected, because pairing an explicit provider with a defaulted model silently mismatches them.
11980
12593
  */
11981
12594
  interface SDKLLMGenerateParams extends Omit<LLMGenerateRequest, 'signal'> {
11982
- /** LLM provider */
11983
- provider: LLMProvider;
11984
- /** Model identifier — must be a supported LLMModel */
11985
- model: LLMModel;
12595
+ /** LLM provider. Omit to inherit the resource's `modelConfig`, then the platform default. */
12596
+ provider?: LLMProvider;
12597
+ /** Model identifier — must be a supported LLMModel. Omit to inherit alongside `provider`. */
12598
+ model?: LLMModel;
11986
12599
  }
11987
12600
 
11988
12601
  /**