@juicesharp/rpiv-warp 1.19.1 → 2.0.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/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to `@juicesharp/rpiv-warp` are documented here.
5
5
  Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
  Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.0] - 2026-07-21
9
+
10
+ ### Added
11
+ - Show a Blocked badge when a workflow run parks on a question, with each concurrent run badged independently until its question is answered.
12
+ - Read configuration from `XDG_CONFIG_HOME` when set, falling back to the legacy `~/.config` location only when no config file exists at the new path.
13
+
14
+ ### Changed
15
+ - Detached workflow child sessions no longer load Warp; it observes only from the launching session.
16
+
17
+ ### Fixed
18
+ - Render skill invocations in toast summaries as `/skill:<name> <args>` without leaking internal argument labeling.
19
+
20
+ ## [1.20.0] - 2026-06-15
21
+
8
22
  ## [1.19.1] - 2026-06-10
9
23
 
10
24
  ## [1.19.0] - 2026-06-09
package/config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { configPath, loadJsonConfig } from "@juicesharp/rpiv-config";
1
+ import { configPath, loadJsonConfigWithLegacyFallback } from "@juicesharp/rpiv-config";
2
2
 
3
3
  export const CONFIG_PATH = configPath("rpiv-warp");
4
4
 
@@ -11,7 +11,7 @@ export const DEFAULT_BLOCKING_TOOLS: readonly string[] = ["ask_user_question"];
11
11
  export const DEFAULT_HEARTBEAT_MS = 15000;
12
12
 
13
13
  export function loadConfig(): RpivWarpConfig {
14
- return loadJsonConfig<RpivWarpConfig>(CONFIG_PATH);
14
+ return loadJsonConfigWithLegacyFallback<RpivWarpConfig>("rpiv-warp");
15
15
  }
16
16
 
