opencode-swarm 5.1.6 → 5.1.7
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/config/schema.d.ts +5 -0
- package/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/config/schema.d.ts
CHANGED
|
@@ -170,7 +170,12 @@ export type GuardrailsConfig = z.infer<typeof GuardrailsConfigSchema>;
|
|
|
170
170
|
* Works with any swarm name by checking if the name (or suffix after removing
|
|
171
171
|
* a prefix) matches a known agent name from ALL_AGENT_NAMES.
|
|
172
172
|
*
|
|
173
|
+
* Normalization handles:
|
|
174
|
+
* - Case-insensitive matching (e.g., "PAID_ARCHITECT" → "architect")
|
|
175
|
+
* - Multiple separators: underscore, hyphen, space (e.g., "paid-architect", "paid architect")
|
|
176
|
+
*
|
|
173
177
|
* Examples: 'local_architect' → 'architect', 'enterprise_coder' → 'coder',
|
|
178
|
+
* 'paid-architect' → 'architect', 'PAID_ARCHITECT' → 'architect',
|
|
174
179
|
* 'architect' → 'architect', 'unknown_thing' → 'unknown_thing'
|
|
175
180
|
*
|
|
176
181
|
* @param name - The agent name (possibly prefixed)
|
package/dist/index.js
CHANGED
|
@@ -13687,14 +13687,20 @@ var GuardrailsConfigSchema = exports_external.object({
|
|
|
13687
13687
|
idle_timeout_minutes: exports_external.number().min(5).max(240).default(60),
|
|
13688
13688
|
profiles: exports_external.record(exports_external.string(), GuardrailsProfileSchema).optional()
|
|
13689
13689
|
});
|
|
13690
|
+
function normalizeAgentName(name) {
|
|
13691
|
+
return name.toLowerCase().replace(/[-\s]+/g, "_");
|
|
13692
|
+
}
|
|
13690
13693
|
function stripKnownSwarmPrefix(name) {
|
|
13691
13694
|
if (!name)
|
|
13692
13695
|
return name;
|
|
13693
13696
|
if (ALL_AGENT_NAMES.includes(name))
|
|
13694
13697
|
return name;
|
|
13698
|
+
const normalized = normalizeAgentName(name);
|
|
13695
13699
|
for (const agentName of ALL_AGENT_NAMES) {
|
|
13696
|
-
const
|
|
13697
|
-
if (
|
|
13700
|
+
const normalizedAgent = normalizeAgentName(agentName);
|
|
13701
|
+
if (normalized === normalizedAgent)
|
|
13702
|
+
return agentName;
|
|
13703
|
+
if (normalized.endsWith("_" + normalizedAgent)) {
|
|
13698
13704
|
return agentName;
|
|
13699
13705
|
}
|
|
13700
13706
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.7",
|
|
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",
|