@cotal-ai/cli 0.165.3 → 0.165.4
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 +9 -4
- package/dist/command.js.map +1 -1
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +2 -2
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/mint.js +1 -1
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/persona-remote.d.ts.map +1 -1
- package/dist/commands/persona-remote.js +5 -2
- package/dist/commands/persona-remote.js.map +1 -1
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +17 -7
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/up.d.ts +1 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +13 -14
- package/dist/commands/up.js.map +1 -1
- package/dist/lib/credential-authority.d.ts +2 -2
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +4 -4
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/manager-proc.d.ts +1 -1
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +12 -2
- package/dist/lib/manager-proc.js.map +1 -1
- package/package.json +4 -4
package/dist/commands/up.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAuBA,OAAO,EAaL,KAAK,eAAe,EAoCpB,KAAK,YAAY,EAIjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAoEL,KAA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AAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsD3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnF;AAED;;;;;;;;;;GAUG;AACH,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAExC;;mCAEmC;AACnC,eAAO,MAAM,oBAAoB,GAAI,GAAG,SAAS,EAAE,YAAY,UAAU,KAAG,IAAoC,CAAC"}
|
package/dist/commands/up.js
CHANGED
|
@@ -221,13 +221,10 @@ export function validateUpArguments(args) {
|
|
|
221
221
|
if (args.values.file !== undefined || args.values.restore !== undefined)
|
|
222
222
|
throw new CommandFailure("refused", "USAGE_INVALID", `--auth-timeout cannot be combined with ${args.values.file !== undefined ? "--file/-f" : "--restore"}, which starts the broker its own record describes; nothing was started`, { remedy: "start it without --auth-timeout; a recorded timeout is rendered again" });
|
|
223
223
|
}
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
// record describes, so none of the three takes the flag.
|
|
224
|
+
// Both broker modes render the payload limit. A manifest or a restore starts the broker its own
|
|
225
|
+
// record describes, so neither takes the flag.
|
|
227
226
|
const requestedPayload = parseMaxPayload(args.values["max-payload"]);
|
|
228
227
|
if (requestedPayload !== undefined) {
|
|
229
|
-
if (args.values.open === true)
|
|
230
|
-
throw new CommandFailure("refused", "USAGE_INVALID", "--max-payload sets the broker's message size limit, which the open broker configuration does not render; nothing was started", { remedy: "drop --max-payload, or start an auth space without --open" });
|
|
231
228
|
if (args.values.file !== undefined || args.values.restore !== undefined)
|
|
232
229
|
throw new CommandFailure("refused", "USAGE_INVALID", `--max-payload cannot be combined with ${args.values.file !== undefined ? "--file/-f" : "--restore"}, which starts the broker its own record describes; nothing was started`, { remedy: "start it without --max-payload; a recorded limit is rendered again" });
|
|
233
230
|
// A space that admits service endpoints is a space whose auth host asserts the caller payload
|
|
@@ -2224,12 +2221,13 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
|
|
|
2224
2221
|
// the server, and the hostname is what the certificate has to match).
|
|
2225
2222
|
assertServesDialHost(transport, new URL(server).hostname);
|
|
2226
2223
|
const setup = useAuth ? await authSetup(storeDir, server, space, host, wantUser ? { idpUrl: values.idp } : undefined, transport, values["rotate-sys"], maxFileStore, false, { authTimeout, maxPayload, accountResolver, manager: values["no-manager"] !== true }) : undefined;
|
|
2224
|
+
const brokerMaxPayload = setup?.maxPayload ?? maxPayload ?? readBrokerPolicy(cotalRoot())?.maxPayload;
|
|
2227
2225
|
const port = Number(new URL(server).port) || 4222;
|
|
2228
2226
|
// Both modes go through a RENDERER, never bare CLI flags. Open mode used to start from
|
|
2229
2227
|
// `-js -sd … -p … -a …`, which never called a renderer at all — so the required transport union
|
|
2230
2228
|
// protected the auth path and was silent on the open one, and a cert/key pair passed to an
|
|
2231
2229
|
// open-mode `up` would have been accepted while the listener came up in cleartext.
|
|
2232
|
-
const confPath = setup ? setup.confPath : writeOpenBrokerConf(storeDir, space, { port, host, transport, maxFileStore });
|
|
2230
|
+
const confPath = setup ? setup.confPath : writeOpenBrokerConf(storeDir, space, { port, host, transport, maxFileStore, maxPayload: brokerMaxPayload });
|
|
2233
2231
|
const natsArgs = [
|
|
2234
2232
|
"-c", confPath,
|
|
2235
2233
|
...(boundListener ? ["--name", boundListener.serverName] : []),
|
|
@@ -2422,7 +2420,7 @@ async function runUp(args, inheritedLock, onAdopt, freshTeamBoot = false, restor
|
|
|
2422
2420
|
})();
|
|
2423
2421
|
};
|
|
2424
2422
|
const { authService, controlPlane } = await serveReadyListener({
|
|
2425
|
-
child, server, space, storeDir, setup, seedFile, transport,
|
|
2423
|
+
child, server, space, storeDir, setup, seedFile, transport, maxPayload: brokerMaxPayload,
|
|
2426
2424
|
...(values["recreate-issued-stores"] !== undefined ? { recreateIssuedStores: resolve(values["recreate-issued-stores"]) } : {}),
|
|
2427
2425
|
...(values["recreate-membership-store"] ? { recreateMembershipStore: true } : {}),
|
|
2428
2426
|
host: values.host,
|
|
@@ -3401,7 +3399,7 @@ export function controllerStackNative() {
|
|
|
3401
3399
|
return {
|
|
3402
3400
|
prepareBroker: async (opts) => {
|
|
3403
3401
|
const prepared = await prepareBrokerStart({ transport: opts.transport, server: opts.server, space: opts.space, ...(opts.open ? { open: true } : {}), ...(opts.userAuth ? { userAuth: opts.userAuth } : {}), ...(opts.host ? { host: opts.host } : {}), ...(opts.storeDir ? { storeDir: opts.storeDir } : {}), ...(opts.existingStore ? { existingStore: opts.existingStore } : {}), ...(opts.maxFileStore !== undefined ? { maxFileStore: opts.maxFileStore } : {}), ...(opts.logFile !== undefined ? { logFile: opts.logFile } : {}), ...(opts.logfileSizeLimit !== undefined ? { logfileSizeLimit: opts.logfileSizeLimit } : {}), ...(opts.logfileMaxNum !== undefined ? { logfileMaxNum: opts.logfileMaxNum } : {}), ...(opts.authTimeout !== undefined ? { authTimeout: opts.authTimeout } : {}), ...(opts.maxPayload !== undefined ? { maxPayload: opts.maxPayload } : {}), ...(opts.accountResolver !== undefined ? { accountResolver: opts.accountResolver } : {}), ...(opts.noManager ? { noManager: true } : {}), ...(opts.seed !== undefined ? { seed: opts.seed } : opts.channels ? { channels: opts.channels } : {}), quietBoot: true });
|
|
3404
|
-
return { root: prepared.root, server: prepared.server, space: prepared.space, storeDir: prepared.storeDir, transport: prepared.transport, ...(prepared.setup ? { setup: { creds: prepared.setup.creds, wsPort: prepared.setup.wsPort } } : {}), ...(prepared.setup?.prepared && prepared.setup.stateDir ? { user: { prepared: prepared.setup.prepared, stateDir: prepared.setup.stateDir } } : {}), confPath: prepared.confPath, bin: prepared.bin, source: prepared.source, version: prepared.version, seedFile: prepared.seedFile, ...(prepared.setup?.authTimeout !== undefined ? { authTimeout: prepared.setup.authTimeout } : {}), ...(prepared.
|
|
3402
|
+
return { root: prepared.root, server: prepared.server, space: prepared.space, storeDir: prepared.storeDir, transport: prepared.transport, ...(prepared.setup ? { setup: { creds: prepared.setup.creds, wsPort: prepared.setup.wsPort } } : {}), ...(prepared.setup?.prepared && prepared.setup.stateDir ? { user: { prepared: prepared.setup.prepared, stateDir: prepared.setup.stateDir } } : {}), confPath: prepared.confPath, bin: prepared.bin, source: prepared.source, version: prepared.version, seedFile: prepared.seedFile, ...(prepared.setup?.authTimeout !== undefined ? { authTimeout: prepared.setup.authTimeout } : {}), ...(prepared.maxPayload !== undefined ? { maxPayload: prepared.maxPayload } : {}), ...(prepared.setup?.accountResolver !== undefined ? { accountResolver: prepared.setup.accountResolver } : {}) };
|
|
3405
3403
|
},
|
|
3406
3404
|
initializeStreams: (server, space, setup, seedFile, recreateIssuedStores, recreateMembershipStore) => postStart(server, space, setup, seedFile, recreateIssuedStores, recreateMembershipStore, true),
|
|
3407
3405
|
recreateDeletedStreams: ({ seed, ...opts }) => recreateDeletedStreams({ ...opts, ...(seed !== undefined ? { seed: seed } : {}) }),
|
|
@@ -3977,7 +3975,7 @@ async function serveReadyListener(l) {
|
|
|
3977
3975
|
// Commit the policy only for a listener that is up and recorded (S5), and before the control
|
|
3978
3976
|
// plane (S9). startDeliveryWithBroker is HANDED the transport decision, so it does not depend on
|
|
3979
3977
|
// the file at all.
|
|
3980
|
-
commitTransportPolicy(cotalRoot(), transport, l.quietBoot, server, { authTimeout: setup?.authTimeout, maxPayload: setup?.maxPayload, accountResolver: setup?.accountResolver });
|
|
3978
|
+
commitTransportPolicy(cotalRoot(), transport, l.quietBoot, server, { authTimeout: setup?.authTimeout, maxPayload: l.maxPayload ?? setup?.maxPayload, accountResolver: setup?.accountResolver });
|
|
3981
3979
|
// An open mesh has no delivery daemon. Its mode is passed down because the root can still hold a
|
|
3982
3980
|
// static stack's accounts. Class-2 credential renewal is NOT wired here: the MANAGER is the
|
|
3983
3981
|
// renewal owner (it is resident in every mesh mode, where a foreground `up` process is not).
|
|
@@ -4052,10 +4050,11 @@ export async function prepareBrokerStart(opts) {
|
|
|
4052
4050
|
}
|
|
4053
4051
|
}
|
|
4054
4052
|
const setup = useAuth ? await authSetup(storeDir, server, space, host, opts.userAuth, transport, opts.rotateSys, opts.maxFileStore, opts.quietBoot, { authTimeout: opts.authTimeout, maxPayload: opts.maxPayload, accountResolver: opts.accountResolver, manager: opts.noManager !== true, logFile, logfileSizeLimit: opts.logfileSizeLimit, logfileMaxNum: opts.logfileMaxNum }) : undefined;
|
|
4053
|
+
const maxPayload = setup?.maxPayload ?? opts.maxPayload ?? readBrokerPolicy(root)?.maxPayload;
|
|
4055
4054
|
const port = Number(new URL(server).port) || 4222;
|
|
4056
4055
|
// Same rule as the foreground path: every route to a listener names its transport (see
|
|
4057
4056
|
// `writeOpenBrokerConf`). Detach must not be the mode where the fence quietly does not apply.
|
|
4058
|
-
const confPath = setup ? setup.confPath : writeOpenBrokerConf(storeDir, space, { port, host, transport, maxFileStore: opts.maxFileStore, logFile, logfileSizeLimit: opts.logfileSizeLimit, logfileMaxNum: opts.logfileMaxNum });
|
|
4057
|
+
const confPath = setup ? setup.confPath : writeOpenBrokerConf(storeDir, space, { port, host, transport, maxFileStore: opts.maxFileStore, maxPayload, logFile, logfileSizeLimit: opts.logfileSizeLimit, logfileMaxNum: opts.logfileMaxNum });
|
|
4059
4058
|
// Trust preparation awaits; the pinned store is checked again before its config is handed back.
|
|
4060
4059
|
if (opts.existingStore)
|
|
4061
4060
|
recheckExistingStore(opts.existingStore, { space, storeDir });
|
|
@@ -4064,7 +4063,7 @@ export async function prepareBrokerStart(opts) {
|
|
|
4064
4063
|
...(opts.boundListener ? ["--name", opts.boundListener.serverName] : []),
|
|
4065
4064
|
];
|
|
4066
4065
|
const { path: bin, source, version } = await resolveNatsServer();
|
|
4067
|
-
return { root, server, space, useAuth, storeDir, seedFile, host, transport, setup, confPath, args, bin, source, version };
|
|
4066
|
+
return { root, server, space, useAuth, storeDir, seedFile, host, transport, setup, maxPayload, confPath, args, bin, source, version };
|
|
4068
4067
|
}
|
|
4069
4068
|
/**
|
|
4070
4069
|
* Open the detached broker's log with {@link openPrivateAppend}: created `0600` whatever the umask,
|
|
@@ -4090,7 +4089,7 @@ export async function startMeshDetached(
|
|
|
4090
4089
|
// The `= {}` default is gone with the optional transport: an options object that can be omitted
|
|
4091
4090
|
// entirely cannot carry a mandatory decision.
|
|
4092
4091
|
opts) {
|
|
4093
|
-
const { server, space, useAuth, storeDir, seedFile, transport, setup, args, bin, source, version } = await prepareBrokerStart(opts);
|
|
4092
|
+
const { server, space, useAuth, storeDir, seedFile, transport, setup, maxPayload, args, bin, source, version } = await prepareBrokerStart(opts);
|
|
4094
4093
|
await seedBeforeLaunch();
|
|
4095
4094
|
const logPath = cotalPath("nats.log");
|
|
4096
4095
|
const fd = openBrokerLog(logPath);
|
|
@@ -4106,7 +4105,7 @@ opts) {
|
|
|
4106
4105
|
child.unref();
|
|
4107
4106
|
await awaitSpawnedListener({ child, executable: { path: bin, source, version }, server, space, creds: setup?.creds, tls: transport.kind === "tls-required", log: logPath, boundListener: opts.boundListener });
|
|
4108
4107
|
const { authService, controlPlane } = await serveReadyListener({
|
|
4109
|
-
child, server, space, storeDir, setup, seedFile, transport,
|
|
4108
|
+
child, server, space, storeDir, setup, seedFile, transport, maxPayload,
|
|
4110
4109
|
...(opts.recreateIssuedStores !== undefined ? { recreateIssuedStores: opts.recreateIssuedStores } : {}),
|
|
4111
4110
|
...(opts.recreateMembershipStore ? { recreateMembershipStore: true } : {}),
|
|
4112
4111
|
host: opts.host,
|
|
@@ -5367,7 +5366,7 @@ function checkStartStore(storeDir, space) {
|
|
|
5367
5366
|
*/
|
|
5368
5367
|
function writeOpenBrokerConf(storeDir, space, opts) {
|
|
5369
5368
|
const confPath = cotalPath("server-open.conf");
|
|
5370
|
-
writeBrokerConfig(confPath, namedOpenConfig(openServerConfig({ port: opts.port, host: opts.host, storeDir: configuredStoreDir(cotalRoot(), storeDir), maxFileStore: opts.maxFileStore, logFile: opts.logFile, logfileSizeLimit: opts.logfileSizeLimit, logfileMaxNum: opts.logfileMaxNum, transport: opts.transport }), space));
|
|
5369
|
+
writeBrokerConfig(confPath, namedOpenConfig(openServerConfig({ port: opts.port, host: opts.host, storeDir: configuredStoreDir(cotalRoot(), storeDir), maxFileStore: opts.maxFileStore, maxPayload: opts.maxPayload, logFile: opts.logFile, logfileSizeLimit: opts.logfileSizeLimit, logfileMaxNum: opts.logfileMaxNum, transport: opts.transport }), space));
|
|
5371
5370
|
return confPath;
|
|
5372
5371
|
}
|
|
5373
5372
|
/** Write a broker configuration that `up` renders again on every start. Something other than this
|