@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.
Files changed (54) hide show
  1. package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +8 -191
  2. package/node_modules/@agentclientprotocol/sdk/dist/acp.js +10 -165
  3. package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -1
  4. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +132 -52
  5. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -1
  6. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +29 -21
  7. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -1
  8. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +1 -0
  9. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +6 -0
  10. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -1
  11. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.d.ts +563 -0
  12. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js +106 -0
  13. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js.map +1 -0
  14. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.d.ts +1261 -0
  15. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js +4 -0
  16. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js.map +1 -0
  17. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.d.ts +962 -0
  18. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js +526 -0
  19. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js.map +1 -0
  20. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +5 -6
  21. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +13 -25
  22. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -1
  23. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +6 -6
  24. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -1
  25. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +0 -9
  26. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -1
  27. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +0 -10
  28. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -1
  29. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +1 -11
  30. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +0 -10
  31. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -1
  32. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +1675 -2753
  33. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +863 -1434
  34. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +91 -534
  35. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -1
  36. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +42 -48
  37. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +86 -139
  38. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -1
  39. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +46 -17
  40. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -1
  41. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +55 -57
  42. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +0 -59
  43. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -1
  44. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +1 -11
  45. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +0 -10
  46. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -1
  47. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +1870 -2874
  48. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +3373 -2844
  49. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +191 -563
  50. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -1
  51. package/node_modules/@agentclientprotocol/sdk/package.json +7 -1
  52. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +1541 -3196
  53. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +875 -2664
  54. package/package.json +2 -2
