@vincemakes/kiso-code 0.26.0 → 0.26.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.js +10 -2
- package/dist/index.js +44 -3
- package/dist/state.d.ts +3 -0
- package/package.json +14 -14
package/dist/chat.js
CHANGED
|
@@ -1182,12 +1182,20 @@ export async function chat(session, faux, input, autoCompact, nav) {
|
|
|
1182
1182
|
return;
|
|
1183
1183
|
dispatch("/compact", dispatchCtx);
|
|
1184
1184
|
};
|
|
1185
|
+
// CX-1 F5: a literal input (task-file mode) submits the turn directly —
|
|
1186
|
+
// its bytes never meet the slash dispatcher.
|
|
1187
|
+
const route = (line) => {
|
|
1188
|
+
if (input.literal === true)
|
|
1189
|
+
dispatchCtx.submitTurn(line);
|
|
1190
|
+
else
|
|
1191
|
+
dispatch(line, dispatchCtx);
|
|
1192
|
+
};
|
|
1185
1193
|
input.onLine((line) => {
|
|
1186
1194
|
if (!replReady) {
|
|
1187
1195
|
queuedLines.push(line);
|
|
1188
1196
|
return;
|
|
1189
1197
|
}
|
|
1190
|
-
|
|
1198
|
+
route(line);
|
|
1191
1199
|
});
|
|
1192
1200
|
// W15: the expand key — the editor forwards ctrl+o; dispatch runs the
|
|
1193
1201
|
// chain action (the sentinel's control char marks the key, so a typed
|
|
@@ -1246,7 +1254,7 @@ export async function chat(session, faux, input, autoCompact, nav) {
|
|
|
1246
1254
|
// chain BEFORE the appends and the replayed turns would never be
|
|
1247
1255
|
// awaited (the F-group regression).
|
|
1248
1256
|
for (const line of queuedLines) {
|
|
1249
|
-
|
|
1257
|
+
route(line);
|
|
1250
1258
|
}
|
|
1251
1259
|
queuedLines.length = 0;
|
|
1252
1260
|
input.prompt();
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import { appendFileSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
27
27
|
import { newSessionId } from "./session-id.js";
|
|
28
28
|
import { createInterface } from "node:readline";
|
|
29
|
+
import { Readable } from "node:stream";
|
|
29
30
|
import { fileURLToPath } from "node:url";
|
|
30
31
|
import { join } from "node:path";
|
|
31
32
|
import { Body, Editor, bannerLines, currentGround, resolveGround, setGround, escapeTerminal, extensionsBannerText, idColumn, idleStatus, interactivePrompt, palette, renderSessionLine, sessionListFooter, sessionListRow } from "@vincemakes/kiso-tui";
|
|
@@ -38,7 +39,7 @@ import { agentModel, atFiles, body, bodyLog, kisoHome, builtInExtensions, curren
|
|
|
38
39
|
import { askUi, resolveProjectTrust } from "./trust-ui.js";
|
|
39
40
|
import { isFirstRun, scaffoldFirstRun } from "./first-run.js";
|
|
40
41
|
import { fauxSkip, readFauxScript } from "./faux-glue.js";
|
|
41
|
-
import {
|
|
42
|
+
import { chat, contextWindowTokens, estimateCtxRatio } from "./chat.js";
|
|
42
43
|
import { loadProjectConfig, loadUserConfig, mergeConfigs, resolveAutoCompact, resolveContextWindow, resolveModel } from "./config.js";
|
|
43
44
|
import { checkForUpdate } from "./update-check.js";
|
|
44
45
|
import { resume } from "./resume.js";
|
|
@@ -54,6 +55,22 @@ export { applyProjectMerges } from "./trust-ui.js";
|
|
|
54
55
|
* prompt. Only ever constructed when stdin is NOT a TTY. The rl starts
|
|
55
56
|
* consuming stdin at construction (main), so 'line' events are buffered
|
|
56
57
|
* until chat() wires the handler — pipe input must never be dropped. */
|
|
58
|
+
/** CX-1 F5 (audit F5): the task-file input — the file's whole content is
|
|
59
|
+
* ONE turn, delivered the moment the loop listens, and the input is
|
|
60
|
+
* closed right after: chat still awaits the in-flight chain before it
|
|
61
|
+
* exits, so the turn runs to its terminal and nothing else is read.
|
|
62
|
+
* Built on an EMPTY readline so every other member keeps the pipe
|
|
63
|
+
* path's exact semantics (auto-denied asks, no chips, no pops). */
|
|
64
|
+
function taskFileInput(content) {
|
|
65
|
+
const base = readlineInput(createInterface({ input: Readable.from([]), output: process.stdout }));
|
|
66
|
+
return {
|
|
67
|
+
...base,
|
|
68
|
+
literal: true,
|
|
69
|
+
onLine(cb) {
|
|
70
|
+
cb(content);
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
57
74
|
function readlineInput(rl) {
|
|
58
75
|
let lineCb = null;
|
|
59
76
|
const pending = [];
|
|
@@ -867,6 +884,25 @@ async function main() {
|
|
|
867
884
|
else {
|
|
868
885
|
setMode(modeFromEnv() ?? loadUserConfig()?.mode ?? "default");
|
|
869
886
|
}
|
|
887
|
+
// CX-1 F5: --task-file <path> — the file is the ONE user turn (the
|
|
888
|
+
// structured child entry). Read BEFORE any session exists: an
|
|
889
|
+
// unreadable file is a usage error with nothing executed.
|
|
890
|
+
let taskFile;
|
|
891
|
+
{
|
|
892
|
+
const i = args.indexOf("--task-file");
|
|
893
|
+
if (i !== -1) {
|
|
894
|
+
const path = args[i + 1];
|
|
895
|
+
if (path === undefined)
|
|
896
|
+
throw new CliUsageError("--task-file needs a path");
|
|
897
|
+
try {
|
|
898
|
+
taskFile = readFileSync(path, "utf8");
|
|
899
|
+
}
|
|
900
|
+
catch (err) {
|
|
901
|
+
throw new CliUsageError(`--task-file: cannot read ${path}: ${err.message}`);
|
|
902
|
+
}
|
|
903
|
+
args.splice(i, 2);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
870
906
|
const [command, arg] = args;
|
|
871
907
|
// round 8: faux mode is the keyless demo script — an exhausted script must
|
|
872
908
|
// exit non-zero, never masquerade as a successful provider run. The
|
|
@@ -878,7 +914,7 @@ async function main() {
|
|
|
878
914
|
// (entered here, dock-bound, trusted before any extension loads),
|
|
879
915
|
// readline elsewhere. The trust question, chat, and resume all read
|
|
880
916
|
// through it; main's finally closes it on every exit path.
|
|
881
|
-
const input = makeLineInput();
|
|
917
|
+
const input = taskFile !== undefined ? taskFileInput(taskFile) : makeLineInput();
|
|
882
918
|
// R3a — cross-session input history: ~/.kiso/history, one line per
|
|
883
919
|
// entry, appended on submit, tail-500 at load (truncated by REWRITE
|
|
884
920
|
// at startup so the file never grows unbounded). Unreadable file =
|
|
@@ -1096,7 +1132,12 @@ async function main() {
|
|
|
1096
1132
|
agent = await makeAgent(id, input, modelFlag);
|
|
1097
1133
|
// finding E4-1's faux resolution rides chatLoop (currentFaux).
|
|
1098
1134
|
faux = currentFaux;
|
|
1099
|
-
|
|
1135
|
+
// CX-1 F9 (audit F9): the bare entry resolves autoCompact from
|
|
1136
|
+
// the SAME merged config chat/resume use — the env override
|
|
1137
|
+
// lives inside the resolver. It used to pass the env-only
|
|
1138
|
+
// reader, so a user's config.json autoCompact worked on
|
|
1139
|
+
// `kiso chat` and silently vanished on the default entry.
|
|
1140
|
+
await chatLoop(agent, id, input, resolveAutoCompact(mergedConfig));
|
|
1100
1141
|
break;
|
|
1101
1142
|
}
|
|
1102
1143
|
}
|
package/dist/state.d.ts
CHANGED
|
@@ -67,6 +67,9 @@ export declare function atWalkFor(root: string, excludeRoots: readonly string[])
|
|
|
67
67
|
* source.
|
|
68
68
|
*/
|
|
69
69
|
export interface LineInput {
|
|
70
|
+
/** CX-1 F5: task-file mode — every line delivered is a TURN, never a
|
|
71
|
+
* command; the dispatcher is bypassed (a leading `/` is content). */
|
|
72
|
+
readonly literal?: boolean;
|
|
70
73
|
onLine(cb: (line: string) => void): void;
|
|
71
74
|
onSigint(cb: () => void): void;
|
|
72
75
|
onEot(cb: () => void): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-code",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
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.26.
|
|
22
|
-
"@vincemakes/kiso-core": "0.26.
|
|
23
|
-
"@vincemakes/kiso-evals": "0.26.
|
|
24
|
-
"@vincemakes/kiso-mcp-ext": "0.26.
|
|
25
|
-
"@vincemakes/kiso-provider-anthropic": "0.26.
|
|
26
|
-
"@vincemakes/kiso-provider-openai": "0.26.
|
|
27
|
-
"@vincemakes/kiso-runtime": "0.26.
|
|
28
|
-
"@vincemakes/kiso-skills-ext": "0.26.
|
|
29
|
-
"@vincemakes/kiso-subagent-ext": "0.26.
|
|
30
|
-
"@vincemakes/kiso-task-ext": "0.26.
|
|
31
|
-
"@vincemakes/kiso-tools-node": "0.26.
|
|
32
|
-
"@vincemakes/kiso-tui": "0.26.
|
|
33
|
-
"@vincemakes/kiso-tui-cells": "0.26.
|
|
21
|
+
"@vincemakes/kiso-ask-ext": "0.26.2",
|
|
22
|
+
"@vincemakes/kiso-core": "0.26.2",
|
|
23
|
+
"@vincemakes/kiso-evals": "0.26.2",
|
|
24
|
+
"@vincemakes/kiso-mcp-ext": "0.26.2",
|
|
25
|
+
"@vincemakes/kiso-provider-anthropic": "0.26.2",
|
|
26
|
+
"@vincemakes/kiso-provider-openai": "0.26.2",
|
|
27
|
+
"@vincemakes/kiso-runtime": "0.26.2",
|
|
28
|
+
"@vincemakes/kiso-skills-ext": "0.26.2",
|
|
29
|
+
"@vincemakes/kiso-subagent-ext": "0.26.2",
|
|
30
|
+
"@vincemakes/kiso-task-ext": "0.26.2",
|
|
31
|
+
"@vincemakes/kiso-tools-node": "0.26.2",
|
|
32
|
+
"@vincemakes/kiso-tui": "0.26.2",
|
|
33
|
+
"@vincemakes/kiso-tui-cells": "0.26.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.1.2",
|