@leiyi-works/dsh-session-tmpdir 0.5.5 → 0.5.7
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.md +6 -2
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Task Temp Folder(session-task-tmpdir)v0.5.
|
|
1
|
+
# Task Temp Folder(session-task-tmpdir)v0.5.7
|
|
2
2
|
|
|
3
3
|
给每个 DSH 会话一个**任务临时目录**,并在**会话被删除 7 天后**自动清掉对应目录:
|
|
4
4
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
## 长期文件审批流程
|
|
47
47
|
|
|
48
48
|
1. 模型判断某文件需要长期保存,且不在任务指定位置;
|
|
49
|
-
2. 模型调用 `ask_user_question` 给用户选择题(标签只写 **A 不长期保存** / **B 工作区根目录保存**,细节放选项 description
|
|
49
|
+
2. 模型调用 `ask_user_question` 给用户选择题(标签只写 **A 不长期保存** / **B 工作区根目录保存**,细节放选项 description 小字;选 B 时模型自行起目录名、不再跟用户确认;其他位置由用户直接在输入框里写路径);
|
|
50
50
|
3. 用户选长期 + 给路径 → 模型调 `longterm_approve({ path, reason, basis })` 登记;
|
|
51
51
|
4. 之后 `write`/`edit`/`pwsh` 才能写该目录;用户否定 → 模型改用 `task_tmpdir` 写 `_tmp`。
|
|
52
52
|
|
|
@@ -85,3 +85,7 @@ v0.5.3 变更(2026-11-12):B/C 选项文案按实际使用重写,消除
|
|
|
85
85
|
v0.5.4 变更(2026-11-12):按实际弹窗效果精简选项——删掉 C("存到指定位置"与输入框重复,用户改成在自由输入框写路径即可,模型收到非 A/B 答案时按指定位置处理,路径不清先追问);B 去掉括号说明,只留"工作区根目录保存"。规则与 guard 未改。
|
|
86
86
|
|
|
87
87
|
v0.5.5 变更(2026-11-12):选项标签统一写短(A 只写"不长期保存",路径等说明移到选项 `description` 小字),并要求不许把路径细节塞进标签;避免长标签把 GUI 里的描述小字顶到下一行造成排版不一致。规则与 guard 未改。
|
|
88
|
+
|
|
89
|
+
v0.5.6 变更(2026-11-12):选 B(工作区根目录保存)时不再要用户确认目录名——模型自行起一个清楚的目录名、`longterm_approve` 登记后直接写,跟 DSH 平时自己命名落盘一样;B 的小字改为"目录名自动起"。规则与 guard 未改。
|
|
90
|
+
|
|
91
|
+
v0.5.7 变更(2026-11-12):微调选项小字——A 的说明改为"随会话删除后 N 天清理"(N 取 `orphanCleanupDays`,默认 7,不再写死"随会话删除清理");B 的说明删掉"目录名自动起"字样,只留"长期保存到会话工作区根目录下"(自动起名行为本身不变)。规则与 guard 未改。
|
package/index.js
CHANGED
|
@@ -823,9 +823,9 @@ export function apply(ctx, config) {
|
|
|
823
823
|
`Before writing a long-term file **outside** \`${rootDirName}/\`, you MUST ask the user with \`ask_user_question\` (multiple choice; the free-text answer box lets the user type any other location), for example:`,
|
|
824
824
|
'- A. 不长期保存',
|
|
825
825
|
'- B. 工作区根目录保存',
|
|
826
|
-
`Keep the option labels short exactly like the two above; put the explanation in each option's \`description\` instead (A: 放 ${rootDirName}
|
|
826
|
+
`Keep the option labels short exactly like the two above; put the explanation in each option's \`description\` instead (A: 放 ${rootDirName}/<会话标题>/,临时目录,随会话删除后 ${orphanCleanupDays} 天清理;B: 长期保存到会话工作区根目录下). Never stuff the path details into the label.`,
|
|
827
827
|
'Do not write anything until the user answers.',
|
|
828
|
-
'Picking B: keep it under the workspace root,
|
|
828
|
+
'Picking B: keep it under the workspace root; pick a clear folder name yourself, call `longterm_approve` on it, then write — no need to ask the user to confirm the folder name (same as how DSH normally names things).',
|
|
829
829
|
'Any answer other than A/B (e.g. a path the user typed in the free-text box) is a designated location: if it is missing or ambiguous, ask the user to confirm it before calling `longterm_approve` — never guess.',
|
|
830
830
|
'After the user picks a long-term location (or when the task itself already named that location), call `longterm_approve` with that directory, then write there.',
|
|
831
831
|
`If the user declines, says temporary, or the content is scratch: call \`task_tmpdir\` and write under \`${rootDirName}/<会话标题>/\`. Never invent a workspace-root folder instead.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leiyi-works/dsh-session-tmpdir",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Per-session task temp folder: _tmp/<session title>/ inside the session working directory, auto-created and auto-renamed when the session title changes; folders are deleted 7 days after their session is deleted, with a manual cleanup tool. Also guards the workspace root: scratch files must live under _tmp/, and any long-term artifact outside _tmp/ requires the user's approval (longterm_approve) before write/edit or shell commands may create it — otherwise the call is denied and the model is told to ask the user first, then fall back to _tmp.",
|
|
6
6
|
"exports": {
|