@deepseek-ai/dsh-api-session-controller 0.2.0-rc.2 → 0.2.1-alpha.1
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/README.i18n.yaml +8 -8
- package/README.md +4 -2
- package/README.zh.md +4 -2
- package/lib/client.js +622 -0
- package/lib/index.js +36 -13
- package/lib/typert.host.js +189 -89
- package/lib/typert.remote-client.js +147 -83
- package/lib/types/index.d.ts +9 -3
- package/lib/types/index.js +5 -3
- package/lib/types/list.d.ts +7 -3
- package/lib/types/list.js +29 -8
- package/package.json +75 -75
package/README.i18n.yaml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: 1fdf707322fb6996
|
|
16
16
|
zh: 0204f7e9d4aa3cce
|
|
17
17
|
/session-controller/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 77552723167e5d8e
|
|
19
|
+
zh: 1d77a657c707190a
|
|
20
20
|
/session-controller/client-references:
|
|
21
21
|
en: 41bdda1ac32df558
|
|
22
22
|
zh: aa5d0e325924066b
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
en: 266ab2b1e2fec542
|
|
25
25
|
zh: b3450ae28a1e0baf
|
|
26
26
|
/session-controller/configuration:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
27
|
+
en: 5ae2b340c630897f
|
|
28
|
+
zh: 1ffbd61ecf302ec2
|
|
29
29
|
/session-controller/model-experience:
|
|
30
30
|
en: 30b917bf822bb4df
|
|
31
31
|
zh: b0b023b5b526c317
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
en: 22fc0c9dbedd3bb6
|
|
34
34
|
zh: fad040ca55fd0e0a
|
|
35
35
|
/session-controller/known-limitations-and-deferred-work:
|
|
36
|
-
en:
|
|
37
|
-
zh:
|
|
36
|
+
en: 5db0f9f69a8be926
|
|
37
|
+
zh: 6ba1cc4a3850fcbc
|
|
38
38
|
/session-controller/known-limitations-and-deferred-work/dev-note:
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
39
|
+
en: e67f633dc6fe7773
|
|
40
|
+
zh: e88aeb617ffb74ea
|
package/README.md
CHANGED
|
@@ -33,6 +33,8 @@ The Client journal validates current Session event envelopes before publishing f
|
|
|
33
33
|
|
|
34
34
|
Each endpoint states its activation policy. List reads only stored headers and projection-cache rows: it never calls per-session stat or opens a cold Session body. A current-format cache identity may supply every list hint; a lifecycle-matching predecessor cache may supply only its version-compatible title as a stale display fact, never as an authoritative fold seed. Search, attachment, history pages, log following, skill discovery, and workspace-path opening can inspect persistence without activating an Agent; `canOpenWorkspacePath()` reports native-opening availability without addressing a Session. Cancellation requires live state; queue mutation, model, rename, prompt, and file-reference operations may resolve or resume an ordinary Session. Prompt rejects content with neither non-whitespace text nor an attachment before resolving the Agent or appending Session events; queue edits accept only non-empty text content. Prompt admission consumes opaque receipts from the injected [`fileUploads`](../../client/file-upload/README.md) Host service and resolves every same-Agent receipt before sending the complete ordered content list through `ctx.attachments`. Prompt retries whose `requestId` is already queued or logged return the original acceptance without inserting another message. Create and fork are the only operations that create a new Agent directly. The service applies one preset-aware resume policy and subagent ownership fence to its own methods and to the Typert Agent and Session lookups used by other Remote namespaces. Queue mutation has one narrow exception: a live child whose current projected identity is continuable and comes from its own non-seed suffix accepts the ordinary Edit, Remove, and QueueDock Steer actions across both inbox destinations. One-shot, missing, unknown, corrupt, seed-only, or cold children remain rejected without resume. The skill catalog uses a live Agent when present or the recorded preset's standing scope when cold, so listing never starts an Agent. The authenticated delivery routes use `workspaceDesktop()` for the serving Host name and file-manager behavior. `openWorkspacePath({ path, action: "reveal" })` delegates file-manager navigation to the native adapter; omitting `action` opens the file-type association, including HTML and SVG. Both operations require the composed filesystem to map the requested Host path to the same canonical process path; unmapped remote paths are refused before a native command runs. `session.projections` reads one complete baseline through a live-preferred Session observation without activating an Agent. It returns null for a missing Session and serves any registered projection keys. The Client exposes shared values and explicit-read state through `projectionsBySession`; domains select their own keys. Session-list summaries carry `agentAvailable`, updated through existing summary and status events independently of durable projections. Initial reads and live projection frames use the same sequence ordering.
|
|
35
35
|
|
|
36
|
+
Host list generation yields between complete rows only when its configured work slice is exhausted; cheap remaining work returns without a forced yield. Request cancellation is checked per row and after each yield and rejects without partial results. Each row is synchronous; the list does not promise one cross-Session snapshot. A Session already queued as cold remains a cached row if it attaches during a yield: Client in-flight mutation replay corrects its availability, and sequenced projections supersede cached hints.
|
|
37
|
+
|
|
36
38
|
Client list rows and resident Sessions use the current `sessionListMetadata` projection to reject stale blank-session hints; recency is the later of the summary timestamp and the projected last user prompt. When SessionManager creates an instance before its list row arrives, it reconciles blankness with metadata already retained for that Session. An opened conversation is therefore not reused by New Session even when an older list response still marks it blank.
|
|
37
39
|
|
|
38
40
|
Explicit-id `session.create` adopts a live Session or resumes a persisted Session while retaining its writer lock. Writer contention returns `session/writer-held`; callers may try another blank without suppressing unrelated failures. `session.list` includes persisted blanks using cached metadata, without opening cold log bodies.
|
|
@@ -92,6 +94,7 @@ A successful `selectModel` response acknowledges the Session-local selection wit
|
|
|
92
94
|
| Field | Default | Meaning |
|
|
93
95
|
|---|---:|---|
|
|
94
96
|
| `nativeOpen` | platform-detected | Whether Session workspace paths can be handed to a native desktop opener |
|
|
97
|
+
| `listWorkSliceMs` | `16` | Positive integral list-work time slice in milliseconds; checks occur between complete rows |
|
|
95
98
|
|
|
96
99
|
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-api-session-controller) is the exhaustive source for accepted fields and their JSDoc.
|
|
97
100
|
|
|
@@ -110,6 +113,7 @@ No direct effect; model requests remain owned by the Agent and LLM packages.
|
|
|
110
113
|
|
|
111
114
|
<a id="known-limitations-and-deferred-work"></a>
|
|
112
115
|
|
|
116
|
+
- A single summary, the query provider's own enumeration, final sorting, and response serialization can exceed the list work-slice target; it is not a hard Host latency bound.
|
|
113
117
|
- The image byte cap does not validate decoded dimensions or pixel count.
|
|
114
118
|
- A failed follow resumption remains visible to the caller instead of retrying indefinitely.
|
|
115
119
|
- The raw browser upload is one streaming HTTP request without resumable offsets; a retry sends the file again from byte zero.
|
|
@@ -127,5 +131,3 @@ No direct effect; model requests remain owned by the Agent and LLM packages.
|
|
|
127
131
|
None.
|
|
128
132
|
|
|
129
133
|
</details>
|
|
130
|
-
|
|
131
|
-
**Runtime invariant:** No companion is published. Every page and frame is checked against the addressed durable Session.
|
package/README.zh.md
CHANGED
|
@@ -33,6 +33,8 @@ Client journal 在发布 follow 快照、live entry 或历史页之前验证当
|
|
|
33
33
|
|
|
34
34
|
每个 endpoint 都声明自己的激活策略。列表只读取持久化 header 与 projection cache row,绝不调用逐 Session stat 或打开冷 Session body。当前格式 cache identity 可以提供全部列表 hint;生命周期匹配的 predecessor cache 只能提供版本兼容的 title,作为可能过时的展示事实,绝不能作为权威 fold seed。搜索、附件、历史页、日志跟随、skill 发现和工作区路径打开可以在不激活 Agent 的情况下检查 persistence;`canOpenWorkspacePath()` 无需指定 Session 即可报告原生打开能力。取消要求 live 状态;queue 变更、模型、重命名、prompt 和文件引用操作可以解析或恢复普通 Session。提示词会在解析 Agent 或追加 Session 事件前,拒绝既没有非空白文本也没有附件的 content;queue edit 只接受非空文本 content。prompt 准入从注入的 [`fileUploads`](../../client/file-upload/README.zh.md) Host 服务取得不透明凭证,在把完整有序内容列表交给 `ctx.attachments` 前解析每个属于同一 Agent 的凭证。`requestId` 已进入 queue 或日志时,prompt 重试直接返回原来的接受结果,不会重复插入消息。只有 create 与 fork 会直接创建新 Agent。该服务把同一套感知 preset 的恢复策略和 subagent ownership fence 同时用于自身方法,以及其他 Remote namespace 使用的 Typert Agent 与 Session lookup。Queue 变更只有一个狭窄例外:当前 projection identity 为 continuable 且来自自身非 seed suffix 的在线 child,可以在两个 inbox 目标上使用普通 Edit、Remove 与 QueueDock Steer action。One-shot、缺失、未知、损坏、仅含 seed identity 或冷 child 继续被拒绝,且不会恢复。skill 目录优先使用已有 live Agent,否则使用所记录 preset 的常驻 scope,因此列表查询绝不会启动 Agent。经过鉴权的文件交付路由通过 `workspaceDesktop()` 获取提供服务的 Host 名称和文件管理器行为。`openWorkspacePath({ path, action: "reveal" })` 将文件管理器导航委托给原生适配器;省略 `action` 时按文件类型关联打开,包括 HTML 和 SVG。两种操作都要求当前文件系统将请求的 Host 路径映射到同一个规范进程路径;无法映射的远端路径会在执行原生命令之前被拒绝。 `session.projections` 通过一次 live-preferred Session observation 读取完整基线,不激活 Agent。Session 不存在时返回 null,并可提供任意已注册的 projection key。Client 通过 `projectionsBySession` 暴露共享值和显式读取状态,由领域选择自身的 key。Session 列表摘要携带 `agentAvailable`,通过已有摘要与状态事件更新,与持久化 projection 相互独立。初始读取与实时 projection 帧使用相同的序号排序规则。
|
|
35
35
|
|
|
36
|
+
Host 仅在配置的工作时间片耗尽时,于完整条目之间让出事件循环;剩余工作较少时直接返回,不强制让出。每行及每次让出之后检查请求取消,取消时拒绝返回部分结果。每行同步计算;列表不承诺跨 Session 的统一快照。已经进入冷态队列的 Session 若在让出期间接入,仍返回缓存行:Client 对进行中请求的变更重放会纠正其可用性,带序号的投影会覆盖缓存提示。
|
|
37
|
+
|
|
36
38
|
Client 列表行和驻留 Session 使用当前 `sessionListMetadata` 投影纠正过期的空白会话提示;最近活动时间取摘要时间戳与投影中最后一次用户提示词时间的较晚值。当 SessionManager 在列表行到达前创建实例时,会使用已保留的该 Session 元数据对账空白状态。因此,即使旧列表响应仍将已有对话标为空白,新会话操作也不会复用已经打开过的对话。
|
|
37
39
|
|
|
38
40
|
显式 ID 的 `session.create` 会收养活动 Session,或恢复持久化 Session 并持续持有其写锁。写锁争用返回 `session/writer-held`;调用方可以尝试其他空白会话,同时保留其他失败。`session.list` 根据缓存元数据列出持久化空白会话,不打开冷日志正文。
|
|
@@ -92,6 +94,7 @@ GUI 模型选择要求确切提供方/模型对出现在可用目录中;不
|
|
|
92
94
|
| 字段 | 默认值 | 含义 |
|
|
93
95
|
|---|---:|---|
|
|
94
96
|
| `nativeOpen` | 平台探测 | 是否能把 Session 工作区路径交给原生桌面打开器 |
|
|
97
|
+
| `listWorkSliceMs` | `16` | 列表工作时间片,单位为毫秒,取正整数;在完整条目之间检查 |
|
|
95
98
|
|
|
96
99
|
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-api-session-controller)是所有受支持字段及其 JSDoc 的完整来源。
|
|
97
100
|
|
|
@@ -110,6 +113,7 @@ GUI 模型选择要求确切提供方/模型对出现在可用目录中;不
|
|
|
110
113
|
|
|
111
114
|
<a id="known-limitations-and-deferred-work"></a>
|
|
112
115
|
|
|
116
|
+
- 单个摘要、查询提供方自身的枚举、最终排序和响应序列化都可能超出列表时间片目标;它不是 Host 延迟的硬上限。
|
|
113
117
|
- 图片字节上限不校验解码后的尺寸或像素数。
|
|
114
118
|
- follow 恢复失败会对调用方可见,而不会无限重试。
|
|
115
119
|
- 浏览器原始字节上传使用一次不带断点续传偏移的流式 HTTP 请求;重试会从第零字节重新传输整个文件。
|
|
@@ -127,5 +131,3 @@ GUI 模型选择要求确切提供方/模型对出现在可用目录中;不
|
|
|
127
131
|
无。
|
|
128
132
|
|
|
129
133
|
</details>
|
|
130
|
-
|
|
131
|
-
**运行时不变式:** 不发布伴生入口。每个分页与帧都会对照其指向的持久 Session 校验。
|