taiwan-invoice-skill 2.3.0 → 2.4.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.
- package/assets/templates/platforms/agent.json +11 -9
- package/dist/index.js +136 -1
- package/package.json +1 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"platform": "antigravity",
|
|
3
3
|
"displayName": "Antigravity / Generic Agent",
|
|
4
|
-
"installType": "
|
|
4
|
+
"installType": "workflow",
|
|
5
5
|
"folderStructure": {
|
|
6
6
|
"root": ".agent",
|
|
7
|
-
"skillPath": "
|
|
8
|
-
"filename": "
|
|
7
|
+
"skillPath": "workflows",
|
|
8
|
+
"filename": "taiwan-invoice.md",
|
|
9
|
+
"sharedRoot": ".shared",
|
|
10
|
+
"sharedPath": "taiwan-invoice"
|
|
9
11
|
},
|
|
10
|
-
"scriptPath": "
|
|
12
|
+
"scriptPath": ".shared/taiwan-invoice/scripts",
|
|
11
13
|
"frontmatter": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
+
"description": "Taiwan E-Invoice API integration for ECPay, SmilePay, and Amego",
|
|
15
|
+
"auto_execution_mode": "3"
|
|
14
16
|
},
|
|
15
17
|
"sections": {
|
|
16
18
|
"examples": true,
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
"scripts": true,
|
|
19
21
|
"quickReference": false
|
|
20
22
|
},
|
|
21
|
-
"title": "
|
|
22
|
-
"description": "
|
|
23
|
-
"skillOrWorkflow": "
|
|
23
|
+
"title": "taiwan-invoice",
|
|
24
|
+
"description": "台灣電子發票 API 整合工具。支援 ECPay、SmilePay、Amego 三家加值中心的 B2C/B2B 發票開立、作廢、折讓、查詢、列印功能。",
|
|
25
|
+
"skillOrWorkflow": "Workflow"
|
|
24
26
|
}
|
package/dist/index.js
CHANGED
|
@@ -14990,7 +14990,7 @@ var AI_FOLDERS = {
|
|
|
14990
14990
|
claude: [".claude"],
|
|
14991
14991
|
cursor: [".cursor"],
|
|
14992
14992
|
windsurf: [".windsurf"],
|
|
14993
|
-
antigravity: [".agent"],
|
|
14993
|
+
antigravity: [".agent", ".shared"],
|
|
14994
14994
|
copilot: [".github"],
|
|
14995
14995
|
kiro: [".kiro"],
|
|
14996
14996
|
codex: [".codex"],
|
|
@@ -15093,9 +15093,144 @@ async function copyTaiwanInvoiceAssets(targetSkillDir, sections) {
|
|
|
15093
15093
|
await (0, import_promises.cp)((0, import_node_path.join)(sourceDir, "data"), dataTarget, { recursive: true });
|
|
15094
15094
|
}
|
|
15095
15095
|
}
|
|
15096
|
+
async function renderWorkflowFile(config) {
|
|
15097
|
+
const frontmatter = renderFrontmatter(config.frontmatter);
|
|
15098
|
+
const sharedPath = config.folderStructure.sharedPath || "taiwan-invoice";
|
|
15099
|
+
const content = `# ${config.title}
|
|
15100
|
+
|
|
15101
|
+
${config.description}
|
|
15102
|
+
|
|
15103
|
+
## Prerequisites
|
|
15104
|
+
|
|
15105
|
+
Check if Python is installed:
|
|
15106
|
+
|
|
15107
|
+
\`\`\`bash
|
|
15108
|
+
python3 --version || python --version
|
|
15109
|
+
\`\`\`
|
|
15110
|
+
|
|
15111
|
+
---
|
|
15112
|
+
|
|
15113
|
+
## How to Use This Workflow
|
|
15114
|
+
|
|
15115
|
+
When user requests Taiwan E-Invoice work (issue, void, allowance, print, query), follow this workflow:
|
|
15116
|
+
|
|
15117
|
+
### Step 1: Analyze User Requirements
|
|
15118
|
+
|
|
15119
|
+
Extract key information:
|
|
15120
|
+
- **Provider**: ECPay, SmilePay, or Amego
|
|
15121
|
+
- **Invoice type**: B2C (\u4E8C\u806F\u5F0F) or B2B (\u4E09\u806F\u5F0F)
|
|
15122
|
+
- **Operation**: issue, void, allowance, print, query
|
|
15123
|
+
|
|
15124
|
+
### Step 2: Recommend Provider (Optional)
|
|
15125
|
+
|
|
15126
|
+
\`\`\`bash
|
|
15127
|
+
python3 .shared/${sharedPath}/scripts/recommend.py "<keywords>"
|
|
15128
|
+
\`\`\`
|
|
15129
|
+
|
|
15130
|
+
Example:
|
|
15131
|
+
\`\`\`bash
|
|
15132
|
+
python3 .shared/${sharedPath}/scripts/recommend.py "\u96FB\u5546 \u9AD8\u4EA4\u6613\u91CF \u7A69\u5B9A"
|
|
15133
|
+
\`\`\`
|
|
15134
|
+
|
|
15135
|
+
### Step 3: Search for Information
|
|
15136
|
+
|
|
15137
|
+
\`\`\`bash
|
|
15138
|
+
python3 .shared/${sharedPath}/scripts/search.py "<keyword>" --domain <domain>
|
|
15139
|
+
\`\`\`
|
|
15140
|
+
|
|
15141
|
+
Available domains:
|
|
15142
|
+
| Domain | Description |
|
|
15143
|
+
|--------|-------------|
|
|
15144
|
+
| provider | Provider comparison |
|
|
15145
|
+
| operation | API endpoints |
|
|
15146
|
+
| error | Error codes |
|
|
15147
|
+
| field | Field mappings |
|
|
15148
|
+
| tax | Tax rules |
|
|
15149
|
+
| troubleshoot | Troubleshooting |
|
|
15150
|
+
|
|
15151
|
+
### Step 4: Generate Service Code
|
|
15152
|
+
|
|
15153
|
+
\`\`\`bash
|
|
15154
|
+
python3 .shared/${sharedPath}/scripts/generate-invoice-service.py <Provider> --output ts
|
|
15155
|
+
\`\`\`
|
|
15156
|
+
|
|
15157
|
+
### Step 5: Initialize Project Config (Optional)
|
|
15158
|
+
|
|
15159
|
+
\`\`\`bash
|
|
15160
|
+
python3 .shared/${sharedPath}/scripts/persist.py init <Provider>
|
|
15161
|
+
\`\`\`
|
|
15162
|
+
|
|
15163
|
+
---
|
|
15164
|
+
|
|
15165
|
+
## Quick Reference
|
|
15166
|
+
|
|
15167
|
+
### B2C Invoice (\u4E8C\u806F\u5F0F)
|
|
15168
|
+
- Amount: **Tax-inclusive**
|
|
15169
|
+
- BuyerIdentifier: \`0000000000\`
|
|
15170
|
+
- TaxAmount: \`0\`
|
|
15171
|
+
- Can use carrier/donation
|
|
15172
|
+
|
|
15173
|
+
### B2B Invoice (\u4E09\u806F\u5F0F)
|
|
15174
|
+
- Amount: **Tax-exclusive**
|
|
15175
|
+
- Must fill 8-digit tax ID
|
|
15176
|
+
- Calculate tax: \`TaxAmount = round(Total - Total/1.05)\`
|
|
15177
|
+
- **Cannot** use carrier/donation
|
|
15178
|
+
|
|
15179
|
+
---
|
|
15180
|
+
|
|
15181
|
+
## Test Credentials
|
|
15182
|
+
|
|
15183
|
+
### ECPay
|
|
15184
|
+
\`\`\`
|
|
15185
|
+
MerchantID: 2000132
|
|
15186
|
+
HashKey: ejCk326UnaZWKisg
|
|
15187
|
+
HashIV: q9jcZX8Ib9LM8wYk
|
|
15188
|
+
\`\`\`
|
|
15189
|
+
|
|
15190
|
+
### SmilePay
|
|
15191
|
+
\`\`\`
|
|
15192
|
+
Grvc: SEI1000034
|
|
15193
|
+
Verify_key: 9D73935693EE0237FABA6AB744E48661
|
|
15194
|
+
\`\`\`
|
|
15195
|
+
|
|
15196
|
+
### Amego
|
|
15197
|
+
\`\`\`
|
|
15198
|
+
Invoice: 12345678
|
|
15199
|
+
App Key: sHeq7t8G1wiQvhAuIM27
|
|
15200
|
+
\`\`\`
|
|
15201
|
+
|
|
15202
|
+
---
|
|
15203
|
+
|
|
15204
|
+
*Generated by Taiwan Invoice Skill*
|
|
15205
|
+
`;
|
|
15206
|
+
return frontmatter + content;
|
|
15207
|
+
}
|
|
15096
15208
|
async function generatePlatformFiles(targetDir, aiType) {
|
|
15097
15209
|
const config = await loadPlatformConfig(aiType);
|
|
15098
15210
|
const createdFolders = [];
|
|
15211
|
+
if (config.installType === "workflow") {
|
|
15212
|
+
const workflowDir = (0, import_node_path.join)(
|
|
15213
|
+
targetDir,
|
|
15214
|
+
config.folderStructure.root,
|
|
15215
|
+
config.folderStructure.skillPath
|
|
15216
|
+
);
|
|
15217
|
+
await (0, import_promises.mkdir)(workflowDir, { recursive: true });
|
|
15218
|
+
const workflowContent = await renderWorkflowFile(config);
|
|
15219
|
+
const workflowFilePath = (0, import_node_path.join)(workflowDir, config.folderStructure.filename);
|
|
15220
|
+
await (0, import_promises.writeFile)(workflowFilePath, workflowContent, "utf-8");
|
|
15221
|
+
createdFolders.push(config.folderStructure.root);
|
|
15222
|
+
if (config.folderStructure.sharedRoot && config.folderStructure.sharedPath) {
|
|
15223
|
+
const sharedDir = (0, import_node_path.join)(
|
|
15224
|
+
targetDir,
|
|
15225
|
+
config.folderStructure.sharedRoot,
|
|
15226
|
+
config.folderStructure.sharedPath
|
|
15227
|
+
);
|
|
15228
|
+
await (0, import_promises.mkdir)(sharedDir, { recursive: true });
|
|
15229
|
+
await copyTaiwanInvoiceAssets(sharedDir, config.sections);
|
|
15230
|
+
createdFolders.push(config.folderStructure.sharedRoot);
|
|
15231
|
+
}
|
|
15232
|
+
return createdFolders;
|
|
15233
|
+
}
|
|
15099
15234
|
const skillDir = (0, import_node_path.join)(
|
|
15100
15235
|
targetDir,
|
|
15101
15236
|
config.folderStructure.root,
|