@iinm/plain-agent 1.10.14 → 1.10.15
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/package.json +1 -1
- package/src/cli/args.mjs +2 -2
- package/src/cli/streamFormatter.mjs +3 -3
- package/src/main.mjs +4 -5
package/package.json
CHANGED
package/src/cli/args.mjs
CHANGED
|
@@ -184,7 +184,7 @@ export function printHelp(exitCode = 0) {
|
|
|
184
184
|
console.log(`
|
|
185
185
|
Usage: plain [options]
|
|
186
186
|
plain batch [options] <task>
|
|
187
|
-
plain resume [<sessionId>] [--list]
|
|
187
|
+
plain resume [<sessionId>] [--list]
|
|
188
188
|
plain cost [--from YYYY-MM-DD] [--to YYYY-MM-DD]
|
|
189
189
|
plain list-models
|
|
190
190
|
plain install-claude-code-plugins
|
|
@@ -210,7 +210,7 @@ Subcommands:
|
|
|
210
210
|
install-claude-code-plugins Install Claude Code plugins
|
|
211
211
|
|
|
212
212
|
Examples:
|
|
213
|
-
plain -m
|
|
213
|
+
plain -m claude-sonnet-4-6+thinking-high
|
|
214
214
|
plain batch \\
|
|
215
215
|
-c ~/.config/plain-agent/config.local.json \\
|
|
216
216
|
-c .plain-agent/config.json \\
|
|
@@ -15,12 +15,12 @@ import { applyInlineMarkdown, formatMarkdownTable } from "./formatter.mjs";
|
|
|
15
15
|
* correctly without special boundary-detection logic.
|
|
16
16
|
*
|
|
17
17
|
* @param {(lines: string[], maxWidth?: number) => string} [formatTable=formatMarkdownTable] - Table formatting function (injectable for testing)
|
|
18
|
-
* @param {number} [maxWidth] - Maximum terminal display width (defaults to process.stdout.columns - 4 or
|
|
18
|
+
* @param {() => number} [maxWidth] - Maximum terminal display width (defaults to process.stdout.columns - 4 or 100)
|
|
19
19
|
* @returns {{ feed: (chunk: string) => StreamFormatterResult, forceFlush: () => StreamFormatterResult }}
|
|
20
20
|
*/
|
|
21
21
|
export function createStreamFormatter(
|
|
22
22
|
formatTable = formatMarkdownTable,
|
|
23
|
-
maxWidth = process.stdout.columns ? process.stdout.columns - 4 :
|
|
23
|
+
maxWidth = () => (process.stdout.columns ? process.stdout.columns - 4 : 100),
|
|
24
24
|
) {
|
|
25
25
|
/** @type {string} - Accumulated incomplete line */
|
|
26
26
|
let pendingLine = "";
|
|
@@ -168,7 +168,7 @@ export function createStreamFormatter(
|
|
|
168
168
|
l.endsWith("\n") ? l.slice(0, -1) : l,
|
|
169
169
|
);
|
|
170
170
|
try {
|
|
171
|
-
const formatted = formatTable(rawLines, maxWidth);
|
|
171
|
+
const formatted = formatTable(rawLines, maxWidth());
|
|
172
172
|
output.push(`${formatted}\n`);
|
|
173
173
|
} catch (err) {
|
|
174
174
|
// Fallback: output raw lines if formatting fails
|
package/src/main.mjs
CHANGED
|
@@ -241,23 +241,22 @@ export async function main(argv = process.argv) {
|
|
|
241
241
|
|
|
242
242
|
if (resumedState) {
|
|
243
243
|
// Switching models on resume is not supported. The model from the saved
|
|
244
|
-
// session always wins. If config disagrees,
|
|
244
|
+
// session always wins. If config disagrees, warn and continue.
|
|
245
245
|
if (
|
|
246
246
|
modelNameWithVariant &&
|
|
247
247
|
modelNameWithVariant !== resumedState.modelName
|
|
248
248
|
) {
|
|
249
249
|
console.error(
|
|
250
250
|
styleText(
|
|
251
|
-
"
|
|
251
|
+
"yellow",
|
|
252
252
|
[
|
|
253
|
-
|
|
253
|
+
`⚠️ Model mismatch for session ${resumedState.sessionId}.`,
|
|
254
254
|
` saved model: ${resumedState.modelName}`,
|
|
255
255
|
` current model: ${modelNameWithVariant}`,
|
|
256
|
-
"
|
|
256
|
+
"Resuming with the saved model.",
|
|
257
257
|
].join("\n"),
|
|
258
258
|
),
|
|
259
259
|
);
|
|
260
|
-
process.exit(1);
|
|
261
260
|
}
|
|
262
261
|
modelNameWithVariant = resumedState.modelName;
|
|
263
262
|
}
|