@cotal-ai/cli 0.180.0 → 0.182.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/command.d.ts.map +1 -1
- package/dist/command.js +81 -31
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +19 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +90 -37
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +28 -8
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/channels.d.ts.map +1 -1
- package/dist/commands/channels.js +17 -6
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +8 -2
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +11 -12
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.js +3 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ext.d.ts +1 -0
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +24 -9
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +14 -17
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/history-clear.d.ts.map +1 -1
- package/dist/commands/history-clear.js +14 -8
- package/dist/commands/history-clear.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +1 -0
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.js +1 -1
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/persona.d.ts.map +1 -1
- package/dist/commands/persona.js +16 -6
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/personas.d.ts.map +1 -1
- package/dist/commands/personas.js +19 -4
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/reset-store-apply.js +1 -1
- package/dist/commands/reset-store-apply.js.map +1 -1
- package/dist/commands/send.d.ts +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +50 -23
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/service-actions.js +1 -1
- package/dist/commands/service-actions.js.map +1 -1
- package/dist/commands/service-registry.d.ts.map +1 -1
- package/dist/commands/service-registry.js +20 -7
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/setup.js +5 -5
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/space-registration.d.ts +3 -3
- package/dist/commands/space-registration.d.ts.map +1 -1
- package/dist/commands/space-registration.js +17 -8
- package/dist/commands/space-registration.js.map +1 -1
- package/dist/commands/space.d.ts +1 -1
- package/dist/commands/space.d.ts.map +1 -1
- package/dist/commands/space.js +22 -4
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn-flags.d.ts +1 -0
- package/dist/commands/spawn-flags.d.ts.map +1 -1
- package/dist/commands/spawn-flags.js +6 -0
- package/dist/commands/spawn-flags.js.map +1 -1
- package/dist/commands/spawn-managed-launch.d.ts.map +1 -1
- package/dist/commands/spawn-managed-launch.js +14 -10
- package/dist/commands/spawn-managed-launch.js.map +1 -1
- package/dist/commands/spawn-preview.js +4 -3
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +9 -9
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +5 -3
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-gone.d.ts +3 -0
- package/dist/commands/stack-gone.d.ts.map +1 -1
- package/dist/commands/stack-gone.js +30 -12
- package/dist/commands/stack-gone.js.map +1 -1
- package/dist/commands/stack-lost-records.d.ts +3 -1
- package/dist/commands/stack-lost-records.d.ts.map +1 -1
- package/dist/commands/stack-lost-records.js +22 -9
- package/dist/commands/stack-lost-records.js.map +1 -1
- package/dist/commands/stack-up.d.ts +1 -1
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +51 -15
- 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 +6 -5
- package/dist/commands/status-health.js.map +1 -1
- package/dist/commands/status-legacy.d.ts +2 -2
- package/dist/commands/status-legacy.js +4 -4
- package/dist/commands/status-meshes.d.ts +11 -2
- package/dist/commands/status-meshes.d.ts.map +1 -1
- package/dist/commands/status-meshes.js +49 -15
- package/dist/commands/status-meshes.js.map +1 -1
- package/dist/commands/status-render.d.ts +2 -1
- package/dist/commands/status-render.d.ts.map +1 -1
- package/dist/commands/status-render.js +28 -13
- package/dist/commands/status-render.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +22 -26
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-boot-controller.d.ts +1 -0
- package/dist/commands/team-boot-controller.d.ts.map +1 -1
- package/dist/commands/team-boot-controller.js +1 -1
- package/dist/commands/team-boot-controller.js.map +1 -1
- package/dist/commands/team.d.ts.map +1 -1
- package/dist/commands/team.js +23 -3
- package/dist/commands/team.js.map +1 -1
- package/dist/commands/up-args.d.ts.map +1 -1
- package/dist/commands/up-args.js +4 -6
- package/dist/commands/up-args.js.map +1 -1
- package/dist/commands/up-detach.js +1 -1
- package/dist/commands/up-detach.js.map +1 -1
- package/dist/commands/up-manifest.d.ts +1 -0
- package/dist/commands/up-manifest.d.ts.map +1 -1
- package/dist/commands/up-manifest.js +9 -3
- package/dist/commands/up-manifest.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +21 -14
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update-continuity.d.ts.map +1 -1
- package/dist/commands/update-continuity.js +3 -4
- package/dist/commands/update-continuity.js.map +1 -1
- package/dist/commands/update-process.d.ts +6 -4
- package/dist/commands/update-process.d.ts.map +1 -1
- package/dist/commands/update-process.js +96 -11
- package/dist/commands/update-process.js.map +1 -1
- package/dist/commands/update-windows-install.d.ts +2 -0
- package/dist/commands/update-windows-install.d.ts.map +1 -0
- package/dist/commands/update-windows-install.js +59 -0
- package/dist/commands/update-windows-install.js.map +1 -0
- package/dist/commands/update.js +6 -6
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/console/app.d.ts.map +1 -1
- package/dist/console/app.js +16 -10
- package/dist/console/app.js.map +1 -1
- package/dist/console/mesh.d.ts +4 -1
- package/dist/console/mesh.d.ts.map +1 -1
- package/dist/console/mesh.js +1 -1
- package/dist/console/mesh.js.map +1 -1
- package/dist/console/ui/Help.d.ts +2 -1
- package/dist/console/ui/Help.d.ts.map +1 -1
- package/dist/console/ui/Help.js +48 -8
- package/dist/console/ui/Help.js.map +1 -1
- package/dist/exec-endpoint/handler.js +1 -1
- package/dist/exec-endpoint/handler.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-proc.js +1 -1
- package/dist/lib/auth-proc.js.map +1 -1
- package/dist/lib/broker-service.js +1 -1
- package/dist/lib/broker-service.js.map +1 -1
- package/dist/lib/broker-spawn.d.ts +3 -1
- package/dist/lib/broker-spawn.d.ts.map +1 -1
- package/dist/lib/broker-spawn.js.map +1 -1
- package/dist/lib/choose-target.js +2 -2
- package/dist/lib/choose-target.js.map +1 -1
- package/dist/lib/delivery-proc.js +1 -1
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/exec-words.d.ts +3 -2
- package/dist/lib/exec-words.d.ts.map +1 -1
- package/dist/lib/exec-words.js +6 -5
- package/dist/lib/exec-words.js.map +1 -1
- package/dist/lib/extension-stage.d.ts +2 -0
- package/dist/lib/extension-stage.d.ts.map +1 -1
- package/dist/lib/extension-stage.js +30 -1
- package/dist/lib/extension-stage.js.map +1 -1
- package/dist/lib/foreground-broker-stop.d.ts +6 -0
- package/dist/lib/foreground-broker-stop.d.ts.map +1 -0
- package/dist/lib/foreground-broker-stop.js +31 -0
- package/dist/lib/foreground-broker-stop.js.map +1 -0
- package/dist/lib/foreground-hold.d.ts.map +1 -1
- package/dist/lib/foreground-hold.js +2 -1
- package/dist/lib/foreground-hold.js.map +1 -1
- package/dist/lib/isolated-broker.js +2 -2
- package/dist/lib/isolated-broker.js.map +1 -1
- package/dist/lib/leading-flags.js +3 -3
- package/dist/lib/leading-flags.js.map +1 -1
- package/dist/lib/local-process-stop.d.ts.map +1 -1
- package/dist/lib/local-process-stop.js +6 -2
- package/dist/lib/local-process-stop.js.map +1 -1
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +50 -2
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/resolve.d.ts.map +1 -1
- package/dist/lib/manifest/resolve.js +2 -0
- package/dist/lib/manifest/resolve.js.map +1 -1
- package/dist/lib/nats-bin.js +2 -2
- package/dist/lib/nats-bin.js.map +1 -1
- package/dist/lib/npm-invocation.d.ts.map +1 -1
- package/dist/lib/npm-invocation.js +17 -7
- package/dist/lib/npm-invocation.js.map +1 -1
- package/dist/lib/paths.d.ts +4 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +9 -0
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/persona-files.d.ts.map +1 -1
- package/dist/lib/persona-files.js +4 -2
- package/dist/lib/persona-files.js.map +1 -1
- package/dist/lib/personas.d.ts +3 -0
- package/dist/lib/personas.d.ts.map +1 -1
- package/dist/lib/personas.js +16 -2
- package/dist/lib/personas.js.map +1 -1
- package/dist/lib/restore-streams.d.ts.map +1 -1
- package/dist/lib/restore-streams.js +4 -4
- package/dist/lib/restore-streams.js.map +1 -1
- package/dist/lib/restore.js +1 -1
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/seat-capture.js +2 -2
- package/dist/lib/seat-capture.js.map +1 -1
- package/dist/lib/seat-restore.js +1 -1
- package/dist/lib/seat-restore.js.map +1 -1
- package/dist/lib/self-exec.js +1 -1
- package/dist/lib/self-exec.js.map +1 -1
- package/dist/lib/service-preset-target.d.ts +2 -2
- package/dist/lib/service-preset-target.d.ts.map +1 -1
- package/dist/lib/service-preset-target.js +7 -5
- package/dist/lib/service-preset-target.js.map +1 -1
- package/dist/lib/service-presets.d.ts.map +1 -1
- package/dist/lib/service-presets.js +9 -2
- package/dist/lib/service-presets.js.map +1 -1
- package/dist/lib/service-process.d.ts +1 -1
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +3 -3
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/service-scope.d.ts.map +1 -1
- package/dist/lib/service-scope.js +13 -1
- package/dist/lib/service-scope.js.map +1 -1
- package/dist/lib/spawn-defaults.d.ts +5 -0
- package/dist/lib/spawn-defaults.d.ts.map +1 -1
- package/dist/lib/spawn-defaults.js +40 -3
- package/dist/lib/spawn-defaults.js.map +1 -1
- package/dist/lib/stack-journal.d.ts +19 -7
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +57 -13
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/stack-resume.js +1 -1
- package/dist/lib/stack-resume.js.map +1 -1
- package/dist/lib/status.d.ts +2 -0
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +16 -2
- package/dist/lib/status.js.map +1 -1
- package/dist/lib/up-broker-address.d.ts +1 -0
- package/dist/lib/up-broker-address.d.ts.map +1 -1
- package/dist/lib/up-broker-address.js +6 -3
- package/dist/lib/up-broker-address.js.map +1 -1
- package/dist/lib/update-connector-config.d.ts.map +1 -1
- package/dist/lib/update-connector-config.js +3 -1
- package/dist/lib/update-connector-config.js.map +1 -1
- package/dist/lib/update-managers.d.ts +3 -0
- package/dist/lib/update-managers.d.ts.map +1 -1
- package/dist/lib/update-managers.js +23 -5
- package/dist/lib/update-managers.js.map +1 -1
- package/dist/lib/update-pending.d.ts +1 -0
- package/dist/lib/update-pending.d.ts.map +1 -1
- package/dist/lib/update-pending.js +3 -2
- package/dist/lib/update-pending.js.map +1 -1
- package/dist/lib/version.d.ts +2 -1
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +13 -8
- package/dist/lib/version.js.map +1 -1
- package/dist/seed/reconcile.d.ts +1 -1
- package/dist/seed/reconcile.d.ts.map +1 -1
- package/dist/seed/reconcile.js +11 -8
- package/dist/seed/reconcile.js.map +1 -1
- package/dist/seed/verify.d.ts +6 -1
- package/dist/seed/verify.d.ts.map +1 -1
- package/dist/seed/verify.js +21 -4
- package/dist/seed/verify.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CompletionResult, type FlagValues, type ParsedArgs } from "@cotal-ai/core";
|
|
2
2
|
import { CommandFailure, type ConnectFlags, type OutputWarning, type Report, type Styled } from "@cotal-ai/workspace";
|
|
3
3
|
import { type AttachTarget, type AttachVerdict } from "@cotal-ai/workspace/attach";
|
|
4
|
-
import { type ScatterInstanceLiveness } from "@cotal-ai/workspace/control";
|
|
4
|
+
import { type ScatterInstanceLiveness, type ScatterReply } from "@cotal-ai/workspace/control";
|
|
5
5
|
export declare const stopFlags: readonly [{
|
|
6
6
|
readonly name: "space";
|
|
7
7
|
readonly short: "s";
|
|
@@ -290,7 +290,7 @@ export interface PsResult {
|
|
|
290
290
|
* `status`'s reading that no agent application is set up here, so an empty list's Next agrees with
|
|
291
291
|
* the one `status` gives. `interactive` is whether a terminal is there to answer `setup`'s
|
|
292
292
|
* 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): Report;
|
|
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;
|
|
294
294
|
export declare function ps(args: ParsedArgs): Promise<void>;
|
|
295
295
|
/** A named-agent detail uses its holding manager's inspect read and checks the selected lifecycle. */
|
|
296
296
|
export declare function agentStatus(args: ParsedArgs): Promise<void>;
|
|
@@ -320,11 +320,28 @@ export interface SeatCensus {
|
|
|
320
320
|
* cannot be resolved or no manager can be asked, and {@link NoManagerAnswered} when none of your
|
|
321
321
|
* managers answered on a user-auth mesh. */
|
|
322
322
|
export declare function readSeats(v: ConnectFlags & FlagValues<typeof psFlags>, command: "ps" | "slots", on: string | undefined): Promise<SeatCensus>;
|
|
323
|
+
/** Classify a failed `ps` / `slots` scatter against this root's local stack state without
|
|
324
|
+
* mistaking an unanswered registered standalone manager for an absent stack manager. */
|
|
325
|
+
export declare function throwScatterFailure(scatter: Extract<ScatterReply, {
|
|
326
|
+
ok: false;
|
|
327
|
+
}>, target: {
|
|
328
|
+
space: string;
|
|
329
|
+
scope: string;
|
|
330
|
+
}, t: {
|
|
331
|
+
root?: string;
|
|
332
|
+
space: string;
|
|
333
|
+
server: string;
|
|
334
|
+
}, command: "ps" | "slots", v: FlagValues<typeof psFlags>): never;
|
|
323
335
|
/** None of your managers answered a read on a user-auth mesh: the one the exchange picked, or each of
|
|
324
336
|
* the several it counts live. `ps` then lists your agents as presence shows them. */
|
|
325
337
|
export declare class NoManagerAnswered extends CommandFailure {
|
|
326
338
|
constructor(cause: CommandFailure);
|
|
327
339
|
}
|
|
340
|
+
/** Mesh commands for a seat whose runtime streams no terminal. Keep a private broker address out of the receipt. */
|
|
341
|
+
export declare function noTerminalCommands(name: string, space: string, server?: string): {
|
|
342
|
+
send: string;
|
|
343
|
+
watch: string;
|
|
344
|
+
};
|
|
328
345
|
/**
|
|
329
346
|
* The attach `cotal attach`, the console and spawn-then-attach run: the shared attach from
|
|
330
347
|
* `@cotal-ai/workspace/attach`, with this CLI's control client, verb and remedy. On the command path
|
|
@@ -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,
|
|
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,EAML,cAAc,EAgBd,KAAK,YAAY,EAEjB,KAAK,aAAa,EAClB,KAAK,MAAM,EAEX,KAAK,MAAM,EAWZ,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAA2C,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY5H,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;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,WA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{ DEV_OWNER, assertLifecycleToken, peerLabel } from "@cotal-ai/core";
|
|
2
|
-
import { brokerAddressForDisplay, brokerUrlKey, checkServer, codeSpan, CommandFailure, findMesh, instanceIdShaped, isCommandFailure, isConnectRefusal, isWorkspaceTargetError, jsonFlag, oneLine, renderReport, plainFlag, preparedNeverStarted, presentationOf, resolveSeatControlTarget, targetFlags, writeResult, recordOperationSpace, resolveControlTarget, resolveMeshTarget, retainedLegacyBroker, spaceRootTarget, stoppedStack, workspaceErrorParts, connectOrThrow, } from "@cotal-ai/workspace";
|
|
2
|
+
import { brokerAddressForDisplay, brokerUrlKey, cachedPreferences, checkServer, codeSpan, CommandFailure, findMesh, instanceIdShaped, isCommandFailure, isConnectRefusal, isWorkspaceTargetError, jsonFlag, oneLine, renderReport, plainFlag, preparedNeverStarted, presentationOf, resolveSeatControlTarget, targetFlags, writeResult, recordOperationSpace, resolveControlTarget, resolveMeshTarget, resolvePreference, retainedLegacyBroker, 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";
|
|
@@ -10,8 +10,10 @@ import { attachSeat as attachSeatWith, detachKey } from "@cotal-ai/workspace/att
|
|
|
10
10
|
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
|
+
import { targetWords } from "../lib/confirmation-required.js";
|
|
13
14
|
import { legacyBrokerPidfileBlock, runningStackManagerPid, stackManagerAbsent, stackManagerStarting, unusableStackJournal } from "../lib/stack-journal.js";
|
|
14
|
-
import { connectorHarnesses } from "../lib/status.js";
|
|
15
|
+
import { connectorHarnesses, defaultLaunchBlock } from "../lib/status.js";
|
|
16
|
+
import { defaultPersonaPin, directPersonaPath } from "../lib/spawn-defaults.js";
|
|
15
17
|
import { channelSeedRestartBlock } from "../lib/channel-seed.js";
|
|
16
18
|
import { preparedRootWriteProblem } from "../lib/paths.js";
|
|
17
19
|
import { legacyRestartAddressProblem } from "../lib/broker-service.js";
|
|
@@ -244,10 +246,11 @@ const stopRetryWords = (v) => [
|
|
|
244
246
|
...(v.force === true ? ["--force"] : []),
|
|
245
247
|
...(v.json === true ? ["--json"] : v.plain === true ? ["--plain"] : []),
|
|
246
248
|
];
|
|
247
|
-
/**
|
|
248
|
-
const inputRetryWords = (text,
|
|
249
|
+
/** Keep the original text, Enter behavior and receipt format on a terminal input retry. */
|
|
250
|
+
const inputRetryWords = (text, v) => [
|
|
249
251
|
text.startsWith("-") ? `--text=${text}` : text,
|
|
250
|
-
...(
|
|
252
|
+
...(v["no-enter"] === true ? ["--no-enter"] : []),
|
|
253
|
+
...(v.json === true ? ["--json"] : v.plain === true ? ["--plain"] : []),
|
|
251
254
|
];
|
|
252
255
|
/** Resolve a targeted verb's manager and retain the presence-selected seat for its fresh caller.
|
|
253
256
|
* `rest` is the command words after the agent name that a remedy has to repeat. */
|
|
@@ -469,7 +472,7 @@ function slotBlocks(rows) {
|
|
|
469
472
|
* `status`'s reading that no agent application is set up here, so an empty list's Next agrees with
|
|
470
473
|
* the one `status` gives. `interactive` is whether a terminal is there to answer `setup`'s
|
|
471
474
|
* questions, as `status` reads it: without one, the Next points at `setup --help` instead. */
|
|
472
|
-
export function psView(result, wide, rowsOf = new Map(), noApplication = false, mode, interactive = true, spawnCommand) {
|
|
475
|
+
export function psView(result, wide, rowsOf = new Map(), noApplication = false, mode, interactive = true, spawnCommand, seatCommand, launchBlock) {
|
|
473
476
|
const empty = result.kind === "slots" ? "No active static slots." : "No managed agents.";
|
|
474
477
|
const blocksFor = (rows) => !rows.length ? [{ kind: "lines", lines: [{ text: empty, tone: "hint" }] }]
|
|
475
478
|
: result.kind === "slots" ? slotBlocks(rows)
|
|
@@ -477,17 +480,20 @@ export function psView(result, wide, rowsOf = new Map(), noApplication = false,
|
|
|
477
480
|
// A single manager that answered is the common case: a flat list, no per-manager grouping noise.
|
|
478
481
|
// Its instance id is still shown, with or without agents, because it is what `--on` takes.
|
|
479
482
|
if (result.managers.length <= 1 && result.managers.every((m) => m.state === "answered")) {
|
|
480
|
-
const next = result.items.length ? [
|
|
481
|
-
{ command:
|
|
482
|
-
{ command:
|
|
483
|
+
const next = result.items.length ? seatCommand === undefined ? [] : [
|
|
484
|
+
{ command: seatCommand("attach"), description: "Return to an agent's terminal" },
|
|
485
|
+
{ command: seatCommand("stop"), description: "Stop one agent" },
|
|
483
486
|
] : 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." }]
|
|
484
487
|
: spawnCommand === undefined ? [] : [{ command: spawnCommand, description: "Launch your default agent" }];
|
|
485
488
|
const sections = [
|
|
486
489
|
{ title: result.kind === "slots" ? "Static slots" : "Agents", blocks: blocksFor(result.items) },
|
|
487
490
|
...result.managers.map((m) => ({ title: "Manager", blocks: [{ kind: "fields", rows: [["instance", m.instanceId], ...(m.reportedHost ? [["reported host", m.reportedHost]] : [])] }] })),
|
|
488
491
|
];
|
|
489
|
-
if (next.length)
|
|
490
|
-
sections.push({ title: "Next", blocks: [
|
|
492
|
+
if (next.length || launchBlock)
|
|
493
|
+
sections.push({ title: "Next", blocks: [
|
|
494
|
+
...(next.length ? [{ kind: "commands", items: next }] : []),
|
|
495
|
+
...(launchBlock ? [{ kind: "lines", lines: [{ text: launchBlock, tone: "hint" }] }] : []),
|
|
496
|
+
] });
|
|
491
497
|
return { sections };
|
|
492
498
|
}
|
|
493
499
|
// Several managers: one section each, named by the FULL instance id, since `--on` takes nothing
|
|
@@ -510,14 +516,25 @@ export function psView(result, wide, rowsOf = new Map(), noApplication = false,
|
|
|
510
516
|
}),
|
|
511
517
|
};
|
|
512
518
|
}
|
|
513
|
-
/**
|
|
514
|
-
|
|
515
|
-
|
|
519
|
+
/** Resolve the target of the suggested foreground launch, independently of the manager's defaults. */
|
|
520
|
+
function psLaunchNext(scope, command) {
|
|
521
|
+
let noApplication = false;
|
|
516
522
|
try {
|
|
517
|
-
|
|
523
|
+
const connectors = connectorHarnesses();
|
|
524
|
+
noApplication = connectors.every((harness) => harness.missing.length > 0);
|
|
525
|
+
if (!command || !connectors.length)
|
|
526
|
+
return { noApplication };
|
|
527
|
+
const { space, root } = resolveMeshTarget(process.cwd(), { ...scope, readOnly: true });
|
|
528
|
+
const context = { space, preferences: cachedPreferences() };
|
|
529
|
+
const persona = resolvePreference("persona", context).winner;
|
|
530
|
+
const pin = defaultPersonaPin(directPersonaPath(root, persona.value), persona.source === "default");
|
|
531
|
+
const harness = resolvePreference("harness", { ...context, pin }).value;
|
|
532
|
+
const block = defaultLaunchBlock(harness, connectors);
|
|
533
|
+
return block ? { noApplication, block } : { spawn: command };
|
|
518
534
|
}
|
|
519
535
|
catch {
|
|
520
|
-
|
|
536
|
+
// This is optional advice. An unreadable inventory or persona cannot confirm a launch.
|
|
537
|
+
return { noApplication };
|
|
521
538
|
}
|
|
522
539
|
}
|
|
523
540
|
function psCommand(v, slots = false) {
|
|
@@ -591,9 +608,15 @@ export async function ps(args) {
|
|
|
591
608
|
throw e;
|
|
592
609
|
return psFromPresence(v, presentation);
|
|
593
610
|
}
|
|
594
|
-
const
|
|
595
|
-
:
|
|
596
|
-
const
|
|
611
|
+
const scope = v.server !== undefined && brokerAddressForDisplay(v.server) !== v.server ? undefined
|
|
612
|
+
: { space: v.server === undefined ? census.target.space : v.space, server: v.server };
|
|
613
|
+
const spawnCommand = scope && onRerun(`${displayCmd()} spawn`, scope);
|
|
614
|
+
const manager = census.target.managerInstanceId;
|
|
615
|
+
const seatCommand = scope && ((verb) => onRerun(`${displayCmd()} ${verb} <name>`, scope, manager ? ["--on", manager] : []));
|
|
616
|
+
const view = (result) => {
|
|
617
|
+
const next = result.items.length || result.managers.length > 1 ? {} : psLaunchNext(scope ?? {}, spawnCommand);
|
|
618
|
+
return psView(result, wide, census.rowsOf, next.noApplication, census.mode, presentation === "rich" && canPrompt(), next.spawn, seatCommand, next.block);
|
|
619
|
+
};
|
|
597
620
|
writeResult(presentation, {
|
|
598
621
|
command: "ps",
|
|
599
622
|
target: census.target,
|
|
@@ -644,7 +667,7 @@ function startManagerNext(root, space, named) {
|
|
|
644
667
|
if (pid !== undefined)
|
|
645
668
|
return { command: `kill -KILL ${pid}`, description: "End the stack manager that does not answer; bare `cotal up` then starts it again" };
|
|
646
669
|
const entry = findMesh(space);
|
|
647
|
-
if (root !== undefined && (stackManagerAbsent(root, space) || (entry?.origin === "up" && entry.root === root)))
|
|
670
|
+
if (root !== undefined && (stackManagerAbsent(root, space, { unanswered: true }) || (entry?.origin === "up" && entry.root === root)))
|
|
648
671
|
return { command: "cotal up", description: "Start the stack's manager" };
|
|
649
672
|
return { command: `cotal manager start${at}`, description: "Start a manager for this space" };
|
|
650
673
|
}
|
|
@@ -681,6 +704,21 @@ function managerItselfRemedy(name, openMesh, { space, server }) {
|
|
|
681
704
|
const status = `${name} is this space's manager, which is answering, not an agent it runs. ${read("cotal status")} shows the manager's state.`;
|
|
682
705
|
return openMesh ? status : `${status} ${read("cotal endpoint describe manager")} reads its commands.`;
|
|
683
706
|
}
|
|
707
|
+
/** Read OpenCode's reported selection for a seat without a recorded model request. */
|
|
708
|
+
async function observedOpenCodeModel(values, row) {
|
|
709
|
+
const { ep } = await openTransient(values, "status", { throwOnRefusal: true, presenceOnly: true, report: () => { } });
|
|
710
|
+
try {
|
|
711
|
+
if (ep.presenceView().state !== "current")
|
|
712
|
+
return;
|
|
713
|
+
const id = row.id.includes(".") ? row.id : `${DEV_OWNER}.${row.id}`;
|
|
714
|
+
const meta = ep.getRoster().find((p) => p.card.id === id && p.lifecycleUid === row.lifecycleUid)?.card.meta;
|
|
715
|
+
if (typeof meta?.model === "string" && meta.model)
|
|
716
|
+
return { model: meta.model, variant: typeof meta.variant === "string" && meta.variant ? meta.variant : undefined };
|
|
717
|
+
}
|
|
718
|
+
finally {
|
|
719
|
+
await ep.stop().catch(() => { });
|
|
720
|
+
}
|
|
721
|
+
}
|
|
684
722
|
/** A named-agent detail uses its holding manager's inspect read and checks the selected lifecycle. */
|
|
685
723
|
export async function agentStatus(args) {
|
|
686
724
|
const name = args.positionals[0];
|
|
@@ -715,6 +753,8 @@ export async function agentStatus(args) {
|
|
|
715
753
|
}
|
|
716
754
|
}
|
|
717
755
|
const projected = item ? agentStatusProjection(item, managerInstanceId) : { identity: null, execution: null, mesh: null, activity: null, details: null };
|
|
756
|
+
const observed = presentation !== "json" && item?.agent === "opencode" && !item.model && projected.mesh?.presenceState !== null && item.lifecycleUid
|
|
757
|
+
? await observedOpenCodeModel(values, item).catch(() => undefined) : undefined;
|
|
718
758
|
writeResult(presentation, {
|
|
719
759
|
command: "status",
|
|
720
760
|
target: { ...census.target, name },
|
|
@@ -731,13 +771,15 @@ export async function agentStatus(args) {
|
|
|
731
771
|
] };
|
|
732
772
|
const identity = result.identity, execution = result.execution, mesh = result.mesh, activity = result.activity;
|
|
733
773
|
const credential = row.authHealth ? [["Credential", { text: row.authHealth, tone: authTone(row) }]] : [];
|
|
774
|
+
const model = execution.model ? `${execution.model} · requested, not provider-confirmed`
|
|
775
|
+
: observed ? `${observed.model} · reported by OpenCode` : "not reported";
|
|
734
776
|
return { sections: [
|
|
735
777
|
{ title: "Identity", blocks: [
|
|
736
778
|
...(census.partial ? [{ kind: "lines", lines: [{ text: "Other managers did not answer. This is one known match, not a complete uniqueness check.", tone: "waiting" }] }] : []),
|
|
737
779
|
{ kind: "fields", rows: [["Agent", psSeatLabel({ name: identity.name, id: row.id })], ["Space", census.target.space], ["Principal", row.id], ["Owner", identity.owner ?? "not established"], ["Actor", identity.actor ?? "not established"], ["Lifecycle", identity.lifecycleUid ?? "not reported"], ["Role", result.details.role ?? "not reported"]] },
|
|
738
780
|
] },
|
|
739
781
|
{ title: "Execution", blocks: [
|
|
740
|
-
{ kind: "fields", rows: [["Process", processCell(row)], ["Application", execution.harness], ["Model",
|
|
782
|
+
{ 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] },
|
|
741
783
|
...(row.authReason ? [{ kind: "lines", lines: [{ text: row.authReason, tone: authTone(row) }] }] : []),
|
|
742
784
|
] },
|
|
743
785
|
{ title: "Mesh", blocks: [
|
|
@@ -846,28 +888,33 @@ export async function readSeats(v, command, on) {
|
|
|
846
888
|
// what this command established about it (pin 3).
|
|
847
889
|
const target = { space: t.space, scope: "all-managers" };
|
|
848
890
|
const scatter = await scatterManager(cliControl, t.space, t.server, command, t.auth, t.spaceAuth, undefined, { reportHosts: true });
|
|
891
|
+
if (!scatter.ok)
|
|
892
|
+
throwScatterFailure(scatter, target, t, command, v);
|
|
893
|
+
return seatCensus(target, scatter.instances, command, t.mode, v);
|
|
894
|
+
}
|
|
895
|
+
/** Classify a failed `ps` / `slots` scatter against this root's local stack state without
|
|
896
|
+
* mistaking an unanswered registered standalone manager for an absent stack manager. */
|
|
897
|
+
export function throwScatterFailure(scatter, target, t, command, v) {
|
|
849
898
|
// An empty manager registry on this root's own controller stack, whose manager does not run, is
|
|
850
899
|
// a known boundary with a remedy; the registry's own failure stays the cause. So is a registry
|
|
851
900
|
// that still lists that manager after its process died: no manager answered the read. While an
|
|
852
901
|
// `up` is still starting that manager, the answer is to wait for it, not to start another.
|
|
853
|
-
if (
|
|
902
|
+
if ((scatter.code === "failed-precondition" || scatter.unanswered === true) && t.root !== undefined) {
|
|
854
903
|
const native = { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) };
|
|
855
904
|
if (stackManagerStarting(t.root, t.space))
|
|
856
905
|
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` });
|
|
857
|
-
if (stackManagerAbsent(t.root, t.space))
|
|
906
|
+
if (stackManagerAbsent(t.root, t.space, { unanswered: scatter.unanswered === true }))
|
|
858
907
|
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) });
|
|
859
908
|
}
|
|
860
|
-
const silentPid =
|
|
861
|
-
if (
|
|
909
|
+
const silentPid = scatter.unanswered === true && t.root !== undefined ? runningStackManagerPid(t.root, t.space) : undefined;
|
|
910
|
+
if (silentPid !== undefined)
|
|
862
911
|
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` });
|
|
863
912
|
// Anywhere else, a registry that was read and lists no live manager is the same boundary: no
|
|
864
913
|
// manager was asked. It is not proof that no manager process runs, since one that is starting or
|
|
865
914
|
// cannot register is not listed, so the refusal says only what the registry showed.
|
|
866
|
-
if (
|
|
915
|
+
if (scatter.noLiveManager)
|
|
867
916
|
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "no manager is registered for this space, so none was asked and nothing was listed. A manager that is still starting or cannot register has no registration either, so this does not show that no manager process runs", { target, native: { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) }, remedy: psManagerStartRemedy(t) });
|
|
868
|
-
|
|
869
|
-
throw readFailure(scatter, target);
|
|
870
|
-
return seatCensus(target, scatter.instances, command, t.mode, v);
|
|
917
|
+
throw readFailure(scatter, target);
|
|
871
918
|
}
|
|
872
919
|
/** Diagnose the channel seed only for the recorded local stack at the broker we asked. */
|
|
873
920
|
function psManagerStartRemedy(t) {
|
|
@@ -979,10 +1026,10 @@ async function readYourManagers(v, command, managers) {
|
|
|
979
1026
|
throw new NoManagerAnswered(new CommandFailure("refused", "TARGET_UNAVAILABLE", `none of the ${managers.length} managers the exchange counts live answered`, { target: { space: space ?? null, scope: "your-managers" } }));
|
|
980
1027
|
return seatCensus({ space, scope: "your-managers" }, instances, command, mode, v);
|
|
981
1028
|
}
|
|
982
|
-
/**
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
return
|
|
1029
|
+
/** Mesh commands for a seat whose runtime streams no terminal. Keep a private broker address out of the receipt. */
|
|
1030
|
+
export function noTerminalCommands(name, space, server) {
|
|
1031
|
+
const target = targetWords({ space, server: server !== undefined && brokerAddressForDisplay(server) !== server ? "<original-server>" : server });
|
|
1032
|
+
return { send: `${displayCmd()} send -t ${shellWord(name)} "<message>"${target}`, watch: `${displayCmd()} watch${target}` };
|
|
986
1033
|
}
|
|
987
1034
|
/**
|
|
988
1035
|
* The attach `cotal attach`, the console and spawn-then-attach run: the shared attach from
|
|
@@ -994,7 +1041,10 @@ export async function attachSeat(v, opts) {
|
|
|
994
1041
|
if (opts.onRefusal === "exit")
|
|
995
1042
|
refuseControlCreds(v.creds, v.space);
|
|
996
1043
|
const pin = opts.on === undefined && opts.onRefusal === "exit" ? await pinForTarget(v, "cotal attach") : { instanceId: opts.on };
|
|
997
|
-
return attachSeatWith({ ...v, expectedSeat: pin.expectedSeat ?? v.expectedSeat }, { ...opts, on: pin.instanceId, control: cliControl, verb: "cotal attach", noTerminalRemedy })
|
|
1044
|
+
return attachSeatWith({ ...v, expectedSeat: pin.expectedSeat ?? v.expectedSeat }, { ...opts, on: pin.instanceId, control: cliControl, verb: "cotal attach", noTerminalRemedy: ({ name, space }) => {
|
|
1045
|
+
const { send, watch } = noTerminalCommands(name, space, v.server);
|
|
1046
|
+
return `nothing was attached and the agent was not touched; follow the runtime's own guidance above, or reach the seat over the mesh with ${codeSpan(send)} and ${codeSpan(watch)}`;
|
|
1047
|
+
} });
|
|
998
1048
|
}
|
|
999
1049
|
async function pickAttach(values) {
|
|
1000
1050
|
const census = await readSeats(values, "ps", await managerPin(values, onRerun("cotal attach", values)));
|
|
@@ -1058,9 +1108,12 @@ export async function attach(args) {
|
|
|
1058
1108
|
if (verdict.kind === "failed")
|
|
1059
1109
|
throw new CommandFailure("failed", "OPERATION_FAILED", verdict.message);
|
|
1060
1110
|
const detached = verdict.kind === "ended" && verdict.reason === "detached";
|
|
1111
|
+
const census = v.server !== undefined && brokerAddressForDisplay(v.server) !== v.server
|
|
1112
|
+
? `${codeSpan(`${displayCmd()} ps`)} with your original space and broker options`
|
|
1113
|
+
: codeSpan(onRerun(`${displayCmd()} ps`, v));
|
|
1061
1114
|
console.error(renderReport({ sections: [{ title: verdict.kind === "gone" ? "Attach target no longer available" : detached ? "Detached" : "Attach session ended", blocks: [
|
|
1062
1115
|
{ kind: "fields", rows: [["Agent", v.name]] },
|
|
1063
|
-
{ kind: "lines", lines: [{ text: verdict.kind === "gone" ? "The selected agent or incarnation was not available to this attach request." : detached ? "Detaching did not send a stop request." :
|
|
1116
|
+
{ kind: "lines", lines: [{ text: verdict.kind === "gone" ? "The selected agent or incarnation was not available to this attach request." : detached ? "Detaching did not send a stop request." : `The terminal session ended. This view sent no agent stop request. Run ${census} to check the agent's current state.`, tone: "hint" }] },
|
|
1064
1117
|
] }] }, "rich", process.stderr));
|
|
1065
1118
|
}
|
|
1066
1119
|
/**
|
|
@@ -1087,14 +1140,14 @@ export function inputArguments(args) {
|
|
|
1087
1140
|
if (!text)
|
|
1088
1141
|
throw new CommandFailure("refused", "USAGE_INVALID", "input needs nonempty text; use --text for a value beginning with a dash");
|
|
1089
1142
|
if (values.on !== undefined)
|
|
1090
|
-
onInstance(values.on, onRemedyVerb("cotal input", { ...values, name }, inputRetryWords(text, values
|
|
1143
|
+
onInstance(values.on, onRemedyVerb("cotal input", { ...values, name }, inputRetryWords(text, values)), managerRosterHint(values));
|
|
1091
1144
|
return { name, text };
|
|
1092
1145
|
}
|
|
1093
1146
|
export async function input(args) {
|
|
1094
1147
|
const parsed = inputArguments(args);
|
|
1095
1148
|
const v = { ...args.values, ...parsed };
|
|
1096
1149
|
refuseControlCreds(v.creds, v.space);
|
|
1097
|
-
const pin = await pinForTarget(v, "cotal input", inputRetryWords(v.text, v
|
|
1150
|
+
const pin = await pinForTarget(v, "cotal input", inputRetryWords(v.text, v), { onRefusal: "throw" });
|
|
1098
1151
|
const on = pin.instanceId;
|
|
1099
1152
|
// A typed pin the registry does not list is refused at once, as stop refuses it.
|
|
1100
1153
|
if (v.on !== undefined && on !== undefined) {
|