@codelia/storage 0.1.81 → 0.1.83
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/index.cjs +555 -133
- package/dist/index.d.cts +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +518 -95
- package/package.json +6 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
|
+
import { GeneratedImageMetadata, ImageArtifactRef, ImageMediaType, AttachedImageMetadata, ImageArtifactMetadata, ApprovalMode, SubagentLineage, AgentMessage, TaskTerminationReason, TaskUsage } from '@codelia/shared-types';
|
|
1
2
|
import { StoragePaths, ResolveStorageOptions, RunEventStoreFactory, RunEventStoreInit, SessionStore, StoragePathService, SessionStateStore, SessionState, SessionStateSummary, SessionRecord, ToolOutputCacheStore, ToolOutputCacheRecord, ToolOutputRef, ToolOutputCacheReadOptions, ToolOutputCacheSearchOptions } from '@codelia/core';
|
|
2
3
|
export { ResolveStorageOptions, StorageLayout, StoragePathService, StoragePaths } from '@codelia/core';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
/** A workspace-scoped store. No TTL deletion: references must survive session resume. */
|
|
6
|
+
declare class ImageArtifactStore {
|
|
7
|
+
readonly root: string;
|
|
8
|
+
constructor(root: string);
|
|
9
|
+
save(bytes: Buffer, provenance: Omit<GeneratedImageMetadata, keyof ImageArtifactRef | "created_at">): Promise<GeneratedImageMetadata>;
|
|
10
|
+
saveAttachment(bytes: Buffer, mediaType: ImageMediaType): Promise<AttachedImageMetadata>;
|
|
11
|
+
private persist;
|
|
12
|
+
read(artifactId: string): Promise<{
|
|
13
|
+
metadata: ImageArtifactMetadata;
|
|
14
|
+
bytes: Buffer;
|
|
15
|
+
}>;
|
|
16
|
+
/** Prepare a new history reference, never upgrade an already persisted reference. */
|
|
17
|
+
modelReference(artifactId: string, original?: boolean): Promise<ImageArtifactRef>;
|
|
18
|
+
resolve(ref: ImageArtifactRef): Promise<{
|
|
19
|
+
type: "image_url";
|
|
20
|
+
image_url: {
|
|
21
|
+
url: string;
|
|
22
|
+
media_type: ImageMediaType;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const IMAGE_MAX_BYTES: number;
|
|
28
|
+
/** Validate chunks, CRC and bounded decompression before accepting provider bytes. */
|
|
29
|
+
declare function validateImagePng(bytes: Buffer): Promise<{
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
}>;
|
|
4
33
|
|
|
5
34
|
type McpOAuthTokens = {
|
|
6
35
|
access_token: string;
|
|
@@ -199,4 +228,4 @@ declare class ToolOutputCacheStoreImpl implements ToolOutputCacheStore {
|
|
|
199
228
|
private resolvePath;
|
|
200
229
|
}
|
|
201
230
|
|
|
202
|
-
export { type McpAuthFile, McpAuthStore, type McpOAuthTokens, type ProjectsPolicyFile, ProjectsPolicyStore, RunEventStoreFactoryImpl, SessionStateStoreImpl, SessionStoreWriterImpl, StoragePathServiceImpl, type TaskArtifact, type TaskKind, type TaskRecord, TaskRegistryStore, type TaskResult, type TaskState, type TaskTruncatedOutput, type TaskWorkspaceMode, ToolOutputCacheStoreImpl, ensureStorageDirs, resolveStoragePaths };
|
|
231
|
+
export { IMAGE_MAX_BYTES, ImageArtifactStore, type McpAuthFile, McpAuthStore, type McpOAuthTokens, type ProjectsPolicyFile, ProjectsPolicyStore, RunEventStoreFactoryImpl, SessionStateStoreImpl, SessionStoreWriterImpl, StoragePathServiceImpl, type TaskArtifact, type TaskKind, type TaskRecord, TaskRegistryStore, type TaskResult, type TaskState, type TaskTruncatedOutput, type TaskWorkspaceMode, ToolOutputCacheStoreImpl, ensureStorageDirs, resolveStoragePaths, validateImagePng };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
|
+
import { GeneratedImageMetadata, ImageArtifactRef, ImageMediaType, AttachedImageMetadata, ImageArtifactMetadata, ApprovalMode, SubagentLineage, AgentMessage, TaskTerminationReason, TaskUsage } from '@codelia/shared-types';
|
|
1
2
|
import { StoragePaths, ResolveStorageOptions, RunEventStoreFactory, RunEventStoreInit, SessionStore, StoragePathService, SessionStateStore, SessionState, SessionStateSummary, SessionRecord, ToolOutputCacheStore, ToolOutputCacheRecord, ToolOutputRef, ToolOutputCacheReadOptions, ToolOutputCacheSearchOptions } from '@codelia/core';
|
|
2
3
|
export { ResolveStorageOptions, StorageLayout, StoragePathService, StoragePaths } from '@codelia/core';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
/** A workspace-scoped store. No TTL deletion: references must survive session resume. */
|
|
6
|
+
declare class ImageArtifactStore {
|
|
7
|
+
readonly root: string;
|
|
8
|
+
constructor(root: string);
|
|
9
|
+
save(bytes: Buffer, provenance: Omit<GeneratedImageMetadata, keyof ImageArtifactRef | "created_at">): Promise<GeneratedImageMetadata>;
|
|
10
|
+
saveAttachment(bytes: Buffer, mediaType: ImageMediaType): Promise<AttachedImageMetadata>;
|
|
11
|
+
private persist;
|
|
12
|
+
read(artifactId: string): Promise<{
|
|
13
|
+
metadata: ImageArtifactMetadata;
|
|
14
|
+
bytes: Buffer;
|
|
15
|
+
}>;
|
|
16
|
+
/** Prepare a new history reference, never upgrade an already persisted reference. */
|
|
17
|
+
modelReference(artifactId: string, original?: boolean): Promise<ImageArtifactRef>;
|
|
18
|
+
resolve(ref: ImageArtifactRef): Promise<{
|
|
19
|
+
type: "image_url";
|
|
20
|
+
image_url: {
|
|
21
|
+
url: string;
|
|
22
|
+
media_type: ImageMediaType;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const IMAGE_MAX_BYTES: number;
|
|
28
|
+
/** Validate chunks, CRC and bounded decompression before accepting provider bytes. */
|
|
29
|
+
declare function validateImagePng(bytes: Buffer): Promise<{
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
}>;
|
|
4
33
|
|
|
5
34
|
type McpOAuthTokens = {
|
|
6
35
|
access_token: string;
|
|
@@ -199,4 +228,4 @@ declare class ToolOutputCacheStoreImpl implements ToolOutputCacheStore {
|
|
|
199
228
|
private resolvePath;
|
|
200
229
|
}
|
|
201
230
|
|
|
202
|
-
export { type McpAuthFile, McpAuthStore, type McpOAuthTokens, type ProjectsPolicyFile, ProjectsPolicyStore, RunEventStoreFactoryImpl, SessionStateStoreImpl, SessionStoreWriterImpl, StoragePathServiceImpl, type TaskArtifact, type TaskKind, type TaskRecord, TaskRegistryStore, type TaskResult, type TaskState, type TaskTruncatedOutput, type TaskWorkspaceMode, ToolOutputCacheStoreImpl, ensureStorageDirs, resolveStoragePaths };
|
|
231
|
+
export { IMAGE_MAX_BYTES, ImageArtifactStore, type McpAuthFile, McpAuthStore, type McpOAuthTokens, type ProjectsPolicyFile, ProjectsPolicyStore, RunEventStoreFactoryImpl, SessionStateStoreImpl, SessionStoreWriterImpl, StoragePathServiceImpl, type TaskArtifact, type TaskKind, type TaskRecord, TaskRegistryStore, type TaskResult, type TaskState, type TaskTruncatedOutput, type TaskWorkspaceMode, ToolOutputCacheStoreImpl, ensureStorageDirs, resolveStoragePaths, validateImagePng };
|