@spotpatch/shared 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/chunk-2LVIH7OA.js +75 -0
  2. package/dist/chunk-2LVIH7OA.js.map +1 -0
  3. package/dist/chunk-MOGITGPP.js +431 -0
  4. package/dist/chunk-MOGITGPP.js.map +1 -0
  5. package/dist/{chunk-K2UAPG7T.js → chunk-RK46Y7LD.js} +2 -23
  6. package/dist/chunk-RK46Y7LD.js.map +1 -0
  7. package/dist/chunk-ZCG3DLSW.js +28 -0
  8. package/dist/chunk-ZCG3DLSW.js.map +1 -0
  9. package/dist/{data-flow-runtime-zwbvImvl.d.cts → data-flow-runtime-BMm3F-eV.d.cts} +2 -16
  10. package/dist/{data-flow-runtime-zwbvImvl.d.ts → data-flow-runtime-Dp-xznQW.d.ts} +2 -16
  11. package/dist/data-flow-runtime.cjs +5 -1
  12. package/dist/data-flow-runtime.cjs.map +1 -1
  13. package/dist/data-flow-runtime.d.cts +2 -1
  14. package/dist/data-flow-runtime.d.ts +2 -1
  15. package/dist/data-flow-runtime.js +4 -2
  16. package/dist/endpoints-BT-Bl1WS.d.cts +20 -0
  17. package/dist/endpoints-BT-Bl1WS.d.ts +20 -0
  18. package/dist/external-agent-node.cjs +692 -0
  19. package/dist/external-agent-node.cjs.map +1 -0
  20. package/dist/external-agent-node.d.cts +556 -0
  21. package/dist/external-agent-node.d.ts +556 -0
  22. package/dist/external-agent-node.js +210 -0
  23. package/dist/external-agent-node.js.map +1 -0
  24. package/dist/external-handoff-CWoooqhp.d.cts +720 -0
  25. package/dist/external-handoff-CWoooqhp.d.ts +720 -0
  26. package/dist/external-handoff-browser.cjs +163 -0
  27. package/dist/external-handoff-browser.cjs.map +1 -0
  28. package/dist/external-handoff-browser.d.cts +32 -0
  29. package/dist/external-handoff-browser.d.ts +32 -0
  30. package/dist/external-handoff-browser.js +58 -0
  31. package/dist/external-handoff-browser.js.map +1 -0
  32. package/dist/index.cjs +302 -65
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +139 -105
  35. package/dist/index.d.ts +139 -105
  36. package/dist/index.js +165 -340
  37. package/dist/index.js.map +1 -1
  38. package/package.json +28 -2
  39. package/dist/chunk-K2UAPG7T.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,6 +1,10 @@
