@stigmer/cli 3.12.9 → 3.14.0-dev.20260910084630
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/auth/login.d.ts.map +1 -1
- package/auth/login.js +30 -5
- package/auth/login.js.map +1 -1
- package/auth/token.d.ts +10 -5
- package/auth/token.d.ts.map +1 -1
- package/auth/token.js +30 -21
- package/auth/token.js.map +1 -1
- package/commands/apikey/index.d.ts.map +1 -1
- package/commands/apikey/index.js +11 -5
- package/commands/apikey/index.js.map +1 -1
- package/commands/auth/index.d.ts.map +1 -1
- package/commands/auth/index.js +19 -8
- package/commands/auth/index.js.map +1 -1
- package/commands/config/backend.d.ts.map +1 -1
- package/commands/config/backend.js +134 -12
- package/commands/config/backend.js.map +1 -1
- package/commands/connect.d.ts.map +1 -1
- package/commands/connect.js +6 -3
- package/commands/connect.js.map +1 -1
- package/commands/share.d.ts.map +1 -1
- package/commands/share.js +8 -6
- package/commands/share.js.map +1 -1
- package/commands/up.d.ts.map +1 -1
- package/commands/up.js +22 -6
- package/commands/up.js.map +1 -1
- package/config/config.d.ts +56 -7
- package/config/config.d.ts.map +1 -1
- package/config/config.js +115 -16
- package/config/config.js.map +1 -1
- package/config/index.d.ts +1 -1
- package/config/index.d.ts.map +1 -1
- package/config/index.js +1 -1
- package/config/index.js.map +1 -1
- package/config/keys.d.ts +1 -1
- package/config/keys.d.ts.map +1 -1
- package/config/keys.js +29 -6
- package/config/keys.js.map +1 -1
- package/config/resolve.d.ts +32 -21
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js +80 -39
- package/config/resolve.js.map +1 -1
- package/local/constants.d.ts +8 -3
- package/local/constants.d.ts.map +1 -1
- package/local/constants.js +8 -3
- package/local/constants.js.map +1 -1
- package/local/daemon/components.d.ts.map +1 -1
- package/local/daemon/components.js +4 -2
- package/local/daemon/components.js.map +1 -1
- package/local/daemon/env.d.ts +16 -3
- package/local/daemon/env.d.ts.map +1 -1
- package/local/daemon/env.js +16 -3
- package/local/daemon/env.js.map +1 -1
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js +5 -4
- package/local/daemon/launch.js.map +1 -1
- package/local/daemon/process.d.ts.map +1 -1
- package/local/daemon/process.js +8 -5
- package/local/daemon/process.js.map +1 -1
- package/local/runtime/index.d.ts +2 -2
- package/local/runtime/index.d.ts.map +1 -1
- package/local/runtime/index.js +4 -2
- package/local/runtime/index.js.map +1 -1
- package/local/runtime/node.d.ts +8 -0
- package/local/runtime/node.d.ts.map +1 -1
- package/local/runtime/node.js +74 -23
- package/local/runtime/node.js.map +1 -1
- package/local/runtime/runner.d.ts +2 -1
- package/local/runtime/runner.d.ts.map +1 -1
- package/local/runtime/runner.js +4 -31
- package/local/runtime/runner.js.map +1 -1
- package/local/runtime/runtimes-install.d.ts +13 -0
- package/local/runtime/runtimes-install.d.ts.map +1 -0
- package/local/runtime/runtimes-install.js +60 -0
- package/local/runtime/runtimes-install.js.map +1 -0
- package/local/runtime/server.d.ts +26 -30
- package/local/runtime/server.d.ts.map +1 -1
- package/local/runtime/server.js +106 -108
- package/local/runtime/server.js.map +1 -1
- package/local/seedpack/content.d.ts +3 -3
- package/local/seedpack/content.d.ts.map +1 -1
- package/local/seedpack/content.js +19 -13
- package/local/seedpack/content.js.map +1 -1
- package/local/status.d.ts.map +1 -1
- package/local/status.js +4 -2
- package/local/status.js.map +1 -1
- package/local/webconsole/index.d.ts +2 -3
- package/local/webconsole/index.d.ts.map +1 -1
- package/local/webconsole/index.js +24 -10
- package/local/webconsole/index.js.map +1 -1
- package/package.json +5 -5
- package/resources/connect/connect.d.ts +4 -3
- package/resources/connect/connect.d.ts.map +1 -1
- package/resources/connect/connect.js +17 -5
- package/resources/connect/connect.js.map +1 -1
- package/resources/connect/oauth.d.ts +5 -2
- package/resources/connect/oauth.d.ts.map +1 -1
- package/resources/connect/oauth.js +5 -4
- package/resources/connect/oauth.js.map +1 -1
- package/src/auth/login.ts +54 -9
- package/src/auth/token.test.ts +69 -13
- package/src/auth/token.ts +46 -22
- package/src/client/client.test.ts +10 -2
- package/src/commands/apikey/index.ts +42 -11
- package/src/commands/auth/index.ts +52 -14
- package/src/commands/config/backend.test.ts +122 -0
- package/src/commands/config/backend.ts +195 -14
- package/src/commands/connect.test.ts +22 -4
- package/src/commands/connect.ts +37 -13
- package/src/commands/share.ts +36 -16
- package/src/commands/up.ts +24 -6
- package/src/config/config.test.ts +62 -6
- package/src/config/config.ts +165 -24
- package/src/config/index.ts +6 -0
- package/src/config/keys.test.ts +27 -4
- package/src/config/keys.ts +46 -9
- package/src/config/resolve.test.ts +135 -34
- package/src/config/resolve.ts +88 -38
- package/src/local/constants.ts +8 -4
- package/src/local/daemon/components.test.ts +9 -1
- package/src/local/daemon/components.ts +4 -2
- package/src/local/daemon/daemon.integration.test.ts +1 -1
- package/src/local/daemon/env.test.ts +15 -4
- package/src/local/daemon/env.ts +33 -5
- package/src/local/daemon/launch.ts +5 -4
- package/src/local/daemon/process.ts +7 -4
- package/src/local/runtime/index.ts +6 -5
- package/src/local/runtime/node.ts +99 -23
- package/src/local/runtime/runner.ts +5 -36
- package/src/local/runtime/runtime.test.ts +58 -14
- package/src/local/runtime/runtimes-install.test.ts +56 -0
- package/src/local/runtime/runtimes-install.ts +72 -0
- package/src/local/runtime/server.test.ts +178 -114
- package/src/local/runtime/server.ts +149 -129
- package/src/local/seedpack/content.ts +52 -21
- package/src/local/status.ts +4 -2
- package/src/local/webconsole/index.ts +27 -10
- package/src/resources/connect/connect.integration.test.ts +79 -26
- package/src/resources/connect/connect.ts +72 -19
- package/src/resources/connect/oauth.test.ts +38 -12
- package/src/resources/connect/oauth.ts +27 -11
- package/src/resources/share.test.ts +2 -2
package/commands/share.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/commands/share.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/commands/share.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwBpD"}
|
package/commands/share.js
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
// best-effort browser launch after render (mirrors auth login: the URL is
|
|
7
7
|
// already on screen, so a failed launch costs nothing). Heavy modules are
|
|
8
8
|
// lazy-imported so `--help` stays fast (DD-001).
|
|
9
|
-
import { ensureAuthenticated, resolveConsoleURL, resolveOrganization } from "../config/index.js";
|
|
9
|
+
import { activeBackend, ensureAuthenticated, resolveConsoleURL, resolveOrganization, } from "../config/index.js";
|
|
10
10
|
import { UsageError } from "../errors/index.js";
|
|
11
11
|
import { addResultFlags, globalOrg, resultFormat } from "./shared.js";
|
|
12
12
|
export function registerShare(program) {
|
|
13
|
-
const share = program
|
|
13
|
+
const share = program
|
|
14
|
+
.command("share")
|
|
15
|
+
.description("share resources via a hosted link");
|
|
14
16
|
const agent = share
|
|
15
17
|
.command("agent <ref>")
|
|
16
18
|
.description("enable sharing for an agent and print its chat link and embed snippet")
|
|
@@ -39,8 +41,7 @@ async function runShareAgent(ref, options, command) {
|
|
|
39
41
|
const client = connectBackend();
|
|
40
42
|
ensureAuthenticated(client.config);
|
|
41
43
|
const org = resolveOrganization(client.config, globalOrg(command));
|
|
42
|
-
const
|
|
43
|
-
const appOrigin = resolveConsoleURL(backendType);
|
|
44
|
+
const appOrigin = resolveConsoleURL(client.config);
|
|
44
45
|
const enabled = options.off !== true;
|
|
45
46
|
const audience = parseAudience(options.audience);
|
|
46
47
|
const resetLink = options.resetLink === true;
|
|
@@ -54,13 +55,14 @@ async function runShareAgent(ref, options, command) {
|
|
|
54
55
|
...(audience !== undefined ? { audience } : {}),
|
|
55
56
|
resetLink,
|
|
56
57
|
appOrigin,
|
|
57
|
-
isLocal:
|
|
58
|
+
isLocal: activeBackend(client.config).entry === undefined,
|
|
58
59
|
});
|
|
59
60
|
renderResult(result, format);
|
|
60
61
|
if (options.open === true && enabled) {
|
|
61
62
|
// Best-effort: the link is already rendered above, so a launch failure
|
|
62
63
|
// only needs a nudge, never an error exit (mirrors auth login).
|
|
63
|
-
const url = result.sections.find((s) => s.title.endsWith("chat link"))
|
|
64
|
+
const url = result.sections.find((s) => s.title.endsWith("chat link"))
|
|
65
|
+
?.items[0];
|
|
64
66
|
if (url !== undefined) {
|
|
65
67
|
try {
|
|
66
68
|
const { default: open } = await import("open");
|
package/commands/share.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share.js","sourceRoot":"","sources":["../../src/commands/share.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,0EAA0E;AAC1E,iDAAiD;AAGjD,OAAO,
|
|
1
|
+
{"version":3,"file":"share.js","sourceRoot":"","sources":["../../src/commands/share.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,0EAA0E;AAC1E,iDAAiD;AAGjD,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAStE,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,KAAK,GAAG,OAAO;SAClB,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,mCAAmC,CAAC,CAAC;IAEpD,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,CA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B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yEAAyE,CAC1E,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/commands/up.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBjD"}
|
package/commands/up.js
CHANGED
|
@@ -5,24 +5,27 @@
|
|
|
5
5
|
// Thin handler: parse flags, delegate to the local daemon launcher, render the
|
|
6
6
|
// outcome. The launcher (and the heavy resolvers it pulls in) load lazily so
|
|
7
7
|
// `--help` stays fast (DD-001).
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
8
10
|
import { CommandResult, renderResult } from "../output/index.js";
|
|
9
|
-
import { SERVER_PORT } from "../local/constants.js";
|
|
11
|
+
import { HEALTH_STATE_FILE, SERVER_PORT } from "../local/constants.js";
|
|
10
12
|
import { addResultFlags, resultFormat } from "./shared.js";
|
|
13
|
+
// The server serves the web console from its unified port (DD-012); the
|
|
14
|
+
// flag suppresses probing/reporting it, not the serving itself (one
|
|
15
|
+
// process, one origin — there is no separate console to not-start).
|
|
16
|
+
const NO_WEB_HELP = "don't report the web console URL";
|
|
11
17
|
export function registerUp(program) {
|
|
12
18
|
const up = program
|
|
13
19
|
.command("up")
|
|
14
20
|
.description("start the local Stigmer stack (server, runner, Temporal)")
|
|
15
21
|
.option("--server-only", "start only the control plane (no runners)")
|
|
16
|
-
|
|
17
|
-
// local web console, so the stack is headless either way (use the cloud
|
|
18
|
-
// console at app.stigmer.ai for a UI).
|
|
19
|
-
.option("--no-web", "no-op: this CLI does not serve a local web console")
|
|
22
|
+
.option("--no-web", NO_WEB_HELP)
|
|
20
23
|
.action((options) => runUp({ serverOnly: options.serverOnly === true, noWeb: options.web === false }, options));
|
|
21
24
|
addResultFlags(up);
|
|
22
25
|
const server = up
|
|
23
26
|
.command("server")
|
|
24
27
|
.description("start only the control plane (no runners)")
|
|
25
|
-
.option("--no-web",
|
|
28
|
+
.option("--no-web", NO_WEB_HELP)
|
|
26
29
|
.action((options) => runUp({ serverOnly: true, noWeb: options.web === false }, options));
|
|
27
30
|
addResultFlags(server);
|
|
28
31
|
}
|
|
@@ -33,7 +36,20 @@ async function runUp(opts, flags) {
|
|
|
33
36
|
const result = CommandResult.success(opts.serverOnly ? "Stigmer control plane is up" : "Stigmer local stack is up");
|
|
34
37
|
const section = result.addSection("Endpoints");
|
|
35
38
|
section.field("server", `http://localhost:${SERVER_PORT}`);
|
|
39
|
+
if (await consoleReported()) {
|
|
40
|
+
// Same origin as the API: the server serves the console (DD-012). Only
|
|
41
|
+
// printed when the daemon's probe found a bundled export — a dev-tree
|
|
42
|
+
// server without one must not advertise a dead URL.
|
|
43
|
+
section.field("console", `http://localhost:${SERVER_PORT}`);
|
|
44
|
+
}
|
|
36
45
|
result.hint("Check status with: stigmer status").hint("Stop it with: stigmer down");
|
|
37
46
|
renderResult(result, resultFormat(flags));
|
|
38
47
|
}
|
|
48
|
+
/** Whether the daemon recorded the web console as running (its own probe). */
|
|
49
|
+
async function consoleReported() {
|
|
50
|
+
const { dataDir } = await import("../local/paths.js");
|
|
51
|
+
const { loadHealthState } = await import("../local/state/health-state.js");
|
|
52
|
+
const health = loadHealthState(join(dataDir(homedir()), HEALTH_STATE_FILE));
|
|
53
|
+
return health?.components["web-console"]?.state === "running";
|
|
54
|
+
}
|
|
39
55
|
//# sourceMappingURL=up.js.map
|
package/commands/up.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"up.js","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2EAA2E;AAC3E,wDAAwD;AACxD,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,gCAAgC;
|
|
1
|
+
{"version":3,"file":"up.js","sourceRoot":"","sources":["../../src/commands/up.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,2EAA2E;AAC3E,wDAAwD;AACxD,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAoB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3D,wEAAwE;AACxE,oEAAoE;AACpE,oEAAoE;AACpE,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAEvD,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,IAAI,CAAC;SACb,WAAW,CAAC,0DAA0D,CAAC;SACvE,MAAM,CAAC,eAAe,EAAE,2CAA2C,CAAC;SACpE,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC;SAC/B,MAAM,CAAC,CAAC,OAAgB,EAAE,EAAE,CAC3B,KAAK,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,KAAK,EAAE,EAAE,OAAO,CAAC,CAC1F,CAAC;IACJ,cAAc,CAAC,EAAE,CAAC,CAAC;IAEnB,MAAM,MAAM,GAAG,EAAE;SACd,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,2CAA2C,CAAC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E,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC5E,OAAO,MAAM,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,KAAK,KAAK,SAAS,CAAC;AAChE,CAAC"}
|
package/config/config.d.ts
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
+
/** The legacy binary switch, still written as a mirror for older readers. */
|
|
1
2
|
export type BackendType = "local" | "cloud";
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/** The two named-backend families: Stigmer Cloud, or any OSS server. */
|
|
4
|
+
export type NamedBackendType = "cloud" | "selfhost";
|
|
5
|
+
/** The reserved name of the managed local daemon backend. */
|
|
6
|
+
export declare const LOCAL_BACKEND_NAME = "local";
|
|
7
|
+
/** The reserved name `stigmer auth login` targets from local mode. */
|
|
8
|
+
export declare const CLOUD_BACKEND_NAME = "cloud";
|
|
9
|
+
/**
|
|
10
|
+
* One named backend: endpoint + its own credentials. Property names are
|
|
11
|
+
* snake_case to keep the YAML in the file's established dialect.
|
|
12
|
+
*
|
|
13
|
+
* Credential lanes by type:
|
|
14
|
+
* - cloud: the OAuth token set (token / refresh_token / token_expiry),
|
|
15
|
+
* written by `stigmer auth login` and rotated by the token provider.
|
|
16
|
+
* - selfhost: `api_key` — a server-minted `stk_` token
|
|
17
|
+
* (`stigmer apikey create`). Browser login against self-hosted
|
|
18
|
+
* issuers is deliberately not modeled here; the API token is the
|
|
19
|
+
* self-host credential story.
|
|
20
|
+
*/
|
|
21
|
+
export interface NamedBackendConfig {
|
|
22
|
+
type: NamedBackendType;
|
|
23
|
+
endpoint?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
org_id?: string;
|
|
26
|
+
env_id?: string;
|
|
27
|
+
refresh_token?: string;
|
|
28
|
+
token_expiry?: string;
|
|
29
|
+
api_key?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Cloud backend connection — the LEGACY single-slot shape (pre-O3 files). */
|
|
4
32
|
export interface CloudBackendConfig {
|
|
5
33
|
endpoint?: string;
|
|
6
34
|
token?: string;
|
|
@@ -11,9 +39,10 @@ export interface CloudBackendConfig {
|
|
|
11
39
|
}
|
|
12
40
|
export interface BackendConfig {
|
|
13
41
|
type: BackendType;
|
|
14
|
-
/** Local daemon/LLM/Temporal settings — opaque to
|
|
42
|
+
/** Local daemon/LLM/Temporal settings — opaque to this CLI,
|
|
15
43
|
* preserved verbatim across save so coexisting tools keep their config. */
|
|
16
44
|
local?: unknown;
|
|
45
|
+
/** Legacy cloud slot — read for migration, never written back. */
|
|
17
46
|
cloud?: CloudBackendConfig;
|
|
18
47
|
}
|
|
19
48
|
export interface ContextConfig {
|
|
@@ -21,9 +50,11 @@ export interface ContextConfig {
|
|
|
21
50
|
}
|
|
22
51
|
export interface Config {
|
|
23
52
|
backend: BackendConfig;
|
|
53
|
+
backends?: Record<string, NamedBackendConfig>;
|
|
54
|
+
current_backend?: string;
|
|
24
55
|
context?: ContextConfig;
|
|
25
56
|
}
|
|
26
|
-
/** The default config: local backend, no daemon settings fabricated. */
|
|
57
|
+
/** The default config: the local backend, no daemon settings fabricated. */
|
|
27
58
|
export declare function getDefault(): Config;
|
|
28
59
|
/**
|
|
29
60
|
* Load the config from disk. In standalone mode the file is ignored and the
|
|
@@ -31,9 +62,27 @@ export declare function getDefault(): Config;
|
|
|
31
62
|
* user config (matches the Go CLI). A missing file also yields the default.
|
|
32
63
|
*/
|
|
33
64
|
export declare function load(path?: string): Config;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
65
|
+
/**
|
|
66
|
+
* Persist the config to disk (0600 file in a 0755 directory), with the
|
|
67
|
+
* documentation header the file has always carried. Writes the NAMED shape
|
|
68
|
+
* (the one-time migration): the legacy cloud slot is dropped — its content
|
|
69
|
+
* lives in `backends.cloud` — and `backend.type` is written as the
|
|
70
|
+
* local-vs-not mirror. A pristine local config (no named backends) writes
|
|
71
|
+
* exactly the pre-O3 bytes.
|
|
72
|
+
*/
|
|
36
73
|
export declare function save(config: Config, path?: string): void;
|
|
37
|
-
/**
|
|
74
|
+
/** The active backend's name (normalize always stamps current_backend). */
|
|
75
|
+
export declare function activeBackendName(config: Config): string;
|
|
76
|
+
/**
|
|
77
|
+
* The active backend: the reserved local daemon (entry undefined) or a
|
|
78
|
+
* named entry. A current_backend naming a missing entry is a loud
|
|
79
|
+
* configuration error, never a silent fallback — the config was edited by
|
|
80
|
+
* hand or a remove left it dangling.
|
|
81
|
+
*/
|
|
82
|
+
export declare function activeBackend(config: Config): {
|
|
83
|
+
name: string;
|
|
84
|
+
entry: NamedBackendConfig | undefined;
|
|
85
|
+
};
|
|
86
|
+
/** True when the active backend is Stigmer Cloud. */
|
|
38
87
|
export declare function isCloudMode(config: Config): boolean;
|
|
39
88
|
//# sourceMappingURL=config.d.ts.map
|
package/config/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AA2BA,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5C,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEpD,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,M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AM,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACvC,CAYA;AAED,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
package/config/config.js
CHANGED
|
@@ -1,24 +1,44 @@
|
|
|
1
1
|
// CLI configuration model and persistence (~/.stigmer/config.yaml).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
3
|
+
// Named backends (O3, 20260827.06 — the parent program's recorded revisit:
|
|
4
|
+
// "a named backend without a credential story is half a feature"): the
|
|
5
|
+
// `backends` map + `current_backend` are the kubectl-context model — each
|
|
6
|
+
// entry carries its own endpoint AND its own credentials, so switching
|
|
7
|
+
// between Stigmer Cloud and a self-hosted server never clobbers either
|
|
8
|
+
// side's login state. Two names are reserved: "local" (the managed daemon,
|
|
9
|
+
// never stored in the map — its endpoint and no-auth posture are fixed)
|
|
10
|
+
// and "cloud" (where `stigmer auth login` lands by default).
|
|
11
|
+
//
|
|
12
|
+
// Legacy shape + migration: pre-O3 files carried one `backend.cloud` slot
|
|
13
|
+
// selected by `backend.type`. Loading migrates that shape in memory
|
|
14
|
+
// (cloud section → `backends.cloud`, type → `current_backend`); the first
|
|
15
|
+
// save writes the new shape — the ruled one-time write migration. The
|
|
16
|
+
// legacy `backend.type` is still WRITTEN (mirroring local vs non-local)
|
|
17
|
+
// so older readers keep a coherent view, and the opaque `backend.local`
|
|
18
|
+
// section (daemon/LLM/Temporal settings owned by other tools) is
|
|
19
|
+
// preserved verbatim, exactly as before.
|
|
9
20
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
10
21
|
import { dirname } from "node:path";
|
|
11
22
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
23
|
+
import { UsageError } from "../errors/index.js";
|
|
12
24
|
import { isStandalone } from "../runtime.js";
|
|
13
25
|
import { configPath } from "./paths.js";
|
|
26
|
+
/** The reserved name of the managed local daemon backend. */
|
|
27
|
+
export const LOCAL_BACKEND_NAME = "local";
|
|
28
|
+
/** The reserved name `stigmer auth login` targets from local mode. */
|
|
29
|
+
export const CLOUD_BACKEND_NAME = "cloud";
|
|
14
30
|
const SAVE_HEADER = `# Stigmer CLI Configuration
|
|
15
31
|
# For configuration options and examples, see:
|
|
16
32
|
# https://github.com/stigmer/stigmer/blob/main/docs/cli/configuration.md
|
|
17
33
|
|
|
18
34
|
`;
|
|
19
|
-
/** The default config: local backend, no daemon settings fabricated. */
|
|
35
|
+
/** The default config: the local backend, no daemon settings fabricated. */
|
|
20
36
|
export function getDefault() {
|
|
21
|
-
return {
|
|
37
|
+
return {
|
|
38
|
+
backend: { type: "local" },
|
|
39
|
+
backends: {},
|
|
40
|
+
current_backend: LOCAL_BACKEND_NAME,
|
|
41
|
+
};
|
|
22
42
|
}
|
|
23
43
|
/**
|
|
24
44
|
* Load the config from disk. In standalone mode the file is ignored and the
|
|
@@ -41,27 +61,106 @@ export function load(path = configPath()) {
|
|
|
41
61
|
const parsed = parseYaml(raw);
|
|
42
62
|
return normalize(parsed);
|
|
43
63
|
}
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
64
|
+
/**
|
|
65
|
+
* Persist the config to disk (0600 file in a 0755 directory), with the
|
|
66
|
+
* documentation header the file has always carried. Writes the NAMED shape
|
|
67
|
+
* (the one-time migration): the legacy cloud slot is dropped — its content
|
|
68
|
+
* lives in `backends.cloud` — and `backend.type` is written as the
|
|
69
|
+
* local-vs-not mirror. A pristine local config (no named backends) writes
|
|
70
|
+
* exactly the pre-O3 bytes.
|
|
71
|
+
*/
|
|
46
72
|
export function save(config, path = configPath()) {
|
|
47
73
|
mkdirSync(dirname(path), { recursive: true, mode: 0o755 });
|
|
48
|
-
const body = stringifyYaml(stripUndefined(config));
|
|
74
|
+
const body = stringifyYaml(stripUndefined(serializable(config)));
|
|
49
75
|
writeFileSync(path, SAVE_HEADER + body, { mode: 0o600 });
|
|
50
76
|
}
|
|
51
|
-
/**
|
|
77
|
+
/** The active backend's name (normalize always stamps current_backend). */
|
|
78
|
+
export function activeBackendName(config) {
|
|
79
|
+
const name = config.current_backend ?? "";
|
|
80
|
+
return name === "" ? LOCAL_BACKEND_NAME : name;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The active backend: the reserved local daemon (entry undefined) or a
|
|
84
|
+
* named entry. A current_backend naming a missing entry is a loud
|
|
85
|
+
* configuration error, never a silent fallback — the config was edited by
|
|
86
|
+
* hand or a remove left it dangling.
|
|
87
|
+
*/
|
|
88
|
+
export function activeBackend(config) {
|
|
89
|
+
const name = activeBackendName(config);
|
|
90
|
+
if (name === LOCAL_BACKEND_NAME) {
|
|
91
|
+
return { name, entry: undefined };
|
|
92
|
+
}
|
|
93
|
+
const entry = config.backends?.[name];
|
|
94
|
+
if (entry === undefined) {
|
|
95
|
+
throw new UsageError(`current backend "${name}" does not exist — run 'stigmer config backend list' and 'stigmer config backend use <name>'`);
|
|
96
|
+
}
|
|
97
|
+
return { name, entry };
|
|
98
|
+
}
|
|
99
|
+
/** True when the active backend is Stigmer Cloud. */
|
|
52
100
|
export function isCloudMode(config) {
|
|
53
|
-
return config.
|
|
101
|
+
return activeBackend(config).entry?.type === "cloud";
|
|
54
102
|
}
|
|
55
103
|
function normalize(parsed) {
|
|
56
|
-
if (parsed === null || parsed
|
|
104
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
57
105
|
return getDefault();
|
|
58
106
|
}
|
|
59
|
-
const
|
|
107
|
+
const legacy = parsed.backend;
|
|
108
|
+
const backends = normalizeBackends(parsed.backends);
|
|
109
|
+
// Migration: a pre-O3 cloud slot becomes the reserved "cloud" entry —
|
|
110
|
+
// unless a named shape already exists (then the named shape wins and the
|
|
111
|
+
// stale legacy slot is ignored).
|
|
112
|
+
if (Object.keys(backends).length === 0 && legacy?.cloud !== undefined) {
|
|
113
|
+
backends[CLOUD_BACKEND_NAME] = { type: "cloud", ...legacy.cloud };
|
|
114
|
+
}
|
|
115
|
+
let current = typeof parsed.current_backend === "string" ? parsed.current_backend : "";
|
|
116
|
+
if (current === "") {
|
|
117
|
+
current =
|
|
118
|
+
legacy?.type === "cloud" && backends[CLOUD_BACKEND_NAME] !== undefined
|
|
119
|
+
? CLOUD_BACKEND_NAME
|
|
120
|
+
: LOCAL_BACKEND_NAME;
|
|
121
|
+
}
|
|
60
122
|
return {
|
|
61
|
-
backend: {
|
|
123
|
+
backend: {
|
|
124
|
+
type: legacy?.type === "cloud" ? "cloud" : "local",
|
|
125
|
+
local: legacy?.local,
|
|
126
|
+
},
|
|
127
|
+
backends,
|
|
128
|
+
current_backend: current,
|
|
62
129
|
context: parsed.context,
|
|
63
130
|
};
|
|
64
131
|
}
|
|
132
|
+
function normalizeBackends(parsed) {
|
|
133
|
+
const backends = {};
|
|
134
|
+
if (parsed === undefined || typeof parsed !== "object") {
|
|
135
|
+
return backends;
|
|
136
|
+
}
|
|
137
|
+
for (const [name, entry] of Object.entries(parsed)) {
|
|
138
|
+
if (entry === null || typeof entry !== "object")
|
|
139
|
+
continue;
|
|
140
|
+
backends[name] = {
|
|
141
|
+
...entry,
|
|
142
|
+
type: entry.type === "cloud" ? "cloud" : "selfhost",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return backends;
|
|
146
|
+
}
|
|
147
|
+
/** The on-disk shape: named model + legacy mirror, minimal for defaults. */
|
|
148
|
+
function serializable(config) {
|
|
149
|
+
const backends = config.backends ?? {};
|
|
150
|
+
const current = activeBackendName(config);
|
|
151
|
+
const pristineLocal = Object.keys(backends).length === 0 && current === LOCAL_BACKEND_NAME;
|
|
152
|
+
return {
|
|
153
|
+
backend: {
|
|
154
|
+
// The legacy mirror: local stays "local"; anything named is "cloud"
|
|
155
|
+
// to older readers (which cannot represent selfhost anyway).
|
|
156
|
+
type: current === LOCAL_BACKEND_NAME ? "local" : "cloud",
|
|
157
|
+
local: config.backend.local,
|
|
158
|
+
// The legacy cloud slot is never written back — migrated.
|
|
159
|
+
},
|
|
160
|
+
...(pristineLocal ? {} : { backends, current_backend: current }),
|
|
161
|
+
context: config.context,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
65
164
|
// Recursively drop undefined-valued keys so the serialized YAML omits empty
|
|
66
165
|
// optionals (matching Go's yaml omitempty), while preserving the opaque local
|
|
67
166
|
// section untouched.
|
package/config/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,uEAAuE;AACvE,uEAAuE;AACvE,2EAA2E;AAC3E,wEAAwE;AACxE,6DAA6D;AAC7D,EAAE;AACF,0EAA0E;AAC1E,oEAAoE;AACpE,0EAA0E;AAC1E,sEAAsE;AACtE,wEAAwE;AACxE,wEAAwE;AACxE,iEAAiE;AACjE,yCAAyC;AAEzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQxC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C,sEAAsE;AACtE,MAAM,CAAC,MA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,OAAO,GAAQ,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAQ,GAAoC,EAAE,IAAI,KAAK,QAAQ,CAAC;AAClE,CAAC"}
|
package/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type BackendConfig, type BackendType, type CloudBackendConfig, type Config, type ContextConfig, getDefault, isCloudMode, load, save, } from "./config.js";
|
|
1
|
+
export { type BackendConfig, type BackendType, type CloudBackendConfig, type Config, type ContextConfig, type NamedBackendConfig, type NamedBackendType, CLOUD_BACKEND_NAME, LOCAL_BACKEND_NAME, activeBackend, activeBackendName, getDefault, isCloudMode, load, save, } from "./config.js";
|
|
2
2
|
export { DEFAULT_CLOUD_CONSOLE_URL, ensureAuthenticated, resolveConsoleURL, resolveContextOrganization, resolveEndpoint, resolveOrganization, resolveToken, } from "./resolve.js";
|
|
3
3
|
export { configDir, configPath, dataDir } from "./paths.js";
|
|
4
4
|
export { configKeyNames, getConfigValue, setConfigValue } from "./keys.js";
|
package/config/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/config/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Public surface of the CLI config module.
|
|
2
|
-
export { getDefault, isCloudMode, load, save, } from "./config.js";
|
|
2
|
+
export { CLOUD_BACKEND_NAME, LOCAL_BACKEND_NAME, activeBackend, activeBackendName, getDefault, isCloudMode, load, save, } from "./config.js";
|
|
3
3
|
export { DEFAULT_CLOUD_CONSOLE_URL, ensureAuthenticated, resolveConsoleURL, resolveContextOrganization, resolveEndpoint, resolveOrganization, resolveToken, } from "./resolve.js";
|
|
4
4
|
export { configDir, configPath, dataDir } from "./paths.js";
|
|
5
5
|
export { configKeyNames, getConfigValue, setConfigValue } from "./keys.js";
|
package/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,EAQL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/config/keys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config } from "./config.js";
|
|
2
2
|
/** All known config keys, sorted, for `config list` and error messages. */
|
|
3
3
|
export declare function configKeyNames(): string[];
|
|
4
4
|
export declare function getConfigValue(config: Config, key: string): string;
|
package/config/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/config/keys.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/config/keys.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,MAAM,EAGZ,MAAM,aAAa,CAAC;AAmErB,2EAA2E;AAC3E,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,IAAI,CAIN"}
|
package/config/keys.js
CHANGED
|
@@ -2,26 +2,49 @@
|
|
|
2
2
|
// fields the TS CLI owns in Wave 1 are exposed; daemon/local settings are
|
|
3
3
|
// managed by their own (later) commands and preserved opaquely on save.
|
|
4
4
|
import { UsageError } from "../errors/usage-error.js";
|
|
5
|
+
import { CLOUD_BACKEND_NAME, LOCAL_BACKEND_NAME, activeBackendName, } from "./config.js";
|
|
6
|
+
// The backend.cloud.* keys predate named backends and remain the documented
|
|
7
|
+
// kv surface for the reserved "cloud" entry; `current_backend` is the named
|
|
8
|
+
// model's own key. `backend.type` stays the simple local/cloud switch
|
|
9
|
+
// (named backends switch through `config backend use`).
|
|
5
10
|
const KEYS = {
|
|
6
11
|
"backend.type": {
|
|
7
|
-
get: (config) => config
|
|
12
|
+
get: (config) => activeBackendName(config) === LOCAL_BACKEND_NAME ? "local" : "cloud",
|
|
8
13
|
set: (config, value) => {
|
|
9
14
|
if (value !== "local" && value !== "cloud") {
|
|
10
15
|
throw new UsageError(`invalid backend.type "${value}" (expected: local, cloud)`);
|
|
11
16
|
}
|
|
12
|
-
|
|
17
|
+
if (value === "cloud") {
|
|
18
|
+
(config.backends ??= {})[CLOUD_BACKEND_NAME] ??= { type: "cloud" };
|
|
19
|
+
config.current_backend = CLOUD_BACKEND_NAME;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
config.current_backend = LOCAL_BACKEND_NAME;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
current_backend: {
|
|
27
|
+
get: (config) => activeBackendName(config),
|
|
28
|
+
set: (config, value) => {
|
|
29
|
+
if (value !== LOCAL_BACKEND_NAME &&
|
|
30
|
+
config.backends?.[value] === undefined) {
|
|
31
|
+
throw new UsageError(`unknown backend "${value}" (add it first: stigmer config backend add)`);
|
|
32
|
+
}
|
|
33
|
+
config.current_backend = value;
|
|
13
34
|
},
|
|
14
35
|
},
|
|
15
36
|
"backend.cloud.endpoint": {
|
|
16
|
-
get: (config) => config.
|
|
37
|
+
get: (config) => config.backends?.[CLOUD_BACKEND_NAME]?.endpoint ?? "",
|
|
17
38
|
set: (config, value) => {
|
|
18
|
-
(config.
|
|
39
|
+
const backends = (config.backends ??= {});
|
|
40
|
+
(backends[CLOUD_BACKEND_NAME] ??= { type: "cloud" }).endpoint = value;
|
|
19
41
|
},
|
|
20
42
|
},
|
|
21
43
|
"backend.cloud.org_id": {
|
|
22
|
-
get: (config) => config.
|
|
44
|
+
get: (config) => config.backends?.[CLOUD_BACKEND_NAME]?.org_id ?? "",
|
|
23
45
|
set: (config, value) => {
|
|
24
|
-
(config.
|
|
46
|
+
const backends = (config.backends ??= {});
|
|
47
|
+
(backends[CLOUD_BACKEND_NAME] ??= { type: "cloud" }).org_id = value;
|
|
25
48
|
},
|
|
26
49
|
},
|
|
27
50
|
"context.organization": {
|
package/config/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/config/keys.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/config/keys.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,kBAAkB,EAElB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AASrB,4EAA4E;AAC5E,4EAA4E;AAC5E,sEAAsE;AACtE,wDAAwD;AACxD,MAAM,IAAI,GAA8B;IACtC,cAAc,EAAE;QACd,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CACd,iBAAiB,CAAC,MAAM,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;QACtE,GAAG,EAAE,CAAC,MAAM,EAA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