@spotpatch/runtime 1.10.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,4 +11,4 @@ export {
11
11
  registerExternalHandoffExtension,
12
12
  getExternalHandoffExtension
13
13
  };
14
- //# sourceMappingURL=chunk-XBD55BCF.js.map
14
+ //# sourceMappingURL=chunk-BXRMVHNT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/external-handoff-contract.ts"],"sourcesContent":["import type {\n ErrorCode,\n ExternalAgentControlStatus,\n ExternalAgentManagedResult,\n ExternalHandoffCapability,\n ExternalHandoffPublishResult,\n ExternalHandoffStatusResult,\n ExternalHandoffFramework,\n SpotAnnotation,\n SpotPatchLocale,\n} from \"@spotpatch/shared/external-handoff-browser\";\n\nexport interface ExternalHandoffPanel {\n readonly cancelManagedButton: HTMLButtonElement;\n readonly connectButton: HTMLButtonElement;\n readonly disconnectButton: HTMLButtonElement;\n readonly refreshButton: HTMLButtonElement;\n readonly root: HTMLElement;\n readonly sendButton: HTMLButtonElement;\n readonly styles: HTMLStyleElement;\n readonly confirmDisclosure: (annotation: SpotAnnotation) => Promise<boolean>;\n readonly dispose: () => void;\n readonly renderCapability: (capability: ExternalHandoffCapability) => void;\n readonly renderControlUnavailable: () => void;\n readonly renderControlStatus: (status: ExternalAgentControlStatus) => void;\n readonly renderError: (code?: ErrorCode, retryable?: boolean) => void;\n readonly renderPublishResult: (result: ExternalHandoffPublishResult) => void;\n readonly renderPublishing: () => void;\n readonly renderManagedResult: (result: ExternalAgentManagedResult) => void;\n readonly renderStatus: (result: ExternalHandoffStatusResult) => void;\n readonly resolveButton: HTMLButtonElement;\n readonly revokeButton: HTMLButtonElement;\n readonly setBusy: (busy: boolean) => void;\n readonly setControlBusy: (busy: boolean) => void;\n readonly setContextReady: (ready: boolean) => void;\n readonly setSelectionVisible: (visible: boolean) => void;\n}\n\nexport interface ExternalHandoffWorkflow {\n readonly cancelPending: () => void;\n readonly dispose: () => void;\n readonly mount: () => void;\n}\n\nexport interface ExternalHandoffExtension {\n readonly createPanel: (\n document: Document,\n framework: ExternalHandoffFramework,\n locale: () => SpotPatchLocale,\n sessionId: string,\n subscribeLocale: (listener: () => void) => () => void,\n onViewChange: () => void,\n ) => ExternalHandoffPanel;\n readonly createWorkflow: (\n fetch: typeof globalThis.fetch,\n panel: ExternalHandoffPanel,\n selectedAnnotation: () => SpotAnnotation | undefined,\n sessionToken: string,\n window: Window,\n ) => ExternalHandoffWorkflow;\n}\n\nconst EXTERNAL_HANDOFF_EXTENSION_KEY = Symbol.for(\"spotpatch.external-handoff.v1\");\ntype ExtensionStore = Partial<Record<symbol, ExternalHandoffExtension>>;\n\nexport function registerExternalHandoffExtension(\n extension: ExternalHandoffExtension,\n): void {\n (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY] = extension;\n}\n\nexport function getExternalHandoffExtension(): ExternalHandoffExtension | undefined {\n return (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY];\n}\n"],"mappings":";AA8DA,IAAM,iCAAiC,uBAAO,IAAI,+BAA+B;AAG1E,SAAS,iCACd,WACM;AACN,EAAC,WAA8B,8BAA8B,IAAI;AACnE;AAEO,SAAS,8BAAoE;AAClF,SAAQ,WAA8B,8BAA8B;AACtE;","names":[]}