superlore-cli 0.6.1 → 0.7.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/index.d.ts +1 -1
- package/dist/index.js +22 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ declare function serializeSuperloreJson(config: SuperloreJson): string;
|
|
|
87
87
|
declare function resolveMcpPath(config: SuperloreJson): string | undefined;
|
|
88
88
|
|
|
89
89
|
/** The CLI version, kept in sync with package.json at build time. */
|
|
90
|
-
declare const VERSION = "0.
|
|
90
|
+
declare const VERSION = "0.7.1";
|
|
91
91
|
/** Build the argument parser. Exported for tests; `run()` wires it to argv. */
|
|
92
92
|
declare function buildCli(argv?: readonly string[]): cac.CAC;
|
|
93
93
|
/** Parse argv and dispatch. Reports unknown commands and unexpected errors cleanly. */
|
package/dist/index.js
CHANGED
|
@@ -266,9 +266,14 @@ import { homedir, tmpdir } from "os";
|
|
|
266
266
|
import { join as join2 } from "path";
|
|
267
267
|
import process2 from "process";
|
|
268
268
|
var EXTENSION_ID = "superlore.superlore-preview";
|
|
269
|
-
var
|
|
270
|
-
async function downloadVsix(
|
|
271
|
-
const
|
|
269
|
+
var OPENVSX_LATEST_API = "https://open-vsx.org/api/superlore/superlore-preview/latest";
|
|
270
|
+
async function downloadVsix(metaUrl = OPENVSX_LATEST_API) {
|
|
271
|
+
const meta = await fetch(metaUrl, { redirect: "follow" });
|
|
272
|
+
if (!meta.ok) throw new Error(`couldn't reach Open VSX (${meta.status} ${meta.statusText})`);
|
|
273
|
+
const info = await meta.json();
|
|
274
|
+
const download = info.files?.download;
|
|
275
|
+
if (!download) throw new Error("Open VSX returned no download URL for the extension");
|
|
276
|
+
const res = await fetch(download, { redirect: "follow" });
|
|
272
277
|
if (!res.ok) throw new Error(`couldn't fetch the extension (${res.status} ${res.statusText})`);
|
|
273
278
|
const bytes = Buffer.from(await res.arrayBuffer());
|
|
274
279
|
const path = join2(tmpdir(), "superlore-preview.vsix");
|
|
@@ -390,17 +395,18 @@ async function connectCommand(flags = {}) {
|
|
|
390
395
|
const labels = detected.map((e) => bold(e.label)).join(", ");
|
|
391
396
|
log.step(`Found ${labels}. Installing the superlore Preview extension\u2026`);
|
|
392
397
|
log.blank();
|
|
393
|
-
let
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
)
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
let results;
|
|
399
|
+
if (flags.vsix) {
|
|
400
|
+
results = detected.map((editor) => report(installInto(editor, { vsix: flags.vsix })));
|
|
401
|
+
} else {
|
|
402
|
+
const byId = detected.map((editor) => installInto(editor));
|
|
403
|
+
const vsix = byId.some((r) => r.status === "failed") ? await downloadVsix().catch(() => void 0) : void 0;
|
|
404
|
+
results = detected.map((editor, i) => {
|
|
405
|
+
const idResult = byId[i];
|
|
406
|
+
if (idResult.status !== "failed") return report(idResult);
|
|
407
|
+
return report(vsix ? installInto(editor, { vsix }) : idResult);
|
|
408
|
+
});
|
|
402
409
|
}
|
|
403
|
-
const results = detected.map((editor) => report(installInto(editor, { vsix })));
|
|
404
410
|
log.blank();
|
|
405
411
|
const failed = results.filter((r) => r.status === "failed");
|
|
406
412
|
if (failed.length > 0 && failed.length === results.length) {
|
|
@@ -432,10 +438,10 @@ function report(result) {
|
|
|
432
438
|
function printManualInstall() {
|
|
433
439
|
log.blank();
|
|
434
440
|
log.info(
|
|
435
|
-
`${dim("Install it by hand:
|
|
441
|
+
`${dim("Install it by hand: open your editor's Extensions panel and search")} ${cyan('"superlore Preview"')}${dim(" (it's on Open VSX),")}`
|
|
436
442
|
);
|
|
437
443
|
log.info(
|
|
438
|
-
`${dim("
|
|
444
|
+
`${dim("or run")} ${cyan("code --install-extension superlore.superlore-preview")} ${dim("(Cursor/Windsurf/VSCodium).")}`
|
|
439
445
|
);
|
|
440
446
|
}
|
|
441
447
|
function printMcpNextStep() {
|
|
@@ -2480,7 +2486,7 @@ function printNextSteps(root, config) {
|
|
|
2480
2486
|
}
|
|
2481
2487
|
|
|
2482
2488
|
// src/index.ts
|
|
2483
|
-
var VERSION = "0.
|
|
2489
|
+
var VERSION = "0.7.1";
|
|
2484
2490
|
function buildCli(argv = process3.argv) {
|
|
2485
2491
|
const cli = cac("superlore");
|
|
2486
2492
|
cli.command("init [dir]", "Scaffold a new superlore knowledge base").option("--name <name>", "KB name").option("--type <type>", "KB type: company-kb | product-docs | personal-kb").option("--auth", "Enable the Google SSO auth gate").option("--no-auth", "Disable the auth gate").option("--allowed-domain <domain>", "Restrict SSO to one email domain (implies --auth)").option("--accent <color>", "Brand accent colour (any CSS colour)").option("--no-mcp", "Disable the MCP endpoint (on by default)").option("--connect", "Install the editor extension after scaffolding (skip the prompt)").option("--no-connect", "Don't set up the editor extension").option("-y, --yes", "Skip prompts; use flags + defaults").example("superlore init my-kb --type product-docs").example("superlore init acme --type company-kb --auth --allowed-domain acme.com").example("superlore init me --type personal-kb").action(
|
package/package.json
CHANGED