Skip to content

Commit 74bcfe2

Browse files
ralyodioclaude
andcommitted
feat(tools): add c0mpute workflow tool + /c0mpute shortcut
Adds c0mpute (the decentralized compute network CLI) as a moshcode workflow tool alongside ugig and coinpay: `/c0mpute [args…]` in the TUI, `moshcode c0mpute …` outside it, and `moshcode install c0mpute` via `curl -fsSL https://c0mpute.com/install.sh | sh`. Updated help/tool listings and tests. Bumps to 0.9.3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 62ca44d commit 74bcfe2

6 files changed

Lines changed: 22 additions & 7 deletions

File tree

bin/moshcode.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ usage:
101101
(bypasses/auto-approves native permissions)
102102
moshcode start <engine> [args…] raw engine launch; inject no arguments
103103
moshcode <engine> [args…] raw launch shorthand (backward compatible)
104-
moshcode <tool> [args…] transparently invoke ugig or coinpay
104+
moshcode <tool> [args…] transparently invoke ugig, coinpay, or c0mpute
105105
moshcode run [file.mosh] [--max N] run a moshscript (stdin with '-', or the
106106
built-in loop if no file); --max bounds
107107
the while loop (default 3)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moshcode",
3-
"version": "0.9.2",
3+
"version": "0.9.3",
44
"type": "module",
55
"description": "moshcode — a metal wrapper for coding engines and native UGig/CoinPay workflow CLIs, with OpenPRD and moshscript",
66
"bin": {

src/tools.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Adjacent workflow CLIs moshcode can install and transparently invoke.
22
// These are deliberately separate from coding engines: UGig owns marketplace
3-
// workflows, CoinPay owns payment workflows, and moshcode only conducts their
4-
// native command lines.
3+
// workflows, CoinPay owns payment workflows, c0mpute owns the compute network,
4+
// and moshcode only conducts their native command lines.
55
import { isInstalled, openPassthrough } from "./engines.mjs";
66

77
export const TOOLS = {
@@ -17,6 +17,12 @@ export const TOOLS = {
1717
// CoinPay ships via its own install script (fetched from GitHub), not npm.
1818
install: { cmd: "sh", args: ["-c", "curl -fsSL https://coinpayportal.com/install.sh | sh"] },
1919
},
20+
c0mpute: {
21+
desc: "c0mpute — decentralized compute network CLI",
22+
bin: "c0mpute",
23+
// c0mpute ships via its own install script (the v1 stack installer).
24+
install: { cmd: "sh", args: ["-c", "curl -fsSL https://c0mpute.com/install.sh | sh"] },
25+
},
2026
};
2127

2228
/** Resolve a name to `[key, tool]`, or null. */

src/tui.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function printEngines() {
105105
}
106106

107107
function printTools() {
108-
console.log(bone(" tools") + ash(" — run one with ") + acid("/ugig") + ash(" or ") + acid("/coinpay"));
108+
console.log(bone(" tools") + ash(" — run one with ") + acid("/ugig") + ash(", ") + acid("/coinpay") + ash(", or ") + acid("/c0mpute"));
109109
for (const tool of toolStatus()) {
110110
const dot = tool.installed ? acid("●") : ash("○");
111111
console.log(` ${dot} ${bone(tool.key.padEnd(9))} ${ash(tool.installed ? "installed" : "not installed — /install " + tool.key)}`);
@@ -118,9 +118,10 @@ function printHelp() {
118118
` ${acid("/agents")} list coding engines`,
119119
` ${acid("/agents <name>")} autonomous launch; bypass/auto-approve native permissions`,
120120
` ${acid("/start <name>")} raw launch; inject no engine arguments`,
121-
` ${acid("/tools")} list workflow tools (ugig · coinpay)`,
121+
` ${acid("/tools")} list workflow tools (ugig · coinpay · c0mpute)`,
122122
` ${acid("/ugig [args…]")} hand off to the native UGig CLI`,
123123
` ${acid("/coinpay [args…]")} hand off to the native CoinPay CLI`,
124+
` ${acid("/c0mpute [args…]")} hand off to the native c0mpute CLI`,
124125
` ${acid("/mcp install <url>")} register an MCP server across every engine that supports it`,
125126
` ${acid("/skill install <url>")} install a skill across every engine that supports it`,
126127
` ${acid("/install <name>")} install an engine or workflow tool`,

test/tools.test.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function run(args, { binDir, cwd, input = "", env = {} } = {}) {
6767
test("tool registry uses the official native CLI packages", () => {
6868
assert.deepEqual(resolveTool("UGIG"), ["ugig", TOOLS.ugig]);
6969
assert.deepEqual(resolveTool("coinpay"), ["coinpay", TOOLS.coinpay]);
70+
assert.deepEqual(resolveTool("c0mpute"), ["c0mpute", TOOLS.c0mpute]);
7071
assert.equal(resolveTool("claude"), null);
7172
assert.deepEqual(TOOLS.ugig.install, {
7273
cmd: "bash",
@@ -76,8 +77,13 @@ test("tool registry uses the official native CLI packages", () => {
7677
cmd: "sh",
7778
args: ["-c", "curl -fsSL https://coinpayportal.com/install.sh | sh"],
7879
});
80+
assert.deepEqual(TOOLS.c0mpute.install, {
81+
cmd: "sh",
82+
args: ["-c", "curl -fsSL https://c0mpute.com/install.sh | sh"],
83+
});
7984
assert.match(toolList(), /ugig/);
8085
assert.match(toolList(), /coinpay/);
86+
assert.match(toolList(), /c0mpute/);
8187
});
8288

8389
for (const name of ["ugig", "coinpay"]) {
@@ -149,6 +155,7 @@ test("tools status reports native executables found on PATH", async () => {
149155
for (const [name, shell, script] of [
150156
["ugig", "bash", "curl -fsSL https://ugig.net/install.sh | bash"],
151157
["coinpay", "sh", "curl -fsSL https://coinpayportal.com/install.sh | sh"],
158+
["c0mpute", "sh", "curl -fsSL https://c0mpute.com/install.sh | sh"],
152159
]) {
153160
test(`install ${name} delegates to its official install script`, async () => {
154161
const root = tempDir("moshcode-install-");

test/upgrade.test.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { planUpgrade } from "../src/upgrade.mjs";
88

99
function withFakeTools(fn) {
1010
const dir = mkdtempSync(path.join(tmpdir(), "moshcode-upgrade-"));
11-
for (const name of ["ugig", "coinpay"]) {
11+
for (const name of ["ugig", "coinpay", "c0mpute"]) {
1212
const file = path.join(dir, name);
1313
writeFileSync(file, "#!/bin/sh\nexit 0\n");
1414
chmodSync(file, 0o755);
@@ -27,6 +27,7 @@ test("upgrade tools selects installed workflow tools without self or engines", (
2727
assert.deepEqual(plan.items.map(({ key, kind }) => ({ key, kind })), [
2828
{ key: "ugig", kind: "tool" },
2929
{ key: "coinpay", kind: "tool" },
30+
{ key: "c0mpute", kind: "tool" },
3031
]);
3132
});
3233
});

0 commit comments

Comments
 (0)