@adhdev/daemon-core 0.9.82-rc.17 → 0.9.82-rc.170

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