@oxgeneral/orch 1.0.1 → 1.0.3
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/App-A5TZETZ2.js +21 -0
- package/dist/agent-Q34L27AY.js +9 -0
- package/dist/agent-shop-D2RS4BZK.js +2 -0
- package/dist/chunk-4MMHVHA6.js +112 -0
- package/dist/chunk-64WUDYEM.js +6 -0
- package/dist/chunk-6MJ7V6VY.js +2 -0
- package/dist/{chunk-DAVHOWGD.js → chunk-BCPUTULS.js} +16 -188
- package/dist/{chunk-UIJYU3J7.js → chunk-BSJVYRI3.js} +5 -2
- package/dist/chunk-BSJVYRI3.js.map +1 -0
- package/dist/chunk-CDFA4IIQ.js +2 -0
- package/dist/chunk-CHRW4CLD.js +2 -0
- package/dist/{chunk-O2OQCSBL.js → chunk-FDSFFFMT.js} +46 -29
- package/dist/chunk-FDSFFFMT.js.map +1 -0
- package/dist/chunk-HMMPM7MF.js +3 -0
- package/dist/chunk-HXOMNULD.js +2 -0
- package/dist/chunk-IKNBPOQL.js +2 -0
- package/dist/chunk-KFQTWMZI.js +3 -0
- package/dist/chunk-LXNRCJ22.js +2 -0
- package/dist/{chunk-C6XZ3FJT.js → chunk-MOWC2CHX.js} +7 -4
- package/dist/chunk-MOWC2CHX.js.map +1 -0
- package/dist/chunk-P4JTJBWO.js +2 -0
- package/dist/chunk-PJ5DKXGR.js +2 -0
- package/dist/chunk-QNZ6D63E.js +4 -0
- package/dist/chunk-RHFRHCN5.js +16 -0
- package/dist/chunk-RHFRHCN5.js.map +1 -0
- package/dist/chunk-TPTHLFOB.js +2 -0
- package/dist/chunk-UMZEA3JT.js +5 -0
- package/dist/chunk-X54D5JZG.js +11 -0
- package/dist/{claude-WUJU5KIE.js → claude-4R6L6BWY.js} +4 -4
- package/dist/{claude-WUJU5KIE.js.map → claude-4R6L6BWY.js.map} +1 -1
- package/dist/claude-ZLVOLRUG.js +2 -0
- package/dist/cli.js +1 -199
- package/dist/clipboard-service-WVON5ZN4.js +25 -0
- package/dist/{codex-NYJWEPRQ.js → codex-IMOW5ZUZ.js} +4 -4
- package/dist/{codex-NYJWEPRQ.js.map → codex-IMOW5ZUZ.js.map} +1 -1
- package/dist/codex-YRSODLH4.js +2 -0
- package/dist/config-OOB7QEKM.js +2 -0
- package/dist/container-CFMUT5KS.js +4 -0
- package/dist/context-FXRERFSP.js +7 -0
- package/dist/cursor-2HILMNM3.js +2 -0
- package/dist/{cursor-3YHVD4NP.js → cursor-NHV7X3WG.js} +4 -4
- package/dist/{cursor-3YHVD4NP.js.map → cursor-NHV7X3WG.js.map} +1 -1
- package/dist/doctor-GKTV4YYD.js +2 -0
- package/dist/doctor-service-PB7YBH3F.js +2 -0
- package/dist/editor-7IFRWVTL.js +8 -0
- package/dist/goal-RNNZYMNR.js +8 -0
- package/dist/index.d.ts +16 -14
- package/dist/index.js +247 -75
- package/dist/index.js.map +1 -1
- package/dist/init-56QC5QVX.js +53 -0
- package/dist/logs-4ISTWUWV.js +12 -0
- package/dist/msg-4ELI7Q52.js +9 -0
- package/dist/opencode-3S4VDXRG.js +2 -0
- package/dist/{opencode-FAMPSA6X.js → opencode-ULT6DYCT.js} +6 -5
- package/dist/opencode-ULT6DYCT.js.map +1 -0
- package/dist/orchestrator-6XH2TY3T.js +6 -0
- package/dist/{orchestrator-X2CWGFCL.js.map → orchestrator-6XH2TY3T.js.map} +1 -1
- package/dist/orchestrator-DRITPUWT.js +13 -0
- package/dist/org-WAK3CDPG.js +3 -0
- package/dist/process-manager-33H27MQF.js +2 -0
- package/dist/registry-BO2PPRNG.js +2 -0
- package/dist/run-NE5E4JPW.js +3 -0
- package/dist/shell-OBHIVC2H.js +2 -0
- package/dist/{shell-NJNW3O6K.js → shell-UXEJRK3D.js} +4 -4
- package/dist/{shell-NJNW3O6K.js.map → shell-UXEJRK3D.js.map} +1 -1
- package/dist/shop-picker-LE3SKFOX.js +5 -0
- package/dist/status-NYHZ7Q5G.js +2 -0
- package/dist/task-JUS5OZJR.js +20 -0
- package/dist/team-VCJSUDWX.js +4 -0
- package/dist/template-engine-42PKL5KD.js +2 -0
- package/dist/tui-R6LXKKSH.js +2 -0
- package/dist/update-FFKCOV63.js +2 -0
- package/dist/update-check-HGMBDYHL.js +2 -0
- package/dist/{workspace-manager-EVD67GCG.js → workspace-manager-ABXFBL2A.js} +3 -3
- package/dist/{workspace-manager-EVD67GCG.js.map → workspace-manager-ABXFBL2A.js.map} +1 -1
- package/dist/workspace-manager-Q6WWXSTR.js +3 -0
- package/package.json +1 -1
- package/readme.md +5 -5
- package/dist/App-GJVTVGRU.js +0 -6717
- package/dist/agent-7ZJ3ZDJ7.js +0 -183
- package/dist/agent-shop-YN2BSLHM.js +0 -2
- package/dist/chunk-2C2TFQ7K.js +0 -136
- package/dist/chunk-45K2XID7.js +0 -29
- package/dist/chunk-4IFIOMCW.js +0 -86
- package/dist/chunk-7X2GI5OV.js +0 -181
- package/dist/chunk-C6XZ3FJT.js.map +0 -1
- package/dist/chunk-CHIP7O6V.js +0 -83
- package/dist/chunk-FRTKB575.js +0 -87
- package/dist/chunk-HXYAZGLP.js +0 -15
- package/dist/chunk-I3SMISEF.js +0 -29
- package/dist/chunk-K6DMQERQ.js +0 -89
- package/dist/chunk-LV6GDBBI.js +0 -297
- package/dist/chunk-MGGSRXWJ.js +0 -69
- package/dist/chunk-O2OQCSBL.js.map +0 -1
- package/dist/chunk-P6ATSXGL.js +0 -107
- package/dist/chunk-PNE6LQRF.js +0 -5
- package/dist/chunk-U2VDNUZL.js +0 -52
- package/dist/chunk-UIJYU3J7.js.map +0 -1
- package/dist/chunk-VXS2CJFH.js +0 -273
- package/dist/chunk-XDVMX2FO.js +0 -8
- package/dist/chunk-XDVMX2FO.js.map +0 -1
- package/dist/chunk-XJTJ2TJV.js +0 -221
- package/dist/claude-ZUEKJJ4X.js +0 -5
- package/dist/clipboard-service-RTDUUQQU.js +0 -200
- package/dist/codex-7IXXXG5U.js +0 -123
- package/dist/config-OTAVSMOD.js +0 -75
- package/dist/container-RY54L3XC.js +0 -1596
- package/dist/context-OL4BVUV5.js +0 -83
- package/dist/cursor-622RBRHH.js +0 -97
- package/dist/doctor-XSGQSD57.js +0 -67
- package/dist/doctor-service-TPOMFAIG.js +0 -2
- package/dist/goal-FMYYN2FR.js +0 -138
- package/dist/init-45BEMVL6.js +0 -199
- package/dist/logs-PHPYWQ6I.js +0 -207
- package/dist/msg-FUWWLEKM.js +0 -95
- package/dist/opencode-FAMPSA6X.js.map +0 -1
- package/dist/opencode-WOR53TSC.js +0 -98
- package/dist/orchestrator-O6MFMATT.js +0 -1448
- package/dist/orchestrator-X2CWGFCL.js +0 -5
- package/dist/process-manager-HUVNAPQV.js +0 -2
- package/dist/registry-PQWRVNF2.js +0 -2
- package/dist/run-N72G5V2H.js +0 -95
- package/dist/shell-DVFHHYAZ.js +0 -5
- package/dist/shop-picker-2HY67UWP.js +0 -79
- package/dist/status-RZWN2C6C.js +0 -56
- package/dist/task-5EL2RNGW.js +0 -221
- package/dist/team-PFLP4PPL.js +0 -97
- package/dist/template-engine-AWIS56BL.js +0 -3
- package/dist/tui-LN5XHSQY.js +0 -245
- package/dist/update-YLP7FPNY.js +0 -64
- package/dist/update-check-4YKLGBFB.js +0 -2
- package/dist/workspace-manager-JM6U7JOH.js +0 -215
package/dist/run-N72G5V2H.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { printError, amber, printSuccess, dim, getIcon } from './chunk-7X2GI5OV.js';
|
|
3
|
-
|
|
4
|
-
// src/cli/commands/run.ts
|
|
5
|
-
function registerRunCommand(program, container) {
|
|
6
|
-
program.command("run [task-id]").description("Run tasks").option("--all", "Run all todo tasks").option("--watch", "Watch mode: continuous orchestration").action(async (taskId, opts) => {
|
|
7
|
-
await container.paths.requireInit();
|
|
8
|
-
if (opts.watch) {
|
|
9
|
-
await runWatch(container);
|
|
10
|
-
} else if (opts.all) {
|
|
11
|
-
await runAll(container);
|
|
12
|
-
} else if (taskId) {
|
|
13
|
-
await runSingle(container, taskId);
|
|
14
|
-
} else {
|
|
15
|
-
printError("Specify a task ID, --all, or --watch");
|
|
16
|
-
process.exit(2);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async function runSingle(container, taskId) {
|
|
21
|
-
const task = await container.taskService.get(taskId);
|
|
22
|
-
console.log();
|
|
23
|
-
console.log(` ${amber("orch")} \xB7 running ${taskId} "${task.title}"`);
|
|
24
|
-
const unsub = container.eventBus.onAny((event) => {
|
|
25
|
-
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
26
|
-
switch (event.type) {
|
|
27
|
-
case "agent:output":
|
|
28
|
-
console.log(` ${dim(time)} ${getIcon("agentAction")} ${typeof event.data === "string" ? event.data.slice(0, 80) : ""}`);
|
|
29
|
-
break;
|
|
30
|
-
case "agent:file_changed":
|
|
31
|
-
console.log(` ${dim(time)} ${getIcon("agentAction")} Modified ${event.path}`);
|
|
32
|
-
break;
|
|
33
|
-
case "agent:error":
|
|
34
|
-
console.log(` ${dim(time)} ${getIcon("failed")} ${event.error}`);
|
|
35
|
-
break;
|
|
36
|
-
case "agent:completed":
|
|
37
|
-
if (event.success) {
|
|
38
|
-
printSuccess("Done");
|
|
39
|
-
} else {
|
|
40
|
-
printError("Failed");
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
try {
|
|
46
|
-
await container.orchestrator.runTask(taskId);
|
|
47
|
-
} finally {
|
|
48
|
-
unsub();
|
|
49
|
-
}
|
|
50
|
-
console.log();
|
|
51
|
-
}
|
|
52
|
-
async function runAll(container) {
|
|
53
|
-
console.log();
|
|
54
|
-
console.log(` ${amber("orch")} \xB7 running all todo tasks`);
|
|
55
|
-
console.log();
|
|
56
|
-
await container.orchestrator.runAll();
|
|
57
|
-
}
|
|
58
|
-
async function runWatch(container) {
|
|
59
|
-
console.log(`${amber("orch")} \xB7 watching \xB7 poll interval ${container.config.scheduling.poll_interval_ms / 1e3}s`);
|
|
60
|
-
console.log("\u2501".repeat(43));
|
|
61
|
-
console.log();
|
|
62
|
-
container.eventBus.onAny((event) => {
|
|
63
|
-
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit" });
|
|
64
|
-
switch (event.type) {
|
|
65
|
-
case "agent:output": {
|
|
66
|
-
const data = typeof event.data === "string" ? event.data.slice(0, 60) : "";
|
|
67
|
-
console.log(`${dim(time)} ${getIcon("agentAction")} ${data}`);
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
case "agent:completed":
|
|
71
|
-
if (event.success) {
|
|
72
|
-
console.log(`${dim(time)} ${getIcon("done")} DONE ${event.runId}`);
|
|
73
|
-
} else {
|
|
74
|
-
console.log(`${dim(time)} ${getIcon("failed")} FAIL ${event.runId}`);
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case "run:retry":
|
|
78
|
-
console.log(`${dim(time)} ${getIcon("retrying")} RETRY attempt ${event.attempt} \xB7 next in ${Math.round(event.delay_ms / 1e3)}s`);
|
|
79
|
-
break;
|
|
80
|
-
case "orchestrator:tick":
|
|
81
|
-
process.stdout.write(`\r${amber("orch")} \xB7 watching \xB7 ${event.running} running \xB7 ${event.queued} queued `);
|
|
82
|
-
break;
|
|
83
|
-
case "orchestrator:stall_detected":
|
|
84
|
-
console.log(`${dim(time)} ${getIcon("warning")} STALL ${event.runId}`);
|
|
85
|
-
break;
|
|
86
|
-
case "orchestrator:shutdown":
|
|
87
|
-
console.log(`
|
|
88
|
-
${dim("Shutting down...")}`);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
await container.orchestrator.startWatch();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { registerRunCommand };
|
package/dist/shell-DVFHHYAZ.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as readline from 'readline';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
|
|
5
|
-
async function pickFromShop(templates) {
|
|
6
|
-
if (!process.stdin.isTTY) return null;
|
|
7
|
-
let selected = 0;
|
|
8
|
-
function getPageSize() {
|
|
9
|
-
const rows = process.stdout.rows ?? 24;
|
|
10
|
-
return Math.max(1, Math.min(templates.length, rows - 4));
|
|
11
|
-
}
|
|
12
|
-
function render() {
|
|
13
|
-
const pageSize = getPageSize();
|
|
14
|
-
process.stdout.write("\x1B[2J\x1B[H");
|
|
15
|
-
console.log(chalk.bold.yellow("\n AGENT SHOP") + chalk.gray(" \u2014 arrow keys to navigate, enter to select, q to cancel\n"));
|
|
16
|
-
const start = Math.max(0, Math.min(selected - Math.floor(pageSize / 2), templates.length - pageSize));
|
|
17
|
-
const end = Math.min(start + pageSize, templates.length);
|
|
18
|
-
for (let i = start; i < end; i++) {
|
|
19
|
-
const t = templates[i];
|
|
20
|
-
const isSelected = i === selected;
|
|
21
|
-
const cursor = isSelected ? chalk.yellow(" \u25B8 ") : " ";
|
|
22
|
-
const name = isSelected ? chalk.bold.white(t.name) : chalk.gray(t.name);
|
|
23
|
-
const desc = chalk.gray(` \u2014 ${t.description}`);
|
|
24
|
-
const model = chalk.gray.dim(` [${t.model.replace("claude-", "")}]`);
|
|
25
|
-
console.log(`${cursor}${name}${desc}${model}`);
|
|
26
|
-
}
|
|
27
|
-
if (templates.length > pageSize) {
|
|
28
|
-
console.log(chalk.gray(`
|
|
29
|
-
${start + 1}-${end} of ${templates.length}`));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return new Promise((resolve) => {
|
|
33
|
-
const rl = readline.createInterface({ input: process.stdin });
|
|
34
|
-
process.stdin.setRawMode(true);
|
|
35
|
-
readline.emitKeypressEvents(process.stdin);
|
|
36
|
-
function cleanup() {
|
|
37
|
-
process.stdin.removeListener("keypress", onKeypress);
|
|
38
|
-
try {
|
|
39
|
-
process.stdin.setRawMode(false);
|
|
40
|
-
} catch {
|
|
41
|
-
}
|
|
42
|
-
rl.close();
|
|
43
|
-
process.stdout.write("\x1B[2J\x1B[H");
|
|
44
|
-
}
|
|
45
|
-
const onKeypress = (_ch, key) => {
|
|
46
|
-
if (key.name === "up" || key.ctrl && key.name === "p") {
|
|
47
|
-
selected = (selected - 1 + templates.length) % templates.length;
|
|
48
|
-
render();
|
|
49
|
-
} else if (key.name === "down" || key.ctrl && key.name === "n") {
|
|
50
|
-
selected = (selected + 1) % templates.length;
|
|
51
|
-
render();
|
|
52
|
-
} else if (key.name === "return") {
|
|
53
|
-
cleanup();
|
|
54
|
-
resolve(templates[selected]);
|
|
55
|
-
} else if (key.name === "q" || key.name === "escape" || key.ctrl && key.name === "c") {
|
|
56
|
-
cleanup();
|
|
57
|
-
resolve(null);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
rl.on("error", () => {
|
|
61
|
-
cleanup();
|
|
62
|
-
resolve(null);
|
|
63
|
-
});
|
|
64
|
-
rl.on("close", () => {
|
|
65
|
-
cleanup();
|
|
66
|
-
resolve(null);
|
|
67
|
-
});
|
|
68
|
-
try {
|
|
69
|
-
render();
|
|
70
|
-
} catch {
|
|
71
|
-
cleanup();
|
|
72
|
-
resolve(null);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
process.stdin.on("keypress", onKeypress);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { pickFromShop };
|
package/dist/status-RZWN2C6C.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { formatDurationSince, amber, dim, statusIcon, agentName, priorityLabel, formatTokens } from './chunk-7X2GI5OV.js';
|
|
3
|
-
|
|
4
|
-
// src/cli/commands/status.ts
|
|
5
|
-
function registerStatusCommand(program, container) {
|
|
6
|
-
program.command("status").description("Show orchestrator status").action(async () => {
|
|
7
|
-
await container.paths.requireInit();
|
|
8
|
-
const tasks = await container.taskService.list();
|
|
9
|
-
const agents = await container.agentService.list();
|
|
10
|
-
const state = await container.stateStore.read();
|
|
11
|
-
if (container.context.json) {
|
|
12
|
-
console.log(JSON.stringify({ tasks, agents, state }, null, 2));
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const runningCount = Object.keys(state.running).length;
|
|
16
|
-
const mode = state.pid ? "watching" : "idle";
|
|
17
|
-
const uptime = state.started_at ? formatDurationSince(state.started_at) : "";
|
|
18
|
-
console.log();
|
|
19
|
-
console.log(`${amber("orch")} \xB7 ${container.config.project.name} \xB7 ${mode}`);
|
|
20
|
-
console.log();
|
|
21
|
-
const counts = {};
|
|
22
|
-
for (const t of tasks) {
|
|
23
|
-
counts[t.status] = (counts[t.status] ?? 0) + 1;
|
|
24
|
-
}
|
|
25
|
-
if (runningCount > 0) {
|
|
26
|
-
console.log(` ${"RUNNING".padEnd(12)}${runningCount}${"".padEnd(20)}AGENTS ${agents.length}`);
|
|
27
|
-
}
|
|
28
|
-
for (const [status, count] of Object.entries(counts)) {
|
|
29
|
-
if (status !== "in_progress") {
|
|
30
|
-
console.log(` ${dim(status.padEnd(12))}${count}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const runningTasks = tasks.filter((t) => t.status === "in_progress");
|
|
34
|
-
if (runningTasks.length > 0) {
|
|
35
|
-
console.log();
|
|
36
|
-
for (const t of runningTasks) {
|
|
37
|
-
const time = formatDurationSince(t.updated_at);
|
|
38
|
-
console.log(
|
|
39
|
-
` ${statusIcon("in_progress")} ${t.assignee ? agentName(t.assignee) : ""} ${t.title.slice(0, 35).padEnd(37)}${time} ${priorityLabel(t.priority)}`
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const totalTokens = state.stats.total_tokens.total;
|
|
44
|
-
const footer = [
|
|
45
|
-
uptime ? `up ${uptime}` : null,
|
|
46
|
-
totalTokens > 0 ? `${formatTokens(totalTokens)} tokens` : null
|
|
47
|
-
].filter(Boolean).join(" \xB7 ");
|
|
48
|
-
if (footer) {
|
|
49
|
-
console.log();
|
|
50
|
-
console.log(` ${dim(footer)}`);
|
|
51
|
-
}
|
|
52
|
-
console.log();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { registerStatusCommand };
|
package/dist/task-5EL2RNGW.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { openInEditor, toEditorContent, fromEditorContent } from './chunk-P6ATSXGL.js';
|
|
3
|
-
import { printSuccess, dim, formatDurationSince, statusIcon, priorityLabel, agentName, printTable, filePath, printKeyValue } from './chunk-7X2GI5OV.js';
|
|
4
|
-
|
|
5
|
-
// src/cli/commands/task.ts
|
|
6
|
-
function registerTaskCommand(program, container) {
|
|
7
|
-
const task = program.command("task").description("Manage tasks");
|
|
8
|
-
task.command("add <title>").description("Create a new task").option("-d, --description <desc>", "Task description").option("-p, --priority <n>", "Priority (1-4)", "3").option("-l, --labels <labels>", "Comma-separated labels").option("--depends-on <ids>", "Comma-separated dependency task IDs").option("--max-attempts <n>", "Max retry attempts").option("--workspace-mode <mode>", "Workspace mode: shared|worktree|isolated").option("--assignee <agent-id>", "Assign to agent").option("--review-criteria <criteria>", "Comma-separated auto-review criteria: test_pass,typecheck,lint").option("--scope <patterns>", "Comma-separated glob patterns for file scope (e.g. src/auth/**,src/session/**)").option("--goal-id <goalId>", "Associate task with a goal").option("--attach <paths>", "Comma-separated file paths to attach (screenshots, docs)").option("-e, --edit", "Open $EDITOR to write the description").action(async (title, opts) => {
|
|
9
|
-
await container.paths.requireInit();
|
|
10
|
-
let description = opts.description;
|
|
11
|
-
if (opts.edit) {
|
|
12
|
-
const content = await openInEditor(
|
|
13
|
-
toEditorContent({ title, priority: parseInt(opts.priority, 10), description })
|
|
14
|
-
);
|
|
15
|
-
const parsed = fromEditorContent(content);
|
|
16
|
-
description = parsed.description;
|
|
17
|
-
}
|
|
18
|
-
const task2 = await container.taskService.create({
|
|
19
|
-
title,
|
|
20
|
-
description,
|
|
21
|
-
priority: parseInt(opts.priority, 10),
|
|
22
|
-
labels: opts.labels?.split(",").map((s) => s.trim()),
|
|
23
|
-
depends_on: opts.dependsOn?.split(",").map((s) => s.trim()),
|
|
24
|
-
max_attempts: opts.maxAttempts ? parseInt(opts.maxAttempts, 10) : void 0,
|
|
25
|
-
workspace_mode: opts.workspaceMode,
|
|
26
|
-
assignee: opts.assignee,
|
|
27
|
-
review_criteria: opts.reviewCriteria?.split(",").map((s) => s.trim()),
|
|
28
|
-
scope: opts.scope?.split(",").map((s) => s.trim()),
|
|
29
|
-
goalId: opts.goalId,
|
|
30
|
-
attachments: opts.attach?.split(",").map((s) => s.trim())
|
|
31
|
-
});
|
|
32
|
-
if (container.context.json) {
|
|
33
|
-
console.log(JSON.stringify(task2, null, 2));
|
|
34
|
-
} else if (container.context.quiet) {
|
|
35
|
-
console.log(task2.id);
|
|
36
|
-
} else {
|
|
37
|
-
printSuccess(`Created ${task2.id} "${task2.title}"`);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
task.command("list").description("List all tasks").option("--status <status>", "Filter by status").action(async (opts) => {
|
|
41
|
-
await container.paths.requireInit();
|
|
42
|
-
const tasks = await container.taskService.list(
|
|
43
|
-
opts.status ? { status: opts.status } : void 0
|
|
44
|
-
);
|
|
45
|
-
if (container.context.json) {
|
|
46
|
-
console.log(JSON.stringify(tasks, null, 2));
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (container.context.quiet) {
|
|
50
|
-
tasks.forEach((t) => console.log(t.id));
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (tasks.length === 0) {
|
|
54
|
-
console.log(`
|
|
55
|
-
No tasks. Create one: ${dim('orch task add "Title"')}
|
|
56
|
-
`);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const headers = ["STATUS", "PRI", "TASK", "AGENT", "TIME"];
|
|
60
|
-
const rows = tasks.map((t) => {
|
|
61
|
-
const time = (t.status === "in_progress" || t.status === "done") && t.updated_at ? formatDurationSince(t.updated_at) : dim("\u2014");
|
|
62
|
-
return [
|
|
63
|
-
`${statusIcon(t.status)} ${t.status}`,
|
|
64
|
-
priorityLabel(t.priority),
|
|
65
|
-
t.title.slice(0, 35),
|
|
66
|
-
t.assignee ? agentName(t.assignee) : dim("\u2014"),
|
|
67
|
-
time
|
|
68
|
-
];
|
|
69
|
-
});
|
|
70
|
-
console.log();
|
|
71
|
-
printTable(headers, rows);
|
|
72
|
-
const running = tasks.filter((t) => t.status === "in_progress").length;
|
|
73
|
-
const review = tasks.filter((t) => t.status === "review").length;
|
|
74
|
-
const done = tasks.filter((t) => t.status === "done").length;
|
|
75
|
-
console.log(
|
|
76
|
-
`
|
|
77
|
-
${tasks.length} tasks${running ? ` \xB7 ${running} running` : ""}${review ? ` \xB7 ${review} review` : ""}${done ? ` \xB7 ${done} done` : ""}
|
|
78
|
-
`
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
task.command("show <id>").description("Show task details").action(async (id) => {
|
|
82
|
-
await container.paths.requireInit();
|
|
83
|
-
const t = await container.taskService.get(id);
|
|
84
|
-
if (container.context.json) {
|
|
85
|
-
console.log(JSON.stringify(t, null, 2));
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
console.log(`
|
|
89
|
-
${t.title}`);
|
|
90
|
-
console.log(` ${"\u2550".repeat(42)}`);
|
|
91
|
-
console.log();
|
|
92
|
-
const pairs = [
|
|
93
|
-
["Status", `${statusIcon(t.status)} ${t.status} \xB7 attempt ${t.attempts}/${t.max_attempts}`],
|
|
94
|
-
["Priority", priorityLabel(t.priority)]
|
|
95
|
-
];
|
|
96
|
-
if (t.assignee) pairs.push(["Agent", agentName(t.assignee)]);
|
|
97
|
-
if (t.labels.length) pairs.push(["Labels", t.labels.join(", ")]);
|
|
98
|
-
if (t.scope?.length) pairs.push(["Scope", t.scope.join(", ")]);
|
|
99
|
-
if (t.workspace_mode) pairs.push(["Workspace", t.workspace_mode]);
|
|
100
|
-
if (t.workspace) pairs.push(["Path", filePath(t.workspace)]);
|
|
101
|
-
if (t.review_criteria?.length) pairs.push(["Review", t.review_criteria.join(", ")]);
|
|
102
|
-
if (t.feedback) pairs.push(["Feedback", t.feedback]);
|
|
103
|
-
pairs.push(["Created", t.created_at]);
|
|
104
|
-
printKeyValue(pairs);
|
|
105
|
-
if (t.attachments?.length) {
|
|
106
|
-
console.log(`
|
|
107
|
-
Attachments (${t.attachments.length})
|
|
108
|
-
${"\u2500".repeat(42)}`);
|
|
109
|
-
for (const a of t.attachments) {
|
|
110
|
-
console.log(` ${filePath(a)}`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (t.description) {
|
|
114
|
-
console.log(`
|
|
115
|
-
Description
|
|
116
|
-
${"\u2500".repeat(42)}`);
|
|
117
|
-
for (const line of t.description.split("\n")) {
|
|
118
|
-
console.log(` ${line}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
if (t.proof) {
|
|
122
|
-
console.log(`
|
|
123
|
-
Result
|
|
124
|
-
${"\u2500".repeat(42)}`);
|
|
125
|
-
if (t.proof.branch) console.log(` Branch: ${t.proof.branch}`);
|
|
126
|
-
if (t.proof.pr_url) console.log(` PR: ${t.proof.pr_url}`);
|
|
127
|
-
if (t.proof.files_changed.length) {
|
|
128
|
-
console.log(` Files changed:`);
|
|
129
|
-
for (const f of t.proof.files_changed) {
|
|
130
|
-
console.log(` \u2022 ${f}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (t.proof.test_results) {
|
|
134
|
-
console.log(` Test results:`);
|
|
135
|
-
for (const line of t.proof.test_results.split("\n")) {
|
|
136
|
-
console.log(` ${line}`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (t.proof.agent_summary) {
|
|
140
|
-
console.log(` Agent summary:`);
|
|
141
|
-
for (const line of t.proof.agent_summary.split("\n")) {
|
|
142
|
-
console.log(` ${line}`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (t.review_results?.length) {
|
|
147
|
-
console.log(`
|
|
148
|
-
Review Results
|
|
149
|
-
${"\u2500".repeat(42)}`);
|
|
150
|
-
for (const r of t.review_results) {
|
|
151
|
-
const icon = r.passed ? "\u2713" : "\u2717";
|
|
152
|
-
console.log(` ${icon} ${r.criterion}: ${r.passed ? "passed" : "failed"}`);
|
|
153
|
-
if (r.output) {
|
|
154
|
-
for (const line of r.output.split("\n")) {
|
|
155
|
-
console.log(` ${line}`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
console.log();
|
|
161
|
-
});
|
|
162
|
-
task.command("edit <id>").description("Open task in $EDITOR to modify title, priority and description").action(async (id) => {
|
|
163
|
-
await container.paths.requireInit();
|
|
164
|
-
const existing = await container.taskService.get(id);
|
|
165
|
-
const attachmentNote = existing.attachments?.length ? `
|
|
166
|
-
# Attachments: ${existing.attachments.join(", ")}` : "";
|
|
167
|
-
const initial = toEditorContent({
|
|
168
|
-
title: existing.title,
|
|
169
|
-
priority: existing.priority,
|
|
170
|
-
description: existing.description
|
|
171
|
-
}) + attachmentNote;
|
|
172
|
-
const content = await openInEditor(initial);
|
|
173
|
-
const parsed = fromEditorContent(content);
|
|
174
|
-
const fields = {};
|
|
175
|
-
if (parsed.title && parsed.title !== existing.title) fields.title = parsed.title;
|
|
176
|
-
if (parsed.priority && parsed.priority !== existing.priority) fields.priority = parsed.priority;
|
|
177
|
-
if (parsed.description !== void 0 && parsed.description !== existing.description) {
|
|
178
|
-
fields.description = parsed.description ?? "";
|
|
179
|
-
}
|
|
180
|
-
if (Object.keys(fields).length === 0) {
|
|
181
|
-
console.log(" No changes.");
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
const updated = await container.taskService.update(id, fields);
|
|
185
|
-
printSuccess(`Updated ${updated.id} "${updated.title}"`);
|
|
186
|
-
});
|
|
187
|
-
task.command("assign <task-id> <agent-id>").description("Assign task to agent").action(async (taskId, agentId) => {
|
|
188
|
-
await container.paths.requireInit();
|
|
189
|
-
const t = await container.taskService.assign(taskId, agentId);
|
|
190
|
-
printSuccess(`Assigned ${t.id} \u2192 ${agentId}`);
|
|
191
|
-
});
|
|
192
|
-
task.command("cancel <id>").description("Cancel a task").action(async (id) => {
|
|
193
|
-
await container.paths.requireInit();
|
|
194
|
-
const task2 = await container.taskService.get(id);
|
|
195
|
-
if (task2.status === "in_progress") {
|
|
196
|
-
const { buildFullContainer } = await import('./container-RY54L3XC.js');
|
|
197
|
-
const full = await buildFullContainer(container.context);
|
|
198
|
-
await full.orchestrator.cancelTask(id);
|
|
199
|
-
} else {
|
|
200
|
-
await container.taskService.cancel(id);
|
|
201
|
-
}
|
|
202
|
-
printSuccess(`Cancelled ${id}`);
|
|
203
|
-
});
|
|
204
|
-
task.command("approve <id>").description("Approve a task in review").action(async (id) => {
|
|
205
|
-
await container.paths.requireInit();
|
|
206
|
-
await container.taskService.updateStatus(id, "done");
|
|
207
|
-
printSuccess(`Approved ${id}`);
|
|
208
|
-
});
|
|
209
|
-
task.command("reject <id>").description("Reject a task and send it back for rework").option("-r, --reason <reason>", "Feedback for the agent explaining what to fix").action(async (id, opts) => {
|
|
210
|
-
await container.paths.requireInit();
|
|
211
|
-
await container.taskService.reject(id, opts.reason);
|
|
212
|
-
printSuccess(`Rejected ${id} \u2192 todo${opts.reason ? ` (reason: ${opts.reason})` : ""}`);
|
|
213
|
-
});
|
|
214
|
-
task.command("retry <id>").description("Retry a failed task").action(async (id) => {
|
|
215
|
-
await container.paths.requireInit();
|
|
216
|
-
await container.taskService.retry(id);
|
|
217
|
-
printSuccess(`Reset ${id} to todo`);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export { registerTaskCommand };
|
package/dist/team-PFLP4PPL.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { printSuccess, dim, printTable, printKeyValue } from './chunk-7X2GI5OV.js';
|
|
3
|
-
|
|
4
|
-
// src/cli/commands/team.ts
|
|
5
|
-
function registerTeamCommand(program, container) {
|
|
6
|
-
const team = program.command("team").description("Manage agent teams");
|
|
7
|
-
team.command("create <name>").description("Create a new team").requiredOption("--lead <agent-id>", "Lead agent ID").option("--members <ids>", "Comma-separated member agent IDs").option("-d, --description <desc>", "Team description").option("--no-auto-claim", "Disable auto-claiming").action(async (name, opts) => {
|
|
8
|
-
await container.paths.requireInit();
|
|
9
|
-
const t = await container.teamService.create({
|
|
10
|
-
name,
|
|
11
|
-
description: opts.description,
|
|
12
|
-
lead_agent_id: opts.lead,
|
|
13
|
-
member_agent_ids: opts.members?.split(",").map((s) => s.trim()),
|
|
14
|
-
config: { auto_claim: opts.autoClaim !== false }
|
|
15
|
-
});
|
|
16
|
-
if (container.context.json) {
|
|
17
|
-
console.log(JSON.stringify(t, null, 2));
|
|
18
|
-
} else if (container.context.quiet) {
|
|
19
|
-
console.log(t.id);
|
|
20
|
-
} else {
|
|
21
|
-
printSuccess(`Created team "${t.name}" \u2192 ${t.id}`);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
team.command("list").description("List all teams").action(async () => {
|
|
25
|
-
await container.paths.requireInit();
|
|
26
|
-
const teams = await container.teamService.list();
|
|
27
|
-
if (container.context.json) {
|
|
28
|
-
console.log(JSON.stringify(teams, null, 2));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (teams.length === 0) {
|
|
32
|
-
console.log(dim(`
|
|
33
|
-
No teams. Create one: orch team create <name> --lead <agent-id>
|
|
34
|
-
`));
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const headers = ["ID", "NAME", "STATUS", "LEAD", "MEMBERS", "POOL"];
|
|
38
|
-
const rows = teams.map((t) => [
|
|
39
|
-
t.id,
|
|
40
|
-
t.name,
|
|
41
|
-
t.status,
|
|
42
|
-
t.lead_agent_id,
|
|
43
|
-
String(t.members.length),
|
|
44
|
-
String(t.task_pool.length)
|
|
45
|
-
]);
|
|
46
|
-
console.log();
|
|
47
|
-
printTable(headers, rows);
|
|
48
|
-
console.log();
|
|
49
|
-
});
|
|
50
|
-
team.command("show <id>").description("Show team details").action(async (id) => {
|
|
51
|
-
await container.paths.requireInit();
|
|
52
|
-
const t = await container.teamService.get(id);
|
|
53
|
-
if (container.context.json) {
|
|
54
|
-
console.log(JSON.stringify(t, null, 2));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
console.log();
|
|
58
|
-
printKeyValue([
|
|
59
|
-
["ID", t.id],
|
|
60
|
-
["Name", t.name],
|
|
61
|
-
["Status", t.status],
|
|
62
|
-
["Lead", t.lead_agent_id],
|
|
63
|
-
["Members", t.members.map((m) => `${m.agent_id} (${m.role})`).join(", ")],
|
|
64
|
-
["Pool", t.task_pool.length > 0 ? t.task_pool.join(", ") : dim("empty")],
|
|
65
|
-
["Auto-claim", String(t.config.auto_claim)],
|
|
66
|
-
["Created", t.created_at]
|
|
67
|
-
]);
|
|
68
|
-
console.log();
|
|
69
|
-
});
|
|
70
|
-
team.command("join <team-id> <agent-id>").description("Add an agent to a team").action(async (teamId, agentId) => {
|
|
71
|
-
await container.paths.requireInit();
|
|
72
|
-
await container.teamService.join(teamId, agentId);
|
|
73
|
-
printSuccess(`Agent ${agentId} joined team ${teamId}`);
|
|
74
|
-
});
|
|
75
|
-
team.command("leave <team-id> <agent-id>").description("Remove an agent from a team").action(async (teamId, agentId) => {
|
|
76
|
-
await container.paths.requireInit();
|
|
77
|
-
await container.teamService.leave(teamId, agentId);
|
|
78
|
-
printSuccess(`Agent ${agentId} left team ${teamId}`);
|
|
79
|
-
});
|
|
80
|
-
team.command("add-task <team-id> <task-id>").description("Add a task to the team pool").action(async (teamId, taskId) => {
|
|
81
|
-
await container.paths.requireInit();
|
|
82
|
-
await container.teamService.addTask(teamId, taskId);
|
|
83
|
-
printSuccess(`Task ${taskId} added to team ${teamId} pool`);
|
|
84
|
-
});
|
|
85
|
-
team.command("set-lead <team-id> <agent-id>").description("Transfer team lead to another member").action(async (teamId, agentId) => {
|
|
86
|
-
await container.paths.requireInit();
|
|
87
|
-
await container.teamService.setLead(teamId, agentId);
|
|
88
|
-
printSuccess(`${agentId} is now lead of team ${teamId}`);
|
|
89
|
-
});
|
|
90
|
-
team.command("disband <id>").description("Disband a team").action(async (id) => {
|
|
91
|
-
await container.paths.requireInit();
|
|
92
|
-
await container.teamService.disband(id);
|
|
93
|
-
printSuccess(`Team ${id} disbanded`);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { registerTeamCommand };
|