opcrew 0.1.2 → 0.1.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/README.md +1 -1
- package/dist/cli.js +77 -10
- package/dist/opencode-plugin.js +83 -12
- package/package.json +1 -1
- package/dist/core/Agent.d.ts +0 -14
- package/dist/crew/Boatswain.d.ts +0 -2
- package/dist/crew/Captain.d.ts +0 -2
- package/dist/crew/Navigator.d.ts +0 -2
- package/dist/crew/Quartermaster.d.ts +0 -2
- package/dist/crew/Scout.d.ts +0 -2
- package/dist/crew/index.d.ts +0 -7
- package/dist/opencode-plugin.d.ts +0 -3
- package/dist/tools/edit-logbook.d.ts +0 -32
package/README.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,62 @@ import process from "process";
|
|
|
7
7
|
// src/cli/install.ts
|
|
8
8
|
import { mkdir, writeFile } from "fs/promises";
|
|
9
9
|
import path from "path";
|
|
10
|
-
|
|
10
|
+
// src/core/tools/translations.ts
|
|
11
|
+
var CLAUDE_TOOLS = {
|
|
12
|
+
read: "read_fs",
|
|
13
|
+
write: "edit_code",
|
|
14
|
+
edit: "edit_code",
|
|
15
|
+
glob: "bash",
|
|
16
|
+
grep: "bash",
|
|
17
|
+
execute: "bash",
|
|
18
|
+
websearch: "web_search",
|
|
19
|
+
webfetch: "web_fetch",
|
|
20
|
+
delegate: "task",
|
|
21
|
+
todo: "todowrite",
|
|
22
|
+
test: "run_tests",
|
|
23
|
+
logbook: "edit_logbook",
|
|
24
|
+
skill: "skill"
|
|
25
|
+
};
|
|
26
|
+
var OPENCODE_TOOLS = {
|
|
27
|
+
read: "read",
|
|
28
|
+
write: "write",
|
|
29
|
+
edit: "edit",
|
|
30
|
+
glob: "glob",
|
|
31
|
+
grep: "grep",
|
|
32
|
+
execute: "bash",
|
|
33
|
+
websearch: "web_search",
|
|
34
|
+
webfetch: "webfetch",
|
|
35
|
+
delegate: "task",
|
|
36
|
+
todo: "todowrite",
|
|
37
|
+
test: "run_tests",
|
|
38
|
+
logbook: "edit_logbook",
|
|
39
|
+
skill: "skill"
|
|
40
|
+
};
|
|
41
|
+
var CODEX_TOOLS = {
|
|
42
|
+
read: "read",
|
|
43
|
+
write: "write",
|
|
44
|
+
edit: "edit",
|
|
45
|
+
glob: "glob",
|
|
46
|
+
grep: "grep",
|
|
47
|
+
execute: "execute",
|
|
48
|
+
websearch: "web_search",
|
|
49
|
+
webfetch: "web_fetch",
|
|
50
|
+
delegate: "task",
|
|
51
|
+
todo: "todo",
|
|
52
|
+
test: "test",
|
|
53
|
+
logbook: "logbook",
|
|
54
|
+
skill: "skill"
|
|
55
|
+
};
|
|
56
|
+
function translateTools(canonicalTools, platform) {
|
|
57
|
+
const maps = {
|
|
58
|
+
claude: CLAUDE_TOOLS,
|
|
59
|
+
opencode: OPENCODE_TOOLS,
|
|
60
|
+
codex: CODEX_TOOLS
|
|
61
|
+
};
|
|
62
|
+
const translationMap = maps[platform];
|
|
63
|
+
const translated = canonicalTools.map((tool) => translationMap[tool]);
|
|
64
|
+
return [...new Set(translated)];
|
|
65
|
+
}
|
|
11
66
|
// src/core/Agent.ts
|
|
12
67
|
class OpCrewAgent {
|
|
13
68
|
config;
|
|
@@ -15,10 +70,11 @@ class OpCrewAgent {
|
|
|
15
70
|
this.config = config;
|
|
16
71
|
}
|
|
17
72
|
compileToMarkdown() {
|
|
73
|
+
const translatedTools = translateTools(this.config.tools, "claude");
|
|
18
74
|
const frontmatter = `---
|
|
19
75
|
name: ${this.config.name}
|
|
20
76
|
role: ${this.config.role}
|
|
21
|
-
tools: [${
|
|
77
|
+
tools: [${translatedTools.join(", ")}]
|
|
22
78
|
---`;
|
|
23
79
|
return `${frontmatter}
|
|
24
80
|
${this.buildMarkdownBody()}`;
|
|
@@ -39,6 +95,16 @@ permission:
|
|
|
39
95
|
edit: ${permission.edit}
|
|
40
96
|
bash: ${permission.bash}
|
|
41
97
|
webfetch: ${permission.webfetch}
|
|
98
|
+
---`;
|
|
99
|
+
return `${frontmatter}
|
|
100
|
+
${this.buildMarkdownBody()}`;
|
|
101
|
+
}
|
|
102
|
+
compileToCodexMarkdown() {
|
|
103
|
+
const translatedTools = translateTools(this.config.tools, "codex");
|
|
104
|
+
const frontmatter = `---
|
|
105
|
+
name: ${this.config.name}
|
|
106
|
+
role: ${this.config.role}
|
|
107
|
+
tools: [${translatedTools.join(", ")}]
|
|
42
108
|
---`;
|
|
43
109
|
return `${frontmatter}
|
|
44
110
|
${this.buildMarkdownBody()}`;
|
|
@@ -76,7 +142,7 @@ var Captain = new OpCrewAgent({
|
|
|
76
142
|
"Knowledge discipline: require crew to read/update docs/knowledge (project map, glossary, relevant ADRs) for any decision or scope change.",
|
|
77
143
|
"Ensure every material decision is captured as an ADR in docs/knowledge/decisions."
|
|
78
144
|
],
|
|
79
|
-
tools: ["
|
|
145
|
+
tools: ["read", "logbook", "delegate"]
|
|
80
146
|
});
|
|
81
147
|
|
|
82
148
|
// src/crew/Navigator.ts
|
|
@@ -97,7 +163,7 @@ var Navigator = new OpCrewAgent({
|
|
|
97
163
|
"Define verification steps explicitly (diagnostics/tests/build) and include success evidence in the plan.",
|
|
98
164
|
"Consult docs/knowledge before planning; update project-map/glossary/ADRs when scope or definitions change."
|
|
99
165
|
],
|
|
100
|
-
tools: ["
|
|
166
|
+
tools: ["read", "websearch", "logbook", "todo"]
|
|
101
167
|
});
|
|
102
168
|
|
|
103
169
|
// src/crew/Boatswain.ts
|
|
@@ -113,9 +179,10 @@ var Boatswain = new OpCrewAgent({
|
|
|
113
179
|
"Log completion status, assumptions, and blockers immediately for the Captain.",
|
|
114
180
|
"Do not re-run delegated exploration; wait for Navigator findings before implementing dependent changes.",
|
|
115
181
|
"Use verification gates: lsp diagnostics on touched files plus relevant tests/builds before completion.",
|
|
116
|
-
"Update docs/knowledge when execution changes assumptions, definitions, or operational steps."
|
|
182
|
+
"Update docs/knowledge when execution changes assumptions, definitions, or operational steps.",
|
|
183
|
+
"Update todo task status immediately upon completion of each task."
|
|
117
184
|
],
|
|
118
|
-
tools: ["
|
|
185
|
+
tools: ["read", "edit", "test", "todo"]
|
|
119
186
|
});
|
|
120
187
|
|
|
121
188
|
// src/crew/Quartermaster.ts
|
|
@@ -133,7 +200,7 @@ var Quartermaster = new OpCrewAgent({
|
|
|
133
200
|
"Verify delegation protocol compliance when specialists were involved (task/outcome/tools/must-do/must-not/context).",
|
|
134
201
|
"Reject approval if docs/knowledge changes are missing for material decisions or scope shifts."
|
|
135
202
|
],
|
|
136
|
-
tools: ["read", "grep", "
|
|
203
|
+
tools: ["read", "grep", "execute", "write"]
|
|
137
204
|
});
|
|
138
205
|
|
|
139
206
|
// src/crew/Scout.ts
|
|
@@ -153,7 +220,7 @@ var Scout = new OpCrewAgent({
|
|
|
153
220
|
"If research reveals the task is more complex than expected, escalate to Navigator for replanning.",
|
|
154
221
|
"Cache useful references in docs/knowledge for future crew reference."
|
|
155
222
|
],
|
|
156
|
-
tools: ["
|
|
223
|
+
tools: ["websearch", "webfetch", "read"]
|
|
157
224
|
});
|
|
158
225
|
|
|
159
226
|
// src/crew/index.ts
|
|
@@ -166,7 +233,7 @@ var crew = [
|
|
|
166
233
|
];
|
|
167
234
|
|
|
168
235
|
// src/cli/install.ts
|
|
169
|
-
var CLAUDE_DIR = path.join(".
|
|
236
|
+
var CLAUDE_DIR = path.join(".claude", "agents");
|
|
170
237
|
var OPENCODE_DIR = path.join(".opencode", "agents");
|
|
171
238
|
var CODEX_FILE = path.join(".codex", "instructions.md");
|
|
172
239
|
async function ensureDir(targetDir) {
|
|
@@ -190,7 +257,7 @@ async function installToTool(tool) {
|
|
|
190
257
|
async function installForCodex() {
|
|
191
258
|
const codexDir = path.dirname(CODEX_FILE);
|
|
192
259
|
await ensureDir(codexDir);
|
|
193
|
-
const compiled = crew.map((agent) => agent.
|
|
260
|
+
const compiled = crew.map((agent) => agent.compileToCodexMarkdown()).join(`
|
|
194
261
|
|
|
195
262
|
---
|
|
196
263
|
|
package/dist/opencode-plugin.js
CHANGED
|
@@ -1,15 +1,74 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __returnValue = (v) => v;
|
|
4
|
+
function __exportSetter(name, newValue) {
|
|
5
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
6
|
+
}
|
|
3
7
|
var __export = (target, all) => {
|
|
4
8
|
for (var name in all)
|
|
5
9
|
__defProp(target, name, {
|
|
6
10
|
get: all[name],
|
|
7
11
|
enumerable: true,
|
|
8
12
|
configurable: true,
|
|
9
|
-
set: (
|
|
13
|
+
set: __exportSetter.bind(all, name)
|
|
10
14
|
});
|
|
11
15
|
};
|
|
12
|
-
|
|
16
|
+
// src/core/tools/translations.ts
|
|
17
|
+
var CLAUDE_TOOLS = {
|
|
18
|
+
read: "read_fs",
|
|
19
|
+
write: "edit_code",
|
|
20
|
+
edit: "edit_code",
|
|
21
|
+
glob: "bash",
|
|
22
|
+
grep: "bash",
|
|
23
|
+
execute: "bash",
|
|
24
|
+
websearch: "web_search",
|
|
25
|
+
webfetch: "web_fetch",
|
|
26
|
+
delegate: "task",
|
|
27
|
+
todo: "todowrite",
|
|
28
|
+
test: "run_tests",
|
|
29
|
+
logbook: "edit_logbook",
|
|
30
|
+
skill: "skill"
|
|
31
|
+
};
|
|
32
|
+
var OPENCODE_TOOLS = {
|
|
33
|
+
read: "read",
|
|
34
|
+
write: "write",
|
|
35
|
+
edit: "edit",
|
|
36
|
+
glob: "glob",
|
|
37
|
+
grep: "grep",
|
|
38
|
+
execute: "bash",
|
|
39
|
+
websearch: "web_search",
|
|
40
|
+
webfetch: "webfetch",
|
|
41
|
+
delegate: "task",
|
|
42
|
+
todo: "todowrite",
|
|
43
|
+
test: "run_tests",
|
|
44
|
+
logbook: "edit_logbook",
|
|
45
|
+
skill: "skill"
|
|
46
|
+
};
|
|
47
|
+
var CODEX_TOOLS = {
|
|
48
|
+
read: "read",
|
|
49
|
+
write: "write",
|
|
50
|
+
edit: "edit",
|
|
51
|
+
glob: "glob",
|
|
52
|
+
grep: "grep",
|
|
53
|
+
execute: "execute",
|
|
54
|
+
websearch: "web_search",
|
|
55
|
+
webfetch: "web_fetch",
|
|
56
|
+
delegate: "task",
|
|
57
|
+
todo: "todo",
|
|
58
|
+
test: "test",
|
|
59
|
+
logbook: "logbook",
|
|
60
|
+
skill: "skill"
|
|
61
|
+
};
|
|
62
|
+
function translateTools(canonicalTools, platform) {
|
|
63
|
+
const maps = {
|
|
64
|
+
claude: CLAUDE_TOOLS,
|
|
65
|
+
opencode: OPENCODE_TOOLS,
|
|
66
|
+
codex: CODEX_TOOLS
|
|
67
|
+
};
|
|
68
|
+
const translationMap = maps[platform];
|
|
69
|
+
const translated = canonicalTools.map((tool) => translationMap[tool]);
|
|
70
|
+
return [...new Set(translated)];
|
|
71
|
+
}
|
|
13
72
|
// src/core/Agent.ts
|
|
14
73
|
class OpCrewAgent {
|
|
15
74
|
config;
|
|
@@ -17,10 +76,11 @@ class OpCrewAgent {
|
|
|
17
76
|
this.config = config;
|
|
18
77
|
}
|
|
19
78
|
compileToMarkdown() {
|
|
79
|
+
const translatedTools = translateTools(this.config.tools, "claude");
|
|
20
80
|
const frontmatter = `---
|
|
21
81
|
name: ${this.config.name}
|
|
22
82
|
role: ${this.config.role}
|
|
23
|
-
tools: [${
|
|
83
|
+
tools: [${translatedTools.join(", ")}]
|
|
24
84
|
---`;
|
|
25
85
|
return `${frontmatter}
|
|
26
86
|
${this.buildMarkdownBody()}`;
|
|
@@ -41,6 +101,16 @@ permission:
|
|
|
41
101
|
edit: ${permission.edit}
|
|
42
102
|
bash: ${permission.bash}
|
|
43
103
|
webfetch: ${permission.webfetch}
|
|
104
|
+
---`;
|
|
105
|
+
return `${frontmatter}
|
|
106
|
+
${this.buildMarkdownBody()}`;
|
|
107
|
+
}
|
|
108
|
+
compileToCodexMarkdown() {
|
|
109
|
+
const translatedTools = translateTools(this.config.tools, "codex");
|
|
110
|
+
const frontmatter = `---
|
|
111
|
+
name: ${this.config.name}
|
|
112
|
+
role: ${this.config.role}
|
|
113
|
+
tools: [${translatedTools.join(", ")}]
|
|
44
114
|
---`;
|
|
45
115
|
return `${frontmatter}
|
|
46
116
|
${this.buildMarkdownBody()}`;
|
|
@@ -78,7 +148,7 @@ var Captain = new OpCrewAgent({
|
|
|
78
148
|
"Knowledge discipline: require crew to read/update docs/knowledge (project map, glossary, relevant ADRs) for any decision or scope change.",
|
|
79
149
|
"Ensure every material decision is captured as an ADR in docs/knowledge/decisions."
|
|
80
150
|
],
|
|
81
|
-
tools: ["
|
|
151
|
+
tools: ["read", "logbook", "delegate"]
|
|
82
152
|
});
|
|
83
153
|
|
|
84
154
|
// src/crew/Navigator.ts
|
|
@@ -99,7 +169,7 @@ var Navigator = new OpCrewAgent({
|
|
|
99
169
|
"Define verification steps explicitly (diagnostics/tests/build) and include success evidence in the plan.",
|
|
100
170
|
"Consult docs/knowledge before planning; update project-map/glossary/ADRs when scope or definitions change."
|
|
101
171
|
],
|
|
102
|
-
tools: ["
|
|
172
|
+
tools: ["read", "websearch", "logbook", "todo"]
|
|
103
173
|
});
|
|
104
174
|
|
|
105
175
|
// src/crew/Boatswain.ts
|
|
@@ -115,9 +185,10 @@ var Boatswain = new OpCrewAgent({
|
|
|
115
185
|
"Log completion status, assumptions, and blockers immediately for the Captain.",
|
|
116
186
|
"Do not re-run delegated exploration; wait for Navigator findings before implementing dependent changes.",
|
|
117
187
|
"Use verification gates: lsp diagnostics on touched files plus relevant tests/builds before completion.",
|
|
118
|
-
"Update docs/knowledge when execution changes assumptions, definitions, or operational steps."
|
|
188
|
+
"Update docs/knowledge when execution changes assumptions, definitions, or operational steps.",
|
|
189
|
+
"Update todo task status immediately upon completion of each task."
|
|
119
190
|
],
|
|
120
|
-
tools: ["
|
|
191
|
+
tools: ["read", "edit", "test", "todo"]
|
|
121
192
|
});
|
|
122
193
|
|
|
123
194
|
// src/crew/Quartermaster.ts
|
|
@@ -135,7 +206,7 @@ var Quartermaster = new OpCrewAgent({
|
|
|
135
206
|
"Verify delegation protocol compliance when specialists were involved (task/outcome/tools/must-do/must-not/context).",
|
|
136
207
|
"Reject approval if docs/knowledge changes are missing for material decisions or scope shifts."
|
|
137
208
|
],
|
|
138
|
-
tools: ["read", "grep", "
|
|
209
|
+
tools: ["read", "grep", "execute", "write"]
|
|
139
210
|
});
|
|
140
211
|
|
|
141
212
|
// src/crew/Scout.ts
|
|
@@ -155,7 +226,7 @@ var Scout = new OpCrewAgent({
|
|
|
155
226
|
"If research reveals the task is more complex than expected, escalate to Navigator for replanning.",
|
|
156
227
|
"Cache useful references in docs/knowledge for future crew reference."
|
|
157
228
|
],
|
|
158
|
-
tools: ["
|
|
229
|
+
tools: ["websearch", "webfetch", "read"]
|
|
159
230
|
});
|
|
160
231
|
|
|
161
232
|
// src/crew/index.ts
|
|
@@ -10251,10 +10322,10 @@ function _property(property, schema, params) {
|
|
|
10251
10322
|
...normalizeParams(params)
|
|
10252
10323
|
});
|
|
10253
10324
|
}
|
|
10254
|
-
function _mime(
|
|
10325
|
+
function _mime(types2, params) {
|
|
10255
10326
|
return new $ZodCheckMimeType({
|
|
10256
10327
|
check: "mime_type",
|
|
10257
|
-
mime:
|
|
10328
|
+
mime: types2,
|
|
10258
10329
|
...normalizeParams(params)
|
|
10259
10330
|
});
|
|
10260
10331
|
}
|
|
@@ -12164,7 +12235,7 @@ var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
|
12164
12235
|
ZodType.init(inst, def);
|
|
12165
12236
|
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
12166
12237
|
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
12167
|
-
inst.mime = (
|
|
12238
|
+
inst.mime = (types2, params) => inst.check(_mime(Array.isArray(types2) ? types2 : [types2], params));
|
|
12168
12239
|
});
|
|
12169
12240
|
function file(params) {
|
|
12170
12241
|
return _file(ZodFile, params);
|
package/package.json
CHANGED
package/dist/core/Agent.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface AgentConfig {
|
|
2
|
-
name: string;
|
|
3
|
-
role: 'Orchestrator' | 'Planner' | 'Executor' | 'Reviewer' | 'Researcher';
|
|
4
|
-
mode: 'primary' | 'subagent';
|
|
5
|
-
instructions: string[];
|
|
6
|
-
tools: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare class OpCrewAgent {
|
|
9
|
-
readonly config: AgentConfig;
|
|
10
|
-
constructor(config: AgentConfig);
|
|
11
|
-
compileToMarkdown(): string;
|
|
12
|
-
compileToOpenCodeMarkdown(): string;
|
|
13
|
-
private buildMarkdownBody;
|
|
14
|
-
}
|
package/dist/crew/Boatswain.d.ts
DELETED
package/dist/crew/Captain.d.ts
DELETED
package/dist/crew/Navigator.d.ts
DELETED
package/dist/crew/Scout.d.ts
DELETED
package/dist/crew/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Captain } from "./Captain";
|
|
2
|
-
import { Navigator } from "./Navigator";
|
|
3
|
-
import { Boatswain } from "./Boatswain";
|
|
4
|
-
import { Quartermaster } from "./Quartermaster";
|
|
5
|
-
import { Scout } from "./Scout";
|
|
6
|
-
export declare const crew: readonly [import("../core/Agent").OpCrewAgent, import("../core/Agent").OpCrewAgent, import("../core/Agent").OpCrewAgent, import("../core/Agent").OpCrewAgent, import("../core/Agent").OpCrewAgent];
|
|
7
|
-
export { Captain, Navigator, Boatswain, Quartermaster, Scout };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const editLogbookTool: {
|
|
2
|
-
description: string;
|
|
3
|
-
args: {
|
|
4
|
-
action: import("zod").ZodEnum<{
|
|
5
|
-
add: "add";
|
|
6
|
-
update: "update";
|
|
7
|
-
remove: "remove";
|
|
8
|
-
set_voyage: "set_voyage";
|
|
9
|
-
}>;
|
|
10
|
-
section: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
11
|
-
missions: "missions";
|
|
12
|
-
decisions: "decisions";
|
|
13
|
-
blockers: "blockers";
|
|
14
|
-
notes: "notes";
|
|
15
|
-
}>>;
|
|
16
|
-
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
-
data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
18
|
-
voyage_status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
19
|
-
idle: "idle";
|
|
20
|
-
active: "active";
|
|
21
|
-
blocked: "blocked";
|
|
22
|
-
completed: "completed";
|
|
23
|
-
}>>;
|
|
24
|
-
};
|
|
25
|
-
execute(args: {
|
|
26
|
-
action: "add" | "update" | "remove" | "set_voyage";
|
|
27
|
-
section?: "missions" | "decisions" | "blockers" | "notes" | undefined;
|
|
28
|
-
id?: string | undefined;
|
|
29
|
-
data?: Record<string, unknown> | undefined;
|
|
30
|
-
voyage_status?: "idle" | "active" | "blocked" | "completed" | undefined;
|
|
31
|
-
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
32
|
-
};
|