@vincemakes/kiso-code 0.20.1 → 0.20.3
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/dispatch.js +46 -3
- package/dist/mode.d.ts +5 -0
- package/dist/mode.js +11 -0
- package/package.json +14 -14
package/dist/dispatch.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* turns. The bodies moved verbatim from chat()'s closure; chat provides
|
|
4
4
|
* the context (the chain, the run state, the prompt arming).
|
|
5
5
|
*/
|
|
6
|
-
import { contextRows, contextUnavailableRows, displayVerb, escapeTerminal, helpRows, kUnit, modelPickView, palette } from "@vincemakes/kiso-tui";
|
|
6
|
+
import { contextRows, contextUnavailableRows, displayVerb, escapeTerminal, helpRows, kUnit, modePickView, modelPickView, palette } from "@vincemakes/kiso-tui";
|
|
7
7
|
import { newSessionId } from "./session-id.js";
|
|
8
8
|
import { buildAdapter, resolveContinuationScope, resolveReasoning } from "@vincemakes/kiso-runtime/internal";
|
|
9
|
-
import { MODES, getMode, setMode } from "./mode.js";
|
|
9
|
+
import { MODES, MODE_NOTE, getMode, setMode } from "./mode.js";
|
|
10
10
|
import { agentModel, body, bodyLog, configModels, dock, readContextLedger, sessionsDir, setAgentModel, setCurrentModelName, setLastBinding } from "./state.js";
|
|
11
11
|
import { directWriteProfile, profileAvailable } from "./config.js";
|
|
12
12
|
/** The ONE dispatcher — slash commands, exit, and turns. The recovery
|
|
@@ -100,7 +100,11 @@ export function dispatch(line, ctx) {
|
|
|
100
100
|
bodyLog(line);
|
|
101
101
|
}
|
|
102
102
|
else if (r.kind === "none") {
|
|
103
|
-
|
|
103
|
+
// DC-35: "nothing to expand" was said in two situations and
|
|
104
|
+
// was only true in one of them. A reader who pressed the key
|
|
105
|
+
// on a ring of one had something to open — they were already
|
|
106
|
+
// looking at it — and the old line told them the opposite.
|
|
107
|
+
bodyLog(r.why === "already-last" ? "[that expansion is already the last thing on screen — ctrl+o opens the transcript]" : "[nothing to expand]");
|
|
104
108
|
}
|
|
105
109
|
ctx.input.prompt();
|
|
106
110
|
};
|
|
@@ -176,6 +180,45 @@ export function dispatch(line, ctx) {
|
|
|
176
180
|
ctx.chainRef.current = ctx.chainRef.current.then(async () => {
|
|
177
181
|
const m = MODES.find((x) => x === trimmed.slice(5).trim());
|
|
178
182
|
if (trimmed.slice(5).trim() === "") {
|
|
183
|
+
// DC-36 — BARE /mode PICKS, the way bare /model has since
|
|
184
|
+
// TUI2-R2 ④. The five tiers are a CLOSED set, which makes
|
|
185
|
+
// this the least defensible place in the product to have
|
|
186
|
+
// asked a human to type the answer: everything needed to
|
|
187
|
+
// make it a choice was on screen and only the choosing was
|
|
188
|
+
// missing.
|
|
189
|
+
//
|
|
190
|
+
// The printed form survives VERBATIM wherever there is no
|
|
191
|
+
// panel to draw — a pipe, a dock-less TTY — because that is
|
|
192
|
+
// a machine-readable surface and this round moves no bytes
|
|
193
|
+
// on one. `/mode <name>` is untouched.
|
|
194
|
+
if (dock.active && ctx.input.panelAsk !== undefined) {
|
|
195
|
+
const current = getMode();
|
|
196
|
+
const picked = await new Promise((resolve) => {
|
|
197
|
+
ctx.input.panelAsk(modePickView({
|
|
198
|
+
header: `mode — current: ${current}`,
|
|
199
|
+
options: MODES.map((name) => ({ label: name, note: [MODE_NOTE[name], ...(name === current ? ["current"] : [])].join(" · ") })),
|
|
200
|
+
},
|
|
201
|
+
// DC-12 (design §4): a panel WAITING ON A HUMAN says ⏸.
|
|
202
|
+
ctx.isRunning() ? "⏸ run paused" : `▸ ${current}`), (v) => resolve(v.action === "picked" ? v.result : null));
|
|
203
|
+
});
|
|
204
|
+
ctx.paintIdle();
|
|
205
|
+
if (picked === null) {
|
|
206
|
+
ctx.input.prompt();
|
|
207
|
+
return; // esc — nothing switched, nothing said
|
|
208
|
+
}
|
|
209
|
+
const chosen = "index" in picked ? MODES[picked.index] : MODES.find((x) => x === picked.custom.trim());
|
|
210
|
+
if (chosen === undefined) {
|
|
211
|
+
bodyLog(`no such mode: ${"index" in picked ? String(picked.index) : picked.custom.trim()}`);
|
|
212
|
+
bodyLog(`tiers: ${MODES.join(" ")}`);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
setMode(chosen);
|
|
216
|
+
body.notice(`mode → ${chosen}`);
|
|
217
|
+
ctx.paintIdle();
|
|
218
|
+
}
|
|
219
|
+
ctx.input.prompt();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
179
222
|
bodyLog(`mode ${getMode()}`);
|
|
180
223
|
bodyLog(`tiers: ${MODES.join(" ")}`);
|
|
181
224
|
}
|
package/dist/mode.d.ts
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
import type { KisoExtension } from "@vincemakes/kiso-runtime";
|
|
13
13
|
export type Mode = "manual" | "default" | "accept-edits" | "plan" | "bypass";
|
|
14
14
|
export declare const MODES: readonly Mode[];
|
|
15
|
+
/** DC-36 — one line per tier, for the picker, TRANSCRIBED FROM decide()
|
|
16
|
+
* below rather than written fresh. A description that drifts from the
|
|
17
|
+
* behaviour is worse than none: this is the row a human reads before
|
|
18
|
+
* handing over the approval gate. */
|
|
19
|
+
export declare const MODE_NOTE: Readonly<Record<Mode, string>>;
|
|
15
20
|
export declare function getMode(): Mode;
|
|
16
21
|
export declare function setMode(m: Mode): void;
|
|
17
22
|
/** The startup mode from env: KISO_MODE, or undefined when unset (the
|
package/dist/mode.js
CHANGED
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
* monotonicity — bypass cannot override an extension deny).
|
|
11
11
|
*/
|
|
12
12
|
export const MODES = ["manual", "default", "accept-edits", "plan", "bypass"];
|
|
13
|
+
/** DC-36 — one line per tier, for the picker, TRANSCRIBED FROM decide()
|
|
14
|
+
* below rather than written fresh. A description that drifts from the
|
|
15
|
+
* behaviour is worse than none: this is the row a human reads before
|
|
16
|
+
* handing over the approval gate. */
|
|
17
|
+
export const MODE_NOTE = {
|
|
18
|
+
manual: "every tool asks",
|
|
19
|
+
default: "reads run; writes, edits and shell ask",
|
|
20
|
+
"accept-edits": "reads, writes and edits run; shell asks",
|
|
21
|
+
plan: "reads run; everything else is denied — read-only",
|
|
22
|
+
bypass: "everything runs, nothing asks",
|
|
23
|
+
};
|
|
13
24
|
/** The read-only tool set (plan): reading is allowed, everything else
|
|
14
25
|
* denied with the guiding reason. */
|
|
15
26
|
const READ_TOOLS = new Set(["read_file", "list_dir", "search_text", "read_skill"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-code",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.3",
|
|
4
4
|
"description": "kiso CLI — the durable coding agent that survives kill -9: kiso chat / kiso resume / kiso sessions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
"test": "vitest run"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@vincemakes/kiso-ask-ext": "0.20.
|
|
22
|
-
"@vincemakes/kiso-core": "0.20.
|
|
23
|
-
"@vincemakes/kiso-evals": "0.20.
|
|
24
|
-
"@vincemakes/kiso-mcp-ext": "0.20.
|
|
25
|
-
"@vincemakes/kiso-provider-anthropic": "0.20.
|
|
26
|
-
"@vincemakes/kiso-provider-openai": "0.20.
|
|
27
|
-
"@vincemakes/kiso-runtime": "0.20.
|
|
28
|
-
"@vincemakes/kiso-skills-ext": "0.20.
|
|
29
|
-
"@vincemakes/kiso-subagent-ext": "0.20.
|
|
30
|
-
"@vincemakes/kiso-task-ext": "0.20.
|
|
31
|
-
"@vincemakes/kiso-tools-node": "0.20.
|
|
32
|
-
"@vincemakes/kiso-tui": "0.20.
|
|
33
|
-
"@vincemakes/kiso-tui-cells": "0.20.
|
|
21
|
+
"@vincemakes/kiso-ask-ext": "0.20.3",
|
|
22
|
+
"@vincemakes/kiso-core": "0.20.3",
|
|
23
|
+
"@vincemakes/kiso-evals": "0.20.3",
|
|
24
|
+
"@vincemakes/kiso-mcp-ext": "0.20.3",
|
|
25
|
+
"@vincemakes/kiso-provider-anthropic": "0.20.3",
|
|
26
|
+
"@vincemakes/kiso-provider-openai": "0.20.3",
|
|
27
|
+
"@vincemakes/kiso-runtime": "0.20.3",
|
|
28
|
+
"@vincemakes/kiso-skills-ext": "0.20.3",
|
|
29
|
+
"@vincemakes/kiso-subagent-ext": "0.20.3",
|
|
30
|
+
"@vincemakes/kiso-task-ext": "0.20.3",
|
|
31
|
+
"@vincemakes/kiso-tools-node": "0.20.3",
|
|
32
|
+
"@vincemakes/kiso-tui": "0.20.3",
|
|
33
|
+
"@vincemakes/kiso-tui-cells": "0.20.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.1.2",
|