opencode-multiagent 0.2.0 → 0.3.0-next.1
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/AGENTS.md +62 -0
- package/CHANGELOG.md +18 -0
- package/CONTRIBUTING.md +36 -0
- package/README.md +41 -165
- package/README.tr.md +84 -0
- package/RELEASE.md +68 -0
- package/agents/advisor.md +9 -6
- package/agents/auditor.md +8 -6
- package/agents/critic.md +19 -10
- package/agents/deep-worker.md +11 -7
- package/agents/devil.md +3 -1
- package/agents/executor.md +20 -19
- package/agents/heavy-worker.md +11 -7
- package/agents/lead.md +22 -30
- package/agents/librarian.md +6 -2
- package/agents/planner.md +18 -10
- package/agents/qa.md +9 -6
- package/agents/quick.md +12 -7
- package/agents/reviewer.md +9 -6
- package/agents/scout.md +9 -5
- package/agents/scribe.md +33 -28
- package/agents/strategist.md +10 -7
- package/agents/ui-heavy-worker.md +11 -7
- package/agents/ui-worker.md +12 -7
- package/agents/validator.md +8 -5
- package/agents/worker.md +12 -7
- package/commands/execute.md +1 -0
- package/commands/init-deep.md +1 -0
- package/commands/init.md +1 -0
- package/commands/inspect.md +1 -0
- package/commands/plan.md +1 -0
- package/commands/quality.md +1 -0
- package/commands/review.md +1 -0
- package/commands/status.md +1 -0
- package/defaults/opencode-multiagent.json +223 -0
- package/defaults/opencode-multiagent.schema.json +249 -0
- package/dist/control-plane.d.ts +4 -0
- package/dist/control-plane.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1583 -0
- package/dist/opencode-multiagent/compiler.d.ts +19 -0
- package/dist/opencode-multiagent/compiler.d.ts.map +1 -0
- package/dist/opencode-multiagent/constants.d.ts +116 -0
- package/dist/opencode-multiagent/constants.d.ts.map +1 -0
- package/dist/opencode-multiagent/defaults.d.ts +10 -0
- package/dist/opencode-multiagent/defaults.d.ts.map +1 -0
- package/dist/opencode-multiagent/file-lock.d.ts +15 -0
- package/dist/opencode-multiagent/file-lock.d.ts.map +1 -0
- package/dist/opencode-multiagent/hooks.d.ts +62 -0
- package/dist/opencode-multiagent/hooks.d.ts.map +1 -0
- package/dist/opencode-multiagent/log.d.ts +2 -0
- package/dist/opencode-multiagent/log.d.ts.map +1 -0
- package/dist/opencode-multiagent/markdown.d.ts +8 -0
- package/dist/opencode-multiagent/markdown.d.ts.map +1 -0
- package/dist/opencode-multiagent/mcp.d.ts +3 -0
- package/dist/opencode-multiagent/mcp.d.ts.map +1 -0
- package/dist/opencode-multiagent/policy.d.ts +5 -0
- package/dist/opencode-multiagent/policy.d.ts.map +1 -0
- package/dist/opencode-multiagent/quality.d.ts +14 -0
- package/dist/opencode-multiagent/quality.d.ts.map +1 -0
- package/dist/opencode-multiagent/runtime.d.ts +7 -0
- package/dist/opencode-multiagent/runtime.d.ts.map +1 -0
- package/dist/opencode-multiagent/session-tracker.d.ts +32 -0
- package/dist/opencode-multiagent/session-tracker.d.ts.map +1 -0
- package/dist/opencode-multiagent/skills.d.ts +17 -0
- package/dist/opencode-multiagent/skills.d.ts.map +1 -0
- package/dist/opencode-multiagent/supervision.d.ts +12 -0
- package/dist/opencode-multiagent/supervision.d.ts.map +1 -0
- package/dist/opencode-multiagent/task-manager.d.ts +48 -0
- package/dist/opencode-multiagent/task-manager.d.ts.map +1 -0
- package/dist/opencode-multiagent/telemetry.d.ts +26 -0
- package/dist/opencode-multiagent/telemetry.d.ts.map +1 -0
- package/dist/opencode-multiagent/tools.d.ts +56 -0
- package/dist/opencode-multiagent/tools.d.ts.map +1 -0
- package/dist/opencode-multiagent/types.d.ts +36 -0
- package/dist/opencode-multiagent/types.d.ts.map +1 -0
- package/dist/opencode-multiagent/utils.d.ts +9 -0
- package/dist/opencode-multiagent/utils.d.ts.map +1 -0
- package/docs/agents.md +260 -0
- package/docs/agents.tr.md +260 -0
- package/docs/configuration.md +255 -0
- package/docs/configuration.tr.md +255 -0
- package/docs/usage-guide.md +226 -0
- package/docs/usage-guide.tr.md +227 -0
- package/examples/opencode.with-overrides.json +1 -5
- package/package.json +23 -13
- package/skills/advanced-evaluation/SKILL.md +37 -21
- package/skills/advanced-evaluation/manifest.json +2 -13
- package/skills/cek-context-engineering/SKILL.md +159 -87
- package/skills/cek-context-engineering/manifest.json +1 -3
- package/skills/cek-prompt-engineering/SKILL.md +13 -10
- package/skills/cek-prompt-engineering/manifest.json +1 -3
- package/skills/cek-test-prompt/SKILL.md +38 -28
- package/skills/cek-test-prompt/manifest.json +1 -3
- package/skills/cek-thought-based-reasoning/SKILL.md +75 -21
- package/skills/cek-thought-based-reasoning/manifest.json +1 -3
- package/skills/context-degradation/SKILL.md +14 -13
- package/skills/context-degradation/manifest.json +1 -3
- package/skills/debate/SKILL.md +23 -78
- package/skills/debate/manifest.json +2 -12
- package/skills/design-first/manifest.json +2 -13
- package/skills/dispatching-parallel-agents/SKILL.md +14 -3
- package/skills/dispatching-parallel-agents/manifest.json +1 -4
- package/skills/drift-analysis/SKILL.md +50 -29
- package/skills/drift-analysis/manifest.json +2 -12
- package/skills/evaluation/manifest.json +2 -12
- package/skills/executing-plans/SKILL.md +15 -8
- package/skills/executing-plans/manifest.json +1 -3
- package/skills/handoff-protocols/manifest.json +2 -12
- package/skills/parallel-investigation/SKILL.md +25 -12
- package/skills/parallel-investigation/manifest.json +1 -4
- package/skills/reflexion-critique/SKILL.md +21 -10
- package/skills/reflexion-critique/manifest.json +1 -3
- package/skills/reflexion-reflect/SKILL.md +36 -34
- package/skills/reflexion-reflect/manifest.json +2 -10
- package/skills/root-cause-analysis/manifest.json +2 -13
- package/skills/sadd-judge-with-debate/SKILL.md +50 -26
- package/skills/sadd-judge-with-debate/manifest.json +1 -3
- package/skills/structured-code-review/manifest.json +2 -11
- package/skills/task-decomposition/manifest.json +2 -13
- package/skills/verification-before-completion/manifest.json +2 -15
- package/skills/verification-gates/SKILL.md +27 -19
- package/skills/verification-gates/manifest.json +2 -12
- package/defaults/agent-settings.json +0 -102
- package/defaults/agent-settings.schema.json +0 -25
- package/defaults/flags.json +0 -35
- package/defaults/flags.schema.json +0 -119
- package/defaults/mcp-defaults.json +0 -47
- package/defaults/mcp-defaults.schema.json +0 -38
- package/defaults/profiles.json +0 -53
- package/defaults/profiles.schema.json +0 -60
- package/defaults/team-profiles.json +0 -83
- package/src/control-plane.ts +0 -21
- package/src/index.ts +0 -8
- package/src/opencode-multiagent/compiler.ts +0 -168
- package/src/opencode-multiagent/constants.ts +0 -178
- package/src/opencode-multiagent/file-lock.ts +0 -90
- package/src/opencode-multiagent/hooks.ts +0 -599
- package/src/opencode-multiagent/log.ts +0 -12
- package/src/opencode-multiagent/mailbox.ts +0 -287
- package/src/opencode-multiagent/markdown.ts +0 -99
- package/src/opencode-multiagent/mcp.ts +0 -35
- package/src/opencode-multiagent/policy.ts +0 -67
- package/src/opencode-multiagent/quality.ts +0 -140
- package/src/opencode-multiagent/runtime.ts +0 -55
- package/src/opencode-multiagent/skills.ts +0 -144
- package/src/opencode-multiagent/supervision.ts +0 -156
- package/src/opencode-multiagent/task-manager.ts +0 -148
- package/src/opencode-multiagent/team-manager.ts +0 -219
- package/src/opencode-multiagent/team-tools.ts +0 -359
- package/src/opencode-multiagent/telemetry.ts +0 -124
- package/src/opencode-multiagent/utils.ts +0 -54
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { homedir } from "node:os";
|
|
2
|
-
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
export const pluginName = "opencode-multiagent";
|
|
6
|
-
export const pluginMode = "stable";
|
|
7
|
-
|
|
8
|
-
export const opencodeDir = join(homedir(), ".config", "opencode");
|
|
9
|
-
export const pluginDir = join(opencodeDir, "plugins");
|
|
10
|
-
export const globalAgentsDir = join(opencodeDir, "agents");
|
|
11
|
-
export const globalCommandsDir = join(opencodeDir, "commands");
|
|
12
|
-
export const logDirPath = join(opencodeDir, "logs");
|
|
13
|
-
export const logFilePath = join(logDirPath, `${pluginName}.jsonl`);
|
|
14
|
-
export const flagsPath = join(pluginDir, `${pluginName}.flags.json`);
|
|
15
|
-
export const agentSettingsPath = join(pluginDir, `${pluginName}.agent-settings.json`);
|
|
16
|
-
export const profilesPath = join(pluginDir, `${pluginName}.profiles.json`);
|
|
17
|
-
|
|
18
|
-
export const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
19
|
-
export const bundledAgentSettingsPath = join(packageRoot, "defaults", "agent-settings.json");
|
|
20
|
-
export const bundledAgentsDir = join(packageRoot, "agents");
|
|
21
|
-
export const bundledCommandsDir = join(packageRoot, "commands");
|
|
22
|
-
export const bundledSkillsDir = join(packageRoot, "skills");
|
|
23
|
-
|
|
24
|
-
export const trackedEventTypes = new Set([
|
|
25
|
-
"permission.updated",
|
|
26
|
-
"permission.replied",
|
|
27
|
-
"session.created",
|
|
28
|
-
"session.status",
|
|
29
|
-
"session.diff",
|
|
30
|
-
"file.edited",
|
|
31
|
-
"session.deleted",
|
|
32
|
-
"session.idle",
|
|
33
|
-
"message.updated",
|
|
34
|
-
"message.part.updated",
|
|
35
|
-
"message.part.delta",
|
|
36
|
-
"command.executed",
|
|
37
|
-
]);
|
|
38
|
-
|
|
39
|
-
export const supervisionEventTypes = new Set([
|
|
40
|
-
"session.created",
|
|
41
|
-
"message.updated",
|
|
42
|
-
"message.part.updated",
|
|
43
|
-
"message.part.delta",
|
|
44
|
-
"session.idle",
|
|
45
|
-
"session.deleted",
|
|
46
|
-
]);
|
|
47
|
-
|
|
48
|
-
export const qualityEventTypes = new Set(["file.edited", "session.idle", "session.deleted"]);
|
|
49
|
-
export const telemetryEventTypes = new Set(["session.created", "message.updated", "session.deleted"]);
|
|
50
|
-
export const suspiciousTerms = ["blocked", "failed", "error", "permission", "refused"];
|
|
51
|
-
export const qualitySignalRegex =
|
|
52
|
-
/\b(test|tests|lint|typecheck|tsc|build|pytest|vitest|jest|cargo test|go test|ruff|mypy|eslint|biome|prettier)\b/i;
|
|
53
|
-
|
|
54
|
-
export const mcpToolPrefixes = ["exa_", "context7_", "gh_grep_", "github_", "code_index_", "repo_git_"];
|
|
55
|
-
|
|
56
|
-
export const defaultProfiles = {
|
|
57
|
-
minimal: {
|
|
58
|
-
enforcement: true,
|
|
59
|
-
observation: false,
|
|
60
|
-
prompt_controls: false,
|
|
61
|
-
agent_compilation: true,
|
|
62
|
-
command_compilation: true,
|
|
63
|
-
mcp_compilation: true,
|
|
64
|
-
telemetry: false,
|
|
65
|
-
supervision: false,
|
|
66
|
-
quality_gate: false,
|
|
67
|
-
experimental: {
|
|
68
|
-
chat_system_transform: false,
|
|
69
|
-
chat_messages_transform: false,
|
|
70
|
-
session_compacting: false,
|
|
71
|
-
text_complete: false,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
standard: {
|
|
75
|
-
enforcement: true,
|
|
76
|
-
observation: true,
|
|
77
|
-
prompt_controls: true,
|
|
78
|
-
agent_compilation: true,
|
|
79
|
-
command_compilation: true,
|
|
80
|
-
mcp_compilation: true,
|
|
81
|
-
telemetry: true,
|
|
82
|
-
supervision: true,
|
|
83
|
-
quality_gate: true,
|
|
84
|
-
skill_sources: [bundledSkillsDir, join(homedir(), ".agents", "skills"), join(homedir(), "skills")],
|
|
85
|
-
skill_injection: false,
|
|
86
|
-
experimental: {
|
|
87
|
-
chat_system_transform: false,
|
|
88
|
-
chat_messages_transform: false,
|
|
89
|
-
session_compacting: false,
|
|
90
|
-
text_complete: false,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
strict: {
|
|
94
|
-
enforcement: true,
|
|
95
|
-
observation: true,
|
|
96
|
-
prompt_controls: true,
|
|
97
|
-
agent_compilation: true,
|
|
98
|
-
command_compilation: true,
|
|
99
|
-
mcp_compilation: true,
|
|
100
|
-
telemetry: true,
|
|
101
|
-
supervision: true,
|
|
102
|
-
quality_gate: true,
|
|
103
|
-
experimental: {
|
|
104
|
-
chat_system_transform: true,
|
|
105
|
-
chat_messages_transform: true,
|
|
106
|
-
session_compacting: true,
|
|
107
|
-
text_complete: true,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const defaultFlags = {
|
|
113
|
-
profile: "standard",
|
|
114
|
-
enforcement: true,
|
|
115
|
-
observation: true,
|
|
116
|
-
prompt_controls: true,
|
|
117
|
-
agent_compilation: true,
|
|
118
|
-
command_compilation: true,
|
|
119
|
-
mcp_compilation: true,
|
|
120
|
-
telemetry: true,
|
|
121
|
-
supervision: true,
|
|
122
|
-
quality_gate: true,
|
|
123
|
-
skill_sources: [bundledSkillsDir, join(homedir(), ".agents", "skills"), join(homedir(), "skills")],
|
|
124
|
-
skill_injection: false,
|
|
125
|
-
compiler: {
|
|
126
|
-
permission_compilation: true,
|
|
127
|
-
},
|
|
128
|
-
experimental: {
|
|
129
|
-
chat_system_transform: false,
|
|
130
|
-
chat_messages_transform: false,
|
|
131
|
-
session_compacting: false,
|
|
132
|
-
text_complete: false,
|
|
133
|
-
},
|
|
134
|
-
supervision_config: {
|
|
135
|
-
idle_timeout_ms: 180000,
|
|
136
|
-
cooldown_ms: 300000,
|
|
137
|
-
},
|
|
138
|
-
quality_config: {
|
|
139
|
-
reminder_idle_ms: 120000,
|
|
140
|
-
reminder_cooldown_ms: 300000,
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const disabledNativeAgents = ["build", "plan", "general", "explore"];
|
|
145
|
-
|
|
146
|
-
export const blockedPathPrefixRegex = /^(\/etc|\/root|\/boot|\/proc|\/sys|\/dev)(?:\/|$)/;
|
|
147
|
-
export const blockedPathFragments = ["/.ssh/", "/credentials", "/secrets", "/.aws/", "/.gcloud/", "/.kube/"];
|
|
148
|
-
export const blockedPathSuffixes = ["/.ssh", "/credentials"];
|
|
149
|
-
export const destructiveBashFragments = [
|
|
150
|
-
"git reset --" + "hard",
|
|
151
|
-
"git che" + "ckout --",
|
|
152
|
-
"r" + "m -rf /",
|
|
153
|
-
"r" + "m -rf ~",
|
|
154
|
-
"su" + "do ",
|
|
155
|
-
"shut" + "down",
|
|
156
|
-
"re" + "boot",
|
|
157
|
-
"mk" + "fs",
|
|
158
|
-
"dd i" + "f=",
|
|
159
|
-
"cu" + "rl | ba" + "sh",
|
|
160
|
-
"cu" + "rl | sh",
|
|
161
|
-
"wg" + "et | ba" + "sh",
|
|
162
|
-
"wg" + "et | sh",
|
|
163
|
-
"ev" + "al $(",
|
|
164
|
-
"> /de" + "v/",
|
|
165
|
-
":" + "(){",
|
|
166
|
-
"ch" + "mod 777",
|
|
167
|
-
"ki" + "ll -9 -1",
|
|
168
|
-
"no" + "hup ",
|
|
169
|
-
];
|
|
170
|
-
export const sensitiveMentions = ["/etc", "/root", "/boot", "/proc", "/sys", "/dev", "/.ssh", "~/.ssh"];
|
|
171
|
-
|
|
172
|
-
export const noteText =
|
|
173
|
-
"[opencode-multiagent note] Sensitive system paths and destructive shell fragments are blocked by local runtime policy.";
|
|
174
|
-
export const experimentalText =
|
|
175
|
-
"[opencode-multiagent experimental] Experimental control-plane transforms are active for this session.";
|
|
176
|
-
|
|
177
|
-
export type DefaultFlags = typeof defaultFlags;
|
|
178
|
-
export type DefaultProfiles = typeof defaultProfiles;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const cleanupIntervalMs = 5 * 60 * 1000;
|
|
2
|
-
const staleLockTtlMs = 30 * 60 * 1000;
|
|
3
|
-
|
|
4
|
-
type LockInfo = {
|
|
5
|
-
sessionID: string;
|
|
6
|
-
lastTouchedAt: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type AcquireResult =
|
|
10
|
-
| { ok: true; filePath: string | undefined }
|
|
11
|
-
| { ok: false; filePath: string; ownerSessionID: string };
|
|
12
|
-
|
|
13
|
-
const normalizeFilePath = (filePath: unknown): string | undefined =>
|
|
14
|
-
typeof filePath === "string" ? filePath.replace(/\\/g, "/") : undefined;
|
|
15
|
-
|
|
16
|
-
export const createFileLockController = () => {
|
|
17
|
-
const locks = new Map<string, LockInfo>();
|
|
18
|
-
const sessionFiles = new Map<string, Set<string>>();
|
|
19
|
-
|
|
20
|
-
const trackSessionFile = (sessionID: string, filePath: string): void => {
|
|
21
|
-
if (!sessionFiles.has(sessionID)) sessionFiles.set(sessionID, new Set());
|
|
22
|
-
sessionFiles.get(sessionID)?.add(filePath);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const untrackSessionFile = (sessionID: string, filePath: string): void => {
|
|
26
|
-
const files = sessionFiles.get(sessionID);
|
|
27
|
-
if (!files) return;
|
|
28
|
-
files.delete(filePath);
|
|
29
|
-
if (files.size === 0) sessionFiles.delete(sessionID);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const release = (sessionID: string, filePath: unknown): boolean => {
|
|
33
|
-
const normalized = normalizeFilePath(filePath);
|
|
34
|
-
if (!normalized) return false;
|
|
35
|
-
const existing = locks.get(normalized);
|
|
36
|
-
if (!existing || existing.sessionID !== sessionID) return false;
|
|
37
|
-
locks.delete(normalized);
|
|
38
|
-
untrackSessionFile(sessionID, normalized);
|
|
39
|
-
return true;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const releaseAll = (sessionID: string): number => {
|
|
43
|
-
const files = sessionFiles.get(sessionID);
|
|
44
|
-
if (!files) return 0;
|
|
45
|
-
let count = 0;
|
|
46
|
-
for (const filePath of files) {
|
|
47
|
-
const existing = locks.get(filePath);
|
|
48
|
-
if (existing?.sessionID === sessionID) {
|
|
49
|
-
locks.delete(filePath);
|
|
50
|
-
count += 1;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
sessionFiles.delete(sessionID);
|
|
54
|
-
return count;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const cleanupStaleLocks = (now = Date.now()): void => {
|
|
58
|
-
for (const [filePath, info] of locks.entries()) {
|
|
59
|
-
if (now - info.lastTouchedAt <= staleLockTtlMs) continue;
|
|
60
|
-
locks.delete(filePath);
|
|
61
|
-
untrackSessionFile(info.sessionID, filePath);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const interval = setInterval(() => cleanupStaleLocks(), cleanupIntervalMs);
|
|
66
|
-
interval.unref?.();
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
acquire(sessionID: string, filePath: unknown): AcquireResult {
|
|
70
|
-
const normalized = normalizeFilePath(filePath);
|
|
71
|
-
if (!sessionID || !normalized) return { ok: true, filePath: normalized };
|
|
72
|
-
const existing = locks.get(normalized);
|
|
73
|
-
if (existing && existing.sessionID !== sessionID) {
|
|
74
|
-
return { ok: false, filePath: normalized, ownerSessionID: existing.sessionID };
|
|
75
|
-
}
|
|
76
|
-
locks.set(normalized, { sessionID, lastTouchedAt: Date.now() });
|
|
77
|
-
trackSessionFile(sessionID, normalized);
|
|
78
|
-
return { ok: true, filePath: normalized };
|
|
79
|
-
},
|
|
80
|
-
release,
|
|
81
|
-
releaseAll,
|
|
82
|
-
inspect(filePath: unknown): LockInfo | undefined {
|
|
83
|
-
return locks.get(normalizeFilePath(filePath) ?? "");
|
|
84
|
-
},
|
|
85
|
-
cleanup(now = Date.now()): void {
|
|
86
|
-
cleanupStaleLocks(now);
|
|
87
|
-
clearInterval(interval);
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
};
|