@capxul/cli 4.20.0-beta.26 → 4.20.0-beta.27
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/README.md +25 -31
- package/dist/browser/signer.js +28 -10
- package/dist/browser/signer.js.map +1 -1
- package/dist/{entry-CXlsnqyc.mjs → entry-GLdITgH4.mjs} +1171 -1519
- package/dist/entry-GLdITgH4.mjs.map +1 -0
- package/dist/{fast-BYzVdpNs.mjs → fast-BQEiHMyp.mjs} +2 -2
- package/dist/{fast-BYzVdpNs.mjs.map → fast-BQEiHMyp.mjs.map} +1 -1
- package/dist/main.mjs +2 -2
- package/dist/{where-view-C0WT0ARR.mjs → where-view-Csv4lEES.mjs} +2 -2
- package/dist/{where-view-C0WT0ARR.mjs.map → where-view-Csv4lEES.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/entry-CXlsnqyc.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as cliHome, d as explicitOrganization, f as flagValue,
|
|
1
|
+
import { c as cliHome, d as explicitOrganization, f as flagValue, h as parseWhere, l as describeWhere, n as styleFor, r as whoamiLines, s as chooseEnvironment } from "./where-view-Csv4lEES.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/commands/whoami/fast.ts
|
|
@@ -54,4 +54,4 @@ const fastWhoami = (args, env, stdoutTty) => {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
export { fastWhoami };
|
|
56
56
|
|
|
57
|
-
//# sourceMappingURL=fast-
|
|
57
|
+
//# sourceMappingURL=fast-BQEiHMyp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fast-
|
|
1
|
+
{"version":3,"file":"fast-BQEiHMyp.mjs","names":[],"sources":["../src/commands/whoami/fast.ts"],"sourcesContent":["// `capxul whoami` without the Effect runtime. Loading the full CLI costs about\n// 0.4 s before any command runs; this path reads two small local files and\n// prints, so it answers in well under 0.3 s. It handles only the plain forms\n// (`--json`, `--org <handle>`, `--env <name>`); anything else returns\n// undefined and the full CLI parses, validates and answers instead. It makes\n// no network call and records no telemetry.\n\nimport { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n chooseEnvironment,\n cliHome,\n describeWhere,\n explicitOrganization,\n flagValue,\n parseWhere,\n} from \"#runtime/where\";\nimport { styleFor, whoamiLines } from \"#runtime/where-view\";\n\ntype Environment = Readonly<Record<string, string | undefined>>;\n\nconst plainForm = (args: readonly string[]) => {\n for (let index = 0; index < args.length; index += 1) {\n const arg = args[index]!;\n if (arg === \"--json\" || /^--(org|env)=./u.test(arg)) continue;\n if ((arg === \"--org\" || arg === \"--env\") && args[index + 1]?.startsWith(\"-\") === false) {\n index += 1;\n continue;\n }\n return false;\n }\n return true;\n};\n\nconst readText = (file: string) => {\n try {\n return readFileSync(file, \"utf8\");\n } catch {\n return null;\n }\n};\n\n/** The text to print for `whoami <args>`, or undefined when the full CLI must answer. */\nexport const fastWhoami = (\n args: readonly string[],\n env: Environment,\n stdoutTty: boolean,\n): string | undefined => {\n if (!plainForm(args)) return undefined;\n const home = cliHome(env, join);\n if (home === undefined) return undefined;\n const saved = parseWhere(readText(join(home, \"context.json\")));\n const bootstrapUrl = env.CAPXUL_BOOTSTRAP_URL;\n if (bootstrapUrl !== undefined && bootstrapUrl !== \"\" && !URL.canParse(bootstrapUrl))\n return undefined;\n const choice = chooseEnvironment({\n flag: flagValue(args, \"env\"),\n variable: env.CAPXUL_ENV,\n bootstrapUrl:\n bootstrapUrl === undefined || bootstrapUrl === \"\" ? undefined : new URL(bootstrapUrl).origin,\n saved: saved.env,\n });\n if (\"refusal\" in choice) return undefined;\n const where = describeWhere({\n origin: choice.origin,\n envSource: choice.source,\n saved,\n explicitOrg: explicitOrganization(flagValue(args, \"org\"), env.CAPXUL_ORG),\n });\n if (args.includes(\"--json\"))\n return `${JSON.stringify(\n {\n version: 1,\n command: \"whoami\",\n invocationId: globalThis.crypto.randomUUID(),\n outcome: \"succeeded\",\n data: where,\n },\n null,\n stdoutTty ? 2 : undefined,\n )}\\n`;\n return `${whoamiLines(where, styleFor(stdoutTty, env)).join(\"\\n\")}\\n`;\n};\n"],"mappings":";;;;AAqBA,MAAM,aAAa,SAA4B;CAC7C,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,GAAG;EACnD,MAAM,MAAM,KAAK;EACjB,IAAI,QAAQ,YAAY,kBAAkB,KAAK,GAAG,GAAG;EACrD,KAAK,QAAQ,WAAW,QAAQ,YAAY,KAAK,QAAQ,EAAE,EAAE,WAAW,GAAG,MAAM,OAAO;GACtF,SAAS;GACT;EACF;EACA,OAAO;CACT;CACA,OAAO;AACT;AAEA,MAAM,YAAY,SAAiB;CACjC,IAAI;EACF,OAAO,aAAa,MAAM,MAAM;CAClC,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,MAAa,cACX,MACA,KACA,cACuB;CACvB,IAAI,CAAC,UAAU,IAAI,GAAG,OAAO,KAAA;CAC7B,MAAM,OAAO,QAAQ,KAAK,IAAI;CAC9B,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;CAC/B,MAAM,QAAQ,WAAW,SAAS,KAAK,MAAM,cAAc,CAAC,CAAC;CAC7D,MAAM,eAAe,IAAI;CACzB,IAAI,iBAAiB,KAAA,KAAa,iBAAiB,MAAM,CAAC,IAAI,SAAS,YAAY,GACjF,OAAO,KAAA;CACT,MAAM,SAAS,kBAAkB;EAC/B,MAAM,UAAU,MAAM,KAAK;EAC3B,UAAU,IAAI;EACd,cACE,iBAAiB,KAAA,KAAa,iBAAiB,KAAK,KAAA,IAAY,IAAI,IAAI,YAAY,CAAC,CAAC;EACxF,OAAO,MAAM;CACf,CAAC;CACD,IAAI,aAAa,QAAQ,OAAO,KAAA;CAChC,MAAM,QAAQ,cAAc;EAC1B,QAAQ,OAAO;EACf,WAAW,OAAO;EAClB;EACA,aAAa,qBAAqB,UAAU,MAAM,KAAK,GAAG,IAAI,UAAU;CAC1E,CAAC;CACD,IAAI,KAAK,SAAS,QAAQ,GACxB,OAAO,GAAG,KAAK,UACb;EACE,SAAS;EACT,SAAS;EACT,cAAc,WAAW,OAAO,WAAW;EAC3C,SAAS;EACT,MAAM;CACR,GACA,MACA,YAAY,IAAI,KAAA,CAClB,EAAE;CACJ,OAAO,GAAG,YAAY,OAAO,SAAS,WAAW,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AACpE"}
|
package/dist/main.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { argv, env, exit, platform, stderr, stdout, versions } from "node:proces
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
//#region src/main.ts
|
|
5
5
|
const args = argv.slice(2);
|
|
6
|
-
const whoami = args[0] === "whoami" ? (await import("./fast-
|
|
6
|
+
const whoami = args[0] === "whoami" ? (await import("./fast-BQEiHMyp.mjs")).fastWhoami(args.slice(1), env, stdout.isTTY) : void 0;
|
|
7
7
|
if (whoami === void 0) {
|
|
8
8
|
const [{ Cause, Effect, Exit, Logger }, { NodeRuntime, NodeServices }, { runCli }] = await Promise.all([
|
|
9
9
|
import("effect"),
|
|
10
10
|
import("@effect/platform-node"),
|
|
11
|
-
import("./entry-
|
|
11
|
+
import("./entry-GLdITgH4.mjs")
|
|
12
12
|
]);
|
|
13
13
|
NodeRuntime.runMain(runCli({
|
|
14
14
|
nodeVersion: versions.node,
|
|
@@ -2693,6 +2693,6 @@ const whoamiLines = (where, style) => {
|
|
|
2693
2693
|
];
|
|
2694
2694
|
};
|
|
2695
2695
|
//#endregion
|
|
2696
|
-
export {
|
|
2696
|
+
export { assertSize as A, pad as B, keccak256 as C, createCursor as D, toRlp as E, boolToHex as F, IntegerOutOfRangeError as G, trim as H, bytesToHex as I, InvalidBytesBooleanError as K, numberToHex as L, hexToNumber as M, hexToBytes as N, concat as O, toBytes as P, stringToHex as R, getAddress as S, format as T, size as U, padHex as V, isHex as W, readField as _, ENVIRONMENT_NAMES as a, isAddress as b, cliHome as c, explicitOrganization as d, flagValue as f, isRecord as g, parseWhere as h, DEVNET_ORIGIN as i, hexToBigInt as j, concatHex as k, describeWhere as l, networkName as m, styleFor as n, STAGING_ORIGIN as o, flagValues as p, BaseError as q, whoamiLines as r, chooseEnvironment as s, headerLine as t, environmentOf as u, slice as v, InvalidAddressError as w, checksumAddress as x, sliceBytes as y, toHex as z };
|
|
2697
2697
|
|
|
2698
|
-
//# sourceMappingURL=where-view-
|
|
2698
|
+
//# sourceMappingURL=where-view-Csv4lEES.mjs.map
|