diff --git a/apps/desktop-host/package.json b/apps/desktop-host/package.json index af74c36899..0d3a6e530d 100644 --- a/apps/desktop-host/package.json +++ b/apps/desktop-host/package.json @@ -26,7 +26,8 @@ "@deepseek-ai/dsh-skill-office": "workspace:*", "@deepseek-ai/dsh-deepseek-account": "workspace:*", "@deepseek-ai/dsh-workspace": "workspace:*", - "@deepseek-ai/dsh-plugin-manager": "workspace:*" + "@deepseek-ai/dsh-plugin-manager": "workspace:*", + "@deepseek-ai/dsh-util-file-drag": "workspace:*" }, "devDependencies": { "@deepseek-ai/cordis-plugin-loader": "workspace:~", @@ -39,7 +40,6 @@ "@deepseek-ai/dsh-sandbox-policy": "workspace:*", "@deepseek-ai/dsh-util-workspace-path": "workspace:*", "@deepseek-ai/dsh-brand": "workspace:*", - "@deepseek-ai/dsh-tool-executor-native": "workspace:*", - "@deepseek-ai/dsh-util-file-drag": "workspace:*" + "@deepseek-ai/dsh-tool-executor-native": "workspace:*" } } diff --git a/apps/desktop-host/src/file-drag.ts b/apps/desktop-host/src/file-drag.ts index 73647a3f42..be826e58e3 100644 --- a/apps/desktop-host/src/file-drag.ts +++ b/apps/desktop-host/src/file-drag.ts @@ -7,7 +7,7 @@ import type {} from '@deepseek-ai/dsh-session-persistence' import type {} from '@deepseek-ai/dsh-sandbox-policy' import type { SessionId } from '@deepseek-ai/dsh-session/types' import { parseFileAddress } from '@deepseek-ai/dsh-util-workspace-path' -import type { ApplicationDragReference, DesktopDragResource } from '@deepseek-ai/dsh-util-file-drag' +import { resolveApplicationDrag, type ApplicationDragReference, type DesktopDragResource } from '@deepseek-ai/dsh-util-file-drag' /** Private Host-to-main answer; never exposed to renderer JavaScript. */ export interface LocalDragResource { @@ -28,9 +28,7 @@ export async function localDragResource(ctx: Context, address: string, cancellat signal.throwIfAborted() if (address.startsWith('application:')) { const reference = address.slice('application:'.length) as ApplicationDragReference - const path = await ctx.serial('desktop/application-drag', reference, signal) - signal.throwIfAborted() - if (path === undefined) throw new Error('Application drag reference expired') + const path = await resolveApplicationDrag(ctx, reference, signal) return { kind: 'application', path } } const resource = parseFileAddress(address) diff --git a/docs/event-producer-consumer.md b/docs/event-producer-consumer.md index 94522af5d1..1f9faf4365 100644 --- a/docs/event-producer-consumer.md +++ b/docs/event-producer-consumer.md @@ -45,6 +45,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t | `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:97`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` | | `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:93`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | `account-controller`, `remotes` | | `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:12`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) | +| `desktop/application-drag` | `serial` | [`packages/util/file-drag/src/index.ts:31`](../packages/util/file-drag/src/index.ts) | `file-drag` (`serial`) | [`cua`](../packages/experimental/cua) | | `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` | | `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | | `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:27`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `forge-session` | diff --git a/docs/event-producer-consumer.zh.md b/docs/event-producer-consumer.zh.md index 38585aa8ab..9e78b0c5f8 100644 --- a/docs/event-producer-consumer.zh.md +++ b/docs/event-producer-consumer.zh.md @@ -47,6 +47,7 @@ | `deepseek-account/model-sign-in-required` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:97`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account`](../packages/credentials/deepseek-account) (`emit`) | `remotes` | | `deepseek-account/session-expired` | `emit` | [`packages/credentials/deepseek-account/src/types.ts:93`](../packages/credentials/deepseek-account/src/types.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | `account-controller`, `remotes` | | `deepseek-account/signed-out` | `emit` | [`packages/credentials/deepseek-account/src/index.ts:12`](../packages/credentials/deepseek-account/src/index.ts) | [`deepseek-account-platform`](../packages/credentials/deepseek-account-platform) (`emit`) | [`deepseek-account`](../packages/credentials/deepseek-account) | +| `desktop/application-drag` | `serial` | [`packages/util/file-drag/src/index.ts:31`](../packages/util/file-drag/src/index.ts) | `file-drag` (`serial`) | [`cua`](../packages/experimental/cua) | | `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` | | `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | | `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:27`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `forge-session` | diff --git a/docs/subsystems/computer-use.md b/docs/subsystems/computer-use.md index 957990b09c..12a6ded651 100644 --- a/docs/subsystems/computer-use.md +++ b/docs/subsystems/computer-use.md @@ -103,12 +103,19 @@ Browser controls for provider-owned native permission and application decisions. @Remote async applicationIcons(): Promise> /** - * Request a system privilege explicitly selected by the user. + * Request a system privilege and open its settings pane. * @param permission macOS privilege to request. * @returns Preflight state after requesting; a false value never implies consent. */ @Remote async requestPermission(permission: CuaSystemPermission): Promise +/** + * Select the displayed permission application in Finder. + * @param reference Application identity from the current permission observation. + * @returns Completion after dispatch to Finder; rejects stale or unavailable applications. + */ +@Remote async revealApplication(reference: ApplicationDragReference): Promise + /** * Open the macOS privacy pane selected by the user. * @param permission Corresponding system privilege. @@ -131,5 +138,7 @@ Browser controls for provider-owned native permission and application decisions. @Remote async retryApproval(id: CuaApplicationId): Promise ``` +Types: [ApplicationDragReference](web-server.md) + Source: [`packages/experimental/cua/src/access.ts`](../../packages/experimental/cua/src/access.ts) diff --git a/docs/subsystems/computer-use.zh.md b/docs/subsystems/computer-use.zh.md index 30d6f91ae1..b2074d53fa 100644 --- a/docs/subsystems/computer-use.zh.md +++ b/docs/subsystems/computer-use.zh.md @@ -103,12 +103,19 @@ Browser controls for provider-owned native permission and application decisions. @Remote async applicationIcons(): Promise> /** - * Request a system privilege explicitly selected by the user. + * Request a system privilege and open its settings pane. * @param permission macOS privilege to request. * @returns Preflight state after requesting; a false value never implies consent. */ @Remote async requestPermission(permission: CuaSystemPermission): Promise +/** + * Select the displayed permission application in Finder. + * @param reference Application identity from the current permission observation. + * @returns Completion after dispatch to Finder; rejects stale or unavailable applications. + */ +@Remote async revealApplication(reference: ApplicationDragReference): Promise + /** * Open the macOS privacy pane selected by the user. * @param permission Corresponding system privilege. @@ -131,5 +138,7 @@ Browser controls for provider-owned native permission and application decisions. @Remote async retryApproval(id: CuaApplicationId): Promise ``` +Types: [ApplicationDragReference](web-server.zh.md) + Source: [`packages/experimental/cua/src/access.ts`](../../packages/experimental/cua/src/access.ts) diff --git a/docs/subsystems/web-server.i18n.yaml b/docs/subsystems/web-server.i18n.yaml index d34ca1303f..e4b4be2630 100644 --- a/docs/subsystems/web-server.i18n.yaml +++ b/docs/subsystems/web-server.i18n.yaml @@ -14,3 +14,6 @@ /http-server/the-service: en: d1922a5e809e20c3 zh: 5c1772c81a19784c +/http-server/desktop-application-files: + en: 7adc5e30cfbe1a13 + zh: 099d0084a0f0f279 diff --git a/docs/subsystems/web-server.md b/docs/subsystems/web-server.md index 2420b6713b..eac58816c8 100644 --- a/docs/subsystems/web-server.md +++ b/docs/subsystems/web-server.md @@ -107,6 +107,10 @@ No composition can bind every interface at once: the unspecified address is reje A request whose handling throws (a malformed %-escape hitting `decodeURIComponent`, a client dropping mid-body) is logged as a warning and answered 400 — or the socket destroyed when headers are already out — never a process exit. Disposal pairs `close()` with `closeAllConnections()` because a handler may hold its response open (SSE) and such connections never end on their own; without the force-close, teardown would hang. A TLS socket counts as a connection only after its handshake, so the server tracks raw TLS sockets beside upgraded ones and destroys both at disposal. The package never prints: the URL line belongs to the shell. Per-package operational detail, including the dev-mode bundle watch pipeline, stays in the [README](../../packages/host/webserver/README.md). +## Desktop application files + +`ApplicationDragReference` is an opaque provider-issued identity for a local application bundle. The Desktop Host resolves it through `desktop/application-drag`; the provider verifies that the reference still names the current application before the shell prepares a native drag. The renderer supplies no filesystem path. [File drag definitions](../../packages/util/file-drag/README.md) own the request types, and [Desktop](../../apps/desktop/README.md) owns directory validation and native delivery. + @@ -320,6 +324,29 @@ Admit or wrap an authenticated shared API request, including body transfer. Exis Source: [`packages/client/connection/src/index.ts`](../../packages/client/connection/src/index.ts) + + +### `desktop/*` events + + + +#### `desktop/application-drag` — serial + +Resolve a provider-issued application reference for the local desktop carrier. + +```ts cordis-catalog +/** + * Resolve a provider-issued application reference for the local desktop carrier. + * @mode serial + * @param reference Opaque application identity issued by the owning provider. + * @param signal Preparation cancellation. + * @returns Authorized application path, or undefined when this listener does not own the reference. + */ +'desktop/application-drag'(reference: ApplicationDragReference, signal: AbortSignal): Promise +``` + +Source: [`packages/util/file-drag/src/index.ts`](../../packages/util/file-drag/src/index.ts) + ### `webserver/*` events diff --git a/docs/subsystems/web-server.zh.md b/docs/subsystems/web-server.zh.md index a59344ad75..db860dde48 100644 --- a/docs/subsystems/web-server.zh.md +++ b/docs/subsystems/web-server.zh.md @@ -107,6 +107,10 @@ interface TlsConfig { 处理过程中抛出异常的请求(畸形的 % 转义撞上 `decodeURIComponent`、客户端在请求体中途断开)会记录为警告并应答 400(响应头已发出时则销毁 socket),绝不导致进程退出。dispose(资源释放)把 `close()` 与 `closeAllConnections()` 配对使用,因为处理器可能像 SSE(Server-Sent Events)那样保持响应打开,而这类连接永远不会自行结束;没有强制关闭,拆卸就会挂起。TLS socket 只有完成握手后才计入连接,因此服务器会把原始 TLS socket 与升级后的 socket 一并跟踪,并在 dispose 时销毁两者。该包从不打印输出:URL 行归 shell 所有。逐包运维细节(含开发模式的 bundle 监视流水线)留在 [README](../../packages/host/webserver/README.zh.md) 中。 +## 桌面应用文件 + +`ApplicationDragReference` 是提供方为本地应用包签发的不透明标识。Desktop Host 通过 `desktop/application-drag` 解析,提供方确认引用仍对应当前应用后,桌面载体才准备原生拖动。渲染页面不提供文件系统路径。[文件拖动定义](../../packages/util/file-drag/README.zh.md)负责请求类型,[Desktop](../../apps/desktop/README.zh.md)负责目录验证和原生交付。 + @@ -320,6 +324,29 @@ Admit or wrap an authenticated shared API request, including body transfer. Exis Source: [`packages/client/connection/src/index.ts`](../../packages/client/connection/src/index.ts) + + +### `desktop/*` events + + + +#### `desktop/application-drag` — serial + +Resolve a provider-issued application reference for the local desktop carrier. + +```ts cordis-catalog +/** + * Resolve a provider-issued application reference for the local desktop carrier. + * @mode serial + * @param reference Opaque application identity issued by the owning provider. + * @param signal Preparation cancellation. + * @returns Authorized application path, or undefined when this listener does not own the reference. + */ +'desktop/application-drag'(reference: ApplicationDragReference, signal: AbortSignal): Promise +``` + +Source: [`packages/util/file-drag/src/index.ts`](../../packages/util/file-drag/src/index.ts) + ### `webserver/*` events diff --git a/packages/client/ui-file-drag/src/client/transfers.ts b/packages/client/ui-file-drag/src/client/transfers.ts index 334e329141..4d30627e41 100644 --- a/packages/client/ui-file-drag/src/client/transfers.ts +++ b/packages/client/ui-file-drag/src/client/transfers.ts @@ -26,6 +26,7 @@ export class FileTransfers { } /** + * Borrow a provider-authorized application for native dragging. * @param reference Provider-authorized application. * @param signal Preparation cancellation. * @returns Native drag operation; no byte-copy fallback exists for applications. diff --git a/packages/experimental/cua/src/access-types.ts b/packages/experimental/cua/src/access-types.ts index 592cf34715..f82a0b5153 100644 --- a/packages/experimental/cua/src/access-types.ts +++ b/packages/experimental/cua/src/access-types.ts @@ -1,6 +1,6 @@ /** Client-safe Computer Use permission observations and saved application decisions. */ import type { CuaApplicationGrant } from './application-types.ts' -import type { ApplicationDragReference } from '@deepseek-ai/dsh-util-file-drag' +import type { ApplicationDragReference } from '@deepseek-ai/dsh-util-file-drag/types' export type { CuaApplicationGrant, CuaApplicationId } from './application-types.ts' /** macOS privileges used by the native provider. */ diff --git a/packages/experimental/cua/src/access.ts b/packages/experimental/cua/src/access.ts index a815e5157c..93384f042c 100644 --- a/packages/experimental/cua/src/access.ts +++ b/packages/experimental/cua/src/access.ts @@ -1,7 +1,7 @@ /** Browser controls for the provider's application decisions and native permission work. */ import type { Context } from '@deepseek-ai/cordis' import { randomUUID } from 'node:crypto' -import type { ApplicationDragReference } from '@deepseek-ai/dsh-util-file-drag' +import type { ApplicationDragReference } from '@deepseek-ai/dsh-util-file-drag/types' import type {} from '@deepseek-ai/dsh-config-editor' import type {} from '@deepseek-ai/dsh-ptc-runtime' import { resolvePersistentExecution } from '@deepseek-ai/dsh-ptc-runtime-node/configuration' diff --git a/packages/extensions/tool-cordis/src/api-catalog.ts b/packages/extensions/tool-cordis/src/api-catalog.ts index 373b67b230..a35588634a 100644 --- a/packages/extensions/tool-cordis/src/api-catalog.ts +++ b/packages/extensions/tool-cordis/src/api-catalog.ts @@ -991,10 +991,16 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [ }, { signature: '@Remote async requestPermission(permission: CuaSystemPermission): Promise', - description: 'Request a system privilege explicitly selected by the user.', + description: 'Request a system privilege and open its settings pane.', parameters: [{ name: 'permission', description: 'macOS privilege to request.' }], returns: 'Preflight state after requesting; a false value never implies consent.', }, + { + signature: '@Remote async revealApplication(reference: ApplicationDragReference): Promise', + description: 'Select the displayed permission application in Finder.', + parameters: [{ name: 'reference', description: 'Application identity from the current permission observation.' }], + returns: 'Completion after dispatch to Finder; rejects stale or unavailable applications.', + }, { signature: '@Remote async openSettings(permission: CuaSystemPermission): Promise', description: 'Open the macOS privacy pane selected by the user.', @@ -4918,6 +4924,14 @@ export const EVENT_API: readonly EventApiEntry[] = [ description: 'Local grant removal has completed.', parameters: [], }, + { + name: 'desktop/application-drag', + mode: 'serial', + signature: '\'desktop/application-drag\'(reference: ApplicationDragReference, signal: AbortSignal): Promise', + summary: 'Resolve a provider-issued application reference for the local desktop carrier.', + description: 'Resolve a provider-issued application reference for the local desktop carrier.', + parameters: [{ name: 'reference', description: 'Opaque application identity issued by the owning provider.' }, { name: 'signal', description: 'Preparation cancellation.' }], + }, { name: 'domain/changed', mode: 'emit', @@ -5510,6 +5524,10 @@ export const TYPE_API: readonly TypeApiEntry[] = [ name: 'ApiSessionAgentResult', declaration: 'export type ApiSessionAgentResult = {\n readonly agent: Agent;\n} | {\n readonly error: ApiSessionAgentError;\n};', }, + { + name: 'ApplicationDragReference', + declaration: 'export type ApplicationDragReference = Branded<\'ApplicationDragReference\'>;', + }, { name: 'ApprovalOutcome', declaration: 'export type ApprovalOutcome = \'allowed-once\' | \'rejected\' | \'cancelled\' | \'unavailable\';', @@ -6108,7 +6126,7 @@ export const TYPE_API: readonly TypeApiEntry[] = [ }, { name: 'CuaSystemPermissionState', - declaration: 'export interface CuaSystemPermissionState {\n accessibility: boolean;\n screenRecording: boolean;\n helper: CuaPermissionProcess;\n parent: CuaPermissionProcess;\n launchApplication?: {\n name: string;\n path: string;\n icon?: string | undefined;\n } | undefined;\n}', + declaration: 'export interface CuaSystemPermissionState {\n accessibility: boolean;\n screenRecording: boolean;\n helper: CuaPermissionProcess;\n parent: CuaPermissionProcess;\n launchApplication?: {\n name: string;\n path: string;\n icon?: string | undefined;\n bundleId?: string | undefined;\n dragReference?: ApplicationDragReference | undefined;\n } | undefined;\n guidancePolling: {\n intervalMs: number;\n timeoutMs: number;\n };\n}', }, { name: 'DailyInput', diff --git a/packages/util/file-drag/README.i18n.yaml b/packages/util/file-drag/README.i18n.yaml index 5e3c8552b0..53d5ae08ca 100644 --- a/packages/util/file-drag/README.i18n.yaml +++ b/packages/util/file-drag/README.i18n.yaml @@ -15,8 +15,8 @@ en: d2f09029bb49c4b4 zh: 9856543a60ee4dfa /deepseek-ai-dsh-util-file-drag/use-this-package: - en: 4020e5c4139730f9 - zh: 1d68a659d5122ac9 + en: babdcf76d47caa4d + zh: d2cf1d0b951552ff /deepseek-ai-dsh-util-file-drag/known-limitations-and-deferred-work: en: 5e1af9ab5f8427f5 zh: 1272263effff89c8 diff --git a/packages/util/file-drag/README.md b/packages/util/file-drag/README.md index 83cd1c87d3..4f7cb99ec6 100644 --- a/packages/util/file-drag/README.md +++ b/packages/util/file-drag/README.md @@ -26,7 +26,7 @@ Callers can export files with the same safe filename in Web and Desktop. MIME da `DesktopFileDrag.prepare(source, requestId)` accepts complete bytes or a Session resource reference, returning an opaque handle. `cancel(requestId)` stops unfinished preparation before a handle is available. Resource borrowing requires Host authorization and main-process content/name checks; callers fall back to byte preparation when borrowing is unavailable. [The plugin](../../client/ui-file-drag/README.md) owns browser preparation and [Desktop](../../../apps/desktop/README.md) owns native delivery. -`DesktopFileDrag.applications` advertises native application dragging. An `application` source carries a provider-issued `ApplicationDragReference`; the desktop Host resolves it through the serial `desktop/application-drag` event. A listener returns the current authorized bundle path only for references it owns. No listener means expiration. The carrier validates the application directory before borrowing and starting the drag. This path never falls back to exporting image bytes. +`DesktopFileDrag.applications` advertises native application dragging. An `application` source carries a provider-issued `ApplicationDragReference`; the desktop Host resolves it through the serial `desktop/application-drag` event. A listener returns the current authorized bundle path only for references it owns. No listener means expiration. The carrier validates the application directory before borrowing and starting the drag. This path never falls back to exporting image bytes. `resolveApplicationDrag(ctx, reference, signal)` dispatches that lookup and rejects expired references or cancellation. ## Known Limitations and Deferred Work diff --git a/packages/util/file-drag/README.zh.md b/packages/util/file-drag/README.zh.md index 7732763661..5da246a18e 100644 --- a/packages/util/file-drag/README.zh.md +++ b/packages/util/file-drag/README.zh.md @@ -26,7 +26,7 @@ kind: "package-library" `DesktopFileDrag.prepare(source, requestId)` 接受完整字节或 Session 资源地址,返回不透明句柄。`cancel(requestId)` 可在句柄返回前停止未完成的准备。资源借用必须经过 Host 授权与主进程的内容、名称检查;无法借用时,调用方回退到字节准备。[插件](../../client/ui-file-drag/README.zh.md) 负责浏览器准备,[Desktop](../../../apps/desktop/README.zh.md) 负责原生交付。 -`DesktopFileDrag.applications` 声明原生应用拖动能力。`application` 来源携带提供方签发的 `ApplicationDragReference`,桌面 Host 通过串行事件 `desktop/application-drag` 解析。监听器仅为自己拥有的引用返回当前授权应用路径,没有监听器表示引用已失效。载体在借用和起拖前验证应用目录,该流程不会回退为导出图像字节。 +`DesktopFileDrag.applications` 声明原生应用拖动能力。`application` 来源携带提供方签发的 `ApplicationDragReference`,桌面 Host 通过串行事件 `desktop/application-drag` 解析。监听器仅为自己拥有的引用返回当前授权应用路径,没有监听器表示引用已失效。载体在借用和起拖前验证应用目录,该流程不会回退为导出图像字节。 `resolveApplicationDrag(ctx, reference, signal)` 发起该查询,并拒绝失效引用或已取消的操作。 ## 已知限制与后续工作 diff --git a/packages/util/file-drag/src/index.ts b/packages/util/file-drag/src/index.ts index 505679f23c..d7568648b7 100644 --- a/packages/util/file-drag/src/index.ts +++ b/packages/util/file-drag/src/index.ts @@ -1,7 +1,7 @@ /** File export naming, browser transfer token type, and native byte-or-resource requests. */ import mime from 'mime' import type { Branded } from '@deepseek-ai/dsh-brand' -import type {} from '@deepseek-ai/cordis' +import type { Context } from '@deepseek-ai/cordis' /** Browser transfer token type; original bytes stay with the application owner. */ export const FILE_DRAG_TOKEN_TYPE = 'application/x-dsh-file' @@ -32,6 +32,21 @@ declare module '@deepseek-ai/cordis' { } } +/** + * Resolve a live application reference through its owning Host plugin. + * @param ctx Host event context. + * @param reference Provider-issued application identity. + * @param signal Preparation cancellation. + * @returns Authorized bundle path; rejects expired references and cancelled preparations. + */ +export async function resolveApplicationDrag(ctx: Context, reference: ApplicationDragReference, signal: AbortSignal): Promise { + signal.throwIfAborted() + const path = await ctx.serial('desktop/application-drag', reference, signal) + signal.throwIfAborted() + if (path === undefined) throw new Error('Application drag reference expired') + return path +} + /** Caller-supplied export naming, shared by Web and Desktop. */ export interface DragFileName { readonly name?: string | undefined diff --git a/packages/util/file-drag/tsconfig.json b/packages/util/file-drag/tsconfig.json index eb6724d0c5..84515c828c 100644 --- a/packages/util/file-drag/tsconfig.json +++ b/packages/util/file-drag/tsconfig.json @@ -8,6 +8,9 @@ "src" ], "references": [ + { + "path": "../../../vendor/cordis" + }, { "path": "../brand" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbf68a310e..3f72224558 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -881,6 +881,9 @@ importers: '@deepseek-ai/dsh-tool-workspace-dependencies': specifier: workspace:* version: link:../../packages/skill/tool-workspace-dependencies + '@deepseek-ai/dsh-util-file-drag': + specifier: workspace:* + version: link:../../packages/util/file-drag '@deepseek-ai/dsh-workspace': specifier: workspace:* version: link:../../packages/workspace/workspace @@ -921,9 +924,6 @@ importers: '@deepseek-ai/dsh-tool-executor-native': specifier: workspace:* version: link:../../packages/core/tool-executor-native - '@deepseek-ai/dsh-util-file-drag': - specifier: workspace:* - version: link:../../packages/util/file-drag '@deepseek-ai/dsh-util-workspace-path': specifier: workspace:* version: link:../../packages/util/workspace-path diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts index 866a6ba263..565bc07af8 100644 --- a/scripts/gen-cordis-catalog.ts +++ b/scripts/gen-cordis-catalog.ts @@ -242,6 +242,7 @@ export const EVENT_SCOPE_PAGE: Record = { 'approval': 'approval.md', 'commands': 'commands.md', 'connection': 'web-server.md', + 'desktop': 'web-server.md', 'compaction': 'compaction.md', 'cordis': 'extensions.md', 'authorization': 'credentials.md', @@ -348,6 +349,7 @@ export const LINK_MAP: Readonly> = { BrowserUseProviderName: 'browser-use.md', ComputerUseProviderName: 'computer-use.md', CuaApplicationId: 'computer-use.md', + ApplicationDragReference: 'web-server.md', CuaApplicationGrant: 'computer-use.md', CuaPermissionProcess: 'computer-use.md', CuaApplicationState: 'computer-use.md', diff --git a/tsconfig.base.json b/tsconfig.base.json index 8389ac37bc..7a3ea866f2 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -404,6 +404,7 @@ // so these aliases stay hand-written like dsh-util-crypto above. "@deepseek-ai/dsh-util-time": ["./packages/util/time/src"], "@deepseek-ai/dsh-util-file-drag": ["./packages/util/file-drag/src"], + "@deepseek-ai/dsh-util-file-drag/types": ["./packages/util/file-drag/src/types.ts"], // session-log-export lives under session-query/, so the generated aliases map only its // bare name; the browser half needs this explicit subpath for source-mode dynamic imports. "@deepseek-ai/dsh-session-log-export/client": ["./packages/session-query/session-log-export/src/client"],