@davesheffer/hunch 1.41.6 → 1.42.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.
- package/README.md +1 -1
- package/dist/cli/index.js +402 -154
- package/dist/constitution/experiment.d.ts +3 -3
- package/dist/constitution/g3.d.ts +1 -1
- package/dist/core/footprint.d.ts +15 -0
- package/dist/core/footprint.js +167 -0
- package/dist/core/groundingLag.d.ts +15 -0
- package/dist/core/groundingLag.js +27 -0
- package/dist/core/hookText.d.ts +4 -0
- package/dist/core/hookText.js +8 -0
- package/dist/core/pipeline.d.ts +28 -0
- package/dist/core/pipeline.js +50 -0
- package/dist/core/shellwrites.d.ts +7 -0
- package/dist/core/shellwrites.js +131 -0
- package/dist/core/siblingfix.d.ts +124 -0
- package/dist/core/siblingfix.js +814 -0
- package/dist/core/taskReportHook.d.ts +1 -1
- package/dist/core/taskReportHook.js +19 -3
- package/dist/extractors/git.d.ts +31 -0
- package/dist/extractors/git.js +180 -1
- package/dist/extractors/nativeTreeSitter.d.ts +2 -1
- package/dist/extractors/nativeTreeSitter.js +128 -30
- package/dist/integrations/claudemd.d.ts +20 -2
- package/dist/integrations/claudemd.js +79 -53
- package/dist/integrations/providers.d.ts +9 -5
- package/dist/integrations/providers.js +34 -22
- package/dist/integrations/team.d.ts +24 -4
- package/dist/integrations/team.js +154 -16
- package/dist/integrations/worktree.d.ts +3 -2
- package/dist/integrations/worktree.js +7 -4
- package/dist/mcp/server.d.ts +489 -0
- package/dist/mcp/server.js +208 -62
- package/dist/mcp/taskReportTools.js +12 -9
- package/dist/mcp/toolset.d.ts +11 -1
- package/dist/mcp/toolset.js +28 -8
- package/dist/store/hunchStore.d.ts +25 -1
- package/dist/store/hunchStore.js +146 -21
- package/dist/store/jsonStore.js +25 -4
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/mcp/server.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* diagnostics go to stderr.
|
|
8
8
|
*/
|
|
9
9
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
+
import { z } from "zod";
|
|
10
11
|
import { HunchStore } from "../store/hunchStore.js";
|
|
11
12
|
import { type StateFacet } from "../core/stateContract.js";
|
|
12
13
|
import type { Symbol } from "../core/types.js";
|
|
@@ -135,6 +136,493 @@ export declare const FILE_EVIDENCE_FIELD: Record<StateFacet, string | null>;
|
|
|
135
136
|
* construction, so anything other than an array of strings reads as no
|
|
136
137
|
* evidence instead of throwing. */
|
|
137
138
|
export declare function fileEvidenceFor(facet: StateFacet, record: Record<string, unknown>): string[];
|
|
139
|
+
/** The list view's gist of an observation: whole sentences until the gist says
|
|
140
|
+
* something (≥ FINDING_GIST_MIN chars), clipped to FINDING_GIST_CHARS. A
|
|
141
|
+
* period after an abbreviation or a list number is not a sentence end. */
|
|
142
|
+
export declare const firstSentence: (text: string) => string;
|
|
143
|
+
/** Public MCP shape for the canonical delivery envelope. Keeping the schema on
|
|
144
|
+
* the tool means orchestrators can consume receipt facts without scraping the
|
|
145
|
+
* backward-compatible text block. */
|
|
146
|
+
declare const DELIVERY_OUTPUT_SCHEMA: z.ZodObject<{
|
|
147
|
+
schema_version: z.ZodLiteral<"hunch.delivery-envelope/1">;
|
|
148
|
+
profile: z.ZodEnum<{
|
|
149
|
+
reviewer: "reviewer";
|
|
150
|
+
builder: "builder";
|
|
151
|
+
architect: "architect";
|
|
152
|
+
}>;
|
|
153
|
+
ranking_policy: z.ZodLiteral<"hunch.delivery-profile/1">;
|
|
154
|
+
receipt_id: z.ZodString;
|
|
155
|
+
text: z.ZodString;
|
|
156
|
+
delivered: z.ZodArray<z.ZodObject<{
|
|
157
|
+
kind: z.ZodEnum<{
|
|
158
|
+
decisions: "decisions";
|
|
159
|
+
constraints: "constraints";
|
|
160
|
+
resources: "resources";
|
|
161
|
+
bugs: "bugs";
|
|
162
|
+
findings: "findings";
|
|
163
|
+
relationships: "relationships";
|
|
164
|
+
}>;
|
|
165
|
+
record_id: z.ZodString;
|
|
166
|
+
rank: z.ZodNumber;
|
|
167
|
+
delivery_reason: z.ZodEnum<{
|
|
168
|
+
ranked: "ranked";
|
|
169
|
+
"blocking-reserved": "blocking-reserved";
|
|
170
|
+
}>;
|
|
171
|
+
provenance_status: z.ZodEnum<{
|
|
172
|
+
current: "current";
|
|
173
|
+
stale: "stale";
|
|
174
|
+
unverified: "unverified";
|
|
175
|
+
}>;
|
|
176
|
+
token_cost: z.ZodNumber;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
hypotheses: z.ZodArray<z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"decision">;
|
|
180
|
+
record_id: z.ZodString;
|
|
181
|
+
rank: z.ZodNumber;
|
|
182
|
+
why: z.ZodString;
|
|
183
|
+
where: z.ZodArray<z.ZodString>;
|
|
184
|
+
historical_pattern: z.ZodString;
|
|
185
|
+
verify: z.ZodString;
|
|
186
|
+
disprove: z.ZodString;
|
|
187
|
+
obligations: z.ZodArray<z.ZodObject<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
origin: z.ZodEnum<{
|
|
190
|
+
memory: "memory";
|
|
191
|
+
manual: "manual";
|
|
192
|
+
episode: "episode";
|
|
193
|
+
}>;
|
|
194
|
+
category: z.ZodEnum<{
|
|
195
|
+
evidence: "evidence";
|
|
196
|
+
types: "types";
|
|
197
|
+
behavior: "behavior";
|
|
198
|
+
serialization: "serialization";
|
|
199
|
+
compatibility: "compatibility";
|
|
200
|
+
other: "other";
|
|
201
|
+
}>;
|
|
202
|
+
phase: z.ZodEnum<{
|
|
203
|
+
session: "session";
|
|
204
|
+
"after-edit": "after-edit";
|
|
205
|
+
}>;
|
|
206
|
+
description: z.ZodString;
|
|
207
|
+
command_alternatives: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
208
|
+
expected: z.ZodObject<{
|
|
209
|
+
success: z.ZodBoolean;
|
|
210
|
+
output_includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
211
|
+
output_excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
obligations: z.ZodArray<z.ZodObject<{
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
origin: z.ZodEnum<{
|
|
218
|
+
memory: "memory";
|
|
219
|
+
manual: "manual";
|
|
220
|
+
episode: "episode";
|
|
221
|
+
}>;
|
|
222
|
+
category: z.ZodEnum<{
|
|
223
|
+
evidence: "evidence";
|
|
224
|
+
types: "types";
|
|
225
|
+
behavior: "behavior";
|
|
226
|
+
serialization: "serialization";
|
|
227
|
+
compatibility: "compatibility";
|
|
228
|
+
other: "other";
|
|
229
|
+
}>;
|
|
230
|
+
phase: z.ZodEnum<{
|
|
231
|
+
session: "session";
|
|
232
|
+
"after-edit": "after-edit";
|
|
233
|
+
}>;
|
|
234
|
+
description: z.ZodString;
|
|
235
|
+
command_alternatives: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
236
|
+
expected: z.ZodObject<{
|
|
237
|
+
success: z.ZodBoolean;
|
|
238
|
+
output_includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
239
|
+
output_excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
supplements: z.ZodArray<z.ZodObject<{
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
kind: z.ZodString;
|
|
245
|
+
delivered: z.ZodBoolean;
|
|
246
|
+
reason: z.ZodEnum<{
|
|
247
|
+
empty: "empty";
|
|
248
|
+
budget: "budget";
|
|
249
|
+
supplemental: "supplemental";
|
|
250
|
+
abstained: "abstained";
|
|
251
|
+
}>;
|
|
252
|
+
rank: z.ZodNumber;
|
|
253
|
+
token_cost: z.ZodNumber;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
omitted: z.ZodArray<z.ZodObject<{
|
|
256
|
+
kind: z.ZodEnum<{
|
|
257
|
+
decisions: "decisions";
|
|
258
|
+
constraints: "constraints";
|
|
259
|
+
resources: "resources";
|
|
260
|
+
bugs: "bugs";
|
|
261
|
+
findings: "findings";
|
|
262
|
+
relationships: "relationships";
|
|
263
|
+
}>;
|
|
264
|
+
record_id: z.ZodString;
|
|
265
|
+
reason: z.ZodEnum<{
|
|
266
|
+
retired: "retired";
|
|
267
|
+
"low-confidence": "low-confidence";
|
|
268
|
+
"landscape-cap": "landscape-cap";
|
|
269
|
+
budget: "budget";
|
|
270
|
+
"stale-provenance": "stale-provenance";
|
|
271
|
+
"endpoint-not-delivered": "endpoint-not-delivered";
|
|
272
|
+
"insufficient-context": "insufficient-context";
|
|
273
|
+
"low-relevance": "low-relevance";
|
|
274
|
+
"actionability-cap": "actionability-cap";
|
|
275
|
+
"profile-cap": "profile-cap";
|
|
276
|
+
}>;
|
|
277
|
+
detail: z.ZodString;
|
|
278
|
+
}, z.core.$strip>>;
|
|
279
|
+
omitted_total: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
omitted_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
omitted_by_reason: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
282
|
+
landscape: z.ZodNullable<z.ZodObject<{
|
|
283
|
+
schema: z.ZodLiteral<"hunch.landscape-fragment/1">;
|
|
284
|
+
authority: z.ZodLiteral<"human_confirmed">;
|
|
285
|
+
target: z.ZodString;
|
|
286
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
287
|
+
selectionReason: z.ZodEnum<{
|
|
288
|
+
"exact-target": "exact-target";
|
|
289
|
+
"task-match": "task-match";
|
|
290
|
+
"orientation-root": "orientation-root";
|
|
291
|
+
"graph-neighbor": "graph-neighbor";
|
|
292
|
+
"graph-connection": "graph-connection";
|
|
293
|
+
}>;
|
|
294
|
+
selectionRank: z.ZodNumber;
|
|
295
|
+
rank: z.ZodNumber;
|
|
296
|
+
deliveryReason: z.ZodLiteral<"ranked">;
|
|
297
|
+
required: z.ZodLiteral<false>;
|
|
298
|
+
blocking: z.ZodLiteral<false>;
|
|
299
|
+
provenanceStatus: z.ZodLiteral<"current">;
|
|
300
|
+
tokenCost: z.ZodNumber;
|
|
301
|
+
record: z.ZodObject<{
|
|
302
|
+
schema: z.ZodLiteral<"hunch.resource/1">;
|
|
303
|
+
id: z.ZodString;
|
|
304
|
+
kind: z.ZodString;
|
|
305
|
+
name: z.ZodString;
|
|
306
|
+
scope: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
307
|
+
locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
308
|
+
lifecycle: z.ZodDefault<z.ZodEnum<{
|
|
309
|
+
active: "active";
|
|
310
|
+
deprecated: "deprecated";
|
|
311
|
+
retired: "retired";
|
|
312
|
+
planned: "planned";
|
|
313
|
+
}>>;
|
|
314
|
+
criticality: z.ZodOptional<z.ZodEnum<{
|
|
315
|
+
low: "low";
|
|
316
|
+
medium: "medium";
|
|
317
|
+
high: "high";
|
|
318
|
+
critical: "critical";
|
|
319
|
+
}>>;
|
|
320
|
+
contract_version: z.ZodOptional<z.ZodString>;
|
|
321
|
+
provenance: z.ZodObject<{
|
|
322
|
+
source: z.ZodString;
|
|
323
|
+
confidence: z.ZodNumber;
|
|
324
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
325
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
currentness: z.ZodObject<{
|
|
328
|
+
status: z.ZodEnum<{
|
|
329
|
+
current: "current";
|
|
330
|
+
stale: "stale";
|
|
331
|
+
unverified: "unverified";
|
|
332
|
+
}>;
|
|
333
|
+
verified_at: z.ZodOptional<z.ZodString>;
|
|
334
|
+
source_revision: z.ZodOptional<z.ZodString>;
|
|
335
|
+
source_content_hash: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
|
|
338
|
+
created_at: z.ZodString;
|
|
339
|
+
updated_at: z.ZodString;
|
|
340
|
+
}, z.core.$strict>;
|
|
341
|
+
}, z.core.$strip>>;
|
|
342
|
+
relationships: z.ZodArray<z.ZodObject<{
|
|
343
|
+
selectionRank: z.ZodNumber;
|
|
344
|
+
rank: z.ZodNumber;
|
|
345
|
+
deliveryReason: z.ZodLiteral<"ranked">;
|
|
346
|
+
required: z.ZodLiteral<false>;
|
|
347
|
+
blocking: z.ZodLiteral<false>;
|
|
348
|
+
provenanceStatus: z.ZodLiteral<"current">;
|
|
349
|
+
tokenCost: z.ZodNumber;
|
|
350
|
+
selectionReason: z.ZodLiteral<"graph-connection">;
|
|
351
|
+
record: z.ZodObject<{
|
|
352
|
+
schema: z.ZodDefault<z.ZodEnum<{
|
|
353
|
+
"hunch.resource-relationship/1": "hunch.resource-relationship/1";
|
|
354
|
+
"hunch.edge/1": "hunch.edge/1";
|
|
355
|
+
}>>;
|
|
356
|
+
id: z.ZodString;
|
|
357
|
+
from: z.ZodString;
|
|
358
|
+
to: z.ZodString;
|
|
359
|
+
type: z.ZodEnum<{
|
|
360
|
+
depends_on: "depends_on";
|
|
361
|
+
calls: "calls";
|
|
362
|
+
imports: "imports";
|
|
363
|
+
contains: "contains";
|
|
364
|
+
implements: "implements";
|
|
365
|
+
supersedes: "supersedes";
|
|
366
|
+
related_to: "related_to";
|
|
367
|
+
references: "references";
|
|
368
|
+
provides: "provides";
|
|
369
|
+
belongs_to: "belongs_to";
|
|
370
|
+
implemented_by: "implemented_by";
|
|
371
|
+
invokes: "invokes";
|
|
372
|
+
exposes: "exposes";
|
|
373
|
+
publishes: "publishes";
|
|
374
|
+
consumes: "consumes";
|
|
375
|
+
reads_from: "reads_from";
|
|
376
|
+
writes_to: "writes_to";
|
|
377
|
+
builds: "builds";
|
|
378
|
+
tests: "tests";
|
|
379
|
+
deploys: "deploys";
|
|
380
|
+
deployed_on: "deployed_on";
|
|
381
|
+
owned_by: "owned_by";
|
|
382
|
+
monitored_by: "monitored_by";
|
|
383
|
+
governed_by: "governed_by";
|
|
384
|
+
source_of_truth_for: "source_of_truth_for";
|
|
385
|
+
compatible_with: "compatible_with";
|
|
386
|
+
replaces: "replaces";
|
|
387
|
+
}>;
|
|
388
|
+
reason: z.ZodDefault<z.ZodString>;
|
|
389
|
+
strength: z.ZodDefault<z.ZodNumber>;
|
|
390
|
+
provenance: z.ZodObject<{
|
|
391
|
+
source: z.ZodString;
|
|
392
|
+
confidence: z.ZodNumber;
|
|
393
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
394
|
+
last_verified: z.ZodOptional<z.ZodString>;
|
|
395
|
+
}, z.core.$strip>;
|
|
396
|
+
currentness: z.ZodOptional<z.ZodObject<{
|
|
397
|
+
status: z.ZodEnum<{
|
|
398
|
+
current: "current";
|
|
399
|
+
stale: "stale";
|
|
400
|
+
unverified: "unverified";
|
|
401
|
+
}>;
|
|
402
|
+
verified_at: z.ZodOptional<z.ZodString>;
|
|
403
|
+
source_revision: z.ZodOptional<z.ZodString>;
|
|
404
|
+
source_content_hash: z.ZodOptional<z.ZodString>;
|
|
405
|
+
}, z.core.$strict>>;
|
|
406
|
+
environment: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
407
|
+
criticality: z.ZodOptional<z.ZodEnum<{
|
|
408
|
+
low: "low";
|
|
409
|
+
medium: "medium";
|
|
410
|
+
high: "high";
|
|
411
|
+
critical: "critical";
|
|
412
|
+
}>>;
|
|
413
|
+
contract_version: z.ZodOptional<z.ZodString>;
|
|
414
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
|
|
415
|
+
}, z.core.$strict>;
|
|
416
|
+
}, z.core.$strip>>;
|
|
417
|
+
omitted: z.ZodArray<z.ZodObject<{
|
|
418
|
+
kind: z.ZodEnum<{
|
|
419
|
+
resources: "resources";
|
|
420
|
+
relationships: "relationships";
|
|
421
|
+
}>;
|
|
422
|
+
recordId: z.ZodString;
|
|
423
|
+
reason: z.ZodEnum<{
|
|
424
|
+
"landscape-cap": "landscape-cap";
|
|
425
|
+
budget: "budget";
|
|
426
|
+
"stale-provenance": "stale-provenance";
|
|
427
|
+
"endpoint-not-delivered": "endpoint-not-delivered";
|
|
428
|
+
}>;
|
|
429
|
+
detail: z.ZodString;
|
|
430
|
+
}, z.core.$strip>>;
|
|
431
|
+
reviewIds: z.ZodArray<z.ZodString>;
|
|
432
|
+
discoveryHashes: z.ZodArray<z.ZodString>;
|
|
433
|
+
sourceRevisions: z.ZodArray<z.ZodString>;
|
|
434
|
+
fragmentHash: z.ZodString;
|
|
435
|
+
}, z.core.$strip>>;
|
|
436
|
+
budget_tokens: z.ZodNumber;
|
|
437
|
+
used_chars: z.ZodNumber;
|
|
438
|
+
accounted_chars: z.ZodNumber;
|
|
439
|
+
blocking_overflow: z.ZodBoolean;
|
|
440
|
+
abstention: z.ZodObject<{
|
|
441
|
+
active: z.ZodBoolean;
|
|
442
|
+
withheld: z.ZodNumber;
|
|
443
|
+
reasons: z.ZodObject<{
|
|
444
|
+
"low-confidence": z.ZodNumber;
|
|
445
|
+
"insufficient-context": z.ZodNumber;
|
|
446
|
+
"low-relevance": z.ZodNumber;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
retry_hint: z.ZodNullable<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
/** What tools/list advertises for hunch_context (#368). The landscape fragment embeds
|
|
452
|
+
* the full Resource and Edge record schemas (~7k of the ~13k chars), which every
|
|
453
|
+
* schema-loading host would pay on every session; it is advertised by its identity
|
|
454
|
+
* fields only. The handler still parses the result with the full
|
|
455
|
+
* DELIVERY_OUTPUT_SCHEMA, so the delivered shape is exactly as strict as before. */
|
|
456
|
+
declare const DELIVERY_ADVERTISED_OUTPUT_SCHEMA: z.ZodObject<{
|
|
457
|
+
schema_version: z.ZodLiteral<"hunch.delivery-envelope/1">;
|
|
458
|
+
profile: z.ZodEnum<{
|
|
459
|
+
reviewer: "reviewer";
|
|
460
|
+
builder: "builder";
|
|
461
|
+
architect: "architect";
|
|
462
|
+
}>;
|
|
463
|
+
ranking_policy: z.ZodLiteral<"hunch.delivery-profile/1">;
|
|
464
|
+
receipt_id: z.ZodString;
|
|
465
|
+
text: z.ZodString;
|
|
466
|
+
hypotheses: z.ZodArray<z.ZodObject<{
|
|
467
|
+
kind: z.ZodLiteral<"decision">;
|
|
468
|
+
record_id: z.ZodString;
|
|
469
|
+
rank: z.ZodNumber;
|
|
470
|
+
why: z.ZodString;
|
|
471
|
+
where: z.ZodArray<z.ZodString>;
|
|
472
|
+
historical_pattern: z.ZodString;
|
|
473
|
+
verify: z.ZodString;
|
|
474
|
+
disprove: z.ZodString;
|
|
475
|
+
obligations: z.ZodArray<z.ZodObject<{
|
|
476
|
+
id: z.ZodString;
|
|
477
|
+
origin: z.ZodEnum<{
|
|
478
|
+
memory: "memory";
|
|
479
|
+
manual: "manual";
|
|
480
|
+
episode: "episode";
|
|
481
|
+
}>;
|
|
482
|
+
category: z.ZodEnum<{
|
|
483
|
+
evidence: "evidence";
|
|
484
|
+
types: "types";
|
|
485
|
+
behavior: "behavior";
|
|
486
|
+
serialization: "serialization";
|
|
487
|
+
compatibility: "compatibility";
|
|
488
|
+
other: "other";
|
|
489
|
+
}>;
|
|
490
|
+
phase: z.ZodEnum<{
|
|
491
|
+
session: "session";
|
|
492
|
+
"after-edit": "after-edit";
|
|
493
|
+
}>;
|
|
494
|
+
description: z.ZodString;
|
|
495
|
+
command_alternatives: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
496
|
+
expected: z.ZodObject<{
|
|
497
|
+
success: z.ZodBoolean;
|
|
498
|
+
output_includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
499
|
+
output_excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
500
|
+
}, z.core.$strip>;
|
|
501
|
+
}, z.core.$strip>>;
|
|
502
|
+
}, z.core.$strip>>;
|
|
503
|
+
obligations: z.ZodArray<z.ZodObject<{
|
|
504
|
+
id: z.ZodString;
|
|
505
|
+
origin: z.ZodEnum<{
|
|
506
|
+
memory: "memory";
|
|
507
|
+
manual: "manual";
|
|
508
|
+
episode: "episode";
|
|
509
|
+
}>;
|
|
510
|
+
category: z.ZodEnum<{
|
|
511
|
+
evidence: "evidence";
|
|
512
|
+
types: "types";
|
|
513
|
+
behavior: "behavior";
|
|
514
|
+
serialization: "serialization";
|
|
515
|
+
compatibility: "compatibility";
|
|
516
|
+
other: "other";
|
|
517
|
+
}>;
|
|
518
|
+
phase: z.ZodEnum<{
|
|
519
|
+
session: "session";
|
|
520
|
+
"after-edit": "after-edit";
|
|
521
|
+
}>;
|
|
522
|
+
description: z.ZodString;
|
|
523
|
+
command_alternatives: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
524
|
+
expected: z.ZodObject<{
|
|
525
|
+
success: z.ZodBoolean;
|
|
526
|
+
output_includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
527
|
+
output_excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
528
|
+
}, z.core.$strip>;
|
|
529
|
+
}, z.core.$strip>>;
|
|
530
|
+
omitted_total: z.ZodOptional<z.ZodNumber>;
|
|
531
|
+
omitted_truncated: z.ZodOptional<z.ZodBoolean>;
|
|
532
|
+
omitted_by_reason: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
533
|
+
budget_tokens: z.ZodNumber;
|
|
534
|
+
used_chars: z.ZodNumber;
|
|
535
|
+
accounted_chars: z.ZodNumber;
|
|
536
|
+
blocking_overflow: z.ZodBoolean;
|
|
537
|
+
abstention: z.ZodObject<{
|
|
538
|
+
active: z.ZodBoolean;
|
|
539
|
+
withheld: z.ZodNumber;
|
|
540
|
+
reasons: z.ZodObject<{
|
|
541
|
+
"low-confidence": z.ZodNumber;
|
|
542
|
+
"insufficient-context": z.ZodNumber;
|
|
543
|
+
"low-relevance": z.ZodNumber;
|
|
544
|
+
}, z.core.$strip>;
|
|
545
|
+
retry_hint: z.ZodNullable<z.ZodString>;
|
|
546
|
+
}, z.core.$strip>;
|
|
547
|
+
delivered: z.ZodArray<z.ZodObject<{
|
|
548
|
+
kind: z.ZodEnum<{
|
|
549
|
+
decisions: "decisions";
|
|
550
|
+
constraints: "constraints";
|
|
551
|
+
resources: "resources";
|
|
552
|
+
bugs: "bugs";
|
|
553
|
+
findings: "findings";
|
|
554
|
+
relationships: "relationships";
|
|
555
|
+
}>;
|
|
556
|
+
record_id: z.ZodString;
|
|
557
|
+
rank: z.ZodOptional<z.ZodNumber>;
|
|
558
|
+
delivery_reason: z.ZodOptional<z.ZodEnum<{
|
|
559
|
+
ranked: "ranked";
|
|
560
|
+
"blocking-reserved": "blocking-reserved";
|
|
561
|
+
}>>;
|
|
562
|
+
provenance_status: z.ZodOptional<z.ZodEnum<{
|
|
563
|
+
current: "current";
|
|
564
|
+
stale: "stale";
|
|
565
|
+
unverified: "unverified";
|
|
566
|
+
}>>;
|
|
567
|
+
token_cost: z.ZodOptional<z.ZodNumber>;
|
|
568
|
+
}, z.core.$strip>>;
|
|
569
|
+
supplements: z.ZodArray<z.ZodObject<{
|
|
570
|
+
id: z.ZodString;
|
|
571
|
+
kind: z.ZodString;
|
|
572
|
+
delivered: z.ZodBoolean;
|
|
573
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
574
|
+
empty: "empty";
|
|
575
|
+
budget: "budget";
|
|
576
|
+
supplemental: "supplemental";
|
|
577
|
+
abstained: "abstained";
|
|
578
|
+
}>>;
|
|
579
|
+
rank: z.ZodOptional<z.ZodNumber>;
|
|
580
|
+
token_cost: z.ZodOptional<z.ZodNumber>;
|
|
581
|
+
}, z.core.$strip>>;
|
|
582
|
+
omitted: z.ZodArray<z.ZodObject<{
|
|
583
|
+
kind: z.ZodEnum<{
|
|
584
|
+
decisions: "decisions";
|
|
585
|
+
constraints: "constraints";
|
|
586
|
+
resources: "resources";
|
|
587
|
+
bugs: "bugs";
|
|
588
|
+
findings: "findings";
|
|
589
|
+
relationships: "relationships";
|
|
590
|
+
}>;
|
|
591
|
+
record_id: z.ZodString;
|
|
592
|
+
reason: z.ZodEnum<{
|
|
593
|
+
retired: "retired";
|
|
594
|
+
"low-confidence": "low-confidence";
|
|
595
|
+
"landscape-cap": "landscape-cap";
|
|
596
|
+
budget: "budget";
|
|
597
|
+
"stale-provenance": "stale-provenance";
|
|
598
|
+
"endpoint-not-delivered": "endpoint-not-delivered";
|
|
599
|
+
"insufficient-context": "insufficient-context";
|
|
600
|
+
"low-relevance": "low-relevance";
|
|
601
|
+
"actionability-cap": "actionability-cap";
|
|
602
|
+
"profile-cap": "profile-cap";
|
|
603
|
+
}>;
|
|
604
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
605
|
+
}, z.core.$strip>>;
|
|
606
|
+
landscape: z.ZodNullable<z.ZodObject<{
|
|
607
|
+
schema: z.ZodLiteral<"hunch.landscape-fragment/1">;
|
|
608
|
+
target: z.ZodString;
|
|
609
|
+
fragmentHash: z.ZodString;
|
|
610
|
+
}, z.core.$loose>>;
|
|
611
|
+
}, z.core.$strip>;
|
|
612
|
+
/** What the MCP result names per record: enough to drill down (hunch_why), no
|
|
613
|
+
* more. A host shows the model either `content` or `structuredContent`, and
|
|
614
|
+
* `text` is the only brief a structured-only host sees, so every other field
|
|
615
|
+
* repeats what the brief already says; rank, costs and provenance stay in the
|
|
616
|
+
* receipt. Undelivered supplements are dropped (the brief never showed them). */
|
|
617
|
+
export declare function compactEnvelope(envelope: z.infer<typeof DELIVERY_OUTPUT_SCHEMA>): z.infer<typeof DELIVERY_ADVERTISED_OUTPUT_SCHEMA>;
|
|
618
|
+
/** The budget must govern the whole tool result, not only the brief: a host
|
|
619
|
+
* that shows the model structuredContent otherwise pays for one repeated
|
|
620
|
+
* sentence per withheld record (104 of them measured on this repo, issue #371).
|
|
621
|
+
* Keep a few ids — round-robin across reasons so every reason the brief cites
|
|
622
|
+
* keeps an id to pass to hunch_why, budget first — and count all of them by
|
|
623
|
+
* reason. Runs after recordServed and after the full envelope validated, so
|
|
624
|
+
* receipts and receipt_id are unchanged. */
|
|
625
|
+
export declare function compactOmissions(envelope: z.infer<typeof DELIVERY_OUTPUT_SCHEMA>): z.infer<typeof DELIVERY_ADVERTISED_OUTPUT_SCHEMA>;
|
|
138
626
|
/** Resolve a free-form target (symbol id / name / file path) to symbol records.
|
|
139
627
|
* Tiered exact-id > exact-name > exact-file > segment-anchored-suffix matching,
|
|
140
628
|
* shared with `HunchStore.why()` via `matchSymbolsTiered` so the two don't drift
|
|
@@ -173,3 +661,4 @@ export declare function buildServer(root: string): McpServer;
|
|
|
173
661
|
export declare function wireClientRoots(control: RootControlledServer, fallback: string): void;
|
|
174
662
|
/** Start the stdio server (called by `hunch mcp`). */
|
|
175
663
|
export declare function startServer(cwd?: string, options?: RootControlOptions): Promise<void>;
|
|
664
|
+
export {};
|