@duke-dsh-plugins/dsh-agent-approval 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +18 -9
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -948,19 +948,28 @@ export class AgentApprovalService extends TypertRemoteService {
948
948
  /**
949
949
  * Resolve the audit sidecar for one session: `agent-approval.jsonl` inside
950
950
  * the session's persistence directory (same directory as the session's own
951
- * durable log, via `sessionPersistence.locate(header)` — a pure path
952
- * resolution that also works for live sessions). Falls back to a
953
- * plugin-owned per-session file under DSH_HOME when the seam or the
954
- * location is unavailable; the fallback keeps restart-safety at the cost
955
- * of not being cleaned up when the session is deleted.
951
+ * durable log — a pure path resolution that also works for live sessions).
952
+ * DSH ≤0.1.7 exposes it as `sessionPersistence.locate(header)`; DSH 0.2.0
953
+ * dropped `locate` and moved resolution to the JSONL backend's async
954
+ * `resolveCurrentLog(id)` (returns the log path, or undefined while only a
955
+ * historical generation exists). Falls back to a plugin-owned per-session
956
+ * file under DSH_HOME when the seam or the location is unavailable; the
957
+ * fallback keeps restart-safety at the cost of not being cleaned up when the
958
+ * session is deleted.
956
959
  */
957
960
  async _recordsFileOf(session) {
958
961
  const persistence = this.ctx.get("sessionPersistence");
959
- if (persistence !== undefined && typeof persistence.locate === "function") {
962
+ if (persistence !== undefined) {
960
963
  try {
961
- const loc = persistence.locate(session.header);
962
- if (loc && typeof loc.path === "string" && loc.path !== "") {
963
- return join(dirname(loc.path), RECORDS_SIDECAR);
964
+ let path;
965
+ if (typeof persistence.locate === "function") {
966
+ const loc = persistence.locate(session.header);
967
+ if (loc && typeof loc.path === "string") path = loc.path;
968
+ } else if (typeof persistence.resolveCurrentLog === "function") {
969
+ path = await persistence.resolveCurrentLog(session.id);
970
+ }
971
+ if (typeof path === "string" && path !== "") {
972
+ return join(dirname(path), RECORDS_SIDECAR);
964
973
  }
965
974
  } catch (e) {
966
975
  /* fall through to the plugin-owned fallback */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duke-dsh-plugins/dsh-agent-approval",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Agent-decided approvals for DeepSeek Harness: an 自动审批 permission mode where every sandbox escalation is judged automatically (default judge: one direct LLM call with no subagent session; optional isolated judge subagent or the TypeSafe Jev decision model), plus an opt-in 自动审查 per-call review mode (Full access base; every tool call reviewed by the Jev judge before execution, risky calls rejected with no human fallback), with a configurable judge model and a per-session audit trail in the conversation window's 审批 tab.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,13 +34,13 @@
34
34
  "platform": "web"
35
35
  },
36
36
  "engines": {
37
- "dsh": "^0.1.5-rc.3"
37
+ "dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1"
38
38
  }
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@deepseek-ai/cordis": "^4.0.1",
42
- "@deepseek-ai/dsh": "^0.1.5-rc.3",
43
- "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.7 || ^0.1.7-rc.1"
42
+ "@deepseek-ai/dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1",
43
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.7 || ^0.1.7-rc.1 || ^0.2.0-rc.1"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "@deepseek-ai/dsh": {