opencode-swarm 2.0.1 → 2.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/dist/agents/index.d.ts +2 -1
- package/dist/agents/reader.d.ts +2 -0
- package/dist/config/constants.d.ts +7 -6
- package/dist/config/index.d.ts +1 -1
- package/dist/index.js +477 -67
- package/dist/tools/gitingest.d.ts +15 -0
- package/dist/tools/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/agents/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
|
13
13
|
export declare function getAgentConfigs(config?: PluginConfig): Record<string, SDKAgentConfig>;
|
|
14
14
|
export { createArchitectAgent } from './architect';
|
|
15
15
|
export { createCoderAgent } from './coder';
|
|
16
|
+
export { createReaderAgent } from './reader';
|
|
16
17
|
export { createSecurityReviewerAgent } from './security-reviewer';
|
|
17
18
|
export { createAuditorAgent } from './auditor';
|
|
18
19
|
export { createTestEngineerAgent } from './test-engineer';
|
|
19
|
-
export {
|
|
20
|
+
export { createAllSMEAgents, createSMEAgent, listDomains } from './sme';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const SME_AGENTS: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux"];
|
|
2
2
|
export declare const QA_AGENTS: readonly ["security_reviewer", "auditor"];
|
|
3
|
-
export declare const PIPELINE_AGENTS: readonly ["coder", "test_engineer"];
|
|
3
|
+
export declare const PIPELINE_AGENTS: readonly ["reader", "coder", "test_engineer"];
|
|
4
4
|
export declare const ORCHESTRATOR_NAME: "architect";
|
|
5
|
-
export declare const ALL_SUBAGENT_NAMES: readonly ["
|
|
6
|
-
export declare const ALL_AGENT_NAMES: readonly ["architect", "
|
|
5
|
+
export declare const ALL_SUBAGENT_NAMES: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "security_reviewer", "auditor", "reader", "coder", "test_engineer"];
|
|
6
|
+
export declare const ALL_AGENT_NAMES: readonly ["architect", "sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "security_reviewer", "auditor", "reader", "coder", "test_engineer"];
|
|
7
|
+
export type SMEAgentName = (typeof SME_AGENTS)[number];
|
|
7
8
|
export type QAAgentName = (typeof QA_AGENTS)[number];
|
|
8
9
|
export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
|
|
9
10
|
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
10
|
-
export type SMEAgentName = 'sme';
|
|
11
11
|
export declare const CATEGORY_PREFIXES: {
|
|
12
12
|
readonly sme: "_sme";
|
|
13
13
|
readonly qa: "_qa";
|
|
14
14
|
};
|
|
15
15
|
export declare const DEFAULT_MODELS: Record<string, string>;
|
|
16
16
|
export declare const DOMAIN_PATTERNS: Record<string, RegExp[]>;
|
|
17
|
-
export declare function domainToAgentName(
|
|
17
|
+
export declare function domainToAgentName(domain: string): SMEAgentName;
|
|
18
|
+
export declare function isSMEAgent(name: string): name is SMEAgentName;
|
|
18
19
|
export declare function isQAAgent(name: string): name is QAAgentName;
|
|
19
20
|
export declare function isSubagent(name: string): boolean;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, CATEGORY_PREFIXES, DEFAULT_MODELS, DOMAIN_PATTERNS, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS,
|
|
1
|
+
export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, CATEGORY_PREFIXES, DEFAULT_MODELS, DOMAIN_PATTERNS, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, SME_AGENTS, domainToAgentName, isQAAgent, isSMEAgent, isSubagent, } from './constants';
|
|
2
2
|
export type { AgentName, PipelineAgentName, QAAgentName, SMEAgentName, } from './constants';
|
|
3
3
|
export { AgentOverrideConfigSchema, PluginConfigSchema, } from './schema';
|
|
4
4
|
export type { AgentOverrideConfig, PluginConfig, } from './schema';
|
package/dist/index.js
CHANGED
|
@@ -11,12 +11,24 @@ var __export = (target, all) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// src/config/constants.ts
|
|
14
|
-
var
|
|
14
|
+
var SME_AGENTS = [
|
|
15
|
+
"sme_windows",
|
|
16
|
+
"sme_powershell",
|
|
17
|
+
"sme_python",
|
|
18
|
+
"sme_oracle",
|
|
19
|
+
"sme_network",
|
|
20
|
+
"sme_security",
|
|
21
|
+
"sme_linux",
|
|
22
|
+
"sme_vmware",
|
|
23
|
+
"sme_azure",
|
|
24
|
+
"sme_active_directory",
|
|
25
|
+
"sme_ui_ux"
|
|
26
|
+
];
|
|
15
27
|
var QA_AGENTS = ["security_reviewer", "auditor"];
|
|
16
|
-
var PIPELINE_AGENTS = ["coder", "test_engineer"];
|
|
28
|
+
var PIPELINE_AGENTS = ["reader", "coder", "test_engineer"];
|
|
17
29
|
var ORCHESTRATOR_NAME = "architect";
|
|
18
30
|
var ALL_SUBAGENT_NAMES = [
|
|
19
|
-
|
|
31
|
+
...SME_AGENTS,
|
|
20
32
|
...QA_AGENTS,
|
|
21
33
|
...PIPELINE_AGENTS
|
|
22
34
|
];
|
|
@@ -29,13 +41,13 @@ var CATEGORY_PREFIXES = {
|
|
|
29
41
|
qa: "_qa"
|
|
30
42
|
};
|
|
31
43
|
var DEFAULT_MODELS = {
|
|
32
|
-
architect: "anthropic/claude-sonnet-4
|
|
33
|
-
|
|
34
|
-
coder: "anthropic/claude-sonnet-4
|
|
35
|
-
test_engineer: "google/gemini-
|
|
36
|
-
_sme: "google/gemini-
|
|
37
|
-
_qa: "google/gemini-
|
|
38
|
-
default: "google/gemini-
|
|
44
|
+
architect: "anthropic/claude-sonnet-4-5",
|
|
45
|
+
reader: "google/gemini-2.0-flash",
|
|
46
|
+
coder: "anthropic/claude-sonnet-4-5",
|
|
47
|
+
test_engineer: "google/gemini-2.0-flash",
|
|
48
|
+
_sme: "google/gemini-2.0-flash",
|
|
49
|
+
_qa: "google/gemini-2.0-flash",
|
|
50
|
+
default: "google/gemini-2.0-flash"
|
|
39
51
|
};
|
|
40
52
|
var DOMAIN_PATTERNS = {
|
|
41
53
|
windows: [
|
|
@@ -191,6 +203,9 @@ var DOMAIN_PATTERNS = {
|
|
|
191
203
|
/\bresponsive\b/i
|
|
192
204
|
]
|
|
193
205
|
};
|
|
206
|
+
function isSMEAgent(name) {
|
|
207
|
+
return SME_AGENTS.includes(name);
|
|
208
|
+
}
|
|
194
209
|
function isQAAgent(name) {
|
|
195
210
|
return QA_AGENTS.includes(name);
|
|
196
211
|
}
|
|
@@ -13829,32 +13844,42 @@ function loadAgentPrompt(agentName) {
|
|
|
13829
13844
|
// src/agents/architect.ts
|
|
13830
13845
|
var ARCHITECT_PROMPT = `You are Architect - an AI coding orchestrator that coordinates specialists to deliver quality code.
|
|
13831
13846
|
|
|
13832
|
-
**Role**: Analyze requests, consult
|
|
13847
|
+
**Role**: Analyze requests, consult domain SMEs, delegate implementation, and manage QA review.
|
|
13833
13848
|
|
|
13834
13849
|
**Agents**:
|
|
13835
13850
|
|
|
13836
|
-
@
|
|
13851
|
+
@reader - Fast data processing agent for analyzing large files, codebases, or outputs
|
|
13852
|
+
@sme_windows - Windows OS internals, registry, services, WMI/CIM
|
|
13853
|
+
@sme_powershell - PowerShell scripting, cmdlets, modules, remoting
|
|
13854
|
+
@sme_python - Python ecosystem, libraries, best practices
|
|
13855
|
+
@sme_oracle - Oracle Database, SQL/PLSQL, administration
|
|
13856
|
+
@sme_network - Networking, firewalls, DNS, TLS/SSL, load balancing
|
|
13857
|
+
@sme_security - STIG compliance, hardening, CVE, encryption, PKI
|
|
13858
|
+
@sme_linux - Linux administration, systemd, package management
|
|
13859
|
+
@sme_vmware - VMware vSphere, ESXi, PowerCLI, virtualization
|
|
13860
|
+
@sme_azure - Azure cloud services, Entra ID, ARM/Bicep
|
|
13861
|
+
@sme_active_directory - Active Directory, LDAP, Group Policy, Kerberos
|
|
13862
|
+
@sme_ui_ux - UI/UX design, interaction patterns, accessibility
|
|
13863
|
+
|
|
13837
13864
|
@coder - Implementation specialist, writes production code
|
|
13838
13865
|
@security_reviewer - Security audit, vulnerability assessment
|
|
13839
13866
|
@auditor - Code quality review, correctness verification
|
|
13840
13867
|
@test_engineer - Test case generation and validation scripts
|
|
13841
13868
|
|
|
13842
|
-
**Available SME Domains**: windows, powershell, python, oracle, network, security, linux, vmware, azure, active_directory, ui_ux
|
|
13843
|
-
|
|
13844
13869
|
**Workflow**:
|
|
13845
13870
|
|
|
13846
13871
|
## 1. Analyze (you do this)
|
|
13847
13872
|
Parse request: explicit requirements + implicit needs.
|
|
13848
|
-
Identify which domains are relevant.
|
|
13873
|
+
Identify which domains are relevant (usually 1-3, not all).
|
|
13849
13874
|
Create initial specification.
|
|
13850
13875
|
|
|
13851
|
-
## 2. SME Consultation (
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
Wait for response.
|
|
13876
|
+
## 2. SME Consultation (delegate only relevant SMEs, serially)
|
|
13877
|
+
For each relevant domain, delegate to @sme_* agent one at a time.
|
|
13878
|
+
Only consult SMEs for domains that actually apply to the task.
|
|
13879
|
+
Wait for each response before calling the next.
|
|
13855
13880
|
|
|
13856
13881
|
## 3. Collate (you do this)
|
|
13857
|
-
Synthesize SME
|
|
13882
|
+
Synthesize SME inputs into unified specification.
|
|
13858
13883
|
Ensure clarity and completeness.
|
|
13859
13884
|
|
|
13860
13885
|
## 4. Code (delegate to @coder)
|
|
@@ -13874,11 +13899,17 @@ Review QA feedback and decide:
|
|
|
13874
13899
|
## 7. Test (delegate to @test_engineer)
|
|
13875
13900
|
Send approved code to @test_engineer for test generation.
|
|
13876
13901
|
|
|
13902
|
+
**Using @reader**:
|
|
13903
|
+
- Delegate to @reader when you need to process large amounts of data
|
|
13904
|
+
- Use for: analyzing gitingest output, reviewing large files, summarizing codebases
|
|
13905
|
+
- @reader returns condensed summaries you can use for decision-making
|
|
13906
|
+
|
|
13877
13907
|
**Delegation Rules**:
|
|
13878
13908
|
- All agents run serially (one at a time)
|
|
13879
13909
|
- Wait for each agent response before calling the next
|
|
13910
|
+
- Only consult SMEs for domains relevant to the task (1-3 typically)
|
|
13880
13911
|
- Reference paths/lines, don't paste entire files
|
|
13881
|
-
- Brief delegation notices: "Consulting @
|
|
13912
|
+
- Brief delegation notices: "Consulting @sme_powershell..."
|
|
13882
13913
|
|
|
13883
13914
|
**Communication**:
|
|
13884
13915
|
- Be direct, no preamble or flattery
|
|
@@ -14017,6 +14048,67 @@ ${customAppendPrompt}`;
|
|
|
14017
14048
|
};
|
|
14018
14049
|
}
|
|
14019
14050
|
|
|
14051
|
+
// src/agents/reader.ts
|
|
14052
|
+
var READER_PROMPT = `You are Reader - a fast data processing specialist.
|
|
14053
|
+
|
|
14054
|
+
**Role**: Quickly analyze large datasets, codebases, or outputs and provide concise summaries for the Architect.
|
|
14055
|
+
|
|
14056
|
+
**Behavior**:
|
|
14057
|
+
- Read and process the provided content efficiently
|
|
14058
|
+
- Extract key information relevant to the task
|
|
14059
|
+
- Summarize findings in a structured, actionable format
|
|
14060
|
+
- Focus on what matters for implementation decisions
|
|
14061
|
+
|
|
14062
|
+
**Use cases**:
|
|
14063
|
+
- Analyzing gitingest output to understand a codebase
|
|
14064
|
+
- Reviewing large log files or data dumps
|
|
14065
|
+
- Summarizing documentation or specifications
|
|
14066
|
+
- Processing API responses or test results
|
|
14067
|
+
|
|
14068
|
+
**Output Format**:
|
|
14069
|
+
<summary>
|
|
14070
|
+
[2-3 sentence overview of what you analyzed]
|
|
14071
|
+
</summary>
|
|
14072
|
+
|
|
14073
|
+
<key_findings>
|
|
14074
|
+
- [Finding 1: specific, actionable]
|
|
14075
|
+
- [Finding 2: specific, actionable]
|
|
14076
|
+
- [Finding 3: specific, actionable]
|
|
14077
|
+
</key_findings>
|
|
14078
|
+
|
|
14079
|
+
<relevant_details>
|
|
14080
|
+
[Specific code patterns, file paths, function names, or data points the Architect needs]
|
|
14081
|
+
</relevant_details>
|
|
14082
|
+
|
|
14083
|
+
<recommendations>
|
|
14084
|
+
[Brief suggestions based on your analysis]
|
|
14085
|
+
</recommendations>
|
|
14086
|
+
|
|
14087
|
+
**Constraints**:
|
|
14088
|
+
- No code writing
|
|
14089
|
+
- No delegation
|
|
14090
|
+
- Focus on speed and accuracy
|
|
14091
|
+
- Keep total output under 2000 characters`;
|
|
14092
|
+
function createReaderAgent(model, customPrompt, customAppendPrompt) {
|
|
14093
|
+
let prompt = READER_PROMPT;
|
|
14094
|
+
if (customPrompt) {
|
|
14095
|
+
prompt = customPrompt;
|
|
14096
|
+
} else if (customAppendPrompt) {
|
|
14097
|
+
prompt = `${READER_PROMPT}
|
|
14098
|
+
|
|
14099
|
+
${customAppendPrompt}`;
|
|
14100
|
+
}
|
|
14101
|
+
return {
|
|
14102
|
+
name: "reader",
|
|
14103
|
+
description: "Fast data processing agent for analyzing large files, codebases, or outputs. Returns concise summaries.",
|
|
14104
|
+
config: {
|
|
14105
|
+
model,
|
|
14106
|
+
temperature: 0.1,
|
|
14107
|
+
prompt
|
|
14108
|
+
}
|
|
14109
|
+
};
|
|
14110
|
+
}
|
|
14111
|
+
|
|
14020
14112
|
// src/agents/security-reviewer.ts
|
|
14021
14113
|
var SECURITY_REVIEWER_PROMPT = `You are Security Reviewer - a security audit specialist.
|
|
14022
14114
|
|
|
@@ -14141,60 +14233,56 @@ ${customAppendPrompt}`;
|
|
|
14141
14233
|
};
|
|
14142
14234
|
}
|
|
14143
14235
|
|
|
14144
|
-
// src/agents/sme
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
python: `Python: pip, venv, Django, Flask, pandas, numpy, pytest, async/await, type hints`,
|
|
14149
|
-
oracle: `Oracle DB: SQL/PLSQL, tablespaces, RMAN, DataGuard, ASM, RAC, TNS, ORA errors`,
|
|
14150
|
-
network: `Networking: TCP/UDP, DNS, DHCP, firewalls, VLANs, routing, load balancing, TLS/SSL, certificates`,
|
|
14151
|
-
security: `Security: STIG compliance, hardening, CVE remediation, SCAP, FIPS, PKI, encryption, CAC`,
|
|
14152
|
-
linux: `Linux: systemd, bash, yum/apt, cron, permissions, SELinux, journalctl`,
|
|
14153
|
-
vmware: `VMware: vSphere, ESXi, vCenter, VSAN, NSX, PowerCLI, datastores, vMotion`,
|
|
14154
|
-
azure: `Azure: Entra ID, ARM/Bicep, KeyVault, Blob storage, Azure DevOps, managed identities`,
|
|
14155
|
-
active_directory: `Active Directory: LDAP, Group Policy, Kerberos, SPNs, domain trusts, ADUC, replication`,
|
|
14156
|
-
ui_ux: `UI/UX: Interaction patterns, accessibility (WCAG), responsive design, typography, color theory, layout`
|
|
14157
|
-
};
|
|
14158
|
-
var UNIFIED_SME_PROMPT = `You are SME (Subject Matter Expert) - a multi-domain technical specialist.
|
|
14236
|
+
// src/agents/sme/base.ts
|
|
14237
|
+
function createSMEPrompt(config2) {
|
|
14238
|
+
const { domain: domain2, description, guidance } = config2;
|
|
14239
|
+
return `You are ${domain2}_SME - a subject matter expert in ${description}.
|
|
14159
14240
|
|
|
14160
|
-
**Role**: Provide domain-specific technical context
|
|
14241
|
+
**Role**: Provide domain-specific technical context to enhance the Architect's specification. Your output will be read by the Architect for collation, not directly by a human or coder.
|
|
14242
|
+
|
|
14243
|
+
**Domain Expertise**:
|
|
14244
|
+
${guidance}
|
|
14161
14245
|
|
|
14162
14246
|
**Behavior**:
|
|
14163
|
-
-
|
|
14164
|
-
- Be
|
|
14165
|
-
- Be concise: focus only on implementation-relevant details
|
|
14247
|
+
- Be specific: exact names, paths, parameters, not general advice
|
|
14248
|
+
- Be concise: under 4000 characters
|
|
14166
14249
|
- Be actionable: information the Coder can directly use
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
${Object.entries(DOMAIN_EXPERTISE).map(([domain2, desc]) => `- ${domain2}: ${desc}`).join(`
|
|
14170
|
-
`)}
|
|
14250
|
+
- Focus on implementation-relevant details only
|
|
14251
|
+
- Include version-specific notes if applicable
|
|
14171
14252
|
|
|
14172
14253
|
**Output Format**:
|
|
14173
|
-
|
|
14174
|
-
|
|
14254
|
+
<${domain2}_context>
|
|
14255
|
+
**Critical Considerations**:
|
|
14256
|
+
[Must-know information that affects implementation]
|
|
14175
14257
|
|
|
14176
|
-
**
|
|
14177
|
-
|
|
14178
|
-
- Recommended approach and patterns
|
|
14179
|
-
- Specific APIs, cmdlets, or functions to use
|
|
14180
|
-
- Common gotchas to avoid
|
|
14181
|
-
- Dependencies required
|
|
14258
|
+
**Recommended Approach**:
|
|
14259
|
+
[Best practices and patterns for this domain]
|
|
14182
14260
|
|
|
14183
|
-
|
|
14261
|
+
**API/Syntax Details**:
|
|
14262
|
+
[Exact cmdlet names, function signatures, class names]
|
|
14184
14263
|
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14264
|
+
**Gotchas**:
|
|
14265
|
+
[Common mistakes to avoid]
|
|
14266
|
+
|
|
14267
|
+
**Dependencies**:
|
|
14268
|
+
[Required modules, services, permissions]
|
|
14269
|
+
|
|
14270
|
+
**Code Patterns**:
|
|
14271
|
+
[Short snippets showing correct usage if helpful]
|
|
14272
|
+
</${domain2}_context>`;
|
|
14273
|
+
}
|
|
14274
|
+
function createSMEAgent(agentName, domainConfig, model, customPrompt, customAppendPrompt) {
|
|
14275
|
+
let prompt = createSMEPrompt(domainConfig);
|
|
14188
14276
|
if (customPrompt) {
|
|
14189
14277
|
prompt = customPrompt;
|
|
14190
14278
|
} else if (customAppendPrompt) {
|
|
14191
|
-
prompt = `${
|
|
14279
|
+
prompt = `${prompt}
|
|
14192
14280
|
|
|
14193
14281
|
${customAppendPrompt}`;
|
|
14194
14282
|
}
|
|
14195
14283
|
return {
|
|
14196
|
-
name:
|
|
14197
|
-
description:
|
|
14284
|
+
name: agentName,
|
|
14285
|
+
description: `Subject matter expert for ${domainConfig.description}. Provides domain-specific technical context for the Architect.`,
|
|
14198
14286
|
config: {
|
|
14199
14287
|
model,
|
|
14200
14288
|
temperature: 0.2,
|
|
@@ -14202,14 +14290,284 @@ ${customAppendPrompt}`;
|
|
|
14202
14290
|
}
|
|
14203
14291
|
};
|
|
14204
14292
|
}
|
|
14205
|
-
|
|
14293
|
+
|
|
14294
|
+
// src/agents/sme/active-directory.ts
|
|
14295
|
+
var activeDirectorySMEConfig = {
|
|
14296
|
+
domain: "active_directory",
|
|
14297
|
+
description: "Active Directory and identity management",
|
|
14298
|
+
guidance: `For Active Directory tasks, provide:
|
|
14299
|
+
- AD PowerShell module cmdlets (Get-ADUser, Set-ADUser, etc.)
|
|
14300
|
+
- LDAP filter syntax and examples
|
|
14301
|
+
- Distinguished name (DN) formats
|
|
14302
|
+
- Group Policy structure and processing order
|
|
14303
|
+
- Kerberos authentication flow considerations
|
|
14304
|
+
- SPN (Service Principal Name) configuration
|
|
14305
|
+
- AD schema and common attributes
|
|
14306
|
+
- Replication and site topology concepts
|
|
14307
|
+
- Organizational Unit (OU) design patterns
|
|
14308
|
+
- Security group types (Domain Local, Global, Universal)
|
|
14309
|
+
- Delegation of control patterns
|
|
14310
|
+
- Fine-grained password policies
|
|
14311
|
+
- AD object GUIDs and SIDs
|
|
14312
|
+
- Trust relationships
|
|
14313
|
+
- ADSI/DirectoryServices .NET classes
|
|
14314
|
+
- Common AD error codes and resolutions
|
|
14315
|
+
- Group Policy preferences vs policies`
|
|
14316
|
+
};
|
|
14317
|
+
|
|
14318
|
+
// src/agents/sme/azure.ts
|
|
14319
|
+
var azureSMEConfig = {
|
|
14320
|
+
domain: "azure",
|
|
14321
|
+
description: "Microsoft Azure cloud services",
|
|
14322
|
+
guidance: `For Azure tasks, provide:
|
|
14323
|
+
- Az PowerShell module cmdlets (Az.Accounts, Az.Compute, etc.)
|
|
14324
|
+
- Azure CLI (az) command syntax
|
|
14325
|
+
- ARM template structure and syntax
|
|
14326
|
+
- Bicep syntax and patterns
|
|
14327
|
+
- Entra ID (formerly Azure AD) configuration
|
|
14328
|
+
- RBAC role assignments and custom roles
|
|
14329
|
+
- Resource naming conventions and constraints
|
|
14330
|
+
- Service principal and managed identity configuration
|
|
14331
|
+
- Azure resource provider namespaces
|
|
14332
|
+
- Common Azure resource types and properties
|
|
14333
|
+
- Subscription and resource group scoping
|
|
14334
|
+
- Azure networking (VNet, NSG, Load Balancer)
|
|
14335
|
+
- Storage account types and access tiers
|
|
14336
|
+
- Azure Key Vault integration patterns
|
|
14337
|
+
- Cost management considerations
|
|
14338
|
+
- Azure Government differences if applicable`
|
|
14339
|
+
};
|
|
14340
|
+
|
|
14341
|
+
// src/agents/sme/linux.ts
|
|
14342
|
+
var linuxSMEConfig = {
|
|
14343
|
+
domain: "linux",
|
|
14344
|
+
description: "Linux system administration",
|
|
14345
|
+
guidance: `For Linux tasks, provide:
|
|
14346
|
+
- Distribution-specific commands (RHEL/CentOS vs Ubuntu/Debian)
|
|
14347
|
+
- Systemd unit file structure (service, timer, socket units)
|
|
14348
|
+
- File permissions and ownership (chmod, chown, ACLs)
|
|
14349
|
+
- SELinux/AppArmor considerations (contexts, policies, booleans)
|
|
14350
|
+
- Package management commands (yum/dnf vs apt)
|
|
14351
|
+
- Cron syntax and systemd timer alternatives
|
|
14352
|
+
- Log file locations (/var/log, journalctl)
|
|
14353
|
+
- Service management patterns (systemctl, enable, start)
|
|
14354
|
+
- User and group management
|
|
14355
|
+
- Filesystem hierarchy standard (FHS) paths
|
|
14356
|
+
- Shell scripting best practices (bash, POSIX compliance)
|
|
14357
|
+
- Process management (ps, top, kill signals)
|
|
14358
|
+
- Network configuration (nmcli, ip, netplan)
|
|
14359
|
+
- Environment variables and profile scripts`
|
|
14360
|
+
};
|
|
14361
|
+
|
|
14362
|
+
// src/agents/sme/network.ts
|
|
14363
|
+
var networkSMEConfig = {
|
|
14364
|
+
domain: "network",
|
|
14365
|
+
description: "network architecture, protocols, and security",
|
|
14366
|
+
guidance: `For network tasks, provide:
|
|
14367
|
+
- Protocol specifications and standard port numbers
|
|
14368
|
+
- Firewall rule syntax (Windows Firewall, iptables, firewalld)
|
|
14369
|
+
- DNS record types and configuration (A, AAAA, CNAME, MX, TXT, SRV)
|
|
14370
|
+
- Certificate requirements and chain validation
|
|
14371
|
+
- TLS/SSL configuration best practices (cipher suites, protocols)
|
|
14372
|
+
- Load balancer and proxy considerations
|
|
14373
|
+
- Network troubleshooting commands (ping, tracert, nslookup, netstat)
|
|
14374
|
+
- Security group and ACL patterns
|
|
14375
|
+
- IP addressing and subnetting
|
|
14376
|
+
- VLAN configuration concepts
|
|
14377
|
+
- NAT and port forwarding
|
|
14378
|
+
- HTTP/HTTPS specifics (headers, status codes, methods)
|
|
14379
|
+
- Socket programming considerations
|
|
14380
|
+
- Common network errors and their causes`
|
|
14381
|
+
};
|
|
14382
|
+
|
|
14383
|
+
// src/agents/sme/oracle.ts
|
|
14384
|
+
var oracleSMEConfig = {
|
|
14385
|
+
domain: "oracle",
|
|
14386
|
+
description: "Oracle Database administration and SQL/PLSQL",
|
|
14387
|
+
guidance: `For Oracle tasks, provide:
|
|
14388
|
+
- Correct SQL syntax for Oracle (not MySQL/SQL Server)
|
|
14389
|
+
- PL/SQL block structure and exception handling
|
|
14390
|
+
- CDB/PDB architecture considerations
|
|
14391
|
+
- Parameter names and valid values (init.ora, spfile)
|
|
14392
|
+
- Required privileges and roles (DBA, SYSDBA, specific grants)
|
|
14393
|
+
- Data dictionary views (DBA_*, ALL_*, USER_*, V$*, GV$*)
|
|
14394
|
+
- RMAN commands and syntax
|
|
14395
|
+
- TNS configuration and connectivity (tnsnames.ora, listener.ora)
|
|
14396
|
+
- Oracle-specific functions (NVL, DECODE, LISTAGG, etc.)
|
|
14397
|
+
- Bind variable usage for performance
|
|
14398
|
+
- Transaction handling (COMMIT, ROLLBACK, savepoints)
|
|
14399
|
+
- LOB handling (CLOB, BLOB operations)
|
|
14400
|
+
- Date/timestamp handling (TO_DATE, TO_TIMESTAMP, NLS settings)
|
|
14401
|
+
- Execution plan analysis (EXPLAIN PLAN, hints)`
|
|
14402
|
+
};
|
|
14403
|
+
|
|
14404
|
+
// src/agents/sme/powershell.ts
|
|
14405
|
+
var powershellSMEConfig = {
|
|
14406
|
+
domain: "powershell",
|
|
14407
|
+
description: "PowerShell scripting and automation",
|
|
14408
|
+
guidance: `For PowerShell tasks, provide:
|
|
14409
|
+
- Correct cmdlet names, parameters, and syntax
|
|
14410
|
+
- Required modules and how to import them (Import-Module, #Requires)
|
|
14411
|
+
- Pipeline patterns and object handling
|
|
14412
|
+
- Error handling with try/catch and $ErrorActionPreference
|
|
14413
|
+
- Output formatting and object types ([PSCustomObject], etc.)
|
|
14414
|
+
- Remote execution (PSSession, Invoke-Command, -ComputerName)
|
|
14415
|
+
- Module compatibility (Windows PowerShell 5.1 vs PowerShell 7+)
|
|
14416
|
+
- Common parameter patterns (-Verbose, -WhatIf, -Confirm, -ErrorAction)
|
|
14417
|
+
- Splatting for complex parameter sets
|
|
14418
|
+
- Advanced function patterns ([CmdletBinding()], param blocks)
|
|
14419
|
+
- Pester testing patterns for the code
|
|
14420
|
+
- Credential handling (Get-Credential, [PSCredential])
|
|
14421
|
+
- Output streams (Write-Output, Write-Verbose, Write-Error)`
|
|
14422
|
+
};
|
|
14423
|
+
|
|
14424
|
+
// src/agents/sme/python.ts
|
|
14425
|
+
var pythonSMEConfig = {
|
|
14426
|
+
domain: "python",
|
|
14427
|
+
description: "Python development and ecosystem",
|
|
14428
|
+
guidance: `For Python tasks, provide:
|
|
14429
|
+
- Recommended libraries for the task (stdlib vs third-party)
|
|
14430
|
+
- Windows-specific modules (pywin32, wmi, winreg, ctypes)
|
|
14431
|
+
- Correct API usage patterns and idioms
|
|
14432
|
+
- Virtual environment considerations (venv, pip install)
|
|
14433
|
+
- Type hints and dataclass usage
|
|
14434
|
+
- Exception handling patterns (specific exceptions, context managers)
|
|
14435
|
+
- File handling (pathlib vs os.path, encoding considerations)
|
|
14436
|
+
- Cross-platform compatibility notes
|
|
14437
|
+
- Async patterns if applicable (asyncio, aiohttp)
|
|
14438
|
+
- Logging configuration (logging module setup)
|
|
14439
|
+
- Package structure for larger scripts
|
|
14440
|
+
- Python version compatibility (3.8+ features)
|
|
14441
|
+
- Common gotchas (mutable default arguments, import cycles)`
|
|
14442
|
+
};
|
|
14443
|
+
|
|
14444
|
+
// src/agents/sme/security.ts
|
|
14445
|
+
var securitySMEConfig = {
|
|
14446
|
+
domain: "security",
|
|
14447
|
+
description: "cybersecurity, compliance, and hardening",
|
|
14448
|
+
guidance: `For security tasks, provide:
|
|
14449
|
+
- STIG requirements and check IDs (V-#####, SV-#####)
|
|
14450
|
+
- DISA compliance requirements
|
|
14451
|
+
- FIPS 140-2/3 considerations (approved algorithms, modes)
|
|
14452
|
+
- CAC/PIV/PKI implementation details
|
|
14453
|
+
- Encryption standards and key management
|
|
14454
|
+
- Audit logging requirements (what to log, retention)
|
|
14455
|
+
- Least privilege patterns
|
|
14456
|
+
- Secure configuration baselines
|
|
14457
|
+
- CIS Benchmark references if applicable
|
|
14458
|
+
- Common vulnerability patterns to avoid
|
|
14459
|
+
- Authentication and authorization best practices
|
|
14460
|
+
- Secrets management (no hardcoding, secure storage)
|
|
14461
|
+
- Input validation and sanitization
|
|
14462
|
+
- Secure communication requirements (TLS versions, cipher suites)
|
|
14463
|
+
- DoD/Federal specific requirements if applicable`
|
|
14464
|
+
};
|
|
14465
|
+
|
|
14466
|
+
// src/agents/sme/ui-ux.ts
|
|
14467
|
+
var uiUxSMEConfig = {
|
|
14468
|
+
domain: "ui_ux",
|
|
14469
|
+
description: "UI/UX design, interaction patterns, and visual systems",
|
|
14470
|
+
guidance: `For UI/UX tasks, provide:
|
|
14471
|
+
- Information architecture and navigation flow
|
|
14472
|
+
- Interaction patterns and states (loading, empty, error, success)
|
|
14473
|
+
- Responsive layout guidance and breakpoints
|
|
14474
|
+
- Typography scale and hierarchy recommendations
|
|
14475
|
+
- Spacing system (8px grid, consistent margins/padding)
|
|
14476
|
+
- Color usage (primary, secondary, semantic colors)
|
|
14477
|
+
- Contrast and accessibility requirements (WCAG 2.1 AA)
|
|
14478
|
+
- Component structure and reusability patterns
|
|
14479
|
+
- Form design best practices (labels, validation, feedback)
|
|
14480
|
+
- Motion/animation guidance (purposeful, not excessive)
|
|
14481
|
+
- Touch target sizes for mobile (44px minimum)
|
|
14482
|
+
- Focus management for keyboard navigation
|
|
14483
|
+
- Icon usage and consistency
|
|
14484
|
+
- Empty states and error message design
|
|
14485
|
+
- Progressive disclosure patterns
|
|
14486
|
+
- Loading and skeleton states`
|
|
14487
|
+
};
|
|
14488
|
+
|
|
14489
|
+
// src/agents/sme/vmware.ts
|
|
14490
|
+
var vmwareSMEConfig = {
|
|
14491
|
+
domain: "vmware",
|
|
14492
|
+
description: "VMware vSphere and virtualization",
|
|
14493
|
+
guidance: `For VMware tasks, provide:
|
|
14494
|
+
- PowerCLI cmdlet names and syntax (Get-VM, Set-VM, etc.)
|
|
14495
|
+
- vSphere API objects and methods
|
|
14496
|
+
- ESXi shell commands (esxcli, vim-cmd)
|
|
14497
|
+
- Datastore path formats ([datastore1] path/to/file.vmdk)
|
|
14498
|
+
- VM hardware version compatibility
|
|
14499
|
+
- vMotion and DRS requirements and constraints
|
|
14500
|
+
- Storage policy configuration (SPBM)
|
|
14501
|
+
- Network adapter types and configurations (vmxnet3, e1000e)
|
|
14502
|
+
- Snapshot management considerations
|
|
14503
|
+
- Template and clone operations
|
|
14504
|
+
- Resource pool and cluster concepts
|
|
14505
|
+
- vCenter Server connection handling
|
|
14506
|
+
- Certificate and authentication requirements
|
|
14507
|
+
- Common vSphere error codes and solutions
|
|
14508
|
+
- Performance metrics and monitoring (Get-Stat)`
|
|
14509
|
+
};
|
|
14510
|
+
|
|
14511
|
+
// src/agents/sme/windows.ts
|
|
14512
|
+
var windowsSMEConfig = {
|
|
14513
|
+
domain: "windows",
|
|
14514
|
+
description: "Windows operating system internals and administration",
|
|
14515
|
+
guidance: `For Windows tasks, provide:
|
|
14516
|
+
- Registry paths and correct hive locations (HKLM, HKCU, HKU)
|
|
14517
|
+
- WMI/CIM class names and properties (Win32_*, CIM_*)
|
|
14518
|
+
- Service names (exact), dependencies, and startup types
|
|
14519
|
+
- File system locations (System32, SysWOW64, ProgramData, AppData)
|
|
14520
|
+
- Permission requirements (admin, SYSTEM, TrustedInstaller)
|
|
14521
|
+
- COM objects and interfaces when relevant
|
|
14522
|
+
- Event log sources, channels, and event IDs
|
|
14523
|
+
- Scheduled task configuration (triggers, actions, principals)
|
|
14524
|
+
- Windows API calls if needed (P/Invoke signatures)
|
|
14525
|
+
- UAC considerations and elevation requirements
|
|
14526
|
+
- 32-bit vs 64-bit considerations (WoW64 redirection)`
|
|
14527
|
+
};
|
|
14528
|
+
|
|
14529
|
+
// src/agents/sme/index.ts
|
|
14530
|
+
var SME_CONFIGS = {
|
|
14531
|
+
windows: windowsSMEConfig,
|
|
14532
|
+
powershell: powershellSMEConfig,
|
|
14533
|
+
python: pythonSMEConfig,
|
|
14534
|
+
oracle: oracleSMEConfig,
|
|
14535
|
+
network: networkSMEConfig,
|
|
14536
|
+
security: securitySMEConfig,
|
|
14537
|
+
linux: linuxSMEConfig,
|
|
14538
|
+
vmware: vmwareSMEConfig,
|
|
14539
|
+
azure: azureSMEConfig,
|
|
14540
|
+
active_directory: activeDirectorySMEConfig,
|
|
14541
|
+
ui_ux: uiUxSMEConfig
|
|
14542
|
+
};
|
|
14543
|
+
var AGENT_TO_DOMAIN = {
|
|
14544
|
+
sme_windows: "windows",
|
|
14545
|
+
sme_powershell: "powershell",
|
|
14546
|
+
sme_python: "python",
|
|
14547
|
+
sme_oracle: "oracle",
|
|
14548
|
+
sme_network: "network",
|
|
14549
|
+
sme_security: "security",
|
|
14550
|
+
sme_linux: "linux",
|
|
14551
|
+
sme_vmware: "vmware",
|
|
14552
|
+
sme_azure: "azure",
|
|
14553
|
+
sme_active_directory: "active_directory",
|
|
14554
|
+
sme_ui_ux: "ui_ux"
|
|
14555
|
+
};
|
|
14556
|
+
function createAllSMEAgents(getModel, loadPrompt) {
|
|
14557
|
+
return Object.entries(AGENT_TO_DOMAIN).map(([agentName, domain2]) => {
|
|
14558
|
+
const config2 = SME_CONFIGS[domain2];
|
|
14559
|
+
const model = getModel(agentName);
|
|
14560
|
+
const prompts = loadPrompt(agentName);
|
|
14561
|
+
return createSMEAgent(agentName, config2, model, prompts.prompt, prompts.appendPrompt);
|
|
14562
|
+
});
|
|
14563
|
+
}
|
|
14206
14564
|
|
|
14207
14565
|
// src/agents/index.ts
|
|
14208
14566
|
function getModelForAgent(agentName, config2) {
|
|
14209
14567
|
const explicit = config2?.agents?.[agentName]?.model;
|
|
14210
14568
|
if (explicit)
|
|
14211
14569
|
return explicit;
|
|
14212
|
-
if (agentName
|
|
14570
|
+
if (isSMEAgent(agentName)) {
|
|
14213
14571
|
const categoryModel = config2?.agents?.[CATEGORY_PREFIXES.sme]?.model;
|
|
14214
14572
|
if (categoryModel)
|
|
14215
14573
|
return categoryModel;
|
|
@@ -14245,10 +14603,16 @@ function createAgents(config2) {
|
|
|
14245
14603
|
const architect = createArchitectAgent(getModel("architect"), architectPrompts.prompt, architectPrompts.appendPrompt);
|
|
14246
14604
|
agents.push(applyOverrides(architect, config2));
|
|
14247
14605
|
}
|
|
14248
|
-
if (!isAgentDisabled("
|
|
14249
|
-
const
|
|
14250
|
-
const
|
|
14251
|
-
agents.push(applyOverrides(
|
|
14606
|
+
if (!isAgentDisabled("reader", config2)) {
|
|
14607
|
+
const readerPrompts = getPrompts("reader");
|
|
14608
|
+
const reader = createReaderAgent(getModel("reader"), readerPrompts.prompt, readerPrompts.appendPrompt);
|
|
14609
|
+
agents.push(applyOverrides(reader, config2));
|
|
14610
|
+
}
|
|
14611
|
+
const smeAgents = createAllSMEAgents(getModel, getPrompts);
|
|
14612
|
+
for (const sme of smeAgents) {
|
|
14613
|
+
if (!isAgentDisabled(sme.name, config2)) {
|
|
14614
|
+
agents.push(applyOverrides(sme, config2));
|
|
14615
|
+
}
|
|
14252
14616
|
}
|
|
14253
14617
|
if (!isAgentDisabled("coder", config2)) {
|
|
14254
14618
|
const coderPrompts = getPrompts("coder");
|
|
@@ -26802,6 +27166,40 @@ Errors:
|
|
|
26802
27166
|
return result;
|
|
26803
27167
|
}
|
|
26804
27168
|
});
|
|
27169
|
+
// src/tools/gitingest.ts
|
|
27170
|
+
async function fetchGitingest(args) {
|
|
27171
|
+
const response = await fetch("https://gitingest.com/api/ingest", {
|
|
27172
|
+
method: "POST",
|
|
27173
|
+
headers: { "Content-Type": "application/json" },
|
|
27174
|
+
body: JSON.stringify({
|
|
27175
|
+
input_text: args.url,
|
|
27176
|
+
max_file_size: args.maxFileSize ?? 50000,
|
|
27177
|
+
pattern: args.pattern ?? "",
|
|
27178
|
+
pattern_type: args.patternType ?? "exclude"
|
|
27179
|
+
})
|
|
27180
|
+
});
|
|
27181
|
+
if (!response.ok) {
|
|
27182
|
+
throw new Error(`gitingest API error: ${response.status} ${response.statusText}`);
|
|
27183
|
+
}
|
|
27184
|
+
const data = await response.json();
|
|
27185
|
+
return `${data.summary}
|
|
27186
|
+
|
|
27187
|
+
${data.tree}
|
|
27188
|
+
|
|
27189
|
+
${data.content}`;
|
|
27190
|
+
}
|
|
27191
|
+
var gitingest = tool({
|
|
27192
|
+
description: "Fetch a GitHub repository's full content via gitingest.com. Returns summary, directory tree, and file contents optimized for LLM analysis. Use when you need to understand an external repository's structure or code.",
|
|
27193
|
+
args: {
|
|
27194
|
+
url: tool.schema.string().describe("GitHub repository URL (e.g., https://github.com/owner/repo)"),
|
|
27195
|
+
maxFileSize: tool.schema.number().optional().describe("Maximum file size in bytes to include (default: 50000)"),
|
|
27196
|
+
pattern: tool.schema.string().optional().describe("Glob pattern to filter files (e.g., '*.ts' or 'src/**/*.py')"),
|
|
27197
|
+
patternType: tool.schema.enum(["include", "exclude"]).optional().describe("Whether pattern includes or excludes matching files (default: exclude)")
|
|
27198
|
+
},
|
|
27199
|
+
async execute(args, _context) {
|
|
27200
|
+
return fetchGitingest(args);
|
|
27201
|
+
}
|
|
27202
|
+
});
|
|
26805
27203
|
// src/utils/logger.ts
|
|
26806
27204
|
var DEBUG = process.env.OPENCODE_SWARM_DEBUG === "1";
|
|
26807
27205
|
function log(message, data) {
|
|
@@ -26822,14 +27220,26 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
26822
27220
|
log("Plugin initialized", {
|
|
26823
27221
|
directory: ctx.directory,
|
|
26824
27222
|
maxIterations: config3.max_iterations,
|
|
26825
|
-
agentCount: Object.keys(agents).length
|
|
27223
|
+
agentCount: Object.keys(agents).length,
|
|
27224
|
+
agentNames: Object.keys(agents)
|
|
26826
27225
|
});
|
|
26827
27226
|
return {
|
|
26828
27227
|
name: "opencode-swarm",
|
|
26829
27228
|
agent: agents,
|
|
26830
27229
|
tool: {
|
|
26831
27230
|
detect_domains,
|
|
26832
|
-
extract_code_blocks
|
|
27231
|
+
extract_code_blocks,
|
|
27232
|
+
gitingest
|
|
27233
|
+
},
|
|
27234
|
+
config: async (opencodeConfig) => {
|
|
27235
|
+
if (!opencodeConfig.agent) {
|
|
27236
|
+
opencodeConfig.agent = { ...agents };
|
|
27237
|
+
} else {
|
|
27238
|
+
Object.assign(opencodeConfig.agent, agents);
|
|
27239
|
+
}
|
|
27240
|
+
log("Config applied", {
|
|
27241
|
+
agents: Object.keys(agents)
|
|
27242
|
+
});
|
|
26833
27243
|
},
|
|
26834
27244
|
"experimental.chat.messages.transform": pipelineHook["experimental.chat.messages.transform"]
|
|
26835
27245
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
2
|
+
export interface GitingestArgs {
|
|
3
|
+
url: string;
|
|
4
|
+
maxFileSize?: number;
|
|
5
|
+
pattern?: string;
|
|
6
|
+
patternType?: 'include' | 'exclude';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fetch repository content via gitingest.com API
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchGitingest(args: GitingestArgs): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Gitingest tool for fetching GitHub repository contents
|
|
14
|
+
*/
|
|
15
|
+
export declare const gitingest: ReturnType<typeof tool>;
|
package/dist/tools/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"opencode-swarm": "dist/cli/index.js"
|
|
8
|
+
"opencode-swarm": "./dist/cli/index.js"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"license": "MIT",
|