@moltbankhq/openclaw 0.1.4 → 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 +8 -0
- package/bin/moltbank.mjs +5 -1
- package/index.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,12 +8,20 @@ Standalone CLI and optional OpenClaw plugin for [MoltBank](https://moltbank.bot)
|
|
|
8
8
|
npm install -g @moltbankhq/openclaw
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Plain `npm install @moltbankhq/openclaw` installs the package locally in the current directory, but it does **not** put `moltbank` on your interactive shell `PATH`.
|
|
12
|
+
|
|
11
13
|
You can also run it without a global install:
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
16
|
npx @moltbankhq/openclaw setup
|
|
15
17
|
```
|
|
16
18
|
|
|
19
|
+
Or from a local install:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm exec --package @moltbankhq/openclaw -- moltbank setup
|
|
23
|
+
```
|
|
24
|
+
|
|
17
25
|
OpenClaw plugin mode still exists in this pass for compatibility:
|
|
18
26
|
|
|
19
27
|
```bash
|
package/bin/moltbank.mjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { createRequire } from 'module';
|
|
3
4
|
import { spawnSync } from 'child_process';
|
|
4
5
|
import { dirname, resolve } from 'path';
|
|
5
6
|
import { fileURLToPath } from 'url';
|
|
6
7
|
|
|
7
8
|
const binDir = dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const cliPath = resolve(binDir, '../cli.ts');
|
|
9
|
-
const
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const tsxImportPath = require.resolve('tsx/esm');
|
|
12
|
+
|
|
13
|
+
const result = spawnSync(process.execPath, ['--import', tsxImportPath, cliPath, ...process.argv.slice(2)], {
|
|
10
14
|
stdio: 'inherit',
|
|
11
15
|
env: process.env
|
|
12
16
|
});
|
package/index.ts
CHANGED
|
@@ -282,7 +282,7 @@ function ensureWrapperExecutable(skillDir: string, api: LoggerApi): void {
|
|
|
282
282
|
|
|
283
283
|
const SKILL_FILES = [
|
|
284
284
|
'README.md',
|
|
285
|
-
'
|
|
285
|
+
'SKILL.md',
|
|
286
286
|
'skill.json',
|
|
287
287
|
'install.sh',
|
|
288
288
|
'assets/mcporter.json',
|
|
@@ -337,7 +337,7 @@ function ensureSkillInstalled(
|
|
|
337
337
|
|
|
338
338
|
const filesJson = JSON.stringify(SKILL_FILES).replace(/"/g, '\\"');
|
|
339
339
|
const installNode = run(
|
|
340
|
-
`node --input-type=module -e "import fs from 'fs'; import path from 'path'; const baseRaw=process.argv[1]; const dir=process.argv[2]; const files=JSON.parse(process.argv[3]); const base=baseRaw.endsWith('/') ? baseRaw.slice(0,-1) : baseRaw; fs.mkdirSync(dir,{recursive:true}); for (const f of files){ const
|
|
340
|
+
`node --input-type=module -e "import fs from 'fs'; import path from 'path'; const baseRaw=process.argv[1]; const dir=process.argv[2]; const files=JSON.parse(process.argv[3]); const base=baseRaw.endsWith('/') ? baseRaw.slice(0,-1) : baseRaw; const aliases={ 'SKILL.md':['SKILL.md','skill.md'], 'skill.md':['skill.md','SKILL.md'] }; fs.mkdirSync(dir,{recursive:true}); for (const f of files){ const out=path.join(dir,f); fs.mkdirSync(path.dirname(out),{recursive:true}); let body=null; let lastUrl=''; let lastStatus=''; for (const candidate of (aliases[f] ?? [f])){ const u=base+'/'+candidate; lastUrl=u; const r=await fetch(u); if(r.ok){ body=await r.text(); break; } lastStatus=String(r.status); } if(body===null){ console.error('download failed',lastUrl,lastStatus); process.exit(2);} fs.writeFileSync(out, body,'utf8'); } fs.writeFileSync(path.join(dir,'.install_success'),'ok\\n','utf8');" "${appBaseUrl}" "${skillDir}" "${filesJson}"`,
|
|
341
341
|
{ cwd: dirname(skillDir), silent: true }
|
|
342
342
|
);
|
|
343
343
|
|
|
@@ -1294,7 +1294,7 @@ export async function runSetup(
|
|
|
1294
1294
|
} else if (hostReady) {
|
|
1295
1295
|
api.logger.info('[moltbank] ✓ host ready');
|
|
1296
1296
|
}
|
|
1297
|
-
api.logger.info(`[moltbank] skill: ${skillDir}/
|
|
1297
|
+
api.logger.info(`[moltbank] skill: ${skillDir}/SKILL.md`);
|
|
1298
1298
|
api.logger.info(`[moltbank] mcporter: ${skillDir}/assets/mcporter.json`);
|
|
1299
1299
|
if (sandbox) {
|
|
1300
1300
|
const finalConfig = readOpenclawConfig();
|