dsh-plugin-sessiongraph-tool 0.0.0-stage → 0.1.1

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,539 @@
1
+ /**
2
+ * The `sessiongraph` tool family's model-facing schemas: the parameters the model fills in, the
3
+ * per-operation defaults the seam refuses to guess, and the canonical value each operation returns.
4
+ *
5
+ * The query vocabulary itself is owned by the seam (`SESSIONGRAPH_OPERATIONS`,
6
+ * `SESSIONGRAPH_ENTRY_KINDS`) and re-exported here rather than copied, so adding an entry kind in the
7
+ * service package cannot leave the model's `kinds` filter behind. The output is a closed `oneOf` keyed
8
+ * on `operation`, not one loose object with every field optional, so a Code Mode program that switches
9
+ * on `operation` gets exactly the fields that operation produces and nothing it must test for.
10
+ * @module dsh-plugin-sessiongraph-tool/schema
11
+ */
12
+ import type { InferArgs, InferValue } from '@deepseek-ai/dsh-tools';
13
+ import { SESSIONGRAPH_ENTRY_KINDS, SESSIONGRAPH_OPERATIONS } from 'dsh-plugin-sessiongraph-service';
14
+ import type { SessiongraphOperation } from 'dsh-plugin-sessiongraph-service';
15
+ export { SESSIONGRAPH_ENTRY_KINDS, SESSIONGRAPH_OPERATIONS };
16
+ /**
17
+ * Every operation the tool family exposes: the seam's five query operations plus `index`, which lives
18
+ * on the dedicated `sessiongraph_index` tool because a full index run needs its own, much larger
19
+ * timeout budget than a query.
20
+ */
21
+ export declare const SESSIONGRAPH_TOOL_OPERATIONS: readonly ["search", "session", "timeline", "workspaces", "status", "index"];
22
+ /** One operation across the tool family. */
23
+ export type SessiongraphToolOperation = (typeof SESSIONGRAPH_TOOL_OPERATIONS)[number];
24
+ /** One query-side operation, i.e. everything `sessiongraph` answers and `sessiongraph_index` does not. */
25
+ export type SessiongraphQueryOperation = SessiongraphOperation;
26
+ /**
27
+ * Results returned per operation when the model names no `limit`.
28
+ *
29
+ * The seam requires a `limit` on every list request and has no opinion on its value, so the consumer
30
+ * owns the defaults: a search answers with a short, scannable list, a session with enough entries to
31
+ * be worth opening, and a workspace census with the whole machine in one page.
32
+ */
33
+ export declare const SESSIONGRAPH_DEFAULT_LIMITS: {
34
+ readonly search: 10;
35
+ readonly session: 200;
36
+ readonly timeline: 20;
37
+ readonly workspaces: 50;
38
+ };
39
+ /** The canonical value every `sessiongraph` or `sessiongraph_index` call returns, keyed on `operation`. */
40
+ export declare const SESSIONGRAPH_OUTPUT_SCHEMA: {
41
+ readonly oneOf: readonly [{
42
+ readonly type: "object";
43
+ readonly additionalProperties: false;
44
+ readonly properties: {
45
+ readonly operation: {
46
+ readonly type: "string";
47
+ readonly required: true;
48
+ readonly const: "search";
49
+ };
50
+ } & {
51
+ readonly stale: {
52
+ readonly type: "boolean";
53
+ };
54
+ readonly total: {
55
+ readonly type: "integer";
56
+ readonly required: true;
57
+ };
58
+ readonly truncated: {
59
+ readonly type: "boolean";
60
+ readonly required: true;
61
+ };
62
+ readonly hits: {
63
+ readonly type: "array";
64
+ readonly required: true;
65
+ readonly items: {
66
+ readonly type: "object";
67
+ readonly additionalProperties: false;
68
+ readonly properties: {
69
+ readonly session_id: {
70
+ readonly type: "string";
71
+ readonly required: true;
72
+ };
73
+ readonly title: {
74
+ readonly type: "string";
75
+ };
76
+ readonly workspace: {
77
+ readonly type: "string";
78
+ readonly required: true;
79
+ };
80
+ readonly time: {
81
+ readonly type: "integer";
82
+ readonly required: true;
83
+ };
84
+ readonly kind: {
85
+ readonly type: "string";
86
+ readonly required: true;
87
+ };
88
+ readonly seq: {
89
+ readonly type: "integer";
90
+ readonly required: true;
91
+ };
92
+ readonly turn: {
93
+ readonly type: "integer";
94
+ };
95
+ readonly snippet: {
96
+ readonly type: "string";
97
+ readonly required: true;
98
+ };
99
+ readonly length: {
100
+ readonly type: "integer";
101
+ readonly required: true;
102
+ };
103
+ };
104
+ };
105
+ };
106
+ };
107
+ }, {
108
+ readonly type: "object";
109
+ readonly additionalProperties: false;
110
+ readonly properties: {
111
+ readonly operation: {
112
+ readonly type: "string";
113
+ readonly required: true;
114
+ readonly const: "session";
115
+ };
116
+ } & {
117
+ readonly stale: {
118
+ readonly type: "boolean";
119
+ };
120
+ readonly session: {
121
+ readonly required: true;
122
+ readonly type: "object";
123
+ readonly additionalProperties: false;
124
+ readonly properties: {
125
+ readonly session_id: {
126
+ readonly type: "string";
127
+ readonly required: true;
128
+ };
129
+ readonly title: {
130
+ readonly type: "string";
131
+ };
132
+ readonly workspace: {
133
+ readonly type: "string";
134
+ readonly required: true;
135
+ };
136
+ readonly created_at: {
137
+ readonly type: "integer";
138
+ readonly required: true;
139
+ };
140
+ readonly last_at: {
141
+ readonly type: "integer";
142
+ readonly required: true;
143
+ };
144
+ readonly turns: {
145
+ readonly type: "integer";
146
+ readonly required: true;
147
+ };
148
+ readonly entries: {
149
+ readonly type: "integer";
150
+ readonly required: true;
151
+ };
152
+ readonly parent_session: {
153
+ readonly type: "string";
154
+ };
155
+ readonly origin: {
156
+ readonly type: "string";
157
+ };
158
+ readonly agent_preset: {
159
+ readonly type: "string";
160
+ };
161
+ };
162
+ };
163
+ readonly entries: {
164
+ readonly type: "array";
165
+ readonly required: true;
166
+ readonly items: {
167
+ readonly type: "object";
168
+ readonly additionalProperties: false;
169
+ readonly properties: {
170
+ readonly seq: {
171
+ readonly type: "integer";
172
+ readonly required: true;
173
+ };
174
+ readonly time: {
175
+ readonly type: "integer";
176
+ readonly required: true;
177
+ };
178
+ readonly kind: {
179
+ readonly type: "string";
180
+ readonly required: true;
181
+ };
182
+ readonly turn: {
183
+ readonly type: "integer";
184
+ };
185
+ readonly text: {
186
+ readonly type: "string";
187
+ readonly required: true;
188
+ };
189
+ readonly clipped: {
190
+ readonly type: "boolean";
191
+ readonly required: true;
192
+ };
193
+ };
194
+ };
195
+ };
196
+ readonly children: {
197
+ readonly type: "array";
198
+ readonly required: true;
199
+ readonly items: {
200
+ readonly type: "string";
201
+ };
202
+ };
203
+ readonly truncated: {
204
+ readonly type: "boolean";
205
+ readonly required: true;
206
+ };
207
+ };
208
+ }, {
209
+ readonly type: "object";
210
+ readonly additionalProperties: false;
211
+ readonly properties: {
212
+ readonly operation: {
213
+ readonly type: "string";
214
+ readonly required: true;
215
+ readonly const: "timeline";
216
+ };
217
+ } & {
218
+ readonly stale: {
219
+ readonly type: "boolean";
220
+ };
221
+ readonly sessions: {
222
+ readonly type: "array";
223
+ readonly required: true;
224
+ readonly items: {
225
+ readonly type: "object";
226
+ readonly additionalProperties: false;
227
+ readonly properties: {
228
+ readonly session_id: {
229
+ readonly type: "string";
230
+ readonly required: true;
231
+ };
232
+ readonly title: {
233
+ readonly type: "string";
234
+ };
235
+ readonly workspace: {
236
+ readonly type: "string";
237
+ readonly required: true;
238
+ };
239
+ readonly created_at: {
240
+ readonly type: "integer";
241
+ readonly required: true;
242
+ };
243
+ readonly last_at: {
244
+ readonly type: "integer";
245
+ readonly required: true;
246
+ };
247
+ readonly turns: {
248
+ readonly type: "integer";
249
+ readonly required: true;
250
+ };
251
+ readonly entries: {
252
+ readonly type: "integer";
253
+ readonly required: true;
254
+ };
255
+ readonly parent_session: {
256
+ readonly type: "string";
257
+ };
258
+ readonly origin: {
259
+ readonly type: "string";
260
+ };
261
+ readonly agent_preset: {
262
+ readonly type: "string";
263
+ };
264
+ };
265
+ };
266
+ };
267
+ readonly truncated: {
268
+ readonly type: "boolean";
269
+ readonly required: true;
270
+ };
271
+ };
272
+ }, {
273
+ readonly type: "object";
274
+ readonly additionalProperties: false;
275
+ readonly properties: {
276
+ readonly operation: {
277
+ readonly type: "string";
278
+ readonly required: true;
279
+ readonly const: "workspaces";
280
+ };
281
+ } & {
282
+ readonly stale: {
283
+ readonly type: "boolean";
284
+ };
285
+ readonly workspaces: {
286
+ readonly type: "array";
287
+ readonly required: true;
288
+ readonly items: {
289
+ readonly type: "object";
290
+ readonly additionalProperties: false;
291
+ readonly properties: {
292
+ readonly workspace: {
293
+ readonly type: "string";
294
+ readonly required: true;
295
+ };
296
+ readonly sessions: {
297
+ readonly type: "integer";
298
+ readonly required: true;
299
+ };
300
+ readonly entries: {
301
+ readonly type: "integer";
302
+ readonly required: true;
303
+ };
304
+ readonly first_at: {
305
+ readonly type: "integer";
306
+ readonly required: true;
307
+ };
308
+ readonly last_at: {
309
+ readonly type: "integer";
310
+ readonly required: true;
311
+ };
312
+ };
313
+ };
314
+ };
315
+ readonly total: {
316
+ readonly type: "integer";
317
+ readonly required: true;
318
+ };
319
+ };
320
+ }, {
321
+ readonly type: "object";
322
+ readonly additionalProperties: false;
323
+ readonly properties: {
324
+ readonly operation: {
325
+ readonly type: "string";
326
+ readonly required: true;
327
+ readonly const: "status";
328
+ };
329
+ } & {
330
+ readonly indexed: {
331
+ readonly type: "boolean";
332
+ readonly required: true;
333
+ };
334
+ readonly index_path: {
335
+ readonly type: "string";
336
+ readonly required: true;
337
+ };
338
+ readonly sessions: {
339
+ readonly type: "integer";
340
+ readonly required: true;
341
+ };
342
+ readonly entries: {
343
+ readonly type: "integer";
344
+ readonly required: true;
345
+ };
346
+ readonly workspaces: {
347
+ readonly type: "integer";
348
+ readonly required: true;
349
+ };
350
+ readonly live_sessions: {
351
+ readonly type: "integer";
352
+ readonly required: true;
353
+ };
354
+ readonly indexed_at: {
355
+ readonly type: "integer";
356
+ };
357
+ readonly bytes: {
358
+ readonly type: "integer";
359
+ readonly required: true;
360
+ };
361
+ };
362
+ }, {
363
+ readonly type: "object";
364
+ readonly additionalProperties: false;
365
+ readonly properties: {
366
+ readonly operation: {
367
+ readonly type: "string";
368
+ readonly required: true;
369
+ readonly const: "index";
370
+ };
371
+ } & {
372
+ readonly status: {
373
+ readonly type: "string";
374
+ readonly required: true;
375
+ readonly const: "started";
376
+ };
377
+ readonly job_id: {
378
+ readonly type: "string";
379
+ readonly required: true;
380
+ };
381
+ };
382
+ }, {
383
+ readonly type: "object";
384
+ readonly additionalProperties: false;
385
+ readonly properties: {
386
+ readonly operation: {
387
+ readonly type: "string";
388
+ readonly required: true;
389
+ readonly const: "index";
390
+ };
391
+ } & {
392
+ readonly index_path: {
393
+ readonly type: "string";
394
+ readonly required: true;
395
+ };
396
+ readonly added: {
397
+ readonly type: "integer";
398
+ readonly required: true;
399
+ };
400
+ readonly updated: {
401
+ readonly type: "integer";
402
+ readonly required: true;
403
+ };
404
+ readonly skipped: {
405
+ readonly type: "integer";
406
+ readonly required: true;
407
+ };
408
+ readonly removed: {
409
+ readonly type: "integer";
410
+ readonly required: true;
411
+ };
412
+ readonly discovered: {
413
+ readonly type: "integer";
414
+ readonly required: true;
415
+ };
416
+ readonly failed: {
417
+ readonly type: "array";
418
+ readonly required: true;
419
+ readonly items: {
420
+ readonly type: "object";
421
+ readonly additionalProperties: false;
422
+ readonly properties: {
423
+ readonly path: {
424
+ readonly type: "string";
425
+ readonly required: true;
426
+ };
427
+ readonly reason: {
428
+ readonly type: "string";
429
+ readonly required: true;
430
+ };
431
+ };
432
+ };
433
+ };
434
+ readonly live_sessions: {
435
+ readonly type: "integer";
436
+ readonly required: true;
437
+ };
438
+ readonly entries: {
439
+ readonly type: "integer";
440
+ readonly required: true;
441
+ };
442
+ readonly sessions: {
443
+ readonly type: "integer";
444
+ readonly required: true;
445
+ };
446
+ readonly workspaces: {
447
+ readonly type: "integer";
448
+ readonly required: true;
449
+ };
450
+ readonly bytes: {
451
+ readonly type: "integer";
452
+ readonly required: true;
453
+ };
454
+ readonly elapsed_ms: {
455
+ readonly type: "integer";
456
+ readonly required: true;
457
+ };
458
+ };
459
+ }];
460
+ };
461
+ /**
462
+ * The parameters the model fills in for the query tool. Which ones apply depends on `operation`; the
463
+ * conditional requirements (`query` for `search`, `session_id` for `session`) are enforced when the
464
+ * request is built, because the parameter DSL has no per-operation conditionals.
465
+ */
466
+ export declare const SESSIONGRAPH_PARAMETERS: {
467
+ readonly operation: {
468
+ readonly type: "string";
469
+ readonly required: true;
470
+ readonly enum: readonly ["search", "session", "timeline", "workspaces", "status"];
471
+ readonly description: "search(跨会话全文检索)、session(按 id 或唯一前缀读一个会话)、timeline(按时间列会话,新→旧)、workspaces(工作区清单与统计)、status(索引自身状态)。status 是唯一在还没有索引时也能回答的操作;要建或刷新索引请调用 sessiongraph_index 工具。";
472
+ };
473
+ readonly query: {
474
+ readonly type: "string";
475
+ readonly description: "search 必填:检索词。中文按双字切分,两字词即可命中(例如「广告」)。";
476
+ };
477
+ readonly session_id: {
478
+ readonly type: "string";
479
+ readonly description: "session 必填:完整会话 id,或长到只指向一个会话的前缀。";
480
+ };
481
+ readonly workspace: {
482
+ readonly type: "string";
483
+ readonly description: "只看某个工作区:精确的 cwd,或不带结尾斜杠的路径前缀。";
484
+ };
485
+ readonly after: {
486
+ readonly type: "number";
487
+ readonly description: "只要这个 epoch 毫秒时间点之后(含)的条目/会话。";
488
+ };
489
+ readonly before: {
490
+ readonly type: "number";
491
+ readonly description: "只要这个 epoch 毫秒时间点之前(含)的条目/会话。";
492
+ };
493
+ readonly kinds: {
494
+ readonly type: "array";
495
+ readonly items: {
496
+ readonly type: "string";
497
+ readonly enum: readonly ["user", "assistant", "tool", "title"];
498
+ };
499
+ readonly description: "只看这些条目类型:user(人真正打的字)、assistant(模型可见回复)、tool(工具调用的名字与参数)、title(会话标题)。省略即全部。";
500
+ };
501
+ readonly limit: {
502
+ readonly type: "number";
503
+ readonly description: "最多返回多少条;超出配置上限会被截断。省略按操作给默认值:search 10、timeline 20、workspaces 50、session 200 条 entries。";
504
+ };
505
+ readonly offset: {
506
+ readonly type: "number";
507
+ readonly description: "跳过前多少条,用于翻页。";
508
+ };
509
+ };
510
+ /**
511
+ * The parameters the dedicated `sessiongraph_index` tool takes: what to (re)build. It needs no
512
+ * `operation` — building the index is the only thing this tool does — and none of the query-side
513
+ * fields (`query`, `limit`, …), which an index run has no use for.
514
+ */
515
+ export declare const SESSIONGRAPH_INDEX_PARAMETERS: {
516
+ readonly force: {
517
+ readonly type: "boolean";
518
+ readonly description: "全量重建:不跳过源文件自上次索引后没有变化的会话。";
519
+ };
520
+ readonly workspace: {
521
+ readonly type: "string";
522
+ readonly description: "只索引 cwd 匹配这个工作区(精确,或不带结尾斜杠的路径前缀)的会话。";
523
+ };
524
+ readonly session_id: {
525
+ readonly type: "string";
526
+ readonly description: "只索引一个会话,按完整 id 或唯一前缀。";
527
+ };
528
+ };
529
+ /** The canonical value, inferred from {@link SESSIONGRAPH_OUTPUT_SCHEMA} so the two cannot drift. */
530
+ export type SessiongraphToolValue = InferValue<typeof SESSIONGRAPH_OUTPUT_SCHEMA>;
531
+ /** The validated arguments, inferred from {@link SESSIONGRAPH_PARAMETERS}. */
532
+ export type SessiongraphToolArgs = InferArgs<typeof SESSIONGRAPH_PARAMETERS>;
533
+ /** The validated arguments, inferred from {@link SESSIONGRAPH_INDEX_PARAMETERS}. */
534
+ export type SessiongraphIndexToolArgs = InferArgs<typeof SESSIONGRAPH_INDEX_PARAMETERS>;
535
+ /** The canonical value for one operation. */
536
+ export type SessiongraphValueFor<O extends SessiongraphToolOperation> = Extract<SessiongraphToolValue, {
537
+ operation: O;
538
+ }>;
539
+ //# sourceMappingURL=schema.d.ts.map