dsh-patch-edit-plus 0.3.1 → 0.4.0
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/CHANGELOG.md +13 -0
- package/CHANGELOG.zh.md +13 -0
- package/README.de.md +9 -4
- package/README.es.md +9 -4
- package/README.fr.md +9 -4
- package/README.it.md +9 -4
- package/README.ja.md +9 -4
- package/README.ko.md +9 -4
- package/README.md +9 -4
- package/README.ru.md +9 -4
- package/README.zh.md +9 -4
- package/cordis.patch.yml +6 -0
- package/dsh.plugin.json +2 -2
- package/lib/client/index.js +151 -0
- package/lib/client.js +213 -0
- package/lib/client.js.map +1 -0
- package/lib/compat.js +101 -0
- package/lib/config.js +4 -3
- package/lib/fsops.js +23 -4
- package/lib/index.js +32 -4
- package/lib/register.js +2 -0
- package/lib/shellops.js +12 -2
- package/lib/tool.js +12 -3
- package/lib/types/client/index.d.ts +48 -0
- package/lib/types/compat.d.ts +46 -0
- package/lib/types/config.d.ts +6 -4
- package/lib/types/fsops.d.ts +0 -5
- package/lib/types/index.d.ts +2 -0
- package/lib/types/tool.d.ts +4 -2
- package/package.json +34 -10
package/lib/types/config.d.ts
CHANGED
|
@@ -21,8 +21,10 @@ export interface Config {
|
|
|
21
21
|
conflictPolicy?: ConflictPolicy;
|
|
22
22
|
/** Suffix appended on rename avoidance. Defaults to `_1`. */
|
|
23
23
|
renameSuffix?: string;
|
|
24
|
-
/** Accept git/unified diff patches. Defaults to true.
|
|
25
|
-
|
|
24
|
+
/** Accept git/unified diff patches. Defaults to true.
|
|
25
|
+
* 0.1.7 `.volatile()`: the loader hands `apply` a live `Volatile` ref for this
|
|
26
|
+
* field — always read it through `readVolatileBoolean`, never cache the ref. */
|
|
27
|
+
allowUnifiedDiff?: boolean | Volatile<boolean>;
|
|
26
28
|
/** Accept Codex `apply_patch` syntax. Defaults to false.
|
|
27
29
|
* 0.1.7 `.volatile()`: the loader hands `apply` a live `Volatile` ref for this
|
|
28
30
|
* field — always read it through `readVolatileBoolean`, never cache the ref. */
|
|
@@ -52,7 +54,7 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
52
54
|
conflictPolicy: z<"rename" | "skip" | "fail", "rename" | "skip" | "fail", "defined">;
|
|
53
55
|
renameSuffix: z<string, string, "defined">;
|
|
54
56
|
allowUnifiedDiff: z<boolean, boolean, "defined">;
|
|
55
|
-
allowCodexPatch: z<boolean, boolean, "
|
|
57
|
+
allowCodexPatch: z<boolean, boolean, "defined">;
|
|
56
58
|
deleteBackend: z<"shell" | "none", "shell" | "none", "defined">;
|
|
57
59
|
shellDialect: z<"auto" | "posix" | "pwsh", "auto" | "posix" | "pwsh", "defined">;
|
|
58
60
|
deleteCommand: z<string, string, "plain">;
|
|
@@ -67,7 +69,7 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
67
69
|
conflictPolicy: z<"rename" | "skip" | "fail", "rename" | "skip" | "fail", "defined">;
|
|
68
70
|
renameSuffix: z<string, string, "defined">;
|
|
69
71
|
allowUnifiedDiff: z<boolean, boolean, "defined">;
|
|
70
|
-
allowCodexPatch: z<boolean, boolean, "
|
|
72
|
+
allowCodexPatch: z<boolean, boolean, "defined">;
|
|
71
73
|
deleteBackend: z<"shell" | "none", "shell" | "none", "defined">;
|
|
72
74
|
shellDialect: z<"auto" | "posix" | "pwsh", "auto" | "posix" | "pwsh", "defined">;
|
|
73
75
|
deleteCommand: z<string, string, "plain">;
|
package/lib/types/fsops.d.ts
CHANGED
|
@@ -16,11 +16,6 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
16
16
|
import type { ToolRunContext } from '@deepseek-ai/dsh-tools';
|
|
17
17
|
import type { FsInfo, FsTarget, FsWriteOutcome } from '@deepseek-ai/dsh-fs';
|
|
18
18
|
import type { SandboxExecutionPolicy } from '@deepseek-ai/dsh-sandbox';
|
|
19
|
-
/**
|
|
20
|
-
* Write one file through the full intent dance. Must stay byte-for-byte the
|
|
21
|
-
* official sequence — the verification script asserts it.
|
|
22
|
-
* @throws {@link PatchError} code `IO` when the backend rejects the write.
|
|
23
|
-
*/
|
|
24
19
|
export declare function writeFile(ctx: Context, exec: ToolRunContext, target: FsTarget, content: string, sandboxPolicy: SandboxExecutionPolicy | undefined): Promise<FsWriteOutcome>;
|
|
25
20
|
/** Read one file's text (whole file). */
|
|
26
21
|
export declare function readFile(ctx: Context, exec: ToolRunContext, target: FsTarget): Promise<string>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { Context } from '@deepseek-ai/cordis';
|
|
16
16
|
import type { Config as PluginConfig } from './config.js';
|
|
17
|
+
/** 设置命名空间(0.1.5 及以下实例/模块注册面用;0.1.7+ 声明式线不消费)。 */
|
|
18
|
+
export declare const SETTINGS_NAMESPACE = "patch-edit-plus";
|
|
17
19
|
declare module '@deepseek-ai/cordis' {
|
|
18
20
|
interface Events {
|
|
19
21
|
'loader/volatile-update': (paths: string[]) => void;
|
package/lib/types/tool.d.ts
CHANGED
|
@@ -38,9 +38,11 @@ export type ApplyPatchResult = {
|
|
|
38
38
|
diffs: ResultDiff[];
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
|
|
41
|
+
/** Build the (frozen) tool definition. The tool name is passed in resolved
|
|
42
42
|
* form so registration-side rename avoidance can mint variant names.
|
|
43
|
+
* Returns `null` when the host line's dsh-tools lacks `defineTool` — the
|
|
44
|
+
* caller skips registration instead of failing the loader entry.
|
|
43
45
|
*/
|
|
44
|
-
export declare function buildApplyPatchTool(toolName: string, ctx: Context, cfg: ResolvedConfig): ToolDefinition;
|
|
46
|
+
export declare function buildApplyPatchTool(toolName: string, ctx: Context, cfg: ResolvedConfig): ToolDefinition | null;
|
|
45
47
|
/** Model-facing text: grouped added → modified → deleted listing. */
|
|
46
48
|
export declare function formatResultText(value: ApplyPatchResult): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-patch-edit-plus",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Patch-style file editing for DeepSeek Harness: one apply_patch tool accepting git/unified diff (default) and Codex apply_patch syntax (opt-in), with all-or-nothing application, read-before-write intent dance, sandbox-aware delete/move,
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Patch-style file editing for DeepSeek Harness: one apply_patch tool accepting git/unified diff (default) and Codex apply_patch syntax (opt-in), with all-or-nothing application, read-before-write intent dance, sandbox-aware delete/move, (declarative volatile settings).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts",
|
|
15
15
|
"default": "./lib/index.js"
|
|
16
16
|
},
|
|
17
|
+
"./client": {
|
|
18
|
+
"types": "./lib/types/client/index.d.ts",
|
|
19
|
+
"default": "./lib/client.js"
|
|
20
|
+
},
|
|
17
21
|
"./package.json": "./package.json"
|
|
18
22
|
},
|
|
19
23
|
"files": [
|
|
@@ -31,10 +35,16 @@
|
|
|
31
35
|
"dsh": {
|
|
32
36
|
"bundle": {
|
|
33
37
|
"patch": "./cordis.patch.yml"
|
|
38
|
+
},
|
|
39
|
+
"client": {
|
|
40
|
+
"platform": "web",
|
|
41
|
+
"inject": [
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
43
|
+
]
|
|
34
44
|
}
|
|
35
45
|
},
|
|
36
46
|
"scripts": {
|
|
37
|
-
"build": "tsc -p tsconfig.build.json",
|
|
47
|
+
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
38
48
|
"prepublishOnly": "npm run build",
|
|
39
49
|
"typecheck": "tsc -p tsconfig.json",
|
|
40
50
|
"typecheck:0.2.0": "node scripts/typecheck-0.2.0.mjs",
|
|
@@ -47,7 +57,7 @@
|
|
|
47
57
|
},
|
|
48
58
|
"engines": {
|
|
49
59
|
"node": ">=20",
|
|
50
|
-
"dsh": ">=0.
|
|
60
|
+
"dsh": ">=0.1.0-rc.8 <0.2.1-0"
|
|
51
61
|
},
|
|
52
62
|
"license": "MIT",
|
|
53
63
|
"keywords": [
|
|
@@ -62,15 +72,25 @@
|
|
|
62
72
|
],
|
|
63
73
|
"peerDependencies": {
|
|
64
74
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-fs": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-sandbox": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-shell": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
81
|
+
"react": "^18.2.0",
|
|
82
|
+
"@deepseek-ai/dsh-settings": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
|
|
69
83
|
},
|
|
70
84
|
"peerDependenciesMeta": {
|
|
71
85
|
"@deepseek-ai/cordis": {
|
|
72
86
|
"optional": true
|
|
73
87
|
},
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-settings": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
74
94
|
"@deepseek-ai/dsh-fs": {
|
|
75
95
|
"optional": true
|
|
76
96
|
},
|
|
@@ -95,13 +115,17 @@
|
|
|
95
115
|
"@deepseek-ai/dsh-tools": "0.2.0-rc.1",
|
|
96
116
|
"@eslint/js": "^9.0.0",
|
|
97
117
|
"@types/node": "^22.0.0",
|
|
118
|
+
"@types/react": "~18.3.1",
|
|
98
119
|
"eslint": "^9.0.0",
|
|
120
|
+
"react": "^18.2.0",
|
|
121
|
+
"tsdown": "^0.22.2",
|
|
99
122
|
"typescript": "^5.6.0",
|
|
100
123
|
"typescript-eslint": "^8.0.0",
|
|
101
124
|
"vitest": "^3.0.0",
|
|
102
|
-
"@deepseek-ai/schemastery": "^3.18.4"
|
|
125
|
+
"@deepseek-ai/schemastery": "^3.18.4",
|
|
126
|
+
"@deepseek-ai/dsh-settings": "0.2.0-rc.1"
|
|
103
127
|
},
|
|
104
128
|
"publishConfig": {
|
|
105
|
-
"tag": "
|
|
129
|
+
"tag": "latest"
|
|
106
130
|
}
|
|
107
131
|
}
|