opencode-swarm 7.96.0 → 7.98.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.
Files changed (35) hide show
  1. package/.opencode/skills/codebase-review-swarm/references/review-protocol-v8.2.md +1 -1
  2. package/.opencode/skills/deep-dive/SKILL.md +3 -1
  3. package/.opencode/skills/deep-research/SKILL.md +8 -8
  4. package/.opencode/skills/pre-phase-briefing/SKILL.md +21 -5
  5. package/.opencode/skills/swarm-pr-feedback/SKILL.md +19 -7
  6. package/.opencode/skills/swarm-pr-review/SKILL.md +2 -0
  7. package/README.md +7 -1
  8. package/dist/agents/architect.d.ts +1 -1
  9. package/dist/cli/{config-doctor-h1xrvq83.js → config-doctor-7yrxfa6b.js} +2 -2
  10. package/dist/cli/{guardrail-explain-0hw3kyab.js → guardrail-explain-xdv74tfk.js} +5 -5
  11. package/dist/cli/{guardrail-log-9yyeccv5.js → guardrail-log-53z1cf46.js} +3 -3
  12. package/dist/cli/{index-tqbb2jx6.js → index-471qxz9g.js} +33 -9
  13. package/dist/cli/{index-b223mczb.js → index-5z2e78tv.js} +1 -1
  14. package/dist/cli/{index-rdc6nvmw.js → index-gnd1280x.js} +1 -1
  15. package/dist/cli/{index-r0zbs7ny.js → index-h6h8qfsh.js} +6 -6
  16. package/dist/cli/{index-q0t7gpf2.js → index-pc10e4d7.js} +9 -9
  17. package/dist/cli/{index-d3ds25vx.js → index-wmm21nsk.js} +2 -2
  18. package/dist/cli/{index-xx3sv77e.js → index-zy22fg5h.js} +1 -1
  19. package/dist/cli/index.js +4 -4
  20. package/dist/cli/{schema-a8fneygm.js → schema-mygkbbe9.js} +5 -1
  21. package/dist/config/constants.d.ts +4 -0
  22. package/dist/config/schema.d.ts +11 -0
  23. package/dist/evidence/normalize-verdict.d.ts +67 -0
  24. package/dist/hooks/knowledge-injector.d.ts +1 -1
  25. package/dist/index.js +576 -285
  26. package/dist/services/injection-budget.d.ts +98 -0
  27. package/dist/summaries/summarizer.d.ts +36 -0
  28. package/dist/tools/context-status.d.ts +102 -0
  29. package/dist/tools/index.d.ts +1 -0
  30. package/dist/tools/manifest.d.ts +1 -0
  31. package/dist/tools/tool-metadata.d.ts +11 -7
  32. package/dist/tools/write-drift-evidence.d.ts +11 -0
  33. package/dist/tools/write-hallucination-evidence.d.ts +11 -0
  34. package/dist/tools/write-mutation-evidence.d.ts +11 -0
  35. package/package.json +1 -1
