@zhin.js/plugin-qrcode 1.1.0 → 1.1.3

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.
@@ -1,7 +1,7 @@
1
1
  // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
2
  import { defineCommand } from 'zhin.js/command';
3
3
  import { raw } from '@zhin.js/core/runtime';
4
- import { buildQrImageUrl } from "../../lib/qrcode-lib.js";
4
+ import { buildQrImageUrl } from "../../../lib/qrcode-lib.js";
5
5
  export default defineCommand({
6
6
  description: '根据文本或链接生成二维码图片',
7
7
  params: { text: { type: 'string' } },
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'zhin.js/command';
2
2
  import { raw } from '@zhin.js/core/runtime';
3
- import { buildQrImageUrl } from '../../src/qrcode-lib.js';
3
+ import { buildQrImageUrl } from '../../../src/qrcode-lib.js';
4
4
 
5
5
  export default defineCommand({
6
6
  description: '根据文本或链接生成二维码图片',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-qrcode",
3
- "version": "1.1.0",
3
+ "version": "1.1.3",
4
4
  "description": "QR code generator & reader plugin for Zhin.js (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -19,7 +19,8 @@
19
19
  "commands",
20
20
  "src",
21
21
  "lib",
22
- "agent",
22
+ "tools",
23
+ "skills",
23
24
  "README.md"
24
25
  ],
25
26
  "keywords": [
@@ -37,25 +38,22 @@
37
38
  },
38
39
  "license": "MIT",
39
40
  "dependencies": {
40
- "@zhin.js/core": "1.1.35"
41
+ "@zhin.js/core": "1.1.38",
42
+ "@zhin.js/tool": "1.1.2",
43
+ "@zhin.js/skill": "1.1.2"
41
44
  },
42
45
  "devDependencies": {
43
46
  "typescript": "^6.0.3",
44
47
  "vitest": "^4.1.10",
45
48
  "zod": "^4.4.3",
46
- "@zhin.js/agent": "1.1.23",
47
- "zhin.js": "1.1.0"
49
+ "zhin.js": "1.1.3"
48
50
  },
49
51
  "peerDependencies": {
50
52
  "zod": "^4.0.0",
51
- "@zhin.js/agent": "^1.1.23",
52
- "@zhin.js/command": "^1.1.0",
53
- "zhin.js": "^1.1.0"
53
+ "@zhin.js/command": "^1.1.2",
54
+ "zhin.js": "^1.1.3"
54
55
  },
55
56
  "peerDependenciesMeta": {
56
- "@zhin.js/agent": {
57
- "optional": true
58
- },
59
57
  "@zhin.js/command": {
60
58
  "optional": true
61
59
  },
@@ -85,6 +83,14 @@
85
83
  {
86
84
  "package": "@zhin.js/command",
87
85
  "api": "^1.0.0"
86
+ },
87
+ {
88
+ "package": "@zhin.js/tool",
89
+ "api": "^1.0.0"
90
+ },
91
+ {
92
+ "package": "@zhin.js/skill",
93
+ "api": "^1.0.0"
88
94
  }
89
95
  ],
90
96
  "plugins": []
@@ -0,0 +1,14 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { defineAgentTool } from '@zhin.js/tool';
3
+ import { z } from 'zod';
4
+ import { buildQrImageUrl } from "../../../../lib/qrcode-lib.js";
5
+ export default defineAgentTool({
6
+ description: '根据文本或 URL 生成二维码图片',
7
+ inputSchema: z.object({ text: z.string().min(1) }),
8
+ keywords: ['二维码', 'QR', 'qrcode'],
9
+ tags: ['qrcode', 'image'],
10
+ async execute({ text }) {
11
+ const qrUrl = buildQrImageUrl(text);
12
+ return JSON.stringify([{ type: 'image', data: { url: qrUrl } }]);
13
+ },
14
+ });
@@ -1,6 +1,6 @@
1
- import { defineAgentTool } from '@zhin.js/agent/tools';
1
+ import { defineAgentTool } from '@zhin.js/tool';
2
2
  import { z } from 'zod';
3
- import { buildQrImageUrl } from '../../src/qrcode-lib.js';
3
+ import { buildQrImageUrl } from '../../../../src/qrcode-lib.js';
4
4
 
5
5
  export default defineAgentTool<{ text: string }>({
6
6
  description: '根据文本或 URL 生成二维码图片',
File without changes
File without changes