@igorjpimenta/winch 2026.11.22-beta.3 → 2026.11.23-beta.2

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.
@@ -0,0 +1,2 @@
1
+ ALTER TABLE `dispatch_deliveries` RENAME TO `webhook_deliveries`;--> statement-breakpoint
2
+ ALTER TABLE `dispatch_delivery_attempts` RENAME TO `webhook_delivery_attempts`;
@@ -0,0 +1,30 @@
1
+ CREATE TABLE `usage_events` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `item_id` text NOT NULL,
4
+ `session_id` text,
5
+ `attempt_id` text,
6
+ `harness` text NOT NULL,
7
+ `agent_id` text NOT NULL,
8
+ `external_session_id` text NOT NULL,
9
+ `model` text,
10
+ `tokens_in` integer,
11
+ `tokens_out` integer,
12
+ `cache_read` integer,
13
+ `cost_usd` real,
14
+ `tool_calls` integer,
15
+ `source` text DEFAULT 'api' NOT NULL,
16
+ `turn_ref` text,
17
+ `created_at` integer NOT NULL,
18
+ FOREIGN KEY (`item_id`) REFERENCES `items`(`id`) ON UPDATE no action ON DELETE restrict,
19
+ FOREIGN KEY (`session_id`) REFERENCES `work_sessions`(`id`) ON UPDATE no action ON DELETE set null,
20
+ FOREIGN KEY (`attempt_id`) REFERENCES `attempts`(`id`) ON UPDATE no action ON DELETE set null,
21
+ CONSTRAINT "usage_source" CHECK("usage_events"."source" IN ('api')),
22
+ CONSTRAINT "usage_nonneg" CHECK(("usage_events"."tokens_in" IS NULL OR "usage_events"."tokens_in" >= 0) AND ("usage_events"."tokens_out" IS NULL OR "usage_events"."tokens_out" >= 0) AND ("usage_events"."cache_read" IS NULL OR "usage_events"."cache_read" >= 0) AND ("usage_events"."cost_usd" IS NULL OR "usage_events"."cost_usd" >= 0) AND ("usage_events"."tool_calls" IS NULL OR "usage_events"."tool_calls" >= 0))
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE INDEX `idx_usage_item` ON `usage_events` (`item_id`);--> statement-breakpoint
26
+ CREATE INDEX `idx_usage_session` ON `usage_events` (`session_id`);--> statement-breakpoint
27
+ CREATE INDEX `idx_usage_attempt` ON `usage_events` (`attempt_id`);--> statement-breakpoint
28
+ CREATE INDEX `idx_usage_created` ON `usage_events` (`created_at`);--> statement-breakpoint
29
+ CREATE INDEX `idx_usage_identity` ON `usage_events` (`harness`,`agent_id`,`external_session_id`);--> statement-breakpoint
30
+ CREATE UNIQUE INDEX `uq_usage_turn` ON `usage_events` (`harness`,`agent_id`,`external_session_id`,`turn_ref`) WHERE "usage_events"."turn_ref" IS NOT NULL;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "6",
3
3
  "dialect": "sqlite",
4
- "id": "87814314-95fb-4521-9988-42fce3b9ead4",
4
+ "id": "75303db3-17f1-4026-9ccb-d4e28d3909da",
5
5
  "prevId": "28f4b593-644f-4990-a26d-f8011defb590",
6
6
  "tables": {
7
7
  "admission_attempts": {
@@ -1897,4 +1897,4 @@
1897
1897
  "internal": {
1898
1898
  "indexes": {}
1899
1899
  }
1900
- }
1900
+ }