larness 0.4.0 → 0.4.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/apps/server/drizzle/0001_auth.sql +109 -109
- package/apps/server/drizzle/0002_projects.sql +12 -12
- package/apps/server/drizzle/0003_workspace.sql +80 -80
- package/apps/server/drizzle/0004_models.sql +30 -30
- package/apps/server/drizzle/0005_resources.sql +54 -54
- package/apps/server/drizzle/0006_commands.sql +23 -23
- package/apps/server/drizzle/0007_terminals.sql +41 -41
- package/apps/server/drizzle/0008_resource_actions.sql +23 -23
- package/apps/server/drizzle/0010_services.sql +31 -31
- package/apps/web/dist/assets/{FileEditor-EgU1WoyG.js → FileEditor-CxzD-z_w.js} +1 -1
- package/apps/web/dist/assets/{FileViewer-CK3jt-Kt.js → FileViewer-4LwgwN4s.js} +1 -1
- package/apps/web/dist/assets/{cssMode-C8rMoO9f.js → cssMode-BfW9rKao.js} +1 -1
- package/apps/web/dist/assets/{editor.api-oDs5eZGS.js → editor.api-D0PbFQmb.js} +1 -1
- package/apps/web/dist/assets/{freemarker2-Bpg8JM09.js → freemarker2-CUmmnP_9.js} +1 -1
- package/apps/web/dist/assets/{handlebars-17J16rlT.js → handlebars-CV0ntFU6.js} +1 -1
- package/apps/web/dist/assets/{html-DJQFF1_1.js → html-lbv15ZCZ.js} +1 -1
- package/apps/web/dist/assets/{htmlMode-H8gHwZ6x.js → htmlMode-2S1Ml4u-.js} +1 -1
- package/apps/web/dist/assets/{index-BTVfvWIs.js → index-Bu4wSG15.js} +2 -2
- package/apps/web/dist/assets/{javascript-CjeM-nVA.js → javascript-s1wW-h_2.js} +1 -1
- package/apps/web/dist/assets/{jsonMode-C6seMV0X.js → jsonMode-Di8Ytqtu.js} +1 -1
- package/apps/web/dist/assets/{liquid-B33LyktO.js → liquid-CR28rx5y.js} +1 -1
- package/apps/web/dist/assets/{lspLanguageFeatures-H7IuoVNs.js → lspLanguageFeatures-uPJRSuKu.js} +1 -1
- package/apps/web/dist/assets/{main-CQzbYrTZ.js → main-KzEpvsAJ.js} +5 -5
- package/apps/web/dist/assets/main-ptChOROf.css +1 -0
- package/apps/web/dist/assets/{mdx-CcNcLUd8.js → mdx-B_RQg_ko.js} +1 -1
- package/apps/web/dist/assets/{monaco-xD43LINc.js → monaco-BHRE2AKp.js} +3 -3
- package/apps/web/dist/assets/{python-BfhjzxvI.js → python-DxrD-zEd.js} +1 -1
- package/apps/web/dist/assets/{razor-COinq8YD.js → razor-BGSx-heg.js} +1 -1
- package/apps/web/dist/assets/{tsMode-CXpnR4mr.js → tsMode-CkPGnA4g.js} +1 -1
- package/apps/web/dist/assets/{typescript-DAgfuTsy.js → typescript-oJa8RtP0.js} +1 -1
- package/apps/web/dist/assets/{workers-DI76FldO.js → workers-BmwP04Ml.js} +1 -1
- package/apps/web/dist/assets/{xml-CSNVYs0K.js → xml-NoacuPD-.js} +1 -1
- package/apps/web/dist/assets/{yaml-Bzp-4SkQ.js → yaml-PU4CKcMI.js} +1 -1
- package/apps/web/dist/favicon.svg +4 -4
- package/apps/web/dist/index.html +1 -1
- package/package.json +9 -1
- package/apps/web/dist/assets/main-gq3n_vn8.css +0 -1
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
CREATE TABLE `app_meta` (
|
|
2
|
-
`key` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`value` text NOT NULL,
|
|
4
|
-
`updated_at` integer NOT NULL
|
|
5
|
-
);
|
|
6
|
-
--> statement-breakpoint
|
|
7
|
-
CREATE TABLE `audit_logs` (
|
|
8
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
9
|
-
`client_session_id` text,
|
|
10
|
-
`session_id` text,
|
|
11
|
-
`action` text NOT NULL,
|
|
12
|
-
`resource_type` text,
|
|
13
|
-
`resource_id` text,
|
|
14
|
-
`decision` text,
|
|
15
|
-
`details_json` text DEFAULT '{}' NOT NULL,
|
|
16
|
-
`created_at` integer NOT NULL
|
|
17
|
-
);
|
|
18
|
-
--> statement-breakpoint
|
|
19
|
-
CREATE INDEX `idx_audit_created` ON `audit_logs` (`created_at`);--> statement-breakpoint
|
|
20
|
-
CREATE INDEX `idx_audit_action` ON `audit_logs` (`action`,`created_at`);--> statement-breakpoint
|
|
21
|
-
CREATE TABLE `auth_settings` (
|
|
22
|
-
`id` integer PRIMARY KEY NOT NULL,
|
|
23
|
-
`admin_hash` text NOT NULL,
|
|
24
|
-
`admin_updated_at` integer NOT NULL,
|
|
25
|
-
`initialized_at` integer NOT NULL,
|
|
26
|
-
CONSTRAINT "auth_settings_single_row" CHECK("auth_settings"."id" = 1)
|
|
27
|
-
);
|
|
28
|
-
--> statement-breakpoint
|
|
29
|
-
CREATE TABLE `browser_sessions` (
|
|
30
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
31
|
-
`device_id` text,
|
|
32
|
-
`token_hash` text NOT NULL,
|
|
33
|
-
`kind` text NOT NULL,
|
|
34
|
-
`ip` text,
|
|
35
|
-
`user_agent` text,
|
|
36
|
-
`created_at` integer NOT NULL,
|
|
37
|
-
`last_seen_at` integer NOT NULL,
|
|
38
|
-
`expires_at` integer NOT NULL,
|
|
39
|
-
`revoked_at` integer,
|
|
40
|
-
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
41
|
-
);
|
|
42
|
-
--> statement-breakpoint
|
|
43
|
-
CREATE UNIQUE INDEX `browser_sessions_token_hash_unique` ON `browser_sessions` (`token_hash`);--> statement-breakpoint
|
|
44
|
-
CREATE INDEX `idx_browser_sessions_device` ON `browser_sessions` (`device_id`);--> statement-breakpoint
|
|
45
|
-
CREATE TABLE `device_requests` (
|
|
46
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
47
|
-
`short_code` text NOT NULL,
|
|
48
|
-
`status` text NOT NULL,
|
|
49
|
-
`decision` text,
|
|
50
|
-
`client_label` text,
|
|
51
|
-
`user_agent` text,
|
|
52
|
-
`ip` text,
|
|
53
|
-
`client_origin` text,
|
|
54
|
-
`poll_token_hash` text NOT NULL,
|
|
55
|
-
`code_hash` text,
|
|
56
|
-
`code_expires_at` integer,
|
|
57
|
-
`attempts` integer DEFAULT 0 NOT NULL,
|
|
58
|
-
`enrollment_token_hash` text,
|
|
59
|
-
`enrollment_expires_at` integer,
|
|
60
|
-
`created_at` integer NOT NULL,
|
|
61
|
-
`expires_at` integer NOT NULL,
|
|
62
|
-
`decided_at` integer,
|
|
63
|
-
`redeemed_at` integer
|
|
64
|
-
);
|
|
65
|
-
--> statement-breakpoint
|
|
66
|
-
CREATE UNIQUE INDEX `device_requests_short_code_unique` ON `device_requests` (`short_code`);--> statement-breakpoint
|
|
67
|
-
CREATE INDEX `idx_device_requests_status` ON `device_requests` (`status`,`expires_at`);--> statement-breakpoint
|
|
68
|
-
CREATE TABLE `trusted_devices` (
|
|
69
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
70
|
-
`label` text NOT NULL,
|
|
71
|
-
`created_by_request_id` text,
|
|
72
|
-
`user_agent` text,
|
|
73
|
-
`created_at` integer NOT NULL,
|
|
74
|
-
`last_seen_at` integer,
|
|
75
|
-
`revoked_at` integer,
|
|
76
|
-
FOREIGN KEY (`created_by_request_id`) REFERENCES `device_requests`(`id`) ON UPDATE no action ON DELETE no action
|
|
77
|
-
);
|
|
78
|
-
--> statement-breakpoint
|
|
79
|
-
CREATE TABLE `webauthn_challenges` (
|
|
80
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
81
|
-
`type` text NOT NULL,
|
|
82
|
-
`challenge` text NOT NULL,
|
|
83
|
-
`request_id` text,
|
|
84
|
-
`device_id` text,
|
|
85
|
-
`created_at` integer NOT NULL,
|
|
86
|
-
`expires_at` integer NOT NULL,
|
|
87
|
-
`consumed_at` integer,
|
|
88
|
-
FOREIGN KEY (`request_id`) REFERENCES `device_requests`(`id`) ON UPDATE no action ON DELETE no action,
|
|
89
|
-
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
90
|
-
);
|
|
91
|
-
--> statement-breakpoint
|
|
92
|
-
CREATE INDEX `idx_webauthn_challenges_expiry` ON `webauthn_challenges` (`expires_at`);--> statement-breakpoint
|
|
93
|
-
CREATE TABLE `webauthn_credentials` (
|
|
94
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
95
|
-
`device_id` text NOT NULL,
|
|
96
|
-
`credential_id` text NOT NULL,
|
|
97
|
-
`public_key` text NOT NULL,
|
|
98
|
-
`counter` integer DEFAULT 0 NOT NULL,
|
|
99
|
-
`transports_json` text DEFAULT '[]' NOT NULL,
|
|
100
|
-
`aaguid` text,
|
|
101
|
-
`backup_eligible` integer DEFAULT false NOT NULL,
|
|
102
|
-
`backup_state` integer DEFAULT false NOT NULL,
|
|
103
|
-
`created_at` integer NOT NULL,
|
|
104
|
-
`last_used_at` integer,
|
|
105
|
-
`revoked_at` integer,
|
|
106
|
-
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
107
|
-
);
|
|
108
|
-
--> statement-breakpoint
|
|
109
|
-
CREATE UNIQUE INDEX `webauthn_credentials_credential_id_unique` ON `webauthn_credentials` (`credential_id`);--> statement-breakpoint
|
|
1
|
+
CREATE TABLE `app_meta` (
|
|
2
|
+
`key` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`value` text NOT NULL,
|
|
4
|
+
`updated_at` integer NOT NULL
|
|
5
|
+
);
|
|
6
|
+
--> statement-breakpoint
|
|
7
|
+
CREATE TABLE `audit_logs` (
|
|
8
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
9
|
+
`client_session_id` text,
|
|
10
|
+
`session_id` text,
|
|
11
|
+
`action` text NOT NULL,
|
|
12
|
+
`resource_type` text,
|
|
13
|
+
`resource_id` text,
|
|
14
|
+
`decision` text,
|
|
15
|
+
`details_json` text DEFAULT '{}' NOT NULL,
|
|
16
|
+
`created_at` integer NOT NULL
|
|
17
|
+
);
|
|
18
|
+
--> statement-breakpoint
|
|
19
|
+
CREATE INDEX `idx_audit_created` ON `audit_logs` (`created_at`);--> statement-breakpoint
|
|
20
|
+
CREATE INDEX `idx_audit_action` ON `audit_logs` (`action`,`created_at`);--> statement-breakpoint
|
|
21
|
+
CREATE TABLE `auth_settings` (
|
|
22
|
+
`id` integer PRIMARY KEY NOT NULL,
|
|
23
|
+
`admin_hash` text NOT NULL,
|
|
24
|
+
`admin_updated_at` integer NOT NULL,
|
|
25
|
+
`initialized_at` integer NOT NULL,
|
|
26
|
+
CONSTRAINT "auth_settings_single_row" CHECK("auth_settings"."id" = 1)
|
|
27
|
+
);
|
|
28
|
+
--> statement-breakpoint
|
|
29
|
+
CREATE TABLE `browser_sessions` (
|
|
30
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
31
|
+
`device_id` text,
|
|
32
|
+
`token_hash` text NOT NULL,
|
|
33
|
+
`kind` text NOT NULL,
|
|
34
|
+
`ip` text,
|
|
35
|
+
`user_agent` text,
|
|
36
|
+
`created_at` integer NOT NULL,
|
|
37
|
+
`last_seen_at` integer NOT NULL,
|
|
38
|
+
`expires_at` integer NOT NULL,
|
|
39
|
+
`revoked_at` integer,
|
|
40
|
+
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
41
|
+
);
|
|
42
|
+
--> statement-breakpoint
|
|
43
|
+
CREATE UNIQUE INDEX `browser_sessions_token_hash_unique` ON `browser_sessions` (`token_hash`);--> statement-breakpoint
|
|
44
|
+
CREATE INDEX `idx_browser_sessions_device` ON `browser_sessions` (`device_id`);--> statement-breakpoint
|
|
45
|
+
CREATE TABLE `device_requests` (
|
|
46
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
47
|
+
`short_code` text NOT NULL,
|
|
48
|
+
`status` text NOT NULL,
|
|
49
|
+
`decision` text,
|
|
50
|
+
`client_label` text,
|
|
51
|
+
`user_agent` text,
|
|
52
|
+
`ip` text,
|
|
53
|
+
`client_origin` text,
|
|
54
|
+
`poll_token_hash` text NOT NULL,
|
|
55
|
+
`code_hash` text,
|
|
56
|
+
`code_expires_at` integer,
|
|
57
|
+
`attempts` integer DEFAULT 0 NOT NULL,
|
|
58
|
+
`enrollment_token_hash` text,
|
|
59
|
+
`enrollment_expires_at` integer,
|
|
60
|
+
`created_at` integer NOT NULL,
|
|
61
|
+
`expires_at` integer NOT NULL,
|
|
62
|
+
`decided_at` integer,
|
|
63
|
+
`redeemed_at` integer
|
|
64
|
+
);
|
|
65
|
+
--> statement-breakpoint
|
|
66
|
+
CREATE UNIQUE INDEX `device_requests_short_code_unique` ON `device_requests` (`short_code`);--> statement-breakpoint
|
|
67
|
+
CREATE INDEX `idx_device_requests_status` ON `device_requests` (`status`,`expires_at`);--> statement-breakpoint
|
|
68
|
+
CREATE TABLE `trusted_devices` (
|
|
69
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
70
|
+
`label` text NOT NULL,
|
|
71
|
+
`created_by_request_id` text,
|
|
72
|
+
`user_agent` text,
|
|
73
|
+
`created_at` integer NOT NULL,
|
|
74
|
+
`last_seen_at` integer,
|
|
75
|
+
`revoked_at` integer,
|
|
76
|
+
FOREIGN KEY (`created_by_request_id`) REFERENCES `device_requests`(`id`) ON UPDATE no action ON DELETE no action
|
|
77
|
+
);
|
|
78
|
+
--> statement-breakpoint
|
|
79
|
+
CREATE TABLE `webauthn_challenges` (
|
|
80
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
81
|
+
`type` text NOT NULL,
|
|
82
|
+
`challenge` text NOT NULL,
|
|
83
|
+
`request_id` text,
|
|
84
|
+
`device_id` text,
|
|
85
|
+
`created_at` integer NOT NULL,
|
|
86
|
+
`expires_at` integer NOT NULL,
|
|
87
|
+
`consumed_at` integer,
|
|
88
|
+
FOREIGN KEY (`request_id`) REFERENCES `device_requests`(`id`) ON UPDATE no action ON DELETE no action,
|
|
89
|
+
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
90
|
+
);
|
|
91
|
+
--> statement-breakpoint
|
|
92
|
+
CREATE INDEX `idx_webauthn_challenges_expiry` ON `webauthn_challenges` (`expires_at`);--> statement-breakpoint
|
|
93
|
+
CREATE TABLE `webauthn_credentials` (
|
|
94
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
95
|
+
`device_id` text NOT NULL,
|
|
96
|
+
`credential_id` text NOT NULL,
|
|
97
|
+
`public_key` text NOT NULL,
|
|
98
|
+
`counter` integer DEFAULT 0 NOT NULL,
|
|
99
|
+
`transports_json` text DEFAULT '[]' NOT NULL,
|
|
100
|
+
`aaguid` text,
|
|
101
|
+
`backup_eligible` integer DEFAULT false NOT NULL,
|
|
102
|
+
`backup_state` integer DEFAULT false NOT NULL,
|
|
103
|
+
`created_at` integer NOT NULL,
|
|
104
|
+
`last_used_at` integer,
|
|
105
|
+
`revoked_at` integer,
|
|
106
|
+
FOREIGN KEY (`device_id`) REFERENCES `trusted_devices`(`id`) ON UPDATE no action ON DELETE no action
|
|
107
|
+
);
|
|
108
|
+
--> statement-breakpoint
|
|
109
|
+
CREATE UNIQUE INDEX `webauthn_credentials_credential_id_unique` ON `webauthn_credentials` (`credential_id`);--> statement-breakpoint
|
|
110
110
|
CREATE INDEX `idx_webauthn_credentials_device` ON `webauthn_credentials` (`device_id`);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
CREATE TABLE `projects` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`name` text NOT NULL,
|
|
4
|
-
`root_path` text NOT NULL,
|
|
5
|
-
`real_path` text NOT NULL,
|
|
6
|
-
`settings_json` text DEFAULT '{}' NOT NULL,
|
|
7
|
-
`git_detected` integer DEFAULT false NOT NULL,
|
|
8
|
-
`created_at` integer NOT NULL,
|
|
9
|
-
`updated_at` integer NOT NULL
|
|
10
|
-
);
|
|
11
|
-
--> statement-breakpoint
|
|
12
|
-
CREATE UNIQUE INDEX `projects_real_path_unique` ON `projects` (`real_path`);--> statement-breakpoint
|
|
1
|
+
CREATE TABLE `projects` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`name` text NOT NULL,
|
|
4
|
+
`root_path` text NOT NULL,
|
|
5
|
+
`real_path` text NOT NULL,
|
|
6
|
+
`settings_json` text DEFAULT '{}' NOT NULL,
|
|
7
|
+
`git_detected` integer DEFAULT false NOT NULL,
|
|
8
|
+
`created_at` integer NOT NULL,
|
|
9
|
+
`updated_at` integer NOT NULL
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE UNIQUE INDEX `projects_real_path_unique` ON `projects` (`real_path`);--> statement-breakpoint
|
|
13
13
|
CREATE INDEX `idx_projects_updated` ON `projects` (`updated_at`);
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
CREATE TABLE `agent_events` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`session_id` text NOT NULL,
|
|
4
|
-
`turn_id` text,
|
|
5
|
-
`seq` integer NOT NULL,
|
|
6
|
-
`type` text NOT NULL,
|
|
7
|
-
`payload_json` text DEFAULT '{}' NOT NULL,
|
|
8
|
-
`created_at` integer NOT NULL,
|
|
9
|
-
FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
10
|
-
FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE cascade
|
|
11
|
-
);
|
|
12
|
-
--> statement-breakpoint
|
|
13
|
-
CREATE UNIQUE INDEX `agent_events_session_seq_unique` ON `agent_events` (`session_id`,`seq`);--> statement-breakpoint
|
|
14
|
-
CREATE TABLE `approvals` (
|
|
15
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
16
|
-
`turn_id` text NOT NULL,
|
|
17
|
-
`tool_call_id` text NOT NULL,
|
|
18
|
-
`tool_name` text NOT NULL,
|
|
19
|
-
`risk` text NOT NULL,
|
|
20
|
-
`status` text DEFAULT 'pending' NOT NULL,
|
|
21
|
-
`scope_json` text DEFAULT '{}' NOT NULL,
|
|
22
|
-
`params_hash` text NOT NULL,
|
|
23
|
-
`expires_at` integer NOT NULL,
|
|
24
|
-
`decided_at` integer,
|
|
25
|
-
`decided_by` text,
|
|
26
|
-
`created_at` integer NOT NULL,
|
|
27
|
-
FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE cascade
|
|
28
|
-
);
|
|
29
|
-
--> statement-breakpoint
|
|
30
|
-
CREATE INDEX `idx_approvals_turn_status` ON `approvals` (`turn_id`,`status`);--> statement-breakpoint
|
|
31
|
-
CREATE INDEX `idx_approvals_expiry` ON `approvals` (`expires_at`);--> statement-breakpoint
|
|
32
|
-
CREATE TABLE `resource_locks` (
|
|
33
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
34
|
-
`resource_type` text NOT NULL,
|
|
35
|
-
`resource_id` text NOT NULL,
|
|
36
|
-
`owner` text NOT NULL,
|
|
37
|
-
`execution_id` text NOT NULL,
|
|
38
|
-
`fencing_token` integer NOT NULL,
|
|
39
|
-
`expires_at` integer NOT NULL,
|
|
40
|
-
`heartbeat_at` integer NOT NULL,
|
|
41
|
-
`created_at` integer NOT NULL
|
|
42
|
-
);
|
|
43
|
-
--> statement-breakpoint
|
|
44
|
-
CREATE UNIQUE INDEX `resource_locks_resource_unique` ON `resource_locks` (`resource_type`,`resource_id`);--> statement-breakpoint
|
|
45
|
-
CREATE INDEX `idx_resource_locks_expiry` ON `resource_locks` (`expires_at`);--> statement-breakpoint
|
|
46
|
-
CREATE TABLE `sessions` (
|
|
47
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
48
|
-
`project_id` text,
|
|
49
|
-
`workspace_path` text NOT NULL,
|
|
50
|
-
`title` text NOT NULL,
|
|
51
|
-
`status` text DEFAULT 'active' NOT NULL,
|
|
52
|
-
`model_profile_id` text,
|
|
53
|
-
`approval_policy_id` text DEFAULT 'standard' NOT NULL,
|
|
54
|
-
`created_at` integer NOT NULL,
|
|
55
|
-
`updated_at` integer NOT NULL,
|
|
56
|
-
`last_activity_at` integer NOT NULL,
|
|
57
|
-
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE set null
|
|
58
|
-
);
|
|
59
|
-
--> statement-breakpoint
|
|
60
|
-
CREATE INDEX `idx_sessions_project_updated` ON `sessions` (`project_id`,`updated_at`);--> statement-breakpoint
|
|
61
|
-
CREATE INDEX `idx_sessions_updated` ON `sessions` (`updated_at`);--> statement-breakpoint
|
|
62
|
-
CREATE TABLE `turns` (
|
|
63
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
64
|
-
`session_id` text NOT NULL,
|
|
65
|
-
`model_profile_id` text,
|
|
66
|
-
`provider` text,
|
|
67
|
-
`model` text,
|
|
68
|
-
`status` text NOT NULL,
|
|
69
|
-
`input_json` text NOT NULL,
|
|
70
|
-
`usage_json` text,
|
|
71
|
-
`error_json` text,
|
|
72
|
-
`idempotency_key` text,
|
|
73
|
-
`created_at` integer NOT NULL,
|
|
74
|
-
`started_at` integer,
|
|
75
|
-
`ended_at` integer,
|
|
76
|
-
FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
|
|
77
|
-
);
|
|
78
|
-
--> statement-breakpoint
|
|
79
|
-
CREATE UNIQUE INDEX `turns_session_idempotency_unique` ON `turns` (`session_id`,`idempotency_key`);--> statement-breakpoint
|
|
80
|
-
CREATE INDEX `idx_turns_session_created` ON `turns` (`session_id`,`created_at`);--> statement-breakpoint
|
|
1
|
+
CREATE TABLE `agent_events` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`session_id` text NOT NULL,
|
|
4
|
+
`turn_id` text,
|
|
5
|
+
`seq` integer NOT NULL,
|
|
6
|
+
`type` text NOT NULL,
|
|
7
|
+
`payload_json` text DEFAULT '{}' NOT NULL,
|
|
8
|
+
`created_at` integer NOT NULL,
|
|
9
|
+
FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
10
|
+
FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE cascade
|
|
11
|
+
);
|
|
12
|
+
--> statement-breakpoint
|
|
13
|
+
CREATE UNIQUE INDEX `agent_events_session_seq_unique` ON `agent_events` (`session_id`,`seq`);--> statement-breakpoint
|
|
14
|
+
CREATE TABLE `approvals` (
|
|
15
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
16
|
+
`turn_id` text NOT NULL,
|
|
17
|
+
`tool_call_id` text NOT NULL,
|
|
18
|
+
`tool_name` text NOT NULL,
|
|
19
|
+
`risk` text NOT NULL,
|
|
20
|
+
`status` text DEFAULT 'pending' NOT NULL,
|
|
21
|
+
`scope_json` text DEFAULT '{}' NOT NULL,
|
|
22
|
+
`params_hash` text NOT NULL,
|
|
23
|
+
`expires_at` integer NOT NULL,
|
|
24
|
+
`decided_at` integer,
|
|
25
|
+
`decided_by` text,
|
|
26
|
+
`created_at` integer NOT NULL,
|
|
27
|
+
FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE cascade
|
|
28
|
+
);
|
|
29
|
+
--> statement-breakpoint
|
|
30
|
+
CREATE INDEX `idx_approvals_turn_status` ON `approvals` (`turn_id`,`status`);--> statement-breakpoint
|
|
31
|
+
CREATE INDEX `idx_approvals_expiry` ON `approvals` (`expires_at`);--> statement-breakpoint
|
|
32
|
+
CREATE TABLE `resource_locks` (
|
|
33
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
34
|
+
`resource_type` text NOT NULL,
|
|
35
|
+
`resource_id` text NOT NULL,
|
|
36
|
+
`owner` text NOT NULL,
|
|
37
|
+
`execution_id` text NOT NULL,
|
|
38
|
+
`fencing_token` integer NOT NULL,
|
|
39
|
+
`expires_at` integer NOT NULL,
|
|
40
|
+
`heartbeat_at` integer NOT NULL,
|
|
41
|
+
`created_at` integer NOT NULL
|
|
42
|
+
);
|
|
43
|
+
--> statement-breakpoint
|
|
44
|
+
CREATE UNIQUE INDEX `resource_locks_resource_unique` ON `resource_locks` (`resource_type`,`resource_id`);--> statement-breakpoint
|
|
45
|
+
CREATE INDEX `idx_resource_locks_expiry` ON `resource_locks` (`expires_at`);--> statement-breakpoint
|
|
46
|
+
CREATE TABLE `sessions` (
|
|
47
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
48
|
+
`project_id` text,
|
|
49
|
+
`workspace_path` text NOT NULL,
|
|
50
|
+
`title` text NOT NULL,
|
|
51
|
+
`status` text DEFAULT 'active' NOT NULL,
|
|
52
|
+
`model_profile_id` text,
|
|
53
|
+
`approval_policy_id` text DEFAULT 'standard' NOT NULL,
|
|
54
|
+
`created_at` integer NOT NULL,
|
|
55
|
+
`updated_at` integer NOT NULL,
|
|
56
|
+
`last_activity_at` integer NOT NULL,
|
|
57
|
+
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE set null
|
|
58
|
+
);
|
|
59
|
+
--> statement-breakpoint
|
|
60
|
+
CREATE INDEX `idx_sessions_project_updated` ON `sessions` (`project_id`,`updated_at`);--> statement-breakpoint
|
|
61
|
+
CREATE INDEX `idx_sessions_updated` ON `sessions` (`updated_at`);--> statement-breakpoint
|
|
62
|
+
CREATE TABLE `turns` (
|
|
63
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
64
|
+
`session_id` text NOT NULL,
|
|
65
|
+
`model_profile_id` text,
|
|
66
|
+
`provider` text,
|
|
67
|
+
`model` text,
|
|
68
|
+
`status` text NOT NULL,
|
|
69
|
+
`input_json` text NOT NULL,
|
|
70
|
+
`usage_json` text,
|
|
71
|
+
`error_json` text,
|
|
72
|
+
`idempotency_key` text,
|
|
73
|
+
`created_at` integer NOT NULL,
|
|
74
|
+
`started_at` integer,
|
|
75
|
+
`ended_at` integer,
|
|
76
|
+
FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
|
|
77
|
+
);
|
|
78
|
+
--> statement-breakpoint
|
|
79
|
+
CREATE UNIQUE INDEX `turns_session_idempotency_unique` ON `turns` (`session_id`,`idempotency_key`);--> statement-breakpoint
|
|
80
|
+
CREATE INDEX `idx_turns_session_created` ON `turns` (`session_id`,`created_at`);--> statement-breakpoint
|
|
81
81
|
CREATE INDEX `idx_turns_session_status` ON `turns` (`session_id`,`status`);
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
CREATE TABLE `credential_profiles` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`provider` text NOT NULL,
|
|
4
|
-
`label` text NOT NULL,
|
|
5
|
-
`secret_ref` text NOT NULL,
|
|
6
|
-
`created_at` integer NOT NULL,
|
|
7
|
-
FOREIGN KEY (`secret_ref`) REFERENCES `secrets`(`id`) ON UPDATE no action ON DELETE cascade
|
|
8
|
-
);
|
|
9
|
-
--> statement-breakpoint
|
|
10
|
-
CREATE INDEX `idx_credential_profiles_provider` ON `credential_profiles` (`provider`);--> statement-breakpoint
|
|
11
|
-
CREATE TABLE `model_profiles` (
|
|
12
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
13
|
-
`label` text NOT NULL,
|
|
14
|
-
`provider` text NOT NULL,
|
|
15
|
-
`model` text NOT NULL,
|
|
16
|
-
`credential_profile_id` text,
|
|
17
|
-
`endpoint` text,
|
|
18
|
-
`capabilities_json` text DEFAULT '{}' NOT NULL,
|
|
19
|
-
`created_at` integer NOT NULL,
|
|
20
|
-
FOREIGN KEY (`credential_profile_id`) REFERENCES `credential_profiles`(`id`) ON UPDATE no action ON DELETE set null
|
|
21
|
-
);
|
|
22
|
-
--> statement-breakpoint
|
|
23
|
-
CREATE INDEX `idx_model_profiles_provider` ON `model_profiles` (`provider`);--> statement-breakpoint
|
|
24
|
-
CREATE TABLE `secrets` (
|
|
25
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
26
|
-
`ciphertext` text NOT NULL,
|
|
27
|
-
`nonce` text NOT NULL,
|
|
28
|
-
`tag` text NOT NULL,
|
|
29
|
-
`created_at` integer NOT NULL
|
|
30
|
-
);
|
|
1
|
+
CREATE TABLE `credential_profiles` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`provider` text NOT NULL,
|
|
4
|
+
`label` text NOT NULL,
|
|
5
|
+
`secret_ref` text NOT NULL,
|
|
6
|
+
`created_at` integer NOT NULL,
|
|
7
|
+
FOREIGN KEY (`secret_ref`) REFERENCES `secrets`(`id`) ON UPDATE no action ON DELETE cascade
|
|
8
|
+
);
|
|
9
|
+
--> statement-breakpoint
|
|
10
|
+
CREATE INDEX `idx_credential_profiles_provider` ON `credential_profiles` (`provider`);--> statement-breakpoint
|
|
11
|
+
CREATE TABLE `model_profiles` (
|
|
12
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
13
|
+
`label` text NOT NULL,
|
|
14
|
+
`provider` text NOT NULL,
|
|
15
|
+
`model` text NOT NULL,
|
|
16
|
+
`credential_profile_id` text,
|
|
17
|
+
`endpoint` text,
|
|
18
|
+
`capabilities_json` text DEFAULT '{}' NOT NULL,
|
|
19
|
+
`created_at` integer NOT NULL,
|
|
20
|
+
FOREIGN KEY (`credential_profile_id`) REFERENCES `credential_profiles`(`id`) ON UPDATE no action ON DELETE set null
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
CREATE INDEX `idx_model_profiles_provider` ON `model_profiles` (`provider`);--> statement-breakpoint
|
|
24
|
+
CREATE TABLE `secrets` (
|
|
25
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
26
|
+
`ciphertext` text NOT NULL,
|
|
27
|
+
`nonce` text NOT NULL,
|
|
28
|
+
`tag` text NOT NULL,
|
|
29
|
+
`created_at` integer NOT NULL
|
|
30
|
+
);
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
CREATE TABLE `file_versions` (
|
|
2
|
-
`scope_key` text NOT NULL,
|
|
3
|
-
`path` text NOT NULL,
|
|
4
|
-
`real_path` text NOT NULL,
|
|
5
|
-
`version_hash` text NOT NULL,
|
|
6
|
-
`size` integer NOT NULL,
|
|
7
|
-
`mtime` integer NOT NULL,
|
|
8
|
-
`updated_at` integer NOT NULL
|
|
9
|
-
);
|
|
10
|
-
--> statement-breakpoint
|
|
11
|
-
CREATE UNIQUE INDEX `file_versions_scope_path` ON `file_versions` (`scope_key`,`path`);--> statement-breakpoint
|
|
12
|
-
CREATE TABLE `resource_events` (
|
|
13
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
14
|
-
`stream_id` text NOT NULL,
|
|
15
|
-
`seq` integer NOT NULL,
|
|
16
|
-
`type` text NOT NULL,
|
|
17
|
-
`payload_json` text NOT NULL,
|
|
18
|
-
`created_at` integer NOT NULL,
|
|
19
|
-
FOREIGN KEY (`stream_id`) REFERENCES `resource_streams`(`stream_id`) ON UPDATE no action ON DELETE no action
|
|
20
|
-
);
|
|
21
|
-
--> statement-breakpoint
|
|
22
|
-
CREATE UNIQUE INDEX `resource_events_stream_seq` ON `resource_events` (`stream_id`,`seq`);--> statement-breakpoint
|
|
23
|
-
CREATE TABLE `resource_operations` (
|
|
24
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
25
|
-
`scope_key` text NOT NULL,
|
|
26
|
-
`root_real_path` text NOT NULL,
|
|
27
|
-
`kind` text NOT NULL,
|
|
28
|
-
`status` text NOT NULL,
|
|
29
|
-
`params_hash` text NOT NULL,
|
|
30
|
-
`idempotency_key` text NOT NULL,
|
|
31
|
-
`client_session_id` text NOT NULL,
|
|
32
|
-
`path` text NOT NULL,
|
|
33
|
-
`expected_version` text NOT NULL,
|
|
34
|
-
`target_version` text NOT NULL,
|
|
35
|
-
`lock_id` text NOT NULL,
|
|
36
|
-
`fencing_token` integer NOT NULL,
|
|
37
|
-
`result_json` text,
|
|
38
|
-
`error_code` text,
|
|
39
|
-
`created_at` integer NOT NULL,
|
|
40
|
-
`updated_at` integer NOT NULL
|
|
41
|
-
);
|
|
42
|
-
--> statement-breakpoint
|
|
43
|
-
CREATE UNIQUE INDEX `resource_operations_client_kind_key` ON `resource_operations` (`client_session_id`,`kind`,`idempotency_key`);--> statement-breakpoint
|
|
44
|
-
CREATE INDEX `resource_operations_status` ON `resource_operations` (`status`);--> statement-breakpoint
|
|
45
|
-
CREATE TABLE `resource_streams` (
|
|
46
|
-
`stream_id` text PRIMARY KEY NOT NULL,
|
|
47
|
-
`last_seq` integer DEFAULT 0 NOT NULL
|
|
48
|
-
);
|
|
49
|
-
--> statement-breakpoint
|
|
50
|
-
ALTER TABLE `resource_locks` ADD `root_real_path` text;
|
|
51
|
-
--> statement-breakpoint
|
|
52
|
-
UPDATE `resource_locks` SET `root_real_path` = (
|
|
53
|
-
SELECT `real_path` FROM `projects` WHERE `projects`.`id` = `resource_locks`.`resource_id`
|
|
54
|
-
) WHERE `resource_type` = 'project';
|
|
1
|
+
CREATE TABLE `file_versions` (
|
|
2
|
+
`scope_key` text NOT NULL,
|
|
3
|
+
`path` text NOT NULL,
|
|
4
|
+
`real_path` text NOT NULL,
|
|
5
|
+
`version_hash` text NOT NULL,
|
|
6
|
+
`size` integer NOT NULL,
|
|
7
|
+
`mtime` integer NOT NULL,
|
|
8
|
+
`updated_at` integer NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE UNIQUE INDEX `file_versions_scope_path` ON `file_versions` (`scope_key`,`path`);--> statement-breakpoint
|
|
12
|
+
CREATE TABLE `resource_events` (
|
|
13
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
14
|
+
`stream_id` text NOT NULL,
|
|
15
|
+
`seq` integer NOT NULL,
|
|
16
|
+
`type` text NOT NULL,
|
|
17
|
+
`payload_json` text NOT NULL,
|
|
18
|
+
`created_at` integer NOT NULL,
|
|
19
|
+
FOREIGN KEY (`stream_id`) REFERENCES `resource_streams`(`stream_id`) ON UPDATE no action ON DELETE no action
|
|
20
|
+
);
|
|
21
|
+
--> statement-breakpoint
|
|
22
|
+
CREATE UNIQUE INDEX `resource_events_stream_seq` ON `resource_events` (`stream_id`,`seq`);--> statement-breakpoint
|
|
23
|
+
CREATE TABLE `resource_operations` (
|
|
24
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
25
|
+
`scope_key` text NOT NULL,
|
|
26
|
+
`root_real_path` text NOT NULL,
|
|
27
|
+
`kind` text NOT NULL,
|
|
28
|
+
`status` text NOT NULL,
|
|
29
|
+
`params_hash` text NOT NULL,
|
|
30
|
+
`idempotency_key` text NOT NULL,
|
|
31
|
+
`client_session_id` text NOT NULL,
|
|
32
|
+
`path` text NOT NULL,
|
|
33
|
+
`expected_version` text NOT NULL,
|
|
34
|
+
`target_version` text NOT NULL,
|
|
35
|
+
`lock_id` text NOT NULL,
|
|
36
|
+
`fencing_token` integer NOT NULL,
|
|
37
|
+
`result_json` text,
|
|
38
|
+
`error_code` text,
|
|
39
|
+
`created_at` integer NOT NULL,
|
|
40
|
+
`updated_at` integer NOT NULL
|
|
41
|
+
);
|
|
42
|
+
--> statement-breakpoint
|
|
43
|
+
CREATE UNIQUE INDEX `resource_operations_client_kind_key` ON `resource_operations` (`client_session_id`,`kind`,`idempotency_key`);--> statement-breakpoint
|
|
44
|
+
CREATE INDEX `resource_operations_status` ON `resource_operations` (`status`);--> statement-breakpoint
|
|
45
|
+
CREATE TABLE `resource_streams` (
|
|
46
|
+
`stream_id` text PRIMARY KEY NOT NULL,
|
|
47
|
+
`last_seq` integer DEFAULT 0 NOT NULL
|
|
48
|
+
);
|
|
49
|
+
--> statement-breakpoint
|
|
50
|
+
ALTER TABLE `resource_locks` ADD `root_real_path` text;
|
|
51
|
+
--> statement-breakpoint
|
|
52
|
+
UPDATE `resource_locks` SET `root_real_path` = (
|
|
53
|
+
SELECT `real_path` FROM `projects` WHERE `projects`.`id` = `resource_locks`.`resource_id`
|
|
54
|
+
) WHERE `resource_type` = 'project';
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
CREATE TABLE `command_executions` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`operation_id` text NOT NULL,
|
|
4
|
-
`project_id` text,
|
|
5
|
-
`workspace_session_id` text,
|
|
6
|
-
`session_id` text NOT NULL,
|
|
7
|
-
`turn_id` text NOT NULL,
|
|
8
|
-
`tool_call_id` text NOT NULL,
|
|
9
|
-
`policy_snapshot_id` text NOT NULL,
|
|
10
|
-
`params_hash` text NOT NULL,
|
|
11
|
-
`status` text NOT NULL,
|
|
12
|
-
`exit_code` integer,
|
|
13
|
-
`reason_code` text,
|
|
14
|
-
`truncated` integer DEFAULT false NOT NULL,
|
|
15
|
-
`process_identity_json` text,
|
|
16
|
-
`output_cursor` integer DEFAULT 0 NOT NULL,
|
|
17
|
-
`created_at` integer NOT NULL,
|
|
18
|
-
`started_at` integer,
|
|
19
|
-
`ended_at` integer,
|
|
20
|
-
FOREIGN KEY (`operation_id`) REFERENCES `resource_operations`(`id`) ON UPDATE no action ON DELETE no action
|
|
21
|
-
);
|
|
22
|
-
--> statement-breakpoint
|
|
23
|
-
CREATE UNIQUE INDEX `command_executions_operation` ON `command_executions` (`operation_id`);--> statement-breakpoint
|
|
1
|
+
CREATE TABLE `command_executions` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`operation_id` text NOT NULL,
|
|
4
|
+
`project_id` text,
|
|
5
|
+
`workspace_session_id` text,
|
|
6
|
+
`session_id` text NOT NULL,
|
|
7
|
+
`turn_id` text NOT NULL,
|
|
8
|
+
`tool_call_id` text NOT NULL,
|
|
9
|
+
`policy_snapshot_id` text NOT NULL,
|
|
10
|
+
`params_hash` text NOT NULL,
|
|
11
|
+
`status` text NOT NULL,
|
|
12
|
+
`exit_code` integer,
|
|
13
|
+
`reason_code` text,
|
|
14
|
+
`truncated` integer DEFAULT false NOT NULL,
|
|
15
|
+
`process_identity_json` text,
|
|
16
|
+
`output_cursor` integer DEFAULT 0 NOT NULL,
|
|
17
|
+
`created_at` integer NOT NULL,
|
|
18
|
+
`started_at` integer,
|
|
19
|
+
`ended_at` integer,
|
|
20
|
+
FOREIGN KEY (`operation_id`) REFERENCES `resource_operations`(`id`) ON UPDATE no action ON DELETE no action
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
CREATE UNIQUE INDEX `command_executions_operation` ON `command_executions` (`operation_id`);--> statement-breakpoint
|
|
24
24
|
CREATE INDEX `command_executions_status` ON `command_executions` (`status`);
|