@ctliz/agent-intercom-pi 0.14.0 → 0.14.1

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.ts +9 -3
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -17,9 +17,9 @@
17
17
  | AGY | [`agent-intercom-agy`](https://github.com/ctliz/agent-intercom-agy) |
18
18
  | Fleet lifecycle | [`agent-intercom-orchestrator`](https://github.com/ctliz/agent-intercom-orchestrator) |
19
19
 
20
- ## Pi 1.0 compatibility and codemode
20
+ ## Pi 1.1 compatibility and codemode
21
21
 
22
- Version 0.14.0 is tested with Pi 1.0.0. The preceding 0.13.0 release was tested with Pi 0.99.1. The development test baseline now uses Pi 1.0.0; host-provided Pi modules remain peer dependencies, not runtime dependencies. The existing protocol v4 broker, durable queues, acknowledgements, and cross-harness routing are unchanged.
22
+ Version 0.14.1 is tested with Pi 1.1.0. Version 0.14.0 was tested with Pi 1.0.0, and 0.13.0 with Pi 0.99.1. The development test baseline now uses Pi 1.1.0; host-provided Pi modules remain peer dependencies, not runtime dependencies. The existing protocol v4 broker, durable queues, acknowledgements, and cross-harness routing are unchanged.
23
23
 
24
24
  Pi 1.0 defaults to fullscreen; set `tuiMode` to `"regular"` or launch with `--tui-mode regular` to retain terminal scrollback. Codemode's shorter declarations preserve Intercom's structured `{ ok, text, data }` results and team guidelines. To check tool existence in a script, use `"intercom_send" in tools`, not `typeof tools.intercom_send`, because unknown members now throw. Restart existing Pi processes to use a newly installed Pi version; `/reload` only reloads resources inside the running version.
25
25
 
@@ -789,7 +789,7 @@ Custom broker commands are trusted local configuration: anyone who can edit this
789
789
  }
790
790
  ```
791
791
 
792
- Pi-intercom publishes live session status automatically. Sessions register as `idle`, switch to `thinking` while the agent is running, show `tool:<name>` during tool execution, and return to `idle` on agent completion. If `status` is set in config, it is appended as context instead of replacing the lifecycle status.
792
+ Pi-intercom publishes live session status automatically. Sessions register as `idle`, switch to `thinking` while the agent is running, and show `tool:<name>` during tool execution. They remain busy through automatic retries, compaction, and queued continuations until `agent_settled`. Normal settlement returns to `idle`; on Pi 1.1.0 or newer, `aborted: true` shows `cancelled` until the next run or session start. Older hosts without the `aborted` field continue to show `idle` after settlement. If `status` is set in config, it is appended as context instead of replacing the lifecycle status.
793
793
 
794
794
  By default, runtime state and config live under `~/.pi/agent/intercom`. If Pi is launched with `PI_CODING_AGENT_DIR`, pi-intercom uses `$PI_CODING_AGENT_DIR/intercom` instead, including `config.json`, broker PID/lock files, sockets, durable inboxes/outboxes, ask state, and launcher state. `PI_INTERCOM_ASK_WAIT_MS` controls the foreground ask wait (30 seconds by default); `PI_INTERCOM_ASK_TIMEOUT_MS` controls how long a deferred ask remains replyable (10 minutes by default).
795
795
 
package/index.ts CHANGED
@@ -721,6 +721,7 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
721
721
  let runtimeStarted = false;
722
722
  let runtimeGeneration = 0;
723
723
  let agentRunning = false;
724
+ let lastRunAborted = false;
724
725
  const activeTools = new Map<string, string>();
725
726
  const replyTracker = new ReplyTracker();
726
727
  const registeredControlTypes = new Set<string>();
@@ -848,7 +849,8 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
848
849
  function currentStatus(): string {
849
850
  const activeToolName = activeTools.values().next().value;
850
851
  const busy = agentRunning || getLiveContext()?.isIdle() === false;
851
- const lifecycleStatus = activeToolName ? `tool:${activeToolName}` : busy ? "thinking" : "idle";
852
+ const settledStatus = lastRunAborted ? "cancelled" : "idle";
853
+ const lifecycleStatus = activeToolName ? `tool:${activeToolName}` : busy ? "thinking" : settledStatus;
852
854
  const queueStatus = inboundInbox?.size ? ` · inbox:${inboundInbox.size}` : "";
853
855
  const outboxStatus = client?.outboxSize ? ` · outbox:${client.outboxSize}` : "";
854
856
  return config.status ? `${lifecycleStatus}${queueStatus}${outboxStatus} · ${config.status}` : `${lifecycleStatus}${queueStatus}${outboxStatus}`;
@@ -1594,6 +1596,7 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
1594
1596
  runtimeInstanceId = randomUUID();
1595
1597
  lastPresenceName = buildPresenceIdentity(pi, currentSessionId).name;
1596
1598
  agentRunning = false;
1599
+ lastRunAborted = false;
1597
1600
  activeTools.clear();
1598
1601
  startNamePoll();
1599
1602
  if (authorizedRecovered.length > 0) scheduleInboundFlush(0);
@@ -1823,6 +1826,7 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
1823
1826
  inboundLastQueuedAt = null;
1824
1827
  controlRegistrationGraceUntil = 0;
1825
1828
  agentRunning = false;
1829
+ lastRunAborted = false;
1826
1830
  activeTools.clear();
1827
1831
  if (client) {
1828
1832
  await client.disconnect(true);
@@ -1844,6 +1848,7 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
1844
1848
  return;
1845
1849
  }
1846
1850
  agentRunning = true;
1851
+ lastRunAborted = false;
1847
1852
  activeTools.clear();
1848
1853
  syncPresenceStatus();
1849
1854
  });
@@ -1864,14 +1869,15 @@ export default function piIntercomExtension(pi: ExtensionAPI) {
1864
1869
  pi.on("agent_end", (_event, ctx) => {
1865
1870
  if (!getLiveContext(ctx)) return;
1866
1871
  replyTracker.endTurn();
1867
- agentRunning = !ctx.isIdle();
1872
+ // Only agent_settled ends the busy state; retries and continuations can still follow.
1868
1873
  activeTools.clear();
1869
1874
  syncPresenceStatus();
1870
1875
  scheduleInboundFlush(0);
1871
1876
  });
1872
- pi.on("agent_settled", (_event, ctx) => {
1877
+ pi.on("agent_settled", (event, ctx) => {
1873
1878
  if (!getLiveContext(ctx)) return;
1874
1879
  agentRunning = false;
1880
+ lastRunAborted = event.aborted === true;
1875
1881
  activeTools.clear();
1876
1882
  syncPresenceStatus();
1877
1883
  scheduleInboundFlush(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctliz/agent-intercom-pi",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Pi coding-agent intercom for local messaging with Codex, Claude Code, OpenCode, Grok Build, and AGY agents.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "type": "module",
@@ -67,9 +67,9 @@
67
67
  "typebox": "*"
68
68
  },
69
69
  "devDependencies": {
70
- "@earendil-works/pi-ai": "^1.0.0",
71
- "@earendil-works/pi-coding-agent": "^1.0.0",
72
- "@earendil-works/pi-tui": "^1.0.0",
70
+ "@earendil-works/pi-ai": "^1.1.0",
71
+ "@earendil-works/pi-coding-agent": "^1.1.0",
72
+ "@earendil-works/pi-tui": "^1.1.0",
73
73
  "@types/node": "^22.15.0",
74
74
  "typebox": "*",
75
75
  "typescript": "^5.9.3"