koneck 2.128.49 → 2.128.51
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/engine.d.ts.map +1 -1
- package/dist/engine.js +33 -4
- package/dist/engine.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +21 -80
- package/dist/ink-chat.js.map +1 -1
- package/dist/session-changes.d.ts +66 -0
- package/dist/session-changes.d.ts.map +1 -0
- package/dist/session-changes.js +96 -0
- package/dist/session-changes.js.map +1 -0
- package/dist/web/sessions.d.ts +5 -9
- package/dist/web/sessions.d.ts.map +1 -1
- package/dist/web/sessions.js +18 -43
- package/dist/web/sessions.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":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA8B3D,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAuCtE,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ink-chat.d.ts","sourceRoot":"","sources":["../src/ink-chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA8B3D,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAuCtE,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAsB5D,OAAO,EAA6C,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3F,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAC;AAmE7D,KAAK,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAGhD,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK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EAAE,kBAA0B,EAAE,EACxE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7C,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqxMhE;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmFvE"}
|
package/dist/ink-chat.js
CHANGED
|
@@ -18,7 +18,7 @@ import { ImageDraft, pastedImagePath } from './image-draft.js';
|
|
|
18
18
|
import { readClipboard, readClipboardImage, startSelectionCopy, cleanPastedSecret, copyViaTerminal } from './clipboard.js';
|
|
19
19
|
import { paceFrom } from './pace.js';
|
|
20
20
|
import { policyFrom, FAILOVER_OFF } from './failover.js';
|
|
21
|
-
import { listCheckpoints, revertCheckpoint, previewCheckpoint,
|
|
21
|
+
import { listCheckpoints, revertCheckpoint, previewCheckpoint, createWorkspaceCheckpoint, checkpointScope } from './checkpoint.js';
|
|
22
22
|
import { fileDiff, diffSummary } from './diff-view.js';
|
|
23
23
|
import { tokenizeLine, spanLangFor } from './highlight-spans.js';
|
|
24
24
|
import { setTerminalTitle } from './terminal-title.js';
|
|
@@ -27,7 +27,7 @@ import { attachReferences, linesIn } from './mention-resolve.js';
|
|
|
27
27
|
import { rankMentions, describeCandidates, rowDetail } from './web/mention.js';
|
|
28
28
|
import { gatherSignals } from './web/mention-signals.js';
|
|
29
29
|
import { isSlashCommand, findMentions, shortenMentions } from './mentions.js';
|
|
30
|
-
import { bar, humanTokens, humanDuration,
|
|
30
|
+
import { bar, humanTokens, humanDuration, contextWindowFor, recordStatus, classifyResponse, stateLabel, readModelStatus, computeUiWidth, } from './usage.js';
|
|
31
31
|
import { Markdown, Panel, panelWidth, safeCommitPoint, displayWidth, sliceToWidth } from './markdown-ink.js';
|
|
32
32
|
import { G } from './glyphs.js';
|
|
33
33
|
import { fetchUpdateStatus, updateCommand } from './update-check.js';
|
|
@@ -50,6 +50,7 @@ import { MODES as MODE_SPECS, modeSpec, decide, loadRules, saveRules, addRule, c
|
|
|
50
50
|
import { AskQueue } from './ask-queue.js';
|
|
51
51
|
import { contextLimitWithSource } from './context-limit.js';
|
|
52
52
|
import { planSummary } from './plan.js';
|
|
53
|
+
import { SessionChanges, readForDiff as readForDiffAt, totalsOf } from './session-changes.js';
|
|
53
54
|
import os from 'node:os';
|
|
54
55
|
import { modeLine, nextMode, statusFacts, barCells, PLACEHOLDER } from './status-line.js';
|
|
55
56
|
import { savePlan, plansDir, PLAN_CHOICES, PROCEED_PROMPT } from './plan-file.js';
|
|
@@ -790,9 +791,7 @@ export function expandPastes(draft, pastes) {
|
|
|
790
791
|
});
|
|
791
792
|
}
|
|
792
793
|
/** Past this, a file is not read for diffing — the render would be useless anyway. */
|
|
793
|
-
const MAX_DIFF_BYTES = 512 * 1024;
|
|
794
794
|
/** One tool rarely touches more; the cap stops a bulk move from flooding scrollback. */
|
|
795
|
-
const MAX_DIFF_FILES = 4;
|
|
796
795
|
/*
|
|
797
796
|
* How many changed lines the side panel draws per file.
|
|
798
797
|
*
|
|
@@ -1854,7 +1853,8 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
1854
1853
|
* and the diff still runs from the state it was in before the first edit, which is the change the
|
|
1855
1854
|
* person actually wants to review.
|
|
1856
1855
|
*/
|
|
1857
|
-
|
|
1856
|
+
// The record, shared with the web session so the two count changes identically.
|
|
1857
|
+
const changesRef = useRef(new SessionChanges(() => cfgRef.current.cwd));
|
|
1858
1858
|
const [liveDiffs, setLiveDiffs] = useState([]);
|
|
1859
1859
|
const charsRef = useRef(0); // streamed chars, for the live token estimate
|
|
1860
1860
|
const realTokRef = useRef(0); // real output tokens this turn, once the provider reports usage
|
|
@@ -1907,15 +1907,7 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
1907
1907
|
* would race the very write it is trying to photograph.
|
|
1908
1908
|
*/
|
|
1909
1909
|
function readForDiff(rel) {
|
|
1910
|
-
|
|
1911
|
-
const abs = path.resolve(cfg.cwd, rel);
|
|
1912
|
-
if (statSync(abs).size > MAX_DIFF_BYTES)
|
|
1913
|
-
return null;
|
|
1914
|
-
return readFileSync(abs, 'utf-8');
|
|
1915
|
-
}
|
|
1916
|
-
catch {
|
|
1917
|
-
return null; // absent: a creation, which fileDiff renders as such
|
|
1918
|
-
}
|
|
1910
|
+
return readForDiffAt(cfg.cwd, rel);
|
|
1919
1911
|
}
|
|
1920
1912
|
/** What a path is, or null if it is not there. Synchronous: a prompt is submitted in one go. */
|
|
1921
1913
|
function pathKind(absolute) {
|
|
@@ -1931,13 +1923,8 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
1931
1923
|
commitSay();
|
|
1932
1924
|
// Photograph every file this tool has announced it will touch, before it touches it.
|
|
1933
1925
|
turnToolsRef.current += 1;
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
// The session baseline: first touch only, so repeated edits still diff from the original.
|
|
1937
|
-
for (const { rel, before } of pendingDiffRef.current) {
|
|
1938
|
-
if (!diffBaseRef.current.has(rel))
|
|
1939
|
-
diffBaseRef.current.set(rel, before);
|
|
1940
|
-
}
|
|
1926
|
+
// This call's befores, and the session's first-touch baseline, in one step: see session-changes.ts.
|
|
1927
|
+
pendingDiffRef.current = changesRef.current.before(name, args);
|
|
1941
1928
|
liveToolRef.current = { kind: 'tool', name, detail: toolDetail(name, args), startedAt: Date.now() };
|
|
1942
1929
|
setRepaint(v => v + 1);
|
|
1943
1930
|
}
|
|
@@ -1969,13 +1956,8 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
1969
1956
|
* formatter, the model reverting itself — can change a file this one had finished with. Disk is
|
|
1970
1957
|
* the truth about what the change currently is.
|
|
1971
1958
|
*/
|
|
1972
|
-
if (
|
|
1973
|
-
const all =
|
|
1974
|
-
for (const [rel, before] of diffBaseRef.current) {
|
|
1975
|
-
const d = fileDiff(rel, before, readForDiff(rel), { maxLines: PANEL_DIFF_LINES });
|
|
1976
|
-
if (!d.unchanged)
|
|
1977
|
-
all.push(d);
|
|
1978
|
-
}
|
|
1959
|
+
if (changesRef.current.size) {
|
|
1960
|
+
const all = changesRef.current.diffs(PANEL_DIFF_LINES);
|
|
1979
1961
|
setLiveDiffs(all);
|
|
1980
1962
|
/*
|
|
1981
1963
|
* Open itself on the session's first change, once, unless the person has already decided.
|
|
@@ -2102,9 +2084,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
2102
2084
|
},
|
|
2103
2085
|
onToolResult: (name, ok, ms, detail) => {
|
|
2104
2086
|
finishTool(name, ok, ms, detail);
|
|
2105
|
-
// A file just changed, so the footer's +added −removed has too.
|
|
2106
|
-
if (ok && FILE_WRITING_TOOLS.has(name))
|
|
2107
|
-
refreshDelta();
|
|
2108
2087
|
},
|
|
2109
2088
|
onToolOutput: (_name, line) => {
|
|
2110
2089
|
// Written to the ref rather than to state: a dev server logs a request every second or two,
|
|
@@ -2775,8 +2754,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
2775
2754
|
// thinking, and the gap between the two is where local tool work lives.
|
|
2776
2755
|
const sessionStartRef = useRef(Date.now());
|
|
2777
2756
|
const apiMsRef = useRef(0);
|
|
2778
|
-
/** Tree hash captured at startup, so "code changes" is a diff rather than a running tally. */
|
|
2779
|
-
const baseTreeRef = useRef(null);
|
|
2780
2757
|
const [usagePane, setUsagePane] = useState(null);
|
|
2781
2758
|
/** Which setting is highlighted on the Settings tab. */
|
|
2782
2759
|
const [settingRow, setSettingRow] = useState(0);
|
|
@@ -2784,9 +2761,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
2784
2761
|
const [stored, setStored] = useState({});
|
|
2785
2762
|
/** Non-null while a value is being typed rather than stepped. */
|
|
2786
2763
|
const [editing, setEditing] = useState(null);
|
|
2787
|
-
// undefined while the diff is still being computed, null once git has said there is nothing to
|
|
2788
|
-
// compare against. Collapsing the two would flash "not a git repo" at every open.
|
|
2789
|
-
const [usageDiff, setUsageDiff] = useState(undefined);
|
|
2790
2764
|
const [modelCatalog, setModelCatalog] = useState([]);
|
|
2791
2765
|
/** Why the last listing came back empty, so the pane can say which rather than guess. */
|
|
2792
2766
|
const catalogNote = useRef(null);
|
|
@@ -3256,46 +3230,15 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
3256
3230
|
process.on('exit', off);
|
|
3257
3231
|
return () => { off(); process.off('exit', off); };
|
|
3258
3232
|
}, []);
|
|
3259
|
-
// The tree as it stood before the session touched anything. Recorded once, so "code changes"
|
|
3260
|
-
// stays a comparison against the starting point however long the session runs.
|
|
3261
|
-
useEffect(() => {
|
|
3262
|
-
void snapshotTree(cfg.cwd).then(t => {
|
|
3263
|
-
baseTreeRef.current = t;
|
|
3264
|
-
// Nothing has changed yet at the moment of the snapshot; outside git there is nothing to count.
|
|
3265
|
-
setUsageDiff(t ? { added: 0, removed: 0, files: 0 } : null);
|
|
3266
|
-
});
|
|
3267
|
-
}, [cfg.cwd]);
|
|
3268
3233
|
/*
|
|
3269
|
-
*
|
|
3234
|
+
* No startup snapshot of the tree any more.
|
|
3270
3235
|
*
|
|
3271
|
-
*
|
|
3272
|
-
*
|
|
3273
|
-
*
|
|
3236
|
+
* It existed to count "code changes" with git, and cost a full snapshot of the workspace at every
|
|
3237
|
+
* start — 20.6 seconds on a workspace git had not been told about, which then marked it too slow
|
|
3238
|
+
* to snapshot, so every later count came back empty and the footer read "+0 -0" for the whole
|
|
3239
|
+
* session while the diff panel beside it read "+99 -64". The count comes from the panel's own
|
|
3240
|
+
* record now (session-changes.ts), which needs no git and cannot disagree with the panel.
|
|
3274
3241
|
*/
|
|
3275
|
-
const deltaTimerRef = useRef(null);
|
|
3276
|
-
const deltaLastRef = useRef(0);
|
|
3277
|
-
function refreshDelta() {
|
|
3278
|
-
const run = () => {
|
|
3279
|
-
deltaLastRef.current = Date.now();
|
|
3280
|
-
// A refresh that comes back empty keeps the last figure: git can refuse a snapshot while
|
|
3281
|
-
// another is writing its index, and a transient refusal is not "outside a repository" —
|
|
3282
|
-
// that is decided once, by the snapshot taken at startup.
|
|
3283
|
-
void diffStatSince(cfgRef.current.cwd, baseTreeRef.current)
|
|
3284
|
-
.then(d => { if (d)
|
|
3285
|
-
setUsageDiff(d); })
|
|
3286
|
-
.catch(() => { });
|
|
3287
|
-
};
|
|
3288
|
-
const wait = 4_000 - (Date.now() - deltaLastRef.current);
|
|
3289
|
-
if (wait <= 0) {
|
|
3290
|
-
run();
|
|
3291
|
-
return;
|
|
3292
|
-
}
|
|
3293
|
-
if (deltaTimerRef.current)
|
|
3294
|
-
return;
|
|
3295
|
-
deltaTimerRef.current = setTimeout(() => { deltaTimerRef.current = null; run(); }, wait);
|
|
3296
|
-
}
|
|
3297
|
-
useEffect(() => () => { if (deltaTimerRef.current)
|
|
3298
|
-
clearTimeout(deltaTimerRef.current); }, []);
|
|
3299
3242
|
// A new model is a new window, and a figure measured against the old one would mislead.
|
|
3300
3243
|
useEffect(() => { setCtxFill(null); }, [cfg.model, cfg.provider]);
|
|
3301
3244
|
const addRow = (row) => setRows(prev => [...prev, row]);
|
|
@@ -3656,7 +3599,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
3656
3599
|
setUsagePane(tab);
|
|
3657
3600
|
setEditing(null);
|
|
3658
3601
|
void loadKoneckConfig().then(c => setStored(c));
|
|
3659
|
-
void diffStatSince(cfg.cwd, baseTreeRef.current).then(setUsageDiff);
|
|
3660
3602
|
if (modelCatalog.length === 0)
|
|
3661
3603
|
void loadModelCatalog();
|
|
3662
3604
|
}
|
|
@@ -6703,7 +6645,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
6703
6645
|
// whichever of those three happened last, which for anyone who closes the terminal
|
|
6704
6646
|
// normally was an old snapshot — the reported "always resumes the old one".
|
|
6705
6647
|
void doSave().catch(() => { });
|
|
6706
|
-
refreshDelta();
|
|
6707
6648
|
// A run that stopped short says so, rather than letting the footer imply it finished.
|
|
6708
6649
|
if (incompleteRef.current) {
|
|
6709
6650
|
addSystem(incompleteRef.current);
|
|
@@ -6745,7 +6686,6 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
6745
6686
|
liveToolRef.current = null;
|
|
6746
6687
|
flushAgents();
|
|
6747
6688
|
void doSave().catch(() => { });
|
|
6748
|
-
refreshDelta();
|
|
6749
6689
|
setRows(prev => [
|
|
6750
6690
|
...prev,
|
|
6751
6691
|
...(trailing ? [{ role: 'steps', steps: [{ kind: 'say', text: trailing }] }] : []),
|
|
@@ -7268,9 +7208,10 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
7268
7208
|
lines.push(`Duration (API) ${humanDuration(apiMsRef.current)}`);
|
|
7269
7209
|
lines.push(`Duration (wall) ${humanDuration(wall)}`);
|
|
7270
7210
|
lines.push(`Turns ${stats.turns}`);
|
|
7271
|
-
lines.push(`Code changes ${
|
|
7272
|
-
|
|
7273
|
-
|
|
7211
|
+
lines.push(`Code changes ${(() => {
|
|
7212
|
+
const t = totalsOf(liveDiffs);
|
|
7213
|
+
return `${t.added} added, ${t.removed} removed, ${t.files} file${t.files === 1 ? '' : 's'}`;
|
|
7214
|
+
})()}`);
|
|
7274
7215
|
lines.push(`Tokens ${humanTokens(stats.promptTokens)} in · ${humanTokens(stats.completionTokens)} out`);
|
|
7275
7216
|
lines.push('');
|
|
7276
7217
|
if (apiMsRef.current > 0 && wall > apiMsRef.current) {
|
|
@@ -7632,7 +7573,7 @@ export function App({ config: initialConfig, clearFrame, synchronizedFrames = fa
|
|
|
7632
7573
|
?? contextLimitWithSource(cfg.model, cfg.contextTokens, servesOwnWeights(cfg.provider)).limit;
|
|
7633
7574
|
const facts = statusFacts({
|
|
7634
7575
|
model: cfg.model, limit, promptTokens: ctxFill?.tokens ?? 0,
|
|
7635
|
-
cwd: cfg.cwd, home: os.homedir(), delta:
|
|
7576
|
+
cwd: cfg.cwd, home: os.homedir(), delta: totalsOf(liveDiffs),
|
|
7636
7577
|
});
|
|
7637
7578
|
const sep = _jsx(Text, { color: DIM, children: ' · ' });
|
|
7638
7579
|
const bar = facts.ctx ? barCells(facts.ctx.fraction, 10) : null;
|