@adhdev/daemon-core 0.9.82-rc.16 → 0.9.82-rc.161

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 (209) hide show
  1. package/dist/boot/process-hardening.d.ts +50 -0
  2. package/dist/chat/source-machine.d.ts +166 -0
  3. package/dist/chat/source-resolver.d.ts +104 -0
  4. package/dist/chat/subscription-updates.d.ts +1 -0
  5. package/dist/cli-adapter-types.d.ts +19 -2
  6. package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
  7. package/dist/cli-adapters/cli-state-engine.d.ts +178 -0
  8. package/dist/cli-adapters/provider-cli-adapter.d.ts +104 -63
  9. package/dist/cli-adapters/provider-cli-parse.d.ts +4 -0
  10. package/dist/cli-adapters/provider-cli-shared.d.ts +27 -0
  11. package/dist/commands/handler.d.ts +66 -0
  12. package/dist/commands/mesh-coordinator.d.ts +72 -1
  13. package/dist/commands/router.d.ts +22 -0
  14. package/dist/config/chat-history.d.ts +7 -0
  15. package/dist/config/config.d.ts +5 -0
  16. package/dist/config/mesh-config.d.ts +71 -1
  17. package/dist/git/git-commands.d.ts +5 -1
  18. package/dist/index.d.ts +31 -6
  19. package/dist/index.js +17210 -3575
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +17127 -3551
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/installer.d.ts +1 -4
  24. package/dist/ipc/local-ipc-server.d.ts +91 -0
  25. package/dist/launch.d.ts +1 -1
  26. package/dist/logging/async-batch-writer.d.ts +10 -0
  27. package/dist/mesh/beads-db.d.ts +72 -0
  28. package/dist/mesh/contracts.d.ts +164 -0
  29. package/dist/mesh/coordinator-prompt.d.ts +30 -0
  30. package/dist/mesh/coordinator-registry.d.ts +59 -0
  31. package/dist/mesh/mesh-active-work.d.ts +90 -0
  32. package/dist/mesh/mesh-events.d.ts +77 -5
  33. package/dist/mesh/mesh-fast-forward.d.ts +39 -0
  34. package/dist/mesh/mesh-host-ownership.d.ts +9 -0
  35. package/dist/mesh/mesh-ledger.d.ts +58 -1
  36. package/dist/mesh/mesh-refine-status.d.ts +26 -0
  37. package/dist/mesh/mesh-work-queue.d.ts +44 -5
  38. package/dist/mesh/preview-freshness.d.ts +18 -0
  39. package/dist/mesh/refine-config.d.ts +193 -0
  40. package/dist/mesh/worktree-bootstrap-config.d.ts +113 -0
  41. package/dist/providers/approval-utils.d.ts +9 -0
  42. package/dist/providers/cli-provider-instance.d.ts +7 -2
  43. package/dist/providers/contracts.d.ts +98 -5
  44. package/dist/providers/native-history/antigravity-cli-transcript.d.ts +100 -0
  45. package/dist/providers/native-history/claude-cli-transcript.d.ts +70 -0
  46. package/dist/providers/native-history/codex-cli-transcript.d.ts +73 -0
  47. package/dist/providers/native-history/dispatcher.d.ts +24 -0
  48. package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
  49. package/dist/providers/native-history/index.d.ts +13 -0
  50. package/dist/providers/provider-loader.d.ts +19 -1
  51. package/dist/providers/read-chat-contract.d.ts +29 -0
  52. package/dist/providers/sdk/v1/builders/acp/detect-status.d.ts +68 -0
  53. package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +85 -0
  54. package/dist/providers/sdk/v1/builders/cli/parse-approval-squash.d.ts +59 -0
  55. package/dist/providers/sdk/v1/builders/cli/parse-approval.d.ts +64 -0
  56. package/dist/providers/sdk/v1/builders/cli/parse-session.d.ts +91 -0
  57. package/dist/providers/sdk/v1/builders/cli/visible-region.d.ts +42 -0
  58. package/dist/providers/sdk/v1/fixture-tooling/format.d.ts +126 -0
  59. package/dist/providers/sdk/v1/fixture-tooling/index.d.ts +8 -0
  60. package/dist/providers/sdk/v1/fixture-tooling/replay.d.ts +38 -0
  61. package/dist/providers/sdk/v1/index.d.ts +30 -0
  62. package/dist/providers/sdk/v1/sandbox/README-design.d.ts +193 -0
  63. package/dist/providers/sdk/v1/sandbox/require-whitelist.d.ts +74 -0
  64. package/dist/providers/sdk/v1/sandbox/script-runner.d.ts +98 -0
  65. package/dist/providers/sdk/v1/types/cli/index.d.ts +277 -0
  66. package/dist/providers/sdk/v1/types/common/index.d.ts +169 -0
  67. package/dist/providers/sdk/v1/validators/index.d.ts +5 -0
  68. package/dist/providers/sdk/v1/validators/manifest.d.ts +40 -0
  69. package/dist/providers/sdk/v1/validators/taint.d.ts +52 -0
  70. package/dist/providers/spec/adapter.d.ts +56 -0
  71. package/dist/providers/spec/cli-adapter.d.ts +76 -0
  72. package/dist/providers/spec/driver.d.ts +148 -0
  73. package/dist/providers/spec/evaluator.d.ts +47 -0
  74. package/dist/providers/spec/loader.d.ts +14 -0
  75. package/dist/providers/spec/native-history-executor.d.ts +39 -0
  76. package/dist/providers/spec/route.d.ts +4 -0
  77. package/dist/providers/spec/schema.gen.d.ts +507 -0
  78. package/dist/providers/spec/types.d.ts +211 -0
  79. package/dist/providers/transcript-v2.d.ts +176 -0
  80. package/dist/repo-mesh-types.d.ts +100 -1
  81. package/dist/sessions/registry.d.ts +3 -0
  82. package/dist/shared-types.d.ts +12 -0
  83. package/dist/status/reporter.d.ts +2 -0
  84. package/dist/status/snapshot.d.ts +1 -0
  85. package/dist/types.d.ts +5 -0
  86. package/package.json +7 -2
  87. package/src/boot/daemon-lifecycle.ts +17 -10
  88. package/src/boot/process-hardening.ts +89 -0
  89. package/src/chat/source-machine.ts +534 -0
  90. package/src/chat/source-resolver.ts +0 -0
  91. package/src/chat/subscription-updates.ts +14 -1
  92. package/src/cli-adapter-types.d.ts +1 -0
  93. package/src/cli-adapter-types.ts +18 -2
  94. package/src/cli-adapters/cli-script-runner.ts +421 -0
  95. package/src/cli-adapters/cli-state-engine.ts +1086 -0
  96. package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
  97. package/src/cli-adapters/provider-cli-adapter.ts +664 -1137
  98. package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
  99. package/src/cli-adapters/provider-cli-parse.ts +13 -0
  100. package/src/cli-adapters/provider-cli-runtime.ts +3 -1
  101. package/src/cli-adapters/provider-cli-shared.d.ts +2 -0
  102. package/src/cli-adapters/provider-cli-shared.ts +57 -11
  103. package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +17 -1
  104. package/src/cli-adapters/terminal-backends/xterm-backend.ts +8 -1
  105. package/src/commands/chat-commands.ts +1597 -60
  106. package/src/commands/cli-manager.ts +195 -3
  107. package/src/commands/handler.ts +547 -2
  108. package/src/commands/mesh-coordinator.ts +231 -127
  109. package/src/commands/router.ts +3547 -502
  110. package/src/config/chat-history.ts +87 -24
  111. package/src/config/config.ts +12 -0
  112. package/src/config/mesh-config.ts +264 -2
  113. package/src/config/recent-activity.ts +8 -2
  114. package/src/daemon/dev-cli-debug.ts +10 -1
  115. package/src/detection/ide-detector.ts +26 -16
  116. package/src/git/git-commands.ts +17 -5
  117. package/src/git/git-worktree.ts +8 -1
  118. package/src/index.ts +91 -5
  119. package/src/installer.d.ts +1 -1
  120. package/src/installer.ts +8 -6
  121. package/src/ipc/local-ipc-server.ts +278 -0
  122. package/src/launch.d.ts +1 -1
  123. package/src/launch.ts +37 -28
  124. package/src/logging/async-batch-writer.ts +55 -0
  125. package/src/logging/logger.ts +2 -1
  126. package/src/mesh/beads-db.ts +479 -0
  127. package/src/mesh/contracts.ts +329 -0
  128. package/src/mesh/coordinator-prompt.ts +204 -30
  129. package/src/mesh/coordinator-registry.ts +121 -0
  130. package/src/mesh/mesh-active-work.ts +437 -0
  131. package/src/mesh/mesh-events.ts +820 -61
  132. package/src/mesh/mesh-fast-forward.ts +430 -0
  133. package/src/mesh/mesh-host-ownership.ts +73 -0
  134. package/src/mesh/mesh-ledger.ts +457 -104
  135. package/src/mesh/mesh-refine-status.ts +144 -0
  136. package/src/mesh/mesh-work-queue.ts +216 -158
  137. package/src/mesh/preview-freshness.ts +118 -0
  138. package/src/mesh/refine-config.ts +366 -0
  139. package/src/mesh/worktree-bootstrap-config.ts +247 -0
  140. package/src/providers/approval-utils.ts +39 -5
  141. package/src/providers/chat-message-normalization.ts +4 -11
  142. package/src/providers/cli-provider-instance.ts +388 -47
  143. package/src/providers/contracts.ts +105 -5
  144. package/src/providers/ide-provider-instance.ts +17 -3
  145. package/src/providers/native-history/antigravity-cli-transcript.ts +643 -0
  146. package/src/providers/native-history/claude-cli-transcript.ts +396 -0
  147. package/src/providers/native-history/codex-cli-transcript.ts +419 -0
  148. package/src/providers/native-history/dispatcher.ts +227 -0
  149. package/src/providers/native-history/hermes-cli-transcript.ts +230 -0
  150. package/src/providers/native-history/index.ts +30 -0
  151. package/src/providers/provider-loader.ts +420 -31
  152. package/src/providers/provider-schema.ts +31 -13
  153. package/src/providers/read-chat-contract.ts +76 -16
  154. package/src/providers/sdk/README.md +49 -0
  155. package/src/providers/sdk/v1/builders/acp/detect-status.ts +144 -0
  156. package/src/providers/sdk/v1/builders/cli/detect-status.ts +262 -0
  157. package/src/providers/sdk/v1/builders/cli/parse-approval-squash.ts +158 -0
  158. package/src/providers/sdk/v1/builders/cli/parse-approval.ts +245 -0
  159. package/src/providers/sdk/v1/builders/cli/parse-session.ts +276 -0
  160. package/src/providers/sdk/v1/builders/cli/visible-region.ts +143 -0
  161. package/src/providers/sdk/v1/fixture-tooling/format.ts +130 -0
  162. package/src/providers/sdk/v1/fixture-tooling/index.ts +22 -0
  163. package/src/providers/sdk/v1/fixture-tooling/replay.ts +352 -0
  164. package/src/providers/sdk/v1/index.ts +152 -0
  165. package/src/providers/sdk/v1/sandbox/README-design.ts +195 -0
  166. package/src/providers/sdk/v1/sandbox/require-whitelist.ts +472 -0
  167. package/src/providers/sdk/v1/sandbox/script-runner.ts +150 -0
  168. package/src/providers/sdk/v1/schemas/cli/provider.schema.json +457 -0
  169. package/src/providers/sdk/v1/schemas/primitives/acp-session-protocol-v1.json +131 -0
  170. package/src/providers/sdk/v1/schemas/primitives/native-history-codex-rollout-v1.json +66 -0
  171. package/src/providers/sdk/v1/schemas/primitives/tui-approval-squash-v1.json +91 -0
  172. package/src/providers/sdk/v1/schemas/primitives/tui-assistant-block-v1.json +91 -0
  173. package/src/providers/sdk/v1/schemas/primitives/tui-cue-ordering-v1.json +47 -0
  174. package/src/providers/sdk/v1/schemas/primitives/tui-dispatch-order-v1.json +32 -0
  175. package/src/providers/sdk/v1/schemas/primitives/tui-footer-chrome-v1.json +42 -0
  176. package/src/providers/sdk/v1/schemas/primitives/tui-index-finder-v1.json +27 -0
  177. package/src/providers/sdk/v1/schemas/primitives/tui-modal-v1.json +119 -0
  178. package/src/providers/sdk/v1/schemas/primitives/tui-prompt-marker-v1.json +45 -0
  179. package/src/providers/sdk/v1/schemas/primitives/tui-session-id-extraction-v1.json +46 -0
  180. package/src/providers/sdk/v1/schemas/primitives/tui-settled-prompt-v1.json +71 -0
  181. package/src/providers/sdk/v1/schemas/primitives/tui-spinner-v1.json +83 -0
  182. package/src/providers/sdk/v1/schemas/primitives/tui-transcript-pty-v1.json +83 -0
  183. package/src/providers/sdk/v1/schemas/primitives/tui-visible-region-v1.json +57 -0
  184. package/src/providers/sdk/v1/schemas/primitives/tui-welcome-screen-v1.json +35 -0
  185. package/src/providers/sdk/v1/types/cli/index.ts +365 -0
  186. package/src/providers/sdk/v1/types/common/index.ts +210 -0
  187. package/src/providers/sdk/v1/validators/index.ts +19 -0
  188. package/src/providers/sdk/v1/validators/manifest.ts +110 -0
  189. package/src/providers/sdk/v1/validators/taint.ts +309 -0
  190. package/src/providers/spec/adapter.ts +153 -0
  191. package/src/providers/spec/cli-adapter.ts +318 -0
  192. package/src/providers/spec/driver.ts +498 -0
  193. package/src/providers/spec/evaluator.ts +268 -0
  194. package/src/providers/spec/loader.ts +130 -0
  195. package/src/providers/spec/native-history-executor.ts +612 -0
  196. package/src/providers/spec/route.ts +51 -0
  197. package/src/providers/spec/schema.gen.ts +507 -0
  198. package/src/providers/spec/schema.json +210 -0
  199. package/src/providers/spec/types.ts +230 -0
  200. package/src/providers/transcript-v2.ts +567 -0
  201. package/src/providers/version-archive.ts +38 -20
  202. package/src/repo-mesh-types.ts +110 -1
  203. package/src/sessions/registry.ts +3 -0
  204. package/src/shared-types.ts +9 -0
  205. package/src/status/builders.ts +23 -6
  206. package/src/status/reporter.ts +15 -0
  207. package/src/status/snapshot.ts +35 -11
  208. package/src/system/host-memory.ts +29 -12
  209. package/src/types.ts +5 -0
