@cordfuse/crosstalk 7.0.0-alpha.10 → 7.0.0-alpha.11
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/commands/status.js +38 -32
- package/package.json +1 -1
package/commands/status.js
CHANGED
|
@@ -25,40 +25,46 @@ export async function run(argv) {
|
|
|
25
25
|
process.stdout.write('\n');
|
|
26
26
|
|
|
27
27
|
process.stdout.write(`Claimed models: ${s.claimed_models.length}\n`);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
for (const m of s.claimed_models) process.stdout.write(` - ${m}\n`);
|
|
29
|
+
|
|
30
|
+
// N1 (alpha.11): surface the install/claim diagnostic regardless of
|
|
31
|
+
// claimed_models count. Alpha.10 only rendered when claimed was zero,
|
|
32
|
+
// which missed the common mixed-state case — operator already had one
|
|
33
|
+
// agent running and installed a second one that's referenced in yaml
|
|
34
|
+
// but not yet claimed. Now the hint fires whenever there's a gap
|
|
35
|
+
// between installed CLIs and claimed CLIs.
|
|
36
|
+
let installed = null;
|
|
37
|
+
let yamlReferenced = null;
|
|
38
|
+
let claimedClis = null;
|
|
39
|
+
try {
|
|
40
|
+
const r = await api.get('/agents/installed');
|
|
41
|
+
installed = r.installed;
|
|
42
|
+
yamlReferenced = r.yaml_referenced;
|
|
43
|
+
claimedClis = r.claimed;
|
|
44
|
+
} catch { /* ignore — best-effort diagnostic */ }
|
|
45
|
+
if (installed) {
|
|
46
|
+
const claimedSet = new Set(claimedClis ?? []);
|
|
47
|
+
const referencedSet = new Set(yamlReferenced ?? []);
|
|
48
|
+
const installedReferencedUnclaimed = installed.filter(
|
|
49
|
+
(b) => referencedSet.has(b) && !claimedSet.has(b),
|
|
50
|
+
);
|
|
51
|
+
const installedNotReferenced = installed.filter((b) => !referencedSet.has(b));
|
|
52
|
+
if (installedReferencedUnclaimed.length > 0) {
|
|
53
|
+
const verb = installedReferencedUnclaimed.length === 1 ? 'is' : 'are';
|
|
54
|
+
process.stdout.write(
|
|
55
|
+
` (${installedReferencedUnclaimed.join(', ')} ${verb} installed and referenced in data/crosstalk.yaml ` +
|
|
56
|
+
`but not yet claimed — run 'crosstalk restart' to refresh the dispatcher's claim list)\n`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (installedNotReferenced.length > 0) {
|
|
60
|
+
const verb = installedNotReferenced.length === 1 ? 'references it' : 'references them';
|
|
61
|
+
process.stdout.write(
|
|
62
|
+
` (${installedNotReferenced.join(', ')} installed in the container but no data/crosstalk.yaml entry ${verb} — add one to claim)\n`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (s.claimed_models.length === 0 && installed.length === 0) {
|
|
58
66
|
process.stdout.write(' (no model CLIs found inside the container — install one via `crosstalk chat --shell` and add an entry to data/crosstalk.yaml)\n');
|
|
59
67
|
}
|
|
60
|
-
} else {
|
|
61
|
-
for (const m of s.claimed_models) process.stdout.write(` - ${m}\n`);
|
|
62
68
|
}
|
|
63
69
|
process.stdout.write('\n');
|
|
64
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cordfuse/crosstalk",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.11",
|
|
4
4
|
"description": "Crosstalk client — host-side CLI that talks to the crosstalkd daemon running inside the crosstalk-server container.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|