@agentproto/acp 0.3.0 → 0.5.0

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.
@@ -9,6 +9,19 @@
9
9
  * `AcpHandle` is the readonly view of the same shape; tighten it by
10
10
  * hand for fields that get defaults applied in build().
11
11
  */
12
+ /**
13
+ * How a host resolves a `session/request_permission` request that was parked
14
+ * by permission-hold mode. `{ optionId }` selects one of the offered options
15
+ * (the allow- or reject-flavored one, chosen by the host); `{ cancelled: true }`
16
+ * maps to ACP's `cancelled` outcome (used when the request offers no matching
17
+ * option or the session is being torn down). Consumed by
18
+ * `AcpClient.respondPermission` and the daemon's permission inbox.
19
+ */
20
+ type AcpPermissionResolution = {
21
+ optionId: string;
22
+ } | {
23
+ cancelled: true;
24
+ };
12
25
  type AcpRole = "client" | "server" | "bridge";
13
26
  type AcpTransport = "stdio" | "websocket";
14
27
  type AcpTier = "basic" | "governance-aware" | "sandboxed";
@@ -42,6 +55,16 @@ interface AcpMcpServer {
42
55
  name: string;
43
56
  transport: "stdio" | "http" | "sse";
44
57
  ref?: string;
58
+ /** Static HTTP headers sent with every request to an `http` or `sse`
59
+ * MCP server. Useful for fixed auth tokens or content-negotiation
60
+ * headers that are safe to embed in config. */
61
+ headers?: Record<string, string>;
62
+ /** Brokered credential path resolved at spawn time into additional
63
+ * `headers` (typically an `Authorization` header). The path is passed
64
+ * to the daemon's credential broker, so the actual secret never lives
65
+ * in env or config. Mutually usable with `headers`; brokered headers
66
+ * win on collision. */
67
+ credentialRef?: string;
45
68
  }
46
69
  /** AIP-44 extensions on the agentskills.io baseline. Lives under `metadata.aip44`. */
47
70
  interface Aip44Extensions {
@@ -109,6 +132,22 @@ type StreamEvent = {
109
132
  toolCallId: string;
110
133
  toolName: string;
111
134
  arguments: unknown;
135
+ /**
136
+ * True when this event ENRICHES a call already announced under the same
137
+ * `toolCallId` rather than announcing a new one.
138
+ *
139
+ * ACP lets an agent announce a call before it knows the details and fill
140
+ * them in afterwards. The claude-code bridge does exactly that: its
141
+ * `tool_call` carries `title: "Read File"` with `rawInput: {}`, and the
142
+ * FOLLOWING `tool_call_update` carries `rawInput: {file_path: …}` plus a
143
+ * real title. Consumers must merge an update onto the existing call
144
+ * (keyed by `toolCallId`) rather than rendering a second card, and must
145
+ * not count it as a fresh call for logging or blocked-on purposes.
146
+ *
147
+ * `toolName` is `""` when the update carried no title — merge only
148
+ * non-empty names so an untitled enrichment can't erase a good one.
149
+ */
150
+ isUpdate?: boolean;
112
151
  } | {
113
152
  kind: "tool-result";
114
153
  sessionId: string;
@@ -122,8 +161,19 @@ type StreamEvent = {
122
161
  } | {
123
162
  kind: "agent-prompt";
124
163
  sessionId: string;
164
+ /**
165
+ * Correlation id for this prompt. In permission-hold mode this is the
166
+ * stable request id the host passes back to `respondPermission` to
167
+ * resolve the parked `session/request_permission` RPC — derived from the
168
+ * ACP `toolCall.toolCallId` plus a per-client counter so it stays unique
169
+ * even when an agent re-requests permission for the same tool call.
170
+ */
125
171
  toolCallId: string;
126
172
  options: unknown;
173
+ /** Human-readable "Allow X?" line, when derivable from the request. */
174
+ text?: string;
175
+ /** Tool title/kind the agent is asking permission for, when present. */
176
+ toolName?: string;
127
177
  } | {
128
178
  kind: "turn-end";
129
179
  sessionId: string;
@@ -160,6 +210,12 @@ type StreamEvent = {
160
210
  amount: number;
161
211
  currency: string;
162
212
  };
213
+ /** Cumulative input/output token counts, when the agent reports them
214
+ * (some ACP agents send per-token usage alongside the context-window
215
+ * `size`/`used`). Lets the daemon price a session that has tokens but
216
+ * no adapter-reported `cost`. */
217
+ tokensIn?: number;
218
+ tokensOut?: number;
163
219
  };
164
220
 
165
- export type { AcpDefinition as A, StreamEvent as S, AcpAuditConfig as a, AcpCapabilities as b, AcpHandle as c, AcpMcpServer as d, AcpRole as e, AcpTier as f, AcpTransport as g, Aip44Extensions as h };
221
+ export type { AcpDefinition as A, StreamEvent as S, AcpAuditConfig as a, AcpCapabilities as b, AcpHandle as c, AcpMcpServer as d, AcpPermissionResolution as e, AcpRole as f, AcpTier as g, AcpTransport as h, Aip44Extensions as i };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/acp",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "@agentproto/acp — AIP-44 ACP.md reference implementation. An agentproto profile of the Agent Client Protocol (agentclientprotocol.com). Wraps @agentclientprotocol/sdk with createAcpClient (drives subprocess agents) and createAcpServer (exposes AIP-9 operators to ACP-speaking IDEs).",
5
5
  "keywords": [
6
6
  "agentproto",
@@ -20,7 +20,7 @@
20
20
  "bugs": {
21
21
  "url": "https://github.com/agentproto/ts/issues"
22
22
  },
23
- "license": "MIT",
23
+ "license": "Apache-2.0",
24
24
  "type": "module",
25
25
  "main": "dist/index.mjs",
26
26
  "module": "dist/index.mjs",
@@ -65,13 +65,14 @@
65
65
  "@agentclientprotocol/sdk": "^0.21.0",
66
66
  "gray-matter": "^4.0.3",
67
67
  "zod": "^4.4.3",
68
- "@agentproto/define-doctype": "0.1.0"
68
+ "@agentproto/define-doctype": "0.1.1"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^25.6.2",
72
72
  "tsup": "^8.5.1",
73
73
  "typescript": "^5.9.3",
74
74
  "vitest": "^3.2.4",
75
+ "@agentproto/secrets": "0.2.0",
75
76
  "@agentproto/tooling": "0.1.0-alpha.0"
76
77
  },
77
78
  "scripts": {