opencode-swarm 7.49.1 → 7.50.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.
- package/README.md +1 -1
- package/dist/cli/index.js +30 -9
- package/dist/hooks/scope-guard.d.ts +24 -0
- package/dist/index.js +1315 -440
- package/dist/tools/apply-patch.d.ts +48 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* apply-patch — Native Swarm tool for applying unified diffs in-process.
|
|
3
|
+
* Parses standard unified diff format, validates paths against workspace
|
|
4
|
+
* boundaries, matches hunk context exactly, and writes atomically.
|
|
5
|
+
*
|
|
6
|
+
* FR-001 through FR-014, SR-002 through SR-005.
|
|
7
|
+
* Pure TypeScript, no shell/git/external binaries, standard node:fs sync I/O.
|
|
8
|
+
*/
|
|
9
|
+
import type { ToolDefinition } from '@opencode-ai/plugin/tool';
|
|
10
|
+
/** Per-file error detail in the structured output. */
|
|
11
|
+
export interface ApplyPatchFileError {
|
|
12
|
+
hunkIndex: number;
|
|
13
|
+
type: 'context-mismatch' | 'file-not-found' | 'file-unchanged' | 'create-not-allowed' | 'delete-not-allowed' | 'binary-rejected' | 'rename-rejected';
|
|
14
|
+
message: string;
|
|
15
|
+
expected?: string;
|
|
16
|
+
actual?: string;
|
|
17
|
+
line?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Per-file result in the structured output. */
|
|
20
|
+
export interface ApplyPatchFileResult {
|
|
21
|
+
file: string;
|
|
22
|
+
status: 'applied' | 'no-changes' | 'created' | 'error';
|
|
23
|
+
hunks: number;
|
|
24
|
+
hunksApplied: number;
|
|
25
|
+
hunksFailed: number;
|
|
26
|
+
errors?: ApplyPatchFileError[];
|
|
27
|
+
}
|
|
28
|
+
/** Structured JSON result returned by the tool. */
|
|
29
|
+
export interface ApplyPatchResult {
|
|
30
|
+
success: boolean;
|
|
31
|
+
dryRun?: boolean;
|
|
32
|
+
files: ApplyPatchFileResult[];
|
|
33
|
+
summary: {
|
|
34
|
+
totalFiles: number;
|
|
35
|
+
applied: number;
|
|
36
|
+
failed: number;
|
|
37
|
+
totalHunks: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Arguments accepted by the apply_patch tool. */
|
|
41
|
+
export interface ApplyPatchArgs {
|
|
42
|
+
patch: string;
|
|
43
|
+
files: string[];
|
|
44
|
+
dryRun?: boolean;
|
|
45
|
+
allowCreates?: boolean;
|
|
46
|
+
allowDeletes?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare const applyPatch: ToolDefinition;
|
package/dist/tools/index.d.ts
CHANGED
package/dist/tools/manifest.d.ts
CHANGED
|
@@ -355,6 +355,10 @@ export declare const TOOL_METADATA: {
|
|
|
355
355
|
description: string;
|
|
356
356
|
agents: "architect"[];
|
|
357
357
|
};
|
|
358
|
+
apply_patch: {
|
|
359
|
+
description: string;
|
|
360
|
+
agents: "coder"[];
|
|
361
|
+
};
|
|
358
362
|
};
|
|
359
363
|
/** Union type of all valid tool names (the metadata keys). */
|
|
360
364
|
export type ToolName = keyof typeof TOOL_METADATA;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.50.1",
|
|
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",
|