@deepwatch/dsh-tools 0.1.0

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.
@@ -0,0 +1,649 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const _deepwatch_dsh_tools_watchQuery_coreHealth_parameter_0$schema = z.object({
5
+ 'protocol': z.number().readonly(),
6
+ 'requestId': z.string().readonly(),
7
+ 'deadlineMs': z.number().readonly(),
8
+ })
9
+ const _deepwatch_dsh_tools_watchQuery_coreHealth_result$schema = z.union([z.object({
10
+ 'outcome': z.literal("rejected").readonly(),
11
+ 'protocol': z.number().readonly(),
12
+ 'requestId': z.string().readonly(),
13
+ 'reason': z.union([z.literal("protocol_mismatch"), z.literal("malformed_request"), z.literal("request_too_large"), z.literal("identifier_invalid")]).readonly(),
14
+ 'field': z.union([z.literal(null), z.string()]).readonly(),
15
+ }), z.object({
16
+ 'outcome': z.literal("deadline_exceeded").readonly(),
17
+ 'protocol': z.number().readonly(),
18
+ 'requestId': z.string().readonly(),
19
+ 'deadlineMs': z.number().readonly(),
20
+ }), z.object({
21
+ 'outcome': z.literal("core_health").readonly(),
22
+ 'protocol': z.number().readonly(),
23
+ 'requestId': z.string().readonly(),
24
+ 'phase': z.string().readonly(),
25
+ 'blocker': z.union([z.literal("protocol_mismatch"), z.literal("connected"), z.literal("core_missing"), z.literal("bridge_surface_missing"), z.literal("handshake_failed"), z.literal("contract_mismatch"), z.literal("core_crashed"), z.literal("core_timeout"), z.literal("circuit_open"), z.literal("test_only_mock")]).readonly(),
26
+ 'coreVersion': z.union([z.literal(null), z.string()]).readonly(),
27
+ 'coreBuild': z.union([z.literal(null), z.string()]).readonly(),
28
+ 'protocolVersion': z.union([z.literal(null), z.number()]).readonly(),
29
+ 'protocolMin': z.union([z.literal(null), z.number()]).readonly(),
30
+ 'transport': z.union([z.literal(null), z.string()]).readonly(),
31
+ 'isTestOnlyMock': z.boolean().readonly(),
32
+ 'contractsMatch': z.boolean().readonly(),
33
+ 'contractDrift': z.array(z.string()).readonly(),
34
+ 'lastHandshakeAt': z.union([z.literal(null), z.string()]).readonly(),
35
+ 'restartCount': z.number().readonly(),
36
+ 'capabilities': z.object({
37
+ 'ready': z.number().readonly(),
38
+ 'unavailable': z.number().readonly(),
39
+ 'degraded': z.number().readonly(),
40
+ 'unknown': z.number().readonly(),
41
+ }).readonly(),
42
+ 'capabilityDetails': z.array(z.object({
43
+ 'capabilityId': z.string().readonly(),
44
+ 'status': z.union([z.literal("implemented"), z.literal("machine_tested"), z.literal("probed"), z.literal("unavailable"), z.literal("not_tested")]).readonly(),
45
+ 'usable': z.boolean().readonly(),
46
+ 'missing': z.array(z.string()).readonly(),
47
+ 'fixes': z.array(z.string()).readonly(),
48
+ 'lastCheckedAt': z.union([z.literal(null), z.string()]).readonly(),
49
+ })).readonly(),
50
+ 'fix': z.string().readonly(),
51
+ })])
52
+ const _deepwatch_dsh_tools_watchQuery_libraryGet_parameter_0$schema = z.object({
53
+ 'protocol': z.number().readonly(),
54
+ 'requestId': z.string().readonly(),
55
+ 'recordId': z.string().readonly(),
56
+ 'deadlineMs': z.number().readonly(),
57
+ })
58
+ const _deepwatch_dsh_tools_watchQuery_libraryGet_result$schema = z.union([z.object({
59
+ 'outcome': z.literal("rejected").readonly(),
60
+ 'protocol': z.number().readonly(),
61
+ 'requestId': z.string().readonly(),
62
+ 'reason': z.union([z.literal("protocol_mismatch"), z.literal("malformed_request"), z.literal("request_too_large"), z.literal("identifier_invalid")]).readonly(),
63
+ 'field': z.union([z.literal(null), z.string()]).readonly(),
64
+ }), z.object({
65
+ 'outcome': z.literal("deadline_exceeded").readonly(),
66
+ 'protocol': z.number().readonly(),
67
+ 'requestId': z.string().readonly(),
68
+ 'deadlineMs': z.number().readonly(),
69
+ }), z.object({
70
+ 'outcome': z.literal("record").readonly(),
71
+ 'protocol': z.number().readonly(),
72
+ 'requestId': z.string().readonly(),
73
+ 'revision': z.number().readonly(),
74
+ 'record': z.object({
75
+ 'recordId': z.string().readonly(),
76
+ 'revisionId': z.string().readonly(),
77
+ 'title': z.string().readonly(),
78
+ 'modality': z.string().readonly(),
79
+ 'observedAt': z.union([z.literal(null), z.string()]).readonly(),
80
+ 'source': z.string().readonly(),
81
+ 'runId': z.union([z.literal(null), z.string()]).readonly(),
82
+ 'verdict': z.union([z.literal(null), z.string()]).readonly(),
83
+ 'tags': z.array(z.string()).readonly(),
84
+ 'evidenceIds': z.array(z.string()).readonly(),
85
+ 'current': z.boolean().readonly(),
86
+ }).readonly(),
87
+ }), z.object({
88
+ 'outcome': z.literal("absent").readonly(),
89
+ 'protocol': z.number().readonly(),
90
+ 'requestId': z.string().readonly(),
91
+ 'revision': z.number().readonly(),
92
+ 'recordId': z.string().readonly(),
93
+ })])
94
+ const _deepwatch_dsh_tools_watchQuery_libraryRefresh_parameter_0$schema = z.object({
95
+ 'protocol': z.number().readonly(),
96
+ 'requestId': z.string().readonly(),
97
+ 'deadlineMs': z.number().readonly(),
98
+ })
99
+ const _deepwatch_dsh_tools_watchQuery_libraryRefresh_result$schema = z.union([z.object({
100
+ 'outcome': z.literal("rejected").readonly(),
101
+ 'protocol': z.number().readonly(),
102
+ 'requestId': z.string().readonly(),
103
+ 'reason': z.union([z.literal("protocol_mismatch"), z.literal("malformed_request"), z.literal("request_too_large"), z.literal("identifier_invalid")]).readonly(),
104
+ 'field': z.union([z.literal(null), z.string()]).readonly(),
105
+ }), z.object({
106
+ 'outcome': z.literal("deadline_exceeded").readonly(),
107
+ 'protocol': z.number().readonly(),
108
+ 'requestId': z.string().readonly(),
109
+ 'deadlineMs': z.number().readonly(),
110
+ }), z.object({
111
+ 'outcome': z.literal("refreshed").readonly(),
112
+ 'protocol': z.number().readonly(),
113
+ 'requestId': z.string().readonly(),
114
+ 'index': z.object({
115
+ 'generation': z.number().readonly(),
116
+ 'startedAt': z.string().readonly(),
117
+ 'completedAt': z.union([z.literal(null), z.string()]).readonly(),
118
+ 'sourceCount': z.number().readonly(),
119
+ 'recordCount': z.number().readonly(),
120
+ 'indexState': z.union([z.literal("ready"), z.literal("rebuilding"), z.literal("stale"), z.literal("empty")]).readonly(),
121
+ }).readonly(),
122
+ 'skipped': z.array(z.string()).readonly(),
123
+ }), z.object({
124
+ 'outcome': z.literal("refresh_cancelled").readonly(),
125
+ 'protocol': z.number().readonly(),
126
+ 'requestId': z.string().readonly(),
127
+ 'index': z.object({
128
+ 'generation': z.number().readonly(),
129
+ 'startedAt': z.string().readonly(),
130
+ 'completedAt': z.union([z.literal(null), z.string()]).readonly(),
131
+ 'sourceCount': z.number().readonly(),
132
+ 'recordCount': z.number().readonly(),
133
+ 'indexState': z.union([z.literal("ready"), z.literal("rebuilding"), z.literal("stale"), z.literal("empty")]).readonly(),
134
+ }).readonly(),
135
+ }), z.object({
136
+ 'outcome': z.literal("refresh_failed").readonly(),
137
+ 'protocol': z.number().readonly(),
138
+ 'requestId': z.string().readonly(),
139
+ 'reason': z.string().readonly(),
140
+ 'index': z.object({
141
+ 'generation': z.number().readonly(),
142
+ 'startedAt': z.string().readonly(),
143
+ 'completedAt': z.union([z.literal(null), z.string()]).readonly(),
144
+ 'sourceCount': z.number().readonly(),
145
+ 'recordCount': z.number().readonly(),
146
+ 'indexState': z.union([z.literal("ready"), z.literal("rebuilding"), z.literal("stale"), z.literal("empty")]).readonly(),
147
+ }).readonly(),
148
+ })])
149
+ const _deepwatch_dsh_tools_watchQuery_librarySearch_parameter_0$schema = z.object({
150
+ 'protocol': z.number().readonly(),
151
+ 'requestId': z.string().readonly(),
152
+ 'query': z.string().readonly(),
153
+ 'modalities': z.array(z.string()).readonly(),
154
+ 'limit': z.number().readonly(),
155
+ 'cursor': z.union([z.literal(null), z.string()]).readonly(),
156
+ 'deadlineMs': z.number().readonly(),
157
+ })
158
+ const _deepwatch_dsh_tools_watchQuery_librarySearch_result$schema = z.union([z.object({
159
+ 'outcome': z.literal("page").readonly(),
160
+ 'protocol': z.number().readonly(),
161
+ 'requestId': z.string().readonly(),
162
+ 'revision': z.number().readonly(),
163
+ 'generation': z.number().readonly(),
164
+ 'records': z.array(z.object({
165
+ 'recordId': z.string().readonly(),
166
+ 'revisionId': z.string().readonly(),
167
+ 'title': z.string().readonly(),
168
+ 'modality': z.string().readonly(),
169
+ 'observedAt': z.union([z.literal(null), z.string()]).readonly(),
170
+ 'source': z.string().readonly(),
171
+ 'runId': z.union([z.literal(null), z.string()]).readonly(),
172
+ 'verdict': z.union([z.literal(null), z.string()]).readonly(),
173
+ 'tags': z.array(z.string()).readonly(),
174
+ 'evidenceIds': z.array(z.string()).readonly(),
175
+ 'current': z.boolean().readonly(),
176
+ })).readonly(),
177
+ 'nextCursor': z.union([z.literal(null), z.string()]).readonly(),
178
+ 'total': z.number().readonly(),
179
+ 'indexState': z.union([z.literal("ready"), z.literal("rebuilding"), z.literal("stale"), z.literal("empty")]).readonly(),
180
+ }), z.object({
181
+ 'outcome': z.literal("cursor_expired").readonly(),
182
+ 'protocol': z.number().readonly(),
183
+ 'requestId': z.string().readonly(),
184
+ 'revision': z.number().readonly(),
185
+ }), z.object({
186
+ 'outcome': z.literal("rejected").readonly(),
187
+ 'protocol': z.number().readonly(),
188
+ 'requestId': z.string().readonly(),
189
+ 'reason': z.union([z.literal("protocol_mismatch"), z.literal("malformed_request"), z.literal("request_too_large"), z.literal("identifier_invalid")]).readonly(),
190
+ 'field': z.union([z.literal(null), z.string()]).readonly(),
191
+ }), z.object({
192
+ 'outcome': z.literal("deadline_exceeded").readonly(),
193
+ 'protocol': z.number().readonly(),
194
+ 'requestId': z.string().readonly(),
195
+ 'deadlineMs': z.number().readonly(),
196
+ })])
197
+ const _deepwatch_dsh_tools_watchQuery_providerTest_parameter_0$schema = z.object({
198
+ 'protocol': z.number().readonly(),
199
+ 'requestId': z.string().readonly(),
200
+ 'deadlineMs': z.number().readonly(),
201
+ 'provider': z.string().readonly(),
202
+ 'model': z.string().readonly(),
203
+ })
204
+ const _deepwatch_dsh_tools_watchQuery_providerTest_result$schema = z.object({
205
+ 'outcome': z.literal("provider_test").readonly(),
206
+ 'protocol': z.number().readonly(),
207
+ 'requestId': z.string().readonly(),
208
+ 'provider': z.string().readonly(),
209
+ 'model': z.string().readonly(),
210
+ 'ok': z.boolean().readonly(),
211
+ 'credential': z.union([z.literal("rejected"), z.literal("configured_unverified"), z.literal("verified")]).readonly(),
212
+ 'reachability': z.union([z.literal("reachable"), z.literal("unreachable"), z.literal("rate_limited"), z.literal("unauthorized")]).readonly(),
213
+ 'message': z.string().readonly(),
214
+ })
215
+ const _deepwatch_dsh_tools_watchQuery_routeReadiness_parameter_0$schema = z.object({
216
+ 'protocol': z.number().readonly(),
217
+ 'requestId': z.string().readonly(),
218
+ 'deadlineMs': z.number().readonly(),
219
+ 'provider': z.string().readonly(),
220
+ 'model': z.string().readonly(),
221
+ })
222
+ const _deepwatch_dsh_tools_watchQuery_routeReadiness_result$schema = z.union([z.object({
223
+ 'outcome': z.literal("rejected").readonly(),
224
+ 'protocol': z.number().readonly(),
225
+ 'requestId': z.string().readonly(),
226
+ 'reason': z.union([z.literal("protocol_mismatch"), z.literal("malformed_request"), z.literal("request_too_large"), z.literal("identifier_invalid")]).readonly(),
227
+ 'field': z.union([z.literal(null), z.string()]).readonly(),
228
+ }), z.object({
229
+ 'outcome': z.literal("deadline_exceeded").readonly(),
230
+ 'protocol': z.number().readonly(),
231
+ 'requestId': z.string().readonly(),
232
+ 'deadlineMs': z.number().readonly(),
233
+ }), z.object({
234
+ 'outcome': z.literal("route_readiness").readonly(),
235
+ 'protocol': z.number().readonly(),
236
+ 'requestId': z.string().readonly(),
237
+ 'provider': z.string().readonly(),
238
+ 'model': z.string().readonly(),
239
+ 'proved': z.boolean().readonly(),
240
+ 'reason': z.union([z.literal("proved"), z.literal("never_tested"), z.literal("configuration_changed"), z.literal("unreadable")]).readonly(),
241
+ })])
242
+
243
+ export const TYPERT = {
244
+ package: '@deepwatch/dsh-tools',
245
+ face: 'host',
246
+ schemas: [
247
+ ],
248
+ invocations: [
249
+ {
250
+ id: '@deepwatch/dsh-tools#watchQuery/coreHealth',
251
+ service: 'watchQuery',
252
+ namespace: 'watchQuery',
253
+ method: 'coreHealth',
254
+ invocation: { kind: 'direct' },
255
+ parameters: [
256
+ {
257
+ name: 'request',
258
+ wire: 'request',
259
+ source: 'json',
260
+ codec: {
261
+ mode: 'strict',
262
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#CoreHealthRequest',
263
+ schema: _deepwatch_dsh_tools_watchQuery_coreHealth_parameter_0$schema,
264
+ },
265
+ },
266
+ ],
267
+ cancellation: { parameter: 'signal' },
268
+ result: {
269
+ mode: 'strict',
270
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#CoreHealthResponse',
271
+ schema: _deepwatch_dsh_tools_watchQuery_coreHealth_result$schema,
272
+ },
273
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":232,"column":3},
274
+ },
275
+ {
276
+ id: '@deepwatch/dsh-tools#watchQuery/libraryGet',
277
+ service: 'watchQuery',
278
+ namespace: 'watchQuery',
279
+ method: 'libraryGet',
280
+ invocation: { kind: 'direct' },
281
+ parameters: [
282
+ {
283
+ name: 'request',
284
+ wire: 'request',
285
+ source: 'json',
286
+ codec: {
287
+ mode: 'strict',
288
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibraryGetRequest',
289
+ schema: _deepwatch_dsh_tools_watchQuery_libraryGet_parameter_0$schema,
290
+ },
291
+ },
292
+ ],
293
+ cancellation: { parameter: 'signal' },
294
+ result: {
295
+ mode: 'strict',
296
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibraryGetResponse',
297
+ schema: _deepwatch_dsh_tools_watchQuery_libraryGet_result$schema,
298
+ },
299
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":194,"column":3},
300
+ },
301
+ {
302
+ id: '@deepwatch/dsh-tools#watchQuery/libraryRefresh',
303
+ service: 'watchQuery',
304
+ namespace: 'watchQuery',
305
+ method: 'libraryRefresh',
306
+ invocation: { kind: 'direct' },
307
+ parameters: [
308
+ {
309
+ name: 'request',
310
+ wire: 'request',
311
+ source: 'json',
312
+ codec: {
313
+ mode: 'strict',
314
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibraryRefreshRequest',
315
+ schema: _deepwatch_dsh_tools_watchQuery_libraryRefresh_parameter_0$schema,
316
+ },
317
+ },
318
+ ],
319
+ cancellation: { parameter: 'signal' },
320
+ result: {
321
+ mode: 'strict',
322
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibraryRefreshResponse',
323
+ schema: _deepwatch_dsh_tools_watchQuery_libraryRefresh_result$schema,
324
+ },
325
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":213,"column":3},
326
+ },
327
+ {
328
+ id: '@deepwatch/dsh-tools#watchQuery/librarySearch',
329
+ service: 'watchQuery',
330
+ namespace: 'watchQuery',
331
+ method: 'librarySearch',
332
+ invocation: { kind: 'direct' },
333
+ parameters: [
334
+ {
335
+ name: 'request',
336
+ wire: 'request',
337
+ source: 'json',
338
+ codec: {
339
+ mode: 'strict',
340
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibrarySearchRequest',
341
+ schema: _deepwatch_dsh_tools_watchQuery_librarySearch_parameter_0$schema,
342
+ },
343
+ },
344
+ ],
345
+ cancellation: { parameter: 'signal' },
346
+ result: {
347
+ mode: 'strict',
348
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#LibrarySearchResponse',
349
+ schema: _deepwatch_dsh_tools_watchQuery_librarySearch_result$schema,
350
+ },
351
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":182,"column":3},
352
+ },
353
+ {
354
+ id: '@deepwatch/dsh-tools#watchQuery/providerTest',
355
+ service: 'watchQuery',
356
+ namespace: 'watchQuery',
357
+ method: 'providerTest',
358
+ invocation: { kind: 'direct' },
359
+ parameters: [
360
+ {
361
+ name: 'request',
362
+ wire: 'request',
363
+ source: 'json',
364
+ codec: {
365
+ mode: 'strict',
366
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#ProviderTestRequest',
367
+ schema: _deepwatch_dsh_tools_watchQuery_providerTest_parameter_0$schema,
368
+ },
369
+ },
370
+ ],
371
+ cancellation: { parameter: 'signal' },
372
+ result: {
373
+ mode: 'strict',
374
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#ProviderTestResponse',
375
+ schema: _deepwatch_dsh_tools_watchQuery_providerTest_result$schema,
376
+ },
377
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":240,"column":3},
378
+ },
379
+ {
380
+ id: '@deepwatch/dsh-tools#watchQuery/routeReadiness',
381
+ service: 'watchQuery',
382
+ namespace: 'watchQuery',
383
+ method: 'routeReadiness',
384
+ invocation: { kind: 'direct' },
385
+ parameters: [
386
+ {
387
+ name: 'request',
388
+ wire: 'request',
389
+ source: 'json',
390
+ codec: {
391
+ mode: 'strict',
392
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#RouteReadinessRequest',
393
+ schema: _deepwatch_dsh_tools_watchQuery_routeReadiness_parameter_0$schema,
394
+ },
395
+ },
396
+ ],
397
+ cancellation: { parameter: 'signal' },
398
+ result: {
399
+ mode: 'strict',
400
+ typeSymbol: '@deepwatch/dsh-contracts/query/wire#RouteReadinessResponse',
401
+ schema: _deepwatch_dsh_tools_watchQuery_routeReadiness_result$schema,
402
+ },
403
+ sourceLocation: {"file":"packages/watch/tools/src/read-plane.ts","line":258,"column":3},
404
+ },
405
+ ],
406
+ model: {
407
+ "services": [
408
+ {
409
+ "description": "The Typert Remote a Watch surface calls. `watchQuery` is both the Cordis service key and the wire namespace, so the client reaches it as `ctx.remote.watchQuery`.",
410
+ "summary": "The Typert Remote a Watch surface calls.",
411
+ "tags": [],
412
+ "jsDoc": "/**\n * The Typert Remote a Watch surface calls.\n *\n * `watchQuery` is both the Cordis service key and the wire namespace, so the\n * client reaches it as `ctx.remote.watchQuery`.\n */",
413
+ "key": "watchQuery",
414
+ "exportName": "WatchQueryService",
415
+ "members": [
416
+ {
417
+ "kind": "property",
418
+ "name": "config",
419
+ "signature": "readonly config: ReadPlaneConfig",
420
+ "summary": "Deliberately not a `#private` field.",
421
+ "jsDoc": "/**\n * Deliberately not a `#private` field.\n *\n * Cordis hands a Service to callers through a Proxy, and a private field is\n * unreachable through one: the Gateway invoked this method and got\n * \"Cannot read private member #config from an object whose class did not\n * declare it\". Every direct unit test passed, because a direct call has no\n * proxy in front of it -- which is the whole argument for exercising this\n * through the real Gateway.\n */"
422
+ },
423
+ {
424
+ "kind": "method",
425
+ "name": "librarySearch",
426
+ "signature": "@Remote('librarySearch') librarySearch( request: LibrarySearchRequest, signal: AbortSignal, ): Promise<LibrarySearchResponse>",
427
+ "summary": "One concrete method per read, rather than one `read` over a union.",
428
+ "jsDoc": "/**\n * One concrete method per read, rather than one `read` over a union.\n *\n * DSH already routes by method, so a discriminated union inside a single\n * entry point would be a second router with its own schema to generate.\n * One request type and one response type per method is what Typert emits\n * a strict codec from most directly.\n *\n * `signal` is last, as Typert requires, and is not serialised.\n */"
429
+ },
430
+ {
431
+ "kind": "method",
432
+ "name": "libraryGet",
433
+ "signature": "@Remote('libraryGet') libraryGet( request: LibraryGetRequest, signal: AbortSignal, ): Promise<LibraryGetResponse>",
434
+ "summary": "One record by id.",
435
+ "jsDoc": "/** One record by id. A direct lookup, not a one-result search. */"
436
+ },
437
+ {
438
+ "kind": "method",
439
+ "name": "libraryRefresh",
440
+ "signature": "@Remote('libraryRefresh') libraryRefresh( request: LibraryRefreshRequest, signal: AbortSignal, ): Promise<LibraryRefreshResponse>",
441
+ "summary": "Read the roots again, and put the result into service if it is healthy.",
442
+ "jsDoc": "/**\n * Read the roots again, and put the result into service if it is healthy.\n *\n * The only method here with a side effect, and the only one that is not a\n * question. It is a separate method for exactly that reason: a `rebuild`\n * flag on `librarySearch` would make every search a potential re-read of the\n * corpus, and would leave a caller no way to ask for an answer from what the\n * host already has.\n *\n * Genuinely async, unlike its siblings: the rebuild yields between files so\n * a caller that stops waiting can be observed doing so.\n */"
443
+ },
444
+ {
445
+ "kind": "method",
446
+ "name": "coreHealth",
447
+ "signature": "@Remote('coreHealth') coreHealth( request: CoreHealthRequest, signal: AbortSignal, ): Promise<CoreHealthResponse>",
448
+ "summary": "What Watch Core is doing right now, read from the running Bridge.",
449
+ "jsDoc": "/**\n * What Watch Core is doing right now, read from the running Bridge.\n *\n * The one method here that is not about the Library, and it is here because\n * this is the only channel the browser has to the Host. Diagnostics used to\n * render \"Connected over stdio\" and a version number as literals in a\n * component, because there was nowhere to read them from.\n *\n * Nothing is defaulted. A value the Bridge has not established is `null`,\n * and the panel renders that as \"not reported\" -- which is worth less than a\n * real reading and far more than a confident wrong one.\n */"
450
+ },
451
+ {
452
+ "kind": "method",
453
+ "name": "providerTest",
454
+ "signature": "@Remote('providerTest') providerTest( request: ProviderTestRequest, signal: AbortSignal, ): Promise<ProviderTestResponse>",
455
+ "summary": "Spend one deliberately tiny provider request only after a person asks.",
456
+ "jsDoc": "/** Spend one deliberately tiny provider request only after a person asks. */"
457
+ },
458
+ {
459
+ "kind": "method",
460
+ "name": "routeReadiness",
461
+ "signature": "@Remote('routeReadiness') routeReadiness( request: RouteReadinessRequest, signal: AbortSignal, ): Promise<RouteReadinessResponse>",
462
+ "summary": "Whether the Host would serve this route right now, asked without spending anything.",
463
+ "jsDoc": "/**\n * Whether the Host would serve this route right now, asked without spending\n * anything.\n *\n * The browser half used to answer this from its own memory of a provider\n * test it had run, which is a claim about a Host it cannot see. A tab that\n * stayed open across a Host restart, or across an edit made in another tab,\n * kept drawing a tested badge over a route the Host had already stopped\n * being willing to serve — and the composer it gates opened onto a refusal.\n * There is one answer, and this is where it is read from.\n */"
464
+ }
465
+ ],
466
+ "types": [
467
+ {
468
+ "name": "CapabilityHealthDetail",
469
+ "declaration": "export interface CapabilityHealthDetail {\n readonly capabilityId: string;\n readonly status: 'implemented' | 'machine_tested' | 'probed' | 'unavailable' | 'not_tested';\n readonly usable: boolean;\n readonly missing: readonly string[];\n readonly fixes: readonly string[];\n readonly lastCheckedAt: string | null;\n}"
470
+ },
471
+ {
472
+ "name": "CapabilityTally",
473
+ "declaration": "export interface CapabilityTally {\n readonly ready: number;\n readonly unavailable: number;\n readonly degraded: number;\n readonly unknown: number;\n}"
474
+ },
475
+ {
476
+ "name": "CoreBlocker",
477
+ "declaration": "export type CoreBlocker = 'connected' | 'core_missing' | 'bridge_surface_missing' | 'handshake_failed' | 'protocol_mismatch' | 'contract_mismatch' | 'core_crashed' | 'core_timeout' | 'circuit_open' | 'test_only_mock';"
478
+ },
479
+ {
480
+ "name": "CoreHealthReport",
481
+ "declaration": "export interface CoreHealthReport {\n readonly outcome: 'core_health';\n readonly protocol: number;\n readonly requestId: string;\n readonly phase: string;\n readonly blocker: CoreBlocker;\n readonly coreVersion: string | null;\n readonly coreBuild: string | null;\n readonly protocolVersion: number | null;\n readonly protocolMin: number | null;\n readonly transport: string | null;\n readonly isTestOnlyMock: boolean;\n readonly contractsMatch: boolean;\n readonly contractDrift: readonly string[];\n readonly lastHandshakeAt: string | null;\n readonly restartCount: number;\n readonly capabilities: CapabilityTally;\n readonly capabilityDetails: readonly CapabilityHealthDetail[];\n readonly fix: string;\n}"
482
+ },
483
+ {
484
+ "name": "CoreHealthRequest",
485
+ "declaration": "export interface CoreHealthRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly deadlineMs: number;\n}"
486
+ },
487
+ {
488
+ "name": "CoreHealthResponse",
489
+ "declaration": "export type CoreHealthResponse = CoreHealthReport | LibraryRequestRejected | LibraryDeadlineExceeded;"
490
+ },
491
+ {
492
+ "name": "IndexableRecord",
493
+ "declaration": "export interface IndexableRecord {\n readonly recordId: string;\n readonly revisionId: string;\n readonly title: string;\n readonly kind: SourceKind;\n readonly text: string;\n readonly source: string | null;\n readonly runId: string | null;\n readonly observedAt: string | null;\n readonly verdict: string | null;\n readonly tags: readonly string[];\n readonly evidenceIds: readonly string[];\n}"
494
+ },
495
+ {
496
+ "name": "IndexGeneration",
497
+ "declaration": "export interface IndexGeneration {\n readonly generation: number;\n readonly startedAt: string;\n readonly completedAt: string | null;\n readonly sourceCount: number;\n readonly recordCount: number;\n readonly indexState: LibraryIndexState;\n readonly skipped: readonly string[];\n}"
498
+ },
499
+ {
500
+ "name": "IndexHealth",
501
+ "declaration": "export type IndexHealth = 'empty' | 'ready' | 'indexing' | 'stale' | 'corrupt';"
502
+ },
503
+ {
504
+ "name": "IndexQuery",
505
+ "declaration": "export interface IndexQuery {\n readonly text: string;\n readonly kinds?: readonly SourceKind[];\n readonly runIds?: readonly string[];\n readonly verdicts?: readonly string[];\n readonly tags?: readonly string[];\n readonly sources?: readonly string[];\n readonly from?: string;\n readonly to?: string;\n readonly sort?: 'relevance' | 'newest' | 'oldest' | 'title';\n readonly offset?: number;\n readonly limit?: number;\n readonly signal?: AbortSignal;\n}"
506
+ },
507
+ {
508
+ "name": "IndexQueryResult",
509
+ "declaration": "export interface IndexQueryResult {\n readonly results: readonly SearchResult[];\n readonly total: number;\n readonly offset: number;\n readonly limit: number;\n readonly health: IndexHealth;\n readonly notes: readonly string[];\n}"
510
+ },
511
+ {
512
+ "name": "LibraryCursorExpired",
513
+ "declaration": "export interface LibraryCursorExpired {\n readonly outcome: 'cursor_expired';\n readonly protocol: number;\n readonly requestId: string;\n readonly revision: number;\n}"
514
+ },
515
+ {
516
+ "name": "LibraryDeadlineExceeded",
517
+ "declaration": "export interface LibraryDeadlineExceeded {\n readonly outcome: 'deadline_exceeded';\n readonly protocol: number;\n readonly requestId: string;\n readonly deadlineMs: number;\n}"
518
+ },
519
+ {
520
+ "name": "LibraryGenerations",
521
+ "declaration": "export class LibraryGenerations {\n addLive(record: IndexableRecord): void;\n liveCount(): number;\n index(): LibraryIndex;\n generation(): IndexGeneration;\n refresh(requestId: string, signal: AbortSignal): Promise<RefreshOutcome>;\n rebuilding(): boolean;\n}"
522
+ },
523
+ {
524
+ "name": "LibraryGetRequest",
525
+ "declaration": "export interface LibraryGetRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly recordId: string;\n readonly deadlineMs: number;\n}"
526
+ },
527
+ {
528
+ "name": "LibraryGetResponse",
529
+ "declaration": "export type LibraryGetResponse = LibraryRecordFound | LibraryRecordAbsent | LibraryRequestRejected | LibraryDeadlineExceeded;"
530
+ },
531
+ {
532
+ "name": "LibraryIndex",
533
+ "declaration": "export class LibraryIndex {\n get health(): IndexHealth;\n record(recordId: string): IndexableRecord | undefined;\n get size(): number;\n get pending(): readonly string[];\n get diagnostics(): readonly string[];\n add(input: IndexableRecord): void;\n addAll(records: readonly IndexableRecord[], signal?: AbortSignal): number;\n remove(recordId: string): boolean;\n clear(): void;\n markStale(reason: string): void;\n search(query: IndexQuery): IndexQueryResult;\n serialize(): SerializedIndex;\n}"
534
+ },
535
+ {
536
+ "name": "LibraryIndexGeneration",
537
+ "declaration": "export interface LibraryIndexGeneration {\n readonly generation: number;\n readonly startedAt: string;\n readonly completedAt: string | null;\n readonly sourceCount: number;\n readonly recordCount: number;\n readonly indexState: LibraryIndexState;\n}"
538
+ },
539
+ {
540
+ "name": "LibraryIndexState",
541
+ "declaration": "export type LibraryIndexState = 'ready' | 'rebuilding' | 'stale' | 'empty';"
542
+ },
543
+ {
544
+ "name": "LibraryRecord",
545
+ "declaration": "export interface LibraryRecord {\n readonly recordId: string;\n readonly revisionId: string;\n readonly title: string;\n readonly modality: string;\n readonly observedAt: string | null;\n readonly source: string;\n readonly runId: string | null;\n readonly verdict: string | null;\n readonly tags: readonly string[];\n readonly evidenceIds: readonly string[];\n readonly current: boolean;\n}"
546
+ },
547
+ {
548
+ "name": "LibraryRecordAbsent",
549
+ "declaration": "export interface LibraryRecordAbsent {\n readonly outcome: 'absent';\n readonly protocol: number;\n readonly requestId: string;\n readonly revision: number;\n readonly recordId: string;\n}"
550
+ },
551
+ {
552
+ "name": "LibraryRecordFound",
553
+ "declaration": "export interface LibraryRecordFound {\n readonly outcome: 'record';\n readonly protocol: number;\n readonly requestId: string;\n readonly revision: number;\n readonly record: LibraryRecord;\n}"
554
+ },
555
+ {
556
+ "name": "LibraryRefreshCancelled",
557
+ "declaration": "export interface LibraryRefreshCancelled {\n readonly outcome: 'refresh_cancelled';\n readonly protocol: number;\n readonly requestId: string;\n readonly index: LibraryIndexGeneration;\n}"
558
+ },
559
+ {
560
+ "name": "LibraryRefreshed",
561
+ "declaration": "export interface LibraryRefreshed {\n readonly outcome: 'refreshed';\n readonly protocol: number;\n readonly requestId: string;\n readonly index: LibraryIndexGeneration;\n readonly skipped: readonly string[];\n}"
562
+ },
563
+ {
564
+ "name": "LibraryRefreshFailed",
565
+ "declaration": "export interface LibraryRefreshFailed {\n readonly outcome: 'refresh_failed';\n readonly protocol: number;\n readonly requestId: string;\n readonly reason: string;\n readonly index: LibraryIndexGeneration;\n}"
566
+ },
567
+ {
568
+ "name": "LibraryRefreshRequest",
569
+ "declaration": "export interface LibraryRefreshRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly deadlineMs: number;\n}"
570
+ },
571
+ {
572
+ "name": "LibraryRefreshResponse",
573
+ "declaration": "export type LibraryRefreshResponse = LibraryRefreshed | LibraryRefreshCancelled | LibraryRefreshFailed | LibraryRequestRejected | LibraryDeadlineExceeded;"
574
+ },
575
+ {
576
+ "name": "LibraryRequestRejected",
577
+ "declaration": "export interface LibraryRequestRejected {\n readonly outcome: 'rejected';\n readonly protocol: number;\n readonly requestId: string;\n readonly reason: 'protocol_mismatch' | 'malformed_request' | 'request_too_large' | 'identifier_invalid';\n readonly field: string | null;\n}"
578
+ },
579
+ {
580
+ "name": "LibrarySearchPage",
581
+ "declaration": "export interface LibrarySearchPage {\n readonly outcome: 'page';\n readonly protocol: number;\n readonly requestId: string;\n readonly revision: number;\n readonly generation: number;\n readonly records: readonly LibraryRecord[];\n readonly nextCursor: string | null;\n readonly total: number;\n readonly indexState: LibraryIndexState;\n}"
582
+ },
583
+ {
584
+ "name": "LibrarySearchRequest",
585
+ "declaration": "export interface LibrarySearchRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly query: string;\n readonly modalities: readonly string[];\n readonly limit: number;\n readonly cursor: string | null;\n readonly deadlineMs: number;\n}"
586
+ },
587
+ {
588
+ "name": "LibrarySearchResponse",
589
+ "declaration": "export type LibrarySearchResponse = LibrarySearchPage | LibraryCursorExpired | LibraryRequestRejected | LibraryDeadlineExceeded;"
590
+ },
591
+ {
592
+ "name": "ProviderTestRequest",
593
+ "declaration": "export interface ProviderTestRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly deadlineMs: number;\n readonly provider: string;\n readonly model: string;\n}"
594
+ },
595
+ {
596
+ "name": "ProviderTestResponse",
597
+ "declaration": "export interface ProviderTestResponse {\n readonly outcome: 'provider_test';\n readonly protocol: number;\n readonly requestId: string;\n readonly provider: string;\n readonly model: string;\n readonly ok: boolean;\n readonly credential: 'configured_unverified' | 'verified' | 'rejected';\n readonly reachability: 'reachable' | 'unreachable' | 'rate_limited' | 'unauthorized';\n readonly message: string;\n}"
598
+ },
599
+ {
600
+ "name": "ReadPlaneConfig",
601
+ "declaration": "export interface ReadPlaneConfig {\n readonly index: () => LibraryIndex;\n readonly scope: string;\n readonly generations?: LibraryGenerations;\n}"
602
+ },
603
+ {
604
+ "name": "RefreshOutcome",
605
+ "declaration": "export type RefreshOutcome = { readonly kind: 'refreshed'; readonly index: IndexGeneration; } | { readonly kind: 'cancelled'; readonly index: IndexGeneration; } | { readonly kind: 'failed'; readonly reason: string; readonly index: IndexGeneration; };"
606
+ },
607
+ {
608
+ "name": "RetrievalPath",
609
+ "declaration": "export type RetrievalPath = 'lexical' | 'semantic' | 'both';"
610
+ },
611
+ {
612
+ "name": "RouteReadinessReport",
613
+ "declaration": "export interface RouteReadinessReport {\n readonly outcome: 'route_readiness';\n readonly protocol: number;\n readonly requestId: string;\n readonly provider: string;\n readonly model: string;\n readonly proved: boolean;\n readonly reason: 'proved' | 'never_tested' | 'configuration_changed' | 'unreadable';\n}"
614
+ },
615
+ {
616
+ "name": "RouteReadinessRequest",
617
+ "declaration": "export interface RouteReadinessRequest {\n readonly protocol: number;\n readonly requestId: string;\n readonly deadlineMs: number;\n readonly provider: string;\n readonly model: string;\n}"
618
+ },
619
+ {
620
+ "name": "RouteReadinessResponse",
621
+ "declaration": "export type RouteReadinessResponse = RouteReadinessReport | LibraryRequestRejected | LibraryDeadlineExceeded;"
622
+ },
623
+ {
624
+ "name": "SearchHit",
625
+ "declaration": "export interface SearchHit {\n readonly sourceId: string;\n readonly sourceRevisionId: string;\n readonly range: TemporalRange | null;\n readonly text: string;\n readonly path: RetrievalPath;\n readonly score: number;\n readonly evidenceIds: readonly string[];\n}"
626
+ },
627
+ {
628
+ "name": "SearchResult",
629
+ "declaration": "export interface SearchResult {\n readonly sourceId: string;\n readonly title: string;\n readonly kind: SourceKind;\n readonly hits: readonly SearchHit[];\n readonly current: boolean;\n}"
630
+ },
631
+ {
632
+ "name": "SerializedIndex",
633
+ "declaration": "export interface SerializedIndex {\n readonly version: number;\n readonly digest: string;\n readonly builtAt: string;\n readonly documents: readonly IndexableRecord[];\n readonly postings: Readonly<Record<string, readonly string[]>>;\n}"
634
+ },
635
+ {
636
+ "name": "SourceKind",
637
+ "declaration": "export type SourceKind = 'video' | 'audio' | 'page' | 'stream' | 'document' | 'screen_capture';"
638
+ },
639
+ {
640
+ "name": "TemporalRange",
641
+ "declaration": "export interface TemporalRange {\n readonly startMs: number;\n readonly endMs: number;\n}"
642
+ }
643
+ ]
644
+ }
645
+ ],
646
+ "events": [],
647
+ "objects": []
648
+ },
649
+ }