@spences10/pi-context 0.0.9 → 0.0.11

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/dist/index.js CHANGED
@@ -1,601 +1,9 @@
1
- import { show_confirm_modal, show_picker_modal, show_text_modal, } from '@spences10/pi-tui-modal';
2
1
  import { Type } from 'typebox';
3
- import { CONTEXT_SETTINGS_PRESETS, context_settings_from_preset, get_context_capture_limits, get_context_mcp_output_limits, get_context_settings_config_path, is_context_settings_preset, load_context_settings_config, save_context_settings_config, } from './config.js';
4
- import { get_context_store, is_context_sidecar_enabled, maybe_store_context_output, set_context_sidecar_enabled, should_index_text, } from './store.js';
5
- function is_text_content(item) {
6
- return (!!item &&
7
- typeof item === 'object' &&
8
- item.type === 'text' &&
9
- typeof item.text === 'string');
10
- }
11
- function summarize_tool_input(input) {
12
- if (!input || typeof input !== 'object')
13
- return null;
14
- try {
15
- const json = JSON.stringify(input);
16
- return json.length > 500 ? `${json.slice(0, 497)}...` : json;
17
- }
18
- catch {
19
- return null;
20
- }
21
- }
22
- function should_skip_tool(tool_name) {
23
- // Coverage policy:
24
- // - context_* tools are retrieval/maintenance output; indexing them would
25
- // recurse and make the sidecar harder to reason about.
26
- // - team output is coordination state, not bulky artifact content; keep it in
27
- // team/pirecall surfaces rather than duplicating mailbox/task state here.
28
- // - MCP receipts are produced before generic tool_result hooks; the hook also
29
- // ignores existing [context-sidecar] receipts so direct MCP storage is not
30
- // indexed a second time.
31
- return (tool_name === 'context_search' ||
32
- tool_name === 'context_get' ||
33
- tool_name === 'context_list' ||
34
- tool_name === 'context_stats' ||
35
- tool_name === 'context_purge' ||
36
- tool_name === 'team');
37
- }
38
- function session_id_from_context(ctx) {
39
- const manager = ctx?.sessionManager;
40
- return (manager?.getSessionFile?.() ?? manager?.getSessionId?.() ?? null);
41
- }
42
- function scope_from_context(ctx) {
43
- return {
44
- project_path: ctx?.cwd ?? process.cwd(),
45
- session_id: session_id_from_context(ctx),
46
- };
47
- }
48
- function format_search_results(results) {
49
- if (results.length === 0)
50
- return 'No indexed context matched.';
51
- return results
52
- .map((result, index) => [
53
- `## ${index + 1}. ${result.title ?? result.chunk_id}`,
54
- `Source: ${result.source_id} • Chunk: ${result.chunk_id} • Tool: ${result.tool_name}`,
55
- '',
56
- result.content,
57
- ].join('\n'))
58
- .join('\n\n---\n\n');
59
- }
60
- function format_list_results(results) {
61
- if (results.length === 0)
62
- return 'No indexed context sources found.';
63
- return results
64
- .map((result) => [
65
- `## ${result.source_id}`,
66
- `Created: ${new Date(result.created_at).toISOString()} • Tool: ${result.tool_name}`,
67
- `Size: ${result.bytes} bytes, ${result.lines} lines, ${result.chunk_count} chunks`,
68
- `Project: ${result.project_path ?? '(none)'}`,
69
- `Session: ${result.session_id ?? '(none)'}`,
70
- result.input_summary
71
- ? `Input: ${result.input_summary}`
72
- : undefined,
73
- result.first_chunk_title
74
- ? `First chunk: ${result.first_chunk_title}`
75
- : undefined,
76
- result.preview ? `Preview: ${result.preview}` : undefined,
77
- ]
78
- .filter(Boolean)
79
- .join('\n'))
80
- .join('\n\n');
81
- }
82
- function format_purge_details(details) {
83
- const filters = [
84
- details.source_id ? `source_id=${details.source_id}` : undefined,
85
- details.project_path !== undefined
86
- ? `project_path=${details.project_path ?? '(none)'}`
87
- : undefined,
88
- details.session_id !== undefined
89
- ? `session_id=${details.session_id ?? '(none)'}`
90
- : undefined,
91
- details.older_than_days !== undefined
92
- ? `older_than_days=${details.older_than_days}`
93
- : undefined,
94
- ]
95
- .filter(Boolean)
96
- .join(', ');
97
- return `Deleted ${details.deleted} context source(s).${filters ? ` Filters: ${filters}.` : ''}`;
98
- }
99
- function format_stats(stats) {
100
- const scoped = stats.scope_project_path || stats.scope_session_id;
101
- return [
102
- '## context-sidecar stats',
103
- '',
104
- `- Enabled: ${is_context_sidecar_enabled()}`,
105
- scoped
106
- ? `- Scope: project=${stats.scope_project_path ?? '(none)'}, session=${stats.scope_session_id ?? '(none)'}`
107
- : '- Scope: global',
108
- `- Scoped sources: ${stats.sources}`,
109
- `- Scoped chunks: ${stats.chunks}`,
110
- `- Scoped raw bytes stored: ${stats.bytes_stored}`,
111
- `- Global sources: ${stats.global_sources}`,
112
- `- Global chunks: ${stats.global_chunks}`,
113
- `- Global raw bytes stored: ${stats.global_bytes_stored}`,
114
- `- Bytes returned: ${stats.bytes_returned}`,
115
- `- Bytes saved: ${stats.bytes_saved}`,
116
- `- Reduction: ${stats.reduction_pct}%`,
117
- `- DB bytes: ${stats.total_bytes}`,
118
- `- Scoped oldest source: ${format_timestamp(stats.oldest_created_at)}`,
119
- `- Scoped newest source: ${format_timestamp(stats.newest_created_at)}`,
120
- `- Global oldest source: ${format_timestamp(stats.global_oldest_created_at)}`,
121
- `- Global newest source: ${format_timestamp(stats.global_newest_created_at)}`,
122
- `- Retention days: ${stats.retention_days ?? 'disabled'}`,
123
- `- Purge on shutdown: ${stats.purge_on_shutdown}`,
124
- `- Max DB size: ${stats.max_mb === null ? 'disabled' : `${stats.max_mb} MiB`}`,
125
- ].join('\n');
126
- }
127
- function format_timestamp(timestamp) {
128
- return timestamp === null
129
- ? '(none)'
130
- : new Date(timestamp).toISOString();
131
- }
132
- function format_days(days) {
133
- return days === null ? 'disabled' : `${days} day(s)`;
134
- }
135
- function format_max_mb(max_mb) {
136
- return max_mb === null ? 'disabled' : `${max_mb} MiB`;
137
- }
138
- function format_kib(bytes) {
139
- return `${Math.round(bytes / 1024)} KiB`;
140
- }
141
- function format_output_limit(bytes, lines) {
142
- return `${format_kib(bytes)} / ${lines} lines`;
143
- }
144
- function format_context_settings_status(stats) {
145
- const saved = load_context_settings_config();
146
- const capture_limits = get_context_capture_limits();
147
- const mcp_limits = get_context_mcp_output_limits();
148
- return [
149
- '## context-sidecar settings',
150
- '',
151
- `- Config path: ${get_context_settings_config_path()}`,
152
- `- Saved preset: ${saved?.preset ?? '(none; using built-in defaults)'}`,
153
- `- Effective retention: ${format_days(stats.retention_days)}`,
154
- `- Effective max size: ${format_max_mb(stats.max_mb)}`,
155
- `- Effective purge on shutdown: ${stats.purge_on_shutdown}`,
156
- `- Effective tool capture threshold: ${format_output_limit(capture_limits.max_bytes, capture_limits.max_lines)}`,
157
- `- Effective MCP capture threshold: ${format_output_limit(mcp_limits.max_bytes, mcp_limits.max_lines)}`,
158
- '',
159
- 'Presets:',
160
- ...Object.entries(CONTEXT_SETTINGS_PRESETS).map(([key, preset]) => `- ${key}: ${preset.description}`),
161
- '',
162
- 'Usage:',
163
- '- /context settings <preset>',
164
- '- /context settings custom <days|off> <max-mb|off> [capture-kb] [capture-lines] [purge-on-shutdown]',
165
- ].join('\n');
166
- }
167
- function parse_optional_setting_number(value) {
168
- const normalized = value.trim().toLowerCase();
169
- if (['0', 'off', 'false', 'none', 'disabled'].includes(normalized)) {
170
- return null;
171
- }
172
- const parsed = Number(normalized);
173
- if (!Number.isFinite(parsed) || parsed <= 0) {
174
- throw new Error('Expected a positive number or off.');
175
- }
176
- return parsed;
177
- }
178
- function parse_optional_setting_boolean(value, fallback = false) {
179
- if (!value)
180
- return fallback;
181
- const normalized = value.trim().toLowerCase();
182
- if (['1', 'true', 'yes', 'on'].includes(normalized))
183
- return true;
184
- if (['0', 'false', 'no', 'off'].includes(normalized))
185
- return false;
186
- throw new Error('Expected purge-on-shutdown to be true or false.');
187
- }
188
- function parse_positive_setting_number(value) {
189
- const parsed = Number(value.trim());
190
- if (!Number.isFinite(parsed) || parsed <= 0) {
191
- throw new Error('Expected a positive number.');
192
- }
193
- return parsed;
194
- }
195
- const RETENTION_SETTING_OPTIONS = [
196
- {
197
- value: '1',
198
- label: '1 day',
199
- description: 'Minimal local cache',
200
- days: 1,
201
- },
202
- {
203
- value: '7',
204
- label: '7 days',
205
- description: 'Default retention',
206
- days: 7,
207
- },
208
- {
209
- value: '30',
210
- label: '30 days',
211
- description: 'Research window',
212
- days: 30,
213
- },
214
- {
215
- value: '90',
216
- label: '90 days',
217
- description: 'Long-lived local archive',
218
- days: 90,
219
- },
220
- {
221
- value: 'off',
222
- label: 'Off',
223
- description: 'Disable age cleanup',
224
- days: null,
225
- },
226
- ];
227
- const STORAGE_CAP_SETTING_OPTIONS = [
228
- {
229
- value: '50',
230
- label: '50 MiB',
231
- description: 'Small local cache',
232
- max_mb: 50,
233
- },
234
- {
235
- value: '250',
236
- label: '250 MiB',
237
- description: 'Balanced cap',
238
- max_mb: 250,
239
- },
240
- {
241
- value: '1024',
242
- label: '1 GiB',
243
- description: 'Research cap',
244
- max_mb: 1024,
245
- },
246
- {
247
- value: '5120',
248
- label: '5 GiB',
249
- description: 'Archive cap',
250
- max_mb: 5120,
251
- },
252
- {
253
- value: 'off',
254
- label: 'No cap',
255
- description: 'Only retention controls cleanup',
256
- max_mb: null,
257
- },
258
- ];
259
- const CAPTURE_SIZE_SETTING_OPTIONS = [
260
- {
261
- value: 'small',
262
- label: 'Small',
263
- description: 'Capture after 16 KiB / 200 lines',
264
- capture_max_bytes: 16 * 1024,
265
- capture_max_lines: 200,
266
- mcp_max_bytes: 32 * 1024,
267
- mcp_max_lines: 1_000,
268
- },
269
- {
270
- value: 'default',
271
- label: 'Default',
272
- description: 'Capture after 24 KiB / 300 lines',
273
- capture_max_bytes: 24 * 1024,
274
- capture_max_lines: 300,
275
- mcp_max_bytes: 50 * 1024,
276
- mcp_max_lines: 2_000,
277
- },
278
- {
279
- value: 'large',
280
- label: 'Large',
281
- description: 'Capture after 48 KiB / 600 lines',
282
- capture_max_bytes: 48 * 1024,
283
- capture_max_lines: 600,
284
- mcp_max_bytes: 96 * 1024,
285
- mcp_max_lines: 3_000,
286
- },
287
- {
288
- value: 'huge',
289
- label: 'Huge',
290
- description: 'Capture after 64 KiB / 1,000 lines',
291
- capture_max_bytes: 64 * 1024,
292
- capture_max_lines: 1_000,
293
- mcp_max_bytes: 128 * 1024,
294
- mcp_max_lines: 4_000,
295
- },
296
- ];
297
- async function show_context_text_modal(ctx, title, text) {
298
- await show_text_modal(ctx, {
299
- title,
300
- text,
301
- max_visible_lines: 18,
302
- overlay_options: { width: '80%', minWidth: 64 },
303
- });
304
- }
305
- async function show_context_stats(ctx) {
306
- const scope = scope_from_context(ctx);
307
- const text = format_stats(get_context_store(scope).stats(scope));
308
- if (ctx.hasUI) {
309
- await show_context_text_modal(ctx, 'Context sidecar stats', text);
310
- }
311
- else {
312
- ctx.ui.notify(text, 'info');
313
- }
314
- }
315
- function save_context_settings(ctx, config) {
316
- save_context_settings_config(config);
317
- const scope = scope_from_context(ctx);
318
- const cleanup = get_context_store(scope).cleanup();
319
- ctx.ui.notify(`Context settings saved: ${config.preset} (${format_days(config.retention_days)}, ${format_max_mb(config.max_mb)} cap, capture ${format_output_limit(config.capture_max_bytes, config.capture_max_lines)}). Cleanup deleted ${cleanup.deleted} source(s).`, 'info');
320
- }
321
- function save_context_settings_patch(ctx, patch) {
322
- const base = load_context_settings_config() ??
323
- context_settings_from_preset('default');
324
- save_context_settings(ctx, {
325
- ...base,
326
- ...patch,
327
- version: 1,
328
- preset: 'custom',
329
- });
330
- }
331
- async function show_context_preset_settings(ctx) {
332
- const saved = load_context_settings_config();
333
- const selected = await show_picker_modal(ctx, {
334
- title: 'Context preset',
335
- subtitle: 'Apply retention, storage, and capture thresholds together',
336
- items: Object.entries(CONTEXT_SETTINGS_PRESETS).map(([key, preset]) => ({
337
- value: key,
338
- label: `${preset.label}${saved?.preset === key ? ' ✓' : ''}`,
339
- description: preset.description,
340
- })),
341
- footer: 'enter applies preset • esc back',
342
- });
343
- if (!selected)
344
- return;
345
- save_context_settings(ctx, context_settings_from_preset(selected));
346
- }
347
- async function show_context_retention_settings(ctx) {
348
- const current = load_context_settings_config();
349
- const selected = await show_picker_modal(ctx, {
350
- title: 'Context retention days',
351
- subtitle: `Current: ${format_days(current?.retention_days ?? 7)}`,
352
- items: RETENTION_SETTING_OPTIONS.map((option) => ({
353
- value: option.value,
354
- label: `${option.label}${current?.retention_days === option.days ? ' ✓' : ''}`,
355
- description: option.description,
356
- })),
357
- footer: 'enter saves • esc back',
358
- });
359
- const option = RETENTION_SETTING_OPTIONS.find((item) => item.value === selected);
360
- if (!option)
361
- return;
362
- save_context_settings_patch(ctx, { retention_days: option.days });
363
- }
364
- async function show_context_storage_cap_settings(ctx) {
365
- const current = load_context_settings_config();
366
- const selected = await show_picker_modal(ctx, {
367
- title: 'Context storage cap',
368
- subtitle: `Current: ${format_max_mb(current?.max_mb ?? null)}`,
369
- items: STORAGE_CAP_SETTING_OPTIONS.map((option) => ({
370
- value: option.value,
371
- label: `${option.label}${current?.max_mb === option.max_mb ? ' ✓' : ''}`,
372
- description: option.description,
373
- })),
374
- footer: 'enter saves • esc back',
375
- });
376
- const option = STORAGE_CAP_SETTING_OPTIONS.find((item) => item.value === selected);
377
- if (!option)
378
- return;
379
- save_context_settings_patch(ctx, { max_mb: option.max_mb });
380
- }
381
- async function show_context_capture_size_settings(ctx) {
382
- const current = load_context_settings_config();
383
- const capture_limits = get_context_capture_limits();
384
- const selected = await show_picker_modal(ctx, {
385
- title: 'Context capture size',
386
- subtitle: `Current: ${format_output_limit(capture_limits.max_bytes, capture_limits.max_lines)}`,
387
- items: CAPTURE_SIZE_SETTING_OPTIONS.map((option) => ({
388
- value: option.value,
389
- label: `${option.label}${current?.capture_max_bytes === option.capture_max_bytes && current?.capture_max_lines === option.capture_max_lines ? ' ✓' : ''}`,
390
- description: option.description,
391
- })),
392
- footer: 'enter saves • esc back',
393
- });
394
- const option = CAPTURE_SIZE_SETTING_OPTIONS.find((item) => item.value === selected);
395
- if (!option)
396
- return;
397
- save_context_settings_patch(ctx, {
398
- capture_max_bytes: option.capture_max_bytes,
399
- capture_max_lines: option.capture_max_lines,
400
- mcp_max_bytes: option.mcp_max_bytes,
401
- mcp_max_lines: option.mcp_max_lines,
402
- });
403
- }
404
- async function show_context_settings(ctx, options = {}) {
405
- if (!ctx.hasUI) {
406
- const scope = scope_from_context(ctx);
407
- ctx.ui.notify(format_context_settings_status(get_context_store(scope).stats(scope)), 'info');
408
- return;
409
- }
410
- while (true) {
411
- const scope = scope_from_context(ctx);
412
- const stats = get_context_store(scope).stats(scope);
413
- const capture_limits = get_context_capture_limits();
414
- const selected = await show_picker_modal(ctx, {
415
- title: 'Context sidecar settings',
416
- subtitle: `Current: ${format_days(stats.retention_days)}, ${format_max_mb(stats.max_mb)} cap, capture ${format_output_limit(capture_limits.max_bytes, capture_limits.max_lines)}`,
417
- items: [
418
- {
419
- value: 'capture-size',
420
- label: 'Capture size',
421
- description: 'Choose when output is moved into sidecar',
422
- },
423
- {
424
- value: 'retention-days',
425
- label: 'Retention days',
426
- description: 'Choose how long indexed output is kept',
427
- },
428
- {
429
- value: 'storage-cap',
430
- label: 'Storage cap',
431
- description: 'Choose max raw bytes stored locally',
432
- },
433
- {
434
- value: 'presets',
435
- label: 'Presets',
436
- description: 'Apply bundled settings all at once',
437
- },
438
- {
439
- value: 'show',
440
- label: 'Show current settings',
441
- description: 'Inspect effective saved/env-backed policy',
442
- },
443
- ],
444
- footer: `enter opens • esc ${options.nested ? 'back' : 'close'}`,
445
- });
446
- if (!selected)
447
- return;
448
- if (selected === 'capture-size') {
449
- await show_context_capture_size_settings(ctx);
450
- }
451
- else if (selected === 'retention-days') {
452
- await show_context_retention_settings(ctx);
453
- }
454
- else if (selected === 'storage-cap') {
455
- await show_context_storage_cap_settings(ctx);
456
- }
457
- else if (selected === 'presets') {
458
- await show_context_preset_settings(ctx);
459
- }
460
- else if (selected === 'show') {
461
- await show_context_text_modal(ctx, 'Context sidecar settings', format_context_settings_status(stats));
462
- }
463
- }
464
- }
465
- async function handle_context_settings(ctx, args) {
466
- const [kind, days_text, max_mb_text, capture_kb_text, capture_lines_text, purge_text,] = args;
467
- if (!kind) {
468
- await show_context_settings(ctx);
469
- return;
470
- }
471
- if (kind === 'show' || kind === 'current') {
472
- const scope = scope_from_context(ctx);
473
- const text = format_context_settings_status(get_context_store(scope).stats(scope));
474
- if (ctx.hasUI) {
475
- await show_context_text_modal(ctx, 'Context sidecar settings', text);
476
- }
477
- else {
478
- ctx.ui.notify(text, 'info');
479
- }
480
- return;
481
- }
482
- if (is_context_settings_preset(kind)) {
483
- save_context_settings(ctx, context_settings_from_preset(kind));
484
- return;
485
- }
486
- if (kind === 'custom') {
487
- if (!days_text || !max_mb_text) {
488
- ctx.ui.notify('Usage: /context settings custom <days|off> <max-mb|off> [capture-kb] [capture-lines] [purge-on-shutdown]', 'warning');
489
- return;
490
- }
491
- try {
492
- const base = load_context_settings_config() ??
493
- context_settings_from_preset('default');
494
- save_context_settings(ctx, {
495
- version: 1,
496
- preset: 'custom',
497
- retention_days: parse_optional_setting_number(days_text),
498
- max_mb: parse_optional_setting_number(max_mb_text),
499
- capture_max_bytes: capture_kb_text
500
- ? parse_positive_setting_number(capture_kb_text) * 1024
501
- : base.capture_max_bytes,
502
- capture_max_lines: capture_lines_text
503
- ? parse_positive_setting_number(capture_lines_text)
504
- : base.capture_max_lines,
505
- mcp_max_bytes: capture_kb_text
506
- ? parse_positive_setting_number(capture_kb_text) * 1024
507
- : base.mcp_max_bytes,
508
- mcp_max_lines: capture_lines_text
509
- ? parse_positive_setting_number(capture_lines_text)
510
- : base.mcp_max_lines,
511
- purge_on_shutdown: parse_optional_setting_boolean(purge_text, base.purge_on_shutdown),
512
- });
513
- }
514
- catch (error) {
515
- ctx.ui.notify(error instanceof Error ? error.message : String(error), 'warning');
516
- }
517
- return;
518
- }
519
- ctx.ui.notify(`Unknown context settings preset: ${kind}. Use ${Object.keys(CONTEXT_SETTINGS_PRESETS).join(', ')}, show, or custom.`, 'warning');
520
- }
521
- async function show_context_list(ctx, limit) {
522
- const scope = scope_from_context(ctx);
523
- const text = format_list_results(get_context_store(scope).list({ ...scope, limit }));
524
- if (ctx.hasUI) {
525
- await show_context_text_modal(ctx, 'Context sidecar sources', text);
526
- }
527
- else {
528
- ctx.ui.notify(text, 'info');
529
- }
530
- }
531
- async function purge_context(ctx, options = {}) {
532
- const policy = get_context_store().stats();
533
- const days = options.older_than_days ?? policy.retention_days ?? 14;
534
- const description = options.expired
535
- ? 'Delete expired context sources now?'
536
- : options.source_id
537
- ? `Delete context source ${options.source_id}?`
538
- : `Delete context sources older than ${days} day(s)?`;
539
- const confirmed = ctx.hasUI
540
- ? await show_confirm_modal(ctx, {
541
- title: 'Purge context sidecar?',
542
- message: description,
543
- confirm_label: 'Purge',
544
- })
545
- : await ctx.ui.confirm('Purge context sidecar?', description);
546
- if (!confirmed)
547
- return;
548
- const scope = scope_from_context(ctx);
549
- const details = options.expired
550
- ? { deleted: get_context_store(scope).cleanup().deleted }
551
- : get_context_store(scope).purge_with_details({
552
- ...scope,
553
- older_than_days: options.source_id ? undefined : days,
554
- source_id: options.source_id,
555
- });
556
- ctx.ui.notify(format_purge_details(details), 'info');
557
- }
558
- async function show_context_menu(ctx) {
559
- while (true) {
560
- const selected = await show_picker_modal(ctx, {
561
- title: 'Context sidecar',
562
- subtitle: 'Local SQLite storage for oversized tool output',
563
- items: [
564
- {
565
- value: 'list',
566
- label: 'List recent sources',
567
- description: 'Browse indexed output in this scope',
568
- },
569
- {
570
- value: 'stats',
571
- label: 'Show stats',
572
- description: 'Byte accounting and storage reduction',
573
- },
574
- {
575
- value: 'settings',
576
- label: 'Configure settings',
577
- description: 'Configure capture size, retention, and storage cap',
578
- },
579
- {
580
- value: 'purge',
581
- label: 'Purge old context',
582
- description: 'Delete sources older than 14 days',
583
- },
584
- ],
585
- footer: 'enter opens • esc close',
586
- });
587
- if (!selected)
588
- return;
589
- if (selected === 'list')
590
- await show_context_list(ctx);
591
- else if (selected === 'stats')
592
- await show_context_stats(ctx);
593
- else if (selected === 'settings')
594
- await show_context_settings(ctx, { nested: true });
595
- else
596
- await purge_context(ctx);
597
- }
598
- }
2
+ import { format_list_results, format_purge_details, format_search_results, format_stats, } from './context-format.js';
3
+ import { is_text_content, scope_from_context, should_skip_tool, summarize_tool_input, } from './context-scope.js';
4
+ import { get_context_store, maybe_store_context_output, set_context_sidecar_enabled, should_index_text, } from './store.js';
5
+ import { purge_context, show_context_list, show_context_menu, } from './ui/menu.js';
6
+ import { handle_context_settings, show_context_stats, } from './ui/settings.js';
599
7
  export default function context_sidecar(pi) {
600
8
  set_context_sidecar_enabled(true, { project_path: process.cwd() });
601
9
  pi.on('session_start', async (_event, ctx) => {
@@ -923,6 +331,6 @@ export default function context_sidecar(pi) {
923
331
  },
924
332
  });
925
333
  }
926
- export { CONTEXT_SETTINGS_PRESETS, context_settings_from_preset, get_context_capture_limits, get_context_mcp_output_limits, get_context_settings_config_path, load_context_settings_config, save_context_settings_config, } from './config.js';
334
+ export { context_settings_from_preset, CONTEXT_SETTINGS_PRESETS, get_context_capture_limits, get_context_mcp_output_limits, get_context_settings_config_path, load_context_settings_config, save_context_settings_config, } from './config.js';
927
335
  export { get_context_store, is_context_sidecar_enabled, maybe_store_context_output, parse_context_retention_policy, set_context_sidecar_enabled, should_index_text, } from './store.js';
928
336
  //# sourceMappingURL=index.js.map