1
- import { R as ReportCompleteness, C as ComponentDataFlowReport, P as PageDataFlowReport, S as SPOTPATCH_API_BASE, a as RuntimeDataFlowConfig } from './data-flow-runtime-zwbvImvl.cjs';
2
- export { A as AgentJobAction, b as AnalysisBaseline, c as AssociationKind, d as ComponentIdentity, D as DATA_FLOW_ASSOCIATION_KINDS, e as DATA_FLOW_DIAGNOSTIC_CODES, f as DATA_FLOW_EXECUTION_STATES, g as DATA_FLOW_FRESHNESS_STATES, h as DATA_FLOW_PROOF_STATES, i as DATA_FLOW_SCHEMA_VERSION, j as DATA_FLOW_URL_QUERY_KEY_LIMIT, k as DEFAULT_DATA_FLOW_LIMITS, l as DEFAULT_RUNTIME_DATA_FLOW_LIMITS, m as DataDependency, n as DataFlowCapability, o as DataFlowCapabilityReason, p as DataFlowDiagnostic, q as DataFlowDiagnosticCode, r as DataFlowLimits, s as DataParameter, t as DataResponseDescriptor, E as EvidenceRef, u as EvidenceSourceRef, v as ExecutionState, F as FreshnessState, N as NetworkObservation, w as ProofState, x as RequestOrigin, y as RuntimeDataFlowLimits, z as SPOTPATCH_ENDPOINTS, B as SPOTPATCH_TOKEN_HEADER, G as SanitizedObservedUrl, H as componentDataFlowReportSchema, I as dataDependencySchema, J as getAgentJobEndpoint, K as networkObservationSchema, L as pageDataFlowReportSchema, M as runtimeDataFlowConfigSchema } from './data-flow-runtime-zwbvImvl.cjs';
1
+ import { C as ContextBudget, y as SPOTPATCH_LOCALE_PREFERENCES, S as SpotAnnotation } from './external-handoff-CWoooqhp.cjs';
2
+ export { A as ActiveAdapterSummary, z as CodeContext, D as DispatchSummary, b as EXTERNAL_HANDOFF_ACTIVE_ADAPTER_KINDS, c as EXTERNAL_HANDOFF_ACTIVE_ADAPTER_STATES, d as EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION, e as EXTERNAL_HANDOFF_DISPATCH_PHASES, f as EXTERNAL_HANDOFF_FRAMEWORKS, E as EXTERNAL_HANDOFF_LIMITS, g as EXTERNAL_HANDOFF_REPORTABLE_DISPATCH_PHASES, h as EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION, i as EXTERNAL_HANDOFF_STATES, B as ElementContext, j as ExternalHandoffActiveAdapterKind, k as ExternalHandoffActiveAdapterState, l as ExternalHandoffCapability, m as ExternalHandoffDispatchPhase, n as ExternalHandoffFramework, o as ExternalHandoffPublishDelivery, p as ExternalHandoffPublishRequest, q as ExternalHandoffPublishResult, r as ExternalHandoffReportableDispatchPhase, s as ExternalHandoffResolveDeliveryRequest, a as ExternalHandoffSnapshot, t as ExternalHandoffState, u as ExternalHandoffStatusRequest, v as ExternalHandoffStatusResult, w as ExternalHandoffSummary, M as MAX_ANNOTATION_INSTRUCTION_CHARACTERS, F as MAX_ANNOTATION_TARGETS, G as MAX_TARGET_INSTRUCTION_CHARACTERS, H as MatchedStyleRule, P as PageContext, R as ReactContext, I as SPOTPATCH_LOCALES, J as SourceConfidence, K as SourceOrigin, L as SourceRef, x as SpotPatchLocale, N as SpotPatchLocalePreference, O as SpotTargetContext, Q as StyleContext, T as activeAdapterSummarySchema, U as dispatchSummarySchema, V as externalHandoffCapabilityRequestSchema, W as externalHandoffCapabilitySchema, X as externalHandoffPublishDeliverySchema, Y as externalHandoffPublishRequestSchema, Z as externalHandoffPublishResultSchema, _ as externalHandoffReportableDispatchPhaseSchema, $ as externalHandoffResolveDeliveryRequestSchema, a0 as externalHandoffSnapshotSchema, a1 as externalHandoffStatusRequestSchema, a2 as externalHandoffStatusResultSchema, a3 as externalHandoffSummarySchema } from './external-handoff-CWoooqhp.cjs';
3
+ import { R as ReportCompleteness, C as ComponentDataFlowReport, P as PageDataFlowReport, a as RuntimeDataFlowConfig } from './data-flow-runtime-BMm3F-eV.cjs';
4
+ export { A as AnalysisBaseline, b as AssociationKind, c as ComponentIdentity, D as DATA_FLOW_ASSOCIATION_KINDS, d as DATA_FLOW_DIAGNOSTIC_CODES, e as DATA_FLOW_EXECUTION_STATES, f as DATA_FLOW_FRESHNESS_STATES, g as DATA_FLOW_PROOF_STATES, h as DATA_FLOW_SCHEMA_VERSION, i as DATA_FLOW_URL_QUERY_KEY_LIMIT, j as DEFAULT_DATA_FLOW_LIMITS, k as DEFAULT_RUNTIME_DATA_FLOW_LIMITS, l as DataDependency, m as DataFlowCapability, n as DataFlowCapabilityReason, o as DataFlowDiagnostic, p as DataFlowDiagnosticCode, q as DataFlowLimits, r as DataParameter, s as DataResponseDescriptor, E as EvidenceRef, t as EvidenceSourceRef, u as ExecutionState, F as FreshnessState, N as NetworkObservation, v as ProofState, w as RequestOrigin, x as RuntimeDataFlowLimits, S as SanitizedObservedUrl, y as componentDataFlowReportSchema, z as dataDependencySchema, B as networkObservationSchema, G as pageDataFlowReportSchema, H as runtimeDataFlowConfigSchema } from './data-flow-runtime-BMm3F-eV.cjs';
3
5
  import { z } from 'zod';
