@oxgeneral/orch 1.0.2 → 1.0.4
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-SSYYVFGW.js +22 -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-INZ4O2RI.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-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/{chunk-O2OQCSBL.js → chunk-YHIYJ5OL.js} +105 -29
- package/dist/chunk-YHIYJ5OL.js.map +1 -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 -213
- 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-FJI7RN2L.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 +26 -8
- 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-PM4BW7W5.js +13 -0
- package/dist/orchestrator-QFNYZ6AH.js +6 -0
- package/dist/{orchestrator-X2CWGFCL.js.map → orchestrator-QFNYZ6AH.js.map} +1 -1
- 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-SZBYNAZP.js +20 -0
- package/dist/team-VCJSUDWX.js +4 -0
- package/dist/template-engine-42PKL5KD.js +2 -0
- package/dist/tui-4VRDSRVB.js +2 -0
- package/dist/update-FFKCOV63.js +2 -0
- package/dist/update-check-HGMBDYHL.js +2 -0
- package/dist/{workspace-manager-2SFPKPLZ.js → workspace-manager-ABXFBL2A.js} +3 -3
- package/dist/{workspace-manager-2SFPKPLZ.js.map → workspace-manager-ABXFBL2A.js.map} +1 -1
- package/dist/workspace-manager-Q6WWXSTR.js +3 -0
- package/package.json +1 -1
- package/dist/App-YQOT4LBE.js +0 -6727
- 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-INZ4O2RI.js.map +0 -1
- package/dist/chunk-ITLJKMTP.js +0 -297
- package/dist/chunk-K6DMQERQ.js +0 -89
- 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-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-IZZVO4AH.js +0 -1596
- package/dist/context-OL4BVUV5.js +0 -83
- package/dist/cursor-622RBRHH.js +0 -97
- package/dist/doctor-SETNAS4S.js +0 -67
- package/dist/doctor-service-TPOMFAIG.js +0 -2
- package/dist/goal-C6YGSX5D.js +0 -143
- package/dist/init-SWAAXP5H.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/org-JSMMBZHI.js +0 -249
- 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-XNYZHPCS.js +0 -221
- package/dist/team-PFLP4PPL.js +0 -97
- package/dist/template-engine-AWIS56BL.js +0 -3
- package/dist/tui-JW3DOOKH.js +0 -245
- package/dist/update-YLP7FPNY.js +0 -64
- package/dist/update-check-4YKLGBFB.js +0 -2
- package/dist/workspace-manager-ESPU7WOH.js +0 -215
package/dist/context-OL4BVUV5.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { printSuccess, printError, dim, formatDurationSince, printTable } from './chunk-7X2GI5OV.js';
|
|
3
|
-
|
|
4
|
-
// src/cli/commands/context.ts
|
|
5
|
-
function registerContextCommand(program, container) {
|
|
6
|
-
const ctx = program.command("context").description("Shared context store for inter-agent data exchange");
|
|
7
|
-
ctx.command("set <key> <value>").description("Set a shared context entry").option("--ttl <ms>", "Time-to-live in milliseconds").action(async (key, value, opts) => {
|
|
8
|
-
await container.paths.requireInit();
|
|
9
|
-
const ttlMs = opts.ttl ? parseInt(opts.ttl, 10) : void 0;
|
|
10
|
-
await container.contextStore.set(key, value, ttlMs);
|
|
11
|
-
if (container.context.json) {
|
|
12
|
-
const entry = await container.contextStore.get(key);
|
|
13
|
-
console.log(JSON.stringify(entry, null, 2));
|
|
14
|
-
} else if (container.context.quiet) {
|
|
15
|
-
console.log(key);
|
|
16
|
-
} else {
|
|
17
|
-
printSuccess(`Set context "${key}"`);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
ctx.command("get <key>").description("Get a shared context entry").action(async (key) => {
|
|
21
|
-
await container.paths.requireInit();
|
|
22
|
-
const entry = await container.contextStore.get(key);
|
|
23
|
-
if (!entry) {
|
|
24
|
-
if (container.context.json) {
|
|
25
|
-
console.log("null");
|
|
26
|
-
} else {
|
|
27
|
-
printError(`Context key "${key}" not found`);
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (container.context.json) {
|
|
32
|
-
console.log(JSON.stringify(entry, null, 2));
|
|
33
|
-
} else if (container.context.quiet) {
|
|
34
|
-
console.log(entry.value);
|
|
35
|
-
} else {
|
|
36
|
-
console.log(`
|
|
37
|
-
${key} = ${entry.value}`);
|
|
38
|
-
if (entry.expires_at) {
|
|
39
|
-
console.log(` ${dim(`expires: ${entry.expires_at}`)}`);
|
|
40
|
-
}
|
|
41
|
-
console.log();
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
ctx.command("list").description("List all shared context entries").action(async () => {
|
|
45
|
-
await container.paths.requireInit();
|
|
46
|
-
const entries = await container.contextStore.list();
|
|
47
|
-
if (container.context.json) {
|
|
48
|
-
console.log(JSON.stringify(entries, null, 2));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (container.context.quiet) {
|
|
52
|
-
entries.forEach((e) => console.log(`${e.key}=${e.value}`));
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (entries.length === 0) {
|
|
56
|
-
console.log(`
|
|
57
|
-
No shared context entries. Set one: ${dim("orch context set key value")}
|
|
58
|
-
`);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const headers = ["KEY", "VALUE", "UPDATED", "TTL"];
|
|
62
|
-
const rows = entries.map((e) => [
|
|
63
|
-
e.key,
|
|
64
|
-
e.value.length > 50 ? e.value.slice(0, 47) + "..." : e.value,
|
|
65
|
-
formatDurationSince(e.updated_at),
|
|
66
|
-
e.expires_at ? formatDurationSince(e.expires_at) : dim("\u2014")
|
|
67
|
-
]);
|
|
68
|
-
console.log();
|
|
69
|
-
printTable(headers, rows);
|
|
70
|
-
console.log(`
|
|
71
|
-
${entries.length} entries
|
|
72
|
-
`);
|
|
73
|
-
});
|
|
74
|
-
ctx.command("delete <key>").description("Delete a shared context entry").action(async (key) => {
|
|
75
|
-
await container.paths.requireInit();
|
|
76
|
-
await container.contextStore.delete(key);
|
|
77
|
-
if (!container.context.quiet && !container.context.json) {
|
|
78
|
-
printSuccess(`Deleted context "${key}"`);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { registerContextCommand };
|
package/dist/cursor-622RBRHH.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { buildFullPrompt, createStreamingEvents, extractTokens } from './chunk-MGGSRXWJ.js';
|
|
3
|
-
import { classifyAdapterError } from './chunk-2C2TFQ7K.js';
|
|
4
|
-
import './chunk-CHIP7O6V.js';
|
|
5
|
-
import { execFile } from 'child_process';
|
|
6
|
-
import { promisify } from 'util';
|
|
7
|
-
|
|
8
|
-
var execFileAsync = promisify(execFile);
|
|
9
|
-
async function findCommand() {
|
|
10
|
-
for (const cmd of ["cursor-agent", "agent"]) {
|
|
11
|
-
try {
|
|
12
|
-
const { stdout } = await execFileAsync(cmd, ["--version"]);
|
|
13
|
-
return { command: cmd, version: stdout.trim() };
|
|
14
|
-
} catch {
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
var CursorAdapter = class {
|
|
20
|
-
constructor(processManager) {
|
|
21
|
-
this.processManager = processManager;
|
|
22
|
-
}
|
|
23
|
-
kind = "cursor";
|
|
24
|
-
resolvedCommand = "cursor-agent";
|
|
25
|
-
async test() {
|
|
26
|
-
const found = await findCommand();
|
|
27
|
-
if (found) {
|
|
28
|
-
this.resolvedCommand = found.command;
|
|
29
|
-
return { ok: true, version: found.version };
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
ok: false,
|
|
33
|
-
error: "Cursor Agent CLI not found. The headless agent CLI is required (cursor-agent or agent).",
|
|
34
|
-
errorKind: "adapter_not_found" /* ADAPTER_NOT_FOUND */
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
execute(params) {
|
|
38
|
-
const args = [
|
|
39
|
-
"-p",
|
|
40
|
-
"--output-format",
|
|
41
|
-
"stream-json",
|
|
42
|
-
"--workspace",
|
|
43
|
-
params.workspace,
|
|
44
|
-
"--yolo"
|
|
45
|
-
// bypass interactive prompts for autonomous agents
|
|
46
|
-
];
|
|
47
|
-
if (params.config.model) {
|
|
48
|
-
args.push("--model", params.config.model);
|
|
49
|
-
}
|
|
50
|
-
const { process: proc, pid } = this.processManager.spawn(this.resolvedCommand, args, {
|
|
51
|
-
cwd: params.workspace,
|
|
52
|
-
env: { ...process.env, ...params.env },
|
|
53
|
-
signal: params.signal,
|
|
54
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
55
|
-
// stdin must be 'pipe' to send prompt
|
|
56
|
-
});
|
|
57
|
-
if (proc.stdin) {
|
|
58
|
-
proc.stdin.write(buildFullPrompt(params.systemPrompt, params.prompt));
|
|
59
|
-
proc.stdin.end();
|
|
60
|
-
}
|
|
61
|
-
const events = createStreamingEvents(proc, parseCursorEvent, "Cursor agent", params.signal);
|
|
62
|
-
return { pid, events };
|
|
63
|
-
}
|
|
64
|
-
async stop(pid) {
|
|
65
|
-
await this.processManager.killWithGrace(pid);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
function parseCursorEvent(line) {
|
|
69
|
-
if (!line.trim()) return null;
|
|
70
|
-
try {
|
|
71
|
-
const parsed = JSON.parse(line);
|
|
72
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
73
|
-
switch (parsed.type) {
|
|
74
|
-
case "assistant":
|
|
75
|
-
return { type: "output", timestamp, data: parsed.message ?? parsed };
|
|
76
|
-
case "tool_use":
|
|
77
|
-
return { type: "tool_call", timestamp, data: parsed };
|
|
78
|
-
case "tool_result":
|
|
79
|
-
return { type: "output", timestamp, data: parsed };
|
|
80
|
-
case "error": {
|
|
81
|
-
const errData = parsed.error ?? parsed;
|
|
82
|
-
const errMsg = typeof errData === "string" ? errData : JSON.stringify(errData);
|
|
83
|
-
return { type: "error", timestamp, data: errData, errorKind: classifyAdapterError(errMsg) };
|
|
84
|
-
}
|
|
85
|
-
case "result": {
|
|
86
|
-
const tokens = extractTokens(parsed);
|
|
87
|
-
return { type: "done", timestamp, data: parsed, tokens };
|
|
88
|
-
}
|
|
89
|
-
default:
|
|
90
|
-
return { type: "output", timestamp, data: parsed };
|
|
91
|
-
}
|
|
92
|
-
} catch {
|
|
93
|
-
return { type: "output", timestamp: (/* @__PURE__ */ new Date()).toISOString(), data: line };
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { CursorAdapter };
|
package/dist/doctor-SETNAS4S.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { DoctorService } from './chunk-K6DMQERQ.js';
|
|
3
|
-
import { Paths } from './chunk-ITLJKMTP.js';
|
|
4
|
-
import { amber, getIcon, dim } from './chunk-7X2GI5OV.js';
|
|
5
|
-
import { AdapterRegistry } from './chunk-45K2XID7.js';
|
|
6
|
-
import { ClaudeAdapter } from './chunk-4IFIOMCW.js';
|
|
7
|
-
import { ShellAdapter } from './chunk-XJTJ2TJV.js';
|
|
8
|
-
import './chunk-MGGSRXWJ.js';
|
|
9
|
-
import './chunk-2C2TFQ7K.js';
|
|
10
|
-
import { ProcessManager } from './chunk-CHIP7O6V.js';
|
|
11
|
-
import chalk from 'chalk';
|
|
12
|
-
|
|
13
|
-
function registerDoctorCommand(program, container) {
|
|
14
|
-
program.command("doctor").description("Check adapters and dependencies").action(async () => {
|
|
15
|
-
let doctorService;
|
|
16
|
-
let paths;
|
|
17
|
-
let hasContainer = false;
|
|
18
|
-
if (container) {
|
|
19
|
-
doctorService = container.doctorService;
|
|
20
|
-
paths = container.paths;
|
|
21
|
-
hasContainer = true;
|
|
22
|
-
} else {
|
|
23
|
-
const pm = new ProcessManager();
|
|
24
|
-
const registry = new AdapterRegistry();
|
|
25
|
-
registry.register(new ClaudeAdapter(pm));
|
|
26
|
-
registry.register(new ShellAdapter(pm));
|
|
27
|
-
doctorService = new DoctorService(registry, pm, process.cwd());
|
|
28
|
-
paths = new Paths(process.cwd());
|
|
29
|
-
}
|
|
30
|
-
console.log();
|
|
31
|
-
console.log(` ${amber("orch doctor")} \xB7 checking adapters and dependencies`);
|
|
32
|
-
console.log();
|
|
33
|
-
const report = await doctorService.runAll();
|
|
34
|
-
if (container?.context.json) {
|
|
35
|
-
console.log(JSON.stringify(report, null, 2));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
for (const check of report.checks) {
|
|
39
|
-
const icon = check.status === "ok" ? chalk.ansi256(72)(getIcon("done")) : check.status === "fail" ? chalk.ansi256(167)(getIcon("failed")) : dim("\u2014");
|
|
40
|
-
const detail = check.detail ? dim(` ${check.detail}`) : "";
|
|
41
|
-
console.log(` ${icon} ${check.name.padEnd(12)}${detail}`);
|
|
42
|
-
}
|
|
43
|
-
if (paths) {
|
|
44
|
-
const initialized = await paths.isInitialized();
|
|
45
|
-
if (initialized && hasContainer) {
|
|
46
|
-
const agents = await container.agentService.list();
|
|
47
|
-
const tasks = await container.taskService.list();
|
|
48
|
-
console.log();
|
|
49
|
-
console.log(
|
|
50
|
-
` ${chalk.ansi256(72)(getIcon("done"))} .orchestry/ ${dim(`exists \xB7 ${agents.length} agents \xB7 ${tasks.length} tasks`)}`
|
|
51
|
-
);
|
|
52
|
-
} else if (!initialized) {
|
|
53
|
-
console.log();
|
|
54
|
-
console.log(
|
|
55
|
-
` ${chalk.ansi256(167)(getIcon("failed"))} .orchestry/ ${dim("not found \u2014 run: orch init")}`
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
console.log();
|
|
60
|
-
console.log(
|
|
61
|
-
` ${report.adaptersReady} of ${report.adaptersTotal} adapters ready`
|
|
62
|
-
);
|
|
63
|
-
console.log();
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export { registerDoctorCommand };
|
package/dist/goal-C6YGSX5D.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { GOAL_STATUSES } from './chunk-HXYAZGLP.js';
|
|
3
|
-
import { printSuccess, dim, printTable, printKeyValue, statusIcon, agentName, printError } from './chunk-7X2GI5OV.js';
|
|
4
|
-
|
|
5
|
-
// src/cli/commands/goal.ts
|
|
6
|
-
var STATUS_ICON = {
|
|
7
|
-
active: "\u25CF",
|
|
8
|
-
// ●
|
|
9
|
-
paused: "\u2016",
|
|
10
|
-
// ‖
|
|
11
|
-
achieved: "\u2713",
|
|
12
|
-
// ✓
|
|
13
|
-
abandoned: "\u2715"
|
|
14
|
-
// ✕
|
|
15
|
-
};
|
|
16
|
-
function registerGoalCommand(program, container) {
|
|
17
|
-
const goal = program.command("goal").description("Manage goals");
|
|
18
|
-
goal.command("add <title>").description("Create a new goal").option("--description <desc>", "Goal description").option("--assignee <agentId>", "Assign to a specific agent").action(async (title, opts) => {
|
|
19
|
-
await container.paths.requireInit();
|
|
20
|
-
const g = await container.goalService.create({
|
|
21
|
-
title,
|
|
22
|
-
description: opts.description,
|
|
23
|
-
assignee: opts.assignee
|
|
24
|
-
});
|
|
25
|
-
if (container.context.json) {
|
|
26
|
-
console.log(JSON.stringify(g, null, 2));
|
|
27
|
-
} else if (container.context.quiet) {
|
|
28
|
-
console.log(g.id);
|
|
29
|
-
} else {
|
|
30
|
-
printSuccess(`Created goal "${g.title}" (${g.id})`);
|
|
31
|
-
console.log();
|
|
32
|
-
console.log(` ${dim("Tips for better results:")}`);
|
|
33
|
-
console.log(` ${dim("\u2022")} Be specific: ${dim('"Implement OAuth2 with Google" > "Add auth"')}`);
|
|
34
|
-
console.log(` ${dim("\u2022")} Add ${dim("--description")} with success criteria and constraints`);
|
|
35
|
-
console.log(` ${dim("\u2022")} Use ${dim("--assignee")} to focus a specific agent on this goal`);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
goal.command("list").alias("ls").description("List all goals").option("--status <status>", "Filter by status").action(async (opts) => {
|
|
39
|
-
await container.paths.requireInit();
|
|
40
|
-
const goals = await container.goalService.list(
|
|
41
|
-
opts.status ? { status: opts.status } : void 0
|
|
42
|
-
);
|
|
43
|
-
if (container.context.json) {
|
|
44
|
-
console.log(JSON.stringify(goals, null, 2));
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (goals.length === 0) {
|
|
48
|
-
console.log(dim("No goals found."));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const rows = goals.map((g) => [
|
|
52
|
-
STATUS_ICON[g.status] ?? "?",
|
|
53
|
-
g.id,
|
|
54
|
-
g.title,
|
|
55
|
-
g.status,
|
|
56
|
-
g.assignee ?? dim("any")
|
|
57
|
-
]);
|
|
58
|
-
printTable(["", "ID", "Title", "Status", "Assignee"], rows);
|
|
59
|
-
});
|
|
60
|
-
goal.command("show <id>").description("Show goal details").action(async (id) => {
|
|
61
|
-
await container.paths.requireInit();
|
|
62
|
-
const [g, tasks, progress] = await Promise.all([
|
|
63
|
-
container.goalService.get(id),
|
|
64
|
-
container.goalService.listTasksForGoal(id),
|
|
65
|
-
container.goalService.getProgressReport(id)
|
|
66
|
-
]);
|
|
67
|
-
if (container.context.json) {
|
|
68
|
-
console.log(JSON.stringify({ ...g, tasks, progress }, null, 2));
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
printKeyValue([
|
|
72
|
-
["ID", g.id],
|
|
73
|
-
["Title", g.title],
|
|
74
|
-
["Status", g.status],
|
|
75
|
-
["Assignee", g.assignee ?? dim("any")],
|
|
76
|
-
["Description", g.description || dim("none")],
|
|
77
|
-
["Created", g.created_at],
|
|
78
|
-
["Updated", g.updated_at ?? dim("never")]
|
|
79
|
-
]);
|
|
80
|
-
if (tasks.length > 0) {
|
|
81
|
-
console.log(`
|
|
82
|
-
Tasks (${tasks.length})
|
|
83
|
-
${"\u2500".repeat(42)}`);
|
|
84
|
-
const rows = tasks.map((t) => [
|
|
85
|
-
`${statusIcon(t.status)} ${t.status}`,
|
|
86
|
-
t.id,
|
|
87
|
-
t.title.slice(0, 40),
|
|
88
|
-
t.assignee ? agentName(t.assignee) : dim("\u2014")
|
|
89
|
-
]);
|
|
90
|
-
printTable(["STATUS", "ID", "TITLE", "AGENT"], rows);
|
|
91
|
-
} else {
|
|
92
|
-
console.log(`
|
|
93
|
-
${dim("No tasks linked to this goal yet.")}`);
|
|
94
|
-
}
|
|
95
|
-
if (progress) {
|
|
96
|
-
console.log(`
|
|
97
|
-
Progress Report
|
|
98
|
-
${"\u2500".repeat(42)}`);
|
|
99
|
-
for (const line of progress.split("\n")) {
|
|
100
|
-
console.log(` ${line}`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
console.log();
|
|
104
|
-
});
|
|
105
|
-
goal.command("status <id> <status>").description("Change goal status (active, paused, achieved, abandoned)").action(async (id, status) => {
|
|
106
|
-
await container.paths.requireInit();
|
|
107
|
-
if (!GOAL_STATUSES.includes(status)) {
|
|
108
|
-
printError(`Invalid status "${status}". Valid: ${GOAL_STATUSES.join(", ")}`);
|
|
109
|
-
process.exitCode = 1;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const g = await container.goalService.updateStatus(id, status);
|
|
113
|
-
if (container.context.json) {
|
|
114
|
-
console.log(JSON.stringify(g, null, 2));
|
|
115
|
-
} else if (container.context.quiet) {
|
|
116
|
-
console.log(g.id);
|
|
117
|
-
} else {
|
|
118
|
-
printSuccess(`Goal "${g.title}" \u2192 ${g.status}`);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
goal.command("update <id>").description("Update goal fields").option("--title <title>", "New title").option("--description <desc>", "New description").option("--assignee <agentId>", "New assignee (empty string to unassign)").action(async (id, opts) => {
|
|
122
|
-
await container.paths.requireInit();
|
|
123
|
-
const g = await container.goalService.update(id, opts);
|
|
124
|
-
if (container.context.json) {
|
|
125
|
-
console.log(JSON.stringify(g, null, 2));
|
|
126
|
-
} else if (container.context.quiet) {
|
|
127
|
-
console.log(g.id);
|
|
128
|
-
} else {
|
|
129
|
-
printSuccess(`Updated goal "${g.title}"`);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
goal.command("delete <id>").alias("rm").description("Delete a goal").action(async (id) => {
|
|
133
|
-
await container.paths.requireInit();
|
|
134
|
-
await container.goalService.delete(id);
|
|
135
|
-
if (container.context.json) {
|
|
136
|
-
console.log(JSON.stringify({ deleted: id }));
|
|
137
|
-
} else if (!container.context.quiet) {
|
|
138
|
-
printSuccess(`Deleted goal ${id}`);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export { registerGoalCommand };
|
package/dist/init-SWAAXP5H.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_PROMPT_TEMPLATE } from './chunk-VXS2CJFH.js';
|
|
3
|
-
import { DEFAULT_CONFIG } from './chunk-I3SMISEF.js';
|
|
4
|
-
import './chunk-PNE6LQRF.js';
|
|
5
|
-
import { Paths, pathExists, ensureDir, writeYaml, atomicWrite } from './chunk-ITLJKMTP.js';
|
|
6
|
-
import { printWarning, printSuccess, dim } from './chunk-7X2GI5OV.js';
|
|
7
|
-
import './chunk-2C2TFQ7K.js';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import fs from 'fs/promises';
|
|
10
|
-
import { execFile } from 'child_process';
|
|
11
|
-
import { promisify } from 'util';
|
|
12
|
-
|
|
13
|
-
// src/domain/default-agents.ts
|
|
14
|
-
var AGENT_CREATOR_ROLE = `Agent architect \u2014 designs and creates AI agents for the orchestrator via \`orch agent add\`.
|
|
15
|
-
|
|
16
|
-
## CREATION PROCESS
|
|
17
|
-
|
|
18
|
-
1) ANALYZE \u2014 determine: agent function, required skills, adapter, team interactions.
|
|
19
|
-
|
|
20
|
-
2) WRITE THE ROLE \u2014 this is the most important part. A good role includes:
|
|
21
|
-
- Identity and specialization (who you are)
|
|
22
|
-
- Concrete workflow (numbered steps)
|
|
23
|
-
- Which skills to invoke (\`/skill-name\`)
|
|
24
|
-
- Rules and constraints
|
|
25
|
-
Do NOT include CLI documentation or goal-mode instructions \u2014 these are already injected by the system prompt template.
|
|
26
|
-
|
|
27
|
-
3) CHOOSE CONFIGURATION:
|
|
28
|
-
- adapter: \`claude\` (AI tasks), \`shell\` (bash scripts), \`codex\` (OpenAI Codex), \`cursor\` (Cursor IDE), \`opencode\` (OpenCode \u2014 multi-provider)
|
|
29
|
-
- model: \`claude-opus-4-6\` (complex/architectural), \`claude-sonnet-4-6\` (fast/routine), \`claude-haiku-4-5-20251001\` (simple/templated)
|
|
30
|
-
- approval_policy: \`auto\` (no confirmation) / \`suggest\` (proposes actions) / \`manual\` (human approval)
|
|
31
|
-
- max_turns: 50 (default), up to 100 for complex tasks
|
|
32
|
-
|
|
33
|
-
4) CREATE:
|
|
34
|
-
\`orch agent add "<name>" --adapter claude --model <model> --skills "<skills>" --role "<role>" --approval-policy auto\`
|
|
35
|
-
|
|
36
|
-
## AVAILABLE SKILLS
|
|
37
|
-
|
|
38
|
-
Development: feature-dev:feature-dev, feature-dev:code-explorer, feature-dev:code-architect, feature-dev:code-reviewer, simplify, claude-api
|
|
39
|
-
Testing: testing-suite:generate-tests, testing-suite:test-coverage, testing-suite:e2e-setup, testing-suite:test-quality-analyzer
|
|
40
|
-
Frontend: frontend-design, document-skills:frontend-design
|
|
41
|
-
Documents: pdf, xlsx, docx, pptx
|
|
42
|
-
Marketing: marketing-psychology, product-manager-toolkit
|
|
43
|
-
|
|
44
|
-
## ANTI-PATTERNS
|
|
45
|
-
|
|
46
|
-
- Never create agents without skills \u2014 they cannot be auto-matched to tasks.
|
|
47
|
-
- Never write generic roles like "helper" \u2014 be specific about actions and tools.
|
|
48
|
-
- Never use opus for simple tasks \u2014 it is expensive; use sonnet or haiku.
|
|
49
|
-
- Never assign more than 3-4 skills per agent \u2014 create specialized agents instead.
|
|
50
|
-
- Never use the -e/--edit flag in automated mode \u2014 it opens an interactive editor.
|
|
51
|
-
- Always specify --role when calling \`orch agent add\`.
|
|
52
|
-
|
|
53
|
-
After creation \u2014 \`orch context set agent-<name> "<capabilities>"\`.`;
|
|
54
|
-
function getDefaultAgents() {
|
|
55
|
-
return [
|
|
56
|
-
{
|
|
57
|
-
id: "agt_creator",
|
|
58
|
-
name: "Agent Creator",
|
|
59
|
-
adapter: "claude",
|
|
60
|
-
role: AGENT_CREATOR_ROLE,
|
|
61
|
-
config: {
|
|
62
|
-
model: "claude-sonnet-4-6",
|
|
63
|
-
approval_policy: "suggest",
|
|
64
|
-
max_turns: 50,
|
|
65
|
-
timeout_ms: 36e5,
|
|
66
|
-
stall_timeout_ms: 3e5,
|
|
67
|
-
skills: ["document-skills:skill-creator"]
|
|
68
|
-
},
|
|
69
|
-
status: "idle",
|
|
70
|
-
stats: {
|
|
71
|
-
tasks_completed: 0,
|
|
72
|
-
tasks_failed: 0,
|
|
73
|
-
total_runs: 0,
|
|
74
|
-
total_runtime_ms: 0
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// src/cli/commands/init.ts
|
|
81
|
-
var execFileAsync = promisify(execFile);
|
|
82
|
-
async function runInit(opts = {}) {
|
|
83
|
-
const projectRoot = process.cwd();
|
|
84
|
-
const paths = new Paths(projectRoot);
|
|
85
|
-
if (await pathExists(paths.root)) {
|
|
86
|
-
printWarning("Already initialized");
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
await Promise.all([
|
|
90
|
-
ensureDir(paths.tasksDir),
|
|
91
|
-
ensureDir(paths.agentsDir),
|
|
92
|
-
ensureDir(paths.goalsDir),
|
|
93
|
-
ensureDir(paths.runsDir),
|
|
94
|
-
ensureDir(paths.templatesDir),
|
|
95
|
-
ensureDir(paths.logsDir)
|
|
96
|
-
]);
|
|
97
|
-
const gitAvailable = await ensureGitRepo(projectRoot);
|
|
98
|
-
const config = structuredClone(DEFAULT_CONFIG);
|
|
99
|
-
config.project.name = opts.name ?? path.basename(projectRoot);
|
|
100
|
-
if (!gitAvailable) {
|
|
101
|
-
config.defaults.agent.workspace_mode = "shared";
|
|
102
|
-
}
|
|
103
|
-
const gitignoreContent = [
|
|
104
|
-
"# Runtime state",
|
|
105
|
-
"state.json",
|
|
106
|
-
"*.lock",
|
|
107
|
-
"",
|
|
108
|
-
"# Logs and runs",
|
|
109
|
-
"runs/",
|
|
110
|
-
"logs/",
|
|
111
|
-
"",
|
|
112
|
-
"# Agent workspaces",
|
|
113
|
-
"workspaces/"
|
|
114
|
-
].join("\n") + "\n";
|
|
115
|
-
const excludeContent = [
|
|
116
|
-
".orchestry",
|
|
117
|
-
"node_modules",
|
|
118
|
-
".env",
|
|
119
|
-
".env.*",
|
|
120
|
-
"dist",
|
|
121
|
-
"build",
|
|
122
|
-
".next",
|
|
123
|
-
"__pycache__",
|
|
124
|
-
"*.pyc",
|
|
125
|
-
".venv"
|
|
126
|
-
].join("\n") + "\n";
|
|
127
|
-
const defaultAgents = getDefaultAgents();
|
|
128
|
-
await Promise.all([
|
|
129
|
-
writeYaml(paths.configPath, config),
|
|
130
|
-
atomicWrite(paths.gitignorePath, gitignoreContent),
|
|
131
|
-
atomicWrite(paths.workspaceExcludePath, excludeContent),
|
|
132
|
-
atomicWrite(paths.defaultTemplatePath(), DEFAULT_PROMPT_TEMPLATE),
|
|
133
|
-
...defaultAgents.map((agent) => writeYaml(paths.agentPath(agent.id), agent))
|
|
134
|
-
]);
|
|
135
|
-
await ensureRootGitignore(projectRoot);
|
|
136
|
-
if (gitAvailable) {
|
|
137
|
-
await ensureGitCommit(projectRoot);
|
|
138
|
-
}
|
|
139
|
-
console.log();
|
|
140
|
-
printSuccess("initialized");
|
|
141
|
-
console.log();
|
|
142
|
-
console.log(` Created ${dim(".orchestry/")}`);
|
|
143
|
-
console.log(` ${dim("\u251C\u2500\u2500")} config.yml`);
|
|
144
|
-
console.log(` ${dim("\u251C\u2500\u2500")} tasks/`);
|
|
145
|
-
console.log(` ${dim("\u251C\u2500\u2500")} agents/`);
|
|
146
|
-
for (const agent of defaultAgents) {
|
|
147
|
-
console.log(` ${dim("\u2502 \u2514\u2500\u2500")} ${agent.id}.yml ${dim(`(${agent.name})`)}`);
|
|
148
|
-
}
|
|
149
|
-
console.log(` ${dim("\u251C\u2500\u2500")} templates/default.md`);
|
|
150
|
-
console.log(` ${dim("\u2514\u2500\u2500")} .gitignore`);
|
|
151
|
-
console.log();
|
|
152
|
-
}
|
|
153
|
-
async function ensureGitRepo(projectRoot) {
|
|
154
|
-
try {
|
|
155
|
-
await execFileAsync("git", ["rev-parse", "--is-inside-work-tree"], { cwd: projectRoot });
|
|
156
|
-
return true;
|
|
157
|
-
} catch {
|
|
158
|
-
try {
|
|
159
|
-
await execFileAsync("git", ["init"], { cwd: projectRoot });
|
|
160
|
-
return true;
|
|
161
|
-
} catch {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async function ensureGitCommit(projectRoot) {
|
|
167
|
-
try {
|
|
168
|
-
await execFileAsync("git", ["rev-parse", "HEAD"], { cwd: projectRoot });
|
|
169
|
-
} catch {
|
|
170
|
-
try {
|
|
171
|
-
await execFileAsync("git", ["add", "-A"], { cwd: projectRoot });
|
|
172
|
-
await execFileAsync("git", ["commit", "-m", "Initial commit", "--allow-empty"], { cwd: projectRoot });
|
|
173
|
-
} catch {
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
async function ensureRootGitignore(projectRoot) {
|
|
178
|
-
const gitignorePath = path.join(projectRoot, ".gitignore");
|
|
179
|
-
try {
|
|
180
|
-
const content = await fs.readFile(gitignorePath, "utf-8");
|
|
181
|
-
if (content.split("\n").some((line) => line.trim() === ".orchestry")) return;
|
|
182
|
-
const separator = content.endsWith("\n") ? "" : "\n";
|
|
183
|
-
await fs.appendFile(gitignorePath, `${separator}
|
|
184
|
-
# Orchestry state
|
|
185
|
-
.orchestry
|
|
186
|
-
`);
|
|
187
|
-
} catch {
|
|
188
|
-
await atomicWrite(gitignorePath, "# Orchestry state\n.orchestry\n");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
function registerInitCommand(program) {
|
|
192
|
-
program.command("init").description("Initialize .orchestry/ in the current directory").option("--name <name>", "Project name").action(async (opts) => {
|
|
193
|
-
await runInit(opts);
|
|
194
|
-
console.log(` Next: ${dim('orch task add "Create backend agent" --assignee agt_creator')}`);
|
|
195
|
-
console.log();
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export { registerInitCommand, runInit };
|