opencode-swarm 7.97.0 → 7.98.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.
Files changed (31) hide show
  1. package/README.md +7 -1
  2. package/dist/agents/architect.d.ts +1 -1
  3. package/dist/cli/{config-doctor-h1xrvq83.js → config-doctor-7yrxfa6b.js} +2 -2
  4. package/dist/cli/{guardrail-explain-t6svvtmn.js → guardrail-explain-cm08h4mt.js} +5 -5
  5. package/dist/cli/{guardrail-log-9yyeccv5.js → guardrail-log-53z1cf46.js} +3 -3
  6. package/dist/cli/{index-a9ghr5cx.js → index-0rgde8qc.js} +2 -2
  7. package/dist/cli/{index-tqbb2jx6.js → index-471qxz9g.js} +33 -9
  8. package/dist/cli/{index-b223mczb.js → index-5z2e78tv.js} +1 -1
  9. package/dist/cli/{index-byb9tgay.js → index-attgb1ma.js} +6 -6
  10. package/dist/cli/{index-rdc6nvmw.js → index-gnd1280x.js} +1 -1
  11. package/dist/cli/{index-sgdr2e4n.js → index-zgba613y.js} +63 -64
  12. package/dist/cli/{index-xx3sv77e.js → index-zy22fg5h.js} +1 -1
  13. package/dist/cli/index.js +4 -4
  14. package/dist/cli/{schema-a8fneygm.js → schema-mygkbbe9.js} +5 -1
  15. package/dist/config/constants.d.ts +4 -0
  16. package/dist/config/schema.d.ts +11 -0
  17. package/dist/evidence/normalize-verdict.d.ts +67 -0
  18. package/dist/hooks/knowledge-curator.d.ts +1 -0
  19. package/dist/hooks/knowledge-injector.d.ts +1 -1
  20. package/dist/index.js +758 -355
  21. package/dist/services/external-skill-validator.d.ts +10 -2
  22. package/dist/services/injection-budget.d.ts +98 -0
  23. package/dist/summaries/summarizer.d.ts +36 -0
  24. package/dist/tools/context-status.d.ts +102 -0
  25. package/dist/tools/index.d.ts +1 -0
  26. package/dist/tools/manifest.d.ts +1 -0
  27. package/dist/tools/tool-metadata.d.ts +11 -7
  28. package/dist/tools/write-drift-evidence.d.ts +11 -0
  29. package/dist/tools/write-hallucination-evidence.d.ts +11 -0
  30. package/dist/tools/write-mutation-evidence.d.ts +11 -0
  31. package/package.json +1 -1
@@ -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 {};
@@ -21,6 +21,7 @@ declare function hashContent(content: string): string;
21
21
  * Exported for testing purposes only.
22
22
  */
23
23
  export declare function isWriteToEvidenceFile(input: unknown): boolean;
24
+ export declare function isEvidencePath(filePath: string | undefined | null): boolean;
24
25
  /** Build the v3-schema enrichment prompt for a single prose lesson. */
25
26
  export declare function buildV3EnrichmentPrompt(lesson: string, category: string, tags: string[]): string;
26
27
  /**
@@ -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: {