spets 0.1.62 → 0.1.63
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/dist/index.js +66 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -140,18 +140,17 @@ function installCodexPlugin() {
|
|
|
140
140
|
console.log("No additional Codex processes are spawned.");
|
|
141
141
|
}
|
|
142
142
|
function installOpenCodePlugin() {
|
|
143
|
-
const
|
|
144
|
-
mkdirSync(
|
|
145
|
-
const
|
|
146
|
-
writeFileSync(
|
|
143
|
+
const commandsDir = join2(process.cwd(), ".opencode", "commands");
|
|
144
|
+
mkdirSync(commandsDir, { recursive: true });
|
|
145
|
+
const commandPath = join2(commandsDir, "spets.md");
|
|
146
|
+
writeFileSync(commandPath, getOpenCodeCommandContent());
|
|
147
147
|
console.log("Installed OpenCode plugin.");
|
|
148
|
-
console.log(`Location: ${
|
|
148
|
+
console.log(`Location: ${commandPath}`);
|
|
149
149
|
console.log("");
|
|
150
150
|
console.log("Usage in OpenCode:");
|
|
151
|
-
console.log(
|
|
151
|
+
console.log(' /spets "your task description"');
|
|
152
152
|
console.log("");
|
|
153
|
-
console.log("This
|
|
154
|
-
console.log("No additional OpenCode processes are spawned.");
|
|
153
|
+
console.log("This command runs deterministically within your OpenCode session.");
|
|
155
154
|
}
|
|
156
155
|
async function uninstallPlugin(name) {
|
|
157
156
|
if (name === "claude") {
|
|
@@ -201,22 +200,12 @@ async function uninstallPlugin(name) {
|
|
|
201
200
|
return;
|
|
202
201
|
}
|
|
203
202
|
if (name === "opencode") {
|
|
204
|
-
const
|
|
205
|
-
const
|
|
203
|
+
const projectCommandPath = join2(process.cwd(), ".opencode", "commands", "spets.md");
|
|
204
|
+
const globalCommandPath = join2(homedir(), ".config", "opencode", "commands", "spets.md");
|
|
206
205
|
let uninstalled = false;
|
|
207
|
-
for (const
|
|
208
|
-
if (existsSync2(
|
|
209
|
-
rmSync(
|
|
210
|
-
try {
|
|
211
|
-
const skillDir = join2(skillPath, "..");
|
|
212
|
-
const skillsDir = join2(skillDir, "..");
|
|
213
|
-
rmSync(skillDir, { recursive: true });
|
|
214
|
-
const remaining = readdirSync(skillsDir);
|
|
215
|
-
if (remaining.length === 0) {
|
|
216
|
-
rmSync(skillsDir);
|
|
217
|
-
}
|
|
218
|
-
} catch {
|
|
219
|
-
}
|
|
206
|
+
for (const commandPath of [projectCommandPath, globalCommandPath]) {
|
|
207
|
+
if (existsSync2(commandPath)) {
|
|
208
|
+
rmSync(commandPath);
|
|
220
209
|
uninstalled = true;
|
|
221
210
|
}
|
|
222
211
|
}
|
|
@@ -244,8 +233,8 @@ async function listPlugins() {
|
|
|
244
233
|
const codexGlobalPath = join2(homedir(), ".codex", "skills", "spets", "SKILL.md");
|
|
245
234
|
const codexInstalled = existsSync2(codexProjectPath) || existsSync2(codexGlobalPath);
|
|
246
235
|
const codexLocation = existsSync2(codexProjectPath) ? "project" : existsSync2(codexGlobalPath) ? "global" : null;
|
|
247
|
-
const opencodeProjectPath = join2(process.cwd(), ".opencode", "
|
|
248
|
-
const opencodeGlobalPath = join2(homedir(), ".config", "opencode", "
|
|
236
|
+
const opencodeProjectPath = join2(process.cwd(), ".opencode", "commands", "spets.md");
|
|
237
|
+
const opencodeGlobalPath = join2(homedir(), ".config", "opencode", "commands", "spets.md");
|
|
249
238
|
const opencodeInstalled = existsSync2(opencodeProjectPath) || existsSync2(opencodeGlobalPath);
|
|
250
239
|
const opencodeLocation = existsSync2(opencodeProjectPath) ? "project" : existsSync2(opencodeGlobalPath) ? "global" : null;
|
|
251
240
|
console.log("Installed:");
|
|
@@ -366,8 +355,58 @@ $ARGUMENTS
|
|
|
366
355
|
description: Task description for the workflow
|
|
367
356
|
`;
|
|
368
357
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
358
|
+
function getOpenCodeCommandContent() {
|
|
359
|
+
return `---
|
|
360
|
+
description: SDD workflow executor - orchestrator-controlled spec-driven development
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
# Spets Workflow Executor
|
|
364
|
+
|
|
365
|
+
## Start
|
|
366
|
+
|
|
367
|
+
\`\`\`bash
|
|
368
|
+
npx spets orchestrate init "$ARGUMENTS"
|
|
369
|
+
\`\`\`
|
|
370
|
+
|
|
371
|
+
## Loop
|
|
372
|
+
|
|
373
|
+
Repeat until \`type\` is \`"complete"\` or \`"error"\`:
|
|
374
|
+
|
|
375
|
+
1. Parse JSON response
|
|
376
|
+
2. Do the action for \`type\`
|
|
377
|
+
3. Run \`onComplete\` command with JSON (single line, single quotes)
|
|
378
|
+
4. Go to step 1
|
|
379
|
+
|
|
380
|
+
## Shell Command Format
|
|
381
|
+
|
|
382
|
+
All commands must be a single line. Minify JSON (no newlines):
|
|
383
|
+
|
|
384
|
+
\`\`\`bash
|
|
385
|
+
npx spets orchestrate explore-done task-123 '{"summary":"...","relevantFiles":[]}'
|
|
386
|
+
\`\`\`
|
|
387
|
+
|
|
388
|
+
## Actions
|
|
389
|
+
|
|
390
|
+
### type: "phase"
|
|
391
|
+
|
|
392
|
+
| phase | Action |
|
|
393
|
+
|-------|--------|
|
|
394
|
+
| explore | Follow \`prompt\` \u2192 \`onComplete '<minified_json>'\` |
|
|
395
|
+
| clarify | Follow \`prompt\` \u2192 \`onComplete '<minified_json>'\` |
|
|
396
|
+
| execute | Follow \`prompt\`, write to \`context.output\` \u2192 run \`onComplete\` |
|
|
397
|
+
| verify | Follow \`prompt\` \u2192 \`onComplete '<minified_json>'\` |
|
|
398
|
+
|
|
399
|
+
### type: "checkpoint"
|
|
400
|
+
|
|
401
|
+
| checkpoint | Action |
|
|
402
|
+
|------------|--------|
|
|
403
|
+
| clarify | Ask user each \`questions[]\` \u2192 \`onComplete '<minified_json>'\` |
|
|
404
|
+
| approve | Read \`specPath\`, summarize, ask user \u2192 run \`onComplete[choice]\` |
|
|
405
|
+
|
|
406
|
+
### type: "complete" / "error"
|
|
407
|
+
|
|
408
|
+
Print message and stop.
|
|
409
|
+
`;
|
|
371
410
|
}
|
|
372
411
|
|
|
373
412
|
// src/commands/init.ts
|