opencode-swarm 7.200.4 → 7.200.6

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 (76) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/cli/{attest-task-dch4wwmn.js → attest-task-10qxnfg0.js} +26 -26
  4. package/dist/cli/{auto-checkpoint-7ef4x67m.js → auto-checkpoint-n4wjv3c3.js} +4 -4
  5. package/dist/cli/{checkpoint-3a7rgjs9.js → checkpoint-hce4bjpa.js} +9 -9
  6. package/dist/cli/{coder-settlement-5mgxjwz9.js → coder-settlement-wzccs5q0.js} +4 -4
  7. package/dist/cli/{config-doctor-pes681a5.js → config-doctor-zmrk4e62.js} +7 -7
  8. package/dist/cli/{core-fxxnawnv.js → core-91vc3hm8.js} +1 -1
  9. package/dist/cli/{curator-drift-jtqr5rwe.js → curator-drift-jnnfryzt.js} +5 -5
  10. package/dist/cli/{curator-llm-factory-fp9gzt41.js → curator-llm-factory-mj9nwpqy.js} +26 -26
  11. package/dist/cli/{curator-tncdqrcf.js → curator-mx34qmvj.js} +26 -26
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-6wan4z5n.js → doctor-knowledge-receipt-phase-id-wsv9av6b.js} +5 -4
  13. package/dist/cli/{evidence-summary-service-cnvgae1a.js → evidence-summary-service-t8jxvzse.js} +10 -10
  14. package/dist/cli/{gate-evidence-hmdnb430.js → gate-evidence-13evayfx.js} +2 -2
  15. package/dist/cli/{guardrail-explain-7g0y6ahb.js → guardrail-explain-w69nx4h3.js} +27 -27
  16. package/dist/cli/{guardrail-log-wpm6srkg.js → guardrail-log-em42cpeg.js} +4 -4
  17. package/dist/cli/{guardrail-reset-henzpvh4.js → guardrail-reset-1z11c474.js} +26 -26
  18. package/dist/cli/{hive-promoter-zr4xnyxn.js → hive-promoter-et6yf4e4.js} +26 -26
  19. package/dist/cli/{index-fz5qbpbw.js → index-1j9g90y9.js} +1 -1
  20. package/dist/cli/{index-66c8xae5.js → index-50h4hrhe.js} +2171 -1904
  21. package/dist/cli/{index-q8456mrf.js → index-6cgh59z6.js} +3 -3
  22. package/dist/cli/{index-fs6t820n.js → index-9ww8f1e9.js} +3 -3
  23. package/dist/cli/{index-5fm37ceh.js → index-bkdkkxxe.js} +1 -1
  24. package/dist/cli/{index-5y245xwk.js → index-cbhkyfmm.js} +2 -2
  25. package/dist/cli/{index-1qc3fhnv.js → index-e5b0ayxw.js} +3 -3
  26. package/dist/cli/{index-08h39kf4.js → index-ehcp9r1f.js} +1 -1
  27. package/dist/cli/{index-hmndq4hk.js → index-fjh70sfg.js} +5 -5
  28. package/dist/cli/{index-2xdsmkev.js → index-gjzfy7zw.js} +1 -1
  29. package/dist/cli/{index-8jbvmffw.js → index-h21p9f69.js} +1 -1
  30. package/dist/cli/{index-gs4gnndf.js → index-he1xpa9h.js} +3 -3
  31. package/dist/cli/{index-0swbpe4d.js → index-hfzyp68b.js} +28 -28
  32. package/dist/cli/{index-ddf3f3k8.js → index-j2736j97.js} +6 -6
  33. package/dist/cli/{index-2s3wgvj8.js → index-k3nhzhkz.js} +3 -3
  34. package/dist/cli/{index-qgzg1vac.js → index-kdp4rk4p.js} +1 -1
  35. package/dist/cli/{index-70ctksz3.js → index-n2vx9eb0.js} +3 -3
  36. package/dist/cli/{index-zystaewy.js → index-n61daqkj.js} +38 -4
  37. package/dist/cli/{index-43djb5h6.js → index-qxse4xm5.js} +1 -1
  38. package/dist/cli/{index-yp5p6kpf.js → index-r9x74612.js} +2 -2
  39. package/dist/cli/{index-zbxahqb0.js → index-tw0bn65v.js} +1 -1
  40. package/dist/cli/{index-ss8wnczy.js → index-w747vv23.js} +4 -4
  41. package/dist/cli/{index-3vwfpqaj.js → index-wxh0624z.js} +1 -1
  42. package/dist/cli/{index-snft68y9.js → index-yd8k2081.js} +26 -26
  43. package/dist/cli/{index-xd5jn7nr.js → index-ykwya5ff.js} +2 -2
  44. package/dist/cli/{index-5dkwdfh9.js → index-yy7hq6c5.js} +8 -5
  45. package/dist/cli/{index-vqzsp93p.js → index-z4qhqws0.js} +3 -3
  46. package/dist/cli/{index-52arsav6.js → index-zfzgt2hj.js} +4 -4
  47. package/dist/cli/{index-6rxm153v.js → index-zq1gna9j.js} +1 -1
  48. package/dist/cli/{index-81b69x1b.js → index-zv45anwx.js} +1 -1
  49. package/dist/cli/index.js +27 -27
  50. package/dist/cli/{knowledge-escalator-a9mkynzv.js → knowledge-escalator-6h3bwf6q.js} +8 -7
  51. package/dist/cli/{knowledge-events-r720tzeq.js → knowledge-events-wp1j51h6.js} +6 -5
  52. package/dist/cli/{knowledge-store-4gktt30d.js → knowledge-store-98jhzs3k.js} +1 -1
  53. package/dist/cli/{knowledge-validator-fv4qgn0x.js → knowledge-validator-jttph6bb.js} +2 -2
  54. package/dist/cli/{mcp-tx4qjmr1.js → mcp-3fbk6v7e.js} +1 -1
  55. package/dist/cli/{model-preflight-4pexdgrc.js → model-preflight-vps41qvj.js} +26 -26
  56. package/dist/cli/{pending-delegations-9sbf3na8.js → pending-delegations-f3yj2qxg.js} +2 -2
  57. package/dist/cli/{pr-subscriptions-db26rzak.js → pr-subscriptions-ash398n1.js} +1 -1
  58. package/dist/cli/{pr-workflow-gate-t8kewb9h.js → pr-workflow-gate-6za22msz.js} +26 -26
  59. package/dist/cli/{scan-cursor-53s9zt38.js → scan-cursor-15x71ymh.js} +2 -2
  60. package/dist/cli/{schema-eaq24w9q.js → schema-69za4986.js} +1 -1
  61. package/dist/cli/{scope-persistence-erxj8vq6.js → scope-persistence-6qnvpm85.js} +6 -6
  62. package/dist/cli/{server-95fz00er.js → server-cdpsjzsp.js} +26 -26
  63. package/dist/cli/{skill-generator-kt8j40ev.js → skill-generator-q77jzyw0.js} +9 -8
  64. package/dist/cli/{snapshot-coordination-init-b08vm3ye.js → snapshot-coordination-init-gz9ak1be.js} +26 -26
  65. package/dist/cli/{speckit-checkoff-3g3bfv0y.js → speckit-checkoff-59xs6f5t.js} +3 -3
  66. package/dist/cli/{worktree-collision-ownership-sf7vbj8n.js → worktree-collision-ownership-8zm5z35p.js} +2 -2
  67. package/dist/cli/{worktree-isolation-5eh9bgcm.js → worktree-isolation-f7khy039.js} +26 -26
  68. package/dist/hooks/guardrails/tool-before.d.ts +36 -5
  69. package/dist/hooks/knowledge-receipt-ledger.d.ts +19 -4
  70. package/dist/hooks/phase-complete-directive-gate.d.ts +13 -1
  71. package/dist/hooks/shell-executor-context.d.ts +17 -0
  72. package/dist/hooks/shell-write-detect.d.ts +38 -0
  73. package/dist/host/v2/hooks.d.ts +20 -0
  74. package/dist/host/v2/types.d.ts +27 -0
  75. package/dist/index.js +67 -67
  76. package/package.json +1 -1
@@ -173,6 +173,24 @@ export type ReceiptUnavailable = {
173
173
  export type ReceiptLedgerResult<T> = ({
174
174
  ok: true;
175
175
  } & T) | ReceiptUnavailable;
176
+ /**
177
+ * #2965: permanent identity-conflict codes for the empty-trace immutability
178
+ * rule. The conflict itself stays legitimate — only its category changes: a
179
+ * deterministic policy rejection must never ride the retry-inviting
180
+ * `store_unavailable` store channel (AGENTS.md invariant 9).
181
+ */
182
+ export type ReceiptEmptyTraceConflictCode = 'wrong_task' | 'wrong_phase' | 'duplicate_conflicting_terminal';
183
+ /** #2965: typed rejection for a conflicting `'none'`-sentinel re-file. */
184
+ export type ReceiptEmptyTraceConflict = {
185
+ ok: false;
186
+ code: ReceiptEmptyTraceConflictCode;
187
+ detail: string;
188
+ };
189
+ export type CommitEmptyRetrievalResult = {
190
+ ok: true;
191
+ event_id: string;
192
+ terminal_event_id: string;
193
+ } | ReceiptEmptyTraceConflict | ReceiptUnavailable;
176
194
  declare function writeSnapshot(paths: ReceiptLedgerPaths, state: LedgerState): Promise<void>;
177
195
  export interface RepairKnowledgeReceiptLedgerInput {
178
196
  phase: string;
@@ -219,10 +237,7 @@ export declare function commitDisplayedMembership(directory: string, input: Comm
219
237
  event_id: string;
220
238
  memberships: ReceiptMembership[];
221
239
  }>>;
222
- export declare function commitEmptyRetrieval(directory: string, input: Omit<CommitDisplayedMembershipInput, 'entries'>): Promise<ReceiptLedgerResult<{
223
- event_id: string;
224
- terminal_event_id: string;
225
- }>>;
240
+ export declare function commitEmptyRetrieval(directory: string, input: Omit<CommitDisplayedMembershipInput, 'entries'>): Promise<CommitEmptyRetrievalResult>;
226
241
  export interface TerminalBatchInput {
227
242
  trace_id: string;
228
243
  session_id: string;
@@ -16,8 +16,9 @@
16
16
  * `override` event with a written justification). Fail-CLOSED: any read error
17
17
  * surfaces as a block, never a silent pass.
18
18
  */
19
+ import { type ReceiptUnavailable } from './knowledge-receipt-ledger.js';
19
20
  export type DirectiveBlockReason = 'no_verdict' | 'unremediated_violation';
20
- export type DirectiveGateFailureCode = 'RECEIPT_MISSING' | 'RECEIPT_CORRUPT' | 'RECEIPT_LOCK_TIMEOUT' | 'RECEIPT_WRONG_ROOT' | 'RECEIPT_PERMISSION' | 'RECEIPT_TRANSIENT' | 'RECEIPT_STORE_UNAVAILABLE';
21
+ export type DirectiveGateFailureCode = 'RECEIPT_MISSING' | 'RECEIPT_CORRUPT' | 'RECEIPT_LOCK_TIMEOUT' | 'RECEIPT_WRONG_ROOT' | 'RECEIPT_PERMISSION' | 'RECEIPT_TRANSIENT' | 'RECEIPT_CONFLICT' | 'RECEIPT_STORE_UNAVAILABLE';
21
22
  export interface DirectiveGateResult {
22
23
  blocked: boolean;
23
24
  unresolved: Array<{
@@ -52,6 +53,7 @@ export interface DirectiveGateResult {
52
53
  action: 'knowledge_receipt' | 'phase_complete' | 'repair_knowledge_receipt_ledger';
53
54
  };
54
55
  }
56
+ declare function classifyDirectiveGateFailure(error: unknown | ReceiptUnavailable): Pick<DirectiveGateResult, 'failure' | 'recovery'>;
55
57
  /**
56
58
  * Evaluate all critical directives shown during the phase. Fail-closed.
57
59
  *
@@ -83,3 +85,13 @@ export declare function evaluatePhaseCriticalDirectives(params: {
83
85
  export declare function recordDirectiveOverrides(directory: string, ids: string[], justification: string, sessionId: string | undefined, phaseLabel?: string, phaseId?: number): Promise<void>;
84
86
  /** Build a structured, human-readable block message for unresolved criticals. */
85
87
  export declare function formatDirectiveBlockMessage(unresolved: DirectiveGateResult['unresolved']): string;
88
+ /**
89
+ * #2965: dependency-injection seam for the failure classifier. Tests drive
90
+ * `classifyDirectiveGateFailure` through this seam (per the repo's
91
+ * `_internals` convention); these are synthetic classifier tests, not
92
+ * end-to-end gate evidence.
93
+ */
94
+ export declare const _internals: {
95
+ classifyDirectiveGateFailure: typeof classifyDirectiveGateFailure;
96
+ };
97
+ export {};
@@ -41,3 +41,20 @@ export declare const CMD_BUILTIN_PREFIX: RegExp;
41
41
  export declare const CMD_STRIP_PREFIX: RegExp;
42
42
  /** Strip pattern for a powershell/pwsh -Command/-c wrapper with switches. */
43
43
  export declare const PS_STRIP_PREFIX: RegExp;
44
+ /** Record the host-reported shell for the `shell` tool (latest wins). */
45
+ export declare function recordObservedHostShell(shell: string): void;
46
+ /** The host-reported shell for the `shell` tool, when one has been observed. */
47
+ export declare function getObservedHostShell(): string | undefined;
48
+ /** Test seam: clear the observed host shell. */
49
+ export declare function resetObservedHostShell(): void;
50
+ /**
51
+ * Classify a host-reported shell path into the grammar family the write
52
+ * detectors should apply for the `shell` tool: a PowerShell-family binary
53
+ * (powershell/pwsh) or cmd.exe keeps a Windows grammar eligible; ANY other
54
+ * basename (bash, zsh, sh, dash, ksh, fish, nu, …) is a POSIX-family
55
+ * executor. Separator-independent basename: the host may report a Windows
56
+ * path while the gate evaluates under an injected POSIX platform (and vice
57
+ * versa), so `path.basename` — which is separator-bound to the host — is
58
+ * never used here (mirrors `basenameAnySep` in shell-write-detect.ts).
59
+ */
60
+ export declare function hostShellGrammarFamily(hostShell: string): 'windows' | 'posix';
@@ -22,6 +22,29 @@ export interface WriteTarget {
22
22
  operator: string;
23
23
  /** The file path written to, or null when the path cannot be determined statically. */
24
24
  path: string | null;
25
+ /**
26
+ * Present ONLY on inspectable POSIX inline-code interpreter evals
27
+ * (`python -c`, `node -e`, `bash -c`, `eval`, … — the detectInterpreterEval
28
+ * sites). Marks a capability write whose target the gate routes through
29
+ * declared scope / file authority at the eval's working directory
30
+ * (#1902/#3347). The opaque interpreter_eval classes (PowerShell
31
+ * -EncodedCommand, nested script blocks, dynamic `&`/IEX invocation,
32
+ * unsafe-text parse failures) deliberately do NOT set it and keep the
33
+ * blanket block.
34
+ */
35
+ capability?: true;
36
+ /**
37
+ * Set only for a bare POSIX `rmdir <dir>`: no options, exactly one literal
38
+ * operand (no expansion, glob, brace or quote characters). rmdir(2) refuses
39
+ * a non-empty directory (ENOTEMPTY), so this form cannot destroy file data.
40
+ * The shell write-scope gate uses it to skip declared-scope membership for
41
+ * a target that resolves inside the workspace; every other check still
42
+ * applies. `rmdir -p` (removes parents) and all other forms never carry it,
43
+ * and neither does any write of a line that runs a command outside
44
+ * CWD_NEUTRAL_COMMANDS or holds a character outside PLAIN_COMMAND_LINE
45
+ * (see detectPosixWrites).
46
+ */
47
+ emptyDirectoryRemoval?: true;
25
48
  }
26
49
  /**
27
50
  * Result of analyzing a single shell command.
@@ -51,6 +74,13 @@ export interface ResolvedWriteTarget {
51
74
  * contains command substitution ($(cmd) or `cmd`).
52
75
  */
53
76
  resolved: boolean;
77
+ /**
78
+ * For capability interpreter-eval writes only: the working directory the
79
+ * eval runs at, tracked through subshell `cd` commands (the starting cwd
80
+ * when none precedes it). The gate authorizes the eval against this
81
+ * directory (#1902/#3347); absent for every other write kind.
82
+ */
83
+ evalDirectory?: string;
54
84
  }
55
85
  /**
56
86
  * Issue #3099 R2 (executor context): merge a POSIX analysis with a Windows
@@ -96,6 +126,14 @@ export declare function isPowerShellShaped(command: string): boolean;
96
126
  * detectors cannot see) fails and the command stays blocked.
97
127
  */
98
128
  export declare function isPowerShellReadOnlyPipeline(command: string): boolean;
129
+ /**
130
+ * Separator-independent basename: splits on BOTH `/` and `\` so a Windows
131
+ * path (`C:\Python311\python.exe`) yields the same leaf under any host
132
+ * platform, then strips a case-insensitive `.exe` suffix. Used by the
133
+ * interpreter-spelling normalizer (#3343) and the host-shell classifier
134
+ * (#3346) — never `path.basename`, which is separator-bound to the host.
135
+ */
136
+ export declare function basenameAnySep(word: string): string;
99
137
  /**
100
138
  * Detect interactive/session tools that should be denied regardless of scope.
101
139
  *
@@ -77,3 +77,23 @@ export declare function registerV2ToolHooks(ctx: V2PluginContext, hooks: V1Hooks
77
77
  * warns, and only a double failure rejects.
78
78
  */
79
79
  export declare function registerV2SessionHooks(ctx: V2PluginContext, hooks: V1HooksSubset, directory: string, registrations: V2Registration[]): Promise<void>;
80
+ /**
81
+ * Register the shell-executor observer hook (#3346).
82
+ *
83
+ * The v2 host reports the shell a `shell`-tool command will actually execute
84
+ * through `ctx.shell` "create.before" (payload carries the resolved `shell`
85
+ * path). Recording it in the observed-host-shell store lets the write gate
86
+ * and `/swarm guardrail explain` key cmd/powershell grammar inheritance on
87
+ * the real executor instead of the platform — closing the Git-Bash-on-Windows
88
+ * false-positive class from #3323/#3346.
89
+ *
90
+ * Contract (mirrors registerV2SessionHooks' bounded registration, with a
91
+ * softer failure mode): a host without the shell domain (pre-2.0.29-era
92
+ * hosts; the vendored member is optional) is a SKIP, not a failure — the
93
+ * gate falls back to the platform-keyed interim, never wider than today. A
94
+ * present-but-REJECTING registration warns through the shared
95
+ * warnV2HookRegistrationFailure path and is likewise non-fatal; a successful
96
+ * registration lands in the disposal sink. Authoritative hook observations
97
+ * only — this module performs no environment probing (plan-critic r2).
98
+ */
99
+ export declare function registerV2ShellHooks(ctx: V2PluginContext, registrations: V2Registration[]): Promise<void>;
@@ -97,6 +97,24 @@ export interface V2ToolEditor {
97
97
  readonly description: string;
98
98
  }): void;
99
99
  }
100
+ /**
101
+ * v2 `ShellCreateBefore` payload (dist/promise/shell.d.ts @2.0.29). The
102
+ * `shell` field is the resolved shell PATH the host will execute the
103
+ * command with (upstream `ShellSelect` resolution) — the authoritative
104
+ * executor report the write gate keys cmd/powershell grammar inheritance
105
+ * on (#3346).
106
+ */
107
+ export interface V2ShellCreateBefore {
108
+ readonly command: string;
109
+ readonly cwd: string;
110
+ readonly timeout: number;
111
+ readonly shell: string;
112
+ readonly env: Record<string, string | undefined>;
113
+ }
114
+ /** v2 `ShellDomain` (dist/promise/shell.d.ts @2.0.29) — hook payloads inline. */
115
+ export interface V2ShellDomain {
116
+ readonly hook: <K extends 'create.before'>(event: K, handler: (payload: V2ShellCreateBefore) => Promise<void> | void) => Promise<unknown> | unknown;
117
+ }
100
118
  /** v2 `ToolDomain` (dist/promise/tool.d.ts) — hook payloads inline. */
101
119
  export interface V2ToolDomain {
102
120
  readonly transform: (callback: (editor: V2ToolEditor) => void) => Promise<V2Registration>;
@@ -522,6 +540,15 @@ export interface V2PluginContext {
522
540
  readonly permission?: V2PermissionDomain;
523
541
  /** Present on 2.0.26 hosts; no Phase 1 code path consumes it (issue #3169). */
524
542
  readonly worktree?: V2WorktreeDomain;
543
+ /**
544
+ * v2 `ShellDomain` (dist/promise/shell.d.ts @2.0.29; the
545
+ * `shell.create.before` hook was added upstream 2026-07-29 and is present
546
+ * across the vendored 2.0.26 pin). OPTIONAL: hosts predating the domain —
547
+ * and the structural-type discipline of this file — treat it as absent.
548
+ * Consumed by `registerV2ShellHooks` (src/host/v2/hooks.ts) to observe
549
+ * the shell the `shell` tool actually executes (#3346).
550
+ */
551
+ readonly shell?: V2ShellDomain;
525
552
  readonly [key: string]: unknown;
526
553
  }
527
554
  /** v2 `Cleanup` — the return of `setup`. */