larkin 0.2.90 → 0.2.92
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.
|
@@ -36,6 +36,7 @@ exports.PI_PROVIDER_PRESETS = Object.freeze([
|
|
|
36
36
|
{ id: "openrouter", name: "OpenRouter", provider: "openrouter", baseUrl: "https://openrouter.ai/api/v1", defaultModel: "moonshotai/kimi-k2.6", api: "openai-completions" },
|
|
37
37
|
{ id: "kimi-coding", name: "Kimi For Coding", provider: "kimi-coding", baseUrl: "https://api.kimi.com/coding", defaultModel: "kimi-for-coding", api: "openai-completions" },
|
|
38
38
|
{ id: "qwen-cn", name: "通义千问 Token Plan(中国)", provider: "qwen-token-plan-cn", baseUrl: "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1", defaultModel: "qwen3.7-max", api: "openai-completions" },
|
|
39
|
+
{ id: "opencode-go", name: "OpenCode Go", provider: "opencode-go", baseUrl: "https://opencode.ai/zen/go/v1", defaultModel: "kimi-k2.6", api: "openai-completions" },
|
|
39
40
|
]);
|
|
40
41
|
const APP_ID = /^cli_[A-Za-z0-9]+$/;
|
|
41
42
|
const MODEL_ID = /^[A-Za-z0-9][A-Za-z0-9._:@+\/-]{0,255}$/;
|
|
@@ -22,6 +22,7 @@ export const PI_PROVIDER_PRESETS = Object.freeze([
|
|
|
22
22
|
{ id: "openrouter", name: "OpenRouter", provider: "openrouter", baseUrl: "https://openrouter.ai/api/v1", defaultModel: "moonshotai/kimi-k2.6", api: "openai-completions" },
|
|
23
23
|
{ id: "kimi-coding", name: "Kimi For Coding", provider: "kimi-coding", baseUrl: "https://api.kimi.com/coding", defaultModel: "kimi-for-coding", api: "openai-completions" },
|
|
24
24
|
{ id: "qwen-cn", name: "通义千问 Token Plan(中国)", provider: "qwen-token-plan-cn", baseUrl: "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1", defaultModel: "qwen3.7-max", api: "openai-completions" },
|
|
25
|
+
{ id: "opencode-go", name: "OpenCode Go", provider: "opencode-go", baseUrl: "https://opencode.ai/zen/go/v1", defaultModel: "kimi-k2.6", api: "openai-completions" },
|
|
25
26
|
]);
|
|
26
27
|
const APP_ID = /^cli_[A-Za-z0-9]+$/;
|
|
27
28
|
const MODEL_ID = /^[A-Za-z0-9][A-Za-z0-9._:@+\/-]{0,255}$/;
|
|
@@ -14,7 +14,7 @@ import { managedLarkCliEnv } from "../app/agent-lark-cli-workspace.mjs";
|
|
|
14
14
|
import { resolveOfficialLarkCli } from "../app/official-lark-cli.mjs";
|
|
15
15
|
import { collectSetupAgentChoice, recoverUnavailableExternalPi, terminalSetupQuestioner } from "./setup-agent-choice.mjs";
|
|
16
16
|
import { probeNativeRuntimeReadiness } from "../runtime/runtime-readiness.mjs";
|
|
17
|
-
import { configureBuiltinPiProviderModel, stageBuiltinPiProvider, validatePiBaseUrl, listProviderModels, PI_PROVIDER_PRESETS } from "../runtime/pi-provider-config.mjs";
|
|
17
|
+
import { configureBuiltinPiProviderModel, stageBuiltinPiProvider, validatePiBaseUrl, validateBuiltinPiProviderSelection, listProviderModels, PI_PROVIDER_PRESETS } from "../runtime/pi-provider-config.mjs";
|
|
18
18
|
import { beginBuiltinPiCredentialTransaction, createOfficialPiCredentialRuntime, createOfficialPiAuthInteraction, createOfficialPiModelRuntime, createOfficialPiLogoutRuntime, createOfficialPiRegistryRuntime, listOfficialPiAuthProviders, logoutOfficialPiProvider, officialPiAuthStatus, runOfficialPiLogin, verifyOfficialPiProviderTurn, } from "../runtime/pi-official-auth.mjs";
|
|
19
19
|
import { documentCommentSubscriptionCapability, markDocumentCommentSubscriptionVerified, } from "../platform/callback-capability.mjs";
|
|
20
20
|
// qrcode-terminal does not publish TypeScript declarations.
|
|
@@ -631,8 +631,12 @@ export async function main() {
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
stageBuiltinPiProvider(CFG_DIR, id, { ...raw, apiKey: setupApiKey });
|
|
634
|
+
// 选择文件写入解析后的全称模型(custom 预设为 larkin-custom/<model>):
|
|
635
|
+
// pi 运行时按 provider 前缀解析凭证,裸模型名会回落到默认 provider(deepseek)
|
|
636
|
+
// 导致「No API key found for deepseek」。
|
|
637
|
+
const validated = validateBuiltinPiProviderSelection({ ...raw, apiKey: setupApiKey });
|
|
634
638
|
temporaryAgentChoiceFile = path.join(CFG_DIR, `.setup-agent-choice-${process.pid}-${Date.now()}.json`);
|
|
635
|
-
fs.writeFileSync(temporaryAgentChoiceFile, `${JSON.stringify({ ...raw, runtime: "pi", authCompleted: true, readinessCompleted: true })}\n`, { mode: 0o600, flag: "wx" });
|
|
639
|
+
fs.writeFileSync(temporaryAgentChoiceFile, `${JSON.stringify({ ...raw, runtime: "pi", model: validated.model, authCompleted: true, readinessCompleted: true })}\n`, { mode: 0o600, flag: "wx" });
|
|
636
640
|
say(`[setup 2/5] ✓ 内置 Pi provider 已配置(${presetId}${setupBaseUrl ? " / custom" : ""})`);
|
|
637
641
|
}
|
|
638
642
|
else if (piDistributionFlag === "external" && (setupProvider || setupApiKey || setupBaseUrl)) {
|