moshcode 0.25.0 → 0.25.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/README.md CHANGED
@@ -76,8 +76,8 @@ use this only in an isolated container, VM, or workspace you trust:
76
76
 
77
77
  ```sh
78
78
  moshcode agents claude # claude agents --dangerously-skip-permissions (agent view)
79
- moshcode agents opencode # opencode agent list (agent view)
80
- moshcode agents privacycode # privacycode agent list (agent view)
79
+ moshcode agents opencode # opencode --auto (autonomous)
80
+ moshcode agents privacycode # privacycode --auto (autonomous)
81
81
  moshcode agents codex # codex --dangerously-bypass-approvals-and-sandbox (autonomous)
82
82
  moshcode agents gemini # gemini --approval-mode=yolo (autonomous)
83
83
  moshcode agents kimi # kimi --yolo (autonomous)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moshcode",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "type": "module",
5
5
  "description": "moshcode — a metal wrapper for coding engines and native UGig/CoinPay workflow CLIs, with OpenPRD and moshscript",
6
6
  "repository": {
package/src/engines.mjs CHANGED
@@ -5,11 +5,11 @@
5
5
  //
6
6
  // `agentsView` (optional) is the exact argv that opens the engine's native
7
7
  // agent list/view — used by `/agents <name>` when the engine actually has one
8
- // (claude, opencode). It's the FULL leading args (subcommand + any flags that
9
- // subcommand accepts), because not every agents-subcommand takes the engine's
10
- // bypass flag (e.g. `opencode agent list` takes none). Engines without an
11
- // `agentsView` fall back to `agentArgs` an autonomous session with native
12
- // approvals bypassed/auto-approved.
8
+ // (currently claude). It's the FULL leading args (subcommand + any flags that
9
+ // subcommand accepts). Engines without an `agentsView` fall back to
10
+ // `agentArgs` an autonomous session with native approvals
11
+ // bypassed/auto-approved. Do not use a machine-readable, one-shot list command
12
+ // as an agents view: `/agents` promises to hand the terminal to a live session.
13
13
  import { spawn } from "node:child_process";
14
14
  import { existsSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
15
15
  import { homedir, tmpdir } from "node:os";
@@ -22,17 +22,19 @@ export const ENGINES = {
22
22
  desc: "opencode — the open-source coding agent (SST/anomalyco)",
23
23
  bin: "opencode",
24
24
  agentArgs: ["--auto"],
25
- agentsView: ["agent", "list"], // `opencode agent list` — lists agents; the `agent` subcommand takes no bypass flag
26
25
  install: { cmd: "bash", args: ["-c", "curl -fsSL https://opencode.ai/install | bash"] },
27
26
  upgrade: { cmd: "opencode", args: ["upgrade"] },
27
+ // The installer appends this directory to a shell profile. The moshcode
28
+ // process that ran it cannot see that PATH change, so search it directly.
29
+ binDirs: [path.join(homedir(), ".opencode", "bin")],
28
30
  },
29
31
  privacycode: {
30
32
  desc: "privacycode — privacy-first coding agent (profullstack)",
31
33
  bin: "privacycode",
32
34
  // An opencode derivative, so it speaks the same flags/subcommands.
33
35
  agentArgs: ["--auto"],
34
- agentsView: ["agent", "list"],
35
36
  install: { cmd: "sh", args: ["-c", "curl -fsSL https://getprivacycode.com/install | sh"] },
37
+ binDirs: [path.join(homedir(), ".privacycode", "bin")],
36
38
  // Deliberately no native updater. `privacycode upgrade` is opencode's, and
37
39
  // it works out how to update itself by recognising where it was installed —
38
40
  // it knows opencode's own locations, not this fork's ~/.privacycode/bin. It
@@ -263,9 +265,10 @@ export function pickAiEngine(preferred) {
263
265
 
264
266
  /** Engine entries annotated with install status. */
265
267
  export function engineStatus() {
266
- // Search each engine's own install dir as well as PATH — kimi's installer only
267
- // adds ~/.kimi-code/bin to your shell rc, so PATH alone reports it missing in
268
- // the very session that installed it. (Inert for engines without binDirs.)
268
+ // Search each engine's own install dir as well as PATH — several curl-based
269
+ // installers only add their bin directory to a shell rc, so PATH alone
270
+ // reports them missing in the very session that installed them. (Inert for
271
+ // engines without binDirs.)
269
272
  return Object.entries(ENGINES).map(([key, e]) => ({ key, ...e, installed: isInstalled(e.bin, e.binDirs) }));
270
273
  }
271
274