@tickernelz/paperclip-pro-adapter-utils 2026.1016.0 → 2026.1016.2
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 +8 -191
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +10 -165
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +132 -52
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +29 -21
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +6 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.d.ts +563 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js +106 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.d.ts +1261 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js +4 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.d.ts +962 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js +526 -0
- package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +5 -6
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +13 -25
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +6 -6
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +0 -9
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +0 -10
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +1 -11
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +0 -10
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +1675 -2753
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +863 -1434
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +91 -534
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +42 -48
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +86 -139
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +46 -17
- 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 +55 -57
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +0 -59
- 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 -11
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +0 -10
- 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 +1870 -2874
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +3373 -2844
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +191 -563
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -1
- package/node_modules/@agentclientprotocol/sdk/package.json +7 -1
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +1541 -3196
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +875 -2664
- package/package.json +2 -2
|
@@ -378,8 +378,9 @@ export const zToolCallLocation = z.object({
|
|
|
378
378
|
* omitted fields leave the existing tool call value unchanged, `null` clears or
|
|
379
379
|
* unsets the value, and concrete values replace the previous value. For
|
|
380
380
|
* collection fields, concrete arrays replace the previous collection, and both
|
|
381
|
-
* `null` and `[]` clear the collection.
|
|
382
|
-
*
|
|
381
|
+
* `null` and `[]` clear the collection. A concrete `_meta` object instead
|
|
382
|
+
* patches the stored metadata by top-level key. When a client receives a tool
|
|
383
|
+
* call ID it has not seen before, omitted fields use client defaults.
|
|
383
384
|
*
|
|
384
385
|
* See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls)
|
|
385
386
|
*/
|
|
@@ -685,6 +686,18 @@ export const zElicitationUrlMode = z.intersection(z.union([zElicitationSessionSc
|
|
|
685
686
|
* either via a form or by directing them to a URL.
|
|
686
687
|
* Elicitations are tied to a session (optionally a tool call) or a request.
|
|
687
688
|
*
|
|
689
|
+
* A session-scoped request follows the aggregate foreground-state contract:
|
|
690
|
+
* agents SHOULD report `requires_action` when the whole foreground workflow is
|
|
691
|
+
* blocked on user action. Once reported, they MUST report `running` when progress
|
|
692
|
+
* resumes, or `idle` if work ends without resuming. Independent background requests
|
|
693
|
+
* and request-scoped elicitations do not themselves change session state.
|
|
694
|
+
* Accepting a URL does not mean the external interaction completed.
|
|
695
|
+
*
|
|
696
|
+
* Agents SHOULD cancel pending elicitations no longer needed by cancelled work.
|
|
697
|
+
* The request's scope alone does not establish that dependency.
|
|
698
|
+
*
|
|
699
|
+
* See protocol docs: [Elicitation](https://agentclientprotocol.com/protocol/v2/draft/elicitation)
|
|
700
|
+
*
|
|
688
701
|
* Custom variants (unknown `mode` values) keep their extra
|
|
689
702
|
* properties exactly as received; unlike known variants, those keys
|
|
690
703
|
* bypass lenient-field salvage and arrive unvalidated.
|
|
@@ -883,6 +896,53 @@ export const zSessionDeleteCapabilities = z.object({
|
|
|
883
896
|
export const zSessionAdditionalDirectoriesCapabilities = z.object({
|
|
884
897
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
885
898
|
});
|
|
899
|
+
/**
|
|
900
|
+
* **UNSTABLE**
|
|
901
|
+
*
|
|
902
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
903
|
+
*
|
|
904
|
+
* Capabilities for the `override` system prompt mode.
|
|
905
|
+
*
|
|
906
|
+
* Supplying `{}` means the agent supports replacing its built-in default
|
|
907
|
+
* instructions with the client-provided system prompt.
|
|
908
|
+
*
|
|
909
|
+
* @experimental
|
|
910
|
+
*/
|
|
911
|
+
export const zSessionSystemPromptOverrideCapabilities = z.object({
|
|
912
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
913
|
+
});
|
|
914
|
+
/**
|
|
915
|
+
* **UNSTABLE**
|
|
916
|
+
*
|
|
917
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
918
|
+
*
|
|
919
|
+
* System prompt delivery modes the agent supports in addition to `append`.
|
|
920
|
+
*
|
|
921
|
+
* `append` has no entry because every agent advertising `session.systemPrompt`
|
|
922
|
+
* supports it.
|
|
923
|
+
*
|
|
924
|
+
* @experimental
|
|
925
|
+
*/
|
|
926
|
+
export const zSessionSystemPromptModeCapabilities = z.object({
|
|
927
|
+
override: defaultOnError(zSessionSystemPromptOverrideCapabilities.nullish(), () => undefined),
|
|
928
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
929
|
+
});
|
|
930
|
+
/**
|
|
931
|
+
* **UNSTABLE**
|
|
932
|
+
*
|
|
933
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
934
|
+
*
|
|
935
|
+
* Capabilities for client-provided system prompts.
|
|
936
|
+
*
|
|
937
|
+
* Supplying `{}` means the agent supports `systemPrompt` on session lifecycle
|
|
938
|
+
* requests in `append` mode.
|
|
939
|
+
*
|
|
940
|
+
* @experimental
|
|
941
|
+
*/
|
|
942
|
+
export const zSessionSystemPromptCapabilities = z.object({
|
|
943
|
+
mode: defaultOnError(zSessionSystemPromptModeCapabilities.nullish(), () => undefined),
|
|
944
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
945
|
+
});
|
|
886
946
|
/**
|
|
887
947
|
* **UNSTABLE**
|
|
888
948
|
*
|
|
@@ -915,6 +975,7 @@ export const zSessionCapabilities = z.object({
|
|
|
915
975
|
mcp: defaultOnError(zMcpCapabilities.nullish(), () => undefined),
|
|
916
976
|
delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => undefined),
|
|
917
977
|
additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => undefined),
|
|
978
|
+
systemPrompt: defaultOnError(zSessionSystemPromptCapabilities.nullish(), () => undefined),
|
|
918
979
|
fork: defaultOnError(zSessionForkCapabilities.nullish(), () => undefined),
|
|
919
980
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
920
981
|
});
|
|
@@ -942,152 +1003,6 @@ export const zAgentAuthCapabilities = z.object({
|
|
|
942
1003
|
export const zProvidersCapabilities = z.object({
|
|
943
1004
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
944
1005
|
});
|
|
945
|
-
/**
|
|
946
|
-
* Marker for `document/didOpen` capability support.
|
|
947
|
-
*/
|
|
948
|
-
export const zNesDocumentDidOpenCapabilities = z.object({
|
|
949
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
950
|
-
});
|
|
951
|
-
/**
|
|
952
|
-
* How the agent wants document changes delivered.
|
|
953
|
-
*/
|
|
954
|
-
export const zTextDocumentSyncKind = z.union([
|
|
955
|
-
z.literal("full"),
|
|
956
|
-
z.literal("incremental"),
|
|
957
|
-
]);
|
|
958
|
-
/**
|
|
959
|
-
* Capabilities for `document/didChange` events.
|
|
960
|
-
*/
|
|
961
|
-
export const zNesDocumentDidChangeCapabilities = z.object({
|
|
962
|
-
syncKind: zTextDocumentSyncKind,
|
|
963
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
964
|
-
});
|
|
965
|
-
/**
|
|
966
|
-
* Marker for `document/didClose` capability support.
|
|
967
|
-
*/
|
|
968
|
-
export const zNesDocumentDidCloseCapabilities = z.object({
|
|
969
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
970
|
-
});
|
|
971
|
-
/**
|
|
972
|
-
* Marker for `document/didSave` capability support.
|
|
973
|
-
*/
|
|
974
|
-
export const zNesDocumentDidSaveCapabilities = z.object({
|
|
975
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
976
|
-
});
|
|
977
|
-
/**
|
|
978
|
-
* Marker for `document/didFocus` capability support.
|
|
979
|
-
*/
|
|
980
|
-
export const zNesDocumentDidFocusCapabilities = z.object({
|
|
981
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
982
|
-
});
|
|
983
|
-
/**
|
|
984
|
-
* Document event capabilities the agent wants to receive.
|
|
985
|
-
*/
|
|
986
|
-
export const zNesDocumentEventCapabilities = z.object({
|
|
987
|
-
didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => undefined),
|
|
988
|
-
didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => undefined),
|
|
989
|
-
didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => undefined),
|
|
990
|
-
didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => undefined),
|
|
991
|
-
didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => undefined),
|
|
992
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
993
|
-
});
|
|
994
|
-
/**
|
|
995
|
-
* Event capabilities the agent can consume.
|
|
996
|
-
*/
|
|
997
|
-
export const zNesEventCapabilities = z.object({
|
|
998
|
-
document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => undefined),
|
|
999
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1000
|
-
});
|
|
1001
|
-
/**
|
|
1002
|
-
* Capabilities for recent files context.
|
|
1003
|
-
*/
|
|
1004
|
-
export const zNesRecentFilesCapabilities = z.object({
|
|
1005
|
-
maxCount: defaultOnError(z
|
|
1006
|
-
.int()
|
|
1007
|
-
.gte(0)
|
|
1008
|
-
.max(4294967295, {
|
|
1009
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
1010
|
-
})
|
|
1011
|
-
.nullish(), () => undefined),
|
|
1012
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1013
|
-
});
|
|
1014
|
-
/**
|
|
1015
|
-
* Capabilities for related snippets context.
|
|
1016
|
-
*/
|
|
1017
|
-
export const zNesRelatedSnippetsCapabilities = z.object({
|
|
1018
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1019
|
-
});
|
|
1020
|
-
/**
|
|
1021
|
-
* Capabilities for edit history context.
|
|
1022
|
-
*/
|
|
1023
|
-
export const zNesEditHistoryCapabilities = z.object({
|
|
1024
|
-
maxCount: defaultOnError(z
|
|
1025
|
-
.int()
|
|
1026
|
-
.gte(0)
|
|
1027
|
-
.max(4294967295, {
|
|
1028
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
1029
|
-
})
|
|
1030
|
-
.nullish(), () => undefined),
|
|
1031
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1032
|
-
});
|
|
1033
|
-
/**
|
|
1034
|
-
* Capabilities for user actions context.
|
|
1035
|
-
*/
|
|
1036
|
-
export const zNesUserActionsCapabilities = z.object({
|
|
1037
|
-
maxCount: defaultOnError(z
|
|
1038
|
-
.int()
|
|
1039
|
-
.gte(0)
|
|
1040
|
-
.max(4294967295, {
|
|
1041
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
1042
|
-
})
|
|
1043
|
-
.nullish(), () => undefined),
|
|
1044
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1045
|
-
});
|
|
1046
|
-
/**
|
|
1047
|
-
* Capabilities for open files context.
|
|
1048
|
-
*/
|
|
1049
|
-
export const zNesOpenFilesCapabilities = z.object({
|
|
1050
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1051
|
-
});
|
|
1052
|
-
/**
|
|
1053
|
-
* Capabilities for diagnostics context.
|
|
1054
|
-
*/
|
|
1055
|
-
export const zNesDiagnosticsCapabilities = z.object({
|
|
1056
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1057
|
-
});
|
|
1058
|
-
/**
|
|
1059
|
-
* Context capabilities the agent wants attached to each suggestion request.
|
|
1060
|
-
*/
|
|
1061
|
-
export const zNesContextCapabilities = z.object({
|
|
1062
|
-
recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => undefined),
|
|
1063
|
-
relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => undefined),
|
|
1064
|
-
editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => undefined),
|
|
1065
|
-
userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => undefined),
|
|
1066
|
-
openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => undefined),
|
|
1067
|
-
diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => undefined),
|
|
1068
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1069
|
-
});
|
|
1070
|
-
/**
|
|
1071
|
-
* NES capabilities advertised by the agent during initialization.
|
|
1072
|
-
*
|
|
1073
|
-
* Supplying `{}` means the agent supports the NES method surface. Omitted or
|
|
1074
|
-
* `null` both mean the agent does not advertise support for `nes*` methods.
|
|
1075
|
-
*/
|
|
1076
|
-
export const zNesCapabilities = z.object({
|
|
1077
|
-
events: defaultOnError(zNesEventCapabilities.nullish(), () => undefined),
|
|
1078
|
-
context: defaultOnError(zNesContextCapabilities.nullish(), () => undefined),
|
|
1079
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1080
|
-
});
|
|
1081
|
-
/**
|
|
1082
|
-
* The encoding used for character offsets in positions.
|
|
1083
|
-
*
|
|
1084
|
-
* Follows the same conventions as LSP 3.17. The default is UTF-16.
|
|
1085
|
-
*/
|
|
1086
|
-
export const zPositionEncodingKind = z.union([
|
|
1087
|
-
z.literal("utf-16"),
|
|
1088
|
-
z.literal("utf-32"),
|
|
1089
|
-
z.literal("utf-8"),
|
|
1090
|
-
]);
|
|
1091
1006
|
/**
|
|
1092
1007
|
* Capabilities supported by the agent.
|
|
1093
1008
|
*
|
|
@@ -1100,8 +1015,6 @@ export const zAgentCapabilities = z.object({
|
|
|
1100
1015
|
session: defaultOnError(zSessionCapabilities.nullish(), () => undefined),
|
|
1101
1016
|
auth: defaultOnError(zAgentAuthCapabilities.nullish(), () => undefined),
|
|
1102
1017
|
providers: defaultOnError(zProvidersCapabilities.nullish(), () => undefined),
|
|
1103
|
-
nes: defaultOnError(zNesCapabilities.nullish(), () => undefined),
|
|
1104
|
-
positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => undefined),
|
|
1105
1018
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1106
1019
|
});
|
|
1107
1020
|
/**
|
|
@@ -1419,6 +1332,10 @@ export const zAvailableCommand = z.object({
|
|
|
1419
1332
|
/**
|
|
1420
1333
|
* Response from creating a new session.
|
|
1421
1334
|
*
|
|
1335
|
+
* New sessions default to `idle` until a state update reports otherwise.
|
|
1336
|
+
* Updates may arrive before or after this response. Clients MUST NOT overwrite
|
|
1337
|
+
* an already-reported state when the response arrives.
|
|
1338
|
+
*
|
|
1422
1339
|
* See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)
|
|
1423
1340
|
*/
|
|
1424
1341
|
export const zNewSessionResponse = z.object({
|
|
@@ -1473,6 +1390,12 @@ export const zForkSessionResponse = z.object({
|
|
|
1473
1390
|
});
|
|
1474
1391
|
/**
|
|
1475
1392
|
* Response from resuming an existing session.
|
|
1393
|
+
*
|
|
1394
|
+
* The agent MUST send a current `state_update` after any requested history
|
|
1395
|
+
* replay and before this response, even without replay. The update reports
|
|
1396
|
+
* foreground state after resuming. The response alone does not imply `idle`.
|
|
1397
|
+
*
|
|
1398
|
+
* See protocol docs: [Current-State Synchronization](https://agentclientprotocol.com/protocol/v2/draft/session-setup#current-state-synchronization)
|
|
1476
1399
|
*/
|
|
1477
1400
|
export const zResumeSessionResponse = z.object({
|
|
1478
1401
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
|
|
@@ -1507,137 +1430,15 @@ export const zMessageId = z.string();
|
|
|
1507
1430
|
* agent has finished processing it.
|
|
1508
1431
|
* Processing and completion are reported through `state_update` session updates.
|
|
1509
1432
|
*
|
|
1433
|
+
* Insertion is the logical addition of a user message with a message ID and a position
|
|
1434
|
+
* relative to other messages in the ACP conversation.
|
|
1435
|
+
*
|
|
1510
1436
|
* See protocol docs: [Prompt Accepted](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#2-prompt-accepted)
|
|
1511
1437
|
*/
|
|
1512
1438
|
export const zPromptResponse = z.object({
|
|
1513
1439
|
messageId: zMessageId,
|
|
1514
1440
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1515
1441
|
});
|
|
1516
|
-
/**
|
|
1517
|
-
* Response to `nes/start`.
|
|
1518
|
-
*/
|
|
1519
|
-
export const zStartNesResponse = z.object({
|
|
1520
|
-
sessionId: zSessionId,
|
|
1521
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1522
|
-
});
|
|
1523
|
-
/**
|
|
1524
|
-
* **UNSTABLE**
|
|
1525
|
-
*
|
|
1526
|
-
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
1527
|
-
*
|
|
1528
|
-
* Unique identifier for an NES suggestion.
|
|
1529
|
-
*
|
|
1530
|
-
* @experimental
|
|
1531
|
-
*/
|
|
1532
|
-
export const zNesSuggestionId = z.string();
|
|
1533
|
-
/**
|
|
1534
|
-
* A zero-based position in a text document.
|
|
1535
|
-
*
|
|
1536
|
-
* The meaning of `character` depends on the negotiated position encoding.
|
|
1537
|
-
*/
|
|
1538
|
-
export const zPosition = z.object({
|
|
1539
|
-
line: z.int().gte(0).max(4294967295, {
|
|
1540
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
1541
|
-
}),
|
|
1542
|
-
character: z.int().gte(0).max(4294967295, {
|
|
1543
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
1544
|
-
}),
|
|
1545
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1546
|
-
});
|
|
1547
|
-
/**
|
|
1548
|
-
* A range in a text document, expressed as start and end positions.
|
|
1549
|
-
*/
|
|
1550
|
-
export const zRange = z.object({
|
|
1551
|
-
start: zPosition,
|
|
1552
|
-
end: zPosition,
|
|
1553
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1554
|
-
});
|
|
1555
|
-
/**
|
|
1556
|
-
* A text edit within a suggestion.
|
|
1557
|
-
*/
|
|
1558
|
-
export const zNesTextEdit = z.object({
|
|
1559
|
-
range: zRange,
|
|
1560
|
-
newText: z.string(),
|
|
1561
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1562
|
-
});
|
|
1563
|
-
/**
|
|
1564
|
-
* A text edit suggestion.
|
|
1565
|
-
*/
|
|
1566
|
-
export const zNesEditSuggestion = z.object({
|
|
1567
|
-
suggestionId: zNesSuggestionId,
|
|
1568
|
-
uri: z.url(),
|
|
1569
|
-
edits: z.array(zNesTextEdit).min(1),
|
|
1570
|
-
cursorPosition: defaultOnError(zPosition.nullish(), () => undefined),
|
|
1571
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1572
|
-
});
|
|
1573
|
-
/**
|
|
1574
|
-
* A jump-to-location suggestion.
|
|
1575
|
-
*/
|
|
1576
|
-
export const zNesJumpSuggestion = z.object({
|
|
1577
|
-
suggestionId: zNesSuggestionId,
|
|
1578
|
-
uri: z.url(),
|
|
1579
|
-
position: zPosition,
|
|
1580
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1581
|
-
});
|
|
1582
|
-
/**
|
|
1583
|
-
* A rename symbol suggestion.
|
|
1584
|
-
*/
|
|
1585
|
-
export const zNesRenameSuggestion = z.object({
|
|
1586
|
-
suggestionId: zNesSuggestionId,
|
|
1587
|
-
uri: z.url(),
|
|
1588
|
-
position: zPosition,
|
|
1589
|
-
newName: z.string(),
|
|
1590
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1591
|
-
});
|
|
1592
|
-
/**
|
|
1593
|
-
* A search-and-replace suggestion.
|
|
1594
|
-
*/
|
|
1595
|
-
export const zNesSearchAndReplaceSuggestion = z.object({
|
|
1596
|
-
suggestionId: zNesSuggestionId,
|
|
1597
|
-
uri: z.url(),
|
|
1598
|
-
search: z.string(),
|
|
1599
|
-
replace: z.string(),
|
|
1600
|
-
isRegex: z.boolean().nullish(),
|
|
1601
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1602
|
-
});
|
|
1603
|
-
/**
|
|
1604
|
-
* A suggestion returned by the agent.
|
|
1605
|
-
*
|
|
1606
|
-
* Custom variants (unknown `kind` values) keep their extra
|
|
1607
|
-
* properties exactly as received; unlike known variants, those keys
|
|
1608
|
-
* bypass lenient-field salvage and arrive unvalidated.
|
|
1609
|
-
*/
|
|
1610
|
-
export const zNesSuggestion = preserveCustomPayload(z.union([
|
|
1611
|
-
zNesEditSuggestion.and(z.object({
|
|
1612
|
-
kind: z.literal("edit"),
|
|
1613
|
-
})),
|
|
1614
|
-
zNesJumpSuggestion.and(z.object({
|
|
1615
|
-
kind: z.literal("jump"),
|
|
1616
|
-
})),
|
|
1617
|
-
zNesRenameSuggestion.and(z.object({
|
|
1618
|
-
kind: z.literal("rename"),
|
|
1619
|
-
})),
|
|
1620
|
-
zNesSearchAndReplaceSuggestion.and(z.object({
|
|
1621
|
-
kind: z.literal("searchAndReplace"),
|
|
1622
|
-
})),
|
|
1623
|
-
excludeKnownTags(z.object({
|
|
1624
|
-
kind: z.string(),
|
|
1625
|
-
suggestionId: zNesSuggestionId,
|
|
1626
|
-
}), "kind", ["edit", "jump", "rename", "searchAndReplace"]),
|
|
1627
|
-
]), "kind", ["edit", "jump", "rename", "searchAndReplace"]);
|
|
1628
|
-
/**
|
|
1629
|
-
* Response to `nes/suggest`.
|
|
1630
|
-
*/
|
|
1631
|
-
export const zSuggestNesResponse = z.object({
|
|
1632
|
-
suggestions: z.array(zNesSuggestion),
|
|
1633
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1634
|
-
});
|
|
1635
|
-
/**
|
|
1636
|
-
* Response from closing an NES session.
|
|
1637
|
-
*/
|
|
1638
|
-
export const zCloseNesResponse = z.object({
|
|
1639
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1640
|
-
});
|
|
1641
1442
|
/**
|
|
1642
1443
|
* Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
|
|
1643
1444
|
* Extension methods provide a way to add custom functionality while maintaining
|
|
@@ -1704,9 +1505,6 @@ export const zAgentResponse = z.union([
|
|
|
1704
1505
|
zCloseSessionResponse,
|
|
1705
1506
|
zSetSessionConfigOptionResponse,
|
|
1706
1507
|
zPromptResponse,
|
|
1707
|
-
zStartNesResponse,
|
|
1708
|
-
zSuggestNesResponse,
|
|
1709
|
-
zCloseNesResponse,
|
|
1710
1508
|
zExtResponse,
|
|
1711
1509
|
]),
|
|
1712
1510
|
}),
|
|
@@ -1814,11 +1612,14 @@ export const zUsage = z.object({
|
|
|
1814
1612
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1815
1613
|
});
|
|
1816
1614
|
/**
|
|
1817
|
-
*
|
|
1615
|
+
* No foreground work is active. Background activity may continue.
|
|
1818
1616
|
*
|
|
1819
1617
|
* Agents SHOULD include a `stopReason` when the idle transition ends foreground
|
|
1820
|
-
* work. An
|
|
1618
|
+
* work. An idle update that does not end foreground work need not include one.
|
|
1619
|
+
* Receivers treat an omitted, `null`, or malformed `stopReason` as the agent not
|
|
1821
1620
|
* reporting one.
|
|
1621
|
+
* Repeated or resume snapshots may carry the last stop reason for context.
|
|
1622
|
+
* They MUST NOT be counted as new completions, cancellations, or additional usage.
|
|
1822
1623
|
*
|
|
1823
1624
|
* Custom variants (unknown `stopReason` values) keep their extra
|
|
1824
1625
|
* properties exactly as received; unlike known variants, those keys
|
|
@@ -1869,7 +1670,14 @@ export const zIdleStateUpdate = defaultOnErrorOptionalStringTag(preserveCustomPa
|
|
|
1869
1670
|
"refusal",
|
|
1870
1671
|
]), "stopReason");
|
|
1871
1672
|
/**
|
|
1872
|
-
*
|
|
1673
|
+
* The foreground workflow as a whole is blocked on user action.
|
|
1674
|
+
*
|
|
1675
|
+
* Agents SHOULD report this state when foreground work cannot progress without
|
|
1676
|
+
* user action. Pending permissions or elicitations alone do not imply this
|
|
1677
|
+
* state if other foreground work can progress, or if the requests belong only
|
|
1678
|
+
* to independent background activity. Once reported, agents MUST report
|
|
1679
|
+
* `running` when progress resumes, or `idle` if the work ends without resuming.
|
|
1680
|
+
* Responding to one request does not itself imply `running`.
|
|
1873
1681
|
*/
|
|
1874
1682
|
export const zRequiresActionStateUpdate = z.object({
|
|
1875
1683
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
@@ -1895,10 +1703,46 @@ export const zUnknownStateUpdate = z.object({
|
|
|
1895
1703
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
1896
1704
|
});
|
|
1897
1705
|
/**
|
|
1898
|
-
*
|
|
1706
|
+
* A snapshot of the session's aggregate foreground activity.
|
|
1707
|
+
*
|
|
1708
|
+
* Foreground work is the agent's active response or workflow in the session,
|
|
1709
|
+
* including model processing, tool execution, and waiting for user action needed
|
|
1710
|
+
* to continue that work. It can start with a prompt or be agent-initiated, for
|
|
1711
|
+
* example to pursue an ongoing goal or follow up on a completed background task.
|
|
1712
|
+
* Either way, the agent MUST report `running` when foreground work starts,
|
|
1713
|
+
* or `requires_action` if it starts blocked on user action, and `idle` when it
|
|
1714
|
+
* ends. The agent SHOULD include a stop reason on that idle update.
|
|
1715
|
+
* Agent-initiated work does not require a prompt request or a synthetic user
|
|
1716
|
+
* message.
|
|
1717
|
+
*
|
|
1718
|
+
* `running` may precede user-message insertion, for example during a foreground
|
|
1719
|
+
* hook. It is not acknowledgment of insertion, and rejecting a prompt does not
|
|
1720
|
+
* itself end foreground work.
|
|
1899
1721
|
*
|
|
1900
1722
|
* Background activity can continue and emit other `session/update` notifications
|
|
1901
|
-
* while `idle`. Those notifications
|
|
1723
|
+
* while `idle`. Those notifications, including a detached task's progress or
|
|
1724
|
+
* completion, do not by themselves change this state. A permission request only
|
|
1725
|
+
* warrants `requires_action` when foreground work is blocked on user action.
|
|
1726
|
+
*
|
|
1727
|
+
* The agent SHOULD report `requires_action` when the foreground workflow as a
|
|
1728
|
+
* whole cannot progress without user action, including permissions or elicitations.
|
|
1729
|
+
* Once reported, it MUST report `running` when progress resumes, or `idle` when
|
|
1730
|
+
* work ends without resuming.
|
|
1731
|
+
* If other foreground work can progress, the state remains `running`. Resolving
|
|
1732
|
+
* one of several requests does not itself change the state. Agents SHOULD ignore
|
|
1733
|
+
* responses for work that has already ended rather than use them to resume it.
|
|
1734
|
+
*
|
|
1735
|
+
* A new session defaults to idle until a state update reports otherwise.
|
|
1736
|
+
* Resume MUST send a current-state snapshot after any replay and before its
|
|
1737
|
+
* response. The snapshot reports foreground state after resuming.
|
|
1738
|
+
* The response alone does not imply idle.
|
|
1739
|
+
* Repeated snapshots are idempotent, not additional work, completions, or usage.
|
|
1740
|
+
* A repeated state may carry updated information without another state transition.
|
|
1741
|
+
* The agent MUST report `idle` when no foreground activity remains. Completing
|
|
1742
|
+
* an individual activity while other foreground work continues does not require
|
|
1743
|
+
* an idle boundary. Local commands use the same lifecycle even without model work.
|
|
1744
|
+
*
|
|
1745
|
+
* See protocol docs: [Session States](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#session-states)
|
|
1902
1746
|
*
|
|
1903
1747
|
* Custom variants (unknown `state` values) keep their extra
|
|
1904
1748
|
* properties exactly as received; unlike known variants, those keys
|
|
@@ -1963,8 +1807,9 @@ export const zTerminalExitStatus = z.object({
|
|
|
1963
1807
|
*
|
|
1964
1808
|
* Only [`TerminalUpdate::terminal_id`] is required. Other fields have patch
|
|
1965
1809
|
* semantics: omitted fields leave the stored value unchanged, `null` clears
|
|
1966
|
-
* it, and concrete values replace it.
|
|
1967
|
-
*
|
|
1810
|
+
* it, and concrete values replace it. A concrete `_meta` object instead
|
|
1811
|
+
* patches the stored metadata by top-level key. When the terminal ID is new,
|
|
1812
|
+
* omitted fields start unknown.
|
|
1968
1813
|
*/
|
|
1969
1814
|
export const zTerminalUpdate = z.object({
|
|
1970
1815
|
terminalId: zTerminalId,
|
|
@@ -2124,7 +1969,8 @@ export const zConfigOptionUpdate = z.object({
|
|
|
2124
1969
|
* This allows clients to display dynamic session names and track session state changes.
|
|
2125
1970
|
*
|
|
2126
1971
|
* Omitted fields leave the existing session info unchanged. `null` clears the
|
|
2127
|
-
* corresponding value.
|
|
1972
|
+
* corresponding value. A concrete `_meta` object patches the stored metadata by
|
|
1973
|
+
* top-level key.
|
|
2128
1974
|
*/
|
|
2129
1975
|
export const zSessionInfoUpdate = z.object({
|
|
2130
1976
|
title: defaultOnError(z.string().nullish(), () => undefined),
|
|
@@ -2192,7 +2038,8 @@ export const zCompactionStatus = z.union([
|
|
|
2192
2038
|
*
|
|
2193
2039
|
* `summary`, `error`, and `_meta` have patch semantics: omission leaves the
|
|
2194
2040
|
* stored value unchanged, `null` clears it, and a concrete value replaces it.
|
|
2195
|
-
* `summary: []` also clears the summary.
|
|
2041
|
+
* `summary: []` also clears the summary. A concrete `_meta` object patches the
|
|
2042
|
+
* stored metadata by top-level key instead of replacing it.
|
|
2196
2043
|
*/
|
|
2197
2044
|
export const zCompactionUpdate = z.object({
|
|
2198
2045
|
compactionId: zCompactionId,
|
|
@@ -2260,9 +2107,10 @@ export const zSubagentSessionCapabilities = z.object({
|
|
|
2260
2107
|
*
|
|
2261
2108
|
* Only [`SubagentUpdate::session_id`] is required. Other fields have
|
|
2262
2109
|
* patch semantics: omitted fields leave the stored value unchanged, `null`
|
|
2263
|
-
* clears or unsets the value, and concrete values replace it.
|
|
2264
|
-
* `
|
|
2265
|
-
*
|
|
2110
|
+
* clears or unsets the value, and concrete values replace it. A concrete
|
|
2111
|
+
* `_meta` object instead patches the stored metadata by top-level key. For
|
|
2112
|
+
* `state`, `null` removes the current state report and leaves activity
|
|
2113
|
+
* unconfirmed; it does not report idle or cancellation. A child whose capabilities are
|
|
2266
2114
|
* unset permits no Client-initiated session mutations.
|
|
2267
2115
|
*
|
|
2268
2116
|
* The title and description provide the parent's display metadata for the
|
|
@@ -2464,6 +2312,8 @@ export const zUpdateSessionNotification = z.object({
|
|
|
2464
2312
|
});
|
|
2465
2313
|
/**
|
|
2466
2314
|
* Notification sent by the agent when a URL-based elicitation is complete.
|
|
2315
|
+
*
|
|
2316
|
+
* This notification is not a foreground state update.
|
|
2467
2317
|
*/
|
|
2468
2318
|
export const zCompleteElicitationNotification = z.object({
|
|
2469
2319
|
elicitationId: zElicitationId,
|
|
@@ -2535,33 +2385,6 @@ export const zElicitationCapabilities = z.object({
|
|
|
2535
2385
|
url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => undefined),
|
|
2536
2386
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2537
2387
|
});
|
|
2538
|
-
/**
|
|
2539
|
-
* Marker for jump suggestion support.
|
|
2540
|
-
*/
|
|
2541
|
-
export const zNesJumpCapabilities = z.object({
|
|
2542
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2543
|
-
});
|
|
2544
|
-
/**
|
|
2545
|
-
* Marker for rename suggestion support.
|
|
2546
|
-
*/
|
|
2547
|
-
export const zNesRenameCapabilities = z.object({
|
|
2548
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2549
|
-
});
|
|
2550
|
-
/**
|
|
2551
|
-
* Marker for search and replace suggestion support.
|
|
2552
|
-
*/
|
|
2553
|
-
export const zNesSearchAndReplaceCapabilities = z.object({
|
|
2554
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2555
|
-
});
|
|
2556
|
-
/**
|
|
2557
|
-
* NES capabilities advertised by the client during initialization.
|
|
2558
|
-
*/
|
|
2559
|
-
export const zClientNesCapabilities = z.object({
|
|
2560
|
-
jump: defaultOnError(zNesJumpCapabilities.nullish(), () => undefined),
|
|
2561
|
-
rename: defaultOnError(zNesRenameCapabilities.nullish(), () => undefined),
|
|
2562
|
-
searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => undefined),
|
|
2563
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2564
|
-
});
|
|
2565
2388
|
/**
|
|
2566
2389
|
* Capabilities supported by the client.
|
|
2567
2390
|
*
|
|
@@ -2573,8 +2396,6 @@ export const zClientNesCapabilities = z.object({
|
|
|
2573
2396
|
export const zClientCapabilities = z.object({
|
|
2574
2397
|
auth: defaultOnError(zAuthCapabilities.nullish(), () => undefined),
|
|
2575
2398
|
elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => undefined),
|
|
2576
|
-
nes: defaultOnError(zClientNesCapabilities.nullish(), () => undefined),
|
|
2577
|
-
positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
|
|
2578
2399
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2579
2400
|
});
|
|
2580
2401
|
/**
|
|
@@ -2728,6 +2549,43 @@ export const zMcpServer = preserveCustomPayload(z.union([
|
|
|
2728
2549
|
type: z.string(),
|
|
2729
2550
|
}), "type", ["acp", "http", "stdio"]),
|
|
2730
2551
|
]), "type", ["acp", "http", "stdio"]);
|
|
2552
|
+
/**
|
|
2553
|
+
* **UNSTABLE**
|
|
2554
|
+
*
|
|
2555
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2556
|
+
*
|
|
2557
|
+
* How the Agent combines a client-provided system prompt with its own instructions.
|
|
2558
|
+
*
|
|
2559
|
+
* Unknown modes parse as [`SystemPromptMode::Other`] so they can be stored,
|
|
2560
|
+
* proxied, or forwarded. An Agent MUST return an error for a mode it does not
|
|
2561
|
+
* support rather than treating it as `append` or `override`.
|
|
2562
|
+
*
|
|
2563
|
+
* @experimental
|
|
2564
|
+
*/
|
|
2565
|
+
export const zSystemPromptMode = z.union([
|
|
2566
|
+
z.literal("append"),
|
|
2567
|
+
z.literal("override"),
|
|
2568
|
+
z.string(),
|
|
2569
|
+
]);
|
|
2570
|
+
/**
|
|
2571
|
+
* **UNSTABLE**
|
|
2572
|
+
*
|
|
2573
|
+
* This capability is not part of the spec yet, and may be removed or changed at any point.
|
|
2574
|
+
*
|
|
2575
|
+
* Client-provided system-level instructions for a session.
|
|
2576
|
+
*
|
|
2577
|
+
* Clients MUST only send this when the Agent advertises
|
|
2578
|
+
* `session.systemPrompt`. Agents that cannot apply it, for example because of
|
|
2579
|
+
* an unadvertised mode or an unsupported content block type, MUST return an
|
|
2580
|
+
* error instead of creating, resuming, or forking the session.
|
|
2581
|
+
*
|
|
2582
|
+
* @experimental
|
|
2583
|
+
*/
|
|
2584
|
+
export const zSystemPrompt = z.object({
|
|
2585
|
+
mode: zSystemPromptMode,
|
|
2586
|
+
content: z.array(zContentBlock),
|
|
2587
|
+
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2588
|
+
});
|
|
2731
2589
|
/**
|
|
2732
2590
|
* Request parameters for creating a new session.
|
|
2733
2591
|
*
|
|
@@ -2737,6 +2595,7 @@ export const zNewSessionRequest = z.object({
|
|
|
2737
2595
|
cwd: zAbsolutePath,
|
|
2738
2596
|
additionalDirectories: z.array(zAbsolutePath).optional(),
|
|
2739
2597
|
mcpServers: z.array(zMcpServer).optional(),
|
|
2598
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
2740
2599
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2741
2600
|
});
|
|
2742
2601
|
/**
|
|
@@ -2775,6 +2634,7 @@ export const zForkSessionRequest = z.object({
|
|
|
2775
2634
|
cwd: zAbsolutePath,
|
|
2776
2635
|
additionalDirectories: z.array(zAbsolutePath).optional(),
|
|
2777
2636
|
mcpServers: z.array(zMcpServer).optional(),
|
|
2637
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
2778
2638
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2779
2639
|
});
|
|
2780
2640
|
/**
|
|
@@ -2813,6 +2673,7 @@ export const zResumeSessionRequest = z.object({
|
|
|
2813
2673
|
additionalDirectories: z.array(zAbsolutePath).optional(),
|
|
2814
2674
|
mcpServers: z.array(zMcpServer).optional(),
|
|
2815
2675
|
replayFrom: zReplayFrom.nullish(),
|
|
2676
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
2816
2677
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2817
2678
|
});
|
|
2818
2679
|
/**
|
|
@@ -2821,6 +2682,17 @@ export const zResumeSessionRequest = z.object({
|
|
|
2821
2682
|
* The agent **must** cancel any ongoing work related to the session (treat it
|
|
2822
2683
|
* as if `session/cancel` was called) and then free up any resources associated
|
|
2823
2684
|
* with the session.
|
|
2685
|
+
*
|
|
2686
|
+
* When closing cancels active foreground work, the Agent MUST send the final
|
|
2687
|
+
* updates for that work and the idle `state_update` with `stopReason: "cancelled"`
|
|
2688
|
+
* before responding successfully to `session/close`. Closing an idle session
|
|
2689
|
+
* does not itself require another idle update.
|
|
2690
|
+
*
|
|
2691
|
+
* Closing may also cancel pending `session/prompt` requests, including queued
|
|
2692
|
+
* prompts. If closing prevents a prompt's user message from being inserted, the
|
|
2693
|
+
* Agent MUST answer that request with `-32800` (Request Cancelled). If the message
|
|
2694
|
+
* has already been inserted, the Agent MUST respond successfully with its
|
|
2695
|
+
* `messageId`. Prompt responses need not precede the close response.
|
|
2824
2696
|
*/
|
|
2825
2697
|
export const zCloseSessionRequest = z.object({
|
|
2826
2698
|
sessionId: zSessionId,
|
|
@@ -2863,154 +2735,6 @@ export const zPromptRequest = z.object({
|
|
|
2863
2735
|
prompt: z.array(zContentBlock),
|
|
2864
2736
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2865
2737
|
});
|
|
2866
|
-
/**
|
|
2867
|
-
* A workspace folder.
|
|
2868
|
-
*/
|
|
2869
|
-
export const zWorkspaceFolder = z.object({
|
|
2870
|
-
uri: z.url(),
|
|
2871
|
-
name: z.string(),
|
|
2872
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2873
|
-
});
|
|
2874
|
-
/**
|
|
2875
|
-
* Repository metadata for an NES session.
|
|
2876
|
-
*/
|
|
2877
|
-
export const zNesRepository = z.object({
|
|
2878
|
-
name: z.string(),
|
|
2879
|
-
owner: z.string(),
|
|
2880
|
-
remoteUrl: z.string(),
|
|
2881
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2882
|
-
});
|
|
2883
|
-
/**
|
|
2884
|
-
* Request to start an NES session.
|
|
2885
|
-
*/
|
|
2886
|
-
export const zStartNesRequest = z.object({
|
|
2887
|
-
workspaceUri: defaultOnError(z.url().nullish(), () => undefined),
|
|
2888
|
-
workspaceFolders: z.array(zWorkspaceFolder).nullish(),
|
|
2889
|
-
repository: defaultOnError(zNesRepository.nullish(), () => undefined),
|
|
2890
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2891
|
-
});
|
|
2892
|
-
/**
|
|
2893
|
-
* What triggered the suggestion request.
|
|
2894
|
-
*/
|
|
2895
|
-
export const zNesTriggerKind = z.union([
|
|
2896
|
-
z.literal("automatic"),
|
|
2897
|
-
z.literal("diagnostic"),
|
|
2898
|
-
z.literal("manual"),
|
|
2899
|
-
z.string(),
|
|
2900
|
-
]);
|
|
2901
|
-
/**
|
|
2902
|
-
* A recently accessed file.
|
|
2903
|
-
*/
|
|
2904
|
-
export const zNesRecentFile = z.object({
|
|
2905
|
-
uri: z.url(),
|
|
2906
|
-
languageId: z.string(),
|
|
2907
|
-
text: z.string(),
|
|
2908
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2909
|
-
});
|
|
2910
|
-
/**
|
|
2911
|
-
* A code excerpt from a file.
|
|
2912
|
-
*/
|
|
2913
|
-
export const zNesExcerpt = z.object({
|
|
2914
|
-
startLine: z.int().gte(0).max(4294967295, {
|
|
2915
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
2916
|
-
}),
|
|
2917
|
-
endLine: z.int().gte(0).max(4294967295, {
|
|
2918
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295",
|
|
2919
|
-
}),
|
|
2920
|
-
text: z.string(),
|
|
2921
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2922
|
-
});
|
|
2923
|
-
/**
|
|
2924
|
-
* A related code snippet from a file.
|
|
2925
|
-
*/
|
|
2926
|
-
export const zNesRelatedSnippet = z.object({
|
|
2927
|
-
uri: z.url(),
|
|
2928
|
-
excerpts: z.array(zNesExcerpt),
|
|
2929
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2930
|
-
});
|
|
2931
|
-
/**
|
|
2932
|
-
* An entry in the edit history.
|
|
2933
|
-
*/
|
|
2934
|
-
export const zNesEditHistoryEntry = z.object({
|
|
2935
|
-
uri: z.url(),
|
|
2936
|
-
diff: z.string(),
|
|
2937
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2938
|
-
});
|
|
2939
|
-
/**
|
|
2940
|
-
* A user action (typing, cursor movement, etc.).
|
|
2941
|
-
*/
|
|
2942
|
-
export const zNesUserAction = z.object({
|
|
2943
|
-
action: z.string(),
|
|
2944
|
-
uri: z.url(),
|
|
2945
|
-
position: zPosition,
|
|
2946
|
-
timestampMs: z.number(),
|
|
2947
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2948
|
-
});
|
|
2949
|
-
/**
|
|
2950
|
-
* An open file in the editor.
|
|
2951
|
-
*/
|
|
2952
|
-
export const zNesOpenFile = z.object({
|
|
2953
|
-
uri: z.url(),
|
|
2954
|
-
languageId: z.string(),
|
|
2955
|
-
visibleRange: defaultOnError(zRange.nullish(), () => undefined),
|
|
2956
|
-
lastFocusedMs: defaultOnError(z.number().nullish(), () => undefined),
|
|
2957
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2958
|
-
});
|
|
2959
|
-
/**
|
|
2960
|
-
* Severity of a diagnostic.
|
|
2961
|
-
*/
|
|
2962
|
-
export const zNesDiagnosticSeverity = z.union([
|
|
2963
|
-
z.literal("error"),
|
|
2964
|
-
z.literal("warning"),
|
|
2965
|
-
z.literal("information"),
|
|
2966
|
-
z.literal("hint"),
|
|
2967
|
-
z.string(),
|
|
2968
|
-
]);
|
|
2969
|
-
/**
|
|
2970
|
-
* A diagnostic (error, warning, etc.).
|
|
2971
|
-
*/
|
|
2972
|
-
export const zNesDiagnostic = z.object({
|
|
2973
|
-
uri: z.url(),
|
|
2974
|
-
range: zRange,
|
|
2975
|
-
severity: zNesDiagnosticSeverity,
|
|
2976
|
-
message: z.string(),
|
|
2977
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2978
|
-
});
|
|
2979
|
-
/**
|
|
2980
|
-
* Context attached to a suggestion request.
|
|
2981
|
-
*/
|
|
2982
|
-
export const zNesSuggestContext = z.object({
|
|
2983
|
-
recentFiles: z.array(zNesRecentFile).nullish(),
|
|
2984
|
-
relatedSnippets: z.array(zNesRelatedSnippet).nullish(),
|
|
2985
|
-
editHistory: z.array(zNesEditHistoryEntry).nullish(),
|
|
2986
|
-
userActions: z.array(zNesUserAction).nullish(),
|
|
2987
|
-
openFiles: z.array(zNesOpenFile).nullish(),
|
|
2988
|
-
diagnostics: z.array(zNesDiagnostic).nullish(),
|
|
2989
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
2990
|
-
});
|
|
2991
|
-
/**
|
|
2992
|
-
* Request for a code suggestion.
|
|
2993
|
-
*/
|
|
2994
|
-
export const zSuggestNesRequest = z.object({
|
|
2995
|
-
sessionId: zSessionId,
|
|
2996
|
-
uri: z.url(),
|
|
2997
|
-
version: z.number(),
|
|
2998
|
-
position: zPosition,
|
|
2999
|
-
selection: zRange.nullish(),
|
|
3000
|
-
triggerKind: zNesTriggerKind,
|
|
3001
|
-
context: zNesSuggestContext.nullish(),
|
|
3002
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3003
|
-
});
|
|
3004
|
-
/**
|
|
3005
|
-
* Request to close an NES session.
|
|
3006
|
-
*
|
|
3007
|
-
* The agent **must** cancel any ongoing work related to the NES session
|
|
3008
|
-
* and then free up any resources associated with the session.
|
|
3009
|
-
*/
|
|
3010
|
-
export const zCloseNesRequest = z.object({
|
|
3011
|
-
sessionId: zSessionId,
|
|
3012
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3013
|
-
});
|
|
3014
2738
|
/**
|
|
3015
2739
|
* A JSON-RPC request object.
|
|
3016
2740
|
*/
|
|
@@ -3033,9 +2757,6 @@ export const zClientRequest = z.object({
|
|
|
3033
2757
|
zCloseSessionRequest,
|
|
3034
2758
|
zSetSessionConfigOptionRequest,
|
|
3035
2759
|
zPromptRequest,
|
|
3036
|
-
zStartNesRequest,
|
|
3037
|
-
zSuggestNesRequest,
|
|
3038
|
-
zCloseNesRequest,
|
|
3039
2760
|
zExtRequest,
|
|
3040
2761
|
])
|
|
3041
2762
|
.nullish(),
|
|
@@ -3184,92 +2905,6 @@ export const zCancelSessionNotification = z.object({
|
|
|
3184
2905
|
sessionId: zSessionId,
|
|
3185
2906
|
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3186
2907
|
});
|
|
3187
|
-
/**
|
|
3188
|
-
* Notification sent when a file is opened in the editor.
|
|
3189
|
-
*/
|
|
3190
|
-
export const zDidOpenDocumentNotification = z.object({
|
|
3191
|
-
sessionId: zSessionId,
|
|
3192
|
-
uri: z.url(),
|
|
3193
|
-
languageId: z.string(),
|
|
3194
|
-
version: z.number(),
|
|
3195
|
-
text: z.string(),
|
|
3196
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3197
|
-
});
|
|
3198
|
-
/**
|
|
3199
|
-
* A content change event for a document.
|
|
3200
|
-
*
|
|
3201
|
-
* When `range` is `None`, `text` is the full content of the document.
|
|
3202
|
-
* When `range` is `Some`, `text` replaces the given range.
|
|
3203
|
-
*/
|
|
3204
|
-
export const zTextDocumentContentChangeEvent = z.object({
|
|
3205
|
-
range: zRange.nullish(),
|
|
3206
|
-
text: z.string(),
|
|
3207
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3208
|
-
});
|
|
3209
|
-
/**
|
|
3210
|
-
* Notification sent when a file is edited.
|
|
3211
|
-
*/
|
|
3212
|
-
export const zDidChangeDocumentNotification = z.object({
|
|
3213
|
-
sessionId: zSessionId,
|
|
3214
|
-
uri: z.url(),
|
|
3215
|
-
version: z.number(),
|
|
3216
|
-
contentChanges: z.array(zTextDocumentContentChangeEvent),
|
|
3217
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3218
|
-
});
|
|
3219
|
-
/**
|
|
3220
|
-
* Notification sent when a file is closed.
|
|
3221
|
-
*/
|
|
3222
|
-
export const zDidCloseDocumentNotification = z.object({
|
|
3223
|
-
sessionId: zSessionId,
|
|
3224
|
-
uri: z.url(),
|
|
3225
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3226
|
-
});
|
|
3227
|
-
/**
|
|
3228
|
-
* Notification sent when a file is saved.
|
|
3229
|
-
*/
|
|
3230
|
-
export const zDidSaveDocumentNotification = z.object({
|
|
3231
|
-
sessionId: zSessionId,
|
|
3232
|
-
uri: z.url(),
|
|
3233
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3234
|
-
});
|
|
3235
|
-
/**
|
|
3236
|
-
* Notification sent when a file becomes the active editor tab.
|
|
3237
|
-
*/
|
|
3238
|
-
export const zDidFocusDocumentNotification = z.object({
|
|
3239
|
-
sessionId: zSessionId,
|
|
3240
|
-
uri: z.url(),
|
|
3241
|
-
version: z.number(),
|
|
3242
|
-
position: zPosition,
|
|
3243
|
-
visibleRange: zRange,
|
|
3244
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3245
|
-
});
|
|
3246
|
-
/**
|
|
3247
|
-
* Notification sent when a suggestion is accepted.
|
|
3248
|
-
*/
|
|
3249
|
-
export const zAcceptNesNotification = z.object({
|
|
3250
|
-
sessionId: zSessionId,
|
|
3251
|
-
suggestionId: zNesSuggestionId,
|
|
3252
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3253
|
-
});
|
|
3254
|
-
/**
|
|
3255
|
-
* The reason a suggestion was rejected.
|
|
3256
|
-
*/
|
|
3257
|
-
export const zNesRejectReason = z.union([
|
|
3258
|
-
z.literal("rejected"),
|
|
3259
|
-
z.literal("ignored"),
|
|
3260
|
-
z.literal("replaced"),
|
|
3261
|
-
z.literal("cancelled"),
|
|
3262
|
-
z.string(),
|
|
3263
|
-
]);
|
|
3264
|
-
/**
|
|
3265
|
-
* Notification sent when a suggestion is rejected.
|
|
3266
|
-
*/
|
|
3267
|
-
export const zRejectNesNotification = z.object({
|
|
3268
|
-
sessionId: zSessionId,
|
|
3269
|
-
suggestionId: zNesSuggestionId,
|
|
3270
|
-
reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),
|
|
3271
|
-
_meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
|
|
3272
|
-
});
|
|
3273
2908
|
/**
|
|
3274
2909
|
* **UNSTABLE**
|
|
3275
2910
|
*
|
|
@@ -3293,13 +2928,6 @@ export const zClientNotification = z.object({
|
|
|
3293
2928
|
params: z
|
|
3294
2929
|
.union([
|
|
3295
2930
|
zCancelSessionNotification,
|
|
3296
|
-
zDidOpenDocumentNotification,
|
|
3297
|
-
zDidChangeDocumentNotification,
|
|
3298
|
-
zDidCloseDocumentNotification,
|
|
3299
|
-
zDidSaveDocumentNotification,
|
|
3300
|
-
zDidFocusDocumentNotification,
|
|
3301
|
-
zAcceptNesNotification,
|
|
3302
|
-
zRejectNesNotification,
|
|
3303
2931
|
zMessageMcpNotification,
|
|
3304
2932
|
zExtNotification,
|
|
3305
2933
|
])
|