@@ -0,0 +1,507 @@
1
+ /**
2
+ * Auto-generated. Mirrors schema.json — regenerate after editing.
3
+ */
4
+ export const SCHEMA = {
5
+ "$schema": "http://json-schema.org/draft-07/schema#",
6
+ "$id": "adhdev:cli/spec@1",
7
+ "title": "ADHDev CLI provider spec",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": [
11
+ "$schema",
12
+ "id",
13
+ "name",
14
+ "binary",
15
+ "send_message",
16
+ "layout",
17
+ "states",
18
+ "default_state"
19
+ ],
20
+ "properties": {
21
+ "$schema": {
22
+ "type": "string",
23
+ "const": "adhdev:cli/spec@1"
24
+ },
25
+ "id": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "pattern": "^[a-z][a-z0-9-]*$"
29
+ },
30
+ "name": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "binary": {
35
+ "type": "string",
36
+ "minLength": 1
37
+ },
38
+ "spawn_args": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ },
43
+ "default": []
44
+ },
45
+ "env": {
46
+ "type": "object",
47
+ "additionalProperties": {
48
+ "type": "string"
49
+ },
50
+ "default": {}
51
+ },
52
+ "send_message": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": [
56
+ "submit_key"
57
+ ],
58
+ "properties": {
59
+ "submit_key": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ },
63
+ "delay_ms_before_submit": {
64
+ "type": "integer",
65
+ "minimum": 0
66
+ },
67
+ "delay_ms_per_char": {
68
+ "type": "integer",
69
+ "minimum": 0
70
+ }
71
+ }
72
+ },
73
+ "layout": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": [
77
+ "sections"
78
+ ],
79
+ "properties": {
80
+ "sections": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "items": {
84
+ "$ref": "#/definitions/section"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "states": {
90
+ "type": "array",
91
+ "minItems": 1,
92
+ "items": {
93
+ "$ref": "#/definitions/state"
94
+ }
95
+ },
96
+ "default_state": {
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ "control_bar": {
101
+ "type": "array",
102
+ "default": [],
103
+ "items": {
104
+ "$ref": "#/definitions/control"
105
+ }
106
+ },
107
+ "notifications": {
108
+ "type": "array",
109
+ "default": [],
110
+ "items": {
111
+ "$ref": "#/definitions/notification"
112
+ }
113
+ },
114
+ "delegate": {
115
+ "type": "array",
116
+ "default": [],
117
+ "items": {
118
+ "$ref": "#/definitions/delegateTrigger"
119
+ }
120
+ },
121
+ "native_history": {
122
+ "$ref": "#/definitions/nativeHistory"
123
+ },
124
+ "cli_version_range": {
125
+ "type": "string",
126
+ "minLength": 1
127
+ },
128
+ "debounce": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "busy_hold_ms": { "type": "integer", "minimum": 0 },
133
+ "startup_grace_ms": { "type": "integer", "minimum": 0 }
134
+ }
135
+ }
136
+ },
137
+ "definitions": {
138
+ "size": {
139
+ "oneOf": [
140
+ {
141
+ "type": "integer",
142
+ "minimum": 0
143
+ },
144
+ {
145
+ "type": "string",
146
+ "pattern": "^\\d+(\\.\\d+)?%$"
147
+ }
148
+ ]
149
+ },
150
+ "section": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": [
154
+ "id"
155
+ ],
156
+ "properties": {
157
+ "id": {
158
+ "type": "string",
159
+ "minLength": 1,
160
+ "pattern": "^[a-z][a-z0-9_]*$"
161
+ },
162
+ "from_top": {
163
+ "$ref": "#/definitions/size"
164
+ },
165
+ "from_bottom": {
166
+ "$ref": "#/definitions/size"
167
+ },
168
+ "until": {
169
+ "type": "object",
170
+ "additionalProperties": false,
171
+ "required": [
172
+ "section"
173
+ ],
174
+ "properties": {
175
+ "section": {
176
+ "type": "string"
177
+ }
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "sectionRegex": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": [
186
+ "regex"
187
+ ],
188
+ "properties": {
189
+ "section": {
190
+ "type": "string"
191
+ },
192
+ "regex": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ },
196
+ "flags": {
197
+ "type": "string",
198
+ "default": "i"
199
+ }
200
+ }
201
+ },
202
+ "sectionPattern": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": [
206
+ "pattern"
207
+ ],
208
+ "properties": {
209
+ "section": {
210
+ "type": "string"
211
+ },
212
+ "pattern": {
213
+ "type": "string",
214
+ "minLength": 1
215
+ },
216
+ "flags": {
217
+ "type": "string",
218
+ "default": ""
219
+ }
220
+ }
221
+ },
222
+ "state": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "required": [
226
+ "id",
227
+ "label",
228
+ "when"
229
+ ],
230
+ "properties": {
231
+ "id": {
232
+ "type": "string",
233
+ "minLength": 1,
234
+ "pattern": "^[a-z][a-z0-9_]*$"
235
+ },
236
+ "label": {
237
+ "type": "string",
238
+ "minLength": 1
239
+ },
240
+ "when": {
241
+ "$ref": "#/definitions/sectionRegex"
242
+ },
243
+ "extract_title": {
244
+ "$ref": "#/definitions/sectionRegex"
245
+ },
246
+ "modal_buttons": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": [
250
+ "pattern",
251
+ "key_for_index"
252
+ ],
253
+ "properties": {
254
+ "section": {
255
+ "type": "string"
256
+ },
257
+ "pattern": {
258
+ "type": "string",
259
+ "minLength": 1
260
+ },
261
+ "flags": {
262
+ "type": "string"
263
+ },
264
+ "key_for_index": {
265
+ "type": "string",
266
+ "minLength": 1
267
+ },
268
+ "min_count": {
269
+ "type": "integer",
270
+ "minimum": 1,
271
+ "default": 2
272
+ }
273
+ }
274
+ }
275
+ }
276
+ },
277
+ "control": {
278
+ "type": "object",
279
+ "additionalProperties": false,
280
+ "required": [
281
+ "id",
282
+ "label",
283
+ "action"
284
+ ],
285
+ "properties": {
286
+ "id": {
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "pattern": "^[a-z][a-z0-9_]*$"
290
+ },
291
+ "label": {
292
+ "type": "string",
293
+ "minLength": 1
294
+ },
295
+ "visible_when_state": {
296
+ "type": "array",
297
+ "items": {
298
+ "type": "string"
299
+ }
300
+ },
301
+ "action": {
302
+ "$ref": "#/definitions/controlAction"
303
+ }
304
+ }
305
+ },
306
+ "controlAction": {
307
+ "oneOf": [
308
+ {
309
+ "type": "object",
310
+ "additionalProperties": false,
311
+ "required": [
312
+ "type",
313
+ "keys"
314
+ ],
315
+ "properties": {
316
+ "type": {
317
+ "const": "send_keys"
318
+ },
319
+ "keys": {
320
+ "type": "string",
321
+ "minLength": 1
322
+ }
323
+ }
324
+ },
325
+ {
326
+ "type": "object",
327
+ "additionalProperties": false,
328
+ "required": [
329
+ "type",
330
+ "trigger_keys",
331
+ "wait_for",
332
+ "extract_choices",
333
+ "submit_key"
334
+ ],
335
+ "properties": {
336
+ "type": {
337
+ "const": "open_picker"
338
+ },
339
+ "trigger_keys": {
340
+ "type": "string",
341
+ "minLength": 1
342
+ },
343
+ "wait_for": {
344
+ "$ref": "#/definitions/sectionRegex"
345
+ },
346
+ "extract_choices": {
347
+ "$ref": "#/definitions/sectionPattern"
348
+ },
349
+ "submit_key": {
350
+ "type": "string",
351
+ "minLength": 1
352
+ }
353
+ }
354
+ },
355
+ {
356
+ "type": "object",
357
+ "additionalProperties": false,
358
+ "required": [
359
+ "type",
360
+ "method",
361
+ "keys_template"
362
+ ],
363
+ "properties": {
364
+ "type": {
365
+ "const": "attach_image"
366
+ },
367
+ "method": {
368
+ "const": "tempfile_then_keys"
369
+ },
370
+ "keys_template": {
371
+ "type": "string",
372
+ "minLength": 1
373
+ }
374
+ }
375
+ }
376
+ ]
377
+ },
378
+ "notification": {
379
+ "type": "object",
380
+ "additionalProperties": false,
381
+ "required": [
382
+ "id",
383
+ "when_state",
384
+ "title"
385
+ ],
386
+ "properties": {
387
+ "id": {
388
+ "type": "string",
389
+ "minLength": 1,
390
+ "pattern": "^[a-z][a-z0-9_]*$"
391
+ },
392
+ "when_state": {
393
+ "type": "string",
394
+ "minLength": 1
395
+ },
396
+ "title": {
397
+ "type": "string",
398
+ "minLength": 1
399
+ },
400
+ "body": {
401
+ "type": "string"
402
+ }
403
+ }
404
+ },
405
+ "nativeHistory": {
406
+ "type": "object",
407
+ "additionalProperties": false,
408
+ "properties": {
409
+ "reader": {
410
+ "type": "string",
411
+ "enum": [
412
+ "claude-cli",
413
+ "codex-cli",
414
+ "antigravity-cli",
415
+ "hermes-cli"
416
+ ]
417
+ },
418
+ "source": {
419
+ "oneOf": [
420
+ { "$ref": "#/definitions/nativeHistoryJsonlSource" },
421
+ { "$ref": "#/definitions/nativeHistorySqliteSource" }
422
+ ]
423
+ },
424
+ "override_path": { "type": "string", "minLength": 1 }
425
+ }
426
+ },
427
+ "nativeHistoryMessageMap": {
428
+ "type": "object",
429
+ "additionalProperties": false,
430
+ "required": ["role", "content"],
431
+ "properties": {
432
+ "role": { "type": "string", "minLength": 1 },
433
+ "content": { "type": "string", "minLength": 1 },
434
+ "content_strip": {
435
+ "type": "array",
436
+ "items": { "type": "string", "minLength": 1 }
437
+ },
438
+ "content_unwrap": {
439
+ "type": "array",
440
+ "items": { "type": "string", "minLength": 1 }
441
+ },
442
+ "timestamp_ms": { "type": "string", "minLength": 1 },
443
+ "kind": { "type": "string", "minLength": 1 }
444
+ }
445
+ },
446
+ "nativeHistoryJsonlSource": {
447
+ "type": "object",
448
+ "additionalProperties": false,
449
+ "required": ["kind", "path", "message_map"],
450
+ "properties": {
451
+ "kind": { "const": "jsonl" },
452
+ "path": { "type": "string", "minLength": 1 },
453
+ "file_pattern": { "type": "string", "minLength": 1 },
454
+ "recent_window_ms": { "type": "integer", "minimum": 0 },
455
+ "session_id_from": { "type": "string", "enum": ["filename_uuid", "first_record"] },
456
+ "session_id_path": { "type": "string", "minLength": 1 },
457
+ "message_filter": {
458
+ "type": "object",
459
+ "additionalProperties": false,
460
+ "required": ["where"],
461
+ "properties": { "where": { "type": "string", "minLength": 1 } }
462
+ },
463
+ "message_map": { "$ref": "#/definitions/nativeHistoryMessageMap" }
464
+ }
465
+ },
466
+ "nativeHistorySqliteSource": {
467
+ "type": "object",
468
+ "additionalProperties": false,
469
+ "required": ["kind", "path", "session_query", "message_query", "message_map"],
470
+ "properties": {
471
+ "kind": { "const": "sqlite" },
472
+ "path": { "type": "string", "minLength": 1 },
473
+ "session_query": { "type": "string", "minLength": 1 },
474
+ "message_query": { "type": "string", "minLength": 1 },
475
+ "message_map": { "$ref": "#/definitions/nativeHistoryMessageMap" }
476
+ }
477
+ },
478
+ "delegateTrigger": {
479
+ "type": "object",
480
+ "additionalProperties": false,
481
+ "required": [
482
+ "id",
483
+ "when_state",
484
+ "task_template"
485
+ ],
486
+ "properties": {
487
+ "id": {
488
+ "type": "string",
489
+ "minLength": 1,
490
+ "pattern": "^[a-z][a-z0-9_]*$"
491
+ },
492
+ "when_state": {
493
+ "type": "string",
494
+ "minLength": 1
495
+ },
496
+ "after_duration_ms": {
497
+ "type": "integer",
498
+ "minimum": 0
499
+ },
500
+ "task_template": {
501
+ "type": "string",
502
+ "minLength": 1
503
+ }
504
+ }
505
+ }
506
+ }
507
+ } as const;