@cotal-ai/cli 0.185.4 → 0.186.0
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/stdio.d.ts.map +1 -1
- package/dist/chat/stdio.js +3 -2
- package/dist/chat/stdio.js.map +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +13 -5
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +8 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +114 -25
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +11 -1
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/doctor.js +2 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +25 -14
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +6 -3
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/personas.js +2 -2
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +24 -12
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +3 -5
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +13 -8
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/spawn-managed-launch.d.ts.map +1 -1
- package/dist/commands/spawn-managed-launch.js +5 -4
- package/dist/commands/spawn-managed-launch.js.map +1 -1
- package/dist/commands/spawn-preview.js +2 -2
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +3 -2
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +1 -1
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +19 -3
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-lost-records.d.ts +1 -1
- package/dist/commands/stack-lost-records.d.ts.map +1 -1
- package/dist/commands/stack-lost-records.js +7 -5
- package/dist/commands/stack-lost-records.js.map +1 -1
- package/dist/commands/stack-up.js +1 -1
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status-health.d.ts.map +1 -1
- package/dist/commands/status-health.js +10 -12
- package/dist/commands/status-health.js.map +1 -1
- package/dist/commands/status-model.d.ts +1 -0
- package/dist/commands/status-model.d.ts.map +1 -1
- package/dist/commands/status-render.d.ts.map +1 -1
- package/dist/commands/status-render.js +3 -1
- package/dist/commands/status-render.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +29 -8
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/up-foreground-listener.d.ts.map +1 -1
- package/dist/commands/up-foreground-listener.js +4 -2
- package/dist/commands/up-foreground-listener.js.map +1 -1
- package/dist/commands/up-resume.d.ts.map +1 -1
- package/dist/commands/up-resume.js +4 -2
- package/dist/commands/up-resume.js.map +1 -1
- package/dist/commands/update-caches.d.ts +1 -0
- package/dist/commands/update-caches.d.ts.map +1 -1
- package/dist/commands/update-caches.js +28 -10
- package/dist/commands/update-caches.js.map +1 -1
- package/dist/commands/update-continuity.d.ts +2 -0
- package/dist/commands/update-continuity.d.ts.map +1 -1
- package/dist/commands/update-continuity.js +27 -4
- package/dist/commands/update-continuity.js.map +1 -1
- package/dist/commands/update-process.d.ts +6 -3
- package/dist/commands/update-process.d.ts.map +1 -1
- package/dist/commands/update-process.js +168 -71
- package/dist/commands/update-process.js.map +1 -1
- package/dist/commands/update-release.d.ts.map +1 -1
- package/dist/commands/update-release.js +29 -12
- package/dist/commands/update-release.js.map +1 -1
- package/dist/commands/update-windows-install.js +23 -5
- package/dist/commands/update-windows-install.js.map +1 -1
- package/dist/commands/update.d.ts +4 -4
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +19 -14
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/who.js +2 -2
- package/dist/commands/who.js.map +1 -1
- package/dist/console/app.d.ts.map +1 -1
- package/dist/console/app.js +9 -8
- package/dist/console/app.js.map +1 -1
- package/dist/console/commands.d.ts.map +1 -1
- package/dist/console/commands.js +10 -14
- package/dist/console/commands.js.map +1 -1
- package/dist/console/ui/Tiles.d.ts +1 -1
- package/dist/console/ui/Tiles.d.ts.map +1 -1
- package/dist/console/ui/Tiles.js +10 -3
- package/dist/console/ui/Tiles.js.map +1 -1
- package/dist/console/ui/theme.d.ts.map +1 -1
- package/dist/console/ui/theme.js +1 -0
- package/dist/console/ui/theme.js.map +1 -1
- package/dist/console/ui/topo/Map.js +1 -1
- package/dist/console/ui/topo/Map.js.map +1 -1
- package/dist/lib/broker-store-health.d.ts +4 -0
- package/dist/lib/broker-store-health.d.ts.map +1 -1
- package/dist/lib/broker-store-health.js +23 -2
- package/dist/lib/broker-store-health.js.map +1 -1
- package/dist/lib/choose-target.js +1 -1
- package/dist/lib/choose-target.js.map +1 -1
- package/dist/lib/held-name.d.ts +3 -2
- package/dist/lib/held-name.d.ts.map +1 -1
- package/dist/lib/held-name.js +10 -6
- package/dist/lib/held-name.js.map +1 -1
- package/dist/lib/held-seat-records.d.ts +11 -0
- package/dist/lib/held-seat-records.d.ts.map +1 -0
- package/dist/lib/held-seat-records.js +34 -0
- package/dist/lib/held-seat-records.js.map +1 -0
- package/dist/lib/manager-choice.d.ts +3 -3
- package/dist/lib/manager-choice.d.ts.map +1 -1
- package/dist/lib/manager-choice.js +12 -3
- package/dist/lib/manager-choice.js.map +1 -1
- package/dist/lib/manager-proc.d.ts +2 -1
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +17 -4
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/spawn-plan.d.ts +1 -1
- package/dist/lib/manifest/spawn-plan.d.ts.map +1 -1
- package/dist/lib/manifest/spawn-plan.js +2 -2
- package/dist/lib/manifest/spawn-plan.js.map +1 -1
- package/dist/lib/npm-invocation.d.ts +3 -1
- package/dist/lib/npm-invocation.d.ts.map +1 -1
- package/dist/lib/npm-invocation.js +59 -3
- package/dist/lib/npm-invocation.js.map +1 -1
- package/dist/lib/npm-reachability.d.ts +8 -0
- package/dist/lib/npm-reachability.d.ts.map +1 -0
- package/dist/lib/npm-reachability.js +175 -0
- package/dist/lib/npm-reachability.js.map +1 -0
- package/dist/lib/service-manager-reboot.d.ts +5 -0
- package/dist/lib/service-manager-reboot.d.ts.map +1 -0
- package/dist/lib/service-manager-reboot.js +39 -0
- package/dist/lib/service-manager-reboot.js.map +1 -0
- package/dist/lib/service-preset-target.d.ts +1 -1
- package/dist/lib/service-preset-target.d.ts.map +1 -1
- package/dist/lib/service-preset-target.js +29 -9
- package/dist/lib/service-preset-target.js.map +1 -1
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +10 -5
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/teardown-spare.d.ts +2 -1
- package/dist/lib/teardown-spare.d.ts.map +1 -1
- package/dist/lib/teardown-spare.js +11 -6
- package/dist/lib/teardown-spare.js.map +1 -1
- package/dist/lib/transient.js +2 -2
- package/dist/lib/transient.js.map +1 -1
- package/dist/lib/update-manager-install-linux.d.ts +6 -7
- package/dist/lib/update-manager-install-linux.d.ts.map +1 -1
- package/dist/lib/update-manager-install-linux.js +70 -43
- package/dist/lib/update-manager-install-linux.js.map +1 -1
- package/dist/lib/update-managers.d.ts +2 -0
- package/dist/lib/update-managers.d.ts.map +1 -1
- package/dist/lib/update-managers.js +14 -3
- package/dist/lib/update-managers.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +2 -0
- package/dist/render.js.map +1 -1
- package/dist/seed/reconcile.js +2 -2
- package/dist/seed/reconcile.js.map +1 -1
- package/dist/telemetry.d.ts +3 -3
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +10 -5
- package/dist/telemetry.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -1
- package/package.json +5 -5
|
@@ -262,6 +262,13 @@ export declare function joinedAgentRows(agent: {
|
|
|
262
262
|
id: string;
|
|
263
263
|
managerInstanceId: string;
|
|
264
264
|
}): [string, string][];
|
|
265
|
+
type AuthRemedyTarget = {
|
|
266
|
+
space?: string;
|
|
267
|
+
server?: string;
|
|
268
|
+
};
|
|
269
|
+
type ResolvedAuthRemedyTarget = AuthRemedyTarget & {
|
|
270
|
+
resolvedSpace: string;
|
|
271
|
+
};
|
|
265
272
|
/** What one manager instance answered a `ps` census with. */
|
|
266
273
|
export interface ManagerAnswer {
|
|
267
274
|
readonly instanceId: string;
|
|
@@ -290,7 +297,7 @@ export interface PsResult {
|
|
|
290
297
|
* `status`'s reading that no agent application is set up here, so an empty list's Next agrees with
|
|
291
298
|
* the one `status` gives. `interactive` is whether a terminal is there to answer `setup`'s
|
|
292
299
|
* questions, as `status` reads it: without one, the Next points at `setup --help` instead. */
|
|
293
|
-
export declare function psView(result: PsResult, wide: boolean, rowsOf?: ReadonlyMap<string, readonly unknown[]>, noApplication?: boolean, mode?: string, interactive?: boolean, spawnCommand?: string, seatCommand?: (verb: "attach" | "stop") => string, launchBlock?: string): Report;
|
|
300
|
+
export declare function psView(result: PsResult, wide: boolean, rowsOf?: ReadonlyMap<string, readonly unknown[]>, noApplication?: boolean, mode?: string, interactive?: boolean, spawnCommand?: string, seatCommand?: (verb: "attach" | "stop") => string, launchBlock?: string, authTarget?: ResolvedAuthRemedyTarget): Report;
|
|
294
301
|
export declare function ps(args: ParsedArgs): Promise<void>;
|
|
295
302
|
/** A named-agent detail uses its holding manager's inspect read and checks the selected lifecycle. */
|
|
296
303
|
export declare function agentStatus(args: ParsedArgs): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,gBAAgB,EAAiB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAiB,MAAM,gBAAgB,CAAC;AACnK,OAAO,EAQL,cAAc,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,gBAAgB,EAAiB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAiB,MAAM,gBAAgB,CAAC;AACnK,OAAO,EAQL,cAAc,EA2Bd,KAAK,YAAY,EAEjB,KAAK,aAAa,EAClB,KAAK,MAAM,EAEX,KAAK,MAAM,EAYZ,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAA2C,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAe5H,OAAO,EAA0I,KAAK,uBAAuB,EAA6B,KAAK,YAAY,EAAiJ,MAAM,6BAA6B,CAAC;AAiBhZ,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG+C,CAAC;AACtE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4G,CAAC;AAKjI,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyI,CAAC;AAClK;;;;;sDAKsD;AACtD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMiB,CAAC;AAEzC,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAMrE;AAOD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,WAAW,UAAQ,GAAG,MAAM,GAAG,SAA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CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAY/E;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3D"}
|
package/dist/commands/agents.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEV_OWNER, assertLifecycleToken, peerLabel } from "@cotal-ai/core";
|
|
2
|
-
import { authDir, brokerAddressForDisplay, brokerUrlKey, cachedPreferences, canonicalRoot, checkServer, codeSpan, CommandFailure, findCotalRoot, findMesh, instanceIdShaped, isCommandFailure, isConnectRefusal, isGenuineSpace, isWorkspaceTargetError, jsonFlag, legacyStackOtherHome, meshesForRoot, oneLine, renderReport, plainFlag, preparedNeverStarted, preparedSpaceAt, presentationOf, projectRootProblem, resolveSeatControlTarget, targetFlags, writeResult, recordOperationSpace, resolveControlTarget, resolveMeshTarget, resolvePreference, retainedLegacyBroker, soleSpaceOf, spaceRootTarget, stoppedStack, workspaceErrorParts, connectOrThrow, } from "@cotal-ai/workspace";
|
|
2
|
+
import { authDir, brokerAddressForDisplay, brokerUrlKey, cachedPreferences, canonicalRoot, checkServer, codeSpan, CommandFailure, findCotalRoot, findMesh, instanceIdShaped, isCommandFailure, isConnectRefusal, isGenuineSpace, isMeshRegistryError, isWorkspaceTargetError, jsonFlag, legacyStackOtherHome, meshesForRoot, oneLine, renderReport, plainFlag, preparedNeverStarted, preparedSpaceAt, presentationOf, processStopped, projectRootProblem, readMeshRegistry, readPreparedSpaces, resolveSeatControlTarget, targetFlags, windowsShellWord, writeResult, recordOperationSpace, resolveControlTarget, resolveMeshTarget, resolvePreference, retainedLegacyBroker, soleSpaceOf, spaceRootTarget, stoppedStack, workspaceErrorParts, connectOrThrow, } from "@cotal-ai/workspace";
|
|
3
3
|
import * as prompts from "../lib/prompts.js";
|
|
4
4
|
import { canPrompt } from "./meshes-wizard.js";
|
|
5
5
|
import { presenceFacts } from "../ui.js";
|
|
@@ -11,7 +11,7 @@ import { completingFlagValue } from "../lib/completion.js";
|
|
|
11
11
|
import { displayCmd } from "../lib/self-exec.js";
|
|
12
12
|
import { shellWord } from "../lib/endpoint-errors.js";
|
|
13
13
|
import { targetWords } from "../lib/confirmation-required.js";
|
|
14
|
-
import { legacyBrokerPidfileBlock, runningStackManagerPid, stackManagerAbsent, stackManagerStarting, unusableStackJournal } from "../lib/stack-journal.js";
|
|
14
|
+
import { legacyBrokerPidfileBlock, readStackJournal, runningStackManagerPid, stackManagerAbsent, stackManagerStarting, unusableStackJournal } from "../lib/stack-journal.js";
|
|
15
15
|
import { connectorHarnesses, defaultLaunchBlock } from "../lib/status.js";
|
|
16
16
|
import { defaultPersonaPin, directPersonaPath } from "../lib/spawn-defaults.js";
|
|
17
17
|
import { channelSeedRestartBlock } from "../lib/channel-seed.js";
|
|
@@ -20,6 +20,7 @@ import { legacyRestartAddressProblem } from "../lib/broker-service.js";
|
|
|
20
20
|
import { retainedOpenSpace } from "../lib/legacy-start.js";
|
|
21
21
|
import { rootStoreProblem } from "../lib/store-dir.js";
|
|
22
22
|
import { localDiagnostic } from "../telemetry.js";
|
|
23
|
+
import { preparedCatalogDiagnostics } from "./sync.js";
|
|
23
24
|
import { askManager, scatterManager, managerFailure, readFailure, refuseUnregisteredManager, startStackManagerRemedy, unansweredDescribeRefusal, managersByInstance, askYourManagers, locateSeat, managerReadFailure, refusedManagers, seatMissRefusal } from "@cotal-ai/workspace/control";
|
|
24
25
|
/**
|
|
25
26
|
* The manager's operator clients — thin control-plane request/reply commands (`stop`/`ps`/
|
|
@@ -264,7 +265,7 @@ async function pinForTarget(v, verb, rest = [], options = {}) {
|
|
|
264
265
|
const on = await managerPin(v, named);
|
|
265
266
|
if (on !== undefined)
|
|
266
267
|
return { instanceId: on };
|
|
267
|
-
const loc = await locateSeat(cliControl, v, String(v.name), { onRefusal: options.onRefusal });
|
|
268
|
+
const loc = await locateSeat(cliControl, v, String(v.name), { onRefusal: options.onRefusal, freshRelay: verb === "cotal input" });
|
|
268
269
|
if (loc.kind === "pin")
|
|
269
270
|
return { instanceId: loc.instanceId, expectedSeat: loc.expectedSeat };
|
|
270
271
|
if (loc.kind === "unpinned")
|
|
@@ -418,11 +419,52 @@ export function attachChoiceLabel(item) {
|
|
|
418
419
|
export function joinedAgentRows(agent) {
|
|
419
420
|
return [["Agent", psSeatLabel({ name: agent.name, id: agent.id })], ["Identity", agent.id], ["Manager", agent.managerInstanceId]];
|
|
420
421
|
}
|
|
421
|
-
/**
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
/** Keep the bearer reason as data. Only the reader knows the launcher and how it reached the manager. */
|
|
423
|
+
function authRemedy(row, target, manager) {
|
|
424
|
+
if (row.authHealth !== "auth-renewal-failed" || !target || !manager)
|
|
425
|
+
return [];
|
|
426
|
+
const diagnosis = /^agent-bearer: exchange refused: agent "([A-Za-z0-9_]+)": spawner "[A-Za-z0-9_]+\.[A-Za-z0-9_]+"(?: \(an ancestor\))? is no longer granted\. Renewal requires that spawner's grant in space /.exec(row.authReason ?? "");
|
|
427
|
+
const principal = /^[A-Za-z0-9_]+\.([A-Za-z0-9_]+)$/.exec(row.id);
|
|
428
|
+
if (!diagnosis || row.authReason !== `${diagnosis[0]}${JSON.stringify(target.resolvedSpace)}.` ||
|
|
429
|
+
principal?.[1] !== diagnosis[1] || !/^[A-Za-z0-9_]+$/.test(row.name))
|
|
430
|
+
return [];
|
|
431
|
+
try {
|
|
432
|
+
assertLifecycleToken(manager, "instanceId");
|
|
433
|
+
}
|
|
434
|
+
catch {
|
|
435
|
+
return [];
|
|
436
|
+
}
|
|
437
|
+
const targetArgs = recoveryTargetWords(target);
|
|
438
|
+
if (targetArgs === undefined)
|
|
439
|
+
return [];
|
|
440
|
+
const persona = diagnosis[1];
|
|
441
|
+
const launcher = displayCmd();
|
|
442
|
+
const at = ` --on ${manager}${targetArgs}`;
|
|
443
|
+
return [
|
|
444
|
+
{ kind: "lines", lines: ["While this refusal persists, the seat retries every two to four minutes and can reconnect if the grant returns.",
|
|
445
|
+
`If the saved persona is named ${persona}, use an unused name in place of NEW_NAME to start a replacement.`] },
|
|
446
|
+
{ kind: "commands", items: [{ command: `${launcher} spawn ${persona} --name NEW_NAME --detach${at}`, description: "" }] },
|
|
447
|
+
{ kind: "lines", lines: ["Once the replacement is up, stop the old seat so it stops retrying."] },
|
|
448
|
+
{ kind: "commands", items: [{ command: `${launcher} stop ${row.name}${at}`, description: "" }] },
|
|
449
|
+
];
|
|
450
|
+
}
|
|
451
|
+
function recoveryTargetWords(target) {
|
|
452
|
+
if (process.platform !== "win32")
|
|
453
|
+
return targetWords(target);
|
|
454
|
+
let args = "";
|
|
455
|
+
for (const flag of ["space", "server"]) {
|
|
456
|
+
const value = target[flag];
|
|
457
|
+
if (value === undefined)
|
|
458
|
+
continue;
|
|
459
|
+
const word = windowsShellWord(value);
|
|
460
|
+
if (word === undefined)
|
|
461
|
+
return undefined;
|
|
462
|
+
args += ` --${flag}${value.startsWith("-") ? "=" : " "}${word}`;
|
|
463
|
+
}
|
|
464
|
+
return args;
|
|
465
|
+
}
|
|
466
|
+
/** The seats one manager answered with: a table, or with `--wide` one labeled record per seat. */
|
|
467
|
+
function seatBlocks(rows, wide, target, manager) {
|
|
426
468
|
const auth = rows.some((r) => r.authHealth);
|
|
427
469
|
const cells = (r) => [
|
|
428
470
|
["NAME", psSeatLabel(r)],
|
|
@@ -438,9 +480,11 @@ function seatBlocks(rows, wide) {
|
|
|
438
480
|
columns: cells(rows[0]).map(([label]) => ({ key: label, label })),
|
|
439
481
|
rows: rows.map((r) => Object.fromEntries(cells(r))),
|
|
440
482
|
}];
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
483
|
+
for (const row of rows)
|
|
484
|
+
if (row.authHealth && row.authReason) {
|
|
485
|
+
blocks.push({ kind: "lines", lines: [{ text: `${psSeatLabel(row)}: ${row.authReason}`, tone: authTone(row) }] });
|
|
486
|
+
blocks.push(...authRemedy(row, target, manager ?? row.instanceId));
|
|
487
|
+
}
|
|
444
488
|
const joins = rows.filter((r) => r.joinHealth).map((r) => ({ text: `${psSeatLabel(r)}: ${r.joinHealth.reason}`, tone: "failed" }));
|
|
445
489
|
if (joins.length)
|
|
446
490
|
blocks.push({ kind: "lines", lines: joins });
|
|
@@ -477,11 +521,11 @@ function slotBlocks(rows) {
|
|
|
477
521
|
* `status`'s reading that no agent application is set up here, so an empty list's Next agrees with
|
|
478
522
|
* the one `status` gives. `interactive` is whether a terminal is there to answer `setup`'s
|
|
479
523
|
* questions, as `status` reads it: without one, the Next points at `setup --help` instead. */
|
|
480
|
-
export function psView(result, wide, rowsOf = new Map(), noApplication = false, mode, interactive = true, spawnCommand, seatCommand, launchBlock) {
|
|
524
|
+
export function psView(result, wide, rowsOf = new Map(), noApplication = false, mode, interactive = true, spawnCommand, seatCommand, launchBlock, authTarget) {
|
|
481
525
|
const empty = result.kind === "slots" ? "No active static slots." : "No managed agents.";
|
|
482
|
-
const blocksFor = (rows) => !rows.length ? [{ kind: "lines", lines: [{ text: empty, tone: "hint" }] }]
|
|
526
|
+
const blocksFor = (rows, manager) => !rows.length ? [{ kind: "lines", lines: [{ text: empty, tone: "hint" }] }]
|
|
483
527
|
: result.kind === "slots" ? slotBlocks(rows)
|
|
484
|
-
: seatBlocks(rows, wide);
|
|
528
|
+
: seatBlocks(rows, wide, authTarget, manager);
|
|
485
529
|
// A single manager that answered is the common case: a flat list, no per-manager grouping noise.
|
|
486
530
|
// Its instance id is still shown, with or without agents, because it is what `--on` takes.
|
|
487
531
|
if (result.managers.length <= 1 && result.managers.every((m) => m.state === "answered")) {
|
|
@@ -491,7 +535,7 @@ export function psView(result, wide, rowsOf = new Map(), noApplication = false,
|
|
|
491
535
|
] : noApplication ? [interactive ? { command: `${displayCmd()} setup`, description: "Set up an agent application" } : { command: `${displayCmd()} setup --help`, description: "See setup flags for scripts. Bare setup needs a terminal." }]
|
|
492
536
|
: spawnCommand === undefined ? [] : [{ command: spawnCommand, description: "Launch your default agent" }];
|
|
493
537
|
const sections = [
|
|
494
|
-
{ title: result.kind === "slots" ? "Static slots" : "Agents", blocks: blocksFor(result.items) },
|
|
538
|
+
{ title: result.kind === "slots" ? "Static slots" : "Agents", blocks: blocksFor(result.items, result.managers[0]?.instanceId) },
|
|
495
539
|
...result.managers.map((m) => ({ title: "Manager", blocks: [{ kind: "fields", rows: [["instance", m.instanceId], ...(m.reportedHost ? [["reported host", m.reportedHost]] : [])] }] })),
|
|
496
540
|
];
|
|
497
541
|
if (next.length || launchBlock)
|
|
@@ -517,7 +561,7 @@ export function psView(result, wide, rowsOf = new Map(), noApplication = false,
|
|
|
517
561
|
return { title, blocks: [{ kind: "lines", lines: [{ text: `list refused: ${m.error}`, tone: "failed" }] }] };
|
|
518
562
|
const rows = rowsOf.get(m.instanceId) ?? [];
|
|
519
563
|
const count = rows.length ? `${rows.length} ${result.kind === "slots" ? "slot" : "agent"}${rows.length === 1 ? "" : "s"}` : `no ${result.kind === "slots" ? "slots" : "agents"}`;
|
|
520
|
-
return { title, blocks: [{ kind: "lines", lines: [{ text: count, tone: "hint" }] }, ...(rows.length ? blocksFor(rows) : [])] };
|
|
564
|
+
return { title, blocks: [{ kind: "lines", lines: [{ text: count, tone: "hint" }] }, ...(rows.length ? blocksFor(rows, m.instanceId) : [])] };
|
|
521
565
|
}),
|
|
522
566
|
};
|
|
523
567
|
}
|
|
@@ -618,6 +662,20 @@ function psUnusableJournalRefusal(e, v) {
|
|
|
618
662
|
}
|
|
619
663
|
return undefined;
|
|
620
664
|
}
|
|
665
|
+
/** An unreadable inventory does not establish that this is a first run. */
|
|
666
|
+
function noRecordedLocalSpace() {
|
|
667
|
+
try {
|
|
668
|
+
const prepared = readPreparedSpaces();
|
|
669
|
+
const registered = readMeshRegistry();
|
|
670
|
+
return prepared.spaces.length === 0 && prepared.unusable.length === 0 &&
|
|
671
|
+
registered.unusable.length === 0 && !registered.entries.some((entry) => entry.origin !== "catalog");
|
|
672
|
+
}
|
|
673
|
+
catch (error) {
|
|
674
|
+
if (!isMeshRegistryError(error))
|
|
675
|
+
throw error;
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
621
679
|
export async function ps(args) {
|
|
622
680
|
const v = args.values;
|
|
623
681
|
// #651 presentations: --wide is a human layout and --json the document that already carries every
|
|
@@ -647,9 +705,16 @@ export async function ps(args) {
|
|
|
647
705
|
const journalRefusal = psUnusableJournalRefusal(e, v);
|
|
648
706
|
if (journalRefusal)
|
|
649
707
|
throw journalRefusal;
|
|
708
|
+
const cause = isConnectRefusal(e) ? e.cause : e;
|
|
709
|
+
if (v.space === undefined && v.server === undefined && isWorkspaceTargetError(cause) && cause.code === "no-meshes" &&
|
|
710
|
+
cause.details.root === undefined && preparedCatalogDiagnostics().length === 0 && noRecordedLocalSpace()) {
|
|
711
|
+
const cli = presentation === "json" ? "cotal" : displayCmd();
|
|
712
|
+
throw new CommandFailure("refused", "TARGET_NOT_FOUND", "You are not signed in, and no local space is available.", {
|
|
713
|
+
remedy: `${cli} login`, remedyIsCommand: true,
|
|
714
|
+
});
|
|
715
|
+
}
|
|
650
716
|
const parts = isConnectRefusal(e) ? e.parts : isWorkspaceTargetError(e) && e.code === "not-started" ? workspaceErrorParts({ kind: "target", error: e }) : undefined;
|
|
651
717
|
if (parts?.restartRoot !== undefined) {
|
|
652
|
-
const cause = isConnectRefusal(e) ? e.cause : e;
|
|
653
718
|
const writeProblem = isWorkspaceTargetError(cause) && cause.code === "not-started" && (cause.details.stopped || preparedNeverStarted(cause.details)) ? preparedRootWriteProblem(parts.restartRoot) : undefined;
|
|
654
719
|
const block = writeProblem ?? channelSeedRestartBlock(parts.restartRoot) ?? (isWorkspaceTargetError(cause) && cause.details.lastRun
|
|
655
720
|
? await legacyRestartAddressProblem(cause.details.server, `${displayCmd()} up`)
|
|
@@ -671,14 +736,13 @@ export async function ps(args) {
|
|
|
671
736
|
throw e;
|
|
672
737
|
return psFromPresence(v, presentation);
|
|
673
738
|
}
|
|
674
|
-
const scope = v
|
|
675
|
-
: { space: v.server === undefined ? census.target.space : v.space, server: v.server };
|
|
739
|
+
const scope = authRemedyTarget(v, census.target.space);
|
|
676
740
|
const spawnCommand = scope && onRerun(`${displayCmd()} spawn`, scope);
|
|
677
741
|
const manager = census.target.managerInstanceId;
|
|
678
742
|
const seatCommand = scope && ((verb) => onRerun(`${displayCmd()} ${verb} <name>`, scope, manager ? ["--on", manager] : []));
|
|
679
743
|
const view = (result) => {
|
|
680
744
|
const next = result.items.length || result.managers.length > 1 ? {} : psLaunchNext(scope ?? {}, spawnCommand);
|
|
681
|
-
return psView(result, wide, census.rowsOf, next.noApplication, census.mode, presentation === "rich" && canPrompt(), next.spawn, seatCommand, next.block);
|
|
745
|
+
return psView(result, wide, census.rowsOf, next.noApplication, census.mode, presentation === "rich" && canPrompt(), next.spawn, seatCommand, next.block, scope);
|
|
682
746
|
};
|
|
683
747
|
writeResult(presentation, {
|
|
684
748
|
command: "ps",
|
|
@@ -782,6 +846,11 @@ async function observedSeatModel(values, row) {
|
|
|
782
846
|
await ep.stop().catch(() => { });
|
|
783
847
|
}
|
|
784
848
|
}
|
|
849
|
+
function authRemedyTarget(values, resolvedSpace) {
|
|
850
|
+
if (values.server !== undefined && brokerAddressForDisplay(values.server) !== values.server)
|
|
851
|
+
return undefined;
|
|
852
|
+
return { space: values.server === undefined ? resolvedSpace : values.space, server: values.server, resolvedSpace };
|
|
853
|
+
}
|
|
785
854
|
/** A named-agent detail uses its holding manager's inspect read and checks the selected lifecycle. */
|
|
786
855
|
export async function agentStatus(args) {
|
|
787
856
|
const name = args.positionals[0];
|
|
@@ -844,6 +913,7 @@ export async function agentStatus(args) {
|
|
|
844
913
|
{ title: "Execution", blocks: [
|
|
845
914
|
{ kind: "fields", rows: [["Process", processCell(row)], ["Application", execution.harness], ["Model", model], ["Variant", result.details.variant ?? observed?.variant ?? "not reported"], ["Reported provider", result.details.providerSource === "exact-principal-lifecycle" ? result.details.provider ?? "not reported" : "not established"], ["Name-matched provider", result.details.providerSource === "name-match-unverified" ? result.details.provider ?? "not reported" : "none"], ["Runtime", execution.runtime], ["PID", execution.pid === null ? "not reported" : String(execution.pid)], ["Host", execution.host ?? "not reported"], ["Folder", result.details.cwd ?? "not reported"], ["Manager", execution.managerInstanceId ?? "not reported"], ...credential] },
|
|
846
915
|
...(row.authReason ? [{ kind: "lines", lines: [{ text: row.authReason, tone: authTone(row) }] }] : []),
|
|
916
|
+
...authRemedy(row, authRemedyTarget(values, census.target.space), managerInstanceId ?? undefined),
|
|
847
917
|
] },
|
|
848
918
|
{ title: "Mesh", blocks: [
|
|
849
919
|
{ kind: "fields", rows: [["Exact presence", mesh.presenceState ?? "not established"], ["Connection", mesh.presenceState === null ? "not attributable to this lifecycle" : meshCell(row)], ["Name-matched roster", mesh.nameMatchedState === null ? "none separate" : meshCell(row)], ["Observed at", mesh.observedAt ?? "not reported"], ["Presence view", result.details.presenceView ?? "not reported"]] },
|
|
@@ -955,6 +1025,19 @@ export async function readSeats(v, command, on) {
|
|
|
955
1025
|
throwScatterFailure(scatter, target, t, command, v);
|
|
956
1026
|
return seatCensus(target, scatter.instances, command, t.mode, v);
|
|
957
1027
|
}
|
|
1028
|
+
/** Local Manager state can explain a failed roster read only at that stack's broker. */
|
|
1029
|
+
function stackAtRosterBroker(root, space, server) {
|
|
1030
|
+
try {
|
|
1031
|
+
const stack = readStackJournal(root)?.journal;
|
|
1032
|
+
if (stack)
|
|
1033
|
+
return stack.space === space && brokerUrlKey(stack.server) === brokerUrlKey(server);
|
|
1034
|
+
const entry = findMesh(space);
|
|
1035
|
+
return !!entry && entry.origin !== "manual" && entry.origin !== "catalog" && canonicalRoot(entry.root) === canonicalRoot(root) && brokerUrlKey(entry.server) === brokerUrlKey(server);
|
|
1036
|
+
}
|
|
1037
|
+
catch {
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
958
1041
|
/** Classify a failed `ps` / `slots` scatter against this root's local stack state without
|
|
959
1042
|
* mistaking an unanswered registered standalone manager for an absent stack manager. */
|
|
960
1043
|
export function throwScatterFailure(scatter, target, t, command, v) {
|
|
@@ -962,16 +1045,21 @@ export function throwScatterFailure(scatter, target, t, command, v) {
|
|
|
962
1045
|
// a known boundary with a remedy; the registry's own failure stays the cause. So is a registry
|
|
963
1046
|
// that still lists that manager after its process died: no manager answered the read. While an
|
|
964
1047
|
// `up` is still starting that manager, the answer is to wait for it, not to start another.
|
|
965
|
-
if ((scatter.code === "failed-precondition" || scatter.unanswered === true) && t.root !== undefined) {
|
|
1048
|
+
if ((scatter.code === "failed-precondition" || scatter.unanswered === true) && t.root !== undefined && stackAtRosterBroker(t.root, t.space, t.server)) {
|
|
966
1049
|
const native = { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) };
|
|
967
1050
|
if (stackManagerStarting(t.root, t.space))
|
|
968
1051
|
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "the stack's manager is starting, so it has no managed agents to list yet", { target, native, remedy: `run ${psRerun(v, command === "slots")} again once \`cotal up\` reports the manager started` });
|
|
969
1052
|
if (stackManagerAbsent(t.root, t.space, { unanswered: scatter.unanswered === true }))
|
|
970
1053
|
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "no manager is running for this space, so it has no managed agents to list", { target, native, remedy: psManagerStartRemedy(t) });
|
|
1054
|
+
const silentPid = scatter.unanswered === true ? runningStackManagerPid(t.root, t.space) : undefined;
|
|
1055
|
+
if (silentPid !== undefined) {
|
|
1056
|
+
const suspended = processStopped(silentPid);
|
|
1057
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `this space's stack manager (pid ${silentPid}) is ${suspended ? "suspended" : "running"} but did not answer, so no agents were listed`, {
|
|
1058
|
+
target, native,
|
|
1059
|
+
remedy: suspended ? `when ready to resume it, use kill -CONT ${silentPid} and retry the read` : `if it stays unresponsive, end that process with kill -KILL ${silentPid}; then bare \`cotal up\` starts the manager again`,
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
971
1062
|
}
|
|
972
|
-
const silentPid = scatter.unanswered === true && t.root !== undefined ? runningStackManagerPid(t.root, t.space) : undefined;
|
|
973
|
-
if (silentPid !== undefined)
|
|
974
|
-
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `this space's stack manager (pid ${silentPid}) is running but did not answer, so no agents were listed`, { target, native: { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) }, remedy: `if it stays unresponsive, end that process with kill -KILL ${silentPid}; then bare \`cotal up\` starts the manager again` });
|
|
975
1063
|
// Anywhere else, a registry that was read and lists no live manager is the same boundary: no
|
|
976
1064
|
// manager was asked. It is not proof that no manager process runs, since one that is starting or
|
|
977
1065
|
// cannot register is not listed, so the refusal says only what the registry showed.
|
|
@@ -1038,6 +1126,7 @@ function seatCensus(target, slots, command, mode, flags) {
|
|
|
1038
1126
|
const unread = managers.filter((m) => m.state !== "answered").length;
|
|
1039
1127
|
const silent = managers.filter((m) => m.state === "silent").map((m) => m.instanceId);
|
|
1040
1128
|
const kind = command === "slots" ? "slots" : "seats";
|
|
1129
|
+
const pinnedRead = unread ? psCommand({ ...flags, on: "<instance>" }, command === "slots") : undefined;
|
|
1041
1130
|
const partial = unread
|
|
1042
1131
|
? {
|
|
1043
1132
|
message: `Incomplete manager census: ${unread} of ${managers.length} instances did not return ${kind}. Rows above are partial, not a complete list.`,
|
|
@@ -1045,7 +1134,7 @@ function seatCensus(target, slots, command, mode, flags) {
|
|
|
1045
1134
|
? `Managers in this space serve different ps contracts. ${mismatches.join("; ")}. Align the manager versions and retry.`
|
|
1046
1135
|
: target.scope === "your-managers" && silent.length
|
|
1047
1136
|
? silentManagersNext(silent, target.space)
|
|
1048
|
-
: `retry, or read one manager with ${codeSpan(
|
|
1137
|
+
: pinnedRead ? `retry, or read one manager with ${codeSpan(pinnedRead)}` : "retry, or add --on <instance> to the original read to ask one manager",
|
|
1049
1138
|
}
|
|
1050
1139
|
: undefined;
|
|
1051
1140
|
return { target, items, managers, warnings, rowsOf, mode, ...(partial ? { partial } : {}) };
|