opencode-ascii 0.1.4 → 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/README.md CHANGED
@@ -53,7 +53,7 @@ All four substitution categories are **enabled by default**. Disable any categor
53
53
 
54
54
  | Unicode | Character | ASCII |
55
55
  |---------|-----------|-------|
56
- | U+2014 | — | `--` |
56
+ | U+2014 | — | `-` |
57
57
  | U+2013 | – | `-` |
58
58
  | U+2026 | … | `...` |
59
59
  | U+201C | " | `"` |
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`, `multiedit`, and `apply_patch` tool arguments
22
+ * - `tool.execute.before` : rewrites `write`, `edit`, and `apply_patch` tool arguments
23
23
  */
24
24
  export declare const AsciiPlugin: Plugin;
25
- export default AsciiPlugin;
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`, `multiedit`, and `apply_patch` tool arguments
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 AsciiPlugin;
84
+ export default {
85
+ id: "opencode-ascii",
86
+ server: AsciiPlugin,
87
+ };
@@ -4,10 +4,10 @@
4
4
  */
5
5
  export const PUNCTUATION = [
6
6
  // Dashes
7
- ["\u2014", "--"], // em dash (—)
7
+ ["\u2014", "-"], // em dash (—)
8
8
  ["\u2013", "-"], // en dash (–)
9
9
  ["\u2012", "-"], // figure dash (‒)
10
- ["\u2015", "--"], // horizontal bar (―)
10
+ ["\u2015", "-"], // horizontal bar (―)
11
11
  // Ellipsis
12
12
  ["\u2026", "..."], // horizontal ellipsis (…)
13
13
  // Curly / smart quotes — double
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-ascii",
3
- "version": "0.1.4",
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"