@modeloslab/modelcode 0.1.0 → 0.1.2

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.mjs CHANGED
@@ -55,6 +55,7 @@ import {
55
55
  runTeam,
56
56
  searchFacts,
57
57
  searchSessions,
58
+ shellInvocation,
58
59
  snapshot,
59
60
  spawnProc,
60
61
  toolSchemas,
@@ -62,7 +63,7 @@ import {
62
63
  validateMnemonic,
63
64
  walletFromMnemonic,
64
65
  which
65
- } from "./main-2aqyq9g6.mjs";
66
+ } from "./main-k6vk3448.mjs";
66
67
  import"./main-p2xnn95s.mjs";
67
68
  import {
68
69
  __require
@@ -153,7 +154,7 @@ var bash = {
153
154
  async run(args, ctx) {
154
155
  const cmd = String(args.command ?? "");
155
156
  const timeout = Number(args.timeout_ms) || 120000;
156
- const r = await runProc(["bash", "-lc", cmd], { cwd: ctx.cwd, timeoutMs: timeout, onChunk: (s) => ctx.onStream?.(s) });
157
+ const r = await runProc(shellInvocation(cmd), { cwd: ctx.cwd, timeoutMs: timeout, onChunk: (s) => ctx.onStream?.(s) });
157
158
  return `exit ${r.code}
158
159
  ${(r.stdout + (r.stderr ? `
159
160
  [stderr]
@@ -250,9 +251,11 @@ var grep = {
250
251
  async run(args, ctx) {
251
252
  const pat = String(args.pattern ?? "");
252
253
  const where = args.path ? inside(ctx.cwd, String(args.path)) : ctx.cwd;
253
- const tool = which("rg") ? `rg -n --no-heading -e ${JSON.stringify(pat)} ${JSON.stringify(where)}` : `grep -rnE ${JSON.stringify(pat)} ${JSON.stringify(where)}`;
254
- const r = await runProc(["bash", "-lc", `${tool} 2>/dev/null | head -200`], { cwd: ctx.cwd });
255
- return r.stdout.trim() || "(no matches)";
254
+ const argv = which("rg") ? ["rg", "-n", "--no-heading", "-e", pat, where] : ["grep", "-rnE", pat, where];
255
+ const r = await runProc(argv, { cwd: ctx.cwd });
256
+ return r.stdout.split(`
257
+ `).slice(0, 200).join(`
258
+ `).trim() || "(no matches)";
256
259
  }
257
260
  };
258
261
  function registerCoreTools() {
@@ -908,9 +911,11 @@ var lsp = {
908
911
  existsSync5(resolve2(ctx.cwd, "Cargo.toml")) && "cargo check -q"
909
912
  ].filter(Boolean);
910
913
  if (action === "diagnostics" && cmds.length) {
911
- const r = await runProc(["bash", "-lc", `${cmds[0]} 2>&1 | head -120`], { cwd: ctx.cwd });
914
+ const r = await runProc(shellInvocation(cmds[0]), { cwd: ctx.cwd });
912
915
  return `(no language server installed; shelled typecheck)
913
- ${r.stdout.trim() || "no diagnostics"}`;
916
+ ${(r.stdout + r.stderr).split(`
917
+ `).slice(0, 120).join(`
918
+ `).trim() || "no diagnostics"}`;
914
919
  }
915
920
  return "no language server for this file type (install e.g. typescript-language-server, pyright, gopls)";
916
921
  }
@@ -1576,9 +1581,7 @@ async function main() {
1576
1581
  await interactiveLogin(rl, cfg);
1577
1582
  rl.close();
1578
1583
  }
1579
- if (!cfg.apiKey)
1580
- return;
1581
- const { runTui } = await import("./tui-0r2q70wm.mjs");
1584
+ const { runTui } = await import("./tui-2wxjcqb2.mjs");
1582
1585
  return runTui(cfg, resume);
1583
1586
  }
1584
1587
  if (cmd === "tui")