@deepseek-ai/dsh-session-log-export 0.1.5-rc.1 → 0.1.6-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 +2 -2
- package/README.md +1 -1
- package/README.zh.md +12 -12
- package/lib/index.js +1 -0
- package/package.json +20 -20
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/session-query/session-log-export/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 8697b0c2c105c928f5325f953b7fb663ae68e18e
|
|
6
|
+
README.zh.md: fe60c6ab8cc8d2d5e7515416bb72624584c11b9d
|
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ The package has two halves. The Host half ([`src/index.ts`](src/index.ts)) regis
|
|
|
77
77
|
|
|
78
78
|
### Download flow
|
|
79
79
|
|
|
80
|
-
Both entry paths issue a `HEAD` preflight to
|
|
80
|
+
Both entry paths issue a `HEAD` preflight to `/api/session.export?...`, then hand the GET URL to the browser download manager without buffering the ZIP in JavaScript. One controller owns one in-flight download per session, collapses concurrent gestures into that operation, and cancels the preflight on plugin disposal. Modal state lives in a snapshot store keyed by session, so the button and the command share one dialog per session.
|
|
81
81
|
|
|
82
82
|
The Host route is a feature-owned exact Fetch contribution. Connection applies its Host/Origin and browser-session checks and bridges the streaming `Response`; this package owns query validation, live-session flushes, handle-based log reads and attachment reads, ZIP generation, and HTTP status semantics.
|
|
83
83
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-session-log-export` 让 Web 界面可以下载会话的完整历史:Session Header 更多操作按钮下的 `下载 Session 日志` 菜单项与 `/export` 斜杠命令都会把会话树——会话本身、其子会话与附件——作为 ZIP 交给浏览器下载。本包拥有 Host 归档流、经过认证的 Fetch
|
|
12
|
+
`dsh-session-log-export` 让 Web 界面可以下载会话的完整历史:Session Header 更多操作按钮下的 `下载 Session 日志` 菜单项与 `/export` 斜杠命令都会把会话树——会话本身、其子会话与附件——作为 ZIP 交给浏览器下载。本包拥有 Host 归档流、经过认证的 Fetch 路由以及浏览器控件和反馈。下载目标位置由浏览器选择。设置与用法在前,随后说明实现细节。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@ kind: "package-reference"
|
|
|
29
29
|
|
|
30
30
|
### 何时选择
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
为需要带可见下载弹窗的面向用户的会话导出的 Web 部署选择它。需要程序化或 Host 侧导出时避免使用:本包产生的是浏览器下载,而非 Host 路径写入。日志从持久化读句柄序列化而来,因此任何已挂载后端都受支持。
|
|
33
33
|
|
|
34
34
|
### 组合
|
|
35
35
|
|
|
@@ -50,12 +50,12 @@ Web bundle 将本包与 Connection、`dsh-commands`、`dsh-client-ui-commands`
|
|
|
50
50
|
|
|
51
51
|
| 输入 | 结果 |
|
|
52
52
|
|---|---|
|
|
53
|
-
| `/export` |
|
|
53
|
+
| `/export` | 记录用户命令的生命周期;提交命令的浏览器下载 `GET /api/session.export?sessionId=<id>&includeDescendants=true` |
|
|
54
54
|
| `/export <path>` | 错误;浏览器下载通过浏览器的普通下载行为选择目标位置 |
|
|
55
55
|
|
|
56
56
|
### 预期行为
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
弹窗报告三个阶段:准备中、开始下载或失败。关闭弹窗不会取消正在进行的下载,该操作随后结束时弹窗也不会重新打开。每个会话同时只允许一项下载,重复操作共用该任务。导出包含实时会话的最新事件:Host 端点在读取前会 flush 活动的根会话,因此斜杠命令触发的 ZIP 会包含启动下载的 `command/run` 与 `command/done` 事件对;非活动的持久化会话不需要 flush。每份逻辑日志在归档中使用当前 generation 的规范文件名(v0 为 `session.jsonl`,其他版本为 `session.vN.jsonl`),每个子会话目录下也遵循同一规则。图片使用 `media/<attachmentId>.<ext>`,通用文件使用 `files/<digest-prefix>/<digest>/<name>`。通用文件以有界分块读取并压缩,因此导出大型上传文件时不会把它完整缓冲进内存。
|
|
59
59
|
|
|
60
60
|
### 失败
|
|
61
61
|
|
|
@@ -69,17 +69,17 @@ Web bundle 将本包与 Connection、`dsh-commands`、`dsh-client-ui-commands`
|
|
|
69
69
|
<details>
|
|
70
70
|
<summary>实现细节——点击展开</summary>
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
本节解释本包如何接入导出控件,并指出实现它的代码位置;可观察行为已在[使用本包](#use-this-package)中完整说明。
|
|
73
73
|
|
|
74
74
|
### 设计拆分
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
本包分为两部分。Host 半包([`src/index.ts`](src/index.ts))注册 `/export` 命令,并向 Connection 贡献精确的 `GET`/`HEAD /api/session.export` Fetch 路由;[`src/archive.ts`](src/archive.ts) 构建有界 ZIP 流。浏览器半包([`src/client/index.ts`](src/client/index.ts))提供共享下载控制器和 UI,并观察 `command/executed`,因此只有提交命令的浏览器会启动下载。
|
|
77
77
|
|
|
78
78
|
### 下载流程
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
两条入口都会先向 `/api/session.export?...` 发出 `HEAD` 预检请求,然后把 GET URL 交给浏览器下载管理器,JavaScript 不缓冲 ZIP。一个控制器按会话持有一项进行中的下载,把并发操作折叠进该任务,并在插件释放时取消预检。弹窗状态存放在按会话键控的快照存储中,因此按钮与命令按会话共享一个弹窗。
|
|
81
81
|
|
|
82
|
-
Host
|
|
82
|
+
Host 路由是由该功能拥有的精确 Fetch 路由贡献。Connection 应用 Host/Origin 与浏览器会话检查并桥接流式 `Response`;本包拥有查询校验、活动会话 flush、基于句柄的日志读取与附件读取、ZIP 生成和 HTTP 状态语义。
|
|
83
83
|
|
|
84
84
|
</details>
|
|
85
85
|
|
|
@@ -88,12 +88,12 @@ Host 路由是业务拥有的精确 Fetch contribution。Connection 应用 Host/
|
|
|
88
88
|
<a id="further-exploration"></a>
|
|
89
89
|
## 进一步探索
|
|
90
90
|
|
|
91
|
-
当包级约定不够用时阅读以下页面。它们从 Web
|
|
91
|
+
当包级约定不够用时阅读以下页面。它们从 Web 控件逐步进入 Host 端点及相关的命令与会话接口。
|
|
92
92
|
|
|
93
93
|
- [dsh-client-connection](../../client/connection/README.zh.md)——Host 端点使用的认证 Fetch 路由载体。
|
|
94
94
|
- [命令子系统参考](../../../docs/subsystems/commands.zh.md)——`/export` 命令注册的用户命令注册表。
|
|
95
|
-
- [dsh-client-ui-commands](../../client/ui-commands/README.zh.md)——渲染并确认 `/export`
|
|
96
|
-
- [会话查询包映射](../README.zh.md)
|
|
95
|
+
- [dsh-client-ui-commands](../../client/ui-commands/README.zh.md)——渲染并确认 `/export` 的浏览器命令界面。
|
|
96
|
+
- [会话查询包映射](../README.zh.md)——本包所属的检索包族。
|
|
97
97
|
|
|
98
98
|
-----
|
|
99
99
|
|
|
@@ -138,4 +138,4 @@ Host 路由是业务拥有的精确 Fetch contribution。Connection 应用 Host/
|
|
|
138
138
|
|
|
139
139
|
</details>
|
|
140
140
|
|
|
141
|
-
**运行时不变式:** 不发布伴生入口。Connection
|
|
141
|
+
**运行时不变式:** 不发布伴生入口。Connection 与命令注册表持有两个注册,每次导出均读取权威的 Session 服务。
|
package/lib/index.js
CHANGED
|
@@ -474,6 +474,7 @@ const REQUESTED = {
|
|
|
474
474
|
*/
|
|
475
475
|
function apply(ctx, config = {}) {
|
|
476
476
|
ctx.effect(() => ctx.commands.register({
|
|
477
|
+
definitionId: brandString("@deepseek-ai/dsh-session-log-export"),
|
|
477
478
|
name: "export",
|
|
478
479
|
description: "Download this Session log as a ZIP archive",
|
|
479
480
|
handler: (invocation) => Promise.resolve(invocation.rawInput.trim() === "" ? REQUESTED : {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-log-export",
|
|
3
3
|
"description": "Web Session-log export command and shared download dialog",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,35 +33,35 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"fflate": "^0.8.2",
|
|
36
|
-
"@deepseek-ai/dsh-session-format": "^0.1.5-rc.1",
|
|
37
36
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
38
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
37
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
|
|
38
|
+
"@deepseek-ai/dsh-session-format": "^0.1.6-alpha.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
41
42
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
42
|
-
"@deepseek-ai/dsh-session-persistence": "^0.1.
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.1.5-rc.1"
|
|
43
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/react": "~18.3.1",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
49
49
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
50
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
51
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-client-
|
|
54
|
-
"@deepseek-ai/dsh-client-
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-session
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
50
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-attachment": "^0.1.6-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-client-store": "^0.1.6-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-commands": "^0.1.6-alpha.1",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.6-alpha.1",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.1",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.1",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.6-alpha.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.1",
|
|
61
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-session-query": "^0.1.6-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
64
|
+
"@deepseek-ai/dsh-commands": "^0.1.6-alpha.1"
|
|
65
65
|
},
|
|
66
66
|
"dsh": {
|
|
67
67
|
"client": {
|