@crewx/sdk 0.9.0-rc.221 → 0.9.0-rc.222
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/app-sync/index.js +53 -53
- package/dist/conversation/sqlite-provider.d.ts +4 -1
- package/dist/conversation/to-template-messages.d.ts +3 -2
- package/dist/conversation/types.d.ts +8 -0
- package/dist/esm/app-sync/index.js +53 -53
- package/dist/esm/history-snapshot/index.js +10 -10
- package/dist/esm/index.js +414 -358
- package/dist/esm/plugins/index.js +133 -98
- package/dist/esm/repository/index.js +194 -159
- package/dist/facade/Crewx.d.ts +1 -0
- package/dist/history-snapshot/index.d.ts +2 -1
- package/dist/history-snapshot/index.js +10 -10
- package/dist/index.d.ts +3 -1
- package/dist/index.js +411 -355
- package/dist/migrations/0058_thread_branches.sql +37 -0
- package/dist/migrations/meta/0058_snapshot.json +7227 -0
- package/dist/migrations/meta/_journal.json +7 -0
- package/dist/plugins/index.js +134 -99
- package/dist/prompt/tag-names.d.ts +1 -0
- package/dist/repository/index.d.ts +1 -0
- package/dist/repository/index.js +190 -155
- package/dist/repository/sidebar-tab.repository.d.ts +1 -0
- package/dist/repository/thread-branch.repository.d.ts +106 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/thread-branches.d.ts +424 -0
- package/dist/ui-instance/store.d.ts +5 -0
- package/dist/utils/id.d.ts +1 -1
- package/package.json +1 -1
- package/templates/agents/default.yaml +8 -0
|
@@ -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
|
|
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;
|