@spotpatch/shared 1.10.0 → 1.12.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.
Files changed (39) hide show
  1. package/dist/{chunk-RK46Y7LD.js → chunk-5CHYMRNS.js} +3 -2
  2. package/dist/chunk-5CHYMRNS.js.map +1 -0
  3. package/dist/{chunk-ZCG3DLSW.js → chunk-JGOIBOFI.js} +8 -2
  4. package/dist/chunk-JGOIBOFI.js.map +1 -0
  5. package/dist/{chunk-MOGITGPP.js → chunk-JU5HIWX7.js} +1 -1
  6. package/dist/chunk-JU5HIWX7.js.map +1 -0
  7. package/dist/{data-flow-runtime-BMm3F-eV.d.cts → data-flow-runtime-BelOgo8s.d.ts} +2 -1
  8. package/dist/{data-flow-runtime-Dp-xznQW.d.ts → data-flow-runtime-oq9m21IP.d.cts} +2 -1
  9. package/dist/data-flow-runtime.cjs +9 -2
  10. package/dist/data-flow-runtime.cjs.map +1 -1
  11. package/dist/data-flow-runtime.d.cts +2 -2
  12. package/dist/data-flow-runtime.d.ts +2 -2
  13. package/dist/data-flow-runtime.js +2 -2
  14. package/dist/{endpoints-BT-Bl1WS.d.cts → endpoints-GedF44M2.d.cts} +6 -0
  15. package/dist/{endpoints-BT-Bl1WS.d.ts → endpoints-GedF44M2.d.ts} +6 -0
  16. package/dist/external-agent-control-BMoSq_xI.d.cts +547 -0
  17. package/dist/external-agent-control-BMoSq_xI.d.ts +547 -0
  18. package/dist/external-agent-node.cjs.map +1 -1
  19. package/dist/external-agent-node.d.cts +19 -19
  20. package/dist/external-agent-node.d.ts +19 -19
  21. package/dist/external-agent-node.js +1 -1
  22. package/dist/external-handoff-browser.cjs +162 -1
  23. package/dist/external-handoff-browser.cjs.map +1 -1
  24. package/dist/external-handoff-browser.d.cts +29 -3
  25. package/dist/external-handoff-browser.d.ts +29 -3
  26. package/dist/external-handoff-browser.js +141 -1
  27. package/dist/external-handoff-browser.js.map +1 -1
  28. package/dist/index.cjs +483 -184
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +62 -60
  31. package/dist/index.d.ts +62 -60
  32. package/dist/index.js +329 -67
  33. package/dist/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-MOGITGPP.js.map +0 -1
  36. package/dist/chunk-RK46Y7LD.js.map +0 -1
  37. package/dist/chunk-ZCG3DLSW.js.map +0 -1
  38. package/dist/{external-handoff-CWoooqhp.d.cts → external-handoff-BNUyMfNb.d.cts} +19 -19
  39. package/dist/{external-handoff-CWoooqhp.d.ts → external-handoff-BNUyMfNb.d.ts} +19 -19
