@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.
- package/dist/{chunk-RK46Y7LD.js → chunk-5CHYMRNS.js} +3 -2
- package/dist/chunk-5CHYMRNS.js.map +1 -0
- package/dist/{chunk-ZCG3DLSW.js → chunk-JGOIBOFI.js} +8 -2
- package/dist/chunk-JGOIBOFI.js.map +1 -0
- package/dist/{chunk-MOGITGPP.js → chunk-JU5HIWX7.js} +1 -1
- package/dist/chunk-JU5HIWX7.js.map +1 -0
- package/dist/{data-flow-runtime-BMm3F-eV.d.cts → data-flow-runtime-BelOgo8s.d.ts} +2 -1
- package/dist/{data-flow-runtime-Dp-xznQW.d.ts → data-flow-runtime-oq9m21IP.d.cts} +2 -1
- package/dist/data-flow-runtime.cjs +9 -2
- package/dist/data-flow-runtime.cjs.map +1 -1
- package/dist/data-flow-runtime.d.cts +2 -2
- package/dist/data-flow-runtime.d.ts +2 -2
- package/dist/data-flow-runtime.js +2 -2
- package/dist/{endpoints-BT-Bl1WS.d.cts → endpoints-GedF44M2.d.cts} +6 -0
- package/dist/{endpoints-BT-Bl1WS.d.ts → endpoints-GedF44M2.d.ts} +6 -0
- package/dist/external-agent-control-BMoSq_xI.d.cts +547 -0
- package/dist/external-agent-control-BMoSq_xI.d.ts +547 -0
- package/dist/external-agent-node.cjs.map +1 -1
- package/dist/external-agent-node.d.cts +19 -19
- package/dist/external-agent-node.d.ts +19 -19
- package/dist/external-agent-node.js +1 -1
- package/dist/external-handoff-browser.cjs +162 -1
- package/dist/external-handoff-browser.cjs.map +1 -1
- package/dist/external-handoff-browser.d.cts +29 -3
- package/dist/external-handoff-browser.d.ts +29 -3
- package/dist/external-handoff-browser.js +141 -1
- package/dist/external-handoff-browser.js.map +1 -1
- package/dist/index.cjs +483 -184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -60
- package/dist/index.d.ts +62 -60
- package/dist/index.js +329 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-MOGITGPP.js.map +0 -1
- package/dist/chunk-RK46Y7LD.js.map +0 -1
- package/dist/chunk-ZCG3DLSW.js.map +0 -1
- package/dist/{external-handoff-CWoooqhp.d.cts → external-handoff-BNUyMfNb.d.cts} +19 -19
- 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
|
|
1203
|
+
var import_zod5 = require("zod");
|
|
935
1204
|
|
|
936
1205
|
// src/protocol/requests.ts
|
|
937
|
-
var
|
|
938
|
-
var runtimeBootstrapRequestSchema =
|
|
939
|
-
var sourceCoordinatesSchema =
|
|
940
|
-
fileId:
|
|
941
|
-
line:
|
|
942
|
-
column:
|
|
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:
|
|
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:
|
|
950
|
-
sourceVersion:
|
|
1218
|
+
schemaVersion: import_zod4.z.literal(1),
|
|
1219
|
+
sourceVersion: import_zod4.z.string().min(1).max(128).optional()
|
|
951
1220
|
}).strict();
|
|
952
|
-
var dataFlowComponentIdentityRequestSchema =
|
|
953
|
-
schemaVersion:
|
|
954
|
-
componentSourceId:
|
|
955
|
-
sourceVersion:
|
|
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 =
|
|
1226
|
+
var dataFlowComponentReportRequestSchema = import_zod4.z.union([
|
|
958
1227
|
dataFlowSourceCoordinatesRequestSchema,
|
|
959
1228
|
dataFlowComponentIdentityRequestSchema
|
|
960
1229
|
]);
|
|
961
|
-
var dataFlowPageReportRequestSchema =
|
|
962
|
-
schemaVersion:
|
|
963
|
-
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 =
|
|
966
|
-
var boundedString = (maximum) =>
|
|
967
|
-
var sourceRefSchema =
|
|
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:
|
|
971
|
-
column:
|
|
972
|
-
origin:
|
|
973
|
-
confidence:
|
|
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 =
|
|
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 =
|
|
1250
|
+
var codeContextSchema = import_zod4.z.strictObject({
|
|
982
1251
|
relativePath: boundedString(1024),
|
|
983
|
-
language:
|
|
984
|
-
startLine:
|
|
985
|
-
endLine:
|
|
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:
|
|
1256
|
+
boundary: import_zod4.z.enum(["component", "nearby-lines"])
|
|
988
1257
|
});
|
|
989
|
-
var pageContextSchema =
|
|
1258
|
+
var pageContextSchema = import_zod4.z.strictObject({
|
|
990
1259
|
url: boundedString(2048),
|
|
991
1260
|
pathname: boundedString(2048),
|
|
992
1261
|
title: boundedString(1024),
|
|
993
|
-
viewportWidth:
|
|
994
|
-
viewportHeight:
|
|
995
|
-
devicePixelRatio:
|
|
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 =
|
|
998
|
-
instruction:
|
|
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:
|
|
1002
|
-
supported:
|
|
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:
|
|
1276
|
+
componentStack: import_zod4.z.array(boundedString(256)).max(64),
|
|
1008
1277
|
source: sourceRefSchema.optional()
|
|
1009
1278
|
}),
|
|
1010
|
-
element:
|
|
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:
|
|
1017
|
-
x:
|
|
1018
|
-
y:
|
|
1019
|
-
width:
|
|
1020
|
-
height:
|
|
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:
|
|
1024
|
-
classNames:
|
|
1292
|
+
styles: import_zod4.z.strictObject({
|
|
1293
|
+
classNames: import_zod4.z.array(boundedString(512)).max(256),
|
|
1025
1294
|
inlineStyle: boundedString(8192).optional(),
|
|
1026
|
-
matchedRules:
|
|
1027
|
-
computed:
|
|
1028
|
-
warnings:
|
|
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:
|
|
1300
|
+
warnings: import_zod4.z.array(boundedString(1024)).max(64)
|
|
1032
1301
|
});
|
|
1033
|
-
var spotAnnotationRequestSchema =
|
|
1034
|
-
schemaVersion:
|
|
1302
|
+
var spotAnnotationRequestSchema = import_zod4.z.strictObject({
|
|
1303
|
+
schemaVersion: import_zod4.z.literal(3),
|
|
1035
1304
|
id: boundedString(128),
|
|
1036
|
-
locale:
|
|
1305
|
+
locale: import_zod4.z.enum(SPOTPATCH_LOCALES),
|
|
1037
1306
|
page: pageContextSchema,
|
|
1038
|
-
targets:
|
|
1039
|
-
createdAt:
|
|
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 =
|
|
1322
|
+
var agentCapabilityRequestSchema = import_zod4.z.strictObject({
|
|
1054
1323
|
providerProfileId: profileIdSchema2,
|
|
1055
1324
|
modelProfileId: profileIdSchema2
|
|
1056
1325
|
});
|
|
1057
|
-
var agentWorkspaceHealthRequestSchema =
|
|
1058
|
-
var agentJobCreateRequestSchema =
|
|
1326
|
+
var agentWorkspaceHealthRequestSchema = import_zod4.z.strictObject({});
|
|
1327
|
+
var agentJobCreateRequestSchema = import_zod4.z.strictObject({
|
|
1059
1328
|
annotation: spotAnnotationRequestSchema,
|
|
1060
|
-
applyMode:
|
|
1329
|
+
applyMode: import_zod4.z.enum(AGENT_APPLY_MODES).optional(),
|
|
1061
1330
|
providerProfileId: profileIdSchema2,
|
|
1062
1331
|
modelProfileId: profileIdSchema2,
|
|
1063
|
-
providerDataConsent:
|
|
1064
|
-
trustedFastModeConsent:
|
|
1065
|
-
workingTreeMode:
|
|
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 =
|
|
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 =
|
|
1134
|
-
var
|
|
1135
|
-
var externalHandoffReportableDispatchPhaseSchema =
|
|
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 =
|
|
1139
|
-
origin:
|
|
1140
|
-
pathname:
|
|
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 =
|
|
1411
|
+
var externalHandoffSummarySchema = import_zod5.z.strictObject({
|
|
1143
1412
|
sessionId: opaqueIdSchema2,
|
|
1144
|
-
framework:
|
|
1145
|
-
revision:
|
|
1413
|
+
framework: import_zod5.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS),
|
|
1414
|
+
revision: import_zod5.z.number().int().positive(),
|
|
1146
1415
|
cursor: opaqueIdSchema2,
|
|
1147
|
-
targetCount:
|
|
1416
|
+
targetCount: import_zod5.z.number().int().positive(),
|
|
1148
1417
|
page: externalHandoffPageSummarySchema,
|
|
1149
|
-
publishedAt:
|
|
1150
|
-
expiresAt:
|
|
1151
|
-
state:
|
|
1152
|
-
pickupCount:
|
|
1153
|
-
pickedUpAt:
|
|
1154
|
-
});
|
|
1155
|
-
var externalHandoffSnapshotSchema =
|
|
1156
|
-
schemaVersion:
|
|
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:
|
|
1427
|
+
session: import_zod5.z.strictObject({
|
|
1159
1428
|
id: opaqueIdSchema2,
|
|
1160
|
-
framework:
|
|
1429
|
+
framework: import_zod5.z.enum(EXTERNAL_HANDOFF_FRAMEWORKS)
|
|
1161
1430
|
}),
|
|
1162
|
-
revision:
|
|
1163
|
-
publishedAt:
|
|
1164
|
-
expiresAt:
|
|
1431
|
+
revision: import_zod5.z.number().int().positive(),
|
|
1432
|
+
publishedAt: isoTimestampSchema2,
|
|
1433
|
+
expiresAt: isoTimestampSchema2,
|
|
1165
1434
|
annotation: spotAnnotationRequestSchema
|
|
1166
1435
|
});
|
|
1167
|
-
var activeAdapterSummarySchema =
|
|
1168
|
-
kind:
|
|
1169
|
-
state:
|
|
1170
|
-
canDispatch:
|
|
1171
|
-
connectedAt:
|
|
1172
|
-
updatedAt:
|
|
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 =
|
|
1183
|
-
adapterKind:
|
|
1184
|
-
revision:
|
|
1185
|
-
phase:
|
|
1186
|
-
updatedAt:
|
|
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 =
|
|
1189
|
-
var externalHandoffPublishRequestSchema =
|
|
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 =
|
|
1462
|
+
var externalHandoffStatusRequestSchema = import_zod5.z.strictObject({
|
|
1194
1463
|
cursor: opaqueIdSchema2.optional()
|
|
1195
1464
|
});
|
|
1196
|
-
var externalHandoffResolveDeliveryRequestSchema =
|
|
1465
|
+
var externalHandoffResolveDeliveryRequestSchema = import_zod5.z.strictObject({
|
|
1197
1466
|
cursor: opaqueIdSchema2,
|
|
1198
|
-
confirmation:
|
|
1199
|
-
});
|
|
1200
|
-
var externalHandoffCapabilitySchema =
|
|
1201
|
-
enabled:
|
|
1202
|
-
brokerReady:
|
|
1203
|
-
activeWaitCount:
|
|
1204
|
-
snapshotSchemaVersion:
|
|
1205
|
-
brokerProtocolVersion:
|
|
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 =
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
mode:
|
|
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 =
|
|
1486
|
+
var externalHandoffPublishResultSchema = import_zod5.z.strictObject({
|
|
1218
1487
|
handoff: externalHandoffSummarySchema,
|
|
1219
1488
|
delivery: externalHandoffPublishDeliverySchema,
|
|
1220
|
-
replayed:
|
|
1489
|
+
replayed: import_zod5.z.boolean()
|
|
1221
1490
|
});
|
|
1222
|
-
var externalHandoffStatusResultSchema =
|
|
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
|
|
1230
|
-
var profileIdSchema3 =
|
|
1231
|
-
var boundedString2 = (maximum) =>
|
|
1232
|
-
var errorCodeSchema =
|
|
1233
|
-
var agentCapabilitySnapshotSchema =
|
|
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:
|
|
1239
|
-
state:
|
|
1240
|
-
authenticated:
|
|
1241
|
-
modelAvailable:
|
|
1242
|
-
toolCalling:
|
|
1243
|
-
toolResultContinuation:
|
|
1244
|
-
streaming:
|
|
1245
|
-
checkedAt:
|
|
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 =
|
|
1249
|
-
state:
|
|
1250
|
-
checkedAt:
|
|
1251
|
-
changes:
|
|
1252
|
-
staged:
|
|
1253
|
-
unstaged:
|
|
1254
|
-
untracked:
|
|
1255
|
-
conflicted:
|
|
1256
|
-
total:
|
|
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:
|
|
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 =
|
|
1545
|
+
var agentChangedFileSchema = import_zod6.z.strictObject({
|
|
1277
1546
|
relativePath: boundedString2(1024),
|
|
1278
|
-
kind:
|
|
1279
|
-
additions:
|
|
1280
|
-
deletions:
|
|
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 =
|
|
1551
|
+
var agentCheckResultSchema = import_zod6.z.strictObject({
|
|
1283
1552
|
checkId: profileIdSchema3,
|
|
1284
1553
|
label: boundedString2(100),
|
|
1285
|
-
status:
|
|
1286
|
-
durationMs:
|
|
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 =
|
|
1290
|
-
jobId:
|
|
1291
|
-
status:
|
|
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:
|
|
1298
|
-
updatedAt:
|
|
1299
|
-
canCancel:
|
|
1300
|
-
canApply:
|
|
1301
|
-
canRevert:
|
|
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 =
|
|
1305
|
-
jobId:
|
|
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:
|
|
1309
|
-
checks:
|
|
1577
|
+
files: import_zod6.z.array(agentChangedFileSchema).max(100),
|
|
1578
|
+
checks: import_zod6.z.array(agentCheckResultSchema).max(100)
|
|
1310
1579
|
});
|
|
1311
|
-
var agentJobResultResponseSchema =
|
|
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 =
|
|
1324
|
-
schemaVersion:
|
|
1325
|
-
sequence:
|
|
1326
|
-
jobId:
|
|
1327
|
-
status:
|
|
1328
|
-
timestamp:
|
|
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 =
|
|
1599
|
+
var agentJobEventSchema = import_zod6.z.discriminatedUnion("type", [
|
|
1331
1600
|
agentJobEventBaseSchema.extend({
|
|
1332
|
-
type:
|
|
1333
|
-
data:
|
|
1601
|
+
type: import_zod6.z.literal("snapshot"),
|
|
1602
|
+
data: import_zod6.z.strictObject({ snapshot: agentJobSnapshotSchema })
|
|
1334
1603
|
}),
|
|
1335
1604
|
agentJobEventBaseSchema.extend({
|
|
1336
|
-
type:
|
|
1337
|
-
data:
|
|
1605
|
+
type: import_zod6.z.literal("phase"),
|
|
1606
|
+
data: import_zod6.z.strictObject({ message: boundedString2(1024) })
|
|
1338
1607
|
}),
|
|
1339
1608
|
agentJobEventBaseSchema.extend({
|
|
1340
|
-
type:
|
|
1341
|
-
data:
|
|
1342
|
-
turn:
|
|
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:
|
|
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:
|
|
1352
|
-
data:
|
|
1620
|
+
type: import_zod6.z.literal("check"),
|
|
1621
|
+
data: import_zod6.z.strictObject({ result: agentCheckResultSchema })
|
|
1353
1622
|
}),
|
|
1354
1623
|
agentJobEventBaseSchema.extend({
|
|
1355
|
-
type:
|
|
1356
|
-
data:
|
|
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:
|
|
1360
|
-
data:
|
|
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,
|