@zonease/aiworker-cli 0.12.2 → 0.13.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.
Files changed (117) hide show
  1. package/README.md +158 -350
  2. package/aiworker-bun.js +614 -694
  3. package/drizzle/worker/0000_polite_stellaris.sql +219 -0
  4. package/drizzle/worker/0001_red_lady_mastermind.sql +29 -0
  5. package/drizzle/worker/0002_concerned_slyde.sql +45 -0
  6. package/drizzle/worker/meta/0000_snapshot.json +1055 -194
  7. package/drizzle/worker/meta/0001_snapshot.json +1244 -222
  8. package/drizzle/worker/meta/0002_snapshot.json +1557 -273
  9. package/drizzle/worker/meta/_journal.json +6 -48
  10. package/official-apps/aiworker-hr/README.md +16 -0
  11. package/official-apps/aiworker-hr/capabilities/candidate-screen/prompt.md +3 -0
  12. package/official-apps/aiworker-hr/capabilities/candidate-screen/review.md +5 -0
  13. package/official-apps/aiworker-hr/capabilities/person-profile/prompt.md +3 -0
  14. package/official-apps/aiworker-hr/capabilities/person-profile/review.md +5 -0
  15. package/official-apps/aiworker-hr/dist/host-mounted.js +15677 -0
  16. package/official-apps/aiworker-hr/dist/index.js +15411 -0
  17. package/official-apps/aiworker-hr/dist/standalone.js +15451 -0
  18. package/official-apps/aiworker-hr/migrations/0001_hr.sql +2 -0
  19. package/official-apps/aiworker-hr/package.json +31 -0
  20. package/official-apps/aiworker-hr/packs/hr-recruiting/SOUL.md +7 -0
  21. package/official-apps/aiworker-hr/review/candidate-screen.md +5 -0
  22. package/official-apps/aiworker-hr/review/person-profile.md +5 -0
  23. package/official-apps/aiworker-hr/schemas/candidate-screen.schema.json +50 -0
  24. package/official-apps/aiworker-hr/schemas/person-profile.schema.json +50 -0
  25. package/official-apps/aiworker-hr/soul-app.manifest.json +374 -0
  26. package/official-apps/aiworker-hr/src/api.ts +1 -0
  27. package/official-apps/aiworker-hr/src/host-mounted.ts +308 -0
  28. package/official-apps/aiworker-hr/src/index.ts +152 -0
  29. package/official-apps/aiworker-hr/src/protocol/artifact.ts +2 -0
  30. package/official-apps/aiworker-hr/src/protocol/connectors.ts +2 -0
  31. package/official-apps/aiworker-hr/src/protocol/lifecycle.ts +2 -0
  32. package/official-apps/aiworker-hr/src/protocol/review.ts +2 -0
  33. package/official-apps/aiworker-hr/src/protocol/runtime.ts +2 -0
  34. package/official-apps/aiworker-hr/src/protocol/ui.ts +2 -0
  35. package/official-apps/aiworker-hr/src/standalone.ts +43 -0
  36. package/official-apps/aiworker-hr/src/ui/candidate-screen-preview.tsx +2 -0
  37. package/official-apps/aiworker-hr/src/ui/hr-route.tsx +1 -0
  38. package/official-apps/aiworker-hr/src/ui/people-widget.tsx +1 -0
  39. package/official-apps/aiworker-hr/src/ui/person-profile-preview.tsx +2 -0
  40. package/official-apps/aiworker-hr/src/ui/profile-panel.tsx +1 -0
  41. package/official-apps/aiworker-hr/src/ui/review-panel.tsx +1 -0
  42. package/official-apps/aiworker-hr/tsconfig.json +20 -0
  43. package/official-apps/aiworker-qa/README.md +14 -0
  44. package/official-apps/aiworker-qa/capabilities/regression-matrix/prompt.md +3 -0
  45. package/official-apps/aiworker-qa/capabilities/regression-matrix/review.md +5 -0
  46. package/official-apps/aiworker-qa/capabilities/release-gate/prompt.md +3 -0
  47. package/official-apps/aiworker-qa/capabilities/release-gate/review.md +5 -0
  48. package/official-apps/aiworker-qa/dist/host-mounted.js +15655 -0
  49. package/official-apps/aiworker-qa/dist/index.js +15395 -0
  50. package/official-apps/aiworker-qa/dist/standalone.js +15435 -0
  51. package/official-apps/aiworker-qa/migrations/0001_qa.sql +2 -0
  52. package/official-apps/aiworker-qa/package.json +31 -0
  53. package/official-apps/aiworker-qa/packs/qa-reviewer/SOUL.md +7 -0
  54. package/official-apps/aiworker-qa/review/regression-matrix.md +5 -0
  55. package/official-apps/aiworker-qa/review/release-gate.md +5 -0
  56. package/official-apps/aiworker-qa/schemas/regression-matrix.schema.json +50 -0
  57. package/official-apps/aiworker-qa/schemas/release-gate.schema.json +50 -0
  58. package/official-apps/aiworker-qa/soul-app.manifest.json +356 -0
  59. package/official-apps/aiworker-qa/src/api.ts +1 -0
  60. package/official-apps/aiworker-qa/src/host-mounted.ts +302 -0
  61. package/official-apps/aiworker-qa/src/index.ts +152 -0
  62. package/official-apps/aiworker-qa/src/protocol/artifact.ts +2 -0
  63. package/official-apps/aiworker-qa/src/protocol/connectors.ts +2 -0
  64. package/official-apps/aiworker-qa/src/protocol/lifecycle.ts +2 -0
  65. package/official-apps/aiworker-qa/src/protocol/review.ts +2 -0
  66. package/official-apps/aiworker-qa/src/protocol/runtime.ts +2 -0
  67. package/official-apps/aiworker-qa/src/protocol/ui.ts +2 -0
  68. package/official-apps/aiworker-qa/src/standalone.ts +43 -0
  69. package/official-apps/aiworker-qa/src/ui/qa-route.tsx +1 -0
  70. package/official-apps/aiworker-qa/src/ui/regression-matrix-preview.tsx +2 -0
  71. package/official-apps/aiworker-qa/src/ui/release-gate-preview.tsx +2 -0
  72. package/official-apps/aiworker-qa/src/ui/release-panel.tsx +1 -0
  73. package/official-apps/aiworker-qa/src/ui/release-review-panel.tsx +1 -0
  74. package/official-apps/aiworker-qa/src/ui/release-widget.tsx +1 -0
  75. package/official-apps/aiworker-qa/src/ui/review-panel.tsx +1 -0
  76. package/official-apps/aiworker-qa/tsconfig.json +20 -0
  77. package/package.json +5 -4
  78. package/web/worker/assets/index-K-y56wrL.css +2 -0
  79. package/web/worker/assets/index-YNnnk64n.js +18 -0
  80. package/web/worker/assets/markdown-preview-DFe-rfff.js +29 -0
  81. package/web/worker/assets/people-workbench-BzWwSc2I.js +1 -0
  82. package/web/worker/engine-icons/claude.svg +1 -0
  83. package/web/worker/engine-icons/cursor.svg +1 -0
  84. package/web/worker/engine-icons/gemini.svg +1 -0
  85. package/web/worker/engine-icons/hermesagent.svg +1 -0
  86. package/web/worker/engine-icons/openai.svg +1 -0
  87. package/web/worker/engine-icons/opencode.svg +1 -0
  88. package/web/worker/engine-icons/qwen.svg +1 -0
  89. package/web/worker/fonts/inter-latin-wght-normal.woff2 +0 -0
  90. package/web/worker/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  91. package/web/worker/fonts/nunito-latin-wght-normal.woff2 +0 -0
  92. package/web/worker/index.html +8 -4
  93. package/web/worker/logo.svg +8 -0
  94. package/drizzle/fleet/0000_fine_havok.sql +0 -23
  95. package/drizzle/fleet/meta/0000_snapshot.json +0 -165
  96. package/drizzle/fleet/meta/_journal.json +0 -13
  97. package/drizzle/worker/0000_spooky_kat_farrell.sql +0 -112
  98. package/drizzle/worker/0001_secret_dagger.sql +0 -1
  99. package/drizzle/worker/0002_jazzy_moondragon.sql +0 -13
  100. package/drizzle/worker/0003_rare_cloak.sql +0 -7
  101. package/drizzle/worker/0004_daffy_thing.sql +0 -26
  102. package/drizzle/worker/0005_worthless_whiplash.sql +0 -20
  103. package/drizzle/worker/0006_fair_jetstream.sql +0 -34
  104. package/drizzle/worker/0007_solid_bromley.sql +0 -11
  105. package/drizzle/worker/0008_peaceful_titanium_man.sql +0 -14
  106. package/drizzle/worker/meta/0003_snapshot.json +0 -873
  107. package/drizzle/worker/meta/0004_snapshot.json +0 -1058
  108. package/drizzle/worker/meta/0005_snapshot.json +0 -1192
  109. package/drizzle/worker/meta/0006_snapshot.json +0 -1420
  110. package/drizzle/worker/meta/0007_snapshot.json +0 -1489
  111. package/drizzle/worker/meta/0008_snapshot.json +0 -1593
  112. package/web/fleet/assets/index-BTknRPEg.js +0 -1372
  113. package/web/fleet/assets/index-lu-9OhC0.css +0 -2
  114. package/web/fleet/favicon.svg +0 -4
  115. package/web/fleet/index.html +0 -14
  116. package/web/worker/assets/index-DuxsPbd7.js +0 -1382
  117. package/web/worker/assets/index-lu-9OhC0.css +0 -2
