dsh-auto-review 0.5.2 → 0.5.4
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/CHANGELOG.md +17 -0
- package/README.es.md +3 -3
- package/README.hi.md +3 -3
- package/README.md +4 -3
- package/README.pt.md +3 -3
- package/README.zh.md +3 -3
- package/bin/dsh-eval.mjs +0 -0
- package/lib/client.js +1 -1
- package/lib/client.js.map +1 -1
- package/lib/index.js +29 -7
- package/lib/types/audit.d.ts +3 -2
- package/lib/types/audit.d.ts.map +1 -1
- package/lib/types/audit.js +7 -4
- package/lib/types/audit.js.map +1 -1
- package/lib/types/client/index.js +1 -1
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/projection-types.d.ts +24 -0
- package/lib/types/projection-types.d.ts.map +1 -1
- package/lib/types/projection.d.ts +49 -18
- package/lib/types/projection.d.ts.map +1 -1
- package/lib/types/projection.js +21 -2
- package/lib/types/projection.js.map +1 -1
- package/package.json +48 -50
- package/src/audit.ts +7 -4
- package/src/client/index.ts +2 -2
- package/src/projection-types.ts +25 -0
- package/src/projection.ts +33 -21
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `dsh-auto-review` are documented here. The repo is pre-release; versions follow the DeepSeek Harness `0.1.0-rc.x` target runtime and bump on every behavior change.
|
|
4
4
|
|
|
5
|
+
## [0.5.4] — 2026-08-22
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Runtime `dependencies` and `devDependencies` pin the exact `0.1.1-rc.2` line and `dshWorkshop.dshVersions` lists `0.1.1-rc.2`; the peer specs stay on the `>=0.1.0-rc.8 <0.2.0` range, which already covers `0.1.1-rc.2`.
|
|
10
|
+
- The session-projection unit migrated to the rc2 `ProjectionDefinition` contract (`stateSchema` + `wire: { viewSchema, view }` + the required `stateVersion`), and the `autoReview` key now declares both the client `SessionProjectionMap` and the host `SessionProjectionStateMap` entries.
|
|
11
|
+
- The browser panel calls the rc2 `remote.commands.execute` shape (empty image list for the text-only `/auto-review` command).
|
|
12
|
+
- `scripts/check-host-versions.mjs` now recognizes the `0.1.1-rc.N` line family; `pnpm-workspace.yaml` excludes the whole `@deepseek-ai/*` scope from `minimumReleaseAge`; the compat workflow pins the rc2 CLI and `dsh-base`/`dsh-headless` bundles.
|
|
13
|
+
|
|
14
|
+
## [0.5.3] — 2026-08-21
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Peers and dev/test pins bumped `0.1.0-rc.7` → `0.1.0-rc.8` (npm `next` moved; the batch rc8 compatibility release). Peer specs now use the `>=0.1.0-rc.8 <0.2.0` range form; runtime `dependencies` and `devDependencies` pin the exact `0.1.0-rc.8` line, and `dshWorkshop.dshVersions` lists `0.1.0-rc.8`.
|
|
19
|
+
- `isUnmarkedHostVersion` bound extended to `0.1.0-rc.8`: the rc.8 release still drops the `ignorable` envelope marker (the stamping fix exists on harness master only), so rc.8 hosts are detected BEFORE the first append and session-log audit degrades to the in-memory mirror instead of polluting the log with an unmarked `autoReview/*` event. Docs (five-language READMEs, AGENTS.md) and the README compatibility table updated to the rc.8 line.
|
|
20
|
+
- `scripts/check-host-versions.mjs` now accepts both exact (`0.1.0-rc.N`) and range (`>=0.1.0-rc.N <0.2.0`) peer pins and fails when they no longer cover the newest rc line published by `@deepseek-ai/dsh` (on `latest` or `next`).
|
|
21
|
+
|
|
5
22
|
## [0.5.2] — 2026-08-19
|
|
6
23
|
|
|
7
24
|
### Fixed
|
package/README.es.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| Superficie | Estado |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` (dependencias fijadas a `0.1.1-rc.2`; peers `>=0.1.0-rc.8 <0.2.0`) |
|
|
28
28
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
29
|
| Plataformas | Todas (answerer de host; panel web opcional mediante la capacidad de proyección de sesión) |
|
|
30
30
|
| Modelo | Cualquiera (el revisor hereda la ruta del agente de sesión; `reviewerModel` la reemplaza) |
|
|
@@ -216,7 +216,7 @@ Puerta de CI: el proceso sale con 0 solo cuando todos los casos de todas las sui
|
|
|
216
216
|
|
|
217
217
|
- **Permisos**: el manifiesto del workshop declara `session:append`, `approval:answer`, `subagent:spawn`, `command:register` y `tools:observe`.
|
|
218
218
|
- **Datos**: nada se guarda en disco; el búfer circular de informes está en memoria y acotado. Sin peticiones de red propias.
|
|
219
|
-
- **Registro de sesión**: los eventos `autoReview/*` llevan identidad del revisor, veredicto, razón, riesgo y duración — añadidos con el marcador de sobre `ignorable: true` para que cualquier compilación cargue el registro. Los hosts cuyo `Session.append` es anterior al marcador (todas las líneas rc publicadas hasta `0.1.
|
|
219
|
+
- **Registro de sesión**: los eventos `autoReview/*` llevan identidad del revisor, veredicto, razón, riesgo y duración — añadidos con el marcador de sobre `ignorable: true` para que cualquier compilación cargue el registro. Los hosts cuyo `Session.append` es anterior al marcador (todas las líneas rc publicadas hasta `0.1.1-rc.2` — ninguna versión lo estampa aún) se detectan antes del primer append (precomprobación de la versión del peer y luego sondeo del sobre devuelto) y la auditoría se degrada a un espejo en memoria con comentarios sin marcador, de modo que las sesiones siguen siendo cargables en todas partes.
|
|
220
220
|
|
|
221
221
|
## Límites de seguridad
|
|
222
222
|
|
|
@@ -236,7 +236,7 @@ Puerta de CI: el proceso sale con 0 solo cuando todos los casos de todas las sui
|
|
|
236
236
|
- Las reglas de riesgo emparejan el `reason` de la solicitud, el `toolName` o los `arguments` redactados de la llamada según su `field`; otras condiciones van en `toolsPolicy.overrides`.
|
|
237
237
|
- La anulación `/auto-review approve` autoriza la siguiente revisión de la misma herramienta, no la llamada histórica exacta; una acción diferente sobre la misma herramienta la consume.
|
|
238
238
|
- Los eventos de veredicto son solo-registro; el panel web de revisión lee la proyección `autoReview` plegada (el flujo crudo de eventos nunca llega a los plugins del navegador).
|
|
239
|
-
- `autoReview/state` y `autoReview/verdict` se añaden con el marcador de sobre `ignorable: true` en hosts que lo respetan, de modo que cualquier compilación del harness carga el registro — los lectores que no conocen los tipos fuera del repo simplemente omiten esos registros. En hosts rc publicados (rc.1–rc.
|
|
239
|
+
- `autoReview/state` y `autoReview/verdict` se añaden con el marcador de sobre `ignorable: true` en hosts que lo respetan, de modo que cualquier compilación del harness carga el registro — los lectores que no conocen los tipos fuera del repo simplemente omiten esos registros. En hosts rc publicados (rc.1–rc.8) el runtime detecta el marcador descartado y nunca escribe estos eventos (el espejo en memoria mantiene el comando, los presupuestos, el disyuntor y `approve` durante la sesión); las sesiones ya contaminadas por versiones anteriores a 0.5.1 pueden repararse con `scripts/repair-session-logs.mjs` de `dsh-permission-rules` (su conjunto de tipos por defecto cubre los cinco eventos `autoReview/*`).
|
|
240
240
|
- El canal git necesita la única clave `allowBuilds` que el CLI de `dsh` imprime para el propio `dsh-auto-review`. El repo incluye su propio `pnpm-workspace.yaml` con `allowBuilds: { esbuild: true }`; `typescript` + `tsdown` son `dependencies` regulares.
|
|
241
241
|
- El compañero invariant opcional necesita el servicio `invariants` (composiciones agent-spine como headless/ACP); el perfil web plano no lo proporciona, por lo que la fila se incluye comentada en el parche del bundle.
|
|
242
242
|
|
package/README.hi.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| सतह | स्थिति |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` (dependencies `0.1.1-rc.2` पर पिन की गईं; peers `>=0.1.0-rc.8 <0.2.0`) |
|
|
28
28
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
29
|
| प्लेटफ़ॉर्म | सभी (होस्ट answerer; सत्र-प्रोजेक्शन क्षमता के ज़रिए वैकल्पिक वेब समीक्षा पैनल) |
|
|
30
30
|
| मॉडल | कोई भी (समीक्षक सत्र एजेंट का मार्ग विरासत में लेता है; `reviewerModel` उसे बदल देता है) |
|
|
@@ -216,7 +216,7 @@ CI द्वार: प्रक्रिया केवल तभी 0 से
|
|
|
216
216
|
|
|
217
217
|
- **अनुमतियाँ**: workshop मेनिफ़ेस्ट `session:append`, `approval:answer`, `subagent:spawn`, `command:register` और `tools:observe` घोषित करता है।
|
|
218
218
|
- **डेटा**: डिस्क पर कुछ नहीं लिखा जाता; रिपोर्ट रिंग बफ़र मेमोरी में और सीमित है। अपनी ओर से कोई नेटवर्क अनुरोध नहीं।
|
|
219
|
-
- **सत्र लॉग**: `autoReview/*` घटनाएँ समीक्षक पहचान, निर्णय, कारण, जोखिम और अवधि रखती हैं — लिफ़ाफ़े के `ignorable: true` मार्कर के साथ जोड़ी जाती हैं ताकि कोई भी बिल्ड लॉग लोड कर सके। जिन होस्ट का `Session.append` मार्कर से पुराना है (`0.1.
|
|
219
|
+
- **सत्र लॉग**: `autoReview/*` घटनाएँ समीक्षक पहचान, निर्णय, कारण, जोखिम और अवधि रखती हैं — लिफ़ाफ़े के `ignorable: true` मार्कर के साथ जोड़ी जाती हैं ताकि कोई भी बिल्ड लॉग लोड कर सके। जिन होस्ट का `Session.append` मार्कर से पुराना है (`0.1.1-rc.2` तक की हर रिलीज़ rc लाइन — कोई रिलीज़ अभी मार्कर नहीं छापती) उन्हें पहले append से पहले ही पहचान लिया जाता है (peer संस्करण पूर्व-जाँच, फिर लौटे लिफ़ाफ़े की जाँच) और ऑडिट बिना मार्कर वाले फीडबैक के साथ इन-मेमोरी मिरर में डिग्रेड हो जाता है — सत्र हर जगह लोड होने योग्य रहते हैं।
|
|
220
220
|
|
|
221
221
|
## सुरक्षा सीमाएँ
|
|
222
222
|
|
|
@@ -236,7 +236,7 @@ CI द्वार: प्रक्रिया केवल तभी 0 से
|
|
|
236
236
|
- जोखिम नियम अपने `field` के अनुसार अनुरोध के `reason`, `toolName` या संशोधित कॉल `arguments` से मिलते हैं; बाकी शर्तें `toolsPolicy.overrides` में रखें।
|
|
237
237
|
- `/auto-review approve` ओवरराइड उसी टूल की अगली समीक्षा को अधिकृत करता है, उस सटीक ऐतिहासिक कॉल को नहीं; उसी टूल पर एक भिन्न क्रिया उसे उपभोग कर लेती है।
|
|
238
238
|
- निर्णय घटनाएँ केवल-लॉग हैं; वेब समीक्षा पैनल मुड़ा हुआ `autoReview` प्रोजेक्शन पढ़ता है (कच्ची घटना धारा ब्राउज़र प्लगइन तक कभी नहीं पहुँचती)।
|
|
239
|
-
- मार्कर का सम्मान करने वाले होस्ट पर `autoReview/state` और `autoReview/verdict` लिफ़ाफ़े के `ignorable: true` मार्कर के साथ जोड़े जाते हैं, ताकि कोई भी harness बिल्ड लॉग लोड करे — जो पाठक रेपो-बाहरी प्रकारों को नहीं जानते वे उन रिकॉर्ड को बस छोड़ देते हैं। रिलीज़ किए गए rc होस्ट (rc.1–rc.
|
|
239
|
+
- मार्कर का सम्मान करने वाले होस्ट पर `autoReview/state` और `autoReview/verdict` लिफ़ाफ़े के `ignorable: true` मार्कर के साथ जोड़े जाते हैं, ताकि कोई भी harness बिल्ड लॉग लोड करे — जो पाठक रेपो-बाहरी प्रकारों को नहीं जानते वे उन रिकॉर्ड को बस छोड़ देते हैं। रिलीज़ किए गए rc होस्ट (rc.1–rc.8) पर runtime छूटे मार्कर का पता लगाकर ये घटनाएँ कभी नहीं लिखता (इन-मेमोरी मिरर कमांड, बजट, ब्रेकर और `approve` को सत्र भर बनाए रखता है); 0.5.1 से पहले के संस्करणों से दूषित सत्र `dsh-permission-rules` के `scripts/repair-session-logs.mjs` से मरम्मत किए जा सकते हैं (इसका डिफ़ॉल्ट सेट सभी पाँच `autoReview/*` घटना प्रकारों को कवर करता है)।
|
|
240
240
|
- git चैनल को वह एकल `allowBuilds` कुंजी चाहिए जो `dsh` CLI स्वयं `dsh-auto-review` के लिए छापता है। रेपो अपना `pnpm-workspace.yaml` `allowBuilds: { esbuild: true }` के साथ शिप करता है; `typescript` + `tsdown` नियमित `dependencies` हैं।
|
|
241
241
|
- वैकल्पिक invariant साथी को `invariants` सेवा चाहिए (agent-spine रचनाएँ जैसे headless/ACP); सादा web प्रोफ़ाइल वह नहीं देता, इसलिए पंक्ति बंडल पैच में टिप्पणी-बंद शिप होती है।
|
|
242
242
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🤖 dsh-auto-review
|
|
4
|
+
[](https://gitee.com/perrylink/dsh-auto-review)
|
|
4
5
|
|
|
5
6
|
**Second-model AI approval for DeepSeek Harness — a read-only reviewer subagent decides allow/deny on the approval chain, fail-closed by default.**
|
|
6
7
|
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
|
|
25
26
|
| Surface | Status |
|
|
26
27
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` (dependencies pinned to `0.1.1-rc.2`; peers `>=0.1.0-rc.8 <0.2.0`) |
|
|
28
29
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
30
|
| Platforms | All (host answerer; optional Web review panel via the session-projection capability) |
|
|
30
31
|
| Model | Any (the reviewer inherits the session agent's route; `reviewerModel` overrides) |
|
|
@@ -216,7 +217,7 @@ CI gate: the process exits 0 only when every case of every suite passed — drop
|
|
|
216
217
|
|
|
217
218
|
- **Permissions**: the workshop manifest declares `session:append`, `approval:answer`, `subagent:spawn`, `command:register`, and `tools:observe`.
|
|
218
219
|
- **Data**: nothing is stored on disk; the report ring buffer is in-memory and bounded. No network requests of its own.
|
|
219
|
-
- **Session log**: `autoReview/*` events carry reviewer identity, verdict, reason, risk, and duration — appended with the envelope's `ignorable: true` marker so any build loads the log. Hosts whose `Session.append` predates the marker (every released rc line through `0.1.
|
|
220
|
+
- **Session log**: `autoReview/*` events carry reviewer identity, verdict, reason, risk, and duration — appended with the envelope's `ignorable: true` marker so any build loads the log. Hosts whose `Session.append` predates the marker (every released rc line through `0.1.1-rc.2` — no release stamps it yet) are detected before the first append (peer-version pre-check, then a probe of the returned envelope) and audit degrades to an in-memory mirror with marker-free feedback, so sessions stay loadable everywhere.
|
|
220
221
|
|
|
221
222
|
## Security boundaries
|
|
222
223
|
|
|
@@ -236,7 +237,7 @@ CI gate: the process exits 0 only when every case of every suite passed — drop
|
|
|
236
237
|
- Risk rules match the request `reason`, the `toolName`, or the redacted call `arguments` per their `field`; other conditions belong in `toolsPolicy.overrides`.
|
|
237
238
|
- The `/auto-review approve` override authorizes the next same-tool review, not the exact historical call; a different action on the same tool consumes it.
|
|
238
239
|
- The verdict events are log-only; the Web review panel reads the folded `autoReview` projection (the raw event stream never reaches browser plugins).
|
|
239
|
-
- `autoReview/state` and `autoReview/verdict` are appended with the envelope's `ignorable: true` marker on hosts that honor it, so any harness build loads the log — readers that do not know the out-of-repo types simply skip those records. On released rc hosts (rc.1–rc.
|
|
240
|
+
- `autoReview/state` and `autoReview/verdict` are appended with the envelope's `ignorable: true` marker on hosts that honor it, so any harness build loads the log — readers that do not know the out-of-repo types simply skip those records. On released rc hosts (rc.1–rc.8) the runtime detects the dropped marker and never writes these events (the in-memory mirror keeps the command, budgets, breaker, and `approve` working for the session); sessions already polluted by pre-0.5.1 versions can be repaired with `scripts/repair-session-logs.mjs` from `dsh-permission-rules` (its default target set covers all five `autoReview/*` event types).
|
|
240
241
|
- The git channel needs the single `allowBuilds` key the `dsh` CLI prints for `dsh-auto-review` itself. The repo ships its own `pnpm-workspace.yaml` with `allowBuilds: { esbuild: true }`; `typescript` + `tsdown` are regular `dependencies`.
|
|
241
242
|
- The optional invariant companion needs the `invariants` service (agent-spine compositions such as headless/ACP); the plain web profile does not provide it, so the row ships commented out in the bundle patch.
|
|
242
243
|
|
package/README.pt.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| Superfície | Status |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` (dependências fixadas em `0.1.1-rc.2`; peers `>=0.1.0-rc.8 <0.2.0`) |
|
|
28
28
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
29
|
| Plataformas | Todas (answerer de host; painel web opcional via capacidade de projeção de sessão) |
|
|
30
30
|
| Modelo | Qualquer (o revisor herda a rota do agente da sessão; `reviewerModel` sobrescreve) |
|
|
@@ -216,7 +216,7 @@ Portão de CI: o processo sai com 0 somente quando todos os casos de todas as su
|
|
|
216
216
|
|
|
217
217
|
- **Permissões**: o manifesto do workshop declara `session:append`, `approval:answer`, `subagent:spawn`, `command:register` e `tools:observe`.
|
|
218
218
|
- **Dados**: nada é gravado em disco; o buffer circular de relatórios fica em memória e é limitado. Sem requisições de rede próprias.
|
|
219
|
-
- **Log de sessão**: os eventos `autoReview/*` carregam identidade do revisor, veredito, razão, risco e duração — anexados com o marcador de envelope `ignorable: true` para que qualquer build carregue o log. Hosts cujo `Session.append` é anterior ao marcador (todas as linhas rc publicadas até `0.1.
|
|
219
|
+
- **Log de sessão**: os eventos `autoReview/*` carregam identidade do revisor, veredito, razão, risco e duração — anexados com o marcador de envelope `ignorable: true` para que qualquer build carregue o log. Hosts cujo `Session.append` é anterior ao marcador (todas as linhas rc publicadas até `0.1.1-rc.2` — nenhuma versão o estampa ainda) são detectados antes do primeiro append (pré-checagem da versão do peer e, em seguida, sondagem do envelope retornado) e a auditoria degrada para um espelho em memória com feedback sem marcador, mantendo as sessões carregáveis em qualquer lugar.
|
|
220
220
|
|
|
221
221
|
## Limites de segurança
|
|
222
222
|
|
|
@@ -236,7 +236,7 @@ Portão de CI: o processo sai com 0 somente quando todos os casos de todas as su
|
|
|
236
236
|
- Regras de risco emparelham o `reason` da solicitação, o `toolName` ou os `arguments` redigidos da chamada conforme seu `field`; outras condições pertencem a `toolsPolicy.overrides`.
|
|
237
237
|
- A anulação `/auto-review approve` autoriza a próxima revisão da mesma ferramenta, não a chamada histórica exata; uma ação diferente na mesma ferramenta a consome.
|
|
238
238
|
- Os eventos de veredito são somente-log; o painel web de revisão lê a projeção `autoReview` dobrada (o fluxo bruto de eventos nunca chega aos plugins do navegador).
|
|
239
|
-
- `autoReview/state` e `autoReview/verdict` são anexados com o marcador de envelope `ignorable: true` em hosts que o respeitam, para que qualquer build do harness carregue o log — leitores que não conhecem os tipos fora do repo simplesmente pulam esses registros. Em hosts rc publicados (rc.1–rc.
|
|
239
|
+
- `autoReview/state` e `autoReview/verdict` são anexados com o marcador de envelope `ignorable: true` em hosts que o respeitam, para que qualquer build do harness carregue o log — leitores que não conhecem os tipos fora do repo simplesmente pulam esses registros. Em hosts rc publicados (rc.1–rc.8) o runtime detecta o marcador descartado e nunca escreve esses eventos (o espelho em memória mantém o comando, os orçamentos, o disjuntor e `approve` durante a sessão); sessões já poluídas por versões anteriores a 0.5.1 podem ser reparadas com `scripts/repair-session-logs.mjs` de `dsh-permission-rules` (seu conjunto padrão cobre os cinco tipos de evento `autoReview/*`).
|
|
240
240
|
- O canal git precisa da única chave `allowBuilds` que o CLI do `dsh` imprime para o próprio `dsh-auto-review`. O repo envia seu próprio `pnpm-workspace.yaml` com `allowBuilds: { esbuild: true }`; `typescript` + `tsdown` são `dependencies` regulares.
|
|
241
241
|
- O companheiro invariant opcional precisa do serviço `invariants` (composições agent-spine como headless/ACP); o perfil web simples não o fornece, então a linha é enviada comentada no patch do bundle.
|
|
242
242
|
|
package/README.zh.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| 方面 | 状态 |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.0-rc.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2`(依赖锁定在 `0.1.1-rc.2`;peer 范围 `>=0.1.0-rc.8 <0.2.0`) |
|
|
28
28
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
29
|
| 平台 | 全部(宿主 answerer;可选 Web 审查面板,依赖会话投影能力) |
|
|
30
30
|
| 模型 | 任意(审查器默认继承会话代理的路由;`reviewerModel` 可覆盖) |
|
|
@@ -216,7 +216,7 @@ CI 门禁:仅当每个套件的每个用例都通过时,进程才以 0 退
|
|
|
216
216
|
|
|
217
217
|
- **权限**:workshop 清单声明 `session:append`、`approval:answer`、`subagent:spawn`、`command:register` 与 `tools:observe`。
|
|
218
218
|
- **数据**:不向磁盘写入任何内容;报告环形缓冲在内存中且有界。自身不发起网络请求。
|
|
219
|
-
- **会话日志**:`autoReview/*` 事件携带审查器身份、裁决、理由、风险与耗时 —— 以信封 `ignorable: true` 标记追加,任何构建都能加载日志。`Session.append` 早于该标记的宿主(迄今发布的所有 rc 版本,至 `0.1.
|
|
219
|
+
- **会话日志**:`autoReview/*` 事件携带审查器身份、裁决、理由、风险与耗时 —— 以信封 `ignorable: true` 标记追加,任何构建都能加载日志。`Session.append` 早于该标记的宿主(迄今发布的所有 rc 版本,至 `0.1.1-rc.2`——任何发布版都还未盖标记)会在首次追加前被探测出来(peer 版本预检 + 返回信封探测),审计降级为内存镜像 + 无标记反馈,会话日志始终保持可加载。
|
|
220
220
|
|
|
221
221
|
## 安全边界
|
|
222
222
|
|
|
@@ -236,7 +236,7 @@ CI 门禁:仅当每个套件的每个用例都通过时,进程才以 0 退
|
|
|
236
236
|
- 风险规则按各自的 `field` 匹配请求的 `reason`、`toolName` 或脱敏后的调用 `arguments`;其他条件应放入 `toolsPolicy.overrides`。
|
|
237
237
|
- `/auto-review approve` 覆盖授权的是下一次对同一工具的审查,而不是那次确切的历史调用;同一工具上的不同操作也会消耗它。
|
|
238
238
|
- 裁决事件是仅日志的;Web 审查面板读取折叠后的 `autoReview` 投影(原始事件流绝不会到达浏览器插件)。
|
|
239
|
-
- `autoReview/state` 与 `autoReview/verdict` 在支持标记的宿主上以信封 `ignorable: true` 追加,任何 harness 构建都能加载日志 —— 不认识这些仓库外类型的读取方直接跳过这些记录。已发布的 rc 宿主(rc.1–rc.
|
|
239
|
+
- `autoReview/state` 与 `autoReview/verdict` 在支持标记的宿主上以信封 `ignorable: true` 追加,任何 harness 构建都能加载日志 —— 不认识这些仓库外类型的读取方直接跳过这些记录。已发布的 rc 宿主(rc.1–rc.8)上运行时会检测到标记被丢弃并完全不写这些事件(内存镜像继续提供命令、预算、熔断器与 `approve`);pre-0.5.1 版本污染的会话可用 `dsh-permission-rules` 的 `scripts/repair-session-logs.mjs` 修复(其默认目标集已覆盖全部五种 `autoReview/*` 事件)。
|
|
240
240
|
- git 渠道需要 `dsh` CLI 为 `dsh-auto-review` 打印的那个 `allowBuilds` 键。仓库自带 `pnpm-workspace.yaml`,声明 `allowBuilds: { esbuild: true }`;`typescript` + `tsdown` 是普通 `dependencies`。
|
|
241
241
|
- 可选的 invariant 配套插件需要 `invariants` 服务(agent-spine 组合,如 headless/ACP);普通 web profile 不提供该服务,所以该行在 bundle 补丁中默认被注释。
|
|
242
242
|
|
package/bin/dsh-eval.mjs
CHANGED
|
File without changes
|
package/lib/client.js
CHANGED
|
@@ -468,7 +468,7 @@ window.__ModuleLoader__.load({
|
|
|
468
468
|
inject: (sessionId) => {
|
|
469
469
|
const remote = ctx.remote;
|
|
470
470
|
const executeCommand = async (line) => {
|
|
471
|
-
const result = await remote.commands.execute(sessionId, line);
|
|
471
|
+
const result = await remote.commands.execute(sessionId, line, []);
|
|
472
472
|
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
|
|
473
473
|
if (result.value === void 0) throw new Error("unknown command: /auto-review");
|
|
474
474
|
const command = result.value.result;
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["useState","useRef"],"sources":["../src/client/present.ts","../src/client/ReviewPanel.tsx","../src/client/locales.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Pure presentation for the review panel: verdict rows and badges as plain\n * strings and tone codes — no I/O, clock, or randomness. The component\n * owns layout and interaction; this module owns the text.\n * @module dsh-auto-review/client/present\n */\n\nimport type { AutoReviewVerdictView } from '../projection-types.ts'\n\n/** Badge tones the component maps to scoped styles. */\nexport type VerdictTone = 'allow' | 'deny' | 'fallback' | 'escalation'\n\n/** One presented verdict row. */\nexport interface PresentedVerdict {\n readonly reviewId: string\n readonly toolName: string\n readonly label: string\n readonly detail: string\n readonly tone: VerdictTone\n}\n\n/** Present one verdict row (the component supplies the localized label texts). */\nexport function presentVerdict(\n verdict: AutoReviewVerdictView,\n labels: {\n readonly allow: string\n readonly deny: string\n readonly fallback: (kind: string) => string\n readonly escalation: string\n },\n): PresentedVerdict {\n if (verdict.fallback !== undefined) {\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label: labels.fallback(verdict.fallback),\n detail: `${verdict.durationMs} ms`,\n tone: 'fallback',\n }\n }\n if (verdict.escalation === 'risk-policy') {\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label: labels.escalation,\n detail: verdict.reason ?? '',\n tone: 'escalation',\n }\n }\n const label = verdict.decision === 'deny' ? labels.deny : labels.allow\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label,\n detail: verdict.reason ?? `${verdict.durationMs} ms`,\n tone: verdict.decision === 'deny' ? 'deny' : 'allow',\n }\n}\n","/**\n * The session-header review panel: a button in the conversation header that\n * opens a popover with this session's auto-review state — the on/off switch,\n * budgets, cumulative statistics (including hard-disable rejections), the\n * circuit trip, recent verdicts, and one-shot approve buttons for recent\n * denials. Data arrives through the `autoReview` session projection;\n * switches and approves execute the `/auto-review` command through the\n * commands Remote.\n * @module dsh-auto-review/client/ReviewPanel\n */\n\nimport { useRef, useState, type ReactNode } from 'react'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { AutoReviewProjection } from '../projection-types.ts'\nimport { presentVerdict } from './present.ts'\nimport { NS } from './locales.ts'\n\n/** Registration-side injected face: the approve action for one recent denial. */\nexport interface ReviewPanelInjected {\n /** Approve the n-th most recent denial (1 = most recent); resolves with the command result text. */\n approve: (n: number) => Promise<string>\n /** Switch the session's auto-review on/off (`/auto-review on|off`); resolves with the command result text. */\n setEnabled: (enabled: boolean) => Promise<string>\n}\n\n/** Full component props assembled by the session-header slot renderer. */\nexport type ReviewPanelProps =\n PropsRuntime<'conversation.session.header.actions'>\n & PropsLocale<typeof NS>\n & InjectFace<ReviewPanelInjected>\n\n/** Compact verdict-row badge label for the panel. */\nfunction verdictBadge(\n value: AutoReviewProjection | undefined,\n t: ReviewPanelProps['t'],\n): ReactNode {\n if (value === undefined) return t('unavailable')\n const fallback = (kind: string): string => t('fallbackLabel').replace('{kind}', kind)\n const labels = {\n allow: t('decisionAllow'),\n deny: t('decisionDeny'),\n fallback,\n escalation: t('escalationLabel'),\n }\n return value.recent.map(verdict => presentVerdict(verdict, labels)).map(row => (\n <div key={row.reviewId} data-dsh-auto-review-verdict>\n <span data-dsh-auto-review-muted>{row.toolName}</span>\n <span data-dsh-auto-review={`tone-${row.tone}`}>{row.label}</span>\n <span data-dsh-auto-review-muted>{row.detail}</span>\n </div>\n ))\n}\n\n/**\n * Render the review panel action.\n * @param props - framework kit (sessionId, useProjection), locale, and the approve face.\n * @returns the header button with its popover.\n */\nexport function ReviewPanel({ useProjection, approve, setEnabled, t }: ReviewPanelProps): ReactNode {\n const value = useProjection('autoReview')\n const [open, setOpen] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n const anchor = useRef<HTMLDivElement | null>(null)\n const toggle = (): void => setOpen(previous => !previous)\n const runApprove = async (n: number): Promise<void> => {\n try {\n const text = await approve(n)\n setNotice(t('approveResult').replace('{text}', text))\n } catch (error: unknown) {\n setNotice(t('approveFailed').replace('{text}', error instanceof Error ? error.message : String(error)))\n }\n }\n const runSwitch = async (enabled: boolean): Promise<void> => {\n try {\n const text = await setEnabled(enabled)\n setNotice(t('switchedResult').replace('{text}', text))\n } catch (error: unknown) {\n setNotice(t('switchFailed').replace('{text}', error instanceof Error ? error.message : String(error)))\n }\n }\n return (\n <div data-dsh-auto-review ref={anchor}>\n <button type=\"button\" data-dsh-auto-review-button onClick={toggle}>\n {t('label')}\n </button>\n {open && (\n <div data-dsh-auto-review-panel>\n <div data-dsh-auto-review-title>{t('title')}</div>\n {value === undefined\n ? <div data-dsh-auto-review-muted>{t('unavailable')}</div>\n : (\n <div>\n <div data-dsh-auto-review-row>\n <span>{t('state')}</span>\n <span>{value.enabled ? t('stateOn') : t('stateOff')}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('enable')} / {t('disable')}</span>\n <span>\n <button\n type=\"button\"\n data-dsh-auto-review-switch\n disabled={value.enabled}\n onClick={() => void runSwitch(true)}\n >\n {t('enable')}\n </button>\n <button\n type=\"button\"\n data-dsh-auto-review-switch\n disabled={!value.enabled}\n onClick={() => void runSwitch(false)}\n >\n {t('disable')}\n </button>\n </span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('verdicts')}</span>\n <span>{value.verdictsUsed}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('failures')}</span>\n <span>{value.failuresUsed}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('allTime')}</span>\n <span>\n {value.allows} {t('allows')} · {value.denies} {t('denies')} · {value.fallbacks} {t('fallbacks')} · {value.neverRejects} {t('neverRejects')} · {t('avg')} {value.avgDurationMs} {t('ms')}\n </span>\n </div>\n {value.circuit !== null && (\n <div data-dsh-auto-review-circuit>\n {t('circuit')} — {t('circuitDetail')\n .replace('{kind}', value.circuit.trip.kind)\n .replace('{count}', String(value.circuit.trip.count))\n .replace('{action}', value.circuit.action)}\n </div>\n )}\n {value.recentDenies.length > 0 && (\n <div data-dsh-auto-review-section>\n <div data-dsh-auto-review-title>{t('denyList')}</div>\n {value.recentDenies.map((deny, index) => (\n <div key={deny.reviewId} data-dsh-auto-review-row>\n <span data-dsh-auto-review-muted>{deny.toolName}</span>\n <button type=\"button\" data-dsh-auto-review-approve onClick={() => void runApprove(index + 1)}>\n {t('approve')} #{index + 1}\n </button>\n </div>\n ))}\n </div>\n )}\n <div data-dsh-auto-review-section>\n <div data-dsh-auto-review-title>{t('recent')}</div>\n {value.recent.length === 0 ? <div data-dsh-auto-review-muted>{t('empty')}</div> : verdictBadge(value, t)}\n </div>\n </div>\n )}\n {notice !== null && <div data-dsh-auto-review-muted>{notice}</div>}\n </div>\n )}\n </div>\n )\n}\n","/**\n * Copy dictionaries for the auto-review session-header panel (en/zh — the\n * harness locale registry accepts these two UI language codes today).\n * @module dsh-auto-review/client/locales\n */\n\n/** Simplified Chinese dictionary and key source of truth. */\nexport const zh = {\n label: 'AI 审查',\n title: 'AI 自动审查',\n state: '状态',\n stateOn: '已开启',\n stateOff: '已关闭',\n enable: '开启',\n disable: '关闭',\n verdicts: '本回合 AI 裁决',\n failures: '本回合失败',\n allTime: '累计',\n allows: '放行',\n denies: '拒绝',\n fallbacks: '失败',\n neverRejects: '硬禁用拒绝',\n avg: '平均耗时',\n circuit: '拒绝熔断器已触发',\n circuitDetail: '触发类型:{kind},计数 {count},动作 {action}',\n empty: '本会话暂无 AI 审查裁决。',\n recent: '最近裁决',\n denyList: '可批准的重试',\n approve: '批准重试',\n approveResult: '已授权:{text}',\n approveFailed: '批准失败:{text}',\n switchedResult: '已切换:{text}',\n switchFailed: '切换失败:{text}',\n unavailable: '审查面板不可用(宿主未提供会话投影能力)。',\n decisionAllow: '放行',\n decisionDeny: '拒绝',\n fallbackLabel: '失败({kind})',\n escalationLabel: '风险策略升级',\n riskLow: '低风险',\n riskMedium: '中风险',\n riskHigh: '高风险',\n ms: 'ms',\n} satisfies Record<string, string>\n\n/** Auto-review panel locale key union. */\nexport type ReviewPanelLocaleKey = keyof typeof zh\n\n/** English dictionary checked against the Chinese key set. */\nexport const en: Record<ReviewPanelLocaleKey, string> = {\n label: 'AI Review',\n title: 'AI Auto-Review',\n state: 'State',\n stateOn: 'ON',\n stateOff: 'OFF',\n enable: 'Enable',\n disable: 'Disable',\n verdicts: 'AI verdicts this turn',\n failures: 'Failures this turn',\n allTime: 'All-time',\n allows: 'allows',\n denies: 'denies',\n fallbacks: 'fallbacks',\n neverRejects: 'never rejects',\n avg: 'avg',\n circuit: 'Rejection circuit breaker tripped',\n circuitDetail: '{kind}: {count} denials, action {action}',\n empty: 'No AI review verdicts in this session yet.',\n recent: 'Recent verdicts',\n denyList: 'Approvable retries',\n approve: 'Approve retry',\n approveResult: 'Authorized: {text}',\n approveFailed: 'Approve failed: {text}',\n switchedResult: 'Switched: {text}',\n switchFailed: 'Switch failed: {text}',\n unavailable: 'The review panel is unavailable (the host does not provide the session-projection capability).',\n decisionAllow: 'allow',\n decisionDeny: 'deny',\n fallbackLabel: 'fallback ({kind})',\n escalationLabel: 'risk-policy escalation',\n riskLow: 'low risk',\n riskMedium: 'medium risk',\n riskHigh: 'high risk',\n ms: 'ms',\n}\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'autoReviewPanel'\n","/**\n * Scoped stylesheet for the review panel. Standalone bundles cannot use the\n * in-repo CSS-module pipeline, so the panel injects one `<style>` element\n * whose selectors are all scoped under `[data-dsh-auto-review]`.\n * @module dsh-auto-review/client/styles\n */\n\nconst STYLE_ID = 'dsh-auto-review-panel-styles'\n\nconst CSS = `\n[data-dsh-auto-review] {\n --ar-allow: var(--dsw-color-success, #16a34a);\n --ar-deny: var(--dsw-color-danger, #dc2626);\n --ar-fallback: var(--dsw-color-warning, #d97706);\n --ar-escalation: var(--dsw-color-warning, #d97706);\n --ar-border: var(--dsw-color-border, rgba(128, 128, 128, 0.3));\n --ar-bg: var(--dsw-color-surface, #ffffff);\n --ar-fg: var(--dsw-color-text, #1f2328);\n --ar-muted: var(--dsw-color-text-muted, #6b7280);\n font-family: inherit;\n color: var(--ar-fg);\n}\n[data-dsh-auto-review-panel] {\n position: absolute;\n z-index: 40;\n min-width: 320px;\n max-width: 420px;\n max-height: 70vh;\n overflow-y: auto;\n background: var(--ar-bg);\n border: 1px solid var(--ar-border);\n border-radius: 8px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);\n padding: 12px;\n font-size: 12px;\n line-height: 1.5;\n}\n[data-dsh-auto-review-button] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n background: transparent;\n border: 1px solid var(--ar-border);\n border-radius: 6px;\n padding: 3px 8px;\n font-size: 12px;\n color: var(--ar-fg);\n}\n[data-dsh-auto-review-button]:hover {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-section] {\n margin: 8px 0;\n border-top: 1px solid var(--ar-border);\n padding-top: 8px;\n}\n[data-dsh-auto-review-title] {\n font-weight: 600;\n margin-bottom: 6px;\n}\n[data-dsh-auto-review-row] {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n padding: 2px 0;\n align-items: baseline;\n}\n[data-dsh-auto-review-muted] {\n color: var(--ar-muted);\n}\n[data-dsh-auto-review-verdict] {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n padding: 3px 0;\n border-bottom: 1px dashed var(--ar-border);\n}\n[data-dsh-auto-review-tone-allow] { color: var(--ar-allow); }\n[data-dsh-auto-review-tone-deny] { color: var(--ar-deny); }\n[data-dsh-auto-review-tone-fallback] { color: var(--ar-fallback); }\n[data-dsh-auto-review-tone-escalation] { color: var(--ar-escalation); }\n[data-dsh-auto-review-approve] {\n cursor: pointer;\n border: 1px solid var(--ar-border);\n border-radius: 4px;\n background: transparent;\n color: var(--ar-fg);\n padding: 1px 6px;\n font-size: 11px;\n}\n[data-dsh-auto-review-approve]:hover {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-switch] {\n cursor: pointer;\n border: 1px solid var(--ar-border);\n border-radius: 4px;\n background: transparent;\n color: var(--ar-fg);\n padding: 1px 6px;\n font-size: 11px;\n}\n[data-dsh-auto-review-switch] + [data-dsh-auto-review-switch] {\n margin-left: 4px;\n}\n[data-dsh-auto-review-switch]:hover:not(:disabled) {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-approve]:disabled,\n[data-dsh-auto-review-switch]:disabled {\n opacity: 0.45;\n cursor: default;\n}\n[data-dsh-auto-review-circuit] {\n color: var(--ar-deny);\n font-weight: 600;\n}\n`\n\n/** Install the scoped stylesheet once per plugin fiber. */\nexport function installPanelStyles(): () => void {\n if (document.getElementById(STYLE_ID) !== null) return () => undefined\n const element = document.createElement('style')\n element.id = STYLE_ID\n element.textContent = CSS\n document.head.appendChild(element)\n return () => {\n element.remove()\n }\n}\n","/**\n * `dsh-auto-review`, browser half: registers the locale dictionaries, the\n * scoped stylesheet, and the session-header review panel action. All data\n * arrives through the `autoReview` session projection; the approve buttons\n * execute the `/auto-review approve [n]` command through the commands\n * Remote namespace.\n *\n * @module dsh-auto-review/client\n */\n\nimport type { ClientContext, SessionId } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the 'conversation.session.header.actions' SlotMap\n// declaration into this program so the registration typechecks.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\n// Type-only: merges the commands namespace onto ctx.remote.\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '../projection-types.ts'\nimport { ReviewPanel, type ReviewPanelInjected } from './ReviewPanel.tsx'\nimport { en, NS, zh, type ReviewPanelLocaleKey } from './locales.ts'\nimport { installPanelStyles } from './styles.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Review panel copy. */\n 'autoReviewPanel': ReviewPanelLocaleKey\n }\n}\n\nexport type { ReviewPanelProps, ReviewPanelInjected } from './ReviewPanel.tsx'\nexport type { ReviewPanelLocaleKey } from './locales.ts'\nexport { presentVerdict, type PresentedVerdict, type VerdictTone } from './present.ts'\n\n/** Plugin name: matches the package name, the graph row id, and the bundle id. */\nexport const name = 'dsh-auto-review'\n\n/** Services the panel reads; `remote.commands` is mounted by the api-remotes client. */\nexport const inject = ['slots', 'locale', 'remote', 'remote.commands']\n\n/**\n * The structural shape of the api-remotes `commands` Remote namespace the\n * panel needs. Declared locally because the ambient namespace merge onto\n * `TypertClientRemote` is assembled from several generated modules and can\n * resolve to a different physical copy under strict package managers —\n * the runtime contract is what this client depends on, so the type is\n * pinned to it explicitly (rc.6 and rc.7 both serve this shape).\n */\ninterface CommandsRemote {\n readonly execute: (\n agentId: SessionId,\n line: string,\n signal?: AbortSignal,\n ) => Promise<\n | { ok: false; error: { code: string; message: string } }\n | { ok: true; value?: { result?: { kind?: string; text?: string } } }\n >\n}\n\n/**\n * Browser plugin body: dictionaries, the scoped stylesheet, and the\n * session-header action registration.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-auto-review: dictionaries')\n ctx.effect(() => installPanelStyles(), 'dsh-auto-review: stylesheet')\n ctx.slots.inject(\n 'conversation.session.header.actions',\n () => ctx.slots.register({\n name: 'conversation.session.header.actions',\n id: 'auto-review',\n order: 40,\n locale: NS,\n inject: (sessionId: SessionId): ReviewPanelInjected => {\n const remote = ctx.remote as unknown as { commands: CommandsRemote }\n const executeCommand = async (line: string): Promise<string> => {\n const result = await remote.commands.execute(sessionId, line)\n if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`)\n if (result.value === undefined) throw new Error('unknown command: /auto-review')\n const command = result.value.result\n if (command === undefined) throw new Error('/auto-review produced no command result')\n const text = command.text ?? ''\n return command.kind === 'success' ? text : `${command.kind}: ${text}`\n }\n return {\n approve: async (n: number): Promise<string> => executeCommand(`/auto-review approve ${n}`),\n setEnabled: async (enabled: boolean): Promise<string> => executeCommand(`/auto-review ${enabled ? 'on' : 'off'}`),\n }\n },\n }, ReviewPanel),\n )\n}\n"],"mappings":";;;;;;;;;;EAsBA,SAAgB,eACd,SACA,QAMkB;GAClB,IAAI,QAAQ,aAAa,KAAA,GACvB,OAAO;IACL,UAAU,QAAQ;IAClB,UAAU,QAAQ;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AAI;MAC5D,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,GAAG,OAAO,MAAM,KAAK,IAAI,OAAO,MAAM,SAAS;MAC/E,IAAI,OAAO,UAAU,KAAA,GAAW,MAAM,IAAI,MAAM,+BAA+B;MAC/E,MAAM,UAAU,OAAO,MAAM;MAC7B,IAAI,YAAY,KAAA,GAAW,MAAM,IAAI,MAAM,yCAAyC;MACpF,MAAM,OAAO,QAAQ,QAAQ;MAC7B,OAAO,QAAQ,SAAS,YAAY,OAAO,GAAG,QAAQ,KAAK,IAAI;KACjE;KACA,OAAO;MACL,SAAS,OAAO,MAA+B,eAAe,wBAAwB,GAAG;MACzF,YAAY,OAAO,YAAsC,eAAe,gBAAgB,UAAU,OAAO,OAAO;KAClH;IACF;GACF,GAAG,WAAW,CAChB;EACF"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["useState","useRef"],"sources":["../src/client/present.ts","../src/client/ReviewPanel.tsx","../src/client/locales.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Pure presentation for the review panel: verdict rows and badges as plain\n * strings and tone codes — no I/O, clock, or randomness. The component\n * owns layout and interaction; this module owns the text.\n * @module dsh-auto-review/client/present\n */\n\nimport type { AutoReviewVerdictView } from '../projection-types.ts'\n\n/** Badge tones the component maps to scoped styles. */\nexport type VerdictTone = 'allow' | 'deny' | 'fallback' | 'escalation'\n\n/** One presented verdict row. */\nexport interface PresentedVerdict {\n readonly reviewId: string\n readonly toolName: string\n readonly label: string\n readonly detail: string\n readonly tone: VerdictTone\n}\n\n/** Present one verdict row (the component supplies the localized label texts). */\nexport function presentVerdict(\n verdict: AutoReviewVerdictView,\n labels: {\n readonly allow: string\n readonly deny: string\n readonly fallback: (kind: string) => string\n readonly escalation: string\n },\n): PresentedVerdict {\n if (verdict.fallback !== undefined) {\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label: labels.fallback(verdict.fallback),\n detail: `${verdict.durationMs} ms`,\n tone: 'fallback',\n }\n }\n if (verdict.escalation === 'risk-policy') {\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label: labels.escalation,\n detail: verdict.reason ?? '',\n tone: 'escalation',\n }\n }\n const label = verdict.decision === 'deny' ? labels.deny : labels.allow\n return {\n reviewId: verdict.reviewId,\n toolName: verdict.toolName,\n label,\n detail: verdict.reason ?? `${verdict.durationMs} ms`,\n tone: verdict.decision === 'deny' ? 'deny' : 'allow',\n }\n}\n","/**\n * The session-header review panel: a button in the conversation header that\n * opens a popover with this session's auto-review state — the on/off switch,\n * budgets, cumulative statistics (including hard-disable rejections), the\n * circuit trip, recent verdicts, and one-shot approve buttons for recent\n * denials. Data arrives through the `autoReview` session projection;\n * switches and approves execute the `/auto-review` command through the\n * commands Remote.\n * @module dsh-auto-review/client/ReviewPanel\n */\n\nimport { useRef, useState, type ReactNode } from 'react'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { AutoReviewProjection } from '../projection-types.ts'\nimport { presentVerdict } from './present.ts'\nimport { NS } from './locales.ts'\n\n/** Registration-side injected face: the approve action for one recent denial. */\nexport interface ReviewPanelInjected {\n /** Approve the n-th most recent denial (1 = most recent); resolves with the command result text. */\n approve: (n: number) => Promise<string>\n /** Switch the session's auto-review on/off (`/auto-review on|off`); resolves with the command result text. */\n setEnabled: (enabled: boolean) => Promise<string>\n}\n\n/** Full component props assembled by the session-header slot renderer. */\nexport type ReviewPanelProps =\n PropsRuntime<'conversation.session.header.actions'>\n & PropsLocale<typeof NS>\n & InjectFace<ReviewPanelInjected>\n\n/** Compact verdict-row badge label for the panel. */\nfunction verdictBadge(\n value: AutoReviewProjection | undefined,\n t: ReviewPanelProps['t'],\n): ReactNode {\n if (value === undefined) return t('unavailable')\n const fallback = (kind: string): string => t('fallbackLabel').replace('{kind}', kind)\n const labels = {\n allow: t('decisionAllow'),\n deny: t('decisionDeny'),\n fallback,\n escalation: t('escalationLabel'),\n }\n return value.recent.map(verdict => presentVerdict(verdict, labels)).map(row => (\n <div key={row.reviewId} data-dsh-auto-review-verdict>\n <span data-dsh-auto-review-muted>{row.toolName}</span>\n <span data-dsh-auto-review={`tone-${row.tone}`}>{row.label}</span>\n <span data-dsh-auto-review-muted>{row.detail}</span>\n </div>\n ))\n}\n\n/**\n * Render the review panel action.\n * @param props - framework kit (sessionId, useProjection), locale, and the approve face.\n * @returns the header button with its popover.\n */\nexport function ReviewPanel({ useProjection, approve, setEnabled, t }: ReviewPanelProps): ReactNode {\n const value = useProjection('autoReview')\n const [open, setOpen] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n const anchor = useRef<HTMLDivElement | null>(null)\n const toggle = (): void => setOpen(previous => !previous)\n const runApprove = async (n: number): Promise<void> => {\n try {\n const text = await approve(n)\n setNotice(t('approveResult').replace('{text}', text))\n } catch (error: unknown) {\n setNotice(t('approveFailed').replace('{text}', error instanceof Error ? error.message : String(error)))\n }\n }\n const runSwitch = async (enabled: boolean): Promise<void> => {\n try {\n const text = await setEnabled(enabled)\n setNotice(t('switchedResult').replace('{text}', text))\n } catch (error: unknown) {\n setNotice(t('switchFailed').replace('{text}', error instanceof Error ? error.message : String(error)))\n }\n }\n return (\n <div data-dsh-auto-review ref={anchor}>\n <button type=\"button\" data-dsh-auto-review-button onClick={toggle}>\n {t('label')}\n </button>\n {open && (\n <div data-dsh-auto-review-panel>\n <div data-dsh-auto-review-title>{t('title')}</div>\n {value === undefined\n ? <div data-dsh-auto-review-muted>{t('unavailable')}</div>\n : (\n <div>\n <div data-dsh-auto-review-row>\n <span>{t('state')}</span>\n <span>{value.enabled ? t('stateOn') : t('stateOff')}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('enable')} / {t('disable')}</span>\n <span>\n <button\n type=\"button\"\n data-dsh-auto-review-switch\n disabled={value.enabled}\n onClick={() => void runSwitch(true)}\n >\n {t('enable')}\n </button>\n <button\n type=\"button\"\n data-dsh-auto-review-switch\n disabled={!value.enabled}\n onClick={() => void runSwitch(false)}\n >\n {t('disable')}\n </button>\n </span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('verdicts')}</span>\n <span>{value.verdictsUsed}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('failures')}</span>\n <span>{value.failuresUsed}</span>\n </div>\n <div data-dsh-auto-review-row>\n <span>{t('allTime')}</span>\n <span>\n {value.allows} {t('allows')} · {value.denies} {t('denies')} · {value.fallbacks} {t('fallbacks')} · {value.neverRejects} {t('neverRejects')} · {t('avg')} {value.avgDurationMs} {t('ms')}\n </span>\n </div>\n {value.circuit !== null && (\n <div data-dsh-auto-review-circuit>\n {t('circuit')} — {t('circuitDetail')\n .replace('{kind}', value.circuit.trip.kind)\n .replace('{count}', String(value.circuit.trip.count))\n .replace('{action}', value.circuit.action)}\n </div>\n )}\n {value.recentDenies.length > 0 && (\n <div data-dsh-auto-review-section>\n <div data-dsh-auto-review-title>{t('denyList')}</div>\n {value.recentDenies.map((deny, index) => (\n <div key={deny.reviewId} data-dsh-auto-review-row>\n <span data-dsh-auto-review-muted>{deny.toolName}</span>\n <button type=\"button\" data-dsh-auto-review-approve onClick={() => void runApprove(index + 1)}>\n {t('approve')} #{index + 1}\n </button>\n </div>\n ))}\n </div>\n )}\n <div data-dsh-auto-review-section>\n <div data-dsh-auto-review-title>{t('recent')}</div>\n {value.recent.length === 0 ? <div data-dsh-auto-review-muted>{t('empty')}</div> : verdictBadge(value, t)}\n </div>\n </div>\n )}\n {notice !== null && <div data-dsh-auto-review-muted>{notice}</div>}\n </div>\n )}\n </div>\n )\n}\n","/**\n * Copy dictionaries for the auto-review session-header panel (en/zh — the\n * harness locale registry accepts these two UI language codes today).\n * @module dsh-auto-review/client/locales\n */\n\n/** Simplified Chinese dictionary and key source of truth. */\nexport const zh = {\n label: 'AI 审查',\n title: 'AI 自动审查',\n state: '状态',\n stateOn: '已开启',\n stateOff: '已关闭',\n enable: '开启',\n disable: '关闭',\n verdicts: '本回合 AI 裁决',\n failures: '本回合失败',\n allTime: '累计',\n allows: '放行',\n denies: '拒绝',\n fallbacks: '失败',\n neverRejects: '硬禁用拒绝',\n avg: '平均耗时',\n circuit: '拒绝熔断器已触发',\n circuitDetail: '触发类型:{kind},计数 {count},动作 {action}',\n empty: '本会话暂无 AI 审查裁决。',\n recent: '最近裁决',\n denyList: '可批准的重试',\n approve: '批准重试',\n approveResult: '已授权:{text}',\n approveFailed: '批准失败:{text}',\n switchedResult: '已切换:{text}',\n switchFailed: '切换失败:{text}',\n unavailable: '审查面板不可用(宿主未提供会话投影能力)。',\n decisionAllow: '放行',\n decisionDeny: '拒绝',\n fallbackLabel: '失败({kind})',\n escalationLabel: '风险策略升级',\n riskLow: '低风险',\n riskMedium: '中风险',\n riskHigh: '高风险',\n ms: 'ms',\n} satisfies Record<string, string>\n\n/** Auto-review panel locale key union. */\nexport type ReviewPanelLocaleKey = keyof typeof zh\n\n/** English dictionary checked against the Chinese key set. */\nexport const en: Record<ReviewPanelLocaleKey, string> = {\n label: 'AI Review',\n title: 'AI Auto-Review',\n state: 'State',\n stateOn: 'ON',\n stateOff: 'OFF',\n enable: 'Enable',\n disable: 'Disable',\n verdicts: 'AI verdicts this turn',\n failures: 'Failures this turn',\n allTime: 'All-time',\n allows: 'allows',\n denies: 'denies',\n fallbacks: 'fallbacks',\n neverRejects: 'never rejects',\n avg: 'avg',\n circuit: 'Rejection circuit breaker tripped',\n circuitDetail: '{kind}: {count} denials, action {action}',\n empty: 'No AI review verdicts in this session yet.',\n recent: 'Recent verdicts',\n denyList: 'Approvable retries',\n approve: 'Approve retry',\n approveResult: 'Authorized: {text}',\n approveFailed: 'Approve failed: {text}',\n switchedResult: 'Switched: {text}',\n switchFailed: 'Switch failed: {text}',\n unavailable: 'The review panel is unavailable (the host does not provide the session-projection capability).',\n decisionAllow: 'allow',\n decisionDeny: 'deny',\n fallbackLabel: 'fallback ({kind})',\n escalationLabel: 'risk-policy escalation',\n riskLow: 'low risk',\n riskMedium: 'medium risk',\n riskHigh: 'high risk',\n ms: 'ms',\n}\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'autoReviewPanel'\n","/**\n * Scoped stylesheet for the review panel. Standalone bundles cannot use the\n * in-repo CSS-module pipeline, so the panel injects one `<style>` element\n * whose selectors are all scoped under `[data-dsh-auto-review]`.\n * @module dsh-auto-review/client/styles\n */\n\nconst STYLE_ID = 'dsh-auto-review-panel-styles'\n\nconst CSS = `\n[data-dsh-auto-review] {\n --ar-allow: var(--dsw-color-success, #16a34a);\n --ar-deny: var(--dsw-color-danger, #dc2626);\n --ar-fallback: var(--dsw-color-warning, #d97706);\n --ar-escalation: var(--dsw-color-warning, #d97706);\n --ar-border: var(--dsw-color-border, rgba(128, 128, 128, 0.3));\n --ar-bg: var(--dsw-color-surface, #ffffff);\n --ar-fg: var(--dsw-color-text, #1f2328);\n --ar-muted: var(--dsw-color-text-muted, #6b7280);\n font-family: inherit;\n color: var(--ar-fg);\n}\n[data-dsh-auto-review-panel] {\n position: absolute;\n z-index: 40;\n min-width: 320px;\n max-width: 420px;\n max-height: 70vh;\n overflow-y: auto;\n background: var(--ar-bg);\n border: 1px solid var(--ar-border);\n border-radius: 8px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);\n padding: 12px;\n font-size: 12px;\n line-height: 1.5;\n}\n[data-dsh-auto-review-button] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n background: transparent;\n border: 1px solid var(--ar-border);\n border-radius: 6px;\n padding: 3px 8px;\n font-size: 12px;\n color: var(--ar-fg);\n}\n[data-dsh-auto-review-button]:hover {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-section] {\n margin: 8px 0;\n border-top: 1px solid var(--ar-border);\n padding-top: 8px;\n}\n[data-dsh-auto-review-title] {\n font-weight: 600;\n margin-bottom: 6px;\n}\n[data-dsh-auto-review-row] {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n padding: 2px 0;\n align-items: baseline;\n}\n[data-dsh-auto-review-muted] {\n color: var(--ar-muted);\n}\n[data-dsh-auto-review-verdict] {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n padding: 3px 0;\n border-bottom: 1px dashed var(--ar-border);\n}\n[data-dsh-auto-review-tone-allow] { color: var(--ar-allow); }\n[data-dsh-auto-review-tone-deny] { color: var(--ar-deny); }\n[data-dsh-auto-review-tone-fallback] { color: var(--ar-fallback); }\n[data-dsh-auto-review-tone-escalation] { color: var(--ar-escalation); }\n[data-dsh-auto-review-approve] {\n cursor: pointer;\n border: 1px solid var(--ar-border);\n border-radius: 4px;\n background: transparent;\n color: var(--ar-fg);\n padding: 1px 6px;\n font-size: 11px;\n}\n[data-dsh-auto-review-approve]:hover {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-switch] {\n cursor: pointer;\n border: 1px solid var(--ar-border);\n border-radius: 4px;\n background: transparent;\n color: var(--ar-fg);\n padding: 1px 6px;\n font-size: 11px;\n}\n[data-dsh-auto-review-switch] + [data-dsh-auto-review-switch] {\n margin-left: 4px;\n}\n[data-dsh-auto-review-switch]:hover:not(:disabled) {\n background: rgba(128, 128, 128, 0.12);\n}\n[data-dsh-auto-review-approve]:disabled,\n[data-dsh-auto-review-switch]:disabled {\n opacity: 0.45;\n cursor: default;\n}\n[data-dsh-auto-review-circuit] {\n color: var(--ar-deny);\n font-weight: 600;\n}\n`\n\n/** Install the scoped stylesheet once per plugin fiber. */\nexport function installPanelStyles(): () => void {\n if (document.getElementById(STYLE_ID) !== null) return () => undefined\n const element = document.createElement('style')\n element.id = STYLE_ID\n element.textContent = CSS\n document.head.appendChild(element)\n return () => {\n element.remove()\n }\n}\n","/**\n * `dsh-auto-review`, browser half: registers the locale dictionaries, the\n * scoped stylesheet, and the session-header review panel action. All data\n * arrives through the `autoReview` session projection; the approve buttons\n * execute the `/auto-review approve [n]` command through the commands\n * Remote namespace.\n *\n * @module dsh-auto-review/client\n */\n\nimport type { ClientContext, SessionId } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the 'conversation.session.header.actions' SlotMap\n// declaration into this program so the registration typechecks.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\n// Type-only: merges the commands namespace onto ctx.remote.\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '../projection-types.ts'\nimport { ReviewPanel, type ReviewPanelInjected } from './ReviewPanel.tsx'\nimport { en, NS, zh, type ReviewPanelLocaleKey } from './locales.ts'\nimport { installPanelStyles } from './styles.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Review panel copy. */\n 'autoReviewPanel': ReviewPanelLocaleKey\n }\n}\n\nexport type { ReviewPanelProps, ReviewPanelInjected } from './ReviewPanel.tsx'\nexport type { ReviewPanelLocaleKey } from './locales.ts'\nexport { presentVerdict, type PresentedVerdict, type VerdictTone } from './present.ts'\n\n/** Plugin name: matches the package name, the graph row id, and the bundle id. */\nexport const name = 'dsh-auto-review'\n\n/** Services the panel reads; `remote.commands` is mounted by the api-remotes client. */\nexport const inject = ['slots', 'locale', 'remote', 'remote.commands']\n\n/**\n * The structural shape of the api-remotes `commands` Remote namespace the\n * panel needs. Declared locally because the ambient namespace merge onto\n * `TypertClientRemote` is assembled from several generated modules and can\n * resolve to a different physical copy under strict package managers —\n * the runtime contract is what this client depends on, so the type is\n * pinned to it explicitly (rc.6 and rc.7 both serve this shape).\n */\ninterface CommandsRemote {\n readonly execute: (\n agentId: SessionId,\n line: string,\n images?: readonly unknown[],\n ) => Promise<\n | { ok: false; error: { code: string; message: string } }\n | { ok: true; value?: { result?: { kind?: string; text?: string } } }\n >\n}\n\n/**\n * Browser plugin body: dictionaries, the scoped stylesheet, and the\n * session-header action registration.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-auto-review: dictionaries')\n ctx.effect(() => installPanelStyles(), 'dsh-auto-review: stylesheet')\n ctx.slots.inject(\n 'conversation.session.header.actions',\n () => ctx.slots.register({\n name: 'conversation.session.header.actions',\n id: 'auto-review',\n order: 40,\n locale: NS,\n inject: (sessionId: SessionId): ReviewPanelInjected => {\n const remote = ctx.remote as unknown as { commands: CommandsRemote }\n const executeCommand = async (line: string): Promise<string> => {\n const result = await remote.commands.execute(sessionId, line, [])\n if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`)\n if (result.value === undefined) throw new Error('unknown command: /auto-review')\n const command = result.value.result\n if (command === undefined) throw new Error('/auto-review produced no command result')\n const text = command.text ?? ''\n return command.kind === 'success' ? text : `${command.kind}: ${text}`\n }\n return {\n approve: async (n: number): Promise<string> => executeCommand(`/auto-review approve ${n}`),\n setEnabled: async (enabled: boolean): Promise<string> => executeCommand(`/auto-review ${enabled ? 'on' : 'off'}`),\n }\n },\n }, ReviewPanel),\n )\n}\n"],"mappings":";;;;;;;;;;EAsBA,SAAgB,eACd,SACA,QAMkB;GAClB,IAAI,QAAQ,aAAa,KAAA,GACvB,OAAO;IACL,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,OAAO,OAAO,SAAS,QAAQ,QAAQ;IACvC,QAAQ,GAAG,QAAQ,WAAW;IAC9B,MAAM;GACR;GAEF,IAAI,QAAQ,eAAe,eACzB,OAAO;IACL,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,OAAO,OAAO;IACd,QAAQ,QAAQ,UAAU;IAC1B,MAAM;GACR;GAEF,MAAM,QAAQ,QAAQ,aAAa,SAAS,OAAO,OAAO,OAAO;GACjE,OAAO;IACL,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB;IACA,QAAQ,QAAQ,UAAU,GAAG,QAAQ,WAAW;IAChD,MAAM,QAAQ,aAAa,SAAS,SAAS;GAC/C;EACF;;;;;;;;;;;;;;ECzBA,SAAS,aACP,OACA,GACW;GACX,IAAI,UAAU,KAAA,GAAW,OAAO,EAAE,aAAa;GAC/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/lib/index.js
CHANGED
|
@@ -35,7 +35,7 @@ function isMarkedAuditEvent(result) {
|
|
|
35
35
|
/**
|
|
36
36
|
* Whether a `@deepseek-ai/dsh-session` version line predates the
|
|
37
37
|
* `ignorable` envelope-marker surface: every released rc line through
|
|
38
|
-
* `0.1.
|
|
38
|
+
* `0.1.1-rc.2` silently drops the marker from `Session.append` options
|
|
39
39
|
* (the stamping fix exists on harness master only — no release carries it
|
|
40
40
|
* yet), so audit events written by those builds land unmarked and break
|
|
41
41
|
* resume on stricter hosts. Extend the bound when a new rc line ships that
|
|
@@ -43,12 +43,15 @@ function isMarkedAuditEvent(result) {
|
|
|
43
43
|
* versions are treated as possibly-marker-aware and verified by the append
|
|
44
44
|
* probe.
|
|
45
45
|
* @param version - the installed peer version string.
|
|
46
|
-
* @returns true for the known-unmarked rc.1–rc.
|
|
46
|
+
* @returns true for the known-unmarked `0.1.0-rc.1–rc.8` and
|
|
47
|
+
* `0.1.1-rc.1–rc.2` lines.
|
|
47
48
|
*/
|
|
48
49
|
function isUnmarkedHostVersion(version) {
|
|
49
|
-
const match = /^0\.1\.
|
|
50
|
+
const match = /^0\.1\.(\d+)-rc\.(\d+)$/.exec(version.trim());
|
|
50
51
|
if (match === null) return false;
|
|
51
|
-
|
|
52
|
+
const minor = Number(match[1]);
|
|
53
|
+
const rc = Number(match[2]);
|
|
54
|
+
return minor === 0 && rc <= 8 || minor === 1 && rc <= 2;
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
57
|
* The installed `@deepseek-ai/dsh-session` version, or `null` when
|
|
@@ -4538,6 +4541,22 @@ function viewAutoReview(state) {
|
|
|
4538
4541
|
recentDenies: state.recentDenies
|
|
4539
4542
|
};
|
|
4540
4543
|
}
|
|
4544
|
+
/** Strict state schema — validates the persisted fold state before it seeds a fold. */
|
|
4545
|
+
const AUTO_REVIEW_STATE_SCHEMA = object({
|
|
4546
|
+
enabled: boolean(),
|
|
4547
|
+
turnOpen: boolean(),
|
|
4548
|
+
verdictsUsed: number().int().nonnegative(),
|
|
4549
|
+
failuresUsed: number().int().nonnegative(),
|
|
4550
|
+
allows: number().int().nonnegative(),
|
|
4551
|
+
denies: number().int().nonnegative(),
|
|
4552
|
+
fallbacks: number().int().nonnegative(),
|
|
4553
|
+
neverRejects: number().int().nonnegative(),
|
|
4554
|
+
durationSum: number().int().nonnegative(),
|
|
4555
|
+
decided: number().int().nonnegative(),
|
|
4556
|
+
circuit: CIRCUIT_VIEW_SCHEMA,
|
|
4557
|
+
recent: array(VERDICT_VIEW_SCHEMA),
|
|
4558
|
+
recentDenies: array(DENY_VIEW_SCHEMA)
|
|
4559
|
+
});
|
|
4541
4560
|
/**
|
|
4542
4561
|
* Build the registered unit for one mount. The unit's initial `enabled` is
|
|
4543
4562
|
* the mount's resolved `enableByDefault` (the pure `init` cannot see plugin
|
|
@@ -4551,10 +4570,13 @@ function viewAutoReview(state) {
|
|
|
4551
4570
|
function makeAutoReviewProjection(enabledByDefault) {
|
|
4552
4571
|
return {
|
|
4553
4572
|
key: "autoReview",
|
|
4554
|
-
|
|
4573
|
+
stateSchema: AUTO_REVIEW_STATE_SCHEMA,
|
|
4555
4574
|
init: () => initAutoReviewProjection(enabledByDefault),
|
|
4556
4575
|
apply: applyAutoReview,
|
|
4557
|
-
|
|
4576
|
+
wire: {
|
|
4577
|
+
viewSchema: AUTO_REVIEW_PROJECTION_SCHEMA,
|
|
4578
|
+
view: viewAutoReview
|
|
4579
|
+
},
|
|
4558
4580
|
stateVersion: 2
|
|
4559
4581
|
};
|
|
4560
4582
|
}
|
|
@@ -5567,4 +5589,4 @@ const inject = [
|
|
|
5567
5589
|
"tools"
|
|
5568
5590
|
];
|
|
5569
5591
|
//#endregion
|
|
5570
|
-
export { AUTO_REVIEW_FALLBACKS, AUTO_REVIEW_PROJECTION_SCHEMA, AutoReviewCircuitId, AutoReviewRejectionId, AutoReviewRuntime, AutoReviewVerdictId, CIRCUIT_MARKER, CIRCUIT_MARKER_PATTERN, Config, DEFAULT_DENY_GUIDANCE, DENY_MARKER, DENY_MARKER_PATTERN, FALLBACK_MARKER, FALLBACK_MARKER_PATTERN, NEVER_MARKER, NEVER_MARKER_PATTERN, RISK_ORDER, VERDICT_SCHEMA, activeOverride, apply, applyAutoReview, autoReviewFailuresInOpenTurn, autoReviewsInOpenTurn, buildContextSection, buildReviewPrompt, circuitInOpenTurn, circuitResultText, consecutiveDeniesInOpenTurn, correlateApprovalId, deniesInRecentVerdicts, denyResultText, effectiveAutoReviewState, fallbackResultText, findPresentedCall, initAutoReviewProjection, inject, isDenial, isReviewFailure, lastDeniedVerdicts, makeAutoReviewProjection, name, neverResultText, newCircuitId, newRejectionId, newVerdictId, openTurnVerdicts, parseVerdict, plainCircuitResultText, plainDenyResultText, plainFallbackResultText, plainNeverResultText, renderCallContext, resolveConfig, reviewStats, riskExceeds, runReview, sanitizeArguments, sanitizedArgumentsText, truncate, viewAutoReview };
|
|
5592
|
+
export { AUTO_REVIEW_FALLBACKS, AUTO_REVIEW_PROJECTION_SCHEMA, AUTO_REVIEW_STATE_SCHEMA, AutoReviewCircuitId, AutoReviewRejectionId, AutoReviewRuntime, AutoReviewVerdictId, CIRCUIT_MARKER, CIRCUIT_MARKER_PATTERN, Config, DEFAULT_DENY_GUIDANCE, DENY_MARKER, DENY_MARKER_PATTERN, FALLBACK_MARKER, FALLBACK_MARKER_PATTERN, NEVER_MARKER, NEVER_MARKER_PATTERN, RISK_ORDER, VERDICT_SCHEMA, activeOverride, apply, applyAutoReview, autoReviewFailuresInOpenTurn, autoReviewsInOpenTurn, buildContextSection, buildReviewPrompt, circuitInOpenTurn, circuitResultText, consecutiveDeniesInOpenTurn, correlateApprovalId, deniesInRecentVerdicts, denyResultText, effectiveAutoReviewState, fallbackResultText, findPresentedCall, initAutoReviewProjection, inject, isDenial, isReviewFailure, lastDeniedVerdicts, makeAutoReviewProjection, name, neverResultText, newCircuitId, newRejectionId, newVerdictId, openTurnVerdicts, parseVerdict, plainCircuitResultText, plainDenyResultText, plainFallbackResultText, plainNeverResultText, renderCallContext, resolveConfig, reviewStats, riskExceeds, runReview, sanitizeArguments, sanitizedArgumentsText, truncate, viewAutoReview };
|
package/lib/types/audit.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function isMarkedAuditEvent(result: unknown): boolean;
|
|
|
28
28
|
/**
|
|
29
29
|
* Whether a `@deepseek-ai/dsh-session` version line predates the
|
|
30
30
|
* `ignorable` envelope-marker surface: every released rc line through
|
|
31
|
-
* `0.1.
|
|
31
|
+
* `0.1.1-rc.2` silently drops the marker from `Session.append` options
|
|
32
32
|
* (the stamping fix exists on harness master only — no release carries it
|
|
33
33
|
* yet), so audit events written by those builds land unmarked and break
|
|
34
34
|
* resume on stricter hosts. Extend the bound when a new rc line ships that
|
|
@@ -36,7 +36,8 @@ export declare function isMarkedAuditEvent(result: unknown): boolean;
|
|
|
36
36
|
* versions are treated as possibly-marker-aware and verified by the append
|
|
37
37
|
* probe.
|
|
38
38
|
* @param version - the installed peer version string.
|
|
39
|
-
* @returns true for the known-unmarked rc.1–rc.
|
|
39
|
+
* @returns true for the known-unmarked `0.1.0-rc.1–rc.8` and
|
|
40
|
+
* `0.1.1-rc.1–rc.2` lines.
|
|
40
41
|
*/
|
|
41
42
|
export declare function isUnmarkedHostVersion(version: string): boolean;
|
|
42
43
|
/**
|
package/lib/types/audit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,sGAAsG;AACtG,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAA;AAElE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,sGAAsG;AACtG,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAA;AAElE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAOlD"}
|
package/lib/types/audit.js
CHANGED
|
@@ -29,7 +29,7 @@ export function isMarkedAuditEvent(result) {
|
|
|
29
29
|
/**
|
|
30
30
|
* Whether a `@deepseek-ai/dsh-session` version line predates the
|
|
31
31
|
* `ignorable` envelope-marker surface: every released rc line through
|
|
32
|
-
* `0.1.
|
|
32
|
+
* `0.1.1-rc.2` silently drops the marker from `Session.append` options
|
|
33
33
|
* (the stamping fix exists on harness master only — no release carries it
|
|
34
34
|
* yet), so audit events written by those builds land unmarked and break
|
|
35
35
|
* resume on stricter hosts. Extend the bound when a new rc line ships that
|
|
@@ -37,13 +37,16 @@ export function isMarkedAuditEvent(result) {
|
|
|
37
37
|
* versions are treated as possibly-marker-aware and verified by the append
|
|
38
38
|
* probe.
|
|
39
39
|
* @param version - the installed peer version string.
|
|
40
|
-
* @returns true for the known-unmarked rc.1–rc.
|
|
40
|
+
* @returns true for the known-unmarked `0.1.0-rc.1–rc.8` and
|
|
41
|
+
* `0.1.1-rc.1–rc.2` lines.
|
|
41
42
|
*/
|
|
42
43
|
export function isUnmarkedHostVersion(version) {
|
|
43
|
-
const match = /^0\.1\.
|
|
44
|
+
const match = /^0\.1\.(\d+)-rc\.(\d+)$/.exec(version.trim());
|
|
44
45
|
if (match === null)
|
|
45
46
|
return false;
|
|
46
|
-
|
|
47
|
+
const minor = Number(match[1]);
|
|
48
|
+
const rc = Number(match[2]);
|
|
49
|
+
return (minor === 0 && rc <= 8) || (minor === 1 && rc <= 2);
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
52
|
* The installed `@deepseek-ai/dsh-session` version, or `null` when
|
package/lib/types/audit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAK,MAAkC,CAAC,SAAS,KAAK,IAAI,CAAA;AAChH,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAK3C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAK,MAAkC,CAAC,SAAS,KAAK,IAAI,CAAA;AAChH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,MAAM,KAAK,GAAG,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IAC5D,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3B,OAAO,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,uCAAuC,CAA0B,CAAA;QAC5G,OAAO,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -31,7 +31,7 @@ export function apply(ctx) {
|
|
|
31
31
|
inject: (sessionId) => {
|
|
32
32
|
const remote = ctx.remote;
|
|
33
33
|
const executeCommand = async (line) => {
|
|
34
|
-
const result = await remote.commands.execute(sessionId, line);
|
|
34
|
+
const result = await remote.commands.execute(sessionId, line, []);
|
|
35
35
|
if (!result.ok)
|
|
36
36
|
throw new Error(`${result.error.code}: ${result.error.message}`);
|
|
37
37
|
if (result.value === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,EAAE,WAAW,EAA4B,MAAM,kBAAmB,CAAA;AACzE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAA6B,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAWhD,OAAO,EAAE,cAAc,EAA2C,MAAM,cAAc,CAAA;AAEtF,kFAAkF;AAClF,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAA;AAErC,wFAAwF;AACxF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAA;AAqBtE;;;;GA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AAI,EAAE,CAAA;gBAC/B,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAA;YACvE,CAAC,CAAA;YACD,OAAO;gBACL,OAAO,EAAE,KAAK,EAAE,CAAS,EAAmB,EAAE,CAAC,cAAc,CAAC,wBAAwB,CAAC,EAAE,CAAC;gBAC1F,UAAU,EAAE,KAAK,EAAE,OAAgB,EAAmB,EAAE,CAAC,cAAc,CAAC,gBAAgB,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aAClH,CAAA;QACH,CAAC;KACF,EAAE,WAAW,CAAC,CAChB,CAAA;AACH,CAAC"}
|
|
@@ -53,9 +53,33 @@ export interface AutoReviewProjection {
|
|
|
53
53
|
/** The last 5 denials, newest first (approve candidates; index 0 = approve 1). */
|
|
54
54
|
readonly recentDenies: readonly AutoReviewDenyView[];
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* The host fold state behind the `autoReview` projection unit — plain JSON
|
|
58
|
+
* (the persisted-cache precondition). It carries the internal counters the
|
|
59
|
+
* wire value derives `avgDurationMs` from (`durationSum`/`decided`) and the
|
|
60
|
+
* open-turn gate (`turnOpen`) that the client never needs.
|
|
61
|
+
*/
|
|
62
|
+
export interface AutoReviewProjectionState {
|
|
63
|
+
readonly enabled: boolean;
|
|
64
|
+
readonly turnOpen: boolean;
|
|
65
|
+
readonly verdictsUsed: number;
|
|
66
|
+
readonly failuresUsed: number;
|
|
67
|
+
readonly allows: number;
|
|
68
|
+
readonly denies: number;
|
|
69
|
+
readonly fallbacks: number;
|
|
70
|
+
readonly neverRejects: number;
|
|
71
|
+
readonly durationSum: number;
|
|
72
|
+
readonly decided: number;
|
|
73
|
+
readonly circuit: AutoReviewProjection['circuit'];
|
|
74
|
+
readonly recent: readonly AutoReviewVerdictView[];
|
|
75
|
+
readonly recentDenies: readonly AutoReviewDenyView[];
|
|
76
|
+
}
|
|
56
77
|
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
57
78
|
interface SessionProjectionMap {
|
|
58
79
|
autoReview: AutoReviewProjection;
|
|
59
80
|
}
|
|
81
|
+
interface SessionProjectionStateMap {
|
|
82
|
+
autoReview: AutoReviewProjectionState;
|
|
83
|
+
}
|
|
60
84
|
}
|
|
61
85
|
//# sourceMappingURL=projection-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-types.d.ts","sourceRoot":"","sources":["../../src/projection-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4CAA4C;AAC5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAA;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,QAAQ,CAAC,OA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ek-ai/dsh-session-projection';
|
|
11
11
|
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
12
|
-
import type {
|
|
12
|
+
import type { AutoReviewProjection, AutoReviewProjectionState } from './projection-types.js';
|
|
13
13
|
/** Strict wire schema — validates the `view` output before it leaves the host. */
|
|
14
14
|
export declare const AUTO_REVIEW_PROJECTION_SCHEMA: z.ZodObject<{
|
|
15
15
|
enabled: z.ZodBoolean;
|
|
@@ -46,22 +46,6 @@ export declare const AUTO_REVIEW_PROJECTION_SCHEMA: z.ZodObject<{
|
|
|
46
46
|
reason: z.ZodOptional<z.ZodString>;
|
|
47
47
|
}, z.core.$strip>>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
-
/** The fold's plain-JSON state (the persisted-cache precondition). */
|
|
50
|
-
export interface AutoReviewProjectionState {
|
|
51
|
-
readonly enabled: boolean;
|
|
52
|
-
readonly turnOpen: boolean;
|
|
53
|
-
readonly verdictsUsed: number;
|
|
54
|
-
readonly failuresUsed: number;
|
|
55
|
-
readonly allows: number;
|
|
56
|
-
readonly denies: number;
|
|
57
|
-
readonly fallbacks: number;
|
|
58
|
-
readonly neverRejects: number;
|
|
59
|
-
readonly durationSum: number;
|
|
60
|
-
readonly decided: number;
|
|
61
|
-
readonly circuit: AutoReviewProjection['circuit'];
|
|
62
|
-
readonly recent: readonly AutoReviewVerdictView[];
|
|
63
|
-
readonly recentDenies: readonly AutoReviewDenyView[];
|
|
64
|
-
}
|
|
65
49
|
/**
|
|
66
50
|
* State for the empty log. `enabled` starts at the resolved
|
|
67
51
|
* `enableByDefault` — the projection cannot know the plugin config on its
|
|
@@ -79,6 +63,52 @@ export declare function initAutoReviewProjection(enabledByDefault: boolean): Aut
|
|
|
79
63
|
export declare function applyAutoReview(state: AutoReviewProjectionState, event: SessionEvent): AutoReviewProjectionState;
|
|
80
64
|
/** State → wire payload (the read-side projection). */
|
|
81
65
|
export declare function viewAutoReview(state: AutoReviewProjectionState): AutoReviewProjection;
|
|
66
|
+
/** Strict state schema — validates the persisted fold state before it seeds a fold. */
|
|
67
|
+
export declare const AUTO_REVIEW_STATE_SCHEMA: z.ZodObject<{
|
|
68
|
+
enabled: z.ZodBoolean;
|
|
69
|
+
turnOpen: z.ZodBoolean;
|
|
70
|
+
verdictsUsed: z.ZodNumber;
|
|
71
|
+
failuresUsed: z.ZodNumber;
|
|
72
|
+
allows: z.ZodNumber;
|
|
73
|
+
denies: z.ZodNumber;
|
|
74
|
+
fallbacks: z.ZodNumber;
|
|
75
|
+
neverRejects: z.ZodNumber;
|
|
76
|
+
durationSum: z.ZodNumber;
|
|
77
|
+
decided: z.ZodNumber;
|
|
78
|
+
circuit: z.ZodNullable<z.ZodObject<{
|
|
79
|
+
action: z.ZodUnion<readonly [z.ZodLiteral<"delegate">, z.ZodLiteral<"reject">, z.ZodLiteral<"abort-turn">]>;
|
|
80
|
+
trip: z.ZodObject<{
|
|
81
|
+
kind: z.ZodUnion<readonly [z.ZodLiteral<"consecutive">, z.ZodLiteral<"window">]>;
|
|
82
|
+
count: z.ZodNumber;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
toolName: z.ZodString;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
recent: z.ZodArray<z.ZodObject<{
|
|
87
|
+
reviewId: z.ZodString;
|
|
88
|
+
toolName: z.ZodString;
|
|
89
|
+
at: z.ZodNumber;
|
|
90
|
+
durationMs: z.ZodNumber;
|
|
91
|
+
decision: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>>;
|
|
92
|
+
riskLevel: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"low">, z.ZodLiteral<"medium">, z.ZodLiteral<"high">]>>;
|
|
93
|
+
escalation: z.ZodOptional<z.ZodLiteral<"risk-policy">>;
|
|
94
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
95
|
+
outcome: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"allowed-once">, z.ZodLiteral<"rejected">, z.ZodLiteral<"cancelled">, z.ZodLiteral<"unavailable">]>>;
|
|
96
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
recentDenies: z.ZodArray<z.ZodObject<{
|
|
99
|
+
reviewId: z.ZodString;
|
|
100
|
+
toolName: z.ZodString;
|
|
101
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
/**
|
|
105
|
+
* The register-ready client-visible unit shape: the rc2 `register` overload
|
|
106
|
+
* requires `wire` to be PRESENT for a `SessionProjectionMap` key (the plain
|
|
107
|
+
* `ProjectionDefinition` keeps `wire` optional for host-only units).
|
|
108
|
+
*/
|
|
109
|
+
type AutoReviewProjectionUnit = Omit<ProjectionDefinition<'autoReview', AutoReviewProjectionState>, 'wire'> & {
|
|
110
|
+
wire: NonNullable<ProjectionDefinition<'autoReview', AutoReviewProjectionState>['wire']>;
|
|
111
|
+
};
|
|
82
112
|
/**
|
|
83
113
|
* Build the registered unit for one mount. The unit's initial `enabled` is
|
|
84
114
|
* the mount's resolved `enableByDefault` (the pure `init` cannot see plugin
|
|
@@ -89,5 +119,6 @@ export declare function viewAutoReview(state: AutoReviewProjectionState): AutoRe
|
|
|
89
119
|
* @param enabledByDefault - the resolved `enableByDefault` config value.
|
|
90
120
|
* @returns the projection unit for `ctx.sessionProjections.register`.
|
|
91
121
|
*/
|
|
92
|
-
export declare function makeAutoReviewProjection(enabledByDefault: boolean):
|
|
122
|
+
export declare function makeAutoReviewProjection(enabledByDefault: boolean): AutoReviewProjectionUnit;
|
|
123
|
+
export {};
|
|
93
124
|
//# sourceMappingURL=projection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MA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BAAwB,CAAC,gBAAgB,EAAE,OAAO,GAAG,wBAAwB,CAgB5F"}
|
package/lib/types/projection.js
CHANGED
|
@@ -170,6 +170,22 @@ export function viewAutoReview(state) {
|
|
|
170
170
|
recentDenies: state.recentDenies,
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
/** Strict state schema — validates the persisted fold state before it seeds a fold. */
|
|
174
|
+
export const AUTO_REVIEW_STATE_SCHEMA = z.object({
|
|
175
|
+
enabled: z.boolean(),
|
|
176
|
+
turnOpen: z.boolean(),
|
|
177
|
+
verdictsUsed: z.number().int().nonnegative(),
|
|
178
|
+
failuresUsed: z.number().int().nonnegative(),
|
|
179
|
+
allows: z.number().int().nonnegative(),
|
|
180
|
+
denies: z.number().int().nonnegative(),
|
|
181
|
+
fallbacks: z.number().int().nonnegative(),
|
|
182
|
+
neverRejects: z.number().int().nonnegative(),
|
|
183
|
+
durationSum: z.number().int().nonnegative(),
|
|
184
|
+
decided: z.number().int().nonnegative(),
|
|
185
|
+
circuit: CIRCUIT_VIEW_SCHEMA,
|
|
186
|
+
recent: z.array(VERDICT_VIEW_SCHEMA),
|
|
187
|
+
recentDenies: z.array(DENY_VIEW_SCHEMA),
|
|
188
|
+
});
|
|
173
189
|
/**
|
|
174
190
|
* Build the registered unit for one mount. The unit's initial `enabled` is
|
|
175
191
|
* the mount's resolved `enableByDefault` (the pure `init` cannot see plugin
|
|
@@ -185,10 +201,13 @@ export function makeAutoReviewProjection(enabledByDefault) {
|
|
|
185
201
|
key: 'autoReview',
|
|
186
202
|
// zod v4's `.optional()` output carries `| undefined`, which exact-optional
|
|
187
203
|
// property types reject; the runtime validation is what matters on the wire.
|
|
188
|
-
|
|
204
|
+
stateSchema: AUTO_REVIEW_STATE_SCHEMA,
|
|
189
205
|
init: () => initAutoReviewProjection(enabledByDefault),
|
|
190
206
|
apply: applyAutoReview,
|
|
191
|
-
|
|
207
|
+
wire: {
|
|
208
|
+
viewSchema: AUTO_REVIEW_PROJECTION_SCHEMA,
|
|
209
|
+
view: viewAutoReview,
|
|
210
|
+
},
|
|
192
211
|
// v2: `init.enabled` follows `enableByDefault` (was hardcoded true) and the
|
|
193
212
|
// wire gained the cumulative `neverRejects` counter.
|
|
194
213
|
stateVersion: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../src/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,+CAA+C;AAC/C,MAAM,UAAU,GAAG,CAAC,CAAA;AACpB,oDAAoD;AACpD,MAAM,UAAU,GAAG,CAAC,CAAA;AAEpB,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzF,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC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Y,EAAE,CAAC;KAChB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-auto-review",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Second-model AI auto-review for DeepSeek Harness approval requests: a read-only reviewer subagent decides allow/deny on the approval answerer chain, with fail-closed fallback and full session-log audit.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
],
|
|
102
102
|
"compatibility": {
|
|
103
103
|
"dshVersions": [
|
|
104
|
-
"0.1.
|
|
104
|
+
"0.1.1-rc.2"
|
|
105
105
|
]
|
|
106
106
|
},
|
|
107
107
|
"capability": {
|
|
@@ -134,35 +134,35 @@
|
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
136
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
137
|
-
"@deepseek-ai/dsh-agent": "0.1.0-rc.
|
|
138
|
-
"@deepseek-ai/dsh-brand": "0.1.0-rc.
|
|
139
|
-
"@deepseek-ai/dsh-commands": "0.1.0-rc.
|
|
140
|
-
"@deepseek-ai/dsh-invariants": "0.1.0-rc.
|
|
141
|
-
"@deepseek-ai/dsh-llm": "0.1.0-rc.
|
|
142
|
-
"@deepseek-ai/dsh-session": "0.1.0-rc.
|
|
143
|
-
"@deepseek-ai/dsh-session-projection": "0.1.0-rc.
|
|
144
|
-
"@deepseek-ai/dsh-subagent": "0.1.0-rc.
|
|
145
|
-
"@deepseek-ai/dsh-tools": "0.1.0-rc.
|
|
146
|
-
"@deepseek-ai/dsh-user-approval": "0.1.0-rc.
|
|
137
|
+
"@deepseek-ai/dsh-agent": ">=0.1.0-rc.8 <0.2.0",
|
|
138
|
+
"@deepseek-ai/dsh-brand": ">=0.1.0-rc.8 <0.2.0",
|
|
139
|
+
"@deepseek-ai/dsh-commands": ">=0.1.0-rc.8 <0.2.0",
|
|
140
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.0-rc.8 <0.2.0",
|
|
141
|
+
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.8 <0.2.0",
|
|
142
|
+
"@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
|
|
143
|
+
"@deepseek-ai/dsh-session-projection": ">=0.1.0-rc.8 <0.2.0",
|
|
144
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.0-rc.8 <0.2.0",
|
|
145
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
146
|
+
"@deepseek-ai/dsh-user-approval": ">=0.1.0-rc.8 <0.2.0",
|
|
147
147
|
"@deepseek-ai/schemastery": "^3.18.0"
|
|
148
148
|
},
|
|
149
149
|
"dependencies": {
|
|
150
|
-
"@deepseek-ai/dsh-agent-spine-demo": "0.1.
|
|
151
|
-
"@deepseek-ai/dsh-app-boot": "0.1.
|
|
152
|
-
"@deepseek-ai/dsh-credentials-local": "0.1.
|
|
153
|
-
"@deepseek-ai/dsh-fs-observation-policy": "0.1.
|
|
154
|
-
"@deepseek-ai/dsh-fs-sandbox": "0.1.
|
|
155
|
-
"@deepseek-ai/dsh-home-paths": "0.1.
|
|
156
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.1.
|
|
157
|
-
"@deepseek-ai/dsh-sandbox-local": "0.1.
|
|
158
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.1.
|
|
159
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.
|
|
160
|
-
"@deepseek-ai/dsh-settings-file": "0.1.
|
|
161
|
-
"@deepseek-ai/dsh-subagent-fork-in-process": "0.1.
|
|
162
|
-
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.
|
|
163
|
-
"@deepseek-ai/dsh-subprocess-local": "0.1.
|
|
164
|
-
"@deepseek-ai/dsh-tool-fs": "0.1.
|
|
165
|
-
"@deepseek-ai/dsh-tool-fs-search": "0.1.
|
|
150
|
+
"@deepseek-ai/dsh-agent-spine-demo": "0.1.1-rc.2",
|
|
151
|
+
"@deepseek-ai/dsh-app-boot": "0.1.1-rc.2",
|
|
152
|
+
"@deepseek-ai/dsh-credentials-local": "0.1.1-rc.2",
|
|
153
|
+
"@deepseek-ai/dsh-fs-observation-policy": "0.1.1-rc.2",
|
|
154
|
+
"@deepseek-ai/dsh-fs-sandbox": "0.1.1-rc.2",
|
|
155
|
+
"@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
|
|
156
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.1.1-rc.2",
|
|
157
|
+
"@deepseek-ai/dsh-sandbox-local": "0.1.1-rc.2",
|
|
158
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
|
|
159
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
|
|
160
|
+
"@deepseek-ai/dsh-settings-file": "0.1.1-rc.2",
|
|
161
|
+
"@deepseek-ai/dsh-subagent-fork-in-process": "0.1.1-rc.2",
|
|
162
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.1-rc.2",
|
|
163
|
+
"@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
|
|
164
|
+
"@deepseek-ai/dsh-tool-fs": "0.1.1-rc.2",
|
|
165
|
+
"@deepseek-ai/dsh-tool-fs-search": "0.1.1-rc.2",
|
|
166
166
|
"tsdown": "^0.22.14",
|
|
167
167
|
"typescript": "^7.0.2",
|
|
168
168
|
"yaml": "^2.8.2",
|
|
@@ -172,22 +172,22 @@
|
|
|
172
172
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
173
173
|
"@deepseek-ai/cordis-plugin-include": "1.0.6",
|
|
174
174
|
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
175
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
176
|
-
"@deepseek-ai/dsh-api-remotes": "0.1.
|
|
177
|
-
"@deepseek-ai/dsh-brand": "0.1.
|
|
178
|
-
"@deepseek-ai/dsh-client-connection": "0.1.
|
|
179
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
180
|
-
"@deepseek-ai/dsh-client-runtime": "0.1.
|
|
181
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.1.
|
|
182
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1.
|
|
183
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
184
|
-
"@deepseek-ai/dsh-invariants": "0.1.
|
|
185
|
-
"@deepseek-ai/dsh-llm": "0.1.
|
|
186
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
187
|
-
"@deepseek-ai/dsh-session-projection": "0.1.
|
|
188
|
-
"@deepseek-ai/dsh-subagent": "0.1.
|
|
189
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
190
|
-
"@deepseek-ai/dsh-user-approval": "0.1.
|
|
175
|
+
"@deepseek-ai/dsh-agent": "0.1.1-rc.2",
|
|
176
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
|
|
177
|
+
"@deepseek-ai/dsh-brand": "0.1.1-rc.2",
|
|
178
|
+
"@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
|
|
179
|
+
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
180
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
181
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
|
|
182
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
|
|
183
|
+
"@deepseek-ai/dsh-commands": "0.1.1-rc.2",
|
|
184
|
+
"@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
|
|
185
|
+
"@deepseek-ai/dsh-llm": "0.1.1-rc.2",
|
|
186
|
+
"@deepseek-ai/dsh-session": "0.1.1-rc.2",
|
|
187
|
+
"@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
|
|
188
|
+
"@deepseek-ai/dsh-subagent": "0.1.1-rc.2",
|
|
189
|
+
"@deepseek-ai/dsh-tools": "0.1.1-rc.2",
|
|
190
|
+
"@deepseek-ai/dsh-user-approval": "0.1.1-rc.2",
|
|
191
191
|
"@deepseek-ai/schemastery": "^3.18.0",
|
|
192
192
|
"@types/node": "^26.2.0",
|
|
193
193
|
"@types/react": "18.3.31",
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
"react-dom": "18.3.1",
|
|
199
199
|
"vitest": "^4.1.10"
|
|
200
200
|
},
|
|
201
|
+
"license": "Apache-2.0",
|
|
201
202
|
"scripts": {
|
|
202
203
|
"build": "node scripts/prepare.mjs",
|
|
203
204
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
@@ -205,9 +206,6 @@
|
|
|
205
206
|
"test:coverage": "vitest run --coverage",
|
|
206
207
|
"lint": "oxlint",
|
|
207
208
|
"check:readmes": "node scripts/check-readme-sync.mjs",
|
|
208
|
-
"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
"license": "Apache-2.0"
|
|
213
|
-
}
|
|
209
|
+
"verify:self-contained": "node scripts/verify-self-contained.mjs"
|
|
210
|
+
}
|
|
211
|
+
}
|
package/src/audit.ts
CHANGED
|
@@ -35,7 +35,7 @@ export function isMarkedAuditEvent(result: unknown): boolean {
|
|
|
35
35
|
/**
|
|
36
36
|
* Whether a `@deepseek-ai/dsh-session` version line predates the
|
|
37
37
|
* `ignorable` envelope-marker surface: every released rc line through
|
|
38
|
-
* `0.1.
|
|
38
|
+
* `0.1.1-rc.2` silently drops the marker from `Session.append` options
|
|
39
39
|
* (the stamping fix exists on harness master only — no release carries it
|
|
40
40
|
* yet), so audit events written by those builds land unmarked and break
|
|
41
41
|
* resume on stricter hosts. Extend the bound when a new rc line ships that
|
|
@@ -43,12 +43,15 @@ export function isMarkedAuditEvent(result: unknown): boolean {
|
|
|
43
43
|
* versions are treated as possibly-marker-aware and verified by the append
|
|
44
44
|
* probe.
|
|
45
45
|
* @param version - the installed peer version string.
|
|
46
|
-
* @returns true for the known-unmarked rc.1–rc.
|
|
46
|
+
* @returns true for the known-unmarked `0.1.0-rc.1–rc.8` and
|
|
47
|
+
* `0.1.1-rc.1–rc.2` lines.
|
|
47
48
|
*/
|
|
48
49
|
export function isUnmarkedHostVersion(version: string): boolean {
|
|
49
|
-
const match = /^0\.1\.
|
|
50
|
+
const match = /^0\.1\.(\d+)-rc\.(\d+)$/.exec(version.trim())
|
|
50
51
|
if (match === null) return false
|
|
51
|
-
|
|
52
|
+
const minor = Number(match[1])
|
|
53
|
+
const rc = Number(match[2])
|
|
54
|
+
return (minor === 0 && rc <= 8) || (minor === 1 && rc <= 2)
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
/**
|
package/src/client/index.ts
CHANGED
|
@@ -49,7 +49,7 @@ interface CommandsRemote {
|
|
|
49
49
|
readonly execute: (
|
|
50
50
|
agentId: SessionId,
|
|
51
51
|
line: string,
|
|
52
|
-
|
|
52
|
+
images?: readonly unknown[],
|
|
53
53
|
) => Promise<
|
|
54
54
|
| { ok: false; error: { code: string; message: string } }
|
|
55
55
|
| { ok: true; value?: { result?: { kind?: string; text?: string } } }
|
|
@@ -74,7 +74,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
74
74
|
inject: (sessionId: SessionId): ReviewPanelInjected => {
|
|
75
75
|
const remote = ctx.remote as unknown as { commands: CommandsRemote }
|
|
76
76
|
const executeCommand = async (line: string): Promise<string> => {
|
|
77
|
-
const result = await remote.commands.execute(sessionId, line)
|
|
77
|
+
const result = await remote.commands.execute(sessionId, line, [])
|
|
78
78
|
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`)
|
|
79
79
|
if (result.value === undefined) throw new Error('unknown command: /auto-review')
|
|
80
80
|
const command = result.value.result
|
package/src/projection-types.ts
CHANGED
|
@@ -54,8 +54,33 @@ export interface AutoReviewProjection {
|
|
|
54
54
|
readonly recentDenies: readonly AutoReviewDenyView[]
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* The host fold state behind the `autoReview` projection unit — plain JSON
|
|
59
|
+
* (the persisted-cache precondition). It carries the internal counters the
|
|
60
|
+
* wire value derives `avgDurationMs` from (`durationSum`/`decided`) and the
|
|
61
|
+
* open-turn gate (`turnOpen`) that the client never needs.
|
|
62
|
+
*/
|
|
63
|
+
export interface AutoReviewProjectionState {
|
|
64
|
+
readonly enabled: boolean
|
|
65
|
+
readonly turnOpen: boolean
|
|
66
|
+
readonly verdictsUsed: number
|
|
67
|
+
readonly failuresUsed: number
|
|
68
|
+
readonly allows: number
|
|
69
|
+
readonly denies: number
|
|
70
|
+
readonly fallbacks: number
|
|
71
|
+
readonly neverRejects: number
|
|
72
|
+
readonly durationSum: number
|
|
73
|
+
readonly decided: number
|
|
74
|
+
readonly circuit: AutoReviewProjection['circuit']
|
|
75
|
+
readonly recent: readonly AutoReviewVerdictView[]
|
|
76
|
+
readonly recentDenies: readonly AutoReviewDenyView[]
|
|
77
|
+
}
|
|
78
|
+
|
|
57
79
|
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
58
80
|
interface SessionProjectionMap {
|
|
59
81
|
autoReview: AutoReviewProjection
|
|
60
82
|
}
|
|
83
|
+
interface SessionProjectionStateMap {
|
|
84
|
+
autoReview: AutoReviewProjectionState
|
|
85
|
+
}
|
|
61
86
|
}
|
package/src/projection.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { z } from 'zod'
|
|
11
11
|
import type { ProjectionDefinition } from '@deepseek-ai/dsh-session-projection'
|
|
12
12
|
import type { SessionEvent, SessionEventMap } from '@deepseek-ai/dsh-session'
|
|
13
|
-
import type { AutoReviewDenyView, AutoReviewProjection, AutoReviewVerdictView } from './projection-types.ts'
|
|
13
|
+
import type { AutoReviewDenyView, AutoReviewProjection, AutoReviewProjectionState, AutoReviewVerdictView } from './projection-types.ts'
|
|
14
14
|
|
|
15
15
|
/** How many verdict rows the panel carries. */
|
|
16
16
|
const RECENT_CAP = 8
|
|
@@ -60,23 +60,6 @@ export const AUTO_REVIEW_PROJECTION_SCHEMA = z.object({
|
|
|
60
60
|
recentDenies: z.array(DENY_VIEW_SCHEMA),
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
/** The fold's plain-JSON state (the persisted-cache precondition). */
|
|
64
|
-
export interface AutoReviewProjectionState {
|
|
65
|
-
readonly enabled: boolean
|
|
66
|
-
readonly turnOpen: boolean
|
|
67
|
-
readonly verdictsUsed: number
|
|
68
|
-
readonly failuresUsed: number
|
|
69
|
-
readonly allows: number
|
|
70
|
-
readonly denies: number
|
|
71
|
-
readonly fallbacks: number
|
|
72
|
-
readonly neverRejects: number
|
|
73
|
-
readonly durationSum: number
|
|
74
|
-
readonly decided: number
|
|
75
|
-
readonly circuit: AutoReviewProjection['circuit']
|
|
76
|
-
readonly recent: readonly AutoReviewVerdictView[]
|
|
77
|
-
readonly recentDenies: readonly AutoReviewDenyView[]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
63
|
/** Drop `readonly` from a view type so a fold can fill optional fields conditionally. */
|
|
81
64
|
type Mutable<T> = { -readonly [K in keyof T]: T[K] }
|
|
82
65
|
|
|
@@ -198,6 +181,32 @@ export function viewAutoReview(state: AutoReviewProjectionState): AutoReviewProj
|
|
|
198
181
|
}
|
|
199
182
|
}
|
|
200
183
|
|
|
184
|
+
/** Strict state schema — validates the persisted fold state before it seeds a fold. */
|
|
185
|
+
export const AUTO_REVIEW_STATE_SCHEMA = z.object({
|
|
186
|
+
enabled: z.boolean(),
|
|
187
|
+
turnOpen: z.boolean(),
|
|
188
|
+
verdictsUsed: z.number().int().nonnegative(),
|
|
189
|
+
failuresUsed: z.number().int().nonnegative(),
|
|
190
|
+
allows: z.number().int().nonnegative(),
|
|
191
|
+
denies: z.number().int().nonnegative(),
|
|
192
|
+
fallbacks: z.number().int().nonnegative(),
|
|
193
|
+
neverRejects: z.number().int().nonnegative(),
|
|
194
|
+
durationSum: z.number().int().nonnegative(),
|
|
195
|
+
decided: z.number().int().nonnegative(),
|
|
196
|
+
circuit: CIRCUIT_VIEW_SCHEMA,
|
|
197
|
+
recent: z.array(VERDICT_VIEW_SCHEMA),
|
|
198
|
+
recentDenies: z.array(DENY_VIEW_SCHEMA),
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The register-ready client-visible unit shape: the rc2 `register` overload
|
|
203
|
+
* requires `wire` to be PRESENT for a `SessionProjectionMap` key (the plain
|
|
204
|
+
* `ProjectionDefinition` keeps `wire` optional for host-only units).
|
|
205
|
+
*/
|
|
206
|
+
type AutoReviewProjectionUnit = Omit<ProjectionDefinition<'autoReview', AutoReviewProjectionState>, 'wire'> & {
|
|
207
|
+
wire: NonNullable<ProjectionDefinition<'autoReview', AutoReviewProjectionState>['wire']>
|
|
208
|
+
}
|
|
209
|
+
|
|
201
210
|
/**
|
|
202
211
|
* Build the registered unit for one mount. The unit's initial `enabled` is
|
|
203
212
|
* the mount's resolved `enableByDefault` (the pure `init` cannot see plugin
|
|
@@ -208,15 +217,18 @@ export function viewAutoReview(state: AutoReviewProjectionState): AutoReviewProj
|
|
|
208
217
|
* @param enabledByDefault - the resolved `enableByDefault` config value.
|
|
209
218
|
* @returns the projection unit for `ctx.sessionProjections.register`.
|
|
210
219
|
*/
|
|
211
|
-
export function makeAutoReviewProjection(enabledByDefault: boolean):
|
|
220
|
+
export function makeAutoReviewProjection(enabledByDefault: boolean): AutoReviewProjectionUnit {
|
|
212
221
|
return {
|
|
213
222
|
key: 'autoReview',
|
|
214
223
|
// zod v4's `.optional()` output carries `| undefined`, which exact-optional
|
|
215
224
|
// property types reject; the runtime validation is what matters on the wire.
|
|
216
|
-
|
|
225
|
+
stateSchema: AUTO_REVIEW_STATE_SCHEMA as unknown as ProjectionDefinition<'autoReview', AutoReviewProjectionState>['stateSchema'],
|
|
217
226
|
init: () => initAutoReviewProjection(enabledByDefault),
|
|
218
227
|
apply: applyAutoReview,
|
|
219
|
-
|
|
228
|
+
wire: {
|
|
229
|
+
viewSchema: AUTO_REVIEW_PROJECTION_SCHEMA as unknown as NonNullable<ProjectionDefinition<'autoReview', AutoReviewProjectionState>['wire']>['viewSchema'],
|
|
230
|
+
view: viewAutoReview,
|
|
231
|
+
},
|
|
220
232
|
// v2: `init.enabled` follows `enableByDefault` (was hardcoded true) and the
|
|
221
233
|
// wire gained the cumulative `neverRejects` counter.
|
|
222
234
|
stateVersion: 2,
|