17
17
  export function getHeartbeatMs(): number {
package/index.ts CHANGED
@@ -8,6 +8,9 @@ import {
8
8
  buildSessionStartPayload,
9
9
  buildStopPayload,
10
10
  buildToolCompletePayload,
11
+ buildWorkflowQuestionAskedPayload,
12
+ buildWorkflowQuestionCompletePayload,
13
+ buildWorkflowSessionStartPayload,
11
14
  lastAssistantText,
12
15
  serializePayload,
13
16
  type WarpPayload,
@@ -55,6 +58,37 @@ function emit(payload: WarpPayload): void {
55
58
  writeOSC777(TITLE, serializePayload(payload));
56
59
  }
57
60
 
61
+ // ---------------------------------------------------------------------------
62
+ // Workflow-question transport — a run-keyed OSC emitter for the rpiv-core
63
+ // workflow-question-warp-bridge. session_id is the workflow runId (Warp's
64
+ // logical session for a parked-question badge), NOT the launcher session.
65
+ // Each method is gated per-call on supportsStructured so the bridge can call
66
+ // unconditionally outside Warp; the factory is cheap and holds no state.
67
+ // ---------------------------------------------------------------------------
68
+
69
+ export interface WorkflowQuestionTransport {
70
+ /** A workflow run parked its FIRST outstanding question (0→≥1): emit
71
+ * `session_start` (defensive) then `question_asked`. No-op outside Warp. */
72
+ asked(runId: string): void;
73
+ /** A workflow run's LAST outstanding question cleared (≥1→0): emit
74
+ * `tool_complete`. No-op outside Warp. */
75
+ resolved(runId: string): void;
76
+ }
77
+
78
+ export function createWorkflowQuestionTransport(cwd: string): WorkflowQuestionTransport {
79
+ return {
80
+ asked(runId: string): void {
81
+ if (!detectWarpEnvironment().supportsStructured) return;
82
+ emit(buildWorkflowSessionStartPayload(runId, cwd));
83
+ emit(buildWorkflowQuestionAskedPayload(runId, cwd));
84
+ },
85
+ resolved(runId: string): void {
86
+ if (!detectWarpEnvironment().supportsStructured) return;
87
+ emit(buildWorkflowQuestionCompletePayload(runId, cwd));
88
+ },
89
+ };
90
+ }
91
+
58
92
  function cancelIdleTimer(): void {
59
93
  if (idleTimer !== undefined) {
60
94
  clearTimeout(idleTimer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-warp",
3
- "version": "1.19.1",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "Pi extension. Native Warp terminal notifications, dispatched via OSC 777 on Pi lifecycle events.",
6
6
  "keywords": [
@@ -27,6 +27,9 @@
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
+ "exports": {
31
+ ".": "./index.ts"
32
+ },
30
33
  "scripts": {
31
34
  "test": "vitest run"
32
35
  },
@@ -44,12 +47,13 @@
44
47
  "pi": {
45
48
  "extensions": [
46
49
  "./index.ts"
47
- ]
50
+ ],
51
+ "ambientObserver": true
48
52
  },
49
53
  "peerDependencies": {
50
54
  "@earendil-works/pi-coding-agent": "*"
51
55
  },
52
56
  "dependencies": {
53
- "@juicesharp/rpiv-config": "^1.19.1"
57
+ "@juicesharp/rpiv-config": "^2.0.0"
54
58
  }
55
59
  }
package/payload.ts CHANGED
@@ -91,7 +91,17 @@ export function extractMessageText(content: UserMessage["content"] | AssistantMe
91
91
  export function summarizeSkillBlock(text: string): string {
92
92
  const parsed = parseSkillBlock(text);
93
93
  if (!parsed) return text;
94
- return parsed.userMessage ? `/skill:${parsed.name} ${parsed.userMessage}` : `/skill:${parsed.name}`;
94
+ const args = unwrapSkillInput(parsed.userMessage);
95
+ return args ? `/skill:${parsed.name} ${args}` : `/skill:${parsed.name}`;
96
+ }
97
+
98
+ /** rpiv-args' token emit path carries the raw argument string in a
99
+ * `Skill input:`-labeled trailer after `</skill>` (args.ts
100
+ * appendSkillInput) — Pi's parseSkillBlock surfaces it verbatim as
101
+ * userMessage. Strip the label so the toast shows what the human typed. */
102
+ function unwrapSkillInput(userMessage: string | undefined): string | undefined {
103
+ const m = userMessage?.match(/^Skill input: ([\s\S]*)$/);
104
+ return m ? m[1] : userMessage;
95
105
  }
96
106
 
97
107
  // ---------------------------------------------------------------------------
@@ -126,18 +136,28 @@ export function lastAssistantText(branch: SessionEntry[]): string {
126
136
  // Envelope — common fields for every Warp event
127
137
  // ---------------------------------------------------------------------------
128
138
 
129
- export function baseEnvelope(event: WarpEvent, ctx: ExtensionContext): WarpPayloadBase {
130
- const cwd = ctx.cwd;
139
+ /**
140
+ * Identity-independent envelope core: builds the shared fields from an
141
+ * explicit `session_id` + `cwd` rather than an `ExtensionContext`. The root
142
+ * flow delegates here with the live session; the workflow-question bridge
143
+ * delegates here with `session_id = runId` (a workflow run is Warp's
144
+ * logical session for its parked-question badge).
145
+ */
146
+ export function runEnvelope(event: WarpEvent, session_id: string, cwd: string): WarpPayloadBase {
131
147
  return {
132
148
  v: negotiateProtocolVersion(),
133
149
  agent: AGENT_ID,
134
150
  event,
135
- session_id: ctx.sessionManager.getSessionId(),
151
+ session_id,
136
152
  cwd,
137
153
  project: projectName(cwd),
138
154
  };
139
155
  }
140
156
 
157
+ export function baseEnvelope(event: WarpEvent, ctx: ExtensionContext): WarpPayloadBase {
158
+ return runEnvelope(event, ctx.sessionManager.getSessionId(), ctx.cwd);
159
+ }
160
+
141
161
  // ---------------------------------------------------------------------------
142
162
  // Builders — one per Warp event; composition is linear and named
143
163
  // ---------------------------------------------------------------------------
@@ -184,6 +204,35 @@ export function buildToolCompletePayload(
184
204
  };
185
205
  }
186
206
 
207
+ // ---------------------------------------------------------------------------
208
+ // Workflow-question builders — session_id is the workflow runId, NOT the
209
+ // launcher session. Composed from runEnvelope so they share the root flow's
210
+ // field shape. Used by createWorkflowQuestionTransport in index.ts.
211
+ // ---------------------------------------------------------------------------
212
+
213
+ /** Defensive first emission for a run that just parked its first question —
214
+ * mirrors the root flow's agent_start defensive `session_start`. */
215
+ export function buildWorkflowSessionStartPayload(runId: string, cwd: string): WarpPayload {
216
+ return runEnvelope("session_start", runId, cwd);
217
+ }
218
+
219
+ /** A workflow run parked its first outstanding question — Warp shows the
220
+ * "question" / Blocked badge for this runId. */
221
+ export function buildWorkflowQuestionAskedPayload(runId: string, cwd: string): WarpPayload {
222
+ return runEnvelope("question_asked", runId, cwd);
223
+ }
224
+
225
+ /** A workflow run's last outstanding question was answered/cleared — Warp
226
+ * clears the badge. Carries `tool_name` so Warp attributes it to the
227
+ * blocking tool, but no `tool_input` (the bridge aggregates, it has no
228
+ * per-question input). */
229
+ export function buildWorkflowQuestionCompletePayload(runId: string, cwd: string): WarpPayload {
230
+ return {
231
+ ...runEnvelope("tool_complete", runId, cwd),
232
+ tool_name: "ask_user_question",
233
+ };
234
+ }
235
+
187
236
  // ---------------------------------------------------------------------------
188
237
  // Serializer — single source of truth so tests can assert on JSON shape
189
238
  // ---------------------------------------------------------------------------