@geometra/mcp 1.64.0 → 1.65.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/README.md +29 -7
- package/dist/index.js +2 -5
- package/dist/proxy-spawn.d.ts +29 -0
- package/dist/proxy-spawn.js +49 -17
- package/dist/server.js +849 -219
- package/dist/session-state.js +262 -80
- package/dist/session.d.ts +93 -13
- package/dist/session.js +1365 -321
- package/dist/state-privacy.d.ts +23 -0
- package/dist/state-privacy.js +171 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +32 -0
- package/package.json +4 -4
package/dist/session.d.ts
CHANGED
|
@@ -44,6 +44,14 @@ export interface A11yNode {
|
|
|
44
44
|
inputPattern?: string;
|
|
45
45
|
inputType?: string;
|
|
46
46
|
autocomplete?: string;
|
|
47
|
+
/** True when this semantic node represents an `<input type="file">`. */
|
|
48
|
+
fileInput?: boolean;
|
|
49
|
+
/** Authored file-type filter from the input's `accept` attribute. */
|
|
50
|
+
accept?: string;
|
|
51
|
+
/** True when the file input accepts more than one file. */
|
|
52
|
+
multiple?: boolean;
|
|
53
|
+
/** Geometry-only fallback that cannot be resolved by semantic proxy actions. */
|
|
54
|
+
coordinateOnly?: boolean;
|
|
47
55
|
/**
|
|
48
56
|
* True when the extractor detected that this `<input>` (or role=textbox)
|
|
49
57
|
* lives inside an autocomplete / searchable combobox wrapper — React
|
|
@@ -292,7 +300,7 @@ export interface PageSectionDetail {
|
|
|
292
300
|
items: PageListItemModel[];
|
|
293
301
|
textPreview: string[];
|
|
294
302
|
}
|
|
295
|
-
export type FormSchemaFieldKind = 'text' | 'choice' | 'toggle' | 'multi_choice';
|
|
303
|
+
export type FormSchemaFieldKind = 'text' | 'choice' | 'toggle' | 'multi_choice' | 'file';
|
|
296
304
|
export type FormSchemaChoiceType = 'select' | 'group' | 'listbox';
|
|
297
305
|
export type FormSchemaContextMode = 'auto' | 'always' | 'none';
|
|
298
306
|
export interface FormSchemaOption {
|
|
@@ -328,6 +336,8 @@ export interface FormSchemaField {
|
|
|
328
336
|
pattern?: string;
|
|
329
337
|
inputType?: string;
|
|
330
338
|
autocomplete?: string;
|
|
339
|
+
accept?: string;
|
|
340
|
+
multiple?: boolean;
|
|
331
341
|
};
|
|
332
342
|
context?: NodeContextModel;
|
|
333
343
|
}
|
|
@@ -466,7 +476,11 @@ export interface WorkflowPageEntry {
|
|
|
466
476
|
pageUrl: string;
|
|
467
477
|
formId?: string;
|
|
468
478
|
formName?: string;
|
|
469
|
-
|
|
479
|
+
/** Backward-compatible value map whose contents are always redaction markers. */
|
|
480
|
+
filledValues: Record<string, '[REDACTED]'>;
|
|
481
|
+
/** Stable field identities retained without submitted values. */
|
|
482
|
+
filledFields: string[];
|
|
483
|
+
valuesRedacted: true;
|
|
470
484
|
filledAt: number;
|
|
471
485
|
fieldCount: number;
|
|
472
486
|
invalidCount: number;
|
|
@@ -482,7 +496,28 @@ export interface Session {
|
|
|
482
496
|
layout: Record<string, unknown> | null;
|
|
483
497
|
tree: Record<string, unknown> | null;
|
|
484
498
|
url: string;
|
|
499
|
+
/** Private bearer capability for an authenticated proxy transport. */
|
|
500
|
+
transportAuthToken?: string;
|
|
485
501
|
updateRevision: number;
|
|
502
|
+
/** Negotiated owner of the WebSocket endpoint. */
|
|
503
|
+
peerTransport?: 'native' | 'proxy';
|
|
504
|
+
/** Negotiated shared geometry protocol version. */
|
|
505
|
+
peerGeometryProtocolVersion?: number;
|
|
506
|
+
/** Negotiated browser-only action protocol version. */
|
|
507
|
+
peerProxyActionProtocolVersion?: number;
|
|
508
|
+
/** True when the peer advertised the split protocol contract explicitly. */
|
|
509
|
+
peerAdvertisedSplitProtocol?: boolean;
|
|
510
|
+
peerProtocolCapabilities?: {
|
|
511
|
+
authenticatedController?: boolean;
|
|
512
|
+
requestScopedAcks?: boolean;
|
|
513
|
+
actionDeadlines?: boolean;
|
|
514
|
+
idempotentRequestIds?: boolean;
|
|
515
|
+
atomicTypeText?: boolean;
|
|
516
|
+
proxyActions?: boolean;
|
|
517
|
+
exactFieldIdentity?: boolean;
|
|
518
|
+
verifiedFileUploads?: boolean;
|
|
519
|
+
binaryFraming?: boolean;
|
|
520
|
+
};
|
|
486
521
|
/** Present when this session owns a child geometra-proxy process (pageUrl connect). */
|
|
487
522
|
proxyChild?: ChildProcess;
|
|
488
523
|
proxyRuntime?: EmbeddedProxyRuntime;
|
|
@@ -503,6 +538,10 @@ export interface Session {
|
|
|
503
538
|
revision: number;
|
|
504
539
|
forms: FormSchemaModel[];
|
|
505
540
|
}>;
|
|
541
|
+
/** True only after the current WebSocket transport has supplied a full frame. */
|
|
542
|
+
hasFreshFrame?: boolean;
|
|
543
|
+
/** Permanently set when this session has been disconnected or otherwise retired. */
|
|
544
|
+
disposed?: boolean;
|
|
506
545
|
workflowState?: WorkflowState;
|
|
507
546
|
reconnectInFlight?: Promise<boolean>;
|
|
508
547
|
lifecycleTaskId?: string;
|
|
@@ -513,6 +552,10 @@ export interface Session {
|
|
|
513
552
|
heartbeatInterval?: ReturnType<typeof setInterval> | null;
|
|
514
553
|
heartbeatLastMessageAt?: number;
|
|
515
554
|
heartbeatPendingPongBy?: number | null;
|
|
555
|
+
/** Mutating operations whose caller timed out before a terminal response. */
|
|
556
|
+
ambiguousOperations?: Map<string, AmbiguousOperation>;
|
|
557
|
+
/** Mutating operations currently awaiting a terminal response. */
|
|
558
|
+
inFlightMutations?: Map<string, AmbiguousOperation>;
|
|
516
559
|
}
|
|
517
560
|
export interface SessionConnectTrace {
|
|
518
561
|
mode: 'direct-ws' | 'fresh-proxy' | 'reused-proxy';
|
|
@@ -532,8 +575,42 @@ export interface SessionConnectTrace {
|
|
|
532
575
|
export interface UpdateWaitResult {
|
|
533
576
|
status: 'updated' | 'acknowledged' | 'timed_out';
|
|
534
577
|
timeoutMs: number;
|
|
578
|
+
/** Wire identity used to correlate the terminal proxy response. */
|
|
579
|
+
requestId: string;
|
|
580
|
+
/** Stable logical identity shared by every wire phase of one action. */
|
|
581
|
+
actionId: string;
|
|
535
582
|
result?: unknown;
|
|
536
583
|
}
|
|
584
|
+
interface AmbiguousOperation {
|
|
585
|
+
fingerprint: string;
|
|
586
|
+
actionId: string;
|
|
587
|
+
requestId: string;
|
|
588
|
+
requestIds: string[];
|
|
589
|
+
wireMessages: string[];
|
|
590
|
+
actionTimeoutMs?: number;
|
|
591
|
+
timeoutMs: number;
|
|
592
|
+
idempotent: boolean;
|
|
593
|
+
mutating: boolean;
|
|
594
|
+
/** A correlated ACK alone is insufficient for actions such as navigation. */
|
|
595
|
+
requireUpdateOnAck?: boolean;
|
|
596
|
+
/** Protocol floor that the terminal ACK must explicitly satisfy. */
|
|
597
|
+
requiredProtocolVersion?: number;
|
|
598
|
+
/** Any non-deduplication phase error permanently blocks later ACK promotion. */
|
|
599
|
+
stickyError?: Error;
|
|
600
|
+
/**
|
|
601
|
+
* Once any caller observes a timeout, identical intent is permanently
|
|
602
|
+
* pinned to this identity for the rest of the session. A future caller
|
|
603
|
+
* cannot prove it is (or is not) the timed-out caller.
|
|
604
|
+
*/
|
|
605
|
+
permanentTombstone?: boolean;
|
|
606
|
+
completion?: {
|
|
607
|
+
kind: 'result';
|
|
608
|
+
value: UpdateWaitResult;
|
|
609
|
+
} | {
|
|
610
|
+
kind: 'error';
|
|
611
|
+
error: Error;
|
|
612
|
+
};
|
|
613
|
+
}
|
|
537
614
|
export type ProxyFillField = {
|
|
538
615
|
kind: 'auto';
|
|
539
616
|
fieldId?: string;
|
|
@@ -606,6 +683,8 @@ export declare function connect(url: string, opts?: {
|
|
|
606
683
|
skipInitialResize?: boolean;
|
|
607
684
|
closePreviousProxy?: boolean;
|
|
608
685
|
awaitInitialFrame?: boolean;
|
|
686
|
+
authToken?: string;
|
|
687
|
+
isolated?: boolean;
|
|
609
688
|
}): Promise<Session>;
|
|
610
689
|
/**
|
|
611
690
|
* Start geometra-proxy for `pageUrl`, connect to its WebSocket, and attach the child
|
|
@@ -622,12 +701,10 @@ export declare function connectThroughProxy(options: {
|
|
|
622
701
|
awaitInitialFrame?: boolean;
|
|
623
702
|
eagerInitialExtract?: boolean;
|
|
624
703
|
/**
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
* submission so localStorage / cookies / page state from one job cannot
|
|
630
|
-
* leak into another. Default false preserves the existing pool behavior.
|
|
704
|
+
* Browser sessions are isolated by default. Pass `false` explicitly to
|
|
705
|
+
* opt into sequential warm-browser reuse, including shared cookies and
|
|
706
|
+
* localStorage. Isolated sessions never enter the reusable pool and their
|
|
707
|
+
* browser is destroyed on disconnect.
|
|
631
708
|
*/
|
|
632
709
|
isolated?: boolean;
|
|
633
710
|
/**
|
|
@@ -682,7 +759,10 @@ export declare function disconnect(opts?: {
|
|
|
682
759
|
closeProxy?: boolean;
|
|
683
760
|
sessionId?: string;
|
|
684
761
|
}): void;
|
|
762
|
+
/** Process/test teardown only. User-facing disconnects are always owner-scoped. */
|
|
763
|
+
export declare function shutdownAllSessionsAndProxies(): void;
|
|
685
764
|
export declare function waitForUiCondition(session: Session, predicate: () => boolean, timeoutMs: number): Promise<boolean>;
|
|
765
|
+
export declare function ensureSessionConnected(session: Session): Promise<void>;
|
|
686
766
|
/**
|
|
687
767
|
* Send a click event at (x, y) and wait for the next frame/patch response.
|
|
688
768
|
*/
|
|
@@ -702,7 +782,9 @@ export declare function sendKey(session: Session, key: string, modifiers?: {
|
|
|
702
782
|
}, timeoutMs?: number): Promise<UpdateWaitResult>;
|
|
703
783
|
/**
|
|
704
784
|
* Attach local file(s). Paths must exist on the machine running `@geometra/proxy` (not the MCP host).
|
|
705
|
-
* Optional `x`,`y` click opens a file chooser
|
|
785
|
+
* Optional `x`,`y` click opens a file chooser. Callers must provide an explicit
|
|
786
|
+
* coordinate or semantic target; MCP never intentionally requests a global
|
|
787
|
+
* first-file-input fallback.
|
|
706
788
|
*/
|
|
707
789
|
export declare function sendFileUpload(session: Session, paths: string[], opts?: {
|
|
708
790
|
click?: {
|
|
@@ -718,6 +800,8 @@ export declare function sendFileUpload(session: Session, paths: string[], opts?:
|
|
|
718
800
|
x: number;
|
|
719
801
|
y: number;
|
|
720
802
|
};
|
|
803
|
+
contextText?: string;
|
|
804
|
+
sectionText?: string;
|
|
721
805
|
}, timeoutMs?: number): Promise<UpdateWaitResult>;
|
|
722
806
|
/** Set a labeled text-like field (`input`, `textarea`, contenteditable, ARIA textbox) semantically. */
|
|
723
807
|
export declare function sendFieldText(session: Session, fieldLabel: string, value: string, opts?: {
|
|
@@ -751,10 +835,6 @@ export declare function sendFillOtp(session: Session, value: string, opts?: {
|
|
|
751
835
|
/** ARIA `role=option` listbox (e.g. React Select). Optional click opens the list. */
|
|
752
836
|
export declare function sendListboxPick(session: Session, label: string, opts?: {
|
|
753
837
|
exact?: boolean;
|
|
754
|
-
open?: {
|
|
755
|
-
x: number;
|
|
756
|
-
y: number;
|
|
757
|
-
};
|
|
758
838
|
fieldLabel?: string;
|
|
759
839
|
query?: string;
|
|
760
840
|
fieldId?: string;
|