opencode-swarm 7.125.2 → 7.125.3

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 (45) hide show
  1. package/dist/cli/{config-doctor-8df6hk58.js → config-doctor-rm1m07gz.js} +2 -2
  2. package/dist/cli/{core-d38hc85b.js → core-v1kp7anb.js} +2 -2
  3. package/dist/cli/{curation-policy-7pvghg6f.js → curation-policy-7pgdjt5w.js} +2 -2
  4. package/dist/cli/{curator-dw2zb74h.js → curator-arwm18td.js} +16 -16
  5. package/dist/cli/{curator-drift-h9a2sjvf.js → curator-drift-24bdacdc.js} +2 -2
  6. package/dist/cli/{curator-llm-factory-bntt6v8j.js → curator-llm-factory-yq5vf298.js} +16 -16
  7. package/dist/cli/{evidence-summary-service-v4h2w487.js → evidence-summary-service-thx1c3me.js} +3 -3
  8. package/dist/cli/{guardrail-explain-vmr4db9n.js → guardrail-explain-mscq3veq.js} +17 -17
  9. package/dist/cli/{guardrail-log-8prd6cnc.js → guardrail-log-6a2zxvtx.js} +3 -3
  10. package/dist/cli/{hive-promoter-xymt9vf2.js → hive-promoter-q79naynh.js} +16 -16
  11. package/dist/cli/{index-ptmhxsaf.js → index-01n43w2p.js} +4 -4
  12. package/dist/cli/{index-qcrah1jk.js → index-414r47r7.js} +3 -3
  13. package/dist/cli/{index-pgya7cnn.js → index-45mvd5q7.js} +4 -4
  14. package/dist/cli/index-4rhhvd1a.js +62 -0
  15. package/dist/cli/{index-1s7jzcsy.js → index-4ycq2mrp.js} +1 -1
  16. package/dist/cli/{index-yrk6hfp1.js → index-7p6jkkat.js} +18 -18
  17. package/dist/cli/{index-39p1yyag.js → index-8tjbq2ej.js} +1 -1
  18. package/dist/cli/{index-s9mj4rb9.js → index-9ss2m4rs.js} +1 -1
  19. package/dist/cli/{index-j8ptbcxz.js → index-ambnwnmt.js} +15 -6
  20. package/dist/cli/{index-zbsxek49.js → index-emzes7sj.js} +3 -3
  21. package/dist/cli/{index-tdpct4cz.js → index-fm4zfxnr.js} +1 -1
  22. package/dist/cli/{index-v2rdhwx8.js → index-g4ef4v3m.js} +1 -1
  23. package/dist/cli/{index-fs02c7tz.js → index-kk1scggc.js} +1 -1
  24. package/dist/cli/{index-8ed9rz7y.js → index-m5e00g9s.js} +44 -42
  25. package/dist/cli/{index-92xyawa7.js → index-pk099nqv.js} +87 -6
  26. package/dist/cli/{index-7ne6q2a0.js → index-rp5msv7n.js} +1 -1
  27. package/dist/cli/{index-7mtvvt8p.js → index-sa3dgpmc.js} +2 -2
  28. package/dist/cli/{index-v3f7jvm8.js → index-vdfewvn5.js} +5 -5
  29. package/dist/cli/{index-em4h33my.js → index-x8entmky.js} +2 -2
  30. package/dist/cli/{index-sxdh19nk.js → index-xezv6tdw.js} +1 -1
  31. package/dist/cli/index.js +16 -16
  32. package/dist/cli/{knowledge-escalator-47hfstmk.js → knowledge-escalator-gr8qd7kz.js} +3 -3
  33. package/dist/cli/{knowledge-events-j5dpp72w.js → knowledge-events-q83g3f8z.js} +1 -1
  34. package/dist/cli/{knowledge-store-58gt7m85.js → knowledge-store-qq3w5yt8.js} +1 -1
  35. package/dist/cli/{knowledge-validator-jjxw5mwc.js → knowledge-validator-7jhq8yam.js} +4 -4
  36. package/dist/cli/{scan-cursor-h8we8dfv.js → scan-cursor-fa5sy36q.js} +2 -2
  37. package/dist/cli/{schema-xpqbhcyp.js → schema-bw68my66.js} +3 -1
  38. package/dist/cli/{skill-generator-k8d0vff0.js → skill-generator-ffc1agyw.js} +6 -6
  39. package/dist/config/loader.d.ts +14 -0
  40. package/dist/config/schema.d.ts +6 -0
  41. package/dist/index.js +6 -6
  42. package/dist/services/config-doctor.d.ts +14 -2
  43. package/dist/services/warning-buffer.d.ts +24 -5
  44. package/package.json +1 -1
  45. package/dist/cli/index-gacm5s2n.js +0 -34
@@ -38,6 +38,14 @@ export interface ConfigFix {
38
38
  description: string;
39
39
  /** Risk level - only 'low' is auto-fixable */
40
40
  risk: 'low' | 'medium' | 'high';
41
+ /**
42
+ * When true, the fix loses user-authored data (e.g. trimming an over-length
43
+ * array). Lossy fixes are applied ONLY when the caller explicitly opts in via
44
+ * `applySafeAutoFixes(..., { applyLossy: true })` — the interactive
45
+ * `/swarm config doctor --fix` command does; the passive startup autofix path
46
+ * never does. This keeps a lossy repair from being applied silently (#1886).
47
+ */
48
+ lossy?: boolean;
41
49
  }
