pi-sessions 0.7.0 → 0.7.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.
@@ -39,9 +39,8 @@ export default function sessionAskExtension(pi: ExtensionAPI): void {
39
39
  name: "session_ask",
40
40
  label: "Session Ask",
41
41
  description: "Interrogate a Pi session",
42
- promptSnippet:
43
- "Use when you have a session id and want to recall information, decisions, reasoning, etc from it",
44
- promptGuidelines: ["Prefer focused follow-up questions over broad recap requests"],
42
+ promptSnippet: "Recall information, decisions, or reasoning from a Pi session by id",
43
+ promptGuidelines: ["Use session_ask with focused questions rather than broad recap requests."],
45
44
  parameters: Type.Object({
46
45
  session: Type.String({
47
46
  description: "Bare UUID for the session",
@@ -87,16 +87,15 @@ export default function sessionHandoffExtension(pi: ExtensionAPI): void {
87
87
  "Start a background pi session in a terminal split based on the current session",
88
88
  promptGuidelines: [
89
89
  "Use session_handoff only when it is clear the work should be forked to a new context.",
90
- "Prefer using session_handoff by direction of the user, not as an unsolicited default.",
91
- "The goal should capture enough detail to encompass the ask and include any directions the next sessions should consider.",
92
- "Only request a response when there is a specific ask-and-response expectation: the user asked for a report back, or the current session needs the child result before it can continue. Do not set requestResponse for independent or unrelated background work; most split-off tasks should run without reporting back.",
93
- "Only capable of a background handoff; to replace the current session, tell the user to run /handoff instead.",
90
+ "Reach for session_handoff by direction of the user, not as an unsolicited default.",
91
+ "session_handoff should only request a response when there is a specific ask-and-response expectation: the user asked for a report back, or this session needs the child result to continue. Leave it off by default and for independent background work.",
92
+ "session_handoff can only fork a background session; to replace the current session, tell the user to run /handoff instead.",
94
93
  ],
95
94
  executionMode: "sequential",
96
95
  parameters: Type.Object({
97
96
  goal: Type.String({
98
97
  description:
99
- "Goal for the new session, including enough detail to capture the user's ask and any directions the next prompt should consider.",
98
+ "Goal for the new session. Capture enough detail to encompass the ask and any directions the next session should consider.",
100
99
  }),
101
100
  splitDirection: Type.Union(
102
101
  [Type.Literal("left"), Type.Literal("right"), Type.Literal("up"), Type.Literal("down")],
@@ -39,7 +39,7 @@ export async function spawnSessionMessagingBrokerIfNeeded(): Promise<void> {
39
39
  detached: true,
40
40
  stdio: "ignore",
41
41
  windowsHide: process.platform === "win32",
42
- env: { ...process.env, NODE_NO_WARNINGS: "1" },
42
+ env: brokerSpawnEnv(),
43
43
  });
44
44
  child.unref();
45
45
  await waitForBroker();
@@ -162,3 +162,19 @@ function releaseSpawnLock(): void {
162
162
  unlinkSync(brokerSpawnLockPath);
163
163
  } catch {}
164
164
  }
165
+
166
+ function brokerSpawnEnv(): NodeJS.ProcessEnv {
167
+ // NODE_NO_WARNINGS silences Node's experimental-TypeScript warning when the
168
+ // broker is launched as `node process.ts`. Redundant while stdio is ignored,
169
+ // but cheap insurance if that changes or an older Node revives the warning.
170
+ const env: NodeJS.ProcessEnv = { ...process.env, NODE_NO_WARNINGS: "1" };
171
+ // process.execPath is the Pi executable. As a Bun-compiled binary it treats a
172
+ // positional path as a file argument to the agent, not a script to run, which
173
+ // would relaunch a full agent session and recurse. BUN_BE_BUN makes it behave
174
+ // as the Bun CLI and execute process.ts directly. It is set whenever Bun is the
175
+ // runtime (compiled binary or `bun run`) and ignored by a plain Node launch.
176
+ if (process.versions.bun) {
177
+ env.BUN_BE_BUN = "1";
178
+ }
179
+ return env;
180
+ }
@@ -14,7 +14,7 @@ export function registerSessionMessagingTools(
14
14
  description: "Send a message to another live pi session",
15
15
  promptSnippet: "Send a message to another live pi session",
16
16
  promptGuidelines: [
17
- "Use session_search with live: true to discover targetable sessions. Usually it is best to exclude all other filters and simply get a list of all live sessions",
17
+ "Before session_send_message, use session_search with live: true (no other filters) to list all live sessions and find the target.",
18
18
  ],
19
19
  parameters: SEND_MESSAGE_PARAMS,
20
20
  renderCall(args, theme, context) {
@@ -64,10 +64,10 @@ export default function sessionSearchExtension(
64
64
  name: "session_search",
65
65
  label: "Session Search",
66
66
  description: "Search Pi sessions",
67
- promptSnippet: "Use when you need to locate a session to do a detailed follow-up",
67
+ promptSnippet: "Locate Pi sessions for follow-up",
68
68
  promptGuidelines: [
69
- "Omit query to list matching sessions chronologically",
70
- "Once you have the right session id, switch to session_ask for questions about that session",
69
+ "Omit queries in session_search to list matching sessions chronologically.",
70
+ "After session_search finds a session id, switch to session_ask for questions about it.",
71
71
  ],
72
72
  parameters: Type.Object({
73
73
  query: Type.Optional(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-sessions",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "Pi session search, ask, handoff, messaging, auto-titling, and indexing tools",
6
6
  "license": "MIT",
@@ -41,6 +41,9 @@
41
41
  "check": "biome check . && tsc --noEmit && vitest run",
42
42
  "prepare": "husky || true"
43
43
  },
44
+ "dependencies": {
45
+ "typebox": "^1.1.38"
46
+ },
44
47
  "devDependencies": {
45
48
  "@biomejs/biome": "^2.4.14",
46
49
  "@earendil-works/pi-agent-core": "^0.80.2",
@@ -50,7 +53,6 @@
50
53
  "@types/node": "^25.6.2",
51
54
  "husky": "^9.1.7",
52
55
  "lint-staged": "^17.0.3",
53
- "typebox": "^1.1.38",
54
56
  "typescript": "^6.0.3",
55
57
  "vitest": "^4.1.5"
56
58
  },
@@ -58,8 +60,7 @@
58
60
  "@earendil-works/pi-agent-core": ">=0.80.2",
59
61
  "@earendil-works/pi-ai": ">=0.80.2",
60
62
  "@earendil-works/pi-coding-agent": ">=0.80.2",
61
- "@earendil-works/pi-tui": ">=0.80.2",
62
- "typebox": ">=1.1.24"
63
+ "@earendil-works/pi-tui": ">=0.80.2"
63
64
  },
64
65
  "lint-staged": {
65
66
  "*.{js,cjs,mjs,jsx,ts,tsx,json,jsonc}": "biome check --write --no-errors-on-unmatched"