@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `thread_branch_sources` (
|
|
2
|
+
`branch_id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`source_json` text NOT NULL,
|
|
4
|
+
`bytes` integer NOT NULL,
|
|
5
|
+
FOREIGN KEY (`branch_id`) REFERENCES `thread_branches`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
6
|
+
CONSTRAINT "thread_branch_sources_bytes_ck" CHECK("thread_branch_sources"."bytes" >= 0 AND "thread_branch_sources"."bytes" <= 524288)
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
CREATE TABLE IF NOT EXISTS `thread_branches` (
|
|
10
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
11
|
+
`workspace_id` text NOT NULL,
|
|
12
|
+
`parent_thread_id` text NOT NULL,
|
|
13
|
+
`child_thread_id` text NOT NULL,
|
|
14
|
+
`branch_point_task_id` text NOT NULL,
|
|
15
|
+
`branch_answer_no` integer NOT NULL,
|
|
16
|
+
`first_task_id` text NOT NULL,
|
|
17
|
+
`parent_title` text NOT NULL,
|
|
18
|
+
`actor_id` text NOT NULL,
|
|
19
|
+
`request_id` text NOT NULL,
|
|
20
|
+
`payload_hash` text NOT NULL,
|
|
21
|
+
`snapshot_version` integer NOT NULL,
|
|
22
|
+
`carry_json` text NOT NULL,
|
|
23
|
+
`carried_turns` integer NOT NULL,
|
|
24
|
+
`carried_chars` integer NOT NULL,
|
|
25
|
+
`carried_truncated` integer DEFAULT 0 NOT NULL,
|
|
26
|
+
`status` text DEFAULT 'active' NOT NULL,
|
|
27
|
+
`created_at` text NOT NULL,
|
|
28
|
+
`undone_at` text,
|
|
29
|
+
FOREIGN KEY (`parent_thread_id`) REFERENCES `threads`(`id`) ON UPDATE no action ON DELETE no action,
|
|
30
|
+
FOREIGN KEY (`child_thread_id`) REFERENCES `threads`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
31
|
+
CONSTRAINT "thread_branches_status_ck" CHECK("thread_branches"."status" IN ('active', 'undone')),
|
|
32
|
+
CONSTRAINT "thread_branches_carried_truncated_ck" CHECK("thread_branches"."carried_truncated" IN (0, 1))
|
|
33
|
+
);
|
|
34
|
+
--> statement-breakpoint
|
|
35
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `thread_branches_child_thread_id_unique` ON `thread_branches` (`child_thread_id`);--> statement-breakpoint
|
|
36
|
+
CREATE INDEX IF NOT EXISTS `idx_thread_branches_parent_point` ON `thread_branches` (`parent_thread_id`,`branch_point_task_id`);--> statement-breakpoint
|
|
37
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uniq_thread_branches_workspace_actor_request` ON `thread_branches` (`workspace_id`,`actor_id`,`request_id`);
|