superacli 1.1.9 → 1.1.12
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/__tests__/jsalt-plugin.test.js +108 -0
- package/gateway.log +2040 -0
- package/package.json +1 -1
- package/plugins/clawteam/README.md +54 -0
- package/plugins/clawteam/learn.md +58 -0
- package/plugins/clawteam/plugin.json +141 -0
- package/plugins/clawteam/scripts/post-install.js +163 -0
- package/plugins/clawteam/scripts/post-uninstall.js +25 -0
- package/plugins/clawteam/scripts/system-setup.js +82 -0
- package/plugins/clawteam/skills/case-study/SKILL.md +110 -0
- package/plugins/clawteam/skills/setup/SKILL.md +44 -0
- package/plugins/clawteam/skills/usage/SKILL.md +45 -0
- package/plugins/jsalt/README.md +36 -0
- package/plugins/jsalt/plugin.json +109 -0
- package/plugins/jsalt/skills/quickstart/SKILL.md +94 -0
- package/plugins/opencode/plugin.json +43 -0
- package/plugins/plugins.json +29 -0
- package/plugins/pplx/README.md +95 -0
- package/plugins/pplx/plugin.json +123 -0
- package/plugins/pplx/skills/usage/SKILL.md +121 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const fs = require("fs")
|
|
2
|
+
const os = require("os")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const { execSync } = require("child_process")
|
|
5
|
+
|
|
6
|
+
const CLI = path.join(__dirname, "..", "cli", "supercli.js")
|
|
7
|
+
|
|
8
|
+
function runNoServer(args, options = {}) {
|
|
9
|
+
try {
|
|
10
|
+
const env = { ...process.env }
|
|
11
|
+
delete env.SUPERCLI_SERVER
|
|
12
|
+
const out = execSync(`node ${CLI} ${args}`, {
|
|
13
|
+
encoding: "utf-8",
|
|
14
|
+
timeout: 15000,
|
|
15
|
+
env: { ...env, ...(options.env || {}) }
|
|
16
|
+
})
|
|
17
|
+
return { ok: true, output: out.trim(), code: 0 }
|
|
18
|
+
} catch (err) {
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
output: (err.stdout || "").trim(),
|
|
22
|
+
stderr: (err.stderr || "").trim(),
|
|
23
|
+
code: err.status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function writeFakeJsaAstBinary(dir) {
|
|
29
|
+
const bin = path.join(dir, "jsa-ast")
|
|
30
|
+
fs.writeFileSync(bin, [
|
|
31
|
+
"#!/usr/bin/env node",
|
|
32
|
+
"const args = process.argv.slice(2);",
|
|
33
|
+
"const firstPath = args.find(a => !a.startsWith('-')) || '';",
|
|
34
|
+
"if (args[0] === '--help') { console.log('JSA AST CLI help'); process.exit(0); }",
|
|
35
|
+
"if (args[0] === '--version') { console.log('jsa-ast 1.0.0-test'); process.exit(0); }",
|
|
36
|
+
"if (args.includes('--tree')) { console.log('program\\n element: div'); process.exit(0); }",
|
|
37
|
+
"if (args.includes('--json')) {",
|
|
38
|
+
" console.log(JSON.stringify({ ok: true, mode: 'json', path: firstPath, args }));",
|
|
39
|
+
" process.exit(0);",
|
|
40
|
+
"}",
|
|
41
|
+
"if (firstPath) { console.log(`validated:${firstPath}`); process.exit(0); }",
|
|
42
|
+
"console.log(JSON.stringify({ ok: true, args }));"
|
|
43
|
+
].join("\n"), "utf-8")
|
|
44
|
+
fs.chmodSync(bin, 0o755)
|
|
45
|
+
return bin
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
describe("jsalt plugin", () => {
|
|
49
|
+
const fakeDir = fs.mkdtempSync(path.join(os.tmpdir(), "dcli-jsalt-"))
|
|
50
|
+
const tempHome = fs.mkdtempSync(path.join(os.tmpdir(), "dcli-home-jsalt-"))
|
|
51
|
+
writeFakeJsaAstBinary(fakeDir)
|
|
52
|
+
const env = { ...process.env, PATH: `${fakeDir}:${process.env.PATH || ""}`, SUPERCLI_HOME: tempHome }
|
|
53
|
+
|
|
54
|
+
beforeAll(() => {
|
|
55
|
+
runNoServer("plugins install ./plugins/jsalt --on-conflict replace --json", { env })
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
afterAll(() => {
|
|
59
|
+
runNoServer("plugins remove jsalt --json", { env })
|
|
60
|
+
fs.rmSync(fakeDir, { recursive: true, force: true })
|
|
61
|
+
fs.rmSync(tempHome, { recursive: true, force: true })
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
test("routes ast validate wrapped command", () => {
|
|
65
|
+
const r = runNoServer("jsalt ast validate --path examples/counter.jsa --json", { env })
|
|
66
|
+
expect(r.ok).toBe(true)
|
|
67
|
+
const data = JSON.parse(r.output)
|
|
68
|
+
expect(data.command).toBe("jsalt.ast.validate")
|
|
69
|
+
expect(data.data.raw).toBe("validated:examples/counter.jsa")
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
test("routes ast json wrapped command", () => {
|
|
73
|
+
const r = runNoServer("jsalt ast json --path examples/counter.jsa --json", { env })
|
|
74
|
+
expect(r.ok).toBe(true)
|
|
75
|
+
const data = JSON.parse(r.output)
|
|
76
|
+
expect(data.command).toBe("jsalt.ast.json")
|
|
77
|
+
expect(data.data.mode).toBe("json")
|
|
78
|
+
expect(data.data.path).toBe("examples/counter.jsa")
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
test("supports namespace passthrough", () => {
|
|
82
|
+
const r = runNoServer("jsalt examples/counter.jsa --foo bar --json", { env })
|
|
83
|
+
expect(r.ok).toBe(true)
|
|
84
|
+
const data = JSON.parse(r.output)
|
|
85
|
+
expect(data.command).toBe("jsalt.passthrough")
|
|
86
|
+
expect(data.data.args[0]).toBe("examples/counter.jsa")
|
|
87
|
+
expect(data.data.args).toContain("--foo")
|
|
88
|
+
expect(data.data.args).toContain("bar")
|
|
89
|
+
expect(data.data.args).toContain("--json")
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
test("doctor reports jsa-ast dependency as healthy", () => {
|
|
93
|
+
const r = runNoServer("plugins doctor jsalt --json", { env })
|
|
94
|
+
expect(r.ok).toBe(true)
|
|
95
|
+
const data = JSON.parse(r.output)
|
|
96
|
+
expect(data.ok).toBe(true)
|
|
97
|
+
expect(data.checks.some(c => c.type === "binary" && c.binary === "jsa-ast" && c.ok === true)).toBe(true)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test("learn returns quickstart content", () => {
|
|
101
|
+
const r = runNoServer("plugins learn jsalt --json", { env })
|
|
102
|
+
expect(r.ok).toBe(true)
|
|
103
|
+
const data = JSON.parse(r.output)
|
|
104
|
+
expect(data.plugin).toBe("jsalt")
|
|
105
|
+
expect(data.learn_markdown).toContain("jsalt Quickstart")
|
|
106
|
+
expect(data.learn_markdown).toContain("Core JSALT syntax checklist")
|
|
107
|
+
})
|
|
108
|
+
})
|