@elevasis/sdk 1.46.0 → 1.48.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 +816 -107
- package/dist/index.d.ts +166 -2
- package/dist/index.js +23 -7
- package/dist/node/index.d.ts +2 -2
- package/dist/test-utils/index.d.ts +166 -2
- package/dist/test-utils/index.js +48 -9
- package/dist/worker/index.d.ts +213 -10
- package/dist/worker/index.js +14 -2
- package/package.json +2 -2
- package/reference/_navigation.md +5 -4
- package/reference/_reference-manifest.json +11 -1
- package/reference/packages/core/src/content/README.md +15 -10
- package/reference/packages/core/src/organization-model/README.md +9 -6
- package/reference/rules/content.md +27 -0
- package/reference/rules/organization-model.md +9 -3
- package/reference/rules/organization-os.md +2 -2
- package/reference/rules/vibe-intents.md +18 -15
- package/reference/rules/vibe.md +12 -12
- package/reference/scaffold/recipes/add-a-feature.md +1 -1
- package/reference/scaffold/recipes/customize-organization-model.md +2 -2
- package/reference/scaffold/recipes/extend-content.md +167 -68
- package/reference/scaffold/reference/glossary.md +2 -2
- package/reference/scaffold/reference/system-interface-capabilities.md +26 -6
- package/reference/sdk/cli-management.mdx +175 -29
- package/reference/sdk/platform-tools/adapters-platform.mdx +5 -5
- package/reference/sdk/platform-tools/index.mdx +0 -2
- package/reference/sdk/resources/patterns.mdx +14 -6
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;
|
|
@@ -6628,7 +6654,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
6628
6654
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6629
6655
|
route: z.ZodOptional<z.ZodString>;
|
|
6630
6656
|
}, z.core.$loose>>>>;
|
|
6631
|
-
}, z.core.$
|
|
6657
|
+
}, z.core.$strict>>;
|
|
6632
6658
|
type OntologyScope = z.infer<typeof OntologyScopeSchema>;
|
|
6633
6659
|
|
|
6634
6660
|
declare const SystemApiInterfaceSchema: z.ZodObject<{
|
|
@@ -7275,7 +7301,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
7275
7301
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7276
7302
|
route: z.ZodOptional<z.ZodString>;
|
|
7277
7303
|
}, z.core.$loose>>>>;
|
|
7278
|
-
}, z.core.$
|
|
7304
|
+
}, z.core.$strict>>>;
|
|
7279
7305
|
resources: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7280
7306
|
id: z.ZodString;
|
|
7281
7307
|
order: z.ZodDefault<z.ZodNumber>;
|
|
@@ -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: {
|
|
@@ -12375,7 +12539,7 @@ declare const notifications: TypedAdapter<NotificationToolMap>;
|
|
|
12375
12539
|
* Typed wrapper over platform.call() for acquisition lead management.
|
|
12376
12540
|
* Singleton export -- no credential needed (platform tool).
|
|
12377
12541
|
*
|
|
12378
|
-
*
|
|
12542
|
+
* 60 methods covering lists, companies, contacts, deals, list-stage updates, deal-sync, deal notes, deal tasks, enrichment, and social monitoring operations.
|
|
12379
12543
|
* organizationId is injected server-side by the dispatcher -- never sent from the SDK.
|
|
12380
12544
|
*/
|
|
12381
12545
|
|
|
@@ -12449,9 +12613,9 @@ declare const list: TypedAdapter<ListToolMap>;
|
|
|
12449
12613
|
/**
|
|
12450
12614
|
* Artifacts Platform Tool Adapter
|
|
12451
12615
|
*
|
|
12452
|
-
* Focused wrapper for the org-scoped governing-document store
|
|
12453
|
-
*
|
|
12454
|
-
* (platform tool).
|
|
12616
|
+
* Focused wrapper for the org-scoped governing-document store, keyed by
|
|
12617
|
+
* owner and kind, for acquisition's audits, proposals, and ICP docs.
|
|
12618
|
+
* Singleton export -- no credential needed (platform tool).
|
|
12455
12619
|
*
|
|
12456
12620
|
* `kind` convention: any artifact written for the content pipeline (an
|
|
12457
12621
|
* `ownerKind: 'organization'` document -- a selection brief, an idea bank,
|
|
@@ -12470,16 +12634,48 @@ 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`, and this adapter narrows it to a **required
|
|
12649
|
+
* key with a nullable value**: the caller must supply it, but may supply
|
|
12650
|
+
* `null`. Requiring the key is the SDK-layer analog of `organizationId` never
|
|
12651
|
+
* appearing in the params type at all -- a worker always has its own
|
|
12652
|
+
* `context.executionId`, so a producer cannot silently forget it, which is
|
|
12653
|
+
* what the step-state model's write-at-start/patch-at-end contract depends on
|
|
12654
|
+
* (see `mock-pipeline-shared.ts`).
|
|
12655
|
+
*
|
|
12656
|
+
* Permitting `null` is what makes a backfill expressible. The narrowing was
|
|
12657
|
+
* briefly `sourceExecutionId: string`, which excluded the one-time import of
|
|
12658
|
+
* records that have no execution behind them and never will -- core's
|
|
12659
|
+
* `CreateContentItemAttemptRequestSchema` types it `UuidSchema.nullable().optional()`
|
|
12660
|
+
* and the DB column is nullable, so the restriction was an SDK compile-time
|
|
12661
|
+
* guard rather than a data constraint, and the API already accepts null
|
|
12662
|
+
* (`reviewItem` writes a review attempt with `sourceExecutionId: null`).
|
|
12663
|
+
* Passing `null` states "no execution, and never will be"; it is not an
|
|
12664
|
+
* invitation to invent an execution id to satisfy the type.
|
|
12665
|
+
*
|
|
12666
|
+
* `createAttempt.status` is a real field on `ContentToolMap` -- a producer
|
|
12667
|
+
* starting a step sends `'running'` and the dispatcher forwards it. It was
|
|
12668
|
+
* briefly missing from both the tool map and the dispatcher's forward, which
|
|
12669
|
+
* meant a create-time status was accepted by the Zod schema and then dropped,
|
|
12670
|
+
* landing the row on the column default. Both were closed on 2026-08-15.
|
|
12481
12671
|
*/
|
|
12482
12672
|
|
|
12673
|
+
/** The content adapter's public shape -- `TypedAdapter<ContentToolMap>` with `createAttempt` narrowed. */
|
|
12674
|
+
type ContentAdapter = Omit<TypedAdapter<ContentToolMap>, 'createAttempt'> & {
|
|
12675
|
+
createAttempt: (params: Omit<ContentToolMap['createAttempt']['params'], 'sourceExecutionId'> & {
|
|
12676
|
+
sourceExecutionId: string | null;
|
|
12677
|
+
}) => Promise<ContentToolMap['createAttempt']['result']>;
|
|
12678
|
+
};
|
|
12483
12679
|
/**
|
|
12484
12680
|
* Typed content adapter for the content pipeline's producer surface.
|
|
12485
12681
|
*
|
|
@@ -12488,10 +12684,17 @@ declare const artifacts: TypedAdapter<ArtifactsToolMap>;
|
|
|
12488
12684
|
* import { content } from '@elevasis/sdk/worker'
|
|
12489
12685
|
*
|
|
12490
12686
|
* const item = await content.createItem({ title: 'Draft', pipelineId: 'long-form-to-shorts' })
|
|
12491
|
-
* const attempt = await content.createAttempt({
|
|
12687
|
+
* const attempt = await content.createAttempt({
|
|
12688
|
+
* contentItemId: item.id,
|
|
12689
|
+
* stepKey: 'clip-proposal',
|
|
12690
|
+
* status: 'running',
|
|
12691
|
+
* payload: {},
|
|
12692
|
+
* sourceExecutionId: context.executionId
|
|
12693
|
+
* })
|
|
12694
|
+
* const settled = await content.updateAttempt({ attemptId: attempt.id, status: 'success', payload: { body: '...' } })
|
|
12492
12695
|
* ```
|
|
12493
12696
|
*/
|
|
12494
|
-
declare const content:
|
|
12697
|
+
declare const content: ContentAdapter;
|
|
12495
12698
|
|
|
12496
12699
|
/**
|
|
12497
12700
|
* Typed PDF adapter for document rendering.
|
package/dist/worker/index.js
CHANGED
|
@@ -6700,6 +6700,8 @@ var acqDb = createAdapter("acqDb", [
|
|
|
6700
6700
|
"addCompaniesToList",
|
|
6701
6701
|
"updateCompanyStage",
|
|
6702
6702
|
"updateContactStage",
|
|
6703
|
+
"clearCompanyStages",
|
|
6704
|
+
"clearContactStages",
|
|
6703
6705
|
// Company operations
|
|
6704
6706
|
"createCompany",
|
|
6705
6707
|
"upsertCompany",
|
|
@@ -6726,6 +6728,8 @@ var acqDb = createAdapter("acqDb", [
|
|
|
6726
6728
|
"getDealById",
|
|
6727
6729
|
"getContactById",
|
|
6728
6730
|
"getCompanyById",
|
|
6731
|
+
"listDeals",
|
|
6732
|
+
"getDealPipelineAnalytics",
|
|
6729
6733
|
// Deal transitions
|
|
6730
6734
|
"updateDiscoveryData",
|
|
6731
6735
|
"updateProposalData",
|
|
@@ -6803,6 +6807,8 @@ var list = createAdapter("list", [
|
|
|
6803
6807
|
"recordExecution",
|
|
6804
6808
|
"updateCompanyStage",
|
|
6805
6809
|
"updateContactStage",
|
|
6810
|
+
"clearCompanyStages",
|
|
6811
|
+
"clearContactStages",
|
|
6806
6812
|
"listPendingCompanyIds",
|
|
6807
6813
|
"listPendingContactIds"
|
|
6808
6814
|
]);
|
|
@@ -6815,16 +6821,22 @@ var artifacts = createAdapter("artifacts", [
|
|
|
6815
6821
|
]);
|
|
6816
6822
|
|
|
6817
6823
|
// src/worker/adapters/content.ts
|
|
6818
|
-
var
|
|
6824
|
+
var METHODS14 = [
|
|
6819
6825
|
"createItem",
|
|
6820
6826
|
"getItem",
|
|
6821
6827
|
"listItems",
|
|
6822
6828
|
"updateItem",
|
|
6823
6829
|
"createAttempt",
|
|
6824
6830
|
"listAttempts",
|
|
6831
|
+
"updateAttempt",
|
|
6832
|
+
"createSourceAsset",
|
|
6833
|
+
"getSourceAsset",
|
|
6834
|
+
"listSourceAssets",
|
|
6835
|
+
"updateSourceAsset",
|
|
6825
6836
|
"createDistribution",
|
|
6826
6837
|
"updateDistribution"
|
|
6827
|
-
]
|
|
6838
|
+
];
|
|
6839
|
+
var content = createAdapter("content", METHODS14);
|
|
6828
6840
|
|
|
6829
6841
|
// src/worker/adapters/pdf.ts
|
|
6830
6842
|
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.48.0",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"tsup": "^8.0.0",
|
|
56
56
|
"typescript": "5.9.2",
|
|
57
57
|
"zod": "^4.1.0",
|
|
58
|
-
"@repo/core": "0.
|
|
58
|
+
"@repo/core": "0.63.0",
|
|
59
59
|
"@repo/typescript-config": "0.0.0",
|
|
60
60
|
"@repo/eslint-config": "0.0.0"
|
|
61
61
|
},
|
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. |
|
|
@@ -210,7 +210,7 @@ Universal scaffold documentation for all SDK projects. Source locations are co-l
|
|
|
210
210
|
|
|
211
211
|
The bundled agent-rule corpus. Locations are relative to this file -- the `reference/` root of the installed `@elevasis/sdk` package -- so every row resolves offline in a cloned project with no monorepo.
|
|
212
212
|
|
|
213
|
-
Agent rules indexed:
|
|
213
|
+
Agent rules indexed: 19.
|
|
214
214
|
|
|
215
215
|
### Core Config
|
|
216
216
|
|
|
@@ -226,6 +226,7 @@ Agent rules indexed: 18.
|
|
|
226
226
|
| Operations | `rules/operations.md` | Platform workflows, agents, resource definitions, and deployment for the operations/ surface | Editing anything under `operations/` -- workflows, agents, or resource definitions. |
|
|
227
227
|
| Platform | `rules/platform.md` | Platform conventions -- SDK workflows, agents, deployment, resource registry | Authoring a workflow or agent definition, or registering a resource in the registry. |
|
|
228
228
|
| Deployment | `rules/deployment.md` | Deployment workflow -- check-first, dev vs prod, version bumping, common errors | Before any deploy -- a plain `run deploy` targets production by default. |
|
|
229
|
+
| Content | `rules/content.md` | Building the content System behind the shipped pipeline, item, and distribution routes -- which recipe to read, and the catalog vocabulary that is model-owned rather than coded | Editing anything under `ui/src/routes/content/` -- items, pipelines, distributions, or a review gate. |
|
|
229
230
|
| Execution Model | `rules/execution.md` | Execution model -- timeouts, memory, concurrency, org isolation, runtime constraints | Hitting a timeout, memory ceiling, concurrency limit, or org-isolation question at runtime. |
|
|
230
231
|
| Agent Runtime | `rules/agent-runtime.md` | Agent runtime behavior -- iteration response shape, session memory and replay, prose normalization, and why a redeploy is what makes a platform fix live | Debugging an agent turn -- a missing reply, a corrupted one, a session that forgot, or an unenforced schema. |
|
|
231
232
|
| Error Handling | `rules/error-handling.md` | Error handling -- ExecutionError vs PlatformToolError, retry logic, no auto-retry | Writing or debugging a step handler that throws, catches, or retries. |
|
|
@@ -235,7 +236,7 @@ Agent rules indexed: 18.
|
|
|
235
236
|
|
|
236
237
|
| Rule | Location | Description | When to Load |
|
|
237
238
|
| --- | --- | --- | --- |
|
|
238
|
-
| Organization OS | `rules/organization-os.md` | Organization OS orientation -- what the semantic contract layer is, which surface owns what, and where the full reference docs live; concrete edit rules live in organization-model.md | Before an org-model change, to see how Systems, ontology, resources,
|
|
239
|
+
| Organization OS | `rules/organization-os.md` | Organization OS orientation -- what the semantic contract layer is, which surface owns what, and where the full reference docs live; concrete edit rules live in organization-model.md | Before an org-model change, to see how Systems, ontology, resources, roles, and knowledge relate. |
|
|
239
240
|
| Package Taxonomy | `rules/package-taxonomy.md` | Package taxonomy (consumer view) -- external projects consume the published @elevasis/* surface only; workspace-internal @repo/elevasis-* packages are not installable here | Adding a dependency, or resolving an `@elevasis/*` import or subpath question. |
|
|
240
241
|
| Active Change Index | `rules/active-change-index.md` | Which bundled references to load for platform areas under active change, and how to resolve drift between the bundled snapshot and live platform behavior | Before trusting a stable scaffold doc in a fast-moving area -- lists what in-progress work overrides. |
|
|
241
242
|
|
|
@@ -280,7 +281,7 @@ Docs-site pages indexed: 38.
|
|
|
280
281
|
|
|
281
282
|
| Page | Location | Description |
|
|
282
283
|
| --- | --- | --- |
|
|
283
|
-
| CLI Management Commands | `sdk/cli-management.mdx` | elevasis-sdk management commands -- project, note, acquisition, client, agent, session, queue, schedule, om, ui, and
|
|
284
|
+
| 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
285
|
| CLI Reference | `sdk/cli.mdx` | Core elevasis-sdk CLI commands -- validate, deploy, execute, inspect resources, manage credentials, rename, and enumerate the command catalog |
|
|
285
286
|
| 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
287
|
| 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. |
|
|
@@ -949,6 +949,16 @@
|
|
|
949
949
|
"sourcePath": "packages/sdk/docs/agent-rules/deployment.md",
|
|
950
950
|
"referencePath": "rules/deployment.md"
|
|
951
951
|
},
|
|
952
|
+
{
|
|
953
|
+
"packageName": "@elevasis/sdk",
|
|
954
|
+
"title": "Content",
|
|
955
|
+
"description": "Building the content System behind the shipped pipeline, item, and distribution routes -- which recipe to read, and the catalog vocabulary that is model-owned rather than coded",
|
|
956
|
+
"group": "Operations",
|
|
957
|
+
"order": 4,
|
|
958
|
+
"loadWhen": "Editing anything under `ui/src/routes/content/` -- items, pipelines, distributions, or a review gate.",
|
|
959
|
+
"sourcePath": "packages/sdk/docs/agent-rules/content.md",
|
|
960
|
+
"referencePath": "rules/content.md"
|
|
961
|
+
},
|
|
952
962
|
{
|
|
953
963
|
"packageName": "@elevasis/sdk",
|
|
954
964
|
"title": "Execution Model",
|
|
@@ -995,7 +1005,7 @@
|
|
|
995
1005
|
"description": "Organization OS orientation -- what the semantic contract layer is, which surface owns what, and where the full reference docs live; concrete edit rules live in organization-model.md",
|
|
996
1006
|
"group": "Orientation",
|
|
997
1007
|
"order": 1,
|
|
998
|
-
"loadWhen": "Before an org-model change, to see how Systems, ontology, resources,
|
|
1008
|
+
"loadWhen": "Before an org-model change, to see how Systems, ontology, resources, roles, and knowledge relate.",
|
|
999
1009
|
"sourcePath": "packages/sdk/docs/agent-rules/organization-os.md",
|
|
1000
1010
|
"referencePath": "rules/organization-os.md"
|
|
1001
1011
|
},
|
|
@@ -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
|
|