opencode-gbk-tools 0.1.8 → 0.1.10

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.
@@ -0,0 +1,28 @@
1
+ // src/plugin/text-guidance.ts
2
+ var TEXT_TOOL_SYSTEM_MARKER = "[opencode-gbk-tools:text-rules]";
3
+ var TEXT_TOOL_SYSTEM_PROMPT = [
4
+ TEXT_TOOL_SYSTEM_MARKER,
5
+ "\u6587\u672C\u6587\u4EF6\u5904\u7406\u89C4\u5219\uFF1A",
6
+ "- \u5904\u7406\u6587\u672C\u6587\u4EF6\u65F6\uFF0C\u4F18\u5148\u4F7F\u7528 text_read\u3001text_write\u3001text_edit\u3002",
7
+ "- text_* \u9ED8\u8BA4\u4F1A\u81EA\u52A8\u8BC6\u522B\u73B0\u6709\u6587\u4EF6\u7F16\u7801\uFF0C\u5E76\u5728\u4FEE\u6539\u65F6\u5C3D\u91CF\u4FDD\u6301\u539F\u7F16\u7801\u3001BOM \u548C\u6362\u884C\u98CE\u683C\u3002",
8
+ "- \u82E5\u68C0\u6D4B\u7F6E\u4FE1\u5EA6\u4E0D\u8DB3\u6216\u51FA\u73B0 TEXT_UNKNOWN_ENCODING\uFF0C\u8BF7\u663E\u5F0F\u6307\u5B9A encoding \u540E\u91CD\u8BD5\u3002",
9
+ "- \u5904\u7406\u660E\u786E\u7684 GBK/GB18030 \u6587\u4EF6\u65F6\uFF0C\u4E5F\u53EF\u7EE7\u7EED\u4F7F\u7528 gbk_read\u3001gbk_write\u3001gbk_edit\u3001gbk_search\u3002"
10
+ ].join("\n");
11
+ function appendTextToolSystemPrompt(system) {
12
+ if (system.some((item) => item.includes(TEXT_TOOL_SYSTEM_MARKER))) {
13
+ return;
14
+ }
15
+ system.push(TEXT_TOOL_SYSTEM_PROMPT);
16
+ }
17
+
18
+ // src/local-plugin/opencode-gbk-tools.ts
19
+ var OpencodeGbkToolsLocalPlugin = async () => {
20
+ return {
21
+ async "experimental.chat.system.transform"(_input, output) {
22
+ appendTextToolSystemPrompt(output.system);
23
+ }
24
+ };
25
+ };
26
+ export {
27
+ OpencodeGbkToolsLocalPlugin
28
+ };
@@ -1,30 +1,48 @@
1
1
  {
2
2
  "manifestVersion": 1,
3
3
  "packageName": "opencode-gbk-tools",
4
- "packageVersion": "0.1.8",
4
+ "packageVersion": "0.1.10",
5
5
  "artifacts": [
6
6
  {
7
7
  "relativePath": "tools/gbk_edit.js",
8
8
  "kind": "tool",
9
- "expectedHash": "68d8398eae66592166de62e1bdce35ac51a6c22f27e6b48eca83c62370bc44f5",
9
+ "expectedHash": "50919e356c3f575a5f022c2b61ec5be942631987a6eef9189144a3a463c9b5d0",
10
10
  "hashAlgorithm": "sha256"
11
11
  },
12
12
  {
13
13
  "relativePath": "tools/gbk_read.js",
14
14
  "kind": "tool",
15
- "expectedHash": "90c0c3ca519000bcc1fc65f84615a5a280866a45104d08678f3ed92dbfda9f45",
15
+ "expectedHash": "5cb2dfd454f36695605e9d07f73dd9984edc80cdf7994cd66d56d637b098bd4b",
16
16
  "hashAlgorithm": "sha256"
17
17
  },
18
18
  {
19
19
  "relativePath": "tools/gbk_search.js",
20
20
  "kind": "tool",
21
- "expectedHash": "dc779c10156dacf1e88195d68445dcd25da0f279b30887559da2a8d5c32b1a02",
21
+ "expectedHash": "4166ccf37155dc282ee0de623f36b85eda61461a61fd07755091f5386c912477",
22
22
  "hashAlgorithm": "sha256"
23
23
  },
24
24
  {
25
25
  "relativePath": "tools/gbk_write.js",
26
26
  "kind": "tool",
27
- "expectedHash": "fa69eecf0c6133ebcd670fa81983a2acb5d011128f1ebc4a99fea4f5f1c37136",
27
+ "expectedHash": "2313f96bb17a4ee40b1599918049b7f4166b4cd0116a23c8826d1e4bf9f8d749",
28
+ "hashAlgorithm": "sha256"
29
+ },
30
+ {
31
+ "relativePath": "tools/text_edit.js",
32
+ "kind": "tool",
33
+ "expectedHash": "b2c31e9c3b205465853d193a81624933c2a46cf370d4ae7beb3b645cc81ddd91",
34
+ "hashAlgorithm": "sha256"
35
+ },
36
+ {
37
+ "relativePath": "tools/text_read.js",
38
+ "kind": "tool",
39
+ "expectedHash": "54aa450b02c1efa98ee4528f9b4511ba454d02bb8b03c332558d6931fa025fb9",
40
+ "hashAlgorithm": "sha256"
41
+ },
42
+ {
43
+ "relativePath": "tools/text_write.js",
44
+ "kind": "tool",
45
+ "expectedHash": "bf13b72c7f16e93e6b560400a652c23871ef64ad3181b1948118cccf2371cf14",
28
46
  "hashAlgorithm": "sha256"
29
47
  },
30
48
  {
@@ -32,6 +50,12 @@
32
50
  "kind": "agent",
33
51
  "expectedHash": "3ff7de130d4fd3c318627efd56e2be08ec6ea5b9d37b3d6bf4a7122a9e0997b1",
34
52
  "hashAlgorithm": "sha256"
53
+ },
54
+ {
55
+ "relativePath": "plugins/opencode-gbk-tools.js",
56
+ "kind": "plugin",
57
+ "expectedHash": "881631c1fa295a2aa4be19a8db5fb305c9c63c32fd158ffaf4911cb87ef1d77d",
58
+ "hashAlgorithm": "sha256"
35
59
  }
36
60
  ]
37
61
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-gbk-tools",
3
- "version": "0.1.8",
4
- "description": "GBK/GB18030 custom tools and agent for OpenCode",
3
+ "version": "0.1.10",
4
+ "description": "Auto-encoding text tools plus GBK/GB18030 tools for OpenCode",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "exports": {