pointcode 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +108 -28
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -109655,10 +109655,19 @@ function parseUserSpecifiedModel(modelInput) {
109655
109655
  case "opusplan":
109656
109656
  return getDefaultSonnetModel() + (has1mTag ? "[1m]" : "");
109657
109657
  case "sonnet":
109658
+ if (getAPIProvider() === "openai") {
109659
+ return modelInputTrimmed;
109660
+ }
109658
109661
  return getDefaultSonnetModel() + (has1mTag ? "[1m]" : "");
109659
109662
  case "haiku":
109663
+ if (getAPIProvider() === "openai") {
109664
+ return modelInputTrimmed;
109665
+ }
109660
109666
  return getDefaultHaikuModel() + (has1mTag ? "[1m]" : "");
109661
109667
  case "opus":
109668
+ if (getAPIProvider() === "openai") {
109669
+ return modelInputTrimmed;
109670
+ }
109662
109671
  return getDefaultOpusModel() + (has1mTag ? "[1m]" : "");
109663
109672
  case "best":
109664
109673
  return getBestModel();
@@ -123105,7 +123114,7 @@ var init_metadata = __esm(() => {
123105
123114
  isClaudeAiAuth: isClaudeAISubscriber(),
123106
123115
  version: "99.0.0",
123107
123116
  versionBase: getVersionBase(),
123108
- buildTime: "2026-04-02T16:31:04.646Z",
123117
+ buildTime: "2026-04-02T17:11:37.808Z",
123109
123118
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
123110
123119
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
123111
123120
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -364187,7 +364196,7 @@ function getAnthropicEnvMetadata() {
364187
364196
  function getBuildAgeMinutes() {
364188
364197
  if (false)
364189
364198
  ;
364190
- const buildTime = new Date("2026-04-02T16:31:04.646Z").getTime();
364199
+ const buildTime = new Date("2026-04-02T17:11:37.808Z").getTime();
364191
364200
  if (isNaN(buildTime))
364192
364201
  return;
364193
364202
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -428483,7 +428492,7 @@ function getRecentActivitySync() {
428483
428492
  return cachedActivity;
428484
428493
  }
428485
428494
  function getLogoDisplayData() {
428486
- const version2 = process.env.DEMO_VERSION ?? "0.1.4" ?? "99.0.0";
428495
+ const version2 = process.env.DEMO_VERSION ?? "0.1.6" ?? "99.0.0";
428487
428496
  const serverUrl = getDirectConnectServerUrl();
428488
428497
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
428489
428498
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -458283,7 +458292,7 @@ var init_bridge_kick = __esm(() => {
458283
458292
  var call54 = async () => {
458284
458293
  return {
458285
458294
  type: "text",
458286
- value: `${"99.0.0"} (built ${"2026-04-02T16:31:04.646Z"})`
458295
+ value: `${"99.0.0"} (built ${"2026-04-02T17:11:37.808Z"})`
458287
458296
  };
458288
458297
  }, version2, version_default;
458289
458298
  var init_version = __esm(() => {
@@ -461303,23 +461312,91 @@ var exports_model2 = {};
461303
461312
  __export(exports_model2, {
461304
461313
  call: () => call61
461305
461314
  });
461306
- async function saveModelApiKey(value, onDone) {
461307
- if (getAPIProvider() === "openai") {
461315
+ function clearThirdPartyProviderFlags() {
461316
+ delete process.env.CLAUDE_CODE_USE_OPENAI;
461317
+ delete process.env.CLAUDE_CODE_USE_GEMINI;
461318
+ delete process.env.CLAUDE_CODE_USE_BEDROCK;
461319
+ delete process.env.CLAUDE_CODE_USE_VERTEX;
461320
+ delete process.env.CLAUDE_CODE_USE_FOUNDRY;
461321
+ }
461322
+ function isAnthropicFamilyModel(model) {
461323
+ if (!model) {
461324
+ return false;
461325
+ }
461326
+ const normalized = model.toLowerCase();
461327
+ return normalized.includes("opus") || normalized.includes("sonnet") || normalized.includes("haiku") || normalized.includes("claude");
461328
+ }
461329
+ function buildCredentialMismatchHint(model, errorText) {
461330
+ const lower = (errorText ?? "").toLowerCase();
461331
+ const likelyAuthError = lower.includes("auth") || lower.includes("invalid api key") || lower.includes("api key") || lower.includes("401") || lower.includes("403");
461332
+ if (!likelyAuthError) {
461333
+ return "";
461334
+ }
461335
+ if (isAnthropicFamilyModel(model)) {
461336
+ return `Model '${model}' belongs to Claude family. Please use an Anthropic/Claude API key, or switch to qwen/deepseek/glm/mimo if you want to use OpenAI-compatible keys.`;
461337
+ }
461338
+ return `Model '${model}' uses an OpenAI-compatible provider. Please use the matching provider key (for example Qwen, DeepSeek, GLM, or MiMo key).`;
461339
+ }
461340
+ async function validateModelAccessAfterSave(modelValue) {
461341
+ if (!modelValue) {
461342
+ return {
461343
+ ok: true
461344
+ };
461345
+ }
461346
+ const modelToValidate = parseUserSpecifiedModel(modelValue);
461347
+ const {
461348
+ valid,
461349
+ error: error42
461350
+ } = await validateModel(modelToValidate);
461351
+ if (valid) {
461352
+ return {
461353
+ ok: true
461354
+ };
461355
+ }
461356
+ const hint = buildCredentialMismatchHint(modelToValidate, error42);
461357
+ return {
461358
+ ok: false,
461359
+ message: `${API_KEY_SAVED_MESSAGE}
461360
+ Validation failed for '${modelToValidate}': ${error42}${hint ? `
461361
+ ${hint}` : ""}`
461362
+ };
461363
+ }
461364
+ function resolveBaseUrlForModel(model) {
461365
+ if (!model) {
461366
+ return process.env.OPENAI_BASE_URL;
461367
+ }
461368
+ const provider = getCNProviderList().find((item) => item.models.some((m) => m.id === model));
461369
+ if (provider) {
461370
+ return provider.baseUrl;
461371
+ }
461372
+ return process.env.OPENAI_BASE_URL;
461373
+ }
461374
+ async function saveModelApiKey(value, onDone, modelValue) {
461375
+ try {
461376
+ if (isAnthropicFamilyModel(modelValue) || /^sk-ant/i.test(value)) {
461377
+ clearThirdPartyProviderFlags();
461378
+ await saveApiKey(value);
461379
+ process.env.ANTHROPIC_API_KEY = value;
461380
+ delete process.env.OPENAI_API_KEY;
461381
+ const validation2 = await validateModelAccessAfterSave(modelValue);
461382
+ onDone(validation2.ok ? API_KEY_SAVED_MESSAGE : validation2.message, {
461383
+ display: "system"
461384
+ });
461385
+ return;
461386
+ }
461387
+ const openAIModel = modelValue ?? process.env.OPENAI_MODEL ?? "qwen3.5-plus";
461388
+ const openAIBaseUrl = resolveBaseUrlForModel(openAIModel) ?? "https://dashscope.aliyuncs.com/compatible-mode/v1";
461308
461389
  const profile = saveOpenAIProviderProfile({
461309
- OPENAI_BASE_URL: process.env.OPENAI_BASE_URL,
461310
- OPENAI_MODEL: process.env.OPENAI_MODEL,
461390
+ OPENAI_BASE_URL: openAIBaseUrl,
461391
+ OPENAI_MODEL: openAIModel,
461311
461392
  OPENAI_API_KEY: value
461312
461393
  });
461313
461394
  applyProviderProfileToProcessEnv(profile);
461314
- onDone("API key saved. You can now run /model to choose a model and start using PointCode.", {
461315
- display: "system"
461316
- });
461317
- return;
461318
- }
461319
- try {
461395
+ process.env.CLAUDE_CODE_USE_OPENAI = "1";
461396
+ delete process.env.ANTHROPIC_API_KEY;
461320
461397
  await saveApiKey(value);
461321
- process.env.ANTHROPIC_API_KEY = value;
461322
- onDone("API key saved. You can now run /model to choose a model and start using PointCode.", {
461398
+ const validation = await validateModelAccessAfterSave(modelValue);
461399
+ onDone(validation.ok ? API_KEY_SAVED_MESSAGE : validation.message, {
461323
461400
  display: "system"
461324
461401
  });
461325
461402
  } catch (error42) {
@@ -461329,7 +461406,8 @@ async function saveModelApiKey(value, onDone) {
461329
461406
  }
461330
461407
  }
461331
461408
  function EnterApiKeyAndSave({
461332
- onDone
461409
+ onDone,
461410
+ modelValue
461333
461411
  }) {
461334
461412
  const terminalSize = useTerminalSize();
461335
461413
  const [apiKey, setApiKey] = import_react194.useState("");
@@ -461341,7 +461419,7 @@ function EnterApiKeyAndSave({
461341
461419
  setErrorText("API key cannot be empty.");
461342
461420
  return;
461343
461421
  }
461344
- saveModelApiKey(value, onDone);
461422
+ saveModelApiKey(value, onDone, modelValue);
461345
461423
  }
461346
461424
  return /* @__PURE__ */ jsx_dev_runtime352.jsxDEV(ThemedBox_default, {
461347
461425
  flexDirection: "column",
@@ -461453,7 +461531,7 @@ function ModelPickerWrapper(t0) {
461453
461531
  return;
461454
461532
  }
461455
461533
  let selectedModel = model;
461456
- if (selectedModel !== null && getAPIProvider() === "openai") {
461534
+ if (selectedModel !== null && !isAnthropicFamilyModel(selectedModel)) {
461457
461535
  selectedModel = switchOpenAIModel(selectedModel);
461458
461536
  }
461459
461537
  if (selectedModel !== null) {
@@ -461468,8 +461546,9 @@ function ModelPickerWrapper(t0) {
461468
461546
  const showFastModeNotice = isFastModeEnabled() && isFastMode && isFastModeSupportedByModel(mainLoopModel) && isFastModeAvailable();
461469
461547
  if (pendingSelection) {
461470
461548
  return /* @__PURE__ */ jsx_dev_runtime352.jsxDEV(EnterApiKeyAndSave, {
461549
+ modelValue: pendingSelection.model,
461471
461550
  onDone: (result, options2) => {
461472
- if (!result || !result.startsWith("API key saved")) {
461551
+ if (!result || result !== API_KEY_SAVED_MESSAGE) {
461473
461552
  onDone(result, options2);
461474
461553
  return;
461475
461554
  }
@@ -461665,7 +461744,7 @@ function renderModelLabel(model) {
461665
461744
  const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
461666
461745
  return model === null ? `${rendered} (default)` : rendered;
461667
461746
  }
461668
- var React110, import_react194, jsx_dev_runtime352, call61 = async (onDone, _context, args) => {
461747
+ var React110, import_react194, jsx_dev_runtime352, API_KEY_SAVED_MESSAGE = "API key saved. You can now run /model to choose a model and start using PointCode.", call61 = async (onDone, _context, args) => {
461669
461748
  args = args?.trim() || "";
461670
461749
  const missingOpenAIKeyTip = getMissingOpenAIKeyTip();
461671
461750
  if (!args && missingOpenAIKeyTip) {
@@ -461738,6 +461817,7 @@ var init_model2 = __esm(() => {
461738
461817
  init_validateModel();
461739
461818
  init_auth2();
461740
461819
  init_providerSetup();
461820
+ init_cnProviders();
461741
461821
  React110 = __toESM(require_react(), 1);
461742
461822
  import_react194 = __toESM(require_react(), 1);
461743
461823
  jsx_dev_runtime352 = __toESM(require_jsx_dev_runtime(), 1);
@@ -530989,7 +531069,7 @@ function WelcomeV2() {
530989
531069
  dimColor: true,
530990
531070
  children: [
530991
531071
  "v",
530992
- "0.1.4",
531072
+ "0.1.6",
530993
531073
  " "
530994
531074
  ]
530995
531075
  }, undefined, true, undefined, this)
@@ -531189,7 +531269,7 @@ function WelcomeV2() {
531189
531269
  dimColor: true,
531190
531270
  children: [
531191
531271
  "v",
531192
- "0.1.4",
531272
+ "0.1.6",
531193
531273
  " "
531194
531274
  ]
531195
531275
  }, undefined, true, undefined, this)
@@ -531415,7 +531495,7 @@ function AppleTerminalWelcomeV2(t0) {
531415
531495
  dimColor: true,
531416
531496
  children: [
531417
531497
  "v",
531418
- "0.1.4",
531498
+ "0.1.6",
531419
531499
  " "
531420
531500
  ]
531421
531501
  }, undefined, true, undefined, this);
@@ -531669,7 +531749,7 @@ function AppleTerminalWelcomeV2(t0) {
531669
531749
  dimColor: true,
531670
531750
  children: [
531671
531751
  "v",
531672
- "0.1.4",
531752
+ "0.1.6",
531673
531753
  " "
531674
531754
  ]
531675
531755
  }, undefined, true, undefined, this);
@@ -552159,7 +552239,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
552159
552239
  pendingHookMessages
552160
552240
  }, renderAndRun);
552161
552241
  }
552162
- }).version("0.1.4 (Open Claude)", "-v, --version", "Output the version number");
552242
+ }).version("0.1.6 (Open Claude)", "-v, --version", "Output the version number");
552163
552243
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
552164
552244
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
552165
552245
  if (canUserConfigureAdvisor()) {
@@ -552718,7 +552798,7 @@ function validateProviderEnvOrExit() {
552718
552798
  async function main2() {
552719
552799
  const args = process.argv.slice(2);
552720
552800
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
552721
- console.log(`${"0.1.4"} (PointCode)`);
552801
+ console.log(`${"0.1.6"} (PointCode)`);
552722
552802
  return;
552723
552803
  }
552724
552804
  validateProviderEnvOrExit();
@@ -552805,4 +552885,4 @@ async function main2() {
552805
552885
  }
552806
552886
  main2();
552807
552887
 
552808
- //# debugId=8E8ABDC9A8B939B064756E2164756E21
552888
+ //# debugId=2743E17132C9179364756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pointcode",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "PointCode - 可自定义UI的AI编程助手",
5
5
  "type": "module",
6
6
  "bin": {