@rubytech/taskmaster 1.16.1 → 1.16.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.
|
@@ -149,7 +149,7 @@ export function createTaskmasterTools(options) {
|
|
|
149
149
|
agentSessionKey: options?.agentSessionKey,
|
|
150
150
|
sandboxRoot: options?.sandboxRoot,
|
|
151
151
|
}),
|
|
152
|
-
createQrGenerateTool(),
|
|
152
|
+
createQrGenerateTool({ workspaceDir: options?.workspaceDir }),
|
|
153
153
|
createCurrentTimeTool({ config: options?.config }),
|
|
154
154
|
createAuthorizeAdminTool({ agentAccountId: options?.agentAccountId }),
|
|
155
155
|
createRevokeAdminTool({ agentAccountId: options?.agentAccountId }),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
|
-
import os from "node:os";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { Type } from "@sinclair/typebox";
|
|
5
4
|
import { renderQrPngBase64 } from "../../web/qr-image.js";
|
|
@@ -10,12 +9,12 @@ const QrGenerateSchema = Type.Object({
|
|
|
10
9
|
"a URL, plain text, a vCard block, or a wa.me deep link.",
|
|
11
10
|
}),
|
|
12
11
|
});
|
|
13
|
-
export function createQrGenerateTool() {
|
|
12
|
+
export function createQrGenerateTool(options) {
|
|
14
13
|
return {
|
|
15
14
|
label: "QR Code Generator",
|
|
16
15
|
name: "qr_generate",
|
|
17
16
|
description: "Generate a QR code PNG from any string (URL, text, vCard, WhatsApp link). " +
|
|
18
|
-
"Returns a MEDIA: path — copy
|
|
17
|
+
"Returns a MEDIA: path — copy the MEDIA: line exactly into your response to deliver the image.",
|
|
19
18
|
parameters: QrGenerateSchema,
|
|
20
19
|
execute: async (_toolCallId, params) => {
|
|
21
20
|
const data = readStringParam(params, "data");
|
|
@@ -25,8 +24,13 @@ export function createQrGenerateTool() {
|
|
|
25
24
|
try {
|
|
26
25
|
const base64 = await renderQrPngBase64(data);
|
|
27
26
|
const buf = Buffer.from(base64, "base64");
|
|
27
|
+
const workspaceDir = options?.workspaceDir?.trim();
|
|
28
|
+
const outputDir = workspaceDir
|
|
29
|
+
? path.join(workspaceDir, "uploads", "generated")
|
|
30
|
+
: path.join(process.cwd(), "uploads", "generated");
|
|
31
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
28
32
|
const filename = `qr-${Date.now()}.png`;
|
|
29
|
-
const pngPath = path.join(
|
|
33
|
+
const pngPath = path.join(outputDir, filename);
|
|
30
34
|
await fs.writeFile(pngPath, buf);
|
|
31
35
|
return {
|
|
32
36
|
content: [
|
package/dist/build-info.json
CHANGED
package/package.json
CHANGED
package/skills/qr-code/SKILL.md
CHANGED
|
@@ -18,10 +18,14 @@ Generate a QR code image and send it via the `message` tool.
|
|
|
18
18
|
|
|
19
19
|
1. **Assemble the data string** (see Content Types below)
|
|
20
20
|
2. **Call `qr_generate`** with the assembled string as `data`
|
|
21
|
-
3. **Copy the `MEDIA:`
|
|
22
|
-
4. **
|
|
21
|
+
3. **Copy the `MEDIA:` line from the tool result verbatim into your response** — do not convert it to markdown or a URL. Write it exactly as returned (e.g. `MEDIA:/tmp/qr-1234567890.png`). The channel delivers it as an image attachment automatically.
|
|
22
|
+
4. **Add a brief caption** as a separate line of text before or after the `MEDIA:` line.
|
|
23
23
|
|
|
24
|
-
Example
|
|
24
|
+
Example response:
|
|
25
|
+
```
|
|
26
|
+
Here's your QR code — scan to open the listing.
|
|
27
|
+
MEDIA:/tmp/qr-1234567890.png
|
|
28
|
+
```
|
|
25
29
|
|
|
26
30
|
## Content Types
|
|
27
31
|
|