mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
Add LogicSRC CLI and AgentSwarm surfaces
This commit is contained in:
parent
ec2e721df1
commit
3b3d7ec09a
8 changed files with 149 additions and 22 deletions
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
"name": "@logicsrc/cli",
|
||||
"version": "0.1.0",
|
||||
"description": "CommandBoard.run CLI.",
|
||||
"description": "LogicSRC OpenSpec CLI.",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"bin": {
|
||||
"logicsrc": "./dist/index.js",
|
||||
"commandboard": "./dist/index.js",
|
||||
"cb": "./dist/index.js"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
import { readFileSync } from "node:fs";
|
||||
import { basename } from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { renderPluginStatus, renderTui } from "@logicsrc/tui";
|
||||
import { assertSchemaKind, parseDocument, validate } from "@logicsrc/validators";
|
||||
|
|
@ -8,11 +9,14 @@ import { print, type OutputFormat } from "./format.js";
|
|||
import { defaultPluginRegistry } from "./registry.js";
|
||||
|
||||
const program = new Command();
|
||||
const binaryName = basename(process.argv[1] ?? "");
|
||||
const commandName = binaryName === "commandboard" || binaryName === "cb" ? binaryName : "logicsrc";
|
||||
|
||||
program
|
||||
.name("commandboard")
|
||||
.alias("cb")
|
||||
.description("CommandBoard.run CLI for LogicSRC boards, tasks, agents, payments, plugins, and TUI.")
|
||||
.name(commandName)
|
||||
.aliases(["commandboard", "cb"])
|
||||
.description("LogicSRC OpenSpec CLI for schemas, boards, tasks, agents, payments, plugins, and TUI.")
|
||||
.option("--openspec-only", "Restrict workflows to LogicSRC OpenSpec schemas, SDKs, MCP, CLI, TUI, and PWA contracts.")
|
||||
.version("0.1.0");
|
||||
|
||||
program
|
||||
|
|
@ -122,6 +126,38 @@ program.command("events").description("Listen to LogicSRC event stream.").argume
|
|||
console.log(JSON.stringify({ type: "logicsrc.event", event: "task.created", resource_id: "task_789" }));
|
||||
});
|
||||
|
||||
program
|
||||
.command("agentswarm")
|
||||
.alias("agent-swarm")
|
||||
.description("Open an AgentSwarm master agent session.")
|
||||
.option("--yolo", "Start the master agent with autonomous execution enabled.")
|
||||
.option("--repo <repo>", "Target repository, for example profullstack/logicsrc")
|
||||
.option("--agents <agents>", "Comma-separated slave agent roles", "reproduce,patch,review")
|
||||
.action((options) => {
|
||||
if (!options.yolo) {
|
||||
console.log("AgentSwarm is coming soon. Run `logicsrc agentswarm --yolo` to open the master agent flow.");
|
||||
return;
|
||||
}
|
||||
|
||||
const slaveAgents = String(options.agents)
|
||||
.split(",")
|
||||
.map((agent) => agent.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
print(
|
||||
{
|
||||
type: "logicsrc.agentswarm.session",
|
||||
status: "opening",
|
||||
mode: "yolo",
|
||||
master_agent: "agentswarm-master",
|
||||
slave_agents: slaveAgents,
|
||||
repo: options.repo ?? null,
|
||||
openspec_only: program.opts().openspecOnly || process.env.LOGICSRC_OPENSPEC_ONLY === "1"
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
program.command("plugins").option("--format <format>", "table, json, or markdown", "table").description("Show plugin status.").action((options) => {
|
||||
const snapshot = defaultPluginRegistry().snapshot();
|
||||
print(snapshot.plugins, options.format as OutputFormat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue