ccjk 12.0.10 → 12.0.11
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/chunks/ccjk-all.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import a from './index2.mjs';
|
|
2
2
|
import { c as consola } from '../shared/ccjk.UIvifqNE.mjs';
|
|
3
|
-
import { c as createCompleteCloudClient } from '../shared/ccjk.
|
|
3
|
+
import { c as createCompleteCloudClient } from '../shared/ccjk.CtXhbEqb.mjs';
|
|
4
4
|
import { i18n, ensureI18nInitialized } from './index5.mjs';
|
|
5
5
|
import { createHash } from 'node:crypto';
|
|
6
6
|
import { promises, readFileSync } from 'node:fs';
|
package/dist/chunks/mcp.mjs
CHANGED
|
@@ -301,7 +301,7 @@ async function mcpDoctor(options = {}) {
|
|
|
301
301
|
console.log("");
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
const DEFAULT_API_URL = "https://api.claudehome.cn/api/v1/
|
|
304
|
+
const DEFAULT_API_URL = "https://api.claudehome.cn/api/v1/skills";
|
|
305
305
|
const REQUEST_TIMEOUT = 3e4;
|
|
306
306
|
const MAX_RETRY_ATTEMPTS = 3;
|
|
307
307
|
const RETRY_DELAY = 1e3;
|
|
@@ -355,7 +355,7 @@ class MarketplaceClient {
|
|
|
355
355
|
async search(options = {}) {
|
|
356
356
|
this.log("Searching packages with options:", options);
|
|
357
357
|
const params = this.buildSearchParams(options);
|
|
358
|
-
const response = await this.request("
|
|
358
|
+
const response = await this.request("", {
|
|
359
359
|
method: "GET",
|
|
360
360
|
params
|
|
361
361
|
});
|
|
@@ -660,7 +660,7 @@ class MarketplaceClient {
|
|
|
660
660
|
*/
|
|
661
661
|
buildSearchParams(options) {
|
|
662
662
|
return {
|
|
663
|
-
|
|
663
|
+
keyword: options.query,
|
|
664
664
|
category: options.category,
|
|
665
665
|
tags: options.tags,
|
|
666
666
|
sortBy: options.sortBy,
|
package/dist/chunks/plugin.mjs
CHANGED
|
@@ -318,7 +318,7 @@ class LocalPluginCache {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
const DEFAULT_CLOUD_API_URL = "https://api.claudehome.cn/api/v1/
|
|
321
|
+
const DEFAULT_CLOUD_API_URL = "https://api.claudehome.cn/api/v1/skills";
|
|
322
322
|
const REQUEST_TIMEOUT = 3e4;
|
|
323
323
|
const MAX_RETRY_ATTEMPTS = 3;
|
|
324
324
|
const RETRY_DELAY = 1e3;
|
package/dist/index.d.mts
CHANGED
|
@@ -3244,6 +3244,15 @@ declare class CloudClient {
|
|
|
3244
3244
|
* Calculate retry delay with exponential backoff
|
|
3245
3245
|
*/
|
|
3246
3246
|
private calculateRetryDelay;
|
|
3247
|
+
/**
|
|
3248
|
+
* Parse server response — handles all 5 response formats from Miaoda API:
|
|
3249
|
+
* 1. { success: true, data: {} } — auth/user/config/admin modules
|
|
3250
|
+
* 2. { success: false, error: { message } } — error from above modules
|
|
3251
|
+
* 3. { data: {} } — usage/license/skill modules
|
|
3252
|
+
* 4. bare object — subscription/llm/storage modules
|
|
3253
|
+
* 5. { error: "..." } — bare error
|
|
3254
|
+
*/
|
|
3255
|
+
parseResponse<T>(raw: unknown): T;
|
|
3247
3256
|
/**
|
|
3248
3257
|
* Handle fetch errors and convert to CloudClientError
|
|
3249
3258
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -3244,6 +3244,15 @@ declare class CloudClient {
|
|
|
3244
3244
|
* Calculate retry delay with exponential backoff
|
|
3245
3245
|
*/
|
|
3246
3246
|
private calculateRetryDelay;
|
|
3247
|
+
/**
|
|
3248
|
+
* Parse server response — handles all 5 response formats from Miaoda API:
|
|
3249
|
+
* 1. { success: true, data: {} } — auth/user/config/admin modules
|
|
3250
|
+
* 2. { success: false, error: { message } } — error from above modules
|
|
3251
|
+
* 3. { data: {} } — usage/license/skill modules
|
|
3252
|
+
* 4. bare object — subscription/llm/storage modules
|
|
3253
|
+
* 5. { error: "..." } — bare error
|
|
3254
|
+
*/
|
|
3255
|
+
parseResponse<T>(raw: unknown): T;
|
|
3247
3256
|
/**
|
|
3248
3257
|
* Handle fetch errors and convert to CloudClientError
|
|
3249
3258
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as createCloudClient } from './shared/ccjk.
|
|
2
|
-
export { C as CachedCloudClient, b as CloudCache, d as CloudClient, F as FallbackCloudClient, R as RetryableCloudClient, T as TelemetryReporter, c as createCompleteCloudClient, g as getTelemetry, i as initializeTelemetry, r as retryUtils, s as stopTelemetry, t as telemetryUtils, e as trackEvent, w as withRetry } from './shared/ccjk.
|
|
1
|
+
import { a as createCloudClient } from './shared/ccjk.CtXhbEqb.mjs';
|
|
2
|
+
export { C as CachedCloudClient, b as CloudCache, d as CloudClient, F as FallbackCloudClient, R as RetryableCloudClient, T as TelemetryReporter, c as createCompleteCloudClient, g as getTelemetry, i as initializeTelemetry, r as retryUtils, s as stopTelemetry, t as telemetryUtils, e as trackEvent, w as withRetry } from './shared/ccjk.CtXhbEqb.mjs';
|
|
3
3
|
export { C as CloudError, a as CloudErrorCode, b as CloudErrorFactory, f as formatErrorForLogging, g as getRetryDelay, h as handleCloudError, i as isAuthError, c as isRateLimitError, d as isRetryableError, e as isRetryableErrorCode } from './shared/ccjk.D8ZLYSZZ.mjs';
|
|
4
4
|
export { T as TemplatesClient, a as createTemplatesClient, g as getTemplatesClient } from './shared/ccjk.UIvifqNE.mjs';
|
|
5
5
|
import { e as extractString } from './shared/ccjk.C2jHOZVP.mjs';
|
|
@@ -924,6 +924,7 @@ try {
|
|
|
924
924
|
} catch {
|
|
925
925
|
}
|
|
926
926
|
const API_PREFIX = "/api/v1";
|
|
927
|
+
const HEALTH_PATH = "/health";
|
|
927
928
|
class CloudClient {
|
|
928
929
|
fetch;
|
|
929
930
|
config;
|
|
@@ -953,6 +954,26 @@ class CloudClient {
|
|
|
953
954
|
const delays = [100, 200, 400, 800];
|
|
954
955
|
return delays[Math.min(attempt, delays.length - 1)];
|
|
955
956
|
}
|
|
957
|
+
/**
|
|
958
|
+
* Parse server response — handles all 5 response formats from Miaoda API:
|
|
959
|
+
* 1. { success: true, data: {} } — auth/user/config/admin modules
|
|
960
|
+
* 2. { success: false, error: { message } } — error from above modules
|
|
961
|
+
* 3. { data: {} } — usage/license/skill modules
|
|
962
|
+
* 4. bare object — subscription/llm/storage modules
|
|
963
|
+
* 5. { error: "..." } — bare error
|
|
964
|
+
*/
|
|
965
|
+
parseResponse(raw) {
|
|
966
|
+
if (raw === null || raw === void 0) return raw;
|
|
967
|
+
const r = raw;
|
|
968
|
+
if (r.success === false) {
|
|
969
|
+
const msg = r.error?.message || r.message || r.error || "Unknown error";
|
|
970
|
+
throw new CloudClientError("API_ERROR", String(msg));
|
|
971
|
+
}
|
|
972
|
+
if (r.success === true && "data" in r) return r.data;
|
|
973
|
+
if (!("success" in r) && "data" in r) return r.data;
|
|
974
|
+
if (typeof r.error === "string" && !("data" in r)) throw new CloudClientError("API_ERROR", r.error);
|
|
975
|
+
return raw;
|
|
976
|
+
}
|
|
956
977
|
/**
|
|
957
978
|
* Handle fetch errors and convert to CloudClientError
|
|
958
979
|
*/
|
|
@@ -1014,7 +1035,7 @@ class CloudClient {
|
|
|
1014
1035
|
async analyzeProject(request) {
|
|
1015
1036
|
try {
|
|
1016
1037
|
consola.debug("Analyzing project:", request.projectRoot);
|
|
1017
|
-
const response = await this.fetch(`${API_PREFIX}/
|
|
1038
|
+
const response = await this.fetch(`${API_PREFIX}/specs`, {
|
|
1018
1039
|
method: "POST",
|
|
1019
1040
|
body: request
|
|
1020
1041
|
});
|
|
@@ -1078,7 +1099,7 @@ class CloudClient {
|
|
|
1078
1099
|
async reportUsage(report) {
|
|
1079
1100
|
try {
|
|
1080
1101
|
consola.debug("Reporting usage:", report.metricType);
|
|
1081
|
-
const response = await this.fetch(`${API_PREFIX}/
|
|
1102
|
+
const response = await this.fetch(`${API_PREFIX}/usage/current`, {
|
|
1082
1103
|
method: "POST",
|
|
1083
1104
|
body: report,
|
|
1084
1105
|
timeout: 5e3
|
|
@@ -1105,7 +1126,7 @@ class CloudClient {
|
|
|
1105
1126
|
async healthCheck() {
|
|
1106
1127
|
try {
|
|
1107
1128
|
consola.debug("Checking API health");
|
|
1108
|
-
const response = await this.fetch(
|
|
1129
|
+
const response = await this.fetch(HEALTH_PATH, {
|
|
1109
1130
|
method: "GET"
|
|
1110
1131
|
});
|
|
1111
1132
|
consola.debug(`API health: ${response.status}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "12.0.
|
|
4
|
+
"version": "12.0.11",
|
|
5
5
|
"packageManager": "pnpm@10.17.1",
|
|
6
6
|
"description": "CLI toolkit for Claude Code and Codex setup. Simplifies MCP service installation, API configuration, workflow management, and multi-provider support with guided interactive setup.",
|
|
7
7
|
"author": {
|