@peer2peer/ext-ix 0.1.1 → 0.1.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/README.md +5 -5
- package/dist/extension.d.ts +1 -1
- package/dist/extension.js +1 -1
- package/dist/subgraph.js +2 -2
- package/dist/text.d.ts +2 -0
- package/dist/text.js +8 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -8,25 +8,25 @@ Share what your Ix graph knows with the agent sessions you work with:
|
|
|
8
8
|
- **Footprints** (`x:ix.footprint`, a state kind): this session's footprint from your local Ix, per agent: the symbols changed (from `git diff` hunks), the code one hop downstream (ring 1; ring 2 optional) and the regions involved. Published to the session's status audience only, kept by peers as the session's latest value, never an event and never shown to a model. File, symbol and region names are hashed by default for every audience, and overlaps still work (both sides derive the same key from the repository); readable names are opt-in per circle with `p2p ix config --circle <cid> names=plain` (SPEC §8.6 says exactly what hashing hides and what it doesn't).
|
|
9
9
|
- **Semantic conflicts**: two live sessions whose changes touch *connected* files (per your Ix graph), not just the same file.
|
|
10
10
|
|
|
11
|
-
A peer without this extension sees a one-line fallback, such as "alice@…: shared an Ix subgraph (auth/*): install Ix to open it". The kinds are specified in [SPEC.md](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.
|
|
11
|
+
A peer without this extension sees a one-line fallback, such as "alice@…: shared an Ix subgraph (auth/*): install Ix to open it". The kinds are specified in [SPEC.md](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.2/packages/ext-ix/SPEC.md).
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```
|
|
16
16
|
npm i -g @peer2peer/cli @peer2peer/ext-ix # side by side: p2p can find it
|
|
17
17
|
p2p extensions enable ix # opt in (writes config.json; or P2P_EXTENSIONS=ix)
|
|
18
|
-
p2p extensions # → @peer2peer/ext-ix 0.1.
|
|
18
|
+
p2p extensions # → @peer2peer/ext-ix 0.1.2 (x:ix.*)
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
**Trust:** an extension runs inside `p2p` with your identity (it can read `~/.p2p` and your keys). Enable it only if you trust where it came from. `p2p` announces the first load from each new location.
|
|
22
22
|
|
|
23
23
|
Ix itself comes from https://github.com/ix-infrastructure/Ix. Previewing what peers send needs only this package. Sending an impact report, resolving a reference, importing a note and conflict detection run your local `ix`. Notes use `ix note`. ext-ix runs it only against your **local** graph, and only when it is the open-source one (Ix after 0.13.0, without Ix Pro), which writes to the local backend. With Ix Pro installed, its `ix note` writes to your cloud org, so `import` and `note --ix-note` answer `graph_target`. With an older Ix, they answer `graph_target` too, and say to upgrade.
|
|
24
24
|
|
|
25
|
-
**Graph memory:** with an open-source `ix note`, `p2p watch` writes your own sessions in shared projects into your local graph as they run: a session record, status lines and the files edited, framed as untrusted records. It writes only to a port your own process holds. **Docker on Linux:** `ix docker start` publishes the port through Docker's proxy, which runs as root, so p2p refuses it until you set `"ixTrustRootListener": true` in p2p's config.json by hand. Do that only if this machine's Docker is yours alone. On a machine other people log in to, turn graph memory off. Background writes also move Ix's `-` shorthand (the last note or session you showed or created, `<IX_HOME>/recent.json`) to graph memory's latest, so after a few seconds `ix note show -` may name a Peer2Peer record instead of your own last note. It never writes peers' content or message bodies, and it runs off the hook path, best effort. `"ixMemory": false` in config.json turns it off. See [SPEC.md §10](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.
|
|
25
|
+
**Graph memory:** with an open-source `ix note`, `p2p watch` writes your own sessions in shared projects into your local graph as they run: a session record, status lines and the files edited, framed as untrusted records. It writes only to a port your own process holds. **Docker on Linux:** `ix docker start` publishes the port through Docker's proxy, which runs as root, so p2p refuses it until you set `"ixTrustRootListener": true` in p2p's config.json by hand. Do that only if this machine's Docker is yours alone. On a machine other people log in to, turn graph memory off. Background writes also move Ix's `-` shorthand (the last note or session you showed or created, `<IX_HOME>/recent.json`) to graph memory's latest, so after a few seconds `ix note show -` may name a Peer2Peer record instead of your own last note. It never writes peers' content or message bodies, and it runs off the hook path, best effort. `"ixMemory": false` in config.json turns it off. See [SPEC.md §10](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.2/packages/ext-ix/SPEC.md#10-graph-memory-the-users-own-sessions-in-the-local-graph).
|
|
26
26
|
|
|
27
|
-
**Graph targets:** every `ix` call takes its endpoint only from `p2p`'s chokepoint (`ExtContext.graphTarget`): a private project, or a session bound to one, is local only. `ix` runs with an allowlisted environment and `IX_ENDPOINT` pinned to that target, so an `IX_ENDPOINT`, `IX_PAT` or Ix Pro login in your shell never sends a private project to the cloud. See [SPEC.md §2.1](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.
|
|
27
|
+
**Graph targets:** every `ix` call takes its endpoint only from `p2p`'s chokepoint (`ExtContext.graphTarget`): a private project, or a session bound to one, is local only. `ix` runs with an allowlisted environment and `IX_ENDPOINT` pinned to that target, so an `IX_ENDPOINT`, `IX_PAT` or Ix Pro login in your shell never sends a private project to the cloud. See [SPEC.md §2.1](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.2/packages/ext-ix/SPEC.md#21-graph-targets).
|
|
28
28
|
|
|
29
|
-
You can also point `P2P_EXTENSION_PATH` at a directory whose `node_modules` holds it. Nothing else is searched: no parent directories, `NODE_PATH` or global folders. How `p2p` loads extensions is described in [packages/p2p/README.md](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.
|
|
29
|
+
You can also point `P2P_EXTENSION_PATH` at a directory whose `node_modules` holds it. Nothing else is searched: no parent directories, `NODE_PATH` or global folders. How `p2p` loads extensions is described in [packages/p2p/README.md](https://github.com/ix-infrastructure/Peer2Peer/blob/v0.1.2/packages/p2p/README.md#extensions).
|
|
30
30
|
|
|
31
31
|
## Commands
|
|
32
32
|
|
package/dist/extension.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type IxRunner, type TargetFn } from "./ix.js";
|
|
|
3
3
|
import { type ListenerCheck } from "./listener.js";
|
|
4
4
|
import { type NoteBody } from "./note.js";
|
|
5
5
|
import { type RepoRef } from "./repo.js";
|
|
6
|
-
export declare const VERSION = "0.1.
|
|
6
|
+
export declare const VERSION = "0.1.2";
|
|
7
7
|
export declare const KINDS: readonly ["x:ix.note", "x:ix.subgraph", "x:ix.impact"];
|
|
8
8
|
/** Cap on local Ix output a command hands back (resolve). */
|
|
9
9
|
export declare const MAX_RESOLVE_OUTPUT: number;
|
package/dist/extension.js
CHANGED
|
@@ -29,7 +29,7 @@ import { buildNote, NOTE_KIND, parseNoteBody, renderNote } from "./note.js";
|
|
|
29
29
|
import { compareRepo, localRepo, normalizeRemote } from "./repo.js";
|
|
30
30
|
import { buildSubgraph, describeSelector, parseSubgraphBody, renderSubgraph, resolveArgv, SUBGRAPH_KIND } from "./subgraph.js";
|
|
31
31
|
import { frame, InvalidBody, IxExtError, line, NOTE_TAGS, SPEC_VERSION, toRepoRelative } from "./text.js";
|
|
32
|
-
export const VERSION = "0.1.
|
|
32
|
+
export const VERSION = "0.1.2";
|
|
33
33
|
export const KINDS = [NOTE_KIND, SUBGRAPH_KIND, IMPACT_KIND];
|
|
34
34
|
/** Cap on local Ix output a command hands back (resolve). */
|
|
35
35
|
export const MAX_RESOLVE_OUTPUT = 32 * 1024;
|
package/dist/subgraph.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// never the peer: the selector becomes a fixed, validated argv for the
|
|
11
11
|
// receiver's own `ix`.
|
|
12
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";
|
|
13
|
+
import { cps, fail, frame, scrubPaths, trimEnd, isObj, jsonBytes, LIMITS, line, MAX_BODY_BYTES, optInt, optStr, str } from "./text.js";
|
|
14
14
|
import { isSafeRelativePath } from "@peer2peer/core/v3";
|
|
15
15
|
export const SUBGRAPH_KIND = "x:ix.subgraph";
|
|
16
16
|
// Strict patterns: what a peer can make the receiver's `ix` see is exactly these.
|
|
@@ -23,7 +23,7 @@ export function splitPattern(p) {
|
|
|
23
23
|
if (cps(p) > LIMITS.path || p.startsWith("-"))
|
|
24
24
|
return undefined;
|
|
25
25
|
const m = /^(.*?)(?:\/(\*\*?))?$/.exec(p);
|
|
26
|
-
const prefix = (m?.[1] ?? ""
|
|
26
|
+
const prefix = trimEnd(m?.[1] ?? "", "/");
|
|
27
27
|
const glob = m?.[2];
|
|
28
28
|
if (prefix === "" || !isSafeRelativePath(prefix) || !prefix.split("/").every((s) => PATH_SEG.test(s)))
|
|
29
29
|
return undefined;
|
package/dist/text.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare function line(s: unknown, max: number): string;
|
|
|
63
63
|
export declare function toRepoRelative(p: string, root?: Roots): string | undefined;
|
|
64
64
|
/** The repo root, or several spellings of it (a symlinked temp dir, the realpath). */
|
|
65
65
|
export type Roots = string | readonly string[];
|
|
66
|
+
/** `s` without any of `chars` at its end: one backward pass (no backtracking regex). */
|
|
67
|
+
export declare function trimEnd(s: string, chars: string): string;
|
|
66
68
|
/**
|
|
67
69
|
* Sending: free text with this machine's identifying details replaced, so a
|
|
68
70
|
* note, a risk summary or a symbol name doesn't leak them:
|
package/dist/text.js
CHANGED
|
@@ -144,6 +144,13 @@ export function toRepoRelative(p, root) {
|
|
|
144
144
|
function rootList(root) {
|
|
145
145
|
return (typeof root === "string" ? [root] : [...(root ?? [])]).filter((r) => r.length > 1);
|
|
146
146
|
}
|
|
147
|
+
/** `s` without any of `chars` at its end: one backward pass (no backtracking regex). */
|
|
148
|
+
export function trimEnd(s, chars) {
|
|
149
|
+
let j = s.length;
|
|
150
|
+
while (j > 0 && chars.includes(s.charAt(j - 1)))
|
|
151
|
+
j--;
|
|
152
|
+
return s.slice(0, j);
|
|
153
|
+
}
|
|
147
154
|
/**
|
|
148
155
|
* Sending: free text with this machine's identifying details replaced, so a
|
|
149
156
|
* note, a risk summary or a symbol name doesn't leak them:
|
|
@@ -159,7 +166,7 @@ export function scrubPaths(text, opts) {
|
|
|
159
166
|
const roots = [...repoRoots, ...(opts.home && opts.home.length > 1 ? [opts.home] : [])].sort((a, b) => b.length - a.length);
|
|
160
167
|
for (const r of roots) {
|
|
161
168
|
const repl = repoRoots.includes(r) ? "." : "~";
|
|
162
|
-
out = out.split(r
|
|
169
|
+
out = out.split(trimEnd(r, "\\/")).join(repl);
|
|
163
170
|
}
|
|
164
171
|
out = out
|
|
165
172
|
.replace(/\\\\[^\\\s]+\\[^\\\s]+/g, "…")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peer2peer/ext-ix",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The Ix extension for Peer2Peer v3: share Ix session notes, subgraph references and blast-radius reports between agent sessions (x:ix.note, x:ix.subgraph, x:ix.impact), and flag semantic conflicts. Needs only a local Ix install.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"peer2peer",
|
|
@@ -50,14 +50,17 @@
|
|
|
50
50
|
"registry": "https://registry.npmjs.org/"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@peer2peer/core": "0.1.
|
|
53
|
+
"@peer2peer/core": "0.1.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@peer2peer/cli": "^0.1.
|
|
56
|
+
"@peer2peer/cli": "^0.1.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@peer2peer/cli": {
|
|
60
60
|
"optional": true
|
|
61
61
|
}
|
|
62
|
+
},
|
|
63
|
+
"overrides": {
|
|
64
|
+
"minimatch": "^11.0.8"
|
|
62
65
|
}
|
|
63
66
|
}
|