@ait-co/console-cli 0.1.25 → 0.1.27
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/dist/cli.mjs +41 -8
- package/dist/cli.mjs.map +1 -1
- package/package.json +5 -5
package/dist/cli.mjs
CHANGED
|
@@ -13,6 +13,10 @@ import { promisify } from "node:util";
|
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
14
14
|
//#region src/api/http.ts
|
|
15
15
|
var TossApiError = class extends Error {
|
|
16
|
+
status;
|
|
17
|
+
errorCode;
|
|
18
|
+
reason;
|
|
19
|
+
errorType;
|
|
16
20
|
constructor(status, errorCode, reason, errorType) {
|
|
17
21
|
super(`Toss API error ${errorCode}: ${reason} (HTTP ${status})`);
|
|
18
22
|
this.status = status;
|
|
@@ -27,6 +31,7 @@ var TossApiError = class extends Error {
|
|
|
27
31
|
}
|
|
28
32
|
};
|
|
29
33
|
var NetworkError = class extends Error {
|
|
34
|
+
url;
|
|
30
35
|
constructor(url, cause) {
|
|
31
36
|
super(`Network request to ${url} failed: ${cause.message}`);
|
|
32
37
|
this.url = url;
|
|
@@ -35,6 +40,9 @@ var NetworkError = class extends Error {
|
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
var MalformedResponseError = class extends Error {
|
|
43
|
+
url;
|
|
44
|
+
status;
|
|
45
|
+
bodyPreview;
|
|
38
46
|
constructor(url, status, message, bodyPreview) {
|
|
39
47
|
const suffix = bodyPreview ? ` (body: ${bodyPreview})` : "";
|
|
40
48
|
super(`Malformed response from ${url} (HTTP ${status}): ${message}${suffix}`);
|
|
@@ -2483,6 +2491,11 @@ function isValidHttpUrl(v) {
|
|
|
2483
2491
|
}
|
|
2484
2492
|
}
|
|
2485
2493
|
function validateManifest(raw, configDir) {
|
|
2494
|
+
let miniAppId;
|
|
2495
|
+
if (raw.miniAppId !== void 0 && raw.miniAppId !== null) {
|
|
2496
|
+
if (typeof raw.miniAppId !== "number" || !Number.isInteger(raw.miniAppId) || raw.miniAppId <= 0) throw new ManifestError("invalid-config", `miniAppId must be a positive integer (got ${JSON.stringify(raw.miniAppId)})`, "miniAppId");
|
|
2497
|
+
miniAppId = raw.miniAppId;
|
|
2498
|
+
}
|
|
2486
2499
|
const titleKo = requireString(raw, "titleKo");
|
|
2487
2500
|
if (!TITLE_KO_REGEX.test(titleKo)) throw new ManifestError("invalid-config", `titleKo may only contain Korean/English letters, digits, spaces, and ":·?" (got "${titleKo}"; server-side rule, errorCode: miniApp.InvalidTitle)`, "titleKo");
|
|
2488
2501
|
const titleKoLen = codePointsExcludingSpaces(titleKo);
|
|
@@ -2505,21 +2518,29 @@ function validateManifest(raw, configDir) {
|
|
|
2505
2518
|
if (descriptionCodepoints > DETAIL_DESCRIPTION_MAX_CODEPOINTS) throw new ManifestError("invalid-config", `description must be ${DETAIL_DESCRIPTION_MAX_CODEPOINTS} characters or fewer (got ${descriptionCodepoints})`, "description");
|
|
2506
2519
|
const homePageUri = optionalString(raw, "homePageUri");
|
|
2507
2520
|
if (homePageUri !== void 0 && !isValidHttpUrl(homePageUri)) throw new ManifestError("invalid-config", `homePageUri must be a http(s) URL (got ${homePageUri})`, "homePageUri");
|
|
2521
|
+
const logo = requirePath(raw, "logo", configDir);
|
|
2522
|
+
const logoDarkMode = optionalPath(raw, "logoDarkMode", configDir);
|
|
2523
|
+
const horizontalThumbnail = requirePath(raw, "horizontalThumbnail", configDir);
|
|
2524
|
+
const categoryIds = requireNumberArray(raw, "categoryIds", { min: 1 });
|
|
2525
|
+
const keywords = optionalStringArray(raw, "keywords", { max: 10 });
|
|
2526
|
+
const verticalScreenshots = requirePathArray(raw, "verticalScreenshots", configDir, { min: 3 });
|
|
2527
|
+
const horizontalScreenshots = optionalPathArray(raw, "horizontalScreenshots", configDir);
|
|
2508
2528
|
return {
|
|
2529
|
+
miniAppId,
|
|
2509
2530
|
titleKo,
|
|
2510
2531
|
titleEn,
|
|
2511
2532
|
appName,
|
|
2512
2533
|
homePageUri,
|
|
2513
2534
|
csEmail,
|
|
2514
|
-
logo
|
|
2515
|
-
logoDarkMode
|
|
2516
|
-
horizontalThumbnail
|
|
2517
|
-
categoryIds
|
|
2535
|
+
logo,
|
|
2536
|
+
logoDarkMode,
|
|
2537
|
+
horizontalThumbnail,
|
|
2538
|
+
categoryIds,
|
|
2518
2539
|
subtitle,
|
|
2519
2540
|
description,
|
|
2520
|
-
keywords
|
|
2521
|
-
verticalScreenshots
|
|
2522
|
-
horizontalScreenshots
|
|
2541
|
+
keywords,
|
|
2542
|
+
verticalScreenshots,
|
|
2543
|
+
horizontalScreenshots
|
|
2523
2544
|
};
|
|
2524
2545
|
}
|
|
2525
2546
|
//#endregion
|
|
@@ -2896,6 +2917,7 @@ function buildSubmitPayload(manifest, urls) {
|
|
|
2896
2917
|
description: manifest.subtitle,
|
|
2897
2918
|
detailDescription: manifest.description,
|
|
2898
2919
|
images,
|
|
2920
|
+
...manifest.miniAppId !== void 0 ? { miniAppId: manifest.miniAppId } : {},
|
|
2899
2921
|
...urls.logoDarkMode !== void 0 ? { darkModeIconUri: urls.logoDarkMode } : {},
|
|
2900
2922
|
...manifest.homePageUri !== void 0 ? { homePageUri: manifest.homePageUri } : {}
|
|
2901
2923
|
},
|
|
@@ -2917,6 +2939,7 @@ async function runRegister(args, deps = {}) {
|
|
|
2917
2939
|
printContextHeader(ctx, { json: args.json });
|
|
2918
2940
|
const manifest = await loadAndValidateManifest(args, deps);
|
|
2919
2941
|
if (!manifest) return;
|
|
2942
|
+
if (manifest.miniAppId !== void 0 && !args.json) process.stderr.write(`[mode: update · miniAppId ${manifest.miniAppId}] existing app draft will be overwritten and re-enter the review queue.\n`);
|
|
2920
2943
|
if (!args.dryRun && !args.acceptTerms) {
|
|
2921
2944
|
emitTermsNotAccepted(args.json);
|
|
2922
2945
|
await exitAfterFlush(ExitCode.Usage);
|
|
@@ -5810,6 +5833,8 @@ const appCommand = defineCommand({
|
|
|
5810
5833
|
//#region src/auth/backend.ts
|
|
5811
5834
|
const CREDENTIAL_SERVICE = "aitcc.credentials";
|
|
5812
5835
|
var CredentialBackendUnsupportedError = class extends Error {
|
|
5836
|
+
platform;
|
|
5837
|
+
hint;
|
|
5813
5838
|
constructor(platform, hint) {
|
|
5814
5839
|
super(`No supported credential backend for platform "${platform}". ${hint}`);
|
|
5815
5840
|
this.platform = platform;
|
|
@@ -5818,6 +5843,9 @@ var CredentialBackendUnsupportedError = class extends Error {
|
|
|
5818
5843
|
}
|
|
5819
5844
|
};
|
|
5820
5845
|
var CredentialBackendCommandError = class extends Error {
|
|
5846
|
+
command;
|
|
5847
|
+
exitCode;
|
|
5848
|
+
redactedStderr;
|
|
5821
5849
|
constructor(command, exitCode, redactedStderr) {
|
|
5822
5850
|
super(`Credential backend command "${command}" failed (exit=${exitCode ?? "null"}): ${redactedStderr}`);
|
|
5823
5851
|
this.command = command;
|
|
@@ -7232,6 +7260,8 @@ function isResponse(m) {
|
|
|
7232
7260
|
return "id" in m;
|
|
7233
7261
|
}
|
|
7234
7262
|
var CdpProtocolError = class extends Error {
|
|
7263
|
+
method;
|
|
7264
|
+
code;
|
|
7235
7265
|
constructor(method, code, message) {
|
|
7236
7266
|
super(`CDP error for ${method}: ${message} (code=${code})`);
|
|
7237
7267
|
this.method = method;
|
|
@@ -7476,6 +7506,7 @@ function validateCookie(raw, index) {
|
|
|
7476
7506
|
//#endregion
|
|
7477
7507
|
//#region src/chrome.ts
|
|
7478
7508
|
var ChromeNotFoundError = class extends Error {
|
|
7509
|
+
candidates;
|
|
7479
7510
|
constructor(candidates) {
|
|
7480
7511
|
super(`Could not find Chrome or a Chromium-family browser. Tried: ${candidates.join(", ")}.\nInstall Chrome, or set AITCC_BROWSER to an executable path.`);
|
|
7481
7512
|
this.candidates = candidates;
|
|
@@ -7483,6 +7514,7 @@ var ChromeNotFoundError = class extends Error {
|
|
|
7483
7514
|
}
|
|
7484
7515
|
};
|
|
7485
7516
|
var ChromeLaunchError = class extends Error {
|
|
7517
|
+
executable;
|
|
7486
7518
|
constructor(executable, cause) {
|
|
7487
7519
|
super(`Failed to launch ${executable}: ${cause.message}`);
|
|
7488
7520
|
this.executable = executable;
|
|
@@ -7491,6 +7523,7 @@ var ChromeLaunchError = class extends Error {
|
|
|
7491
7523
|
}
|
|
7492
7524
|
};
|
|
7493
7525
|
var ChromeEndpointTimeoutError = class extends Error {
|
|
7526
|
+
executable;
|
|
7494
7527
|
constructor(executable) {
|
|
7495
7528
|
super(`${executable} did not print a DevTools endpoint within the timeout. It may have been blocked by the OS or launched a GUI-less variant.`);
|
|
7496
7529
|
this.executable = executable;
|
|
@@ -9133,7 +9166,7 @@ function resolveVersion() {
|
|
|
9133
9166
|
if (typeof injected === "string" && injected.length > 0) return injected;
|
|
9134
9167
|
} catch {}
|
|
9135
9168
|
try {
|
|
9136
|
-
return "0.1.
|
|
9169
|
+
return "0.1.27";
|
|
9137
9170
|
} catch {}
|
|
9138
9171
|
return "0.0.0-dev";
|
|
9139
9172
|
}
|