ashishcode 0.1.0 → 0.1.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ashishcode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Source-run Bun CLI for Claude Code workflows with multi-provider support.",
|
|
6
6
|
"type": "module",
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"README.md",
|
|
13
|
-
"public",
|
|
14
13
|
"scripts/ashishcode.mjs",
|
|
15
14
|
"scripts/claude-local.mjs",
|
|
16
15
|
"src",
|
|
16
|
+
"!src/**/*.test.ts",
|
|
17
|
+
"!src/**/*.test.tsx",
|
|
17
18
|
"package.json",
|
|
18
19
|
"bun.lock"
|
|
19
20
|
],
|
package/public/claude-files.png
DELETED
|
Binary file
|
package/public/leak-tweet.png
DELETED
|
Binary file
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
compactModelDescription,
|
|
4
|
-
filterModelOptions,
|
|
5
|
-
getModelPickerDisplayDescription,
|
|
6
|
-
} from "./modelPickerHelpers.js";
|
|
7
|
-
|
|
8
|
-
describe("compactModelDescription", () => {
|
|
9
|
-
test("keeps short descriptions intact", () => {
|
|
10
|
-
expect(
|
|
11
|
-
compactModelDescription("Sonnet 4.6 · Best for everyday tasks"),
|
|
12
|
-
).toBe("Sonnet 4.6 · Best for everyday tasks");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
test("truncates long provider descriptions to a readable summary", () => {
|
|
16
|
-
expect(
|
|
17
|
-
compactModelDescription(
|
|
18
|
-
"256,000 context · KAT-Coder-Pro V2 is the latest high-performance model in KwaiKAT's KAT-Coder series, designed for complex enterprise-grade software engineering and SaaS integration.",
|
|
19
|
-
80,
|
|
20
|
-
),
|
|
21
|
-
).toBe(
|
|
22
|
-
"256,000 context · KAT-Coder-Pro V2 is the latest high-performance model in…",
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
describe("filterModelOptions", () => {
|
|
28
|
-
const options = [
|
|
29
|
-
{
|
|
30
|
-
value: "gpt-5",
|
|
31
|
-
label: "GPT-5",
|
|
32
|
-
description: "GitHub Copilot model",
|
|
33
|
-
descriptionForModel: "High reasoning model",
|
|
34
|
-
provider: "copilot" as const,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: "anthropic/claude-sonnet-4.6",
|
|
38
|
-
label: "Claude Sonnet 4.6",
|
|
39
|
-
description: "OpenRouter model",
|
|
40
|
-
descriptionForModel: "Everyday coding model",
|
|
41
|
-
provider: "openrouter" as const,
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
test("matches on labels, values, providers, and full descriptions", () => {
|
|
46
|
-
expect(filterModelOptions(options, "copilot")).toEqual([options[0]]);
|
|
47
|
-
expect(filterModelOptions(options, "claude-sonnet")).toEqual([options[1]]);
|
|
48
|
-
expect(filterModelOptions(options, "everyday coding")).toEqual([
|
|
49
|
-
options[1],
|
|
50
|
-
]);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
describe("getModelPickerDisplayDescription", () => {
|
|
55
|
-
test("shows provider labels for provider-backed models", () => {
|
|
56
|
-
expect(
|
|
57
|
-
getModelPickerDisplayDescription({
|
|
58
|
-
value: "gpt-5",
|
|
59
|
-
label: "GPT-5",
|
|
60
|
-
description: "Long provider description that should not be shown",
|
|
61
|
-
provider: "copilot",
|
|
62
|
-
}),
|
|
63
|
-
).toBe("GitHub Copilot");
|
|
64
|
-
|
|
65
|
-
expect(
|
|
66
|
-
getModelPickerDisplayDescription({
|
|
67
|
-
value: "anthropic/claude-sonnet-4.5",
|
|
68
|
-
label: "Claude Sonnet 4.5",
|
|
69
|
-
description: "Another long provider description",
|
|
70
|
-
provider: "openrouter",
|
|
71
|
-
}),
|
|
72
|
-
).toBe("OpenRouter");
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
normalizeDomain,
|
|
4
|
-
parseCopilotModelOptions,
|
|
5
|
-
} from "./copilot/provider.js";
|
|
6
|
-
import { parseOpenRouterModelOptions } from "./openrouter/provider.js";
|
|
7
|
-
import {
|
|
8
|
-
CLAUDE_OPUS_4_CONFIG,
|
|
9
|
-
CLAUDE_OPUS_4_1_CONFIG,
|
|
10
|
-
} from "../utils/model/configs.js";
|
|
11
|
-
import {
|
|
12
|
-
getCLIProviderName,
|
|
13
|
-
toSelectableAPIProvider,
|
|
14
|
-
} from "../utils/providerSelection.js";
|
|
15
|
-
|
|
16
|
-
describe("OpenRouter provider catalog", () => {
|
|
17
|
-
test("accepts nullable context metadata from the API", () => {
|
|
18
|
-
const options = parseOpenRouterModelOptions({
|
|
19
|
-
data: [
|
|
20
|
-
{
|
|
21
|
-
id: "anthropic/claude-sonnet-4.6",
|
|
22
|
-
name: "Claude Sonnet 4.6",
|
|
23
|
-
description: "Everyday coding model",
|
|
24
|
-
context_length: null,
|
|
25
|
-
pricing: {
|
|
26
|
-
prompt: null,
|
|
27
|
-
completion: null,
|
|
28
|
-
},
|
|
29
|
-
top_provider: {
|
|
30
|
-
context_length: null,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
expect(options).toEqual([
|
|
37
|
-
{
|
|
38
|
-
value: "anthropic/claude-sonnet-4.6",
|
|
39
|
-
label: "Claude Sonnet 4.6",
|
|
40
|
-
description: "OpenRouter model · Everyday coding model",
|
|
41
|
-
provider: "openrouter",
|
|
42
|
-
},
|
|
43
|
-
]);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe("Copilot provider catalog", () => {
|
|
48
|
-
test("normalizes nullable provider fields and keeps unsupported models disabled", () => {
|
|
49
|
-
const options = parseCopilotModelOptions({
|
|
50
|
-
data: [
|
|
51
|
-
{
|
|
52
|
-
id: "gpt-5",
|
|
53
|
-
name: null,
|
|
54
|
-
model_picker_enabled: null,
|
|
55
|
-
supported_endpoints: ["responses"],
|
|
56
|
-
capabilities: {
|
|
57
|
-
supports: {
|
|
58
|
-
tool_calls: null,
|
|
59
|
-
vision: null,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "legacy-chat",
|
|
65
|
-
name: "Legacy Chat",
|
|
66
|
-
model_picker_enabled: true,
|
|
67
|
-
supported_endpoints: ["embeddings"],
|
|
68
|
-
capabilities: {
|
|
69
|
-
supports: {
|
|
70
|
-
tool_calls: false,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
expect(options).toEqual([
|
|
78
|
-
{
|
|
79
|
-
value: "gpt-5",
|
|
80
|
-
label: "gpt-5",
|
|
81
|
-
description: "GitHub Copilot model",
|
|
82
|
-
disabled: false,
|
|
83
|
-
provider: "copilot",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
value: "legacy-chat",
|
|
87
|
-
label: "Legacy Chat",
|
|
88
|
-
description:
|
|
89
|
-
"GitHub Copilot model · Tool calling unavailable, disabled in Claude Code",
|
|
90
|
-
disabled: true,
|
|
91
|
-
provider: "copilot",
|
|
92
|
-
},
|
|
93
|
-
]);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
test("normalizes enterprise URLs to hostnames before building endpoints", () => {
|
|
97
|
-
expect(normalizeDomain("ghe.example.com")).toBe("ghe.example.com");
|
|
98
|
-
expect(normalizeDomain("https://ghe.example.com")).toBe("ghe.example.com");
|
|
99
|
-
expect(normalizeDomain("https://ghe.example.com/foo/bar")).toBe(
|
|
100
|
-
"ghe.example.com",
|
|
101
|
-
);
|
|
102
|
-
expect(normalizeDomain("https://ghe.example.com:8443/foo/bar?x=1")).toBe(
|
|
103
|
-
"ghe.example.com:8443",
|
|
104
|
-
);
|
|
105
|
-
expect(normalizeDomain("ghe.example.com/foo/bar")).toBe("ghe.example.com");
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
describe("Anthropic provider helpers", () => {
|
|
110
|
-
test("maps public and internal anthropic provider names consistently", () => {
|
|
111
|
-
expect(toSelectableAPIProvider("anthropic")).toBe("firstParty");
|
|
112
|
-
expect(toSelectableAPIProvider("default")).toBe("firstParty");
|
|
113
|
-
expect(toSelectableAPIProvider("firstparty")).toBe("firstParty");
|
|
114
|
-
expect(getCLIProviderName("firstParty")).toBe("anthropic");
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test("keeps Copilot Opus 4 and 4.1 ids distinct", () => {
|
|
118
|
-
expect(CLAUDE_OPUS_4_CONFIG.copilot).toBe("claude-opus-4");
|
|
119
|
-
expect(CLAUDE_OPUS_4_1_CONFIG.copilot).toBe("claude-opus-4-1");
|
|
120
|
-
expect(CLAUDE_OPUS_4_CONFIG.copilot).not.toBe(
|
|
121
|
-
CLAUDE_OPUS_4_1_CONFIG.copilot,
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
});
|