cline 1.0.0-nightly.17 → 1.0.0-nightly.19
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 +0 -0
- package/bin/cline-darwin-amd64 +0 -0
- package/bin/cline-darwin-arm64 +0 -0
- package/bin/cline-host +0 -0
- package/bin/cline-host-darwin-amd64 +0 -0
- package/bin/cline-host-darwin-arm64 +0 -0
- package/bin/cline-host-linux-amd64 +0 -0
- package/bin/cline-host-linux-arm64 +0 -0
- package/bin/cline-linux-amd64 +0 -0
- package/bin/cline-linux-arm64 +0 -0
- package/cline-core.js +54 -18
- package/package.json +1 -1
package/bin/cline
CHANGED
|
Binary file
|
package/bin/cline-darwin-amd64
CHANGED
|
Binary file
|
package/bin/cline-darwin-arm64
CHANGED
|
Binary file
|
package/bin/cline-host
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/cline-linux-amd64
CHANGED
|
Binary file
|
package/bin/cline-linux-arm64
CHANGED
|
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
|
|
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(
|
|
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(
|
|
533453
|
+
console.error(`Cached config validation failed for organization ${organizationId}:`, validationError);
|
|
533464
533454
|
}
|
|
533465
533455
|
}
|
|
533466
|
-
|
|
533467
|
-
|
|
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 = () => {
|
package/package.json
CHANGED