@shadowob/sdk
Advanced tools
| import { | ||
| BUDDY_INBOX_DELIVERY_PERMISSION, | ||
| decodeShadowServerAppLaunchTokenHint, | ||
| deliverShadowServerAppLaunchOutbox, | ||
| getShadowServerAppChannelMessageDeliveries, | ||
| getShadowServerAppChannelMessageErrors, | ||
| getShadowServerAppInboxDeliveries, | ||
| getShadowServerAppInboxErrors, | ||
| hasShadowServerAppPendingOutbox, | ||
| readShadowServerAppCommandResponse, | ||
| unwrapShadowServerAppCommandPayload | ||
| } from "./chunk-5ODYWMBC.js"; | ||
| // src/bridge.ts | ||
| var SHADOW_BRIDGE_CAPABILITIES = [ | ||
| "copilot.open", | ||
| "workspace.open", | ||
| "buddy.create.open", | ||
| "buddy.inboxes.list", | ||
| "buddy.grant.ensure", | ||
| "oauth.authorize", | ||
| "route.navigate" | ||
| ]; | ||
| function commandPath(basePath, commandName) { | ||
| return `${basePath.replace(/\/+$/u, "")}/${encodeURIComponent(commandName)}`; | ||
| } | ||
| function shadowServerAppMountedPathPrefix(windowRef) { | ||
| const win = windowRef ?? (typeof window === "undefined" ? null : window); | ||
| const pathname = win?.location?.pathname ?? ""; | ||
| const segments = pathname.split("/").filter(Boolean); | ||
| const shadowIndex = segments.indexOf("shadow"); | ||
| if (shadowIndex <= 0 || segments[shadowIndex + 1] !== "server") return ""; | ||
| return `/${segments.slice(0, shadowIndex).join("/")}`; | ||
| } | ||
| function shadowServerAppMountedPath(path, windowRef) { | ||
| const normalized = path.startsWith("/") ? path : `/${path}`; | ||
| return `${shadowServerAppMountedPathPrefix(windowRef)}${normalized}`; | ||
| } | ||
| function isRecord(value) { | ||
| return !!value && typeof value === "object" && !Array.isArray(value); | ||
| } | ||
| function withoutUndefined(value) { | ||
| if (value === void 0) return {}; | ||
| if (Array.isArray(value)) return value.map(withoutUndefined); | ||
| if (!isRecord(value)) return value; | ||
| return Object.fromEntries( | ||
| Object.entries(value).filter(([, entry]) => entry !== void 0).map(([key, entry]) => [key, withoutUndefined(entry)]) | ||
| ); | ||
| } | ||
| var ShadowServerAppBrowserClient = class { | ||
| bridge; | ||
| commandBasePath; | ||
| inboxesPath; | ||
| shadowApiBaseUrl; | ||
| fetchFn; | ||
| deliverLaunchOutboxFromBrowser; | ||
| win; | ||
| constructor(options = {}) { | ||
| this.bridge = new ShadowBridge(options); | ||
| const windowRef = options.windowRef ?? (typeof window === "undefined" ? null : window); | ||
| this.commandBasePath = options.commandBasePath ?? shadowServerAppMountedPath("/api/local/commands", windowRef); | ||
| this.inboxesPath = options.inboxesPath ?? shadowServerAppMountedPath("/api/local/inboxes", windowRef); | ||
| this.shadowApiBaseUrl = options.shadowApiBaseUrl; | ||
| this.fetchFn = options.fetch; | ||
| this.deliverLaunchOutboxFromBrowser = options.deliverLaunchOutboxFromBrowser ?? false; | ||
| this.win = windowRef; | ||
| } | ||
| bridgeAvailable() { | ||
| return this.bridge.isAvailable(); | ||
| } | ||
| launchToken(param = "shadow_launch") { | ||
| if (!this.win) return null; | ||
| return new URLSearchParams(this.win.location.search).get(param); | ||
| } | ||
| launchHeaders(headers = {}, options = {}) { | ||
| const token = this.launchToken(options.launchTokenParam); | ||
| return token ? { ...headers, "X-Shadow-Launch-Token": token } : headers; | ||
| } | ||
| async command(commandName, input = {}) { | ||
| const response = await this.fetch(commandPath(this.commandBasePath, commandName), { | ||
| method: "POST", | ||
| headers: this.launchHeaders({ "Content-Type": "application/json" }), | ||
| body: JSON.stringify({ input: withoutUndefined(input) }) | ||
| }); | ||
| const result = await readShadowServerAppCommandResponse(response); | ||
| return this.deliverLaunchOutbox(commandName, result); | ||
| } | ||
| async listBuddyInboxes(options = {}) { | ||
| if (this.bridge.isAvailable()) { | ||
| try { | ||
| return await this.bridge.listBuddyInboxes({ refresh: options.refresh }); | ||
| } catch { | ||
| } | ||
| } | ||
| const response = await this.fetch(this.inboxesPath, { headers: this.launchHeaders() }); | ||
| if (!response.ok) { | ||
| if (options.emptyOnError) return { inboxes: [] }; | ||
| const message = await response.text().catch(() => ""); | ||
| throw new Error(message || `Buddy inbox lookup failed (${response.status})`); | ||
| } | ||
| return await response.json(); | ||
| } | ||
| async ensureBuddyTaskGrant(input) { | ||
| const buddyAgentId = input.agentId?.trim(); | ||
| if (!buddyAgentId || !this.bridge.isAvailable()) return { granted: false, skipped: true }; | ||
| return this.bridge.ensureBuddyGrant( | ||
| { | ||
| buddyAgentId, | ||
| permissions: input.permissions ?? [BUDDY_INBOX_DELIVERY_PERMISSION], | ||
| reason: input.reason | ||
| }, | ||
| { timeoutMs: input.timeoutMs ?? 6e4 } | ||
| ); | ||
| } | ||
| openBuddyCreator(input = {}, options = {}) { | ||
| if (!this.bridge.isAvailable()) return Promise.resolve({ opened: false, agent: null }); | ||
| return this.bridge.openBuddyCreator(input, options); | ||
| } | ||
| openCopilot(delivery, options = {}) { | ||
| return this.bridge.openCopilot(delivery, options); | ||
| } | ||
| openWorkspaceResource(input, options = {}) { | ||
| return this.bridge.openWorkspaceResource(input, options); | ||
| } | ||
| authorizeOAuth(input, options = {}) { | ||
| if (!this.bridge.isAvailable()) return Promise.resolve({ opened: false }); | ||
| return this.bridge.authorizeOAuth(input, options); | ||
| } | ||
| inboxDeliveries(payload) { | ||
| return this.bridge.inboxDeliveries(payload); | ||
| } | ||
| inboxErrors(payload) { | ||
| return this.bridge.inboxErrors(payload); | ||
| } | ||
| channelMessageDeliveries(payload) { | ||
| return this.bridge.channelMessageDeliveries(payload); | ||
| } | ||
| channelMessageErrors(payload) { | ||
| return this.bridge.channelMessageErrors(payload); | ||
| } | ||
| async deliverLaunchOutbox(commandName, result) { | ||
| if (!this.deliverLaunchOutboxFromBrowser || !hasShadowServerAppPendingOutbox(result)) { | ||
| return result; | ||
| } | ||
| const launchToken = this.launchToken(); | ||
| if (!decodeShadowServerAppLaunchTokenHint(launchToken)) return result; | ||
| return await deliverShadowServerAppLaunchOutbox({ | ||
| commandName, | ||
| result, | ||
| launchToken, | ||
| shadowApiBaseUrl: this.shadowApiBaseUrl, | ||
| fetch: this.fetch.bind(this) | ||
| }); | ||
| } | ||
| fetch(input, init) { | ||
| if (this.fetchFn) return this.fetchFn(input, init); | ||
| return globalThis.fetch(input, init); | ||
| } | ||
| }; | ||
| function createShadowServerAppClient(options = {}) { | ||
| return new ShadowServerAppBrowserClient(options); | ||
| } | ||
| var createShadowServerAppBrowserClient = createShadowServerAppClient; | ||
| function createShadowServerAppRuntimeClient(options = {}) { | ||
| const windowRef = options.windowRef ?? (typeof window === "undefined" ? void 0 : window); | ||
| return new ShadowServerAppBrowserClient({ | ||
| ...options, | ||
| windowRef, | ||
| commandBasePath: options.commandBasePath ?? shadowServerAppMountedPath("/api/runtime/commands", windowRef), | ||
| inboxesPath: options.inboxesPath ?? shadowServerAppMountedPath("/api/runtime/inboxes", windowRef), | ||
| deliverLaunchOutboxFromBrowser: false | ||
| }); | ||
| } | ||
| var ShadowBridge = class _ShadowBridge { | ||
| static capabilitiesRequestType = "shadow.app.capabilities.request"; | ||
| static capabilitiesResponseType = "shadow.app.capabilities.response"; | ||
| static openCopilotRequestType = "shadow.app.copilot.open.request"; | ||
| static openCopilotResponseType = "shadow.app.copilot.open.response"; | ||
| static openWorkspaceResourceRequestType = "shadow.app.workspace.open.request"; | ||
| static openWorkspaceResourceResponseType = "shadow.app.workspace.open.response"; | ||
| static openBuddyCreatorRequestType = "shadow.app.buddy.create.request"; | ||
| static openBuddyCreatorResponseType = "shadow.app.buddy.create.response"; | ||
| static listBuddyInboxesRequestType = "shadow.app.buddy.inboxes.request"; | ||
| static listBuddyInboxesResponseType = "shadow.app.buddy.inboxes.response"; | ||
| static ensureBuddyGrantRequestType = "shadow.app.buddy.grant.request"; | ||
| static ensureBuddyGrantResponseType = "shadow.app.buddy.grant.response"; | ||
| static authorizeOAuthRequestType = "shadow.app.oauth.authorize.request"; | ||
| static authorizeOAuthResponseType = "shadow.app.oauth.authorize.response"; | ||
| static inboxDeliveries(payload) { | ||
| return getShadowServerAppInboxDeliveries(payload); | ||
| } | ||
| static inboxErrors(payload) { | ||
| return getShadowServerAppInboxErrors(payload); | ||
| } | ||
| static channelMessageDeliveries(payload) { | ||
| return getShadowServerAppChannelMessageDeliveries(payload); | ||
| } | ||
| static channelMessageErrors(payload) { | ||
| return getShadowServerAppChannelMessageErrors(payload); | ||
| } | ||
| static unwrapCommandPayload(payload) { | ||
| return unwrapShadowServerAppCommandPayload(payload); | ||
| } | ||
| appKey; | ||
| targetOrigin; | ||
| timeoutMs; | ||
| win; | ||
| hasLaunchContext; | ||
| pending = /* @__PURE__ */ new Map(); | ||
| onMessage = (event) => { | ||
| let data = event.data; | ||
| if (typeof data === "string") { | ||
| try { | ||
| data = JSON.parse(data || "{}"); | ||
| } catch { | ||
| return; | ||
| } | ||
| } | ||
| if (!data || typeof data !== "object") return; | ||
| const record = data; | ||
| if (typeof record.requestId !== "string" || typeof record.type !== "string") return; | ||
| const entry = this.pending.get(record.requestId); | ||
| if (!entry || record.type !== entry.responseType) return; | ||
| this.pending.delete(record.requestId); | ||
| if (record.ok) entry.resolve(record.result); | ||
| else | ||
| entry.reject( | ||
| new Error(typeof record.error === "string" ? record.error : "Bridge request failed") | ||
| ); | ||
| }; | ||
| constructor(options = {}) { | ||
| this.win = options.windowRef ?? (typeof window === "undefined" ? null : window); | ||
| this.appKey = options.appKey ?? this.resolveLaunchAppKey(); | ||
| this.targetOrigin = options.targetOrigin ?? "*"; | ||
| this.timeoutMs = options.timeoutMs ?? 6e4; | ||
| this.hasLaunchContext = this.resolveLaunchContext(); | ||
| this.win?.addEventListener("message", this.onMessage); | ||
| } | ||
| dispose() { | ||
| this.win?.removeEventListener("message", this.onMessage); | ||
| for (const entry of this.pending.values()) { | ||
| entry.reject(new Error("ShadowBridge disposed")); | ||
| } | ||
| this.pending.clear(); | ||
| } | ||
| isAvailable() { | ||
| if (!this.win) return false; | ||
| return this.hasLaunchContext && (this.win.parent !== this.win || !!this.win.ReactNativeWebView); | ||
| } | ||
| capabilities(options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.capabilitiesRequestType, | ||
| _ShadowBridge.capabilitiesResponseType, | ||
| {}, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openCopilot(deliveryOrInput, options = {}) { | ||
| const input = "delivery" in deliveryOrInput ? deliveryOrInput : { delivery: deliveryOrInput }; | ||
| return this.request( | ||
| _ShadowBridge.openCopilotRequestType, | ||
| _ShadowBridge.openCopilotResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openWorkspaceResource(input, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.openWorkspaceResourceRequestType, | ||
| _ShadowBridge.openWorkspaceResourceResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openBuddyCreator(input = {}, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.openBuddyCreatorRequestType, | ||
| _ShadowBridge.openBuddyCreatorResponseType, | ||
| input, | ||
| options.timeoutMs ?? 10 * 60 * 1e3 | ||
| ); | ||
| } | ||
| listBuddyInboxes(input = {}, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.listBuddyInboxesRequestType, | ||
| _ShadowBridge.listBuddyInboxesResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| ensureBuddyGrant(input, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.ensureBuddyGrantRequestType, | ||
| _ShadowBridge.ensureBuddyGrantResponseType, | ||
| input, | ||
| options.timeoutMs ?? 3e4 | ||
| ); | ||
| } | ||
| authorizeOAuth(input, options = {}) { | ||
| const payload = typeof input === "string" ? { authorizeUrl: input } : input; | ||
| return this.request( | ||
| _ShadowBridge.authorizeOAuthRequestType, | ||
| _ShadowBridge.authorizeOAuthResponseType, | ||
| payload, | ||
| options.timeoutMs ?? 10 * 60 * 1e3 | ||
| ); | ||
| } | ||
| unwrapCommandPayload(payload) { | ||
| return unwrapShadowServerAppCommandPayload(payload); | ||
| } | ||
| inboxDeliveries(payload) { | ||
| return getShadowServerAppInboxDeliveries(payload); | ||
| } | ||
| inboxErrors(payload) { | ||
| return getShadowServerAppInboxErrors(payload); | ||
| } | ||
| channelMessageDeliveries(payload) { | ||
| return getShadowServerAppChannelMessageDeliveries(payload); | ||
| } | ||
| channelMessageErrors(payload) { | ||
| return getShadowServerAppChannelMessageErrors(payload); | ||
| } | ||
| request(requestType, responseType, payload, timeoutMs = this.timeoutMs) { | ||
| if (!this.isAvailable()) { | ||
| return Promise.reject( | ||
| new Error("ShadowBridge is not available outside a Shadow launch frame") | ||
| ); | ||
| } | ||
| const requestId = `req_${Math.random().toString(36).slice(2)}`; | ||
| return new Promise((resolve, reject) => { | ||
| this.pending.set(requestId, { | ||
| responseType, | ||
| resolve, | ||
| reject | ||
| }); | ||
| this.postMessage({ | ||
| type: requestType, | ||
| requestId, | ||
| ...this.appKey ? { appKey: this.appKey } : {}, | ||
| ...payload | ||
| }); | ||
| this.win?.setTimeout(() => { | ||
| if (!this.pending.has(requestId)) return; | ||
| this.pending.delete(requestId); | ||
| reject(new Error("Bridge request timed out")); | ||
| }, timeoutMs); | ||
| }); | ||
| } | ||
| postMessage(message) { | ||
| if (!this.win) return; | ||
| if (this.win.ReactNativeWebView) { | ||
| this.win.ReactNativeWebView.postMessage(JSON.stringify(message)); | ||
| return; | ||
| } | ||
| this.win.parent.postMessage(message, this.targetOrigin); | ||
| } | ||
| resolveLaunchContext() { | ||
| if (!this.win) return false; | ||
| const storageKey = this.appKey ? `shadow.bridge.launch:${this.appKey}` : null; | ||
| const memoryContexts = this.win.__shadowBridgeLaunchContexts ??= {}; | ||
| const hasLaunchToken = new URLSearchParams(this.win.location.search).has("shadow_launch"); | ||
| if (hasLaunchToken) { | ||
| if (this.appKey) memoryContexts[this.appKey] = true; | ||
| try { | ||
| if (storageKey) this.win.sessionStorage?.setItem(storageKey, "1"); | ||
| } catch { | ||
| } | ||
| return true; | ||
| } | ||
| if (this.appKey && memoryContexts[this.appKey]) return true; | ||
| try { | ||
| return storageKey ? this.win.sessionStorage?.getItem(storageKey) === "1" : false; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| resolveLaunchAppKey() { | ||
| if (!this.win) return void 0; | ||
| const token = new URLSearchParams(this.win.location.search).get("shadow_launch"); | ||
| return decodeShadowServerAppLaunchTokenHint(token)?.appKey; | ||
| } | ||
| }; | ||
| export { | ||
| SHADOW_BRIDGE_CAPABILITIES, | ||
| shadowServerAppMountedPathPrefix, | ||
| shadowServerAppMountedPath, | ||
| ShadowServerAppBrowserClient, | ||
| createShadowServerAppClient, | ||
| createShadowServerAppBrowserClient, | ||
| createShadowServerAppRuntimeClient, | ||
| ShadowBridge | ||
| }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
+28
-0
@@ -33,2 +33,3 @@ "use strict"; | ||
| createShadowServerAppClient: () => createShadowServerAppClient, | ||
| createShadowServerAppRuntimeClient: () => createShadowServerAppRuntimeClient, | ||
| getShadowServerAppChannelMessageDeliveries: () => getShadowServerAppChannelMessageDeliveries, | ||
@@ -322,2 +323,3 @@ getShadowServerAppChannelMessageErrors: () => getShadowServerAppChannelMessageErrors, | ||
| "buddy.grant.ensure", | ||
| "oauth.authorize", | ||
| "route.navigate" | ||
@@ -426,2 +428,6 @@ ]; | ||
| } | ||
| authorizeOAuth(input, options = {}) { | ||
| if (!this.bridge.isAvailable()) return Promise.resolve({ opened: false }); | ||
| return this.bridge.authorizeOAuth(input, options); | ||
| } | ||
| inboxDeliveries(payload) { | ||
@@ -462,2 +468,12 @@ return this.bridge.inboxDeliveries(payload); | ||
| var createShadowServerAppBrowserClient = createShadowServerAppClient; | ||
| function createShadowServerAppRuntimeClient(options = {}) { | ||
| const windowRef = options.windowRef ?? (typeof window === "undefined" ? void 0 : window); | ||
| return new ShadowServerAppBrowserClient({ | ||
| ...options, | ||
| windowRef, | ||
| commandBasePath: options.commandBasePath ?? shadowServerAppMountedPath("/api/runtime/commands", windowRef), | ||
| inboxesPath: options.inboxesPath ?? shadowServerAppMountedPath("/api/runtime/inboxes", windowRef), | ||
| deliverLaunchOutboxFromBrowser: false | ||
| }); | ||
| } | ||
| var ShadowBridge = class _ShadowBridge { | ||
@@ -476,2 +492,4 @@ static capabilitiesRequestType = "shadow.app.capabilities.request"; | ||
| static ensureBuddyGrantResponseType = "shadow.app.buddy.grant.response"; | ||
| static authorizeOAuthRequestType = "shadow.app.oauth.authorize.request"; | ||
| static authorizeOAuthResponseType = "shadow.app.oauth.authorize.response"; | ||
| static inboxDeliveries(payload) { | ||
@@ -587,2 +605,11 @@ return getShadowServerAppInboxDeliveries(payload); | ||
| } | ||
| authorizeOAuth(input, options = {}) { | ||
| const payload = typeof input === "string" ? { authorizeUrl: input } : input; | ||
| return this.request( | ||
| _ShadowBridge.authorizeOAuthRequestType, | ||
| _ShadowBridge.authorizeOAuthResponseType, | ||
| payload, | ||
| options.timeoutMs ?? 10 * 60 * 1e3 | ||
| ); | ||
| } | ||
| unwrapCommandPayload(payload) { | ||
@@ -675,2 +702,3 @@ return unwrapShadowServerAppCommandPayload(payload); | ||
| createShadowServerAppClient, | ||
| createShadowServerAppRuntimeClient, | ||
| getShadowServerAppChannelMessageDeliveries, | ||
@@ -677,0 +705,0 @@ getShadowServerAppChannelMessageErrors, |
+28
-4
@@ -1,3 +0,3 @@ | ||
| import { cu as ShadowServerAppInboxDelivery, cv as ShadowServerAppInboxDeliveryError, c2 as ShadowServerAppChannelMessageDelivery, c3 as ShadowServerAppChannelMessageDeliveryError, X as ShadowBuddyInboxSummary } from './server-app-B5LcrBUV.cjs'; | ||
| export { bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, c4 as ShadowServerAppChannelMessageOutbox, ca as ShadowServerAppCommandEventType, cr as ShadowServerAppHostAppRef, cs as ShadowServerAppHostInboxTaskRequestInput, cw as ShadowServerAppInboxDeliveryFromMessageInput, cx as ShadowServerAppInboxTarget, cy as ShadowServerAppInboxTaskOutbox, cJ as ShadowServerAppResolvedInboxTaskRequest, cK as ShadowServerAppResultShadow, cV as buildShadowServerAppInboxDelivery, cW as buildShadowServerAppInboxTaskRequest, d2 as getShadowServerAppChannelMessageDeliveries, d3 as getShadowServerAppChannelMessageErrors, d4 as getShadowServerAppTaskCardId, d9 as readShadowServerAppCommandResponse, de as shadowServerAppInboxTaskEndpoint } from './server-app-B5LcrBUV.cjs'; | ||
| import { cv as ShadowServerAppInboxDelivery, cw as ShadowServerAppInboxDeliveryError, c3 as ShadowServerAppChannelMessageDelivery, c4 as ShadowServerAppChannelMessageDeliveryError, X as ShadowBuddyInboxSummary } from './server-app-BfTqb2YO.cjs'; | ||
| export { bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, c5 as ShadowServerAppChannelMessageOutbox, cb as ShadowServerAppCommandEventType, cs as ShadowServerAppHostAppRef, ct as ShadowServerAppHostInboxTaskRequestInput, cx as ShadowServerAppInboxDeliveryFromMessageInput, cy as ShadowServerAppInboxTarget, cz as ShadowServerAppInboxTaskOutbox, cK as ShadowServerAppResolvedInboxTaskRequest, cL as ShadowServerAppResultShadow, cW as buildShadowServerAppInboxDelivery, cX as buildShadowServerAppInboxTaskRequest, d3 as getShadowServerAppChannelMessageDeliveries, d4 as getShadowServerAppChannelMessageErrors, d5 as getShadowServerAppTaskCardId, da as readShadowServerAppCommandResponse, df as shadowServerAppInboxTaskEndpoint } from './server-app-BfTqb2YO.cjs'; | ||
| import '@shadowob/shared'; | ||
@@ -16,2 +16,4 @@ | ||
| title?: string; | ||
| mimeType?: string; | ||
| sizeBytes?: number; | ||
| }; | ||
@@ -34,3 +36,10 @@ } | ||
| } | ||
| declare const SHADOW_BRIDGE_CAPABILITIES: readonly ["copilot.open", "workspace.open", "buddy.create.open", "buddy.inboxes.list", "buddy.grant.ensure", "route.navigate"]; | ||
| interface ShadowBridgeAuthorizeOAuthInput { | ||
| authorizeUrl: string; | ||
| } | ||
| interface ShadowBridgeAuthorizeOAuthResult { | ||
| opened: boolean; | ||
| redirectUrl?: string; | ||
| } | ||
| declare const SHADOW_BRIDGE_CAPABILITIES: readonly ["copilot.open", "workspace.open", "buddy.create.open", "buddy.inboxes.list", "buddy.grant.ensure", "oauth.authorize", "route.navigate"]; | ||
| type ShadowBridgeCapability = (typeof SHADOW_BRIDGE_CAPABILITIES)[number]; | ||
@@ -55,2 +64,6 @@ interface ShadowBridgeOptions { | ||
| } | ||
| type ShadowServerAppRuntimeClientOptions = Omit<ShadowServerAppBrowserClientOptions, 'commandBasePath' | 'deliverLaunchOutboxFromBrowser' | 'inboxesPath'> & { | ||
| commandBasePath?: string; | ||
| inboxesPath?: string; | ||
| }; | ||
| interface ShadowServerAppEnsureBuddyTaskGrantInput { | ||
@@ -110,2 +123,7 @@ agentId?: string | null; | ||
| }>; | ||
| authorizeOAuth(input: ShadowBridgeAuthorizeOAuthInput | string, options?: { | ||
| timeoutMs?: number; | ||
| }): Promise<{ | ||
| opened: boolean; | ||
| }>; | ||
| inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
@@ -120,2 +138,3 @@ inboxErrors(payload: unknown): ShadowServerAppInboxDeliveryError[]; | ||
| declare const createShadowServerAppBrowserClient: typeof createShadowServerAppClient; | ||
| declare function createShadowServerAppRuntimeClient(options?: ShadowServerAppRuntimeClientOptions): ShadowServerAppBrowserClient; | ||
| declare class ShadowBridge { | ||
@@ -134,2 +153,4 @@ static readonly capabilitiesRequestType = "shadow.app.capabilities.request"; | ||
| static readonly ensureBuddyGrantResponseType = "shadow.app.buddy.grant.response"; | ||
| static readonly authorizeOAuthRequestType = "shadow.app.oauth.authorize.request"; | ||
| static readonly authorizeOAuthResponseType = "shadow.app.oauth.authorize.response"; | ||
| static inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
@@ -182,2 +203,5 @@ static inboxErrors(payload: unknown): ShadowServerAppInboxDeliveryError[]; | ||
| }>; | ||
| authorizeOAuth(input: ShadowBridgeAuthorizeOAuthInput | string, options?: { | ||
| timeoutMs?: number; | ||
| }): Promise<ShadowBridgeAuthorizeOAuthResult>; | ||
| unwrapCommandPayload<TResult = unknown>(payload: unknown): TResult; | ||
@@ -194,2 +218,2 @@ inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
| export { SHADOW_BRIDGE_CAPABILITIES, ShadowBridge, type ShadowBridgeCapability, type ShadowBridgeEnsureBuddyGrantInput, type ShadowBridgeListBuddyInboxesInput, type ShadowBridgeOpenBuddyCreatorInput, type ShadowBridgeOpenCopilotInput, type ShadowBridgeOpenWorkspaceResourceInput, type ShadowBridgeOptions, ShadowBuddyInboxSummary, ShadowServerAppBrowserClient, type ShadowServerAppBrowserClientOptions, ShadowServerAppChannelMessageDelivery, ShadowServerAppChannelMessageDeliveryError, type ShadowServerAppEnsureBuddyTaskGrantInput, ShadowServerAppInboxDelivery, ShadowServerAppInboxDeliveryError, type ShadowServerAppLaunchHeadersOptions, type ShadowServerAppListBuddyInboxesOptions, createShadowServerAppBrowserClient, createShadowServerAppClient, shadowServerAppMountedPath, shadowServerAppMountedPathPrefix }; | ||
| export { SHADOW_BRIDGE_CAPABILITIES, ShadowBridge, type ShadowBridgeAuthorizeOAuthInput, type ShadowBridgeAuthorizeOAuthResult, type ShadowBridgeCapability, type ShadowBridgeEnsureBuddyGrantInput, type ShadowBridgeListBuddyInboxesInput, type ShadowBridgeOpenBuddyCreatorInput, type ShadowBridgeOpenCopilotInput, type ShadowBridgeOpenWorkspaceResourceInput, type ShadowBridgeOptions, ShadowBuddyInboxSummary, ShadowServerAppBrowserClient, type ShadowServerAppBrowserClientOptions, ShadowServerAppChannelMessageDelivery, ShadowServerAppChannelMessageDeliveryError, type ShadowServerAppEnsureBuddyTaskGrantInput, ShadowServerAppInboxDelivery, ShadowServerAppInboxDeliveryError, type ShadowServerAppLaunchHeadersOptions, type ShadowServerAppListBuddyInboxesOptions, type ShadowServerAppRuntimeClientOptions, createShadowServerAppBrowserClient, createShadowServerAppClient, createShadowServerAppRuntimeClient, shadowServerAppMountedPath, shadowServerAppMountedPathPrefix }; |
+28
-4
@@ -1,3 +0,3 @@ | ||
| import { cu as ShadowServerAppInboxDelivery, cv as ShadowServerAppInboxDeliveryError, c2 as ShadowServerAppChannelMessageDelivery, c3 as ShadowServerAppChannelMessageDeliveryError, X as ShadowBuddyInboxSummary } from './server-app-B5LcrBUV.js'; | ||
| export { bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, c4 as ShadowServerAppChannelMessageOutbox, ca as ShadowServerAppCommandEventType, cr as ShadowServerAppHostAppRef, cs as ShadowServerAppHostInboxTaskRequestInput, cw as ShadowServerAppInboxDeliveryFromMessageInput, cx as ShadowServerAppInboxTarget, cy as ShadowServerAppInboxTaskOutbox, cJ as ShadowServerAppResolvedInboxTaskRequest, cK as ShadowServerAppResultShadow, cV as buildShadowServerAppInboxDelivery, cW as buildShadowServerAppInboxTaskRequest, d2 as getShadowServerAppChannelMessageDeliveries, d3 as getShadowServerAppChannelMessageErrors, d4 as getShadowServerAppTaskCardId, d9 as readShadowServerAppCommandResponse, de as shadowServerAppInboxTaskEndpoint } from './server-app-B5LcrBUV.js'; | ||
| import { cv as ShadowServerAppInboxDelivery, cw as ShadowServerAppInboxDeliveryError, c3 as ShadowServerAppChannelMessageDelivery, c4 as ShadowServerAppChannelMessageDeliveryError, X as ShadowBuddyInboxSummary } from './server-app-BfTqb2YO.js'; | ||
| export { bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, c5 as ShadowServerAppChannelMessageOutbox, cb as ShadowServerAppCommandEventType, cs as ShadowServerAppHostAppRef, ct as ShadowServerAppHostInboxTaskRequestInput, cx as ShadowServerAppInboxDeliveryFromMessageInput, cy as ShadowServerAppInboxTarget, cz as ShadowServerAppInboxTaskOutbox, cK as ShadowServerAppResolvedInboxTaskRequest, cL as ShadowServerAppResultShadow, cW as buildShadowServerAppInboxDelivery, cX as buildShadowServerAppInboxTaskRequest, d3 as getShadowServerAppChannelMessageDeliveries, d4 as getShadowServerAppChannelMessageErrors, d5 as getShadowServerAppTaskCardId, da as readShadowServerAppCommandResponse, df as shadowServerAppInboxTaskEndpoint } from './server-app-BfTqb2YO.js'; | ||
| import '@shadowob/shared'; | ||
@@ -16,2 +16,4 @@ | ||
| title?: string; | ||
| mimeType?: string; | ||
| sizeBytes?: number; | ||
| }; | ||
@@ -34,3 +36,10 @@ } | ||
| } | ||
| declare const SHADOW_BRIDGE_CAPABILITIES: readonly ["copilot.open", "workspace.open", "buddy.create.open", "buddy.inboxes.list", "buddy.grant.ensure", "route.navigate"]; | ||
| interface ShadowBridgeAuthorizeOAuthInput { | ||
| authorizeUrl: string; | ||
| } | ||
| interface ShadowBridgeAuthorizeOAuthResult { | ||
| opened: boolean; | ||
| redirectUrl?: string; | ||
| } | ||
| declare const SHADOW_BRIDGE_CAPABILITIES: readonly ["copilot.open", "workspace.open", "buddy.create.open", "buddy.inboxes.list", "buddy.grant.ensure", "oauth.authorize", "route.navigate"]; | ||
| type ShadowBridgeCapability = (typeof SHADOW_BRIDGE_CAPABILITIES)[number]; | ||
@@ -55,2 +64,6 @@ interface ShadowBridgeOptions { | ||
| } | ||
| type ShadowServerAppRuntimeClientOptions = Omit<ShadowServerAppBrowserClientOptions, 'commandBasePath' | 'deliverLaunchOutboxFromBrowser' | 'inboxesPath'> & { | ||
| commandBasePath?: string; | ||
| inboxesPath?: string; | ||
| }; | ||
| interface ShadowServerAppEnsureBuddyTaskGrantInput { | ||
@@ -110,2 +123,7 @@ agentId?: string | null; | ||
| }>; | ||
| authorizeOAuth(input: ShadowBridgeAuthorizeOAuthInput | string, options?: { | ||
| timeoutMs?: number; | ||
| }): Promise<{ | ||
| opened: boolean; | ||
| }>; | ||
| inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
@@ -120,2 +138,3 @@ inboxErrors(payload: unknown): ShadowServerAppInboxDeliveryError[]; | ||
| declare const createShadowServerAppBrowserClient: typeof createShadowServerAppClient; | ||
| declare function createShadowServerAppRuntimeClient(options?: ShadowServerAppRuntimeClientOptions): ShadowServerAppBrowserClient; | ||
| declare class ShadowBridge { | ||
@@ -134,2 +153,4 @@ static readonly capabilitiesRequestType = "shadow.app.capabilities.request"; | ||
| static readonly ensureBuddyGrantResponseType = "shadow.app.buddy.grant.response"; | ||
| static readonly authorizeOAuthRequestType = "shadow.app.oauth.authorize.request"; | ||
| static readonly authorizeOAuthResponseType = "shadow.app.oauth.authorize.response"; | ||
| static inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
@@ -182,2 +203,5 @@ static inboxErrors(payload: unknown): ShadowServerAppInboxDeliveryError[]; | ||
| }>; | ||
| authorizeOAuth(input: ShadowBridgeAuthorizeOAuthInput | string, options?: { | ||
| timeoutMs?: number; | ||
| }): Promise<ShadowBridgeAuthorizeOAuthResult>; | ||
| unwrapCommandPayload<TResult = unknown>(payload: unknown): TResult; | ||
@@ -194,2 +218,2 @@ inboxDeliveries(payload: unknown): ShadowServerAppInboxDelivery[]; | ||
| export { SHADOW_BRIDGE_CAPABILITIES, ShadowBridge, type ShadowBridgeCapability, type ShadowBridgeEnsureBuddyGrantInput, type ShadowBridgeListBuddyInboxesInput, type ShadowBridgeOpenBuddyCreatorInput, type ShadowBridgeOpenCopilotInput, type ShadowBridgeOpenWorkspaceResourceInput, type ShadowBridgeOptions, ShadowBuddyInboxSummary, ShadowServerAppBrowserClient, type ShadowServerAppBrowserClientOptions, ShadowServerAppChannelMessageDelivery, ShadowServerAppChannelMessageDeliveryError, type ShadowServerAppEnsureBuddyTaskGrantInput, ShadowServerAppInboxDelivery, ShadowServerAppInboxDeliveryError, type ShadowServerAppLaunchHeadersOptions, type ShadowServerAppListBuddyInboxesOptions, createShadowServerAppBrowserClient, createShadowServerAppClient, shadowServerAppMountedPath, shadowServerAppMountedPathPrefix }; | ||
| export { SHADOW_BRIDGE_CAPABILITIES, ShadowBridge, type ShadowBridgeAuthorizeOAuthInput, type ShadowBridgeAuthorizeOAuthResult, type ShadowBridgeCapability, type ShadowBridgeEnsureBuddyGrantInput, type ShadowBridgeListBuddyInboxesInput, type ShadowBridgeOpenBuddyCreatorInput, type ShadowBridgeOpenCopilotInput, type ShadowBridgeOpenWorkspaceResourceInput, type ShadowBridgeOptions, ShadowBuddyInboxSummary, ShadowServerAppBrowserClient, type ShadowServerAppBrowserClientOptions, ShadowServerAppChannelMessageDelivery, ShadowServerAppChannelMessageDeliveryError, type ShadowServerAppEnsureBuddyTaskGrantInput, ShadowServerAppInboxDelivery, ShadowServerAppInboxDeliveryError, type ShadowServerAppLaunchHeadersOptions, type ShadowServerAppListBuddyInboxesOptions, type ShadowServerAppRuntimeClientOptions, createShadowServerAppBrowserClient, createShadowServerAppClient, createShadowServerAppRuntimeClient, shadowServerAppMountedPath, shadowServerAppMountedPathPrefix }; |
+3
-1
@@ -7,5 +7,6 @@ import { | ||
| createShadowServerAppClient, | ||
| createShadowServerAppRuntimeClient, | ||
| shadowServerAppMountedPath, | ||
| shadowServerAppMountedPathPrefix | ||
| } from "./chunk-LJ5KRY3A.js"; | ||
| } from "./chunk-L5PHQEDC.js"; | ||
| import { | ||
@@ -34,2 +35,3 @@ SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, | ||
| createShadowServerAppClient, | ||
| createShadowServerAppRuntimeClient, | ||
| getShadowServerAppChannelMessageDeliveries, | ||
@@ -36,0 +38,0 @@ getShadowServerAppChannelMessageErrors, |
@@ -1,2 +0,2 @@ | ||
| export { bh as JsonSchemaToType, bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, bs as SHADOW_SERVER_APP_PROTOCOL, bW as ShadowServerAppActorRef, bX as ShadowServerAppBridgeCapabilitiesRequest, bY as ShadowServerAppBridgeFailureResponse, bZ as ShadowServerAppBridgeOpenCopilotRequest, dg as ShadowServerAppBridgeOpenWorkspaceResourceRequest, b_ as ShadowServerAppBridgeRequest, b$ as ShadowServerAppBridgeResponse, c0 as ShadowServerAppBridgeResponseType, c1 as ShadowServerAppBridgeSuccessResponse, c2 as ShadowServerAppChannelMessageDelivery, c3 as ShadowServerAppChannelMessageDeliveryError, c4 as ShadowServerAppChannelMessageOutbox, c7 as ShadowServerAppCommandContext, c8 as ShadowServerAppCommandEnvelope, c9 as ShadowServerAppCommandError, ca as ShadowServerAppCommandEventType, cb as ShadowServerAppCommandFailureResponse, cc as ShadowServerAppCommandHandler, cd as ShadowServerAppCommandHandlerContext, ce as ShadowServerAppCommandHandlers, cf as ShadowServerAppCommandInput, cg as ShadowServerAppCommandName, ch as ShadowServerAppCommandParseError, ci as ShadowServerAppCommandParseResult, cj as ShadowServerAppCommandParseSuccess, ck as ShadowServerAppCommandRequestInput, cl as ShadowServerAppCommandResponse, dh as ShadowServerAppCommandRuntimeRequest, cm as ShadowServerAppCommandSuccessResponse, cn as ShadowServerAppExecutionFailure, co as ShadowServerAppExecutionResult, cp as ShadowServerAppExecutionSuccess, cq as ShadowServerAppFetch, cr as ShadowServerAppHostAppRef, cs as ShadowServerAppHostInboxTaskRequestInput, ct as ShadowServerAppHttpError, cu as ShadowServerAppInboxDelivery, cv as ShadowServerAppInboxDeliveryError, cw as ShadowServerAppInboxDeliveryFromMessageInput, cx as ShadowServerAppInboxTarget, cy as ShadowServerAppInboxTaskOutbox, cz as ShadowServerAppInboxTaskPriority, cA as ShadowServerAppInboxTaskResource, cB as ShadowServerAppIntrospectionInput, cC as ShadowServerAppLaunchFetchOptions, cD as ShadowServerAppLaunchOutboxDeliveryOptions, cE as ShadowServerAppLaunchTokenHint, cF as ShadowServerAppManifestOptions, cG as ShadowServerAppOutbox, cH as ShadowServerAppOutboxPayload, cJ as ShadowServerAppResolvedInboxTaskRequest, cK as ShadowServerAppResultShadow, cL as ShadowServerAppResultWithShadow, cM as ShadowServerAppRuntime, cN as ShadowServerAppRuntimeOptions, cO as ShadowServerAppValidationIssue, cV as buildShadowServerAppInboxDelivery, cW as buildShadowServerAppInboxTaskRequest, cX as createShadowServerAppManifest, cY as createShadowServerAppRuntime, cZ as decodeShadowServerAppLaunchTokenHint, c_ as defineShadowServerApp, c$ as deliverShadowServerAppLaunchOutbox, d0 as extractShadowServerAppBearerToken, d1 as fetchShadowServerAppLaunchInboxes, d2 as getShadowServerAppChannelMessageDeliveries, d3 as getShadowServerAppChannelMessageErrors, di as getShadowServerAppInboxDeliveries, dj as getShadowServerAppInboxErrors, dk as getShadowServerAppPendingChannelMessages, dl as getShadowServerAppPendingInboxTasks, d4 as getShadowServerAppTaskCardId, d5 as hasShadowServerAppPendingOutbox, d6 as introspectShadowServerAppToken, d7 as normalizeShadowServerAppCommandInput, d8 as parseShadowServerAppCommandRequest, d9 as readShadowServerAppCommandResponse, da as shadowServerAppActorAvatarUrl, db as shadowServerAppActorDisplayName, dc as shadowServerAppActorRef, dd as shadowServerAppError, de as shadowServerAppInboxTaskEndpoint, dm as unwrapShadowServerAppCommandPayload, df as validateShadowServerAppJsonSchema } from './server-app-B5LcrBUV.cjs'; | ||
| export { bh as JsonSchemaToType, bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, bs as SHADOW_SERVER_APP_PROTOCOL, bW as ShadowServerAppActorRef, bX as ShadowServerAppBridgeAuthorizeOAuthRequest, bY as ShadowServerAppBridgeCapabilitiesRequest, bZ as ShadowServerAppBridgeFailureResponse, b_ as ShadowServerAppBridgeOpenCopilotRequest, dh as ShadowServerAppBridgeOpenWorkspaceResourceRequest, b$ as ShadowServerAppBridgeRequest, c0 as ShadowServerAppBridgeResponse, c1 as ShadowServerAppBridgeResponseType, c2 as ShadowServerAppBridgeSuccessResponse, c3 as ShadowServerAppChannelMessageDelivery, c4 as ShadowServerAppChannelMessageDeliveryError, c5 as ShadowServerAppChannelMessageOutbox, c8 as ShadowServerAppCommandContext, c9 as ShadowServerAppCommandEnvelope, ca as ShadowServerAppCommandError, cb as ShadowServerAppCommandEventType, cc as ShadowServerAppCommandFailureResponse, cd as ShadowServerAppCommandHandler, ce as ShadowServerAppCommandHandlerContext, cf as ShadowServerAppCommandHandlers, cg as ShadowServerAppCommandInput, ch as ShadowServerAppCommandName, ci as ShadowServerAppCommandParseError, cj as ShadowServerAppCommandParseResult, ck as ShadowServerAppCommandParseSuccess, cl as ShadowServerAppCommandRequestInput, cm as ShadowServerAppCommandResponse, di as ShadowServerAppCommandRuntimeRequest, cn as ShadowServerAppCommandSuccessResponse, co as ShadowServerAppExecutionFailure, cp as ShadowServerAppExecutionResult, cq as ShadowServerAppExecutionSuccess, cr as ShadowServerAppFetch, cs as ShadowServerAppHostAppRef, ct as ShadowServerAppHostInboxTaskRequestInput, cu as ShadowServerAppHttpError, cv as ShadowServerAppInboxDelivery, cw as ShadowServerAppInboxDeliveryError, cx as ShadowServerAppInboxDeliveryFromMessageInput, cy as ShadowServerAppInboxTarget, cz as ShadowServerAppInboxTaskOutbox, cA as ShadowServerAppInboxTaskPriority, cB as ShadowServerAppInboxTaskResource, cC as ShadowServerAppIntrospectionInput, cD as ShadowServerAppLaunchFetchOptions, cE as ShadowServerAppLaunchOutboxDeliveryOptions, cF as ShadowServerAppLaunchTokenHint, cG as ShadowServerAppManifestOptions, cH as ShadowServerAppOutbox, cI as ShadowServerAppOutboxPayload, cK as ShadowServerAppResolvedInboxTaskRequest, cL as ShadowServerAppResultShadow, cM as ShadowServerAppResultWithShadow, cN as ShadowServerAppRuntime, cO as ShadowServerAppRuntimeOptions, cP as ShadowServerAppValidationIssue, cW as buildShadowServerAppInboxDelivery, cX as buildShadowServerAppInboxTaskRequest, cY as createShadowServerAppManifest, cZ as createShadowServerAppRuntime, c_ as decodeShadowServerAppLaunchTokenHint, c$ as defineShadowServerApp, d0 as deliverShadowServerAppLaunchOutbox, d1 as extractShadowServerAppBearerToken, d2 as fetchShadowServerAppLaunchInboxes, d3 as getShadowServerAppChannelMessageDeliveries, d4 as getShadowServerAppChannelMessageErrors, dj as getShadowServerAppInboxDeliveries, dk as getShadowServerAppInboxErrors, dl as getShadowServerAppPendingChannelMessages, dm as getShadowServerAppPendingInboxTasks, d5 as getShadowServerAppTaskCardId, d6 as hasShadowServerAppPendingOutbox, d7 as introspectShadowServerAppToken, d8 as normalizeShadowServerAppCommandInput, d9 as parseShadowServerAppCommandRequest, da as readShadowServerAppCommandResponse, db as shadowServerAppActorAvatarUrl, dc as shadowServerAppActorDisplayName, dd as shadowServerAppActorRef, de as shadowServerAppError, df as shadowServerAppInboxTaskEndpoint, dn as unwrapShadowServerAppCommandPayload, dg as validateShadowServerAppJsonSchema } from './server-app-BfTqb2YO.cjs'; | ||
| export { BUDDY_INBOX_DELIVERY_PERMISSION, BuddyInboxPlatformPermission } from '@shadowob/shared'; |
@@ -1,2 +0,2 @@ | ||
| export { bh as JsonSchemaToType, bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, bs as SHADOW_SERVER_APP_PROTOCOL, bW as ShadowServerAppActorRef, bX as ShadowServerAppBridgeCapabilitiesRequest, bY as ShadowServerAppBridgeFailureResponse, bZ as ShadowServerAppBridgeOpenCopilotRequest, dg as ShadowServerAppBridgeOpenWorkspaceResourceRequest, b_ as ShadowServerAppBridgeRequest, b$ as ShadowServerAppBridgeResponse, c0 as ShadowServerAppBridgeResponseType, c1 as ShadowServerAppBridgeSuccessResponse, c2 as ShadowServerAppChannelMessageDelivery, c3 as ShadowServerAppChannelMessageDeliveryError, c4 as ShadowServerAppChannelMessageOutbox, c7 as ShadowServerAppCommandContext, c8 as ShadowServerAppCommandEnvelope, c9 as ShadowServerAppCommandError, ca as ShadowServerAppCommandEventType, cb as ShadowServerAppCommandFailureResponse, cc as ShadowServerAppCommandHandler, cd as ShadowServerAppCommandHandlerContext, ce as ShadowServerAppCommandHandlers, cf as ShadowServerAppCommandInput, cg as ShadowServerAppCommandName, ch as ShadowServerAppCommandParseError, ci as ShadowServerAppCommandParseResult, cj as ShadowServerAppCommandParseSuccess, ck as ShadowServerAppCommandRequestInput, cl as ShadowServerAppCommandResponse, dh as ShadowServerAppCommandRuntimeRequest, cm as ShadowServerAppCommandSuccessResponse, cn as ShadowServerAppExecutionFailure, co as ShadowServerAppExecutionResult, cp as ShadowServerAppExecutionSuccess, cq as ShadowServerAppFetch, cr as ShadowServerAppHostAppRef, cs as ShadowServerAppHostInboxTaskRequestInput, ct as ShadowServerAppHttpError, cu as ShadowServerAppInboxDelivery, cv as ShadowServerAppInboxDeliveryError, cw as ShadowServerAppInboxDeliveryFromMessageInput, cx as ShadowServerAppInboxTarget, cy as ShadowServerAppInboxTaskOutbox, cz as ShadowServerAppInboxTaskPriority, cA as ShadowServerAppInboxTaskResource, cB as ShadowServerAppIntrospectionInput, cC as ShadowServerAppLaunchFetchOptions, cD as ShadowServerAppLaunchOutboxDeliveryOptions, cE as ShadowServerAppLaunchTokenHint, cF as ShadowServerAppManifestOptions, cG as ShadowServerAppOutbox, cH as ShadowServerAppOutboxPayload, cJ as ShadowServerAppResolvedInboxTaskRequest, cK as ShadowServerAppResultShadow, cL as ShadowServerAppResultWithShadow, cM as ShadowServerAppRuntime, cN as ShadowServerAppRuntimeOptions, cO as ShadowServerAppValidationIssue, cV as buildShadowServerAppInboxDelivery, cW as buildShadowServerAppInboxTaskRequest, cX as createShadowServerAppManifest, cY as createShadowServerAppRuntime, cZ as decodeShadowServerAppLaunchTokenHint, c_ as defineShadowServerApp, c$ as deliverShadowServerAppLaunchOutbox, d0 as extractShadowServerAppBearerToken, d1 as fetchShadowServerAppLaunchInboxes, d2 as getShadowServerAppChannelMessageDeliveries, d3 as getShadowServerAppChannelMessageErrors, di as getShadowServerAppInboxDeliveries, dj as getShadowServerAppInboxErrors, dk as getShadowServerAppPendingChannelMessages, dl as getShadowServerAppPendingInboxTasks, d4 as getShadowServerAppTaskCardId, d5 as hasShadowServerAppPendingOutbox, d6 as introspectShadowServerAppToken, d7 as normalizeShadowServerAppCommandInput, d8 as parseShadowServerAppCommandRequest, d9 as readShadowServerAppCommandResponse, da as shadowServerAppActorAvatarUrl, db as shadowServerAppActorDisplayName, dc as shadowServerAppActorRef, dd as shadowServerAppError, de as shadowServerAppInboxTaskEndpoint, dm as unwrapShadowServerAppCommandPayload, df as validateShadowServerAppJsonSchema } from './server-app-B5LcrBUV.js'; | ||
| export { bh as JsonSchemaToType, bp as SHADOW_SERVER_APP_COMMAND_COMPLETED_EVENT, bq as SHADOW_SERVER_APP_COMMAND_EVENTS, br as SHADOW_SERVER_APP_COMMAND_FAILED_EVENT, bs as SHADOW_SERVER_APP_PROTOCOL, bW as ShadowServerAppActorRef, bX as ShadowServerAppBridgeAuthorizeOAuthRequest, bY as ShadowServerAppBridgeCapabilitiesRequest, bZ as ShadowServerAppBridgeFailureResponse, b_ as ShadowServerAppBridgeOpenCopilotRequest, dh as ShadowServerAppBridgeOpenWorkspaceResourceRequest, b$ as ShadowServerAppBridgeRequest, c0 as ShadowServerAppBridgeResponse, c1 as ShadowServerAppBridgeResponseType, c2 as ShadowServerAppBridgeSuccessResponse, c3 as ShadowServerAppChannelMessageDelivery, c4 as ShadowServerAppChannelMessageDeliveryError, c5 as ShadowServerAppChannelMessageOutbox, c8 as ShadowServerAppCommandContext, c9 as ShadowServerAppCommandEnvelope, ca as ShadowServerAppCommandError, cb as ShadowServerAppCommandEventType, cc as ShadowServerAppCommandFailureResponse, cd as ShadowServerAppCommandHandler, ce as ShadowServerAppCommandHandlerContext, cf as ShadowServerAppCommandHandlers, cg as ShadowServerAppCommandInput, ch as ShadowServerAppCommandName, ci as ShadowServerAppCommandParseError, cj as ShadowServerAppCommandParseResult, ck as ShadowServerAppCommandParseSuccess, cl as ShadowServerAppCommandRequestInput, cm as ShadowServerAppCommandResponse, di as ShadowServerAppCommandRuntimeRequest, cn as ShadowServerAppCommandSuccessResponse, co as ShadowServerAppExecutionFailure, cp as ShadowServerAppExecutionResult, cq as ShadowServerAppExecutionSuccess, cr as ShadowServerAppFetch, cs as ShadowServerAppHostAppRef, ct as ShadowServerAppHostInboxTaskRequestInput, cu as ShadowServerAppHttpError, cv as ShadowServerAppInboxDelivery, cw as ShadowServerAppInboxDeliveryError, cx as ShadowServerAppInboxDeliveryFromMessageInput, cy as ShadowServerAppInboxTarget, cz as ShadowServerAppInboxTaskOutbox, cA as ShadowServerAppInboxTaskPriority, cB as ShadowServerAppInboxTaskResource, cC as ShadowServerAppIntrospectionInput, cD as ShadowServerAppLaunchFetchOptions, cE as ShadowServerAppLaunchOutboxDeliveryOptions, cF as ShadowServerAppLaunchTokenHint, cG as ShadowServerAppManifestOptions, cH as ShadowServerAppOutbox, cI as ShadowServerAppOutboxPayload, cK as ShadowServerAppResolvedInboxTaskRequest, cL as ShadowServerAppResultShadow, cM as ShadowServerAppResultWithShadow, cN as ShadowServerAppRuntime, cO as ShadowServerAppRuntimeOptions, cP as ShadowServerAppValidationIssue, cW as buildShadowServerAppInboxDelivery, cX as buildShadowServerAppInboxTaskRequest, cY as createShadowServerAppManifest, cZ as createShadowServerAppRuntime, c_ as decodeShadowServerAppLaunchTokenHint, c$ as defineShadowServerApp, d0 as deliverShadowServerAppLaunchOutbox, d1 as extractShadowServerAppBearerToken, d2 as fetchShadowServerAppLaunchInboxes, d3 as getShadowServerAppChannelMessageDeliveries, d4 as getShadowServerAppChannelMessageErrors, dj as getShadowServerAppInboxDeliveries, dk as getShadowServerAppInboxErrors, dl as getShadowServerAppPendingChannelMessages, dm as getShadowServerAppPendingInboxTasks, d5 as getShadowServerAppTaskCardId, d6 as hasShadowServerAppPendingOutbox, d7 as introspectShadowServerAppToken, d8 as normalizeShadowServerAppCommandInput, d9 as parseShadowServerAppCommandRequest, da as readShadowServerAppCommandResponse, db as shadowServerAppActorAvatarUrl, dc as shadowServerAppActorDisplayName, dd as shadowServerAppActorRef, de as shadowServerAppError, df as shadowServerAppInboxTaskEndpoint, dn as unwrapShadowServerAppCommandPayload, dg as validateShadowServerAppJsonSchema } from './server-app-BfTqb2YO.js'; | ||
| export { BUDDY_INBOX_DELIVERY_PERMISSION, BuddyInboxPlatformPermission } from '@shadowob/shared'; |
+2
-2
| { | ||
| "name": "@shadowob/sdk", | ||
| "version": "1.1.49", | ||
| "version": "1.1.50", | ||
| "description": "Shadow SDK — typed REST client and real-time Socket.IO event listener for Shadow servers", | ||
@@ -51,3 +51,3 @@ "license": "MIT", | ||
| "socket.io-client": "^4.8.1", | ||
| "@shadowob/shared": "1.1.49" | ||
| "@shadowob/shared": "1.1.50" | ||
| }, | ||
@@ -54,0 +54,0 @@ "peerDependencies": { |
| import { | ||
| BUDDY_INBOX_DELIVERY_PERMISSION, | ||
| decodeShadowServerAppLaunchTokenHint, | ||
| deliverShadowServerAppLaunchOutbox, | ||
| getShadowServerAppChannelMessageDeliveries, | ||
| getShadowServerAppChannelMessageErrors, | ||
| getShadowServerAppInboxDeliveries, | ||
| getShadowServerAppInboxErrors, | ||
| hasShadowServerAppPendingOutbox, | ||
| readShadowServerAppCommandResponse, | ||
| unwrapShadowServerAppCommandPayload | ||
| } from "./chunk-5ODYWMBC.js"; | ||
| // src/bridge.ts | ||
| var SHADOW_BRIDGE_CAPABILITIES = [ | ||
| "copilot.open", | ||
| "workspace.open", | ||
| "buddy.create.open", | ||
| "buddy.inboxes.list", | ||
| "buddy.grant.ensure", | ||
| "route.navigate" | ||
| ]; | ||
| function commandPath(basePath, commandName) { | ||
| return `${basePath.replace(/\/+$/u, "")}/${encodeURIComponent(commandName)}`; | ||
| } | ||
| function shadowServerAppMountedPathPrefix(windowRef) { | ||
| const win = windowRef ?? (typeof window === "undefined" ? null : window); | ||
| const pathname = win?.location?.pathname ?? ""; | ||
| const segments = pathname.split("/").filter(Boolean); | ||
| const shadowIndex = segments.indexOf("shadow"); | ||
| if (shadowIndex <= 0 || segments[shadowIndex + 1] !== "server") return ""; | ||
| return `/${segments.slice(0, shadowIndex).join("/")}`; | ||
| } | ||
| function shadowServerAppMountedPath(path, windowRef) { | ||
| const normalized = path.startsWith("/") ? path : `/${path}`; | ||
| return `${shadowServerAppMountedPathPrefix(windowRef)}${normalized}`; | ||
| } | ||
| function isRecord(value) { | ||
| return !!value && typeof value === "object" && !Array.isArray(value); | ||
| } | ||
| function withoutUndefined(value) { | ||
| if (value === void 0) return {}; | ||
| if (Array.isArray(value)) return value.map(withoutUndefined); | ||
| if (!isRecord(value)) return value; | ||
| return Object.fromEntries( | ||
| Object.entries(value).filter(([, entry]) => entry !== void 0).map(([key, entry]) => [key, withoutUndefined(entry)]) | ||
| ); | ||
| } | ||
| var ShadowServerAppBrowserClient = class { | ||
| bridge; | ||
| commandBasePath; | ||
| inboxesPath; | ||
| shadowApiBaseUrl; | ||
| fetchFn; | ||
| deliverLaunchOutboxFromBrowser; | ||
| win; | ||
| constructor(options = {}) { | ||
| this.bridge = new ShadowBridge(options); | ||
| const windowRef = options.windowRef ?? (typeof window === "undefined" ? null : window); | ||
| this.commandBasePath = options.commandBasePath ?? shadowServerAppMountedPath("/api/local/commands", windowRef); | ||
| this.inboxesPath = options.inboxesPath ?? shadowServerAppMountedPath("/api/local/inboxes", windowRef); | ||
| this.shadowApiBaseUrl = options.shadowApiBaseUrl; | ||
| this.fetchFn = options.fetch; | ||
| this.deliverLaunchOutboxFromBrowser = options.deliverLaunchOutboxFromBrowser ?? false; | ||
| this.win = windowRef; | ||
| } | ||
| bridgeAvailable() { | ||
| return this.bridge.isAvailable(); | ||
| } | ||
| launchToken(param = "shadow_launch") { | ||
| if (!this.win) return null; | ||
| return new URLSearchParams(this.win.location.search).get(param); | ||
| } | ||
| launchHeaders(headers = {}, options = {}) { | ||
| const token = this.launchToken(options.launchTokenParam); | ||
| return token ? { ...headers, "X-Shadow-Launch-Token": token } : headers; | ||
| } | ||
| async command(commandName, input = {}) { | ||
| const response = await this.fetch(commandPath(this.commandBasePath, commandName), { | ||
| method: "POST", | ||
| headers: this.launchHeaders({ "Content-Type": "application/json" }), | ||
| body: JSON.stringify({ input: withoutUndefined(input) }) | ||
| }); | ||
| const result = await readShadowServerAppCommandResponse(response); | ||
| return this.deliverLaunchOutbox(commandName, result); | ||
| } | ||
| async listBuddyInboxes(options = {}) { | ||
| if (this.bridge.isAvailable()) { | ||
| try { | ||
| return await this.bridge.listBuddyInboxes({ refresh: options.refresh }); | ||
| } catch { | ||
| } | ||
| } | ||
| const response = await this.fetch(this.inboxesPath, { headers: this.launchHeaders() }); | ||
| if (!response.ok) { | ||
| if (options.emptyOnError) return { inboxes: [] }; | ||
| const message = await response.text().catch(() => ""); | ||
| throw new Error(message || `Buddy inbox lookup failed (${response.status})`); | ||
| } | ||
| return await response.json(); | ||
| } | ||
| async ensureBuddyTaskGrant(input) { | ||
| const buddyAgentId = input.agentId?.trim(); | ||
| if (!buddyAgentId || !this.bridge.isAvailable()) return { granted: false, skipped: true }; | ||
| return this.bridge.ensureBuddyGrant( | ||
| { | ||
| buddyAgentId, | ||
| permissions: input.permissions ?? [BUDDY_INBOX_DELIVERY_PERMISSION], | ||
| reason: input.reason | ||
| }, | ||
| { timeoutMs: input.timeoutMs ?? 6e4 } | ||
| ); | ||
| } | ||
| openBuddyCreator(input = {}, options = {}) { | ||
| if (!this.bridge.isAvailable()) return Promise.resolve({ opened: false, agent: null }); | ||
| return this.bridge.openBuddyCreator(input, options); | ||
| } | ||
| openCopilot(delivery, options = {}) { | ||
| return this.bridge.openCopilot(delivery, options); | ||
| } | ||
| openWorkspaceResource(input, options = {}) { | ||
| return this.bridge.openWorkspaceResource(input, options); | ||
| } | ||
| inboxDeliveries(payload) { | ||
| return this.bridge.inboxDeliveries(payload); | ||
| } | ||
| inboxErrors(payload) { | ||
| return this.bridge.inboxErrors(payload); | ||
| } | ||
| channelMessageDeliveries(payload) { | ||
| return this.bridge.channelMessageDeliveries(payload); | ||
| } | ||
| channelMessageErrors(payload) { | ||
| return this.bridge.channelMessageErrors(payload); | ||
| } | ||
| async deliverLaunchOutbox(commandName, result) { | ||
| if (!this.deliverLaunchOutboxFromBrowser || !hasShadowServerAppPendingOutbox(result)) { | ||
| return result; | ||
| } | ||
| const launchToken = this.launchToken(); | ||
| if (!decodeShadowServerAppLaunchTokenHint(launchToken)) return result; | ||
| return await deliverShadowServerAppLaunchOutbox({ | ||
| commandName, | ||
| result, | ||
| launchToken, | ||
| shadowApiBaseUrl: this.shadowApiBaseUrl, | ||
| fetch: this.fetch.bind(this) | ||
| }); | ||
| } | ||
| fetch(input, init) { | ||
| if (this.fetchFn) return this.fetchFn(input, init); | ||
| return globalThis.fetch(input, init); | ||
| } | ||
| }; | ||
| function createShadowServerAppClient(options = {}) { | ||
| return new ShadowServerAppBrowserClient(options); | ||
| } | ||
| var createShadowServerAppBrowserClient = createShadowServerAppClient; | ||
| var ShadowBridge = class _ShadowBridge { | ||
| static capabilitiesRequestType = "shadow.app.capabilities.request"; | ||
| static capabilitiesResponseType = "shadow.app.capabilities.response"; | ||
| static openCopilotRequestType = "shadow.app.copilot.open.request"; | ||
| static openCopilotResponseType = "shadow.app.copilot.open.response"; | ||
| static openWorkspaceResourceRequestType = "shadow.app.workspace.open.request"; | ||
| static openWorkspaceResourceResponseType = "shadow.app.workspace.open.response"; | ||
| static openBuddyCreatorRequestType = "shadow.app.buddy.create.request"; | ||
| static openBuddyCreatorResponseType = "shadow.app.buddy.create.response"; | ||
| static listBuddyInboxesRequestType = "shadow.app.buddy.inboxes.request"; | ||
| static listBuddyInboxesResponseType = "shadow.app.buddy.inboxes.response"; | ||
| static ensureBuddyGrantRequestType = "shadow.app.buddy.grant.request"; | ||
| static ensureBuddyGrantResponseType = "shadow.app.buddy.grant.response"; | ||
| static inboxDeliveries(payload) { | ||
| return getShadowServerAppInboxDeliveries(payload); | ||
| } | ||
| static inboxErrors(payload) { | ||
| return getShadowServerAppInboxErrors(payload); | ||
| } | ||
| static channelMessageDeliveries(payload) { | ||
| return getShadowServerAppChannelMessageDeliveries(payload); | ||
| } | ||
| static channelMessageErrors(payload) { | ||
| return getShadowServerAppChannelMessageErrors(payload); | ||
| } | ||
| static unwrapCommandPayload(payload) { | ||
| return unwrapShadowServerAppCommandPayload(payload); | ||
| } | ||
| appKey; | ||
| targetOrigin; | ||
| timeoutMs; | ||
| win; | ||
| hasLaunchContext; | ||
| pending = /* @__PURE__ */ new Map(); | ||
| onMessage = (event) => { | ||
| let data = event.data; | ||
| if (typeof data === "string") { | ||
| try { | ||
| data = JSON.parse(data || "{}"); | ||
| } catch { | ||
| return; | ||
| } | ||
| } | ||
| if (!data || typeof data !== "object") return; | ||
| const record = data; | ||
| if (typeof record.requestId !== "string" || typeof record.type !== "string") return; | ||
| const entry = this.pending.get(record.requestId); | ||
| if (!entry || record.type !== entry.responseType) return; | ||
| this.pending.delete(record.requestId); | ||
| if (record.ok) entry.resolve(record.result); | ||
| else | ||
| entry.reject( | ||
| new Error(typeof record.error === "string" ? record.error : "Bridge request failed") | ||
| ); | ||
| }; | ||
| constructor(options = {}) { | ||
| this.win = options.windowRef ?? (typeof window === "undefined" ? null : window); | ||
| this.appKey = options.appKey ?? this.resolveLaunchAppKey(); | ||
| this.targetOrigin = options.targetOrigin ?? "*"; | ||
| this.timeoutMs = options.timeoutMs ?? 6e4; | ||
| this.hasLaunchContext = this.resolveLaunchContext(); | ||
| this.win?.addEventListener("message", this.onMessage); | ||
| } | ||
| dispose() { | ||
| this.win?.removeEventListener("message", this.onMessage); | ||
| for (const entry of this.pending.values()) { | ||
| entry.reject(new Error("ShadowBridge disposed")); | ||
| } | ||
| this.pending.clear(); | ||
| } | ||
| isAvailable() { | ||
| if (!this.win) return false; | ||
| return this.hasLaunchContext && (this.win.parent !== this.win || !!this.win.ReactNativeWebView); | ||
| } | ||
| capabilities(options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.capabilitiesRequestType, | ||
| _ShadowBridge.capabilitiesResponseType, | ||
| {}, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openCopilot(deliveryOrInput, options = {}) { | ||
| const input = "delivery" in deliveryOrInput ? deliveryOrInput : { delivery: deliveryOrInput }; | ||
| return this.request( | ||
| _ShadowBridge.openCopilotRequestType, | ||
| _ShadowBridge.openCopilotResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openWorkspaceResource(input, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.openWorkspaceResourceRequestType, | ||
| _ShadowBridge.openWorkspaceResourceResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| openBuddyCreator(input = {}, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.openBuddyCreatorRequestType, | ||
| _ShadowBridge.openBuddyCreatorResponseType, | ||
| input, | ||
| options.timeoutMs ?? 10 * 60 * 1e3 | ||
| ); | ||
| } | ||
| listBuddyInboxes(input = {}, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.listBuddyInboxesRequestType, | ||
| _ShadowBridge.listBuddyInboxesResponseType, | ||
| input, | ||
| options.timeoutMs ?? 15e3 | ||
| ); | ||
| } | ||
| ensureBuddyGrant(input, options = {}) { | ||
| return this.request( | ||
| _ShadowBridge.ensureBuddyGrantRequestType, | ||
| _ShadowBridge.ensureBuddyGrantResponseType, | ||
| input, | ||
| options.timeoutMs ?? 3e4 | ||
| ); | ||
| } | ||
| unwrapCommandPayload(payload) { | ||
| return unwrapShadowServerAppCommandPayload(payload); | ||
| } | ||
| inboxDeliveries(payload) { | ||
| return getShadowServerAppInboxDeliveries(payload); | ||
| } | ||
| inboxErrors(payload) { | ||
| return getShadowServerAppInboxErrors(payload); | ||
| } | ||
| channelMessageDeliveries(payload) { | ||
| return getShadowServerAppChannelMessageDeliveries(payload); | ||
| } | ||
| channelMessageErrors(payload) { | ||
| return getShadowServerAppChannelMessageErrors(payload); | ||
| } | ||
| request(requestType, responseType, payload, timeoutMs = this.timeoutMs) { | ||
| if (!this.isAvailable()) { | ||
| return Promise.reject( | ||
| new Error("ShadowBridge is not available outside a Shadow launch frame") | ||
| ); | ||
| } | ||
| const requestId = `req_${Math.random().toString(36).slice(2)}`; | ||
| return new Promise((resolve, reject) => { | ||
| this.pending.set(requestId, { | ||
| responseType, | ||
| resolve, | ||
| reject | ||
| }); | ||
| this.postMessage({ | ||
| type: requestType, | ||
| requestId, | ||
| ...this.appKey ? { appKey: this.appKey } : {}, | ||
| ...payload | ||
| }); | ||
| this.win?.setTimeout(() => { | ||
| if (!this.pending.has(requestId)) return; | ||
| this.pending.delete(requestId); | ||
| reject(new Error("Bridge request timed out")); | ||
| }, timeoutMs); | ||
| }); | ||
| } | ||
| postMessage(message) { | ||
| if (!this.win) return; | ||
| if (this.win.ReactNativeWebView) { | ||
| this.win.ReactNativeWebView.postMessage(JSON.stringify(message)); | ||
| return; | ||
| } | ||
| this.win.parent.postMessage(message, this.targetOrigin); | ||
| } | ||
| resolveLaunchContext() { | ||
| if (!this.win) return false; | ||
| const storageKey = this.appKey ? `shadow.bridge.launch:${this.appKey}` : null; | ||
| const memoryContexts = this.win.__shadowBridgeLaunchContexts ??= {}; | ||
| const hasLaunchToken = new URLSearchParams(this.win.location.search).has("shadow_launch"); | ||
| if (hasLaunchToken) { | ||
| if (this.appKey) memoryContexts[this.appKey] = true; | ||
| try { | ||
| if (storageKey) this.win.sessionStorage?.setItem(storageKey, "1"); | ||
| } catch { | ||
| } | ||
| return true; | ||
| } | ||
| if (this.appKey && memoryContexts[this.appKey]) return true; | ||
| try { | ||
| return storageKey ? this.win.sessionStorage?.getItem(storageKey) === "1" : false; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
| resolveLaunchAppKey() { | ||
| if (!this.win) return void 0; | ||
| const token = new URLSearchParams(this.win.location.search).get("shadow_launch"); | ||
| return decodeShadowServerAppLaunchTokenHint(token)?.appKey; | ||
| } | ||
| }; | ||
| export { | ||
| SHADOW_BRIDGE_CAPABILITIES, | ||
| shadowServerAppMountedPathPrefix, | ||
| shadowServerAppMountedPath, | ||
| ShadowServerAppBrowserClient, | ||
| createShadowServerAppClient, | ||
| createShadowServerAppBrowserClient, | ||
| ShadowBridge | ||
| }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
752336
1.34%14189
1.1%5
25%+ Added
- Removed
Updated