@kaitranntt/ccs 7.78.0-dev.9 → 7.78.1
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/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +0 -21
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/ui/assets/{accounts-D_ROBWJW.js → accounts-CW9bbE4S.js} +1 -1
- package/dist/ui/assets/{alert-dialog-CdBSeTf8.js → alert-dialog-ClPYGzV3.js} +1 -1
- package/dist/ui/assets/{api-DZp9XoZ3.js → api-BjpAFHdA.js} +1 -1
- package/dist/ui/assets/{auth-section-CBHPWh8P.js → auth-section-wl4-fzwD.js} +1 -1
- package/dist/ui/assets/{backups-section-BEfeEYNu.js → backups-section-CRfyOhtX.js} +1 -1
- package/dist/ui/assets/{channels-yd4p8uGF.js → channels-DH0HkSGX.js} +1 -1
- package/dist/ui/assets/{checkbox-O4MS4m31.js → checkbox-CTpEjpTH.js} +1 -1
- package/dist/ui/assets/{claude-extension-RX6pi5Dq.js → claude-extension-BQOBO5Au.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-CFaY0exX.js → cliproxy-ai-providers-DoUPKyI5.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-Co84wmaz.js → cliproxy-control-panel-CvjXdHw9.js} +1 -1
- package/dist/ui/assets/{cliproxy-CCPBZ2hk.js → cliproxy-qUbiZjec.js} +2 -3
- package/dist/ui/assets/{codex-BndwF_Uy.js → codex-BeeazJpw.js} +2 -2
- package/dist/ui/assets/{confirm-dialog-CuqXEw3c.js → confirm-dialog-CYj_LLWN.js} +1 -1
- package/dist/ui/assets/{copilot-DwVnqcwy.js → copilot-ZCJeM_Zk.js} +1 -1
- package/dist/ui/assets/{cursor-DMk7oeR8.js → cursor-CtBjQ1_j.js} +1 -1
- package/dist/ui/assets/{droid-BNzpeb07.js → droid-BLmzMBtN.js} +1 -1
- package/dist/ui/assets/{globalenv-section-BDlzpym6.js → globalenv-section-0ENDeVbM.js} +1 -1
- package/dist/ui/assets/{health-BQ7Tv1rQ.js → health-BEnDHk-j.js} +1 -1
- package/dist/ui/assets/{index-DgTEmJwC.js → index-B3xma6R0.js} +1 -1
- package/dist/ui/assets/{index-CHRUhYJD.js → index-Bs28kNJN.js} +22 -22
- package/dist/ui/assets/{index-B5Fvdc9D.js → index-C04Kst21.js} +1 -1
- package/dist/ui/assets/{index-BQO1Car5.js → index-Cip18A41.js} +1 -1
- package/dist/ui/assets/{index-DTFmb_cl.js → index-ClMz157R.js} +1 -1
- package/dist/ui/assets/index-D2_yb3d2.css +1 -0
- package/dist/ui/assets/{index-C1oiTZ4n.js → index-DrCrZ7r1.js} +1 -1
- package/dist/ui/assets/{index-dIME7UaU.js → index-O9Qq-UJq.js} +1 -1
- package/dist/ui/assets/{logs-BTE4BziS.js → logs-DQxVdsHm.js} +1 -1
- package/dist/ui/assets/{masked-input-FdlUBXx1.js → masked-input-eN6tFUjN.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-BHCYqiYU.js → proxy-status-widget-50UIM6S8.js} +1 -1
- package/dist/ui/assets/raw-json-settings-editor-panel-DqKmVWL-.js +1 -0
- package/dist/ui/assets/{searchable-select-DuJbJ_tt.js → searchable-select-JO0gngYE.js} +1 -1
- package/dist/ui/assets/{separator-ohkxsfxk.js → separator-AoncAA6l.js} +1 -1
- package/dist/ui/assets/{shared-1ZnvRlC8.js → shared-BTv96-3y.js} +1 -1
- package/dist/ui/assets/{table-BXnQYMP2.js → table-BM_YK49c.js} +1 -1
- package/dist/ui/assets/{updates-Cp9b84A6.js → updates-eo4H4NOg.js} +1 -1
- package/dist/ui/assets/{use-accounts-C88lVWLw.js → use-accounts-ELLatpzU.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/web-server/index.d.ts.map +1 -1
- package/dist/web-server/index.js +3 -47
- package/dist/web-server/index.js.map +1 -1
- package/dist/web-server/middleware/auth-middleware.d.ts +0 -5
- package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
- package/dist/web-server/middleware/auth-middleware.js +1 -73
- package/dist/web-server/middleware/auth-middleware.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +3 -30
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
- package/dist/web-server/routes/codex-routes.js +0 -7
- package/dist/web-server/routes/codex-routes.js.map +1 -1
- package/lib/mcp/ccs-browser-server.cjs +6 -153
- package/package.json +1 -1
- package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts +0 -22
- package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts.map +0 -1
- package/dist/cliproxy/auth/oauth-start-failure-guidance.js +0 -82
- package/dist/cliproxy/auth/oauth-start-failure-guidance.js.map +0 -1
- package/dist/ui/assets/index-C-pkmHvH.css +0 -1
- package/dist/ui/assets/raw-json-settings-editor-panel-BWEzkHEh.js +0 -1
|
@@ -151,8 +151,6 @@ const DEFAULT_DRAG_STEPS = 5;
|
|
|
151
151
|
const MAX_POINTER_ACTIONS = 25;
|
|
152
152
|
const SESSION_START_SETTLE_WINDOW_MS = 250;
|
|
153
153
|
const MAX_ARTIFACT_FILE_BYTES = 5 * 1024 * 1024;
|
|
154
|
-
const MAX_LOCAL_TRANSFER_FILE_BYTES = 10 * 1024 * 1024;
|
|
155
|
-
const MAX_LOCAL_TRANSFER_FILES = 10;
|
|
156
154
|
const SAFE_ARTIFACT_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
157
155
|
const SESSION_CANCELED_ERROR_CODE = 'SESSION_CANCELED';
|
|
158
156
|
|
|
@@ -179,37 +177,6 @@ const recentDownloads = [];
|
|
|
179
177
|
const interceptSessionsByPageId = new Map();
|
|
180
178
|
let browserDownloadSession = null;
|
|
181
179
|
let sessionDownloadDir = '';
|
|
182
|
-
const SENSITIVE_LOCAL_PATH_SEGMENTS = new Set([
|
|
183
|
-
'.ssh',
|
|
184
|
-
'.gnupg',
|
|
185
|
-
'.aws',
|
|
186
|
-
'.azure',
|
|
187
|
-
'.kube',
|
|
188
|
-
'.docker',
|
|
189
|
-
'.npmrc',
|
|
190
|
-
'.netrc',
|
|
191
|
-
'.pypirc',
|
|
192
|
-
'.config',
|
|
193
|
-
'.claude',
|
|
194
|
-
'.ccs',
|
|
195
|
-
]);
|
|
196
|
-
const SENSITIVE_LOCAL_FILE_NAMES = new Set([
|
|
197
|
-
'.env',
|
|
198
|
-
'id_rsa',
|
|
199
|
-
'id_dsa',
|
|
200
|
-
'id_ecdsa',
|
|
201
|
-
'id_ed25519',
|
|
202
|
-
'known_hosts',
|
|
203
|
-
'authorized_keys',
|
|
204
|
-
'credentials',
|
|
205
|
-
'credentials.json',
|
|
206
|
-
'config.json',
|
|
207
|
-
'settings.json',
|
|
208
|
-
'history',
|
|
209
|
-
'.bash_history',
|
|
210
|
-
'.zsh_history',
|
|
211
|
-
'.fish_history',
|
|
212
|
-
]);
|
|
213
180
|
const MAX_RECENT_REQUESTS = 100;
|
|
214
181
|
const MAX_RECENT_DOWNLOADS = 100;
|
|
215
182
|
const FETCH_FAIL_ERROR_REASON = 'Failed';
|
|
@@ -1471,105 +1438,10 @@ function getSessionDownloadPath() {
|
|
|
1471
1438
|
return sessionDownloadDir;
|
|
1472
1439
|
}
|
|
1473
1440
|
|
|
1474
|
-
function splitConfiguredPathRoots(value) {
|
|
1475
|
-
return String(value || '')
|
|
1476
|
-
.split(path.delimiter)
|
|
1477
|
-
.map((entry) => entry.trim())
|
|
1478
|
-
.filter(Boolean)
|
|
1479
|
-
.map((entry) => path.resolve(entry));
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
function getDownloadSafeRoots() {
|
|
1483
|
-
return [
|
|
1484
|
-
getSessionDownloadPath(),
|
|
1485
|
-
...splitConfiguredPathRoots(process.env.CCS_BROWSER_DOWNLOAD_ROOTS),
|
|
1486
|
-
];
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
function getUploadSafeRoots() {
|
|
1490
|
-
return [
|
|
1491
|
-
getSessionDownloadPath(),
|
|
1492
|
-
...splitConfiguredPathRoots(process.env.CCS_BROWSER_UPLOAD_ROOTS),
|
|
1493
|
-
];
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
function getNearestExistingAncestor(candidatePath) {
|
|
1497
|
-
let currentPath = candidatePath;
|
|
1498
|
-
while (!fs.existsSync(currentPath)) {
|
|
1499
|
-
const parentPath = path.dirname(currentPath);
|
|
1500
|
-
if (parentPath === currentPath) {
|
|
1501
|
-
return currentPath;
|
|
1502
|
-
}
|
|
1503
|
-
currentPath = parentPath;
|
|
1504
|
-
}
|
|
1505
|
-
return currentPath;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
function resolveExistingRoot(rootPath) {
|
|
1509
|
-
fs.mkdirSync(rootPath, { recursive: true });
|
|
1510
|
-
return fs.realpathSync(rootPath);
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
function resolvePathWithRealAncestor(candidatePath) {
|
|
1514
|
-
const resolvedPath = path.resolve(candidatePath);
|
|
1515
|
-
const ancestorPath = getNearestExistingAncestor(resolvedPath);
|
|
1516
|
-
const realAncestorPath = fs.realpathSync(ancestorPath);
|
|
1517
|
-
const relativeSuffix = path.relative(ancestorPath, resolvedPath);
|
|
1518
|
-
return relativeSuffix ? path.resolve(realAncestorPath, relativeSuffix) : realAncestorPath;
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
function isPathInsideRoot(candidatePath, rootPath) {
|
|
1522
|
-
const relativePath = path.relative(rootPath, candidatePath);
|
|
1523
|
-
return relativePath === '' || (!relativePath.startsWith('..') && !path.isAbsolute(relativePath));
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
function findContainingRoot(candidatePath, rootPaths) {
|
|
1527
|
-
return rootPaths.find((rootPath) => isPathInsideRoot(candidatePath, rootPath)) || '';
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
function getLocalPathSegments(candidatePath, rootPath) {
|
|
1531
|
-
const rootSegments = path.resolve(rootPath).split(path.sep).filter(Boolean);
|
|
1532
|
-
const relativePath = path.relative(rootPath, candidatePath);
|
|
1533
|
-
const relativeSegments = relativePath.split(path.sep).filter(Boolean);
|
|
1534
|
-
return [...rootSegments, ...relativeSegments];
|
|
1535
|
-
}
|
|
1536
|
-
|
|
1537
|
-
function assertNoSensitiveLocalPathSegments(candidatePath, rootPath, label) {
|
|
1538
|
-
const segments = getLocalPathSegments(candidatePath, rootPath);
|
|
1539
|
-
for (const segment of segments) {
|
|
1540
|
-
const normalizedSegment = segment.toLowerCase();
|
|
1541
|
-
if (normalizedSegment.startsWith('.') || SENSITIVE_LOCAL_PATH_SEGMENTS.has(normalizedSegment)) {
|
|
1542
|
-
throw new Error(`${label} cannot include hidden or sensitive path segment: ${segment}`);
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
const fileName = path.basename(candidatePath).toLowerCase();
|
|
1547
|
-
if (SENSITIVE_LOCAL_FILE_NAMES.has(fileName)) {
|
|
1548
|
-
throw new Error(
|
|
1549
|
-
`${label} cannot reference sensitive file name: ${path.basename(candidatePath)}`
|
|
1550
|
-
);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
1441
|
function ensureWritableDirectory(downloadPath) {
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
const containingRoot = findContainingRoot(candidatePath, safeRoots);
|
|
1559
|
-
if (!containingRoot) {
|
|
1560
|
-
throw new Error(
|
|
1561
|
-
'downloadPath must be inside the browser session download directory or a CCS_BROWSER_DOWNLOAD_ROOTS entry'
|
|
1562
|
-
);
|
|
1563
|
-
}
|
|
1564
|
-
assertNoSensitiveLocalPathSegments(candidatePath, containingRoot, 'downloadPath');
|
|
1565
|
-
|
|
1566
|
-
fs.mkdirSync(resolvedPath, { recursive: true });
|
|
1567
|
-
const realDownloadPath = fs.realpathSync(resolvedPath);
|
|
1568
|
-
if (!isPathInsideRoot(realDownloadPath, containingRoot)) {
|
|
1569
|
-
throw new Error('downloadPath cannot traverse outside the allowed download root');
|
|
1570
|
-
}
|
|
1571
|
-
fs.accessSync(realDownloadPath, fs.constants.W_OK);
|
|
1572
|
-
return realDownloadPath;
|
|
1442
|
+
fs.mkdirSync(downloadPath, { recursive: true });
|
|
1443
|
+
fs.accessSync(downloadPath, fs.constants.W_OK);
|
|
1444
|
+
return downloadPath;
|
|
1573
1445
|
}
|
|
1574
1446
|
|
|
1575
1447
|
function pushRecentDownload(entry) {
|
|
@@ -2546,35 +2418,16 @@ function buildFileInputHandleExpression(selector, nth, frameSelector, pierceShad
|
|
|
2546
2418
|
}
|
|
2547
2419
|
|
|
2548
2420
|
function validateLocalFiles(files) {
|
|
2549
|
-
if (files.length > MAX_LOCAL_TRANSFER_FILES) {
|
|
2550
|
-
throw new Error(`files exceeds maximum of ${MAX_LOCAL_TRANSFER_FILES}`);
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
const safeRoots = getUploadSafeRoots().map(resolveExistingRoot);
|
|
2554
2421
|
return files.map((filePath) => {
|
|
2555
2422
|
const resolvedPath = path.resolve(filePath);
|
|
2556
2423
|
if (!fs.existsSync(resolvedPath)) {
|
|
2557
2424
|
throw new Error(`file does not exist: ${resolvedPath}`);
|
|
2558
2425
|
}
|
|
2559
|
-
const
|
|
2560
|
-
const containingRoot = findContainingRoot(realFilePath, safeRoots);
|
|
2561
|
-
if (!containingRoot) {
|
|
2562
|
-
throw new Error(
|
|
2563
|
-
'file must be inside the browser session download directory or a CCS_BROWSER_UPLOAD_ROOTS entry'
|
|
2564
|
-
);
|
|
2565
|
-
}
|
|
2566
|
-
assertNoSensitiveLocalPathSegments(realFilePath, containingRoot, 'file');
|
|
2567
|
-
|
|
2568
|
-
const stat = fs.statSync(realFilePath);
|
|
2426
|
+
const stat = fs.statSync(resolvedPath);
|
|
2569
2427
|
if (!stat.isFile()) {
|
|
2570
|
-
throw new Error(`file is not a regular file: ${
|
|
2571
|
-
}
|
|
2572
|
-
if (stat.size > MAX_LOCAL_TRANSFER_FILE_BYTES) {
|
|
2573
|
-
throw new Error(
|
|
2574
|
-
`file exceeds maximum size of ${MAX_LOCAL_TRANSFER_FILE_BYTES} bytes: ${realFilePath}`
|
|
2575
|
-
);
|
|
2428
|
+
throw new Error(`file is not a regular file: ${resolvedPath}`);
|
|
2576
2429
|
}
|
|
2577
|
-
return
|
|
2430
|
+
return resolvedPath;
|
|
2578
2431
|
});
|
|
2579
2432
|
}
|
|
2580
2433
|
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { CLIProxyProvider } from '../types';
|
|
2
|
-
import { type ProxyTarget } from '../proxy/proxy-target-resolver';
|
|
3
|
-
export interface OAuthStartFailureGuidance {
|
|
4
|
-
error: 'cliproxy_oauth_start_failed';
|
|
5
|
-
provider: CLIProxyProvider;
|
|
6
|
-
message: string;
|
|
7
|
-
details: string;
|
|
8
|
-
hints: string[];
|
|
9
|
-
endpoint: string | null;
|
|
10
|
-
retryCommand: string;
|
|
11
|
-
portForwardCommand?: string;
|
|
12
|
-
}
|
|
13
|
-
interface GuidanceOptions {
|
|
14
|
-
target: ProxyTarget;
|
|
15
|
-
startPath?: string | null;
|
|
16
|
-
cause?: unknown;
|
|
17
|
-
addAccount?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare function buildOAuthStartFailureGuidance(provider: CLIProxyProvider, options: GuidanceOptions): OAuthStartFailureGuidance;
|
|
20
|
-
export declare function formatOAuthStartFailureForCli(guidance: OAuthStartFailureGuidance): string[];
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=oauth-start-failure-guidance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-start-failure-guidance.d.ts","sourceRoot":"","sources":["../../../src/cliproxy/auth/oauth-start-failure-guidance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAEjF,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,6BAA6B,CAAC;IACrC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAyBD,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,GACvB,yBAAyB,CAmD3B;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,EAAE,CAQ3F"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatOAuthStartFailureForCli = exports.buildOAuthStartFailureGuidance = void 0;
|
|
4
|
-
const provider_capabilities_1 = require("../provider-capabilities");
|
|
5
|
-
const proxy_target_resolver_1 = require("../proxy/proxy-target-resolver");
|
|
6
|
-
function getCauseMessage(cause) {
|
|
7
|
-
if (cause instanceof Error && cause.message.trim()) {
|
|
8
|
-
return cause.message.trim();
|
|
9
|
-
}
|
|
10
|
-
if (typeof cause === 'string' && cause.trim()) {
|
|
11
|
-
return cause.trim();
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
function buildAuthCommand(provider, flag, addAccount) {
|
|
16
|
-
const parts = ['ccs', provider, '--auth'];
|
|
17
|
-
if (addAccount) {
|
|
18
|
-
parts.push('--add');
|
|
19
|
-
}
|
|
20
|
-
parts.push(flag);
|
|
21
|
-
return parts.join(' ');
|
|
22
|
-
}
|
|
23
|
-
function buildOAuthStartFailureGuidance(provider, options) {
|
|
24
|
-
const { target, startPath, cause, addAccount } = options;
|
|
25
|
-
const displayName = (0, provider_capabilities_1.getProviderDisplayName)(provider);
|
|
26
|
-
const endpoint = startPath ? (0, proxy_target_resolver_1.buildProxyUrl)(target, startPath) : null;
|
|
27
|
-
const causeMessage = getCauseMessage(cause);
|
|
28
|
-
const retryCommand = buildAuthCommand(provider, '--paste-callback', addAccount);
|
|
29
|
-
const portForwardRetryCommand = buildAuthCommand(provider, '--port-forward', addAccount);
|
|
30
|
-
const callbackPort = (0, provider_capabilities_1.getOAuthCallbackPort)(provider);
|
|
31
|
-
const portForwardCommand = callbackPort
|
|
32
|
-
? `ssh -L ${callbackPort}:localhost:${callbackPort} <USER>@<HOST>`
|
|
33
|
-
: undefined;
|
|
34
|
-
const targetDescription = target.isRemote
|
|
35
|
-
? `remote CLIProxy management API at ${target.protocol}://${target.host}:${target.port}`
|
|
36
|
-
: `local CLIProxy management API at ${target.protocol}://${target.host}:${target.port}`;
|
|
37
|
-
const message = `${displayName} OAuth could not start through the ${targetDescription}.`;
|
|
38
|
-
const details = [
|
|
39
|
-
endpoint ? `Endpoint: ${endpoint}` : null,
|
|
40
|
-
causeMessage ? `Cause: ${causeMessage}` : null,
|
|
41
|
-
]
|
|
42
|
-
.filter(Boolean)
|
|
43
|
-
.join(' ');
|
|
44
|
-
const hints = target.isRemote
|
|
45
|
-
? [
|
|
46
|
-
'Verify the remote CLIProxy server is running and reachable from this machine.',
|
|
47
|
-
'Check cliproxy_server.remote.management_key or auth_token in CCS config.',
|
|
48
|
-
`After fixing the remote proxy, retry: ${retryCommand}`,
|
|
49
|
-
]
|
|
50
|
-
: [
|
|
51
|
-
'Start local CLIProxy first: ccs cliproxy start',
|
|
52
|
-
`Then retry paste-callback mode: ${retryCommand}`,
|
|
53
|
-
...(portForwardCommand
|
|
54
|
-
? [
|
|
55
|
-
`For SSH/VPS auth, open a tunnel from your local machine: ${portForwardCommand}`,
|
|
56
|
-
`Then run inside that SSH session: ${portForwardRetryCommand}`,
|
|
57
|
-
]
|
|
58
|
-
: []),
|
|
59
|
-
];
|
|
60
|
-
return {
|
|
61
|
-
error: 'cliproxy_oauth_start_failed',
|
|
62
|
-
provider,
|
|
63
|
-
message,
|
|
64
|
-
details,
|
|
65
|
-
hints,
|
|
66
|
-
endpoint,
|
|
67
|
-
retryCommand,
|
|
68
|
-
portForwardCommand,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
exports.buildOAuthStartFailureGuidance = buildOAuthStartFailureGuidance;
|
|
72
|
-
function formatOAuthStartFailureForCli(guidance) {
|
|
73
|
-
const lines = [guidance.message];
|
|
74
|
-
if (guidance.details) {
|
|
75
|
-
lines.push(guidance.details);
|
|
76
|
-
}
|
|
77
|
-
lines.push('Next steps:');
|
|
78
|
-
lines.push(...guidance.hints.map((hint) => ` - ${hint}`));
|
|
79
|
-
return lines;
|
|
80
|
-
}
|
|
81
|
-
exports.formatOAuthStartFailureForCli = formatOAuthStartFailureForCli;
|
|
82
|
-
//# sourceMappingURL=oauth-start-failure-guidance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-start-failure-guidance.js","sourceRoot":"","sources":["../../../src/cliproxy/auth/oauth-start-failure-guidance.ts"],"names":[],"mappings":";;;AACA,oEAAwF;AACxF,0EAAiF;AAoBjF,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAA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