@cotal-ai/cli 0.175.0 → 0.175.2
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 +27 -20
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +25 -14
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/backup-read.d.ts.map +1 -1
- package/dist/commands/backup-read.js +15 -11
- package/dist/commands/backup-read.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +8 -2
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +8 -3
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +3 -3
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +3 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +16 -9
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-authoring.d.ts.map +1 -1
- package/dist/commands/endpoint-authoring.js +15 -5
- package/dist/commands/endpoint-authoring.js.map +1 -1
- package/dist/commands/endpoint.d.ts.map +1 -1
- package/dist/commands/endpoint.js +2 -0
- package/dist/commands/endpoint.js.map +1 -1
- package/dist/commands/help.js +1 -1
- 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 -3
- package/dist/commands/history-clear.js.map +1 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +9 -10
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/personas.d.ts.map +1 -1
- package/dist/commands/personas.js +10 -3
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/removed-start.d.ts +4 -0
- package/dist/commands/removed-start.d.ts.map +1 -0
- package/dist/commands/removed-start.js +68 -0
- package/dist/commands/removed-start.js.map +1 -0
- package/dist/commands/revoke-credential.d.ts.map +1 -1
- package/dist/commands/revoke-credential.js +9 -6
- package/dist/commands/revoke-credential.js.map +1 -1
- package/dist/commands/service-actions.d.ts.map +1 -1
- package/dist/commands/service-actions.js +4 -2
- 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 +21 -3
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/space-delete.d.ts.map +1 -1
- package/dist/commands/space-delete.js +4 -3
- package/dist/commands/space-delete.js.map +1 -1
- package/dist/commands/space-registration.d.ts +2 -0
- package/dist/commands/space-registration.d.ts.map +1 -1
- package/dist/commands/space-registration.js +15 -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 +7 -4
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn-flags.d.ts +2 -0
- package/dist/commands/spawn-flags.d.ts.map +1 -1
- package/dist/commands/spawn-flags.js +1 -1
- package/dist/commands/spawn-flags.js.map +1 -1
- package/dist/commands/spawn-preview.js +1 -1
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/spawn.js +1 -1
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +3 -1
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +56 -6
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-up.d.ts +9 -9
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +23 -31
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status-health.d.ts +2 -2
- package/dist/commands/status-health.d.ts.map +1 -1
- package/dist/commands/status-health.js +19 -2
- package/dist/commands/status-health.js.map +1 -1
- package/dist/commands/status-meshes.js +3 -3
- package/dist/commands/status-meshes.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-agent-apply.d.ts.map +1 -1
- package/dist/commands/team-agent-apply.js +5 -4
- package/dist/commands/team-agent-apply.js.map +1 -1
- package/dist/commands/team-deploy-apply.d.ts.map +1 -1
- package/dist/commands/team-deploy-apply.js +9 -3
- package/dist/commands/team-deploy-apply.js.map +1 -1
- package/dist/commands/team.js +2 -2
- package/dist/commands/team.js.map +1 -1
- package/dist/commands/up-args.d.ts +65 -0
- package/dist/commands/up-args.d.ts.map +1 -0
- package/dist/commands/up-args.js +541 -0
- package/dist/commands/up-args.js.map +1 -0
- package/dist/commands/up-detach.d.ts +373 -0
- package/dist/commands/up-detach.d.ts.map +1 -0
- package/dist/commands/up-detach.js +819 -0
- package/dist/commands/up-detach.js.map +1 -0
- package/dist/commands/up-manifest.d.ts +109 -0
- package/dist/commands/up-manifest.d.ts.map +1 -0
- package/dist/commands/up-manifest.js +549 -0
- package/dist/commands/up-manifest.js.map +1 -0
- package/dist/commands/up-stores.d.ts +2 -2
- package/dist/commands/up-stores.d.ts.map +1 -1
- package/dist/commands/up-stores.js +5 -5
- package/dist/commands/up-stores.js.map +1 -1
- package/dist/commands/up.d.ts +7 -245
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +39 -1882
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update-release.d.ts +2 -4
- package/dist/commands/update-release.d.ts.map +1 -1
- package/dist/commands/update-release.js +30 -12
- package/dist/commands/update-release.js.map +1 -1
- package/dist/commands/update.d.ts +3 -3
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +29 -25
- package/dist/commands/update.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +6 -2
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/backup-artifact.d.ts +2 -2
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +39 -14
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/broker-service.d.ts +2 -0
- package/dist/lib/broker-service.d.ts.map +1 -1
- package/dist/lib/broker-service.js +13 -0
- package/dist/lib/broker-service.js.map +1 -1
- package/dist/lib/confirmation-required.d.ts.map +1 -1
- package/dist/lib/confirmation-required.js +7 -1
- package/dist/lib/confirmation-required.js.map +1 -1
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +13 -1
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/foreground-hold.d.ts +2 -1
- package/dist/lib/foreground-hold.d.ts.map +1 -1
- package/dist/lib/foreground-hold.js +25 -7
- package/dist/lib/foreground-hold.js.map +1 -1
- package/dist/lib/nearest-word.d.ts +3 -4
- package/dist/lib/nearest-word.d.ts.map +1 -1
- package/dist/lib/nearest-word.js +9 -5
- package/dist/lib/nearest-word.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 +23 -5
- package/dist/lib/persona-files.js.map +1 -1
- package/dist/lib/service-preset-target.d.ts +3 -2
- package/dist/lib/service-preset-target.d.ts.map +1 -1
- package/dist/lib/service-preset-target.js +8 -3
- 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 +17 -9
- package/dist/lib/service-presets.js.map +1 -1
- package/dist/lib/service-process.d.ts +2 -2
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +7 -4
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/spawn-defaults.d.ts +2 -2
- package/dist/lib/spawn-defaults.d.ts.map +1 -1
- package/dist/lib/spawn-defaults.js +3 -3
- package/dist/lib/spawn-defaults.js.map +1 -1
- package/dist/lib/stack-journal.d.ts +2 -2
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +9 -5
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/store-dir.js +1 -1
- package/dist/lib/store-dir.js.map +1 -1
- package/dist/lib/team-deploy-inspection.d.ts +3 -1
- package/dist/lib/team-deploy-inspection.d.ts.map +1 -1
- package/dist/lib/team-deploy-inspection.js +23 -2
- package/dist/lib/team-deploy-inspection.js.map +1 -1
- package/package.json +4 -4
|
@@ -209,9 +209,6 @@ export interface StackUpResult {
|
|
|
209
209
|
/** Process records under the root that fronted no process, which this call removed before it started a member. */
|
|
210
210
|
clearedRecords?: LocalRecord[];
|
|
211
211
|
}
|
|
212
|
-
/** A `--server` broker URL as `up` records and compares it: the scheme in lower case, with no bare
|
|
213
|
-
* trailing `/`. Any other value comes back as given, for the address checks to refuse. */
|
|
214
|
-
export declare function canonicalServer(server: string): string;
|
|
215
212
|
/** Whether an `up` invocation asks for a TLS broker. */
|
|
216
213
|
export declare function requestsTls(values: ParsedArgs["values"]): boolean;
|
|
217
214
|
/** The mode an invocation explicitly asks for, or none for a bare `up`. */
|
|
@@ -235,12 +232,15 @@ export declare function unparsableDaemonCredsNotice(kinds: readonly string[]): s
|
|
|
235
232
|
export declare function selectedOnUp(space: string): string;
|
|
236
233
|
/** What `up` says when another selected space stays selected. */
|
|
237
234
|
export declare function keptOnUp(space: string, kept: string): string;
|
|
238
|
-
/** `cotal up`'s controller route: start, seed the default persona into the root, then
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
export declare function stackUp(request: StackUpRequest, native: StackUpNative): Promise<
|
|
242
|
-
|
|
243
|
-
|
|
235
|
+
/** `cotal up`'s controller route: start, seed the default persona into the root, then prepare its
|
|
236
|
+
* receipt, which the caller prints after releasing the startup lock. A persona that cannot be
|
|
237
|
+
* written, or saved services that cannot be listed, is a warning. */
|
|
238
|
+
export declare function stackUp(request: StackUpRequest, native: StackUpNative): Promise<{
|
|
239
|
+
journal: StackJournal;
|
|
240
|
+
writeReceipt: () => void;
|
|
241
|
+
}>;
|
|
242
|
+
/** The live address blocker for a stopped stack or refused first start at its recorded broker address. */
|
|
243
|
+
export declare function stackStartAddressProblem(root: string, space: string, server?: string): Promise<{
|
|
244
244
|
message: string;
|
|
245
245
|
remedy: string;
|
|
246
246
|
} | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-up.d.ts","sourceRoot":"","sources":["../../src/commands/stack-up.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAsM,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3Q,OAAO,EACL,cAAc,
|
|
1
|
+
{"version":3,"file":"stack-up.d.ts","sourceRoot":"","sources":["../../src/commands/stack-up.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAsM,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3Q,OAAO,EACL,cAAc,EAkBd,cAAc,EAad,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,OAAO,EAEZ,KAAK,YAAY,EAMlB,MAAM,qBAAqB,CAAC;AAc7B,OAAO,EAA0a,KAAK,WAAW,EAAE,KAAK,YAAY,EAA+C,KAAK,SAAS,EAAkB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEzlB,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE/F,OAAO,EAA+I,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiB3M;iGACiG;AACjG,MAAM,WAAW,aAAa;IAC5B;4DACwD;IACxD,aAAa,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC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 @@ import { basename, join, resolve } from "node:path";
|
|
|
16
16
|
import { setTimeout as delay } from "node:timers/promises";
|
|
17
17
|
import { JetStreamApiCodes, JetStreamApiError } from "@nats-io/jetstream";
|
|
18
18
|
import { awaitDeadDeliveryLease, CONTRACT_ARTIFACT_MAX_BYTES, deliveryLeaseHolderFor, isJetStreamMissing, isReachable, LEASE_TTL_MS, MANAGER_START_PAYLOAD_FLOOR, mintCreds, newIdentity, openPrivateAppend } from "@cotal-ai/core";
|
|
19
|
-
import { CommandFailure, accountInventory, authDir, canonicalRoot, codeSpan, deliveryCredsKey, findMesh, findPreparedSpace, getCurrent, readCurrentSelection, getSpaceAuth, hasUserAuthState, homeCotalDir, isCommandFailure, loadMeshes, localMeshesForRoot, NATS_PIDFILE, presentationOf, readBrokerPolicy, readMaintenanceJournal, renderReport, resolveNativeServiceTarget, resolveOnPath, rotateSystemCreds, SPACE_NAME_MAX, spaceNameTooLong, stackHomeRemedy, stackRunsUnderOtherHome, workspaceSecretStore, writeResult, unparsableDaemonCreds, loopbackListeners, readProcessCommand, resolveMeshTarget, processStopped, } from "@cotal-ai/workspace";
|
|
19
|
+
import { CommandFailure, accountInventory, authDir, brokerUrlKey, canonicalRoot, codeSpan, deliveryCredsKey, findMesh, findPreparedSpace, getCurrent, readCurrentSelection, getSpaceAuth, hasUserAuthState, homeCotalDir, isCommandFailure, loadMeshes, localMeshesForRoot, NATS_PIDFILE, presentationOf, readBrokerPolicy, readMaintenanceJournal, renderReport, resolveNativeServiceTarget, resolveOnPath, rotateSystemCreds, SPACE_NAME_MAX, spaceNameTooLong, stackHomeRemedy, stackRunsUnderOtherHome, workspaceSecretStore, writeResult, unparsableDaemonCreds, loopbackListeners, readProcessCommand, resolveMeshTarget, processStopped, } from "@cotal-ai/workspace";
|
|
20
20
|
import { liveMeshProcesses } from "./clean.js";
|
|
21
|
-
import { addressHolder, brokerListenAddress, listenerBindError } from "../lib/broker-service.js";
|
|
21
|
+
import { addressHolder, brokerListenAddress, canonicalServer, listenerBindError } from "../lib/broker-service.js";
|
|
22
22
|
import { brokerStoreWrite, jetStreamDisabled, jetStreamDisabledRefusal, readStoredBytes, storeDamageNotice, storeFull } from "../lib/broker-store-health.js";
|
|
23
23
|
import { shellWord } from "../lib/endpoint-errors.js";
|
|
24
24
|
import { seedDefaultPersona } from "../lib/default-persona.js";
|
|
@@ -31,6 +31,7 @@ import { listLedgerFiles } from "../lib/manifest/ledger.js";
|
|
|
31
31
|
import { listAdditiveTeamAttempts, retainedAdditiveTeamAttempts } from "../lib/team-additive-attempt.js";
|
|
32
32
|
import { freshTeamAttemptSettled, listFreshTeamAttempts, listFreshTeamSummaries } from "../lib/team-fresh.js";
|
|
33
33
|
import { foreignLocalProcesses, newStackOperation, readStackJournal, removeStaleLocalRecords, runningStackRoles, serviceHeldRecords, settleRetainedStackStops, settleStackOperation, STACK_ADAPTER, STACK_DEFINITION, STACK_ROLES, stackDefinitionsAt, stackMaintenanceFence, stackNeverStarted, stackRecoveryHost, stackOperationUnsettled, stackRoleApplies, stackSettlementNotice, staleRecordWarning, withSettledMembers, writeStackJournal } from "../lib/stack-journal.js";
|
|
34
|
+
import { retryStackAddress } from "../lib/up-broker-address.js";
|
|
34
35
|
import { NATS_DEFAULT_MAX_PAYLOAD, natsServerLabel } from "../lib/nats-bin.js";
|
|
35
36
|
import { sharedStoreAtStart, sharedStoreWarning } from "../lib/store-dir.js";
|
|
36
37
|
import { readStoreIdentity, stackStoreWarnings } from "../lib/store-identity.js";
|
|
@@ -98,20 +99,6 @@ const CONTROLLER_UNSUPPORTED = ["file", "dry-run", "restore", "restore-only", "a
|
|
|
98
99
|
* pair, and a `--server` that names a `tls://` address. */
|
|
99
100
|
const TLS_INPUTS = ["tls-cert", "tls-key", "server tls://"];
|
|
100
101
|
const namesTlsServer = (values) => typeof values.server === "string" && /^tls:\/\//i.test(values.server);
|
|
101
|
-
/** A `--server` broker URL as `up` records and compares it: the scheme in lower case, with no bare
|
|
102
|
-
* trailing `/`. Any other value comes back as given, for the address checks to refuse. */
|
|
103
|
-
export function canonicalServer(server) {
|
|
104
|
-
let url;
|
|
105
|
-
try {
|
|
106
|
-
url = new URL(server);
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
return server;
|
|
110
|
-
}
|
|
111
|
-
if ((url.protocol !== "nats:" && url.protocol !== "tls:") || url.username || url.password || url.search || url.hash || (url.pathname !== "" && url.pathname !== "/") || server.includes(","))
|
|
112
|
-
return server;
|
|
113
|
-
return `${url.protocol}//${url.host}`;
|
|
114
|
-
}
|
|
115
102
|
/** Whether an `up` invocation asks for a TLS broker. */
|
|
116
103
|
export function requestsTls(values) {
|
|
117
104
|
return values["tls-cert"] !== undefined || values["tls-key"] !== undefined || namesTlsServer(values);
|
|
@@ -236,7 +223,7 @@ function stackPreflight({ root, space, noManager, invokedRoot, manifest }, recor
|
|
|
236
223
|
if (held.length && held.length === legacy.length) {
|
|
237
224
|
const cmd = displayCmd();
|
|
238
225
|
const retryRoot = invokedRoot !== undefined && invokedRoot !== root ? ` --root ${shellWord(root)}` : "";
|
|
239
|
-
const retry = noManager ? `${cmd} up --space ${shellWord(space)} --no-manager${retryRoot}` : `${cmd} up`;
|
|
226
|
+
const retry = noManager || retryRoot ? `${cmd} up --space ${shellWord(space)}${noManager ? " --no-manager" : ""}${retryRoot}` : `${cmd} up`;
|
|
240
227
|
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", `${held.map((row) => `the ${row.definition} service of this space runs this root's ${row.record.name} (pid ${row.record.pid}, instance ${row.instanceId})`).join("; ")}, outside the controller stack, which neither adopts nor replaces it`, {
|
|
241
228
|
target: { root, space, processes: legacy, services: held.map((row) => ({ definition: row.definition, instanceId: row.instanceId })) },
|
|
242
229
|
remedy: `stop ${held.length === 1 ? "it" : "each"} with ${held.map((row) => codeSpan(`${cmd} svc stop ${row.definition} --instance ${row.instanceId} --space ${shellWord(space)} --yes`)).join(", ")}, then run ${codeSpan(retry)} again`,
|
|
@@ -371,9 +358,9 @@ export function keptOnUp(space, kept) {
|
|
|
371
358
|
? `"${space}" up; commands here still target the selected space "${kept}" - use --space ${space} or \`cotal use --clear\` to reach this folder's space`
|
|
372
359
|
: `"${space}" up; "${kept}" stays automatically selected outside this folder - \`cotal use ${space}\` selects this space in every folder`;
|
|
373
360
|
}
|
|
374
|
-
/** `cotal up`'s controller route: start, seed the default persona into the root, then
|
|
375
|
-
*
|
|
376
|
-
*
|
|
361
|
+
/** `cotal up`'s controller route: start, seed the default persona into the root, then prepare its
|
|
362
|
+
* receipt, which the caller prints after releasing the startup lock. A persona that cannot be
|
|
363
|
+
* written, or saved services that cannot be listed, is a warning. */
|
|
377
364
|
export async function stackUp(request, native) {
|
|
378
365
|
const before = usableSelection();
|
|
379
366
|
const { journal, changed, allReused, admittedRestore, settled, brokerExecutable, streamsRecreated, rotation, storeShared, storeWarnings, clearedRecords } = await startControllerStack(request, native);
|
|
@@ -419,7 +406,10 @@ export async function stackUp(request, native) {
|
|
|
419
406
|
catch (error) {
|
|
420
407
|
warnings.push({ code: "SAVED_SERVICES_NOT_READ", target: { root, space }, message: `the saved services of ${space} could not be listed: ${error.message}` });
|
|
421
408
|
}
|
|
422
|
-
|
|
409
|
+
const listeners = stackListeners(journal);
|
|
410
|
+
const elsewhere = request.invokedRoot !== undefined && request.invokedRoot !== canonicalRoot(root);
|
|
411
|
+
const brokerPayload = request.maxPayload ?? (request.presentation === "json" ? undefined : readBrokerPolicy(root)?.maxPayload);
|
|
412
|
+
const writeReceipt = () => writeResult(request.presentation, { command: "up", target: { root, space, server }, result: { kind: "controller-stack-up", root, space, server, mode, operation: journal.operation, members: journal.members, changed, foreground: request.foreground, admittedRestore: admittedRestore ?? null, settledOperation: settled ?? null, brokerExecutable: brokerExecutable ?? null, streamsRecreated: streamsRecreated === true, rotatedSystemAccount: rotation ?? null, listeners, written, savedServices, inheritedServices, selection: { current: current ?? null, changed: current === space && before !== space } }, warnings, ...(allReused && written.length === 0 && !streamsRecreated ? { noOp: true } : {}) }, (result) => {
|
|
423
413
|
const members = membersView({ ...journal, members: result.members }, allReused ? "Controller stack already running" : "Controller stack started", result.brokerExecutable, result.streamsRecreated);
|
|
424
414
|
const exposed = result.listeners && exposedPlaintext(result.listeners);
|
|
425
415
|
const listening = [{ title: "Listeners", blocks: [
|
|
@@ -427,12 +417,9 @@ export async function stackUp(request, native) {
|
|
|
427
417
|
...(exposed ? [{ kind: "lines", lines: [{ text: exposed, tone: "waiting" }] }] : []),
|
|
428
418
|
] }];
|
|
429
419
|
const view = { ...members, sections: [...members.sections, ...listening, ...(result.written.length ? [{ blocks: [{ kind: "fields", rows: result.written.map((w) => ["wrote", `${w.what}: ${w.path}`]) }] }] : [])] };
|
|
430
|
-
// `down` stops only the stack of the folder it runs in, so from another folder the Next says where.
|
|
431
|
-
const elsewhere = request.invokedRoot !== undefined && request.invokedRoot !== canonicalRoot(root);
|
|
432
420
|
// The payload limit is fixed at the broker's start, so a bare up cannot add a manager to a
|
|
433
421
|
// broker-only stack whose limit is below the floor the manager starts on: the Next names the
|
|
434
422
|
// stop and restart that can, instead of the bare up that would refuse.
|
|
435
|
-
const brokerPayload = request.maxPayload ?? readBrokerPolicy(root)?.maxPayload;
|
|
436
423
|
const managerBelowFloor = !managed && brokerPayload !== undefined && brokerPayload < MANAGER_START_PAYLOAD_FLOOR;
|
|
437
424
|
const next = request.foreground ? [] : [{ title: "Next", blocks: [{ kind: "commands", items: [
|
|
438
425
|
// A bare spawn targets the selected space, which this up does not change when one is set.
|
|
@@ -452,6 +439,7 @@ export async function stackUp(request, native) {
|
|
|
452
439
|
] }] : [];
|
|
453
440
|
return { ...view, sections: [...view.sections, ...rotated, ...(admittedRestore ? [{ title: "Retained restore journal", blocks: [{ kind: "lines", lines: [`Active restore ${admittedRestore} stays in this root's maintenance journal. It was read and not changed.`] }] }] : []), ...saved, ...kept, ...next] };
|
|
454
441
|
});
|
|
442
|
+
return { journal, writeReceipt };
|
|
455
443
|
}
|
|
456
444
|
/** The refusal of an up whose running broker disabled JetStream after a store write failure: no
|
|
457
445
|
* stream check or later member start reaches it. Undefined for an error already classified. */
|
|
@@ -464,7 +452,7 @@ function reusedWithoutJetStream(caught, brokerReused, root, space) {
|
|
|
464
452
|
const manager = serviceInstances(space, STACK_DEFINITION.manager).map((row) => row.record.value).find((value) => observeServiceProcess(value) === "running");
|
|
465
453
|
return jetStreamDisabledRefusal(disabled, root, space, "up cannot check the space's streams on it", "its running members were left as they are", { root, space }, manager?.process?.pid);
|
|
466
454
|
}
|
|
467
|
-
/** What holds a
|
|
455
|
+
/** What holds a stack's recorded broker address, as bare up's own bind check finds it, with
|
|
468
456
|
* the listening processes of this account named. Undefined while the address is free, could not be
|
|
469
457
|
* checked, or this stack's broker runs there. */
|
|
470
458
|
async function recordedAddressHeld(space, server, bindHost) {
|
|
@@ -483,21 +471,25 @@ async function recordedAddressHeld(space, server, bindHost) {
|
|
|
483
471
|
});
|
|
484
472
|
return holders.length ? { says: `${held.says}, where process ${holders.join(", ")} of this account listens`, frees: held.frees } : held;
|
|
485
473
|
}
|
|
486
|
-
/** The live address blocker for a stopped
|
|
487
|
-
export async function
|
|
474
|
+
/** The live address blocker for a stopped stack or refused first start at its recorded broker address. */
|
|
475
|
+
export async function stackStartAddressProblem(root, space, server) {
|
|
488
476
|
try {
|
|
489
477
|
const journal = readStackJournal(root)?.journal;
|
|
490
|
-
if (journal?.space !== space)
|
|
478
|
+
if (journal?.space !== space || (server !== undefined && brokerUrlKey(server) !== brokerUrlKey(journal.server)))
|
|
491
479
|
return undefined;
|
|
492
480
|
const { kind, phase } = journal.operation;
|
|
493
481
|
const cleanStop = kind === "down" && phase === "completed";
|
|
494
|
-
const
|
|
482
|
+
const refusedStart = kind === "up" && phase === "refused"
|
|
495
483
|
&& journal.members.some((row) => row.role === "broker" && row.state === "refused");
|
|
496
|
-
if (!cleanStop && !
|
|
484
|
+
if (!cleanStop && !refusedStart)
|
|
497
485
|
return undefined;
|
|
498
486
|
const held = await recordedAddressHeld(space, journal.server, journal.broker?.host);
|
|
499
487
|
if (!held)
|
|
500
488
|
return undefined;
|
|
489
|
+
if (refusedStart && stackNeverStarted(journal)) {
|
|
490
|
+
const retry = await retryStackAddress(["--foreground"], root, journal.server, journal.broker?.host ?? brokerListenAddress(journal.server).host);
|
|
491
|
+
return { message: held.says, remedy: `${retry ? `${retry}, or ` : ""}${held.frees}, then run ${codeSpan(`${displayCmd()} up`)} in ${root}` };
|
|
492
|
+
}
|
|
501
493
|
const noManager = journal.members.some((row) => row.role === "manager" && row.state === "not-attempted" && (cleanStop || row.instanceId === null));
|
|
502
494
|
const restart = `${displayCmd()} up${noManager ? " --no-manager" : ""}`;
|
|
503
495
|
return { message: held.says, remedy: `${held.frees}, then run ${codeSpan(restart)} in ${root}; this stack keeps its recorded address` };
|
|
@@ -813,7 +805,7 @@ export async function startControllerStack(request, native) {
|
|
|
813
805
|
// A member stop an earlier down could not confirm in time is settled from its own receipt first.
|
|
814
806
|
if (previous)
|
|
815
807
|
await settleRetainedStackStops(previous.journal);
|
|
816
|
-
const { snapshot: current, settled } = previous ? settleStackOperation(request.maintenanceLock, previous) : { snapshot: undefined, settled: undefined };
|
|
808
|
+
const { snapshot: current, settled } = previous ? settleStackOperation(request.maintenanceLock, previous, request.invokedRoot) : { snapshot: undefined, settled: undefined };
|
|
817
809
|
if (current && stackOperationUnsettled(current.journal))
|
|
818
810
|
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "an earlier preserve or resume on this root has no settled outcome; it is decided by its own maintenance attempt and no member was started", { target: { root, space, operation: current.journal.operation }, remedy: `inspect the root's maintenance attempt and the stack's members with \`cotal service --space ${space}\` before another whole-stack operation` });
|
|
819
811
|
const server = previous?.journal.server ?? request.server;
|