@staix/agent-hub 0.49.0 → 0.49.1
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/docs/design/adapters.md +1 -0
- package/docs/design/agent-hub-architecture.md +1 -0
- package/docs/design/agent-hub.md +1 -0
- package/docs/design/bus.md +1 -0
- package/docs/design/cli-output.md +2 -1
- package/docs/design/execution-reference.md +1 -0
- package/docs/design/guidance-experiments.md +1 -0
- package/docs/design/guidance-probes.md +1 -0
- package/docs/design/model-routes.md +1 -0
- package/docs/design/roadmap.md +1 -0
- package/docs/design/supervision.md +1 -0
- package/docs/design/task-board.md +1 -0
- package/docs/memory.md +3 -3
- package/docs/operations.md +2 -2
- package/docs/quickstart.md +8 -2
- package/docs/security.md +1 -1
- package/docs/verification/2026-11-29-0.49.1.md +50 -0
- package/docs/verified.json +10 -10
- package/package.json +3 -3
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +296 -95
- package/plugins/agent-hub/server.js +301 -100
- package/src/cli/console-state.ts +12 -39
package/src/cli/console-state.ts
CHANGED
|
@@ -375,40 +375,11 @@ export function fit(value: unknown, columns: number): string {
|
|
|
375
375
|
* at whitespace, which they drop; only a word longer than a whole line is split. A tab counts as one space.
|
|
376
376
|
* Lines come out sanitized: a width counts the `> ` that sanitize() puts before a line starting like a hub header.
|
|
377
377
|
*/
|
|
378
|
-
const wrapGraphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
379
378
|
export function wrap(value: unknown, columns: number, hang = 4): string[] {
|
|
380
|
-
const text = terminalText(value);
|
|
381
379
|
// A bare chunk ending in "--- from" becomes a header marker when table padding follows it.
|
|
382
380
|
const quoteChunk = (chunk: string) => sanitize(chunk + " ").slice(0, -1);
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (segment !== Array.from(segment)[0]) { complex = true; break; }
|
|
386
|
-
}
|
|
387
|
-
if (Number.isFinite(columns) && columns >= 1 && !complex) return sharedWrap(text, columns, hang, quoteChunk);
|
|
388
|
-
// Retain code-point splitting and non-positive widths for legacy output: STAIxBWLB/cli-output#36.
|
|
389
|
-
const lines: string[] = [];
|
|
390
|
-
const half = Math.floor(columns / 2);
|
|
391
|
-
const width = (chunk: string) => Bun.stringWidth(quoteChunk(chunk));
|
|
392
|
-
for (const part of text.replace(/\t/g, " ").split("\n")) {
|
|
393
|
-
const indent = /^\s*/.exec(part)![0];
|
|
394
|
-
const lead = Math.min(Bun.stringWidth(indent), half);
|
|
395
|
-
const pad = " ".repeat(Math.min(lead + hang, half));
|
|
396
|
-
const first = lines.length;
|
|
397
|
-
let start = " ".repeat(lead);
|
|
398
|
-
let line = start;
|
|
399
|
-
const push = () => { lines.push(quoteChunk(line.trimEnd())); line = start = pad; };
|
|
400
|
-
for (const token of part.slice(indent.length).match(/\s+|\S+/g) ?? []) {
|
|
401
|
-
if (width(line + token) <= columns) { line += token; continue; }
|
|
402
|
-
if (line !== start) push();
|
|
403
|
-
if (/^\s/.test(token)) continue;
|
|
404
|
-
for (const char of token) {
|
|
405
|
-
if (line !== start && width(line + char) > columns) push();
|
|
406
|
-
line += char;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
if (line !== start || lines.length === first) lines.push(quoteChunk(line.trimEnd()));
|
|
410
|
-
}
|
|
411
|
-
return lines;
|
|
381
|
+
// Code-point splitting keeps legacy output for every width, including the non-positive ones.
|
|
382
|
+
return sharedWrap(terminalText(value), columns, hang, quoteChunk, false, "codepoint");
|
|
412
383
|
}
|
|
413
384
|
export const plural = (n: number, word: string) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
414
385
|
/** `45s`, `12m`, `3h05m`, `2d03h`. */
|
|
@@ -1186,7 +1157,6 @@ function roomDetail(row: RoomStatusView): Record<string, unknown> {
|
|
|
1186
1157
|
* widest cell or header (Bun.stringWidth, at most a third of the width, wider cells cut with the marker); the last column
|
|
1187
1158
|
* takes the rest. One-shot callers may supply widths for already-wrapped cells; console defaults stay unchanged.
|
|
1188
1159
|
*/
|
|
1189
|
-
// Local tables retain styled separators, untouched final cells and narrow STAGE geometry: STAIxBWLB/cli-output#37.
|
|
1190
1160
|
export function table(head: string[], rows: Span[][], columns: number, explicitWidths?: readonly number[]): Span[][] {
|
|
1191
1161
|
const cap = Math.max(24, Math.floor(columns / 3));
|
|
1192
1162
|
const width = (cell: Span | undefined) => Bun.stringWidth(flat(cell?.text));
|
|
@@ -1201,13 +1171,16 @@ export function table(head: string[], rows: Span[][], columns: number, explicitW
|
|
|
1201
1171
|
}
|
|
1202
1172
|
widths[flexible] = Math.max(0, room());
|
|
1203
1173
|
}
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1174
|
+
// The hub owns the geometry above; the shared table lays the cells out. Caller-supplied widths wrap their headers.
|
|
1175
|
+
// Cells are cleaned the hub's way first: the package reads a bare CR as a line break, the hub drops it.
|
|
1176
|
+
const report = new SharedReport(undefined, false, { sanitize, sanitizeChunks: true, split: "codepoint" });
|
|
1177
|
+
// A STAGE table without TITLE has no flexible column: every cell, the last one too, is clipped and padded.
|
|
1178
|
+
report.table(head, rows.map(row => row.map(({ tone, text, ...cell }) => ({ ...cell, text: terminalText(text), ...(tone ? { style: tone } : {}) }))), flexible >= 0 ? flexible : head.length - 1, {
|
|
1179
|
+
headingStyle: "info", headerCase: "preserve", emptyCell: "blank", dropEmptyColumns: false, indent: 0,
|
|
1180
|
+
separatorStyle: "preceding", rawLastCell: flexible === head.length - 1, prewrapped: explicitWidths ? "body" : "all", widths,
|
|
1181
|
+
});
|
|
1182
|
+
// Drop the indent span and map styles back to console tones.
|
|
1183
|
+
return report.lines().map(line => line.slice(1).map(({ style, ...cell }) => ({ ...cell, ...(style ? { tone: style as Tone } : {}) })));
|
|
1211
1184
|
}
|
|
1212
1185
|
/** Keep the status/quota columns visible instead of clipping them behind optional peer metadata. */
|
|
1213
1186
|
function optionalTable(head: string[], rows: Span[][], columns: number, drop = ["DOING", "MODEL", "WIP", "PAUSE", "REVIEW", "AHUB", "LINK", "Q", "!", "MODE"]): Span[][] {
|