@inerrata-corporation/errata 2.0.6-dev.2272 → 2.0.6-dev.2282

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/errata.mjs +42 -24
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -2286,8 +2286,8 @@ var init_regexes = __esm({
2286
2286
  _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
2287
2287
  ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
2288
2288
  ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
2289
- mac = (delimiter) => {
2290
- const escapedDelim = escapeRegex(delimiter ?? ":");
2289
+ mac = (delimiter2) => {
2290
+ const escapedDelim = escapeRegex(delimiter2 ?? ":");
2291
2291
  return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
2292
2292
  };
2293
2293
  cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
@@ -16353,6 +16353,9 @@ function parsePackageJson(path2, text) {
16353
16353
  }
16354
16354
  return deps;
16355
16355
  }
16356
+ function isPep508DirectRef(spec) {
16357
+ return /^[A-Za-z0-9][A-Za-z0-9._-]*(?:\[[^\]]*\])?\s*@\s*\S/.test(spec.trim());
16358
+ }
16356
16359
  function parseRequirements(path2, text) {
16357
16360
  const deps = [];
16358
16361
  for (const raw2 of text.split(/\r?\n/)) {
@@ -16360,7 +16363,14 @@ function parseRequirements(path2, text) {
16360
16363
  if (!line || line.startsWith("-") || line.startsWith("git+") || line.startsWith("http")) continue;
16361
16364
  const m = /^([A-Za-z0-9][A-Za-z0-9._-]*)(?:\[[^\]]*\])?\s*(?:([=<>!~]+)\s*([^\s;]+))?/.exec(line);
16362
16365
  if (m) {
16363
- deps.push({ ecosystem: "pypi", name: m[1] ?? "", version: m[2] ? m[3] ?? null : null, kind: "package", manifest: path2 });
16366
+ deps.push({
16367
+ ecosystem: "pypi",
16368
+ name: m[1] ?? "",
16369
+ version: m[2] ? m[3] ?? null : null,
16370
+ kind: "package",
16371
+ manifest: path2,
16372
+ ...isPep508DirectRef(line) ? { directRef: true } : {}
16373
+ });
16364
16374
  }
16365
16375
  }
16366
16376
  return deps;
@@ -16372,7 +16382,16 @@ function parsePyproject(path2, text) {
16372
16382
  for (const s of (m[1] ?? "").matchAll(/"([^"]+)"|'([^']+)'/g)) {
16373
16383
  const spec = s[1] || s[2] || "";
16374
16384
  const mm = /^([A-Za-z0-9][A-Za-z0-9._-]*)/.exec(spec);
16375
- if (mm) deps.push({ ecosystem: "pypi", name: mm[1] ?? "", version: null, kind: "package", manifest: path2 });
16385
+ if (mm) {
16386
+ deps.push({
16387
+ ecosystem: "pypi",
16388
+ name: mm[1] ?? "",
16389
+ version: null,
16390
+ kind: "package",
16391
+ manifest: path2,
16392
+ ...isPep508DirectRef(spec) ? { directRef: true } : {}
16393
+ });
16394
+ }
16376
16395
  }
16377
16396
  return deps;
16378
16397
  }
@@ -63559,10 +63578,10 @@ var require_headers = __commonJS({
63559
63578
  const lowercaseName = isLowerCase ? name2 : name2.toLowerCase();
63560
63579
  const exists = this[kHeadersMap].get(lowercaseName);
63561
63580
  if (exists) {
63562
- const delimiter = lowercaseName === "cookie" ? "; " : ", ";
63581
+ const delimiter2 = lowercaseName === "cookie" ? "; " : ", ";
63563
63582
  this[kHeadersMap].set(lowercaseName, {
63564
63583
  name: exists.name,
63565
- value: `${exists.value}${delimiter}${value}`
63584
+ value: `${exists.value}${delimiter2}${value}`
63566
63585
  });
63567
63586
  } else {
63568
63587
  this[kHeadersMap].set(lowercaseName, { name: name2, value });
@@ -73320,7 +73339,7 @@ init_review2();
73320
73339
 
73321
73340
  // src/turn.ts
73322
73341
  import { closeSync, existsSync as existsSync15, fstatSync, openSync, readdirSync as readdirSync6, readSync, realpathSync, statSync as statSync5 } from "node:fs";
73323
- import { basename as basename5, dirname as dirname10, join as join18 } from "node:path";
73342
+ import { basename as basename5, delimiter, dirname as dirname10, join as join18, normalize as normalize3 } from "node:path";
73324
73343
  import { homedir as homedir4 } from "node:os";
73325
73344
  import { createHash as createHash13 } from "node:crypto";
73326
73345
  function readFrom(path2, fromByte, maxBytes) {
@@ -73751,12 +73770,13 @@ function subagentTranscripts(mainTranscriptPath, sessionId) {
73751
73770
  refs.sort((a, b) => b.mtimeMs - a.mtimeMs);
73752
73771
  return refs;
73753
73772
  }
73773
+ function splitPathList(value, sep5 = delimiter) {
73774
+ if (!value) return [];
73775
+ return value.split(sep5).map((d) => d.trim()).filter(Boolean).map((d) => normalize3(d));
73776
+ }
73754
73777
  function codexSessionRoots(env2 = process.env, home = homedir4()) {
73755
73778
  const roots = /* @__PURE__ */ new Set();
73756
- const explicit = env2["ERRATA_CODEX_SESSIONS_DIRS"];
73757
- if (explicit) {
73758
- for (const d of explicit.split(":")) if (d.trim()) roots.add(d.trim());
73759
- }
73779
+ for (const d of splitPathList(env2["ERRATA_CODEX_SESSIONS_DIRS"])) roots.add(d);
73760
73780
  if (env2["CODEX_HOME"]) roots.add(join18(env2["CODEX_HOME"], "sessions"));
73761
73781
  roots.add(join18(home, ".codex", "sessions"));
73762
73782
  return [...roots];
@@ -73838,10 +73858,7 @@ function codexRolloutsForCwd(cwd, opts = {}) {
73838
73858
  }
73839
73859
  function geminiSessionRoots(env2 = process.env, home = homedir4()) {
73840
73860
  const roots = /* @__PURE__ */ new Set();
73841
- const explicit = env2["ERRATA_GEMINI_SESSIONS_DIRS"];
73842
- if (explicit) {
73843
- for (const d of explicit.split(":")) if (d.trim()) roots.add(d.trim());
73844
- }
73861
+ for (const d of splitPathList(env2["ERRATA_GEMINI_SESSIONS_DIRS"])) roots.add(d);
73845
73862
  if (env2["GEMINI_CLI_HOME"]) roots.add(join18(env2["GEMINI_CLI_HOME"], ".gemini", "tmp"));
73846
73863
  roots.add(join18(home, ".gemini", "tmp"));
73847
73864
  return [...roots];
@@ -73919,10 +73936,7 @@ function geminiTranscriptsForCwd(cwd, opts = {}) {
73919
73936
  }
73920
73937
  function opencodeSessionRoots(env2 = process.env, home = homedir4()) {
73921
73938
  const roots = /* @__PURE__ */ new Set();
73922
- const explicit = env2["ERRATA_OPENCODE_SESSIONS_DIRS"];
73923
- if (explicit) {
73924
- for (const d of explicit.split(":")) if (d.trim()) roots.add(d.trim());
73925
- }
73939
+ for (const d of splitPathList(env2["ERRATA_OPENCODE_SESSIONS_DIRS"])) roots.add(d);
73926
73940
  if (env2["XDG_DATA_HOME"]) roots.add(join18(env2["XDG_DATA_HOME"], "opencode", "errata"));
73927
73941
  roots.add(join18(home, ".local", "share", "opencode", "errata"));
73928
73942
  return [...roots];
@@ -76517,10 +76531,13 @@ function isRuntimeToken(token) {
76517
76531
  function rankCandidates(cs) {
76518
76532
  return [...cs].sort((a, b) => b.weight - a.weight || a.name.localeCompare(b.name));
76519
76533
  }
76534
+ var VCS_HOST_SHORTHAND = /^(?:github|gitlab|bitbucket|gist):/;
76535
+ var SCP_STYLE_REMOTE = /^[\w.-]+@[\w.-]+:/;
76536
+ var BARE_REPO_SHORTHAND = /^[a-z0-9_.-]+\/[a-z0-9_.-]+(?:#.*)?$/;
76520
76537
  function isLocalSpec(version2) {
76521
76538
  if (!version2) return false;
76522
76539
  const v = version2.trim().toLowerCase();
76523
- return v.startsWith("workspace:") || v.startsWith("link:") || v.startsWith("file:") || v.startsWith("portal:") || v.startsWith("path:") || v.startsWith("git:") || v.startsWith("git+") || v.includes("://");
76540
+ return v.startsWith("workspace:") || v.startsWith("link:") || v.startsWith("file:") || v.startsWith("portal:") || v.startsWith("path:") || v.startsWith("git:") || v.startsWith("git+") || v.includes("://") || VCS_HOST_SHORTHAND.test(v) || SCP_STYLE_REMOTE.test(v) || BARE_REPO_SHORTHAND.test(v);
76524
76541
  }
76525
76542
  function retrievalStackTokens(input) {
76526
76543
  const cap = input.cap ?? RETRIEVAL_STACK_CAP;
@@ -76569,7 +76586,7 @@ function retrievalStackTokens(input) {
76569
76586
  if (RUNTIME_KINDS.has(d.kind)) continue;
76570
76587
  const ecosystem = d.ecosystem.toLowerCase();
76571
76588
  if (lockfileKeys.has(ecoKey(ecosystem, d.name))) continue;
76572
- if (isLocalSpec(d.version)) continue;
76589
+ if (d.directRef || isLocalSpec(d.version)) continue;
76573
76590
  if (!isPublicDep({ ecosystem, name: d.name }, registry2)) continue;
76574
76591
  const key = ecoKey(ecosystem, d.name);
76575
76592
  const prev = counted.get(key);
@@ -78098,7 +78115,7 @@ function createWatchBreaker(deps) {
78098
78115
  }
78099
78116
 
78100
78117
  // src/engine.ts
78101
- var DAEMON_VERSION = true ? "2.0.6-dev.2272" : "2.0.0-alpha.0";
78118
+ var DAEMON_VERSION = true ? "2.0.6-dev.2282" : "2.0.0-alpha.0";
78102
78119
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
78103
78120
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
78104
78121
  var GIT_OP_MUTE_MS = 4e3;
@@ -86469,7 +86486,7 @@ function buildOpencodePluginSource(port, opts = {}) {
86469
86486
  // file the errata daemon can parse, and tells the daemon on every turn boundary.
86470
86487
  // It has no dependencies and never throws into OpenCode.
86471
86488
  import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
86472
- import { join } from "node:path";
86489
+ import { delimiter, join, normalize } from "node:path";
86473
86490
  import { homedir } from "node:os";
86474
86491
 
86475
86492
  const DAEMON = "http://127.0.0.1:${port}";
@@ -86479,7 +86496,8 @@ const TOOL_FAILURE_NUDGE = ${JSON.stringify(OPENCODE_TOOL_FAILURE_NUDGE)};
86479
86496
 
86480
86497
  function mirrorRoot() {
86481
86498
  const explicit = process.env.ERRATA_OPENCODE_SESSIONS_DIRS;
86482
- if (explicit) { const first = explicit.split(":").map((s) => s.trim()).find(Boolean); if (first) return first; }
86499
+ // Platform delimiter, same as the daemon's splitPathList \u2014 ":" shreds "C:\\x".
86500
+ if (explicit) { const first = explicit.split(delimiter).map((s) => s.trim()).find(Boolean); if (first) return normalize(first); }
86483
86501
  if (process.env.XDG_DATA_HOME) return join(process.env.XDG_DATA_HOME, "opencode", "errata");
86484
86502
  return join(homedir(), ".local", "share", "opencode", "errata");
86485
86503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.6-dev.2272",
3
+ "version": "2.0.6-dev.2282",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {