@inerrata-corporation/errata 2.0.21-dev.3904 → 2.0.21-dev.3918

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/errata.mjs CHANGED
@@ -26722,6 +26722,30 @@ function sidecarForNodes(sidecar, nodes) {
26722
26722
  }
26723
26723
  return count > 0 ? filtered : void 0;
26724
26724
  }
26725
+ function wireVia(value) {
26726
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
26727
+ const v = value;
26728
+ const { edgeType, parentId, forward } = v;
26729
+ if (typeof edgeType !== "string" || !edgeType || typeof parentId !== "string" || !parentId) return null;
26730
+ if (typeof forward !== "boolean") return null;
26731
+ return { edgeType, parentId, forward };
26732
+ }
26733
+ function searchVia(nodes) {
26734
+ const out2 = {};
26735
+ let any2 = false;
26736
+ for (const n of nodes) {
26737
+ const via = wireVia(n.attrs?.["via"]);
26738
+ if (!via || out2[n.canonicalId]) continue;
26739
+ out2[n.canonicalId] = via;
26740
+ any2 = true;
26741
+ }
26742
+ return any2 ? out2 : void 0;
26743
+ }
26744
+ function withoutVia(attrs) {
26745
+ if (!("via" in attrs)) return attrs;
26746
+ const { via: _via, ...rest2 } = attrs;
26747
+ return rest2;
26748
+ }
26725
26749
  function toWirePayload(batch, runId) {
26726
26750
  const droppedNodeIds = new Set(
26727
26751
  batch.nodes.filter((n) => !isCloudWritableNodeLabel(n.label)).map((n) => n.id)
@@ -27401,6 +27425,7 @@ var init_client = __esm({
27401
27425
  if (q.scope) qs.set("scope", q.scope);
27402
27426
  if (q.community) qs.set("community", "true");
27403
27427
  if (q.bridges) qs.set("bridges", "true");
27428
+ if (q.via) qs.set("via", "true");
27404
27429
  const publicCtx = process.env["ERRATA_PRIMING_PUBLIC_CONTEXT"];
27405
27430
  const usePublicCtx = Boolean(publicCtx && publicCtx !== "0" && q.channel === "priming");
27406
27431
  const UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -27415,10 +27440,12 @@ var init_client = __esm({
27415
27440
  } : void 0
27416
27441
  );
27417
27442
  const { nodes, edges } = this.toCastalia(res);
27443
+ const via = searchVia(res.nodes);
27418
27444
  return {
27419
27445
  nodes,
27420
27446
  edges,
27421
27447
  generatedAt: res.generatedAt,
27448
+ ...via ? { via } : {},
27422
27449
  ...res.voidSignal ? { voidSignal: res.voidSignal } : {},
27423
27450
  ...res.seeds ? { seeds: res.seeds } : {}
27424
27451
  };
@@ -27448,7 +27475,7 @@ var init_client = __esm({
27448
27475
  isLandmark: false,
27449
27476
  community: null,
27450
27477
  stability: "stable",
27451
- attrs: { ...localCloudAttrs(n.attrs), source: "cloud", cloudNodeId: n.nodeId }
27478
+ attrs: { ...withoutVia(localCloudAttrs(n.attrs)), source: "cloud", cloudNodeId: n.nodeId }
27452
27479
  }));
27453
27480
  const edges = res.edges.map((e) => ({
27454
27481
  id: digest({ from: e.fromCanonicalId, type: e.type, to: e.toCanonicalId }),
@@ -34991,7 +35018,8 @@ function mergeDualBurst(local, cloud, opts = {}) {
34991
35018
  provenance: "collective",
34992
35019
  ...c.usageCount != null ? { usageCount: c.usageCount } : {},
34993
35020
  ...c.rel ? { rel: c.rel } : {},
34994
- ...c.community ? { community: c.community } : {}
35021
+ ...c.community ? { community: c.community } : {},
35022
+ ...c.via ? { via: c.via } : {}
34995
35023
  });
34996
35024
  }
34997
35025
  nodes.sort((a, b) => b.score - a.score);
@@ -35030,13 +35058,15 @@ function searchResultToCloudHits(result) {
35030
35058
  const cloudScore = !Number.isNaN(s) && maxScore > 0 ? s / maxScore : n > 0 ? (n - i2) / n : 0;
35031
35059
  const communityId = node2.attrs?.["community"];
35032
35060
  const communityLabel = node2.attrs?.["communityLabel"];
35061
+ const via = result.via?.[node2.id];
35033
35062
  return {
35034
35063
  id: node2.id,
35035
35064
  label: node2.label,
35036
35065
  description: node2.description,
35037
35066
  cloudScore,
35038
35067
  ...typeof usage === "number" ? { usageCount: usage } : {},
35039
- ...typeof communityId === "number" ? { community: { id: communityId, label: typeof communityLabel === "string" ? communityLabel : null } } : {}
35068
+ ...typeof communityId === "number" ? { community: { id: communityId, label: typeof communityLabel === "string" ? communityLabel : null } } : {},
35069
+ ...via ? { via } : {}
35040
35070
  };
35041
35071
  });
35042
35072
  }
@@ -35083,7 +35113,7 @@ async function dualAugment(opts) {
35083
35113
  }
35084
35114
  if (hardIds.length > 0 || softQ) {
35085
35115
  calls.push(
35086
- cloud.search({ stack: [], domains: [], kinds: [], seed: hardIds, ...softQ ? { q: softQ } : {}, limit, community: true }).then((res) => {
35116
+ cloud.search({ stack: [], domains: [], kinds: [], seed: hardIds, ...softQ ? { q: softQ } : {}, limit, community: true, via: true }).then((res) => {
35087
35117
  cloudHits.push(...searchResultToCloudHits(res));
35088
35118
  })
35089
35119
  );
@@ -35143,6 +35173,7 @@ async function collectiveDrilldown(cloud, seedId, limit, opts = {}) {
35143
35173
  seed: [seedId],
35144
35174
  limit,
35145
35175
  community: true,
35176
+ via: true,
35146
35177
  ...opts.bridges ? { bridges: true } : {},
35147
35178
  ...opts.scope ? { scope: opts.scope } : {}
35148
35179
  });
@@ -35171,6 +35202,7 @@ async function collectiveDrilldown(cloud, seedId, limit, opts = {}) {
35171
35202
  const score2 = n.attrs["score"];
35172
35203
  const uncertainty = n.attrs["uncertainty"];
35173
35204
  const community = attrsCommunity(n.attrs);
35205
+ const via = res.via?.[n.id];
35174
35206
  return {
35175
35207
  id: n.id,
35176
35208
  label: n.label,
@@ -35179,7 +35211,8 @@ async function collectiveDrilldown(cloud, seedId, limit, opts = {}) {
35179
35211
  ...typeof uncertainty === "number" ? { uncertainty: Number(uncertainty.toFixed(4)) } : {},
35180
35212
  ...community ? { community } : {},
35181
35213
  hops: 1,
35182
- provenance: "collective"
35214
+ provenance: "collective",
35215
+ ...via ? { via } : {}
35183
35216
  };
35184
35217
  }),
35185
35218
  edges: res.edges.map((e) => ({ from: e.from, to: e.to, type: e.type })),
@@ -44915,11 +44948,10 @@ var init_mcp = __esm({
44915
44948
  node: { id: cn.seed, provenance: "collective" },
44916
44949
  collectiveReachable: true,
44917
44950
  collectiveStatus: collectiveSeedStatus(cn),
44918
- // Seed-touching edge types aren't on the wire (the server's seed
44919
- // burst excludes the seed itself, and edges to nodes outside the
44920
- // result set are dropped), so the collective fallback reports the
44921
- // 1-hop neighborhood + its internal topology instead of the local
44922
- // contract's typed out/in lists.
44951
+ // The collective fallback reports the 1-hop neighborhood + its
44952
+ // internal topology instead of the local contract's typed out/in
44953
+ // lists; the seed-touching edge rides on each node's `via` (the
44954
+ // server's seed burst excludes the seed itself, so `edges` can't).
44923
44955
  nearby: cn.nodes,
44924
44956
  edges: cn.edges,
44925
44957
  ...collectiveCommunityFields(cn)
@@ -45183,7 +45215,8 @@ var init_mcp = __esm({
45183
45215
  hops: n.hops,
45184
45216
  relevance: n.score,
45185
45217
  provenance: n.provenance,
45186
- ...n.community ? { community: n.community } : {}
45218
+ ...n.community ? { community: n.community } : {},
45219
+ ...n.via ? { via: n.via } : {}
45187
45220
  })),
45188
45221
  edges: cn.edges,
45189
45222
  ...collectiveCommunityFields(cn)
@@ -83179,7 +83212,7 @@ function createWatchBreaker(deps) {
83179
83212
  }
83180
83213
 
83181
83214
  // src/engine.ts
83182
- var DAEMON_VERSION = true ? "2.0.21-dev.3904" : "2.0.0-alpha.0";
83215
+ var DAEMON_VERSION = true ? "2.0.21-dev.3918" : "2.0.0-alpha.0";
83183
83216
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
83184
83217
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
83185
83218
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.21-dev.3904",
3
+ "version": "2.0.21-dev.3918",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.21-dev.3904",
3
+ "version": "2.0.21-dev.3918",
4
4
  "description": "A minimal 3D view of loaded Errata priors and recent graph bursts.",
5
5
  "author": {
6
6
  "name": "inErrata"
@@ -1,4 +1,4 @@
1
- 80437cb509261f3ab983d93240320f8ef99241c2b0709ccca75d3052035b27a7 .codex-plugin/plugin.json
1
+ b107a94e4e9828c1c6f57f4acb3e914b4e2ed683a0c75446defb85835e5010ce .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js