dsh-open-in-dsh 0.3.3 → 0.3.4
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/lib/index.js +6 -0
- package/lib/types/index.d.ts +12 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -279,31 +279,37 @@ export function apply(ctx, rawConfig = {}) {
|
|
|
279
279
|
host.effect(() => host.webServer.register({
|
|
280
280
|
kind: 'exact',
|
|
281
281
|
path: ROUTE_OPEN,
|
|
282
|
+
auth: 'anonymous',
|
|
282
283
|
handler: createOpenHandler(ctx, hub, allowNonLoopback),
|
|
283
284
|
}), 'dsh-open-in-dsh: open route');
|
|
284
285
|
host.effect(() => host.webServer.register({
|
|
285
286
|
kind: 'exact',
|
|
286
287
|
path: ROUTE_EVENTS,
|
|
288
|
+
auth: 'anonymous',
|
|
287
289
|
handler: createEventsHandler(ctx, hub, allowNonLoopback),
|
|
288
290
|
}), 'dsh-open-in-dsh: events route');
|
|
289
291
|
host.effect(() => host.webServer.register({
|
|
290
292
|
kind: 'exact',
|
|
291
293
|
path: ROUTE_STATUS,
|
|
294
|
+
auth: 'anonymous',
|
|
292
295
|
handler: createStatusHandler(hub, allowNonLoopback),
|
|
293
296
|
}), 'dsh-open-in-dsh: status route');
|
|
294
297
|
host.effect(() => host.webServer.register({
|
|
295
298
|
kind: 'exact',
|
|
296
299
|
path: ROUTE_APPS,
|
|
300
|
+
auth: 'anonymous',
|
|
297
301
|
handler: createAppsHandler(allowNonLoopback),
|
|
298
302
|
}), 'dsh-open-in-dsh: apps route');
|
|
299
303
|
host.effect(() => host.webServer.register({
|
|
300
304
|
kind: 'exact',
|
|
301
305
|
path: ROUTE_OPEN_WITH,
|
|
306
|
+
auth: 'anonymous',
|
|
302
307
|
handler: createOpenWithHandler(ctx, allowNonLoopback),
|
|
303
308
|
}), 'dsh-open-in-dsh: open-with route');
|
|
304
309
|
host.effect(() => host.webServer.register({
|
|
305
310
|
kind: 'exact',
|
|
306
311
|
path: ROUTE_OPEN_SESSION,
|
|
312
|
+
auth: 'anonymous',
|
|
307
313
|
handler: createOpenSessionHandler(ctx, allowNonLoopback, {
|
|
308
314
|
resolveCwd: (sessionId) => resolveSessionCwd(sessionId, { live: createLiveCwdReader(ctx) }),
|
|
309
315
|
}),
|
package/lib/types/index.d.ts
CHANGED
|
@@ -34,11 +34,22 @@ export interface EventStream {
|
|
|
34
34
|
}
|
|
35
35
|
/** One incoming HTTP request handler, as `webServer.register` takes it. */
|
|
36
36
|
export type RouteHandler = (request: IncomingMessage, response: ServerResponse) => void | Promise<void>;
|
|
37
|
-
/** The
|
|
37
|
+
/** The `auth` policy a WebServer route accepts since DSH 0.2.2-rc.2. */
|
|
38
|
+
export type WebAuthPolicy = 'anonymous' | 'required' | 'deny';
|
|
39
|
+
/**
|
|
40
|
+
* The exact-route row this plugin registers.
|
|
41
|
+
*
|
|
42
|
+
* Every route here is a loopback-fenced callback for this machine's own
|
|
43
|
+
* launcher scripts (Finder/Explorer, macOS `open` helper) rather than a page
|
|
44
|
+
* fetch, so each one declares `auth: 'anonymous'`: DSH 0.2.2-rc.2 made
|
|
45
|
+
* `required` the default and the TCP launchers have no cookie to present
|
|
46
|
+
* (`401`). The handlers keep their own loopback + same-origin fences.
|
|
47
|
+
*/
|
|
38
48
|
export interface ExactRoute {
|
|
39
49
|
kind: 'exact';
|
|
40
50
|
path: string;
|
|
41
51
|
handler: RouteHandler;
|
|
52
|
+
auth?: WebAuthPolicy;
|
|
42
53
|
}
|
|
43
54
|
/** The `webServer` service slice the plugin uses. */
|
|
44
55
|
export interface WebServerService {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-open-in-dsh",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=24",
|
|
43
|
-
"dsh": "^0.2.1-rc.2 || ^0.2.2-alpha.2"
|
|
43
|
+
"dsh": "^0.2.1-rc.2 || ^0.2.2-alpha.2 || ^0.2.3-alpha.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@deepseek-ai/schemastery": "^3.18.5"
|