@cotal-ai/cli 0.171.2 → 0.171.3
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 +140 -85
- package/dist/command.js.map +1 -1
- package/dist/commands/app-identity.d.ts +6 -0
- package/dist/commands/app-identity.d.ts.map +1 -1
- package/dist/commands/app-identity.js +4 -4
- package/dist/commands/app-identity.js.map +1 -1
- package/dist/commands/backup-maintenance.js +1 -1
- package/dist/commands/backup-maintenance.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +7 -5
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ext.js +1 -1
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +2 -13
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/history-clear.d.ts.map +1 -1
- package/dist/commands/history-clear.js +18 -2
- package/dist/commands/history-clear.js.map +1 -1
- package/dist/commands/join.js +7 -2
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/manager-service.d.ts +1 -1
- package/dist/commands/manager-service.d.ts.map +1 -1
- package/dist/commands/manager-service.js +9 -4
- package/dist/commands/manager-service.js.map +1 -1
- package/dist/commands/reset-space-apply.d.ts.map +1 -1
- package/dist/commands/reset-space-apply.js +2 -1
- package/dist/commands/reset-space-apply.js.map +1 -1
- package/dist/commands/reset-store-apply.d.ts +6 -0
- package/dist/commands/reset-store-apply.d.ts.map +1 -1
- package/dist/commands/reset-store-apply.js +22 -2
- package/dist/commands/reset-store-apply.js.map +1 -1
- package/dist/commands/service-registry.d.ts.map +1 -1
- package/dist/commands/service-registry.js +2 -0
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/space.d.ts +1 -0
- package/dist/commands/space.d.ts.map +1 -1
- package/dist/commands/space.js +5 -1
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn.d.ts +7 -2
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +115 -30
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.js +5 -2
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +5 -4
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status.d.ts +6 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +69 -26
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +47 -22
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +3 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/ext-loader.d.ts +1 -1
- package/dist/ext-loader.d.ts.map +1 -1
- package/dist/ext-loader.js +3 -3
- package/dist/ext-loader.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/local-process-stop.d.ts +2 -0
- package/dist/lib/local-process-stop.d.ts.map +1 -1
- package/dist/lib/local-process-stop.js +1 -0
- package/dist/lib/local-process-stop.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 +8 -2
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/nats-bin.d.ts +1 -0
- package/dist/lib/nats-bin.d.ts.map +1 -1
- package/dist/lib/nats-bin.js +1 -0
- package/dist/lib/nats-bin.js.map +1 -1
- package/dist/lib/persona-files.d.ts +1 -1
- package/dist/lib/persona-files.d.ts.map +1 -1
- package/dist/lib/persona-files.js +10 -2
- package/dist/lib/persona-files.js.map +1 -1
- package/dist/lib/restore.d.ts +4 -3
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +12 -10
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/self-exec.d.ts.map +1 -1
- package/dist/lib/self-exec.js +8 -2
- package/dist/lib/self-exec.js.map +1 -1
- package/dist/lib/service-adapters.d.ts +1 -1
- package/dist/lib/service-adapters.d.ts.map +1 -1
- package/dist/lib/service-adapters.js +2 -2
- package/dist/lib/service-adapters.js.map +1 -1
- package/dist/lib/service-census.d.ts +5 -5
- package/dist/lib/service-install-intent.d.ts +2 -2
- package/dist/lib/service-instances.d.ts +2 -2
- package/dist/lib/service-presets.d.ts +1 -1
- package/dist/lib/service-presets.d.ts.map +1 -1
- package/dist/lib/service-presets.js +4 -4
- package/dist/lib/service-presets.js.map +1 -1
- package/dist/lib/service-supervision.d.ts +1 -1
- package/dist/lib/service-systemd-attempt-read.d.ts +3 -3
- package/dist/lib/service-uninstall-intent.d.ts +2 -2
- package/dist/lib/stack-journal.d.ts +5 -2
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +5 -2
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/team-agent-removal.d.ts +1 -1
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +15 -1
- package/dist/lib/version.js.map +1 -1
- package/dist/seed/reconcile.d.ts.map +1 -1
- package/dist/seed/reconcile.js +5 -2
- package/dist/seed/reconcile.js.map +1 -1
- package/package.json +12 -4
package/dist/commands/status.js
CHANGED
|
@@ -3,7 +3,7 @@ import { drainAndClose } from "@cotal-ai/core";
|
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { CotalEndpoint, agentFilePath, dialerFor, EpEnvelopeError, formatAge, isReachable, isStreamNotFound, mintCreds, mintLifecycleUid, resolveService, realDirNoSymlink, invokeRepairingSplit, standaloneConnectOpts, newIdentity, idFromCreds, principalKey, DEV_OWNER, unansweredRequest, resolveAuthProvider, personaDir, } from "@cotal-ai/core";
|
|
6
|
-
import { stoppedLoopbackListener, stackRunsUnderOtherHome, accountInventory, authDir, isCommandFailure, readMaintenanceJournal, recordsElsewhereError, recordsElsewhereText, restoreRolledBackRuns, targetErrorSpace, brokerAddressForDisplay, brokerCheck, brokerUrlKey, canonicalRoot, CLI_USER_ACTOR, codeSpan, credentialFileExposure, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, folderSpaceOverSelection, meshesForRoot, resolveReadsLiveness, stoppedStack, unsettledStackOperation, withdrawOperationNote, hasUserAuthState, homeCotalDir, installationWriter, cachedPreferences, loadLaunchPersonaFile, resolvePreference, isMeshRegistryError, isWorkspaceTargetError, jsonFlag, loadManagerInstanceIdentity, loadSoleSpaceAuth, localProcessPath, localProcessVisible, MANAGER_PIDFILE, NATS_PIDFILE, oneLine, spaceKey, PREFERENCE_KEYS, plainFlag, preflightTarget, presentationOf, principalFromBearer, verifyIdentityPin, probeWebReadiness, readCurrent, readMeshRegistry, readPidfile, preparedRecordSkipped, readPreparedSpaces, stackJournalPath, readRenewalRecord, recordOperationSpace, renderWorkspaceError, resolveMeshTarget, serverFlag, spaceFlag, userAuthStateDir, WEB_PIDFILE, workspaceSecretStore, displayWidth, terminalWidth, wrapWords, writeResult, workspaceErrorParts, preferencesPath, preferencesFolderWarning, cotalDirLink, movedProject, spaceStreamsAbsent, spaceStreamsExpected, resolveControlTarget, } from "@cotal-ai/workspace";
|
|
6
|
+
import { stoppedLoopbackListener, stackRunsUnderOtherHome, accountInventory, authDir, isCommandFailure, readMaintenanceJournal, recordsElsewhereError, recordsElsewhereText, restoreRolledBackRuns, targetErrorSpace, brokerAddressForDisplay, brokerCheck, brokerUrlKey, canonicalRoot, CLI_USER_ACTOR, codeSpan, credentialFileExposure, CommandFailure, deliveryCredsKey, DELIVERY_PIDFILE, extensionsDir, findCotalRoot, folderSpaceOverSelection, meshesForRoot, resolveReadsLiveness, stoppedStack, unsettledStackOperation, withdrawOperationNote, hasUserAuthState, homeCotalDir, installationWriter, cachedPreferences, loadLaunchPersonaFile, resolvePreference, isMeshRegistryError, isWorkspaceTargetError, jsonFlag, loadManagerInstanceIdentity, loadSoleSpaceAuth, localProcessPath, localProcessVisible, MANAGER_PIDFILE, NATS_PIDFILE, OFFICIAL_CONNECTORS, oneLine, spaceKey, PREFERENCE_KEYS, plainFlag, preflightTarget, preparedNeverStarted, presentationOf, principalFromBearer, verifyIdentityPin, probeWebReadiness, readCurrent, readMeshRegistry, readPidfile, preparedRecordSkipped, readPreparedSpaces, stackJournalPath, readRenewalRecord, recordOperationSpace, renderWorkspaceError, resolveMeshTarget, serverFlag, spaceFlag, userAuthStateDir, WEB_PIDFILE, workspaceSecretStore, displayWidth, terminalWidth, wrapWords, writeResult, workspaceErrorParts, preferencesPath, preferencesFolderWarning, cotalDirLink, movedProject, spaceStreamsAbsent, spaceStreamsExpected, resolveControlTarget, } from "@cotal-ai/workspace";
|
|
7
7
|
import { localProcessSurface } from "../ext-loader.js";
|
|
8
8
|
import { cliVersion, cliProvenance, readExtensionVersions } from "../lib/version.js";
|
|
9
9
|
import { agentSkillsSkew } from "../lib/agent-skills.js";
|
|
@@ -23,6 +23,7 @@ import { c } from "../ui.js";
|
|
|
23
23
|
import { preparedCatalogDiagnostics } from "./sync.js";
|
|
24
24
|
import { agentStatus } from "./agents.js";
|
|
25
25
|
import { invalidEnvironmentValues } from "./config.js";
|
|
26
|
+
import { canPrompt } from "./meshes-wizard.js";
|
|
26
27
|
import { cliControl, onInstance, onRerun } from "../lib/control.js";
|
|
27
28
|
import { serviceDefinitionProjection, serviceDefinitionStore } from "../lib/service-definitions.js";
|
|
28
29
|
import { instanceProjection, serviceInstances } from "../lib/service-instances.js";
|
|
@@ -37,6 +38,8 @@ import { rootStoreProblem } from "../lib/store-dir.js";
|
|
|
37
38
|
import { stackStoreWarnings } from "../lib/store-identity.js";
|
|
38
39
|
import { natsServerLabel } from "../lib/nats-bin.js";
|
|
39
40
|
import { askManager } from "@cotal-ai/workspace/control";
|
|
41
|
+
import { readCursor } from "../seed/lock.js";
|
|
42
|
+
import { reconcileCursorPath } from "../seed/paths.js";
|
|
40
43
|
/** `--components` is the fail-loud health pass with a machine-readable EXIT DISPOSITION. Bare
|
|
41
44
|
* `status` is a broad, recovery-oriented report: it exits 0, or 4 when it could not read part of what
|
|
42
45
|
* it reports; this explicit mode is for an operator or monitor that needs a component state per
|
|
@@ -169,14 +172,28 @@ export async function status(args) {
|
|
|
169
172
|
if (preferencesFolder)
|
|
170
173
|
hints.push(`protect the preferences folder: ${preferencesFolder.remedy}`);
|
|
171
174
|
const machine = await readMachine(selected, gaps, hints);
|
|
175
|
+
const installationChanging = gaps.warnings.some((warning) => warning.code === "INSTALLATION_CHANGING");
|
|
172
176
|
const extensions = readExtensions(gaps);
|
|
177
|
+
let seed;
|
|
178
|
+
try {
|
|
179
|
+
const cursor = readCursor();
|
|
180
|
+
if (cursor?.failed !== undefined)
|
|
181
|
+
seed = cursor;
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
const path = reconcileCursorPath();
|
|
185
|
+
const code = error.code;
|
|
186
|
+
gaps.add("EXTENSIONS_UNREADABLE", `the connector seed cursor at ${path} could not be read${code ? ` (${code})` : ""}`, { path });
|
|
187
|
+
}
|
|
173
188
|
const skewedExtensions = extensions.items?.filter((item) => item.package.startsWith("@cotal-ai/") && item.version !== machine.version) ?? [];
|
|
174
189
|
const extensionWarnings = skewedExtensions.length ? [{
|
|
175
190
|
code: "EXTENSION_VERSION_SKEW",
|
|
176
191
|
target: { version: machine.version, packages: skewedExtensions.map((item) => item.package) },
|
|
177
|
-
message: `extension version skew: ${skewedExtensions.map((item) => `${item.package} is ${item.version}`).join(", ")}; this cotal is ${machine.version}.
|
|
192
|
+
message: `extension version skew: ${skewedExtensions.map((item) => `${item.package} is ${item.version}`).join(", ")}; this cotal is ${machine.version}. ${installationChanging
|
|
193
|
+
? "These versions may change. Check again when that command finishes."
|
|
194
|
+
: `Run \`${displayCmd()} update --self\` to reconcile this installation.`}`,
|
|
178
195
|
}] : [];
|
|
179
|
-
if (extensionWarnings.length)
|
|
196
|
+
if (extensionWarnings.length && !installationChanging)
|
|
180
197
|
hints.push(`reconcile extension versions with \`${displayCmd()} update --self\``);
|
|
181
198
|
// THE RESPONDER AXIS (#1576), read ONCE and threaded into the rows that would otherwise claim
|
|
182
199
|
// health they never checked. It is read before the folder section because that section renders
|
|
@@ -239,7 +256,9 @@ export async function status(args) {
|
|
|
239
256
|
const store = full ?? logged;
|
|
240
257
|
const stackManager = selected.ok ? await readStackManager(selected.target, services) : undefined;
|
|
241
258
|
// Two readers can name the same unreadable record, so each hint is listed once.
|
|
242
|
-
const result = { kind: "infrastructure", machine, extensions, folder, meshes, selected: target, services, bootAttempts, maintenance, ...(store ? { store } : {}), ...(stackManager ? { stackManager } : {}), hints:
|
|
259
|
+
const result = { kind: "infrastructure", machine, extensions, folder, meshes, selected: target, services, bootAttempts, maintenance, ...(store ? { store } : {}), ...(stackManager ? { stackManager } : {}), hints: seed?.failed !== undefined
|
|
260
|
+
? [`Fix the recorded cause first:\n${seed.failed}`, `Then run \`${displayCmd()} ext seed --repair\` before starting a space`, ...(recovery ? [recovery] : [])]
|
|
261
|
+
: [...new Set(hints)] };
|
|
243
262
|
const parts = gaps.warnings.length;
|
|
244
263
|
// A preference variable `config set` would refuse is named, but it was read, so the run stays complete.
|
|
245
264
|
// An unreadable preferences file is already a gap, so the variables are checked without it.
|
|
@@ -263,7 +282,12 @@ export async function status(args) {
|
|
|
263
282
|
completeness: parts ? "partial" : "complete",
|
|
264
283
|
warnings: [...gaps.warnings, ...extensionWarnings, ...invalidValues, ...survivors],
|
|
265
284
|
...(parts ? { partial: { message: `status could not read ${parts === 1 ? "one part" : `${parts} parts`} of what it reports; the warnings name ${parts === 1 ? "it" : "each"}` } } : {}),
|
|
266
|
-
}, (result) => statusView(result, Boolean(values.verbose), Boolean(values.all) || Boolean(values.wide)
|
|
285
|
+
}, (result) => statusView(result, Boolean(values.verbose), Boolean(values.all) || Boolean(values.wide), {
|
|
286
|
+
interactive: presentation === "rich" && canPrompt(),
|
|
287
|
+
preparedHarness: !selected.ok && isWorkspaceTargetError(selected.error) && selected.error.code === "not-started" && preparedNeverStarted(selected.error.details)
|
|
288
|
+
? preferences.spaces[selected.error.details.space]?.harness : undefined,
|
|
289
|
+
seed,
|
|
290
|
+
}));
|
|
267
291
|
if (values.components)
|
|
268
292
|
await printComponentHealth(selected, store);
|
|
269
293
|
}
|
|
@@ -415,7 +439,7 @@ async function readMachine(selected, gaps, hints) {
|
|
|
415
439
|
}
|
|
416
440
|
// Loading a connector's provider waits for a command that is changing the installation. Status is
|
|
417
441
|
// a read: it reports that command and leaves the rows unread.
|
|
418
|
-
const writer =
|
|
442
|
+
const writer = installationWriter();
|
|
419
443
|
if (writer) {
|
|
420
444
|
gaps.add("INSTALLATION_CHANGING", `another cotal command (pid ${writer.pid}) is changing this installation, so the application rows were not read`, { pid: writer.pid });
|
|
421
445
|
hints.push("run `cotal status` again when that command finishes");
|
|
@@ -1731,10 +1755,12 @@ function setUpApplications(m) {
|
|
|
1731
1755
|
return (m.connectors ?? []).filter((connector) => !connector.missing.length).map((connector) => connector.name);
|
|
1732
1756
|
}
|
|
1733
1757
|
/** The applications line: the names that are set up, and how many more `cotal setup` would add. */
|
|
1734
|
-
function applicationsCell(m) {
|
|
1758
|
+
function applicationsCell(m, interactive) {
|
|
1735
1759
|
if (m.connectors === null)
|
|
1736
1760
|
return stateCell("could not be read", "failed");
|
|
1737
1761
|
const setUp = setUpApplications(m), others = m.connectors.length - setUp.length;
|
|
1762
|
+
if (!interactive)
|
|
1763
|
+
return setUp.length ? stateCell(`${setUp.join(", ")}${others ? ` · ${others} not set up` : ""}`, "ok") : stateCell("not set up", "hint");
|
|
1738
1764
|
if (!setUp.length)
|
|
1739
1765
|
return stateCell(`not set up · \`${displayCmd()} setup\` adds one`, "hint");
|
|
1740
1766
|
return stateCell(`${setUp.join(", ")}${others ? ` · ${others} more with \`${displayCmd()} setup\`` : ""}`, "ok");
|
|
@@ -1769,7 +1795,7 @@ function extensionsCell(e) {
|
|
|
1769
1795
|
* with the same version spelled out on each, and the broker executable's full bundled path on a
|
|
1770
1796
|
* healthy machine: a block of text whose signal a reader had to hunt for.
|
|
1771
1797
|
*/
|
|
1772
|
-
function machineOverview(r, wide) {
|
|
1798
|
+
function machineOverview(r, wide, interactive, seed) {
|
|
1773
1799
|
const m = r.machine;
|
|
1774
1800
|
const tones = { ok: "ok", warn: "waiting", error: "failed", off: "hint" };
|
|
1775
1801
|
const setUp = setUpApplications(m);
|
|
@@ -1778,7 +1804,7 @@ function machineOverview(r, wide) {
|
|
|
1778
1804
|
const rows = wide
|
|
1779
1805
|
? m.integrations.map((item) => [item.name, stateCell(item.text, tones[item.state])])
|
|
1780
1806
|
: m.integrations.filter((item) => item.state !== "ok" && ownedBySetUp(item.name)).map((item) => [item.name, stateCell(item.text, tones[item.state])]);
|
|
1781
|
-
rows.unshift(["Agent applications", applicationsCell(m)]);
|
|
1807
|
+
rows.unshift(["Agent applications", applicationsCell(m, interactive)]);
|
|
1782
1808
|
if (wide)
|
|
1783
1809
|
for (const connector of m.connectors ?? []) {
|
|
1784
1810
|
if (m.integrations.some((item) => item.name.toLowerCase().includes(connector.name.toLowerCase())))
|
|
@@ -1804,6 +1830,8 @@ function machineOverview(r, wide) {
|
|
|
1804
1830
|
: extensionsCell(r.extensions);
|
|
1805
1831
|
if (extensions !== undefined)
|
|
1806
1832
|
rows.push(["Extensions", extensions]);
|
|
1833
|
+
if (seed)
|
|
1834
|
+
rows.push(["Connector setup", stateCell(`incomplete · ${seed.package} failed during ${seed.phase}`, "failed")]);
|
|
1807
1835
|
return {
|
|
1808
1836
|
title: "This machine",
|
|
1809
1837
|
blocks: [
|
|
@@ -1869,7 +1897,7 @@ function spaceStateCell(r, entry) {
|
|
|
1869
1897
|
* is not a group title: it groups spaces by an address a reader does not act on here, and `cotal
|
|
1870
1898
|
* space show <name>` names it. `--all` and `--wide` keep the grouped report.
|
|
1871
1899
|
*/
|
|
1872
|
-
function spacesOverview(r, wide) {
|
|
1900
|
+
function spacesOverview(r, wide, seedFailed) {
|
|
1873
1901
|
const blocks = [];
|
|
1874
1902
|
// The space this report is for: the target it resolved or the space it is about, else the selection
|
|
1875
1903
|
// it could not resolve.
|
|
@@ -1881,7 +1909,7 @@ function spacesOverview(r, wide) {
|
|
|
1881
1909
|
});
|
|
1882
1910
|
const columns = [{ key: "space", label: "Space" }, { key: "state", label: "Connection" }, { key: "detail", label: "Signs in" }];
|
|
1883
1911
|
if (!r.meshes.items.length && !r.meshes.unreadable.length)
|
|
1884
|
-
blocks.push({ kind: "lines", lines: [cell("No spaces registered", "hint"), cell(`Sign in to Cotal Cloud with \`${displayCmd()} login\`.`, "hint")] });
|
|
1912
|
+
blocks.push({ kind: "lines", lines: [cell("No spaces registered", "hint"), ...(seedFailed ? [] : [cell(`Sign in to Cotal Cloud with \`${displayCmd()} login\`.`, "hint")])] });
|
|
1885
1913
|
else if (wide) {
|
|
1886
1914
|
const groups = new Map();
|
|
1887
1915
|
for (const entry of r.meshes.items) {
|
|
@@ -2028,7 +2056,12 @@ function roleList(roles) {
|
|
|
2028
2056
|
function backupRecovery(maintenance) {
|
|
2029
2057
|
return maintenance?.state === "claimed" || maintenance?.state === "restore-ready" ? maintenance.next : null;
|
|
2030
2058
|
}
|
|
2031
|
-
function nextActions(r) {
|
|
2059
|
+
function nextActions(r, seedFailed, interactive, preparedHarness) {
|
|
2060
|
+
if (seedFailed)
|
|
2061
|
+
return {
|
|
2062
|
+
title: "Next",
|
|
2063
|
+
blocks: [{ kind: "lines", lines: r.hints.flatMap(hint => hint.split("\n").map(line => cell(line, "hint"))) }],
|
|
2064
|
+
};
|
|
2032
2065
|
const recovery = backupRecovery(r.maintenance);
|
|
2033
2066
|
if (recovery)
|
|
2034
2067
|
return { title: "Next", blocks: [...new Set([recovery, ...r.hints])].map((hint) => ({ kind: "lines", lines: [cell(hint, "hint")] })) };
|
|
@@ -2039,22 +2072,32 @@ function nextActions(r) {
|
|
|
2039
2072
|
if (!r.selected.resolved && !r.meshes.items.length && !r.meshes.unreadable.length) {
|
|
2040
2073
|
items.push({ command: `${cmd} login`, description: "Sign in to Cotal Cloud" });
|
|
2041
2074
|
}
|
|
2075
|
+
if (noApplication) {
|
|
2076
|
+
const s = r.selected;
|
|
2077
|
+
const connector = r.machine.connectors?.find((row) => row.name === preparedHarness);
|
|
2078
|
+
if (interactive)
|
|
2079
|
+
items.push({ command: `${cmd} setup`, description: !s.resolved && s.code !== "not-started" ? "Set up an agent application and a space" : "Set up an agent application" });
|
|
2080
|
+
else if (connector && !s.resolved && s.code === "not-started" && s.root && s.space && !s.recordedRoot) {
|
|
2081
|
+
const guide = Object.hasOwn(OFFICIAL_CONNECTORS, connector.name) ? `connect-${connector.name}` : "connectors";
|
|
2082
|
+
extra.push(`Install ${connector.missing.join(", ")} on PATH first. See https://docs.cotal.ai/docs/${guide}/.`);
|
|
2083
|
+
items.push({ command: `${cmd} setup --destination local --harness ${shellWord(connector.name)} --project ${shellWord(s.root)} --space ${shellWord(s.space)} --configure-only --no-input`, description: "" });
|
|
2084
|
+
}
|
|
2085
|
+
else
|
|
2086
|
+
items.push({ command: `${cmd} setup --help`, description: "See setup flags for scripts. Bare setup needs a terminal." });
|
|
2087
|
+
}
|
|
2042
2088
|
if (r.selected.resolved) {
|
|
2043
2089
|
const s = r.selected;
|
|
2044
|
-
// A space that already resolves needs only the application to spawn into it.
|
|
2045
|
-
if (noApplication)
|
|
2046
|
-
items.push({ command: `${cmd} setup`, description: "Set up an agent application" });
|
|
2047
2090
|
// Name what fixes the default persona alone; setup does far more than that.
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2091
|
+
if (!noApplication) {
|
|
2092
|
+
if (s.personas.default === "missing")
|
|
2093
|
+
items.push({ command: `${cmd} spawn`, description: "Open your default agent; creates the shipped default persona" });
|
|
2094
|
+
else if (s.personas.default !== "valid")
|
|
2095
|
+
items.push({ command: `${cmd} persona show default --space ${s.space}`, description: "See what is wrong with the default persona" });
|
|
2096
|
+
else
|
|
2097
|
+
items.push({ command: `${cmd} spawn`, description: "Open your default agent" });
|
|
2098
|
+
}
|
|
2054
2099
|
items.push({ command: `${cmd} ps`, description: "See the agent roster" });
|
|
2055
2100
|
}
|
|
2056
|
-
else if (noApplication)
|
|
2057
|
-
items.push({ command: `${cmd} setup`, description: r.selected.code === "not-started" ? "Set up an agent application" : "Set up an agent application and a space" });
|
|
2058
2101
|
if (r.selected.resolved || !noApplication) {
|
|
2059
2102
|
items.push({ command: `${cmd} space`, description: "List the spaces on this machine" });
|
|
2060
2103
|
items.push({ command: `${cmd} use <name>`, description: "Select the default space" });
|
|
@@ -2228,7 +2271,7 @@ function maintenanceOverview(maintenance) {
|
|
|
2228
2271
|
}
|
|
2229
2272
|
/** The approved screen hierarchy; record-level diagnostics are opt-in. `wide` reports every row in
|
|
2230
2273
|
* full, as `--all` and `--wide` ask. */
|
|
2231
|
-
export function statusView(r, verbose = false, wide = false) {
|
|
2274
|
+
export function statusView(r, verbose = false, wide = false, { interactive = false, preparedHarness, seed } = {}) {
|
|
2232
2275
|
const selected = selectedOverview(r);
|
|
2233
2276
|
// This folder's own stack under another selection, with the lines it has when it is selected.
|
|
2234
2277
|
const held = folderStack(r.folder, r.selected), heldLines = held ? stackLines(r.folder) : [];
|
|
@@ -2236,10 +2279,10 @@ export function statusView(r, verbose = false, wide = false) {
|
|
|
2236
2279
|
const owned = ownedServicesOverview(r.services);
|
|
2237
2280
|
const attempts = bootAttemptOverview(r.bootAttempts);
|
|
2238
2281
|
const maintenance = maintenanceOverview(r.maintenance);
|
|
2239
|
-
const sections = [machineOverview(r, wide), spacesOverview(r, wide), ...(selected ? [selected] : []), ...(heldSection ? [heldSection] : []), ...(maintenance ? [maintenance] : []), ...(attempts ? [attempts] : []), ...(owned ? [owned] : [])];
|
|
2282
|
+
const sections = [machineOverview(r, wide, interactive, seed), spacesOverview(r, wide, Boolean(seed)), ...(selected ? [selected] : []), ...(heldSection ? [heldSection] : []), ...(maintenance ? [maintenance] : []), ...(attempts ? [attempts] : []), ...(owned ? [owned] : [])];
|
|
2240
2283
|
if (verbose)
|
|
2241
2284
|
sections.push(machineSection(r.machine), extensionsSection(r.extensions), folderSection(r.folder, r.selected), ...meshesSections(r.meshes), selectedSection(r.selected, r.folder, stackDeliveryPid(r), r.store?.state === "full"));
|
|
2242
|
-
sections.push(nextActions(r));
|
|
2285
|
+
sections.push(nextActions(r, Boolean(seed), interactive, preparedHarness));
|
|
2243
2286
|
return { sections };
|
|
2244
2287
|
}
|
|
2245
2288
|
function section(name) {
|