taiwan-invoice-skill 2.5.3 → 2.5.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.
- package/README.md +0 -9
- package/dist/index.js +39 -80
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,7 +74,6 @@ taiwan-invoice update # 檢查更新
|
|
|
74
74
|
### 選項
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
-
taiwan-invoice init --offline # 跳過 GitHub 下載,使用內建資源
|
|
78
77
|
taiwan-invoice init --force # 覆蓋現有檔案
|
|
79
78
|
taiwan-invoice init --global # 安裝到全域目錄(所有專案共用)
|
|
80
79
|
```
|
|
@@ -91,14 +90,6 @@ taiwan-invoice init --ai antigravity --global # ~/.gemini/antigravity/global_sk
|
|
|
91
90
|
|
|
92
91
|
---
|
|
93
92
|
|
|
94
|
-
## 運作原理
|
|
95
|
-
|
|
96
|
-
`taiwan-invoice init` 預設會從 GitHub 下載最新版本。如果下載失敗(網路錯誤、速率限制),會自動使用 CLI 內建的資源。
|
|
97
|
-
|
|
98
|
-
使用 `--offline` 可跳過 GitHub 下載,直接使用內建資源。
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
93
|
## 支援平台
|
|
103
94
|
|
|
104
95
|
| 平台 | 說明 | 啟動方式 |
|
package/dist/index.js
CHANGED
|
@@ -3741,10 +3741,10 @@ var require_ansi_styles = __commonJS({
|
|
|
3741
3741
|
};
|
|
3742
3742
|
var ansi2ansi = (n) => n;
|
|
3743
3743
|
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
3744
|
-
var setLazyProperty = (object, property,
|
|
3744
|
+
var setLazyProperty = (object, property, get) => {
|
|
3745
3745
|
Object.defineProperty(object, property, {
|
|
3746
3746
|
get: () => {
|
|
3747
|
-
const value =
|
|
3747
|
+
const value = get();
|
|
3748
3748
|
Object.defineProperty(object, property, {
|
|
3749
3749
|
value,
|
|
3750
3750
|
enumerable: true,
|
|
@@ -13075,7 +13075,7 @@ var require_stream_writable = __commonJS({
|
|
|
13075
13075
|
// because otherwise some prototype manipulation in
|
|
13076
13076
|
// userland will fail
|
|
13077
13077
|
enumerable: false,
|
|
13078
|
-
get: function
|
|
13078
|
+
get: function get() {
|
|
13079
13079
|
return this._writableState && this._writableState.getBuffer();
|
|
13080
13080
|
}
|
|
13081
13081
|
});
|
|
@@ -13090,7 +13090,7 @@ var require_stream_writable = __commonJS({
|
|
|
13090
13090
|
// because otherwise some prototype manipulation in
|
|
13091
13091
|
// userland will fail
|
|
13092
13092
|
enumerable: false,
|
|
13093
|
-
get: function
|
|
13093
|
+
get: function get() {
|
|
13094
13094
|
return this._writableState.highWaterMark;
|
|
13095
13095
|
}
|
|
13096
13096
|
});
|
|
@@ -13260,7 +13260,7 @@ var require_stream_writable = __commonJS({
|
|
|
13260
13260
|
// because otherwise some prototype manipulation in
|
|
13261
13261
|
// userland will fail
|
|
13262
13262
|
enumerable: false,
|
|
13263
|
-
get: function
|
|
13263
|
+
get: function get() {
|
|
13264
13264
|
return this._writableState.length;
|
|
13265
13265
|
}
|
|
13266
13266
|
});
|
|
@@ -13333,7 +13333,7 @@ var require_stream_writable = __commonJS({
|
|
|
13333
13333
|
// because otherwise some prototype manipulation in
|
|
13334
13334
|
// userland will fail
|
|
13335
13335
|
enumerable: false,
|
|
13336
|
-
get: function
|
|
13336
|
+
get: function get() {
|
|
13337
13337
|
if (this._writableState === void 0) {
|
|
13338
13338
|
return false;
|
|
13339
13339
|
}
|
|
@@ -13396,7 +13396,7 @@ var require_stream_duplex = __commonJS({
|
|
|
13396
13396
|
// because otherwise some prototype manipulation in
|
|
13397
13397
|
// userland will fail
|
|
13398
13398
|
enumerable: false,
|
|
13399
|
-
get: function
|
|
13399
|
+
get: function get() {
|
|
13400
13400
|
return this._writableState.highWaterMark;
|
|
13401
13401
|
}
|
|
13402
13402
|
});
|
|
@@ -13405,7 +13405,7 @@ var require_stream_duplex = __commonJS({
|
|
|
13405
13405
|
// because otherwise some prototype manipulation in
|
|
13406
13406
|
// userland will fail
|
|
13407
13407
|
enumerable: false,
|
|
13408
|
-
get: function
|
|
13408
|
+
get: function get() {
|
|
13409
13409
|
return this._writableState && this._writableState.getBuffer();
|
|
13410
13410
|
}
|
|
13411
13411
|
});
|
|
@@ -13414,7 +13414,7 @@ var require_stream_duplex = __commonJS({
|
|
|
13414
13414
|
// because otherwise some prototype manipulation in
|
|
13415
13415
|
// userland will fail
|
|
13416
13416
|
enumerable: false,
|
|
13417
|
-
get: function
|
|
13417
|
+
get: function get() {
|
|
13418
13418
|
return this._writableState.length;
|
|
13419
13419
|
}
|
|
13420
13420
|
});
|
|
@@ -13430,7 +13430,7 @@ var require_stream_duplex = __commonJS({
|
|
|
13430
13430
|
// because otherwise some prototype manipulation in
|
|
13431
13431
|
// userland will fail
|
|
13432
13432
|
enumerable: false,
|
|
13433
|
-
get: function
|
|
13433
|
+
get: function get() {
|
|
13434
13434
|
if (this._readableState === void 0 || this._writableState === void 0) {
|
|
13435
13435
|
return false;
|
|
13436
13436
|
}
|
|
@@ -14238,7 +14238,7 @@ var require_stream_readable = __commonJS({
|
|
|
14238
14238
|
// because otherwise some prototype manipulation in
|
|
14239
14239
|
// userland will fail
|
|
14240
14240
|
enumerable: false,
|
|
14241
|
-
get: function
|
|
14241
|
+
get: function get() {
|
|
14242
14242
|
if (this._readableState === void 0) {
|
|
14243
14243
|
return false;
|
|
14244
14244
|
}
|
|
@@ -14779,7 +14779,7 @@ var require_stream_readable = __commonJS({
|
|
|
14779
14779
|
// because otherwise some prototype manipulation in
|
|
14780
14780
|
// userland will fail
|
|
14781
14781
|
enumerable: false,
|
|
14782
|
-
get: function
|
|
14782
|
+
get: function get() {
|
|
14783
14783
|
return this._readableState.highWaterMark;
|
|
14784
14784
|
}
|
|
14785
14785
|
});
|
|
@@ -14788,7 +14788,7 @@ var require_stream_readable = __commonJS({
|
|
|
14788
14788
|
// because otherwise some prototype manipulation in
|
|
14789
14789
|
// userland will fail
|
|
14790
14790
|
enumerable: false,
|
|
14791
|
-
get: function
|
|
14791
|
+
get: function get() {
|
|
14792
14792
|
return this._readableState && this._readableState.buffer;
|
|
14793
14793
|
}
|
|
14794
14794
|
});
|
|
@@ -14797,7 +14797,7 @@ var require_stream_readable = __commonJS({
|
|
|
14797
14797
|
// because otherwise some prototype manipulation in
|
|
14798
14798
|
// userland will fail
|
|
14799
14799
|
enumerable: false,
|
|
14800
|
-
get: function
|
|
14800
|
+
get: function get() {
|
|
14801
14801
|
return this._readableState.flowing;
|
|
14802
14802
|
},
|
|
14803
14803
|
set: function set(state) {
|
|
@@ -14812,7 +14812,7 @@ var require_stream_readable = __commonJS({
|
|
|
14812
14812
|
// because otherwise some prototype manipulation in
|
|
14813
14813
|
// userland will fail
|
|
14814
14814
|
enumerable: false,
|
|
14815
|
-
get: function
|
|
14815
|
+
get: function get() {
|
|
14816
14816
|
return this._readableState.length;
|
|
14817
14817
|
}
|
|
14818
14818
|
});
|
|
@@ -15138,7 +15138,7 @@ var require_BufferList = __commonJS({
|
|
|
15138
15138
|
}
|
|
15139
15139
|
return offset;
|
|
15140
15140
|
};
|
|
15141
|
-
BufferList.prototype.get = function
|
|
15141
|
+
BufferList.prototype.get = function get(index) {
|
|
15142
15142
|
if (index > this.length || index < 0) {
|
|
15143
15143
|
return void 0;
|
|
15144
15144
|
}
|
|
@@ -16068,15 +16068,6 @@ ${msg}
|
|
|
16068
16068
|
var import_cli_progress = __toESM(require_cli_progress());
|
|
16069
16069
|
var import_chalk2 = __toESM(require_source());
|
|
16070
16070
|
var INSTALL_STEPS = [
|
|
16071
|
-
{ name: "Checking for updates", weight: 10 },
|
|
16072
|
-
{ name: "Downloading release", weight: 25 },
|
|
16073
|
-
{ name: "Extracting files", weight: 15 },
|
|
16074
|
-
{ name: "Installing skill files", weight: 20 },
|
|
16075
|
-
{ name: "Installing references", weight: 10 },
|
|
16076
|
-
{ name: "Installing scripts", weight: 10 },
|
|
16077
|
-
{ name: "Installing data files", weight: 10 }
|
|
16078
|
-
];
|
|
16079
|
-
var OFFLINE_STEPS = [
|
|
16080
16071
|
{ name: "Loading templates", weight: 20 },
|
|
16081
16072
|
{ name: "Generating skill files", weight: 30 },
|
|
16082
16073
|
{ name: "Installing references", weight: 20 },
|
|
@@ -16175,7 +16166,7 @@ async function initCommand(options) {
|
|
|
16175
16166
|
logger.info(`Installing for: ${import_chalk3.default.cyan(getAITypeDescription(aiType))}${options.global ? " (global)" : ""}`);
|
|
16176
16167
|
let copiedFolders = [];
|
|
16177
16168
|
try {
|
|
16178
|
-
const progress = new InstallProgress(
|
|
16169
|
+
const progress = new InstallProgress(INSTALL_STEPS);
|
|
16179
16170
|
progress.start();
|
|
16180
16171
|
await animatedDelay(300);
|
|
16181
16172
|
progress.nextStep();
|
|
@@ -16280,68 +16271,37 @@ async function infoCommand() {
|
|
|
16280
16271
|
// src/commands/versions.ts
|
|
16281
16272
|
var import_chalk6 = __toESM(require_source());
|
|
16282
16273
|
var import_ora = __toESM(require_ora());
|
|
16283
|
-
|
|
16284
|
-
// src/utils/github.ts
|
|
16285
|
-
var https = __toESM(require("https"));
|
|
16286
|
-
var REPO_OWNER = "Moksa1123";
|
|
16287
|
-
var REPO_NAME = "taiwan-invoice";
|
|
16288
|
-
async function fetchReleases() {
|
|
16289
|
-
return new Promise((resolve, reject) => {
|
|
16290
|
-
const options = {
|
|
16291
|
-
hostname: "api.github.com",
|
|
16292
|
-
path: `/repos/${REPO_OWNER}/${REPO_NAME}/releases`,
|
|
16293
|
-
headers: {
|
|
16294
|
-
"User-Agent": "taiwan-invoice-skill-cli",
|
|
16295
|
-
"Accept": "application/vnd.github.v3+json"
|
|
16296
|
-
}
|
|
16297
|
-
};
|
|
16298
|
-
https.get(options, (res) => {
|
|
16299
|
-
let data = "";
|
|
16300
|
-
res.on("data", (chunk) => data += chunk);
|
|
16301
|
-
res.on("end", () => {
|
|
16302
|
-
if (res.statusCode === 200) {
|
|
16303
|
-
try {
|
|
16304
|
-
resolve(JSON.parse(data));
|
|
16305
|
-
} catch (e) {
|
|
16306
|
-
reject(new Error("Failed to parse GitHub response"));
|
|
16307
|
-
}
|
|
16308
|
-
} else if (res.statusCode === 404) {
|
|
16309
|
-
resolve([]);
|
|
16310
|
-
} else {
|
|
16311
|
-
reject(new Error(`GitHub API error: ${res.statusCode}`));
|
|
16312
|
-
}
|
|
16313
|
-
});
|
|
16314
|
-
}).on("error", reject);
|
|
16315
|
-
});
|
|
16316
|
-
}
|
|
16317
|
-
|
|
16318
|
-
// src/commands/versions.ts
|
|
16319
|
-
var VERSION2 = "2.0.0";
|
|
16274
|
+
var VERSION2 = "2.5.4";
|
|
16320
16275
|
async function versionsCommand() {
|
|
16321
16276
|
logger.title("Taiwan Invoice Skill - Available Versions");
|
|
16322
|
-
const spinner = (0, import_ora.default)("Fetching
|
|
16277
|
+
const spinner = (0, import_ora.default)("Fetching versions from npm...").start();
|
|
16323
16278
|
try {
|
|
16324
|
-
const
|
|
16325
|
-
|
|
16279
|
+
const response = await fetch("https://registry.npmjs.org/taiwan-invoice-skill", {
|
|
16280
|
+
headers: {
|
|
16281
|
+
"Accept": "application/json"
|
|
16282
|
+
}
|
|
16283
|
+
});
|
|
16284
|
+
if (!response.ok) {
|
|
16285
|
+
throw new Error(`npm registry error: ${response.status}`);
|
|
16286
|
+
}
|
|
16287
|
+
const data = await response.json();
|
|
16288
|
+
const versions = Object.keys(data.versions || {}).reverse().slice(0, 10);
|
|
16289
|
+
spinner.succeed("Fetched versions from npm");
|
|
16326
16290
|
console.log();
|
|
16327
16291
|
console.log(import_chalk6.default.cyan("Available Versions:"));
|
|
16328
16292
|
console.log();
|
|
16329
|
-
if (
|
|
16330
|
-
console.log(import_chalk6.default.dim(" No
|
|
16293
|
+
if (versions.length === 0) {
|
|
16294
|
+
console.log(import_chalk6.default.dim(" No versions found"));
|
|
16331
16295
|
} else {
|
|
16332
|
-
for (const
|
|
16333
|
-
const
|
|
16334
|
-
const isCurrent = release.tag_name === `v${VERSION2}`;
|
|
16296
|
+
for (const version of versions) {
|
|
16297
|
+
const isCurrent = version === VERSION2;
|
|
16335
16298
|
const marker = isCurrent ? import_chalk6.default.green(" (current)") : "";
|
|
16336
|
-
console.log(` ${import_chalk6.default.green(
|
|
16299
|
+
console.log(` ${import_chalk6.default.green(version.padEnd(12))}${marker}`);
|
|
16337
16300
|
}
|
|
16338
16301
|
}
|
|
16339
16302
|
console.log();
|
|
16340
|
-
console.log(import_chalk6.default.cyan("Current CLI Version:"));
|
|
16341
|
-
console.log(import_chalk6.default.dim(` ${VERSION2}`));
|
|
16342
|
-
console.log();
|
|
16343
16303
|
} catch (error) {
|
|
16344
|
-
spinner.fail("Failed to fetch
|
|
16304
|
+
spinner.fail("Failed to fetch versions");
|
|
16345
16305
|
console.log();
|
|
16346
16306
|
console.log(import_chalk6.default.cyan("Current CLI Version:"));
|
|
16347
16307
|
console.log(import_chalk6.default.dim(` ${VERSION2}`));
|
|
@@ -16354,7 +16314,7 @@ async function versionsCommand() {
|
|
|
16354
16314
|
// src/commands/update.ts
|
|
16355
16315
|
var import_chalk7 = __toESM(require_source());
|
|
16356
16316
|
var import_ora2 = __toESM(require_ora());
|
|
16357
|
-
var VERSION3 = "2.
|
|
16317
|
+
var VERSION3 = "2.5.4";
|
|
16358
16318
|
async function updateCommand() {
|
|
16359
16319
|
logger.title("Taiwan Invoice Skill - Update");
|
|
16360
16320
|
console.log(import_chalk7.default.cyan("Current Version:"));
|
|
@@ -16393,7 +16353,7 @@ async function updateCommand() {
|
|
|
16393
16353
|
var VERSION4 = "2.0.0";
|
|
16394
16354
|
var program2 = new Command();
|
|
16395
16355
|
program2.name("taiwan-invoice").description("CLI to install Taiwan E-Invoice skill for AI coding assistants").version(VERSION4);
|
|
16396
|
-
program2.command("init").description("Install Taiwan Invoice skill to current project").option("-a, --ai <type>", `AI assistant type (${AI_TYPES.join(", ")})`).option("-f, --force", "Overwrite existing files").option("-g, --global", "Install to global directory").
|
|
16356
|
+
program2.command("init").description("Install Taiwan Invoice skill to current project").option("-a, --ai <type>", `AI assistant type (${AI_TYPES.join(", ")})`).option("-f, --force", "Overwrite existing files").option("-g, --global", "Install to global directory").action(async (options) => {
|
|
16397
16357
|
if (options.ai && !AI_TYPES.includes(options.ai)) {
|
|
16398
16358
|
console.error(`Invalid AI type: ${options.ai}`);
|
|
16399
16359
|
console.error(`Valid types: ${AI_TYPES.join(", ")}`);
|
|
@@ -16402,8 +16362,7 @@ program2.command("init").description("Install Taiwan Invoice skill to current pr
|
|
|
16402
16362
|
await initCommand({
|
|
16403
16363
|
ai: options.ai,
|
|
16404
16364
|
force: options.force,
|
|
16405
|
-
global: options.global
|
|
16406
|
-
offline: options.offline
|
|
16365
|
+
global: options.global
|
|
16407
16366
|
});
|
|
16408
16367
|
});
|
|
16409
16368
|
program2.command("list").description("List supported AI platforms").action(listCommand);
|