cofounder-crew 0.1.0
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/README.md +206 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +249 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/codex.d.ts +8 -0
- package/dist/src/codex.js +335 -0
- package/dist/src/codex.js.map +1 -0
- package/dist/src/codexConfig.d.ts +10 -0
- package/dist/src/codexConfig.js +136 -0
- package/dist/src/codexConfig.js.map +1 -0
- package/dist/src/codexSessions.d.ts +5 -0
- package/dist/src/codexSessions.js +100 -0
- package/dist/src/codexSessions.js.map +1 -0
- package/dist/src/config.d.ts +14 -0
- package/dist/src/config.js +154 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/errors.d.ts +4 -0
- package/dist/src/errors.js +12 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/git.d.ts +15 -0
- package/dist/src/git.js +151 -0
- package/dist/src/git.js.map +1 -0
- package/dist/src/init.d.ts +8 -0
- package/dist/src/init.js +43 -0
- package/dist/src/init.js.map +1 -0
- package/dist/src/mcp.d.ts +4 -0
- package/dist/src/mcp.js +159 -0
- package/dist/src/mcp.js.map +1 -0
- package/dist/src/memberRuntime.d.ts +13 -0
- package/dist/src/memberRuntime.js +70 -0
- package/dist/src/memberRuntime.js.map +1 -0
- package/dist/src/paths.d.ts +7 -0
- package/dist/src/paths.js +36 -0
- package/dist/src/paths.js.map +1 -0
- package/dist/src/prompt.d.ts +2 -0
- package/dist/src/prompt.js +59 -0
- package/dist/src/prompt.js.map +1 -0
- package/dist/src/runtime.d.ts +50 -0
- package/dist/src/runtime.js +362 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/setup.d.ts +6 -0
- package/dist/src/setup.js +48 -0
- package/dist/src/setup.js.map +1 -0
- package/dist/src/tasks.d.ts +10 -0
- package/dist/src/tasks.js +130 -0
- package/dist/src/tasks.js.map +1 -0
- package/dist/src/templates.d.ts +15 -0
- package/dist/src/templates.js +158 -0
- package/dist/src/templates.js.map +1 -0
- package/dist/src/types.d.ts +141 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/worker.d.ts +2 -0
- package/dist/src/worker.js +17 -0
- package/dist/src/worker.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { CofounderError } from "./errors.js";
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
export const DEFAULT_PUBLISHED_PACKAGE = "cofounder-crew";
|
|
8
|
+
export function formatCodexSetup(options = {}) {
|
|
9
|
+
const packageName = options.packageName ?? DEFAULT_PUBLISHED_PACKAGE;
|
|
10
|
+
const modulePath = fileURLToPath(import.meta.url);
|
|
11
|
+
const directMcpPath = modulePath.endsWith(".ts")
|
|
12
|
+
? path.resolve(path.dirname(modulePath), "../dist/src/mcp.js")
|
|
13
|
+
: fileURLToPath(new URL("./mcp.js", import.meta.url));
|
|
14
|
+
return `Codex MCP setup
|
|
15
|
+
|
|
16
|
+
Preferred from npm registry:
|
|
17
|
+
|
|
18
|
+
codex mcp add cofounder -- npx -y ${packageName} mcp
|
|
19
|
+
|
|
20
|
+
After npm link or global install:
|
|
21
|
+
|
|
22
|
+
codex mcp add cofounder -- cofounder mcp
|
|
23
|
+
|
|
24
|
+
Direct checkout fallback after npm run build:
|
|
25
|
+
|
|
26
|
+
codex mcp add cofounder -- node ${directMcpPath}
|
|
27
|
+
|
|
28
|
+
Then open Codex from a configured project:
|
|
29
|
+
|
|
30
|
+
cd my-project
|
|
31
|
+
codex
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
export async function installCodexMcp(options = {}) {
|
|
35
|
+
const packageName = options.packageName ?? DEFAULT_PUBLISHED_PACKAGE;
|
|
36
|
+
const args = ["mcp", "add", "cofounder", "--", "npx", "-y", packageName, "mcp"];
|
|
37
|
+
try {
|
|
38
|
+
await execFileAsync("codex", args, {
|
|
39
|
+
maxBuffer: 10 * 1024 * 1024
|
|
40
|
+
});
|
|
41
|
+
return `codex ${args.join(" ")}`;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
45
|
+
throw new CofounderError(`failed to install Codex MCP config: ${message}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AAM1D,MAAM,UAAU,gBAAgB,CAAC,UAA6B,EAAE;IAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,yBAAyB,CAAC;IACrE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC9C,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC;QAC9D,CAAC,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,OAAO;;;;sCAI6B,WAAW;;;;;;;;oCAQb,aAAa;;;;;;CAMhD,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,UAA6B,EAAE;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,yBAAyB,CAAC;IACrE,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAChF,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;SAC5B,CAAC,CAAC;QACH,OAAO,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,cAAc,CAAC,uCAAuC,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CreateTaskInput, LoadedProject, TaskEvent, TaskRecord, TaskStatus } from "./types.js";
|
|
2
|
+
export declare function createTask(project: LoadedProject, input: CreateTaskInput, prompt: string): Promise<TaskRecord>;
|
|
3
|
+
export declare function readTask(projectRoot: string, taskId: string): Promise<TaskRecord>;
|
|
4
|
+
export declare function writeTask(projectRoot: string, record: TaskRecord): Promise<void>;
|
|
5
|
+
export declare function updateTask(projectRoot: string, taskId: string, patch: Partial<TaskRecord>): Promise<TaskRecord>;
|
|
6
|
+
export declare function appendTaskEvent(projectRoot: string, record: TaskRecord, event: TaskEvent): Promise<void>;
|
|
7
|
+
export declare function appendTaskLog(projectRoot: string, relativePath: string, chunk: string): Promise<void>;
|
|
8
|
+
export declare function markTaskStatus(projectRoot: string, record: TaskRecord, status: TaskStatus, message?: string): Promise<TaskRecord>;
|
|
9
|
+
export declare function taskRunDir(projectRoot: string, taskId: string): string;
|
|
10
|
+
export declare function resolveTaskRecordPath(projectRoot: string, record: TaskRecord, key: "events_path" | "result_path" | "stdout_path" | "stderr_path" | "prompt_path"): string;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile, appendFile } from "node:fs/promises";
|
|
2
|
+
import crypto from "node:crypto";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { createGitWorktree } from "./git.js";
|
|
5
|
+
export async function createTask(project, input, prompt) {
|
|
6
|
+
const id = createTaskId(input.assignee);
|
|
7
|
+
const runDir = taskRunDir(project.projectRoot, id);
|
|
8
|
+
const workMode = input.work_mode;
|
|
9
|
+
const worktreeAbsolutePath = workMode === "worktree" && !input.execution_cwd
|
|
10
|
+
? path.join(project.projectRoot, ".cofounder", "worktrees", id)
|
|
11
|
+
: null;
|
|
12
|
+
const executionCwd = input.execution_cwd ?? worktreeAbsolutePath ?? project.projectRoot;
|
|
13
|
+
await mkdir(runDir, { recursive: true });
|
|
14
|
+
if (worktreeAbsolutePath) {
|
|
15
|
+
await createGitWorktree(project.projectRoot, worktreeAbsolutePath);
|
|
16
|
+
}
|
|
17
|
+
const record = {
|
|
18
|
+
id,
|
|
19
|
+
status: "queued",
|
|
20
|
+
caller: input.caller,
|
|
21
|
+
assignee: input.assignee,
|
|
22
|
+
runner: "codex",
|
|
23
|
+
cwd: project.projectRoot,
|
|
24
|
+
execution_cwd: executionCwd,
|
|
25
|
+
work_mode: workMode,
|
|
26
|
+
worktree_path: input.worktree_path ?? (worktreeAbsolutePath ? relative(project.projectRoot, worktreeAbsolutePath) : null),
|
|
27
|
+
codex_session_id: null,
|
|
28
|
+
codex_resume_session_id: input.codex_resume_session_id ?? null,
|
|
29
|
+
interrupted_task_id: input.interrupted_task_id ?? null,
|
|
30
|
+
interrupt_message: input.interrupt_message ?? null,
|
|
31
|
+
config_root: project.configRoot,
|
|
32
|
+
member_home_path: input.member_home_path ?? null,
|
|
33
|
+
member_prompt_path: input.member_prompt_path,
|
|
34
|
+
member_settings_path: input.member_settings_path,
|
|
35
|
+
member_effective_config_path: input.member_effective_config_path ?? null,
|
|
36
|
+
member_codex_config_path: input.member_codex_config_path ?? null,
|
|
37
|
+
created_at: new Date().toISOString(),
|
|
38
|
+
started_at: null,
|
|
39
|
+
finished_at: null,
|
|
40
|
+
prompt_path: relative(project.projectRoot, path.join(runDir, "prompt.md")),
|
|
41
|
+
events_path: relative(project.projectRoot, path.join(runDir, "events.jsonl")),
|
|
42
|
+
stdout_path: relative(project.projectRoot, path.join(runDir, "stdout.log")),
|
|
43
|
+
stderr_path: relative(project.projectRoot, path.join(runDir, "stderr.log")),
|
|
44
|
+
result_path: relative(project.projectRoot, path.join(runDir, "result.md")),
|
|
45
|
+
git_available: null,
|
|
46
|
+
base_changed_files: [],
|
|
47
|
+
changed_files: [],
|
|
48
|
+
new_changed_files: [],
|
|
49
|
+
touched_files: [],
|
|
50
|
+
conflict_risk: false,
|
|
51
|
+
apply_patch_path: null,
|
|
52
|
+
applied_at: null,
|
|
53
|
+
applied_files: []
|
|
54
|
+
};
|
|
55
|
+
await writeFile(path.join(runDir, "prompt.md"), prompt, "utf8");
|
|
56
|
+
await writeFile(path.join(runDir, "stdout.log"), "", "utf8");
|
|
57
|
+
await writeFile(path.join(runDir, "stderr.log"), "", "utf8");
|
|
58
|
+
await writeFile(path.join(runDir, "result.md"), "", "utf8");
|
|
59
|
+
await writeTask(project.projectRoot, record);
|
|
60
|
+
await appendTaskEvent(project.projectRoot, record, {
|
|
61
|
+
time: new Date().toISOString(),
|
|
62
|
+
task_id: record.id,
|
|
63
|
+
type: "task.created",
|
|
64
|
+
message: `${input.mode} task created for ${input.assignee} (${workMode} mode)`
|
|
65
|
+
});
|
|
66
|
+
if (worktreeAbsolutePath) {
|
|
67
|
+
await appendTaskEvent(project.projectRoot, record, {
|
|
68
|
+
time: new Date().toISOString(),
|
|
69
|
+
task_id: record.id,
|
|
70
|
+
type: "git.worktree.created",
|
|
71
|
+
message: record.worktree_path ?? worktreeAbsolutePath
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return record;
|
|
75
|
+
}
|
|
76
|
+
export async function readTask(projectRoot, taskId) {
|
|
77
|
+
const raw = await readFile(path.join(taskRunDir(projectRoot, taskId), "task.json"), "utf8");
|
|
78
|
+
return JSON.parse(raw);
|
|
79
|
+
}
|
|
80
|
+
export async function writeTask(projectRoot, record) {
|
|
81
|
+
await writeFile(path.join(taskRunDir(projectRoot, record.id), "task.json"), `${JSON.stringify(record, null, 2)}\n`, "utf8");
|
|
82
|
+
}
|
|
83
|
+
export async function updateTask(projectRoot, taskId, patch) {
|
|
84
|
+
const record = await readTask(projectRoot, taskId);
|
|
85
|
+
const next = { ...record, ...patch };
|
|
86
|
+
await writeTask(projectRoot, next);
|
|
87
|
+
return next;
|
|
88
|
+
}
|
|
89
|
+
export async function appendTaskEvent(projectRoot, record, event) {
|
|
90
|
+
await appendFile(path.resolve(projectRoot, record.events_path), `${JSON.stringify(event)}\n`, "utf8");
|
|
91
|
+
}
|
|
92
|
+
export async function appendTaskLog(projectRoot, relativePath, chunk) {
|
|
93
|
+
await appendFile(path.resolve(projectRoot, relativePath), chunk, "utf8");
|
|
94
|
+
}
|
|
95
|
+
export async function markTaskStatus(projectRoot, record, status, message) {
|
|
96
|
+
const now = new Date().toISOString();
|
|
97
|
+
const patch = { status };
|
|
98
|
+
if (status === "running" && !record.started_at) {
|
|
99
|
+
patch.started_at = now;
|
|
100
|
+
}
|
|
101
|
+
if (["succeeded", "failed", "cancelled"].includes(status)) {
|
|
102
|
+
patch.finished_at = now;
|
|
103
|
+
}
|
|
104
|
+
const updated = await updateTask(projectRoot, record.id, patch);
|
|
105
|
+
await appendTaskEvent(projectRoot, updated, {
|
|
106
|
+
time: now,
|
|
107
|
+
task_id: record.id,
|
|
108
|
+
type: "task.status",
|
|
109
|
+
message: message ?? status
|
|
110
|
+
});
|
|
111
|
+
return updated;
|
|
112
|
+
}
|
|
113
|
+
export function taskRunDir(projectRoot, taskId) {
|
|
114
|
+
return path.join(projectRoot, ".cofounder", "runs", taskId);
|
|
115
|
+
}
|
|
116
|
+
export function resolveTaskRecordPath(projectRoot, record, key) {
|
|
117
|
+
return path.resolve(projectRoot, record[key]);
|
|
118
|
+
}
|
|
119
|
+
function createTaskId(assignee) {
|
|
120
|
+
const stamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\..+$/, "").replace("T", "_");
|
|
121
|
+
const suffix = crypto.randomBytes(2).toString("hex");
|
|
122
|
+
return `tsk_${stamp}_${safeId(assignee)}_${suffix}`;
|
|
123
|
+
}
|
|
124
|
+
function safeId(value) {
|
|
125
|
+
return value.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
126
|
+
}
|
|
127
|
+
function relative(projectRoot, absolutePath) {
|
|
128
|
+
return path.relative(projectRoot, absolutePath);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAsB,EAAE,KAAsB,EAAE,MAAc;IAC7F,MAAM,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,MAAM,G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,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrD,OAAO,OAAO,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,CAAC;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,QAAQ,CAAC,WAAmB,EAAE,YAAoB;IACzD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ProjectTemplateName = "default" | "worktree";
|
|
2
|
+
export interface ProjectTemplate {
|
|
3
|
+
name: ProjectTemplateName;
|
|
4
|
+
description: string;
|
|
5
|
+
members: string[];
|
|
6
|
+
teamYaml: string;
|
|
7
|
+
prompts: Record<string, string>;
|
|
8
|
+
settings: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface ProjectTemplateSummary {
|
|
11
|
+
name: ProjectTemplateName;
|
|
12
|
+
description: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function listProjectTemplates(): ProjectTemplateSummary[];
|
|
15
|
+
export declare function getProjectTemplate(name?: string): ProjectTemplate;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { CofounderError } from "./errors.js";
|
|
2
|
+
const TEMPLATE_ORDER = ["default", "worktree"];
|
|
3
|
+
export function listProjectTemplates() {
|
|
4
|
+
return TEMPLATE_ORDER.map((name) => {
|
|
5
|
+
const template = getProjectTemplate(name);
|
|
6
|
+
return {
|
|
7
|
+
name: template.name,
|
|
8
|
+
description: template.description
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function getProjectTemplate(name = "default") {
|
|
13
|
+
if (name === "default") {
|
|
14
|
+
return buildTemplate("default", "General Codex-backed team with direct working-tree writes.", "default", "Default Project Team", "direct");
|
|
15
|
+
}
|
|
16
|
+
if (name === "worktree") {
|
|
17
|
+
return buildTemplate("worktree", "Same team, but implementation edits run in isolated git worktrees.", "worktree", "Worktree Project Team", "worktree");
|
|
18
|
+
}
|
|
19
|
+
throw new CofounderError(`Unknown template "${name}". Available templates: ${TEMPLATE_ORDER.join(", ")}`);
|
|
20
|
+
}
|
|
21
|
+
function buildTemplate(name, description, teamId, teamName, backendWriteMode) {
|
|
22
|
+
const members = ["lead", "backend", "reviewer"];
|
|
23
|
+
return {
|
|
24
|
+
name,
|
|
25
|
+
description,
|
|
26
|
+
members,
|
|
27
|
+
teamYaml: teamYaml(teamId, teamName),
|
|
28
|
+
prompts: Object.fromEntries(members.map((member) => [member, memberPrompt(member)])),
|
|
29
|
+
settings: {
|
|
30
|
+
lead: memberSettings("lead", "direct"),
|
|
31
|
+
backend: memberSettings("backend", backendWriteMode),
|
|
32
|
+
reviewer: memberSettings("reviewer", "direct")
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function teamYaml(teamId, teamName) {
|
|
37
|
+
return `version: 1
|
|
38
|
+
|
|
39
|
+
team:
|
|
40
|
+
id: ${teamId}
|
|
41
|
+
name: ${teamName}
|
|
42
|
+
|
|
43
|
+
defaults:
|
|
44
|
+
runner: codex
|
|
45
|
+
cwd: inherit
|
|
46
|
+
run_mode: async
|
|
47
|
+
|
|
48
|
+
members:
|
|
49
|
+
lead:
|
|
50
|
+
title: Lead Engineer
|
|
51
|
+
runner: codex
|
|
52
|
+
prompt: members/lead/prompt.md
|
|
53
|
+
settings: members/lead/settings.toml
|
|
54
|
+
home: members/lead/home
|
|
55
|
+
responsibilities:
|
|
56
|
+
- decompose tasks
|
|
57
|
+
- choose assignees
|
|
58
|
+
- own final user response
|
|
59
|
+
can_call:
|
|
60
|
+
- backend
|
|
61
|
+
- reviewer
|
|
62
|
+
|
|
63
|
+
backend:
|
|
64
|
+
title: Backend Engineer
|
|
65
|
+
runner: codex
|
|
66
|
+
prompt: members/backend/prompt.md
|
|
67
|
+
settings: members/backend/settings.toml
|
|
68
|
+
home: members/backend/home
|
|
69
|
+
responsibilities:
|
|
70
|
+
- inspect and modify code
|
|
71
|
+
- understand implementation boundaries
|
|
72
|
+
- write focused tests
|
|
73
|
+
can_call:
|
|
74
|
+
- reviewer
|
|
75
|
+
|
|
76
|
+
reviewer:
|
|
77
|
+
title: Reviewer
|
|
78
|
+
runner: codex
|
|
79
|
+
prompt: members/reviewer/prompt.md
|
|
80
|
+
settings: members/reviewer/settings.toml
|
|
81
|
+
home: members/reviewer/home
|
|
82
|
+
responsibilities:
|
|
83
|
+
- review diffs
|
|
84
|
+
- identify bugs and regressions
|
|
85
|
+
- surface missing tests
|
|
86
|
+
can_call: []
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
function memberPrompt(member) {
|
|
90
|
+
if (member === "lead") {
|
|
91
|
+
return `# Lead Engineer
|
|
92
|
+
|
|
93
|
+
You coordinate the local Codex-backed team.
|
|
94
|
+
|
|
95
|
+
Responsibilities:
|
|
96
|
+
|
|
97
|
+
- understand the user's request
|
|
98
|
+
- decide whether to handle work directly or delegate
|
|
99
|
+
- keep delegated tasks focused
|
|
100
|
+
- own the final answer to the user
|
|
101
|
+
|
|
102
|
+
Delegate only when another member has a clearer responsibility boundary.
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
if (member === "backend") {
|
|
106
|
+
return `# Backend Engineer
|
|
107
|
+
|
|
108
|
+
You handle implementation-oriented code tasks.
|
|
109
|
+
|
|
110
|
+
Responsibilities:
|
|
111
|
+
|
|
112
|
+
- inspect the project before changing code
|
|
113
|
+
- keep changes scoped to the assigned task
|
|
114
|
+
- state assumptions and risks
|
|
115
|
+
- report changed files and verification results
|
|
116
|
+
|
|
117
|
+
Do not broaden the task without explicit instructions.
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
return `# Reviewer
|
|
121
|
+
|
|
122
|
+
You review work for correctness, regressions, and missing tests.
|
|
123
|
+
|
|
124
|
+
Responsibilities:
|
|
125
|
+
|
|
126
|
+
- prioritize concrete bugs and risks
|
|
127
|
+
- reference files and commands when relevant
|
|
128
|
+
- keep summaries brief
|
|
129
|
+
- avoid unrelated cleanup suggestions
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
function memberSettings(member, writeMode) {
|
|
133
|
+
const effort = member === "reviewer" ? "medium" : "high";
|
|
134
|
+
return `model = "gpt-5.5"
|
|
135
|
+
sandbox = "workspace-write"
|
|
136
|
+
approval = "never"
|
|
137
|
+
reasoning_effort = "${effort}"
|
|
138
|
+
live_interrupt = false
|
|
139
|
+
|
|
140
|
+
[write]
|
|
141
|
+
mode = "${writeMode}"
|
|
142
|
+
|
|
143
|
+
[mcp]
|
|
144
|
+
mode = "inherit"
|
|
145
|
+
allow = []
|
|
146
|
+
|
|
147
|
+
[memory]
|
|
148
|
+
project = true
|
|
149
|
+
member = true
|
|
150
|
+
max_snippets = 5
|
|
151
|
+
|
|
152
|
+
[runner.codex]
|
|
153
|
+
json = true
|
|
154
|
+
extra_args = []
|
|
155
|
+
use_member_home = false
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB7C,MAAM,cAAc,GAA0B,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAEtE,MAAM,UAAU,oBAAoB;IAClC,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;SAClC,CAAC;IACJ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;;;;;;;;;;;;;;;;;;;;;;;;CA8CjB,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO;;;;;;;;;;;;CAYV,CAAC;IACA,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO;;;;;;;;;;;;CAYV,CAAC;IACA,CAAC;IAED,OAAO;;;;;;;;;;CAUR,CAAC;AACF,CAAC;AAED,SAAS,cAAc,CAAC,MAAc,EAAE,SAAgC;IACtE,MAAM,MAAM,GAAG,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IACzD,OAAO;;;sBAGa,MAAM;;;;UAIlB,SAAS;;;;;;;;;;;;;;;CAelB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export type TaskStatus = "queued" | "running" | "waiting" | "succeeded" | "failed" | "cancelled";
|
|
2
|
+
export type RunnerName = "codex";
|
|
3
|
+
export type WorkMode = "direct" | "worktree";
|
|
4
|
+
export interface TeamFile {
|
|
5
|
+
version: number;
|
|
6
|
+
team?: {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
};
|
|
10
|
+
defaults?: {
|
|
11
|
+
runner?: RunnerName;
|
|
12
|
+
cwd?: "inherit";
|
|
13
|
+
run_mode?: "sync" | "async";
|
|
14
|
+
};
|
|
15
|
+
members: Record<string, MemberDefinition>;
|
|
16
|
+
}
|
|
17
|
+
export interface MemberDefinition {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
runner: RunnerName;
|
|
21
|
+
prompt: string;
|
|
22
|
+
settings: string;
|
|
23
|
+
home?: string;
|
|
24
|
+
responsibilities: string[];
|
|
25
|
+
can_call: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface LoadedProject {
|
|
28
|
+
projectRoot: string;
|
|
29
|
+
configRoot: string;
|
|
30
|
+
team: TeamFile;
|
|
31
|
+
}
|
|
32
|
+
export interface MemberSettings {
|
|
33
|
+
model?: string;
|
|
34
|
+
sandbox?: "read-only" | "workspace-write" | "danger-full-access";
|
|
35
|
+
approval?: "untrusted" | "on-request" | "never" | string;
|
|
36
|
+
reasoning_effort?: "low" | "medium" | "high" | "xhigh" | string;
|
|
37
|
+
live_interrupt?: boolean;
|
|
38
|
+
write?: {
|
|
39
|
+
mode?: WorkMode;
|
|
40
|
+
};
|
|
41
|
+
mcp?: {
|
|
42
|
+
mode?: "inherit" | "none" | "allowlist";
|
|
43
|
+
allow?: string[];
|
|
44
|
+
config_path?: string;
|
|
45
|
+
include_inline_env?: boolean;
|
|
46
|
+
};
|
|
47
|
+
memory?: {
|
|
48
|
+
project?: boolean;
|
|
49
|
+
member?: boolean;
|
|
50
|
+
max_snippets?: number;
|
|
51
|
+
};
|
|
52
|
+
runner?: {
|
|
53
|
+
codex?: {
|
|
54
|
+
json?: boolean;
|
|
55
|
+
extra_args?: string[];
|
|
56
|
+
use_member_home?: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface CreateTaskInput {
|
|
61
|
+
caller: string;
|
|
62
|
+
assignee: string;
|
|
63
|
+
task: string;
|
|
64
|
+
mode: "run" | "delegate" | "interrupt";
|
|
65
|
+
member_home_path: string | null;
|
|
66
|
+
member_prompt_path: string;
|
|
67
|
+
member_settings_path: string;
|
|
68
|
+
member_effective_config_path: string | null;
|
|
69
|
+
member_codex_config_path: string | null;
|
|
70
|
+
work_mode: WorkMode;
|
|
71
|
+
execution_cwd?: string;
|
|
72
|
+
worktree_path?: string | null;
|
|
73
|
+
codex_resume_session_id?: string | null;
|
|
74
|
+
interrupted_task_id?: string | null;
|
|
75
|
+
interrupt_message?: string | null;
|
|
76
|
+
}
|
|
77
|
+
export interface TaskRecord {
|
|
78
|
+
id: string;
|
|
79
|
+
status: TaskStatus;
|
|
80
|
+
caller: string;
|
|
81
|
+
assignee: string;
|
|
82
|
+
runner: RunnerName;
|
|
83
|
+
cwd: string;
|
|
84
|
+
execution_cwd: string;
|
|
85
|
+
work_mode: WorkMode;
|
|
86
|
+
worktree_path: string | null;
|
|
87
|
+
codex_session_id: string | null;
|
|
88
|
+
codex_resume_session_id: string | null;
|
|
89
|
+
interrupted_task_id: string | null;
|
|
90
|
+
interrupt_message: string | null;
|
|
91
|
+
config_root: string;
|
|
92
|
+
member_home_path: string | null;
|
|
93
|
+
member_prompt_path: string;
|
|
94
|
+
member_settings_path: string;
|
|
95
|
+
member_effective_config_path: string | null;
|
|
96
|
+
member_codex_config_path: string | null;
|
|
97
|
+
created_at: string;
|
|
98
|
+
started_at: string | null;
|
|
99
|
+
finished_at: string | null;
|
|
100
|
+
prompt_path: string;
|
|
101
|
+
events_path: string;
|
|
102
|
+
stdout_path: string;
|
|
103
|
+
stderr_path: string;
|
|
104
|
+
result_path: string;
|
|
105
|
+
git_available: boolean | null;
|
|
106
|
+
base_changed_files: string[];
|
|
107
|
+
changed_files: string[];
|
|
108
|
+
new_changed_files: string[];
|
|
109
|
+
touched_files: string[];
|
|
110
|
+
conflict_risk: boolean;
|
|
111
|
+
apply_patch_path: string | null;
|
|
112
|
+
applied_at: string | null;
|
|
113
|
+
applied_files: string[];
|
|
114
|
+
worker_pid?: number;
|
|
115
|
+
runner_pid?: number;
|
|
116
|
+
exit_code?: number | null;
|
|
117
|
+
error?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface TaskEvent {
|
|
120
|
+
time: string;
|
|
121
|
+
task_id: string;
|
|
122
|
+
type: string;
|
|
123
|
+
message?: string;
|
|
124
|
+
raw?: unknown;
|
|
125
|
+
}
|
|
126
|
+
export interface RunnerCapabilities {
|
|
127
|
+
runner: RunnerName;
|
|
128
|
+
async_tasks: boolean;
|
|
129
|
+
watch: boolean;
|
|
130
|
+
cancel: boolean;
|
|
131
|
+
live_interrupt: boolean;
|
|
132
|
+
interrupt_mode: "unsupported" | "live" | "cancel-resume";
|
|
133
|
+
normalized_events: boolean;
|
|
134
|
+
member_home: boolean;
|
|
135
|
+
}
|
|
136
|
+
export interface CodexCommand {
|
|
137
|
+
command: string;
|
|
138
|
+
args: string[];
|
|
139
|
+
env: NodeJS.ProcessEnv;
|
|
140
|
+
cwd: string;
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { CofounderError } from "./errors.js";
|
|
3
|
+
import { runWorkerTask } from "./runtime.js";
|
|
4
|
+
const taskId = process.argv[2];
|
|
5
|
+
if (!taskId) {
|
|
6
|
+
console.error("error: missing task_id");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
runWorkerTask(taskId).catch((error) => {
|
|
10
|
+
if (error instanceof CofounderError) {
|
|
11
|
+
console.error(`error: ${error.message}`);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
throw error;
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/worker.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,aAAa,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC7C,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,MAAM,KAAK,CAAC;AACd,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cofounder-crew",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Codex-backed local team runtime",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/src",
|
|
8
|
+
"README.md"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/src/runtime.js",
|
|
12
|
+
"./init": "./dist/src/init.js",
|
|
13
|
+
"./setup": "./dist/src/setup.js",
|
|
14
|
+
"./templates": "./dist/src/templates.js"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"cofounder": "dist/src/cli.js",
|
|
18
|
+
"cofounder-mcp": "dist/src/mcp.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json && chmod +x dist/src/cli.js dist/src/mcp.js dist/src/worker.js",
|
|
22
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"test": "tsx --test tests/*.test.ts",
|
|
24
|
+
"prepack": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"workspaces": [
|
|
27
|
+
"packages/*"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
31
|
+
"smol-toml": "^1.3.1",
|
|
32
|
+
"yaml": "^2.8.0",
|
|
33
|
+
"zod": "^4.4.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.15.0",
|
|
37
|
+
"tsx": "^4.19.4",
|
|
38
|
+
"typescript": "^5.8.3"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22"
|
|
42
|
+
}
|
|
43
|
+
}
|