@tryglen/pi 0.6.0 → 0.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryglen/pi",
3
- "version": "0.6.0",
3
+ "version": "0.6.3",
4
4
  "description": "Shared team memory for coding agents — automatic recall and capture on every turn via the glen CLI.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -31,6 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "scripts": {
34
+ "prepublishOnly": "echo 'Do not publish from this folder. pi-publish.yml packs, checks and publishes the tarball.' && exit 1",
34
35
  "typecheck": "tsc --noEmit",
35
36
  "test": "vitest run"
36
37
  },
@@ -5,7 +5,7 @@ description: Trace a specific piece of code to the agent conversations that prod
5
5
 
6
6
  Resolve the file and line range the user is asking about, then run
7
7
  `glen code-search <path:start-end> "<the user's question>"` via Bash — e.g.
8
- `glen code-search src/server/api/foo.ts:40-85 "why is this rate-limited?"`.
8
+ `glen code-search src/api/rate-limit.ts:40-85 "why is this rate-limited?"`.
9
9
 
10
10
  The output is the ranked memory plus the full transcripts of the conversations
11
11
  behind the commits that last touched those lines. Answer from those transcripts —
@@ -16,12 +16,6 @@ lands in the pool. When the user wants to bring someone in:
16
16
  - `· <email> is already a member`: nothing to do.
17
17
  - `warning: could not invite <email> (<reason>)`: relay the reason.
18
18
 
19
- Or share a link instead of emailing: run `glen invite` with NO email to print a
20
- shareable join link for the org. Anyone who signs in with a verified email on the
21
- org's work-email domain joins automatically — good for dropping in a team channel.
22
- (Requires "Let teammates join with their work email" to be enabled in
23
- Settings → General.)
24
-
25
19
  Notes:
26
20
  - Invites are sent by email and expire after 48 hours; the teammate clicks the
27
21
  link, signs in, and lands directly in the shared memory.
@@ -1,3 +1,5 @@
1
+ import { parseJson } from "./parse-json";
2
+
1
3
  // A hook prints either the JSON envelope or plain text meant as context.
2
4
  export const parseHookOutput = (
3
5
  raw: string,
@@ -17,11 +19,3 @@ export const parseHookOutput = (
17
19
  notice: typeof notice === "string" ? notice : "",
18
20
  };
19
21
  };
20
-
21
- const parseJson = (text: string): unknown => {
22
- try {
23
- return JSON.parse(text) as unknown;
24
- } catch {
25
- return undefined;
26
- }
27
- };
@@ -0,0 +1,8 @@
1
+ // Bad JSON comes back as undefined: JSON.parse can only report it by throwing.
2
+ export const parseJson = (text: string): unknown => {
3
+ try {
4
+ return JSON.parse(text) as unknown;
5
+ } catch {
6
+ return undefined;
7
+ }
8
+ };
@@ -17,7 +17,8 @@ export const runGlenHook = (
17
17
  const chunks: Buffer[] = [];
18
18
  const timer = setTimeout(() => child.kill("SIGKILL"), timeoutMs);
19
19
  child.stdout.on("data", (chunk: Buffer) => chunks.push(chunk));
20
- child.stdin.on("error", () => {});
20
+ // A glen that exits before reading its payload makes this write fail (EPIPE); close still resolves.
21
+ child.stdin.on("error", () => undefined);
21
22
  child.on("error", (error: NodeJS.ErrnoException) => {
22
23
  clearTimeout(timer);
23
24
  resolve({ kind: error.code === "ENOENT" ? "missing" : "failed" });