@crewx/sdk 0.9.0-rc.0 → 0.9.0-rc.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.
@@ -1,5 +1,5 @@
1
1
  PRAGMA foreign_keys=OFF;--> statement-breakpoint
2
- CREATE TABLE `__new_tool_calls` (
2
+ CREATE TABLE IF NOT EXISTS `__new_tool_calls` (
3
3
  `id` text PRIMARY KEY NOT NULL,
4
4
  `task_id` text,
5
5
  `session_id` text,
@@ -16,6 +16,6 @@ INSERT INTO `__new_tool_calls`("id", "task_id", "session_id", "tool_name", "file
16
16
  DROP TABLE `tool_calls`;--> statement-breakpoint
17
17
  ALTER TABLE `__new_tool_calls` RENAME TO `tool_calls`;--> statement-breakpoint
18
18
  PRAGMA foreign_keys=ON;--> statement-breakpoint
19
- CREATE INDEX `idx_tool_calls_task_id` ON `tool_calls` (`task_id`);--> statement-breakpoint
20
- CREATE INDEX `idx_tool_calls_tool_name` ON `tool_calls` (`tool_name`);--> statement-breakpoint
21
- CREATE INDEX `idx_tool_calls_timestamp` ON `tool_calls` (`timestamp`);
19
+ CREATE INDEX IF NOT EXISTS `idx_tool_calls_task_id` ON `tool_calls` (`task_id`);--> statement-breakpoint
20
+ CREATE INDEX IF NOT EXISTS `idx_tool_calls_tool_name` ON `tool_calls` (`tool_name`);--> statement-breakpoint
21
+ CREATE INDEX IF NOT EXISTS `idx_tool_calls_timestamp` ON `tool_calls` (`timestamp`);
@@ -0,0 +1,17 @@
1
+ CREATE TABLE IF NOT EXISTS `usage_limit_snapshots` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `provider` text NOT NULL,
4
+ `account_ref` text DEFAULT 'default' NOT NULL,
5
+ `limit_window` text NOT NULL,
6
+ `bucket_start` text NOT NULL,
7
+ `captured_at` text NOT NULL,
8
+ `used_percent` integer NOT NULL,
9
+ `remaining_percent` integer NOT NULL,
10
+ `resets_at` text,
11
+ `source` text NOT NULL,
12
+ `metadata` text
13
+ );
14
+ --> statement-breakpoint
15
+ CREATE UNIQUE INDEX IF NOT EXISTS `uniq_usage_limit_snapshots_bucket` ON `usage_limit_snapshots` (`provider`,`account_ref`,`limit_window`,`bucket_start`);--> statement-breakpoint
16
+ CREATE INDEX IF NOT EXISTS `idx_usage_limit_snapshots_window_bucket` ON `usage_limit_snapshots` (`limit_window`,`bucket_start`);--> statement-breakpoint
17
+ CREATE INDEX IF NOT EXISTS `idx_usage_limit_snapshots_provider_window_bucket` ON `usage_limit_snapshots` (`provider`,`limit_window`,`bucket_start`);