Skip to content

Commit 4a8f389

Browse files
committed
refactor(P060): drop createField from the copilot bridge
Removes the bridge.createField method, CreateFieldArgs type, the CREATE_FIELD BridgeRequestType variant, and the matching timeout-bucket arm. The copilot demo never invoked it: create_field is not a registered LLM tool (CLIENT_TOOL_NAMES omits it) and there are no direct non-dispatcher consumers. Cleanup of dead surface — the iframe contract itself still exposes CREATE_FIELD for SDK consumers, this only trims the copilot's internal bridge.
1 parent 577aa65 commit 4a8f389

3 files changed

Lines changed: 0 additions & 25 deletions

File tree

copilot/src/lib/embed-bridge/bridge.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
type BridgeRequestType,
44
type BridgeResult,
55
type BridgeState,
6-
type CreateFieldArgs,
76
type DocumentContentResult,
87
type FieldRecord,
98
type IframeBridge,
@@ -34,7 +33,6 @@ const getRequestTimeoutMs = (requestType: BridgeRequestType): number => {
3433
case 'DETECT_FIELDS':
3534
case 'GET_DOCUMENT_CONTENT':
3635
return HEAVY_REQUEST_TIMEOUT_MS
37-
case 'CREATE_FIELD':
3836
case 'DELETE_FIELDS':
3937
case 'DELETE_PAGES':
4038
case 'FOCUS_FIELD':
@@ -389,16 +387,6 @@ export const createBridge = ({
389387
getFields: () => sendRequest<{ fields: FieldRecord[] }>('GET_FIELDS', {}),
390388
setFieldValue: ({ fieldId, value }) => sendRequest('SET_FIELD_VALUE', { field_id: fieldId, value }),
391389
focusField: ({ fieldId }) => sendRequest('FOCUS_FIELD', { field_id: fieldId }),
392-
createField: ({ type, x, y, width, height, page, value }: CreateFieldArgs) =>
393-
sendRequest<{ field_id: string }>('CREATE_FIELD', {
394-
type,
395-
x,
396-
y,
397-
width,
398-
height,
399-
page,
400-
value: value ?? null,
401-
}),
402390
submit: ({ downloadCopy }) => sendRequest('SUBMIT', { download_copy: downloadCopy }),
403391
download: () => sendRequest('DOWNLOAD', {}),
404392
movePage: ({ fromPage, toPage }) => sendRequest('MOVE_PAGE', { from_page: fromPage, to_page: toPage }),

copilot/src/lib/embed-bridge/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export type {
66
BridgeRequestType,
77
BridgeResult,
88
BridgeState,
9-
CreateFieldArgs,
109
DeleteFieldsArgs,
1110
DocumentContentPage,
1211
DocumentContentResult,

copilot/src/lib/embed-bridge/types.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ export type LoadDocumentArgs = {
6868
initialPage?: number
6969
}
7070

71-
export type CreateFieldArgs = {
72-
type: SupportedFieldType
73-
x: number
74-
y: number
75-
width: number
76-
height: number
77-
page: number
78-
value?: string | null
79-
}
80-
8171
export type DeleteFieldsArgs = {
8272
fieldIds?: unknown
8373
page?: unknown
@@ -104,7 +94,6 @@ export type BridgeRequestType =
10494
| 'GET_FIELDS'
10595
| 'SET_FIELD_VALUE'
10696
| 'FOCUS_FIELD'
107-
| 'CREATE_FIELD'
10897
| 'SUBMIT'
10998
| 'DOWNLOAD'
11099
| 'MOVE_PAGE'
@@ -131,7 +120,6 @@ export type IframeBridge = {
131120
focusField: (args: {
132121
fieldId: unknown
133122
}) => Promise<BridgeResult<{ hint: { type: 'user_action_expected'; message: string } } | null>>
134-
createField: (args: CreateFieldArgs) => Promise<BridgeResult<{ field_id: string }>>
135123
submit: (args: { downloadCopy: boolean }) => Promise<BridgeResult>
136124
download: () => Promise<BridgeResult>
137125
movePage: (args: { fromPage: unknown; toPage: unknown }) => Promise<BridgeResult>

0 commit comments

Comments
 (0)