worktrust 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config-edits.mjs CHANGED
@@ -71,14 +71,17 @@ export function takeOut(lines, path, mine) {
71
71
  /**
72
72
  * ONLY THE HOUSE'S OWN DOOR (0.6.16, audit L5; the same rule as log-session.mjs and count-behaviour.mjs): an MCP address is
73
73
  * WorkTrust's when its path is /api/mcp and its host is worktrust.io or a subdomain over https, the host WORKTRUST_MCP_URL
74
- * names, or this computer. `/api/mcp` alone is every hosted MCP server's conventional path, so another product's entry is
74
+ * names, or WorkTrust's own port on this computer. `/api/mcp` alone is every hosted MCP server's conventional path, so another product's entry is
75
75
  * never adopted as the coupling, and never taken out with it.
76
76
  */
77
+ /** WorkTrust's own local doors (the app in development, 3011; a module branch, 3021). Another product's local MCP server
78
+ * (the Advisory Board on 3007, 2026-10-09) is not one: it was offered for removal on update, and could have been adopted. */
79
+ const LOCAL_DOOR_PORTS = new Set(["3011", "3021"]);
77
80
  export const isWorkTrustDoor = (url) => {
78
81
  try {
79
82
  const parsed = new URL(String(url));
80
83
  if (!/\/api\/mcp\/?$/.test(parsed.pathname)) return false;
81
84
  const own = process.env.WORKTRUST_MCP_URL ? new URL(process.env.WORKTRUST_MCP_URL).host : null;
82
- return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1";
85
+ return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || ((parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1") && LOCAL_DOOR_PORTS.has(parsed.port));
83
86
  } catch { return false; }
84
87
  };
@@ -485,12 +485,15 @@ if (flag("classify")) {
485
485
  * fetched a script to run from its origin. A door is WorkTrust's when its host is worktrust.io or a
486
486
  * subdomain, or a local one named by WORKTRUST_MCP_URL; nothing else is a coupling.
487
487
  */
488
+ /** WorkTrust's own local doors (the app in development, 3011; a module branch, 3021). Another product's local MCP server
489
+ * (the Advisory Board on 3007, 2026-10-09) is not one: it was offered for removal on update, and could have been adopted. */
490
+ const LOCAL_DOOR_PORTS = new Set(["3011", "3021"]);
488
491
  const isWorkTrustDoor = (url) => {
489
492
  try {
490
493
  const parsed = new URL(String(url));
491
494
  if (!/\/api\/mcp\/?$/.test(parsed.pathname)) return false;
492
495
  const own = process.env.WORKTRUST_MCP_URL ? new URL(process.env.WORKTRUST_MCP_URL).host : null;
493
- return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1";
496
+ return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || ((parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1") && LOCAL_DOOR_PORTS.has(parsed.port));
494
497
  } catch { return false; }
495
498
  };
496
499
  function fromClientConfig() {
package/log-session.mjs CHANGED
@@ -212,12 +212,15 @@ const floorOf = (state, key) => { const at = typeof state?.[key] === "string" ?
212
212
  * fetched a script to run from its origin. A door is WorkTrust's when its host is worktrust.io or a
213
213
  * subdomain, or a local one named by WORKTRUST_MCP_URL; nothing else is a coupling.
214
214
  */
215
+ /** WorkTrust's own local doors (the app in development, 3011; a module branch, 3021). Another product's local MCP server
216
+ * (the Advisory Board on 3007, 2026-10-09) is not one: it was offered for removal on update, and could have been adopted. */
217
+ const LOCAL_DOOR_PORTS = new Set(["3011", "3021"]);
215
218
  const isWorkTrustDoor = (url) => {
216
219
  try {
217
220
  const parsed = new URL(String(url));
218
221
  if (!/\/api\/mcp\/?$/.test(parsed.pathname)) return false;
219
222
  const own = process.env.WORKTRUST_MCP_URL ? new URL(process.env.WORKTRUST_MCP_URL).host : null;
220
- return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1";
223
+ return parsed.protocol === "https:" && (parsed.hostname === "worktrust.io" || parsed.hostname.endsWith(".worktrust.io")) || (own !== null && parsed.host === own) || ((parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1") && LOCAL_DOOR_PORTS.has(parsed.port));
221
224
  } catch { return false; }
222
225
  };
223
226
  /** The coupling: given, or the one Claude Code already holds — the same read the counter does. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktrust",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Couple this computer to WorkTrust: approve a code in your browser, and every AI app here reports what you built. Metadata only, no dependencies.",
5
5
  "type": "module",
6
6
  "bin": {
package/worktrust.mjs CHANGED
@@ -73,7 +73,7 @@ const command = args.find((arg, at) => !arg.startsWith("--") && !(at > 0 && VALU
73
73
  const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
74
74
  const has = (name) => args.includes(`--${name}`);
75
75
  /** This CLI's version, said to the door so the app can tell which computer runs an old one (check-cli-package holds it equal to package.json). */
76
- const CLI_VERSION = "0.10.1";
76
+ const CLI_VERSION = "0.10.2";
77
77
  const ORIGIN = (flag("origin") ?? process.env.WORKTRUST_ORIGIN ?? "https://app.worktrust.io").replace(/\/$/, "");
78
78
  const MCP = flag("url") ?? process.env.WORKTRUST_MCP_URL ?? `${ORIGIN}/api/mcp`;
79
79
  const HOME_DIR = join(homedir(), ".worktrust");