@oldflag2333333/pi-subagent 0.1.3 → 0.1.4

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 CHANGED
@@ -184,6 +184,8 @@ Messages use custom inbox cards and Pi’s native run preparation, without extra
184
184
  - **Subs have separate conversations.** They receive their task, profile, and normal project context—not Main's chat history. Include the details they need in the task.
185
185
  - **Reloading Main does not close Subs.** Close tabs you no longer need. Hard crashes may require manual cleanup.
186
186
 
187
+ Before a fresh or resumed Sub launch, the plugin submits a short shell probe and waits up to 60 seconds for it to execute before submitting the full Pi command. This avoids macOS truncating long commands (especially resume paths) and dropping Enter while the shell is still initializing. The wait is cancellable; launch failure attempts to close the new tab rather than sending Enter to a partial command. See [Herdr issue #4950](https://github.com/herdrdev/herdr/issues/4950).
188
+
187
189
  If a profile is missing or fails to start, run `/profiles` first. Check its directory/name match, project trust, and any referenced tools, skills, or extensions. If Herdr is unavailable, confirm Pi is running inside a Herdr workspace.
188
190
 
189
191
  To hide or show Pi Subagent Subs in Herdr's Agents panel, see the optional [Herdr companion plugin](herdr-plugin/README.md).
package/README.zh-CN.md CHANGED
@@ -184,6 +184,8 @@ reviewer/
184
184
  - **子助手拥有独立对话。** 它会收到任务、角色配置和常规项目上下文,但不会收到主对话的聊天记录。请在任务中提供必要信息。
185
185
  - **重载主 Pi 不会关闭子助手。** 不再需要时请关闭标签页;异常崩溃后可能需要手动清理。
186
186
 
187
+ 新建或恢复子助手时,插件先发送一条短 shell 探针,并等待最多 60 秒确认它已执行,再提交完整 Pi 命令。这样可避免 macOS 上 shell 仍在初始化时,长命令(尤其是包含会话路径的 resume)被截断、末尾 Enter 丢失的问题。探针等待支持取消;启动失败会尝试关闭新建的标签页,不会向半截命令补发 Enter。参见 [Herdr 已知问题 #4950](https://github.com/herdrdev/herdr/issues/4950)。
188
+
187
189
  如果找不到角色或启动失败,先运行 `/profiles`,检查目录名与 `name` 是否一致、项目是否受信任,以及引用的工具、技能和扩展是否可用。如果提示 Herdr 不可用,请确认 Pi 正在 Herdr 工作区内运行。
188
190
 
189
191
  如需在 Herdr 的 Agents 面板中隐藏或显示 Pi Subagent 子助手,可安装可选的 [Herdr 配套插件](herdr-plugin/README.md)(英文说明)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oldflag2333333/pi-subagent",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Reusable specialist profiles and independent sub-agents for Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import * as fs from "node:fs";
2
3
  import * as path from "node:path";
3
4
  import { getAgentDir, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
@@ -99,6 +100,16 @@ export class HerdrTabAdapter implements SubSurfaceAdapter {
99
100
  try {
100
101
  if (created.code !== 0 || created.killed) throw new Error(created.stderr || "Failed to create Herdr tab.");
101
102
  if (!paneId) throw new Error("Herdr tab creation response did not contain a root pane ID.");
103
+ // A new pane's shell can still be initializing in canonical mode.
104
+ // On macOS a long launch line can lose its tail (including Enter).
105
+ // Execute a short probe first; match only its output, never the echoed
106
+ // command. Unwrapped rows keep a wrapped command from matching early.
107
+ const readyMarker = `pi-subagent-shell-ready-${randomUUID()}`;
108
+ await step(["pane", "run", paneId, `echo ${readyMarker}`], 10_000, "Failed to probe the Sub shell.");
109
+ await step([
110
+ "pane", "wait-output", paneId, "--regex", `^${readyMarker}$`,
111
+ "--source", "recent-unwrapped", "--timeout", "60000",
112
+ ], 65_000, "The Sub shell did not become ready.");
102
113
  const name = agentName(spec.runId);
103
114
  await step([
104
115
  "agent", "start", name, "--kind", "pi", "--pane", paneId, "--timeout", "60000", "--", ...subArgs(spec),