opencode-ascii 0.1.5 → 0.1.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.
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -13
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,11 @@ export type AsciiPluginOptions = SubstitutionConfig;
|
|
|
19
19
|
*
|
|
20
20
|
* Covered hooks:
|
|
21
21
|
* - `experimental.text.complete` : rewrites completed AI text parts
|
|
22
|
-
* - `tool.execute.before` : rewrites `write`, `edit`,
|
|
22
|
+
* - `tool.execute.before` : rewrites `write`, `edit`, and `apply_patch` tool arguments
|
|
23
23
|
*/
|
|
24
24
|
export declare const AsciiPlugin: Plugin;
|
|
25
|
-
|
|
25
|
+
declare const _default: {
|
|
26
|
+
id: string;
|
|
27
|
+
server: Plugin;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ function resolveConfig(options) {
|
|
|
19
19
|
*
|
|
20
20
|
* Covered hooks:
|
|
21
21
|
* - `experimental.text.complete` : rewrites completed AI text parts
|
|
22
|
-
* - `tool.execute.before` : rewrites `write`, `edit`,
|
|
22
|
+
* - `tool.execute.before` : rewrites `write`, `edit`, and `apply_patch` tool arguments
|
|
23
23
|
*/
|
|
24
24
|
export const AsciiPlugin = async (_ctx, options) => {
|
|
25
25
|
const config = resolveConfig(options);
|
|
@@ -55,7 +55,6 @@ export const AsciiPlugin = async (_ctx, options) => {
|
|
|
55
55
|
* Tools handled:
|
|
56
56
|
* - `write` : `args.content`
|
|
57
57
|
* - `edit` : `args.newString` (NOT `oldString` -- it must match existing file content)
|
|
58
|
-
* - `multiedit` : each `args.edits[].newString`
|
|
59
58
|
* - `apply_patch` : `args.patchText` (unified diff content)
|
|
60
59
|
*/
|
|
61
60
|
"tool.execute.before": async (input, output) => {
|
|
@@ -72,16 +71,6 @@ export const AsciiPlugin = async (_ctx, options) => {
|
|
|
72
71
|
}
|
|
73
72
|
break;
|
|
74
73
|
}
|
|
75
|
-
case "multiedit": {
|
|
76
|
-
if (Array.isArray(output.args?.edits)) {
|
|
77
|
-
for (const edit of output.args.edits) {
|
|
78
|
-
if (typeof edit?.newString === "string") {
|
|
79
|
-
edit.newString = substitute(edit.newString);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
74
|
case "apply_patch": {
|
|
86
75
|
if (typeof output.args?.patchText === "string") {
|
|
87
76
|
output.args.patchText = substitute(output.args.patchText);
|
|
@@ -92,4 +81,7 @@ export const AsciiPlugin = async (_ctx, options) => {
|
|
|
92
81
|
},
|
|
93
82
|
};
|
|
94
83
|
};
|
|
95
|
-
export default
|
|
84
|
+
export default {
|
|
85
|
+
id: "opencode-ascii",
|
|
86
|
+
server: AsciiPlugin,
|
|
87
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-ascii",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "OpenCode plugin that substitutes unicode characters with ASCII equivalents in AI responses and file edits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"./server": "./dist/index.js"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"dist"
|