@elevasis/sdk 1.46.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.
- package/dist/cli.cjs +550 -45
- package/dist/index.d.ts +164 -0
- package/dist/test-utils/index.d.ts +164 -0
- package/dist/test-utils/index.js +13 -2
- package/dist/worker/index.d.ts +197 -4
- package/dist/worker/index.js +8 -2
- package/package.json +4 -4
- package/reference/_navigation.md +2 -2
- package/reference/packages/core/src/content/README.md +15 -10
- package/reference/scaffold/recipes/extend-content.md +103 -67
- package/reference/sdk/cli-management.mdx +111 -27
- package/reference/sdk/platform-tools/adapters-platform.mdx +1 -1
- package/reference/sdk/platform-tools/index.mdx +0 -2
- package/reference/sdk/resources/patterns.mdx +14 -6
package/dist/test-utils/index.js
CHANGED
|
@@ -8656,16 +8656,22 @@ createAdapter("artifacts", [
|
|
|
8656
8656
|
]);
|
|
8657
8657
|
|
|
8658
8658
|
// src/worker/adapters/content.ts
|
|
8659
|
-
|
|
8659
|
+
var METHODS = [
|
|
8660
8660
|
"createItem",
|
|
8661
8661
|
"getItem",
|
|
8662
8662
|
"listItems",
|
|
8663
8663
|
"updateItem",
|
|
8664
8664
|
"createAttempt",
|
|
8665
8665
|
"listAttempts",
|
|
8666
|
+
"updateAttempt",
|
|
8667
|
+
"createSourceAsset",
|
|
8668
|
+
"getSourceAsset",
|
|
8669
|
+
"listSourceAssets",
|
|
8670
|
+
"updateSourceAsset",
|
|
8666
8671
|
"createDistribution",
|
|
8667
8672
|
"updateDistribution"
|
|
8668
|
-
]
|
|
8673
|
+
];
|
|
8674
|
+
createAdapter("content", METHODS);
|
|
8669
8675
|
|
|
8670
8676
|
// src/worker/adapters/pdf.ts
|
|
8671
8677
|
createAdapter("pdf", ["render", "renderToBuffer"]);
|
|
@@ -27742,6 +27748,11 @@ var mockContent = (overrides) => createMockAdapter(
|
|
|
27742
27748
|
"updateItem",
|
|
27743
27749
|
"createAttempt",
|
|
27744
27750
|
"listAttempts",
|
|
27751
|
+
"updateAttempt",
|
|
27752
|
+
"createSourceAsset",
|
|
27753
|
+
"getSourceAsset",
|
|
27754
|
+
"listSourceAssets",
|
|
27755
|
+
"updateSourceAsset",
|
|
27745
27756
|
"createDistribution",
|
|
27746
27757
|
"updateDistribution"
|
|
27747
27758
|
],
|
package/dist/worker/index.d.ts
CHANGED
|
@@ -2482,6 +2482,7 @@ type Database = {
|
|
|
2482
2482
|
activities: {
|
|
2483
2483
|
Row: {
|
|
2484
2484
|
activity_type: string;
|
|
2485
|
+
actor_api_key_id: string | null;
|
|
2485
2486
|
actor_id: string | null;
|
|
2486
2487
|
actor_type: string | null;
|
|
2487
2488
|
created_at: string;
|
|
@@ -2498,6 +2499,7 @@ type Database = {
|
|
|
2498
2499
|
};
|
|
2499
2500
|
Insert: {
|
|
2500
2501
|
activity_type: string;
|
|
2502
|
+
actor_api_key_id?: string | null;
|
|
2501
2503
|
actor_id?: string | null;
|
|
2502
2504
|
actor_type?: string | null;
|
|
2503
2505
|
created_at?: string;
|
|
@@ -2514,6 +2516,7 @@ type Database = {
|
|
|
2514
2516
|
};
|
|
2515
2517
|
Update: {
|
|
2516
2518
|
activity_type?: string;
|
|
2519
|
+
actor_api_key_id?: string | null;
|
|
2517
2520
|
actor_id?: string | null;
|
|
2518
2521
|
actor_type?: string | null;
|
|
2519
2522
|
created_at?: string;
|
|
@@ -2529,6 +2532,13 @@ type Database = {
|
|
|
2529
2532
|
title?: string;
|
|
2530
2533
|
};
|
|
2531
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
|
+
},
|
|
2532
2542
|
{
|
|
2533
2543
|
foreignKeyName: "activities_actor_id_fkey";
|
|
2534
2544
|
columns: ["actor_id"];
|
|
@@ -2616,6 +2626,7 @@ type Database = {
|
|
|
2616
2626
|
api_keys: {
|
|
2617
2627
|
Row: {
|
|
2618
2628
|
created_at: string | null;
|
|
2629
|
+
created_by: string | null;
|
|
2619
2630
|
id: string;
|
|
2620
2631
|
key_hash: string;
|
|
2621
2632
|
last_used_at: string | null;
|
|
@@ -2624,6 +2635,7 @@ type Database = {
|
|
|
2624
2635
|
};
|
|
2625
2636
|
Insert: {
|
|
2626
2637
|
created_at?: string | null;
|
|
2638
|
+
created_by?: string | null;
|
|
2627
2639
|
id?: string;
|
|
2628
2640
|
key_hash: string;
|
|
2629
2641
|
last_used_at?: string | null;
|
|
@@ -2632,6 +2644,7 @@ type Database = {
|
|
|
2632
2644
|
};
|
|
2633
2645
|
Update: {
|
|
2634
2646
|
created_at?: string | null;
|
|
2647
|
+
created_by?: string | null;
|
|
2635
2648
|
id?: string;
|
|
2636
2649
|
key_hash?: string;
|
|
2637
2650
|
last_used_at?: string | null;
|
|
@@ -2639,6 +2652,13 @@ type Database = {
|
|
|
2639
2652
|
organization_id?: string;
|
|
2640
2653
|
};
|
|
2641
2654
|
Relationships: [
|
|
2655
|
+
{
|
|
2656
|
+
foreignKeyName: "api_keys_created_by_fkey";
|
|
2657
|
+
columns: ["created_by"];
|
|
2658
|
+
isOneToOne: false;
|
|
2659
|
+
referencedRelation: "users";
|
|
2660
|
+
referencedColumns: ["id"];
|
|
2661
|
+
},
|
|
2642
2662
|
{
|
|
2643
2663
|
foreignKeyName: "api_keys_organization_id_fkey";
|
|
2644
2664
|
columns: ["organization_id"];
|
|
@@ -2966,6 +2986,7 @@ type Database = {
|
|
|
2966
2986
|
organization_id: string;
|
|
2967
2987
|
payload: Json;
|
|
2968
2988
|
source_execution_id: string | null;
|
|
2989
|
+
status: string;
|
|
2969
2990
|
step_key: string | null;
|
|
2970
2991
|
};
|
|
2971
2992
|
Insert: {
|
|
@@ -2977,6 +2998,7 @@ type Database = {
|
|
|
2977
2998
|
organization_id: string;
|
|
2978
2999
|
payload?: Json;
|
|
2979
3000
|
source_execution_id?: string | null;
|
|
3001
|
+
status: string;
|
|
2980
3002
|
step_key?: string | null;
|
|
2981
3003
|
};
|
|
2982
3004
|
Update: {
|
|
@@ -2988,6 +3010,7 @@ type Database = {
|
|
|
2988
3010
|
organization_id?: string;
|
|
2989
3011
|
payload?: Json;
|
|
2990
3012
|
source_execution_id?: string | null;
|
|
3013
|
+
status?: string;
|
|
2991
3014
|
step_key?: string | null;
|
|
2992
3015
|
};
|
|
2993
3016
|
Relationships: [
|
|
@@ -3139,6 +3162,7 @@ type Database = {
|
|
|
3139
3162
|
kind: string;
|
|
3140
3163
|
metadata: Json;
|
|
3141
3164
|
organization_id: string;
|
|
3165
|
+
payload: Json;
|
|
3142
3166
|
processing_state: Json;
|
|
3143
3167
|
storage_path: string | null;
|
|
3144
3168
|
title: string;
|
|
@@ -3152,6 +3176,7 @@ type Database = {
|
|
|
3152
3176
|
kind: string;
|
|
3153
3177
|
metadata?: Json;
|
|
3154
3178
|
organization_id: string;
|
|
3179
|
+
payload?: Json;
|
|
3155
3180
|
processing_state?: Json;
|
|
3156
3181
|
storage_path?: string | null;
|
|
3157
3182
|
title: string;
|
|
@@ -3165,6 +3190,7 @@ type Database = {
|
|
|
3165
3190
|
kind?: string;
|
|
3166
3191
|
metadata?: Json;
|
|
3167
3192
|
organization_id?: string;
|
|
3193
|
+
payload?: Json;
|
|
3168
3194
|
processing_state?: Json;
|
|
3169
3195
|
storage_path?: string | null;
|
|
3170
3196
|
title?: string;
|
|
@@ -9778,6 +9804,20 @@ declare const ProjectSchemas: {
|
|
|
9778
9804
|
}, z.core.$strip>;
|
|
9779
9805
|
};
|
|
9780
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
|
+
}>;
|
|
9781
9821
|
/** D18: `pipeline_id` is an OM ontology id (free text), not a UUID. */
|
|
9782
9822
|
declare const ContentPipelineIdSchema: z.ZodString;
|
|
9783
9823
|
/** `content:catalog/status` entries. Free text, model-owned. */
|
|
@@ -9812,9 +9852,13 @@ declare const ContentItemResponseSchema: z.ZodObject<{
|
|
|
9812
9852
|
status: z.ZodEnum<{
|
|
9813
9853
|
error: "error";
|
|
9814
9854
|
success: "success";
|
|
9855
|
+
running: "running";
|
|
9815
9856
|
no_result: "no_result";
|
|
9816
9857
|
skipped: "skipped";
|
|
9817
9858
|
}>;
|
|
9859
|
+
attemptId: z.ZodString;
|
|
9860
|
+
executionId: z.ZodNullable<z.ZodString>;
|
|
9861
|
+
attemptedAt: z.ZodString;
|
|
9818
9862
|
data: z.ZodOptional<z.ZodUnknown>;
|
|
9819
9863
|
}, z.core.$loose>>;
|
|
9820
9864
|
reviewedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -9842,9 +9886,13 @@ declare const ContentItemListResponseSchema: z.ZodObject<{
|
|
|
9842
9886
|
status: z.ZodEnum<{
|
|
9843
9887
|
error: "error";
|
|
9844
9888
|
success: "success";
|
|
9889
|
+
running: "running";
|
|
9845
9890
|
no_result: "no_result";
|
|
9846
9891
|
skipped: "skipped";
|
|
9847
9892
|
}>;
|
|
9893
|
+
attemptId: z.ZodString;
|
|
9894
|
+
executionId: z.ZodNullable<z.ZodString>;
|
|
9895
|
+
attemptedAt: z.ZodString;
|
|
9848
9896
|
data: z.ZodOptional<z.ZodUnknown>;
|
|
9849
9897
|
}, z.core.$loose>>;
|
|
9850
9898
|
reviewedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -9866,6 +9914,13 @@ declare const ContentItemAttemptResponseSchema: z.ZodObject<{
|
|
|
9866
9914
|
contentItemId: z.ZodString;
|
|
9867
9915
|
attemptNumber: z.ZodNumber;
|
|
9868
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
|
+
}>;
|
|
9869
9924
|
payload: z.ZodUnknown;
|
|
9870
9925
|
sourceExecutionId: z.ZodNullable<z.ZodString>;
|
|
9871
9926
|
createdBy: z.ZodNullable<z.ZodString>;
|
|
@@ -9878,12 +9933,45 @@ declare const ContentItemAttemptListResponseSchema: z.ZodObject<{
|
|
|
9878
9933
|
contentItemId: z.ZodString;
|
|
9879
9934
|
attemptNumber: z.ZodNumber;
|
|
9880
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
|
+
}>;
|
|
9881
9943
|
payload: z.ZodUnknown;
|
|
9882
9944
|
sourceExecutionId: z.ZodNullable<z.ZodString>;
|
|
9883
9945
|
createdBy: z.ZodNullable<z.ZodString>;
|
|
9884
9946
|
createdAt: z.ZodString;
|
|
9885
9947
|
}, z.core.$strip>>;
|
|
9886
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>;
|
|
9887
9975
|
declare const ContentDistributionResponseSchema: z.ZodObject<{
|
|
9888
9976
|
id: z.ZodString;
|
|
9889
9977
|
organizationId: z.ZodString;
|
|
@@ -9899,9 +9987,13 @@ declare const ContentDistributionResponseSchema: z.ZodObject<{
|
|
|
9899
9987
|
status: z.ZodEnum<{
|
|
9900
9988
|
error: "error";
|
|
9901
9989
|
success: "success";
|
|
9990
|
+
running: "running";
|
|
9902
9991
|
no_result: "no_result";
|
|
9903
9992
|
skipped: "skipped";
|
|
9904
9993
|
}>;
|
|
9994
|
+
attemptId: z.ZodString;
|
|
9995
|
+
executionId: z.ZodNullable<z.ZodString>;
|
|
9996
|
+
attemptedAt: z.ZodString;
|
|
9905
9997
|
data: z.ZodOptional<z.ZodUnknown>;
|
|
9906
9998
|
}, z.core.$loose>>;
|
|
9907
9999
|
publishMethod: z.ZodNullable<z.ZodString>;
|
|
@@ -9913,6 +10005,7 @@ declare const ContentDistributionResponseSchema: z.ZodObject<{
|
|
|
9913
10005
|
createdAt: z.ZodString;
|
|
9914
10006
|
updatedAt: z.ZodString;
|
|
9915
10007
|
}, z.core.$strip>;
|
|
10008
|
+
type ContentStepStatus = z.infer<typeof ContentStepStatusSchema>;
|
|
9916
10009
|
type ContentPipelineId = z.infer<typeof ContentPipelineIdSchema>;
|
|
9917
10010
|
type ContentItemStatus = z.infer<typeof ContentItemStatusSchema>;
|
|
9918
10011
|
type ContentPillar = z.infer<typeof ContentPillarSchema>;
|
|
@@ -9924,6 +10017,7 @@ type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
|
|
|
9924
10017
|
type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
|
|
9925
10018
|
type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
|
|
9926
10019
|
type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
|
|
10020
|
+
type ContentSourceAssetResponse = z.infer<typeof ContentSourceAssetResponseSchema>;
|
|
9927
10021
|
type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
|
|
9928
10022
|
|
|
9929
10023
|
/**
|
|
@@ -10956,6 +11050,13 @@ type ContentToolMap = {
|
|
|
10956
11050
|
/** Which step this attempt implements. Stored as-is; NULL when omitted. */
|
|
10957
11051
|
stepKey?: string | null;
|
|
10958
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;
|
|
10959
11060
|
};
|
|
10960
11061
|
result: ContentItemAttemptResponse;
|
|
10961
11062
|
};
|
|
@@ -10966,6 +11067,69 @@ type ContentToolMap = {
|
|
|
10966
11067
|
};
|
|
10967
11068
|
result: ContentItemAttemptListResponse;
|
|
10968
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
|
+
};
|
|
10969
11133
|
/** Insert a `content_distributions` row for one platform/format target. */
|
|
10970
11134
|
createDistribution: {
|
|
10971
11135
|
params: {
|
|
@@ -12470,16 +12634,38 @@ declare const artifacts: TypedAdapter<ArtifactsToolMap>;
|
|
|
12470
12634
|
* Content Platform Tool Adapter
|
|
12471
12635
|
*
|
|
12472
12636
|
* Typed wrapper over platform.call() for the content System's producer
|
|
12473
|
-
* surface (`content_items`, `content_item_attempts`, `content_distributions
|
|
12474
|
-
* Singleton export -- no credential needed
|
|
12637
|
+
* surface (`content_items`, `content_item_attempts`, `content_distributions`,
|
|
12638
|
+
* `content_source_assets`). Singleton export -- no credential needed
|
|
12639
|
+
* (platform tool).
|
|
12475
12640
|
*
|
|
12476
12641
|
* `organizationId` is injected server-side by the dispatcher -- never sent
|
|
12477
12642
|
* from the SDK. There is deliberately no `updateProcessingState` method:
|
|
12478
12643
|
* `content_items.processing_state` and `content_distributions.processing_state`
|
|
12479
12644
|
* are not writable through this adapter (content-pipeline execution plan
|
|
12480
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.
|
|
12481
12661
|
*/
|
|
12482
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
|
+
};
|
|
12483
12669
|
/**
|
|
12484
12670
|
* Typed content adapter for the content pipeline's producer surface.
|
|
12485
12671
|
*
|
|
@@ -12488,10 +12674,17 @@ declare const artifacts: TypedAdapter<ArtifactsToolMap>;
|
|
|
12488
12674
|
* import { content } from '@elevasis/sdk/worker'
|
|
12489
12675
|
*
|
|
12490
12676
|
* const item = await content.createItem({ title: 'Draft', pipelineId: 'long-form-to-shorts' })
|
|
12491
|
-
* const attempt = await content.createAttempt({
|
|
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: '...' } })
|
|
12492
12685
|
* ```
|
|
12493
12686
|
*/
|
|
12494
|
-
declare const content:
|
|
12687
|
+
declare const content: ContentAdapter;
|
|
12495
12688
|
|
|
12496
12689
|
/**
|
|
12497
12690
|
* Typed PDF adapter for document rendering.
|
package/dist/worker/index.js
CHANGED
|
@@ -6815,16 +6815,22 @@ var artifacts = createAdapter("artifacts", [
|
|
|
6815
6815
|
]);
|
|
6816
6816
|
|
|
6817
6817
|
// src/worker/adapters/content.ts
|
|
6818
|
-
var
|
|
6818
|
+
var METHODS14 = [
|
|
6819
6819
|
"createItem",
|
|
6820
6820
|
"getItem",
|
|
6821
6821
|
"listItems",
|
|
6822
6822
|
"updateItem",
|
|
6823
6823
|
"createAttempt",
|
|
6824
6824
|
"listAttempts",
|
|
6825
|
+
"updateAttempt",
|
|
6826
|
+
"createSourceAsset",
|
|
6827
|
+
"getSourceAsset",
|
|
6828
|
+
"listSourceAssets",
|
|
6829
|
+
"updateSourceAsset",
|
|
6825
6830
|
"createDistribution",
|
|
6826
6831
|
"updateDistribution"
|
|
6827
|
-
]
|
|
6832
|
+
];
|
|
6833
|
+
var content = createAdapter("content", METHODS14);
|
|
6828
6834
|
|
|
6829
6835
|
// src/worker/adapters/pdf.ts
|
|
6830
6836
|
var pdf = createAdapter("pdf", ["render", "renderToBuffer"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"tsup": "^8.0.0",
|
|
56
56
|
"typescript": "5.9.2",
|
|
57
57
|
"zod": "^4.1.0",
|
|
58
|
-
"@repo/core": "0.
|
|
59
|
-
"@repo/
|
|
60
|
-
"@repo/
|
|
58
|
+
"@repo/core": "0.62.0",
|
|
59
|
+
"@repo/eslint-config": "0.0.0",
|
|
60
|
+
"@repo/typescript-config": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"lint": "eslint src --max-warnings 0",
|
package/reference/_navigation.md
CHANGED
|
@@ -194,7 +194,7 @@ Universal scaffold documentation for all SDK projects. Source locations are co-l
|
|
|
194
194
|
| Gate by System or Admin | `scaffold/recipes/gate-by-feature-or-admin.md` | Decision table and recipes for gating routes, sidebar entries, and UI elements with AccessGuard and the unified Access Model. |
|
|
195
195
|
| Build and Extend CRM | `scaffold/recipes/extend-crm.md` | Map the CRM platform primitives available to SDK projects: shared UI pages, sidebar composition, data hooks, action definitions, workflow adapters, System Interfaces, and org-model extension boundaries. |
|
|
196
196
|
| Build and Extend Lead Gen | `scaffold/recipes/extend-lead-gen.md` | Map the lead-gen platform primitives available to SDK projects: shared UI pages, provider-injected Organization Model config, data hooks, list/member state, artifacts, workflow adapters, System Interfaces, and tenant-owned extension boundaries. |
|
|
197
|
-
| Build and Extend Content | `scaffold/recipes/extend-content.md` | Map the content platform primitives available to SDK projects: pipeline and step catalogs, shared review/pipeline/distribution pages, data hooks, the content workflow adapter,
|
|
197
|
+
| Build and Extend Content | `scaffold/recipes/extend-content.md` | Map the content platform primitives available to SDK projects: pipeline and step catalogs, shared review/pipeline/distribution pages, data hooks, the content workflow adapter, and org-model extension boundaries. |
|
|
198
198
|
| Customize CRM Actions | `scaffold/recipes/customize-crm-actions.md` | Add, hide, or replace CRM deal action buttons in a template-derived project, and override default platform action workflows with project-owned implementations. |
|
|
199
199
|
| Customize Knowledge Browser | `scaffold/recipes/customize-knowledge-browser.md` | Author knowledge nodes and customize the Knowledge Browser in a template-derived project -- from zero-config authoring through sidebar composition, custom dispatchers, and direct query access. |
|
|
200
200
|
| Query the Knowledge Graph | `scaffold/recipes/query-the-knowledge-graph.md` | Use the `knowledge:*` CLI subcommands on `elevasis-sdk` (external projects) and `elevasis` (monorepo) to browse, inspect, and traverse the OrganizationModel knowledge graph via six mount axes. |
|
|
@@ -280,7 +280,7 @@ Docs-site pages indexed: 38.
|
|
|
280
280
|
|
|
281
281
|
| Page | Location | Description |
|
|
282
282
|
| --- | --- | --- |
|
|
283
|
-
| CLI Management Commands | `sdk/cli-management.mdx` | elevasis-sdk management commands -- project, note, acquisition, client, agent, session, queue, schedule, om, ui, and
|
|
283
|
+
| CLI Management Commands | `sdk/cli-management.mdx` | elevasis-sdk management commands -- project, note, acquisition, client, agent, session, queue, schedule, om, ui, skill, and content subcommand families |
|
|
284
284
|
| CLI Reference | `sdk/cli.mdx` | Core elevasis-sdk CLI commands -- validate, deploy, execute, inspect resources, manage credentials, rename, and enumerate the command catalog |
|
|
285
285
|
| Concepts Reference | `sdk/concepts.mdx` | Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, and design decisions |
|
|
286
286
|
| When to Reach for the define* Builders | `sdk/define-builders.mdx` | defineWorkflow, defineStep, defineContract, defineResource, and defineTopology exist for two different reasons -- this page teaches which reason applies before you pick a builder over a plain object literal. |
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# @elevasis/core/content
|
|
2
2
|
|
|
3
|
-
Content pipeline API schemas
|
|
3
|
+
Content pipeline API schemas, platform-content typed interfaces, and the pure placement helpers the API, the CLI, and the Command Center all share. Browser-safe (no Node APIs).
|
|
4
|
+
|
|
5
|
+
The helpers live here rather than in `@repo/ui` because they have three consumers and only one of them is a React app. `packages/sdk` has no `@repo/ui` dependency, so a CLI board would have needed its own copy of the placement rule — and two copies of a rule like this diverge. That is not hypothetical: the open-review-gate predicate was inline in the `/queue` handler, was about to be hand-copied into review validation and the review page, and had already produced a live wrong answer before it was consolidated into `review-gates.ts` on 2026-08-15. `derive-board.ts` and `item-identity.ts` moved here the same day for the same reason; `@repo/ui` re-exports both from `features/content/board/`.
|
|
4
6
|
|
|
5
7
|
## Surface
|
|
6
8
|
|
|
7
|
-
| Export | Purpose
|
|
8
|
-
| ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
-
| `ContentItemResponseSchema`, `CreateContentItemRequestSchema`, `UpdateContentItemRequestSchema` | `content_items` transport shape. `processingState` is intentionally absent from create/update — factory-write-only.
|
|
10
|
-
| `ContentProcessingStateSchema` | `{ stepKey: { status, data? } }`, keyed by `ContentStepKeySchema` — a content-specific key, not lead-gen's `LeadGenStageKeySchema`.
|
|
11
|
-
| `ContentPayloadEnvelopeSchema` | The producer's immutable emission stored in `payload`. Never edited — `body` is the human's canonical text.
|
|
12
|
-
| `ReviewContentItemRequestSchema` | Approve, or reject with a required `rejectReason`. Writes `reviewed_at` / `reviewed_by`.
|
|
13
|
-
| `ContentItemAttemptResponseSchema`, `CreateContentItemAttemptRequestSchema` | `content_item_attempts` transport shape. No `attemptNumber` field on create — the API service assigns it inside the write. `stepKey` is producer-supplied and nullable.
|
|
14
|
-
| `ContentDistributionResponseSchema`, `CreateContentDistributionRequestSchema`, `UpdateContentDistributionRequestSchema` | `content_distributions` transport shape, including the manual-publish fields (`publishMethod`, `platformPostId`, `platformUrl`).
|
|
15
|
-
| `PlatformContent`, `YouTubeContent`, `LinkedInContent`, `InstagramContent`, `XContent`, `AnyPlatformContent`, `PlatformContentMap`, `Platform` | Typed interfaces for platform-specific content stored in `content_distributions.platform_content`.
|
|
9
|
+
| Export | Purpose |
|
|
10
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `ContentItemResponseSchema`, `CreateContentItemRequestSchema`, `UpdateContentItemRequestSchema` | `content_items` transport shape. `processingState` is intentionally absent from create/update — factory-write-only. |
|
|
12
|
+
| `ContentProcessingStateSchema` | `{ stepKey: { status, data? } }`, keyed by `ContentStepKeySchema` — a content-specific key, not lead-gen's `LeadGenStageKeySchema`. |
|
|
13
|
+
| `ContentPayloadEnvelopeSchema` | The producer's immutable emission stored in `payload`. Never edited — `body` is the human's canonical text. |
|
|
14
|
+
| `ReviewContentItemRequestSchema` | Approve, or reject with a required `rejectReason`. Writes `reviewed_at` / `reviewed_by`. |
|
|
15
|
+
| `ContentItemAttemptResponseSchema`, `CreateContentItemAttemptRequestSchema` | `content_item_attempts` transport shape. No `attemptNumber` field on create — the API service assigns it inside the write. `stepKey` is producer-supplied and nullable. |
|
|
16
|
+
| `ContentDistributionResponseSchema`, `CreateContentDistributionRequestSchema`, `UpdateContentDistributionRequestSchema` | `content_distributions` transport shape, including the manual-publish fields (`publishMethod`, `platformPostId`, `platformUrl`). |
|
|
17
|
+
| `PlatformContent`, `YouTubeContent`, `LinkedInContent`, `InstagramContent`, `XContent`, `AnyPlatformContent`, `PlatformContentMap`, `Platform` | Typed interfaces for platform-specific content stored in `content_distributions.platform_content`. |
|
|
18
|
+
| `isOpenContentReviewGate`, `getOpenContentReviewGates` | The one predicate deciding whether a `processing_state` entry is an open, unreviewed `queued` gate. Consumed by the `/queue` handler, `reviewItem`'s `stepKey` validation, and the review page. |
|
|
19
|
+
| `deriveContentBoard`, `ContentBoard`, `ContentBoardCard`, `ContentBoardColumn`, `ContentBoardGate` | Placement: `(items, pipeline, now)` to columns, gates, waiting counts, plus the `done` and `unplaced` buckets. Pure. Consumed by the Command Center board and `elevasis-sdk content:board`. |
|
|
20
|
+
| `getContentItemIdentity` | Names an item for display when `title` cannot — first non-blank line of `body`, then the first string payload field, then `title`, then `'Untitled'`. |
|
|
16
21
|
|
|
17
22
|
## Step catalog reconciliation
|
|
18
23
|
|