opencode-swarm 7.113.1 → 7.113.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 (78) hide show
  1. package/.opencode/skills/engineering-conventions/SKILL.md +5 -0
  2. package/.opencode/skills/gate-attribution/SKILL.md +2 -0
  3. package/binaries/win32-arm64/.gitkeep +0 -0
  4. package/binaries/win32-x64/.gitkeep +0 -0
  5. package/dist/background/event-bus.d.ts +1 -1
  6. package/dist/background/pending-delegations.d.ts +8 -0
  7. package/dist/background/queue.d.ts +11 -0
  8. package/dist/background/trigger.d.ts +1 -0
  9. package/dist/background/workspace-snapshot.d.ts +7 -0
  10. package/dist/cli/{capability-probe-sh9bwh39.js → capability-probe-f1paszww.js} +1 -1
  11. package/dist/cli/{config-doctor-az11cwf5.js → config-doctor-xbdfrbwt.js} +2 -2
  12. package/dist/cli/{core-f4cbabe7.js → core-zg8s1jwx.js} +2 -2
  13. package/dist/cli/{curator-nm2c9y1p.js → curator-ckzb8ww4.js} +23 -22
  14. package/dist/cli/{curator-drift-jvs1v6em.js → curator-drift-c0by7063.js} +2 -2
  15. package/dist/cli/curator-llm-factory-mhjcpy1s.js +41 -0
  16. package/dist/cli/{dispatch-wst7bypk.js → dispatch-mczsxy5s.js} +2 -2
  17. package/dist/cli/{evidence-summary-service-j6fnsfeq.js → evidence-summary-service-8g594znj.js} +7 -7
  18. package/dist/cli/{gate-evidence-mk0ss1re.js → gate-evidence-vkpqt300.js} +5 -5
  19. package/dist/cli/guardrail-explain-kabd97j8.js +42 -0
  20. package/dist/cli/{guardrail-log-hysxdwg9.js → guardrail-log-qfc2j0tb.js} +4 -4
  21. package/dist/cli/hive-promoter-h21wzpsr.js +49 -0
  22. package/dist/cli/{index-0dab9w37.js → index-0p660a87.js} +2 -2
  23. package/dist/cli/{index-32bx4kch.js → index-0q7rrh59.js} +4 -4
  24. package/dist/cli/{index-1ey3dxq7.js → index-147ja18h.js} +0 -4
  25. package/dist/cli/{index-0gf6de8b.js → index-2148358e.js} +45 -1
  26. package/dist/cli/{index-30ejh1tx.js → index-43khae15.js} +3 -3
  27. package/dist/cli/{index-pm992z24.js → index-4h2ea8h5.js} +12 -9
  28. package/dist/cli/{index-5mkc2f9z.js → index-4sckv7y6.js} +1 -1
  29. package/dist/cli/{index-q1jaeynn.js → index-80jkseqw.js} +2 -2
  30. package/dist/cli/{index-wvrj16f0.js → index-8fwhhayc.js} +4 -0
  31. package/dist/cli/{index-npd9rypp.js → index-dh87tpc5.js} +176 -63
  32. package/dist/cli/{workspace-snapshot-w58jr2ga.js → index-dqh3zhhc.js} +53 -10
  33. package/dist/cli/{index-d0w40jm3.js → index-f6y341yk.js} +14 -11
  34. package/dist/cli/{index-db1fh1fv.js → index-g40r5d08.js} +1 -1
  35. package/dist/cli/{index-8f256d7t.js → index-g6va6n3t.js} +1 -1
  36. package/dist/cli/{index-9fxs0rm1.js → index-ga4ta3cr.js} +1 -1
  37. package/dist/cli/{index-t6wfwdm1.js → index-h7q1bvzm.js} +3 -3
  38. package/dist/cli/{index-rqpm9cwe.js → index-hw4tcxs9.js} +25 -24
  39. package/dist/cli/{index-h389ed8y.js → index-mr4whary.js} +3 -3
  40. package/dist/cli/{index-g55nzpwn.js → index-n6fa2hhk.js} +1 -1
  41. package/dist/cli/{index-vn263hqt.js → index-pa6t33pt.js} +17 -10
  42. package/dist/cli/{index-h91bv3hy.js → index-qe3v54nb.js} +6 -1
  43. package/dist/cli/{index-hpp2r0sd.js → index-qzqx2qky.js} +3 -3
  44. package/dist/cli/{index-fhmw7evd.js → index-rdwfqhp7.js} +2 -2
  45. package/dist/cli/{index-ky8eb4q6.js → index-srvqfcyj.js} +2 -2
  46. package/dist/cli/{index-1rga1vvb.js → index-wh8949ef.js} +1 -1
  47. package/dist/cli/{index-r9fjzr3k.js → index-xbe1wtme.js} +1 -1
  48. package/dist/cli/index.js +23 -22
  49. package/dist/cli/{knowledge-escalator-4gbz527n.js → knowledge-escalator-0q1p6br7.js} +8 -8
  50. package/dist/cli/{knowledge-events-b6x28fgc.js → knowledge-events-9518gzsp.js} +6 -6
  51. package/dist/cli/{knowledge-store-h3cjx4dg.js → knowledge-store-k5rab79h.js} +6 -6
  52. package/dist/cli/{knowledge-validator-q6jw2p0t.js → knowledge-validator-csay9wqj.js} +7 -7
  53. package/dist/cli/{pending-delegations-gc3a2hfx.js → pending-delegations-ddbkbgxy.js} +11 -4
  54. package/dist/cli/{pr-subscriptions-p8g2rzxd.js → pr-subscriptions-vwv7zm2p.js} +5 -5
  55. package/dist/cli/{schema-qb313fyy.js → schema-e5kd993s.js} +1 -1
  56. package/dist/cli/{scope-persistence-5ccgtebg.js → scope-persistence-fm0gzhnk.js} +2 -2
  57. package/dist/cli/{skill-generator-nnwn4sq0.js → skill-generator-z01sjppf.js} +9 -9
  58. package/dist/cli/{telemetry-jm7t8031.js → telemetry-jny76r83.js} +1 -1
  59. package/dist/cli/workspace-snapshot-eyf6gd0d.js +22 -0
  60. package/dist/commands/registry.d.ts +7 -0
  61. package/dist/config/constants.d.ts +1 -1
  62. package/dist/config/skill-mirrors.d.ts +3 -1
  63. package/dist/gate-evidence-classification.d.ts +5 -0
  64. package/dist/gate-evidence.d.ts +14 -3
  65. package/dist/hooks/messages-transform.d.ts +22 -1
  66. package/dist/hooks/spawn-helper.d.ts +10 -0
  67. package/dist/index.js +302 -300
  68. package/dist/memory/schema.d.ts +4 -4
  69. package/dist/sandbox/capability-probe.d.ts +14 -0
  70. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +5 -0
  71. package/dist/tools/phase-complete.d.ts +8 -0
  72. package/dist/tools/sast-scan.d.ts +2 -0
  73. package/dist/tools/tool-metadata.d.ts +1 -1
  74. package/dist/utils/path-security.d.ts +28 -0
  75. package/package.json +2 -1
  76. package/dist/cli/curator-llm-factory-nmhzc774.js +0 -40
  77. package/dist/cli/guardrail-explain-q1np1xaw.js +0 -41
  78. package/dist/cli/hive-promoter-z4dezw62.js +0 -48
