@leiyi-works/dsh-session-tmpdir 0.5.1 → 0.5.3
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 +5 -3
- package/package.json +34 -34
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.3
|
|
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
|
|
49
|
+
2. 模型调用 `ask_user_question` 给用户选择题(A 临时 `_tmp` / B 工作区根目录 / C 指定位置);
|
|
50
50
|
3. 用户选长期 + 给路径 → 模型调 `longterm_approve({ path, reason, basis })` 登记;
|
|
51
51
|
4. 之后 `write`/`edit`/`pwsh` 才能写该目录;用户否定 → 模型改用 `task_tmpdir` 写 `_tmp`。
|
|
52
52
|
|
|
@@ -77,3 +77,7 @@ node test/guard-v2.mjs # 22 条纯函数用例
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
v0.5 变更(2026-11-07):新增长期落点审批(`longterm_approve` + guard v2),覆盖 pwsh/bash 命令;修复 v1 只拦"临时命名文件"导致根目录被会话自建文件夹的问题。
|
|
80
|
+
|
|
81
|
+
v0.5.2 变更(2026-11-12):长期落点选择题的选项顺序调整——A 改为"不长期保存,放 `_tmp/<会话标题>/`(临时)",C 改为"长期保存到本次任务指定的目录";B(新建归档目录)不变。落盘规则本身无变化。
|
|
82
|
+
|
|
83
|
+
v0.5.3 变更(2026-11-12):B/C 选项文案按实际使用重写,消除语义重叠——B 改为"工作区根目录保存"(长期保存到会话工作区根目录下,一般新建一个目录,如 `归档/<主题>/`);C 改为"存到指定位置(写明路径)",并明确选 C 但未给路径时模型必须先向用户确认,不得自行猜路径。规则与 guard 未改。
|
package/index.js
CHANGED
|
@@ -821,10 +821,12 @@ export function apply(ctx, config) {
|
|
|
821
821
|
rootDirName +
|
|
822
822
|
'/` and must NOT trigger a question.',
|
|
823
823
|
`Before writing a long-term file **outside** \`${rootDirName}/\`, you MUST ask the user with \`ask_user_question\` (multiple choice), for example:`,
|
|
824
|
-
|
|
825
|
-
'- B.
|
|
826
|
-
|
|
824
|
+
`- A. 不长期保存,放 ${rootDirName}/<会话标题>/(临时目录,随会话删除清理)`,
|
|
825
|
+
'- B. 工作区根目录保存(长期保存到会话工作区根目录下,一般新建一个目录,例如 归档/<主题>/)',
|
|
826
|
+
'- C. 存到指定位置(写明路径;用户选了这项但还没给出具体路径时,先问清楚再写,不要自行猜)',
|
|
827
827
|
'Do not write anything until the user answers.',
|
|
828
|
+
'Picking B: keep it under the workspace root, propose/confirm the folder name when the user has not named one.',
|
|
829
|
+
'Picking C: the destination is given by the user or the task; if the exact path is missing or ambiguous, ask the user to confirm it before calling `longterm_approve` — never guess.',
|
|
828
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.',
|
|
829
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.`,
|
|
830
832
|
'',
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@leiyi-works/dsh-session-tmpdir",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"type": "module",
|
|
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
|
-
"exports": {
|
|
7
|
-
".": "./index.js",
|
|
8
|
-
"./locale/*.json": "./locale/*.json",
|
|
9
|
-
"./icon": "./icon.svg"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"index.js",
|
|
13
|
-
"cordis.patch.yml",
|
|
14
|
-
"README.md",
|
|
15
|
-
"locale/*.json",
|
|
16
|
-
"icon.svg"
|
|
17
|
-
],
|
|
18
|
-
"dsh": {
|
|
19
|
-
"bundle": {
|
|
20
|
-
"patch": "./cordis.patch.yml"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"author": "leiyi-works",
|
|
25
|
-
"homepage": "https://gitee.com/leiyi-works",
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"keywords": [
|
|
30
|
-
"deepseek-harness",
|
|
31
|
-
"dsh",
|
|
32
|
-
"dsh-harmonyos",
|
|
33
|
-
"dsh-plugin"
|
|
34
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "@leiyi-works/dsh-session-tmpdir",
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"type": "module",
|
|
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
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./locale/*.json": "./locale/*.json",
|
|
9
|
+
"./icon": "./icon.svg"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"cordis.patch.yml",
|
|
14
|
+
"README.md",
|
|
15
|
+
"locale/*.json",
|
|
16
|
+
"icon.svg"
|
|
17
|
+
],
|
|
18
|
+
"dsh": {
|
|
19
|
+
"bundle": {
|
|
20
|
+
"patch": "./cordis.patch.yml"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "leiyi-works",
|
|
25
|
+
"homepage": "https://gitee.com/leiyi-works",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"deepseek-harness",
|
|
31
|
+
"dsh",
|
|
32
|
+
"dsh-harmonyos",
|
|
33
|
+
"dsh-plugin"
|
|
34
|
+
]
|
|
35
35
|
}
|