Skip to content

Commit baf4c4e

Browse files
committed
fix(sdk): 修复会话资源接口上下文类型限制
1 parent 17a9b4f commit baf4c4e

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎.changeset/bailian-session-runtime-resources.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ Session 动态追加文件:`mountRemoteSessionResource`、`listRemoteSessionRe
1111
(`sesrsc_…`,卸载凭据)。挂载与卸载不产生会话事件;provider 返回的 `file_id` 是服务端内部副本
1212
id,完整载荷保留在 `attributes` 中。运行时挂载不进入 `getSession` 的 `resources` 回显,对账请
1313
使用列表端点。合同经 2026-11-02 live 实测校准。
14+
15+
上述四个 SDK 入口接受仅含 Provider 配置的 `ManagedApiContext`,无需项目配置或本地 State;
16+
现有 `ProjectRuntimeContext` 调用保持兼容。

‎packages/sdk/src/internal/core/managed-api-runtime.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import type {
3636
import type { ProviderSessionInfo, SessionResourceInfo } from "../types/session.ts";
3737
import type { ProviderSkillInfo } from "../types/skill-info.ts";
3838
import {
39+
type ManagedApiContext,
3940
requireManagedApiMethod as requiredMethod,
4041
resolveManagedApiAdapter as resolveAdapter,
4142
} from "./managed-api-context.ts";
@@ -213,7 +214,7 @@ export async function archiveRemoteSession(
213214
}
214215

215216
export async function mountRemoteSessionResource(
216-
ctx: ProjectRuntimeContext,
217+
ctx: ManagedApiContext,
217218
sessionId: string,
218219
input: SessionResourceMountInput,
219220
options: ManagedApiTarget = {},
@@ -224,7 +225,7 @@ export async function mountRemoteSessionResource(
224225
}
225226

226227
export async function listRemoteSessionResources(
227-
ctx: ProjectRuntimeContext,
228+
ctx: ManagedApiContext,
228229
sessionId: string,
229230
options: ManagedApiTarget & SessionResourceListOptions = {},
230231
): Promise<SessionResourcePage> {
@@ -234,7 +235,7 @@ export async function listRemoteSessionResources(
234235
}
235236

236237
export async function getRemoteSessionResource(
237-
ctx: ProjectRuntimeContext,
238+
ctx: ManagedApiContext,
238239
sessionId: string,
239240
resourceId: string,
240241
options: ManagedApiTarget = {},
@@ -245,7 +246,7 @@ export async function getRemoteSessionResource(
245246
}
246247

247248
export async function unmountRemoteSessionResource(
248-
ctx: ProjectRuntimeContext,
249+
ctx: ManagedApiContext,
249250
sessionId: string,
250251
resourceId: string,
251252
options: ManagedApiTarget = {},

0 commit comments

Comments
 (0)