42
50
  /** Result of running the config doctor */
43
51
  export interface ConfigDoctorResult {
@@ -98,7 +106,9 @@ export declare function runConfigDoctor(config: PluginConfig, directory: string)
98
106
  * Apply safe auto-fixes to config
99
107
  * Only applies low-risk, non-destructive fixes
100
108
  */
101
- export declare function applySafeAutoFixes(directory: string, result: ConfigDoctorResult): {
109
+ export declare function applySafeAutoFixes(directory: string, result: ConfigDoctorResult, options?: {
110
+ applyLossy?: boolean;
111
+ }): {
102
112
  appliedFixes: ConfigFix[];
103
113
  updatedConfigPath: string | null;
104
114
  };
@@ -131,7 +141,9 @@ export declare function shouldRunOnStartup(automationConfig: {
131
141
  /**
132
142
  * Full config doctor run with backup and fix application
133
143
  */
134
- export declare function runConfigDoctorWithFixes(directory: string, config: PluginConfig, autoFix?: boolean): Promise<{
144
+ export declare function runConfigDoctorWithFixes(directory: string, config: PluginConfig, autoFix?: boolean, options?: {
145
+ applyLossy?: boolean;
146
+ }): Promise<{
135
147
  result: ConfigDoctorResult;
136
148
  backupPath: string | null;
137
149
  appliedFixes: ConfigFix[];
@@ -1,14 +1,33 @@
1
+ /**
2
+ * Buffer a warning for `/swarm diagnose`. This is the single write boundary
3
+ * for `deferredWarnings` — `advisoryWarn` funnels through it, and roughly a
4
+ * dozen call sites across `src/index.ts` and `src/agents/index.ts` call it
5
+ * directly with hand-composed messages. Several of those interpolate
6
+ * repo-controlled config content (agent names from `agents: z.record(...)`,
7
+ * the `auto_select_architect` string, …) that flows straight from an
8
+ * auto-loaded, attacker-editable `.opencode/opencode-swarm.json`.
9
+ *
10
+ * Sanitizing HERE — not in `advisoryWarn` — is what actually closes the class:
11
+ * every path into the buffer passes through this one function, so a future
12
+ * direct caller can't reintroduce the terminal-control-character /
13
+ * markdown-bullet-breaking class this guards against (security review,
14
+ * issue #1886 follow-up; an earlier revision of this fix sanitized only
15
+ * inside `advisoryWarn` and missed every direct caller).
16
+ */
1
17
  export declare function addDeferredWarning(warning: string): void;
2
18
  /**
3
19
  * Operational advisory: a non-fatal, operator-actionable condition reached on
4
20
  * a path that can run while the host TUI owns the terminal (plugin init,
5
- * /swarm command handlers, tool execution, chat/tool hooks). Routes the message
6
- * to BOTH delivery channels:
21
+ * /swarm command handlers, tool execution, chat/tool hooks). Routes to BOTH
22
+ * delivery channels:
7
23
  *
8
24
  * 1. `addDeferredWarning` — buffers it for `/swarm diagnose`, so the operator
9
- * can discover the condition without it polluting the live display.
10
- * 2. `log` the debug-gated logger, so it also shows under
11
- * `OPENCODE_SWARM_DEBUG=1` for live debugging.
25
+ * can discover the condition without it polluting the live display. The
26
+ * optional `data` is folded into the buffered entry (rendered compact +
27
+ * single-line) so actionable detail is visible in `/swarm diagnose`, not
28
+ * only under debug (issue #1886: config-validation detail was silently lost).
29
+ * 2. `log` — the debug-gated logger, so the message AND the structured `data`
30
+ * also show under `OPENCODE_SWARM_DEBUG=1` for live debugging.
12
31
  *
13
32
  * This NEVER writes raw stderr/stdout. It is the safe replacement for the raw
14
33
  * `console.warn` calls that corrupt the bubbletea TUI (issue #1249 class, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.125.2",
3
+ "version": "7.125.3",
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",
@@ -1,34 +0,0 @@
1
- // @bun
2
- import {
3
- init_logger,
4
- log
5
- } from "./index-zgwm4ryv.js";
6
- import {
7
- __esm
8
- } from "./index-a76rekgs.js";
9
-
10
- // src/services/warning-buffer.ts
11
- function addDeferredWarning(warning) {
12
- if (deferredWarnings.length < MAX_DEFERRED_WARNINGS - 1) {
13
- deferredWarnings.push(warning);
14
- return;
15
- }
16
- if (!deferredWarningsTruncated) {
17
- deferredWarnings.push(`[opencode-swarm] ${MAX_DEFERRED_WARNINGS - 1} deferred warnings buffered; additional advisories were dropped (cap reached). Run with OPENCODE_SWARM_DEBUG=1 to see all advisories in the debug log.`);
18
- deferredWarningsTruncated = true;
19
- }
20
- }
21
- function advisoryWarn(message, data) {
22
- addDeferredWarning(message);
23
- log(message, data);
24
- }
25
- function getDeferredWarnings() {
26
- return [...deferredWarnings];
27
- }
28
- var deferredWarnings, MAX_DEFERRED_WARNINGS = 50, deferredWarningsTruncated = false;
29
- var init_warning_buffer = __esm(() => {
30
- init_logger();
31
- deferredWarnings = [];
32
- });
33
-
34
- export { advisoryWarn, getDeferredWarnings, init_warning_buffer };