@levelcode/sdk 0.0.3 → 0.0.4
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/CHANGELOG.md +1 -1
- package/README.md +4 -4
- package/dist/index.cjs +19 -11
- package/dist/index.cjs.map +10 -10
- package/dist/index.d.ts +3443 -0
- package/dist/index.mjs +19 -11
- package/dist/index.mjs.map +10 -10
- package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/wasm/tree-sitter-c-sharp.wasm +0 -0
- package/dist/wasm/tree-sitter-cpp.wasm +0 -0
- package/dist/wasm/tree-sitter-go.wasm +0 -0
- package/dist/wasm/tree-sitter-java.wasm +0 -0
- package/dist/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/wasm/tree-sitter-python.wasm +0 -0
- package/dist/wasm/tree-sitter-ruby.wasm +0 -0
- package/dist/wasm/tree-sitter-rust.wasm +0 -0
- package/dist/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/wasm/tree-sitter.wasm +0 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -13094,7 +13094,7 @@ import path17 from "path";
|
|
|
13094
13094
|
import z from "zod/v4";
|
|
13095
13095
|
var clientEnvSchema = z.object({
|
|
13096
13096
|
NEXT_PUBLIC_CB_ENVIRONMENT: z.enum(["dev", "test", "prod"]).default("prod"),
|
|
13097
|
-
NEXT_PUBLIC_LEVELCODE_APP_URL: z.string().default(""),
|
|
13097
|
+
NEXT_PUBLIC_LEVELCODE_APP_URL: z.string().default("https://levelcode.vercel.app"),
|
|
13098
13098
|
NEXT_PUBLIC_SUPPORT_EMAIL: z.string().default("support@levelcode.ai"),
|
|
13099
13099
|
NEXT_PUBLIC_POSTHOG_API_KEY: z.string().default(""),
|
|
13100
13100
|
NEXT_PUBLIC_POSTHOG_HOST_URL: z.string().default("https://app.posthog.com"),
|
|
@@ -13120,7 +13120,7 @@ var clientProcessEnv = {
|
|
|
13120
13120
|
var parsedEnv = clientEnvSchema.safeParse(clientProcessEnv);
|
|
13121
13121
|
var fallbackEnv = {
|
|
13122
13122
|
NEXT_PUBLIC_CB_ENVIRONMENT: "prod",
|
|
13123
|
-
NEXT_PUBLIC_LEVELCODE_APP_URL: "",
|
|
13123
|
+
NEXT_PUBLIC_LEVELCODE_APP_URL: "https://levelcode.vercel.app",
|
|
13124
13124
|
NEXT_PUBLIC_SUPPORT_EMAIL: "support@levelcode.ai",
|
|
13125
13125
|
NEXT_PUBLIC_POSTHOG_API_KEY: "",
|
|
13126
13126
|
NEXT_PUBLIC_POSTHOG_HOST_URL: "https://app.posthog.com",
|
|
@@ -19619,7 +19619,7 @@ When the user requests a new git commit, please follow these steps closely:
|
|
|
19619
19619
|
4. **Create the commit, ending with this specific footer:**
|
|
19620
19620
|
\`\`\`
|
|
19621
19621
|
Generated with LevelCode \uD83E\uDD16
|
|
19622
|
-
Co-Authored-By: LevelCode <noreply@levelcode.
|
|
19622
|
+
Co-Authored-By: LevelCode <noreply@levelcode.vercel.app>
|
|
19623
19623
|
\`\`\`
|
|
19624
19624
|
To maintain proper formatting, use cross-platform compatible commit messages:
|
|
19625
19625
|
|
|
@@ -19629,7 +19629,7 @@ When the user requests a new git commit, please follow these steps closely:
|
|
|
19629
19629
|
Your commit message here.
|
|
19630
19630
|
|
|
19631
19631
|
\uD83E\uDD16 Generated with LevelCode
|
|
19632
|
-
Co-Authored-By: LevelCode <noreply@levelcode.
|
|
19632
|
+
Co-Authored-By: LevelCode <noreply@levelcode.vercel.app>
|
|
19633
19633
|
EOF
|
|
19634
19634
|
)"
|
|
19635
19635
|
\`\`\`
|
|
@@ -19639,7 +19639,7 @@ When the user requests a new git commit, please follow these steps closely:
|
|
|
19639
19639
|
git commit -m "Your commit message here.
|
|
19640
19640
|
|
|
19641
19641
|
\uD83E\uDD16 Generated with LevelCode
|
|
19642
|
-
Co-Authored-By: LevelCode <noreply@levelcode.
|
|
19642
|
+
Co-Authored-By: LevelCode <noreply@levelcode.vercel.app>"
|
|
19643
19643
|
\`\`\`
|
|
19644
19644
|
|
|
19645
19645
|
Always detect the platform and use the appropriate syntax. HEREDOC syntax (\`<<'EOF'\`) only works in bash/Unix shells and will fail on Windows Command Prompt.
|
|
@@ -19706,7 +19706,7 @@ ${$getNativeToolCallExampleString({
|
|
|
19706
19706
|
command: `git commit -m "Your commit message here.
|
|
19707
19707
|
|
|
19708
19708
|
\uD83E\uDD16 Generated with LevelCode
|
|
19709
|
-
Co-Authored-By: LevelCode <noreply@levelcode.
|
|
19709
|
+
Co-Authored-By: LevelCode <noreply@levelcode.vercel.app>"`
|
|
19710
19710
|
},
|
|
19711
19711
|
endsAgentStep: endsAgentStep18
|
|
19712
19712
|
})}
|
|
@@ -35298,9 +35298,15 @@ var getClaudeOAuthTokenFromEnv = () => {
|
|
|
35298
35298
|
var getOpenRouterApiKeyFromEnv = () => {
|
|
35299
35299
|
return process.env.OPENROUTER_API_KEY;
|
|
35300
35300
|
};
|
|
35301
|
+
var getOpenRouterBaseUrlFromEnv = () => {
|
|
35302
|
+
return process.env.OPENROUTER_BASE_URL;
|
|
35303
|
+
};
|
|
35301
35304
|
var getAnthropicApiKeyFromEnv = () => {
|
|
35302
35305
|
return process.env.ANTHROPIC_API_KEY;
|
|
35303
35306
|
};
|
|
35307
|
+
var getAnthropicBaseUrlFromEnv = () => {
|
|
35308
|
+
return process.env.ANTHROPIC_BASE_URL;
|
|
35309
|
+
};
|
|
35304
35310
|
var isStandaloneMode = () => {
|
|
35305
35311
|
const appUrl = process.env.NEXT_PUBLIC_LEVELCODE_APP_URL;
|
|
35306
35312
|
if (!appUrl)
|
|
@@ -38591,7 +38597,7 @@ var userFromJson = (json) => {
|
|
|
38591
38597
|
};
|
|
38592
38598
|
var getConfigDir = (clientEnv = env) => {
|
|
38593
38599
|
const envSuffix = clientEnv.NEXT_PUBLIC_CB_ENVIRONMENT && clientEnv.NEXT_PUBLIC_CB_ENVIRONMENT !== "prod" ? `-${clientEnv.NEXT_PUBLIC_CB_ENVIRONMENT}` : "";
|
|
38594
|
-
return path4.join(os2.homedir(), ".config", `
|
|
38600
|
+
return path4.join(os2.homedir(), ".config", `levelcode${envSuffix}`);
|
|
38595
38601
|
};
|
|
38596
38602
|
var getCredentialsPath = (clientEnv = env) => {
|
|
38597
38603
|
return path4.join(getConfigDir(clientEnv), "credentials.json");
|
|
@@ -38781,12 +38787,14 @@ async function fetchClaudeOAuthResetTime(accessToken) {
|
|
|
38781
38787
|
}
|
|
38782
38788
|
}
|
|
38783
38789
|
function createDirectOpenRouterModel(openRouterApiKey, model) {
|
|
38784
|
-
const
|
|
38790
|
+
const baseURL = getOpenRouterBaseUrlFromEnv();
|
|
38791
|
+
const provider = createOpenRouter({ apiKey: openRouterApiKey, compatibility: "strict", ...baseURL && { baseURL } });
|
|
38785
38792
|
return provider.chat(model);
|
|
38786
38793
|
}
|
|
38787
38794
|
function createDirectAnthropicModel(anthropicApiKey, model) {
|
|
38788
38795
|
const anthropicModelId = toAnthropicModelId(model);
|
|
38789
|
-
const
|
|
38796
|
+
const baseURL = getAnthropicBaseUrlFromEnv();
|
|
38797
|
+
const anthropic = createAnthropic({ apiKey: anthropicApiKey, ...baseURL && { baseURL } });
|
|
38790
38798
|
return anthropic(anthropicModelId);
|
|
38791
38799
|
}
|
|
38792
38800
|
async function getModelForRequest(params2) {
|
|
@@ -42147,7 +42155,7 @@ async function handlePromptResponse({
|
|
|
42147
42155
|
const message = [
|
|
42148
42156
|
"Received invalid prompt response from server:",
|
|
42149
42157
|
JSON.stringify(parsedOutput.error.issues),
|
|
42150
|
-
"If this issues persists, please contact support@levelcode.
|
|
42158
|
+
"If this issues persists, please contact support@levelcode.vercel.app"
|
|
42151
42159
|
].join(`
|
|
42152
42160
|
`);
|
|
42153
42161
|
onError({ message });
|
|
@@ -42477,5 +42485,5 @@ export {
|
|
|
42477
42485
|
IS_DEV
|
|
42478
42486
|
};
|
|
42479
42487
|
|
|
42480
|
-
//# debugId=
|
|
42488
|
+
//# debugId=E5A8E91746F38B8964756E2164756E21
|
|
42481
42489
|
//# sourceMappingURL=index.mjs.map
|