@deepseek-ai/dsh-experimental-auto-review 0.1.6-alpha.2 → 0.1.7-alpha.2

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 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/experimental/auto-review/README.md
5
- README.md: db4d1d3c5a8ace23f41b3d522824b3163156fc7a
6
- README.zh.md: c4fd7e59b25f22adb4b1947fc0b27ff844c3ebf2
5
+ README.md: 73ee9e5aaff00f1160f647218b5714b63c23684b
6
+ README.zh.md: 40fe6f48cae4854c5cfd5ea8f3ae4276dd540e82
package/README.md CHANGED
@@ -57,7 +57,7 @@ A denied call uses the ordinary tool card. The collapsed row identifies Auto rev
57
57
 
58
58
  [`cordis.patch.yml`](cordis.patch.yml) inserts the package itself as the `auto-review` row. [`src/index.ts`](src/index.ts) requires the LLM, permission, Session, and tools services, then installs the preset contribution and prepended pre-execute listener in one effect. The [permission owner](../../interaction/permission-presets/README.md) supplies the current identity and process catalog; Auto shares Full access's existing sandbox and approval values without changing tool definitions.
59
59
 
60
- The reviewer reconstructs five sections from the current Session surface and pending execution: fixed policy, cwd-only environment, sourced project constraints, filtered sourced history, and the complete pending action. Native schema comes from the latest request header. A PTC binding freezes its schema and carries it through the scheduler into transient execution metadata; start and settle events never serialize description or parameters. Main-agent `system/message` nodes, assistant text and reasoning, and tool results are excluded. [The decision record](../../../.agents/notes/implemented/feature/2026-08-28-auto-review.md) owns authority, lifecycle, and child-inheritance rationale.
60
+ The reviewer reconstructs five sections from the current Session surface and pending execution: fixed policy, cwd-only environment, sourced project constraints, filtered sourced history, and the complete pending action. Native schema comes from the latest request header. A PTC binding freezes its schema and carries it through the scheduler into transient execution metadata; start and settle events never serialize description or parameters. Main-agent `system/message` nodes, assistant text and reasoning, and tool results are excluded. The outer review input is a frozen `RequestUserInput` without durable identity or source; retained history keeps its original source attribution in the review text. [The decision record](../../../.agents/notes/implemented/feature/2026-08-28-auto-review.md) owns authority, lifecycle, and child-inheritance rationale.
61
61
 
62
62
  Unloading closes selection and review admission, migrates live Auto Sessions to Full access through the existing preset writer, then aborts and drains reviews before withdrawing the listener and contribution. Knobs and persistent terminals survive that migration. A persisted Auto Session cannot publish without the complete integration; reopening it after installation is an explicit user action. Reinstalling the layer restores the option but does not switch live Sessions back to Auto.
63
63
 
package/README.zh.md CHANGED
@@ -57,7 +57,7 @@ Auto 在每个受支持调用的 body 执行前审查一次,包括每个已开
57
57
 
58
58
  [`cordis.patch.yml`](cordis.patch.yml)把本包自身插入为 `auto-review` 行。[`src/index.ts`](src/index.ts)要求 LLM、permission、Session 与 tools 服务,然后在同一个 effect 中安装 preset contribution 和置前的 pre-execute listener。[权限 owner](../../interaction/permission-presets/README.zh.md)提供当前身份和进程目录;Auto 共用 Full access 既有沙箱与审批值,不改变工具定义。
59
59
 
60
- Reviewer 从当前 Session surface 与待执行调用重建五个分区:固定策略、仅 cwd 的环境、带来源的项目约束、过滤后带来源的历史,以及完整待审动作。原生 schema 来自最新 request header。PTC binding 冻结其 schema,经由调度器传入临时执行元数据;开始与结算事件都不序列化描述或参数 schema。主 agent 的 `system/message` 节点、assistant 正文与 reasoning、tool results 全部排除。[决策记录](../../../.agents/notes/implemented/feature/2026-08-28-auto-review.zh.md)拥有权威、生命周期与 child 继承的理由。
60
+ Reviewer 从当前 Session surface 与待执行调用重建五个分区:固定策略、仅 cwd 的环境、带来源的项目约束、过滤后带来源的历史,以及完整待审动作。原生 schema 来自最新 request header。PTC binding 冻结其 schema,经由调度器传入临时执行元数据;开始与结算事件都不序列化描述或参数 schema。主 agent 的 `system/message` 节点、assistant 正文与 reasoning、tool results 全部排除。外层评审输入是冻结的 `RequestUserInput`,不含持久身份或来源;保留历史在评审文本中仍携带原始来源。[决策记录](../../../.agents/notes/implemented/feature/2026-08-28-auto-review.zh.md)拥有权威、生命周期与 child 继承的理由。
61
61
 
