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