@workit-dev/opencode 2.27.2 → 2.27.5

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 +13 -8
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -10931,6 +10931,11 @@ var HOST_SESSION_VARS = [
10931
10931
  (env) => env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli"
10932
10932
  ]
10933
10933
  ];
10934
+ var STAMPING_HOSTS = new Set([
10935
+ "claude_code",
10936
+ "codex_cli",
10937
+ "codex_desktop"
10938
+ ]);
10934
10939
  var family = (host) => host?.replace(/_(?:cli|desktop)$/, "") ?? null;
10935
10940
  function hostSessionFromEnv(env) {
10936
10941
  const value = (key) => env[key]?.trim() || null;
@@ -16926,15 +16931,13 @@ function sessionTrust(cwd, row) {
16926
16931
  const session = row.actor.session;
16927
16932
  if (!session || row.self === true)
16928
16933
  return null;
16934
+ const binding = session.includes(":") ? issuedBinding(cwd, session) : null;
16935
+ if (binding === "token" && row.sessionBound !== true)
16936
+ return "unbound_session";
16929
16937
  const source = typeof row.sessionSource === "string" ? row.sessionSource : "env";
16930
16938
  const host = row.actor.host;
16931
16939
  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;
16940
+ return issuedOnly && binding === null ? "unissued_session" : null;
16938
16941
  }
16939
16942
  function trustReasons(cwd, row) {
16940
16943
  if (row.integrity === "unverified")
@@ -29863,11 +29866,13 @@ function currentJudgment(cwd) {
29863
29866
  // packages/workit-core/src/core/verdict-set.ts
29864
29867
  import path44 from "node:path";
29865
29868
  var SET_TTL_MS = 7 * 86400000;
29869
+ var SET_ROW = "verdict.set";
29866
29870
  var SET_VOID = "verdict.set.voided";
29867
29871
  var setStorePath = () => path44.join(resolveStateDir(), "verdicts", "sets", "ledger.jsonl");
29872
+ var distrusted = (cwd, id, rows, type) => rows.some((row) => row.type === type && row.id === id && trustReasons(cwd, row).length > 0);
29868
29873
  function gateStands(cwd, gate, rows, now = Date.now()) {
29869
29874
  const id = typeof gate.verdictId === "string" ? gate.verdictId : null;
29870
- if (id !== null && verdictVoids(rows).has(id))
29875
+ if (id !== null && (verdictVoids(rows).has(id) || distrusted(cwd, id, rows, "verdict")))
29871
29876
  return false;
29872
29877
  if (gate.via !== "set")
29873
29878
  return true;
@@ -29877,7 +29882,7 @@ function gateStands(cwd, gate, rows, now = Date.now()) {
29877
29882
  if (id === null)
29878
29883
  return true;
29879
29884
  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");
29885
+ 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
29886
  }
29882
29887
 
29883
29888
  // 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.2",
3
+ "version": "2.27.5",
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.2"
44
+ "@workit-dev/core": "^2.27.5"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24"