@@ -204,6 +204,7 @@ export declare const ContextBudgetConfigSchema: z.ZodObject<{
204
204
  critical_threshold: z.ZodDefault<z.ZodNumber>;
205
205
  model_limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
206
206
  max_injection_tokens: z.ZodDefault<z.ZodNumber>;
207
+ unified_injection_tokens: z.ZodOptional<z.ZodNumber>;
207
208
  tracked_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
208
209
  scoring: z.ZodOptional<z.ZodObject<{
209
210
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -757,6 +758,10 @@ export declare const SkillImproverConfigSchema: z.ZodObject<{
757
758
  allow_deterministic_fallback: z.ZodDefault<z.ZodBoolean>;
758
759
  }, z.core.$strip>;
759
760
  export type SkillImproverConfig = z.infer<typeof SkillImproverConfigSchema>;
761
+ export declare const SkillsConfigSchema: z.ZodObject<{
762
+ enabled: z.ZodDefault<z.ZodBoolean>;
763
+ }, z.core.$strip>;
764
+ export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
760
765
  export declare const SpecWriterConfigSchema: z.ZodObject<{
761
766
  enabled: z.ZodDefault<z.ZodBoolean>;
762
767
  model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -1341,6 +1346,8 @@ export declare const ExternalSkillsConfigSchema: z.ZodObject<{
1341
1346
  export type ExternalSkillsConfig = z.infer<typeof ExternalSkillsConfigSchema>;
1342
1347
  /** Default external skills configuration (all subsystems disabled). */
1343
1348
  export declare const DEFAULT_EXTERNAL_SKILLS_CONFIG: ExternalSkillsConfig;
1349
+ /** Default skills configuration (tools gated off). */
1350
+ export declare const DEFAULT_SKILLS_CONFIG: SkillsConfig;
1344
1351
  /**
1345
1352
  * Resolve the external_skills config section, merging user-provided values
1346
1353
  * over defaults. Returns the default (all-disabled) config when
@@ -1474,6 +1481,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
1474
1481
  critical_threshold: z.ZodDefault<z.ZodNumber>;
1475
1482
  model_limits: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1476
1483
  max_injection_tokens: z.ZodDefault<z.ZodNumber>;
1484
+ unified_injection_tokens: z.ZodOptional<z.ZodNumber>;
1477
1485
  tracked_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1478
1486
  scoring: z.ZodOptional<z.ZodObject<{
1479
1487
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -2183,6 +2191,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
2183
2191
  max_concurrent_fetches: z.ZodDefault<z.ZodNumber>;
2184
2192
  fetch_timeout_ms: z.ZodDefault<z.ZodNumber>;
2185
2193
  }, z.core.$strip>>;
2194
+ skills: z.ZodOptional<z.ZodObject<{
2195
+ enabled: z.ZodDefault<z.ZodBoolean>;
2196
+ }, z.core.$strip>>;
2186
2197
  }, z.core.$strip>;
2187
2198
  export type PluginConfig = z.infer<typeof PluginConfigSchema>;
2188
2199
  export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared verdict normalization utilities for evidence writers.
3
+ *
4
+ * Centralizes the uppercase→lowercase verdict mapping that was previously
5
+ * duplicated across write_drift_evidence, write_hallucination_evidence,
6
+ * and write_mutation_evidence.
7
+ *
8
+ * Two distinct verdict sets are supported:
9
+ * - 2-value (drift / hallucination): APPROVED ↔ approved, NEEDS_REVISION ↔ rejected
10
+ * - 4-value (mutation): PASS/WARN/FAIL/SKIP ↔ pass/warn/fail/skip
11
+ *
12
+ * All functions are pure and throw on invalid input, matching the original
13
+ * per-file behavior exactly.
14
+ */
15
+ /**
16
+ * Normalize a 2-value drift/hallucination verdict to lowercase.
17
+ * @param verdict - Raw verdict from VERDICT_SET_2 (base: 'APPROVED' | 'NEEDS_REVISION'; extensible)
18
+ * @returns Normalized verdict: 'approved' | 'rejected' | lowercase form for extended verdicts
19
+ * @throws Error if verdict is not one of the allowed values in the live set
20
+ */
21
+ export declare function normalizeVerdict2(verdict: 'APPROVED'): 'approved';
22
+ export declare function normalizeVerdict2(verdict: 'NEEDS_REVISION'): 'rejected';
23
+ export declare function normalizeVerdict2(verdict: 'APPROVED' | 'NEEDS_REVISION'): 'approved' | 'rejected';
24
+ export declare function normalizeVerdict2(verdict: string): string;
25
+ /**
26
+ * Normalize a 4-value mutation verdict to lowercase.
27
+ * @param verdict - Raw verdict from VERDICT_SET_4 (base: 'PASS' | 'WARN' | 'FAIL' | 'SKIP'; extensible)
28
+ * @returns Normalized verdict: 'pass' | 'warn' | 'fail' | 'skip' | lowercase form for extended verdicts
29
+ * @throws Error if verdict is not one of the allowed values in the live set
30
+ */
31
+ export declare function normalizeVerdict4(verdict: 'PASS'): 'pass';
32
+ export declare function normalizeVerdict4(verdict: 'WARN'): 'warn';
33
+ export declare function normalizeVerdict4(verdict: 'FAIL'): 'fail';
34
+ export declare function normalizeVerdict4(verdict: 'SKIP'): 'skip';
35
+ export declare function normalizeVerdict4(verdict: 'PASS' | 'WARN' | 'FAIL' | 'SKIP'): 'pass' | 'warn' | 'fail' | 'skip';
36
+ export declare function normalizeVerdict4(verdict: string): string;
37
+ /**
38
+ * Dependency-injection seam for testing. Tests can temporarily replace these
39
+ * to verify that evidence writers delegate to the shared normalize-verdict module.
40
+ * Restore each entry in afterEach via the saved original reference.
41
+ *
42
+ * VERDICT_SET_* are the single source of truth. Writers import VERDICT_SET_2 / _4
43
+ * for their Zod schemas and isAcceptedVerdict* for runtime checks. Adding a value
44
+ * here (or via _internals for tests) makes all three writers accept it with no
45
+ * per-writer edits.
46
+ */
47
+ declare const LIVE_VERDICT_SET_2: string[];
48
+ declare const LIVE_VERDICT_SET_4: string[];
49
+ export declare const VERDICT_SET_2: readonly string[];
50
+ export type Verdict2 = (typeof LIVE_VERDICT_SET_2)[number];
51
+ export declare const VERDICT_SET_4: readonly string[];
52
+ export type Verdict4 = (typeof LIVE_VERDICT_SET_4)[number];
53
+ export declare function isAcceptedVerdict2(v: string): v is Verdict2;
54
+ export declare function isAcceptedVerdict4(v: string): v is Verdict4;
55
+ export declare const _internals: {
56
+ normalizeVerdict2: typeof normalizeVerdict2;
57
+ normalizeVerdict4: typeof normalizeVerdict4;
58
+ VERDICT_SET_2: string[];
59
+ VERDICT_SET_4: string[];
60
+ isAcceptedVerdict2: typeof isAcceptedVerdict2;
61
+ isAcceptedVerdict4: typeof isAcceptedVerdict4;
62
+ setVerdictSet2: (values: string[]) => void;
63
+ setVerdictSet4: (values: string[]) => void;
64
+ getVerdictSet2: () => string[];
65
+ getVerdictSet4: () => string[];
66
+ };
67
+ export {};
@@ -87,7 +87,7 @@ export declare function matchesDelegateScope(entry: Pick<RankedEntry, 'applies_t
87
87
  * @param config - Knowledge system configuration
88
88
  * @returns A hook function that injects knowledge into messages
89
89
  */
90
- export declare function createKnowledgeInjectorHook(directory: string, config: KnowledgeConfig, modelLimitOverrides?: Record<string, number>): (input: Record<string, never>, output: {
90
+ export declare function createKnowledgeInjectorHook(directory: string, config: KnowledgeConfig, modelLimitOverrides?: Record<string, number>, unifiedInjectionTokens?: number | undefined): (input: Record<string, never>, output: {
91
91
  messages?: MessageWithParts[];
92
92
  }) => Promise<void>;
93
93
  export declare const _internals: {