@tickernelz/paperclip-pro-adapter-utils 2026.1001.1 → 2026.1002.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.
- package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +8 -31
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +60 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +55 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +1 -3
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +0 -2
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +428 -114
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +3516 -1530
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +256 -78
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +0 -7
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +0 -6
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +19 -7
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +52 -36
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +62 -35
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +1 -3
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +0 -2
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +394 -188
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +4535 -464
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +236 -117
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/package.json +1 -1
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +591 -193
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +547 -303
- package/package.json +2 -2
|
@@ -711,8 +711,7 @@ export const zCreateElicitationRequest = preserveCustomPayload(z.intersection(z.
|
|
|
711
711
|
* Unique identifier for an MCP server using the ACP transport.
|
|
712
712
|
*
|
|
713
713
|
* The value is opaque and generated by the ACP component providing the MCP server. It is
|
|
714
|
-
* used by `mcp/
|
|
715
|
-
* server.
|
|
714
|
+
* used by `mcp/message` to route requests to the component that declared the server.
|
|
716
715
|
*
|
|
717
716
|
* @experimental
|
|
718
717
|
*/
|
|
@@ -720,54 +719,27 @@ export const zMcpServerAcpId = z.string();
|
|
|
720
719
|
/**
|
|
721
720
|
* **UNSTABLE**
|
|
722
721
|
*
|
|
723
|
-
*
|
|
724
|
-
*
|
|
725
|
-
*
|
|
726
|
-
*
|
|
727
|
-
* @experimental
|
|
728
|
-
*/
|
|
729
|
-
export const zConnectMcpRequest = z.object({
|
|
730
|
-
serverId: zMcpServerAcpId,
|
|
731
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
732
|
-
});
|
|
733
|
-
/**
|
|
734
|
-
* **UNSTABLE**
|
|
735
|
-
*
|
|
736
|
-
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
737
|
-
*
|
|
738
|
-
* A unique identifier for an active MCP-over-ACP connection.
|
|
722
|
+
* Identifies an inner MCP request active against a server on this ACP connection.
|
|
723
|
+
* Generated by the caller and preserved unchanged by proxies, independently of
|
|
724
|
+
* the outer ACP JSON-RPC request ID.
|
|
739
725
|
*
|
|
740
726
|
* @experimental
|
|
741
727
|
*/
|
|
742
|
-
export const
|
|
728
|
+
export const zMcpRequestId = z.string();
|
|
743
729
|
/**
|
|
744
730
|
* **UNSTABLE**
|
|
745
731
|
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
* Request parameters for `mcp/message`.
|
|
732
|
+
* Request parameters for `mcp/message`, sent from consumer to provider.
|
|
749
733
|
*
|
|
750
734
|
* @experimental
|
|
751
735
|
*/
|
|
752
736
|
export const zMessageMcpRequest = z.object({
|
|
753
|
-
|
|
737
|
+
serverId: zMcpServerAcpId,
|
|
738
|
+
requestId: zMcpRequestId,
|
|
754
739
|
method: z.string(),
|
|
755
740
|
params: z.record(z.string(), z.unknown()).nullish(),
|
|
756
741
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
757
742
|
});
|
|
758
|
-
/**
|
|
759
|
-
* **UNSTABLE**
|
|
760
|
-
*
|
|
761
|
-
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
762
|
-
*
|
|
763
|
-
* Request parameters for `mcp/disconnect`.
|
|
764
|
-
*
|
|
765
|
-
* @experimental
|
|
766
|
-
*/
|
|
767
|
-
export const zDisconnectMcpRequest = z.object({
|
|
768
|
-
connectionId: zMcpConnectionId,
|
|
769
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
770
|
-
});
|
|
771
743
|
/**
|
|
772
744
|
* Allows for sending an arbitrary request that is not part of the ACP spec.
|
|
773
745
|
* Extension methods provide a way to add custom functionality while maintaining
|
|
@@ -786,9 +758,7 @@ export const zAgentRequest = z.object({
|
|
|
786
758
|
.union([
|
|
787
759
|
zRequestPermissionRequest,
|
|
788
760
|
zCreateElicitationRequest,
|
|
789
|
-
zConnectMcpRequest,
|
|
790
761
|
zMessageMcpRequest,
|
|
791
|
-
zDisconnectMcpRequest,
|
|
792
762
|
zExtRequest,
|
|
793
763
|
])
|
|
794
764
|
.nullish(),
|
|
@@ -1415,6 +1385,37 @@ export const zSessionConfigOption = preserveCustomPayload(z.intersection(z.union
|
|
|
1415
1385
|
category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => undefined),
|
|
1416
1386
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1417
1387
|
})), "type", ["boolean", "select"]);
|
|
1388
|
+
/**
|
|
1389
|
+
* All text that was typed after the command name is provided as input.
|
|
1390
|
+
*/
|
|
1391
|
+
export const zTextCommandInput = z.object({
|
|
1392
|
+
hint: z.string(),
|
|
1393
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1394
|
+
});
|
|
1395
|
+
/**
|
|
1396
|
+
* The input specification for a command.
|
|
1397
|
+
*
|
|
1398
|
+
* Custom variants (unknown `type` values) keep their extra
|
|
1399
|
+
* properties exactly as received; unlike known variants, those keys
|
|
1400
|
+
* bypass lenient-field salvage and arrive unvalidated.
|
|
1401
|
+
*/
|
|
1402
|
+
export const zAvailableCommandInput = preserveCustomPayload(z.union([
|
|
1403
|
+
zTextCommandInput.and(z.object({
|
|
1404
|
+
type: z.literal("text"),
|
|
1405
|
+
})),
|
|
1406
|
+
excludeKnownTags(z.object({
|
|
1407
|
+
type: z.string(),
|
|
1408
|
+
}), "type", ["text"]),
|
|
1409
|
+
]), "type", ["text"]);
|
|
1410
|
+
/**
|
|
1411
|
+
* Information about a command.
|
|
1412
|
+
*/
|
|
1413
|
+
export const zAvailableCommand = z.object({
|
|
1414
|
+
name: z.string(),
|
|
1415
|
+
description: z.string(),
|
|
1416
|
+
input: defaultOnError(zAvailableCommandInput.nullish(), () => undefined),
|
|
1417
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1418
|
+
});
|
|
1418
1419
|
/**
|
|
1419
1420
|
* Response from creating a new session.
|
|
1420
1421
|
*
|
|
@@ -1423,6 +1424,7 @@ export const zSessionConfigOption = preserveCustomPayload(z.intersection(z.union
|
|
|
1423
1424
|
export const zNewSessionResponse = z.object({
|
|
1424
1425
|
sessionId: zSessionId,
|
|
1425
1426
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
|
|
1427
|
+
availableCommands: defaultOnError(vecSkipError(zAvailableCommand).optional(), () => []),
|
|
1426
1428
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1427
1429
|
});
|
|
1428
1430
|
/**
|
|
@@ -1466,6 +1468,7 @@ export const zDeleteSessionResponse = z.object({
|
|
|
1466
1468
|
export const zForkSessionResponse = z.object({
|
|
1467
1469
|
sessionId: zSessionId,
|
|
1468
1470
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
|
|
1471
|
+
availableCommands: defaultOnError(vecSkipError(zAvailableCommand).optional(), () => []),
|
|
1469
1472
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1470
1473
|
});
|
|
1471
1474
|
/**
|
|
@@ -1473,6 +1476,7 @@ export const zForkSessionResponse = z.object({
|
|
|
1473
1476
|
*/
|
|
1474
1477
|
export const zResumeSessionResponse = z.object({
|
|
1475
1478
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
|
|
1479
|
+
availableCommands: defaultOnError(vecSkipError(zAvailableCommand).optional(), () => []),
|
|
1476
1480
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1477
1481
|
});
|
|
1478
1482
|
/**
|
|
@@ -1638,18 +1642,6 @@ export const zCloseNesResponse = z.object({
|
|
|
1638
1642
|
* See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)
|
|
1639
1643
|
*/
|
|
1640
1644
|
export const zExtResponse = z.unknown();
|
|
1641
|
-
/**
|
|
1642
|
-
* **UNSTABLE**
|
|
1643
|
-
*
|
|
1644
|
-
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1645
|
-
*
|
|
1646
|
-
* Response to `mcp/message`.
|
|
1647
|
-
*
|
|
1648
|
-
* This is the inner MCP response result payload. Any JSON value is valid.
|
|
1649
|
-
*
|
|
1650
|
-
* @experimental
|
|
1651
|
-
*/
|
|
1652
|
-
export const zMessageMcpResponse = z.unknown();
|
|
1653
1645
|
/**
|
|
1654
1646
|
* Predefined error codes for common JSON-RPC and ACP-specific errors.
|
|
1655
1647
|
*
|
|
@@ -1712,7 +1704,6 @@ export const zAgentResponse = z.union([
|
|
|
1712
1704
|
zSuggestNesResponse,
|
|
1713
1705
|
zCloseNesResponse,
|
|
1714
1706
|
zExtResponse,
|
|
1715
|
-
zMessageMcpResponse,
|
|
1716
1707
|
]),
|
|
1717
1708
|
}),
|
|
1718
1709
|
z.object({
|
|
@@ -1839,6 +1830,26 @@ export const zIdleStateUpdate = z.object({
|
|
|
1839
1830
|
export const zRequiresActionStateUpdate = z.object({
|
|
1840
1831
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1841
1832
|
});
|
|
1833
|
+
/**
|
|
1834
|
+
* **UNSTABLE**
|
|
1835
|
+
*
|
|
1836
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1837
|
+
*
|
|
1838
|
+
* The Agent cannot currently determine foreground activity.
|
|
1839
|
+
*
|
|
1840
|
+
* Report this when activity becomes unobservable, not merely because the session
|
|
1841
|
+
* has been quiet. The Client MUST stop presenting the previous state as confirmed
|
|
1842
|
+
* current activity, but may retain it as last known. A later state replaces this
|
|
1843
|
+
* snapshot normally.
|
|
1844
|
+
*
|
|
1845
|
+
* This is not a task outcome or session closure. It does not cancel work, resolve
|
|
1846
|
+
* pending requests, or revoke capabilities; capabilities are updated separately.
|
|
1847
|
+
*
|
|
1848
|
+
* @experimental
|
|
1849
|
+
*/
|
|
1850
|
+
export const zUnknownStateUpdate = z.object({
|
|
1851
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1852
|
+
});
|
|
1842
1853
|
/**
|
|
1843
1854
|
* The state of the agent's foreground work has changed.
|
|
1844
1855
|
*
|
|
@@ -1859,10 +1870,13 @@ export const zStateUpdate = preserveCustomPayload(z.union([
|
|
|
1859
1870
|
zRequiresActionStateUpdate.and(z.object({
|
|
1860
1871
|
state: z.literal("requires_action"),
|
|
1861
1872
|
})),
|
|
1873
|
+
zUnknownStateUpdate.and(z.object({
|
|
1874
|
+
state: z.literal("unknown"),
|
|
1875
|
+
})),
|
|
1862
1876
|
excludeKnownTags(z.object({
|
|
1863
1877
|
state: z.string(),
|
|
1864
|
-
}), "state", ["idle", "requires_action", "running"]),
|
|
1865
|
-
]), "state", ["idle", "requires_action", "running"]);
|
|
1878
|
+
}), "state", ["idle", "requires_action", "running", "unknown"]),
|
|
1879
|
+
]), "state", ["idle", "requires_action", "running", "unknown"]);
|
|
1866
1880
|
/**
|
|
1867
1881
|
* A streamed item of tool-call content.
|
|
1868
1882
|
*
|
|
@@ -2045,37 +2059,6 @@ export const zPlanRemoved = z.object({
|
|
|
2045
2059
|
planId: zPlanId,
|
|
2046
2060
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2047
2061
|
});
|
|
2048
|
-
/**
|
|
2049
|
-
* All text that was typed after the command name is provided as input.
|
|
2050
|
-
*/
|
|
2051
|
-
export const zTextCommandInput = z.object({
|
|
2052
|
-
hint: z.string(),
|
|
2053
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2054
|
-
});
|
|
2055
|
-
/**
|
|
2056
|
-
* The input specification for a command.
|
|
2057
|
-
*
|
|
2058
|
-
* Custom variants (unknown `type` values) keep their extra
|
|
2059
|
-
* properties exactly as received; unlike known variants, those keys
|
|
2060
|
-
* bypass lenient-field salvage and arrive unvalidated.
|
|
2061
|
-
*/
|
|
2062
|
-
export const zAvailableCommandInput = preserveCustomPayload(z.union([
|
|
2063
|
-
zTextCommandInput.and(z.object({
|
|
2064
|
-
type: z.literal("text"),
|
|
2065
|
-
})),
|
|
2066
|
-
excludeKnownTags(z.object({
|
|
2067
|
-
type: z.string(),
|
|
2068
|
-
}), "type", ["text"]),
|
|
2069
|
-
]), "type", ["text"]);
|
|
2070
|
-
/**
|
|
2071
|
-
* Information about a command.
|
|
2072
|
-
*/
|
|
2073
|
-
export const zAvailableCommand = z.object({
|
|
2074
|
-
name: z.string(),
|
|
2075
|
-
description: z.string(),
|
|
2076
|
-
input: defaultOnError(zAvailableCommandInput.nullish(), () => undefined),
|
|
2077
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2078
|
-
});
|
|
2079
2062
|
/**
|
|
2080
2063
|
* Available commands are ready or have changed
|
|
2081
2064
|
*/
|
|
@@ -2221,6 +2204,113 @@ export const zCompactionSummaryChunk = z.object({
|
|
|
2221
2204
|
content: zContentBlock,
|
|
2222
2205
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2223
2206
|
});
|
|
2207
|
+
/**
|
|
2208
|
+
* **UNSTABLE**
|
|
2209
|
+
*
|
|
2210
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2211
|
+
*
|
|
2212
|
+
* Capability to cancel work in a subagent session without ending that session.
|
|
2213
|
+
*
|
|
2214
|
+
* Supplying `{}` advertises support; an omitted or `null` `cancel` does not.
|
|
2215
|
+
*
|
|
2216
|
+
* @experimental
|
|
2217
|
+
*/
|
|
2218
|
+
export const zSessionCancelCapabilities = z.object({
|
|
2219
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2220
|
+
});
|
|
2221
|
+
/**
|
|
2222
|
+
* **UNSTABLE**
|
|
2223
|
+
*
|
|
2224
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2225
|
+
*
|
|
2226
|
+
* Client-initiated session mutations permitted for a specific subagent session.
|
|
2227
|
+
*
|
|
2228
|
+
* A mutation requires an explicit per-child capability; support for the method
|
|
2229
|
+
* on ordinary sessions does not grant support on a child.
|
|
2230
|
+
*
|
|
2231
|
+
* @experimental
|
|
2232
|
+
*/
|
|
2233
|
+
export const zSubagentSessionCapabilities = z.object({
|
|
2234
|
+
cancel: defaultOnError(zSessionCancelCapabilities.nullish(), () => undefined),
|
|
2235
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2236
|
+
});
|
|
2237
|
+
/**
|
|
2238
|
+
* **UNSTABLE**
|
|
2239
|
+
*
|
|
2240
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2241
|
+
*
|
|
2242
|
+
* Notification that the enclosing parent session created and owns a child session.
|
|
2243
|
+
*
|
|
2244
|
+
* Later updates modify the existing association's metadata, not its ownership.
|
|
2245
|
+
*
|
|
2246
|
+
* Sent on the immediate parent session. The first update for an unknown
|
|
2247
|
+
* [`SubagentUpdate::session_id`] announces the child and MUST be sent
|
|
2248
|
+
* before any live request or notification bearing the child's session ID,
|
|
2249
|
+
* including messages naming it as sender or recipient. Child events are
|
|
2250
|
+
* delivered automatically; no separate child load, resume, or subscription is needed.
|
|
2251
|
+
* Understanding this update, registering child sessions, and applying their
|
|
2252
|
+
* operation restrictions are baseline v2 requirements; no Client capability
|
|
2253
|
+
* is required.
|
|
2254
|
+
*
|
|
2255
|
+
* Only [`SubagentUpdate::session_id`] is required. Other fields have
|
|
2256
|
+
* patch semantics: omitted fields leave the stored value unchanged, `null`
|
|
2257
|
+
* clears or unsets the value, and concrete values replace it. For `state`,
|
|
2258
|
+
* `null` removes the current state report and leaves activity unconfirmed;
|
|
2259
|
+
* it does not report idle or cancellation. A child whose capabilities are
|
|
2260
|
+
* unset permits no Client-initiated session mutations.
|
|
2261
|
+
*
|
|
2262
|
+
* The title and description provide the parent's display metadata for the
|
|
2263
|
+
* child. Agents SHOULD mirror known child state changes in the parent's
|
|
2264
|
+
* [`SubagentUpdate::state`] using the same [`StateUpdate`] snapshot as the
|
|
2265
|
+
* ordinary `state_update` notification on the child session. This reports
|
|
2266
|
+
* child state, not a separate parent-owned lifecycle. Consumers should
|
|
2267
|
+
* treat duplicate reports idempotently.
|
|
2268
|
+
* Completing or cancelling work does not end the association: the parent may
|
|
2269
|
+
* message the same child again. Individual messages and their outcomes do not
|
|
2270
|
+
* change this association.
|
|
2271
|
+
*
|
|
2272
|
+
* @experimental
|
|
2273
|
+
*/
|
|
2274
|
+
export const zSubagentUpdate = z.object({
|
|
2275
|
+
sessionId: zSessionId,
|
|
2276
|
+
title: defaultOnError(z.string().nullish(), () => undefined),
|
|
2277
|
+
description: defaultOnError(z.string().nullish(), () => undefined),
|
|
2278
|
+
capabilities: defaultOnError(zSubagentSessionCapabilities.nullish(), () => undefined),
|
|
2279
|
+
state: defaultOnError(zStateUpdate.nullish(), () => undefined),
|
|
2280
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2281
|
+
});
|
|
2282
|
+
/**
|
|
2283
|
+
* **UNSTABLE**
|
|
2284
|
+
*
|
|
2285
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2286
|
+
*
|
|
2287
|
+
* An upsert for an inter-session message.
|
|
2288
|
+
*
|
|
2289
|
+
* @experimental
|
|
2290
|
+
*/
|
|
2291
|
+
export const zSessionMessage = z.object({
|
|
2292
|
+
messageId: zMessageId,
|
|
2293
|
+
senderSessionId: defaultOnError(zSessionId.nullish(), () => undefined),
|
|
2294
|
+
recipientSessionId: defaultOnError(zSessionId.nullish(), () => undefined),
|
|
2295
|
+
content: defaultOnError(vecSkipError(zContentBlock).nullish(), () => undefined),
|
|
2296
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2297
|
+
});
|
|
2298
|
+
/**
|
|
2299
|
+
* **UNSTABLE**
|
|
2300
|
+
*
|
|
2301
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2302
|
+
*
|
|
2303
|
+
* A streamed content block of an inter-session message.
|
|
2304
|
+
*
|
|
2305
|
+
* @experimental
|
|
2306
|
+
*/
|
|
2307
|
+
export const zSessionMessageChunk = z.object({
|
|
2308
|
+
messageId: zMessageId,
|
|
2309
|
+
senderSessionId: defaultOnError(zSessionId.nullish(), () => undefined),
|
|
2310
|
+
recipientSessionId: defaultOnError(zSessionId.nullish(), () => undefined),
|
|
2311
|
+
content: zContentBlock,
|
|
2312
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2313
|
+
});
|
|
2224
2314
|
/**
|
|
2225
2315
|
* Different types of updates that can be sent while a session exists.
|
|
2226
2316
|
*
|
|
@@ -2293,6 +2383,15 @@ export const zSessionUpdate = preserveCustomPayload(z.union([
|
|
|
2293
2383
|
zCompactionSummaryChunk.and(z.object({
|
|
2294
2384
|
sessionUpdate: z.literal("compaction_summary_chunk"),
|
|
2295
2385
|
})),
|
|
2386
|
+
zSubagentUpdate.and(z.object({
|
|
2387
|
+
sessionUpdate: z.literal("subagent_update"),
|
|
2388
|
+
})),
|
|
2389
|
+
zSessionMessage.and(z.object({
|
|
2390
|
+
sessionUpdate: z.literal("session_message"),
|
|
2391
|
+
})),
|
|
2392
|
+
zSessionMessageChunk.and(z.object({
|
|
2393
|
+
sessionUpdate: z.literal("session_message_chunk"),
|
|
2394
|
+
})),
|
|
2296
2395
|
excludeKnownTags(z.object({
|
|
2297
2396
|
sessionUpdate: z.string(),
|
|
2298
2397
|
}), "sessionUpdate", [
|
|
@@ -2308,7 +2407,10 @@ export const zSessionUpdate = preserveCustomPayload(z.union([
|
|
|
2308
2407
|
"plan_removed",
|
|
2309
2408
|
"plan_update",
|
|
2310
2409
|
"session_info_update",
|
|
2410
|
+
"session_message",
|
|
2411
|
+
"session_message_chunk",
|
|
2311
2412
|
"state_update",
|
|
2413
|
+
"subagent_update",
|
|
2312
2414
|
"terminal_output_chunk",
|
|
2313
2415
|
"terminal_update",
|
|
2314
2416
|
"tool_call_content_chunk",
|
|
@@ -2330,7 +2432,10 @@ export const zSessionUpdate = preserveCustomPayload(z.union([
|
|
|
2330
2432
|
"plan_removed",
|
|
2331
2433
|
"plan_update",
|
|
2332
2434
|
"session_info_update",
|
|
2435
|
+
"session_message",
|
|
2436
|
+
"session_message_chunk",
|
|
2333
2437
|
"state_update",
|
|
2438
|
+
"subagent_update",
|
|
2334
2439
|
"terminal_output_chunk",
|
|
2335
2440
|
"terminal_update",
|
|
2336
2441
|
"tool_call_content_chunk",
|
|
@@ -2358,24 +2463,6 @@ export const zCompleteElicitationNotification = z.object({
|
|
|
2358
2463
|
elicitationId: zElicitationId,
|
|
2359
2464
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2360
2465
|
});
|
|
2361
|
-
/**
|
|
2362
|
-
* **UNSTABLE**
|
|
2363
|
-
*
|
|
2364
|
-
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2365
|
-
*
|
|
2366
|
-
* Notification parameters for `mcp/message`.
|
|
2367
|
-
*
|
|
2368
|
-
* This is used when the wrapped MCP message is a notification and the outer JSON-RPC
|
|
2369
|
-
* envelope has no `id`.
|
|
2370
|
-
*
|
|
2371
|
-
* @experimental
|
|
2372
|
-
*/
|
|
2373
|
-
export const zMessageMcpNotification = z.object({
|
|
2374
|
-
connectionId: zMcpConnectionId,
|
|
2375
|
-
method: z.string(),
|
|
2376
|
-
params: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2377
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2378
|
-
});
|
|
2379
2466
|
/**
|
|
2380
2467
|
* Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
|
|
2381
2468
|
* Extension notifications provide a way to send one-way messages for custom functionality
|
|
@@ -2393,7 +2480,6 @@ export const zAgentNotification = z.object({
|
|
|
2393
2480
|
.union([
|
|
2394
2481
|
zUpdateSessionNotification,
|
|
2395
2482
|
zCompleteElicitationNotification,
|
|
2396
|
-
zMessageMcpNotification,
|
|
2397
2483
|
zExtNotification,
|
|
2398
2484
|
])
|
|
2399
2485
|
.nullish(),
|
|
@@ -2591,7 +2677,7 @@ export const zMcpServerHttp = z.object({
|
|
|
2591
2677
|
* ACP transport configuration for MCP.
|
|
2592
2678
|
*
|
|
2593
2679
|
* The MCP server is provided by an ACP component and communicates over the ACP channel
|
|
2594
|
-
* using `mcp/
|
|
2680
|
+
* using `mcp/message`.
|
|
2595
2681
|
*
|
|
2596
2682
|
* @experimental
|
|
2597
2683
|
*/
|
|
@@ -2944,7 +3030,6 @@ export const zClientRequest = z.object({
|
|
|
2944
3030
|
zStartNesRequest,
|
|
2945
3031
|
zSuggestNesRequest,
|
|
2946
3032
|
zCloseNesRequest,
|
|
2947
|
-
zMessageMcpRequest,
|
|
2948
3033
|
zExtRequest,
|
|
2949
3034
|
])
|
|
2950
3035
|
.nullish(),
|
|
@@ -3023,28 +3108,49 @@ export const zCreateElicitationResponse = preserveCustomPayload(z.intersection(z
|
|
|
3023
3108
|
/**
|
|
3024
3109
|
* **UNSTABLE**
|
|
3025
3110
|
*
|
|
3026
|
-
*
|
|
3111
|
+
* An inner MCP error, distinct from an outer ACP binding or runtime error.
|
|
3027
3112
|
*
|
|
3028
|
-
*
|
|
3113
|
+
* `code` and `message` are required and non-null. `data` is optional;
|
|
3114
|
+
* explicit `null` is preserved separately from an omitted key.
|
|
3029
3115
|
*
|
|
3030
3116
|
* @experimental
|
|
3031
3117
|
*/
|
|
3032
|
-
export const
|
|
3033
|
-
|
|
3034
|
-
|
|
3118
|
+
export const zMcpError = z.looseObject({
|
|
3119
|
+
code: z
|
|
3120
|
+
.int()
|
|
3121
|
+
.min(-2147483648, {
|
|
3122
|
+
error: "Invalid value: Expected int32 to be >= -2147483648",
|
|
3123
|
+
})
|
|
3124
|
+
.max(2147483647, {
|
|
3125
|
+
error: "Invalid value: Expected int32 to be <= 2147483647",
|
|
3126
|
+
}),
|
|
3127
|
+
message: z.string(),
|
|
3128
|
+
data: z.unknown().optional(),
|
|
3035
3129
|
});
|
|
3036
3130
|
/**
|
|
3037
3131
|
* **UNSTABLE**
|
|
3038
3132
|
*
|
|
3039
|
-
*
|
|
3133
|
+
* The successful outer ACP `mcp/message` response carries exactly one
|
|
3134
|
+
* inner MCP outcome: an opaque result (including JSON null), or an MCP error.
|
|
3135
|
+
* Outer ACP errors are reserved for binding and runtime failures.
|
|
3040
3136
|
*
|
|
3041
|
-
*
|
|
3137
|
+
* Both branches require their carrier key. An error must be a non-null object.
|
|
3138
|
+
* Unknown outer fields are ignored; inner result and error fields are preserved.
|
|
3139
|
+
* Carrier `_meta` is optional; null or invalid values are treated as absent.
|
|
3140
|
+
* Senders must include exactly one outcome; receivers prefer `result` if both are present.
|
|
3042
3141
|
*
|
|
3043
3142
|
* @experimental
|
|
3044
3143
|
*/
|
|
3045
|
-
export const
|
|
3046
|
-
|
|
3047
|
-
|
|
3144
|
+
export const zMessageMcpResponse = z.union([
|
|
3145
|
+
z.object({
|
|
3146
|
+
result: z.unknown(),
|
|
3147
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3148
|
+
}),
|
|
3149
|
+
z.object({
|
|
3150
|
+
error: zMcpError,
|
|
3151
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3152
|
+
}),
|
|
3153
|
+
]);
|
|
3048
3154
|
/**
|
|
3049
3155
|
* A JSON-RPC response object.
|
|
3050
3156
|
*/
|
|
@@ -3054,8 +3160,6 @@ export const zClientResponse = z.union([
|
|
|
3054
3160
|
result: z.union([
|
|
3055
3161
|
zRequestPermissionResponse,
|
|
3056
3162
|
zCreateElicitationResponse,
|
|
3057
|
-
zConnectMcpResponse,
|
|
3058
|
-
zDisconnectMcpResponse,
|
|
3059
3163
|
zMessageMcpResponse,
|
|
3060
3164
|
zExtResponse,
|
|
3061
3165
|
]),
|
|
@@ -3160,6 +3264,21 @@ export const zRejectNesNotification = z.object({
|
|
|
3160
3264
|
reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),
|
|
3161
3265
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3162
3266
|
});
|
|
3267
|
+
/**
|
|
3268
|
+
* **UNSTABLE**
|
|
3269
|
+
*
|
|
3270
|
+
* Notification for an active request, sent from provider to consumer.
|
|
3271
|
+
* Includes subscription acknowledgements and updates.
|
|
3272
|
+
*
|
|
3273
|
+
* @experimental
|
|
3274
|
+
*/
|
|
3275
|
+
export const zMessageMcpNotification = z.object({
|
|
3276
|
+
serverId: zMcpServerAcpId,
|
|
3277
|
+
requestId: zMcpRequestId,
|
|
3278
|
+
method: z.string(),
|
|
3279
|
+
params: z.record(z.string(), z.unknown()).nullish(),
|
|
3280
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3281
|
+
});
|
|
3163
3282
|
/**
|
|
3164
3283
|
* A JSON-RPC notification object.
|
|
3165
3284
|
*/
|