62
62
  卸载时先关闭选择与 review admission,经由既有 preset writer 将存活 Auto Session 迁移到 Full access,再中止并等待在途 review 结清,最后撤回 listener 与 contribution。旋钮与持久终端在迁移中保持不变。持久 Auto Session 缺少完整 integration 时不能发布;安装后重新打开需要用户显式操作。重装只恢复选项,不把存活 Session 切回 Auto。
63
63
 
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BlockAssembler, createUserMessage } from "@deepseek-ai/dsh-llm";
1
+ import { BlockAssembler } from "@deepseek-ai/dsh-llm";
2
2
  import { deepFreeze } from "@deepseek-ai/dsh-util-values";
3
3
  import { AUTO_PRESET } from "@deepseek-ai/dsh-permission-presets";
4
4
  import { RUN_CODE_NAME } from "@deepseek-ai/dsh-tools";
@@ -93,7 +93,7 @@ function isProjectInstruction(source) {
93
93
  }
94
94
  /** Whether this source is a compaction checkpoint. */
95
95
  function isCheckpoint(source) {
96
- return source.kind === "plugin" && source.plugin === "compact";
96
+ return source.kind === "compact-checkpoint";
97
97
  }
98
98
  /** Whether this message was durably attributed to the child's direct parent. */
99
99
  function isDirectParentInstruction(source, parentSession) {
@@ -122,7 +122,7 @@ function textRole(source, seq, initialPromptSeq, parentSession) {
122
122
  }
123
123
  /** Partition one visible user-role message into role-labelled retained blocks. */
124
124
  function filteredUserEntries(seq, source, content, initialPromptSeq, parentSession) {
125
- return content.filter((block) => block.type !== "tool-result").map((block) => ({
125
+ return content.map((block) => ({
126
126
  kind: "user-message",
127
127
  role: block.type === "text" ? textRole(source, seq, initialPromptSeq, parentSession) : "fact",
128
128
  source,
@@ -252,7 +252,7 @@ function snapshotAutoReview(agent, exec) {
252
252
  if (event.type === "user/message") {
253
253
  if (event.data.source.kind === "tool") continue;
254
254
  if (isProjectInstruction(event.data.source)) {
255
- const content = event.data.content.filter((block) => block.type !== "tool-result");
255
+ const content = event.data.content;
256
256
  if (content.length > 0) projectInstructions.push({
257
257
  kind: "user-message",
258
258
  role: "constraint",
@@ -395,16 +395,13 @@ async function classifyRisk(ctx, agent, exec, signal) {
395
395
  provider: snapshot.provider,
396
396
  model: snapshot.model,
397
397
  system: REVIEW_POLICY,
398
- messages: [createUserMessage({
398
+ messages: [{
399
+ role: "user",
399
400
  content: [{
400
401
  type: "text",
401
402
  text: reviewUserText(snapshot)
402
- }],
403
- source: {
404
- kind: "plugin",
405
- plugin: "dsh-experimental-auto-review"
406
- }
407
- })],
403
+ }]
404
+ }],
408
405
  temperature: 0,
409
406
  signal
410
407
  });
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Auto Authorization Review",
4
+ "description": "Add an Auto review permission mode that uses the model to assess authorization before each tool call."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "自动授权审查",
4
+ "description": "提供自动审查权限模式,由模型在每次工具调用前判断是否授权。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-experimental-auto-review",
3
3
  "description": "Per-tool LLM authorization review for the DeepSeek Harness Auto permission preset",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
@@ -15,57 +15,59 @@
15
15
  "types": "./lib/types/index.d.ts",
16
16
  "default": "./lib/index.js"
17
17
  },
18
+ "./locale/*.json": "./locale/*.json",
18
19
  "./src/*": "./src/*",
19
20
  "./package.json": "./package.json",
20
21
  "./cordis.patch.yml": "./cordis.patch.yml"
21
22
  },
22
23
  "files": [
24
+ "locale/*.json",
23
25
  "lib/index.js",
24
26
  "cordis.patch.yml",
25
27
  "lib/types/**/*.d.ts"
26
28
  ],
27
29
  "license": "MIT",
28
30
  "peerDependencies": {
29
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
30
- "@deepseek-ai/dsh-agent-instructions": "^0.1.6-alpha.2",
31
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
32
- "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.2",
33
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
34
- "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
35
- "@deepseek-ai/cordis": "^4.0.2"
31
+ "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
32
+ "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
33
+ "@deepseek-ai/dsh-agent-instructions": "0.1.7-alpha.2",
34
+ "@deepseek-ai/dsh-permission-presets": "0.1.7-alpha.2",
35
+ "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
36
+ "@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
37
+ "@deepseek-ai/cordis": "~4.0.4"
36
38
  },
37
39
  "dependencies": {
38
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2"
40
+ "@deepseek-ai/dsh-util-values": "0.1.7-alpha.2"
39
41
  },
40
42
  "devDependencies": {
41
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
42
- "@deepseek-ai/dsh-agent-instructions": "^0.1.6-alpha.2",
43
- "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.2",
44
- "@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
45
- "@deepseek-ai/dsh-bash-sandbox": "^0.1.6-alpha.2",
46
- "@deepseek-ai/dsh-compaction": "^0.1.6-alpha.2",
47
- "@deepseek-ai/dsh-fs-local": "^0.1.6-alpha.2",
48
- "@deepseek-ai/dsh-fs-observation-policy": "^0.1.6-alpha.2",
49
- "@deepseek-ai/dsh-fs-sandbox": "^0.1.6-alpha.2",
50
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
51
- "@deepseek-ai/dsh-llm-deepseek": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.2",
53
- "@deepseek-ai/dsh-ptc-runtime-node": "^0.1.6-alpha.2",
54
- "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
56
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2",
57
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
58
- "@deepseek-ai/dsh-shell": "^0.1.6-alpha.2",
59
- "@deepseek-ai/dsh-shell-env": "^0.1.6-alpha.2",
60
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
61
- "@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.2",
62
- "@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2",
63
- "@deepseek-ai/dsh-tool-bash": "^0.1.6-alpha.2",
64
- "@deepseek-ai/dsh-tool-fs": "^0.1.6-alpha.2",
65
- "@deepseek-ai/dsh-tool-subagent": "^0.1.6-alpha.2",
66
- "@deepseek-ai/dsh-user-approval": "^0.1.6-alpha.2",
67
- "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
68
- "@deepseek-ai/cordis": "^4.0.2"
43
+ "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
44
+ "@deepseek-ai/dsh-agent-instructions": "0.1.7-alpha.2",
45
+ "@deepseek-ai/dsh-agent-loop": "0.1.7-alpha.2",
46
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-alpha.2",
47
+ "@deepseek-ai/dsh-bash-sandbox": "0.1.7-alpha.2",
48
+ "@deepseek-ai/dsh-compaction": "0.1.7-alpha.2",
49
+ "@deepseek-ai/dsh-fs-local": "0.1.7-alpha.2",
50
+ "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
51
+ "@deepseek-ai/dsh-llm-deepseek": "0.1.7-alpha.2",
52
+ "@deepseek-ai/dsh-permission-presets": "0.1.7-alpha.2",
53
+ "@deepseek-ai/dsh-ptc-runtime-node": "0.1.7-alpha.2",
54
+ "@deepseek-ai/dsh-sandbox": "0.1.7-alpha.2",
55
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.7-alpha.2",
56
+ "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
57
+ "@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
58
+ "@deepseek-ai/dsh-shell": "0.1.7-alpha.2",
59
+ "@deepseek-ai/dsh-shell-env": "0.1.7-alpha.2",
60
+ "@deepseek-ai/dsh-subagent": "0.1.7-alpha.2",
61
+ "@deepseek-ai/dsh-subprocess-local": "0.1.7-alpha.2",
62
+ "@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.2",
63
+ "@deepseek-ai/dsh-tool-bash": "0.1.7-alpha.2",
64
+ "@deepseek-ai/dsh-tool-fs": "0.1.7-alpha.2",
65
+ "@deepseek-ai/dsh-tool-subagent": "0.1.7-alpha.2",
66
+ "@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
67
+ "@deepseek-ai/dsh-user-approval": "0.1.7-alpha.2",
68
+ "@deepseek-ai/cordis": "~4.0.4",
69
+ "@deepseek-ai/dsh-fs-sandbox": "0.1.7-alpha.2",
70
+ "@deepseek-ai/dsh-fs-observation-policy": "0.1.7-alpha.2"
69
71
  },
70
72
  "publishConfig": {
71
73
  "access": "public"