@absolutejs/artifacts 0.0.1 → 0.0.3

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.
@@ -1,18 +1,52 @@
1
1
  export declare const ARTIFACT_STATUSES: readonly ["draft", "published", "archived"];
2
2
  export type ArtifactStatus = (typeof ARTIFACT_STATUSES)[number];
3
- export type ArtifactCapability = "archive" | "edit" | "export" | "preview" | "publish" | "refine";
3
+ export type ArtifactCapability = "attach" | "archive" | "edit" | "export" | "preview" | "publish" | "refine";
4
4
  export type ArtifactProvenance = {
5
+ lineage?: ArtifactLineageReference[];
5
6
  model?: string;
6
7
  sourceIds?: string[];
7
8
  tool?: string;
8
9
  traceId?: string;
9
10
  };
11
+ export type ArtifactLineageRelation = "derived_from" | "generated_from" | "references" | "replaces";
12
+ export type ArtifactLineageReference = {
13
+ artifactId?: string;
14
+ relation: ArtifactLineageRelation;
15
+ revision?: number;
16
+ sourceId?: string;
17
+ };
10
18
  export type ArtifactPublication = {
11
19
  id: string;
20
+ mode: "live" | "pinned";
12
21
  publishedAt: string;
22
+ revision: number;
13
23
  url: string;
14
24
  };
