@zerowall/dsh-claude-coderun 0.1.6 → 0.1.7
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/lib/index.js +10 -3
- package/lib/types/host/route.d.ts +1 -1
- package/package.json +1 -1
- package/zerowall.plugin.json +1 -1
package/lib/index.js
CHANGED
|
@@ -892,8 +892,8 @@ var routeErrors = {
|
|
|
892
892
|
UNSUPPORTED_PROTOCOL: "\u8BF7\u4E3A Claude Code \u9009\u62E9\u652F\u6301 Anthropic Messages \u7684\u624B\u52A8\u6A21\u578B\u8DEF\u7531\uFF0C\u6216\u9009\u62E9 AI \u4E91\u6A21\u578B\u3002"
|
|
893
893
|
};
|
|
894
894
|
var ClaudeRouteError = class extends HarnessError {
|
|
895
|
-
constructor(reason) {
|
|
896
|
-
super(routeErrors[reason], `CLAUDE_ROUTE_${reason}
|
|
895
|
+
constructor(reason, options) {
|
|
896
|
+
super(routeErrors[reason], `CLAUDE_ROUTE_${reason}`, options);
|
|
897
897
|
this.reason = reason;
|
|
898
898
|
}
|
|
899
899
|
reason;
|
|
@@ -925,7 +925,14 @@ async function resolveClaudeRoute(selection, services) {
|
|
|
925
925
|
if (!route2) throw new ClaudeRouteError("NO_MANAGED_ROUTE");
|
|
926
926
|
const gateway = endpoint(route2.baseUrl);
|
|
927
927
|
baseUrl = gateway.origin + gateway.pathname.replace(/\/+$/u, "").replace(/\/v1(?:beta)?$/u, "");
|
|
928
|
-
apiKey =
|
|
928
|
+
apiKey = route2.apiKey?.trim() ? route2.apiKey : void 0;
|
|
929
|
+
if (!apiKey && services.managedCredential) {
|
|
930
|
+
try {
|
|
931
|
+
apiKey = await services.managedCredential(selection.provider, selection.model);
|
|
932
|
+
} catch (cause) {
|
|
933
|
+
throw new ClaudeRouteError("MISSING_CREDENTIAL", { cause });
|
|
934
|
+
}
|
|
935
|
+
}
|
|
929
936
|
} else {
|
|
930
937
|
const entry = services.directory().find((row2) => row2.provider === selection.provider);
|
|
931
938
|
if (!entry) throw new ClaudeRouteError("NO_ROUTE");
|
|
@@ -47,7 +47,7 @@ declare const routeErrors: {
|
|
|
47
47
|
/** Validation failures with fixed text safe for the conversation transcript. */
|
|
48
48
|
export declare class ClaudeRouteError extends HarnessError {
|
|
49
49
|
readonly reason: keyof typeof routeErrors;
|
|
50
|
-
constructor(reason: keyof typeof routeErrors);
|
|
50
|
+
constructor(reason: keyof typeof routeErrors, options?: ErrorOptions);
|
|
51
51
|
}
|
|
52
52
|
export declare function selectedClaudeModel(projection: {
|
|
53
53
|
pending?: ClaudeSelection | null;
|
package/package.json
CHANGED