acpx 0.1.13 → 0.1.14

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 (4) hide show
  1. package/README.md +2 -1
  2. package/dist/cli.d.ts +99 -12
  3. package/dist/cli.js +6236 -5530
  4. package/package.json +7 -6
package/README.md CHANGED
@@ -10,7 +10,8 @@
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
11
  [![Node.js](https://img.shields.io/node/v/acpx.svg)](https://nodejs.org)
12
12
 
13
- > Alpha notice: `acpx` is in alpha and the CLI/runtime interfaces are likely to change.
13
+ > ⚠️ `acpx` is in alpha and the CLI/runtime interfaces are likely to change. Anything you build downstream of this might break until it stabilizes.
14
+
14
15
  > ACP coverage status: see [ACP Spec Coverage Roadmap](docs/2026-02-19-acp-coverage-roadmap.md).
15
16
 
16
17
  Your agents love acpx! 🤖❤️ They hate having to scrape characters from a PTY session 😤
package/dist/cli.d.ts CHANGED
@@ -1,21 +1,102 @@
1
1
  #!/usr/bin/env node
2
- import { AgentCapabilities } from '@agentclientprotocol/sdk';
2
+ import { AgentCapabilities, SessionConfigOption } from '@agentclientprotocol/sdk';
3
3
 
4
- type SessionHistoryRole = "user" | "assistant";
5
- type SessionHistoryEntry = {
6
- role: SessionHistoryRole;
7
- timestamp: string;
8
- textPreview: string;
4
+ type SessionEventLog = {
5
+ active_path: string;
6
+ segment_count: number;
7
+ max_segment_bytes: number;
8
+ max_segments: number;
9
+ last_write_at?: string;
10
+ last_write_error?: string | null;
9
11
  };
10
- type SessionRecord = {
12
+ declare const SESSION_RECORD_SCHEMA: "acpx.session.v1";
13
+ type SessionMessageImage = {
14
+ source: string;
15
+ size?: {
16
+ width: number;
17
+ height: number;
18
+ } | null;
19
+ };
20
+ type SessionUserContent = {
21
+ Text: string;
22
+ } | {
23
+ Mention: {
24
+ uri: string;
25
+ content: string;
26
+ };
27
+ } | {
28
+ Image: SessionMessageImage;
29
+ };
30
+ type SessionToolUse = {
31
+ id: string;
32
+ name: string;
33
+ raw_input: string;
34
+ input: unknown;
35
+ is_input_complete: boolean;
36
+ thought_signature?: string | null;
37
+ };
38
+ type SessionToolResultContent = {
39
+ Text: string;
40
+ } | {
41
+ Image: SessionMessageImage;
42
+ };
43
+ type SessionToolResult = {
44
+ tool_use_id: string;
45
+ tool_name: string;
46
+ is_error: boolean;
47
+ content: SessionToolResultContent;
48
+ output?: unknown;
49
+ };
50
+ type SessionAgentContent = {
51
+ Text: string;
52
+ } | {
53
+ Thinking: {
54
+ text: string;
55
+ signature?: string | null;
56
+ };
57
+ } | {
58
+ RedactedThinking: string;
59
+ } | {
60
+ ToolUse: SessionToolUse;
61
+ };
62
+ type SessionUserMessage = {
11
63
  id: string;
12
- sessionId: string;
64
+ content: SessionUserContent[];
65
+ };
66
+ type SessionAgentMessage = {
67
+ content: SessionAgentContent[];
68
+ tool_results: Record<string, SessionToolResult>;
69
+ reasoning_details?: unknown | null;
70
+ };
71
+ type SessionMessage = {
72
+ User: SessionUserMessage;
73
+ } | {
74
+ Agent: SessionAgentMessage;
75
+ } | "Resume";
76
+ type SessionTokenUsage = {
77
+ input_tokens?: number;
78
+ output_tokens?: number;
79
+ cache_creation_input_tokens?: number;
80
+ cache_read_input_tokens?: number;
81
+ };
82
+ type SessionAcpxState = {
83
+ current_mode_id?: string;
84
+ available_commands?: string[];
85
+ config_options?: SessionConfigOption[];
86
+ };
87
+ type SessionRecord = {
88
+ schema: typeof SESSION_RECORD_SCHEMA;
89
+ acpxRecordId: string;
90
+ acpSessionId: string;
13
91
  agentSessionId?: string;
14
92
  agentCommand: string;
15
93
  cwd: string;
16
94
  name?: string;
17
95
  createdAt: string;
18
96
  lastUsedAt: string;
97
+ lastSeq: number;
98
+ lastRequestId?: string;
99
+ eventLog: SessionEventLog;
19
100
  closed?: boolean;
20
101
  closedAt?: string;
21
102
  pid?: number;
@@ -25,13 +106,19 @@ type SessionRecord = {
25
106
  lastAgentExitSignal?: NodeJS.Signals | null;
26
107
  lastAgentExitAt?: string;
27
108
  lastAgentDisconnectReason?: string;
28
- turnHistory?: SessionHistoryEntry[];
29
109
  protocolVersion?: number;
30
110
  agentCapabilities?: AgentCapabilities;
111
+ title?: string | null;
112
+ messages: SessionMessage[];
113
+ updated_at: string;
114
+ cumulative_token_usage: SessionTokenUsage;
115
+ request_token_usage: Record<string, SessionTokenUsage>;
116
+ acpx?: SessionAcpxState;
31
117
  };
32
118
 
33
119
  declare function parseTtlSeconds(value: string): number;
34
- declare function formatPromptSessionBannerLine(record: SessionRecord, currentCwd: string): string;
35
- declare function main(argv?: string[]): Promise<void>;
36
120
 
37
- export { formatPromptSessionBannerLine, main, parseTtlSeconds };
121
+ type SessionConnectionStatus = "connected" | "needs reconnect";
122
+ declare function formatPromptSessionBannerLine(record: SessionRecord, currentCwd: string, connectionStatus?: SessionConnectionStatus): string;
123
+
124
+ export { formatPromptSessionBannerLine, parseTtlSeconds };