package/dist/index.cjs CHANGED
@@ -45,6 +45,22 @@ __export(index_exports, {
45
45
  DEFAULT_RUNTIME_DATA_FLOW_LIMITS: () => DEFAULT_RUNTIME_DATA_FLOW_LIMITS,
46
46
  ERROR_CODES: () => ERROR_CODES,
47
47
  ERROR_CODE_VALUES: () => ERROR_CODE_VALUES,
48
+ EXTERNAL_AGENT_ACTIONS: () => EXTERNAL_AGENT_ACTIONS,
49
+ EXTERNAL_AGENT_AUTH_READINESS: () => EXTERNAL_AGENT_AUTH_READINESS,
50
+ EXTERNAL_AGENT_CONNECTION_STATES: () => EXTERNAL_AGENT_CONNECTION_STATES,
51
+ EXTERNAL_AGENT_CONTROL_LIMITS: () => EXTERNAL_AGENT_CONTROL_LIMITS,
52
+ EXTERNAL_AGENT_CONTROL_SCHEMA_VERSION: () => EXTERNAL_AGENT_CONTROL_SCHEMA_VERSION,
53
+ EXTERNAL_AGENT_DELIVERY_STATUSES: () => EXTERNAL_AGENT_DELIVERY_STATUSES,
54
+ EXTERNAL_AGENT_ERROR_CODES: () => EXTERNAL_AGENT_ERROR_CODES,
55
+ EXTERNAL_AGENT_ERROR_RECOVERABILITY: () => EXTERNAL_AGENT_ERROR_RECOVERABILITY,
56
+ EXTERNAL_AGENT_ERROR_STAGES: () => EXTERNAL_AGENT_ERROR_STAGES,
57
+ EXTERNAL_AGENT_EXECUTION_STATUSES: () => EXTERNAL_AGENT_EXECUTION_STATUSES,
58
+ EXTERNAL_AGENT_GRANT_STATES: () => EXTERNAL_AGENT_GRANT_STATES,
59
+ EXTERNAL_AGENT_MANAGED_ADAPTER_KINDS: () => EXTERNAL_AGENT_MANAGED_ADAPTER_KINDS,
60
+ EXTERNAL_AGENT_MANAGED_PHASES: () => EXTERNAL_AGENT_MANAGED_PHASES,
61
+ EXTERNAL_AGENT_MANAGED_PROFILE: () => EXTERNAL_AGENT_MANAGED_PROFILE,
62
+ EXTERNAL_AGENT_MODES: () => EXTERNAL_AGENT_MODES,
63
+ EXTERNAL_AGENT_VALIDATION_OUTCOMES: () => EXTERNAL_AGENT_VALIDATION_OUTCOMES,
48
64
  EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS: () => EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS,
49
65
  EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES: () => EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES,
50
66
  EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION: () => EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION,
@@ -86,6 +102,16 @@ __export(index_exports, {
86
102
  dataFlowComponentReportRequestSchema: () => dataFlowComponentReportRequestSchema,
87
103
  dataFlowPageReportRequestSchema: () => dataFlowPageReportRequestSchema,
88
104
  dispatchSummarySchema: () => dispatchSummarySchema,
105
+ externalAgentControlCancelRequestSchema: () => externalAgentControlCancelRequestSchema,
106
+ externalAgentControlConnectRequestSchema: () => externalAgentControlConnectRequestSchema,
107
+ externalAgentControlDisconnectRequestSchema: () => externalAgentControlDisconnectRequestSchema,
108
+ externalAgentControlStatusRequestSchema: () => externalAgentControlStatusRequestSchema,
109
+ externalAgentControlStatusSchema: () => externalAgentControlStatusSchema,
110
+ externalAgentErrorSchema: () => externalAgentErrorSchema,
111
+ externalAgentEventSchema: () => externalAgentEventSchema,
112
+ externalAgentEventsRequestSchema: () => externalAgentEventsRequestSchema,
113
+ externalAgentManagedResultSchema: () => externalAgentManagedResultSchema,
114
+ externalAgentResultRequestSchema: () => externalAgentResultRequestSchema,
89
115
  externalHandoffCapabilityRequestSchema: () => externalHandoffCapabilityRequestSchema,
90
116
  externalHandoffCapabilitySchema: () => externalHandoffCapabilitySchema,
91
117
  externalHandoffPublishDeliverySchema: () => externalHandoffPublishDeliverySchema,
@@ -102,6 +128,10 @@ __export(index_exports, {
102
128
  isErrorCode: () => isErrorCode,
103
129
  isSensitiveName: () => isSensitiveName,
104
130
  limitDataFlowReportCollections: () => limitDataFlowReportCollections,
131
+ managedCheckSummarySchema: () => managedCheckSummarySchema,
132
+ managedFileSummarySchema: () => managedFileSummarySchema,
133
+ managedTaskStatusSchema: () => managedTaskStatusSchema,
134
+ managedTimingSummarySchema: () => managedTimingSummarySchema,
105
135
  networkObservationSchema: () => networkObservationSchema,
106
136
  openEditorRequestSchema: () => openEditorRequestSchema,
107
137
  pageDataFlowReportSchema: () => pageDataFlowReportSchema,
@@ -327,7 +357,8 @@ var DEFAULT_DATA_FLOW_LIMITS = Object.freeze({
327
357
  graphMaxModules: 50,
328
358
  graphMaxCallsites: 100,
329
359
  analysisTimeoutMs: 2e3,
330
- reportMaxFields: 100
360
+ reportMaxFields: 100,
361
+ sourceMaxComponents: 256
331
362
  });
332
363
  var DATA_FLOW_URL_QUERY_KEY_LIMIT = DEFAULT_DATA_FLOW_LIMITS.reportMaxFields;
333
364
  var DEFAULT_RUNTIME_DATA_FLOW_LIMITS = Object.freeze({
@@ -762,7 +793,13 @@ var SPOTPATCH_ENDPOINTS = Object.freeze({
762
793
  externalHandoffCapability: `${SPOTPATCH_API_BASE}/external-handoff/capability`,
763
794
  externalHandoffPublish: `${SPOTPATCH_API_BASE}/external-handoff/publish`,
764
795
  externalHandoffStatus: `${SPOTPATCH_API_BASE}/external-handoff/status`,
765
- externalHandoffResolveDelivery: `${SPOTPATCH_API_BASE}/external-handoff/resolve-delivery`
796
+ externalHandoffResolveDelivery: `${SPOTPATCH_API_BASE}/external-handoff/resolve-delivery`,
797
+ externalAgentControlStatus: `${SPOTPATCH_API_BASE}/external-agent/control/status`,
798
+ externalAgentControlConnect: `${SPOTPATCH_API_BASE}/external-agent/control/connect`,
799
+ externalAgentControlDisconnect: `${SPOTPATCH_API_BASE}/external-agent/control/disconnect`,
800
+ externalAgentControlCancel: `${SPOTPATCH_API_BASE}/external-agent/control/cancel`,
801
+ externalAgentEvents: `${SPOTPATCH_API_BASE}/external-agent/events`,
802
+ externalAgentResult: `${SPOTPATCH_API_BASE}/external-agent/result`
766
803
  });
767
804
  function getAgentJobEndpoint(jobId, action) {
768
805
  return `${SPOTPATCH_ENDPOINTS.agentJobs}/${encodeURIComponent(jobId)}/${action}`;
@@ -930,113 +967,345 @@ function parseSourceMarker(value) {
930
967
  return Object.freeze({ fileId, line, column });
931
968
  }
932
969
 
970
+ // src/protocol/external-agent-control.ts
971
+ var import_zod3 = require("zod");
972
+ var EXTERNAL_AGENT_CONTROL_SCHEMA_VERSION = 1;
973
+ var EXTERNAL_AGENT_MANAGED_ADAPTER_KINDS = Object.freeze(["codex"]);
974
+ var EXTERNAL_AGENT_MODES = Object.freeze(["inbox", "managed"]);
975
+ var EXTERNAL_AGENT_CONNECTION_STATES = Object.freeze([
976
+ "disconnected",
977
+ "diagnosing",
978
+ "awaiting-consent",
979
+ "connecting",
980
+ "ready",
981
+ "busy",
982
+ "degraded",
983
+ "error",
984
+ "disconnecting"
985
+ ]);
986
+ var EXTERNAL_AGENT_AUTH_READINESS = Object.freeze([
987
+ "authenticated",
988
+ "auth-not-required",
989
+ "signed-out",
990
+ "unknown"
991
+ ]);
992
+ var EXTERNAL_AGENT_GRANT_STATES = Object.freeze([
993
+ "missing",
994
+ "valid",
995
+ "invalid"
996
+ ]);
997
+ var EXTERNAL_AGENT_DELIVERY_STATUSES = Object.freeze([
998
+ "queued",
999
+ "dispatching",
1000
+ "accepted",
1001
+ "unknown"
1002
+ ]);
1003
+ var EXTERNAL_AGENT_EXECUTION_STATUSES = Object.freeze([
1004
+ "not-observable",
1005
+ "started",
1006
+ "terminal-succeeded",
1007
+ "terminal-failed",
1008
+ "interrupted",
1009
+ "unknown"
1010
+ ]);
1011
+ var EXTERNAL_AGENT_MANAGED_PHASES = Object.freeze([
1012
+ "preparing",
1013
+ "running",
1014
+ "auditing",
1015
+ "validating",
1016
+ "applying",
1017
+ "completed",
1018
+ "review-required",
1019
+ "failed",
1020
+ "cancelled",
1021
+ "cleanup-warning"
1022
+ ]);
1023
+ var EXTERNAL_AGENT_VALIDATION_OUTCOMES = Object.freeze([
1024
+ "passed",
1025
+ "failed",
1026
+ "not-configured",
1027
+ "unavailable"
1028
+ ]);
1029
+ var EXTERNAL_AGENT_CHECK_OUTCOMES = Object.freeze([
1030
+ "passed",
1031
+ "failed",
1032
+ "unavailable"
1033
+ ]);
1034
+ var EXTERNAL_AGENT_ERROR_STAGES = Object.freeze([
1035
+ "integration",
1036
+ "binary",
1037
+ "handshake",
1038
+ "auth",
1039
+ "model",
1040
+ "protocol",
1041
+ "snapshot",
1042
+ "audit",
1043
+ "validation",
1044
+ "apply",
1045
+ "cleanup"
1046
+ ]);
1047
+ var EXTERNAL_AGENT_ERROR_RECOVERABILITY = Object.freeze([
1048
+ "retry",
1049
+ "user-action",
1050
+ "reconfigure",
1051
+ "none"
1052
+ ]);
1053
+ var EXTERNAL_AGENT_ERROR_CODES = Object.freeze([
1054
+ "AGENT_BINARY_NOT_FOUND",
1055
+ "AGENT_BINARY_UNTRUSTED",
1056
+ "AGENT_VERSION_UNSUPPORTED",
1057
+ "APP_SERVER_HANDSHAKE_FAILED",
1058
+ "AGENT_AUTH_REQUIRED",
1059
+ "AGENT_MODEL_UNAVAILABLE",
1060
+ "AGENT_PROTOCOL_INCOMPATIBLE",
1061
+ "CODEX_CONFIG_ISOLATION_UNSUPPORTED",
1062
+ "MANAGED_GRANT_INVALID",
1063
+ "MANAGED_PLATFORM_UNSUPPORTED",
1064
+ "MANAGED_GIT_REQUIRED",
1065
+ "MANAGED_SNAPSHOT_FAILED",
1066
+ "MANAGED_SCOPE_VIOLATION",
1067
+ "MANAGED_CHANGE_LIMIT_EXCEEDED",
1068
+ "MANAGED_VALIDATION_FAILED",
1069
+ "MANAGED_WORKSPACE_CONFLICT",
1070
+ "MANAGED_APPLY_FAILED",
1071
+ "MANAGED_CLEANUP_INCOMPLETE"
1072
+ ]);
1073
+ var EXTERNAL_AGENT_ACTIONS = Object.freeze([
1074
+ "install-agent",
1075
+ "use-supported-version",
1076
+ "sign-in",
1077
+ "choose-available-model",
1078
+ "use-inbox",
1079
+ "confirm-managed-access",
1080
+ "review-candidate-diff",
1081
+ "review-workspace-conflict",
1082
+ "retry",
1083
+ "inspect-cleanup-warning"
1084
+ ]);
1085
+ var EXTERNAL_AGENT_MANAGED_PROFILE = "managed-apply-v1";
1086
+ var EXTERNAL_AGENT_CONTROL_LIMITS = Object.freeze({
1087
+ maximumEventSubscribers: 4,
1088
+ eventHeartbeatMs: 15e3,
1089
+ eventReconnectMinimumMs: 500,
1090
+ eventReconnectMaximumMs: 1e4,
1091
+ maximumChangedFiles: DEFAULT_AGENT_LIMITS.maxChangedFiles,
1092
+ maximumChecks: 64,
1093
+ maximumEventLineBytes: 64 * 1024,
1094
+ maximumResultDiffBytes: DEFAULT_AGENT_LIMITS.maxDiffBytes
1095
+ });
1096
+ var isoTimestampSchema = import_zod3.z.iso.datetime();
1097
+ var requestIdSchema = import_zod3.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/u);
1098
+ var safeRelativePathSchema = import_zod3.z.string().min(1).max(4096).superRefine((value, context) => {
1099
+ const segments = value.split("/");
1100
+ if (value.startsWith("/") || value.includes("\\") || segments.some(
1101
+ (segment) => segment.length === 0 || segment === "." || segment === ".."
1102
+ )) {
1103
+ context.addIssue({ code: "custom", message: "Expected a safe relative path." });
1104
+ }
1105
+ });
1106
+ var externalAgentErrorSchema = import_zod3.z.strictObject({
1107
+ code: import_zod3.z.enum(EXTERNAL_AGENT_ERROR_CODES),
1108
+ stage: import_zod3.z.enum(EXTERNAL_AGENT_ERROR_STAGES),
1109
+ recoverability: import_zod3.z.enum(EXTERNAL_AGENT_ERROR_RECOVERABILITY),
1110
+ action: import_zod3.z.enum(EXTERNAL_AGENT_ACTIONS)
1111
+ });
1112
+ var managedFileSummarySchema = import_zod3.z.strictObject({
1113
+ path: safeRelativePathSchema,
1114
+ additions: import_zod3.z.number().int().nonnegative(),
1115
+ deletions: import_zod3.z.number().int().nonnegative()
1116
+ });
1117
+ var managedCheckSummarySchema = import_zod3.z.strictObject({
1118
+ id: import_zod3.z.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/u),
1119
+ outcome: import_zod3.z.enum(EXTERNAL_AGENT_CHECK_OUTCOMES),
1120
+ durationMs: import_zod3.z.number().int().nonnegative(),
1121
+ exitCode: import_zod3.z.number().int().optional()
1122
+ });
1123
+ var managedTimingSummarySchema = import_zod3.z.strictObject({
1124
+ preparing: import_zod3.z.number().int().nonnegative().optional(),
1125
+ agent: import_zod3.z.number().int().nonnegative().optional(),
1126
+ auditing: import_zod3.z.number().int().nonnegative().optional(),
1127
+ validating: import_zod3.z.number().int().nonnegative().optional(),
1128
+ applying: import_zod3.z.number().int().nonnegative().optional(),
1129
+ total: import_zod3.z.number().int().nonnegative().optional()
1130
+ });
1131
+ var managedTaskStatusSchema = import_zod3.z.strictObject({
1132
+ revision: import_zod3.z.number().int().positive(),
1133
+ deliveryStatus: import_zod3.z.enum(EXTERNAL_AGENT_DELIVERY_STATUSES),
1134
+ executionStatus: import_zod3.z.enum(EXTERNAL_AGENT_EXECUTION_STATUSES),
1135
+ managedPhase: import_zod3.z.enum(EXTERNAL_AGENT_MANAGED_PHASES),
1136
+ validationOutcome: import_zod3.z.enum(EXTERNAL_AGENT_VALIDATION_OUTCOMES).optional(),
1137
+ files: import_zod3.z.array(managedFileSummarySchema).max(EXTERNAL_AGENT_CONTROL_LIMITS.maximumChangedFiles),
1138
+ checks: import_zod3.z.array(managedCheckSummarySchema).max(EXTERNAL_AGENT_CONTROL_LIMITS.maximumChecks),
1139
+ timings: managedTimingSummarySchema,
1140
+ resultExpiresAt: isoTimestampSchema.optional()
1141
+ });
1142
+ var externalAgentControlStatusSchema = import_zod3.z.strictObject({
1143
+ schemaVersion: import_zod3.z.literal(EXTERNAL_AGENT_CONTROL_SCHEMA_VERSION),
1144
+ sequence: import_zod3.z.number().int().nonnegative(),
1145
+ mode: import_zod3.z.enum(EXTERNAL_AGENT_MODES),
1146
+ adapter: import_zod3.z.strictObject({
1147
+ kind: import_zod3.z.enum(EXTERNAL_AGENT_MANAGED_ADAPTER_KINDS),
1148
+ maturity: import_zod3.z.literal("experimental"),
1149
+ availability: import_zod3.z.enum(["available", "unavailable"])
1150
+ }),
1151
+ connectionState: import_zod3.z.enum(EXTERNAL_AGENT_CONNECTION_STATES),
1152
+ authReadiness: import_zod3.z.enum(EXTERNAL_AGENT_AUTH_READINESS),
1153
+ grantState: import_zod3.z.enum(EXTERNAL_AGENT_GRANT_STATES),
1154
+ requestedModel: import_zod3.z.string().min(1).max(128).optional(),
1155
+ effectiveModel: import_zod3.z.string().min(1).max(128).optional(),
1156
+ task: managedTaskStatusSchema.optional(),
1157
+ error: externalAgentErrorSchema.optional(),
1158
+ updatedAt: isoTimestampSchema
1159
+ });
1160
+ var externalAgentControlStatusRequestSchema = import_zod3.z.strictObject({});
1161
+ var externalAgentControlConnectRequestSchema = import_zod3.z.strictObject({
1162
+ requestId: requestIdSchema,
1163
+ adapterKind: import_zod3.z.literal("codex"),
1164
+ profile: import_zod3.z.literal(EXTERNAL_AGENT_MANAGED_PROFILE)
1165
+ });
1166
+ var externalAgentControlDisconnectRequestSchema = import_zod3.z.strictObject({
1167
+ requestId: requestIdSchema,
1168
+ adapterKind: import_zod3.z.literal("codex"),
1169
+ revokeGrant: import_zod3.z.boolean()
1170
+ });
1171
+ var externalAgentControlCancelRequestSchema = import_zod3.z.strictObject({
1172
+ requestId: requestIdSchema,
1173
+ revision: import_zod3.z.number().int().positive()
1174
+ });
1175
+ var externalAgentEventsRequestSchema = import_zod3.z.strictObject({
1176
+ afterSequence: import_zod3.z.number().int().nonnegative().optional()
1177
+ });
1178
+ var externalAgentEventSchema = import_zod3.z.discriminatedUnion("type", [
1179
+ import_zod3.z.strictObject({
1180
+ type: import_zod3.z.literal("status"),
1181
+ data: externalAgentControlStatusSchema
1182
+ }),
1183
+ import_zod3.z.strictObject({
1184
+ type: import_zod3.z.literal("heartbeat"),
1185
+ sequence: import_zod3.z.number().int().nonnegative(),
1186
+ emittedAt: isoTimestampSchema
1187
+ })
1188
+ ]);
1189
+ var externalAgentResultRequestSchema = import_zod3.z.strictObject({
1190
+ revision: import_zod3.z.number().int().positive()
1191
+ });
1192
+ var externalAgentManagedResultSchema = import_zod3.z.strictObject({
1193
+ revision: import_zod3.z.number().int().positive(),
1194
+ diff: import_zod3.z.string().max(EXTERNAL_AGENT_CONTROL_LIMITS.maximumResultDiffBytes),
1195
+ files: import_zod3.z.array(managedFileSummarySchema).max(EXTERNAL_AGENT_CONTROL_LIMITS.maximumChangedFiles),
1196
+ checks: import_zod3.z.array(managedCheckSummarySchema).max(EXTERNAL_AGENT_CONTROL_LIMITS.maximumChecks),
1197
+ timings: managedTimingSummarySchema,
1198
+ validationOutcome: import_zod3.z.enum(EXTERNAL_AGENT_VALIDATION_OUTCOMES),
1199
+ expiresAt: isoTimestampSchema
1200
+ });
1201
+
933
1202
  // src/protocol/external-handoff.ts
934
- var import_zod4 = require("zod");
1203
+ var import_zod5 = require("zod");
935
1204
 
936
1205
  // src/protocol/requests.ts
937
- var import_zod3 = require("zod");
938
- var runtimeBootstrapRequestSchema = import_zod3.z.strictObject({});
939
- var sourceCoordinatesSchema = import_zod3.z.strictObject({
940
- fileId: import_zod3.z.string().min(1).max(128),
941
- line: import_zod3.z.number().int().positive(),
942
- column: import_zod3.z.number().int().positive()
1206
+ var import_zod4 = require("zod");
1207
+ var runtimeBootstrapRequestSchema = import_zod4.z.strictObject({});
1208
+ var sourceCoordinatesSchema = import_zod4.z.strictObject({
1209
+ fileId: import_zod4.z.string().min(1).max(128),
1210
+ line: import_zod4.z.number().int().positive(),
1211
+ column: import_zod4.z.number().int().positive()
943
1212
  });
944
1213
  var sourceContextRequestSchema = sourceCoordinatesSchema.extend({
945
- maxLines: import_zod3.z.number().int().positive()
1214
+ maxLines: import_zod4.z.number().int().positive()
946
1215
  }).strict();
947
1216
  var openEditorRequestSchema = sourceCoordinatesSchema.strict();
948
1217
  var dataFlowSourceCoordinatesRequestSchema = sourceCoordinatesSchema.extend({
949
- schemaVersion: import_zod3.z.literal(1),
950
- sourceVersion: import_zod3.z.string().min(1).max(128).optional()
1218
+ schemaVersion: import_zod4.z.literal(1),
1219
+ sourceVersion: import_zod4.z.string().min(1).max(128).optional()
951
1220
  }).strict();
952
- var dataFlowComponentIdentityRequestSchema = import_zod3.z.strictObject({
953
- schemaVersion: import_zod3.z.literal(1),
954
- componentSourceId: import_zod3.z.string().min(1).max(128),
955
- sourceVersion: import_zod3.z.string().min(1).max(128)
1221
+ var dataFlowComponentIdentityRequestSchema = import_zod4.z.strictObject({
1222
+ schemaVersion: import_zod4.z.literal(1),
1223
+ componentSourceId: import_zod4.z.string().min(1).max(128),
1224
+ sourceVersion: import_zod4.z.string().min(1).max(128)
956
1225
  });
957
- var dataFlowComponentReportRequestSchema = import_zod3.z.union([
1226
+ var dataFlowComponentReportRequestSchema = import_zod4.z.union([
958
1227
  dataFlowSourceCoordinatesRequestSchema,
959
1228
  dataFlowComponentIdentityRequestSchema
960
1229
  ]);
961
- var dataFlowPageReportRequestSchema = import_zod3.z.strictObject({
962
- schemaVersion: import_zod3.z.literal(1),
963
- targets: import_zod3.z.array(dataFlowComponentReportRequestSchema).min(1).max(MAX_ANNOTATION_TARGETS)
1230
+ var dataFlowPageReportRequestSchema = import_zod4.z.strictObject({
1231
+ schemaVersion: import_zod4.z.literal(1),
1232
+ targets: import_zod4.z.array(dataFlowComponentReportRequestSchema).min(1).max(MAX_ANNOTATION_TARGETS)
964
1233
  });
965
- var profileIdSchema2 = import_zod3.z.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
966
- var boundedString = (maximum) => import_zod3.z.string().max(maximum);
967
- var sourceRefSchema = import_zod3.z.strictObject({
1234
+ var profileIdSchema2 = import_zod4.z.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
1235
+ var boundedString = (maximum) => import_zod4.z.string().max(maximum);
1236
+ var sourceRefSchema = import_zod4.z.strictObject({
968
1237
  fileId: boundedString(128).optional(),
969
1238
  relativePath: boundedString(1024).optional(),
970
- line: import_zod3.z.number().int().positive().optional(),
971
- column: import_zod3.z.number().int().positive().optional(),
972
- origin: import_zod3.z.enum(["jsx-host", "react-fiber", "dom-ancestor", "none"]),
973
- confidence: import_zod3.z.enum(["exact", "probable", "approximate", "unknown"])
1239
+ line: import_zod4.z.number().int().positive().optional(),
1240
+ column: import_zod4.z.number().int().positive().optional(),
1241
+ origin: import_zod4.z.enum(["jsx-host", "react-fiber", "dom-ancestor", "none"]),
1242
+ confidence: import_zod4.z.enum(["exact", "probable", "approximate", "unknown"])
974
1243
  });
975
- var matchedStyleRuleSchema = import_zod3.z.strictObject({
1244
+ var matchedStyleRuleSchema = import_zod4.z.strictObject({
976
1245
  selector: boundedString(2048),
977
1246
  declarations: boundedString(8192),
978
1247
  source: boundedString(1024).optional(),
979
1248
  media: boundedString(1024).optional()
980
1249
  });
981
- var codeContextSchema = import_zod3.z.strictObject({
1250
+ var codeContextSchema = import_zod4.z.strictObject({
982
1251
  relativePath: boundedString(1024),
983
- language: import_zod3.z.enum(["tsx", "jsx"]),
984
- startLine: import_zod3.z.number().int().positive(),
985
- endLine: import_zod3.z.number().int().positive(),
1252
+ language: import_zod4.z.enum(["tsx", "jsx"]),
1253
+ startLine: import_zod4.z.number().int().positive(),
1254
+ endLine: import_zod4.z.number().int().positive(),
986
1255
  excerpt: boundedString(16e3),
987
- boundary: import_zod3.z.enum(["component", "nearby-lines"])
1256
+ boundary: import_zod4.z.enum(["component", "nearby-lines"])
988
1257
  });
989
- var pageContextSchema = import_zod3.z.strictObject({
1258
+ var pageContextSchema = import_zod4.z.strictObject({
990
1259
  url: boundedString(2048),
991
1260
  pathname: boundedString(2048),
992
1261
  title: boundedString(1024),
993
- viewportWidth: import_zod3.z.number().nonnegative(),
994
- viewportHeight: import_zod3.z.number().nonnegative(),
995
- devicePixelRatio: import_zod3.z.number().positive()
1262
+ viewportWidth: import_zod4.z.number().nonnegative(),
1263
+ viewportHeight: import_zod4.z.number().nonnegative(),
1264
+ devicePixelRatio: import_zod4.z.number().positive()
996
1265
  });
997
- var spotTargetContextRequestSchema = import_zod3.z.strictObject({
998
- instruction: import_zod3.z.string().trim().min(1).max(MAX_TARGET_INSTRUCTION_CHARACTERS),
1266
+ var spotTargetContextRequestSchema = import_zod4.z.strictObject({
1267
+ instruction: import_zod4.z.string().trim().min(1).max(MAX_TARGET_INSTRUCTION_CHARACTERS),
999
1268
  page: pageContextSchema.optional(),
1000
1269
  source: sourceRefSchema,
1001
- react: import_zod3.z.strictObject({
1002
- supported: import_zod3.z.boolean(),
1270
+ react: import_zod4.z.strictObject({
1271
+ supported: import_zod4.z.boolean(),
1003
1272
  version: boundedString(64).optional(),
1004
1273
  componentName: boundedString(256).optional(),
1005
1274
  componentSourceId: boundedString(128).optional(),
1006
1275
  sourceVersion: boundedString(128).optional(),
1007
- componentStack: import_zod3.z.array(boundedString(256)).max(64),
1276
+ componentStack: import_zod4.z.array(boundedString(256)).max(64),
1008
1277
  source: sourceRefSchema.optional()
1009
1278
  }),
1010
- element: import_zod3.z.strictObject({
1279
+ element: import_zod4.z.strictObject({
1011
1280
  tagName: boundedString(128),
1012
1281
  selector: boundedString(2048),
1013
1282
  sanitizedHtml: boundedString(8192),
1014
1283
  textPreview: boundedString(2048).optional(),
1015
1284
  role: boundedString(256).optional(),
1016
- rect: import_zod3.z.strictObject({
1017
- x: import_zod3.z.number(),
1018
- y: import_zod3.z.number(),
1019
- width: import_zod3.z.number().nonnegative(),
1020
- height: import_zod3.z.number().nonnegative()
1285
+ rect: import_zod4.z.strictObject({
1286
+ x: import_zod4.z.number(),
1287
+ y: import_zod4.z.number(),
1288
+ width: import_zod4.z.number().nonnegative(),
1289
+ height: import_zod4.z.number().nonnegative()
1021
1290
  })
1022
1291
  }),
1023
- styles: import_zod3.z.strictObject({
1024
- classNames: import_zod3.z.array(boundedString(512)).max(256),
1292
+ styles: import_zod4.z.strictObject({
1293
+ classNames: import_zod4.z.array(boundedString(512)).max(256),
1025
1294
  inlineStyle: boundedString(8192).optional(),
1026
- matchedRules: import_zod3.z.array(matchedStyleRuleSchema).max(256),
1027
- computed: import_zod3.z.record(boundedString(256), boundedString(2048)),
1028
- warnings: import_zod3.z.array(boundedString(1024)).max(64)
1295
+ matchedRules: import_zod4.z.array(matchedStyleRuleSchema).max(256),
1296
+ computed: import_zod4.z.record(boundedString(256), boundedString(2048)),
1297
+ warnings: import_zod4.z.array(boundedString(1024)).max(64)
1029
1298
  }),
1030
1299
  code: codeContextSchema.optional(),
1031
- warnings: import_zod3.z.array(boundedString(1024)).max(64)
1300
+ warnings: import_zod4.z.array(boundedString(1024)).max(64)
1032
1301
  });
1033
- var spotAnnotationRequestSchema = import_zod3.z.strictObject({
1034
- schemaVersion: import_zod3.z.literal(3),
1302
+ var spotAnnotationRequestSchema = import_zod4.z.strictObject({
1303
+ schemaVersion: import_zod4.z.literal(3),
1035
1304
  id: boundedString(128),
1036
- locale: import_zod3.z.enum(SPOTPATCH_LOCALES),
1305
+ locale: import_zod4.z.enum(SPOTPATCH_LOCALES),
1037
1306
  page: pageContextSchema,
1038
- targets: import_zod3.z.array(spotTargetContextRequestSchema).min(1).max(MAX_ANNOTATION_TARGETS),
1039
- createdAt: import_zod3.z.iso.datetime()
1307
+ targets: import_zod4.z.array(spotTargetContextRequestSchema).min(1).max(MAX_ANNOTATION_TARGETS),
1308
+ createdAt: import_zod4.z.iso.datetime()
1040
1309
  }).superRefine((annotation, context) => {
1041
1310
  const total = annotation.targets.reduce(
1042
1311
  (characters, target) => characters + target.instruction.length,
@@ -1050,21 +1319,21 @@ var spotAnnotationRequestSchema = import_zod3.z.strictObject({
1050
1319
  });
1051
1320
  }
1052
1321
  });
1053
- var agentCapabilityRequestSchema = import_zod3.z.strictObject({
1322
+ var agentCapabilityRequestSchema = import_zod4.z.strictObject({
1054
1323
  providerProfileId: profileIdSchema2,
1055
1324
  modelProfileId: profileIdSchema2
1056
1325
  });
1057
- var agentWorkspaceHealthRequestSchema = import_zod3.z.strictObject({});
1058
- var agentJobCreateRequestSchema = import_zod3.z.strictObject({
1326
+ var agentWorkspaceHealthRequestSchema = import_zod4.z.strictObject({});
1327
+ var agentJobCreateRequestSchema = import_zod4.z.strictObject({
1059
1328
  annotation: spotAnnotationRequestSchema,
1060
- applyMode: import_zod3.z.enum(AGENT_APPLY_MODES).optional(),
1329
+ applyMode: import_zod4.z.enum(AGENT_APPLY_MODES).optional(),
1061
1330
  providerProfileId: profileIdSchema2,
1062
1331
  modelProfileId: profileIdSchema2,
1063
- providerDataConsent: import_zod3.z.literal(true),
1064
- trustedFastModeConsent: import_zod3.z.literal(true).optional(),
1065
- workingTreeMode: import_zod3.z.enum(["require-clean", "include-local-changes"]).default("require-clean")
1332
+ providerDataConsent: import_zod4.z.literal(true),
1333
+ trustedFastModeConsent: import_zod4.z.literal(true).optional(),
1334
+ workingTreeMode: import_zod4.z.enum(["require-clean", "include-local-changes"]).default("require-clean")
1066
1335
  });
1067
- var agentJobActionRequestSchema = import_zod3.z.strictObject({});
1336
+ var agentJobActionRequestSchema = import_zod4.z.strictObject({});
1068
1337
 
1069
1338
  // src/protocol/external-handoff-constants.ts
1070
1339
  var EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION = 1;
@@ -1130,46 +1399,46 @@ var EXTERNAL_HANDOFF_LIMITS = Object.freeze({
1130
1399
  });
1131
1400
 
1132
1401
  // src/protocol/external-handoff.ts
1133
- var opaqueIdSchema2 = import_zod4.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/u);
1134
- var isoTimestampSchema = import_zod4.z.iso.datetime();
1135
- var externalHandoffReportableDispatchPhaseSchema = import_zod4.z.enum(
1402
+ var opaqueIdSchema2 = import_zod5.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/u);
1403
+ var isoTimestampSchema2 = import_zod5.z.iso.datetime();
1404
+ var externalHandoffReportableDispatchPhaseSchema = import_zod5.z.enum(
1136
1405
  EXTERNAL_HANDOFF_REPORTABLE_DISPATCH_PHASES
1137
1406
  );
1138
- var externalHandoffPageSummarySchema = import_zod4.z.strictObject({
1139
- origin: import_zod4.z.string().min(1).max(2048),
1140
- pathname: import_zod4.z.string().min(1).max(2048)
1407
+ var externalHandoffPageSummarySchema = import_zod5.z.strictObject({
1408
+ origin: import_zod5.z.string().min(1).max(2048),
1409
+ pathname: import_zod5.z.string().min(1).max(2048)
1141
1410
  });
1142
- var externalHandoffSummarySchema = import_zod4.z.strictObject({
1411
+ var externalHandoffSummarySchema = import_zod5.z.strictObject({
1143
1412
  sessionId: opaqueIdSchema2,
1144
- framework: import_zod4.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS),
1145
- revision: import_zod4.z.number().int().positive(),
1413
+ framework: import_zod5.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS),
1414
+ revision: import_zod5.z.number().int().positive(),
1146
1415
  cursor: opaqueIdSchema2,
1147
- targetCount: import_zod4.z.number().int().positive(),
1416
+ targetCount: import_zod5.z.number().int().positive(),
1148
1417
  page: externalHandoffPageSummarySchema,
1149
- publishedAt: isoTimestampSchema,
1150
- expiresAt: isoTimestampSchema,
1151
- state: import_zod4.z.enum(EXTERNAL_HANDOFF_STATES),
1152
- pickupCount: import_zod4.z.number().int().nonnegative().max(EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts),
1153
- pickedUpAt: isoTimestampSchema.optional()
1154
- });
1155
- var externalHandoffSnapshotSchema = import_zod4.z.strictObject({
1156
- schemaVersion: import_zod4.z.literal(EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION),
1418
+ publishedAt: isoTimestampSchema2,
1419
+ expiresAt: isoTimestampSchema2,
1420
+ state: import_zod5.z.enum(EXTERNAL_HANDOFF_STATES),
1421
+ pickupCount: import_zod5.z.number().int().nonnegative().max(EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts),
1422
+ pickedUpAt: isoTimestampSchema2.optional()
1423
+ });
1424
+ var externalHandoffSnapshotSchema = import_zod5.z.strictObject({
1425
+ schemaVersion: import_zod5.z.literal(EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION),
1157
1426
  cursor: opaqueIdSchema2,
1158
- session: import_zod4.z.strictObject({
1427
+ session: import_zod5.z.strictObject({
1159
1428
  id: opaqueIdSchema2,
1160
- framework: import_zod4.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS)
1429
+ framework: import_zod5.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS)
1161
1430
  }),
1162
- revision: import_zod4.z.number().int().positive(),
1163
- publishedAt: isoTimestampSchema,
1164
- expiresAt: isoTimestampSchema,
1431
+ revision: import_zod5.z.number().int().positive(),
1432
+ publishedAt: isoTimestampSchema2,
1433
+ expiresAt: isoTimestampSchema2,
1165
1434
  annotation: spotAnnotationRequestSchema
1166
1435
  });
1167
- var activeAdapterSummarySchema = import_zod4.z.strictObject({
1168
- kind: import_zod4.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS),
1169
- state: import_zod4.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES),
1170
- canDispatch: import_zod4.z.boolean(),
1171
- connectedAt: isoTimestampSchema,
1172
- updatedAt: isoTimestampSchema
1436
+ var activeAdapterSummarySchema = import_zod5.z.strictObject({
1437
+ kind: import_zod5.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS),
1438
+ state: import_zod5.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES),
1439
+ canDispatch: import_zod5.z.boolean(),
1440
+ connectedAt: isoTimestampSchema2,
1441
+ updatedAt: isoTimestampSchema2
1173
1442
  }).superRefine((value, context) => {
1174
1443
  if (value.canDispatch !== (value.state === "ready")) {
1175
1444
  context.addIssue({
@@ -1179,83 +1448,83 @@ var activeAdapterSummarySchema = import_zod4.z.strictObject({
1179
1448
  });
1180
1449
  }
1181
1450
  });
1182
- var dispatchSummarySchema = import_zod4.z.strictObject({
1183
- adapterKind: import_zod4.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS),
1184
- revision: import_zod4.z.number().int().positive(),
1185
- phase: import_zod4.z.enum(EXTERNAL_HANDOFF_DISPATCH_PHASES),
1186
- updatedAt: isoTimestampSchema
1451
+ var dispatchSummarySchema = import_zod5.z.strictObject({
1452
+ adapterKind: import_zod5.z.enum(EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS),
1453
+ revision: import_zod5.z.number().int().positive(),
1454
+ phase: import_zod5.z.enum(EXTERNAL_HANDOFF_DISPATCH_PHASES),
1455
+ updatedAt: isoTimestampSchema2
1187
1456
  });
1188
- var externalHandoffCapabilityRequestSchema = import_zod4.z.strictObject({});
1189
- var externalHandoffPublishRequestSchema = import_zod4.z.strictObject({
1457
+ var externalHandoffCapabilityRequestSchema = import_zod5.z.strictObject({});
1458
+ var externalHandoffPublishRequestSchema = import_zod5.z.strictObject({
1190
1459
  requestId: opaqueIdSchema2,
1191
1460
  annotation: spotAnnotationRequestSchema
1192
1461
  });
1193
- var externalHandoffStatusRequestSchema = import_zod4.z.strictObject({
1462
+ var externalHandoffStatusRequestSchema = import_zod5.z.strictObject({
1194
1463
  cursor: opaqueIdSchema2.optional()
1195
1464
  });
1196
- var externalHandoffResolveDeliveryRequestSchema = import_zod4.z.strictObject({
1465
+ var externalHandoffResolveDeliveryRequestSchema = import_zod5.z.strictObject({
1197
1466
  cursor: opaqueIdSchema2,
1198
- confirmation: import_zod4.z.literal("workspace-reviewed")
1199
- });
1200
- var externalHandoffCapabilitySchema = import_zod4.z.strictObject({
1201
- enabled: import_zod4.z.literal(true),
1202
- brokerReady: import_zod4.z.boolean(),
1203
- activeWaitCount: import_zod4.z.number().int().nonnegative().max(EXTERNAL_HANDOFF_LIMITS.maximumWaiters),
1204
- snapshotSchemaVersion: import_zod4.z.literal(EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION),
1205
- brokerProtocolVersion: import_zod4.z.literal(EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION),
1467
+ confirmation: import_zod5.z.literal("workspace-reviewed")
1468
+ });
1469
+ var externalHandoffCapabilitySchema = import_zod5.z.strictObject({
1470
+ enabled: import_zod5.z.literal(true),
1471
+ brokerReady: import_zod5.z.boolean(),
1472
+ activeWaitCount: import_zod5.z.number().int().nonnegative().max(EXTERNAL_HANDOFF_LIMITS.maximumWaiters),
1473
+ snapshotSchemaVersion: import_zod5.z.literal(EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION),
1474
+ brokerProtocolVersion: import_zod5.z.literal(EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION),
1206
1475
  activeAdapter: activeAdapterSummarySchema.nullable(),
1207
1476
  dispatch: dispatchSummarySchema.nullable()
1208
1477
  });
1209
- var externalHandoffPublishDeliverySchema = import_zod4.z.discriminatedUnion("mode", [
1210
- import_zod4.z.strictObject({ mode: import_zod4.z.literal("inbox") }),
1211
- import_zod4.z.strictObject({
1212
- mode: import_zod4.z.literal("active"),
1478
+ var externalHandoffPublishDeliverySchema = import_zod5.z.discriminatedUnion("mode", [
1479
+ import_zod5.z.strictObject({ mode: import_zod5.z.literal("inbox") }),
1480
+ import_zod5.z.strictObject({
1481
+ mode: import_zod5.z.literal("active"),
1213
1482
  adapter: activeAdapterSummarySchema,
1214
1483
  dispatch: dispatchSummarySchema
1215
1484
  })
1216
1485
  ]);
1217
- var externalHandoffPublishResultSchema = import_zod4.z.strictObject({
1486
+ var externalHandoffPublishResultSchema = import_zod5.z.strictObject({
1218
1487
  handoff: externalHandoffSummarySchema,
1219
1488
  delivery: externalHandoffPublishDeliverySchema,
1220
- replayed: import_zod4.z.boolean()
1489
+ replayed: import_zod5.z.boolean()
1221
1490
  });
1222
- var externalHandoffStatusResultSchema = import_zod4.z.strictObject({
1491
+ var externalHandoffStatusResultSchema = import_zod5.z.strictObject({
1223
1492
  handoff: externalHandoffSummarySchema,
1224
1493
  activeAdapter: activeAdapterSummarySchema.nullable(),
1225
1494
  dispatch: dispatchSummarySchema.nullable()
1226
1495
  });
1227
1496
 
1228
1497
  // src/protocol/agent-schemas.ts
1229
- var import_zod5 = require("zod");
1230
- var profileIdSchema3 = import_zod5.z.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
1231
- var boundedString2 = (maximum) => import_zod5.z.string().max(maximum);
1232
- var errorCodeSchema = import_zod5.z.enum(ERROR_CODES);
1233
- var agentCapabilitySnapshotSchema = import_zod5.z.strictObject({
1498
+ var import_zod6 = require("zod");
1499
+ var profileIdSchema3 = import_zod6.z.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
1500
+ var boundedString2 = (maximum) => import_zod6.z.string().max(maximum);
1501
+ var errorCodeSchema = import_zod6.z.enum(ERROR_CODES);
1502
+ var agentCapabilitySnapshotSchema = import_zod6.z.strictObject({
1234
1503
  providerProfileId: profileIdSchema3,
1235
1504
  providerLabel: boundedString2(100),
1236
1505
  modelProfileId: profileIdSchema3,
1237
1506
  modelLabel: boundedString2(100),
1238
- protocol: import_zod5.z.enum(["responses", "chat-completions"]),
1239
- state: import_zod5.z.enum(AGENT_CAPABILITY_STATES),
1240
- authenticated: import_zod5.z.boolean(),
1241
- modelAvailable: import_zod5.z.boolean(),
1242
- toolCalling: import_zod5.z.boolean(),
1243
- toolResultContinuation: import_zod5.z.boolean(),
1244
- streaming: import_zod5.z.boolean(),
1245
- checkedAt: import_zod5.z.iso.datetime().optional(),
1507
+ protocol: import_zod6.z.enum(["responses", "chat-completions"]),
1508
+ state: import_zod6.z.enum(AGENT_CAPABILITY_STATES),
1509
+ authenticated: import_zod6.z.boolean(),
1510
+ modelAvailable: import_zod6.z.boolean(),
1511
+ toolCalling: import_zod6.z.boolean(),
1512
+ toolResultContinuation: import_zod6.z.boolean(),
1513
+ streaming: import_zod6.z.boolean(),
1514
+ checkedAt: import_zod6.z.iso.datetime().optional(),
1246
1515
  errorCode: errorCodeSchema.optional()
1247
1516
  });
1248
- var agentWorkspaceHealthSnapshotSchema = import_zod5.z.strictObject({
1249
- state: import_zod5.z.enum(AGENT_WORKSPACE_STATES),
1250
- checkedAt: import_zod5.z.iso.datetime(),
1251
- changes: import_zod5.z.strictObject({
1252
- staged: import_zod5.z.number().int().nonnegative(),
1253
- unstaged: import_zod5.z.number().int().nonnegative(),
1254
- untracked: import_zod5.z.number().int().nonnegative(),
1255
- conflicted: import_zod5.z.number().int().nonnegative(),
1256
- total: import_zod5.z.number().int().nonnegative()
1517
+ var agentWorkspaceHealthSnapshotSchema = import_zod6.z.strictObject({
1518
+ state: import_zod6.z.enum(AGENT_WORKSPACE_STATES),
1519
+ checkedAt: import_zod6.z.iso.datetime(),
1520
+ changes: import_zod6.z.strictObject({
1521
+ staged: import_zod6.z.number().int().nonnegative(),
1522
+ unstaged: import_zod6.z.number().int().nonnegative(),
1523
+ untracked: import_zod6.z.number().int().nonnegative(),
1524
+ conflicted: import_zod6.z.number().int().nonnegative(),
1525
+ total: import_zod6.z.number().int().nonnegative()
1257
1526
  }),
1258
- canIncludeLocalChanges: import_zod5.z.boolean(),
1527
+ canIncludeLocalChanges: import_zod6.z.boolean(),
1259
1528
  errorCode: errorCodeSchema.optional()
1260
1529
  }).refine(
1261
1530
  ({ state, changes, canIncludeLocalChanges, errorCode }) => {
@@ -1273,42 +1542,42 @@ var agentWorkspaceHealthSnapshotSchema = import_zod5.z.strictObject({
1273
1542
  },
1274
1543
  { message: "Agent workspace health fields are inconsistent." }
1275
1544
  );
1276
- var agentChangedFileSchema = import_zod5.z.strictObject({
1545
+ var agentChangedFileSchema = import_zod6.z.strictObject({
1277
1546
  relativePath: boundedString2(1024),
1278
- kind: import_zod5.z.enum(AGENT_FILE_CHANGE_KINDS),
1279
- additions: import_zod5.z.number().int().nonnegative(),
1280
- deletions: import_zod5.z.number().int().nonnegative()
1547
+ kind: import_zod6.z.enum(AGENT_FILE_CHANGE_KINDS),
1548
+ additions: import_zod6.z.number().int().nonnegative(),
1549
+ deletions: import_zod6.z.number().int().nonnegative()
1281
1550
  });
1282
- var agentCheckResultSchema = import_zod5.z.strictObject({
1551
+ var agentCheckResultSchema = import_zod6.z.strictObject({
1283
1552
  checkId: profileIdSchema3,
1284
1553
  label: boundedString2(100),
1285
- status: import_zod5.z.enum(AGENT_CHECK_STATUSES),
1286
- durationMs: import_zod5.z.number().int().nonnegative(),
1554
+ status: import_zod6.z.enum(AGENT_CHECK_STATUSES),
1555
+ durationMs: import_zod6.z.number().int().nonnegative(),
1287
1556
  output: boundedString2(8e4)
1288
1557
  });
1289
- var agentJobSnapshotSchema = import_zod5.z.strictObject({
1290
- jobId: import_zod5.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1291
- status: import_zod5.z.enum(AGENT_JOB_STATUSES),
1558
+ var agentJobSnapshotSchema = import_zod6.z.strictObject({
1559
+ jobId: import_zod6.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1560
+ status: import_zod6.z.enum(AGENT_JOB_STATUSES),
1292
1561
  providerProfileId: profileIdSchema3,
1293
1562
  providerLabel: boundedString2(100),
1294
1563
  modelProfileId: profileIdSchema3,
1295
1564
  modelLabel: boundedString2(100),
1296
1565
  phaseMessage: boundedString2(1024),
1297
- createdAt: import_zod5.z.iso.datetime(),
1298
- updatedAt: import_zod5.z.iso.datetime(),
1299
- canCancel: import_zod5.z.boolean(),
1300
- canApply: import_zod5.z.boolean(),
1301
- canRevert: import_zod5.z.boolean(),
1566
+ createdAt: import_zod6.z.iso.datetime(),
1567
+ updatedAt: import_zod6.z.iso.datetime(),
1568
+ canCancel: import_zod6.z.boolean(),
1569
+ canApply: import_zod6.z.boolean(),
1570
+ canRevert: import_zod6.z.boolean(),
1302
1571
  errorCode: errorCodeSchema.optional()
1303
1572
  });
1304
- var agentJobResultSchema = import_zod5.z.strictObject({
1305
- jobId: import_zod5.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1573
+ var agentJobResultSchema = import_zod6.z.strictObject({
1574
+ jobId: import_zod6.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1306
1575
  summary: boundedString2(8e4),
1307
1576
  diff: boundedString2(1e6),
1308
- files: import_zod5.z.array(agentChangedFileSchema).max(100),
1309
- checks: import_zod5.z.array(agentCheckResultSchema).max(100)
1577
+ files: import_zod6.z.array(agentChangedFileSchema).max(100),
1578
+ checks: import_zod6.z.array(agentCheckResultSchema).max(100)
1310
1579
  });
1311
- var agentJobResultResponseSchema = import_zod5.z.strictObject({
1580
+ var agentJobResultResponseSchema = import_zod6.z.strictObject({
1312
1581
  snapshot: agentJobSnapshotSchema,
1313
1582
  result: agentJobResultSchema.optional()
1314
1583
  }).superRefine((value, context) => {
@@ -1320,44 +1589,44 @@ var agentJobResultResponseSchema = import_zod5.z.strictObject({
1320
1589
  });
1321
1590
  }
1322
1591
  });
1323
- var agentJobEventBaseSchema = import_zod5.z.strictObject({
1324
- schemaVersion: import_zod5.z.literal(2),
1325
- sequence: import_zod5.z.number().int().positive(),
1326
- jobId: import_zod5.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1327
- status: import_zod5.z.enum(AGENT_JOB_STATUSES),
1328
- timestamp: import_zod5.z.iso.datetime()
1592
+ var agentJobEventBaseSchema = import_zod6.z.strictObject({
1593
+ schemaVersion: import_zod6.z.literal(2),
1594
+ sequence: import_zod6.z.number().int().positive(),
1595
+ jobId: import_zod6.z.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/),
1596
+ status: import_zod6.z.enum(AGENT_JOB_STATUSES),
1597
+ timestamp: import_zod6.z.iso.datetime()
1329
1598
  });
1330
- var agentJobEventSchema = import_zod5.z.discriminatedUnion("type", [
1599
+ var agentJobEventSchema = import_zod6.z.discriminatedUnion("type", [
1331
1600
  agentJobEventBaseSchema.extend({
1332
- type: import_zod5.z.literal("snapshot"),
1333
- data: import_zod5.z.strictObject({ snapshot: agentJobSnapshotSchema })
1601
+ type: import_zod6.z.literal("snapshot"),
1602
+ data: import_zod6.z.strictObject({ snapshot: agentJobSnapshotSchema })
1334
1603
  }),
1335
1604
  agentJobEventBaseSchema.extend({
1336
- type: import_zod5.z.literal("phase"),
1337
- data: import_zod5.z.strictObject({ message: boundedString2(1024) })
1605
+ type: import_zod6.z.literal("phase"),
1606
+ data: import_zod6.z.strictObject({ message: boundedString2(1024) })
1338
1607
  }),
1339
1608
  agentJobEventBaseSchema.extend({
1340
- type: import_zod5.z.literal("tool"),
1341
- data: import_zod5.z.strictObject({
1342
- turn: import_zod5.z.number().int().positive(),
1609
+ type: import_zod6.z.literal("tool"),
1610
+ data: import_zod6.z.strictObject({
1611
+ turn: import_zod6.z.number().int().positive(),
1343
1612
  toolCallId: boundedString2(256),
1344
1613
  toolName: boundedString2(100),
1345
- state: import_zod5.z.enum(["started", "succeeded", "failed"]),
1614
+ state: import_zod6.z.enum(["started", "succeeded", "failed"]),
1346
1615
  relativePath: boundedString2(1024).optional(),
1347
1616
  checkLabel: boundedString2(100).optional()
1348
1617
  })
1349
1618
  }),
1350
1619
  agentJobEventBaseSchema.extend({
1351
- type: import_zod5.z.literal("check"),
1352
- data: import_zod5.z.strictObject({ result: agentCheckResultSchema })
1620
+ type: import_zod6.z.literal("check"),
1621
+ data: import_zod6.z.strictObject({ result: agentCheckResultSchema })
1353
1622
  }),
1354
1623
  agentJobEventBaseSchema.extend({
1355
- type: import_zod5.z.literal("result-ready"),
1356
- data: import_zod5.z.strictObject({ hasResult: import_zod5.z.literal(true) })
1624
+ type: import_zod6.z.literal("result-ready"),
1625
+ data: import_zod6.z.strictObject({ hasResult: import_zod6.z.literal(true) })
1357
1626
  }),
1358
1627
  agentJobEventBaseSchema.extend({
1359
- type: import_zod5.z.literal("error"),
1360
- data: import_zod5.z.strictObject({
1628
+ type: import_zod6.z.literal("error"),
1629
+ data: import_zod6.z.strictObject({
1361
1630
  code: errorCodeSchema,
1362
1631
  message: boundedString2(1024)
1363
1632
  })
@@ -1411,6 +1680,22 @@ var SPOTPATCH_REPOSITORY_URL = "https://github.com/huanglvjing/spotpatch";
1411
1680
  DEFAULT_RUNTIME_DATA_FLOW_LIMITS,
1412
1681
  ERROR_CODES,
1413
1682
  ERROR_CODE_VALUES,
1683
+ EXTERNAL_AGENT_ACTIONS,
1684
+ EXTERNAL_AGENT_AUTH_READINESS,
1685
+ EXTERNAL_AGENT_CONNECTION_STATES,
1686
+ EXTERNAL_AGENT_CONTROL_LIMITS,
1687
+ EXTERNAL_AGENT_CONTROL_SCHEMA_VERSION,
1688
+ EXTERNAL_AGENT_DELIVERY_STATUSES,
1689
+ EXTERNAL_AGENT_ERROR_CODES,
1690
+ EXTERNAL_AGENT_ERROR_RECOVERABILITY,
1691
+ EXTERNAL_AGENT_ERROR_STAGES,
1692
+ EXTERNAL_AGENT_EXECUTION_STATUSES,
1693
+ EXTERNAL_AGENT_GRANT_STATES,
1694
+ EXTERNAL_AGENT_MANAGED_ADAPTER_KINDS,
1695
+ EXTERNAL_AGENT_MANAGED_PHASES,
1696
+ EXTERNAL_AGENT_MANAGED_PROFILE,
1697
+ EXTERNAL_AGENT_MODES,
1698
+ EXTERNAL_AGENT_VALIDATION_OUTCOMES,
1414
1699
  EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS,
1415
1700
  EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES,
1416
1701
  EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION,
@@ -1452,6 +1737,16 @@ var SPOTPATCH_REPOSITORY_URL = "https://github.com/huanglvjing/spotpatch";
1452
1737
  dataFlowComponentReportRequestSchema,
1453
1738
  dataFlowPageReportRequestSchema,
1454
1739
  dispatchSummarySchema,
1740
+ externalAgentControlCancelRequestSchema,
1741
+ externalAgentControlConnectRequestSchema,
1742
+ externalAgentControlDisconnectRequestSchema,
1743
+ externalAgentControlStatusRequestSchema,
1744
+ externalAgentControlStatusSchema,
1745
+ externalAgentErrorSchema,
1746
+ externalAgentEventSchema,
1747
+ externalAgentEventsRequestSchema,
1748
+ externalAgentManagedResultSchema,
1749
+ externalAgentResultRequestSchema,
1455
1750
  externalHandoffCapabilityRequestSchema,
1456
1751
  externalHandoffCapabilitySchema,
1457
1752
  externalHandoffPublishDeliverySchema,
@@ -1468,6 +1763,10 @@ var SPOTPATCH_REPOSITORY_URL = "https://github.com/huanglvjing/spotpatch";
1468
1763
  isErrorCode,
1469
1764
  isSensitiveName,
1470
1765
  limitDataFlowReportCollections,
1766
+ managedCheckSummarySchema,
1767
+ managedFileSummarySchema,
1768
+ managedTaskStatusSchema,
1769
+ managedTimingSummarySchema,
1471
1770
  networkObservationSchema,
1472
1771
  openEditorRequestSchema,
1473
1772
  pageDataFlowReportSchema,