@costrict/cs 2.0.3 → 2.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.
Files changed (2) hide show
  1. package/bundle/gemini.js +45 -16
  2. package/package.json +1 -1
package/bundle/gemini.js CHANGED
@@ -109348,7 +109348,9 @@ var init_tools = __esm({
109348
109348
  cleanup();
109349
109349
  resolve29("ASK_USER");
109350
109350
  }, 3e4);
109351
- this.messageBus.subscribe(MessageBusType.TOOL_CONFIRMATION_RESPONSE, responseHandler);
109351
+ if (this.messageBus && typeof this.messageBus.subscribe === "function") {
109352
+ this.messageBus.subscribe(MessageBusType.TOOL_CONFIRMATION_RESPONSE, responseHandler);
109353
+ }
109352
109354
  const request3 = {
109353
109355
  type: MessageBusType.TOOL_CONFIRMATION_REQUEST,
109354
109356
  toolCall,
@@ -118585,7 +118587,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
118585
118587
  import path16 from "node:path";
118586
118588
  async function getVersion() {
118587
118589
  const pkgJson = await getPackageJson(__dirname3);
118588
- return "2.0.3";
118590
+ return "2.0.4";
118589
118591
  }
118590
118592
  var __filename2, __dirname3;
118591
118593
  var init_version2 = __esm({
@@ -173542,8 +173544,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
173542
173544
  var init_git_commit = __esm({
173543
173545
  "packages/core/dist/src/generated/git-commit.js"() {
173544
173546
  "use strict";
173545
- GIT_COMMIT_INFO = "dfdd00850";
173546
- CLI_VERSION = "2.0.3";
173547
+ GIT_COMMIT_INFO = "a48888634";
173548
+ CLI_VERSION = "2.0.4";
173547
173549
  }
173548
173550
  });
173549
173551
 
@@ -262226,7 +262228,7 @@ var init_default2 = __esm({
262226
262228
  this.contentGeneratorConfig = contentGeneratorConfig;
262227
262229
  }
262228
262230
  buildHeaders() {
262229
- const version4 = "2.0.3";
262231
+ const version4 = "2.0.4";
262230
262232
  const userAgent = `CoStrict/${version4} (${process.platform}; ${process.arch})`;
262231
262233
  return {
262232
262234
  "User-Agent": userAgent
@@ -262283,7 +262285,7 @@ var init_costrict = __esm({
262283
262285
  */
262284
262286
  buildHeaders() {
262285
262287
  const baseHeaders = super.buildHeaders();
262286
- const version4 = "2.0.3";
262288
+ const version4 = "2.0.4";
262287
262289
  const requestId = v7_default();
262288
262290
  const headers = {
262289
262291
  ...baseHeaders,
@@ -262904,7 +262906,7 @@ var init_dashscope = __esm({
262904
262906
  return baseUrl === "https://dashscope.aliyuncs.com/compatible-mode/v1" || baseUrl === "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
262905
262907
  }
262906
262908
  buildHeaders() {
262907
- const version4 = "2.0.3";
262909
+ const version4 = "2.0.4";
262908
262910
  const userAgent = `CoStrict/${version4} (${process.platform}; ${process.arch})`;
262909
262911
  const { authType } = this.contentGeneratorConfig;
262910
262912
  return {
@@ -366348,7 +366350,7 @@ var init_costrictModelProvider = __esm({
366348
366350
  debugLogger.warn("[CoStrictModelProvider] Failed to get auth token:", error40);
366349
366351
  throw new Error(`Failed to get CoStrict auth token: ${error40 instanceof Error ? error40.message : String(error40)}`);
366350
366352
  }
366351
- const version4 = "2.0.3";
366353
+ const version4 = "2.0.4";
366352
366354
  const requestId = v7_default();
366353
366355
  const headers = {
366354
366356
  Authorization: `Bearer ${token2}`,
@@ -461568,7 +461570,7 @@ var RetryMessage = ({
461568
461570
  };
461569
461571
 
461570
461572
  // packages/cli/src/generated/git-commit.ts
461571
- var GIT_COMMIT_INFO2 = "862c0eaff";
461573
+ var GIT_COMMIT_INFO2 = "065d8ea7c";
461572
461574
 
461573
461575
  // packages/cli/src/ui/components/AboutBox.tsx
461574
461576
  var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
@@ -470327,7 +470329,9 @@ function LoginDialog({
470327
470329
  onCancel();
470328
470330
  }
470329
470331
  },
470330
- { isActive: state !== "success" /* Success */ && state !== "failed" /* Failed */ }
470332
+ {
470333
+ isActive: state !== "success" /* Success */ && state !== "failed" /* Failed */ && state !== "cancelled" /* Cancelled */
470334
+ }
470331
470335
  );
470332
470336
  const getStateMessage = () => {
470333
470337
  switch (state) {
@@ -470487,7 +470491,7 @@ function LoginDialogContainer({
470487
470491
  errorMessage,
470488
470492
  pollingAttempt,
470489
470493
  maxAttempts: 120,
470490
- onCancel: state !== "success" /* Success */ && state !== "failed" /* Failed */ ? handleCancel : void 0
470494
+ onCancel: state !== "success" /* Success */ && state !== "failed" /* Failed */ && state !== "cancelled" /* Cancelled */ ? handleCancel : void 0
470491
470495
  }
470492
470496
  );
470493
470497
  }
@@ -472469,22 +472473,39 @@ var DialogManager = ({
472469
472473
  Date.now()
472470
472474
  );
472471
472475
  uiActions.setAuthState("unauthenticated" /* Unauthenticated */);
472476
+ uiActions.refreshStatic();
472472
472477
  } else {
472478
+ const msg = errorMessage || "Unknown error";
472479
+ const isCancelled = msg.toLowerCase().includes("cancelled") || msg.toLowerCase().includes("aborted");
472480
+ if (isCancelled) {
472481
+ addItem(
472482
+ {
472483
+ type: "info" /* INFO */,
472484
+ text: "\u2297 Login cancelled"
472485
+ },
472486
+ Date.now()
472487
+ );
472488
+ uiActions.onAuthError(null);
472489
+ uiActions.setAuthState("updating" /* Updating */);
472490
+ uiActions.refreshStatic();
472491
+ return;
472492
+ }
472473
472493
  addItem(
472474
472494
  {
472475
472495
  type: "error" /* ERROR */,
472476
472496
  text: [
472477
472497
  "\u2717 Login failed",
472478
472498
  "",
472479
- `Error: ${errorMessage || "Unknown error"}`,
472499
+ `Error: ${msg}`,
472480
472500
  "",
472481
472501
  "Please try again or select a different authentication method."
472482
472502
  ].join("\n")
472483
472503
  },
472484
472504
  Date.now()
472485
472505
  );
472486
- uiActions.onAuthError(errorMessage || "Login failed");
472506
+ uiActions.onAuthError(msg);
472487
472507
  uiActions.setAuthState("updating" /* Updating */);
472508
+ uiActions.refreshStatic();
472488
472509
  }
472489
472510
  }
472490
472511
  }
@@ -487635,13 +487656,18 @@ var costrictLoginCommand = {
487635
487656
  Date.now()
487636
487657
  );
487637
487658
  } else {
487659
+ const msg = errorMessage || "Unknown error";
487660
+ const isCancelled = msg.toLowerCase().includes("cancelled") || msg.toLowerCase().includes("aborted");
487638
487661
  context2.ui.addItem(
487639
- {
487662
+ isCancelled ? {
487663
+ type: "info" /* INFO */,
487664
+ text: "\u2297 Login cancelled"
487665
+ } : {
487640
487666
  type: "error" /* ERROR */,
487641
487667
  text: [
487642
487668
  "\u2717 Login failed",
487643
487669
  "",
487644
- `Error: ${errorMessage || "Unknown error"}`,
487670
+ `Error: ${msg}`,
487645
487671
  "",
487646
487672
  "Please try again or use the IDE plugin to log in.",
487647
487673
  "Credentials are shared via ~/.costrict/share/auth.json"
@@ -488631,7 +488657,10 @@ var useSlashCommandProcessor = (config2, settings, addItem, clearItems, loadHist
488631
488657
  extensionsUpdateState,
488632
488658
  dispatchExtensionStateUpdate: actions.dispatchExtensionStateUpdate,
488633
488659
  addConfirmUpdateExtensionRequest: actions.addConfirmUpdateExtensionRequest,
488634
- removeComponent: () => setCustomDialog(null)
488660
+ removeComponent: () => {
488661
+ setCustomDialog(null);
488662
+ refreshStatic();
488663
+ }
488635
488664
  },
488636
488665
  session: {
488637
488666
  stats: session.stats,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@costrict/cs",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },