pi-supernova 0.0.6 → 0.0.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.0.7] - 2026-09-03
6
+
7
+ ### Fixed
8
+
9
+ - `bash` / `exec` run through `bash -c` (and strip a wrapping quote pair), so `git status` and `echo $PATH` are not looked up as a single binary name.
10
+ - `nova.search` / `nova.describe` return promises, so `.catch()` in guest programs works.
11
+
5
12
  ## [0.0.6] - 2026-09-03
6
13
 
7
14
  ### Changed
package/host-bridge.js CHANGED
@@ -16,6 +16,17 @@ function textResult(text, details) {
16
16
  };
17
17
  }
18
18
 
19
+ /** Unwrap a single matching quote pair around the whole string (`'git status'`). */
20
+ function unwrapIfFullyQuoted(s) {
21
+ if (s.length < 2) return s;
22
+ const q = s[0];
23
+ if (q !== "'" && q !== '"') return s;
24
+ if (s[s.length - 1] !== q) return s;
25
+ const inner = s.slice(1, -1);
26
+ if (inner.includes(q)) return s;
27
+ return inner;
28
+ }
29
+
19
30
  let cachedCwd = null;
20
31
  let cachedResolvedCwd = null;
21
32
 
@@ -576,12 +587,13 @@ function createNativeAdapters(getCwd, vfs, config) {
576
587
  },
577
588
  async bash(params, signal) {
578
589
  const cwd = getCwd();
579
- const command = String(params?.command ?? "").trim();
590
+ const command = unwrapIfFullyQuoted(String(params?.command ?? "").trim());
580
591
  if (!command) throw new Error("bash requires command");
581
592
  const targetCwd = params?.cwd ? await resolveWorkspacePath(cwd, params.cwd, "bash cwd", true) : cwd;
582
593
 
583
- const hasShellMeta = /[|><&;*$()'"]/.test(command) || command.includes("`");
584
- const argv = hasShellMeta ? ["bash", "-c", command] : command.split(/\s+/);
594
+ // Always shell. Splitting on spaces treated `git status` / quoted `exec("git status")`
595
+ // as a single binary name (`bash: git status: command not found`).
596
+ const argv = ["bash", "-c", command];
585
597
 
586
598
  const transactionBarrier = await vfs.prepareExternalMutation("bash");
587
599
  let res;
package/index.js CHANGED
@@ -86,12 +86,12 @@ export default function piSupernova(pi) {
86
86
 
87
87
  function makeNovaApi() {
88
88
  return {
89
- search(query, limit) {
89
+ async search(query, limit) {
90
90
  const cat = catalog.length ? catalog : refreshCatalog();
91
91
  const lim = Number.isInteger(limit) ? limit : config.maxSearchResults;
92
92
  return searchCatalog(cat, query, lim);
93
93
  },
94
- describe(name) {
94
+ async describe(name) {
95
95
  const cat = catalog.length ? catalog : refreshCatalog();
96
96
  return describeTool(cat, name);
97
97
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-supernova",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Dual-host CodeMode for Pi/OMP: progressive tool discovery, result bottleneck, and Amdahl Auto parallel.",
5
5
  "type": "module",
6
6
  "author": "AdityaVG13",
package/runtime.js CHANGED
@@ -158,7 +158,13 @@ export async function runGuestProgram(options) {
158
158
  };
159
159
  const quoteShellArg = (value) => `'${String(value).replaceAll("'", "'\\''")}'`;
160
160
  const guestExec = async (cmd, args, opts) => {
161
- const argv = [cmd, ...(Array.isArray(args) ? args : [])].map(quoteShellArg).join(" ");
161
+ const command = String(cmd ?? "").trim();
162
+ if (!command) throw new Error("exec requires command");
163
+ // exec("git status") is a shell line; exec("git", ["status"]) is argv.
164
+ if (!Array.isArray(args) || args.length === 0) {
165
+ return guestBash(command, opts);
166
+ }
167
+ const argv = [command, ...args].map(quoteShellArg).join(" ");
162
168
  return guestBash(argv, opts);
163
169
  };
164
170
  const guestSpeculate = async (fn) => (isFunction(nova.speculate) ? nova.speculate(fn) : fn());