@peer2peer/ext-ix 0.0.0-stage → 0.1.0
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/LICENSE +201 -0
- package/README.md +75 -2
- package/SPEC.md +695 -0
- package/dist/conflicts.d.ts +64 -0
- package/dist/conflicts.js +188 -0
- package/dist/extension.d.ts +31 -0
- package/dist/extension.js +552 -0
- package/dist/footprint-command.d.ts +57 -0
- package/dist/footprint-command.js +398 -0
- package/dist/footprint-compute.d.ts +106 -0
- package/dist/footprint-compute.js +559 -0
- package/dist/footprint.d.ts +162 -0
- package/dist/footprint.js +451 -0
- package/dist/hmac.d.ts +18 -0
- package/dist/hmac.js +42 -0
- package/dist/impact.d.ts +66 -0
- package/dist/impact.js +208 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +20 -0
- package/dist/ix.d.ts +20 -0
- package/dist/ix.js +76 -0
- package/dist/note.d.ts +40 -0
- package/dist/note.js +82 -0
- package/dist/overlap-command.d.ts +37 -0
- package/dist/overlap-command.js +81 -0
- package/dist/overlap.d.ts +83 -0
- package/dist/overlap.js +227 -0
- package/dist/repo.d.ts +36 -0
- package/dist/repo.js +116 -0
- package/dist/subgraph.d.ts +59 -0
- package/dist/subgraph.js +140 -0
- package/dist/text.d.ts +83 -0
- package/dist/text.js +187 -0
- package/dist/which.d.ts +1 -0
- package/dist/which.js +45 -0
- package/package.json +61 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { FootprintBody } from "./footprint.js";
|
|
2
|
+
import { type NameKey } from "./hmac.js";
|
|
3
|
+
export declare const OVERLAP_TIERS: readonly ["same-symbol", "depends", "same-file", "same-area", "transitive"];
|
|
4
|
+
export type OverlapTier = (typeof OVERLAP_TIERS)[number];
|
|
5
|
+
export type OverlapSeverity = "high" | "medium" | "low";
|
|
6
|
+
export type OverlapDirection = "both" | "mine-affects-theirs" | "theirs-affects-mine";
|
|
7
|
+
export interface OverlapPeer {
|
|
8
|
+
own: string;
|
|
9
|
+
sid: string;
|
|
10
|
+
ref: string;
|
|
11
|
+
address: string;
|
|
12
|
+
body: FootprintBody;
|
|
13
|
+
}
|
|
14
|
+
export interface Overlap {
|
|
15
|
+
peer: {
|
|
16
|
+
own: string;
|
|
17
|
+
sid: string;
|
|
18
|
+
ref: string;
|
|
19
|
+
address: string;
|
|
20
|
+
};
|
|
21
|
+
/** My actor ("main", "a1", …) and theirs. */
|
|
22
|
+
mine: string;
|
|
23
|
+
theirs: string;
|
|
24
|
+
tier: OverlapTier;
|
|
25
|
+
severity: OverlapSeverity;
|
|
26
|
+
direction: OverlapDirection;
|
|
27
|
+
/** The matched entry (compare keys: plain names, or h: tokens) and the ring relation. */
|
|
28
|
+
via: {
|
|
29
|
+
key: string;
|
|
30
|
+
rel?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Up to 3 matched entries in all. */
|
|
33
|
+
examples: number;
|
|
34
|
+
/** Whether the line names things (the peer's body is plain); a hashed overlap stays generic. */
|
|
35
|
+
named: boolean;
|
|
36
|
+
/** Changes when the overlap does: (peer user, tier, direction, matched entry). */
|
|
37
|
+
key: string;
|
|
38
|
+
/** For a model: one line, at most 240 characters, sanitized; no name the peer doesn't already hold. */
|
|
39
|
+
message: string;
|
|
40
|
+
/** For the person (a terminal): the same, with my own readable names. Never for a model. */
|
|
41
|
+
detail: string;
|
|
42
|
+
}
|
|
43
|
+
export interface OverlapInput {
|
|
44
|
+
/** My footprint: preferably with plain names (`detail` names things for the person); hashed works too. */
|
|
45
|
+
mine: FootprintBody;
|
|
46
|
+
peers: OverlapPeer[];
|
|
47
|
+
/** The repository's name key (needed when either side is hashed and the other plain). */
|
|
48
|
+
key?: NameKey;
|
|
49
|
+
/**
|
|
50
|
+
* Files my own status shares in the clear (repo-relative): a model line about a hashed overlap
|
|
51
|
+
* may name one of these, for a peer in `statusAudience` (who already sees that status).
|
|
52
|
+
*/
|
|
53
|
+
statusFiles?: readonly string[];
|
|
54
|
+
/** The users my session's status reaches (its roster audience, and my own userId). Default: none. */
|
|
55
|
+
statusAudience?: readonly string[];
|
|
56
|
+
/**
|
|
57
|
+
* How my session's published footprint names things (default: hashed). A peer's plain names
|
|
58
|
+
* appear in a model line only when mine are plain too (we chose readable names for this
|
|
59
|
+
* audience) and the peer is in my status audience. Otherwise a peer could publish guesses and
|
|
60
|
+
* read our model's confirmation.
|
|
61
|
+
*/
|
|
62
|
+
publishedNames?: "plain" | "hmac";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Overlaps with each peer, both ways. Different remotes, or a different key id (another root
|
|
66
|
+
* commit), are skipped. Sorted: severity, then key; one per key (the peer user, tier, direction
|
|
67
|
+
* and matched entry: not the peer's session or agent ids, which they choose).
|
|
68
|
+
*
|
|
69
|
+
* `message` is for a model: it names something only when the peer's own plain body holds the
|
|
70
|
+
* name (they have it), or a file my status already shares; a hashed overlap otherwise stays
|
|
71
|
+
* generic and says so. `detail` names things with my own readable names, for the person only.
|
|
72
|
+
*/
|
|
73
|
+
export declare function computeOverlaps(i: OverlapInput): {
|
|
74
|
+
overlaps: Overlap[];
|
|
75
|
+
skipped: {
|
|
76
|
+
peer: {
|
|
77
|
+
own: string;
|
|
78
|
+
sid: string;
|
|
79
|
+
address: string;
|
|
80
|
+
};
|
|
81
|
+
reason: string;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
package/dist/overlap.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// Copyright 2026 Ix Infrastructure Inc.
|
|
2
|
+
//
|
|
3
|
+
// Footprint overlap (SPEC.md §9): this session's footprint against each live
|
|
4
|
+
// peer session's, both ways, per pair of actors, in tiers:
|
|
5
|
+
//
|
|
6
|
+
// T1 same symbol both change it high
|
|
7
|
+
// T2 depends one changes what the other's change calls, medium (high when it calls
|
|
8
|
+
// uses or imports (ring 1), either way it and my risk is high+)
|
|
9
|
+
// T3 same file both edit it, no T1 medium
|
|
10
|
+
// T4 same area a shared region, no T1-T3 low
|
|
11
|
+
// T5 transitive two hops (ring 2), no T1-T4 low
|
|
12
|
+
//
|
|
13
|
+
// No Ix call: only the two bodies. Hashed names compare as tokens (both sides
|
|
14
|
+
// derive the same key from the repository); a plain side is hashed with that
|
|
15
|
+
// key first, so plain, hashed and mixed bodies all compare. A peer body is
|
|
16
|
+
// never shown: messages name only what this side knows (its own readable
|
|
17
|
+
// names, or a peer's plain names), sanitized and capped.
|
|
18
|
+
import { hashFile, hashRegion, hashSymbol } from "./hmac.js";
|
|
19
|
+
import { line } from "./text.js";
|
|
20
|
+
export const OVERLAP_TIERS = ["same-symbol", "depends", "same-file", "same-area", "transitive"];
|
|
21
|
+
const SEVERITY_RANK = { high: 3, medium: 2, low: 1 };
|
|
22
|
+
const TIER_LABEL = { "same-symbol": "same symbol", depends: "depends", "same-file": "same file", "same-area": "same area", transitive: "transitive" };
|
|
23
|
+
const REL_WORD = { call: "calls", use: "uses", import: "imports", test: "tests" };
|
|
24
|
+
function compareKey(kind, name, plain, mode) {
|
|
25
|
+
if (!plain)
|
|
26
|
+
return name; // already a token
|
|
27
|
+
if (!mode.tokens) {
|
|
28
|
+
if (kind === "f")
|
|
29
|
+
return name.toLowerCase();
|
|
30
|
+
if (kind === "s") {
|
|
31
|
+
const i = name.indexOf("#");
|
|
32
|
+
return `${name.slice(0, i).toLowerCase()}#${name.slice(i + 1)}`;
|
|
33
|
+
}
|
|
34
|
+
return name;
|
|
35
|
+
}
|
|
36
|
+
if (!mode.key)
|
|
37
|
+
return undefined;
|
|
38
|
+
return kind === "f" ? hashFile(mode.key, name) : kind === "s" ? hashSymbol(mode.key, name) : hashRegion(mode.key, name);
|
|
39
|
+
}
|
|
40
|
+
function side(a, plain, mode) {
|
|
41
|
+
const put = (m, kind, name, v) => {
|
|
42
|
+
const k = compareKey(kind, name, plain, mode);
|
|
43
|
+
if (k !== undefined && !m.has(k))
|
|
44
|
+
m.set(k, v);
|
|
45
|
+
};
|
|
46
|
+
const d = (n) => (plain ? n : undefined);
|
|
47
|
+
const s = {
|
|
48
|
+
a: a.a,
|
|
49
|
+
risk: a.risk,
|
|
50
|
+
wt: a.wt === true,
|
|
51
|
+
approx: a.stale === true || a.coarse === true,
|
|
52
|
+
changedSyms: new Map(),
|
|
53
|
+
changedFiles: new Map(),
|
|
54
|
+
ring1Syms: new Map(),
|
|
55
|
+
ring1Files: new Map(),
|
|
56
|
+
ring2: new Map(),
|
|
57
|
+
comps: new Map(),
|
|
58
|
+
};
|
|
59
|
+
for (const x of a.changed.symbols)
|
|
60
|
+
put(s.changedSyms, "s", x.k, d(x.k));
|
|
61
|
+
for (const x of a.changed.new ?? [])
|
|
62
|
+
put(s.changedSyms, "s", x, d(x));
|
|
63
|
+
for (const f of a.changed.files)
|
|
64
|
+
put(s.changedFiles, "f", f, d(f));
|
|
65
|
+
for (const x of a.ring1.symbols)
|
|
66
|
+
put(s.ring1Syms, "s", x.k, { d: d(x.k), rel: x.rel });
|
|
67
|
+
for (const x of a.ring1.files)
|
|
68
|
+
put(s.ring1Files, "f", x.f, { d: d(x.f), rel: x.rel });
|
|
69
|
+
for (const f of a.ring2?.files ?? [])
|
|
70
|
+
put(s.ring2, "f", f, d(f));
|
|
71
|
+
for (const c of a.components)
|
|
72
|
+
put(s.comps, "c", c.n, d(c.n));
|
|
73
|
+
return s;
|
|
74
|
+
}
|
|
75
|
+
const sortedHits = (a, b) => [...a.keys()]
|
|
76
|
+
.filter((k) => b.has(k))
|
|
77
|
+
.sort()
|
|
78
|
+
.map((k) => [k, b.get(k)]);
|
|
79
|
+
/** The overlaps between my actor `m` and their actor `t`, top tier per direction. */
|
|
80
|
+
function pair(m, t, n) {
|
|
81
|
+
const out = [];
|
|
82
|
+
// My readable name for a key (I know my names): for the person only (`detail`).
|
|
83
|
+
const mine = (k) => m.changedSyms.get(k) ?? m.changedFiles.get(k) ?? m.ring1Syms.get(k)?.d ?? m.ring1Files.get(k)?.d ?? m.ring2.get(k) ?? m.comps.get(k);
|
|
84
|
+
// Their name for a key, from their own (plain) body: they already have it, so a model line may say it.
|
|
85
|
+
const theirs = (k) => t.changedSyms.get(k) ?? t.changedFiles.get(k) ?? t.ring1Syms.get(k)?.d ?? t.ring1Files.get(k)?.d ?? t.ring2.get(k) ?? t.comps.get(k);
|
|
86
|
+
/**
|
|
87
|
+
* A name for the model's line. Only a name the peer's plain body holds (they have it already);
|
|
88
|
+
* otherwise generic, with the file only when my own status already shares it in the clear.
|
|
89
|
+
*/
|
|
90
|
+
const say = (k, generic) => {
|
|
91
|
+
const t0 = n.peerPlain ? theirs(k) : undefined;
|
|
92
|
+
if (t0)
|
|
93
|
+
return t0;
|
|
94
|
+
const my = mine(k);
|
|
95
|
+
const file = my ? (my.includes("#") ? my.slice(0, my.indexOf("#")) : my) : undefined;
|
|
96
|
+
return file && n.statusFiles.has(file.toLowerCase()) ? `${generic} in ${file}` : generic;
|
|
97
|
+
};
|
|
98
|
+
const hashed = n.peerPlain ? "" : " (hashed: names stay private)";
|
|
99
|
+
const det = (k, fallback) => mine(k) ?? theirs(k) ?? fallback;
|
|
100
|
+
// T1
|
|
101
|
+
const t1 = sortedHits(m.changedSyms, t.changedSyms);
|
|
102
|
+
if (t1.length) {
|
|
103
|
+
const k = t1[0][0];
|
|
104
|
+
out.push({ tier: "same-symbol", severity: "high", direction: "both", key: k, examples: Math.min(3, t1.length), text: `you both change ${say(k, "a symbol you are changing")}${hashed}`, detail: `you both change ${det(k, "the same symbol")}` });
|
|
105
|
+
}
|
|
106
|
+
// T2, mine affects theirs: they edit what depends on my change (in my ring 1).
|
|
107
|
+
const a2 = sortedHits(t.changedSyms, m.ring1Syms);
|
|
108
|
+
const a2f = a2.length ? [] : sortedHits(t.changedFiles, m.ring1Files);
|
|
109
|
+
const a2hit = a2[0] ?? a2f[0];
|
|
110
|
+
if (a2hit) {
|
|
111
|
+
const [k, v] = a2hit;
|
|
112
|
+
const high = v.rel === "call" && (m.risk === "high" || m.risk === "critical");
|
|
113
|
+
const rel = REL_WORD[v.rel] ?? "depends on";
|
|
114
|
+
out.push({ tier: "depends", severity: high ? "high" : "medium", direction: "mine-affects-theirs", key: k, rel: v.rel, examples: Math.min(3, a2.length + a2f.length), text: `your change affects ${say(k, "code")} they're editing (it ${rel} it)${hashed}`, detail: `your change affects ${det(k, "code")} they're editing (it ${rel} it)` });
|
|
115
|
+
}
|
|
116
|
+
// T2, theirs affects mine: I edit what depends on their change (in their ring 1).
|
|
117
|
+
const b2 = sortedHits(m.changedSyms, t.ring1Syms);
|
|
118
|
+
const b2f = b2.length ? [] : sortedHits(m.changedFiles, t.ring1Files);
|
|
119
|
+
const b2hit = b2[0] ?? b2f[0];
|
|
120
|
+
if (b2hit) {
|
|
121
|
+
const [k, v] = b2hit;
|
|
122
|
+
const high = v.rel === "call" && (t.risk === "high" || t.risk === "critical");
|
|
123
|
+
const rel = REL_WORD[v.rel] ?? "depends on";
|
|
124
|
+
out.push({ tier: "depends", severity: high ? "high" : "medium", direction: "theirs-affects-mine", key: k, rel: v.rel, examples: Math.min(3, b2.length + b2f.length), text: `their change affects ${say(k, "code")} you're editing (it ${rel} their change)${hashed}`, detail: `their change affects ${det(k, "code")} you're editing (it ${rel} their change)` });
|
|
125
|
+
}
|
|
126
|
+
// T3
|
|
127
|
+
if (!t1.length) {
|
|
128
|
+
const t3 = sortedHits(m.changedFiles, t.changedFiles);
|
|
129
|
+
if (t3.length) {
|
|
130
|
+
const k = t3[0][0];
|
|
131
|
+
out.push({ tier: "same-file", severity: "medium", direction: "both", key: k, examples: Math.min(3, t3.length), text: `you both edit ${say(k, "a file")} (different symbols)${hashed}`, detail: `you both edit ${det(k, "a file")} (different symbols)` });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// T4
|
|
135
|
+
if (!out.length) {
|
|
136
|
+
const t4 = sortedHits(m.comps, t.comps);
|
|
137
|
+
if (t4.length) {
|
|
138
|
+
const k = t4[0][0];
|
|
139
|
+
out.push({ tier: "same-area", severity: "low", direction: "both", key: k, examples: Math.min(3, t4.length), text: `you both work in ${n.peerPlain ? (theirs(k) ?? "the same area") : "the same area"}${hashed}`, detail: `you both work in ${det(k, "the same area")}` });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// T5
|
|
143
|
+
if (!out.length) {
|
|
144
|
+
const a5 = sortedHits(t.changedFiles, m.ring2);
|
|
145
|
+
if (a5.length)
|
|
146
|
+
out.push({ tier: "transitive", severity: "low", direction: "mine-affects-theirs", key: a5[0][0], examples: Math.min(3, a5.length), text: `your change may reach ${say(a5[0][0], "a file")} they're editing (two hops)${hashed}`, detail: `your change may reach ${det(a5[0][0], "a file")} they're editing (two hops)` });
|
|
147
|
+
const b5 = sortedHits(m.changedFiles, t.ring2);
|
|
148
|
+
if (b5.length)
|
|
149
|
+
out.push({ tier: "transitive", severity: "low", direction: "theirs-affects-mine", key: b5[0][0], examples: Math.min(3, b5.length), text: `their change may reach ${say(b5[0][0], "a file")} you're editing (two hops)${hashed}`, detail: `their change may reach ${det(b5[0][0], "a file")} you're editing (two hops)` });
|
|
150
|
+
}
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
/** One line, at most 240 characters: the modifiers stay whole, the description gives way (with "…"). */
|
|
154
|
+
function fit(head, text, tail) {
|
|
155
|
+
const room = Math.max(20, 240 - [...head].length - [...tail].length);
|
|
156
|
+
const t = line(text, 1000);
|
|
157
|
+
return line(`${head}${[...t].length > room ? `${[...t].slice(0, room - 1).join("")}…` : t}${tail}`, 240);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Overlaps with each peer, both ways. Different remotes, or a different key id (another root
|
|
161
|
+
* commit), are skipped. Sorted: severity, then key; one per key (the peer user, tier, direction
|
|
162
|
+
* and matched entry: not the peer's session or agent ids, which they choose).
|
|
163
|
+
*
|
|
164
|
+
* `message` is for a model: it names something only when the peer's own plain body holds the
|
|
165
|
+
* name (they have it), or a file my status already shares; a hashed overlap otherwise stays
|
|
166
|
+
* generic and says so. `detail` names things with my own readable names, for the person only.
|
|
167
|
+
*/
|
|
168
|
+
export function computeOverlaps(i) {
|
|
169
|
+
const overlaps = [];
|
|
170
|
+
const skipped = [];
|
|
171
|
+
const statusFiles = new Set((i.statusFiles ?? []).map((f) => f.toLowerCase()));
|
|
172
|
+
const audience = new Set(i.statusAudience ?? []);
|
|
173
|
+
const published = i.publishedNames ?? "hmac";
|
|
174
|
+
for (const p of i.peers) {
|
|
175
|
+
const who = { own: p.own, sid: p.sid, address: p.address };
|
|
176
|
+
if (p.body.repo.remote !== i.mine.repo.remote) {
|
|
177
|
+
skipped.push({ peer: who, reason: "another repository" });
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const tokens = i.mine.names === "hmac" || p.body.names === "hmac";
|
|
181
|
+
const keyIds = [i.mine.keyId, p.body.keyId, i.key?.keyId].filter((x) => !!x);
|
|
182
|
+
if (tokens && new Set(keyIds).size > 1) {
|
|
183
|
+
skipped.push({ peer: who, reason: "another repository key (a fork, or another root commit)" });
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const mixed = tokens && (i.mine.names === "plain" || p.body.names === "plain");
|
|
187
|
+
if (mixed && !i.key) {
|
|
188
|
+
skipped.push({ peer: who, reason: "no repository key to compare hashed names" });
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const mode = { tokens, ...(i.key ? { key: i.key } : {}) };
|
|
192
|
+
// Names in a model line: only when both sides chose readable names (theirs, and our published
|
|
193
|
+
// body), and status files only for someone our status reaches.
|
|
194
|
+
const naming = { peerPlain: p.body.names === "plain" && published === "plain" && audience.has(p.own), statusFiles: audience.has(p.own) ? statusFiles : new Set() };
|
|
195
|
+
const mySides = i.mine.actors.map((a) => side(a, i.mine.names === "plain", mode));
|
|
196
|
+
const theirSides = p.body.actors.map((a) => side(a, p.body.names === "plain", mode));
|
|
197
|
+
const branch = p.body.repo.branch && i.mine.repo.branch && p.body.repo.branch !== i.mine.repo.branch ? p.body.repo.branch : undefined;
|
|
198
|
+
for (const m of mySides) {
|
|
199
|
+
for (const t of theirSides) {
|
|
200
|
+
for (const f of pair(m, t, naming)) {
|
|
201
|
+
// Their agent by id only: a task line is theirs to write, and stays out of the model's line.
|
|
202
|
+
const agent = t.a === "main" ? "" : ` [agent ${t.a}${t.wt ? ", worktree" : ""}]`;
|
|
203
|
+
const mods = [m.a !== "main" ? `your agent ${m.a}` : "", m.wt || t.wt ? "unmerged, agent worktree" : "", branch && naming.peerPlain ? `on branch ${line(branch, 60)}` : "", m.approx || t.approx ? "approximate" : ""].filter(Boolean);
|
|
204
|
+
const head = `POSSIBLE CONFLICT (${f.severity}, ${TIER_LABEL[f.tier]}) with ${line(p.address, 80)}${agent}: `;
|
|
205
|
+
const tail = mods.length ? ` (${mods.join("; ")})` : "";
|
|
206
|
+
overlaps.push({
|
|
207
|
+
peer: { own: p.own, sid: p.sid, ref: p.ref, address: p.address },
|
|
208
|
+
mine: m.a,
|
|
209
|
+
theirs: t.a,
|
|
210
|
+
tier: f.tier,
|
|
211
|
+
severity: f.severity,
|
|
212
|
+
direction: f.direction,
|
|
213
|
+
via: { key: f.key, ...(f.rel ? { rel: f.rel } : {}) },
|
|
214
|
+
examples: f.examples,
|
|
215
|
+
named: naming.peerPlain,
|
|
216
|
+
key: JSON.stringify([p.own, f.tier, f.direction, f.key]),
|
|
217
|
+
message: fit(head, f.text, tail),
|
|
218
|
+
detail: fit(head, f.detail, tail),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
overlaps.sort((x, y) => SEVERITY_RANK[y.severity] - SEVERITY_RANK[x.severity] || (x.key < y.key ? -1 : x.key > y.key ? 1 : 0));
|
|
225
|
+
const seen = new Set();
|
|
226
|
+
return { overlaps: overlaps.filter((o) => !seen.has(o.key) && seen.add(o.key)), skipped };
|
|
227
|
+
}
|
package/dist/repo.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface RepoRef {
|
|
2
|
+
/** "github.com/ix-infrastructure/peer2peer". */
|
|
3
|
+
remote: string;
|
|
4
|
+
/** A commit id (7-64 hex). */
|
|
5
|
+
rev?: string;
|
|
6
|
+
branch?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* "https://user:tok@GitHub.com:443/Org/Repo.git", "git@github.com:org/repo",
|
|
10
|
+
* "ssh://git@host/org/repo" → "github.com/org/repo". Undefined when it isn't a
|
|
11
|
+
* remote (a local path, a file:// URL).
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeRemote(url: string): string | undefined;
|
|
14
|
+
export declare function parseRepo(v: unknown, what: string): RepoRef;
|
|
15
|
+
/**
|
|
16
|
+
* Runs git (resolved from PATH's absolute entries: never a git planted in the
|
|
17
|
+
* repo, the cwd) and returns its stdout, or undefined on any failure.
|
|
18
|
+
*/
|
|
19
|
+
export declare function gitOut(cwd: string, args: string[], env?: NodeJS.ProcessEnv, opts?: {
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
maxBuffer?: number;
|
|
22
|
+
trim?: boolean;
|
|
23
|
+
}): Promise<string | undefined>;
|
|
24
|
+
export declare function gitEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
25
|
+
export interface LocalRepo {
|
|
26
|
+
/** The working tree's root (absolute: local use only, never sent). */
|
|
27
|
+
root?: string;
|
|
28
|
+
ref?: RepoRef;
|
|
29
|
+
}
|
|
30
|
+
/** The repo `cwd` is in: its root, normalized origin remote, HEAD and branch. */
|
|
31
|
+
export declare function localRepo(cwd: string, env?: NodeJS.ProcessEnv): Promise<LocalRepo>;
|
|
32
|
+
/** How a received repo reference compares with the local checkout. */
|
|
33
|
+
export declare function compareRepo(theirs: RepoRef, mine: RepoRef | undefined): {
|
|
34
|
+
sameRepo: boolean;
|
|
35
|
+
sameRev?: boolean;
|
|
36
|
+
};
|
package/dist/repo.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Copyright 2026 Ix Infrastructure Inc.
|
|
2
|
+
//
|
|
3
|
+
// Repository identity: how a sender says "this repo at this revision" so the
|
|
4
|
+
// receiver's Ix can find the same code in its own graph, without leaking a
|
|
5
|
+
// local path. A repo is named by its normalized remote ("host/owner/name":
|
|
6
|
+
// no scheme, no user or token, no port, no ".git", lower case), never by a
|
|
7
|
+
// directory.
|
|
8
|
+
import { execFile } from "node:child_process";
|
|
9
|
+
import { whichAbsolute } from "./which.js";
|
|
10
|
+
import { fail, isObj, LIMITS, optStr, str } from "./text.js";
|
|
11
|
+
const REMOTE_RE = /^[a-z0-9.-]+(?:\/[a-z0-9._~-]+){1,8}$/;
|
|
12
|
+
const REV_RE = /^[0-9a-f]{7,64}$/;
|
|
13
|
+
const BRANCH_RE = /^[A-Za-z0-9._/+@-]{1,128}$/;
|
|
14
|
+
/**
|
|
15
|
+
* "https://user:tok@GitHub.com:443/Org/Repo.git", "git@github.com:org/repo",
|
|
16
|
+
* "ssh://git@host/org/repo" → "github.com/org/repo". Undefined when it isn't a
|
|
17
|
+
* remote (a local path, a file:// URL).
|
|
18
|
+
*/
|
|
19
|
+
export function normalizeRemote(url) {
|
|
20
|
+
let s = url.trim();
|
|
21
|
+
if (s === "" || s.startsWith("/") || s.startsWith(".") || /^file:/i.test(s) || /^[A-Za-z]:[\\/]/.test(s))
|
|
22
|
+
return undefined;
|
|
23
|
+
let host;
|
|
24
|
+
let path;
|
|
25
|
+
const scp = /^(?:[^@/\s]+@)?([^:/\s]+):(?!\/)(.+)$/.exec(s);
|
|
26
|
+
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(s) && scp) {
|
|
27
|
+
host = scp[1];
|
|
28
|
+
path = scp[2];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
let u;
|
|
32
|
+
try {
|
|
33
|
+
u = new URL(s);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
if (u.protocol === "file:")
|
|
39
|
+
return undefined;
|
|
40
|
+
host = u.hostname;
|
|
41
|
+
path = u.pathname;
|
|
42
|
+
}
|
|
43
|
+
s = `${host}/${path}`
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.replace(/\/+/g, "/")
|
|
46
|
+
.replace(/\/$/, "")
|
|
47
|
+
.replace(/\.git$/, "");
|
|
48
|
+
return REMOTE_RE.test(s) ? s : undefined;
|
|
49
|
+
}
|
|
50
|
+
export function parseRepo(v, what) {
|
|
51
|
+
if (!isObj(v))
|
|
52
|
+
return fail(`${what} must be an object`);
|
|
53
|
+
const o = v;
|
|
54
|
+
const remote = str(o, "remote", LIMITS.remote, what);
|
|
55
|
+
if (!REMOTE_RE.test(remote))
|
|
56
|
+
fail(`${what}.remote must be a normalized remote (host/owner/name)`);
|
|
57
|
+
const rev = optStr(o, "rev", 64, what);
|
|
58
|
+
if (rev !== undefined && !REV_RE.test(rev))
|
|
59
|
+
fail(`${what}.rev must be a commit id`);
|
|
60
|
+
const branch = optStr(o, "branch", LIMITS.branch, what);
|
|
61
|
+
if (branch !== undefined && !BRANCH_RE.test(branch))
|
|
62
|
+
fail(`${what}.branch has characters a branch can't`);
|
|
63
|
+
return { remote, ...(rev ? { rev } : {}), ...(branch ? { branch } : {}) };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Runs git (resolved from PATH's absolute entries: never a git planted in the
|
|
67
|
+
* repo, the cwd) and returns its stdout, or undefined on any failure.
|
|
68
|
+
*/
|
|
69
|
+
export function gitOut(cwd, args, env, opts = {}) {
|
|
70
|
+
const bin = whichAbsolute("git", env ?? process.env);
|
|
71
|
+
if (!bin)
|
|
72
|
+
return Promise.resolve(undefined);
|
|
73
|
+
// The repository is the agent's to write: none of its config may run anything (an fsmonitor or
|
|
74
|
+
// hook program, an external diff), and git gets only what it needs from the environment, never
|
|
75
|
+
// a secret of p2p's (packages/p2p/src/projects.ts: the person token).
|
|
76
|
+
const safeArgs = ["-c", "core.fsmonitor=false", "-c", `core.hooksPath=${process.platform === "win32" ? "NUL" : "/dev/null"}`, "-c", "diff.external=", "-c", "core.sshCommand=false", ...args];
|
|
77
|
+
return new Promise((resolve) => {
|
|
78
|
+
execFile(bin, safeArgs, { cwd, timeout: opts.timeoutMs ?? 5000, killSignal: "SIGKILL", maxBuffer: opts.maxBuffer ?? 1 << 20, env: gitEnv(env ?? process.env), windowsHide: true }, (err, stdout) => resolve(err ? undefined : opts.trim === false ? stdout : stdout.trim()));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const git = (cwd, args, env) => gitOut(cwd, args, env);
|
|
82
|
+
/** What git may see of the environment: where it lives, its home and temp, the locale and the user's own git config choice. */
|
|
83
|
+
const GIT_ENV_KEYS = ["PATH", "HOME", "USERPROFILE", "SystemRoot", "TMPDIR", "TEMP", "TMP", "LANG", "LC_ALL", "LC_CTYPE", "GIT_CONFIG_GLOBAL", "GIT_CONFIG_SYSTEM", "GIT_CONFIG_NOSYSTEM"];
|
|
84
|
+
export function gitEnv(env) {
|
|
85
|
+
const out = {};
|
|
86
|
+
for (const k of GIT_ENV_KEYS)
|
|
87
|
+
if (typeof env[k] === "string")
|
|
88
|
+
out[k] = env[k];
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
/** The repo `cwd` is in: its root, normalized origin remote, HEAD and branch. */
|
|
92
|
+
export async function localRepo(cwd, env) {
|
|
93
|
+
const root = await git(cwd, ["rev-parse", "--show-toplevel"], env);
|
|
94
|
+
if (!root)
|
|
95
|
+
return {};
|
|
96
|
+
const url = await git(cwd, ["remote", "get-url", "origin"], env);
|
|
97
|
+
const remote = url ? normalizeRemote(url) : undefined;
|
|
98
|
+
const rev = await git(cwd, ["rev-parse", "HEAD"], env);
|
|
99
|
+
const branch = await git(cwd, ["rev-parse", "--abbrev-ref", "HEAD"], env);
|
|
100
|
+
if (!remote)
|
|
101
|
+
return { root };
|
|
102
|
+
return {
|
|
103
|
+
root,
|
|
104
|
+
ref: { remote, ...(rev && REV_RE.test(rev) ? { rev } : {}), ...(branch && branch !== "HEAD" && BRANCH_RE.test(branch) ? { branch } : {}) },
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** How a received repo reference compares with the local checkout. */
|
|
108
|
+
export function compareRepo(theirs, mine) {
|
|
109
|
+
if (!mine)
|
|
110
|
+
return { sameRepo: false };
|
|
111
|
+
const sameRepo = theirs.remote === mine.remote;
|
|
112
|
+
if (!sameRepo || !theirs.rev || !mine.rev)
|
|
113
|
+
return { sameRepo };
|
|
114
|
+
const n = Math.min(theirs.rev.length, mine.rev.length);
|
|
115
|
+
return { sameRepo, sameRev: theirs.rev.slice(0, n) === mine.rev.slice(0, n) };
|
|
116
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type RepoRef } from "./repo.js";
|
|
2
|
+
import { type Roots } from "./text.js";
|
|
3
|
+
export declare const SUBGRAPH_KIND: "x:ix.subgraph";
|
|
4
|
+
export type Selector =
|
|
5
|
+
/** A file, a directory, or a directory glob ("auth/*", "auth/**"), repo-relative. */
|
|
6
|
+
{
|
|
7
|
+
type: "path";
|
|
8
|
+
pattern: string;
|
|
9
|
+
}
|
|
10
|
+
/** A named entity (function, class, …), optionally narrowed by kind and a path substring. */
|
|
11
|
+
| {
|
|
12
|
+
type: "symbol";
|
|
13
|
+
name: string;
|
|
14
|
+
kind?: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A region of Ix's architecture map (`ix subsystems`). */
|
|
18
|
+
| {
|
|
19
|
+
type: "region";
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
export interface SubgraphBody {
|
|
23
|
+
repo: RepoRef;
|
|
24
|
+
selector: Selector;
|
|
25
|
+
title?: string;
|
|
26
|
+
/** Why the sender wants them to look (free text). */
|
|
27
|
+
why?: string;
|
|
28
|
+
/** The sender's Ix graph revision (informational). */
|
|
29
|
+
graphRev?: number;
|
|
30
|
+
}
|
|
31
|
+
/** "auth/*" → {prefix: "auth", glob: "*"}; a plain path → {prefix: path}. Undefined when invalid. */
|
|
32
|
+
export declare function splitPattern(p: string): {
|
|
33
|
+
prefix: string;
|
|
34
|
+
glob?: "*" | "**";
|
|
35
|
+
} | undefined;
|
|
36
|
+
export declare function parseSelector(v: unknown): Selector;
|
|
37
|
+
export declare function parseSubgraphBody(v: unknown): SubgraphBody;
|
|
38
|
+
export declare function describeSelector(s: Selector): string;
|
|
39
|
+
export declare function subgraphFallback(b: SubgraphBody): string;
|
|
40
|
+
export interface SubgraphInput {
|
|
41
|
+
repo: RepoRef | undefined;
|
|
42
|
+
selector: Selector;
|
|
43
|
+
title?: string;
|
|
44
|
+
why?: string;
|
|
45
|
+
graphRev?: number;
|
|
46
|
+
/** For scrubbing title and why (never sent). */
|
|
47
|
+
root?: Roots;
|
|
48
|
+
home?: string;
|
|
49
|
+
hostname?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function buildSubgraph(i: SubgraphInput): {
|
|
52
|
+
body: SubgraphBody;
|
|
53
|
+
fallback: string;
|
|
54
|
+
};
|
|
55
|
+
/** The receiver's own `ix` argv for a selector (validated: no element can be read as an option). */
|
|
56
|
+
export declare function resolveArgv(s: Selector, limit?: number): string[];
|
|
57
|
+
export declare function renderSubgraph(b: SubgraphBody, from: {
|
|
58
|
+
address: string;
|
|
59
|
+
}, mine?: RepoRef): Record<string, unknown>;
|
package/dist/subgraph.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Copyright 2026 Ix Infrastructure Inc.
|
|
2
|
+
//
|
|
3
|
+
// x:ix.subgraph: a reference to part of the sender's graph ("look at auth/*
|
|
4
|
+
// in my graph", SPEC.md §4). It carries only what the receiver's Ix needs to
|
|
5
|
+
// find the same part of the same repo in its own graph: the repo's
|
|
6
|
+
// normalized remote, a revision, and a selector. It carries no graph content
|
|
7
|
+
// and no local path; the sender's Ix isn't even run.
|
|
8
|
+
//
|
|
9
|
+
// Resolving it is something the receiving user starts (`p2p ix resolve`),
|
|
10
|
+
// never the peer: the selector becomes a fixed, validated argv for the
|
|
11
|
+
// receiver's own `ix`.
|
|
12
|
+
import { compareRepo, parseRepo } from "./repo.js";
|
|
13
|
+
import { cps, fail, frame, scrubPaths, isObj, jsonBytes, LIMITS, line, MAX_BODY_BYTES, optInt, optStr, str } from "./text.js";
|
|
14
|
+
import { isSafeRelativePath } from "@peer2peer/core/v3";
|
|
15
|
+
export const SUBGRAPH_KIND = "x:ix.subgraph";
|
|
16
|
+
// Strict patterns: what a peer can make the receiver's `ix` see is exactly these.
|
|
17
|
+
const PATH_SEG = /^[A-Za-z0-9._@+-][A-Za-z0-9._@+ -]*$/;
|
|
18
|
+
const SYMBOL_RE = /^[A-Za-z_$][A-Za-z0-9_$.:#]{0,199}$/;
|
|
19
|
+
const KIND_RE = /^[a-z][a-z_]{0,31}$/;
|
|
20
|
+
const REGION_RE = /^[A-Za-z0-9][A-Za-z0-9 ._/-]{0,127}$/;
|
|
21
|
+
/** "auth/*" → {prefix: "auth", glob: "*"}; a plain path → {prefix: path}. Undefined when invalid. */
|
|
22
|
+
export function splitPattern(p) {
|
|
23
|
+
if (cps(p) > LIMITS.path || p.startsWith("-"))
|
|
24
|
+
return undefined;
|
|
25
|
+
const m = /^(.*?)(?:\/(\*\*?))?$/.exec(p);
|
|
26
|
+
const prefix = (m?.[1] ?? "").replace(/\/+$/, "");
|
|
27
|
+
const glob = m?.[2];
|
|
28
|
+
if (prefix === "" || !isSafeRelativePath(prefix) || !prefix.split("/").every((s) => PATH_SEG.test(s)))
|
|
29
|
+
return undefined;
|
|
30
|
+
return { prefix, ...(glob ? { glob } : {}) };
|
|
31
|
+
}
|
|
32
|
+
export function parseSelector(v) {
|
|
33
|
+
if (!isObj(v))
|
|
34
|
+
return fail("subgraph.selector must be an object");
|
|
35
|
+
const o = v;
|
|
36
|
+
switch (o.type) {
|
|
37
|
+
case "path": {
|
|
38
|
+
const pattern = str(o, "pattern", LIMITS.path, "selector");
|
|
39
|
+
if (!splitPattern(pattern))
|
|
40
|
+
fail("selector.pattern must be a repo-relative path, optionally ending in /* or /**");
|
|
41
|
+
return { type: "path", pattern };
|
|
42
|
+
}
|
|
43
|
+
case "symbol": {
|
|
44
|
+
const name = str(o, "name", LIMITS.symbol, "selector");
|
|
45
|
+
if (!SYMBOL_RE.test(name))
|
|
46
|
+
fail("selector.name must be an identifier (letters, digits, _ $ . : #)");
|
|
47
|
+
const kind = optStr(o, "kind", LIMITS.kind, "selector");
|
|
48
|
+
if (kind !== undefined && !KIND_RE.test(kind))
|
|
49
|
+
fail("selector.kind must be a lowercase entity kind");
|
|
50
|
+
const path = optStr(o, "path", LIMITS.path, "selector");
|
|
51
|
+
if (path !== undefined && !splitPattern(path))
|
|
52
|
+
fail("selector.path must be a repo-relative path");
|
|
53
|
+
return { type: "symbol", name, ...(kind ? { kind } : {}), ...(path ? { path } : {}) };
|
|
54
|
+
}
|
|
55
|
+
case "region": {
|
|
56
|
+
const name = str(o, "name", LIMITS.region, "selector");
|
|
57
|
+
// L6: Ix sends --target to its backend as a region-name query (`getSubsystemMap({target})`), not a
|
|
58
|
+
// path; still, nothing path-like: no "..", "//" or "./" segments.
|
|
59
|
+
if (!REGION_RE.test(name) || name.split("/").some((seg) => /^\s*\.{1,2}\s*$/.test(seg)) || name.includes("//"))
|
|
60
|
+
fail("selector.name must be a region name");
|
|
61
|
+
return { type: "region", name };
|
|
62
|
+
}
|
|
63
|
+
default:
|
|
64
|
+
return fail("selector.type must be path, symbol or region");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function parseSubgraphBody(v) {
|
|
68
|
+
if (!isObj(v))
|
|
69
|
+
return fail("subgraph body must be an object");
|
|
70
|
+
const o = v;
|
|
71
|
+
if (jsonBytes(o) > MAX_BODY_BYTES)
|
|
72
|
+
fail(`subgraph body is larger than ${MAX_BODY_BYTES} bytes`);
|
|
73
|
+
const repo = parseRepo(o.repo, "subgraph.repo");
|
|
74
|
+
const selector = parseSelector(o.selector);
|
|
75
|
+
const title = optStr(o, "title", LIMITS.title, "subgraph");
|
|
76
|
+
const why = optStr(o, "why", LIMITS.why, "subgraph");
|
|
77
|
+
const graphRev = optInt(o, "graphRev", "subgraph");
|
|
78
|
+
return { repo, selector, ...(title ? { title } : {}), ...(why ? { why } : {}), ...(graphRev !== undefined ? { graphRev } : {}) };
|
|
79
|
+
}
|
|
80
|
+
export function describeSelector(s) {
|
|
81
|
+
if (s.type === "path")
|
|
82
|
+
return s.pattern;
|
|
83
|
+
if (s.type === "symbol")
|
|
84
|
+
return `${s.kind ? `${s.kind} ` : ""}${s.name}${s.path ? ` in ${s.path}` : ""}`;
|
|
85
|
+
return `region ${s.name}`;
|
|
86
|
+
}
|
|
87
|
+
export function subgraphFallback(b) {
|
|
88
|
+
const what = line(describeSelector(b.selector), 60);
|
|
89
|
+
return `shared an Ix subgraph (${what}): install Ix to open it: https://github.com/ix-infrastructure/Ix`.slice(0, 200);
|
|
90
|
+
}
|
|
91
|
+
export function buildSubgraph(i) {
|
|
92
|
+
if (!i.repo)
|
|
93
|
+
fail("not in a git repository with an `origin` remote: a subgraph reference names the repo (or pass --remote)");
|
|
94
|
+
const scrub = (t) => scrubPaths(t, { root: i.root, home: i.home, hostname: i.hostname });
|
|
95
|
+
const body = parseSubgraphBody({ repo: i.repo, selector: i.selector, ...(i.title ? { title: scrub(i.title) } : {}), ...(i.why ? { why: scrub(i.why) } : {}), ...(i.graphRev !== undefined ? { graphRev: i.graphRev } : {}) });
|
|
96
|
+
return { body, fallback: subgraphFallback(body) };
|
|
97
|
+
}
|
|
98
|
+
/** The receiver's own `ix` argv for a selector (validated: no element can be read as an option). */
|
|
99
|
+
export function resolveArgv(s, limit = 100) {
|
|
100
|
+
let argv;
|
|
101
|
+
if (s.type === "path") {
|
|
102
|
+
const sp = splitPattern(s.pattern);
|
|
103
|
+
if (!sp)
|
|
104
|
+
return fail("bad selector");
|
|
105
|
+
// A glob or a directory-looking path lists files under it; a file gets its structural overview.
|
|
106
|
+
const looksLikeFile = !sp.glob && /\.[A-Za-z0-9]{1,8}$/.test(sp.prefix);
|
|
107
|
+
argv = looksLikeFile ? ["overview", sp.prefix, "--format", "llm"] : ["inventory", "--kind", "file", "--path", `${sp.prefix}/`, "--format", "llm", "--limit", String(limit)];
|
|
108
|
+
}
|
|
109
|
+
else if (s.type === "symbol") {
|
|
110
|
+
argv = ["context", s.name, "--format", "llm", ...(s.kind ? ["--kind", s.kind] : []), ...(s.path ? ["--path", s.path] : [])];
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
argv = ["subsystems", "--target", s.name, "--format", "llm"];
|
|
114
|
+
}
|
|
115
|
+
// Belt and braces: the patterns above never allow a leading "-".
|
|
116
|
+
for (const a of argv.slice(1))
|
|
117
|
+
if (a.startsWith("-") && !/^--[a-z]+$/.test(a))
|
|
118
|
+
fail("refusing an argument that looks like an option");
|
|
119
|
+
return argv;
|
|
120
|
+
}
|
|
121
|
+
export function renderSubgraph(b, from, mine) {
|
|
122
|
+
const where = describeSelector(b.selector);
|
|
123
|
+
const cmp = compareRepo(b.repo, mine);
|
|
124
|
+
const repoNote = mine === undefined ? "" : !cmp.sameRepo ? " (not the repo this session is in)" : cmp.sameRev === false ? " (same repo, another revision)" : "";
|
|
125
|
+
const parts = [
|
|
126
|
+
`look at ${line(where, 200)} in ${line(b.repo.remote, LIMITS.remote)}${b.repo.rev ? `@${b.repo.rev.slice(0, 12)}` : ""}${repoNote}`,
|
|
127
|
+
b.title ? `"${line(b.title, LIMITS.title)}"` : undefined,
|
|
128
|
+
b.why ? `why: ${line(b.why, LIMITS.why)}` : undefined,
|
|
129
|
+
].filter(Boolean);
|
|
130
|
+
return {
|
|
131
|
+
type: "subgraph",
|
|
132
|
+
repo: b.repo,
|
|
133
|
+
selector: b.selector,
|
|
134
|
+
...(b.title ? { title: line(b.title, LIMITS.title) } : {}),
|
|
135
|
+
...(b.why ? { why: line(b.why, LIMITS.why) } : {}),
|
|
136
|
+
...(mine !== undefined ? { sameRepo: cmp.sameRepo, ...(cmp.sameRev !== undefined ? { sameRev: cmp.sameRev } : {}) } : {}),
|
|
137
|
+
digest: frame(from.address, "Ix subgraph reference", parts.join("; ")),
|
|
138
|
+
consent: "Nothing was run. The user opens it in their own graph with `p2p ix resolve <event id>`.",
|
|
139
|
+
};
|
|
140
|
+
}
|