@workit-dev/opencode 2.27.1 → 2.27.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.
Files changed (2) hide show
  1. package/dist/plugin.js +8 -8
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -16926,15 +16926,13 @@ function sessionTrust(cwd, row) {
16926
16926
  const session = row.actor.session;
16927
16927
  if (!session || row.self === true)
16928
16928
  return null;
16929
+ const binding = session.includes(":") ? issuedBinding(cwd, session) : null;
16930
+ if (binding === "token" && row.sessionBound !== true)
16931
+ return "unbound_session";
16929
16932
  const source = typeof row.sessionSource === "string" ? row.sessionSource : "env";
16930
16933
  const host = row.actor.host;
16931
16934
  const issuedOnly = source === "flag" ? host !== "cli" : source === "env" && session.includes(":") && !SHELL_VOUCHED_HOSTS.has(host);
16932
- if (!issuedOnly)
16933
- return null;
16934
- const binding = issuedBinding(cwd, session);
16935
- if (binding === null)
16936
- return "unissued_session";
16937
- return binding === "token" && row.sessionBound !== true ? "unbound_session" : null;
16935
+ return issuedOnly && binding === null ? "unissued_session" : null;
16938
16936
  }
16939
16937
  function trustReasons(cwd, row) {
16940
16938
  if (row.integrity === "unverified")
@@ -29863,11 +29861,13 @@ function currentJudgment(cwd) {
29863
29861
  // packages/workit-core/src/core/verdict-set.ts
29864
29862
  import path44 from "node:path";
29865
29863
  var SET_TTL_MS = 7 * 86400000;
29864
+ var SET_ROW = "verdict.set";
29866
29865
  var SET_VOID = "verdict.set.voided";
29867
29866
  var setStorePath = () => path44.join(resolveStateDir(), "verdicts", "sets", "ledger.jsonl");
29867
+ var distrusted = (cwd, id, rows, type) => rows.some((row) => row.type === type && row.id === id && trustReasons(cwd, row).length > 0);
29868
29868
  function gateStands(cwd, gate, rows, now = Date.now()) {
29869
29869
  const id = typeof gate.verdictId === "string" ? gate.verdictId : null;
29870
- if (id !== null && verdictVoids(rows).has(id))
29870
+ if (id !== null && (verdictVoids(rows).has(id) || distrusted(cwd, id, rows, "verdict")))
29871
29871
  return false;
29872
29872
  if (gate.via !== "set")
29873
29873
  return true;
@@ -29877,7 +29877,7 @@ function gateStands(cwd, gate, rows, now = Date.now()) {
29877
29877
  if (id === null)
29878
29878
  return true;
29879
29879
  const read = readLedgerAt(cwd, setStorePath(), { integrity: true });
29880
- return read.ok && !read.value.rows.some((row) => row.type === SET_VOID && row.target === id && row.integrity === "verified");
29880
+ return read.ok && !distrusted(cwd, id, read.value.rows, SET_ROW) && !read.value.rows.some((row) => row.type === SET_VOID && row.target === id && row.integrity === "verified");
29881
29881
  }
29882
29882
 
29883
29883
  // packages/workit-core/src/hooks/stop.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/opencode",
3
- "version": "2.27.1",
3
+ "version": "2.27.4",
4
4
  "private": false,
5
5
  "description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@opencode/plugin": "2.3.2",
44
- "@workit-dev/core": "^2.27.1"
44
+ "@workit-dev/core": "^2.27.4"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24"