@cjhyy/code-shell-server 0.9.34 → 0.9.35
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/links/service.d.ts +2 -0
- package/dist/links/service.js +21 -2
- package/package.json +5 -5
package/dist/links/service.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export interface LinkServiceOptions {
|
|
|
16
16
|
now?: () => number;
|
|
17
17
|
/** Trusted Host configuration; never accepted from a browser request. */
|
|
18
18
|
remoteLink?: () => RemoteLinkConfiguration | undefined;
|
|
19
|
+
/** Trusted Host opt-in: reuse a uniquely identified user connection after remote OAuth. */
|
|
20
|
+
reuseRemoteConnection?: boolean;
|
|
19
21
|
/** Test seams. Production delegates to Core's fixed provider and CLI executors. */
|
|
20
22
|
validateToken?: typeof validateLocalLinkToken;
|
|
21
23
|
cliStatus?: typeof getCliLinkStatus;
|
package/dist/links/service.js
CHANGED
|
@@ -1164,8 +1164,27 @@ export function createLinkService(options = {}) {
|
|
|
1164
1164
|
};
|
|
1165
1165
|
await change(guarded, () => {
|
|
1166
1166
|
assertPending();
|
|
1167
|
-
|
|
1168
|
-
|
|
1167
|
+
let prepared = job.prepared;
|
|
1168
|
+
if (options.reuseRemoteConnection &&
|
|
1169
|
+
!prepared.expected &&
|
|
1170
|
+
prepared.input.connectionId === undefined) {
|
|
1171
|
+
// Identity comes from authenticated metadata, never a browser-supplied connection ID.
|
|
1172
|
+
const current = records();
|
|
1173
|
+
const matches = current.credentials.filter((entry) => !current.projectIds.has(entry.id) &&
|
|
1174
|
+
isRemoteLinkCredential(entry) &&
|
|
1175
|
+
entry.meta?.linkProvider === credential.meta?.linkProvider &&
|
|
1176
|
+
entry.meta?.linkRemoteIssuer === credential.meta?.linkRemoteIssuer &&
|
|
1177
|
+
entry.meta?.linkRemoteConnectionId === credential.meta?.linkRemoteConnectionId);
|
|
1178
|
+
if (matches.length > 1)
|
|
1179
|
+
throw new LinkServiceError(409, "conflict");
|
|
1180
|
+
if (matches.length === 1) {
|
|
1181
|
+
const expected = matches[0];
|
|
1182
|
+
prepared = { ...prepared, id: expected.id, expected };
|
|
1183
|
+
credential = { ...credential, id: expected.id, label: expected.label };
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
swap(prepared, credential, {
|
|
1187
|
+
retireExpected: !!prepared.expected,
|
|
1169
1188
|
adopt: staged,
|
|
1170
1189
|
now: now(),
|
|
1171
1190
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cjhyy/code-shell-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.35",
|
|
4
4
|
"description": "CodeShell server transport layer — mobile remote HTTP/WS host, pairing, passcode gate, tunnel, rooms, uploads, and session/attachment services. Electron-free; precursor of the auth gateway.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cjhyy/code-shell-capability-coding": "0.9.
|
|
64
|
-
"@cjhyy/code-shell-core": "0.9.
|
|
65
|
-
"@cjhyy/code-shell-web": "0.9.
|
|
63
|
+
"@cjhyy/code-shell-capability-coding": "0.9.35",
|
|
64
|
+
"@cjhyy/code-shell-core": "0.9.35",
|
|
65
|
+
"@cjhyy/code-shell-web": "0.9.35",
|
|
66
66
|
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
67
67
|
"@types/ws": "^8.18.1",
|
|
68
68
|
"ws": "^8.21.0",
|
|
69
|
-
"@cjhyy/code-shell-link": "0.9.
|
|
69
|
+
"@cjhyy/code-shell-link": "0.9.35"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=20.10"
|