@inkeep/agents-core 0.31.7 → 0.32.1
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/{chunk-RBUBOGX6.js → chunk-FUJJ4OQ2.js} +62 -10
- package/dist/{chunk-T5TTDZ6L.js → chunk-VSQY72K5.js} +133 -133
- package/dist/{chunk-PPBBIDK4.js → chunk-X6ZMJ3G6.js} +1 -1
- package/dist/client-exports.cjs +283 -224
- package/dist/client-exports.d.cts +7 -7
- package/dist/client-exports.d.ts +7 -7
- package/dist/client-exports.js +15 -7
- package/dist/db/schema.cjs +211 -211
- package/dist/db/schema.d.cts +3 -3
- package/dist/db/schema.d.ts +3 -3
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +597 -402
- package/dist/index.d.cts +409 -352
- package/dist/index.d.ts +409 -352
- package/dist/index.js +281 -162
- package/dist/{schema-lEFnfOQ-.d.ts → schema-CuEjPQt7.d.ts} +876 -1014
- package/dist/{schema-ztSm-Iv6.d.cts → schema-D1P8r3qm.d.cts} +876 -1014
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/{utility-qLyZ45lb.d.cts → utility-DF5IUC9K.d.cts} +1230 -1394
- package/dist/{utility-qLyZ45lb.d.ts → utility-DF5IUC9K.d.ts} +1230 -1394
- package/dist/validation/index.cjs +270 -219
- package/dist/validation/index.d.cts +3 -3
- package/dist/validation/index.d.ts +3 -3
- package/dist/validation/index.js +2 -2
- package/drizzle/0000_exotic_mysterio.sql +398 -0
- package/drizzle/meta/0000_snapshot.json +1683 -1223
- package/drizzle/meta/_journal.json +4 -102
- package/package.json +6 -3
- package/drizzle/0000_material_menace.sql +0 -326
- package/drizzle/0001_eminent_fixer.sql +0 -43
- package/drizzle/0002_bumpy_romulus.sql +0 -3
- package/drizzle/0003_soft_forgotten_one.sql +0 -39
- package/drizzle/0004_melted_omega_flight.sql +0 -3
- package/drizzle/0005_wide_shriek.sql +0 -127
- package/drizzle/0006_damp_lenny_balinger.sql +0 -52
- package/drizzle/0007_mighty_typhoid_mary.sql +0 -227
- package/drizzle/0008_mysterious_crusher_hogan.sql +0 -20
- package/drizzle/0009_old_black_cat.sql +0 -1
- package/drizzle/0010_wet_vampiro.sql +0 -2
- package/drizzle/0011_slippery_korg.sql +0 -36
- package/drizzle/0012_salty_psynapse.sql +0 -17
- package/drizzle/0013_shocking_blur.sql +0 -19
- package/drizzle/0014_broad_hellfire_club.sql +0 -29
- package/drizzle/meta/0001_snapshot.json +0 -2435
- package/drizzle/meta/0002_snapshot.json +0 -2428
- package/drizzle/meta/0003_snapshot.json +0 -2559
- package/drizzle/meta/0004_snapshot.json +0 -2547
- package/drizzle/meta/0005_snapshot.json +0 -2558
- package/drizzle/meta/0006_snapshot.json +0 -2751
- package/drizzle/meta/0007_snapshot.json +0 -2766
- package/drizzle/meta/0008_snapshot.json +0 -2753
- package/drizzle/meta/0009_snapshot.json +0 -2744
- package/drizzle/meta/0010_snapshot.json +0 -2751
- package/drizzle/meta/0011_snapshot.json +0 -2849
- package/drizzle/meta/0012_snapshot.json +0 -2985
- package/drizzle/meta/0013_snapshot.json +0 -2988
- package/drizzle/meta/0014_snapshot.json +0 -2992
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `agent_artifact_components` RENAME TO `sub_agent_artifact_components`;--> statement-breakpoint
|
|
2
|
-
ALTER TABLE `agent_data_components` RENAME TO `sub_agent_data_components`;--> statement-breakpoint
|
|
3
|
-
ALTER TABLE `agent_relations` RENAME TO `sub_agent_relations`;--> statement-breakpoint
|
|
4
|
-
ALTER TABLE `agent_tool_relations` RENAME TO `sub_agent_tool_relations`;--> statement-breakpoint
|
|
5
|
-
ALTER TABLE `agents` RENAME TO `sub_agents`;--> statement-breakpoint
|
|
6
|
-
ALTER TABLE `sub_agent_artifact_components` RENAME COLUMN "agent_id" TO "sub_agent_id";--> statement-breakpoint
|
|
7
|
-
ALTER TABLE `sub_agent_data_components` RENAME COLUMN "agent_id" TO "sub_agent_id";--> statement-breakpoint
|
|
8
|
-
ALTER TABLE `sub_agent_relations` RENAME COLUMN "source_agent_id" TO "source_sub_agent_id";--> statement-breakpoint
|
|
9
|
-
ALTER TABLE `sub_agent_relations` RENAME COLUMN "target_agent_id" TO "target_sub_agent_id";--> statement-breakpoint
|
|
10
|
-
ALTER TABLE `sub_agent_relations` RENAME COLUMN "external_agent_id" TO "external_sub_agent_id";--> statement-breakpoint
|
|
11
|
-
ALTER TABLE `sub_agent_tool_relations` RENAME COLUMN "agent_id" TO "sub_agent_id";--> statement-breakpoint
|
|
12
|
-
ALTER TABLE `agent_graph` RENAME COLUMN "default_agent_id" TO "default_sub_agent_id";--> statement-breakpoint
|
|
13
|
-
ALTER TABLE `conversations` RENAME COLUMN "active_agent_id" TO "active_sub_agent_id";--> statement-breakpoint
|
|
14
|
-
ALTER TABLE `messages` RENAME COLUMN "from_agent_id" TO "from_sub_agent_id";--> statement-breakpoint
|
|
15
|
-
ALTER TABLE `messages` RENAME COLUMN "to_agent_id" TO "to_sub_agent_id";--> statement-breakpoint
|
|
16
|
-
ALTER TABLE `messages` RENAME COLUMN "from_external_agent_id" TO "from_external_sub_agent_id";--> statement-breakpoint
|
|
17
|
-
ALTER TABLE `messages` RENAME COLUMN "to_external_agent_id" TO "to_external_sub_agent_id";--> statement-breakpoint
|
|
18
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
19
|
-
CREATE TABLE `__new_sub_agent_artifact_components` (
|
|
20
|
-
`tenant_id` text NOT NULL,
|
|
21
|
-
`id` text NOT NULL,
|
|
22
|
-
`project_id` text NOT NULL,
|
|
23
|
-
`graph_id` text NOT NULL,
|
|
24
|
-
`sub_agent_id` text NOT NULL,
|
|
25
|
-
`artifact_component_id` text NOT NULL,
|
|
26
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
27
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `sub_agent_id`, `id`),
|
|
28
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
29
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`artifact_component_id`) REFERENCES `artifact_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
30
|
-
);
|
|
31
|
-
--> statement-breakpoint
|
|
32
|
-
INSERT INTO `__new_sub_agent_artifact_components`("tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "artifact_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "artifact_component_id", "created_at" FROM `sub_agent_artifact_components`;--> statement-breakpoint
|
|
33
|
-
DROP TABLE `sub_agent_artifact_components`;--> statement-breakpoint
|
|
34
|
-
ALTER TABLE `__new_sub_agent_artifact_components` RENAME TO `sub_agent_artifact_components`;--> statement-breakpoint
|
|
35
|
-
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
36
|
-
CREATE TABLE `__new_sub_agent_data_components` (
|
|
37
|
-
`tenant_id` text NOT NULL,
|
|
38
|
-
`id` text NOT NULL,
|
|
39
|
-
`project_id` text NOT NULL,
|
|
40
|
-
`graph_id` text NOT NULL,
|
|
41
|
-
`sub_agent_id` text NOT NULL,
|
|
42
|
-
`data_component_id` text NOT NULL,
|
|
43
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
44
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
45
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
46
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`data_component_id`) REFERENCES `data_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
47
|
-
);
|
|
48
|
-
--> statement-breakpoint
|
|
49
|
-
INSERT INTO `__new_sub_agent_data_components`("tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "data_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "data_component_id", "created_at" FROM `sub_agent_data_components`;--> statement-breakpoint
|
|
50
|
-
DROP TABLE `sub_agent_data_components`;--> statement-breakpoint
|
|
51
|
-
ALTER TABLE `__new_sub_agent_data_components` RENAME TO `sub_agent_data_components`;--> statement-breakpoint
|
|
52
|
-
CREATE TABLE `__new_sub_agent_relations` (
|
|
53
|
-
`tenant_id` text NOT NULL,
|
|
54
|
-
`id` text NOT NULL,
|
|
55
|
-
`project_id` text NOT NULL,
|
|
56
|
-
`graph_id` text NOT NULL,
|
|
57
|
-
`source_sub_agent_id` text NOT NULL,
|
|
58
|
-
`target_sub_agent_id` text,
|
|
59
|
-
`external_sub_agent_id` text,
|
|
60
|
-
`relation_type` text,
|
|
61
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
62
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
63
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `id`),
|
|
64
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`) REFERENCES `agent_graph`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
65
|
-
);
|
|
66
|
-
--> statement-breakpoint
|
|
67
|
-
INSERT INTO `__new_sub_agent_relations`("tenant_id", "id", "project_id", "graph_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at" FROM `sub_agent_relations`;--> statement-breakpoint
|
|
68
|
-
DROP TABLE `sub_agent_relations`;--> statement-breakpoint
|
|
69
|
-
ALTER TABLE `__new_sub_agent_relations` RENAME TO `sub_agent_relations`;--> statement-breakpoint
|
|
70
|
-
CREATE TABLE `__new_sub_agent_tool_relations` (
|
|
71
|
-
`tenant_id` text NOT NULL,
|
|
72
|
-
`id` text NOT NULL,
|
|
73
|
-
`project_id` text NOT NULL,
|
|
74
|
-
`graph_id` text NOT NULL,
|
|
75
|
-
`sub_agent_id` text NOT NULL,
|
|
76
|
-
`tool_id` text NOT NULL,
|
|
77
|
-
`selected_tools` blob,
|
|
78
|
-
`headers` blob,
|
|
79
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
80
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
81
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `id`),
|
|
82
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
83
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`tool_id`) REFERENCES `tools`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
84
|
-
);
|
|
85
|
-
--> statement-breakpoint
|
|
86
|
-
INSERT INTO `__new_sub_agent_tool_relations`("tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at" FROM `sub_agent_tool_relations`;--> statement-breakpoint
|
|
87
|
-
DROP TABLE `sub_agent_tool_relations`;--> statement-breakpoint
|
|
88
|
-
ALTER TABLE `__new_sub_agent_tool_relations` RENAME TO `sub_agent_tool_relations`;--> statement-breakpoint
|
|
89
|
-
CREATE TABLE `__new_sub_agents` (
|
|
90
|
-
`tenant_id` text NOT NULL,
|
|
91
|
-
`id` text NOT NULL,
|
|
92
|
-
`project_id` text NOT NULL,
|
|
93
|
-
`graph_id` text NOT NULL,
|
|
94
|
-
`name` text NOT NULL,
|
|
95
|
-
`description` text NOT NULL,
|
|
96
|
-
`prompt` text NOT NULL,
|
|
97
|
-
`conversation_history_config` text,
|
|
98
|
-
`models` text,
|
|
99
|
-
`stop_when` text,
|
|
100
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
101
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
102
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `id`),
|
|
103
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`) REFERENCES `agent_graph`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
104
|
-
);
|
|
105
|
-
--> statement-breakpoint
|
|
106
|
-
INSERT INTO `__new_sub_agents`("tenant_id", "id", "project_id", "graph_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at" FROM `sub_agents`;--> statement-breakpoint
|
|
107
|
-
DROP TABLE `sub_agents`;--> statement-breakpoint
|
|
108
|
-
ALTER TABLE `__new_sub_agents` RENAME TO `sub_agents`;--> statement-breakpoint
|
|
109
|
-
ALTER TABLE `messages` DROP COLUMN `agent_id`;--> statement-breakpoint
|
|
110
|
-
CREATE TABLE `__new_tasks` (
|
|
111
|
-
`tenant_id` text NOT NULL,
|
|
112
|
-
`id` text NOT NULL,
|
|
113
|
-
`project_id` text NOT NULL,
|
|
114
|
-
`graph_id` text NOT NULL,
|
|
115
|
-
`sub_agent_id` text NOT NULL,
|
|
116
|
-
`context_id` text NOT NULL,
|
|
117
|
-
`status` text NOT NULL,
|
|
118
|
-
`metadata` blob,
|
|
119
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
120
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
121
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
122
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
123
|
-
);
|
|
124
|
-
--> statement-breakpoint
|
|
125
|
-
INSERT INTO `__new_tasks`("tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "context_id", "status", "metadata", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "agent_id", "context_id", "status", "metadata", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint
|
|
126
|
-
DROP TABLE `tasks`;--> statement-breakpoint
|
|
127
|
-
ALTER TABLE `__new_tasks` RENAME TO `tasks`;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `agent_function_tool_relations` (
|
|
2
|
-
`tenant_id` text NOT NULL,
|
|
3
|
-
`id` text NOT NULL,
|
|
4
|
-
`project_id` text NOT NULL,
|
|
5
|
-
`graph_id` text NOT NULL,
|
|
6
|
-
`sub_agent_id` text NOT NULL,
|
|
7
|
-
`function_tool_id` text NOT NULL,
|
|
8
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
9
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
10
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `id`),
|
|
11
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
12
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`,`function_tool_id`) REFERENCES `function_tools`(`tenant_id`,`project_id`,`graph_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
13
|
-
);
|
|
14
|
-
--> statement-breakpoint
|
|
15
|
-
CREATE TABLE `function_tools` (
|
|
16
|
-
`tenant_id` text NOT NULL,
|
|
17
|
-
`id` text NOT NULL,
|
|
18
|
-
`project_id` text NOT NULL,
|
|
19
|
-
`graph_id` text NOT NULL,
|
|
20
|
-
`name` text NOT NULL,
|
|
21
|
-
`description` text,
|
|
22
|
-
`function_id` text NOT NULL,
|
|
23
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
24
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
25
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `graph_id`, `id`),
|
|
26
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`graph_id`) REFERENCES `agent_graph`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
27
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`function_id`) REFERENCES `functions`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
28
|
-
);
|
|
29
|
-
--> statement-breakpoint
|
|
30
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
31
|
-
CREATE TABLE `__new_tools` (
|
|
32
|
-
`tenant_id` text NOT NULL,
|
|
33
|
-
`id` text NOT NULL,
|
|
34
|
-
`project_id` text NOT NULL,
|
|
35
|
-
`name` text NOT NULL,
|
|
36
|
-
`description` text,
|
|
37
|
-
`config` blob NOT NULL,
|
|
38
|
-
`credential_reference_id` text,
|
|
39
|
-
`headers` blob,
|
|
40
|
-
`image_url` text,
|
|
41
|
-
`capabilities` blob,
|
|
42
|
-
`last_error` text,
|
|
43
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
44
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
45
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
46
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
47
|
-
);
|
|
48
|
-
--> statement-breakpoint
|
|
49
|
-
INSERT INTO `__new_tools`("tenant_id", "id", "project_id", "name", "description", "config", "credential_reference_id", "headers", "image_url", "capabilities", "last_error", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "config", "credential_reference_id", "headers", "image_url", "capabilities", "last_error", "created_at", "updated_at" FROM `tools`;--> statement-breakpoint
|
|
50
|
-
DROP TABLE `tools`;--> statement-breakpoint
|
|
51
|
-
ALTER TABLE `__new_tools` RENAME TO `tools`;--> statement-breakpoint
|
|
52
|
-
PRAGMA foreign_keys=ON;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `agent_graph` RENAME TO `agent`;--> statement-breakpoint
|
|
2
|
-
ALTER TABLE `agent` RENAME COLUMN "graph_prompt" TO "prompt";--> statement-breakpoint
|
|
3
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
4
|
-
CREATE TABLE `__new_agent` (
|
|
5
|
-
`tenant_id` text NOT NULL,
|
|
6
|
-
`id` text NOT NULL,
|
|
7
|
-
`project_id` text NOT NULL,
|
|
8
|
-
`name` text NOT NULL,
|
|
9
|
-
`description` text,
|
|
10
|
-
`default_sub_agent_id` text,
|
|
11
|
-
`context_config_id` text,
|
|
12
|
-
`models` text,
|
|
13
|
-
`status_updates` text,
|
|
14
|
-
`prompt` text,
|
|
15
|
-
`stop_when` text,
|
|
16
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
17
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
18
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
19
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
20
|
-
);
|
|
21
|
-
--> statement-breakpoint
|
|
22
|
-
INSERT INTO `__new_agent`("tenant_id", "id", "project_id", "name", "description", "default_sub_agent_id", "context_config_id", "models", "status_updates", "prompt", "stop_when", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "default_sub_agent_id", "context_config_id", "models", "status_updates", "prompt", "stop_when", "created_at", "updated_at" FROM `agent`;--> statement-breakpoint
|
|
23
|
-
DROP TABLE `agent`;--> statement-breakpoint
|
|
24
|
-
ALTER TABLE `__new_agent` RENAME TO `agent`;--> statement-breakpoint
|
|
25
|
-
CREATE TABLE `__new_agent_function_tool_relations` (
|
|
26
|
-
`tenant_id` text NOT NULL,
|
|
27
|
-
`id` text NOT NULL,
|
|
28
|
-
`project_id` text NOT NULL,
|
|
29
|
-
`agent_id` text NOT NULL,
|
|
30
|
-
`sub_agent_id` text NOT NULL,
|
|
31
|
-
`function_tool_id` text NOT NULL,
|
|
32
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
33
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
34
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
35
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
36
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`function_tool_id`) REFERENCES `function_tools`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
37
|
-
);
|
|
38
|
-
--> statement-breakpoint
|
|
39
|
-
INSERT INTO `__new_agent_function_tool_relations`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at" FROM `agent_function_tool_relations`;--> statement-breakpoint
|
|
40
|
-
DROP TABLE `agent_function_tool_relations`;--> statement-breakpoint
|
|
41
|
-
ALTER TABLE `__new_agent_function_tool_relations` RENAME TO `agent_function_tool_relations`;--> statement-breakpoint
|
|
42
|
-
CREATE TABLE `__new_api_keys` (
|
|
43
|
-
`tenant_id` text NOT NULL,
|
|
44
|
-
`id` text NOT NULL,
|
|
45
|
-
`project_id` text NOT NULL,
|
|
46
|
-
`agent_id` text NOT NULL,
|
|
47
|
-
`public_id` text NOT NULL,
|
|
48
|
-
`key_hash` text NOT NULL,
|
|
49
|
-
`key_prefix` text NOT NULL,
|
|
50
|
-
`name` text,
|
|
51
|
-
`last_used_at` text,
|
|
52
|
-
`expires_at` text,
|
|
53
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
54
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
55
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
56
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
57
|
-
);
|
|
58
|
-
--> statement-breakpoint
|
|
59
|
-
INSERT INTO `__new_api_keys`("tenant_id", "id", "project_id", "agent_id", "public_id", "key_hash", "key_prefix", "name", "last_used_at", "expires_at", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "public_id", "key_hash", "key_prefix", "name", "last_used_at", "expires_at", "created_at", "updated_at" FROM `api_keys`;--> statement-breakpoint
|
|
60
|
-
DROP TABLE `api_keys`;--> statement-breakpoint
|
|
61
|
-
ALTER TABLE `__new_api_keys` RENAME TO `api_keys`;--> statement-breakpoint
|
|
62
|
-
CREATE UNIQUE INDEX `api_keys_public_id_unique` ON `api_keys` (`public_id`);--> statement-breakpoint
|
|
63
|
-
CREATE INDEX `api_keys_tenant_agent_idx` ON `api_keys` (`tenant_id`,`agent_id`);--> statement-breakpoint
|
|
64
|
-
CREATE INDEX `api_keys_prefix_idx` ON `api_keys` (`key_prefix`);--> statement-breakpoint
|
|
65
|
-
CREATE INDEX `api_keys_public_id_idx` ON `api_keys` (`public_id`);--> statement-breakpoint
|
|
66
|
-
CREATE TABLE `__new_context_configs` (
|
|
67
|
-
`tenant_id` text NOT NULL,
|
|
68
|
-
`id` text NOT NULL,
|
|
69
|
-
`project_id` text NOT NULL,
|
|
70
|
-
`agent_id` text NOT NULL,
|
|
71
|
-
`headers_schema` blob,
|
|
72
|
-
`context_variables` blob,
|
|
73
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
74
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
75
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
76
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
77
|
-
);
|
|
78
|
-
--> statement-breakpoint
|
|
79
|
-
INSERT INTO `__new_context_configs`("tenant_id", "id", "project_id", "agent_id", "headers_schema", "context_variables", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "headers_schema", "context_variables", "created_at", "updated_at" FROM `context_configs`;--> statement-breakpoint
|
|
80
|
-
DROP TABLE `context_configs`;--> statement-breakpoint
|
|
81
|
-
ALTER TABLE `__new_context_configs` RENAME TO `context_configs`;--> statement-breakpoint
|
|
82
|
-
CREATE TABLE `__new_external_agents` (
|
|
83
|
-
`tenant_id` text NOT NULL,
|
|
84
|
-
`id` text NOT NULL,
|
|
85
|
-
`project_id` text NOT NULL,
|
|
86
|
-
`agent_id` text NOT NULL,
|
|
87
|
-
`name` text NOT NULL,
|
|
88
|
-
`description` text NOT NULL,
|
|
89
|
-
`base_url` text NOT NULL,
|
|
90
|
-
`credential_reference_id` text,
|
|
91
|
-
`headers` blob,
|
|
92
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
93
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
94
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
95
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
96
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`credential_reference_id`) REFERENCES `credential_references`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE set null
|
|
97
|
-
);
|
|
98
|
-
--> statement-breakpoint
|
|
99
|
-
INSERT INTO `__new_external_agents`("tenant_id", "id", "project_id", "agent_id", "name", "description", "base_url", "credential_reference_id", "headers", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "base_url", "credential_reference_id", "headers", "created_at", "updated_at" FROM `external_agents`;--> statement-breakpoint
|
|
100
|
-
DROP TABLE `external_agents`;--> statement-breakpoint
|
|
101
|
-
ALTER TABLE `__new_external_agents` RENAME TO `external_agents`;--> statement-breakpoint
|
|
102
|
-
CREATE TABLE `__new_function_tools` (
|
|
103
|
-
`tenant_id` text NOT NULL,
|
|
104
|
-
`id` text NOT NULL,
|
|
105
|
-
`project_id` text NOT NULL,
|
|
106
|
-
`agent_id` text NOT NULL,
|
|
107
|
-
`name` text NOT NULL,
|
|
108
|
-
`description` text,
|
|
109
|
-
`function_id` text NOT NULL,
|
|
110
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
111
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
112
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
113
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
114
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`function_id`) REFERENCES `functions`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
115
|
-
);
|
|
116
|
-
--> statement-breakpoint
|
|
117
|
-
INSERT INTO `__new_function_tools`("tenant_id", "id", "project_id", "agent_id", "name", "description", "function_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "function_id", "created_at", "updated_at" FROM `function_tools`;--> statement-breakpoint
|
|
118
|
-
DROP TABLE `function_tools`;--> statement-breakpoint
|
|
119
|
-
ALTER TABLE `__new_function_tools` RENAME TO `function_tools`;--> statement-breakpoint
|
|
120
|
-
CREATE TABLE `__new_sub_agent_artifact_components` (
|
|
121
|
-
`tenant_id` text NOT NULL,
|
|
122
|
-
`id` text NOT NULL,
|
|
123
|
-
`project_id` text NOT NULL,
|
|
124
|
-
`agent_id` text NOT NULL,
|
|
125
|
-
`sub_agent_id` text NOT NULL,
|
|
126
|
-
`artifact_component_id` text NOT NULL,
|
|
127
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
128
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `sub_agent_id`, `id`),
|
|
129
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
130
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`artifact_component_id`) REFERENCES `artifact_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
131
|
-
);
|
|
132
|
-
--> statement-breakpoint
|
|
133
|
-
INSERT INTO `__new_sub_agent_artifact_components`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "artifact_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "artifact_component_id", "created_at" FROM `sub_agent_artifact_components`;--> statement-breakpoint
|
|
134
|
-
DROP TABLE `sub_agent_artifact_components`;--> statement-breakpoint
|
|
135
|
-
ALTER TABLE `__new_sub_agent_artifact_components` RENAME TO `sub_agent_artifact_components`;--> statement-breakpoint
|
|
136
|
-
CREATE TABLE `__new_sub_agent_data_components` (
|
|
137
|
-
`tenant_id` text NOT NULL,
|
|
138
|
-
`id` text NOT NULL,
|
|
139
|
-
`project_id` text NOT NULL,
|
|
140
|
-
`agent_id` text NOT NULL,
|
|
141
|
-
`sub_agent_id` text NOT NULL,
|
|
142
|
-
`data_component_id` text NOT NULL,
|
|
143
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
144
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
145
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
146
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`data_component_id`) REFERENCES `data_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
147
|
-
);
|
|
148
|
-
--> statement-breakpoint
|
|
149
|
-
INSERT INTO `__new_sub_agent_data_components`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "data_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "data_component_id", "created_at" FROM `sub_agent_data_components`;--> statement-breakpoint
|
|
150
|
-
DROP TABLE `sub_agent_data_components`;--> statement-breakpoint
|
|
151
|
-
ALTER TABLE `__new_sub_agent_data_components` RENAME TO `sub_agent_data_components`;--> statement-breakpoint
|
|
152
|
-
CREATE TABLE `__new_sub_agent_relations` (
|
|
153
|
-
`tenant_id` text NOT NULL,
|
|
154
|
-
`id` text NOT NULL,
|
|
155
|
-
`project_id` text NOT NULL,
|
|
156
|
-
`agent_id` text NOT NULL,
|
|
157
|
-
`source_sub_agent_id` text NOT NULL,
|
|
158
|
-
`target_sub_agent_id` text,
|
|
159
|
-
`external_sub_agent_id` text,
|
|
160
|
-
`relation_type` text,
|
|
161
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
162
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
163
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
164
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
165
|
-
);
|
|
166
|
-
--> statement-breakpoint
|
|
167
|
-
INSERT INTO `__new_sub_agent_relations`("tenant_id", "id", "project_id", "agent_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at" FROM `sub_agent_relations`;--> statement-breakpoint
|
|
168
|
-
DROP TABLE `sub_agent_relations`;--> statement-breakpoint
|
|
169
|
-
ALTER TABLE `__new_sub_agent_relations` RENAME TO `sub_agent_relations`;--> statement-breakpoint
|
|
170
|
-
CREATE TABLE `__new_sub_agent_tool_relations` (
|
|
171
|
-
`tenant_id` text NOT NULL,
|
|
172
|
-
`id` text NOT NULL,
|
|
173
|
-
`project_id` text NOT NULL,
|
|
174
|
-
`agent_id` text NOT NULL,
|
|
175
|
-
`sub_agent_id` text NOT NULL,
|
|
176
|
-
`tool_id` text NOT NULL,
|
|
177
|
-
`selected_tools` blob,
|
|
178
|
-
`headers` blob,
|
|
179
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
180
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
181
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
182
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
183
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`tool_id`) REFERENCES `tools`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
184
|
-
);
|
|
185
|
-
--> statement-breakpoint
|
|
186
|
-
INSERT INTO `__new_sub_agent_tool_relations`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at" FROM `sub_agent_tool_relations`;--> statement-breakpoint
|
|
187
|
-
DROP TABLE `sub_agent_tool_relations`;--> statement-breakpoint
|
|
188
|
-
ALTER TABLE `__new_sub_agent_tool_relations` RENAME TO `sub_agent_tool_relations`;--> statement-breakpoint
|
|
189
|
-
CREATE TABLE `__new_sub_agents` (
|
|
190
|
-
`tenant_id` text NOT NULL,
|
|
191
|
-
`id` text NOT NULL,
|
|
192
|
-
`project_id` text NOT NULL,
|
|
193
|
-
`agent_id` text NOT NULL,
|
|
194
|
-
`name` text NOT NULL,
|
|
195
|
-
`description` text NOT NULL,
|
|
196
|
-
`prompt` text NOT NULL,
|
|
197
|
-
`conversation_history_config` text,
|
|
198
|
-
`models` text,
|
|
199
|
-
`stop_when` text,
|
|
200
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
201
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
202
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
203
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
204
|
-
);
|
|
205
|
-
--> statement-breakpoint
|
|
206
|
-
INSERT INTO `__new_sub_agents`("tenant_id", "id", "project_id", "agent_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at" FROM `sub_agents`;--> statement-breakpoint
|
|
207
|
-
DROP TABLE `sub_agents`;--> statement-breakpoint
|
|
208
|
-
ALTER TABLE `__new_sub_agents` RENAME TO `sub_agents`;--> statement-breakpoint
|
|
209
|
-
CREATE TABLE `__new_tasks` (
|
|
210
|
-
`tenant_id` text NOT NULL,
|
|
211
|
-
`id` text NOT NULL,
|
|
212
|
-
`project_id` text NOT NULL,
|
|
213
|
-
`agent_id` text NOT NULL,
|
|
214
|
-
`sub_agent_id` text NOT NULL,
|
|
215
|
-
`context_id` text NOT NULL,
|
|
216
|
-
`status` text NOT NULL,
|
|
217
|
-
`metadata` blob,
|
|
218
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
219
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
220
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
221
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
222
|
-
);
|
|
223
|
-
--> statement-breakpoint
|
|
224
|
-
INSERT INTO `__new_tasks`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "context_id", "status", "metadata", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "context_id", "status", "metadata", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint
|
|
225
|
-
DROP TABLE `tasks`;--> statement-breakpoint
|
|
226
|
-
ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint
|
|
227
|
-
PRAGMA foreign_keys=ON;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `agent_function_tool_relations` RENAME TO `sub_agent_function_tool_relations`;--> statement-breakpoint
|
|
2
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
3
|
-
CREATE TABLE `__new_sub_agent_function_tool_relations` (
|
|
4
|
-
`tenant_id` text NOT NULL,
|
|
5
|
-
`id` text NOT NULL,
|
|
6
|
-
`project_id` text NOT NULL,
|
|
7
|
-
`agent_id` text NOT NULL,
|
|
8
|
-
`sub_agent_id` text NOT NULL,
|
|
9
|
-
`function_tool_id` text NOT NULL,
|
|
10
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
11
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
12
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
13
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
14
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`function_tool_id`) REFERENCES `function_tools`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
15
|
-
);
|
|
16
|
-
--> statement-breakpoint
|
|
17
|
-
INSERT INTO `__new_sub_agent_function_tool_relations`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at" FROM `sub_agent_function_tool_relations`;--> statement-breakpoint
|
|
18
|
-
DROP TABLE `sub_agent_function_tool_relations`;--> statement-breakpoint
|
|
19
|
-
ALTER TABLE `__new_sub_agent_function_tool_relations` RENAME TO `sub_agent_function_tool_relations`;--> statement-breakpoint
|
|
20
|
-
PRAGMA foreign_keys=ON;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `projects` DROP COLUMN `sandbox_config`;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `sub_agent_external_agent_relations` (
|
|
2
|
-
`tenant_id` text NOT NULL,
|
|
3
|
-
`id` text NOT NULL,
|
|
4
|
-
`project_id` text NOT NULL,
|
|
5
|
-
`agent_id` text NOT NULL,
|
|
6
|
-
`sub_agent_id` text NOT NULL,
|
|
7
|
-
`external_agent_id` text NOT NULL,
|
|
8
|
-
`headers` blob,
|
|
9
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
10
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
11
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
12
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
13
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`external_agent_id`) REFERENCES `external_agents`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
14
|
-
);
|
|
15
|
-
--> statement-breakpoint
|
|
16
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
17
|
-
CREATE TABLE `__new_external_agents` (
|
|
18
|
-
`tenant_id` text NOT NULL,
|
|
19
|
-
`id` text NOT NULL,
|
|
20
|
-
`project_id` text NOT NULL,
|
|
21
|
-
`name` text NOT NULL,
|
|
22
|
-
`description` text NOT NULL,
|
|
23
|
-
`base_url` text NOT NULL,
|
|
24
|
-
`credential_reference_id` text,
|
|
25
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
26
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
27
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
28
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
29
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`credential_reference_id`) REFERENCES `credential_references`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE set null
|
|
30
|
-
);
|
|
31
|
-
--> statement-breakpoint
|
|
32
|
-
INSERT INTO `__new_external_agents`("tenant_id", "id", "project_id", "name", "description", "base_url", "credential_reference_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "base_url", "credential_reference_id", "created_at", "updated_at" FROM `external_agents`;--> statement-breakpoint
|
|
33
|
-
DROP TABLE `external_agents`;--> statement-breakpoint
|
|
34
|
-
ALTER TABLE `__new_external_agents` RENAME TO `external_agents`;--> statement-breakpoint
|
|
35
|
-
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
36
|
-
ALTER TABLE `sub_agent_relations` DROP COLUMN `external_sub_agent_id`;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `sub_agent_team_agent_relations` (
|
|
2
|
-
`tenant_id` text NOT NULL,
|
|
3
|
-
`id` text NOT NULL,
|
|
4
|
-
`project_id` text NOT NULL,
|
|
5
|
-
`agent_id` text NOT NULL,
|
|
6
|
-
`sub_agent_id` text NOT NULL,
|
|
7
|
-
`target_agent_id` text NOT NULL,
|
|
8
|
-
`headers` blob,
|
|
9
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
10
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
11
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
12
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
13
|
-
FOREIGN KEY (`tenant_id`,`project_id`,`target_agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
14
|
-
);
|
|
15
|
-
--> statement-breakpoint
|
|
16
|
-
ALTER TABLE `messages` ADD `from_team_agent_id` text;--> statement-breakpoint
|
|
17
|
-
ALTER TABLE `messages` ADD `to_team_agent_id` text;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
-
CREATE TABLE `__new_data_components` (
|
|
3
|
-
`tenant_id` text NOT NULL,
|
|
4
|
-
`id` text NOT NULL,
|
|
5
|
-
`project_id` text NOT NULL,
|
|
6
|
-
`name` text NOT NULL,
|
|
7
|
-
`description` text NOT NULL,
|
|
8
|
-
`props` blob,
|
|
9
|
-
`render` blob DEFAULT 'null',
|
|
10
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
11
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
12
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
13
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
14
|
-
);
|
|
15
|
-
--> statement-breakpoint
|
|
16
|
-
INSERT INTO `__new_data_components`("tenant_id", "id", "project_id", "name", "description", "props", "render", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "props", NULL, "created_at", "updated_at" FROM `data_components` WHERE EXISTS(SELECT 1 FROM sqlite_master WHERE type='table' AND name='data_components');--> statement-breakpoint
|
|
17
|
-
DROP TABLE IF EXISTS `data_components`;--> statement-breakpoint
|
|
18
|
-
ALTER TABLE `__new_data_components` RENAME TO `data_components`;--> statement-breakpoint
|
|
19
|
-
PRAGMA foreign_keys=ON;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
-
|
|
3
|
-
-- Create new table with NOT NULL constraint on name
|
|
4
|
-
CREATE TABLE `__new_credential_references` (
|
|
5
|
-
`tenant_id` text NOT NULL,
|
|
6
|
-
`id` text NOT NULL,
|
|
7
|
-
`project_id` text NOT NULL,
|
|
8
|
-
`name` text NOT NULL,
|
|
9
|
-
`type` text NOT NULL,
|
|
10
|
-
`credential_store_id` text NOT NULL,
|
|
11
|
-
`retrieval_params` blob,
|
|
12
|
-
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
13
|
-
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
14
|
-
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
15
|
-
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
16
|
-
);--> statement-breakpoint
|
|
17
|
-
|
|
18
|
-
-- Copy existing data, using id as the name for all existing rows
|
|
19
|
-
INSERT INTO `__new_credential_references`("tenant_id", "id", "project_id", "name", "type", "credential_store_id", "retrieval_params", "created_at", "updated_at")
|
|
20
|
-
SELECT "tenant_id", "id", "project_id", "id", "type", "credential_store_id", "retrieval_params", "created_at", "updated_at"
|
|
21
|
-
FROM `credential_references`;--> statement-breakpoint
|
|
22
|
-
|
|
23
|
-
-- Drop old table
|
|
24
|
-
DROP TABLE `credential_references`;--> statement-breakpoint
|
|
25
|
-
|
|
26
|
-
-- Rename new table
|
|
27
|
-
ALTER TABLE `__new_credential_references` RENAME TO `credential_references`;--> statement-breakpoint
|
|
28
|
-
|
|
29
|
-
PRAGMA foreign_keys=ON;
|