@asaidimu/utils-workspace 6.6.2 → 6.6.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.
package/index.d.mts CHANGED
@@ -818,9 +818,11 @@ interface BaseContentBlock<BlockType extends string> {
818
818
  /** Extensible key-value store for block-specific properties. */
819
819
  [key: string]: any;
820
820
  }
821
- /** Standard text content within a turn. */
821
+ /**
822
+ * Represents a standard text-based content block within a conversational turn.
823
+ * This block is used for general communication, explanations, or any textual output.\n
824
+ */
822
825
  interface TextBlock extends BaseContentBlock<"text"> {
823
- /** The raw markdown or plain text content. */
824
826
  text: string;
825
827
  }
826
828
  /** An image asset within a turn, optionally containing the resolved binary data. */
@@ -1057,6 +1059,8 @@ interface BaseContextContent<Kind extends string> {
1057
1059
  interface TextContextContent extends BaseContextContent<"text"> {
1058
1060
  /** The raw text content. */
1059
1061
  value: string;
1062
+ format?: string;
1063
+ extension?: string;
1060
1064
  }
1061
1065
  /**
1062
1066
  * Supported payload for structured JSON context.
@@ -3045,6 +3049,18 @@ declare class SessionManager {
3045
3049
  metadata(sessionId: UUID): SessionMetadata | undefined;
3046
3050
  }
3047
3051
 
3052
+ /**
3053
+ * Standard TurnProcessor that handles core workspace blocks like artifacts.
3054
+ * Applications can wrap this or delegate to it.
3055
+ */
3056
+ declare class CoreTurnProcessor implements TurnProcessor {
3057
+ process(turn: {
3058
+ blocks: any[];
3059
+ }, session: UUID): BaseCommand[];
3060
+ private handleAddArtifact;
3061
+ private handleUpdateArtifact;
3062
+ }
3063
+
3048
3064
  /**
3049
3065
  * A fluent builder for creating Turn objects.
3050
3066
  * This class helps construct a Turn object by adding various content blocks.
@@ -3175,8 +3191,8 @@ declare function computeSHA256(data: Uint8Array): Promise<SHA256>;
3175
3191
  */
3176
3192
  declare function bufferToBase64(buffer: Uint8Array): string;
3177
3193
  /**
3178
- * Short, deterministic hash of a string (4 chars in base36).
3179
- * Suitable for AI-friendly reference tokens.
3194
+ * Short, deterministic hash of a string (length chars in base36).
3195
+ * Returns a uniformly distributed, fixed-length base36 string.
3180
3196
  */
3181
3197
  declare function shortHash(s: string, length?: number): string;
3182
3198
  declare function getExtension<K extends string, V>(index: Index, key: K): Record<string, V>;
@@ -3393,4 +3409,4 @@ declare function createWorkspace(params: CreateWorkspaceParams): Promise<{
3393
3409
  bootstrap: (config: BootstrapConfig) => Promise<BootstrapResult>;
3394
3410
  }>;
3395
3411
 
3396
- export { type AdapterStatus, type AddArtifact, type AddContext, type AddPreference, type AddRole, type AddSessionTopics, type AddTopic, type AddTurn, type Artifact, type ArtifactSummary, type AssemblerExtension, type AuthRequest, type BackendError, type BaseCommand, type BaseContentBlock, type BaseContextContent, type BlobCommand, type BlobContextContent, type BlobError, type BlobMediaType, type BlobRecord, type BlobRef, type BlobResolver, type BlockMapper, type BootstrapConfig, type BootstrapResult, type BranchInfo, type BranchTurn, COLLECTIONS, type CheckpointBlock, type CheckpointSessionState, type Collections, type Command, type ContentBlock, type ContentBlockDefinition, type Context, type ContextContent, type ContextDefinition, type ContextRetriever, type ContextSummary, type CreateSession, type CreateWorkspace, type CreateWorkspaceParams, type DeepPartial, type DefaultContextContent, DefaultPromptBuilder, type DeleteArtifact, type DeleteContext, type DeletePreference, type DeleteRole, type DeleteSession, type DeleteTopic, type DeleteTurn, type DocumentBlock, type DocumentMediaType, type DuplicateKeyError, EMPTY_SYSTEM_ROLE, type EditTurn, type ForkSession, index as GoogleAdapter, type ImageBlock, type ImageMediaType, type Index, type IndexExtensions, type IndexedDBBlobConfig, IndexedDBBlobStorage, type Indexer, type InvalidCommandError, JaccardContextRetriever, type JsonContextContent, type LLMAdapter, type LLMAdapterStatic, LRUCache, MemoryBlobStorage, type MergeTopics, type ModelConstraint, type ModelConstraintMap, type ModelName, type ModelProfile, type ModelRegistry, type NotFoundError, type OverrideSessionPreferences, type PermissionDeniedError, type PermissionGuard, type Preference, type PreferenceSummary, type PreparedPrompt, type Project, type Prompt, PromptAssembler, type PromptBuilder, type PromptBuilderOptions, type PromptResult, type PromptSection, type PurgeBlob, type RecordBlobRemoteId, type RegisterBlob, type ReleaseBlob, type RemoteContextContent, type ResolvedBlob, type ResolvedSession, type Result, type RetainBlob, type Role, type RoleSummary, type RoleTransitionBlock, type SHA256, Session, SessionManager, type SessionMetadata, type SessionSnapshot, type Settings, type Store, type Summarizer, type SummaryBlock, type SwitchSessionRole, type SyncWorkspace, type SystemActor, type SystemPromptAssembler, type TextBlock, type TextContextContent, type ThinkingBlock, type Timestamp, type ToolCall, type ToolCallCommand, type ToolRegistry, type ToolResultBlock, type ToolSummary, type ToolUseBlock, type Topic, type TopicIndex, type Turn, TurnBuilder, type TurnKey, type TurnNode, type TurnProcessor, type TurnRef, TurnTree, type URI, type UUID, type UpdateArtifact, type UpdateContext, type UpdatePreference, type UpdateRole, type UpdateSession, type UpdateTopic, type UpdateTurn, type Workspace, WorkspaceApi, type WorkspaceBundle, type WorkspaceContext, type WorkspaceDatabase, type WorkspaceError, type WorkspaceEvents, type WorkspaceExtension, WorkspaceManager, type WorkspaceMiddleware, type WorkspaceReducer, WorkspaceRegistry, type WorkspaceServices, bufferToBase64, computeSHA256, createDefaultAssembler, createEmptySession, createEmptyTurn, createEmptyWorkspace, createWorkspace, createWorkspaceDatabase, del, error, getExtension, merge, omitNullUndefined, sessionStateToMarkdown, shortHash, success };
3412
+ export { type AdapterStatus, type AddArtifact, type AddContext, type AddPreference, type AddRole, type AddSessionTopics, type AddTopic, type AddTurn, type Artifact, type ArtifactSummary, type AssemblerExtension, type AuthRequest, type BackendError, type BaseCommand, type BaseContentBlock, type BaseContextContent, type BlobCommand, type BlobContextContent, type BlobError, type BlobMediaType, type BlobRecord, type BlobRef, type BlobResolver, type BlockMapper, type BootstrapConfig, type BootstrapResult, type BranchInfo, type BranchTurn, COLLECTIONS, type CheckpointBlock, type CheckpointSessionState, type Collections, type Command, type ContentBlock, type ContentBlockDefinition, type Context, type ContextContent, type ContextDefinition, type ContextRetriever, type ContextSummary, CoreTurnProcessor, type CreateSession, type CreateWorkspace, type CreateWorkspaceParams, type DeepPartial, type DefaultContextContent, DefaultPromptBuilder, type DeleteArtifact, type DeleteContext, type DeletePreference, type DeleteRole, type DeleteSession, type DeleteTopic, type DeleteTurn, type DocumentBlock, type DocumentMediaType, type DuplicateKeyError, EMPTY_SYSTEM_ROLE, type EditTurn, type ForkSession, index as GoogleAdapter, type ImageBlock, type ImageMediaType, type Index, type IndexExtensions, type IndexedDBBlobConfig, IndexedDBBlobStorage, type Indexer, type InvalidCommandError, JaccardContextRetriever, type JsonContextContent, type LLMAdapter, type LLMAdapterStatic, LRUCache, MemoryBlobStorage, type MergeTopics, type ModelConstraint, type ModelConstraintMap, type ModelName, type ModelProfile, type ModelRegistry, type NotFoundError, type OverrideSessionPreferences, type PermissionDeniedError, type PermissionGuard, type Preference, type PreferenceSummary, type PreparedPrompt, type Project, type Prompt, PromptAssembler, type PromptBuilder, type PromptBuilderOptions, type PromptResult, type PromptSection, type PurgeBlob, type RecordBlobRemoteId, type RegisterBlob, type ReleaseBlob, type RemoteContextContent, type ResolvedBlob, type ResolvedSession, type Result, type RetainBlob, type Role, type RoleSummary, type RoleTransitionBlock, type SHA256, Session, SessionManager, type SessionMetadata, type SessionSnapshot, type Settings, type Store, type Summarizer, type SummaryBlock, type SwitchSessionRole, type SyncWorkspace, type SystemActor, type SystemPromptAssembler, type TextBlock, type TextContextContent, type ThinkingBlock, type Timestamp, type ToolCall, type ToolCallCommand, type ToolRegistry, type ToolResultBlock, type ToolSummary, type ToolUseBlock, type Topic, type TopicIndex, type Turn, TurnBuilder, type TurnKey, type TurnNode, type TurnProcessor, type TurnRef, TurnTree, type URI, type UUID, type UpdateArtifact, type UpdateContext, type UpdatePreference, type UpdateRole, type UpdateSession, type UpdateTopic, type UpdateTurn, type Workspace, WorkspaceApi, type WorkspaceBundle, type WorkspaceContext, type WorkspaceDatabase, type WorkspaceError, type WorkspaceEvents, type WorkspaceExtension, WorkspaceManager, type WorkspaceMiddleware, type WorkspaceReducer, WorkspaceRegistry, type WorkspaceServices, bufferToBase64, computeSHA256, createDefaultAssembler, createEmptySession, createEmptyTurn, createEmptyWorkspace, createWorkspace, createWorkspaceDatabase, del, error, getExtension, merge, omitNullUndefined, sessionStateToMarkdown, shortHash, success };
package/index.d.ts CHANGED
@@ -818,9 +818,11 @@ interface BaseContentBlock<BlockType extends string> {
818
818
  /** Extensible key-value store for block-specific properties. */
819
819
  [key: string]: any;
820
820
  }
821
- /** Standard text content within a turn. */
821
+ /**
822
+ * Represents a standard text-based content block within a conversational turn.
823
+ * This block is used for general communication, explanations, or any textual output.\n
824
+ */
822
825
  interface TextBlock extends BaseContentBlock<"text"> {
823
- /** The raw markdown or plain text content. */
824
826
  text: string;
825
827
  }
826
828
  /** An image asset within a turn, optionally containing the resolved binary data. */
@@ -1057,6 +1059,8 @@ interface BaseContextContent<Kind extends string> {
1057
1059
  interface TextContextContent extends BaseContextContent<"text"> {
1058
1060
  /** The raw text content. */
1059
1061
  value: string;
1062
+ format?: string;
1063
+ extension?: string;
1060
1064
  }
1061
1065
  /**
1062
1066
  * Supported payload for structured JSON context.
@@ -3045,6 +3049,18 @@ declare class SessionManager {
3045
3049
  metadata(sessionId: UUID): SessionMetadata | undefined;
3046
3050
  }
3047
3051
 
3052
+ /**
3053
+ * Standard TurnProcessor that handles core workspace blocks like artifacts.
3054
+ * Applications can wrap this or delegate to it.
3055
+ */
3056
+ declare class CoreTurnProcessor implements TurnProcessor {
3057
+ process(turn: {
3058
+ blocks: any[];
3059
+ }, session: UUID): BaseCommand[];
3060
+ private handleAddArtifact;
3061
+ private handleUpdateArtifact;
3062
+ }
3063
+
3048
3064
  /**
3049
3065
  * A fluent builder for creating Turn objects.
3050
3066
  * This class helps construct a Turn object by adding various content blocks.
@@ -3175,8 +3191,8 @@ declare function computeSHA256(data: Uint8Array): Promise<SHA256>;
3175
3191
  */
3176
3192
  declare function bufferToBase64(buffer: Uint8Array): string;
3177
3193
  /**
3178
- * Short, deterministic hash of a string (4 chars in base36).
3179
- * Suitable for AI-friendly reference tokens.
3194
+ * Short, deterministic hash of a string (length chars in base36).
3195
+ * Returns a uniformly distributed, fixed-length base36 string.
3180
3196
  */
3181
3197
  declare function shortHash(s: string, length?: number): string;
3182
3198
  declare function getExtension<K extends string, V>(index: Index, key: K): Record<string, V>;
@@ -3393,4 +3409,4 @@ declare function createWorkspace(params: CreateWorkspaceParams): Promise<{
3393
3409
  bootstrap: (config: BootstrapConfig) => Promise<BootstrapResult>;
3394
3410
  }>;
3395
3411
 
3396
- export { type AdapterStatus, type AddArtifact, type AddContext, type AddPreference, type AddRole, type AddSessionTopics, type AddTopic, type AddTurn, type Artifact, type ArtifactSummary, type AssemblerExtension, type AuthRequest, type BackendError, type BaseCommand, type BaseContentBlock, type BaseContextContent, type BlobCommand, type BlobContextContent, type BlobError, type BlobMediaType, type BlobRecord, type BlobRef, type BlobResolver, type BlockMapper, type BootstrapConfig, type BootstrapResult, type BranchInfo, type BranchTurn, COLLECTIONS, type CheckpointBlock, type CheckpointSessionState, type Collections, type Command, type ContentBlock, type ContentBlockDefinition, type Context, type ContextContent, type ContextDefinition, type ContextRetriever, type ContextSummary, type CreateSession, type CreateWorkspace, type CreateWorkspaceParams, type DeepPartial, type DefaultContextContent, DefaultPromptBuilder, type DeleteArtifact, type DeleteContext, type DeletePreference, type DeleteRole, type DeleteSession, type DeleteTopic, type DeleteTurn, type DocumentBlock, type DocumentMediaType, type DuplicateKeyError, EMPTY_SYSTEM_ROLE, type EditTurn, type ForkSession, index as GoogleAdapter, type ImageBlock, type ImageMediaType, type Index, type IndexExtensions, type IndexedDBBlobConfig, IndexedDBBlobStorage, type Indexer, type InvalidCommandError, JaccardContextRetriever, type JsonContextContent, type LLMAdapter, type LLMAdapterStatic, LRUCache, MemoryBlobStorage, type MergeTopics, type ModelConstraint, type ModelConstraintMap, type ModelName, type ModelProfile, type ModelRegistry, type NotFoundError, type OverrideSessionPreferences, type PermissionDeniedError, type PermissionGuard, type Preference, type PreferenceSummary, type PreparedPrompt, type Project, type Prompt, PromptAssembler, type PromptBuilder, type PromptBuilderOptions, type PromptResult, type PromptSection, type PurgeBlob, type RecordBlobRemoteId, type RegisterBlob, type ReleaseBlob, type RemoteContextContent, type ResolvedBlob, type ResolvedSession, type Result, type RetainBlob, type Role, type RoleSummary, type RoleTransitionBlock, type SHA256, Session, SessionManager, type SessionMetadata, type SessionSnapshot, type Settings, type Store, type Summarizer, type SummaryBlock, type SwitchSessionRole, type SyncWorkspace, type SystemActor, type SystemPromptAssembler, type TextBlock, type TextContextContent, type ThinkingBlock, type Timestamp, type ToolCall, type ToolCallCommand, type ToolRegistry, type ToolResultBlock, type ToolSummary, type ToolUseBlock, type Topic, type TopicIndex, type Turn, TurnBuilder, type TurnKey, type TurnNode, type TurnProcessor, type TurnRef, TurnTree, type URI, type UUID, type UpdateArtifact, type UpdateContext, type UpdatePreference, type UpdateRole, type UpdateSession, type UpdateTopic, type UpdateTurn, type Workspace, WorkspaceApi, type WorkspaceBundle, type WorkspaceContext, type WorkspaceDatabase, type WorkspaceError, type WorkspaceEvents, type WorkspaceExtension, WorkspaceManager, type WorkspaceMiddleware, type WorkspaceReducer, WorkspaceRegistry, type WorkspaceServices, bufferToBase64, computeSHA256, createDefaultAssembler, createEmptySession, createEmptyTurn, createEmptyWorkspace, createWorkspace, createWorkspaceDatabase, del, error, getExtension, merge, omitNullUndefined, sessionStateToMarkdown, shortHash, success };
3412
+ export { type AdapterStatus, type AddArtifact, type AddContext, type AddPreference, type AddRole, type AddSessionTopics, type AddTopic, type AddTurn, type Artifact, type ArtifactSummary, type AssemblerExtension, type AuthRequest, type BackendError, type BaseCommand, type BaseContentBlock, type BaseContextContent, type BlobCommand, type BlobContextContent, type BlobError, type BlobMediaType, type BlobRecord, type BlobRef, type BlobResolver, type BlockMapper, type BootstrapConfig, type BootstrapResult, type BranchInfo, type BranchTurn, COLLECTIONS, type CheckpointBlock, type CheckpointSessionState, type Collections, type Command, type ContentBlock, type ContentBlockDefinition, type Context, type ContextContent, type ContextDefinition, type ContextRetriever, type ContextSummary, CoreTurnProcessor, type CreateSession, type CreateWorkspace, type CreateWorkspaceParams, type DeepPartial, type DefaultContextContent, DefaultPromptBuilder, type DeleteArtifact, type DeleteContext, type DeletePreference, type DeleteRole, type DeleteSession, type DeleteTopic, type DeleteTurn, type DocumentBlock, type DocumentMediaType, type DuplicateKeyError, EMPTY_SYSTEM_ROLE, type EditTurn, type ForkSession, index as GoogleAdapter, type ImageBlock, type ImageMediaType, type Index, type IndexExtensions, type IndexedDBBlobConfig, IndexedDBBlobStorage, type Indexer, type InvalidCommandError, JaccardContextRetriever, type JsonContextContent, type LLMAdapter, type LLMAdapterStatic, LRUCache, MemoryBlobStorage, type MergeTopics, type ModelConstraint, type ModelConstraintMap, type ModelName, type ModelProfile, type ModelRegistry, type NotFoundError, type OverrideSessionPreferences, type PermissionDeniedError, type PermissionGuard, type Preference, type PreferenceSummary, type PreparedPrompt, type Project, type Prompt, PromptAssembler, type PromptBuilder, type PromptBuilderOptions, type PromptResult, type PromptSection, type PurgeBlob, type RecordBlobRemoteId, type RegisterBlob, type ReleaseBlob, type RemoteContextContent, type ResolvedBlob, type ResolvedSession, type Result, type RetainBlob, type Role, type RoleSummary, type RoleTransitionBlock, type SHA256, Session, SessionManager, type SessionMetadata, type SessionSnapshot, type Settings, type Store, type Summarizer, type SummaryBlock, type SwitchSessionRole, type SyncWorkspace, type SystemActor, type SystemPromptAssembler, type TextBlock, type TextContextContent, type ThinkingBlock, type Timestamp, type ToolCall, type ToolCallCommand, type ToolRegistry, type ToolResultBlock, type ToolSummary, type ToolUseBlock, type Topic, type TopicIndex, type Turn, TurnBuilder, type TurnKey, type TurnNode, type TurnProcessor, type TurnRef, TurnTree, type URI, type UUID, type UpdateArtifact, type UpdateContext, type UpdatePreference, type UpdateRole, type UpdateSession, type UpdateTopic, type UpdateTurn, type Workspace, WorkspaceApi, type WorkspaceBundle, type WorkspaceContext, type WorkspaceDatabase, type WorkspaceError, type WorkspaceEvents, type WorkspaceExtension, WorkspaceManager, type WorkspaceMiddleware, type WorkspaceReducer, WorkspaceRegistry, type WorkspaceServices, bufferToBase64, computeSHA256, createDefaultAssembler, createEmptySession, createEmptyTurn, createEmptyWorkspace, createWorkspace, createWorkspaceDatabase, del, error, getExtension, merge, omitNullUndefined, sessionStateToMarkdown, shortHash, success };