@xtruder/opencode-claude-max-plugin 0.1.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/README.md +99 -0
- package/build/agent-index.d.ts +24 -0
- package/build/agent-index.d.ts.map +1 -0
- package/build/agent-index.js +294 -0
- package/build/agent-model.d.ts +34 -0
- package/build/agent-model.d.ts.map +1 -0
- package/build/agent-test.d.ts +2 -0
- package/build/agent-test.d.ts.map +1 -0
- package/build/credentials.d.ts +21 -0
- package/build/credentials.d.ts.map +1 -0
- package/build/index.d.ts +66 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +881 -0
- package/build/model.d.ts +19 -0
- package/build/model.d.ts.map +1 -0
- package/build/prompt.d.ts +11 -0
- package/build/prompt.d.ts.map +1 -0
- package/build/stream.d.ts +6 -0
- package/build/stream.d.ts.map +1 -0
- package/build/tool-names.d.ts +24 -0
- package/build/tool-names.d.ts.map +1 -0
- package/build/tools.d.ts +8 -0
- package/build/tools.d.ts.map +1 -0
- package/build/usage-cli.d.ts +3 -0
- package/build/usage-cli.d.ts.map +1 -0
- package/build/usage-cli.js +139 -0
- package/build/usage.d.ts +28 -0
- package/build/usage.d.ts.map +1 -0
- package/package.json +50 -0
package/build/model.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LanguageModelV2, LanguageModelV2CallOptions } from "@ai-sdk/provider";
|
|
2
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
3
|
+
type DoGenerateResult = Awaited<ReturnType<LanguageModelV2["doGenerate"]>>;
|
|
4
|
+
type DoStreamResult = Awaited<ReturnType<LanguageModelV2["doStream"]>>;
|
|
5
|
+
export declare class AnthropicSDKModel implements LanguageModelV2 {
|
|
6
|
+
private client;
|
|
7
|
+
private providerName;
|
|
8
|
+
private isOAuth;
|
|
9
|
+
readonly specificationVersion: "v2";
|
|
10
|
+
readonly provider: string;
|
|
11
|
+
readonly modelId: string;
|
|
12
|
+
readonly supportedUrls: Record<string, RegExp[]>;
|
|
13
|
+
constructor(modelId: string, client: Anthropic, providerName: string, isOAuth?: boolean);
|
|
14
|
+
private buildParams;
|
|
15
|
+
doGenerate(options: LanguageModelV2CallOptions): Promise<DoGenerateResult>;
|
|
16
|
+
doStream(options: LanguageModelV2CallOptions): Promise<DoStreamResult>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAK3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAA;AAQ9C,KAAK,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;AAC1E,KAAK,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;AAqGtE,qBAAa,iBAAkB,YAAW,eAAe;IAQrD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,OAAO;IATjB,QAAQ,CAAC,oBAAoB,EAAG,IAAI,CAAS;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAK;gBAGnD,OAAO,EAAE,MAAM,EACP,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,OAAe;IAMlC,OAAO,CAAC,WAAW;IAmLb,UAAU,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgE1E,QAAQ,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC;CA2C7E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LanguageModelV2Prompt } from "@ai-sdk/provider";
|
|
2
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
3
|
+
type AnthropicMessage = Anthropic.MessageCreateParams["messages"][number];
|
|
4
|
+
type AnthropicSystemParam = Anthropic.MessageCreateParams["system"];
|
|
5
|
+
export interface ConvertedPrompt {
|
|
6
|
+
system: AnthropicSystemParam;
|
|
7
|
+
messages: AnthropicMessage[];
|
|
8
|
+
}
|
|
9
|
+
export declare function convertPrompt(prompt: LanguageModelV2Prompt): ConvertedPrompt;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA0B,MAAM,kBAAkB,CAAA;AACrF,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAA;AAG9C,KAAK,gBAAgB,GAAG,SAAS,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzE,KAAK,oBAAoB,GAAG,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;AAEnE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,oBAAoB,CAAA;IAC5B,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC7B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAyB5E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LanguageModelV2StreamPart } from "@ai-sdk/provider";
|
|
2
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
3
|
+
type MessageStreamEvent = Anthropic.MessageStreamEvent;
|
|
4
|
+
export declare function convertStream(anthropicStream: AsyncIterable<MessageStreamEvent>, modelId: string): ReadableStream<LanguageModelV2StreamPart>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAA;AAG9C,KAAK,kBAAkB,GAAG,SAAS,CAAC,kBAAkB,CAAA;AAiCtD,wBAAgB,aAAa,CAC3B,eAAe,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAClD,OAAO,EAAE,MAAM,GACd,cAAc,CAAC,yBAAyB,CAAC,CA4C3C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explicitly set known MCP server names.
|
|
3
|
+
*/
|
|
4
|
+
export declare function setKnownMcpServers(servers: string[]): void;
|
|
5
|
+
/**
|
|
6
|
+
* Convert an OpenCode tool name to a Claude Code tool name.
|
|
7
|
+
*
|
|
8
|
+
* Built-in: `bash` → `Bash`, `task` → `Agent`, etc.
|
|
9
|
+
* MCP: `context7_query-docs` → `mcp__context7__query-docs`
|
|
10
|
+
*/
|
|
11
|
+
export declare function toClaudeToolName(opencodeName: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a Claude Code tool name back to an OpenCode tool name.
|
|
14
|
+
*
|
|
15
|
+
* Built-in: `Bash` → `bash`, `Agent` → `task`, etc.
|
|
16
|
+
* MCP: `mcp__context7__query-docs` → `context7_query-docs`
|
|
17
|
+
*/
|
|
18
|
+
export declare function toOpencodeToolName(claudeName: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Rewrite OpenCode tool names in system prompt text to match Claude Code names.
|
|
21
|
+
* This ensures the model sees tool names consistent with the tools list.
|
|
22
|
+
*/
|
|
23
|
+
export declare function rewriteToolNamesInText(text: string): string;
|
|
24
|
+
//# sourceMappingURL=tool-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-names.d.ts","sourceRoot":"","sources":["../src/tool-names.ts"],"names":[],"mappings":"AAoDA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAE1D;AAgED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAY7D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAiB7D;AAmCD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM3D"}
|
package/build/tools.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LanguageModelV2FunctionTool, LanguageModelV2ProviderDefinedTool, LanguageModelV2ToolChoice } from "@ai-sdk/provider";
|
|
2
|
+
import type Anthropic from "@anthropic-ai/sdk";
|
|
3
|
+
type AnthropicTool = Anthropic.Tool;
|
|
4
|
+
type AnthropicToolChoice = Anthropic.MessageCreateParams["tool_choice"];
|
|
5
|
+
export declare function convertTools(tools: Array<LanguageModelV2FunctionTool | LanguageModelV2ProviderDefinedTool> | undefined): AnthropicTool[] | undefined;
|
|
6
|
+
export declare function convertToolChoice(toolChoice: LanguageModelV2ToolChoice | undefined): AnthropicToolChoice | undefined;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,kCAAkC,EAClC,yBAAyB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAA;AAG9C,KAAK,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AACnC,KAAK,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAA;AAwBvE,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,CAAC,2BAA2B,GAAG,kCAAkC,CAAC,GAAG,SAAS,GACzF,aAAa,EAAE,GAAG,SAAS,CAU7B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,yBAAyB,GAAG,SAAS,GAChD,mBAAmB,GAAG,SAAS,CAcjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-cli.d.ts","sourceRoot":"","sources":["../src/usage-cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
// src/credentials.ts
|
|
4
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
function getCredentialsPath() {
|
|
8
|
+
return join(homedir(), ".claude", ".credentials.json");
|
|
9
|
+
}
|
|
10
|
+
function readClaudeCredentials(path) {
|
|
11
|
+
const credPath = path ?? getCredentialsPath();
|
|
12
|
+
if (!existsSync(credPath))
|
|
13
|
+
return null;
|
|
14
|
+
try {
|
|
15
|
+
const raw = readFileSync(credPath, "utf-8");
|
|
16
|
+
const parsed = JSON.parse(raw);
|
|
17
|
+
if (!parsed.claudeAiOauth?.accessToken)
|
|
18
|
+
return null;
|
|
19
|
+
return parsed.claudeAiOauth;
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function isExpired(creds) {
|
|
25
|
+
const buffer = 5 * 60 * 1000;
|
|
26
|
+
return Date.now() > creds.expiresAt - buffer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/usage.ts
|
|
30
|
+
var USAGE_URL = "https://api.anthropic.com/api/oauth/usage";
|
|
31
|
+
async function fetchUsage(credentialsPath) {
|
|
32
|
+
const creds = readClaudeCredentials(credentialsPath);
|
|
33
|
+
if (!creds)
|
|
34
|
+
return null;
|
|
35
|
+
if (isExpired(creds))
|
|
36
|
+
return null;
|
|
37
|
+
const resp = await fetch(USAGE_URL, {
|
|
38
|
+
headers: {
|
|
39
|
+
authorization: `Bearer ${creds.accessToken}`,
|
|
40
|
+
"anthropic-beta": "claude-code-20250219,oauth-2025-04-20",
|
|
41
|
+
"content-type": "application/json",
|
|
42
|
+
"user-agent": "claude-cli/2.1.81 (external, sdk-cli)",
|
|
43
|
+
"x-app": "cli"
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (!resp.ok)
|
|
47
|
+
return null;
|
|
48
|
+
return resp.json();
|
|
49
|
+
}
|
|
50
|
+
function progressBar(utilization, width = 50) {
|
|
51
|
+
const filled = Math.round(utilization / 100 * width);
|
|
52
|
+
const bar = "█".repeat(filled) + " ".repeat(width - filled);
|
|
53
|
+
return bar;
|
|
54
|
+
}
|
|
55
|
+
function formatReset(resetsAt) {
|
|
56
|
+
if (!resetsAt)
|
|
57
|
+
return "";
|
|
58
|
+
const reset = new Date(resetsAt);
|
|
59
|
+
const now = new Date;
|
|
60
|
+
const diffMs = reset.getTime() - now.getTime();
|
|
61
|
+
if (diffMs <= 0)
|
|
62
|
+
return "Reset now";
|
|
63
|
+
const diffMin = Math.floor(diffMs / 60000);
|
|
64
|
+
const diffHour = Math.floor(diffMin / 60);
|
|
65
|
+
const timeStr = reset.toLocaleTimeString("en-US", {
|
|
66
|
+
hour: "numeric",
|
|
67
|
+
minute: "2-digit",
|
|
68
|
+
timeZoneName: "short"
|
|
69
|
+
});
|
|
70
|
+
const dateStr = reset.toLocaleDateString("en-US", {
|
|
71
|
+
month: "short",
|
|
72
|
+
day: "numeric"
|
|
73
|
+
});
|
|
74
|
+
if (diffHour < 24) {
|
|
75
|
+
return `Resets ${timeStr}`;
|
|
76
|
+
}
|
|
77
|
+
return `Resets ${dateStr}, ${timeStr}`;
|
|
78
|
+
}
|
|
79
|
+
function formatUsage(data) {
|
|
80
|
+
const lines = [];
|
|
81
|
+
if (data.five_hour) {
|
|
82
|
+
const pct = Math.round(data.five_hour.utilization);
|
|
83
|
+
lines.push(" Current session");
|
|
84
|
+
lines.push(` ${progressBar(pct)} ${pct}% used`);
|
|
85
|
+
lines.push(` ${formatReset(data.five_hour.resets_at)}`);
|
|
86
|
+
lines.push("");
|
|
87
|
+
}
|
|
88
|
+
if (data.seven_day) {
|
|
89
|
+
const pct = Math.round(data.seven_day.utilization);
|
|
90
|
+
lines.push(" Current week (all models)");
|
|
91
|
+
lines.push(` ${progressBar(pct)} ${pct}% used`);
|
|
92
|
+
lines.push(` ${formatReset(data.seven_day.resets_at)}`);
|
|
93
|
+
lines.push("");
|
|
94
|
+
}
|
|
95
|
+
if (data.seven_day_sonnet) {
|
|
96
|
+
const pct = Math.round(data.seven_day_sonnet.utilization);
|
|
97
|
+
lines.push(" Current week (Sonnet only)");
|
|
98
|
+
lines.push(` ${progressBar(pct)} ${pct}% used`);
|
|
99
|
+
if (data.seven_day_sonnet.resets_at) {
|
|
100
|
+
lines.push(` ${formatReset(data.seven_day_sonnet.resets_at)}`);
|
|
101
|
+
}
|
|
102
|
+
lines.push("");
|
|
103
|
+
}
|
|
104
|
+
if (data.seven_day_opus) {
|
|
105
|
+
const pct = Math.round(data.seven_day_opus.utilization);
|
|
106
|
+
lines.push(" Current week (Opus only)");
|
|
107
|
+
lines.push(` ${progressBar(pct)} ${pct}% used`);
|
|
108
|
+
if (data.seven_day_opus.resets_at) {
|
|
109
|
+
lines.push(` ${formatReset(data.seven_day_opus.resets_at)}`);
|
|
110
|
+
}
|
|
111
|
+
lines.push("");
|
|
112
|
+
}
|
|
113
|
+
if (data.extra_usage) {
|
|
114
|
+
if (data.extra_usage.is_enabled) {
|
|
115
|
+
const pct = Math.round(data.extra_usage.utilization ?? 0);
|
|
116
|
+
lines.push(" Extra usage");
|
|
117
|
+
lines.push(` ${progressBar(pct)} ${pct}% used`);
|
|
118
|
+
if (data.extra_usage.monthly_limit != null) {
|
|
119
|
+
lines.push(` $${data.extra_usage.used_credits?.toFixed(2) ?? "0.00"} / $${data.extra_usage.monthly_limit.toFixed(2)}`);
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
lines.push(" Extra usage: disabled");
|
|
123
|
+
}
|
|
124
|
+
lines.push("");
|
|
125
|
+
}
|
|
126
|
+
return lines.join(`
|
|
127
|
+
`);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/usage-cli.ts
|
|
131
|
+
var data = await fetchUsage();
|
|
132
|
+
if (!data) {
|
|
133
|
+
console.error("Could not fetch usage. Make sure you're logged into Claude Code (~/.claude/.credentials.json).");
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
console.log("");
|
|
137
|
+
console.log(" Claude Subscription Usage");
|
|
138
|
+
console.log(" " + "─".repeat(52));
|
|
139
|
+
console.log(formatUsage(data));
|
package/build/usage.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface UsageWindow {
|
|
2
|
+
utilization: number;
|
|
3
|
+
resets_at: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface UsageData {
|
|
6
|
+
five_hour: UsageWindow | null;
|
|
7
|
+
seven_day: UsageWindow | null;
|
|
8
|
+
seven_day_sonnet: UsageWindow | null;
|
|
9
|
+
seven_day_opus: UsageWindow | null;
|
|
10
|
+
seven_day_oauth_apps: UsageWindow | null;
|
|
11
|
+
seven_day_cowork: UsageWindow | null;
|
|
12
|
+
extra_usage: {
|
|
13
|
+
is_enabled: boolean;
|
|
14
|
+
monthly_limit: number | null;
|
|
15
|
+
used_credits: number | null;
|
|
16
|
+
utilization: number | null;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch current Claude subscription usage.
|
|
21
|
+
* Returns null if not using OAuth credentials.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchUsage(credentialsPath?: string): Promise<UsageData | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Format usage data as a display string matching Claude Code's /usage output.
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatUsage(data: UsageData): string;
|
|
28
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAA;IACpC,cAAc,EAAE,WAAW,GAAG,IAAI,CAAA;IAClC,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAA;IACxC,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAA;IACpC,WAAW,EAAE;QACX,UAAU,EAAE,OAAO,CAAA;QACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAC3B,GAAG,IAAI,CAAA;CACT;AAID;;;GAGG;AACH,wBAAsB,UAAU,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAiBpF;AA0CD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAsDnD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xtruder/opencode-claude-max-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OpenCode plugin for Claude Max/Pro subscription via @anthropic-ai/sdk - uses Claude Code OAuth credentials",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"types": "build/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./build/index.js",
|
|
11
|
+
"types": "./build/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./agent": {
|
|
14
|
+
"import": "./build/agent-index.js",
|
|
15
|
+
"types": "./build/agent-index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"claude-usage": "build/usage-cli.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"build"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bun build ./src/index.ts ./src/agent-index.ts ./src/usage-cli.ts --outdir ./build --target node --format esm --packages external && bun x tsc --emitDeclarationOnly --declaration --outDir build",
|
|
26
|
+
"test": "bun run src/test.ts"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.81",
|
|
30
|
+
"@anthropic-ai/sdk": "0.74.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@ai-sdk/provider": ">=2.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@ai-sdk/provider": "2.0.1",
|
|
37
|
+
"@ai-sdk/provider-utils": "3.0.2",
|
|
38
|
+
"ai": "5.0.124",
|
|
39
|
+
"bun-types": "^1.3.11",
|
|
40
|
+
"typescript": "^5.7.0"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"opencode",
|
|
44
|
+
"anthropic",
|
|
45
|
+
"claude",
|
|
46
|
+
"ai-sdk",
|
|
47
|
+
"provider"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT"
|
|
50
|
+
}
|