@duckwalk/mcp-server 0.1.2

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,568 @@
1
+ import { GuidedSession, StepStatus, SessionMode } from '@duckwalk/schema';
2
+
3
+ declare function getDuckWalkContract(): {
4
+ server: {
5
+ name: string;
6
+ version: string;
7
+ };
8
+ guidance: {
9
+ summary: string;
10
+ workspaceRoot: string;
11
+ gitignore: string;
12
+ commentStyle: string;
13
+ pathfinderAuthoringHints: string[];
14
+ recommendedFlow: string[];
15
+ };
16
+ tools: {
17
+ get_duckwalk_contract: {
18
+ description: string;
19
+ };
20
+ create_guided_session: {
21
+ description: string;
22
+ input: {
23
+ workspaceRoot: string;
24
+ session: string;
25
+ };
26
+ };
27
+ create_pr_review_session: {
28
+ description: string;
29
+ input: {
30
+ workspaceRoot: string;
31
+ session: string;
32
+ };
33
+ };
34
+ pathfinder: {
35
+ description: string;
36
+ input: {
37
+ workspaceRoot: string;
38
+ session: string;
39
+ };
40
+ };
41
+ get_guided_session: {
42
+ description: string;
43
+ input: {
44
+ workspaceRoot: string;
45
+ sessionId: string;
46
+ };
47
+ };
48
+ update_step_status: {
49
+ description: string;
50
+ input: {
51
+ workspaceRoot: string;
52
+ sessionId: string;
53
+ stepId: string;
54
+ status: string[];
55
+ };
56
+ };
57
+ };
58
+ schema: {
59
+ sessionModes: string[];
60
+ implementationStepRequiredFields: string[];
61
+ prReviewStepRequiredFields: string[];
62
+ codebaseWalkthroughRequiredFields: string[];
63
+ walkthroughFlowFields: string[];
64
+ walkthroughSubrangeFields: string[];
65
+ walkthroughLinkFields: string[];
66
+ walkthroughBranchFields: string[];
67
+ walkthroughFollowUpFields: string[];
68
+ optionalStepFields: string[];
69
+ guidedFileTargetFields: string[];
70
+ locationStrategies: string[];
71
+ explanationFields: string[];
72
+ validation: {
73
+ default: {
74
+ type: string;
75
+ };
76
+ optionalFields: string[];
77
+ };
78
+ prReviewRangeRule: string;
79
+ codebaseWalkthroughRangeRule: string;
80
+ codebaseWalkthroughSubrangeRules: string[];
81
+ };
82
+ examples: {
83
+ create_guided_session: {
84
+ workspaceRoot: string;
85
+ session: {
86
+ id: string;
87
+ mode: string;
88
+ title: string;
89
+ summary: string;
90
+ createdAt: string;
91
+ steps: {
92
+ id: string;
93
+ order: number;
94
+ mode: string;
95
+ file: {
96
+ path: string;
97
+ createIfMissing: boolean;
98
+ };
99
+ location: {
100
+ strategy: string;
101
+ };
102
+ explanation: {
103
+ title: string;
104
+ what: string;
105
+ why: string;
106
+ };
107
+ ghostCode: string;
108
+ validation: {
109
+ type: string;
110
+ };
111
+ }[];
112
+ };
113
+ };
114
+ create_pr_review_session: {
115
+ workspaceRoot: string;
116
+ session: {
117
+ id: string;
118
+ mode: string;
119
+ title: string;
120
+ summary: string;
121
+ createdAt: string;
122
+ steps: {
123
+ id: string;
124
+ order: number;
125
+ mode: string;
126
+ file: {
127
+ path: string;
128
+ };
129
+ location: {
130
+ strategy: string;
131
+ range: {
132
+ startLine: number;
133
+ startCharacter: number;
134
+ endLine: number;
135
+ endCharacter: number;
136
+ };
137
+ };
138
+ explanation: {
139
+ title: string;
140
+ what: string;
141
+ why: string;
142
+ impact: string;
143
+ };
144
+ review: {
145
+ beforeCode: string;
146
+ afterCode: string;
147
+ changedRange: {
148
+ startLine: number;
149
+ startCharacter: number;
150
+ endLine: number;
151
+ endCharacter: number;
152
+ };
153
+ };
154
+ }[];
155
+ };
156
+ };
157
+ pathfinder: {
158
+ workspaceRoot: string;
159
+ session: {
160
+ id: string;
161
+ mode: string;
162
+ title: string;
163
+ summary: string;
164
+ question: string;
165
+ lens: string;
166
+ flow: {
167
+ summary: string;
168
+ path: string[];
169
+ entrypoint: string;
170
+ outcome: string;
171
+ };
172
+ followUps: {
173
+ id: string;
174
+ kind: string;
175
+ label: string;
176
+ description: string;
177
+ file: string;
178
+ }[];
179
+ createdAt: string;
180
+ steps: ({
181
+ id: string;
182
+ order: number;
183
+ mode: string;
184
+ touchpoint: string;
185
+ confidence: string;
186
+ evidenceQuality: string;
187
+ fileRationale: string;
188
+ file: {
189
+ path: string;
190
+ };
191
+ location: {
192
+ strategy: string;
193
+ range: {
194
+ startLine: number;
195
+ startCharacter: number;
196
+ endLine: number;
197
+ endCharacter: number;
198
+ };
199
+ };
200
+ subranges: {
201
+ id: string;
202
+ label: string;
203
+ role: string;
204
+ range: {
205
+ startLine: number;
206
+ startCharacter: number;
207
+ endLine: number;
208
+ endCharacter: number;
209
+ };
210
+ summary: string;
211
+ symbols: string[];
212
+ }[];
213
+ symbols: string[];
214
+ explanation: {
215
+ title: string;
216
+ what: string;
217
+ why: string;
218
+ how: string;
219
+ impact: string;
220
+ };
221
+ snippet: string;
222
+ links: {
223
+ stepId: string;
224
+ subrangeId: string;
225
+ type: string;
226
+ why: string;
227
+ viaSymbol: string;
228
+ }[];
229
+ branches: ({
230
+ id: string;
231
+ label: string;
232
+ condition: string;
233
+ outcome: string;
234
+ targetStepId?: never;
235
+ targetSubrangeId?: never;
236
+ } | {
237
+ id: string;
238
+ label: string;
239
+ condition: string;
240
+ outcome: string;
241
+ targetStepId: string;
242
+ targetSubrangeId: string;
243
+ })[];
244
+ } | {
245
+ id: string;
246
+ order: number;
247
+ mode: string;
248
+ touchpoint: string;
249
+ confidence: string;
250
+ evidenceQuality: string;
251
+ fileRationale: string;
252
+ file: {
253
+ path: string;
254
+ };
255
+ location: {
256
+ strategy: string;
257
+ range: {
258
+ startLine: number;
259
+ startCharacter: number;
260
+ endLine: number;
261
+ endCharacter: number;
262
+ };
263
+ };
264
+ subranges: {
265
+ id: string;
266
+ label: string;
267
+ role: string;
268
+ range: {
269
+ startLine: number;
270
+ startCharacter: number;
271
+ endLine: number;
272
+ endCharacter: number;
273
+ };
274
+ summary: string;
275
+ symbols: string[];
276
+ }[];
277
+ symbols: string[];
278
+ explanation: {
279
+ title: string;
280
+ what: string;
281
+ why: string;
282
+ how: string;
283
+ impact?: never;
284
+ };
285
+ snippet: string;
286
+ links?: never;
287
+ branches?: never;
288
+ })[];
289
+ };
290
+ };
291
+ };
292
+ };
293
+
294
+ type CreateGuidedSessionResult = {
295
+ sessionId: string;
296
+ recipePath: string;
297
+ markdownPath: string;
298
+ statePath: string;
299
+ };
300
+
301
+ declare function validateGuidedSessionInput(input: {
302
+ session: GuidedSession;
303
+ expectMode?: SessionMode;
304
+ }): {
305
+ valid: boolean;
306
+ session: {
307
+ id: string;
308
+ mode: "implementation" | "pr_review" | "codebase_walkthrough";
309
+ title: string;
310
+ summary: string;
311
+ stepCount: number;
312
+ files: string[];
313
+ locationStrategies: ("create_file" | "line" | "range" | "after_text" | "before_text")[];
314
+ };
315
+ };
316
+ declare function createGuidedSession(rootDir: string, sessionInput: GuidedSession): Promise<CreateGuidedSessionResult>;
317
+ declare function createPrReviewSession(rootDir: string, sessionInput: GuidedSession): Promise<CreateGuidedSessionResult>;
318
+ declare function pathfinder(rootDir: string, sessionInput: GuidedSession): Promise<CreateGuidedSessionResult>;
319
+ declare function getGuidedSession(rootDir: string, sessionId?: string): Promise<{
320
+ session: {
321
+ title: string;
322
+ id: string;
323
+ summary: string;
324
+ mode: "implementation" | "pr_review" | "codebase_walkthrough";
325
+ createdAt: string;
326
+ steps: ({
327
+ id: string;
328
+ file: {
329
+ path: string;
330
+ exists?: boolean | undefined;
331
+ createIfMissing?: boolean | undefined;
332
+ };
333
+ order: number;
334
+ mode: "implementation";
335
+ location: {
336
+ strategy: "create_file" | "line" | "range" | "after_text" | "before_text";
337
+ line?: number | undefined;
338
+ range?: {
339
+ startLine: number;
340
+ startCharacter: number;
341
+ endLine: number;
342
+ endCharacter: number;
343
+ } | undefined;
344
+ column?: number | undefined;
345
+ anchorText?: string | undefined;
346
+ };
347
+ explanation: {
348
+ title: string;
349
+ what: string;
350
+ why: string;
351
+ how?: string | undefined;
352
+ impact?: string | undefined;
353
+ risk?: string | undefined;
354
+ narration?: {
355
+ short: string;
356
+ detailed?: string | undefined;
357
+ } | undefined;
358
+ };
359
+ ghostCode: string;
360
+ validation?: {
361
+ type: "normalised_match";
362
+ expectedText?: string | undefined;
363
+ scope?: "range" | "file" | undefined;
364
+ } | undefined;
365
+ status?: "pending" | "active" | "complete" | "skipped" | undefined;
366
+ symbols?: string[] | undefined;
367
+ subranges?: {
368
+ range: {
369
+ startLine: number;
370
+ startCharacter: number;
371
+ endLine: number;
372
+ endCharacter: number;
373
+ };
374
+ id: string;
375
+ label: string;
376
+ role: "primary" | "action" | "context";
377
+ summary?: string | undefined;
378
+ snippet?: string | undefined;
379
+ symbols?: string[] | undefined;
380
+ }[] | undefined;
381
+ } | {
382
+ id: string;
383
+ file: {
384
+ path: string;
385
+ exists?: boolean | undefined;
386
+ createIfMissing?: boolean | undefined;
387
+ };
388
+ order: number;
389
+ mode: "pr_review";
390
+ location: {
391
+ strategy: "create_file" | "line" | "range" | "after_text" | "before_text";
392
+ line?: number | undefined;
393
+ range?: {
394
+ startLine: number;
395
+ startCharacter: number;
396
+ endLine: number;
397
+ endCharacter: number;
398
+ } | undefined;
399
+ column?: number | undefined;
400
+ anchorText?: string | undefined;
401
+ };
402
+ explanation: {
403
+ title: string;
404
+ what: string;
405
+ why: string;
406
+ how?: string | undefined;
407
+ impact?: string | undefined;
408
+ risk?: string | undefined;
409
+ narration?: {
410
+ short: string;
411
+ detailed?: string | undefined;
412
+ } | undefined;
413
+ };
414
+ review: {
415
+ beforeCode?: string | undefined;
416
+ afterCode?: string | undefined;
417
+ changedRange?: {
418
+ startLine: number;
419
+ startCharacter: number;
420
+ endLine: number;
421
+ endCharacter: number;
422
+ } | undefined;
423
+ };
424
+ validation?: {
425
+ type: "normalised_match";
426
+ expectedText?: string | undefined;
427
+ scope?: "range" | "file" | undefined;
428
+ } | undefined;
429
+ status?: "pending" | "active" | "complete" | "skipped" | undefined;
430
+ symbols?: string[] | undefined;
431
+ subranges?: {
432
+ range: {
433
+ startLine: number;
434
+ startCharacter: number;
435
+ endLine: number;
436
+ endCharacter: number;
437
+ };
438
+ id: string;
439
+ label: string;
440
+ role: "primary" | "action" | "context";
441
+ summary?: string | undefined;
442
+ snippet?: string | undefined;
443
+ symbols?: string[] | undefined;
444
+ }[] | undefined;
445
+ } | {
446
+ id: string;
447
+ snippet: string;
448
+ file: {
449
+ path: string;
450
+ exists?: boolean | undefined;
451
+ createIfMissing?: boolean | undefined;
452
+ };
453
+ order: number;
454
+ mode: "codebase_walkthrough";
455
+ location: {
456
+ strategy: "create_file" | "line" | "range" | "after_text" | "before_text";
457
+ line?: number | undefined;
458
+ range?: {
459
+ startLine: number;
460
+ startCharacter: number;
461
+ endLine: number;
462
+ endCharacter: number;
463
+ } | undefined;
464
+ column?: number | undefined;
465
+ anchorText?: string | undefined;
466
+ };
467
+ explanation: {
468
+ title: string;
469
+ what: string;
470
+ why: string;
471
+ how?: string | undefined;
472
+ impact?: string | undefined;
473
+ risk?: string | undefined;
474
+ narration?: {
475
+ short: string;
476
+ detailed?: string | undefined;
477
+ } | undefined;
478
+ };
479
+ touchpoint: "entry" | "guard" | "read" | "write" | "transform" | "emit" | "respond" | "config";
480
+ confidence: "direct" | "mixed" | "inferred";
481
+ evidenceQuality: "high" | "medium" | "low";
482
+ fileRationale: string;
483
+ validation?: {
484
+ type: "normalised_match";
485
+ expectedText?: string | undefined;
486
+ scope?: "range" | "file" | undefined;
487
+ } | undefined;
488
+ status?: "pending" | "active" | "complete" | "skipped" | undefined;
489
+ symbols?: string[] | undefined;
490
+ subranges?: {
491
+ range: {
492
+ startLine: number;
493
+ startCharacter: number;
494
+ endLine: number;
495
+ endCharacter: number;
496
+ };
497
+ id: string;
498
+ label: string;
499
+ role: "primary" | "action" | "context";
500
+ summary?: string | undefined;
501
+ snippet?: string | undefined;
502
+ symbols?: string[] | undefined;
503
+ }[] | undefined;
504
+ links?: {
505
+ type: "calls" | "returns" | "guards" | "dispatches" | "reads" | "writes" | "configures" | "emits";
506
+ why: string;
507
+ stepId: string;
508
+ subrangeId?: string | undefined;
509
+ viaSymbol?: string | undefined;
510
+ }[] | undefined;
511
+ branches?: {
512
+ id: string;
513
+ label: string;
514
+ condition: string;
515
+ outcome: string;
516
+ targetStepId?: string | undefined;
517
+ targetSubrangeId?: string | undefined;
518
+ }[] | undefined;
519
+ })[];
520
+ question?: string | undefined;
521
+ lens?: "request_flow" | "data_flow" | "permission_flow" | "error_path" | "config_dependency_flow" | undefined;
522
+ flow?: {
523
+ path: string[];
524
+ summary: string;
525
+ outcome?: string | undefined;
526
+ entrypoint?: string | undefined;
527
+ } | undefined;
528
+ followUps?: {
529
+ id: string;
530
+ label: string;
531
+ kind: "implementation" | "config" | "tests" | "docs" | "investigate";
532
+ description: string;
533
+ stepId?: string | undefined;
534
+ file?: string | undefined;
535
+ }[] | undefined;
536
+ };
537
+ state: {
538
+ steps: Record<string, {
539
+ status: "pending" | "active" | "complete" | "skipped";
540
+ completedAt?: string | undefined;
541
+ }>;
542
+ sessionId: string;
543
+ activeStepId: string | null;
544
+ activeStepOrder: number | null;
545
+ updatedAt: string;
546
+ } | null;
547
+ }>;
548
+ declare function updateStepStatus(rootDir: string, input: {
549
+ sessionId: string;
550
+ stepId: string;
551
+ status: StepStatus;
552
+ }): Promise<{
553
+ sessionId: string;
554
+ stepId: string;
555
+ status: "pending" | "active" | "complete" | "skipped";
556
+ state: {
557
+ steps: Record<string, {
558
+ status: "pending" | "active" | "complete" | "skipped";
559
+ completedAt?: string | undefined;
560
+ }>;
561
+ sessionId: string;
562
+ activeStepId: string | null;
563
+ activeStepOrder: number | null;
564
+ updatedAt: string;
565
+ };
566
+ }>;
567
+
568
+ export { type CreateGuidedSessionResult, createGuidedSession, createPrReviewSession, getDuckWalkContract, getGuidedSession, pathfinder, updateStepStatus, validateGuidedSessionInput };
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import {
2
+ createGuidedSession,
3
+ createPrReviewSession,
4
+ getDuckWalkContract,
5
+ getGuidedSession,
6
+ pathfinder,
7
+ updateStepStatus,
8
+ validateGuidedSessionInput
9
+ } from "./chunk-IIW4JPFI.js";
10
+ export {
11
+ createGuidedSession,
12
+ createPrReviewSession,
13
+ getDuckWalkContract,
14
+ getGuidedSession,
15
+ pathfinder,
16
+ updateStepStatus,
17
+ validateGuidedSessionInput
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }