@xzzpig/pi-subagents 0.24.1 → 0.24.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.24.2] - 2026-11-01 (fork)
4
+
5
+ ### 维护
6
+
7
+ - 同步内嵌共享库依赖至 pi-components 0.5.0;fleet 继续使用既有无状态渲染入口,不隐式启用新的有状态展示策略。
8
+
3
9
  ## [0.24.1] - 2026-10-31 (fork)
4
10
 
5
11
  ### Fixed
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-X6LOM3Z4.js";
15
15
  import {
16
16
  package_default
17
- } from "./chunk-TGLFTQWJ.js";
17
+ } from "./chunk-O4D5PBVI.js";
18
18
  import {
19
19
  EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
20
20
  REVIVAL_ORIGIN_FILE,
@@ -64,7 +64,7 @@ import {
64
64
  snapshotProviderDiagnostics,
65
65
  workflowResumeClaimState,
66
66
  workflowResumeRefusal
67
- } from "./chunk-SLNMBXLL.js";
67
+ } from "./chunk-CYY5UMJU.js";
68
68
  import {
69
69
  listHerdrProjectPaneRoots,
70
70
  restoreHerdrProjectPaneSnapshots
@@ -9207,7 +9207,7 @@ function registerSubagentExtension(pi) {
9207
9207
  let executor;
9208
9208
  let executorPromise;
9209
9209
  let executorModulePromise;
9210
- const loadExecutorModule = () => executorModulePromise ??= import("./chunk-ZWXU5SPQ.js");
9210
+ const loadExecutorModule = () => executorModulePromise ??= import("./chunk-XWWUDWUW.js");
9211
9211
  const getExecutor = () => {
9212
9212
  executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
9213
9213
  executor = createSubagentExecutor(executorDeps);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FG6SQJAR.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-TGLFTQWJ.js";
6
+ } from "./chunk-O4D5PBVI.js";
7
7
  import "./chunk-EUPJB4S7.js";
8
8
  import {
9
9
  MODEL_ONLY_TOOL
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-35GII5EF.js";
17
17
  import {
18
18
  package_default
19
- } from "./chunk-TGLFTQWJ.js";
19
+ } from "./chunk-O4D5PBVI.js";
20
20
  import {
21
21
  HERDR_PI_MODE_ENV,
22
22
  HERDR_PI_PROTOCOL,
@@ -6352,7 +6352,7 @@ function childSessionFactory() {
6352
6352
  }
6353
6353
  function createLazyPlacementFactory(local) {
6354
6354
  let placed;
6355
- const factory = async () => placed ??= (await import("./chunk-Y6H2G6KX.js")).createPlacementAwareChildSessionFactory(local);
6355
+ const factory = async () => placed ??= (await import("./chunk-BQ2OAB4Q.js")).createPlacementAwareChildSessionFactory(local);
6356
6356
  return {
6357
6357
  async create(launch) {
6358
6358
  return launch.machine ? (await factory()).create(launch) : local.create(launch);
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@xzzpig/pi-subagents",
4
- version: "0.24.1",
4
+ version: "0.24.2",
5
5
  description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  author: "Nico Bailon",
7
7
  license: "MIT",
@@ -28,7 +28,7 @@ var package_default = {
28
28
  },
29
29
  repository: {
30
30
  type: "git",
31
- url: "git+https://github.com/nicobailon/pi-subagents.git"
31
+ url: "git+https://github.com/xzzpig/pi-extensions.git"
32
32
  },
33
33
  homepage: "https://github.com/nicobailon/pi-subagents#readme",
34
34
  bugs: {
@@ -106,7 +106,7 @@ var package_default = {
106
106
  }
107
107
  },
108
108
  dependencies: {
109
- "@xzzpig/pi-components": "0.4.0",
109
+ "@xzzpig/pi-components": "0.5.0",
110
110
  "@js-temporal/polyfill": "0.5.1",
111
111
  acorn: "8.18.0",
112
112
  jiti: "2.7.0",
@@ -120,7 +120,7 @@ import {
120
120
  workflowStopCause,
121
121
  writeWorkflowLaunchRecord,
122
122
  writeWorkflowReceipt
123
- } from "./chunk-SLNMBXLL.js";
123
+ } from "./chunk-CYY5UMJU.js";
124
124
  import {
125
125
  HERDR_PROJECT_PANE_ACTIONS,
126
126
  handleHerdrProjectPaneAction
package/bundle/index.js CHANGED
@@ -17,7 +17,7 @@ function readInstalledPackageVersion() {
17
17
  var loadedPackageVersion = readInstalledPackageVersion();
18
18
 
19
19
  // index.ts
20
- var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-6BJUEES3.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-LMGQAJ3O.js")).default;
20
+ var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-4UH4WS4G.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-224WMDIV.js")).default;
21
21
  function registerSubagentExtension(pi) {
22
22
  const installedVersion = readInstalledPackageVersion();
23
23
  if (installedVersion !== loadedPackageVersion) {
@@ -3,6 +3,18 @@
3
3
  All notable changes to the internal `@xzzpig/pi-components` shared library are
4
4
  documented here.
5
5
 
6
+ ## 0.5.0
7
+
8
+ ### Added
9
+
10
+ - **可选启用的 `TranscriptPresenter`(`@xzzpig/pi-components/transcript-presenter`)。**
11
+ 在既有 `TranscriptEntry` 值之上的有状态展示层:按稳定消息段保留原生用户/助手
12
+ 组件,把真实流式状态传给 Pi 的 `AssistantMessageComponent`,在内容更新和缩放后
13
+ 保留原生思考块的点击状态,暴露组件行范围与规范化鼠标分发,支持本地统一思考切换
14
+ (包括通过 Pi 原生 `MouseRegion` 点击路径展开已完成的块),并提供显式的
15
+ `sync`/`render`/`invalidate`/`clear`/`dispose` 生命周期钩子。既有
16
+ `renderTranscriptLines` 与 `TranscriptViewport` 行为不变。
17
+
6
18
  ## 0.4.0
7
19
 
8
20
  ### Added
@@ -51,6 +51,100 @@ scrolling. Hosts keep ownership of terminal mouse-reporting setup, dialog
51
51
  chrome, focus behavior, input controls, session lifecycle, and cancellation
52
52
  policy. `Esc` handling is intentionally delegated to the host overlay.
53
53
 
54
+ ### 有状态展示器(可选启用)
55
+
56
+ `@xzzpig/pi-components/transcript-presenter` 新增 `TranscriptPresenter`,供需要
57
+ 真实流式状态、原生思考块点击和本地思考切换的宿主使用。上述无状态入口保持不变;
58
+ 宿主通过导入第二个子路径显式启用。
59
+
60
+ 展示器消费相同的 `TranscriptEntry` 值,并按用户条目保留一个原生
61
+ `UserMessageComponent`、按助手消息段保留一个原生 `AssistantMessageComponent`。
62
+ 助手组件先以空内容构造,再通过 `updateContent(message, streaming)` 接收内容,因此
63
+ Pi 的原生流式状态会到达宿主侧补丁(例如 `pi-thinking-collapse`),而不是先渲染
64
+ 一条已完成消息。只有段落文本或流式标志变化时才重新赋值内容;缩放和纯重绘保留组件
65
+ 及其逐块点击状态。
66
+
67
+ ```ts
68
+ import { SessionTranscript } from "@xzzpig/pi-components/transcript";
69
+ import { TranscriptPresenter } from "@xzzpig/pi-components/transcript-presenter";
70
+
71
+ const transcript = new SessionTranscript();
72
+ const presenter = new TranscriptPresenter({
73
+ theme,
74
+ // 复用 transcript 注册表,让工具 renderer 状态和展开点击跨帧保留。
75
+ // 仅在只读回放时省略;此时工具块回退为无状态的临时组件。
76
+ toolComponents: transcript.toolComponents,
77
+ assistantLabel: "Assistant",
78
+ // 省略 thinkingLabel 可保留 Pi 原生的 `Thinking...` 标签,折叠补丁会把
79
+ // 它替换成自己的 “click to expand” 提示。
80
+ });
81
+ presenter.attachTui(tui);
82
+ // 把 renderer 发起的工具重绘接到展示器修订号上。
83
+ transcript.toolComponents.attachTui({
84
+ requestRender: () => presenter.requestRender(),
85
+ });
86
+
87
+ // 宿主的 transcript 版本变化时(或简单宿主每帧一次),渲染前先 sync。
88
+ // 对未变化条目的重复 sync 只做内容比较,不会改动展示修订号。
89
+ presenter.sync(transcript.entries);
90
+ const frame = presenter.render(innerWidth);
91
+ const visibleLines = frame.lines.slice(scrollOffset, scrollOffset + height);
92
+
93
+ // 鼠标路由:把可见视口行加上 scroll offset 换算到完整 transcript 空间,
94
+ // 再交给展示器分发。
95
+ const handled = presenter.handleMouse({
96
+ ...mouseEvent,
97
+ y: mouseEvent.y - overlayChromeTop + scrollOffset,
98
+ });
99
+
100
+ // BTW 本地统一思考切换(在 overlay 绑定 Ctrl+T;不写 Pi 设置,也不碰主会话)。
101
+ const thinkingVisible = presenter.toggleThinkingVisibility();
102
+ ```
103
+
104
+ `sync(entries)` 只更新发生变化的段,并清理条目已消失的组件。`render(width)` 返回
105
+ 渲染行以及 `frame.rows`(组件行范围)、`frame.totalLines` 和 `frame.revision`;
106
+ 宿主缓存应比较 `frame.revision` 与宽度。展示器自身的缓存会在条目变化、宽度变化、
107
+ `invalidate()`(主题变化)、思考切换和 `requestRender()`(组件发起的重绘)时失效。
108
+
109
+ 鼠标处理使用 Pi 公开的 `Component.handleMouse` 路径:展示器把转录行映射到所属
110
+ 原生组件,减去该行的 `top`,再转发事件。这样无需读取组件私有字段,即可保留 Pi
111
+ 原生的逐块思考点击与工具展开。
112
+
113
+ 思考控制:
114
+
115
+ - `thinkingVisible` 反映展示器的本地偏好。展示器初始为 `auto`:没有宿主补丁时
116
+ Pi 原生默认展开;存在折叠补丁时,流式内容保持可见,完成的消息折叠。
117
+ - `setThinkingVisible(visible)` 把显式本地偏好应用到每个保留的助手组件。隐藏使用
118
+ Pi 公开的 `setHideThinkingBlock(true)`,因此会清除原生的逐块覆盖。显示时先通过
119
+ 同一个公开 setter 强制到已知的折叠状态,再通过原生思考 `MouseRegion`(经公开
120
+ 的 `Container.children` 取得)分发一次点击。这会设置与用户点击相同的逐块覆盖,
121
+ 因此即使宿主折叠补丁持续自动折叠,已完成消息也会展开。流式标志从不伪造,不读取
122
+ 组件私有字段,也不修改折叠补丁。
123
+ - 新段继承显式的可见偏好:首次内容更新后,展示器应用相同的原生点击路径。
124
+ - 之后对某个思考块的真实点击仍然只切换该块,且该覆盖在内容更新、主题失效和缩放后
125
+ 保持。
126
+ - `toggleThinkingVisibility()` 翻转偏好并返回新的可见性。从初始 `auto` 状态开始,
127
+ 第一次切换隐藏,下一次展开所有保留的块。
128
+ - 该偏好只属于本展示器。它绝不写入 Pi 设置,也不改变主会话的思考偏好。
129
+
130
+ 在 `AssistantMessageComponent` 没有思考 `MouseRegion` 的宿主(较旧的 Pi)上,
131
+ 显示会降级为公开的 `setHideThinkingBlock(false)` 调用;内容与键盘切换仍然可用,
132
+ 但宿主折叠补丁仍可再次折叠已完成消息。
133
+
134
+ 生命周期:
135
+
136
+ - `attachTui(tui)` / `detachTui()` 接通重绘转发。分离已关闭的 overlay 会保留线程
137
+ 状态,包括展开选择。
138
+ - `invalidate()` 为主题变化重新渲染原生组件,而不重新初始化宿主全局主题。
139
+ - `clear()` 在线程被清空时丢弃保留的消息组件与布局。
140
+ - `dispose()` 释放组件、分离 TUI,并让后续调用变为 no-op;在线程/会话本身销毁时
141
+ 使用。
142
+
143
+ 当宿主侧补丁自动折叠已完成的思考(例如 `pi-thinking-collapse`)时,展示器保留该
144
+ 补丁的流式与完成行为及其原生逐块点击覆盖。统一切换通过原生点击路径为保留块显式
145
+ 覆盖该自动折叠,新块继承该显式偏好。没有此类补丁时,已完成的思考遵循 Pi 原生
146
+ 默认值(展开),本地切换会展开/收起每个保留块。
147
+
54
148
  ### History replay
55
149
 
56
150
  Hosts that rebuild a transcript from persisted records write entries through
@@ -0,0 +1,186 @@
1
+ import { type TuiMouseEvent } from "@earendil-works/pi-tui";
2
+ import { type NativeToolRenderOptions, type ToolComponentLookup, type TranscriptEntry, type TranscriptTheme, type TranscriptTui } from "./transcript.js";
3
+ /**
4
+ * Options for the opt-in stateful presenter.
5
+ *
6
+ * The presenter owns user/assistant components; tool components stay owned by
7
+ * the caller's `TranscriptToolComponents` registry so live tool updates keep
8
+ * their existing renderer state. When no registry is supplied, tool calls are
9
+ * rendered through stateless ad-hoc components, exactly like
10
+ * `renderTranscriptLines`.
11
+ */
12
+ export interface TranscriptPresenterOptions extends NativeToolRenderOptions {
13
+ theme: TranscriptTheme;
14
+ emptyText?: string;
15
+ assistantLabel?: string;
16
+ /**
17
+ * Collapsed-label text used while thinking is hidden. Defaults to Pi's
18
+ * native `Thinking...` label so collapse patches can replace it with their
19
+ * own expand affordance instead of treating it as a custom label.
20
+ */
21
+ thinkingLabel?: string;
22
+ assistantBadgeBackground?: string;
23
+ assistantBadgeForeground?: string;
24
+ /**
25
+ * Start with the presenter's local thinking preference hidden. When omitted
26
+ * (or false) the presenter starts in `auto`: host patches such as
27
+ * `pi-thinking-collapse` keep deciding per-message visibility until the host
28
+ * calls `setThinkingVisible`/`toggleThinkingVisibility`.
29
+ */
30
+ hideThinkingBlock?: boolean;
31
+ /** Persistent native tool components keyed by tool call id. */
32
+ toolComponents?: ToolComponentLookup;
33
+ }
34
+ /**
35
+ * A rendered, mouse-addressable component range in the full transcript.
36
+ * `top` is the zero-based line offset including any scroll offset the host has
37
+ * not applied; callers translate visible viewport rows into this space.
38
+ */
39
+ export type TranscriptPresenterRow = {
40
+ kind: "user";
41
+ entryId: number;
42
+ top: number;
43
+ height: number;
44
+ } | {
45
+ kind: "assistant";
46
+ /** Stable id of the assistant message segment (its first entry id). */
47
+ segmentId: number;
48
+ entryIds: readonly number[];
49
+ top: number;
50
+ height: number;
51
+ } | {
52
+ kind: "tool";
53
+ entryId: number;
54
+ toolCallId: string;
55
+ top: number;
56
+ height: number;
57
+ };
58
+ /** One rendered frame plus the layout needed to route mouse events. */
59
+ export interface TranscriptPresenterFrame {
60
+ lines: string[];
61
+ rows: readonly TranscriptPresenterRow[];
62
+ totalLines: number;
63
+ width: number;
64
+ /**
65
+ * Display revision the lines were rendered at. A component that requests a
66
+ * repaint during rendering can raise the presenter's current revision above
67
+ * this value; callers then re-render instead of reusing the lines.
68
+ */
69
+ revision: number;
70
+ }
71
+ /**
72
+ * Opt-in stateful transcript presenter.
73
+ *
74
+ * It consumes the same `TranscriptEntry` values as `renderTranscriptLines`,
75
+ * but keeps one native `UserMessageComponent` per user entry and one native
76
+ * `AssistantMessageComponent` per assistant message segment. Assistant
77
+ * components are constructed empty and receive content through
78
+ * `updateContent(message, streaming)`, so a host-side thinking-collapse patch
79
+ * observes the real streaming state instead of an already-finished message.
80
+ *
81
+ * The presenter owns its display revision: entry changes, thinking toggles,
82
+ * theme invalidation, width changes, and component-initiated repaint requests
83
+ * all raise it. `render` reuses its line cache only while that revision and
84
+ * the width are unchanged; content is never re-assigned on a pure repaint or
85
+ * resize.
86
+ *
87
+ * Mouse handling is normalized: pass a `TuiMouseEvent` whose `y` is a row in
88
+ * the full transcript (visible row + scroll offset). The presenter maps it to
89
+ * the owning component and forwards it through the component's public
90
+ * `handleMouse`, so Pi's native thinking-block and tool-expansion click paths
91
+ * keep working without private fields.
92
+ */
93
+ export declare class TranscriptPresenter {
94
+ private readonly options;
95
+ private readonly assistantComponents;
96
+ private readonly assistantContent;
97
+ private readonly userComponents;
98
+ private readonly userText;
99
+ private readonly toolState;
100
+ private blocks;
101
+ private blockIdentities;
102
+ private rows;
103
+ private renderedToolComponents;
104
+ private cachedFrame;
105
+ private renderedWidth;
106
+ private renderedRevision;
107
+ private revisionValue;
108
+ private thinkingPreference;
109
+ private readonly expandedSegments;
110
+ private attachedTui;
111
+ private disposed;
112
+ constructor(options: TranscriptPresenterOptions);
113
+ /** Latest display revision. */
114
+ get revision(): number;
115
+ /** Retained presenter-owned message components (user + assistant). */
116
+ get componentCount(): number;
117
+ /**
118
+ * The presenter's local thinking preference. This is not the host patch's
119
+ * effective per-message state: in `auto` a collapse patch may still hide a
120
+ * completed message while the preference remains "visible".
121
+ */
122
+ get thinkingVisible(): boolean;
123
+ /** Wires the host TUI that receives repaint requests. */
124
+ attachTui(tui: TranscriptTui): void;
125
+ /** Stops forwarding repaint requests without discarding retained state. */
126
+ detachTui(): void;
127
+ /**
128
+ * Marks the display dirty and asks the attached TUI to repaint. Hosts wire
129
+ * tool components' repaint requests here so renderer-driven invalidations
130
+ * bypass the presenter's line cache.
131
+ */
132
+ requestRender(): void;
133
+ /**
134
+ * Synchronizes the presenter with the current entries. Components are
135
+ * created or updated only when their segment/content actually changed; a
136
+ * repeated sync of unchanged entries leaves the display revision alone.
137
+ */
138
+ sync(entries: readonly TranscriptEntry[]): number;
139
+ /**
140
+ * Renders the synced entries at `width`. When nothing changed since the last
141
+ * frame, the cached frame is returned unchanged.
142
+ */
143
+ render(width: number): TranscriptPresenterFrame;
144
+ /**
145
+ * Routes a normalized mouse event (transcript-space `y`) to the component
146
+ * whose row contains it. Returns whether the component handled the event.
147
+ */
148
+ handleMouse(event: TuiMouseEvent): boolean;
149
+ /**
150
+ * Applies the presenter's local thinking preference to every retained
151
+ * assistant component.
152
+ *
153
+ * Hiding uses the public `setHideThinkingBlock(true)`, which also clears
154
+ * native per-block overrides. Showing first forces the known collapsed state
155
+ * through the same public setter, then dispatches the native thinking-block
156
+ * click through `MouseRegion.handleMouse`. That sets the same per-block
157
+ * override a user click sets, so completed messages expand even while a
158
+ * host collapse patch keeps auto-collapsing them. No private component field
159
+ * is read and the streaming flag is never faked.
160
+ */
161
+ setThinkingVisible(visible: boolean): void;
162
+ /** Flips the local thinking preference and returns the new visibility. */
163
+ toggleThinkingVisibility(): boolean;
164
+ /**
165
+ * Invalidates native components for a theme change and raises the display
166
+ * revision. The host's global theme is never re-initialized here.
167
+ */
168
+ invalidate(): void;
169
+ /** Drops retained message components and rendered layout. */
170
+ clear(): void;
171
+ /**
172
+ * Releases every retained component and detaches the TUI. Idempotent; later
173
+ * calls to `sync`, `render`, and `handleMouse` degrade to no-ops.
174
+ */
175
+ dispose(): void;
176
+ private dropRetainedState;
177
+ private ensureAssistantComponent;
178
+ /**
179
+ * Expands every thinking block in `component` through the native public
180
+ * click path. When the host has no thinking `MouseRegion` (an older Pi), it
181
+ * degrades to the public visibility setter.
182
+ */
183
+ private expandThinking;
184
+ private componentForRow;
185
+ private renderBlocks;
186
+ }
@@ -0,0 +1,693 @@
1
+ import { AssistantMessageComponent, getMarkdownTheme, ToolExecutionComponent, UserMessageComponent, } from "@earendil-works/pi-coding-agent";
2
+ import { Container, MouseRegion, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
3
+ import { ensureTranscriptTheme, safeTerminalText, } from "./transcript.js";
4
+ const DETACHED_TUI = { requestRender() { } };
5
+ const ESC_SEQUENCE = String.fromCharCode(27);
6
+ const BEL_SEQUENCE = String.fromCharCode(7);
7
+ const OSC_133_SEQUENCE = new RegExp(`${ESC_SEQUENCE}]133;[ABC]${BEL_SEQUENCE}`, "g");
8
+ /** Embedded overlays must not leak Pi's shell-integration zone markers. */
9
+ function stripOsc133(lines) {
10
+ return lines.map((line) => line.replace(OSC_133_SEQUENCE, ""));
11
+ }
12
+ /**
13
+ * A click on the native thinking-block affordance. Pi's thinking `MouseRegion`
14
+ * only inspects type/button; coordinates are irrelevant. The presenter uses
15
+ * this through the public `MouseRegion.handleMouse` path so a unified toggle
16
+ * sets the same per-block override a real click would set.
17
+ */
18
+ const THINKING_CLICK_EVENT = {
19
+ type: "click",
20
+ button: "left",
21
+ x: 0,
22
+ y: 0,
23
+ screenX: 0,
24
+ screenY: 0,
25
+ width: 1,
26
+ height: 1,
27
+ shift: false,
28
+ alt: false,
29
+ ctrl: false,
30
+ clickCount: 1,
31
+ };
32
+ /**
33
+ * Collects the public mouse regions Pi's assistant renderer wraps around
34
+ * thinking blocks. Only public `Container.children` is walked (the assistant
35
+ * component's content container and its direct children), so deeper nested
36
+ * regions such as future link affordances are not clicked. The private content
37
+ * container field and region callbacks are never read. `MouseRegion` is a
38
+ * pi-tui peer export, so the host and this package share the same class.
39
+ */
40
+ function collectThinkingMouseRegions(component) {
41
+ const regions = [];
42
+ for (const child of component.children) {
43
+ if (child instanceof MouseRegion) {
44
+ regions.push(child);
45
+ continue;
46
+ }
47
+ if (!(child instanceof Container))
48
+ continue;
49
+ for (const nested of child.children) {
50
+ if (nested instanceof MouseRegion)
51
+ regions.push(nested);
52
+ }
53
+ }
54
+ return regions;
55
+ }
56
+ /**
57
+ * Mirrors the segmentation used by `renderTranscriptLines`: a turn is not a
58
+ * message, and a tool call or a repeated content kind starts a new assistant
59
+ * segment. Each segment carries the entry ids that produced it so the
60
+ * presenter can keep one native component per message across updates.
61
+ */
62
+ function buildPresenterBlocks(entries) {
63
+ const blocks = [];
64
+ let pendingAssistant;
65
+ const latestResults = new Map();
66
+ const finishedTurns = new Set();
67
+ for (const entry of entries) {
68
+ if (entry.type === "tool-result")
69
+ latestResults.set(entry.toolCallId, entry);
70
+ if (entry.type === "turn-boundary" && entry.phase === "end")
71
+ finishedTurns.add(entry.turnId);
72
+ }
73
+ const flushAssistant = () => {
74
+ if (!pendingAssistant)
75
+ return;
76
+ blocks.push(pendingAssistant);
77
+ pendingAssistant = undefined;
78
+ };
79
+ const appendAssistantText = (entry) => {
80
+ const text = safeTerminalText(entry.text);
81
+ if (!text)
82
+ return;
83
+ const field = entry.type === "thinking" ? "thinking" : "text";
84
+ if (pendingAssistant?.[field])
85
+ flushAssistant();
86
+ if (!pendingAssistant) {
87
+ pendingAssistant = {
88
+ kind: "assistant",
89
+ segmentId: entry.id,
90
+ entryIds: [],
91
+ thinking: "",
92
+ text: "",
93
+ streaming: false,
94
+ };
95
+ }
96
+ pendingAssistant[field] = text;
97
+ pendingAssistant.entryIds.push(entry.id);
98
+ pendingAssistant.streaming =
99
+ pendingAssistant.streaming ||
100
+ (entry.streaming && !finishedTurns.has(entry.turnId));
101
+ };
102
+ for (const entry of entries) {
103
+ switch (entry.type) {
104
+ case "turn-boundary":
105
+ flushAssistant();
106
+ if (entry.phase === "start" && blocks.length > 0)
107
+ blocks.push({ kind: "separator" });
108
+ break;
109
+ case "user-message":
110
+ flushAssistant();
111
+ blocks.push({
112
+ kind: "user",
113
+ entryId: entry.id,
114
+ text: safeTerminalText(entry.text),
115
+ });
116
+ break;
117
+ case "thinking":
118
+ case "assistant-text":
119
+ appendAssistantText(entry);
120
+ break;
121
+ case "tool-call": {
122
+ flushAssistant();
123
+ const result = latestResults.get(entry.toolCallId);
124
+ blocks.push({
125
+ kind: "tool",
126
+ entryId: entry.id,
127
+ toolCallId: entry.toolCallId,
128
+ toolName: entry.toolName,
129
+ args: entry.args,
130
+ result: result?.result ?? null,
131
+ isError: result?.isError ?? false,
132
+ streaming: (result?.streaming ?? false) && !finishedTurns.has(entry.turnId),
133
+ });
134
+ break;
135
+ }
136
+ case "tool-result":
137
+ break;
138
+ case "notice":
139
+ flushAssistant();
140
+ blocks.push({
141
+ kind: "notice",
142
+ entryId: entry.id,
143
+ text: safeTerminalText(entry.text),
144
+ tone: entry.tone,
145
+ });
146
+ break;
147
+ default:
148
+ break;
149
+ }
150
+ }
151
+ flushAssistant();
152
+ return blocks;
153
+ }
154
+ function blockIdentity(block) {
155
+ switch (block.kind) {
156
+ case "separator":
157
+ return "separator";
158
+ case "user":
159
+ return `user:${block.entryId}`;
160
+ case "assistant":
161
+ return `assistant:${block.segmentId}`;
162
+ case "tool":
163
+ return `tool:${block.toolCallId}:${block.toolName}`;
164
+ case "notice":
165
+ return `notice:${block.entryId}:${block.tone}:${block.text}`;
166
+ }
167
+ }
168
+ function createAssistantMessage(thinking, text) {
169
+ const content = [
170
+ ...(thinking ? [{ type: "thinking", thinking }] : []),
171
+ ...(text ? [{ type: "text", text }] : []),
172
+ ];
173
+ // Pi's renderer reads only role/content. A transcript segment can combine
174
+ // streamed updates that have no single provider response.
175
+ return { role: "assistant", content };
176
+ }
177
+ function noticeToneColor(tone) {
178
+ switch (tone) {
179
+ case "error":
180
+ return "error";
181
+ case "warning":
182
+ return "warning";
183
+ default:
184
+ return "dim";
185
+ }
186
+ }
187
+ function toComponentResult(value, isError) {
188
+ const payload = value && typeof value === "object"
189
+ ? value
190
+ : {};
191
+ const content = Array.isArray(payload.content)
192
+ ? payload.content.map((part) => ({
193
+ type: part?.type ?? "text",
194
+ text: part?.text,
195
+ data: part?.data,
196
+ mimeType: part?.mimeType,
197
+ }))
198
+ : [];
199
+ return { content, details: payload.details, isError };
200
+ }
201
+ /**
202
+ * Stateless fallback for tool blocks rendered without a live registry. The
203
+ * component is rebuilt per frame, so callers that need persistent tool
204
+ * expansion state should pass `toolComponents`.
205
+ */
206
+ function createAdHocToolComponent(block, options) {
207
+ const component = new ToolExecutionComponent(block.toolName, block.toolCallId, block.args ?? {}, {
208
+ showImages: options.showImages,
209
+ imageWidthCells: options.imageWidthCells,
210
+ }, options.resolveToolDefinition?.(block.toolName), DETACHED_TUI, options.cwd ?? process.cwd());
211
+ component.setArgsComplete();
212
+ component.markExecutionStarted();
213
+ if (block.result) {
214
+ component.updateResult(toComponentResult(block.result, block.isError), block.streaming);
215
+ }
216
+ return component;
217
+ }
218
+ /**
219
+ * Opt-in stateful transcript presenter.
220
+ *
221
+ * It consumes the same `TranscriptEntry` values as `renderTranscriptLines`,
222
+ * but keeps one native `UserMessageComponent` per user entry and one native
223
+ * `AssistantMessageComponent` per assistant message segment. Assistant
224
+ * components are constructed empty and receive content through
225
+ * `updateContent(message, streaming)`, so a host-side thinking-collapse patch
226
+ * observes the real streaming state instead of an already-finished message.
227
+ *
228
+ * The presenter owns its display revision: entry changes, thinking toggles,
229
+ * theme invalidation, width changes, and component-initiated repaint requests
230
+ * all raise it. `render` reuses its line cache only while that revision and
231
+ * the width are unchanged; content is never re-assigned on a pure repaint or
232
+ * resize.
233
+ *
234
+ * Mouse handling is normalized: pass a `TuiMouseEvent` whose `y` is a row in
235
+ * the full transcript (visible row + scroll offset). The presenter maps it to
236
+ * the owning component and forwards it through the component's public
237
+ * `handleMouse`, so Pi's native thinking-block and tool-expansion click paths
238
+ * keep working without private fields.
239
+ */
240
+ export class TranscriptPresenter {
241
+ options;
242
+ assistantComponents = new Map();
243
+ assistantContent = new Map();
244
+ userComponents = new Map();
245
+ userText = new Map();
246
+ toolState = new Map();
247
+ blocks = [];
248
+ blockIdentities = [];
249
+ rows = [];
250
+ renderedToolComponents = new Map();
251
+ cachedFrame = null;
252
+ renderedWidth = 0;
253
+ renderedRevision = -1;
254
+ revisionValue = 0;
255
+ thinkingPreference;
256
+ expandedSegments = new Set();
257
+ attachedTui;
258
+ disposed = false;
259
+ constructor(options) {
260
+ ensureTranscriptTheme();
261
+ this.options = options;
262
+ this.thinkingPreference =
263
+ options.hideThinkingBlock === true ? "hidden" : "auto";
264
+ this.attachedTui = options.tui ?? null;
265
+ }
266
+ /** Latest display revision. */
267
+ get revision() {
268
+ return this.revisionValue;
269
+ }
270
+ /** Retained presenter-owned message components (user + assistant). */
271
+ get componentCount() {
272
+ return this.assistantComponents.size + this.userComponents.size;
273
+ }
274
+ /**
275
+ * The presenter's local thinking preference. This is not the host patch's
276
+ * effective per-message state: in `auto` a collapse patch may still hide a
277
+ * completed message while the preference remains "visible".
278
+ */
279
+ get thinkingVisible() {
280
+ return this.thinkingPreference !== "hidden";
281
+ }
282
+ /** Wires the host TUI that receives repaint requests. */
283
+ attachTui(tui) {
284
+ this.attachedTui = tui;
285
+ }
286
+ /** Stops forwarding repaint requests without discarding retained state. */
287
+ detachTui() {
288
+ this.attachedTui = null;
289
+ }
290
+ /**
291
+ * Marks the display dirty and asks the attached TUI to repaint. Hosts wire
292
+ * tool components' repaint requests here so renderer-driven invalidations
293
+ * bypass the presenter's line cache.
294
+ */
295
+ requestRender() {
296
+ if (this.disposed)
297
+ return;
298
+ this.revisionValue++;
299
+ this.attachedTui?.requestRender();
300
+ }
301
+ /**
302
+ * Synchronizes the presenter with the current entries. Components are
303
+ * created or updated only when their segment/content actually changed; a
304
+ * repeated sync of unchanged entries leaves the display revision alone.
305
+ */
306
+ sync(entries) {
307
+ if (this.disposed)
308
+ return this.revisionValue;
309
+ const blocks = buildPresenterBlocks(entries);
310
+ const identities = blocks.map(blockIdentity);
311
+ let changed = identities.length !== this.blockIdentities.length ||
312
+ identities.some((identity, index) => identity !== this.blockIdentities[index]);
313
+ const seenAssistant = new Set();
314
+ const seenUser = new Set();
315
+ const seenTools = new Set();
316
+ for (const block of blocks) {
317
+ if (block.kind === "assistant") {
318
+ seenAssistant.add(block.segmentId);
319
+ const component = this.ensureAssistantComponent(block.segmentId);
320
+ const previous = this.assistantContent.get(block.segmentId);
321
+ if (!previous ||
322
+ previous.thinking !== block.thinking ||
323
+ previous.text !== block.text ||
324
+ previous.streaming !== block.streaming) {
325
+ component.updateContent(createAssistantMessage(block.thinking, block.text), block.streaming);
326
+ this.assistantContent.set(block.segmentId, {
327
+ thinking: block.thinking,
328
+ text: block.text,
329
+ streaming: block.streaming,
330
+ });
331
+ changed = true;
332
+ }
333
+ if (this.thinkingPreference === "visible") {
334
+ if (!block.thinking) {
335
+ this.expandedSegments.delete(block.segmentId);
336
+ }
337
+ else if (!this.expandedSegments.has(block.segmentId)) {
338
+ this.expandThinking(component);
339
+ this.expandedSegments.add(block.segmentId);
340
+ changed = true;
341
+ }
342
+ }
343
+ continue;
344
+ }
345
+ if (block.kind === "user") {
346
+ seenUser.add(block.entryId);
347
+ const previousText = this.userText.get(block.entryId);
348
+ if (previousText === undefined || previousText !== block.text) {
349
+ this.userComponents.set(block.entryId, new UserMessageComponent(block.text, getMarkdownTheme(), 1));
350
+ this.userText.set(block.entryId, block.text);
351
+ changed = true;
352
+ }
353
+ continue;
354
+ }
355
+ if (block.kind === "tool") {
356
+ seenTools.add(block.toolCallId);
357
+ const previous = this.toolState.get(block.toolCallId);
358
+ if (!previous ||
359
+ previous.args !== block.args ||
360
+ previous.result !== block.result ||
361
+ previous.isError !== block.isError ||
362
+ previous.streaming !== block.streaming) {
363
+ this.toolState.set(block.toolCallId, {
364
+ args: block.args,
365
+ result: block.result,
366
+ isError: block.isError,
367
+ streaming: block.streaming,
368
+ });
369
+ changed = true;
370
+ }
371
+ }
372
+ }
373
+ for (const segmentId of this.assistantComponents.keys()) {
374
+ if (seenAssistant.has(segmentId))
375
+ continue;
376
+ this.assistantComponents.delete(segmentId);
377
+ this.assistantContent.delete(segmentId);
378
+ this.expandedSegments.delete(segmentId);
379
+ }
380
+ for (const entryId of this.userComponents.keys()) {
381
+ if (seenUser.has(entryId))
382
+ continue;
383
+ this.userComponents.delete(entryId);
384
+ this.userText.delete(entryId);
385
+ }
386
+ for (const toolCallId of this.toolState.keys()) {
387
+ if (!seenTools.has(toolCallId))
388
+ this.toolState.delete(toolCallId);
389
+ }
390
+ this.blocks = blocks;
391
+ this.blockIdentities = identities;
392
+ if (changed) {
393
+ // The previous row ranges may reference removed/replaced components;
394
+ // refuse hits until the next render rebuilds the layout.
395
+ this.rows = [];
396
+ this.renderedToolComponents.clear();
397
+ this.requestRender();
398
+ }
399
+ return this.revisionValue;
400
+ }
401
+ /**
402
+ * Renders the synced entries at `width`. When nothing changed since the last
403
+ * frame, the cached frame is returned unchanged.
404
+ */
405
+ render(width) {
406
+ const targetWidth = Math.max(1, width);
407
+ if (this.disposed) {
408
+ return {
409
+ lines: [],
410
+ rows: [],
411
+ totalLines: 0,
412
+ width: targetWidth,
413
+ revision: this.revisionValue,
414
+ };
415
+ }
416
+ if (targetWidth !== this.renderedWidth) {
417
+ this.renderedWidth = targetWidth;
418
+ this.revisionValue++;
419
+ this.cachedFrame = null;
420
+ }
421
+ const startRevision = this.revisionValue;
422
+ if (this.cachedFrame &&
423
+ this.cachedFrame.width === targetWidth &&
424
+ this.renderedRevision === startRevision) {
425
+ return this.cachedFrame;
426
+ }
427
+ const rendered = this.renderBlocks(targetWidth);
428
+ this.rows = rendered.rows;
429
+ this.renderedToolComponents = rendered.toolComponents;
430
+ this.renderedRevision = startRevision;
431
+ const frame = {
432
+ lines: rendered.lines,
433
+ rows: rendered.rows,
434
+ totalLines: rendered.lines.length,
435
+ width: targetWidth,
436
+ revision: startRevision,
437
+ };
438
+ this.cachedFrame = frame;
439
+ return frame;
440
+ }
441
+ /**
442
+ * Routes a normalized mouse event (transcript-space `y`) to the component
443
+ * whose row contains it. Returns whether the component handled the event.
444
+ */
445
+ handleMouse(event) {
446
+ if (this.disposed)
447
+ return false;
448
+ const row = this.rows.find((candidate) => event.y >= candidate.top && event.y < candidate.top + candidate.height);
449
+ if (!row)
450
+ return false;
451
+ const component = this.componentForRow(row);
452
+ if (!component?.handleMouse)
453
+ return false;
454
+ const localEvent = {
455
+ ...event,
456
+ y: event.y - row.top,
457
+ width: this.renderedWidth,
458
+ height: row.height,
459
+ };
460
+ const result = component.handleMouse(localEvent);
461
+ if (!result)
462
+ return false;
463
+ const handled = result.handled === true || "target" in result;
464
+ if (handled)
465
+ this.requestRender();
466
+ return handled;
467
+ }
468
+ /**
469
+ * Applies the presenter's local thinking preference to every retained
470
+ * assistant component.
471
+ *
472
+ * Hiding uses the public `setHideThinkingBlock(true)`, which also clears
473
+ * native per-block overrides. Showing first forces the known collapsed state
474
+ * through the same public setter, then dispatches the native thinking-block
475
+ * click through `MouseRegion.handleMouse`. That sets the same per-block
476
+ * override a user click sets, so completed messages expand even while a
477
+ * host collapse patch keeps auto-collapsing them. No private component field
478
+ * is read and the streaming flag is never faked.
479
+ */
480
+ setThinkingVisible(visible) {
481
+ if (this.disposed)
482
+ return;
483
+ this.thinkingPreference = visible ? "visible" : "hidden";
484
+ if (visible) {
485
+ for (const [segmentId, component] of this.assistantComponents) {
486
+ this.expandThinking(component);
487
+ if (this.assistantContent.get(segmentId)?.thinking) {
488
+ this.expandedSegments.add(segmentId);
489
+ }
490
+ else {
491
+ this.expandedSegments.delete(segmentId);
492
+ }
493
+ }
494
+ }
495
+ else {
496
+ this.expandedSegments.clear();
497
+ for (const component of this.assistantComponents.values()) {
498
+ component.setHideThinkingBlock(true);
499
+ }
500
+ }
501
+ this.requestRender();
502
+ }
503
+ /** Flips the local thinking preference and returns the new visibility. */
504
+ toggleThinkingVisibility() {
505
+ const nextVisible = !this.thinkingVisible;
506
+ this.setThinkingVisible(nextVisible);
507
+ return nextVisible;
508
+ }
509
+ /**
510
+ * Invalidates native components for a theme change and raises the display
511
+ * revision. The host's global theme is never re-initialized here.
512
+ */
513
+ invalidate() {
514
+ if (this.disposed)
515
+ return;
516
+ const invalidated = new Set();
517
+ const invalidate = (component) => {
518
+ if (invalidated.has(component))
519
+ return;
520
+ invalidated.add(component);
521
+ component.invalidate();
522
+ };
523
+ for (const component of this.assistantComponents.values())
524
+ invalidate(component);
525
+ for (const component of this.userComponents.values())
526
+ invalidate(component);
527
+ for (const component of this.renderedToolComponents.values())
528
+ invalidate(component);
529
+ this.requestRender();
530
+ }
531
+ /** Drops retained message components and rendered layout. */
532
+ clear() {
533
+ if (this.disposed)
534
+ return;
535
+ this.dropRetainedState();
536
+ this.requestRender();
537
+ }
538
+ /**
539
+ * Releases every retained component and detaches the TUI. Idempotent; later
540
+ * calls to `sync`, `render`, and `handleMouse` degrade to no-ops.
541
+ */
542
+ dispose() {
543
+ if (this.disposed)
544
+ return;
545
+ this.disposed = true;
546
+ this.dropRetainedState();
547
+ this.attachedTui = null;
548
+ this.cachedFrame = null;
549
+ this.renderedRevision = -1;
550
+ this.revisionValue++;
551
+ }
552
+ dropRetainedState() {
553
+ this.assistantComponents.clear();
554
+ this.assistantContent.clear();
555
+ this.expandedSegments.clear();
556
+ this.userComponents.clear();
557
+ this.userText.clear();
558
+ this.toolState.clear();
559
+ this.renderedToolComponents.clear();
560
+ this.blocks = [];
561
+ this.blockIdentities = [];
562
+ this.rows = [];
563
+ this.cachedFrame = null;
564
+ this.renderedRevision = -1;
565
+ }
566
+ ensureAssistantComponent(segmentId) {
567
+ const existing = this.assistantComponents.get(segmentId);
568
+ if (existing)
569
+ return existing;
570
+ const component = new AssistantMessageComponent(undefined, this.thinkingPreference === "hidden", getMarkdownTheme(), this.options.thinkingLabel ?? "Thinking...", 1);
571
+ this.assistantComponents.set(segmentId, component);
572
+ return component;
573
+ }
574
+ /**
575
+ * Expands every thinking block in `component` through the native public
576
+ * click path. When the host has no thinking `MouseRegion` (an older Pi), it
577
+ * degrades to the public visibility setter.
578
+ */
579
+ expandThinking(component) {
580
+ if (collectThinkingMouseRegions(component).length === 0) {
581
+ component.setHideThinkingBlock(false);
582
+ return;
583
+ }
584
+ // Force a known collapsed render first so each region's click handler
585
+ // records "expand" as its override. Clicking while already expanded would
586
+ // collapse the block instead.
587
+ component.setHideThinkingBlock(true);
588
+ const count = collectThinkingMouseRegions(component).length;
589
+ for (let index = 0; index < count; index++) {
590
+ // The click rebuilds the component's content, so re-collect the current
591
+ // region for this run instead of holding a detached instance.
592
+ collectThinkingMouseRegions(component)[index]?.handleMouse(THINKING_CLICK_EVENT);
593
+ }
594
+ }
595
+ componentForRow(row) {
596
+ switch (row.kind) {
597
+ case "user":
598
+ return this.userComponents.get(row.entryId);
599
+ case "assistant":
600
+ return this.assistantComponents.get(row.segmentId);
601
+ case "tool":
602
+ return this.renderedToolComponents.get(row.toolCallId);
603
+ }
604
+ }
605
+ renderBlocks(width) {
606
+ const theme = this.options.theme;
607
+ const lines = [];
608
+ const rows = [];
609
+ const toolComponents = new Map();
610
+ if (this.blocks.length === 0) {
611
+ return {
612
+ lines: [
613
+ theme.fg("dim", this.options.emptyText ?? "No transcript yet."),
614
+ ],
615
+ rows,
616
+ toolComponents,
617
+ };
618
+ }
619
+ const assistantBadge = theme.bg(this.options.assistantBadgeBackground ?? "customMessageBg", theme.fg(this.options.assistantBadgeForeground ?? "success", theme.bold(` ${this.options.assistantLabel ?? "Assistant"} `)));
620
+ const separator = theme.fg("borderMuted", "────────────────────────────────────────");
621
+ const blankBefore = () => {
622
+ if (lines.length > 0 && lines.at(-1) !== "")
623
+ lines.push("");
624
+ };
625
+ for (const block of this.blocks) {
626
+ switch (block.kind) {
627
+ case "separator":
628
+ blankBefore();
629
+ lines.push(separator);
630
+ break;
631
+ case "user": {
632
+ const component = this.userComponents.get(block.entryId);
633
+ if (!component)
634
+ break;
635
+ const rendered = stripOsc133(component.render(width));
636
+ rows.push({
637
+ kind: "user",
638
+ entryId: block.entryId,
639
+ top: lines.length,
640
+ height: rendered.length,
641
+ });
642
+ lines.push(...rendered);
643
+ break;
644
+ }
645
+ case "assistant": {
646
+ const component = this.assistantComponents.get(block.segmentId);
647
+ if (!component)
648
+ break;
649
+ blankBefore();
650
+ lines.push(assistantBadge);
651
+ const rendered = stripOsc133(component.render(width));
652
+ rows.push({
653
+ kind: "assistant",
654
+ segmentId: block.segmentId,
655
+ entryIds: block.entryIds,
656
+ top: lines.length,
657
+ height: rendered.length,
658
+ });
659
+ lines.push(...rendered);
660
+ break;
661
+ }
662
+ case "tool": {
663
+ blankBefore();
664
+ const component = this.options.toolComponents?.get(block.toolCallId) ??
665
+ createAdHocToolComponent(block, this.options);
666
+ toolComponents.set(block.toolCallId, component);
667
+ const rendered = component.render(width);
668
+ rows.push({
669
+ kind: "tool",
670
+ entryId: block.entryId,
671
+ toolCallId: block.toolCallId,
672
+ top: lines.length,
673
+ height: rendered.length,
674
+ });
675
+ lines.push(...rendered);
676
+ break;
677
+ }
678
+ case "notice": {
679
+ blankBefore();
680
+ const color = noticeToneColor(block.tone);
681
+ for (const noticeLine of block.text.split("\n")) {
682
+ const colored = theme.fg(color, noticeLine);
683
+ lines.push(visibleWidth(colored) > width
684
+ ? truncateToWidth(colored, width, "")
685
+ : colored);
686
+ }
687
+ break;
688
+ }
689
+ }
690
+ }
691
+ return { lines, rows, toolComponents };
692
+ }
693
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xzzpig/pi-components",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": true,
5
5
  "description": "Reusable transcript components for Pi extensions.",
6
6
  "license": "MIT",
@@ -21,6 +21,10 @@
21
21
  "./transcript": {
22
22
  "types": "./dist/src/transcript.d.ts",
23
23
  "default": "./dist/src/transcript.js"
24
+ },
25
+ "./transcript-presenter": {
26
+ "types": "./dist/src/transcript-presenter.d.ts",
27
+ "default": "./src/transcript-presenter.ts"
24
28
  }
25
29
  },
26
30
  "scripts": {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@xzzpig/pi-subagents",
4
- "version": "0.24.1",
4
+ "version": "0.24.2",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/nicobailon/pi-subagents.git"
10
+ "url": "git+https://github.com/xzzpig/pi-extensions.git"
11
11
  },
12
12
  "homepage": "https://github.com/nicobailon/pi-subagents#readme",
13
13
  "bugs": {
@@ -17,7 +17,7 @@
17
17
  "pi-subagents": "install.mjs"
18
18
  },
19
19
  "dependencies": {
20
- "@xzzpig/pi-components": "0.4.0",
20
+ "@xzzpig/pi-components": "0.5.0",
21
21
  "@js-temporal/polyfill": "0.5.1",
22
22
  "acorn": "8.18.0",
23
23
  "jiti": "2.7.0",