@crewx/sdk 0.9.0-rc.221 → 0.9.0-rc.223

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,9 +1,10 @@
1
- import type { ConversationHighlight, ConversationThread, ConversationThreadState, FetchHistoryOptions, IConversationHistoryProvider, Platform, ThreadCreationOptions } from './types';
1
+ import type { ConversationHighlight, ConversationBranchMarker, ConversationThread, ConversationThreadState, FetchHistoryOptions, IConversationHistoryProvider, Platform, ThreadCreationOptions } from './types';
2
2
  export declare class SqliteConversationProvider implements IConversationHistoryProvider {
3
3
  private readonly dbPath;
4
4
  constructor(dbPath?: string);
5
5
  private getThreadRepo;
6
6
  private getThreadHistoryRepo;
7
+ private getThreadBranchRepo;
7
8
  updateThread(id: string, patch: {
8
9
  title?: string;
9
10
  }): void;
@@ -12,6 +13,8 @@ export declare class SqliteConversationProvider implements IConversationHistoryP
12
13
  }>;
13
14
  fetchHistory(threadId: string, options?: FetchHistoryOptions): Promise<ConversationThread>;
14
15
  fetchThreadState(threadId: string): Promise<ConversationThreadState | undefined>;
16
+ fetchBranchContext(childThreadId: string): Promise<import("../repository/thread-branch.repository.js").ThreadBranchActiveContext | undefined>;
17
+ fetchBranchMarkers(parentThreadId: string): Promise<ConversationBranchMarker[]>;
15
18
  fetchHighlights(threadId: string): Promise<ConversationHighlight[] | undefined>;
16
19
  saveUserMessage(threadId: string, text: string, _userId?: string, _metadata?: Record<string, unknown>): Promise<{
17
20
  id: string;
@@ -1,4 +1,4 @@
1
- import type { ConversationThread, TemplateMessage } from './types';
1
+ import type { ConversationBranchMarker, ConversationThread, TemplateMessage } from './types';
2
2
  import type { UiAgentContextProjection } from '../ui-instance/types.js';
3
3
  import type { McpAppStateDescriptor } from '../mcp-app/types.js';
4
4
  export declare const LEGACY_UI_CARD_SAFE_SUMMARY = "[workflow card omitted from AI context]";
@@ -8,4 +8,5 @@ export declare function sanitizeLegacyUiCardText(text: string): string;
8
8
  export declare function sanitizeTemplateMessages(messages: readonly TemplateMessage[]): TemplateMessage[];
9
9
  export declare function appendUiProjections(messages: readonly TemplateMessage[], projections: readonly UiAgentContextProjection[] | undefined): TemplateMessage[];
10
10
  export declare function appendMcpAppProjections(messages: readonly TemplateMessage[], descriptors: readonly McpAppStateDescriptor[] | undefined): TemplateMessage[];
11
- export declare function toTemplateMessages(thread: ConversationThread): TemplateMessage[];
11
+ export declare function attachBranchMarkersToTemplateMessages(messages: readonly TemplateMessage[], branchMarkers: readonly ConversationBranchMarker[]): TemplateMessage[];
12
+ export declare function toTemplateMessages(thread: ConversationThread, branchMarkers?: readonly ConversationBranchMarker[]): TemplateMessage[];
@@ -1,4 +1,5 @@
1
1
  import type { ThreadCreationOptions } from '../repository/thread.repository';
2
+ import type { ThreadBranchActiveContext } from '../repository/thread-branch.repository.js';
2
3
  export type { ThreadCreationOptions } from '../repository/thread.repository';
3
4
  export interface ConversationMessage {
4
5
  id: string;
@@ -73,6 +74,10 @@ export interface ConversationThreadState {
73
74
  state?: ConversationThreadStateValue;
74
75
  rendered?: string;
75
76
  }
77
+ export interface ConversationBranchMarker {
78
+ readonly branchPointTaskId: string;
79
+ readonly childTitle: string;
80
+ }
76
81
  export type ThreadStateContext = ConversationThreadState;
77
82
  export interface ConversationThread {
78
83
  threadId: string;
@@ -104,6 +109,7 @@ export interface TemplateMessage {
104
109
  timestamp?: number;
105
110
  metadata?: Record<string, unknown>;
106
111
  activity_log?: string;
112
+ branch_markers?: readonly string[];
107
113
  files?: Array<{
108
114
  name: string;
109
115
  size?: number;
@@ -124,6 +130,8 @@ export interface IConversationHistoryProvider {
124
130
  }>;
125
131
  fetchHistory(threadId: string, options?: FetchHistoryOptions): Promise<ConversationThread>;
126
132
  fetchThreadState?(threadId: string): Promise<ConversationThreadState | undefined>;
133
+ fetchBranchContext?(childThreadId: string): Promise<ThreadBranchActiveContext | undefined>;
134
+ fetchBranchMarkers?(parentThreadId: string): Promise<ConversationBranchMarker[]>;
127
135
  fetchHighlights?(threadId: string): Promise<ConversationHighlight[] | undefined>;
128
136
  saveUserMessage(threadId: string, text: string, userId?: string, metadata?: Record<string, unknown>): Promise<{
129
137
  id: string;