opencode-swarm 7.52.0 → 7.52.2
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/cli/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "opencode-swarm",
|
|
55
|
-
version: "7.52.
|
|
55
|
+
version: "7.52.2",
|
|
56
56
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
57
57
|
main: "dist/index.js",
|
|
58
58
|
types: "dist/index.d.ts",
|
|
@@ -17275,7 +17275,7 @@ function getCanonicalAgentRole(agentName, generatedAgentNames) {
|
|
|
17275
17275
|
function stripKnownSwarmPrefix(agentName) {
|
|
17276
17276
|
return getCanonicalAgentRole(agentName);
|
|
17277
17277
|
}
|
|
17278
|
-
var SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillImproverConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, ParallelizationConfigSchema, LeanTurboConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, PluginConfigSchema;
|
|
17278
|
+
var SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, ParallelizationConfigSchema, LeanTurboConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, PluginConfigSchema;
|
|
17279
17279
|
var init_schema = __esm(() => {
|
|
17280
17280
|
init_zod();
|
|
17281
17281
|
init_constants();
|
|
@@ -17832,6 +17832,10 @@ var init_schema = __esm(() => {
|
|
|
17832
17832
|
"Task"
|
|
17833
17833
|
])
|
|
17834
17834
|
});
|
|
17835
|
+
SkillPropagationConfigSchema = exports_external.object({
|
|
17836
|
+
enabled: exports_external.boolean().default(true),
|
|
17837
|
+
enforce: exports_external.boolean().default(false)
|
|
17838
|
+
});
|
|
17835
17839
|
SkillImproverConfigSchema = exports_external.object({
|
|
17836
17840
|
enabled: exports_external.boolean().default(false),
|
|
17837
17841
|
model: exports_external.string().nullable().default(null),
|
|
@@ -18023,6 +18027,7 @@ var init_schema = __esm(() => {
|
|
|
18023
18027
|
curator: CuratorConfigSchema.optional(),
|
|
18024
18028
|
architectural_supervision: ArchitecturalSupervisionConfigSchema.optional(),
|
|
18025
18029
|
knowledge_application: KnowledgeApplicationConfigSchema.optional(),
|
|
18030
|
+
skillPropagation: SkillPropagationConfigSchema.optional(),
|
|
18026
18031
|
skill_improver: SkillImproverConfigSchema.optional(),
|
|
18027
18032
|
spec_writer: SpecWriterConfigSchema.optional(),
|
|
18028
18033
|
tool_output: exports_external.object({
|
|
@@ -37092,6 +37097,57 @@ function readSkillUsageEntries(directory, options) {
|
|
|
37092
37097
|
return true;
|
|
37093
37098
|
});
|
|
37094
37099
|
}
|
|
37100
|
+
function pruneSkillUsageLog(directory, maxEntriesPerSkill = 500) {
|
|
37101
|
+
const resolved = resolveLogPath(directory);
|
|
37102
|
+
if (!_internals10.existsSync(resolved)) {
|
|
37103
|
+
return { pruned: 0, remaining: 0 };
|
|
37104
|
+
}
|
|
37105
|
+
const allEntries = readSkillUsageEntries(directory);
|
|
37106
|
+
if (allEntries.length === 0) {
|
|
37107
|
+
return { pruned: 0, remaining: 0 };
|
|
37108
|
+
}
|
|
37109
|
+
const groups = new Map;
|
|
37110
|
+
for (const entry of allEntries) {
|
|
37111
|
+
const list = groups.get(entry.skillPath);
|
|
37112
|
+
if (list)
|
|
37113
|
+
list.push(entry);
|
|
37114
|
+
else
|
|
37115
|
+
groups.set(entry.skillPath, [entry]);
|
|
37116
|
+
}
|
|
37117
|
+
let pruned = 0;
|
|
37118
|
+
const surviving = [];
|
|
37119
|
+
groups.forEach((entries) => {
|
|
37120
|
+
if (entries.length <= maxEntriesPerSkill) {
|
|
37121
|
+
surviving.push(...entries);
|
|
37122
|
+
return;
|
|
37123
|
+
}
|
|
37124
|
+
entries.sort((a, b) => b.timestamp > a.timestamp ? 1 : b.timestamp < a.timestamp ? -1 : 0);
|
|
37125
|
+
const kept = entries.slice(0, maxEntriesPerSkill);
|
|
37126
|
+
pruned += entries.length - kept.length;
|
|
37127
|
+
surviving.push(...kept);
|
|
37128
|
+
});
|
|
37129
|
+
if (pruned === 0) {
|
|
37130
|
+
return { pruned: 0, remaining: allEntries.length };
|
|
37131
|
+
}
|
|
37132
|
+
const dir = path14.dirname(resolved);
|
|
37133
|
+
const tmpPath = path14.join(dir, `skill-usage-${Date.now()}.tmp`);
|
|
37134
|
+
const content = surviving.map((e) => JSON.stringify(e)).join(`
|
|
37135
|
+
`).concat(`
|
|
37136
|
+
`);
|
|
37137
|
+
try {
|
|
37138
|
+
_internals10.writeFileSync(tmpPath, content, "utf-8");
|
|
37139
|
+
_internals10.renameSync(tmpPath, resolved);
|
|
37140
|
+
} catch (writeErr) {
|
|
37141
|
+
const msg = writeErr instanceof Error ? writeErr.message : String(writeErr);
|
|
37142
|
+
try {
|
|
37143
|
+
if (_internals10.existsSync(tmpPath)) {
|
|
37144
|
+
_internals10.writeFileSync(tmpPath, "", "utf-8");
|
|
37145
|
+
}
|
|
37146
|
+
} catch {}
|
|
37147
|
+
return { pruned: 0, remaining: allEntries.length, error: msg };
|
|
37148
|
+
}
|
|
37149
|
+
return { pruned, remaining: surviving.length };
|
|
37150
|
+
}
|
|
37095
37151
|
async function resolveSourceKnowledgeIds(directory, skillPath) {
|
|
37096
37152
|
try {
|
|
37097
37153
|
let cleanPath = skillPath;
|
|
@@ -37203,7 +37259,7 @@ async function applySkillUsageFeedback(directory, options) {
|
|
|
37203
37259
|
}
|
|
37204
37260
|
return { processed, bumps };
|
|
37205
37261
|
}
|
|
37206
|
-
var _internals10, TAIL_BYTES_DEFAULT, COMPLIANCE_BOOST = 0.05, VIOLATION_DECAY = 0.1;
|
|
37262
|
+
var _internals10, TAIL_BYTES_DEFAULT, SKILL_USAGE_LOG_ROTATE_BYTES, COMPLIANCE_BOOST = 0.05, VIOLATION_DECAY = 0.1;
|
|
37207
37263
|
var init_skill_usage_log = __esm(() => {
|
|
37208
37264
|
init_knowledge_store();
|
|
37209
37265
|
init_utils2();
|
|
@@ -37219,11 +37275,13 @@ var init_skill_usage_log = __esm(() => {
|
|
|
37219
37275
|
openSync: fs7.openSync.bind(fs7),
|
|
37220
37276
|
readSync: fs7.readSync.bind(fs7),
|
|
37221
37277
|
closeSync: fs7.closeSync.bind(fs7),
|
|
37278
|
+
pruneSkillUsageLog,
|
|
37222
37279
|
resolveSourceKnowledgeIds,
|
|
37223
37280
|
applySkillUsageFeedback,
|
|
37224
37281
|
parseGeneratedFromKnowledge
|
|
37225
37282
|
};
|
|
37226
37283
|
TAIL_BYTES_DEFAULT = 64 * 1024;
|
|
37284
|
+
SKILL_USAGE_LOG_ROTATE_BYTES = 1024 * 1024;
|
|
37227
37285
|
});
|
|
37228
37286
|
|
|
37229
37287
|
// src/hooks/curator.ts
|
package/dist/config/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const _internals: {
|
|
|
18
18
|
};
|
|
19
19
|
export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
|
|
20
20
|
export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
|
|
21
|
-
export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, LeanTurboConfig, MemoryConfig, PhaseCompleteConfig, PipelineConfig, PluginConfig, SwarmConfig, TurboConfig, } from './schema';
|
|
22
|
-
export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, LeanTurboConfigSchema, MemoryConfigSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, SwarmConfigSchema, TurboConfigSchema, } from './schema';
|
|
21
|
+
export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, LeanTurboConfig, MemoryConfig, PhaseCompleteConfig, PipelineConfig, PluginConfig, SkillPropagationConfig, SwarmConfig, TurboConfig, } from './schema';
|
|
22
|
+
export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, LeanTurboConfigSchema, MemoryConfigSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, SkillPropagationConfigSchema, SwarmConfigSchema, TurboConfigSchema, } from './schema';
|
|
23
23
|
export type { DeltaSpec, Obligation, SpecDelta, SpecRequirement, SpecScenario, SpecSection, SwarmSpec, } from './spec-schema';
|
|
24
24
|
export { DeltaSpecSchema, ObligationSchema, SpecDeltaSchema, SpecRequirementSchema, SpecScenarioSchema, SpecSectionSchema, SwarmSpecSchema, validateSpecContent, } from './spec-schema';
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -611,6 +611,11 @@ export declare const KnowledgeApplicationConfigSchema: z.ZodObject<{
|
|
|
611
611
|
high_risk_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
612
612
|
}, z.core.$strip>;
|
|
613
613
|
export type KnowledgeApplicationConfig = z.infer<typeof KnowledgeApplicationConfigSchema>;
|
|
614
|
+
export declare const SkillPropagationConfigSchema: z.ZodObject<{
|
|
615
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
616
|
+
enforce: z.ZodDefault<z.ZodBoolean>;
|
|
617
|
+
}, z.core.$strip>;
|
|
618
|
+
export type SkillPropagationConfig = z.infer<typeof SkillPropagationConfigSchema>;
|
|
614
619
|
export declare const SkillImproverConfigSchema: z.ZodObject<{
|
|
615
620
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
616
621
|
model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -1309,6 +1314,10 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
1309
1314
|
require_skill_refs: z.ZodDefault<z.ZodBoolean>;
|
|
1310
1315
|
high_risk_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1311
1316
|
}, z.core.$strip>>;
|
|
1317
|
+
skillPropagation: z.ZodOptional<z.ZodObject<{
|
|
1318
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1319
|
+
enforce: z.ZodDefault<z.ZodBoolean>;
|
|
1320
|
+
}, z.core.$strip>>;
|
|
1312
1321
|
skill_improver: z.ZodOptional<z.ZodObject<{
|
|
1313
1322
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1314
1323
|
model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -29,10 +29,8 @@ export declare function loadRoutingSkills(directory: string, targetAgent: string
|
|
|
29
29
|
/** Agents that should receive skill context in delegations. */
|
|
30
30
|
export declare const SKILL_CAPABLE_AGENTS: Set<string>;
|
|
31
31
|
/**
|
|
32
|
-
* Maximum number of session-scoped skill-usage entries to process for
|
|
33
|
-
* skill scoring.
|
|
34
|
-
* limit, scoring is skipped to prevent unbounded file reads from
|
|
35
|
-
* stalling every delegated Task call.
|
|
32
|
+
* Maximum number of session-scoped skill-usage tail entries to process for
|
|
33
|
+
* skill scoring. This applies to the bounded tail-read window only.
|
|
36
34
|
*/
|
|
37
35
|
export declare const MAX_SCORING_SESSION_ENTRIES = 500;
|
|
38
36
|
export interface SkillGateInput {
|
|
@@ -66,6 +66,7 @@ export declare const _internals: {
|
|
|
66
66
|
openSync: typeof fs.openSync;
|
|
67
67
|
readSync: typeof fs.readSync;
|
|
68
68
|
closeSync: typeof fs.closeSync;
|
|
69
|
+
pruneSkillUsageLog: typeof pruneSkillUsageLog;
|
|
69
70
|
resolveSourceKnowledgeIds: typeof resolveSourceKnowledgeIds;
|
|
70
71
|
applySkillUsageFeedback: typeof applySkillUsageFeedback;
|
|
71
72
|
parseGeneratedFromKnowledge: typeof parseGeneratedFromKnowledge;
|
|
@@ -86,6 +87,7 @@ export declare function appendSkillUsageEntry(directory: string, entry: Omit<Ski
|
|
|
86
87
|
export declare function readSkillUsageEntries(directory: string, options?: SkillUsageFilterOptions): SkillUsageEntry[];
|
|
87
88
|
/** Default maximum bytes to read from the end of the log file. */
|
|
88
89
|
export declare const TAIL_BYTES_DEFAULT: number;
|
|
90
|
+
export declare const MAX_TAIL_BYTES: number;
|
|
89
91
|
/**
|
|
90
92
|
* Read the last `maxBytes` of the skill-usage JSONL log and parse matching
|
|
91
93
|
* entries. Much faster than `readSkillUsageEntries` for large logs because
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var package_default;
|
|
|
69
69
|
var init_package = __esm(() => {
|
|
70
70
|
package_default = {
|
|
71
71
|
name: "opencode-swarm",
|
|
72
|
-
version: "7.52.
|
|
72
|
+
version: "7.52.2",
|
|
73
73
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
74
74
|
main: "dist/index.js",
|
|
75
75
|
types: "dist/index.d.ts",
|
|
@@ -15207,7 +15207,7 @@ function resolveGuardrailsConfig(config2, agentName) {
|
|
|
15207
15207
|
};
|
|
15208
15208
|
return resolved;
|
|
15209
15209
|
}
|
|
15210
|
-
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillImproverConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, ParallelizationConfigSchema, LeanTurboConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, PluginConfigSchema;
|
|
15210
|
+
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentOverrideConfigSchema, SwarmConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, CheckpointConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, ParallelizationConfigSchema, LeanTurboConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, PluginConfigSchema;
|
|
15211
15211
|
var init_schema = __esm(() => {
|
|
15212
15212
|
init_zod();
|
|
15213
15213
|
init_constants();
|
|
@@ -15769,6 +15769,10 @@ var init_schema = __esm(() => {
|
|
|
15769
15769
|
"Task"
|
|
15770
15770
|
])
|
|
15771
15771
|
});
|
|
15772
|
+
SkillPropagationConfigSchema = exports_external.object({
|
|
15773
|
+
enabled: exports_external.boolean().default(true),
|
|
15774
|
+
enforce: exports_external.boolean().default(false)
|
|
15775
|
+
});
|
|
15772
15776
|
SkillImproverConfigSchema = exports_external.object({
|
|
15773
15777
|
enabled: exports_external.boolean().default(false),
|
|
15774
15778
|
model: exports_external.string().nullable().default(null),
|
|
@@ -15960,6 +15964,7 @@ var init_schema = __esm(() => {
|
|
|
15960
15964
|
curator: CuratorConfigSchema.optional(),
|
|
15961
15965
|
architectural_supervision: ArchitecturalSupervisionConfigSchema.optional(),
|
|
15962
15966
|
knowledge_application: KnowledgeApplicationConfigSchema.optional(),
|
|
15967
|
+
skillPropagation: SkillPropagationConfigSchema.optional(),
|
|
15963
15968
|
skill_improver: SkillImproverConfigSchema.optional(),
|
|
15964
15969
|
spec_writer: SpecWriterConfigSchema.optional(),
|
|
15965
15970
|
tool_output: exports_external.object({
|
|
@@ -16520,6 +16525,7 @@ __export(exports_config, {
|
|
|
16520
16525
|
SpecScenarioSchema: () => SpecScenarioSchema,
|
|
16521
16526
|
SpecRequirementSchema: () => SpecRequirementSchema,
|
|
16522
16527
|
SpecDeltaSchema: () => SpecDeltaSchema,
|
|
16528
|
+
SkillPropagationConfigSchema: () => SkillPropagationConfigSchema,
|
|
16523
16529
|
ReviewEvidenceSchema: () => ReviewEvidenceSchema,
|
|
16524
16530
|
QA_AGENTS: () => QA_AGENTS,
|
|
16525
16531
|
PluginConfigSchema: () => PluginConfigSchema,
|
|
@@ -40634,6 +40640,27 @@ function resolveDelegatedPlanTaskId(args2, knownPlanTaskIds) {
|
|
|
40634
40640
|
args2.task,
|
|
40635
40641
|
args2.input
|
|
40636
40642
|
];
|
|
40643
|
+
const taskLineMatches = new Set;
|
|
40644
|
+
for (const field of candidateTextFields) {
|
|
40645
|
+
if (typeof field !== "string")
|
|
40646
|
+
continue;
|
|
40647
|
+
const taskLine = extractTaskLine(field);
|
|
40648
|
+
if (!taskLine)
|
|
40649
|
+
continue;
|
|
40650
|
+
for (const m of taskLine.matchAll(/\b(\d+\.\d+(?:\.\d+)*)\b/g)) {
|
|
40651
|
+
const candidate = m[1];
|
|
40652
|
+
if (!isStrictTaskId(candidate))
|
|
40653
|
+
continue;
|
|
40654
|
+
if (knownPlanTaskIds && !knownPlanTaskIds.has(candidate))
|
|
40655
|
+
continue;
|
|
40656
|
+
taskLineMatches.add(candidate);
|
|
40657
|
+
}
|
|
40658
|
+
}
|
|
40659
|
+
if (taskLineMatches.size === 1) {
|
|
40660
|
+
return taskLineMatches.values().next().value;
|
|
40661
|
+
}
|
|
40662
|
+
if (taskLineMatches.size > 1)
|
|
40663
|
+
return null;
|
|
40637
40664
|
const seen = new Set;
|
|
40638
40665
|
for (const field of candidateTextFields) {
|
|
40639
40666
|
if (typeof field !== "string")
|
|
@@ -58201,6 +58228,12 @@ function appendSkillUsageEntry(directory, entry) {
|
|
|
58201
58228
|
};
|
|
58202
58229
|
_internals19.appendFileSync(resolved, `${JSON.stringify(fullEntry)}
|
|
58203
58230
|
`, "utf-8");
|
|
58231
|
+
try {
|
|
58232
|
+
const stat3 = _internals19.statSync(resolved);
|
|
58233
|
+
if (stat3.size > SKILL_USAGE_LOG_ROTATE_BYTES) {
|
|
58234
|
+
_internals19.pruneSkillUsageLog(directory, SKILL_USAGE_LOG_MAX_ENTRIES_PER_SKILL);
|
|
58235
|
+
}
|
|
58236
|
+
} catch {}
|
|
58204
58237
|
}
|
|
58205
58238
|
function readSkillUsageEntries(directory, options) {
|
|
58206
58239
|
const resolved = resolveLogPath(directory);
|
|
@@ -58247,8 +58280,10 @@ function readSkillUsageEntriesTail(directory, filters, maxBytes = TAIL_BYTES_DEF
|
|
|
58247
58280
|
if (!_internals19.existsSync(logPath))
|
|
58248
58281
|
return [];
|
|
58249
58282
|
try {
|
|
58283
|
+
const normalizedMaxBytes = Number.isFinite(maxBytes) ? maxBytes : TAIL_BYTES_DEFAULT;
|
|
58284
|
+
const boundedMaxBytes = Math.min(Math.max(1, normalizedMaxBytes), MAX_TAIL_BYTES);
|
|
58250
58285
|
const stat3 = _internals19.statSync(logPath);
|
|
58251
|
-
const start2 = Math.max(0, stat3.size -
|
|
58286
|
+
const start2 = Math.max(0, stat3.size - boundedMaxBytes);
|
|
58252
58287
|
const fd = _internals19.openSync(logPath, "r");
|
|
58253
58288
|
try {
|
|
58254
58289
|
const readLen = stat3.size - start2;
|
|
@@ -58448,7 +58483,7 @@ async function applySkillUsageFeedback(directory, options) {
|
|
|
58448
58483
|
}
|
|
58449
58484
|
return { processed, bumps };
|
|
58450
58485
|
}
|
|
58451
|
-
var _internals19, TAIL_BYTES_DEFAULT, COMPLIANCE_BOOST = 0.05, VIOLATION_DECAY = 0.1;
|
|
58486
|
+
var _internals19, TAIL_BYTES_DEFAULT, MAX_TAIL_BYTES, SKILL_USAGE_LOG_ROTATE_BYTES, SKILL_USAGE_LOG_MAX_ENTRIES_PER_SKILL = 500, COMPLIANCE_BOOST = 0.05, VIOLATION_DECAY = 0.1;
|
|
58452
58487
|
var init_skill_usage_log = __esm(() => {
|
|
58453
58488
|
init_knowledge_store();
|
|
58454
58489
|
init_utils2();
|
|
@@ -58464,11 +58499,14 @@ var init_skill_usage_log = __esm(() => {
|
|
|
58464
58499
|
openSync: fs15.openSync.bind(fs15),
|
|
58465
58500
|
readSync: fs15.readSync.bind(fs15),
|
|
58466
58501
|
closeSync: fs15.closeSync.bind(fs15),
|
|
58502
|
+
pruneSkillUsageLog,
|
|
58467
58503
|
resolveSourceKnowledgeIds,
|
|
58468
58504
|
applySkillUsageFeedback,
|
|
58469
58505
|
parseGeneratedFromKnowledge
|
|
58470
58506
|
};
|
|
58471
58507
|
TAIL_BYTES_DEFAULT = 64 * 1024;
|
|
58508
|
+
MAX_TAIL_BYTES = TAIL_BYTES_DEFAULT;
|
|
58509
|
+
SKILL_USAGE_LOG_ROTATE_BYTES = 1024 * 1024;
|
|
58472
58510
|
});
|
|
58473
58511
|
|
|
58474
58512
|
// src/hooks/curator.ts
|
|
@@ -105490,7 +105528,7 @@ async function skillPropagationGateBefore(directory, input, config3) {
|
|
|
105490
105528
|
});
|
|
105491
105529
|
if (sessionEntries.length > _internals58.MAX_SCORING_SESSION_ENTRIES) {
|
|
105492
105530
|
scoringSkipped = true;
|
|
105493
|
-
warn(`[skill-propagation-gate] skipping scoring —
|
|
105531
|
+
warn(`[skill-propagation-gate] skipping scoring — tail window has ${sessionEntries.length} session entries (limit: ${_internals58.MAX_SCORING_SESSION_ENTRIES})`);
|
|
105494
105532
|
} else {
|
|
105495
105533
|
const prompt = typeof input.args?.prompt === "string" ? String(input.args.prompt) : "";
|
|
105496
105534
|
scored = availableSkills.map((skillPath) => {
|
|
@@ -130099,6 +130137,7 @@ async function initializeOpenCodeSwarm(ctx) {
|
|
|
130099
130137
|
const summaryConfig = SummaryConfigSchema.parse(config3.summaries ?? {});
|
|
130100
130138
|
const toolSummarizerHook = createToolSummarizerHook(summaryConfig, ctx.directory);
|
|
130101
130139
|
const knowledgeConfig = KnowledgeConfigSchema.parse(config3.knowledge ?? {});
|
|
130140
|
+
const skillPropagationConfig = SkillPropagationConfigSchema.parse(config3.skillPropagation ?? {});
|
|
130102
130141
|
const knowledgeCuratorHook = knowledgeConfig.enabled ? createKnowledgeCuratorHook(ctx.directory, knowledgeConfig) : undefined;
|
|
130103
130142
|
const hivePromoterHook = knowledgeConfig.enabled && knowledgeConfig.hive_enabled ? createHivePromoterHook(ctx.directory, knowledgeConfig) : undefined;
|
|
130104
130143
|
const knowledgeInjectorHook = knowledgeConfig.enabled ? createKnowledgeInjectorHook(ctx.directory, knowledgeConfig) : undefined;
|
|
@@ -130555,6 +130594,9 @@ async function initializeOpenCodeSwarm(ctx) {
|
|
|
130555
130594
|
},
|
|
130556
130595
|
(input, output) => {
|
|
130557
130596
|
try {
|
|
130597
|
+
if (!skillPropagationConfig.enabled) {
|
|
130598
|
+
return Promise.resolve();
|
|
130599
|
+
}
|
|
130558
130600
|
const p = input;
|
|
130559
130601
|
return skillPropagationTransformScan(ctx.directory, output, p.sessionID);
|
|
130560
130602
|
} catch {
|
|
@@ -130635,12 +130677,12 @@ async function initializeOpenCodeSwarm(ctx) {
|
|
|
130635
130677
|
agent: input.agent,
|
|
130636
130678
|
sessionID: input.sessionID
|
|
130637
130679
|
}, KnowledgeApplicationConfigSchema.parse(config3.knowledge_application ?? {}));
|
|
130638
|
-
const skillResult = await skillPropagationGateBefore(ctx.directory, {
|
|
130680
|
+
const skillResult = skillPropagationConfig.enabled ? await skillPropagationGateBefore(ctx.directory, {
|
|
130639
130681
|
tool: input.tool,
|
|
130640
130682
|
agent: input.agent,
|
|
130641
130683
|
sessionID: input.sessionID,
|
|
130642
130684
|
args: input.args
|
|
130643
|
-
}, {
|
|
130685
|
+
}, skillPropagationConfig) : { blocked: false, reason: null, recommendedSkills: undefined };
|
|
130644
130686
|
if (skillResult.blocked) {
|
|
130645
130687
|
throw new Error(skillResult.reason ?? "Blocked by skill propagation gate");
|
|
130646
130688
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.52.
|
|
3
|
+
"version": "7.52.2",
|
|
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",
|