@@ -0,0 +1,219 @@
1
+ CREATE TABLE `artifacts` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `workspace_id` text NOT NULL,
4
+ `session_id` text,
5
+ `turn_id` text,
6
+ `invocation_id` text,
7
+ `path` text NOT NULL,
8
+ `kind` text DEFAULT 'file' NOT NULL,
9
+ `title` text NOT NULL,
10
+ `status` text DEFAULT 'available' NOT NULL,
11
+ `metadata_json` text NOT NULL,
12
+ `created_at` text NOT NULL,
13
+ `updated_at` text NOT NULL,
14
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
15
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
16
+ FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE set null,
17
+ FOREIGN KEY (`invocation_id`) REFERENCES `engine_invocations`(`id`) ON UPDATE no action ON DELETE set null
18
+ );
19
+ --> statement-breakpoint
20
+ CREATE INDEX `artifacts_session_updated_at_idx` ON `artifacts` (`session_id`,`updated_at`);--> statement-breakpoint
21
+ CREATE INDEX `artifacts_status_updated_at_idx` ON `artifacts` (`status`,`updated_at`);--> statement-breakpoint
22
+ CREATE INDEX `artifacts_workspace_updated_at_idx` ON `artifacts` (`workspace_id`,`updated_at`);--> statement-breakpoint
23
+ CREATE TABLE `engine_invocations` (
24
+ `id` text PRIMARY KEY NOT NULL,
25
+ `session_id` text NOT NULL,
26
+ `turn_id` text NOT NULL,
27
+ `seq` integer NOT NULL,
28
+ `engine_id` text NOT NULL,
29
+ `engine_command` text,
30
+ `status` text DEFAULT 'queued' NOT NULL,
31
+ `prompt` text NOT NULL,
32
+ `summary` text,
33
+ `error` text,
34
+ `metadata_json` text NOT NULL,
35
+ `started_at` text,
36
+ `finished_at` text,
37
+ `created_at` text NOT NULL,
38
+ `updated_at` text NOT NULL,
39
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
40
+ FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE cascade
41
+ );
42
+ --> statement-breakpoint
43
+ CREATE INDEX `engine_invocations_engine_updated_at_idx` ON `engine_invocations` (`engine_id`,`updated_at`);--> statement-breakpoint
44
+ CREATE INDEX `engine_invocations_session_seq_idx` ON `engine_invocations` (`session_id`,`seq`);--> statement-breakpoint
45
+ CREATE INDEX `engine_invocations_status_updated_at_idx` ON `engine_invocations` (`status`,`updated_at`);--> statement-breakpoint
46
+ CREATE INDEX `engine_invocations_turn_idx` ON `engine_invocations` (`turn_id`);--> statement-breakpoint
47
+ CREATE TABLE `files` (
48
+ `id` text PRIMARY KEY NOT NULL,
49
+ `workspace_id` text NOT NULL,
50
+ `path` text NOT NULL,
51
+ `kind` text DEFAULT 'file' NOT NULL,
52
+ `size` integer,
53
+ `mtime` integer,
54
+ `hash` text,
55
+ `source` text DEFAULT 'user' NOT NULL,
56
+ `created_at` text NOT NULL,
57
+ `updated_at` text NOT NULL,
58
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade
59
+ );
60
+ --> statement-breakpoint
61
+ CREATE INDEX `files_kind_idx` ON `files` (`kind`);--> statement-breakpoint
62
+ CREATE UNIQUE INDEX `files_workspace_path_idx` ON `files` (`workspace_id`,`path`);--> statement-breakpoint
63
+ CREATE INDEX `files_workspace_updated_at_idx` ON `files` (`workspace_id`,`updated_at`);--> statement-breakpoint
64
+ CREATE TABLE `lessons` (
65
+ `id` text PRIMARY KEY NOT NULL,
66
+ `workspace_id` text NOT NULL,
67
+ `source_review_id` text,
68
+ `statement` text NOT NULL,
69
+ `evidence_json` text NOT NULL,
70
+ `status` text DEFAULT 'proposed' NOT NULL,
71
+ `created_at` text NOT NULL,
72
+ `updated_at` text NOT NULL,
73
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
74
+ FOREIGN KEY (`source_review_id`) REFERENCES `reviews`(`id`) ON UPDATE no action ON DELETE set null
75
+ );
76
+ --> statement-breakpoint
77
+ CREATE INDEX `lessons_status_updated_at_idx` ON `lessons` (`status`,`updated_at`);--> statement-breakpoint
78
+ CREATE INDEX `lessons_workspace_updated_at_idx` ON `lessons` (`workspace_id`,`updated_at`);--> statement-breakpoint
79
+ CREATE TABLE `reviews` (
80
+ `id` text PRIMARY KEY NOT NULL,
81
+ `workspace_id` text NOT NULL,
82
+ `session_id` text,
83
+ `turn_id` text,
84
+ `artifact_id` text,
85
+ `verdict` text DEFAULT 'needs_review' NOT NULL,
86
+ `findings_json` text NOT NULL,
87
+ `risks_json` text NOT NULL,
88
+ `created_at` text NOT NULL,
89
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
90
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null,
91
+ FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE set null,
92
+ FOREIGN KEY (`artifact_id`) REFERENCES `artifacts`(`id`) ON UPDATE no action ON DELETE set null
93
+ );
94
+ --> statement-breakpoint
95
+ CREATE INDEX `reviews_artifact_created_at_idx` ON `reviews` (`artifact_id`,`created_at`);--> statement-breakpoint
96
+ CREATE INDEX `reviews_session_created_at_idx` ON `reviews` (`session_id`,`created_at`);--> statement-breakpoint
97
+ CREATE INDEX `reviews_workspace_created_at_idx` ON `reviews` (`workspace_id`,`created_at`);--> statement-breakpoint
98
+ CREATE TABLE `session_events` (
99
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
100
+ `session_id` text NOT NULL,
101
+ `turn_id` text,
102
+ `invocation_id` text,
103
+ `seq` integer NOT NULL,
104
+ `type` text NOT NULL,
105
+ `payload_json` text NOT NULL,
106
+ `created_at` text NOT NULL,
107
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
108
+ FOREIGN KEY (`turn_id`) REFERENCES `turns`(`id`) ON UPDATE no action ON DELETE set null,
109
+ FOREIGN KEY (`invocation_id`) REFERENCES `engine_invocations`(`id`) ON UPDATE no action ON DELETE set null
110
+ );
111
+ --> statement-breakpoint
112
+ CREATE INDEX `session_events_session_created_at_idx` ON `session_events` (`session_id`,`created_at`);--> statement-breakpoint
113
+ CREATE INDEX `session_events_session_seq_idx` ON `session_events` (`session_id`,`seq`);--> statement-breakpoint
114
+ CREATE UNIQUE INDEX `session_events_session_seq_unique_idx` ON `session_events` (`session_id`,`seq`);--> statement-breakpoint
115
+ CREATE TABLE `sessions` (
116
+ `id` text PRIMARY KEY NOT NULL,
117
+ `worker_id` text NOT NULL,
118
+ `workspace_id` text NOT NULL,
119
+ `capability_template_id` text NOT NULL,
120
+ `title` text NOT NULL,
121
+ `context` text DEFAULT '' NOT NULL,
122
+ `status` text DEFAULT 'active' NOT NULL,
123
+ `metadata_json` text NOT NULL,
124
+ `started_at` text,
125
+ `ended_at` text,
126
+ `created_at` text NOT NULL,
127
+ `updated_at` text NOT NULL,
128
+ FOREIGN KEY (`worker_id`) REFERENCES `workers`(`id`) ON UPDATE no action ON DELETE cascade,
129
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade
130
+ );
131
+ --> statement-breakpoint
132
+ CREATE INDEX `sessions_capability_updated_at_idx` ON `sessions` (`capability_template_id`,`updated_at`);--> statement-breakpoint
133
+ CREATE INDEX `sessions_status_updated_at_idx` ON `sessions` (`status`,`updated_at`);--> statement-breakpoint
134
+ CREATE INDEX `sessions_worker_updated_at_idx` ON `sessions` (`worker_id`,`updated_at`);--> statement-breakpoint
135
+ CREATE INDEX `sessions_workspace_updated_at_idx` ON `sessions` (`workspace_id`,`updated_at`);--> statement-breakpoint
136
+ CREATE TABLE `settings` (
137
+ `key` text PRIMARY KEY NOT NULL,
138
+ `value_json` text NOT NULL,
139
+ `updated_at` text NOT NULL
140
+ );
141
+ --> statement-breakpoint
142
+ CREATE TABLE `turns` (
143
+ `id` text PRIMARY KEY NOT NULL,
144
+ `session_id` text NOT NULL,
145
+ `seq` integer NOT NULL,
146
+ `input` text NOT NULL,
147
+ `response` text,
148
+ `status` text DEFAULT 'queued' NOT NULL,
149
+ `error` text,
150
+ `metadata_json` text NOT NULL,
151
+ `created_at` text NOT NULL,
152
+ `updated_at` text NOT NULL,
153
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
154
+ );
155
+ --> statement-breakpoint
156
+ CREATE INDEX `turns_session_seq_idx` ON `turns` (`session_id`,`seq`);--> statement-breakpoint
157
+ CREATE UNIQUE INDEX `turns_session_seq_unique_idx` ON `turns` (`session_id`,`seq`);--> statement-breakpoint
158
+ CREATE INDEX `turns_status_updated_at_idx` ON `turns` (`status`,`updated_at`);--> statement-breakpoint
159
+ CREATE TABLE `worker_config` (
160
+ `pk` text PRIMARY KEY DEFAULT 'default' NOT NULL,
161
+ `config_json` text NOT NULL,
162
+ `version` integer DEFAULT 1 NOT NULL,
163
+ `updated_at` text NOT NULL,
164
+ `updated_by` text
165
+ );
166
+ --> statement-breakpoint
167
+ CREATE TABLE `worker_identity` (
168
+ `pk` text PRIMARY KEY DEFAULT 'default' NOT NULL,
169
+ `worker_id` text NOT NULL,
170
+ `api_token_enc` text NOT NULL,
171
+ `nonce` text NOT NULL,
172
+ `auth_tag` text NOT NULL,
173
+ `bootstrap_shown_at` text NOT NULL,
174
+ `created_at` text NOT NULL,
175
+ `rotated_at` text
176
+ );
177
+ --> statement-breakpoint
178
+ CREATE UNIQUE INDEX `worker_identity_worker_id_unique` ON `worker_identity` (`worker_id`);--> statement-breakpoint
179
+ CREATE TABLE `worker_secrets` (
180
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
181
+ `key` text NOT NULL,
182
+ `value_enc` text NOT NULL,
183
+ `nonce` text NOT NULL,
184
+ `auth_tag` text NOT NULL,
185
+ `created_at` text NOT NULL,
186
+ `updated_at` text NOT NULL
187
+ );
188
+ --> statement-breakpoint
189
+ CREATE UNIQUE INDEX `worker_secrets_key_unique` ON `worker_secrets` (`key`);--> statement-breakpoint
190
+ CREATE TABLE `workers` (
191
+ `id` text PRIMARY KEY NOT NULL,
192
+ `soul_id` text NOT NULL,
193
+ `name` text NOT NULL,
194
+ `status` text DEFAULT 'active' NOT NULL,
195
+ `default_engine_id` text,
196
+ `metadata_json` text NOT NULL,
197
+ `created_at` text NOT NULL,
198
+ `updated_at` text NOT NULL
199
+ );
200
+ --> statement-breakpoint
201
+ CREATE INDEX `workers_soul_idx` ON `workers` (`soul_id`);--> statement-breakpoint
202
+ CREATE INDEX `workers_status_updated_at_idx` ON `workers` (`status`,`updated_at`);--> statement-breakpoint
203
+ CREATE TABLE `workspaces` (
204
+ `id` text PRIMARY KEY NOT NULL,
205
+ `worker_id` text NOT NULL,
206
+ `name` text NOT NULL,
207
+ `root_path` text NOT NULL,
208
+ `type` text DEFAULT 'workspace' NOT NULL,
209
+ `status` text DEFAULT 'active' NOT NULL,
210
+ `source_pointers_json` text NOT NULL,
211
+ `metadata_json` text NOT NULL,
212
+ `created_at` text NOT NULL,
213
+ `updated_at` text NOT NULL,
214
+ FOREIGN KEY (`worker_id`) REFERENCES `workers`(`id`) ON UPDATE no action ON DELETE cascade
215
+ );
216
+ --> statement-breakpoint
217
+ CREATE UNIQUE INDEX `workspaces_root_path_idx` ON `workspaces` (`root_path`);--> statement-breakpoint
218
+ CREATE INDEX `workspaces_status_updated_at_idx` ON `workspaces` (`status`,`updated_at`);--> statement-breakpoint
219
+ CREATE INDEX `workspaces_worker_updated_at_idx` ON `workspaces` (`worker_id`,`updated_at`);
@@ -0,0 +1,29 @@
1
+ CREATE TABLE `soul_apps` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `name` text NOT NULL,
4
+ `version` text NOT NULL,
5
+ `protocol` text NOT NULL,
6
+ `soul_id` text NOT NULL,
7
+ `status` text DEFAULT 'installed' NOT NULL,
8
+ `source_kind` text NOT NULL,
9
+ `source_ref` text NOT NULL,
10
+ `manifest_digest` text NOT NULL,
11
+ `manifest_json` text NOT NULL,
12
+ `validation_issues_json` text NOT NULL,
13
+ `health_status` text DEFAULT 'unknown' NOT NULL,
14
+ `health_message` text,
15
+ `installed_at` text NOT NULL,
16
+ `enabled_at` text,
17
+ `disabled_at` text,
18
+ `last_healthcheck_at` text,
19
+ `created_at` text NOT NULL,
20
+ `updated_at` text NOT NULL
21
+ );
22
+ --> statement-breakpoint
23
+ CREATE INDEX `soul_apps_manifest_digest_idx` ON `soul_apps` (`manifest_digest`);--> statement-breakpoint
24
+ CREATE INDEX `soul_apps_soul_idx` ON `soul_apps` (`soul_id`);--> statement-breakpoint
25
+ CREATE INDEX `soul_apps_status_updated_at_idx` ON `soul_apps` (`status`,`updated_at`);--> statement-breakpoint
26
+ DROP INDEX `files_workspace_path_idx`;--> statement-breakpoint
27
+ CREATE UNIQUE INDEX `files_workspace_path_idx` ON `files` (`workspace_id`,`path`);--> statement-breakpoint
28
+ DROP INDEX `workers_soul_idx`;--> statement-breakpoint
29
+ CREATE INDEX `workers_soul_idx` ON `workers` (`soul_id`);
@@ -0,0 +1,45 @@
1
+ CREATE TABLE `soul_app_audit_events` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `app_id` text NOT NULL,
4
+ `action` text NOT NULL,
5
+ `target_kind` text NOT NULL,
6
+ `target` text NOT NULL,
7
+ `decision` text NOT NULL,
8
+ `reason` text NOT NULL,
9
+ `worker_id` text,
10
+ `workspace_id` text,
11
+ `session_id` text,
12
+ `operator_id` text,
13
+ `request_json` text NOT NULL,
14
+ `created_at` text NOT NULL,
15
+ FOREIGN KEY (`app_id`) REFERENCES `soul_apps`(`id`) ON UPDATE no action ON DELETE cascade,
16
+ FOREIGN KEY (`worker_id`) REFERENCES `workers`(`id`) ON UPDATE no action ON DELETE set null,
17
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE set null,
18
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null
19
+ );
20
+ --> statement-breakpoint
21
+ CREATE INDEX `soul_app_audit_app_created_at_idx` ON `soul_app_audit_events` (`app_id`,`created_at`);--> statement-breakpoint
22
+ CREATE INDEX `soul_app_audit_context_idx` ON `soul_app_audit_events` (`workspace_id`,`session_id`);--> statement-breakpoint
23
+ CREATE INDEX `soul_app_audit_target_idx` ON `soul_app_audit_events` (`target_kind`,`target`);--> statement-breakpoint
24
+ CREATE TABLE `soul_app_storage_records` (
25
+ `id` text PRIMARY KEY NOT NULL,
26
+ `app_id` text NOT NULL,
27
+ `namespace` text NOT NULL,
28
+ `key` text NOT NULL,
29
+ `value_json` text NOT NULL,
30
+ `worker_id` text,
31
+ `workspace_id` text,
32
+ `session_id` text,
33
+ `operator_id` text,
34
+ `created_at` text NOT NULL,
35
+ `updated_at` text NOT NULL,
36
+ FOREIGN KEY (`app_id`) REFERENCES `soul_apps`(`id`) ON UPDATE no action ON DELETE cascade,
37
+ FOREIGN KEY (`worker_id`) REFERENCES `workers`(`id`) ON UPDATE no action ON DELETE set null,
38
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE set null,
39
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null
40
+ );
41
+ --> statement-breakpoint
42
+ CREATE UNIQUE INDEX `soul_app_storage_app_key_idx` ON `soul_app_storage_records` (`app_id`,`key`);--> statement-breakpoint
43
+ CREATE INDEX `soul_app_storage_app_updated_at_idx` ON `soul_app_storage_records` (`app_id`,`updated_at`);--> statement-breakpoint
44
+ CREATE INDEX `soul_app_storage_namespace_idx` ON `soul_app_storage_records` (`namespace`);--> statement-breakpoint
45
+ CREATE INDEX `soul_app_storage_workspace_idx` ON `soul_app_storage_records` (`workspace_id`);