agent-coord-mcp 0.3.8 → 0.3.9
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/scripts/coord-chat.mjs +23 -10
package/package.json
CHANGED
package/scripts/coord-chat.mjs
CHANGED
|
@@ -108,19 +108,33 @@ const SLASH_COMMANDS = [
|
|
|
108
108
|
];
|
|
109
109
|
|
|
110
110
|
function completer(line) {
|
|
111
|
-
// Tab-complete slash commands and DM targets.
|
|
111
|
+
// Tab-complete slash commands and DM targets. On multi-match with no
|
|
112
|
+
// common-prefix advancement, surface the options on the first Tab via
|
|
113
|
+
// say() — default readline UX hides them until a second Tab, which most
|
|
114
|
+
// users assume means "nothing happened."
|
|
115
|
+
let hits = [];
|
|
112
116
|
if (line.startsWith("/dm ")) {
|
|
113
117
|
const partial = line.slice(4);
|
|
114
118
|
const reg = readJsonSafe(AGENTS_FILE, {});
|
|
115
119
|
const ids = Object.keys(reg).filter((id) => id !== ID && id.startsWith(partial));
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
hits = ids.map((id) => `/dm ${id} `);
|
|
121
|
+
} else if (line.startsWith("/")) {
|
|
122
|
+
hits = SLASH_COMMANDS.filter((c) => c.startsWith(line));
|
|
118
123
|
}
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
|
|
124
|
+
if (hits.length > 1 && commonPrefix(hits).length <= line.length) {
|
|
125
|
+
const display = hits.map((h) => h.trim()).join(" ");
|
|
126
|
+
say(A.dim(" ┄ " + display));
|
|
122
127
|
}
|
|
123
|
-
return [
|
|
128
|
+
return [hits, line];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function commonPrefix(strs) {
|
|
132
|
+
if (strs.length === 0) return "";
|
|
133
|
+
let p = strs[0];
|
|
134
|
+
for (const s of strs.slice(1)) {
|
|
135
|
+
while (s.indexOf(p) !== 0) p = p.slice(0, -1);
|
|
136
|
+
}
|
|
137
|
+
return p;
|
|
124
138
|
}
|
|
125
139
|
|
|
126
140
|
const rl = readline.createInterface({
|
|
@@ -264,15 +278,14 @@ function refreshPrompt() {
|
|
|
264
278
|
}
|
|
265
279
|
|
|
266
280
|
function printBanner() {
|
|
267
|
-
// Compact banner — three lines plus a separator
|
|
268
|
-
//
|
|
281
|
+
// Compact banner — three lines plus a separator matching the input-area
|
|
282
|
+
// separator width so they look like the same UI element, not two.
|
|
269
283
|
const lines = [
|
|
270
284
|
A.bold(A.cyan(" agent-coord ")) + A.dim("— shared chat for agents and humans"),
|
|
271
285
|
A.dim(` agentId=${A.reset}${agentColor(ID)(ID)}${A.dim(" dir=" + ROOT)}`),
|
|
272
286
|
A.dim(" type /help for commands · /quit to leave"),
|
|
273
287
|
];
|
|
274
288
|
for (const l of lines) say(l);
|
|
275
|
-
say(A.dim(" " + "─".repeat(60)));
|
|
276
289
|
}
|
|
277
290
|
|
|
278
291
|
function printHelp() {
|