koneck 2.68.0 → 2.69.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/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +98 -9
- package/dist/ink-chat.js.map +1 -1
- package/dist/mention-resolve.d.ts +64 -0
- package/dist/mention-resolve.d.ts.map +1 -0
- package/dist/mention-resolve.js +139 -0
- package/dist/mention-resolve.js.map +1 -0
- package/dist/web/api.d.ts.map +1 -1
- package/dist/web/api.js +63 -0
- package/dist/web/api.js.map +1 -1
- package/dist/web/events.d.ts +13 -0
- package/dist/web/events.d.ts.map +1 -1
- package/dist/web/events.js.map +1 -1
- package/dist/web/mention-signals.d.ts +41 -0
- package/dist/web/mention-signals.d.ts.map +1 -0
- package/dist/web/mention-signals.js +117 -0
- package/dist/web/mention-signals.js.map +1 -0
- package/dist/web/mention.d.ts +121 -0
- package/dist/web/mention.d.ts.map +1 -0
- package/dist/web/mention.js +211 -0
- package/dist/web/mention.js.map +1 -0
- package/dist/web/sessions.d.ts.map +1 -1
- package/dist/web/sessions.js +23 -2
- package/dist/web/sessions.js.map +1 -1
- package/dist/web/ui-client.d.ts.map +1 -1
- package/dist/web/ui-client.js +270 -1
- package/dist/web/ui-client.js.map +1 -1
- package/dist/web/ui-css.d.ts.map +1 -1
- package/dist/web/ui-css.js +39 -0
- package/dist/web/ui-css.js.map +1 -1
- package/dist/web/ui.d.ts.map +1 -1
- package/dist/web/ui.js +9 -0
- package/dist/web/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/ink-chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink-chat.d.ts","sourceRoot":"","sources":["../src/ink-chat.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ink-chat.d.ts","sourceRoot":"","sources":["../src/ink-chat.tsx"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,kB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;;;GAKG;AACH;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAU3D;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAmB,EAC7E,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAQT;AAo7ID,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBvE"}
|
package/dist/ink-chat.js
CHANGED
|
@@ -16,7 +16,10 @@ import { policyFrom, FAILOVER_OFF } from './failover.js';
|
|
|
16
16
|
import { listCheckpoints, revertCheckpoint, previewCheckpoint, snapshotTree, filesTouchedBy, createWorkspaceCheckpoint, checkpointScope } from './checkpoint.js';
|
|
17
17
|
import { fileDiff, diffSummary } from './diff-view.js';
|
|
18
18
|
import { untrackedPatches } from './git-diff.js';
|
|
19
|
-
import { listWorkspaceEntries,
|
|
19
|
+
import { listWorkspaceEntries, activeReference } from './workspace-files.js';
|
|
20
|
+
import { attachReferences, linesIn } from './mention-resolve.js';
|
|
21
|
+
import { rankMentions, describeCandidates, rowDetail } from './web/mention.js';
|
|
22
|
+
import { gatherSignals } from './web/mention-signals.js';
|
|
20
23
|
import { isSlashCommand, findMentions, shortenMentions } from './mentions.js';
|
|
21
24
|
import { bar, humanTokens, humanDuration, diffStatSince, contextWindowFor, recordStatus, classifyResponse, stateLabel, readModelStatus, computeUiWidth, } from './usage.js';
|
|
22
25
|
import { Markdown, Panel, panelWidth, safeCommitPoint, displayWidth, sliceToWidth } from './markdown-ink.js';
|
|
@@ -1069,6 +1072,23 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
1069
1072
|
const pasteBufRef = useRef(null);
|
|
1070
1073
|
/** Workspace paths for the `@` picker, read once and reused. */
|
|
1071
1074
|
const entriesRef = useRef(null);
|
|
1075
|
+
/**
|
|
1076
|
+
* The project's signals for the `@` picker, gathered once per session rather than per keystroke.
|
|
1077
|
+
*
|
|
1078
|
+
* Null until the picker is first opened, for the same reason the listing is: a session that never
|
|
1079
|
+
* references a file should not pay for git and the ledger being read.
|
|
1080
|
+
*/
|
|
1081
|
+
const signalsRef = useRef(null);
|
|
1082
|
+
/**
|
|
1083
|
+
* Sizes for the paths that have actually been shown.
|
|
1084
|
+
*
|
|
1085
|
+
* Filled in behind the first draw. Statting four thousand files to put an advisory number beside
|
|
1086
|
+
* forty of them would make the picker stutter, and statting them synchronously would make it
|
|
1087
|
+
* stutter visibly.
|
|
1088
|
+
*/
|
|
1089
|
+
const sizesRef = useRef(new Map());
|
|
1090
|
+
/** Which of the shown paths turned out to be folders, so they are labelled rather than priced. */
|
|
1091
|
+
const dirsRef = useRef(new Set());
|
|
1072
1092
|
/** Where the `@` being completed starts in the draft. */
|
|
1073
1093
|
const atStartRef = useRef(-1);
|
|
1074
1094
|
/**
|
|
@@ -2363,8 +2383,12 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
2363
2383
|
}));
|
|
2364
2384
|
}
|
|
2365
2385
|
/**
|
|
2366
|
-
* Offers workspace paths for an `@` reference.
|
|
2367
|
-
*
|
|
2386
|
+
* Offers workspace paths for an `@` reference.
|
|
2387
|
+
*
|
|
2388
|
+
* The listing is read on first use rather than at startup, so a session in a large repository is
|
|
2389
|
+
* not delayed by a scan it may never need. The project's own signals — what git has touched, what
|
|
2390
|
+
* this session has handled, what the ledger has notes about — are gathered alongside it and reused
|
|
2391
|
+
* for the rest of the typing, because three reads per keystroke is a wait rather than a picker.
|
|
2368
2392
|
*/
|
|
2369
2393
|
async function openFilePicker(query) {
|
|
2370
2394
|
if (entriesRef.current === null)
|
|
@@ -2374,16 +2398,64 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
2374
2398
|
addSystem('No files found to reference here.');
|
|
2375
2399
|
return;
|
|
2376
2400
|
}
|
|
2401
|
+
if (signalsRef.current === null) {
|
|
2402
|
+
const live = await activeSession.p.catch(() => null);
|
|
2403
|
+
signalsRef.current = await gatherSignals(cfg.cwd, live?.trajectory ?? [])
|
|
2404
|
+
.catch(() => ({}));
|
|
2405
|
+
}
|
|
2377
2406
|
setPicker({ kind: 'file', items: fileItems(all, query) });
|
|
2378
2407
|
setPickQuery(query);
|
|
2379
2408
|
setPickIndex(0);
|
|
2409
|
+
void fillCosts(query);
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Puts the token cost on the rows that are showing.
|
|
2413
|
+
*
|
|
2414
|
+
* Behind the first draw, and only for what is on screen: the rows appear at once and the numbers
|
|
2415
|
+
* arrive a moment later, which is the right way round. A picker that waits for forty stat calls
|
|
2416
|
+
* before showing anything is a picker that feels broken.
|
|
2417
|
+
*/
|
|
2418
|
+
async function fillCosts(query) {
|
|
2419
|
+
const ranked = rankMentions(entriesRef.current ?? [], query, signalsRef.current ?? {}, 40);
|
|
2420
|
+
const wanted = ranked.map(r => r.path).filter(p => !sizesRef.current.has(p));
|
|
2421
|
+
if (wanted.length === 0)
|
|
2422
|
+
return;
|
|
2423
|
+
const found = await describeCandidates(cfg.cwd, ranked.filter(r => wanted.includes(r.path)))
|
|
2424
|
+
.catch(() => []);
|
|
2425
|
+
let learned = false;
|
|
2426
|
+
for (const item of found) {
|
|
2427
|
+
if (item.kind === 'dir') {
|
|
2428
|
+
dirsRef.current.add(item.path);
|
|
2429
|
+
learned = true;
|
|
2430
|
+
continue;
|
|
2431
|
+
}
|
|
2432
|
+
if (item.bytes === null)
|
|
2433
|
+
continue;
|
|
2434
|
+
sizesRef.current.set(item.path, item.bytes);
|
|
2435
|
+
learned = true;
|
|
2436
|
+
}
|
|
2437
|
+
if (!learned)
|
|
2438
|
+
return;
|
|
2439
|
+
setPicker(p => (p && p.kind === 'file'
|
|
2440
|
+
? { ...p, items: fileItems(entriesRef.current ?? [], query) } : p));
|
|
2380
2441
|
}
|
|
2381
|
-
/**
|
|
2442
|
+
/**
|
|
2443
|
+
* The picker rows for a query.
|
|
2444
|
+
*
|
|
2445
|
+
* Ranked by the project's signals rather than by the match alone, and each row says why it is
|
|
2446
|
+
* where it is and what attaching it will spend — the same two things the browser's picker shows,
|
|
2447
|
+
* because an `@` puts the file in the prompt on both surfaces and the price should be visible on
|
|
2448
|
+
* both. The sizes come from the listing rather than from a stat per row: forty stats per keystroke
|
|
2449
|
+
* in a terminal is a stutter, and the number is advisory anyway.
|
|
2450
|
+
*/
|
|
2382
2451
|
function fileItems(all, query) {
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2452
|
+
const ranked = rankMentions(all, query, signalsRef.current ?? {}, 200);
|
|
2453
|
+
return ranked.map(entry => ({
|
|
2454
|
+
value: entry.path,
|
|
2455
|
+
label: entry.path,
|
|
2456
|
+
// The same wording the browser's rows use, from the same function, so the two surfaces cannot
|
|
2457
|
+
// drift into describing the same signal differently.
|
|
2458
|
+
desc: rowDetail(entry.because, sizesRef.current.get(entry.path), dirsRef.current.has(entry.path) ? 'dir' : 'file'),
|
|
2387
2459
|
}));
|
|
2388
2460
|
}
|
|
2389
2461
|
function openPicker(kind, items, query = '') {
|
|
@@ -4044,6 +4116,7 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
4044
4116
|
setPickQuery(q);
|
|
4045
4117
|
setPickIndex(0);
|
|
4046
4118
|
setPicker(p => (p ? { ...p, items: fileItems(entriesRef.current ?? [], q) } : p));
|
|
4119
|
+
void fillCosts(q);
|
|
4047
4120
|
return;
|
|
4048
4121
|
}
|
|
4049
4122
|
setPickQuery(q => q.slice(0, -1));
|
|
@@ -4457,7 +4530,23 @@ function App({ config: initialConfig, clearFrame }) {
|
|
|
4457
4530
|
(effort !== 'medium' ? `[Effort: ${effort}]\n` : '');
|
|
4458
4531
|
const controller = new AbortController();
|
|
4459
4532
|
abortRef.current = controller;
|
|
4460
|
-
|
|
4533
|
+
/*
|
|
4534
|
+
* An `@` becomes the file it names, here as in the browser.
|
|
4535
|
+
*
|
|
4536
|
+
* The terminal has offered `@` completion for a long time and it only ever inserted the
|
|
4537
|
+
* path, leaving the model to go and read it — a round trip for something already decided.
|
|
4538
|
+
* What is attached is printed, because a message that quietly grew by eight hundred lines
|
|
4539
|
+
* should say so.
|
|
4540
|
+
*/
|
|
4541
|
+
const referenced = await attachReferences(cfg.cwd, task)
|
|
4542
|
+
.catch(() => ({ text: task, attached: [] }));
|
|
4543
|
+
for (const item of referenced.attached) {
|
|
4544
|
+
const lines = item.content === undefined ? null : linesIn(item.content);
|
|
4545
|
+
addRow({ role: 'system', text: item.note
|
|
4546
|
+
? `@${item.ref} was not attached — ${item.note}`
|
|
4547
|
+
: `Attached @${item.ref} (${lines} lines)` });
|
|
4548
|
+
}
|
|
4549
|
+
await active.send(prefix + referenced.text, controller.signal);
|
|
4461
4550
|
// An aborted turn returns rather than throwing, so cancellation is detected here and
|
|
4462
4551
|
// not in the catch. Anything the agent managed before the abort is already committed
|
|
4463
4552
|
// to scrollback; the composer is left exactly as it was.
|