create-op-node 0.11.0 → 0.11.1
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/cli.js +21 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1509,7 +1509,11 @@ function validatePlistInput(input) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
function buildSetenvCommand(input) {
|
|
1511
1511
|
return [
|
|
1512
|
-
`
|
|
1512
|
+
// Quote the path inside `cat` so a space-containing keyFilePath (allowed by
|
|
1513
|
+
// SAFE_PATH_RE) doesn't word-split and leave PGSODIUM_ROOT_KEY empty. The
|
|
1514
|
+
// regex rejects `"`/`$`/backticks, so the inner quotes can't be broken out
|
|
1515
|
+
// of — this is word-split safety, not new injection surface. (#36)
|
|
1516
|
+
`launchctl setenv PGSODIUM_ROOT_KEY "$(cat "${input.keyFilePath}")"`,
|
|
1513
1517
|
...input.tunnelToken !== void 0 ? [`launchctl setenv TUNNEL_TOKEN "${input.tunnelToken}"`] : [],
|
|
1514
1518
|
...input.llmModel !== void 0 ? [`launchctl setenv LLM_MODEL "${input.llmModel}"`] : [],
|
|
1515
1519
|
...input.embeddingModel !== void 0 ? [`launchctl setenv EMBEDDINGS_MODEL "${input.embeddingModel}"`] : [],
|
|
@@ -1586,7 +1590,7 @@ async function teardownLaunchAgent(paths, opts = {}) {
|
|
|
1586
1590
|
const unload = await safeExeca("launchctl", ["unload", paths.plistFile]);
|
|
1587
1591
|
steps.push({
|
|
1588
1592
|
step: "unload",
|
|
1589
|
-
ok:
|
|
1593
|
+
ok: unload !== null,
|
|
1590
1594
|
...unload === null ? { reason: "`launchctl` not on PATH" } : {}
|
|
1591
1595
|
});
|
|
1592
1596
|
try {
|
|
@@ -4963,8 +4967,18 @@ async function looksLikeRegionsRepo(dir) {
|
|
|
4963
4967
|
return hasSchema && hasRegions;
|
|
4964
4968
|
}
|
|
4965
4969
|
|
|
4970
|
+
// src/lib/cli-args.ts
|
|
4971
|
+
var GLOBAL_FLAGS = /* @__PURE__ */ new Set(["-v", "--version", "-h", "--help"]);
|
|
4972
|
+
function withDefaultSubcommand(argv, known) {
|
|
4973
|
+
const first2 = argv[2];
|
|
4974
|
+
if (first2 !== void 0 && (known.includes(first2) || GLOBAL_FLAGS.has(first2))) {
|
|
4975
|
+
return argv;
|
|
4976
|
+
}
|
|
4977
|
+
return [...argv.slice(0, 2), "init", ...argv.slice(2)];
|
|
4978
|
+
}
|
|
4979
|
+
|
|
4966
4980
|
// src/cli.ts
|
|
4967
|
-
var VERSION = "0.11.
|
|
4981
|
+
var VERSION = "0.11.1";
|
|
4968
4982
|
var program = new Command();
|
|
4969
4983
|
program.name("create-op-node").description(
|
|
4970
4984
|
"Interactive bootstrap for an Opus Populi federation node.\nCloudflare infrastructure \u2192 Mac Studio \u2192 live public API."
|
|
@@ -4974,9 +4988,10 @@ program.addCommand(bootstrapCommand);
|
|
|
4974
4988
|
program.addCommand(resetCommand);
|
|
4975
4989
|
program.addCommand(verifyCommand);
|
|
4976
4990
|
program.addCommand(regionCommand);
|
|
4977
|
-
|
|
4978
|
-
process.argv
|
|
4979
|
-
|
|
4991
|
+
process.argv = withDefaultSubcommand(
|
|
4992
|
+
process.argv,
|
|
4993
|
+
program.commands.map((c) => c.name())
|
|
4994
|
+
);
|
|
4980
4995
|
await program.parseAsync(process.argv).catch((err) => {
|
|
4981
4996
|
const msg = err instanceof Error ? err.message : String(err);
|
|
4982
4997
|
console.error(`
|