@adhdev/daemon-core 0.9.82-rc.209 → 0.9.82-rc.210

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 (64) hide show
  1. package/dist/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +2 -0
  2. package/dist/commands/router.d.ts +6 -0
  3. package/dist/git/git-commands.d.ts +2 -0
  4. package/dist/git/git-diff.d.ts +6 -0
  5. package/dist/index.d.ts +11 -5
  6. package/dist/index.js +5699 -3486
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +5679 -3483
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/mesh/coordinator-prompt.d.ts +6 -0
  11. package/dist/mesh/mesh-delivery-policy.d.ts +5 -0
  12. package/dist/mesh/mesh-events-coordinator.d.ts +151 -0
  13. package/dist/mesh/mesh-events-pending.d.ts +33 -0
  14. package/dist/mesh/mesh-events-stale.d.ts +40 -0
  15. package/dist/mesh/mesh-events-utils.d.ts +14 -0
  16. package/dist/mesh/mesh-events.d.ts +5 -198
  17. package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -3
  18. package/dist/mesh/mesh-ledger.d.ts +19 -0
  19. package/dist/mesh/mesh-missions.d.ts +58 -0
  20. package/dist/mesh/mesh-review-inbox.d.ts +90 -0
  21. package/dist/mesh/mesh-runtime-store.d.ts +175 -0
  22. package/dist/mesh/mesh-task-stats.d.ts +49 -0
  23. package/dist/mesh/mesh-work-queue.d.ts +82 -0
  24. package/dist/mesh/refine-config.d.ts +24 -2
  25. package/dist/mesh/worktree-bootstrap-config.d.ts +22 -0
  26. package/dist/providers/acp-provider-instance.d.ts +2 -0
  27. package/dist/providers/spec/driver.d.ts +8 -0
  28. package/dist/providers/spec/evaluator.d.ts +4 -5
  29. package/dist/providers/spec/loader.d.ts +1 -0
  30. package/dist/providers/spec/schema.gen.d.ts +1409 -6
  31. package/dist/providers/spec/types.d.ts +188 -175
  32. package/dist/repo-mesh-types.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/src/boot/daemon-lifecycle.ts +3 -0
  35. package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +20 -7
  36. package/src/commands/router.ts +594 -66
  37. package/src/git/git-commands.ts +5 -5
  38. package/src/git/git-diff.ts +53 -0
  39. package/src/index.ts +11 -5
  40. package/src/mesh/coordinator-prompt.ts +14 -1
  41. package/src/mesh/mesh-delivery-policy.ts +17 -0
  42. package/src/mesh/mesh-events-coordinator.ts +1404 -0
  43. package/src/mesh/mesh-events-pending.ts +371 -0
  44. package/src/mesh/mesh-events-stale.ts +283 -0
  45. package/src/mesh/mesh-events-utils.ts +161 -0
  46. package/src/mesh/mesh-events.ts +27 -2143
  47. package/src/mesh/mesh-ledger-reconciliation.ts +12 -5
  48. package/src/mesh/mesh-ledger.ts +134 -2
  49. package/src/mesh/mesh-missions.ts +151 -0
  50. package/src/mesh/mesh-review-inbox.ts +307 -0
  51. package/src/mesh/mesh-runtime-store.ts +539 -3
  52. package/src/mesh/mesh-task-stats.ts +154 -0
  53. package/src/mesh/mesh-work-queue.ts +233 -17
  54. package/src/mesh/refine-config.ts +42 -5
  55. package/src/mesh/worktree-bootstrap-config.ts +79 -0
  56. package/src/providers/acp-provider-instance.ts +15 -1
  57. package/src/providers/cli-provider-instance.ts +34 -13
  58. package/src/providers/spec/driver.ts +57 -29
  59. package/src/providers/spec/evaluator.ts +302 -112
  60. package/src/providers/spec/loader.ts +226 -37
  61. package/src/providers/spec/schema.gen.ts +450 -334
  62. package/src/providers/spec/schema.json +162 -75
  63. package/src/providers/spec/types.ts +234 -183
  64. package/src/repo-mesh-types.ts +1 -0
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "adhdev:cli/spec@1",
4
- "title": "ADHDev CLI provider spec",
3
+ "$id": "adhdev:cli/spec@3",
4
+ "title": "ADHDev CLI provider spec v3",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["$schema", "id", "name", "binary", "send_message", "layout", "states", "default_state"],
7
+ "required": ["$schema", "id", "name", "binary", "send_message", "sections", "states", "default_state"],
8
8
  "properties": {
9
- "$schema": { "type": "string", "const": "adhdev:cli/spec@1" },
9
+ "$schema": { "type": "string", "const": "adhdev:cli/spec@3" },
10
10
  "id": { "type": "string", "minLength": 1, "pattern": "^[a-z][a-z0-9-]*$" },
11
11
  "name": { "type": "string", "minLength": 1 },
12
12
  "binary": { "type": "string", "minLength": 1 },
13
13
  "spawn_args": { "type": "array", "items": { "type": "string" }, "default": [] },
14
- "env": {
15
- "type": "object",
16
- "additionalProperties": { "type": "string" },
17
- "default": {}
18
- },
14
+ "env": { "type": "object", "additionalProperties": { "type": "string" }, "default": {} },
15
+ "cli_version_range": { "type": "string", "minLength": 1 },
19
16
  "send_message": {
20
17
  "type": "object",
21
18
  "additionalProperties": false,
@@ -26,56 +23,36 @@
26
23
  "delay_ms_per_char": { "type": "integer", "minimum": 0 }
27
24
  }
28
25
  },