6
+ import { b as SPOTPATCH_API_BASE } from './endpoints-BT-Bl1WS.cjs';
7
+ export { A as AgentJobAction, S as SPOTPATCH_ENDPOINTS, a as SPOTPATCH_TOKEN_HEADER, g as getAgentJobEndpoint } from './endpoints-BT-Bl1WS.cjs';
4
8
 
5
9
  declare const ERROR_CODES: {
6
10
  readonly INVALID_REQUEST: "INVALID_REQUEST";
@@ -23,6 +27,24 @@ declare const ERROR_CODES: {
23
27
  readonly AGENT_BUSY: "AGENT_BUSY";
24
28
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
25
29
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
30
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
31
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
32
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
33
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
34
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
35
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
36
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
37
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
38
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
39
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
40
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
41
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
42
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
43
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
44
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
45
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
46
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
47
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
26
48
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
27
49
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
28
50
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -41,6 +63,8 @@ declare const ERROR_CODES: {
41
63
  readonly INTERNAL_ERROR: "INTERNAL_ERROR";
42
64
  };
43
65
  type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
66
+ declare const ERROR_CODE_VALUES: readonly ("INVALID_REQUEST" | "INVALID_TOKEN" | "ORIGIN_NOT_ALLOWED" | "SOURCE_NOT_FOUND" | "SOURCE_OUTSIDE_ROOT" | "SOURCE_TOO_LARGE" | "EDITOR_OPEN_FAILED" | "DATA_FLOW_DISABLED" | "DATA_FLOW_SOURCE_STALE" | "DATA_FLOW_ANALYSIS_CANCELLED" | "AI_DISABLED" | "PROVIDER_NOT_CONFIGURED" | "PROVIDER_AUTH_FAILED" | "PROVIDER_PROTOCOL_UNSUPPORTED" | "MODEL_NOT_ALLOWED" | "MODEL_TOOL_CALL_UNSUPPORTED" | "PROVIDER_RATE_LIMITED" | "AGENT_BUSY" | "AGENT_LIMIT_EXCEEDED" | "AGENT_CANCELLED" | "EXTERNAL_HANDOFF_DISABLED" | "EXTERNAL_HANDOFF_UNAVAILABLE" | "HANDOFF_VALIDATION_FAILED" | "HANDOFF_SOURCE_STALE" | "HANDOFF_NOT_FOUND" | "HANDOFF_EXPIRED" | "HANDOFF_CURSOR_INVALID" | "HANDOFF_RESPONSE_TOO_LARGE" | "BRIDGE_UNAUTHORIZED" | "BRIDGE_PROTOCOL_MISMATCH" | "BRIDGE_BUSY" | "EXTERNAL_AGENT_BUSY" | "ACTIVE_ADAPTER_CONFLICT" | "ACTIVE_ADAPTER_LEASE_INVALID" | "ACTIVE_DISPATCH_INVALID" | "SESSION_NOT_FOUND" | "SESSION_AMBIGUOUS" | "SESSION_CLOSED" | "WORKTREE_DIRTY" | "WORKTREE_NOT_REPOSITORY" | "WORKTREE_OPERATION_IN_PROGRESS" | "WORKTREE_CONFLICTED" | "WORKTREE_LOCAL_CHANGES_TOO_LARGE" | "WORKTREE_UNTRACKED_UNSUPPORTED" | "WORKTREE_LOCAL_CHANGES_UNSUPPORTED" | "TOOL_DENIED" | "TOOL_INPUT_INVALID" | "TOOL_ARGUMENTS_INVALID" | "TOOL_CALL_ID_CONFLICT" | "TOOL_PATH_DENIED" | "PATCH_REJECTED" | "VALIDATION_FAILED" | "APPLY_CONFLICT" | "INTERNAL_ERROR")[];
67
+ declare function isErrorCode(value: unknown): value is ErrorCode;
44
68
 
45
69
  declare class SpotPatchError extends Error {
46
70
  readonly code: ErrorCode;
@@ -51,107 +75,6 @@ declare function isSensitiveName(name: string): boolean;
51
75
  declare function redactSensitiveText(value: string): string;
52
76
  declare function sanitizeUrl(value: string, baseUrl: string): string;
53
77
 
54
- interface ContextBudget {
55
- readonly totalCharacters: number;
56
- readonly domCharacters: number;
57
- readonly cssCharacters: number;
58
- readonly codeCharacters: number;
59
- readonly maxCodeLines: number;
60
- readonly maxComponentDepth: number;
61
- }
62
- interface CodeContext {
63
- readonly relativePath: string;
64
- readonly language: "tsx" | "jsx";
65
- readonly startLine: number;
66
- readonly endLine: number;
67
- readonly excerpt: string;
68
- readonly boundary: "component" | "nearby-lines";
69
- }
70
-
71
- type SourceConfidence = "exact" | "probable" | "approximate" | "unknown";
72
- type SourceOrigin = "jsx-host" | "react-fiber" | "dom-ancestor" | "none";
73
- interface SourceRef {
74
- readonly fileId?: string;
75
- readonly relativePath?: string;
76
- readonly line?: number;
77
- readonly column?: number;
78
- readonly origin: SourceOrigin;
79
- readonly confidence: SourceConfidence;
80
- }
81
- interface ReactContext {
82
- readonly supported: boolean;
83
- readonly version?: string;
84
- readonly componentName?: string;
85
- readonly componentSourceId?: string;
86
- readonly sourceVersion?: string;
87
- readonly componentStack: readonly string[];
88
- readonly source?: SourceRef;
89
- }
90
-
91
- interface MatchedStyleRule {
92
- readonly selector: string;
93
- readonly declarations: string;
94
- readonly source?: string;
95
- readonly media?: string;
96
- }
97
- interface StyleContext {
98
- readonly classNames: readonly string[];
99
- readonly inlineStyle?: string;
100
- readonly matchedRules: readonly MatchedStyleRule[];
101
- readonly computed: Readonly<Record<string, string>>;
102
- readonly warnings: readonly string[];
103
- }
104
-
105
- interface PageContext {
106
- readonly url: string;
107
- readonly pathname: string;
108
- readonly title: string;
109
- readonly viewportWidth: number;
110
- readonly viewportHeight: number;
111
- readonly devicePixelRatio: number;
112
- }
113
- interface ElementContext {
114
- readonly tagName: string;
115
- readonly selector: string;
116
- readonly sanitizedHtml: string;
117
- readonly textPreview?: string;
118
- readonly role?: string;
119
- readonly rect: Readonly<{
120
- x: number;
121
- y: number;
122
- width: number;
123
- height: number;
124
- }>;
125
- }
126
- /** Protocol hard limit. Runtime configuration may choose a smaller limit. */
127
- declare const MAX_ANNOTATION_TARGETS = 20;
128
- /** Each target owns its requested change; the UI enforces the same bound. */
129
- declare const MAX_TARGET_INSTRUCTION_CHARACTERS = 2000;
130
- /** Keeps the complete, atomic user intent within the prompt and request budgets. */
131
- declare const MAX_ANNOTATION_INSTRUCTION_CHARACTERS = 4000;
132
- declare const SPOTPATCH_LOCALES: readonly ["en-US", "zh-CN"];
133
- type SpotPatchLocale = (typeof SPOTPATCH_LOCALES)[number];
134
- declare const SPOTPATCH_LOCALE_PREFERENCES: readonly ["auto", "en-US", "zh-CN"];
135
- type SpotPatchLocalePreference = (typeof SPOTPATCH_LOCALE_PREFERENCES)[number];
136
- interface SpotTargetContext {
137
- readonly instruction: string;
138
- readonly page?: Readonly<PageContext>;
139
- readonly source: SourceRef;
140
- readonly react: ReactContext;
141
- readonly element: ElementContext;
142
- readonly styles: StyleContext;
143
- readonly code?: CodeContext;
144
- readonly warnings: readonly string[];
145
- }
146
- interface SpotAnnotation {
147
- readonly schemaVersion: 3;
148
- readonly id: string;
149
- readonly locale: SpotPatchLocale;
150
- readonly page: Readonly<PageContext>;
151
- readonly targets: readonly SpotTargetContext[];
152
- readonly createdAt: string;
153
- }
154
-
155
78
  /**
156
79
  * Syntax names shared by the compiler and Node analyzer.
157
80
  *
@@ -391,6 +314,9 @@ interface RuntimeConfigBase {
391
314
  readonly dataFlow: RuntimeDataFlowConfig;
392
315
  readonly debug: boolean;
393
316
  readonly editor: (typeof SPOTPATCH_EDITOR_PREFERENCES)[number];
317
+ readonly externalAgent: Readonly<{
318
+ enabled: boolean;
319
+ }>;
394
320
  readonly frameworkVersion: string;
395
321
  readonly locale: (typeof SPOTPATCH_LOCALE_PREFERENCES)[number];
396
322
  readonly maxTargets: number;
@@ -867,10 +793,10 @@ declare const agentCapabilitySnapshotSchema: z.ZodObject<{
867
793
  }>;
868
794
  state: z.ZodEnum<{
869
795
  unknown: "unknown";
870
- unavailable: "unavailable";
871
796
  probing: "probing";
872
797
  "agent-ready": "agent-ready";
873
798
  "prompt-only": "prompt-only";
799
+ unavailable: "unavailable";
874
800
  }>;
875
801
  authenticated: z.ZodBoolean;
876
802
  modelAvailable: z.ZodBoolean;
@@ -899,6 +825,24 @@ declare const agentCapabilitySnapshotSchema: z.ZodObject<{
899
825
  readonly AGENT_BUSY: "AGENT_BUSY";
900
826
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
901
827
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
828
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
829
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
830
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
831
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
832
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
833
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
834
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
835
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
836
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
837
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
838
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
839
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
840
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
841
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
842
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
843
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
844
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
845
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
902
846
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
903
847
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
904
848
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -953,6 +897,24 @@ declare const agentWorkspaceHealthSnapshotSchema: z.ZodObject<{
953
897
  readonly AGENT_BUSY: "AGENT_BUSY";
954
898
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
955
899
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
900
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
901
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
902
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
903
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
904
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
905
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
906
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
907
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
908
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
909
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
910
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
911
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
912
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
913
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
914
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
915
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
916
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
917
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
956
918
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
957
919
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
958
920
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -1041,6 +1003,24 @@ declare const agentJobSnapshotSchema: z.ZodObject<{
1041
1003
  readonly AGENT_BUSY: "AGENT_BUSY";
1042
1004
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
1043
1005
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
1006
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
1007
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
1008
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
1009
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
1010
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
1011
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
1012
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
1013
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
1014
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
1015
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
1016
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
1017
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
1018
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
1019
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
1020
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
1021
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
1022
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
1023
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
1044
1024
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
1045
1025
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
1046
1026
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -1135,6 +1115,24 @@ declare const agentJobResultResponseSchema: z.ZodObject<{
1135
1115
  readonly AGENT_BUSY: "AGENT_BUSY";
1136
1116
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
1137
1117
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
1118
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
1119
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
1120
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
1121
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
1122
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
1123
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
1124
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
1125
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
1126
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
1127
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
1128
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
1129
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
1130
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
1131
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
1132
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
1133
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
1134
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
1135
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
1138
1136
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
1139
1137
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
1140
1138
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -1251,6 +1249,24 @@ declare const agentJobEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1251
1249
  readonly AGENT_BUSY: "AGENT_BUSY";
1252
1250
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
1253
1251
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
1252
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
1253
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
1254
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
1255
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
1256
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
1257
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
1258
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
1259
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
1260
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
1261
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
1262
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
1263
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
1264
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
1265
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
1266
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
1267
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
1268
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
1269
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
1254
1270
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
1255
1271
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
1256
1272
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -1429,6 +1445,24 @@ declare const agentJobEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1429
1445
  readonly AGENT_BUSY: "AGENT_BUSY";
1430
1446
  readonly AGENT_LIMIT_EXCEEDED: "AGENT_LIMIT_EXCEEDED";
1431
1447
  readonly AGENT_CANCELLED: "AGENT_CANCELLED";
1448
+ readonly EXTERNAL_HANDOFF_DISABLED: "EXTERNAL_HANDOFF_DISABLED";
1449
+ readonly EXTERNAL_HANDOFF_UNAVAILABLE: "EXTERNAL_HANDOFF_UNAVAILABLE";
1450
+ readonly HANDOFF_VALIDATION_FAILED: "HANDOFF_VALIDATION_FAILED";
1451
+ readonly HANDOFF_SOURCE_STALE: "HANDOFF_SOURCE_STALE";
1452
+ readonly HANDOFF_NOT_FOUND: "HANDOFF_NOT_FOUND";
1453
+ readonly HANDOFF_EXPIRED: "HANDOFF_EXPIRED";
1454
+ readonly HANDOFF_CURSOR_INVALID: "HANDOFF_CURSOR_INVALID";
1455
+ readonly HANDOFF_RESPONSE_TOO_LARGE: "HANDOFF_RESPONSE_TOO_LARGE";
1456
+ readonly BRIDGE_UNAUTHORIZED: "BRIDGE_UNAUTHORIZED";
1457
+ readonly BRIDGE_PROTOCOL_MISMATCH: "BRIDGE_PROTOCOL_MISMATCH";
1458
+ readonly BRIDGE_BUSY: "BRIDGE_BUSY";
1459
+ readonly EXTERNAL_AGENT_BUSY: "EXTERNAL_AGENT_BUSY";
1460
+ readonly ACTIVE_ADAPTER_CONFLICT: "ACTIVE_ADAPTER_CONFLICT";
1461
+ readonly ACTIVE_ADAPTER_LEASE_INVALID: "ACTIVE_ADAPTER_LEASE_INVALID";
1462
+ readonly ACTIVE_DISPATCH_INVALID: "ACTIVE_DISPATCH_INVALID";
1463
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
1464
+ readonly SESSION_AMBIGUOUS: "SESSION_AMBIGUOUS";
1465
+ readonly SESSION_CLOSED: "SESSION_CLOSED";
1432
1466
  readonly WORKTREE_DIRTY: "WORKTREE_DIRTY";
1433
1467
  readonly WORKTREE_NOT_REPOSITORY: "WORKTREE_NOT_REPOSITORY";
1434
1468
  readonly WORKTREE_OPERATION_IN_PROGRESS: "WORKTREE_OPERATION_IN_PROGRESS";
@@ -1465,4 +1499,4 @@ type ApiResponse<T> = ApiSuccess<T> | ApiFailure;
1465
1499
 
1466
1500
  declare const SPOTPATCH_REPOSITORY_URL: "https://github.com/huanglvjing/spotpatch";
1467
1501
 
1468
- export { AGENT_APPLY_MODES, AGENT_CAPABILITY_STATES, AGENT_CHECK_STATUSES, AGENT_FILE_CHANGE_KINDS, AGENT_JOB_STATUSES, AGENT_WORKSPACE_SNAPSHOT_LIMITS, AGENT_WORKSPACE_STATES, type AgentApplyMode, type AgentCapabilityRequest, type AgentCapabilitySnapshot, type AgentCapabilityState, type AgentChangedFile, type AgentCheckDefinition, type AgentCheckResult, type AgentCheckStatus, type AgentFileChangeKind, type AgentJobCreateRequest, type AgentJobEvent, type AgentJobResult, type AgentJobResultResponse, type AgentJobSnapshot, type AgentJobStatus, type AgentLimits, type AgentWorkingTreeMode, type AgentWorkspaceChangeSummary, type AgentWorkspaceHealthSnapshot, type AgentWorkspaceState, type AiExecutionOptions, type AiModelProfile, type AiOptions, type AiProviderAuthentication, type AiProviderProtocol, type ApiFailure, type ApiResponse, type ApiSuccess, type CodeContext, ComponentDataFlowReport, type ContextBudget, DATA_FLOW_QUERY_ADAPTER_MODULES, DATA_FLOW_QUERY_HOOK_NAMES, DATA_FLOW_TRPC_CLIENT_FACTORY_NAMES, DATA_FLOW_TRPC_PROXY_FACTORY_NAMES, DATA_FLOW_TRPC_REQUEST_METHODS, DATA_FLOW_TRPC_ROOT_FACTORY_NAMES, DEFAULT_AGENT_LIMITS, type DataFlowCollectionLimitOptions, type DataFlowComponentReportRequest, type DataFlowPageReportRequest, ERROR_CODES, type EditorOpenResult, type ElementContext, type ErrorCode, MAX_ANNOTATION_INSTRUCTION_CHARACTERS, MAX_ANNOTATION_TARGETS, MAX_TARGET_INSTRUCTION_CHARACTERS, type MatchedStyleRule, type OpenAICompatibleProviderOptions, type OpenEditorRequest, type PageContext, PageDataFlowReport, type ReactContext, ReportCompleteness, type ResolvedAgentCheckDefinition, type ResolvedAiExecutionOptions, type ResolvedAiModelProfile, type ResolvedAiOptions, type ResolvedOpenAICompatibleProviderOptions, type RuntimeAiConfig, type RuntimeAiModelProfile, type RuntimeAiProviderProfile, type RuntimeBootstrapRequest, RuntimeDataFlowConfig, SOURCE_MARKER_ATTRIBUTE, SPOTPATCH_API_BASE, SPOTPATCH_EDITOR_PREFERENCES, SPOTPATCH_LOCALES, SPOTPATCH_LOCALE_PREFERENCES, SPOTPATCH_NEXT_BUNDLERS, SPOTPATCH_NEXT_ROUTER_KINDS, SPOTPATCH_REPOSITORY_URL, type SourceConfidence, type SourceContextRequest, type SourceMarker, type SourceOrigin, type SourceRef, type SpotAnnotation, type SpotPatchEditorPreference, SpotPatchError, type SpotPatchLocale, type SpotPatchLocalePreference, type SpotPatchNextBundler, type SpotPatchNextRouterKind, type SpotPatchRuntimeConfig, type SpotTargetContext, type StyleContext, agentCapabilityRequestSchema, agentCapabilitySnapshotSchema, agentChangedFileSchema, agentCheckResultSchema, agentJobActionRequestSchema, agentJobCreateRequestSchema, agentJobEventSchema, agentJobResultResponseSchema, agentJobResultSchema, agentJobSnapshotSchema, agentWorkspaceHealthRequestSchema, agentWorkspaceHealthSnapshotSchema, dataFlowComponentReportRequestSchema, dataFlowPageReportRequestSchema, formatSourceMarker, isSensitiveName, limitDataFlowReportCollections, openEditorRequestSchema, parseSourceMarker, redactSensitiveText, runtimeBootstrapRequestSchema, runtimeConfigSchema, sanitizeUrl, sourceContextRequestSchema, spotAnnotationRequestSchema, spotTargetContextRequestSchema };
1502
+ export { AGENT_APPLY_MODES, AGENT_CAPABILITY_STATES, AGENT_CHECK_STATUSES, AGENT_FILE_CHANGE_KINDS, AGENT_JOB_STATUSES, AGENT_WORKSPACE_SNAPSHOT_LIMITS, AGENT_WORKSPACE_STATES, type AgentApplyMode, type AgentCapabilityRequest, type AgentCapabilitySnapshot, type AgentCapabilityState, type AgentChangedFile, type AgentCheckDefinition, type AgentCheckResult, type AgentCheckStatus, type AgentFileChangeKind, type AgentJobCreateRequest, type AgentJobEvent, type AgentJobResult, type AgentJobResultResponse, type AgentJobSnapshot, type AgentJobStatus, type AgentLimits, type AgentWorkingTreeMode, type AgentWorkspaceChangeSummary, type AgentWorkspaceHealthSnapshot, type AgentWorkspaceState, type AiExecutionOptions, type AiModelProfile, type AiOptions, type AiProviderAuthentication, type AiProviderProtocol, type ApiFailure, type ApiResponse, type ApiSuccess, ComponentDataFlowReport, ContextBudget, DATA_FLOW_QUERY_ADAPTER_MODULES, DATA_FLOW_QUERY_HOOK_NAMES, DATA_FLOW_TRPC_CLIENT_FACTORY_NAMES, DATA_FLOW_TRPC_PROXY_FACTORY_NAMES, DATA_FLOW_TRPC_REQUEST_METHODS, DATA_FLOW_TRPC_ROOT_FACTORY_NAMES, DEFAULT_AGENT_LIMITS, type DataFlowCollectionLimitOptions, type DataFlowComponentReportRequest, type DataFlowPageReportRequest, ERROR_CODES, ERROR_CODE_VALUES, type EditorOpenResult, type ErrorCode, type OpenAICompatibleProviderOptions, type OpenEditorRequest, PageDataFlowReport, ReportCompleteness, type ResolvedAgentCheckDefinition, type ResolvedAiExecutionOptions, type ResolvedAiModelProfile, type ResolvedAiOptions, type ResolvedOpenAICompatibleProviderOptions, type RuntimeAiConfig, type RuntimeAiModelProfile, type RuntimeAiProviderProfile, type RuntimeBootstrapRequest, RuntimeDataFlowConfig, SOURCE_MARKER_ATTRIBUTE, SPOTPATCH_API_BASE, SPOTPATCH_EDITOR_PREFERENCES, SPOTPATCH_LOCALE_PREFERENCES, SPOTPATCH_NEXT_BUNDLERS, SPOTPATCH_NEXT_ROUTER_KINDS, SPOTPATCH_REPOSITORY_URL, type SourceContextRequest, type SourceMarker, SpotAnnotation, type SpotPatchEditorPreference, SpotPatchError, type SpotPatchNextBundler, type SpotPatchNextRouterKind, type SpotPatchRuntimeConfig, agentCapabilityRequestSchema, agentCapabilitySnapshotSchema, agentChangedFileSchema, agentCheckResultSchema, agentJobActionRequestSchema, agentJobCreateRequestSchema, agentJobEventSchema, agentJobResultResponseSchema, agentJobResultSchema, agentJobSnapshotSchema, agentWorkspaceHealthRequestSchema, agentWorkspaceHealthSnapshotSchema, dataFlowComponentReportRequestSchema, dataFlowPageReportRequestSchema, formatSourceMarker, isErrorCode, isSensitiveName, limitDataFlowReportCollections, openEditorRequestSchema, parseSourceMarker, redactSensitiveText, runtimeBootstrapRequestSchema, runtimeConfigSchema, sanitizeUrl, sourceContextRequestSchema, spotAnnotationRequestSchema, spotTargetContextRequestSchema };