@codelia/storage 0.1.80 → 0.1.82

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.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
- import { ApprovalMode } from '@codelia/shared-types';
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;
@@ -110,6 +139,9 @@ type TaskTruncatedOutput = {
110
139
  combined: boolean;
111
140
  };
112
141
  type TaskResult = {
142
+ termination_reason?: TaskTerminationReason;
143
+ usage?: TaskUsage;
144
+ summary_cache_id?: string;
113
145
  summary?: string;
114
146
  stdout?: string;
115
147
  stderr?: string;
@@ -125,6 +157,9 @@ type TaskResult = {
125
157
  };
126
158
  type TaskRecord = {
127
159
  version: 1;
160
+ subagent?: SubagentLineage;
161
+ messages?: AgentMessage[];
162
+ executor_identity?: string;
128
163
  task_id: string;
129
164
  kind: TaskKind;
130
165
  workspace_mode: TaskWorkspaceMode;
@@ -193,4 +228,4 @@ declare class ToolOutputCacheStoreImpl implements ToolOutputCacheStore {
193
228
  private resolvePath;
194
229
  }
195
230
 
196
- 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
- import { ApprovalMode } from '@codelia/shared-types';
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;
@@ -110,6 +139,9 @@ type TaskTruncatedOutput = {
110
139
  combined: boolean;
111
140
  };
112
141
  type TaskResult = {
142
+ termination_reason?: TaskTerminationReason;
143
+ usage?: TaskUsage;
144
+ summary_cache_id?: string;
113
145
  summary?: string;
114
146
  stdout?: string;
115
147
  stderr?: string;
@@ -125,6 +157,9 @@ type TaskResult = {
125
157
  };
126
158
  type TaskRecord = {
127
159
  version: 1;
160
+ subagent?: SubagentLineage;
161
+ messages?: AgentMessage[];
162
+ executor_identity?: string;
128
163
  task_id: string;
129
164
  kind: TaskKind;
130
165
  workspace_mode: TaskWorkspaceMode;
@@ -193,4 +228,4 @@ declare class ToolOutputCacheStoreImpl implements ToolOutputCacheStore {
193
228
  private resolvePath;
194
229
  }
195
230
 
196
- 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 };