cline 1.0.0-nightly.16 → 1.0.0-nightly.18

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/bin/cline CHANGED
Binary file
Binary file
Binary file
package/bin/cline-host CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/cline-core.js CHANGED
@@ -533401,13 +533401,8 @@ var init_utils6 = __esm({
533401
533401
  });
533402
533402
 
533403
533403
  // src/core/storage/remote-config/fetch.ts
533404
- async function fetchRemoteConfig(controller) {
533404
+ async function fetchRemoteConfigForOrganization(organizationId) {
533405
533405
  const authService = AuthService.getInstance();
533406
- const organizationId = authService.getActiveOrganizationId();
533407
- if (!organizationId) {
533408
- StateManager.get().clearRemoteConfig();
533409
- return void 0;
533410
- }
533411
533406
  try {
533412
533407
  const authToken = await authService.getAuthToken();
533413
533408
  if (!authToken) {
@@ -533442,32 +533437,68 @@ async function fetchRemoteConfig(controller) {
533442
533437
  }
533443
533438
  if (!configData.enabled) {
533444
533439
  await deleteRemoteConfigFromCache(organizationId);
533445
- StateManager.get().clearRemoteConfig();
533446
533440
  return void 0;
533447
533441
  }
533448
533442
  const parsedConfig = JSON.parse(configData.value);
533449
533443
  const validatedConfig = RemoteConfigSchema.parse(parsedConfig);
533450
- await writeRemoteConfigToCache(organizationId, validatedConfig);
533451
- applyRemoteConfig(validatedConfig);
533452
- controller.postStateToWebview();
533453
533444
  return validatedConfig;
533454
533445
  } catch (error) {
533455
- console.error("Failed to fetch remote config from API:", error);
533446
+ console.error(`Failed to fetch remote config for organization ${organizationId}:`, error);
533456
533447
  const cachedConfig = await readRemoteConfigFromCache(organizationId);
533457
533448
  if (cachedConfig) {
533458
533449
  try {
533459
533450
  const validatedCachedConfig = RemoteConfigSchema.parse(cachedConfig);
533460
- applyRemoteConfig(validatedCachedConfig);
533461
533451
  return validatedCachedConfig;
533462
533452
  } catch (validationError) {
533463
- console.error("Cached config validation failed:", validationError);
533453
+ console.error(`Cached config validation failed for organization ${organizationId}:`, validationError);
533464
533454
  }
533465
533455
  }
533466
- throw new Error(
533467
- `Failed to fetch remote config: ${error instanceof Error ? error.message : "Unknown error"}. No valid cached config available.`
533468
- );
533456
+ return void 0;
533457
+ }
533458
+ }
533459
+ async function findOrganizationWithRemoteConfig() {
533460
+ const authService = AuthService.getInstance();
533461
+ const userOrganizations = authService.getUserOrganizations();
533462
+ if (!userOrganizations || userOrganizations.length === 0) {
533463
+ return void 0;
533464
+ }
533465
+ for (const org of userOrganizations) {
533466
+ const remoteConfig = await fetchRemoteConfigForOrganization(org.organizationId);
533467
+ if (remoteConfig) {
533468
+ return {
533469
+ organizationId: org.organizationId,
533470
+ config: remoteConfig
533471
+ };
533472
+ }
533473
+ }
533474
+ return void 0;
533475
+ }
533476
+ async function ensureUserInOrgWithRemoteConfig(controller) {
533477
+ const authService = AuthService.getInstance();
533478
+ try {
533479
+ const result2 = await findOrganizationWithRemoteConfig();
533480
+ if (!result2) {
533481
+ StateManager.get().clearRemoteConfig();
533482
+ controller.postStateToWebview();
533483
+ return void 0;
533484
+ }
533485
+ const { organizationId, config: config6 } = result2;
533486
+ const currentActiveOrgId = authService.getActiveOrganizationId();
533487
+ if (currentActiveOrgId !== organizationId) {
533488
+ await controller.accountService.switchAccount(organizationId);
533489
+ }
533490
+ await writeRemoteConfigToCache(organizationId, config6);
533491
+ applyRemoteConfig(config6);
533492
+ controller.postStateToWebview();
533493
+ return config6;
533494
+ } catch (error) {
533495
+ console.error("Failed to ensure user in organization with remote config:", error);
533496
+ return void 0;
533469
533497
  }
533470
533498
  }
533499
+ async function fetchRemoteConfig(controller) {
533500
+ return ensureUserInOrgWithRemoteConfig(controller);
533501
+ }
533471
533502
  var init_fetch2 = __esm({
533472
533503
  "src/core/storage/remote-config/fetch.ts"() {
533473
533504
  "use strict";
@@ -784694,6 +784725,13 @@ var init_AuthService = __esm({
784694
784725
  const activeOrg = this._clineAuthInfo.userInfo.organizations.find((org) => org.active);
784695
784726
  return activeOrg?.organizationId ?? null;
784696
784727
  }
784728
+ /**
784729
+ * Gets all organizations from the authenticated user's info
784730
+ * @returns Array of organizations, or undefined if not available
784731
+ */
784732
+ getUserOrganizations() {
784733
+ return this._clineAuthInfo?.userInfo?.organizations;
784734
+ }
784697
784735
  async internalGetAuthToken(provider) {
784698
784736
  try {
784699
784737
  let clineAccountAuthToken = this._clineAuthInfo?.idToken;
@@ -784701,7 +784739,6 @@ var init_AuthService = __esm({
784701
784739
  return null;
784702
784740
  }
784703
784741
  if (await provider.shouldRefreshIdToken(clineAccountAuthToken, this._clineAuthInfo.expiresAt)) {
784704
- console.log("Provider indicates token needs refresh");
784705
784742
  const updatedAuthInfo = await provider.retrieveClineAuthInfo(this._controller);
784706
784743
  if (updatedAuthInfo) {
784707
784744
  this._clineAuthInfo = updatedAuthInfo;
@@ -784856,7 +784893,6 @@ var init_AuthService = __esm({
784856
784893
  * @param requestId The ID of the request (passed by the gRPC handler)
784857
784894
  */
784858
784895
  async subscribeToAuthStatusUpdate(controller, _request, responseStream, requestId) {
784859
- console.log("Subscribing to authStatusUpdate");
784860
784896
  this._activeAuthStatusUpdateHandlers.add(responseStream);
784861
784897
  this._handlerToController.set(responseStream, controller);
784862
784898
  const cleanup = () => {
@@ -295,7 +295,7 @@
295
295
  "vscode:prepublish": "npm run package",
296
296
  "compile": "npm run check-types && npm run lint && node esbuild.mjs",
297
297
  "compile-standalone": "npm run check-types && npm run lint && node esbuild.mjs --standalone",
298
- "compile-standalone-npm": "npm run check-types && npm run lint && node esbuild.mjs --standalone",
298
+ "compile-standalone-npm": "npm run protos && npm run protos-go && npm run check-types && npm run lint && node esbuild.mjs --standalone",
299
299
  "compile-cli": "scripts/build-cli.sh",
300
300
  "compile-cli-all-platforms": "scripts/build-cli-all-platforms.sh",
301
301
  "compile-cli-man-page": "pandoc cli/man/cline.1.md -s -t man -o cli/man/cline.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cline",
3
- "version": "1.0.0-nightly.16",
3
+ "version": "1.0.0-nightly.18",
4
4
  "description": "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more",
5
5
  "main": "cline-core.js",
6
6
  "bin": {
Binary file
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ # Test script to check if cline-core starts without errors
3
+
4
+ echo "Testing cline-core startup..."
5
+ node cline-core.js &
6
+ PID=$!
7
+
8
+ # Wait for 3 seconds
9
+ sleep 3
10
+
11
+ # Kill the process
12
+ kill $PID 2>/dev/null
13
+
14
+ echo "Test complete"