@hheei/pi-apply-patch 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +8 -2
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/apply-patch/executor.d.ts +15 -0
- package/dist/apply-patch/executor.js +407 -0
- package/dist/apply-patch/fs.d.ts +37 -0
- package/dist/apply-patch/fs.js +186 -0
- package/dist/apply-patch/glyph.d.ts +8 -0
- package/dist/apply-patch/glyph.js +23 -0
- package/dist/apply-patch/index.d.ts +6 -0
- package/dist/apply-patch/index.js +5 -0
- package/dist/apply-patch/jsdiff-matching.d.ts +13 -0
- package/dist/apply-patch/jsdiff-matching.js +613 -0
- package/dist/apply-patch/jsdiff-worker.d.ts +1 -0
- package/dist/apply-patch/jsdiff-worker.js +18 -0
- package/dist/apply-patch/jsdiff.d.ts +9 -0
- package/dist/apply-patch/jsdiff.js +219 -0
- package/dist/apply-patch/outcome.d.ts +84 -0
- package/dist/apply-patch/outcome.js +1 -0
- package/dist/apply-patch/parser.d.ts +85 -0
- package/dist/apply-patch/parser.js +486 -0
- package/dist/apply-patch/paths.d.ts +5 -0
- package/dist/apply-patch/paths.js +23 -0
- package/dist/apply-patch/policy.d.ts +11 -0
- package/dist/apply-patch/policy.js +44 -0
- package/dist/apply-patch/presentation.d.ts +7 -0
- package/dist/apply-patch/presentation.js +127 -0
- package/dist/apply-patch/settings.d.ts +5 -0
- package/dist/apply-patch/settings.js +33 -0
- package/dist/apply-patch/tool.d.ts +18 -0
- package/dist/apply-patch/tool.js +178 -0
- package/dist/apply-patch/view.d.ts +34 -0
- package/dist/apply-patch/view.js +256 -0
- package/dist/apply-patch-tool.d.ts +1 -0
- package/dist/apply-patch-tool.js +1 -0
- package/dist/extension.d.ts +2 -0
- package/dist/extension.js +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +57 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getRuntimeSettingsRegistry, registerExtensionLifecycle, registerSettings, } from "@hheei/pi-ext-core";
|
|
2
|
+
import { createApplyPatchSettingsProvider } from "./apply-patch/settings.js";
|
|
3
|
+
import { isApplyPatchToolDetails, registerApplyPatchTool } from "./apply-patch/tool.js";
|
|
4
|
+
export default function piApplyPatchExtension(pi) {
|
|
5
|
+
registerApplyPatchTool(pi);
|
|
6
|
+
registerExtensionLifecycle(pi, {
|
|
7
|
+
key: "@hheei/pi-apply-patch/settings",
|
|
8
|
+
start({ resources }) {
|
|
9
|
+
resources.add("settings", registerSettings(createApplyPatchSettingsProvider(), getRuntimeSettingsRegistry(pi)));
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
pi.on("tool_result", (event) => {
|
|
13
|
+
if (event.toolName !== "apply_patch" || !isApplyPatchToolDetails(event.details))
|
|
14
|
+
return;
|
|
15
|
+
const details = event.details;
|
|
16
|
+
if (details.status === "failed" ||
|
|
17
|
+
(details.unconfirmed?.length ?? 0) > 0 ||
|
|
18
|
+
(details.notApplied?.length ?? 0) > 0)
|
|
19
|
+
return { isError: true };
|
|
20
|
+
return;
|
|
21
|
+
});
|
|
22
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./extension.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./extension.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@hheei/pi-apply-patch",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "V4A apply_patch editing tool with worker matching and per-path publishing.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"THIRD_PARTY_NOTICES.md"
|
|
16
|
+
],
|
|
17
|
+
"pi": {
|
|
18
|
+
"extensions": [
|
|
19
|
+
"dist/extension.js"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "node -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
|
|
24
|
+
"prepack": "pnpm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"pi",
|
|
28
|
+
"pi-package",
|
|
29
|
+
"pi-extension",
|
|
30
|
+
"hepi",
|
|
31
|
+
"tools"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/hheei/hepi-mono.git",
|
|
37
|
+
"directory": "packages/pi-apply-patch"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@hheei/pi-ext-core": "workspace:^",
|
|
44
|
+
"diff": "^9.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@earendil-works/pi-agent-core": ">=1.3.0",
|
|
48
|
+
"@earendil-works/pi-coding-agent": ">=1.3.0",
|
|
49
|
+
"@earendil-works/pi-tui": ">=1.3.0",
|
|
50
|
+
"typebox": "*"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@earendil-works/pi-agent-core": "1.3.0",
|
|
54
|
+
"@earendil-works/pi-ai": "1.3.0",
|
|
55
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
56
|
+
"@earendil-works/pi-tui": "1.3.0"
|
|
57
|
+
}
|
|
58
|
+
}
|