@@ -86,7 +86,7 @@ import {
86
86
  resolveGeneratedAgentRole,
87
87
  resolveGuardrailsConfig,
88
88
  stripKnownSwarmPrefix
89
- } from "./index-1ey3dxq7.js";
89
+ } from "./index-147ja18h.js";
90
90
  import"./index-bfwt3abw.js";
91
91
  import"./index-p0arc26j.js";
92
92
  import"./index-293f68mj.js";
@@ -6,9 +6,9 @@ import {
6
6
  readScopeFromDisk,
7
7
  resolveScopeWithFallbacks,
8
8
  writeScopeToDisk
9
- } from "./index-g55nzpwn.js";
9
+ } from "./index-n6fa2hhk.js";
10
10
  import"./index-vvk2g744.js";
11
- import"./index-h91bv3hy.js";
11
+ import"./index-qe3v54nb.js";
12
12
  import"./index-a76rekgs.js";
13
13
  export {
14
14
  writeScopeToDisk,
@@ -33,19 +33,19 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-h389ed8y.js";
37
- import"./index-30ejh1tx.js";
38
- import"./index-hpp2r0sd.js";
39
- import"./index-32bx4kch.js";
36
+ } from "./index-mr4whary.js";
37
+ import"./index-43khae15.js";
38
+ import"./index-qzqx2qky.js";
39
+ import"./index-0q7rrh59.js";
40
40
  import"./index-bfwt3abw.js";
