@bastiangx/opencode-unmoji 0.1.0 → 0.3.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.
Files changed (76) hide show
  1. package/README.md +24 -5
  2. package/dist/core/emoji-data-generated.d.ts.map +1 -1
  3. package/dist/core/emoji-data-generated.js +7645 -5370
  4. package/dist/core/emoji-data-generated.js.map +1 -1
  5. package/dist/core/emoji-data.d.ts +3 -0
  6. package/dist/core/emoji-data.d.ts.map +1 -1
  7. package/dist/core/emoji-data.js +46 -2
  8. package/dist/core/emoji-data.js.map +1 -1
  9. package/dist/core/processor.d.ts +12 -1
  10. package/dist/core/processor.d.ts.map +1 -1
  11. package/dist/core/processor.js +67 -12
  12. package/dist/core/processor.js.map +1 -1
  13. package/dist/data/emoji-data-gen.d.ts +6 -0
  14. package/dist/data/emoji-data-gen.d.ts.map +1 -0
  15. package/dist/data/emoji-data-gen.js +30638 -0
  16. package/dist/data/emoji-data-gen.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +135 -4
  20. package/dist/index.js.map +1 -1
  21. package/dist/plugin.bundled.js +7949 -5445
  22. package/dist/src/core/config.d.ts +22 -0
  23. package/dist/src/core/config.d.ts.map +1 -0
  24. package/dist/src/core/config.js +82 -0
  25. package/dist/src/core/config.js.map +1 -0
  26. package/dist/src/core/emoji-data.d.ts +11 -0
  27. package/dist/src/core/emoji-data.d.ts.map +1 -0
  28. package/dist/src/core/emoji-data.js +105 -0
  29. package/dist/src/core/emoji-data.js.map +1 -0
  30. package/dist/src/core/processor.d.ts +16 -0
  31. package/dist/src/core/processor.d.ts.map +1 -0
  32. package/dist/src/core/processor.js +115 -0
  33. package/dist/src/core/processor.js.map +1 -0
  34. package/dist/src/index.d.ts +4 -0
  35. package/dist/src/index.d.ts.map +1 -0
  36. package/dist/src/index.js +153 -0
  37. package/dist/src/index.js.map +1 -0
  38. package/dist/src/types/config.d.ts +55 -0
  39. package/dist/src/types/config.d.ts.map +1 -0
  40. package/dist/src/types/config.js +36 -0
  41. package/dist/src/types/config.js.map +1 -0
  42. package/dist/src/types/errors.d.ts +59 -0
  43. package/dist/src/types/errors.d.ts.map +1 -0
  44. package/dist/src/types/errors.js +6 -0
  45. package/dist/src/types/errors.js.map +1 -0
  46. package/dist/src/utils/code-detector.d.ts +17 -0
  47. package/dist/src/utils/code-detector.d.ts.map +1 -0
  48. package/dist/src/utils/code-detector.js +288 -0
  49. package/dist/src/utils/code-detector.js.map +1 -0
  50. package/dist/src/utils/grapheme.d.ts +20 -0
  51. package/dist/src/utils/grapheme.d.ts.map +1 -0
  52. package/dist/src/utils/grapheme.js +82 -0
  53. package/dist/src/utils/grapheme.js.map +1 -0
  54. package/dist/streaming/hooks.d.ts +12 -0
  55. package/dist/streaming/hooks.d.ts.map +1 -0
  56. package/dist/streaming/hooks.js +8 -0
  57. package/dist/streaming/hooks.js.map +1 -0
  58. package/dist/streaming/sanitizer.d.ts +66 -0
  59. package/dist/streaming/sanitizer.d.ts.map +1 -0
  60. package/dist/streaming/sanitizer.js +118 -0
  61. package/dist/streaming/sanitizer.js.map +1 -0
  62. package/dist/streaming/state.d.ts +10 -0
  63. package/dist/streaming/state.d.ts.map +1 -0
  64. package/dist/streaming/state.js +33 -0
  65. package/dist/streaming/state.js.map +1 -0
  66. package/dist/types/config.d.ts +21 -0
  67. package/dist/types/config.d.ts.map +1 -1
  68. package/dist/types/config.js +14 -0
  69. package/dist/types/config.js.map +1 -1
  70. package/dist/utils/code-detector.d.ts.map +1 -1
  71. package/dist/utils/code-detector.js +46 -10
  72. package/dist/utils/code-detector.js.map +1 -1
  73. package/dist/utils/grapheme.d.ts.map +1 -1
  74. package/dist/utils/grapheme.js +20 -2
  75. package/dist/utils/grapheme.js.map +1 -1
  76. package/package.json +19 -6
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <a href="https://codeberg.org/bastiangx/opencode-unmoji">
3
- <img src="https://github.com/user-attachments/assets/420baa83-4349-41ab-b6f1-a8252c43dee1"/>
3
+ <img height="600" src="https://github.com/user-attachments/assets/e1aaf6b4-a646-4708-8002-9dbac7236f95"/>
4
4
  </a>