@@ -763,6 +763,53 @@ export const zSessionDeleteCapabilities = z.object({
763
763
  export const zSessionAdditionalDirectoriesCapabilities = z.object({
764
764
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
765
765
  });
766
+ /**
767
+ * **UNSTABLE**
768
+ *
769
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
770
+ *
771
+ * Capabilities for the `override` system prompt mode.
772
+ *
773
+ * Supplying `{}` means the agent supports replacing its built-in default
774
+ * instructions with the client-provided system prompt.
775
+ *
776
+ * @experimental
777
+ */
778
+ export const zSessionSystemPromptOverrideCapabilities = z.object({
779
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
780
+ });
781
+ /**
782
+ * **UNSTABLE**
783
+ *
784
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
785
+ *
786
+ * System prompt delivery modes the agent supports in addition to `append`.
787
+ *
788
+ * `append` has no entry because every agent advertising
789
+ * `sessionCapabilities.systemPrompt` supports it.
790
+ *
791
+ * @experimental
792
+ */
793
+ export const zSessionSystemPromptModeCapabilities = z.object({
794
+ override: defaultOnError(zSessionSystemPromptOverrideCapabilities.nullish(), () => undefined),
795
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
796
+ });
797
+ /**
798
+ * **UNSTABLE**
799
+ *
800
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
801
+ *
802
+ * Capabilities for client-provided system prompts.
803
+ *
804
+ * Supplying `{}` means the agent supports `systemPrompt` on session lifecycle
805
+ * requests in `append` mode.
806
+ *
807
+ * @experimental
808
+ */
809
+ export const zSessionSystemPromptCapabilities = z.object({
810
+ mode: defaultOnError(zSessionSystemPromptModeCapabilities.nullish(), () => undefined),
811
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
812
+ });
766
813
  /**
767
814
  * **UNSTABLE**
768
815
  *
@@ -808,6 +855,7 @@ export const zSessionCapabilities = z.object({
808
855
  list: defaultOnError(zSessionListCapabilities.nullish(), () => undefined),
809
856
  delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => undefined),
810
857
  additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => undefined),
858
+ systemPrompt: defaultOnError(zSessionSystemPromptCapabilities.nullish(), () => undefined),
811
859
  fork: defaultOnError(zSessionForkCapabilities.nullish(), () => undefined),
812
860
  resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => undefined),
813
861
  close: defaultOnError(zSessionCloseCapabilities.nullish(), () => undefined),
@@ -842,149 +890,6 @@ export const zAgentAuthCapabilities = z.object({
842
890
  export const zProvidersCapabilities = z.object({
843
891
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
844
892
  });
845
- /**
846
- * Marker for `document/didOpen` capability support.
847
- */
848
- export const zNesDocumentDidOpenCapabilities = z.object({
849
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
850
- });
851
- /**
852
- * How the agent wants document changes delivered.
853
- */
854
- export const zTextDocumentSyncKind = z.union([
855
- z.literal("full"),
856
- z.literal("incremental"),
857
- ]);
858
- /**
859
- * Capabilities for `document/didChange` events.
860
- */
861
- export const zNesDocumentDidChangeCapabilities = z.object({
862
- syncKind: zTextDocumentSyncKind,
863
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
864
- });
865
- /**
866
- * Marker for `document/didClose` capability support.
867
- */
868
- export const zNesDocumentDidCloseCapabilities = z.object({
869
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
870
- });
871
- /**
872
- * Marker for `document/didSave` capability support.
873
- */
874
- export const zNesDocumentDidSaveCapabilities = z.object({
875
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
876
- });
877
- /**
878
- * Marker for `document/didFocus` capability support.
879
- */
880
- export const zNesDocumentDidFocusCapabilities = z.object({
881
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
882
- });
883
- /**
884
- * Document event capabilities the agent wants to receive.
885
- */
886
- export const zNesDocumentEventCapabilities = z.object({
887
- didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => undefined),
888
- didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => undefined),
889
- didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => undefined),
890
- didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => undefined),
891
- didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => undefined),
892
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
893
- });
894
- /**
895
- * Event capabilities the agent can consume.
896
- */
897
- export const zNesEventCapabilities = z.object({
898
- document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => undefined),
899
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
900
- });
901
- /**
902
- * Capabilities for recent files context.
903
- */
904
- export const zNesRecentFilesCapabilities = z.object({
905
- maxCount: defaultOnError(z
906
- .int()
907
- .gte(0)
908
- .max(4294967295, {
909
- error: "Invalid value: Expected uint32 to be <= 4294967295",
910
- })
911
- .nullish(), () => undefined),
912
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
913
- });
914
- /**
915
- * Capabilities for related snippets context.
916
- */
917
- export const zNesRelatedSnippetsCapabilities = z.object({
918
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
919
- });
920
- /**
921
- * Capabilities for edit history context.
922
- */
923
- export const zNesEditHistoryCapabilities = z.object({
924
- maxCount: defaultOnError(z
925
- .int()
926
- .gte(0)
927
- .max(4294967295, {
928
- error: "Invalid value: Expected uint32 to be <= 4294967295",
929
- })
930
- .nullish(), () => undefined),
931
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
932
- });
933
- /**
934
- * Capabilities for user actions context.
935
- */
936
- export const zNesUserActionsCapabilities = z.object({
937
- maxCount: defaultOnError(z
938
- .int()
939
- .gte(0)
940
- .max(4294967295, {
941
- error: "Invalid value: Expected uint32 to be <= 4294967295",
942
- })
943
- .nullish(), () => undefined),
944
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
945
- });
946
- /**
947
- * Capabilities for open files context.
948
- */
949
- export const zNesOpenFilesCapabilities = z.object({
950
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
951
- });
952
- /**
953
- * Capabilities for diagnostics context.
954
- */
955
- export const zNesDiagnosticsCapabilities = z.object({
956
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
957
- });
958
- /**
959
- * Context capabilities the agent wants attached to each suggestion request.
960
- */
961
- export const zNesContextCapabilities = z.object({
962
- recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => undefined),
963
- relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => undefined),
964
- editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => undefined),
965
- userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => undefined),
966
- openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => undefined),
967
- diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => undefined),
968
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
969
- });
970
- /**
971
- * NES capabilities advertised by the agent during initialization.
972
- */
973
- export const zNesCapabilities = z.object({
974
- events: defaultOnError(zNesEventCapabilities.nullish(), () => undefined),
975
- context: defaultOnError(zNesContextCapabilities.nullish(), () => undefined),
976
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
977
- });
978
- /**
979
- * The encoding used for character offsets in positions.
980
- *
981
- * Follows the same conventions as LSP 3.17. The default is UTF-16.
982
- */
983
- export const zPositionEncodingKind = z.union([
984
- z.literal("utf-16"),
985
- z.literal("utf-32"),
986
- z.literal("utf-8"),
987
- ]);
988
893
  /**
989
894
  * Capabilities supported by the agent.
990
895
  *
@@ -1016,8 +921,6 @@ export const zAgentCapabilities = z.object({
1016
921
  sessionCapabilities: defaultOnError(zSessionCapabilities.optional().default({}), () => ({})),
1017
922
  auth: defaultOnError(zAgentAuthCapabilities.optional().default({}), () => ({})),
1018
923
  providers: defaultOnError(zProvidersCapabilities.nullish(), () => undefined),
1019
- nes: defaultOnError(zNesCapabilities.nullish(), () => undefined),
1020
- positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => undefined),
1021
924
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1022
925
  });
1023
926
  /**
@@ -1462,117 +1365,6 @@ export const zPromptResponse = z.object({
1462
1365
  usage: defaultOnError(zUsage.nullish(), () => undefined),
1463
1366
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1464
1367
  });
1465
- /**
1466
- * Response to `nes/start`.
1467
- */
1468
- export const zStartNesResponse = z.object({
1469
- sessionId: zSessionId,
1470
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1471
- });
1472
- /**
1473
- * Unique identifier for a next edit suggestion.
1474
- */
1475
- export const zNesSuggestionId = z.string();
1476
- /**
1477
- * A zero-based position in a text document.
1478
- *
1479
- * The meaning of `character` depends on the negotiated position encoding.
1480
- */
1481
- export const zPosition = z.object({
1482
- line: z.int().gte(0).max(4294967295, {
1483
- error: "Invalid value: Expected uint32 to be <= 4294967295",
1484
- }),
1485
- character: z.int().gte(0).max(4294967295, {
1486
- error: "Invalid value: Expected uint32 to be <= 4294967295",
1487
- }),
1488
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1489
- });
1490
- /**
1491
- * A range in a text document, expressed as start and end positions.
1492
- */
1493
- export const zRange = z.object({
1494
- start: zPosition,
1495
- end: zPosition,
1496
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1497
- });
1498
- /**
1499
- * A text edit within a suggestion.
1500
- */
1501
- export const zNesTextEdit = z.object({
1502
- range: zRange,
1503
- newText: z.string(),
1504
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1505
- });
1506
- /**
1507
- * A text edit suggestion.
1508
- */
1509
- export const zNesEditSuggestion = z.object({
1510
- id: zNesSuggestionId,
1511
- uri: z.string(),
1512
- edits: z.array(zNesTextEdit),
1513
- cursorPosition: defaultOnError(zPosition.nullish(), () => undefined),
1514
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1515
- });
1516
- /**
1517
- * A jump-to-location suggestion.
1518
- */
1519
- export const zNesJumpSuggestion = z.object({
1520
- id: zNesSuggestionId,
1521
- uri: z.string(),
1522
- position: zPosition,
1523
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1524
- });
1525
- /**
1526
- * A rename symbol suggestion.
1527
- */
1528
- export const zNesRenameSuggestion = z.object({
1529
- id: zNesSuggestionId,
1530
- uri: z.string(),
1531
- position: zPosition,
1532
- newName: z.string(),
1533
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1534
- });
1535
- /**
1536
- * A search-and-replace suggestion.
1537
- */
1538
- export const zNesSearchAndReplaceSuggestion = z.object({
1539
- id: zNesSuggestionId,
1540
- uri: z.string(),
1541
- search: z.string(),
1542
- replace: z.string(),
1543
- isRegex: z.boolean().nullish(),
1544
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1545
- });
1546
- /**
1547
- * A suggestion returned by the agent.
1548
- */
1549
- export const zNesSuggestion = z.union([
1550
- zNesEditSuggestion.and(z.object({
1551
- kind: z.literal("edit"),
1552
- })),
1553
- zNesJumpSuggestion.and(z.object({
1554
- kind: z.literal("jump"),
1555
- })),
1556
- zNesRenameSuggestion.and(z.object({
1557
- kind: z.literal("rename"),
1558
- })),
1559
- zNesSearchAndReplaceSuggestion.and(z.object({
1560
- kind: z.literal("searchAndReplace"),
1561
- })),
1562
- ]);
1563
- /**
1564
- * Response to `nes/suggest`.
1565
- */
1566
- export const zSuggestNesResponse = z.object({
1567
- suggestions: z.array(zNesSuggestion),
1568
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1569
- });
1570
- /**
1571
- * Response from closing an NES session.
1572
- */
1573
- export const zCloseNesResponse = z.object({
1574
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1575
- });
1576
1368
  /**
1577
1369
  * Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
1578
1370
  * Extension methods provide a way to add custom functionality while maintaining
@@ -1641,9 +1433,6 @@ export const zAgentResponse = z.union([
1641
1433
  zSetSessionModeResponse,
1642
1434
  zSetSessionConfigOptionResponse,
1643
1435
  zPromptResponse,
1644
- zStartNesResponse,
1645
- zSuggestNesResponse,
1646
- zCloseNesResponse,
1647
1436
  zExtResponse,
1648
1437
  ]),
1649
1438
  }),
@@ -2412,33 +2201,6 @@ export const zElicitationCapabilities = z.object({
2412
2201
  url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => undefined),
2413
2202
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2414
2203
  });
2415
- /**
2416
- * Marker for jump suggestion support.
2417
- */
2418
- export const zNesJumpCapabilities = z.object({
2419
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2420
- });
2421
- /**
2422
- * Marker for rename suggestion support.
2423
- */
2424
- export const zNesRenameCapabilities = z.object({
2425
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2426
- });
2427
- /**
2428
- * Marker for search and replace suggestion support.
2429
- */
2430
- export const zNesSearchAndReplaceCapabilities = z.object({
2431
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2432
- });
2433
- /**
2434
- * NES capabilities advertised by the client during initialization.
2435
- */
2436
- export const zClientNesCapabilities = z.object({
2437
- jump: defaultOnError(zNesJumpCapabilities.nullish(), () => undefined),
2438
- rename: defaultOnError(zNesRenameCapabilities.nullish(), () => undefined),
2439
- searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => undefined),
2440
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2441
- });
2442
2204
  /**
2443
2205
  * Capabilities supported by the client.
2444
2206
  *
@@ -2457,8 +2219,6 @@ export const zClientCapabilities = z.object({
2457
2219
  plan: defaultOnError(zPlanCapabilities.nullish(), () => undefined),
2458
2220
  auth: defaultOnError(zAuthCapabilities.optional().default({ terminal: false }), () => ({ terminal: false })),
2459
2221
  elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => undefined),
2460
- nes: defaultOnError(zClientNesCapabilities.nullish(), () => undefined),
2461
- positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
2462
2222
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2463
2223
  });
2464
2224
  /**
@@ -2615,6 +2375,44 @@ export const zMcpServer = z.union([
2615
2375
  })),
2616
2376
  zMcpServerStdio,
2617
2377
  ]);
2378
+ /**
2379
+ * **UNSTABLE**
2380
+ *
2381
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2382
+ *
2383
+ * How the Agent combines a client-provided system prompt with its own instructions.
2384
+ *
2385
+ * Unknown modes parse as [`SystemPromptMode::Other`] so they can be stored,
2386
+ * proxied, or forwarded. An Agent MUST return an error for a mode it does not
2387
+ * support rather than treating it as `append` or `override`.
2388
+ *
2389
+ * @experimental
2390
+ */
2391
+ export const zSystemPromptMode = z.union([
2392
+ z.literal("append"),
2393
+ z.literal("override"),
2394
+ z.string(),
2395
+ ]);
2396
+ /**
2397
+ * **UNSTABLE**
2398
+ *
2399
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2400
+ *
2401
+ * Client-provided system-level instructions for a session.
2402
+ *
2403
+ * Clients MUST only send this when the Agent advertises
2404
+ * `sessionCapabilities.systemPrompt`. Agents that cannot apply it, for example
2405
+ * because of an unadvertised mode or an unsupported content block type, MUST
2406
+ * return an error instead of creating, loading, resuming, or forking the
2407
+ * session.
2408
+ *
2409
+ * @experimental
2410
+ */
2411
+ export const zSystemPrompt = z.object({
2412
+ mode: zSystemPromptMode,
2413
+ content: z.array(zContentBlock),
2414
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2415
+ });
2618
2416
  /**
2619
2417
  * Request parameters for creating a new session.
2620
2418
  *
@@ -2624,6 +2422,7 @@ export const zNewSessionRequest = z.object({
2624
2422
  cwd: z.string(),
2625
2423
  additionalDirectories: z.array(z.string()).optional(),
2626
2424
  mcpServers: z.array(zMcpServer),
2425
+ systemPrompt: zSystemPrompt.nullish(),
2627
2426
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2628
2427
  });
2629
2428
  /**
@@ -2638,6 +2437,7 @@ export const zLoadSessionRequest = z.object({
2638
2437
  cwd: z.string(),
2639
2438
  additionalDirectories: z.array(z.string()).optional(),
2640
2439
  sessionId: zSessionId,
2440
+ systemPrompt: zSystemPrompt.nullish(),
2641
2441
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2642
2442
  });
2643
2443
  /**
@@ -2678,6 +2478,7 @@ export const zForkSessionRequest = z.object({
2678
2478
  cwd: z.string(),
2679
2479
  additionalDirectories: z.array(z.string()).optional(),
2680
2480
  mcpServers: z.array(zMcpServer).optional(),
2481
+ systemPrompt: zSystemPrompt.nullish(),
2681
2482
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2682
2483
  });
2683
2484
  /**
@@ -2693,6 +2494,7 @@ export const zResumeSessionRequest = z.object({
2693
2494
  cwd: z.string(),
2694
2495
  additionalDirectories: z.array(z.string()).optional(),
2695
2496
  mcpServers: z.array(zMcpServer).optional(),
2497
+ systemPrompt: zSystemPrompt.nullish(),
2696
2498
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2697
2499
  });
2698
2500
  /**
@@ -2744,152 +2546,6 @@ export const zPromptRequest = z.object({
2744
2546
  prompt: z.array(zContentBlock),
2745
2547
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2746
2548
  });
2747
- /**
2748
- * A workspace folder.
2749
- */
2750
- export const zWorkspaceFolder = z.object({
2751
- uri: z.string(),
2752
- name: z.string(),
2753
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2754
- });
2755
- /**
2756
- * Repository metadata for an NES session.
2757
- */
2758
- export const zNesRepository = z.object({
2759
- name: z.string(),
2760
- owner: z.string(),
2761
- remoteUrl: z.string(),
2762
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2763
- });
2764
- /**
2765
- * Request to start an NES session.
2766
- */
2767
- export const zStartNesRequest = z.object({
2768
- workspaceUri: defaultOnError(z.string().nullish(), () => undefined),
2769
- workspaceFolders: z.array(zWorkspaceFolder).nullish(),
2770
- repository: defaultOnError(zNesRepository.nullish(), () => undefined),
2771
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2772
- });
2773
- /**
2774
- * What triggered the suggestion request.
2775
- */
2776
- export const zNesTriggerKind = z.union([
2777
- z.literal("automatic"),
2778
- z.literal("diagnostic"),
2779
- z.literal("manual"),
2780
- ]);
2781
- /**
2782
- * A recently accessed file.
2783
- */
2784
- export const zNesRecentFile = z.object({
2785
- uri: z.string(),
2786
- languageId: z.string(),
2787
- text: z.string(),
2788
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2789
- });
2790
- /**
2791
- * A code excerpt from a file.
2792
- */
2793
- export const zNesExcerpt = z.object({
2794
- startLine: z.int().gte(0).max(4294967295, {
2795
- error: "Invalid value: Expected uint32 to be <= 4294967295",
2796
- }),
2797
- endLine: z.int().gte(0).max(4294967295, {
2798
- error: "Invalid value: Expected uint32 to be <= 4294967295",
2799
- }),
2800
- text: z.string(),
2801
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2802
- });
2803
- /**
2804
- * A related code snippet from a file.
2805
- */
2806
- export const zNesRelatedSnippet = z.object({
2807
- uri: z.string(),
2808
- excerpts: z.array(zNesExcerpt),
2809
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2810
- });
2811
- /**
2812
- * An entry in the edit history.
2813
- */
2814
- export const zNesEditHistoryEntry = z.object({
2815
- uri: z.string(),
2816
- diff: z.string(),
2817
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2818
- });
2819
- /**
2820
- * A user action (typing, cursor movement, etc.).
2821
- */
2822
- export const zNesUserAction = z.object({
2823
- action: z.string(),
2824
- uri: z.string(),
2825
- position: zPosition,
2826
- timestampMs: z.number(),
2827
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2828
- });
2829
- /**
2830
- * An open file in the editor.
2831
- */
2832
- export const zNesOpenFile = z.object({
2833
- uri: z.string(),
2834
- languageId: z.string(),
2835
- visibleRange: defaultOnError(zRange.nullish(), () => undefined),
2836
- lastFocusedMs: defaultOnError(z.number().nullish(), () => undefined),
2837
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2838
- });
2839
- /**
2840
- * Severity of a diagnostic.
2841
- */
2842
- export const zNesDiagnosticSeverity = z.union([
2843
- z.literal("error"),
2844
- z.literal("warning"),
2845
- z.literal("information"),
2846
- z.literal("hint"),
2847
- ]);
2848
- /**
2849
- * A diagnostic (error, warning, etc.).
2850
- */
2851
- export const zNesDiagnostic = z.object({
2852
- uri: z.string(),
2853
- range: zRange,
2854
- severity: zNesDiagnosticSeverity,
2855
- message: z.string(),
2856
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2857
- });
2858
- /**
2859
- * Context attached to a suggestion request.
2860
- */
2861
- export const zNesSuggestContext = z.object({
2862
- recentFiles: z.array(zNesRecentFile).nullish(),
2863
- relatedSnippets: z.array(zNesRelatedSnippet).nullish(),
2864
- editHistory: z.array(zNesEditHistoryEntry).nullish(),
2865
- userActions: z.array(zNesUserAction).nullish(),
2866
- openFiles: z.array(zNesOpenFile).nullish(),
2867
- diagnostics: z.array(zNesDiagnostic).nullish(),
2868
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2869
- });
2870
- /**
2871
- * Request for a code suggestion.
2872
- */
2873
- export const zSuggestNesRequest = z.object({
2874
- sessionId: zSessionId,
2875
- uri: z.string(),
2876
- version: z.number(),
2877
- position: zPosition,
2878
- selection: zRange.nullish(),
2879
- triggerKind: zNesTriggerKind,
2880
- context: zNesSuggestContext.nullish(),
2881
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2882
- });
2883
- /**
2884
- * Request to close an NES session.
2885
- *
2886
- * The agent **must** cancel any ongoing work related to the NES session
2887
- * and then free up any resources associated with the session.
2888
- */
2889
- export const zCloseNesRequest = z.object({
2890
- sessionId: zSessionId,
2891
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2892
- });
2893
2549
  /**
2894
2550
  * A JSON-RPC request object.
2895
2551
  */