41
- import"./index-db1fh1fv.js";
41
+ import"./index-g40r5d08.js";
42
42
  import"./index-jtqkh8jf.js";
43
43
  import"./index-zgwm4ryv.js";
44
- import"./index-0dab9w37.js";
45
- import"./index-5mkc2f9z.js";
46
- import"./index-vn263hqt.js";
44
+ import"./index-0p660a87.js";
45
+ import"./index-4sckv7y6.js";
46
+ import"./index-pa6t33pt.js";
47
47
  import"./index-vvk2g744.js";
48
- import"./index-h91bv3hy.js";
48
+ import"./index-qe3v54nb.js";
49
49
  import"./index-a76rekgs.js";
50
50
  export {
51
51
  writeEvalStub,
@@ -8,7 +8,7 @@ import {
8
8
  resetTelemetryForTesting,
9
9
  rotateTelemetryIfNeeded,
10
10
  telemetry
11
- } from "./index-vn263hqt.js";
11
+ } from "./index-pa6t33pt.js";
12
12
  import"./index-a76rekgs.js";
13
13
  export {
14
14
  telemetry,
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import {
3
+ _internals,
4
+ captureWorkspaceSnapshot,
5
+ changedFilesSinceSnapshot,
6
+ compareWorkspaceSnapshot,
7
+ compareWorkspaceSnapshots,
8
+ digest,
9
+ parsePorcelainPaths,
10
+ workspaceSnapshotMatches
11
+ } from "./index-dqh3zhhc.js";
12
+ import"./index-a76rekgs.js";
13
+ export {
14
+ workspaceSnapshotMatches,
15
+ parsePorcelainPaths,
16
+ digest,
17
+ compareWorkspaceSnapshots,
18
+ compareWorkspaceSnapshot,
19
+ changedFilesSinceSnapshot,
20
+ captureWorkspaceSnapshot,
21
+ _internals
22
+ };
@@ -176,6 +176,13 @@ export declare const COMMAND_REGISTRY: {
176
176
  readonly toolPolicy: "agent";
177
177
  readonly toolNoArgs: false;
178
178
  };
179
+ readonly 'guardrail-explain': {
180
+ readonly handler: (ctx: CommandContext) => Promise<string>;
181
+ readonly description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)";
182
+ readonly category: "diagnostics";
183
+ readonly aliasOf: "guardrail explain";
184
+ readonly deprecated: true;
185
+ };
179
186
  readonly 'guardrail-log': {
180
187
  readonly handler: (ctx: CommandContext) => Promise<string>;
181
188
  readonly description: "Read the guardrail decision log (use --blocks-only for blocks)";
@@ -27,7 +27,7 @@ export declare const SKILL_AGENT_TOOL_MAP: Partial<Record<AgentName, ToolName[]>
27
27
  * NOTE: bash/shell tools are intentionally excluded — bash commands are opaque
28
28
  * to static scope analysis. Post-hoc detection via guardrails diff-scope provides secondary coverage.
29
29
  */
30
- export declare const WRITE_TOOL_NAMES: readonly ["write", "edit", "patch", "apply_patch", "swarm_apply_patch", "create_file", "insert", "replace", "append", "prepend"];
30
+ export declare const WRITE_TOOL_NAMES: readonly ["write", "edit", "patch", "apply_patch", "swarm_apply_patch", "create_file", "insert", "replace", "append", "prepend", "extract_code_blocks"];
31
31
  export type WriteToolName = (typeof WRITE_TOOL_NAMES)[number];
32
32
  export declare const DEFAULT_MODELS: Record<string, string>;
33
33
  export declare const DEFAULT_AGENT_CONFIGS: Record<string, {
@@ -68,7 +68,8 @@ export declare const OPENCODE_ONLY_ARCHITECT_MODE_SKILLS: Array<{
68
68
  * `kind`:
69
69
  * - `identical`: `.opencode` and `.claude` SKILL.md must be byte-identical.
70
70
  * `canonical` records which side wins when they drift (fix direction only;
71
- * detection is symmetric).
71
+ * detection is symmetric). `extraIdenticalPaths` narrowly extends the same
72
+ * byte-identity contract to additional runtime mirrors when present.
72
73
  * - `divergent`: both must exist; content intentionally differs per runtime.
73
74
  * - `opencode-only`: `.opencode` exists; no `.claude` mirror expected.
74
75
  */
@@ -76,6 +77,7 @@ export declare const ADDITIONAL_SKILL_MIRROR_CONTRACTS: Array<{
76
77
  slug: string;
77
78
  kind: 'identical' | 'divergent' | 'opencode-only';
78
79
  canonical?: '.claude' | '.opencode';
80
+ extraIdenticalPaths?: string[];
79
81
  reason: string;
80
82
  }>;
81
83
  /**
@@ -0,0 +1,5 @@
1
+ export declare function isExactMarkdownPath(value: unknown): boolean;
2
+ /** Cheap pre-classification used to avoid Git snapshots for ineligible tasks. */
3
+ export declare function isMarkdownOnlyDeclaredScope(value: unknown): value is string[];
4
+ /** Require independent non-empty declared and observed exact-.md proof. */
5
+ export declare function isMarkdownOnlyTaskChange(declaredFiles: unknown, observedFiles: unknown): boolean;
@@ -9,6 +9,11 @@
9
9
  * Evidence files survive session restarts (unlike in-memory state).
10
10
  * Agents never write these files directly — only the hook does.
11
11
  * Gates are append-only: required_gates can only grow, never shrink.
12
+ *
13
+ * Threat boundary: this store provides atomic, path-contained durability and
14
+ * auditability for cooperative same-user agents. It is not tamper-proof
15
+ * authorization against a process with arbitrary same-user workspace access;
16
+ * that requires a protected trust root outside the project workspace.
12
17
  */
13
18
  export interface GateEvidence {
14
19
  sessionId: string;
@@ -20,8 +25,14 @@ export interface TaskEvidence {
20
25
  required_gates: string[];
21
26
  gates: Record<string, GateEvidence>;
22
27
  turbo?: boolean;
28
+ /** Durable proof that the coder dispatch was classified as exact Markdown-only. */
29
+ test_engineer_exempt?: boolean;
23
30
  }
24
31
  export declare const DEFAULT_REQUIRED_GATES: string[];
32
+ export interface GateDerivationContext {
33
+ /** Trusted pre/post workspace classification; false/absent fails closed. */
34
+ testEngineerExempt?: boolean;
35
+ }
25
36
  /**
26
37
  * Canonical task-id validation helper.
27
38
  * Delegates to the shared strict validator (#452 item 2).
@@ -32,12 +43,12 @@ export declare function isValidTaskId(taskId: string): boolean;
32
43
  * Maps the first-dispatched agent type to the initial required_gates array.
33
44
  * Unknown agent types fall back to the safe default ["reviewer", "test_engineer"].
34
45
  */
35
- export declare function deriveRequiredGates(agentType: string): string[];
46
+ export declare function deriveRequiredGates(agentType: string, context?: GateDerivationContext): string[];
36
47
  /**
37
48
  * Returns the union of existingGates and deriveRequiredGates(newAgentType).
38
49
  * Sorted, deduplicated. Gates can only grow, never shrink.
39
50
  */
40
- export declare function expandRequiredGates(existingGates: string[], newAgentType: string): string[];
51
+ export declare function expandRequiredGates(existingGates: string[], newAgentType: string, context?: GateDerivationContext): string[];
41
52
  /**
42
53
  * Creates or updates .swarm/evidence/{taskId}.json with a gate pass entry.
43
54
  * If file doesn't exist: creates with required_gates from deriveRequiredGates(gate).
@@ -50,7 +61,7 @@ export declare function recordGateEvidence(directory: string, taskId: string, ga
50
61
  * Used when non-gate agents are dispatched (coder, explorer, sme, etc.).
51
62
  * Creates evidence file if it doesn't exist yet.
52
63
  */
53
- export declare function recordAgentDispatch(directory: string, taskId: string, agentType: string, turbo?: boolean): Promise<void>;
64
+ export declare function recordAgentDispatch(directory: string, taskId: string, agentType: string, turbo?: boolean, context?: GateDerivationContext): Promise<void>;
54
65
  /**
55
66
  * Returns the TaskEvidence for a task, or null if file missing or parse error.
56
67
  * Never throws.
@@ -3,11 +3,32 @@
3
3
  *
4
4
  * Note: Merged content order matches original insertion order (OpenCode base prompt
5
5
  * first, then swarm agent prompt) - this assumes sequential message construction.
6
+ *
7
+ * Dual-shape (issue #1778 H1): the OpenCode `messages.transform` hook delivers
8
+ * items shaped `{ info: { role, ... }, parts: [{ type: 'text', text }] }`, while
9
+ * unit fixtures and some callers use the flat `{ role, content }` shape. Both
10
+ * must be handled — reading role from `info.role` OR top-level `role`, and text
11
+ * from `parts[].text` OR `content` — or the consolidation (and the invariant-10
12
+ * safety-net that strips system messages at index > 0 for local models) becomes
13
+ * a silent no-op on production data.
6
14
  */
7
- type Message = {
15
+ type FlatMessage = {
8
16
  role: string;
9
17
  content: unknown;
10
18
  [key: string]: unknown;
11
19
  };
20
+ type PartsMessage = {
21
+ info: {
22
+ role: string;
23
+ [key: string]: unknown;
24
+ };
25
+ parts: Array<{
26
+ type?: string;
27
+ text?: string;
28
+ [key: string]: unknown;
29
+ }>;
30
+ [key: string]: unknown;
31
+ };
32
+ export type Message = FlatMessage | PartsMessage;
12
33
  export declare function consolidateSystemMessages(messages: Message[]): Message[];
13
34
  export {};
@@ -1,3 +1,13 @@
1
+ import * as child_process from 'node:child_process';
2
+ /**
3
+ * DI seam (AGENTS.md invariant #7 — prefer `_internals` over `mock.module`).
4
+ * Tests inject a spawn spy here to assert the win32 `.cmd` transformation of
5
+ * the resolved command name without depending on `npm.cmd` actually existing
6
+ * on the (POSIX) test runner. Restore in `afterEach`.
7
+ */
8
+ export declare const _internals: {
9
+ spawn: typeof child_process.spawn;
10
+ };
1
11
  export declare function spawnAsync(command: string[], cwd: string, timeoutMs: number): Promise<{
2
12
  exitCode: number;
3
13
  stdout: string;