poe-code 3.0.269 → 3.0.270

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-code",
3
- "version": "3.0.269",
3
+ "version": "3.0.270",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,10 +1,13 @@
1
- import type { SessionUpdate, ToolKind } from "../../../poe-acp-client/dist/index.js";
2
- import type { AcpEvent } from "./types.js";
1
+ import type { SessionUpdate as AcpClientSessionUpdate, ToolKind as AcpClientToolKind } from "../../../poe-acp-client/dist/index.js";
2
+ import type { AcpEvent, SessionUpdate as LegacySessionUpdate, ToolKind as LegacyToolKind } from "./types.js";
3
+ type ConvertibleSessionUpdate = AcpClientSessionUpdate | LegacySessionUpdate;
4
+ type ConvertibleToolKind = AcpClientToolKind | LegacyToolKind;
3
5
  export interface ToolRenderState {
4
6
  startedToolCalls: Set<string>;
5
7
  toolCallKinds: Map<string, string>;
6
8
  toolCallTitles: Map<string, string>;
7
9
  }
8
10
  export declare function createToolRenderState(): ToolRenderState;
9
- export declare function toRenderKind(kind: ToolKind | undefined | null): string;
10
- export declare function sessionUpdateToEvents(update: SessionUpdate, state: ToolRenderState): AcpEvent[];
11
+ export declare function toRenderKind(kind: ConvertibleToolKind | undefined | null): string;
12
+ export declare function sessionUpdateToEvents(update: ConvertibleSessionUpdate, state: ToolRenderState): AcpEvent[];
13
+ export {};
@@ -2,13 +2,13 @@ export function createToolRenderState() {
2
2
  return {
3
3
  startedToolCalls: new Set(),
4
4
  toolCallKinds: new Map(),
5
- toolCallTitles: new Map(),
5
+ toolCallTitles: new Map()
6
6
  };
7
7
  }
8
8
  export function toRenderKind(kind) {
9
9
  if (kind === "execute")
10
10
  return "exec";
11
- if (kind === "write")
11
+ if (kind === "write" || kind === "edit")
12
12
  return "edit";
13
13
  if (kind === "read")
14
14
  return "read";
@@ -60,7 +60,7 @@ export function sessionUpdateToEvents(update, state) {
60
60
  const usage = {
61
61
  event: "usage",
62
62
  inputTokens,
63
- outputTokens,
63
+ outputTokens
64
64
  };
65
65
  if (cachedTokens > 0) {
66
66
  usage.cachedTokens = cachedTokens;
@@ -79,31 +79,33 @@ export function sessionUpdateToEvents(update, state) {
79
79
  return [];
80
80
  }
81
81
  state.startedToolCalls.add(update.toolCallId);
82
- return [{
82
+ return [
83
+ {
83
84
  event: "tool_start",
84
85
  kind: renderKind,
85
86
  title,
86
- id: update.toolCallId,
87
- }];
87
+ id: update.toolCallId
88
+ }
89
+ ];
88
90
  }
89
91
  if (update.sessionUpdate === "tool_call_update") {
90
- const renderKind = toRenderKind(update.kind ?? undefined)
91
- || state.toolCallKinds.get(update.toolCallId)
92
- || "other";
92
+ const renderKind = (update.kind == null ? undefined : toRenderKind(update.kind)) ||
93
+ state.toolCallKinds.get(update.toolCallId) ||
94
+ "other";
93
95
  state.toolCallKinds.set(update.toolCallId, renderKind);
94
96
  const events = [];
95
97
  const toolTitle = toToolTitle(state.toolCallTitles.get(update.toolCallId) ?? update.toolCallId, update.locations);
96
98
  state.toolCallTitles.set(update.toolCallId, toolTitle);
97
99
  const status = update.status;
98
- const shouldStart = !state.startedToolCalls.has(update.toolCallId)
99
- && (status === "pending" || status === "in_progress");
100
+ const shouldStart = !state.startedToolCalls.has(update.toolCallId) &&
101
+ (status === "pending" || status === "in_progress");
100
102
  if (shouldStart) {
101
103
  state.startedToolCalls.add(update.toolCallId);
102
104
  events.push({
103
105
  event: "tool_start",
104
106
  kind: renderKind,
105
107
  title: toolTitle,
106
- id: update.toolCallId,
108
+ id: update.toolCallId
107
109
  });
108
110
  }
109
111
  if (status === "completed" || status === "failed" || status === "cancelled") {
@@ -113,14 +115,14 @@ export function sessionUpdateToEvents(update, state) {
113
115
  event: "tool_start",
114
116
  kind: renderKind,
115
117
  title: toolTitle,
116
- id: update.toolCallId,
118
+ id: update.toolCallId
117
119
  });
118
120
  }
119
121
  events.push({
120
122
  event: "tool_complete",
121
123
  kind: renderKind,
122
124
  path: extractToolOutputText(update),
123
- id: update.toolCallId,
125
+ id: update.toolCallId
124
126
  });
125
127
  }
126
128
  return events;
@@ -18,7 +18,7 @@
18
18
  */
19
19
  export type ToolKind = "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "other";
20
20
  /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
21
- export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed";
21
+ export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
22
22
  /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
23
23
  export interface ContentChunk {
24
24
  type: "text";
@@ -39,9 +39,12 @@ export interface ToolCall {
39
39
  sessionUpdate: "tool_call";
40
40
  toolCallId: string;
41
41
  title: string;
42
+ content?: ToolCallContent[];
42
43
  kind?: ToolKind;
44
+ locations?: ToolCallLocation[];
43
45
  status?: ToolCallStatus;
44
46
  rawInput?: unknown;
47
+ rawOutput?: unknown;
45
48
  _meta?: Record<string, unknown>;
46
49
  }
47
50
  /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
@@ -54,13 +57,22 @@ export type ToolCallContent = {
54
57
  data: string;
55
58
  };
56
59
  /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
60
+ export interface ToolCallLocation {
61
+ path: string;
62
+ lineNumber?: number | null;
63
+ _meta?: Record<string, unknown>;
64
+ }
65
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
57
66
  export interface ToolCallUpdate {
58
67
  sessionUpdate: "tool_call_update";
59
68
  toolCallId: string;
60
69
  kind?: ToolKind;
61
- status?: ToolCallStatus;
70
+ status?: ToolCallStatus | null;
62
71
  rawOutput?: unknown;
63
- content?: ToolCallContent[];
72
+ rawInput?: unknown;
73
+ content?: ToolCallContent[] | null;
74
+ locations?: ToolCallLocation[] | null;
75
+ title?: string | null;
64
76
  _meta?: Record<string, unknown>;
65
77
  }
66
78
  /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
@@ -17,6 +17,8 @@ export { spawnInteractive } from "./spawn-interactive.js";
17
17
  export { spawnAutonomous } from "./autonomous.js";
18
18
  export type { AutonomousOptions, StreamingSpawnFn, StreamingSpawnReturn } from "./autonomous.js";
19
19
  export { renderAcpEvent, renderAcpStream, renderSessionUpdateStream } from "./acp/renderer.js";
20
+ export { createToolRenderState, sessionUpdateToEvents } from "./acp/session-update-converter.js";
21
+ export type { ToolRenderState } from "./acp/session-update-converter.js";
20
22
  export type { LogEntry, MalformedSpawnLogRecord, ReadSpawnLogOptions } from "./acp/replay.js";
21
23
  export { findLatestLog, listSpawnLogs, pickRandomLog, readSpawnLog, replaySpawnLog } from "./acp/replay.js";
22
24
  export type { SpawnStreamingOptions, SpawnStreamingResult } from "./acp/spawn.js";
@@ -14,6 +14,7 @@ export { createSpawnParallel, SpawnParallelError } from "./parallel.js";
14
14
  export { spawnInteractive } from "./spawn-interactive.js";
15
15
  export { spawnAutonomous } from "./autonomous.js";
16
16
  export { renderAcpEvent, renderAcpStream, renderSessionUpdateStream } from "./acp/renderer.js";
17
+ export { createToolRenderState, sessionUpdateToEvents } from "./acp/session-update-converter.js";
17
18
  export { findLatestLog, listSpawnLogs, pickRandomLog, readSpawnLog, replaySpawnLog } from "./acp/replay.js";
18
19
  export { spawnStreaming } from "./acp/spawn.js";
19
20
  export { spawnAcp } from "./acp/spawn-acp.js";