@unityclaw/skills 1.1.2 โ†’ 1.1.4

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,318 +0,0 @@
1
- ---
2
- name: unityclaw-document-translation
3
- description: Translate documents between multiple languages while preserving formatting
4
- version: 1.1.2
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - UNITYCLAW_API_KEY
10
- bins:
11
- - node
12
- - npm
13
- primaryEnv: UNITYCLAW_API_KEY
14
- emoji: "๐ŸŒ"
15
- homepage: https://unityclaw.com
16
- install:
17
- - kind: node
18
- package: "@unityclaw/sdk"
19
- bins: []
20
- ---
21
-
22
- # UnityClaw Document Translation
23
-
24
- Translate documents between multiple languages while preserving original formatting and structure.
25
-
26
- ## Installation
27
-
28
- ```bash
29
- npm install @unityclaw/sdk
30
- ```
31
-
32
- ## Configuration
33
-
34
- Set your API key using one of these methods:
35
-
36
- ```bash
37
- # Method 1: Use SDK CLI (recommended - persists across sessions)
38
- npx @unityclaw/sdk config set apiKey your-api-key
39
-
40
- # Method 2: Environment variable
41
- export UNITYCLAW_API_KEY=your-api-key
42
- ```
43
-
44
- ## Response Structure
45
-
46
- > **IMPORTANT:** The result has a nested structure. Use `result.success` to check overall success, and access data via `result.response.data`.
47
-
48
- ```typescript
49
- interface UnityClawResult {
50
- success: boolean; // โœ… Use this to check if SDK call succeeded
51
- taskId: string; // Task identifier
52
- taskFolder: string; // Path to task folder with logs
53
- duration: number; // Request duration in ms
54
- response: { // API response object
55
- code: number; // 0 = success
56
- data: Array<{ // โœ… Result data here
57
- name: string;
58
- contentType: string;
59
- content: string; // URL to translated document
60
- }> | null;
61
- };
62
- logs: Array<{ timestamp; level; message }>;
63
- attachments: any[];
64
- }
65
- ```
66
-
67
- ## Quick Start
68
-
69
- ```typescript
70
- import { UnityClawClient } from '@unityclaw/sdk';
71
-
72
- const client = new UnityClawClient();
73
-
74
- const result = await client.document.translate({
75
- attachment: [
76
- { path: './files/document.pdf' }
77
- ],
78
- source_language: { value: 'en', label: 'English' },
79
- target_language: { value: 'zh', label: 'Chinese' }
80
- });
81
-
82
- // โœ… Correct: Check result.success, access data via result.response.data
83
- if (result.success && result.response?.data) {
84
- console.log('Translated document:', result.response.data);
85
- }
86
- ```
87
-
88
- ## API Reference
89
-
90
- ### translate()
91
-
92
- Translate a document from one language to another.
93
-
94
- ```typescript
95
- await client.document.translate({
96
- attachment: AttachmentFieldItem[];
97
- source_language: LabelFieldItem | string;
98
- target_language: LabelFieldItem | string;
99
- }): Promise<APIResponse<AttachmentResult[]>>
100
- ```
101
-
102
- ## Parameters
103
-
104
- | Parameter | Type | Required | Description |
105
- |-----------|------|----------|-------------|
106
- | `attachment` | `AttachmentFieldItem[]` | Yes | Document(s) to translate |
107
- | `source_language` | `LabelFieldItem \| string` | Yes | Source language code |
108
- | `target_language` | `LabelFieldItem \| string` | Yes | Target language code |
109
-
110
- ## Supported Languages
111
-
112
- | Code | Language |
113
- |------|----------|
114
- | `en` | English |
115
- | `zh` | Chinese (Simplified) |
116
- | `zh-TW` | Chinese (Traditional) |
117
- | `ja` | Japanese |
118
- | `ko` | Korean |
119
- | `es` | Spanish |
120
- | `fr` | French |
121
- | `de` | German |
122
- | `pt` | Portuguese |
123
- | `ru` | Russian |
124
- | `ar` | Arabic |
125
- | `it` | Italian |
126
- | `nl` | Dutch |
127
- | `pl` | Polish |
128
- | `tr` | Turkish |
129
- | `vi` | Vietnamese |
130
- | `th` | Thai |
131
- | `id` | Indonesian |
132
-
133
- ## Supported Document Formats
134
-
135
- - PDF (.pdf)
136
- - Word (.doc, .docx)
137
- - PowerPoint (.ppt, .pptx)
138
- - Excel (.xls, .xlsx)
139
- - Text (.txt)
140
- - RTF (.rtf)
141
-
142
- ## Examples
143
-
144
- ### PDF Translation
145
-
146
- ```typescript
147
- const client = new UnityClawClient();
148
-
149
- const result = await client.document.translate({
150
- attachment: [
151
- { tmp_url: 'https://example.com/report.pdf', name: 'report.pdf' }
152
- ],
153
- source_language: { value: 'en', label: 'English' },
154
- target_language: { value: 'zh', label: 'Chinese' }
155
- });
156
-
157
- if (result.success && result.response?.data) {
158
- console.log('Translated PDF:', result.response.data[0].content);
159
- }
160
- ```
161
-
162
- ### Word Document Translation
163
-
164
- ```typescript
165
- const result = await client.document.translate({
166
- attachment: [
167
- { tmp_url: 'https://example.com/contract.docx', name: 'contract.docx' }
168
- ],
169
- source_language: 'en',
170
- target_language: 'ja'
171
- });
172
- ```
173
-
174
- ### Simple String Parameters
175
-
176
- ```typescript
177
- // Use simple strings for language codes
178
- const result = await client.document.translate({
179
- attachment: [
180
- { tmp_url: 'https://example.com/doc.pdf', name: 'doc.pdf' }
181
- ],
182
- source_language: 'en',
183
- target_language: 'zh'
184
- });
185
- ```
186
-
187
- ### Batch Translation
188
-
189
- ```typescript
190
- const documents = [
191
- { tmp_url: 'https://example.com/doc1.pdf', name: 'doc1.pdf' },
192
- { tmp_url: 'https://example.com/doc2.pdf', name: 'doc2.pdf' },
193
- { tmp_url: 'https://example.com/doc3.pdf', name: 'doc3.pdf' }
194
- ];
195
-
196
- const result = await client.document.translate({
197
- attachment: documents,
198
- source_language: { value: 'en', label: 'English' },
199
- target_language: { value: 'zh', label: 'Chinese' }
200
- });
201
-
202
- if (result.success && result.response?.data) {
203
- result.response.data.forEach((doc, i) => {
204
- console.log(`Document ${i + 1}: ${doc.content}`);
205
- });
206
- }
207
- ```
208
-
209
- ### Multi-Language Translation
210
-
211
- ```typescript
212
- const translateTo = async (
213
- documentUrl: string,
214
- targetLanguages: string[]
215
- ) => {
216
- const client = new UnityClawClient();
217
- const results = await Promise.all(
218
- targetLanguages.map(lang =>
219
- client.document.translate({
220
- attachment: [{ tmp_url: documentUrl, name: 'document.pdf' }],
221
- source_language: 'en',
222
- target_language: lang
223
- })
224
- )
225
- );
226
-
227
- return results;
228
- };
229
-
230
- // Translate English document to multiple languages
231
- const translations = await translateTo(
232
- 'https://example.com/english-doc.pdf',
233
- ['zh', 'ja', 'ko', 'es', 'fr']
234
- );
235
- ```
236
-
237
- ### Chinese to English
238
-
239
- ```typescript
240
- const result = await client.document.translate({
241
- attachment: [
242
- { tmp_url: 'https://example.com/chinese-doc.pdf', name: 'chinese.pdf' }
243
- ],
244
- source_language: { value: 'zh', label: 'Chinese' },
245
- target_language: { value: 'en', label: 'English' }
246
- });
247
- ```
248
-
249
- ## Response Format
250
-
251
- ```typescript
252
- interface AttachmentResult {
253
- name: string;
254
- contentType: 'attachment/url';
255
- content: string; // URL to translated document
256
- }
257
- ```
258
-
259
- ## Error Handling
260
-
261
- ```typescript
262
- const result = await client.document.translate({
263
- attachment: [{ tmp_url: 'https://...', name: 'doc.pdf' }],
264
- source_language: 'en',
265
- target_language: 'zh'
266
- });
267
-
268
- if (!result.success) {
269
- console.error('Request failed');
270
- console.log('Check logs:', result.logs);
271
- return;
272
- }
273
-
274
- if (result.response?.code !== 0) {
275
- console.error('API error:', result.response);
276
- return;
277
- }
278
-
279
- // Success
280
- console.log('Success:', result.response.data);
281
- ```
282
-
283
- ## Task Folders
284
-
285
- Each execution creates a task folder:
286
-
287
- ```typescript
288
- const result = await client.document.translate({
289
- attachment: [{ tmp_url: 'https://...', name: 'doc.pdf' }],
290
- source_language: 'en',
291
- target_language: 'zh'
292
- });
293
-
294
- console.log('Task ID:', result.taskId);
295
- console.log('Task Folder:', result.taskFolder);
296
- console.log('Downloaded Files:', result.attachments);
297
- ```
298
-
299
- ## Best Practices
300
-
301
- 1. **Format Preservation**: Original formatting is maintained
302
- 2. **Large Documents**: May take longer for extensive documents
303
- 3. **Language Detection**: Specify source language for accuracy
304
- 4. **Quality Review**: Review translations for context-specific terms
305
-
306
- ## Related Skills
307
-
308
- - [unityclaw-document-convert](../unityclaw-document-convert/SKILL.md) - Convert document formats
309
- - [unityclaw-media-analysis](../unityclaw-media-analysis/SKILL.md) - Analyze video/audio content
310
-
311
- <!-- SDK_VERSION_RULE_START -->
312
- ## SDK Version Check Rule
313
-
314
- - Before invoking this skill, check local `@unityclaw/sdk` version.
315
- - Required minimum SDK version: `1.1.2`
316
- - If local SDK version is lower than this skill version, stop and prompt user to upgrade SDK first.
317
- - Suggested command: `npm i @unityclaw/sdk@latest`
318
- <!-- SDK_VERSION_RULE_END -->
@@ -1,63 +0,0 @@
1
- ---
2
- name: unityclaw-idp-business-extraction
3
- description: Extract fields from business documents (business license, business card)
4
- version: 1.1.2
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - UNITYCLAW_API_KEY
10
- bins:
11
- - node
12
- - npm
13
- primaryEnv: UNITYCLAW_API_KEY
14
- emoji: "๐Ÿข"
15
- homepage: https://unityclaw.com
16
- install:
17
- - kind: node
18
- package: "@unityclaw/sdk"
19
- bins: []
20
- ---
21
-
22
- # UnityClaw IDP - Business Extraction
23
-
24
- Use this skill for business document extraction:
25
- - `business_license`
26
- - `business_card`
27
-
28
- ## SDK APIs
29
-
30
- ```typescript
31
- await client.idp.businessLicense({ attachments: [{ path: './files/business-license.jpg' }] });
32
- await client.idp.businessCard({ attachments: [{ path: './files/business-card.jpg' }] });
33
- ```
34
-
35
- Or generic API:
36
-
37
- ```typescript
38
- await client.idp.extract('business_license', {
39
- attachments: [{ path: './files/business-license.jpg' }]
40
- });
41
- ```
42
-
43
- ## Input
44
-
45
- ```typescript
46
- {
47
- attachments: AttachmentInput[]
48
- }
49
- ```
50
-
51
- ## Notes
52
-
53
- - This skill groups enterprise scenarios to avoid over-generic routing.
54
- - Output fields vary between license and card extraction.
55
-
56
- <!-- SDK_VERSION_RULE_START -->
57
- ## SDK Version Check Rule
58
-
59
- - Before invoking this skill, check local `@unityclaw/sdk` version.
60
- - Required minimum SDK version: `1.1.2`
61
- - If local SDK version is lower than this skill version, stop and prompt user to upgrade SDK first.
62
- - Suggested command: `npm i @unityclaw/sdk@latest`
63
- <!-- SDK_VERSION_RULE_END -->
@@ -1,63 +0,0 @@
1
- ---
2
- name: unityclaw-idp-contract-extraction
3
- description: Extract structured fields from contract files
4
- version: 1.1.2
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - UNITYCLAW_API_KEY
10
- bins:
11
- - node
12
- - npm
13
- primaryEnv: UNITYCLAW_API_KEY
14
- emoji: "๐Ÿ“‘"
15
- homepage: https://unityclaw.com
16
- install:
17
- - kind: node
18
- package: "@unityclaw/sdk"
19
- bins: []
20
- ---
21
-
22
- # UnityClaw IDP - Contract Extraction
23
-
24
- Use this skill for contract parsing:
25
- - `contract`
26
-
27
- ## SDK APIs
28
-
29
- ```typescript
30
- await client.idp.contract({
31
- attachments: [{ path: './files/contract.pdf' }]
32
- });
33
- ```
34
-
35
- Or generic API:
36
-
37
- ```typescript
38
- await client.idp.extract('contract', {
39
- attachments: [{ path: './files/contract.pdf' }]
40
- });
41
- ```
42
-
43
- ## Input
44
-
45
- ```typescript
46
- {
47
- attachments: AttachmentInput[]
48
- }
49
- ```
50
-
51
- ## Notes
52
-
53
- - Preferred for long contract OCR + key field extraction scenarios.
54
- - Read extracted data from `result.response.data`.
55
-
56
- <!-- SDK_VERSION_RULE_START -->
57
- ## SDK Version Check Rule
58
-
59
- - Before invoking this skill, check local `@unityclaw/sdk` version.
60
- - Required minimum SDK version: `1.1.2`
61
- - If local SDK version is lower than this skill version, stop and prompt user to upgrade SDK first.
62
- - Suggested command: `npm i @unityclaw/sdk@latest`
63
- <!-- SDK_VERSION_RULE_END -->
@@ -1,65 +0,0 @@
1
- ---
2
- name: unityclaw-idp-invoice-extraction
3
- description: Extract fields from invoice and ticket documents (VAT, train, taxi)
4
- version: 1.1.2
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - UNITYCLAW_API_KEY
10
- bins:
11
- - node
12
- - npm
13
- primaryEnv: UNITYCLAW_API_KEY
14
- emoji: "๐Ÿงพ"
15
- homepage: https://unityclaw.com
16
- install:
17
- - kind: node
18
- package: "@unityclaw/sdk"
19
- bins: []
20
- ---
21
-
22
- # UnityClaw IDP - Invoice Extraction
23
-
24
- Use this skill for invoice/ticket extraction:
25
- - `vat_invoice`
26
- - `train_invoice`
27
- - `taxi_invoice`
28
-
29
- ## SDK APIs
30
-
31
- ```typescript
32
- await client.idp.vatInvoice({ attachments: [{ path: './files/vat-invoice.pdf' }] });
33
- await client.idp.trainInvoice({ attachments: [{ path: './files/train-ticket.jpg' }] });
34
- await client.idp.taxiInvoice({ attachments: [{ path: './files/taxi-invoice.jpg' }] });
35
- ```
36
-
37
- Or generic API:
38
-
39
- ```typescript
40
- await client.idp.extract('vat_invoice', {
41
- attachments: [{ path: './files/vat-invoice.pdf' }]
42
- });
43
- ```
44
-
45
- ## Input
46
-
47
- ```typescript
48
- {
49
- attachments: AttachmentInput[]
50
- }
51
- ```
52
-
53
- ## Notes
54
-
55
- - Files can be image/PDF according to each underlying IDP type.
56
- - Output schema differs by type; parse from `result.response.data`.
57
-
58
- <!-- SDK_VERSION_RULE_START -->
59
- ## SDK Version Check Rule
60
-
61
- - Before invoking this skill, check local `@unityclaw/sdk` version.
62
- - Required minimum SDK version: `1.1.2`
63
- - If local SDK version is lower than this skill version, stop and prompt user to upgrade SDK first.
64
- - Suggested command: `npm i @unityclaw/sdk@latest`
65
- <!-- SDK_VERSION_RULE_END -->
@@ -1,69 +0,0 @@
1
- ---
2
- name: unityclaw-idp-personal-documents
3
- description: Extract structured fields from personal identity documents (ID card, vehicle license, bank card)
4
- version: 1.1.2
5
- metadata:
6
- openclaw:
7
- requires:
8
- env:
9
- - UNITYCLAW_API_KEY
10
- bins:
11
- - node
12
- - npm
13
- primaryEnv: UNITYCLAW_API_KEY
14
- emoji: "๐Ÿชช"
15
- homepage: https://unityclaw.com
16
- install:
17
- - kind: node
18
- package: "@unityclaw/sdk"
19
- bins: []
20
- ---
21
-
22
- # UnityClaw IDP - Personal Documents
23
-
24
- Use this skill for personal document extraction:
25
- - `id_card`
26
- - `vehicle_license`
27
- - `bank_card`
28
-
29
- ## SDK APIs
30
-
31
- ```typescript
32
- await client.idp.idCard({ attachments: [{ path: './files/id-card.jpg' }] });
33
- await client.idp.vehicleLicense({ attachments: [{ path: './files/vehicle-license.jpg' }] });
34
- await client.idp.bankCard({ attachments: [{ path: './files/bank-card.jpg' }] });
35
- ```
36
-
37
- Or generic API:
38
-
39
- ```typescript
40
- await client.idp.extract('id_card', {
41
- attachments: [{ path: './files/id-card.jpg' }]
42
- });
43
- ```
44
-
45
- ## Input
46
-
47
- ```typescript
48
- {
49
- attachments: AttachmentInput[]
50
- }
51
- ```
52
-
53
- `AttachmentInput` supports:
54
- - `tmp_url`
55
- - local path (`path` / `localPath` / `filePath`), SDK auto-uploads to `/api/upload`
56
-
57
- ## Notes
58
-
59
- - This category is split from invoice/business/contract to improve skill routing success.
60
- - Output fields vary by type; read from `result.response.data`.
61
-
62
- <!-- SDK_VERSION_RULE_START -->
63
- ## SDK Version Check Rule
64
-
65
- - Before invoking this skill, check local `@unityclaw/sdk` version.
66
- - Required minimum SDK version: `1.1.2`
67
- - If local SDK version is lower than this skill version, stop and prompt user to upgrade SDK first.
68
- - Suggested command: `npm i @unityclaw/sdk@latest`
69
- <!-- SDK_VERSION_RULE_END -->