@kigo-dev/sindri 0.1.5 → 0.1.6
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 +1 -1
- package/dist/index.js +23 -8
- package/manifest.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -36764,23 +36764,30 @@ async function setupToolchain(cfg, opts = {}) {
|
|
|
36764
36764
|
await fs7.mkdir(cfg.home, { recursive: true });
|
|
36765
36765
|
return { installed, node: node2, pnpm, source: tc.source };
|
|
36766
36766
|
}
|
|
36767
|
+
function fnmInstallerArgs(installDir, platform = process.platform) {
|
|
36768
|
+
return ["-s", "--", "--install-dir", installDir, "--skip-shell", ...platform === "darwin" ? ["--force-no-brew"] : []];
|
|
36769
|
+
}
|
|
36770
|
+
function stepFailed(step, r) {
|
|
36771
|
+
const out = [r.stderr.trim(), r.stdout.trim()].filter(Boolean).join("\n");
|
|
36772
|
+
return new Error(`${step} failed (exit ${r.code}${r.timedOut ? ", timeout" : ""}): ${out.slice(-300) || "sin salida"}`);
|
|
36773
|
+
}
|
|
36767
36774
|
async function installFnmLts(cfg, env) {
|
|
36768
36775
|
await fs7.mkdir(cfg.fnmDir, { recursive: true });
|
|
36769
36776
|
const script = await (await fetch("https://fnm.vercel.app/install")).text();
|
|
36770
|
-
const sh = await run("bash",
|
|
36771
|
-
if (sh.code !== 0) throw
|
|
36777
|
+
const sh = await run("bash", fnmInstallerArgs(cfg.fnmDir), { env, input: script, timeoutMs: 3e5 });
|
|
36778
|
+
if (sh.code !== 0) throw stepFailed("fnm installer", sh);
|
|
36772
36779
|
const fnm = path7.join(cfg.fnmDir, "fnm");
|
|
36773
36780
|
const fnmEnv = { ...env, FNM_DIR: cfg.fnmDir };
|
|
36774
36781
|
const inst = await run(fnm, ["install", "--lts"], { env: fnmEnv, timeoutMs: 6e5 });
|
|
36775
|
-
if (inst.code !== 0) throw
|
|
36782
|
+
if (inst.code !== 0) throw stepFailed("fnm install --lts", inst);
|
|
36776
36783
|
const def = await run(fnm, ["default", "lts-latest"], { env: fnmEnv, timeoutMs: 6e4 });
|
|
36777
|
-
if (def.code !== 0) throw
|
|
36784
|
+
if (def.code !== 0) throw stepFailed("fnm default", def);
|
|
36778
36785
|
const bin = path7.join(cfg.fnmDir, "aliases", "default", "bin");
|
|
36779
36786
|
const childEnv = { ...env, PATH: `${bin}${path7.delimiter}${env.PATH ?? ""}`, COREPACK_ENABLE_DOWNLOAD_PROMPT: "0", npm_config_verify_deps_before_run: "false" };
|
|
36780
36787
|
const enable = await run(path7.join(bin, "corepack"), ["enable", "--install-directory", bin], { env: childEnv, timeoutMs: 6e4 });
|
|
36781
|
-
if (enable.code !== 0) throw
|
|
36788
|
+
if (enable.code !== 0) throw stepFailed("corepack enable", enable);
|
|
36782
36789
|
const prep = await run(path7.join(bin, "corepack"), ["prepare", `pnpm@${cfg.pnpmVersion}`, "--activate"], { env: childEnv, timeoutMs: 3e5 });
|
|
36783
|
-
if (prep.code !== 0) throw
|
|
36790
|
+
if (prep.code !== 0) throw stepFailed("corepack prepare pnpm", prep);
|
|
36784
36791
|
}
|
|
36785
36792
|
|
|
36786
36793
|
// src/preview.ts
|
|
@@ -37316,7 +37323,15 @@ function createTools(deps) {
|
|
|
37316
37323
|
};
|
|
37317
37324
|
}
|
|
37318
37325
|
const setup = guard(async () => {
|
|
37319
|
-
|
|
37326
|
+
let report;
|
|
37327
|
+
try {
|
|
37328
|
+
report = await setupToolchain(cfg, { env, ...deps.installer ? { installer: deps.installer } : {} });
|
|
37329
|
+
} catch (err) {
|
|
37330
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
37331
|
+
process.stderr.write(`sindri: ${msg}
|
|
37332
|
+
`);
|
|
37333
|
+
return { ok: false, summary: "No pude instalar Node y pnpm en tu computadora. Escribe en Slack, canal #sindri, y pega el detalle.", detail: msg.slice(0, 400) };
|
|
37334
|
+
}
|
|
37320
37335
|
const what = report.installed.length ? `Instal\xE9 ${report.installed.join(" y ")}.` : "Tu computadora ya ten\xEDa lo necesario.";
|
|
37321
37336
|
return {
|
|
37322
37337
|
ok: true,
|
|
@@ -37894,7 +37909,7 @@ function when(iso, now = /* @__PURE__ */ new Date()) {
|
|
|
37894
37909
|
}
|
|
37895
37910
|
|
|
37896
37911
|
// src/index.ts
|
|
37897
|
-
var VERSION = "0.1.
|
|
37912
|
+
var VERSION = "0.1.6";
|
|
37898
37913
|
function registerTools(server, tools) {
|
|
37899
37914
|
for (const name of Object.keys(SCHEMAS)) {
|
|
37900
37915
|
const meta3 = DESCRIPTIONS[name];
|
package/manifest.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"manifest_version": "0.2",
|
|
3
3
|
"name": "sindri",
|
|
4
4
|
"display_name": "Kigo Sindri",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"description": "Create, preview and publish Kigo internal apps from your Claude.",
|
|
7
|
-
"long_description": "Sindri lets
|
|
7
|
+
"long_description": "Sindri lets anyone at Kigo build small internal apps by talking to Claude. Claude edits the app on your computer; this connector installs what is needed, runs the app locally with test data, publishes it at <name>.sindri.kigo.dev and keeps versions. Sign in with your @cargomovil.com account.",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Kigo"
|
|
10
10
|
},
|
package/package.json
CHANGED