@cjhyy/code-shell-server 0.9.15 → 0.9.17

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.
@@ -20,8 +20,9 @@ export interface PanelAppProcessServiceOptions {
20
20
  /** Rechecked after asynchronous work and immediately before admitting a process. */
21
21
  isOwnerAuthorized?(owner: PanelProcessOwner): boolean | Promise<boolean>;
22
22
  /**
23
- * Desktop defaults to app-version approvals. Web uses guest to isolate each
24
- * authenticated instance; guest approvals never use the app-wide durable hooks.
23
+ * Desktop delegates durable approval lifetime to its Host hooks. Web uses guest
24
+ * to isolate each authenticated instance; guest approvals never use the
25
+ * app-wide durable hooks.
25
26
  */
26
27
  approvalScope?: "app" | "guest";
27
28
  confirmExecution(input: {
@@ -33,6 +34,8 @@ export interface PanelAppProcessServiceOptions {
33
34
  }): Promise<boolean>;
34
35
  isExecutionApproved?(scope: PanelProcessApprovalScope): Promise<boolean>;
35
36
  rememberExecutionApproval?(scope: PanelProcessApprovalScope): Promise<void>;
37
+ /** Desktop can use installed-app process permission and trusted-project binding as consent. */
38
+ allowAuthorizedProcessWithoutPrompt?: boolean;
36
39
  /** Resolve a declared entry in this app revision; return a canonical, reviewed file. */
37
40
  resolvePackageEntry?(owner: PanelProcessOwner, name: string): Promise<{
38
41
  path: string;
@@ -426,7 +426,10 @@ export class PanelAppProcessService {
426
426
  const guestScoped = this.options.approvalScope === "guest";
427
427
  const approvalKey = (guestScoped ? `${owner.guestId}\0${epoch}\0` : "") +
428
428
  `${scope.appId}\0${scope.revision}\0${scope.executablePath}\0${scope.executableFingerprint}`;
429
- let approved = this.approvedExecutables.has(approvalKey);
429
+ // Desktop already checks installed-app process permission and a trusted,
430
+ // bound project in authorize(). Web keeps its per-guest confirmation path.
431
+ let approved = this.options.allowAuthorizedProcessWithoutPrompt === true ||
432
+ this.approvedExecutables.has(approvalKey);
430
433
  if (!approved && !guestScoped && this.options.isExecutionApproved) {
431
434
  approved = await this.options.isExecutionApproved(scope).catch(() => false);
432
435
  await this.authorize(owner, epoch);
@@ -475,7 +478,8 @@ export class PanelAppProcessService {
475
478
  this.directoryPath(owner, grant.directoryHandle) !== grant.path)
476
479
  throw new Error("sealed directory argument was replaced");
477
480
  }
478
- this.approvedExecutables.add(approvalKey);
481
+ if (!this.options.allowAuthorizedProcessWithoutPrompt)
482
+ this.approvedExecutables.add(approvalKey);
479
483
  const processId = randomUUID();
480
484
  const child = spawn(executable.path, args, {
481
485
  cwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell-server",
3
- "version": "0.9.15",
3
+ "version": "0.9.17",
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",
@@ -51,13 +51,13 @@
51
51
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
52
52
  },
53
53
  "dependencies": {
54
- "@cjhyy/code-shell-capability-coding": "0.9.15",
55
- "@cjhyy/code-shell-core": "0.9.15",
56
- "@cjhyy/code-shell-web": "0.9.15",
54
+ "@cjhyy/code-shell-capability-coding": "0.9.17",
55
+ "@cjhyy/code-shell-core": "0.9.17",
56
+ "@cjhyy/code-shell-web": "0.9.17",
57
57
  "@modelcontextprotocol/sdk": "^1.12.1",
58
58
  "@types/ws": "^8.18.1",
59
59
  "ws": "^8.21.0",
60
- "@cjhyy/code-shell-link": "0.9.15"
60
+ "@cjhyy/code-shell-link": "0.9.17"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=20.10"