5
5
  </div>
6
6
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  An [OpenCode](https://opencode.ai) plugin that strips and replace _all_ emojis from agent outputs.
12
12
 
13
- <img src="https://github.com/user-attachments/assets/fe606d89-01b0-4da6-81b7-5014d6aff972"/>
13
+ <img height="600" src="https://github.com/user-attachments/assets/fe606d89-01b0-4da6-81b7-5014d6aff972"/>
14
14
 
15
15
  ## Installation
16
16
 
@@ -35,7 +35,7 @@ UNMOJI automatically removes _all_ _standard_ unicode emojis and glyphs from you
35
35
 
36
36
  Specially useful when you are using models like Claude which seem to _LOVE_ spamming emojis on summaries, README files and documentations.
37
37
 
38
- - ~ 4000 emojis covered.
38
+ - ~ 30,000 emojis covered.
39
39
 
40
40
  > _Thinking_ tokens as output targets are not supported.
41
41
 
@@ -53,7 +53,11 @@ Create and add the `unmoji.json` file to your OpenCode [config path](https://ope
53
53
  "preserveInlineCode": true,
54
54
  "skipQuotes": false,
55
55
  "replacementStyle": "github",
56
- "replacementFormat": "[:name:]"
56
+ "replacementFormat": "[:name:]",
57
+ "processMarkdown": true,
58
+ "markdownExtensions": [".md"],
59
+ "showNotification": true,
60
+ "notificationStyle": "thread"
57
61
  }
58
62
  ```
59
63
 
@@ -66,6 +70,10 @@ Create and add the `unmoji.json` file to your OpenCode [config path](https://ope
66
70
  | `skipQuotes` | `false` | `true`, `false` | Do not process emojis inside quoted text blocks |
67
71
  | `replacementStyle` | `github` | `github`, `slack`, `discord`, `cldr`, `iamcal`, `joypixels` | Shortcode style used when mode is `replace` |
68
72
  | `replacementFormat` | `[:name:]` | `:name:`, `[:name:]`, `{name}` | Template format for shortcode outputs |
73
+ | `processMarkdown` | `true` | `true`, `false` | Process emojis in markdown files written by tools |
74
+ | `markdownExtensions` | `[".md"]` | `.md`, `.mdx`, `.mdc`, `.markdown` (array) | File extensions treated as markdown for tool hooks |
75
+ | `showNotification` | `true` | `true`, `false` | Show notification when emojis are processed |
76
+ | `notificationStyle` | `thread` | `thread`, `thread-verbose`, `toast` | Notification display style |
69
77
 
70
78
  #### `replace` Examples
71
79
 
@@ -103,13 +111,24 @@ Deploy successful 🚀 Bug fixed 🐛
103
111
  Deploy successful [:rocket:] Bug fixed [:bug:]
104
112
  ```
105
113
 
114
+ ### Markdown file processing
115
+
116
+ In addition to stripping/replacing emojis from agent text outputs, UNMOJI can also process markdown content that the agent writes to disk.
117
+
118
+ When `processMarkdown` is `true` (default):
119
+
120
+ - The `write` tool's `content` is processed for files whose `filePath` ends with one of `markdownExtensions`.
121
+ - The `edit` tool's `newString` is processed for matching markdown paths.
122
+
123
+ This ensures generated README.md, documentation, and other markdown files are kept emoji-free (or use text shortcodes) without affecting non-markdown files.
124
+
106
125
  ---
107
126
 
108
127
  ## Contributing
109
128
 
110
129
  Contributions are welcome!
111
130
 
112
- Follow the [Contributing guide](/CONTRIBUTING.md) for instructions.
131
+ Follow the [Contributing guide](./CONTRIBUTING.md) for instructions.
113
132
 
114
133
  ---
115
134
 
@@ -1 +1 @@
1
- {"version":3,"file":"emoji-data-generated.d.ts","sourceRoot":"","sources":["../../src/core/emoji-data-generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,aAuiLpB,CAAC;AAEH,eAAO,MAAM,cAAc,qBAuiLzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,qBAuiL3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,qBAuiL3B,CAAC;AAEH,eAAO,MAAM,mBAAmB,qBAuiL9B,CAAC"}
1
+ {"version":3,"file":"emoji-data-generated.d.ts","sourceRoot":"","sources":["../../src/core/emoji-data-generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,aA8+LpB,CAAC;AAEH,eAAO,MAAM,cAAc,qBA8+LzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,qBA8+L3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,qBA8+L3B,CAAC;AAEH,eAAO,MAAM,mBAAmB,qBA8+L9B,CAAC"}