29
- "layout": {
26
+ "sections": {
30
27
  "type": "object",
31
- "additionalProperties": false,
32
- "required": ["sections"],
33
- "properties": {
34
- "sections": {
35
- "type": "array",
36
- "minItems": 1,
37
- "items": { "$ref": "#/definitions/section" }
38
- }
39
- }
28
+ "minProperties": 1,
29
+ "additionalProperties": { "$ref": "#/definitions/sectionDef" }
40
30
  },
41
31
  "states": {
42
32
  "type": "array",
43
33
  "minItems": 1,
44
- "items": { "$ref": "#/definitions/state" }
34
+ "items": { "$ref": "#/definitions/stateV3" }
45
35
  },
46
36
  "default_state": { "type": "string", "minLength": 1 },
47
- "control_bar": {
48
- "type": "array",
49
- "default": [],
50
- "items": { "$ref": "#/definitions/control" }
51
- },
52
- "notifications": {
53
- "type": "array",
54
- "default": [],
55
- "items": { "$ref": "#/definitions/notification" }
56
- },
57
- "delegate": {
58
- "type": "array",
59
- "default": [],
60
- "items": { "$ref": "#/definitions/delegateTrigger" }
61
- },
37
+ "control_bar": { "type": "array", "default": [], "items": { "$ref": "#/definitions/control" } },
38
+ "notifications": { "type": "array", "default": [], "items": { "$ref": "#/definitions/notification" } },
39
+ "delegate": { "type": "array", "default": [], "items": { "$ref": "#/definitions/delegateTrigger" } },
62
40
  "native_history": { "$ref": "#/definitions/nativeHistory" },
63
- "cli_version_range": { "type": "string", "minLength": 1 },
64
41
  "requiresFinalAssistantBeforeIdle": { "type": "boolean" },
65
- "debounce": {
42
+ "timing": {
66
43
  "type": "object",
67
44
  "additionalProperties": false,
68
45
  "properties": {
69
46
  "busy_hold_ms": { "type": "integer", "minimum": 0 },
70
47
  "idle_hold_ms": { "type": "integer", "minimum": 0 },
71
48
  "startup_grace_ms": { "type": "integer", "minimum": 0 },
72
- "completion_idle_after": {
49
+ "completion_marker": {
73
50
  "type": "object",
74
51
  "additionalProperties": false,
75
- "required": ["regex", "hold_ms"],
52
+ "required": ["matches", "hold_ms"],
76
53
  "properties": {
77
54
  "section": { "type": "string", "minLength": 1 },
78
- "regex": { "type": "string", "minLength": 1 },
55
+ "matches": { "type": "string", "minLength": 1 },
79
56
  "flags": { "type": "string" },
80
57
  "hold_ms": { "type": "integer", "minimum": 0 },
81
58
  "force_after_ms": { "type": "integer", "minimum": 0 }
@@ -91,16 +68,14 @@
91
68
  { "type": "string", "pattern": "^\\d+(\\.\\d+)?%$" }
92
69
  ]
93
70
  },
94
- "section": {
71
+ "sectionDef": {
95
72
  "type": "object",
96
73
  "additionalProperties": false,
97
- "required": ["id"],
98
74
  "properties": {
99
- "id": { "type": "string", "minLength": 1, "pattern": "^[a-z][a-z0-9_]*$" },
100
75
  "from_top": { "$ref": "#/definitions/size" },
101
76
  "from_bottom": { "$ref": "#/definitions/size" },
102
- "lines": { "type": "integer", "minimum": 1 },
103
- "anchor_regex": { "type": "string", "minLength": 1 },
77
+ "until": { "type": "string", "minLength": 1 },
78
+ "anchor": { "type": "string", "minLength": 1 },
104
79
  "anchor_flags": { "type": "string" },
105
80
  "anchor_last": { "type": "boolean" },
106
81
  "anchor_context": {
@@ -113,64 +88,128 @@
113
88
  "next_flags": { "type": "string" }
114
89
  }
115
90
  },
91
+ "lines": { "type": "integer", "minimum": 1 },
116
92
  "until_regex": { "type": "string", "minLength": 1 },
117
- "until_regex_flags": { "type": "string" },
118
- "until": {
119
- "type": "object",
120
- "additionalProperties": false,
121
- "required": ["section"],
122
- "properties": { "section": { "type": "string" } }
123
- }
93
+ "until_regex_flags": { "type": "string" }
124
94
  }
125
95
  },
126
- "sectionRegex": {
96
+ "condition": {
97
+ "oneOf": [
98
+ { "$ref": "#/definitions/regexCondition" },
99
+ { "$ref": "#/definitions/changedCondition" },
100
+ { "$ref": "#/definitions/allCondition" },
101
+ { "$ref": "#/definitions/anyCondition" }
102
+ ]
103
+ },
104
+ "regexCondition": {
127
105
  "type": "object",
128
106
  "additionalProperties": false,
129
- "required": ["regex"],
107
+ "required": ["matches"],
130
108
  "properties": {
131
109
  "section": { "type": "string" },
132
- "regex": { "type": "string", "minLength": 1 },
133
- "flags": { "type": "string", "default": "i" },
110
+ "matches": { "type": "string", "minLength": 1 },
111
+ "flags": { "type": "string" },
134
112
  "cursor_row_min": { "type": "integer", "minimum": 0 },
135
113
  "cursor_row_max": { "type": "integer", "minimum": 0 },
136
114
  "cursor_col_min": { "type": "integer", "minimum": 0 },
137
115
  "cursor_col_max": { "type": "integer", "minimum": 0 }
138
116
  }
139
117
  },
140
- "sectionPattern": {
118
+ "changedCondition": {
141
119
  "type": "object",
142
120
  "additionalProperties": false,
143
- "required": ["pattern"],
121
+ "required": ["cursor_above", "changed"],
122
+ "properties": {
123
+ "cursor_above": { "type": "integer", "minimum": 1 },
124
+ "changed": { "type": "boolean", "const": true }
125
+ }
126
+ },
127
+ "allCondition": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": ["all"],
131
+ "properties": {
132
+ "all": { "type": "array", "items": { "$ref": "#/definitions/condition" } }
133
+ }
134
+ },
135
+ "anyCondition": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": ["any"],
139
+ "properties": {
140
+ "any": { "type": "array", "items": { "$ref": "#/definitions/condition" } }
141
+ }
142
+ },
143
+ "extractTitle": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "properties": {
147
+ "section": { "type": "string" },
148
+ "regex": { "type": "string", "minLength": 1 },
149
+ "flags": { "type": "string" },
150
+ "first_line": { "type": "boolean", "const": true }
151
+ }
152
+ },
153
+ "extractButtons": {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "required": ["pattern", "key_for_index"],
144
157
  "properties": {
145
158
  "section": { "type": "string" },
146
159
  "pattern": { "type": "string", "minLength": 1 },
147
- "flags": { "type": "string", "default": "" }
160
+ "flags": { "type": "string" },
161
+ "key_for_index": { "type": "string", "minLength": 1 },
162
+ "min_count": { "type": "integer", "minimum": 1, "default": 2 },
163
+ "continuation_lines": { "type": "boolean", "default": false }
148
164
  }
149
165
  },
150
- "state": {
166
+ "stateV3": {
151
167
  "type": "object",
152
168
  "additionalProperties": false,
153
169
  "required": ["id", "label", "when"],
154
170
  "properties": {
155
171
  "id": { "type": "string", "minLength": 1, "pattern": "^[a-z][a-z0-9_]*$" },
156
172
  "label": { "type": "string", "minLength": 1 },
157
- "when": { "$ref": "#/definitions/sectionRegex" },
158
- "extract_title": { "$ref": "#/definitions/sectionRegex" },
159
- "modal_buttons": {
173
+ "when": {
174
+ "oneOf": [
175
+ { "$ref": "#/definitions/allCondition" },
176
+ { "$ref": "#/definitions/anyCondition" }
177
+ ]
178
+ },
179
+ "extract": {
160
180
  "type": "object",
161
181
  "additionalProperties": false,
162
- "required": ["pattern", "key_for_index"],
163
182
  "properties": {
164
- "section": { "type": "string" },
165
- "pattern": { "type": "string", "minLength": 1 },
166
- "flags": { "type": "string" },
167
- "key_for_index": { "type": "string", "minLength": 1 },
168
- "min_count": { "type": "integer", "minimum": 1, "default": 2 },
169
- "continuation_lines": { "type": "boolean", "default": false }
183
+ "title": { "$ref": "#/definitions/extractTitle" },
184
+ "buttons": { "$ref": "#/definitions/extractButtons" }
170
185
  }
171
186
  }
172
187
  }
173
188
  },
189
+ "sectionRegex": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": ["regex"],
193
+ "properties": {
194
+ "section": { "type": "string" },
195
+ "regex": { "type": "string", "minLength": 1 },
196
+ "flags": { "type": "string", "default": "i" },
197
+ "cursor_row_min": { "type": "integer", "minimum": 0 },
198
+ "cursor_row_max": { "type": "integer", "minimum": 0 },
199
+ "cursor_col_min": { "type": "integer", "minimum": 0 },
200
+ "cursor_col_max": { "type": "integer", "minimum": 0 }
201
+ }
202
+ },
203
+ "sectionPattern": {
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": ["pattern"],
207
+ "properties": {
208
+ "section": { "type": "string" },
209
+ "pattern": { "type": "string", "minLength": 1 },
210
+ "flags": { "type": "string", "default": "" }
211
+ }
212
+ },
174
213
  "control": {
175
214
  "type": "object",
176
215
  "additionalProperties": false,
@@ -231,12 +270,60 @@
231
270
  "nativeHistory": {
232
271
  "type": "object",
233
272
  "additionalProperties": false,
234
- "required": ["reader"],
235
273
  "properties": {
236
- "reader": {
237
- "type": "string",
238
- "enum": ["claude-cli", "codex-cli", "antigravity-cli", "hermes-cli"]
239
- }
274
+ "reader": { "type": "string", "enum": ["claude-cli", "codex-cli", "antigravity-cli", "hermes-cli"] },
275
+ "source": {
276
+ "oneOf": [
277
+ { "$ref": "#/definitions/nativeHistoryJsonlSource" },
278
+ { "$ref": "#/definitions/nativeHistorySqliteSource" }
279
+ ]
280
+ },
281
+ "override_path": { "type": "string", "minLength": 1 }
282
+ }
283
+ },
284
+ "nativeHistoryMessageMap": {
285
+ "type": "object",
286
+ "additionalProperties": false,
287
+ "required": ["role", "content"],
288
+ "properties": {
289
+ "role": { "type": "string", "minLength": 1 },
290
+ "content": { "type": "string", "minLength": 1 },
291
+ "content_strip": { "type": "array", "items": { "type": "string", "minLength": 1 } },
292
+ "content_unwrap": { "type": "array", "items": { "type": "string", "minLength": 1 } },
293
+ "timestamp_ms": { "type": "string", "minLength": 1 },
294
+ "kind": { "type": "string", "minLength": 1 }
295
+ }
296
+ },
297
+ "nativeHistoryJsonlSource": {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": ["kind", "path", "message_map"],
301
+ "properties": {
302
+ "kind": { "const": "jsonl" },
303
+ "path": { "type": "string", "minLength": 1 },
304
+ "file_pattern": { "type": "string", "minLength": 1 },
305
+ "recent_window_ms": { "type": "integer", "minimum": 0 },
306
+ "session_id_from": { "type": "string", "enum": ["filename_uuid", "first_record"] },
307
+ "session_id_path": { "type": "string", "minLength": 1 },
308
+ "message_filter": {
309
+ "type": "object",
310
+ "additionalProperties": false,
311
+ "required": ["where"],
312
+ "properties": { "where": { "type": "string", "minLength": 1 } }
313
+ },
314
+ "message_map": { "$ref": "#/definitions/nativeHistoryMessageMap" }
315
+ }
316
+ },
317
+ "nativeHistorySqliteSource": {
318
+ "type": "object",
319
+ "additionalProperties": false,
320
+ "required": ["kind", "path", "session_query", "message_query", "message_map"],
321
+ "properties": {
322
+ "kind": { "const": "sqlite" },
323
+ "path": { "type": "string", "minLength": 1 },
324
+ "session_query": { "type": "string", "minLength": 1 },
325
+ "message_query": { "type": "string", "minLength": 1 },
326
+ "message_map": { "$ref": "#/definitions/nativeHistoryMessageMap" }
240
327
  }
241
328
  },
242
329
  "delegateTrigger": {