@@ -2914,9 +2570,6 @@ export const zClientRequest = z.object({
2914
2570
  zSetSessionModeRequest,
2915
2571
  zSetSessionConfigOptionRequest,
2916
2572
  zPromptRequest,
2917
- zStartNesRequest,
2918
- zSuggestNesRequest,
2919
- zCloseNesRequest,
2920
2573
  zExtRequest,
2921
2574
  ])
2922
2575
  .nullish(),
@@ -3134,91 +2787,6 @@ export const zCancelNotification = z.object({
3134
2787
  sessionId: zSessionId,
3135
2788
  _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3136
2789
  });
3137
- /**
3138
- * Notification sent when a file is opened in the editor.
3139
- */
3140
- export const zDidOpenDocumentNotification = z.object({
3141
- sessionId: zSessionId,
3142
- uri: z.string(),
3143
- languageId: z.string(),
3144
- version: z.number(),
3145
- text: z.string(),
3146
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3147
- });
3148
- /**
3149
- * A content change event for a document.
3150
- *
3151
- * When `range` is `None`, `text` is the full content of the document.
3152
- * When `range` is `Some`, `text` replaces the given range.
3153
- */
3154
- export const zTextDocumentContentChangeEvent = z.object({
3155
- range: zRange.nullish(),
3156
- text: z.string(),
3157
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3158
- });
3159
- /**
3160
- * Notification sent when a file is edited.
3161
- */
3162
- export const zDidChangeDocumentNotification = z.object({
3163
- sessionId: zSessionId,
3164
- uri: z.string(),
3165
- version: z.number(),
3166
- contentChanges: z.array(zTextDocumentContentChangeEvent),
3167
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3168
- });
3169
- /**
3170
- * Notification sent when a file is closed.
3171
- */
3172
- export const zDidCloseDocumentNotification = z.object({
3173
- sessionId: zSessionId,
3174
- uri: z.string(),
3175
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3176
- });
3177
- /**
3178
- * Notification sent when a file is saved.
3179
- */
3180
- export const zDidSaveDocumentNotification = z.object({
3181
- sessionId: zSessionId,
3182
- uri: z.string(),
3183
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3184
- });
3185
- /**
3186
- * Notification sent when a file becomes the active editor tab.
3187
- */
3188
- export const zDidFocusDocumentNotification = z.object({
3189
- sessionId: zSessionId,
3190
- uri: z.string(),
3191
- version: z.number(),
3192
- position: zPosition,
3193
- visibleRange: zRange,
3194
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3195
- });
3196
- /**
3197
- * Notification sent when a suggestion is accepted.
3198
- */
3199
- export const zAcceptNesNotification = z.object({
3200
- sessionId: zSessionId,
3201
- id: zNesSuggestionId,
3202
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3203
- });
3204
- /**
3205
- * The reason a suggestion was rejected.
3206
- */
3207
- export const zNesRejectReason = z.union([
3208
- z.literal("rejected"),
3209
- z.literal("ignored"),
3210
- z.literal("replaced"),
3211
- z.literal("cancelled"),
3212
- ]);
3213
- /**
3214
- * Notification sent when a suggestion is rejected.
3215
- */
3216
- export const zRejectNesNotification = z.object({
3217
- sessionId: zSessionId,
3218
- id: zNesSuggestionId,
3219
- reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),
3220
- _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3221
- });
3222
2790
  /**
3223
2791
  * **UNSTABLE**
3224
2792
  *
@@ -3244,18 +2812,7 @@ export const zMessageMcpNotification = z.object({
3244
2812
  export const zClientNotification = z.object({
3245
2813
  method: z.string(),
3246
2814
  params: z
3247
- .union([
3248
- zCancelNotification,
3249
- zDidOpenDocumentNotification,
3250
- zDidChangeDocumentNotification,
3251
- zDidCloseDocumentNotification,
3252
- zDidSaveDocumentNotification,
3253
- zDidFocusDocumentNotification,
3254
- zAcceptNesNotification,
3255
- zRejectNesNotification,
3256
- zMessageMcpNotification,
3257
- zExtNotification,
3258
- ])
2815
+ .union([zCancelNotification, zMessageMcpNotification, zExtNotification])
3259
2816
  .nullish(),
3260
2817
  });
3261
2818
  /**