@absolutejs/artifacts 0.1.5 → 0.2.1
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/README.md +40 -0
- package/dist/drizzle.js +24 -13
- package/dist/index.js +267 -24
- package/dist/manifest.js +227 -226
- package/dist/manifest.json +23 -23
- package/dist/rag.js +2 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/manifest.d.ts +11 -1
- package/dist/src/registry.d.ts +1 -1
- package/dist/src/service.d.ts +5 -1
- package/dist/src/standardKinds.d.ts +45 -44
- package/dist/src/store.d.ts +5 -0
- package/dist/src/tools.d.ts +1 -1
- package/dist/src/types.d.ts +81 -1
- package/package.json +5 -4
package/dist/manifest.json
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
],
|
|
28
28
|
"properties": {
|
|
29
29
|
"artifactId": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"type": "string",
|
|
31
|
+
"minLength": 1
|
|
32
32
|
},
|
|
33
33
|
"ownerId": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
},
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
]
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
|
-
"from": "
|
|
171
|
+
"from": "typebox",
|
|
172
172
|
"names": [
|
|
173
173
|
"Type"
|
|
174
174
|
]
|
|
@@ -208,12 +208,12 @@
|
|
|
208
208
|
],
|
|
209
209
|
"properties": {
|
|
210
210
|
"artifactId": {
|
|
211
|
-
"
|
|
212
|
-
"
|
|
211
|
+
"type": "string",
|
|
212
|
+
"minLength": 1
|
|
213
213
|
},
|
|
214
214
|
"ownerId": {
|
|
215
|
-
"
|
|
216
|
-
"
|
|
215
|
+
"type": "string",
|
|
216
|
+
"minLength": 1
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
},
|
|
@@ -245,12 +245,12 @@
|
|
|
245
245
|
],
|
|
246
246
|
"properties": {
|
|
247
247
|
"kind": {
|
|
248
|
-
"
|
|
249
|
-
"
|
|
248
|
+
"type": "string",
|
|
249
|
+
"minLength": 1
|
|
250
250
|
},
|
|
251
251
|
"ownerId": {
|
|
252
|
-
"
|
|
253
|
-
"
|
|
252
|
+
"type": "string",
|
|
253
|
+
"minLength": 1
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
},
|
|
@@ -284,12 +284,12 @@
|
|
|
284
284
|
],
|
|
285
285
|
"properties": {
|
|
286
286
|
"artifactId": {
|
|
287
|
-
"
|
|
288
|
-
"
|
|
287
|
+
"type": "string",
|
|
288
|
+
"minLength": 1
|
|
289
289
|
},
|
|
290
290
|
"ownerId": {
|
|
291
|
-
"
|
|
292
|
-
"
|
|
291
|
+
"type": "string",
|
|
292
|
+
"minLength": 1
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
},
|
|
@@ -325,16 +325,16 @@
|
|
|
325
325
|
],
|
|
326
326
|
"properties": {
|
|
327
327
|
"artifactId": {
|
|
328
|
-
"
|
|
329
|
-
"
|
|
328
|
+
"type": "string",
|
|
329
|
+
"minLength": 1
|
|
330
330
|
},
|
|
331
331
|
"ownerId": {
|
|
332
|
-
"
|
|
333
|
-
"
|
|
332
|
+
"type": "string",
|
|
333
|
+
"minLength": 1
|
|
334
334
|
},
|
|
335
335
|
"revision": {
|
|
336
|
-
"
|
|
337
|
-
"
|
|
336
|
+
"type": "integer",
|
|
337
|
+
"minimum": 1
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
},
|
package/dist/rag.js
CHANGED
package/dist/src/index.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export { createArtifactRendererRegistry, type ArtifactRenderer, type ArtifactRen
|
|
|
13
13
|
export { createArtifactService, type ArtifactPublisher, type ArtifactService, type ArtifactServiceOptions, } from "./service";
|
|
14
14
|
export { createMemoryArtifactStore, createMemoryArtifactAssetStore, type ArtifactAssetStore, type ArtifactAssetTransaction, type ArtifactStore, } from "./store";
|
|
15
15
|
export { createArtifactTools, type ArtifactToolDefinition, type ArtifactToolMap, type ArtifactToolOptions, } from "./tools";
|
|
16
|
-
export { ARTIFACT_STATUSES, ARTIFACT_EVENT_TYPES, ArtifactError, isJsonValue, type ArtifactAssetReference, type ArtifactAssetRole, type ArtifactAssetWriteInput, type ArtifactBundleCreateInput, type ArtifactCapability, type ArtifactCreateInput, type ArtifactErrorCode, type ArtifactEvent, type ArtifactEventQuery, type ArtifactEventType, type ArtifactGarbageCollectionResult, type ArtifactIndexingState, type ArtifactIndexingStatus, type ArtifactListQuery, type ArtifactLineageReference, type ArtifactLineageRelation, type ArtifactProvenance, type ArtifactPublication, type ArtifactPublishInput, type ArtifactRecord, type ArtifactRevision, type ArtifactRetentionCandidate, type ArtifactStatus, type ArtifactUpdateInput, type JsonObject, type JsonPrimitive, type JsonValue, } from "./types";
|
|
16
|
+
export { ARTIFACT_STATUSES, ARTIFACT_EVENT_TYPES, ArtifactError, isJsonValue, type ArtifactAssetReference, type ArtifactAssetRole, type ArtifactAssetWriteInput, type ArtifactBatchCommitMode, type ArtifactBatchCompletionReceipt, type ArtifactBatchCreateInput, type ArtifactBatchItemInput, type ArtifactBatchReceiptItem, type ArtifactBatchValidationIssue, type ArtifactBatchValidationResult, type ArtifactBatchValidator, type ArtifactBundleCreateInput, type ArtifactCapability, type ArtifactCreateInput, type ArtifactErrorCode, type ArtifactEvent, type ArtifactEventQuery, type ArtifactEventType, type ArtifactEvidenceReference, type ArtifactGarbageCollectionResult, type ArtifactIndexingState, type ArtifactIndexingStatus, type ArtifactListQuery, type ArtifactLineageReference, type ArtifactLineageRelation, type ArtifactProvenance, type ArtifactPublication, type ArtifactPublishInput, type ArtifactRecord, type ArtifactRevision, type ArtifactRetentionCandidate, type ArtifactStatus, type ArtifactUpdateInput, type JsonObject, type JsonPrimitive, type JsonValue, type StagedArtifactBatch, } from "./types";
|
package/dist/src/manifest.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
1
2
|
export declare const manifest: Omit<import("@absolutejs/manifest").PackageManifest<Record<string, never>, {
|
|
2
3
|
archive: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactRecord>;
|
|
3
4
|
attach: (ownerId: string, artifactId: string, input: import("./types").ArtifactAssetWriteInput, expectedRevision?: number) => Promise<import("./types").ArtifactRecord>;
|
|
@@ -8,6 +9,9 @@ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManife
|
|
|
8
9
|
}) => Promise<import("./types").ArtifactGarbageCollectionResult>;
|
|
9
10
|
create: (ownerId: string, input: import("./types").ArtifactCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
10
11
|
createBundle: (ownerId: string, input: import("./types").ArtifactBundleCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
12
|
+
stageBatch: (ownerId: string, input: import("./types").ArtifactBatchCreateInput, stageOptions?: {
|
|
13
|
+
validators?: import("./types").ArtifactBatchValidator[];
|
|
14
|
+
}) => Promise<import("./types").StagedArtifactBatch>;
|
|
11
15
|
detach: (ownerId: string, artifactId: string, assetId: string, expectedRevision?: number) => Promise<import("./types").ArtifactRecord>;
|
|
12
16
|
get: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactRecord>;
|
|
13
17
|
getIndexingState: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactIndexingState | null>;
|
|
@@ -43,6 +47,9 @@ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManife
|
|
|
43
47
|
}) => Promise<import("./types").ArtifactGarbageCollectionResult>;
|
|
44
48
|
create: (ownerId: string, input: import("./types").ArtifactCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
45
49
|
createBundle: (ownerId: string, input: import("./types").ArtifactBundleCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
50
|
+
stageBatch: (ownerId: string, input: import("./types").ArtifactBatchCreateInput, stageOptions?: {
|
|
51
|
+
validators?: import("./types").ArtifactBatchValidator[];
|
|
52
|
+
}) => Promise<import("./types").StagedArtifactBatch>;
|
|
46
53
|
detach: (ownerId: string, artifactId: string, assetId: string, expectedRevision?: number) => Promise<import("./types").ArtifactRecord>;
|
|
47
54
|
get: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactRecord>;
|
|
48
55
|
getIndexingState: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactIndexingState | null>;
|
|
@@ -79,6 +86,9 @@ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManife
|
|
|
79
86
|
}) => Promise<import("./types").ArtifactGarbageCollectionResult>;
|
|
80
87
|
create: (ownerId: string, input: import("./types").ArtifactCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
81
88
|
createBundle: (ownerId: string, input: import("./types").ArtifactBundleCreateInput) => Promise<import("./types").ArtifactRecord>;
|
|
89
|
+
stageBatch: (ownerId: string, input: import("./types").ArtifactBatchCreateInput, stageOptions?: {
|
|
90
|
+
validators?: import("./types").ArtifactBatchValidator[];
|
|
91
|
+
}) => Promise<import("./types").StagedArtifactBatch>;
|
|
82
92
|
detach: (ownerId: string, artifactId: string, assetId: string, expectedRevision?: number) => Promise<import("./types").ArtifactRecord>;
|
|
83
93
|
get: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactRecord>;
|
|
84
94
|
getIndexingState: (ownerId: string, artifactId: string) => Promise<import("./types").ArtifactIndexingState | null>;
|
|
@@ -104,5 +114,5 @@ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManife
|
|
|
104
114
|
update: (ownerId: string, artifactId: string, input: import("./types").ArtifactUpdateInput) => Promise<import("./types").ArtifactRecord>;
|
|
105
115
|
}>> | undefined;
|
|
106
116
|
}) & {
|
|
107
|
-
settings:
|
|
117
|
+
settings: Type.TObject<{}>;
|
|
108
118
|
});
|
package/dist/src/registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Static, TSchema } from "
|
|
1
|
+
import type { Static, TSchema } from "typebox";
|
|
2
2
|
import { type ArtifactCapability, type JsonValue } from "./types";
|
|
3
3
|
export type ArtifactAssetPolicy = {
|
|
4
4
|
/** Exact media types or wildcards such as image/* and application/*. */
|
package/dist/src/service.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ArtifactKindDefinitions, ArtifactRegistry } from "./registry";
|
|
2
2
|
import type { ArtifactAssetStore, ArtifactStore } from "./store";
|
|
3
|
-
import { type ArtifactAssetReference, type ArtifactAssetWriteInput, type ArtifactBundleCreateInput, type ArtifactCreateInput, type ArtifactEvent, type ArtifactEventQuery, type ArtifactGarbageCollectionResult, type ArtifactIndexingState, type ArtifactIndexingStatus, type ArtifactListQuery, type ArtifactPublishInput, type ArtifactRecord, type ArtifactUpdateInput } from "./types";
|
|
3
|
+
import { type ArtifactAssetReference, type ArtifactAssetWriteInput, type ArtifactBatchCreateInput, type ArtifactBatchValidator, type ArtifactBundleCreateInput, type ArtifactCreateInput, type ArtifactEvent, type ArtifactEventQuery, type ArtifactGarbageCollectionResult, type ArtifactIndexingState, type ArtifactIndexingStatus, type ArtifactListQuery, type ArtifactPublishInput, type ArtifactRecord, type ArtifactUpdateInput, type StagedArtifactBatch } from "./types";
|
|
4
4
|
export type ArtifactPublisher = {
|
|
5
5
|
publish(artifact: ArtifactRecord, options: {
|
|
6
6
|
idempotencyKey: string;
|
|
@@ -16,6 +16,7 @@ export type ArtifactPublisher = {
|
|
|
16
16
|
};
|
|
17
17
|
export type ArtifactServiceOptions<TDefinitions extends ArtifactKindDefinitions = ArtifactKindDefinitions> = {
|
|
18
18
|
assetStore?: ArtifactAssetStore;
|
|
19
|
+
batchIdFactory?: () => string;
|
|
19
20
|
clock?: () => Date;
|
|
20
21
|
eventIdFactory?: () => string;
|
|
21
22
|
idFactory?: () => string;
|
|
@@ -34,6 +35,9 @@ export declare const createArtifactService: <TDefinitions extends ArtifactKindDe
|
|
|
34
35
|
}) => Promise<ArtifactGarbageCollectionResult>;
|
|
35
36
|
create: (ownerId: string, input: ArtifactCreateInput) => Promise<ArtifactRecord>;
|
|
36
37
|
createBundle: (ownerId: string, input: ArtifactBundleCreateInput) => Promise<ArtifactRecord>;
|
|
38
|
+
stageBatch: (ownerId: string, input: ArtifactBatchCreateInput, stageOptions?: {
|
|
39
|
+
validators?: ArtifactBatchValidator[];
|
|
40
|
+
}) => Promise<StagedArtifactBatch>;
|
|
37
41
|
detach: (ownerId: string, artifactId: string, assetId: string, expectedRevision?: number) => Promise<ArtifactRecord>;
|
|
38
42
|
get: (ownerId: string, artifactId: string) => Promise<ArtifactRecord>;
|
|
39
43
|
getIndexingState: (ownerId: string, artifactId: string) => Promise<ArtifactIndexingState | null>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
1
2
|
export declare const standardArtifactDefinitions: {
|
|
2
3
|
archive: {
|
|
3
4
|
assets: {
|
|
@@ -5,10 +6,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
5
6
|
maxCount: number;
|
|
6
7
|
};
|
|
7
8
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
8
|
-
content:
|
|
9
|
-
description:
|
|
10
|
-
instructions:
|
|
11
|
-
summary:
|
|
9
|
+
content: Type.TObject<{
|
|
10
|
+
description: Type.TOptional<Type.TString>;
|
|
11
|
+
instructions: Type.TOptional<Type.TString>;
|
|
12
|
+
summary: Type.TOptional<Type.TString>;
|
|
12
13
|
}>;
|
|
13
14
|
label: string;
|
|
14
15
|
schemaVersion: number;
|
|
@@ -19,10 +20,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
19
20
|
maxCount: number;
|
|
20
21
|
};
|
|
21
22
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
22
|
-
content:
|
|
23
|
-
description:
|
|
24
|
-
instructions:
|
|
25
|
-
summary:
|
|
23
|
+
content: Type.TObject<{
|
|
24
|
+
description: Type.TOptional<Type.TString>;
|
|
25
|
+
instructions: Type.TOptional<Type.TString>;
|
|
26
|
+
summary: Type.TOptional<Type.TString>;
|
|
26
27
|
}>;
|
|
27
28
|
label: string;
|
|
28
29
|
schemaVersion: number;
|
|
@@ -33,10 +34,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
33
34
|
maxCount: number;
|
|
34
35
|
};
|
|
35
36
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
36
|
-
content:
|
|
37
|
-
description:
|
|
38
|
-
instructions:
|
|
39
|
-
summary:
|
|
37
|
+
content: Type.TObject<{
|
|
38
|
+
description: Type.TOptional<Type.TString>;
|
|
39
|
+
instructions: Type.TOptional<Type.TString>;
|
|
40
|
+
summary: Type.TOptional<Type.TString>;
|
|
40
41
|
}>;
|
|
41
42
|
label: string;
|
|
42
43
|
schemaVersion: number;
|
|
@@ -47,10 +48,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
47
48
|
maxCount: number;
|
|
48
49
|
};
|
|
49
50
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
50
|
-
content:
|
|
51
|
-
description:
|
|
52
|
-
instructions:
|
|
53
|
-
summary:
|
|
51
|
+
content: Type.TObject<{
|
|
52
|
+
description: Type.TOptional<Type.TString>;
|
|
53
|
+
instructions: Type.TOptional<Type.TString>;
|
|
54
|
+
summary: Type.TOptional<Type.TString>;
|
|
54
55
|
}>;
|
|
55
56
|
label: string;
|
|
56
57
|
schemaVersion: number;
|
|
@@ -61,10 +62,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
61
62
|
maxCount: number;
|
|
62
63
|
};
|
|
63
64
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
64
|
-
content:
|
|
65
|
-
description:
|
|
66
|
-
instructions:
|
|
67
|
-
summary:
|
|
65
|
+
content: Type.TObject<{
|
|
66
|
+
description: Type.TOptional<Type.TString>;
|
|
67
|
+
instructions: Type.TOptional<Type.TString>;
|
|
68
|
+
summary: Type.TOptional<Type.TString>;
|
|
68
69
|
}>;
|
|
69
70
|
label: string;
|
|
70
71
|
schemaVersion: number;
|
|
@@ -75,10 +76,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
75
76
|
maxCount: number;
|
|
76
77
|
};
|
|
77
78
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
78
|
-
content:
|
|
79
|
-
description:
|
|
80
|
-
instructions:
|
|
81
|
-
summary:
|
|
79
|
+
content: Type.TObject<{
|
|
80
|
+
description: Type.TOptional<Type.TString>;
|
|
81
|
+
instructions: Type.TOptional<Type.TString>;
|
|
82
|
+
summary: Type.TOptional<Type.TString>;
|
|
82
83
|
}>;
|
|
83
84
|
label: string;
|
|
84
85
|
schemaVersion: number;
|
|
@@ -89,10 +90,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
89
90
|
maxCount: number;
|
|
90
91
|
};
|
|
91
92
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
92
|
-
content:
|
|
93
|
-
description:
|
|
94
|
-
instructions:
|
|
95
|
-
summary:
|
|
93
|
+
content: Type.TObject<{
|
|
94
|
+
description: Type.TOptional<Type.TString>;
|
|
95
|
+
instructions: Type.TOptional<Type.TString>;
|
|
96
|
+
summary: Type.TOptional<Type.TString>;
|
|
96
97
|
}>;
|
|
97
98
|
label: string;
|
|
98
99
|
schemaVersion: number;
|
|
@@ -103,10 +104,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
103
104
|
maxCount: number;
|
|
104
105
|
};
|
|
105
106
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
106
|
-
content:
|
|
107
|
-
description:
|
|
108
|
-
instructions:
|
|
109
|
-
summary:
|
|
107
|
+
content: Type.TObject<{
|
|
108
|
+
description: Type.TOptional<Type.TString>;
|
|
109
|
+
instructions: Type.TOptional<Type.TString>;
|
|
110
|
+
summary: Type.TOptional<Type.TString>;
|
|
110
111
|
}>;
|
|
111
112
|
label: string;
|
|
112
113
|
schemaVersion: number;
|
|
@@ -117,10 +118,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
117
118
|
maxCount: number;
|
|
118
119
|
};
|
|
119
120
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
120
|
-
content:
|
|
121
|
-
description:
|
|
122
|
-
instructions:
|
|
123
|
-
summary:
|
|
121
|
+
content: Type.TObject<{
|
|
122
|
+
description: Type.TOptional<Type.TString>;
|
|
123
|
+
instructions: Type.TOptional<Type.TString>;
|
|
124
|
+
summary: Type.TOptional<Type.TString>;
|
|
124
125
|
}>;
|
|
125
126
|
label: string;
|
|
126
127
|
schemaVersion: number;
|
|
@@ -131,10 +132,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
131
132
|
maxCount: number;
|
|
132
133
|
};
|
|
133
134
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
134
|
-
content:
|
|
135
|
-
description:
|
|
136
|
-
instructions:
|
|
137
|
-
summary:
|
|
135
|
+
content: Type.TObject<{
|
|
136
|
+
description: Type.TOptional<Type.TString>;
|
|
137
|
+
instructions: Type.TOptional<Type.TString>;
|
|
138
|
+
summary: Type.TOptional<Type.TString>;
|
|
138
139
|
}>;
|
|
139
140
|
label: string;
|
|
140
141
|
schemaVersion: number;
|
|
@@ -145,10 +146,10 @@ export declare const standardArtifactDefinitions: {
|
|
|
145
146
|
maxCount: number;
|
|
146
147
|
};
|
|
147
148
|
capabilities: ("attach" | "archive" | "edit" | "export" | "preview" | "refine")[];
|
|
148
|
-
content:
|
|
149
|
-
description:
|
|
150
|
-
instructions:
|
|
151
|
-
summary:
|
|
149
|
+
content: Type.TObject<{
|
|
150
|
+
description: Type.TOptional<Type.TString>;
|
|
151
|
+
instructions: Type.TOptional<Type.TString>;
|
|
152
|
+
summary: Type.TOptional<Type.TString>;
|
|
152
153
|
}>;
|
|
153
154
|
label: string;
|
|
154
155
|
schemaVersion: number;
|
package/dist/src/store.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export type ArtifactAssetStore = {
|
|
|
22
22
|
export type ArtifactStore = {
|
|
23
23
|
/** Persist the current record and its first immutable revision atomically. */
|
|
24
24
|
create(record: ArtifactRecord, events?: ArtifactEvent[]): Promise<void>;
|
|
25
|
+
/** Persist multiple records, first revisions, and events in one transaction. */
|
|
26
|
+
createBatch?(entries: Array<{
|
|
27
|
+
events?: ArtifactEvent[];
|
|
28
|
+
record: ArtifactRecord;
|
|
29
|
+
}>): Promise<void>;
|
|
25
30
|
getIndexingState(ownerId: string, artifactId: string): Promise<ArtifactIndexingState | null>;
|
|
26
31
|
get(ownerId: string, artifactId: string): Promise<ArtifactRecord | null>;
|
|
27
32
|
getRevision(ownerId: string, artifactId: string, revision: number): Promise<ArtifactRevision | null>;
|
package/dist/src/tools.d.ts
CHANGED
package/dist/src/types.d.ts
CHANGED
|
@@ -8,12 +8,20 @@ export declare function isJsonValue(value: unknown): value is JsonValue;
|
|
|
8
8
|
export type ArtifactStatus = (typeof ARTIFACT_STATUSES)[number];
|
|
9
9
|
export type ArtifactCapability = "attach" | "archive" | "edit" | "export" | "preview" | "publish" | "refine";
|
|
10
10
|
export type ArtifactProvenance = {
|
|
11
|
+
evidence?: ArtifactEvidenceReference[];
|
|
11
12
|
lineage?: ArtifactLineageReference[];
|
|
12
13
|
model?: string;
|
|
13
14
|
sourceIds?: string[];
|
|
14
15
|
tool?: string;
|
|
15
16
|
traceId?: string;
|
|
16
17
|
};
|
|
18
|
+
export type ArtifactEvidenceReference = {
|
|
19
|
+
capturedAt?: string;
|
|
20
|
+
excerpt?: string;
|
|
21
|
+
metadata?: JsonObject;
|
|
22
|
+
sourceId?: string;
|
|
23
|
+
sourceUrl?: string;
|
|
24
|
+
};
|
|
17
25
|
export type ArtifactLineageRelation = "derived_from" | "generated_from" | "references" | "replaces";
|
|
18
26
|
export type ArtifactLineageReference = {
|
|
19
27
|
artifactId?: string;
|
|
@@ -122,6 +130,78 @@ export type ArtifactUpdateInput = {
|
|
|
122
130
|
export type ArtifactBundleCreateInput = Omit<ArtifactCreateInput, "assets"> & {
|
|
123
131
|
assets?: ArtifactAssetWriteInput[];
|
|
124
132
|
};
|
|
133
|
+
export type ArtifactBatchItemInput = {
|
|
134
|
+
artifact: ArtifactBundleCreateInput;
|
|
135
|
+
evidence?: ArtifactEvidenceReference[];
|
|
136
|
+
/** Stable caller-defined key used to reconcile a receipt with requested output. */
|
|
137
|
+
key: string;
|
|
138
|
+
};
|
|
139
|
+
export type ArtifactBatchCommitMode = "archive_on_failure" | "require_atomic";
|
|
140
|
+
export type ArtifactBatchCreateInput = {
|
|
141
|
+
bundleId?: string;
|
|
142
|
+
commitMode?: ArtifactBatchCommitMode;
|
|
143
|
+
evidence?: ArtifactEvidenceReference[];
|
|
144
|
+
items: ArtifactBatchItemInput[];
|
|
145
|
+
metadata?: JsonObject;
|
|
146
|
+
provenance?: ArtifactProvenance;
|
|
147
|
+
};
|
|
148
|
+
export type ArtifactBatchValidationIssue = {
|
|
149
|
+
code: string;
|
|
150
|
+
itemKey?: string;
|
|
151
|
+
message: string;
|
|
152
|
+
path?: string;
|
|
153
|
+
};
|
|
154
|
+
export type ArtifactBatchValidationResult = {
|
|
155
|
+
issues?: never;
|
|
156
|
+
valid: true;
|
|
157
|
+
} | {
|
|
158
|
+
issues: ArtifactBatchValidationIssue[];
|
|
159
|
+
valid: false;
|
|
160
|
+
};
|
|
161
|
+
export type ArtifactBatchReceiptItem = {
|
|
162
|
+
artifactId: string;
|
|
163
|
+
archived?: boolean;
|
|
164
|
+
key: string;
|
|
165
|
+
kind: string;
|
|
166
|
+
revision: number;
|
|
167
|
+
title: string;
|
|
168
|
+
};
|
|
169
|
+
export type ArtifactBatchCompletionReceipt = {
|
|
170
|
+
archivedArtifactIds: string[];
|
|
171
|
+
atomic: boolean;
|
|
172
|
+
bundleId: string;
|
|
173
|
+
completedAt: string;
|
|
174
|
+
error?: string;
|
|
175
|
+
items: ArtifactBatchReceiptItem[];
|
|
176
|
+
ownerId: string;
|
|
177
|
+
stagedAt: string;
|
|
178
|
+
status: "committed" | "partial_failure" | "rolled_back";
|
|
179
|
+
validation: ArtifactBatchValidationResult;
|
|
180
|
+
};
|
|
181
|
+
export type ArtifactBatchValidator = (context: {
|
|
182
|
+
bundleId: string;
|
|
183
|
+
evidence: ArtifactEvidenceReference[];
|
|
184
|
+
items: ReadonlyArray<{
|
|
185
|
+
evidence: ArtifactEvidenceReference[];
|
|
186
|
+
key: string;
|
|
187
|
+
record: Readonly<ArtifactRecord>;
|
|
188
|
+
}>;
|
|
189
|
+
ownerId: string;
|
|
190
|
+
}) => ArtifactBatchValidationIssue[] | Promise<ArtifactBatchValidationIssue[]>;
|
|
191
|
+
export type StagedArtifactBatch = {
|
|
192
|
+
bundleId: string;
|
|
193
|
+
commit(): Promise<ArtifactBatchCompletionReceipt>;
|
|
194
|
+
evidence: ArtifactEvidenceReference[];
|
|
195
|
+
items: ReadonlyArray<{
|
|
196
|
+
evidence: ArtifactEvidenceReference[];
|
|
197
|
+
key: string;
|
|
198
|
+
record: Readonly<ArtifactRecord>;
|
|
199
|
+
}>;
|
|
200
|
+
ownerId: string;
|
|
201
|
+
rollback(reason?: string): Promise<ArtifactBatchCompletionReceipt>;
|
|
202
|
+
stagedAt: string;
|
|
203
|
+
validation: ArtifactBatchValidationResult;
|
|
204
|
+
};
|
|
125
205
|
export type ArtifactPublishInput = {
|
|
126
206
|
mode?: "live" | "pinned";
|
|
127
207
|
};
|
|
@@ -133,7 +213,7 @@ export type ArtifactGarbageCollectionResult = {
|
|
|
133
213
|
deleted: ArtifactAssetReference[];
|
|
134
214
|
retained: ArtifactAssetReference[];
|
|
135
215
|
};
|
|
136
|
-
export type ArtifactErrorCode = "asset_store_unavailable" | "asset_transaction_unavailable" | "conflict" | "generator_unavailable" | "invalid_content" | "not_found" | "publisher_unavailable" | "renderer_unavailable" | "unsupported_capability" | "unknown_kind";
|
|
216
|
+
export type ArtifactErrorCode = "asset_store_unavailable" | "asset_transaction_unavailable" | "atomic_batch_unavailable" | "batch_validation_failed" | "conflict" | "generator_unavailable" | "invalid_content" | "not_found" | "publisher_unavailable" | "renderer_unavailable" | "unsupported_capability" | "unknown_kind";
|
|
137
217
|
export declare class ArtifactError extends Error {
|
|
138
218
|
readonly code: ArtifactErrorCode;
|
|
139
219
|
constructor(code: ArtifactErrorCode, message: string);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/artifacts",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Typed, versioned artifacts for AI products — schemas, lifecycle, storage, rendering, publishing, revisions, and agent tools without prescribing a database or host.",
|
|
5
5
|
"author": "Alex Kahn",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://github.com/absolutejs/artifacts/issues"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "rm -rf dist && bun build src/index.ts src/drizzle.ts src/manifest.ts src/rag.ts --outdir dist --root ./src --target=bun --external @absolutejs/rag --external @sinclair/typebox --external @sinclair/typebox/value --external drizzle-orm --external 'drizzle-orm/*' --external drizzle-typebox && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
|
|
24
|
+
"build": "rm -rf dist && bun build src/index.ts src/drizzle.ts src/manifest.ts src/rag.ts --outdir dist --root ./src --target=bun --external @absolutejs/rag --external @sinclair/typebox --external @sinclair/typebox/value --external typebox --external 'typebox/*' --external drizzle-orm --external 'drizzle-orm/*' --external drizzle-typebox && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
|
|
25
25
|
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
26
26
|
"release": "bun run format && bun run test && bun run build && bun publish",
|
|
27
27
|
"test": "bun test",
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@absolutejs/manifest": "^0.
|
|
60
|
+
"@absolutejs/manifest": "^0.10.0",
|
|
61
61
|
"@sinclair/typebox": "^0.34.0",
|
|
62
|
-
"drizzle-typebox": "1.0.0-beta.14-a36c63d"
|
|
62
|
+
"drizzle-typebox": "1.0.0-beta.14-a36c63d",
|
|
63
|
+
"typebox": "^1.3.16"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"@absolutejs/rag": ">=0.1.1 <0.9.0",
|