25
+ export type ArtifactAssetRole = "attachment" | "primary" | "preview" | "source";
26
+ export type ArtifactAssetReference = {
27
+ checksum?: {
28
+ algorithm: "sha256";
29
+ value: string;
30
+ };
31
+ id: string;
32
+ createdAt: string;
33
+ mediaType: string;
34
+ metadata?: Record<string, unknown>;
35
+ name: string;
36
+ role: ArtifactAssetRole;
37
+ size: number;
38
+ /** Opaque host storage locator. It is not required to be publicly fetchable. */
39
+ uri: string;
40
+ };
41
+ export type ArtifactAssetWriteInput = {
42
+ data: Uint8Array;
43
+ mediaType: string;
44
+ metadata?: Record<string, unknown>;
45
+ name: string;
46
+ role?: ArtifactAssetRole;
47
+ };
15
48
  export type ArtifactRecord<TContent = unknown> = {
49
+ assets: ArtifactAssetReference[];
16
50
  capabilities: ArtifactCapability[];
17
51
  content: TContent;
18
52
  createdAt: string;
@@ -29,12 +63,42 @@ export type ArtifactRecord<TContent = unknown> = {
29
63
  title: string;
30
64
  updatedAt: string;
31
65
  };
66
+ export declare const ARTIFACT_EVENT_TYPES: readonly ["artifact.archived", "artifact.asset_attached", "artifact.asset_detached", "artifact.created", "artifact.generated", "artifact.indexing_changed", "artifact.published", "artifact.restored", "artifact.revised", "artifact.unpublished"];
67
+ export type ArtifactEventType = (typeof ARTIFACT_EVENT_TYPES)[number];
68
+ export type ArtifactEvent = {
69
+ artifactId: string;
70
+ createdAt: string;
71
+ id: string;
72
+ ownerId: string;
73
+ payload?: Record<string, unknown>;
74
+ processedAt?: string;
75
+ revision: number;
76
+ type: ArtifactEventType;
77
+ };
78
+ export type ArtifactEventQuery = {
79
+ limit?: number;
80
+ processed?: boolean;
81
+ type?: ArtifactEventType;
82
+ };
83
+ export type ArtifactIndexingStatus = "failed" | "indexed" | "pending" | "stale";
84
+ export type ArtifactIndexingState = {
85
+ artifactId: string;
86
+ documentIds: string[];
87
+ error?: string;
88
+ indexedAt?: string;
89
+ revision: number;
90
+ status: ArtifactIndexingStatus;
91
+ updatedAt: string;
92
+ };
93
+ /** An immutable point-in-time copy of an artifact record. */
94
+ export type ArtifactRevision<TContent = unknown> = Readonly<ArtifactRecord<TContent>>;
32
95
  export type ArtifactListQuery = {
33
96
  kind?: string;
34
97
  limit?: number;
35
98
  status?: ArtifactStatus;
36
99
  };
37
100
  export type ArtifactCreateInput = {
101
+ assets?: ArtifactAssetReference[];
38
102
  content: unknown;
39
103
  createdBy: string;
40
104
  kind: string;
@@ -43,12 +107,27 @@ export type ArtifactCreateInput = {
43
107
  title: string;
44
108
  };
45
109
  export type ArtifactUpdateInput = {
110
+ assets?: ArtifactAssetReference[];
46
111
  content?: unknown;
47
112
  expectedRevision?: number;
48
113
  metadata?: Record<string, unknown>;
49
114
  title?: string;
50
115
  };
51
- export type ArtifactErrorCode = "conflict" | "invalid_content" | "not_found" | "publisher_unavailable" | "renderer_unavailable" | "unsupported_capability" | "unknown_kind";
116
+ export type ArtifactBundleCreateInput = Omit<ArtifactCreateInput, "assets"> & {
117
+ assets?: ArtifactAssetWriteInput[];
118
+ };
119
+ export type ArtifactPublishInput = {
120
+ mode?: "live" | "pinned";
121
+ };
122
+ export type ArtifactRetentionCandidate = {
123
+ createdAt: string;
124
+ reference: ArtifactAssetReference;
125
+ };
126
+ export type ArtifactGarbageCollectionResult = {
127
+ deleted: ArtifactAssetReference[];
128
+ retained: ArtifactAssetReference[];
129
+ };
130
+ export type ArtifactErrorCode = "asset_store_unavailable" | "asset_transaction_unavailable" | "conflict" | "generator_unavailable" | "invalid_content" | "not_found" | "publisher_unavailable" | "renderer_unavailable" | "unsupported_capability" | "unknown_kind";
52
131
  export declare class ArtifactError extends Error {
53
132
  readonly code: ArtifactErrorCode;
54
133
  constructor(code: ArtifactErrorCode, message: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/artifacts",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
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",
@@ -14,14 +14,14 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/absolutejs/artifacts.git"
17
+ "url": "git+https://github.com/absolutejs/artifacts.git"
18
18
  },
19
19
  "homepage": "https://github.com/absolutejs/artifacts",
20
20
  "bugs": {
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/manifest.ts --outdir dist --root ./src --target=bun --external @sinclair/typebox --external @sinclair/typebox/value && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
24
+ "build": "rm -rf dist && bun build src/index.ts src/manifest.ts src/rag.ts --outdir dist --root ./src --target=bun --external @absolutejs/rag --external @sinclair/typebox --external @sinclair/typebox/value && 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",
@@ -44,13 +44,27 @@
44
44
  "import": "./dist/manifest.js",
45
45
  "default": "./dist/manifest.js"
46
46
  },
47
- "./manifest.json": "./dist/manifest.json"
47
+ "./manifest.json": "./dist/manifest.json",
48
+ "./rag": {
49
+ "types": "./dist/src/rag.d.ts",
50
+ "import": "./dist/rag.js",
51
+ "default": "./dist/rag.js"
52
+ }
48
53
  },
49
54
  "dependencies": {
50
55
  "@absolutejs/manifest": "^0.1.0",
51
56
  "@sinclair/typebox": "^0.34.0"
52
57
  },
58
+ "peerDependencies": {
59
+ "@absolutejs/rag": ">=0.0.29"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "@absolutejs/rag": {
63
+ "optional": true
64
+ }
65
+ },
53
66
  "devDependencies": {
67
+ "@absolutejs/rag": "0.0.29",
54
68
  "@types/bun": "latest",
55
69
  "prettier": "3.5.3",
56
70
  "typescript": "5.8.3"