@unson/brainbase-mcp 0.46.1 → 0.47.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.
@@ -50,6 +50,33 @@ ALTER TABLE canonical_tasks
50
50
  OR jsonb_typeof(completion_contract) = 'object'
51
51
  );
52
52
 
53
+ -- botキューがTaskをclaimしているagent member ID。未claimはNULL。
54
+ ALTER TABLE canonical_tasks
55
+ ADD COLUMN IF NOT EXISTS claimed_by TEXT;
56
+
57
+ -- claimのリース期限。claimed_until < now() は期限切れ。
58
+ ALTER TABLE canonical_tasks
59
+ ADD COLUMN IF NOT EXISTS claimed_until TIMESTAMPTZ;
60
+
61
+ -- 保存statusの詳細。started / waiting_for_review / blocked 以外はNULL。
62
+ ALTER TABLE canonical_tasks
63
+ ADD COLUMN IF NOT EXISTS status_detail TEXT;
64
+
65
+ ALTER TABLE canonical_tasks
66
+ DROP CONSTRAINT IF EXISTS canonical_tasks_status_detail_check;
67
+ ALTER TABLE canonical_tasks
68
+ ADD CONSTRAINT canonical_tasks_status_detail_check
69
+ CHECK (
70
+ status_detail IS NULL
71
+ OR status_detail IN ('started', 'waiting_for_review', 'blocked')
72
+ );
73
+
74
+ ALTER TABLE canonical_tasks
75
+ DROP CONSTRAINT IF EXISTS canonical_tasks_claim_pair_check;
76
+ ALTER TABLE canonical_tasks
77
+ ADD CONSTRAINT canonical_tasks_claim_pair_check
78
+ CHECK ((claimed_by IS NULL) = (claimed_until IS NULL));
79
+
53
80
  ALTER TABLE canonical_tasks
54
81
  DROP CONSTRAINT IF EXISTS canonical_tasks_purpose_label_check;
55
82
  ALTER TABLE canonical_tasks
@@ -75,3 +102,5 @@ CREATE INDEX IF NOT EXISTS canonical_tasks_assignee_due_idx
75
102
  ON canonical_tasks (assignee_person_id, due_at);
76
103
  CREATE INDEX IF NOT EXISTS canonical_tasks_project_codes_idx
77
104
  ON canonical_tasks USING GIN (project_codes);
105
+ CREATE INDEX IF NOT EXISTS canonical_tasks_claimed_by_until_idx
106
+ ON canonical_tasks (claimed_by, claimed_until) WHERE claimed_by IS NOT NULL;