@vincemakes/kiso-code 0.40.1 → 0.40.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.
- package/dist/chat.d.ts +12 -0
- package/dist/chat.js +18 -2
- package/dist/index.js +18 -2
- package/package.json +15 -15
package/dist/chat.d.ts
CHANGED
|
@@ -100,6 +100,18 @@ export declare function statusModelLabel(session: {
|
|
|
100
100
|
readonly effort: string;
|
|
101
101
|
};
|
|
102
102
|
}): string;
|
|
103
|
+
/** ADR-0055 Amendment 2 (decision 5): with no stated window the status row
|
|
104
|
+
* shows `ctx ?`, yet the compaction tiers still assume the 200K fallback
|
|
105
|
+
* — the assumption is said out loud once, at agent build. */
|
|
106
|
+
export declare function unknownWindowNotice(model: string): string;
|
|
107
|
+
/** ADR-0055 Amendment 2: the notice for a checkpoint the shrink invariant
|
|
108
|
+
* discarded — chars/4 sizes only; the checkpoint's text is the owner's
|
|
109
|
+
* work and never reaches the screen. */
|
|
110
|
+
export declare function compactionDiscardedNotice(d: {
|
|
111
|
+
readonly pre: number;
|
|
112
|
+
readonly post: number;
|
|
113
|
+
readonly summary: number;
|
|
114
|
+
}): string;
|
|
103
115
|
export declare function displayCtxRatio(session: AgentSession): number;
|
|
104
116
|
/** 0.40.0 item 9: how long a prompt cache is assumed to live. PROVISIONAL:
|
|
105
117
|
* DeepSeek does not publish its TTL (the owner's cache was gone after 27
|
package/dist/chat.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* estimates. All bodies moved verbatim from index.ts.
|
|
6
6
|
*/
|
|
7
7
|
import { readFileSync, statSync } from "node:fs";
|
|
8
|
-
import { escapeTerminal, cacheHitPct, decodeRate, idleStatus, palette, renderEvent, renderRecap, runningStatus, toolTarget, verifyOfferView, STATUS_GLYPHS, } from "@vincemakes/kiso-tui";
|
|
8
|
+
import { escapeTerminal, cacheHitPct, decodeRate, idleStatus, palette, renderEvent, renderRecap, runningStatus, toolTarget, verifyOfferView, STATUS_GLYPHS, kUnit, } from "@vincemakes/kiso-tui";
|
|
9
9
|
import { askView, coldResumeLine, coldResumeView, deletionRiskHint, editFileDiff, writeFileDiff } from "@vincemakes/kiso-tui";
|
|
10
10
|
import { canonicalTargetPath, isProtectedPath, protectedIdentity, shellProgressPath } from "@vincemakes/kiso-tools-node";
|
|
11
11
|
import { queuedSwitchLines } from "./state.js";
|
|
@@ -160,7 +160,23 @@ export function statusModelLabel(session) {
|
|
|
160
160
|
// identity is asked for (`/status`), not in a row that has ~40 columns and
|
|
161
161
|
// cut the host to `deepseek/d…ndcode.ai`. Unnecessary at best, misleading at
|
|
162
162
|
// worst: it read as a path, not as an account.
|
|
163
|
-
|
|
163
|
+
// The owner, 2026-09-22: the row shows the MODEL's name only — a vendor
|
|
164
|
+
// prefix (`deepseek/deepseek-v4.1-flash`) cost the row its tail. The full
|
|
165
|
+
// id stays in `/status` and `/model`, where identity is asked for.
|
|
166
|
+
const name = agentModel.slice(agentModel.lastIndexOf("/") + 1) || agentModel;
|
|
167
|
+
return effort !== undefined && effort !== "default" ? `${name} · ${effort}` : name;
|
|
168
|
+
}
|
|
169
|
+
/** ADR-0055 Amendment 2 (decision 5): with no stated window the status row
|
|
170
|
+
* shows `ctx ?`, yet the compaction tiers still assume the 200K fallback
|
|
171
|
+
* — the assumption is said out loud once, at agent build. */
|
|
172
|
+
export function unknownWindowNotice(model) {
|
|
173
|
+
return `[kiso] context window unknown for ${model} at this endpoint — compaction assumes ${DEFAULT_CONTEXT_WINDOW / 1000}K; set contextWindow on the profile to state it`;
|
|
174
|
+
}
|
|
175
|
+
/** ADR-0055 Amendment 2: the notice for a checkpoint the shrink invariant
|
|
176
|
+
* discarded — chars/4 sizes only; the checkpoint's text is the owner's
|
|
177
|
+
* work and never reaches the screen. */
|
|
178
|
+
export function compactionDiscardedNotice(d) {
|
|
179
|
+
return `✦ compaction discarded — the checkpoint did not shrink the context (~${kUnit(d.pre)} → ~${kUnit(d.post)}; it wrote ~${kUnit(d.summary)})`;
|
|
164
180
|
}
|
|
165
181
|
export function displayCtxRatio(session) {
|
|
166
182
|
// CAPACITY is not POLICY. `contextWindowTokens` falls back to 200,000 so
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,7 @@ import { maxRetriesFromEnv } from "./retries.js";
|
|
|
50
50
|
import { askUi, resolveProjectTrust } from "./trust-ui.js";
|
|
51
51
|
import { isFirstRun, scaffoldFirstRun } from "./first-run.js";
|
|
52
52
|
import { fauxSkip, readFauxScript } from "./faux-glue.js";
|
|
53
|
-
import { chat, contextWindowTokens, displayCtxRatio, microcompactThresholdFor, statusModelLabel } from "./chat.js";
|
|
53
|
+
import { chat, compactionDiscardedNotice, contextWindowTokens, displayCtxRatio, knownContextWindow, microcompactThresholdFor, statusModelLabel, unknownWindowNotice } from "./chat.js";
|
|
54
54
|
import { adapterOptionsFor } from "./auth/adapter-options.js";
|
|
55
55
|
import { loadProjectConfig, loadUserConfig, mergeConfigs, resolveAutoCompact, resolveContextWindow, resolveModel } from "./config.js";
|
|
56
56
|
import { checkForUpdate, knownUpdate, updateCardLines } from "./update-check.js";
|
|
@@ -794,6 +794,12 @@ async function makeAgent(sessionId, input, modelFlag) {
|
|
|
794
794
|
setCurrentProfileName(resolved.name);
|
|
795
795
|
}
|
|
796
796
|
setAgentModel(model, resolved?.profile.baseUrl); // v2b: the status bar shows it; OR-1: the endpoint rides along
|
|
797
|
+
// ADR-0055 Amendment 2: the row says `ctx ?` for an unstated window, but
|
|
798
|
+
// the tiers still need a number and assume 200K — say so, once, at build.
|
|
799
|
+
if (!unknownWindowNoticed && knownContextWindow() === null) {
|
|
800
|
+
unknownWindowNoticed = true;
|
|
801
|
+
console.error(unknownWindowNotice(model));
|
|
802
|
+
}
|
|
797
803
|
// W21: the extensions array is built ONCE per agent and shared with
|
|
798
804
|
// the runtime by reference — the don't-ask-again writer pushes the
|
|
799
805
|
// generated extension into it so a first-time rule joins the chain
|
|
@@ -860,7 +866,16 @@ async function makeAgent(sessionId, input, modelFlag) {
|
|
|
860
866
|
// 1 reads the user's configured checks first, then the runner table.
|
|
861
867
|
contextPolicy: {
|
|
862
868
|
...(contextPolicy ?? {}),
|
|
863
|
-
tiers: {
|
|
869
|
+
tiers: {
|
|
870
|
+
windowTokens: contextWindowTokens(),
|
|
871
|
+
isCheck: (command) => runsACheck(command, Object.values(merged.checks ?? {})),
|
|
872
|
+
// ADR-0055 Amendment 2: a discarded checkpoint says so, in sizes only.
|
|
873
|
+
onDiscard: (d) => body.notice(compactionDiscardedNotice(d)),
|
|
874
|
+
// ADR-0055 Amendment 2 (decision 3): only a window someone stated
|
|
875
|
+
// arms the overflow belt — read from the LIVE binding, so it moves
|
|
876
|
+
// with /model and /resume; the 200K fallback reads as null.
|
|
877
|
+
statedWindow: () => knownContextWindow(),
|
|
878
|
+
},
|
|
864
879
|
},
|
|
865
880
|
// R3e (owner ruling, 2026-08-28): NO turn limit on an interactive
|
|
866
881
|
// session. This was `maxTurns: 20`, hardcoded on 2026-08-03 with no
|
|
@@ -1109,6 +1124,7 @@ async function pickSession(agent, input) {
|
|
|
1109
1124
|
* once; 0.41.0 removes it.
|
|
1110
1125
|
*/
|
|
1111
1126
|
let autoCompactNoticed = false;
|
|
1127
|
+
let unknownWindowNoticed = false;
|
|
1112
1128
|
function retiredAutoCompact(merged) {
|
|
1113
1129
|
if (!autoCompactNoticed && (process.env.KISO_AUTO_COMPACT !== undefined || resolveAutoCompact(merged) !== undefined)) {
|
|
1114
1130
|
autoCompactNoticed = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-code",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.2",
|
|
4
4
|
"description": "kiso-code \u2014 the coding agent on kiso, the durable runtime for AI agents: kiso chat / kiso resume / kiso sessions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
"test": "vitest run"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@vincemakes/kiso-ask-ext": "0.40.
|
|
22
|
-
"@vincemakes/kiso-core": "0.40.
|
|
23
|
-
"@vincemakes/kiso-evals": "0.40.
|
|
24
|
-
"@vincemakes/kiso-mcp-ext": "0.40.
|
|
25
|
-
"@vincemakes/kiso-provider-anthropic": "0.40.
|
|
26
|
-
"@vincemakes/kiso-provider-openai": "0.40.
|
|
27
|
-
"@vincemakes/kiso-provider-openai-responses": "0.40.
|
|
28
|
-
"@vincemakes/kiso-runtime": "0.40.
|
|
29
|
-
"@vincemakes/kiso-skills-ext": "0.40.
|
|
30
|
-
"@vincemakes/kiso-subagent-ext": "0.40.
|
|
31
|
-
"@vincemakes/kiso-task-ext": "0.40.
|
|
32
|
-
"@vincemakes/kiso-tools-node": "0.40.
|
|
33
|
-
"@vincemakes/kiso-tui": "0.40.
|
|
34
|
-
"@vincemakes/kiso-tui-cells": "0.40.
|
|
21
|
+
"@vincemakes/kiso-ask-ext": "0.40.2",
|
|
22
|
+
"@vincemakes/kiso-core": "0.40.2",
|
|
23
|
+
"@vincemakes/kiso-evals": "0.40.2",
|
|
24
|
+
"@vincemakes/kiso-mcp-ext": "0.40.2",
|
|
25
|
+
"@vincemakes/kiso-provider-anthropic": "0.40.2",
|
|
26
|
+
"@vincemakes/kiso-provider-openai": "0.40.2",
|
|
27
|
+
"@vincemakes/kiso-provider-openai-responses": "0.40.2",
|
|
28
|
+
"@vincemakes/kiso-runtime": "0.40.2",
|
|
29
|
+
"@vincemakes/kiso-skills-ext": "0.40.2",
|
|
30
|
+
"@vincemakes/kiso-subagent-ext": "0.40.2",
|
|
31
|
+
"@vincemakes/kiso-task-ext": "0.40.2",
|
|
32
|
+
"@vincemakes/kiso-tools-node": "0.40.2",
|
|
33
|
+
"@vincemakes/kiso-tui": "0.40.2",
|
|
34
|
+
"@vincemakes/kiso-tui-cells": "0.40.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^26.1.2",
|