@executor-js/sdk 1.5.16 → 1.5.18
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/dist/{chunk-EIHWBY6T.js → chunk-4XPVLX62.js} +36 -1
- package/dist/chunk-4XPVLX62.js.map +1 -0
- package/dist/{chunk-SK3PCJHJ.js → chunk-EJKXSREX.js} +10 -1
- package/dist/chunk-EJKXSREX.js.map +1 -0
- package/dist/{chunk-6EED5LAL.js → chunk-PCSRC6WP.js} +1 -1
- package/dist/{chunk-6EED5LAL.js.map → chunk-PCSRC6WP.js.map} +1 -1
- package/dist/{chunk-VICUTMT6.js → chunk-UWBP7WLB.js} +192 -22
- package/dist/chunk-UWBP7WLB.js.map +1 -0
- package/dist/client.d.ts +13 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/core-schema.d.ts +2 -0
- package/dist/core-schema.d.ts.map +1 -1
- package/dist/core-tools.d.ts +3 -0
- package/dist/core-tools.d.ts.map +1 -1
- package/dist/core.js +4 -4
- package/dist/executor.d.ts +1 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/host-internal.js +1 -1
- package/dist/index.js +3 -3
- package/dist/oauth-client.d.ts +5 -0
- package/dist/oauth-client.d.ts.map +1 -1
- package/dist/oauth-helpers.d.ts +1 -0
- package/dist/oauth-helpers.d.ts.map +1 -1
- package/dist/oauth-service.d.ts +4 -0
- package/dist/oauth-service.d.ts.map +1 -1
- package/dist/server-connection.d.ts +7 -0
- package/dist/server-connection.d.ts.map +1 -1
- package/dist/shared.js +2 -2
- package/dist/testing.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-EIHWBY6T.js.map +0 -1
- package/dist/chunk-SK3PCJHJ.js.map +0 -1
- package/dist/chunk-VICUTMT6.js.map +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -58,6 +58,19 @@ export interface IntegrationAccountHandoff {
|
|
|
58
58
|
readonly template?: string;
|
|
59
59
|
/** Non-secret connection label to prefill. */
|
|
60
60
|
readonly label?: string;
|
|
61
|
+
/** Present when the agent handed off a CONFIDENTIAL OAuth-app registration
|
|
62
|
+
* (via `oauth.clients.createHandoff`): the accounts UI opens the
|
|
63
|
+
* Register-OAuth-app form pre-filled with these NON-secret fields, and the
|
|
64
|
+
* human types the client secret directly into the browser. */
|
|
65
|
+
readonly oauthClient?: {
|
|
66
|
+
/** Preselected client slug; when set the form's slug is fixed. */
|
|
67
|
+
readonly slug?: string;
|
|
68
|
+
readonly grant?: string;
|
|
69
|
+
readonly clientId?: string;
|
|
70
|
+
readonly authorizationUrl?: string;
|
|
71
|
+
readonly tokenUrl?: string;
|
|
72
|
+
readonly resource?: string;
|
|
73
|
+
};
|
|
61
74
|
}
|
|
62
75
|
/** Outcome of applying an edit-sheet section's staged change. `summary` is
|
|
63
76
|
* toasted on success; `ok: false` keeps the sheet open (the section renders
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,aAAa,EAIb,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAA+B,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAC;AAOtE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAC;AACtE,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AACxD,OAAO,KAAK,WAAW,MAAM,wCAAwC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,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AC,CAAC;CACjE;AAED,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,GAChD,SAAS,iBAAiB,CAAC,iBAAiB,EAC5C,SAAS,uCAAuC,KAC/C,iBAAiB,CAAC,iBAkBpB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,CAAC,SAAS,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,EAEzE,OAAO,CAAC,EACR,UAAS,6BAAkC,kGAgC5C,CAAC;AA0BF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,4BAA4B,GAClC,UAAU,CAAC,OAAO,aAAa,CAAC,CAoBlC;AAWD,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,QAAO,SAAS,gBAAgB,EAClB,CAAC;AAE5C,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,QAAO,SAAS,iBAAiB,EACR,CAAC;AAE5D,qFAAqF;AACrF,eAAO,MAAM,wBAAwB,QAAO,SAAS,oBAAoB,EACR,CAAC"}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @executor-js/sdk/client — frontend half of the plugin SDK.\n//\n// Plugins import from this entry to register pages/widgets and consume\n// their own typed reactive client. Server bundles must NOT import this\n// module — it pulls in React + @effect/atom-react. Plugin packages should\n// keep React/atom imports inside `./client.tsx` and Effect/Node imports\n// inside `./server.ts`; shared schema definitions go in `./shared.ts` and\n// can be imported from both halves.\n// ---------------------------------------------------------------------------\n\nimport {\n createContext,\n createElement,\n useContext,\n useEffect,\n useMemo,\n type ComponentType,\n type ReactNode,\n} from \"react\";\nimport { HttpApi } from \"effect/unstable/httpapi\";\nimport type { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\nimport { FetchHttpClient, HttpClient, HttpClientRequest } from \"effect/unstable/http\";\nimport * as AtomHttpApi from \"effect/unstable/reactivity/AtomHttpApi\";\n\n// ---------------------------------------------------------------------------\n// Re-exports — the curated set of primitives a plugin author needs to\n// build a typed reactive UI without reaching into `effect/*` directly.\n// ---------------------------------------------------------------------------\n\nexport { Schema } from \"effect\";\nexport { HttpApi, HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\n\nexport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nexport * as Atom from \"effect/unstable/reactivity/Atom\";\nexport * as AtomHttpApi from \"effect/unstable/reactivity/AtomHttpApi\";\n\nexport { useAtomValue, useAtomSet, useAtomMount, useAtomRefresh } from \"@effect/atom-react\";\n\n// ---------------------------------------------------------------------------\n// defineClientPlugin — declarative spec for the frontend half of a plugin.\n//\n// Mirror of `definePlugin` on the server, but everything here is React /\n// browser-only. The host treats the value as data: collects routes,\n// widgets, and slot components from every loaded plugin and mounts them\n// alongside the host's own UI.\n// ---------------------------------------------------------------------------\n\nexport interface PageDecl {\n /** Path relative to the plugin's mount point, e.g. `/`, `/edit/$id`. */\n readonly path: string;\n readonly component: ComponentType;\n /** Optional sidebar nav metadata — the host renders these alongside its\n * own nav links. Omit to register a page without a nav entry. */\n readonly nav?: {\n readonly label: string;\n readonly section?: string;\n };\n}\n\nexport interface WidgetProps {\n readonly scopeId?: string;\n}\n\nexport interface WidgetDecl {\n readonly id: string;\n readonly component: ComponentType<WidgetProps>;\n readonly size?: \"half\" | \"full\";\n}\n\n/**\n * Open record of host-defined slot components a plugin can fill. Slot\n * names are part of the host UI contract — plugins opt in by registering\n * a component for the slot they care about. Adding a slot is a host-side\n * change; plugin authors don't define new slots.\n */\nexport type SlotComponent = ComponentType<Record<string, unknown>>;\n\n// ---------------------------------------------------------------------------\n// IntegrationPlugin / IntegrationPreset — UI contract for plugins that expose\n// \"integrations\" (OpenAPI specs, MCP servers, GraphQL endpoints, etc.). The\n// host owns the integration list / detail chrome; the plugin owns the\n// add-flow, edit form, and (optional) summary + sign-in buttons.\n//\n// Lives here, not in `@executor-js/react`, so it's part of the plugin\n// contract: a plugin's `./client` entry assembles its `integrationPlugin`\n// alongside `pages`/`widgets`, and the host derives the union list\n// from `virtual:executor/plugins-client`.\n// ---------------------------------------------------------------------------\n\nexport interface IntegrationPreset {\n /** Unique id (e.g. \"stripe\", \"github-graphql\"). */\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n /** URL passed as `initialUrl` to the add form. Omit for presets that\n * don't use a URL (e.g. stdio MCP presets). */\n readonly url?: string;\n /** Endpoint passed to agent-facing probe/add tools when their schema\n * uses `endpoint` instead of `url`. */\n readonly endpoint?: string;\n /** Optional icon URL (favicon, logo). */\n readonly icon?: string;\n /** Shown in the top-level grid on the integrations page when true. */\n readonly featured?: boolean;\n}\n\nexport interface IntegrationAccountHandoff {\n /** Changes on each handoff URL, so the accounts UI can open once per link. */\n readonly key: string;\n readonly owner?: \"org\" | \"user\";\n /** Auth template/method to preselect when present. */\n readonly template?: string;\n /** Non-secret connection label to prefill. */\n readonly label?: string;\n}\n\n/** Outcome of applying an edit-sheet section's staged change. `summary` is\n * toasted on success; `ok: false` keeps the sheet open (the section renders\n * its own error inline). */\nexport type EditSheetApplyResult =\n | { readonly ok: true; readonly summary: string | null }\n | { readonly ok: false };\n\nexport interface EditSheetSectionProps {\n readonly sourceId: string;\n readonly onPendingChange?: (apply: (() => Promise<EditSheetApplyResult>) | null) => void;\n}\n\nexport interface IntegrationPlugin {\n /** Unique key matching the SDK plugin id (e.g. \"openapi\"). */\n readonly key: string;\n readonly label: string;\n readonly add: ComponentType<{\n /** Called when the integration has been registered. Receives the slug of\n * the just-registered integration, so the host can route to its detail\n * hub (`/integrations/<slug>`). Optional so existing no-arg calls still\n * typecheck while plugins are threading the slug through. */\n readonly onComplete: (slug?: string) => void;\n readonly onCancel: () => void;\n readonly initialUrl?: string;\n readonly initialPreset?: string;\n readonly initialNamespace?: string;\n }>;\n /** Legacy full-page edit surface. No host renders this anymore — plugin\n * configuration lives in the integration Edit sheet via `editSheet`. */\n readonly edit?: ComponentType<{\n readonly sourceId: string;\n readonly onSave: () => void;\n }>;\n /** Plugin-owned configuration rendered inside the integration's Edit sheet,\n * below the shared metadata fields (e.g. the OpenAPI spec-update controls).\n * The sheet has ONE Save: the section stages its pending change locally and\n * reports it through `onPendingChange` — a thunk that applies the staged\n * change. Save runs the metadata update, then the staged apply; a failed\n * apply keeps the sheet open with the section showing its own error. */\n readonly editSheet?: ComponentType<EditSheetSectionProps>;\n readonly summary?: ComponentType<{\n readonly sourceId: string;\n readonly variant?: \"badge\" | \"panel\";\n readonly onAction?: () => void;\n }>;\n /** Renders the integration's Accounts hub (auth methods + connections) inside\n * the detail page's Accounts tab. Plugins that declare auth methods implement\n * this; the page falls back to a generic accounts list when absent. */\n readonly accounts?: ComponentType<{\n readonly sourceId: string;\n readonly integrationName: string;\n readonly accountHandoff?: IntegrationAccountHandoff | null;\n }>;\n readonly presets?: readonly IntegrationPreset[];\n /** Trigger early download of the plugin's lazy component chunks (add/edit/etc.).\n * Call from the host on intent (hover/focus) so the chunks land before the\n * user navigates into the add page. Idempotent. */\n readonly preload?: () => void;\n}\n\n// ---------------------------------------------------------------------------\n// SecretProviderPlugin — UI contract for plugins that contribute secret\n// providers (1Password, WorkOS Vault, etc.). The host owns the secrets\n// page chrome; the plugin owns the settings card rendered inside.\n// ---------------------------------------------------------------------------\n\nexport interface SecretProviderPlugin {\n /** Unique key matching the SDK plugin id (e.g. \"onepassword\"). */\n readonly key: string;\n readonly label: string;\n readonly settings: ComponentType<Record<string, never>>;\n}\n\nexport interface ClientPluginSpec<TId extends string = string> {\n readonly id: TId;\n readonly pages?: readonly PageDecl[];\n readonly widgets?: readonly WidgetDecl[];\n readonly slots?: Record<string, SlotComponent>;\n /** Integration plugin contribution — populated by plugins that expose\n * `kind` rows in the core `source` table (openapi, mcp, graphql).\n * The host's integrations page derives its provider\n * list from the union of every loaded plugin's `integrationPlugin`. */\n readonly integrationPlugin?: IntegrationPlugin;\n /** Secret provider plugin contribution — populated by plugins that\n * also ship a `secretProviders` (or related) server-side capability\n * AND want to expose a settings card on the host's secrets page. */\n readonly secretProviderPlugin?: SecretProviderPlugin;\n}\n\n/**\n * Identity factory — returns the spec unchanged but pins the inferred\n * literal type of `id` so the host can index plugin records by id with\n * full autocomplete. Plugins export this as their package's default\n * (or named) export from `./client`.\n */\nexport const defineClientPlugin = <const TId extends string>(\n spec: ClientPluginSpec<TId>,\n): ClientPluginSpec<TId> => spec;\n\n// ---------------------------------------------------------------------------\n// createPluginAtomClient — typed reactive HTTP client for one plugin.\n//\n// Wraps the plugin's `HttpApiGroup` in a per-plugin `HttpApi`, then\n// hands back an `AtomHttpApi.Service` keyed to that bundle. The\n// resulting service exposes `.query(\"group\", \"endpoint\", opts)` and\n// `.mutation(\"group\", \"endpoint\")` factories — same shape as the host's\n// existing `ExecutorApiClient` (see packages/react/src/api/client.tsx).\n// Per-endpoint payload/response/error types flow through from the\n// imported group, so plugin client code typechecks without codegen.\n//\n// The plugin id (used for the Service Tag and the synthetic API id) is\n// read from `group.identifier` — the same string the plugin passed to\n// `HttpApiGroup.make(\"foo\")`. No second-source duplication.\n// ---------------------------------------------------------------------------\n\nexport interface CreatePluginAtomClientOptions {\n /** Override the base URL. Defaults to `/api` (host strips this prefix\n * when forwarding to the Effect handler) — same convention as the\n * core `ExecutorApiClient`. */\n readonly baseUrl?: string | (() => string);\n /** Optional dynamic Authorization header for hosts whose active\n * Executor Server Connection requires Basic or Bearer auth. */\n readonly authorizationHeader?: string | null | (() => string | null);\n /** Optional dynamic request headers supplied by the host shell. */\n readonly headers?:\n | Readonly<Record<string, string | null | undefined>>\n | (() => Readonly<Record<string, string | null | undefined>>);\n}\n\nexport interface PluginAtomClientRequestTransformOptions {\n readonly baseUrl?: () => string;\n readonly authorizationHeader?: string | null | (() => string | null);\n readonly headers?:\n | Readonly<Record<string, string | null | undefined>>\n | (() => Readonly<Record<string, string | null | undefined>>);\n}\n\n/** @internal */\nexport const applyPluginAtomClientRequestTransform = (\n request: HttpClientRequest.HttpClientRequest,\n options: PluginAtomClientRequestTransformOptions,\n): HttpClientRequest.HttpClientRequest => {\n let next = options.baseUrl ? HttpClientRequest.prependUrl(request, options.baseUrl()) : request;\n const authorization =\n typeof options.authorizationHeader === \"function\"\n ? options.authorizationHeader()\n : options.authorizationHeader;\n if (authorization) {\n next = HttpClientRequest.setHeader(next, \"authorization\", authorization);\n }\n const headers = typeof options.headers === \"function\" ? options.headers() : options.headers;\n if (headers) {\n for (const [name, value] of Object.entries(headers)) {\n if (value !== undefined && value !== null) {\n next = HttpClientRequest.setHeader(next, name, value);\n }\n }\n }\n return next;\n};\n\n/**\n * Build a typed reactive client for a plugin's HttpApiGroup.\n *\n * const FooClient = createPluginAtomClient(FooApi)\n * export const fooThings = FooClient.query(\"foo\", \"listThings\", { ... })\n * export const fooSync = FooClient.mutation(\"foo\", \"syncThing\")\n *\n * Each plugin gets a private service Tag (`Plugin_<id>Client`) keyed by\n * the group's `identifier`, so multiple plugins coexist in the same\n * React tree without colliding.\n */\nexport const createPluginAtomClient = <\n G extends HttpApiGroup.HttpApiGroup<string, HttpApiEndpoint.Any, boolean>,\n>(\n group: G,\n options: CreatePluginAtomClientOptions = {},\n) => {\n const { baseUrl = \"/api\", authorizationHeader, headers } = options;\n const pluginId = group.identifier;\n const bundle = HttpApi.make(`plugin-${pluginId}`).add(group);\n const getBaseUrl = typeof baseUrl === \"function\" ? baseUrl : null;\n const staticBaseUrl = typeof baseUrl === \"function\" ? undefined : baseUrl;\n const getAuthorizationHeader =\n typeof authorizationHeader === \"function\" ? authorizationHeader : null;\n const hasAuthorization = authorizationHeader !== undefined && authorizationHeader !== null;\n const hasHeaders = headers !== undefined;\n const transformClient =\n getBaseUrl || hasAuthorization || hasHeaders\n ? HttpClient.mapRequest((request) =>\n applyPluginAtomClientRequestTransform(request, {\n ...(getBaseUrl ? { baseUrl: getBaseUrl } : {}),\n ...(getAuthorizationHeader\n ? { authorizationHeader: getAuthorizationHeader }\n : authorizationHeader !== undefined\n ? { authorizationHeader }\n : {}),\n ...(headers !== undefined ? { headers } : {}),\n }),\n )\n : undefined;\n\n return AtomHttpApi.Service<`Plugin_${G[\"identifier\"]}Client`>()(`Plugin_${pluginId}Client`, {\n api: bundle,\n httpClient: FetchHttpClient.layer,\n ...(staticBaseUrl !== undefined ? { baseUrl: staticBaseUrl } : {}),\n ...(transformClient ? { transformClient } : {}),\n });\n};\n\n// ---------------------------------------------------------------------------\n// ExecutorPluginsProvider + hooks — host-level distribution of the loaded\n// `ClientPluginSpec[]` via React context.\n//\n// The host wraps once at the root of its tree (typically reading from\n// `virtual:executor/plugins-client`); pages and shared components consume\n// via the focused hooks (`useIntegrationPlugins` etc.) so they don't import\n// from any host-app aggregator file. Pages stay portable across hosts —\n// the same component renders against whatever plugin set the surrounding\n// `<ExecutorPluginsProvider>` provides.\n//\n// Hooks throw if no provider is in scope so missing setup fails loudly;\n// matches the pattern of `useScope` / `useAuth` already in the codebase.\n// ---------------------------------------------------------------------------\n\ninterface ExecutorPluginsContextValue {\n readonly plugins: readonly ClientPluginSpec[];\n readonly integrationPlugins: readonly IntegrationPlugin[];\n readonly secretProviderPlugins: readonly SecretProviderPlugin[];\n}\n\nconst ExecutorPluginsContext = createContext<ExecutorPluginsContextValue | null>(null);\nExecutorPluginsContext.displayName = \"ExecutorPluginsContext\";\n\nexport interface ExecutorPluginsProviderProps {\n readonly plugins: readonly ClientPluginSpec[];\n readonly children: ReactNode;\n}\n\nexport function ExecutorPluginsProvider(\n props: ExecutorPluginsProviderProps,\n): ReturnType<typeof createElement> {\n const { plugins, children } = props;\n const value = useMemo<ExecutorPluginsContextValue>(\n () => ({\n plugins,\n integrationPlugins: plugins.flatMap((p) =>\n p.integrationPlugin ? [p.integrationPlugin] : [],\n ),\n secretProviderPlugins: plugins.flatMap((p) =>\n p.secretProviderPlugin ? [p.secretProviderPlugin] : [],\n ),\n }),\n [plugins],\n );\n // Kick off lazy chunk downloads for every integration plugin once the host\n // mounts, so navigating into an add/edit page doesn't suspend.\n useEffect(() => {\n for (const ip of value.integrationPlugins) ip.preload?.();\n }, [value.integrationPlugins]);\n return createElement(ExecutorPluginsContext.Provider, { value }, children);\n}\n\nconst usePluginsCtx = (hookName: string): ExecutorPluginsContextValue => {\n const ctx = useContext(ExecutorPluginsContext);\n if (!ctx) {\n // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant\n throw new Error(`${hookName} must be called inside an <ExecutorPluginsProvider>.`);\n }\n return ctx;\n};\n\n/** Full list of loaded `ClientPluginSpec` values. */\nexport const useClientPlugins = (): readonly ClientPluginSpec[] =>\n usePluginsCtx(\"useClientPlugins\").plugins;\n\n/** Integration plugins extracted from `clientPlugins[].integrationPlugin`. */\nexport const useIntegrationPlugins = (): readonly IntegrationPlugin[] =>\n usePluginsCtx(\"useIntegrationPlugins\").integrationPlugins;\n\n/** Secret-provider plugins extracted from `clientPlugins[].secretProviderPlugin`. */\nexport const useSecretProviderPlugins = (): readonly SecretProviderPlugin[] =>\n usePluginsCtx(\"useSecretProviderPlugins\").secretProviderPlugins;\n"],"mappings":";;;AAWA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,eAAe;AAExB,SAAS,iBAAiB,YAAY,yBAAyB;AAC/D,YAAY,iBAAiB;AAO7B,SAAS,cAAc;AACvB,SAAS,WAAAA,UAAS,iBAAiB,oBAAoB;AAEvD,YAAY,iBAAiB;AAC7B,YAAY,UAAU;AACtB,YAAYC,kBAAiB;AAE7B,SAAS,cAAc,YAAY,cAAc,sBAAsB;AA+KhE,IAAM,qBAAqB,CAChC,SAC0B;AAyCrB,IAAM,wCAAwC,CACnD,SACA,YACwC;AACxC,MAAI,OA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AmB,oBAA2C,EAAE,UAAU,QAAQ,UAAU;AAAA,IAC1F,KAAK;AAAA,IACL,YAAY,gBAAgB;AAAA,IAC5B,GAAI,kBAAkB,SAAY,EAAE,SAAS,cAAc,IAAI,CAAC;AAAA,IAChE,GAAI,kBAAkB,EAAE,gBAAgB,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;AAuBA,IAAM,yBAAyB,cAAkD,IAAI;AACrF,uBAAuB,cAAc;AAO9B,SAAS,wBACd,OACkC;AAClC,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA,oBAAoB,QAAQ;AAAA,QAAQ,CAAC,MACnC,EAAE,oBAAoB,CAAC,EAAE,iBAAiB,IAAI,CAAC;AAAA,MACjD;AAAA,MACA,uBAAuB,QAAQ;AAAA,QAAQ,CAAC,MACtC,EAAE,uBAAuB,CAAC,EAAE,oBAAoB,IAAI,CAAC;AAAA,MACvD;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAGA,YAAU,MAAM;AACd,eAAW,MAAM,MAAM,mBAAoB,IAAG,UAAU;AAAA,EAC1D,GAAG,CAAC,MAAM,kBAAkB,CAAC;AAC7B,SAAO,cAAc,uBAAuB,UAAU,EAAE,MAAM,GAAG,QAAQ;AAC3E;AAEA,IAAM,gBAAgB,CAAC,aAAkD;AACvE,QAAM,MAAM,WAAW,sBAAsB;AAC7C,MAAI,CAAC,KAAK;AAER,UAAM,IAAI,MAAM,GAAG,QAAQ,sDAAsD;AAAA,EACnF;AACA,SAAO;AACT;AAGO,IAAM,mBAAmB,MAC9B,cAAc,kBAAkB,EAAE;AAG7B,IAAM,wBAAwB,MACnC,cAAc,uBAAuB,EAAE;AAGlC,IAAM,2BAA2B,MACtC,cAAc,0BAA0B,EAAE;","names":["HttpApi","AtomHttpApi"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @executor-js/sdk/client — frontend half of the plugin SDK.\n//\n// Plugins import from this entry to register pages/widgets and consume\n// their own typed reactive client. Server bundles must NOT import this\n// module — it pulls in React + @effect/atom-react. Plugin packages should\n// keep React/atom imports inside `./client.tsx` and Effect/Node imports\n// inside `./server.ts`; shared schema definitions go in `./shared.ts` and\n// can be imported from both halves.\n// ---------------------------------------------------------------------------\n\nimport {\n createContext,\n createElement,\n useContext,\n useEffect,\n useMemo,\n type ComponentType,\n type ReactNode,\n} from \"react\";\nimport { HttpApi } from \"effect/unstable/httpapi\";\nimport type { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\nimport { FetchHttpClient, HttpClient, HttpClientRequest } from \"effect/unstable/http\";\nimport * as AtomHttpApi from \"effect/unstable/reactivity/AtomHttpApi\";\n\n// ---------------------------------------------------------------------------\n// Re-exports — the curated set of primitives a plugin author needs to\n// build a typed reactive UI without reaching into `effect/*` directly.\n// ---------------------------------------------------------------------------\n\nexport { Schema } from \"effect\";\nexport { HttpApi, HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\n\nexport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nexport * as Atom from \"effect/unstable/reactivity/Atom\";\nexport * as AtomHttpApi from \"effect/unstable/reactivity/AtomHttpApi\";\n\nexport { useAtomValue, useAtomSet, useAtomMount, useAtomRefresh } from \"@effect/atom-react\";\n\n// ---------------------------------------------------------------------------\n// defineClientPlugin — declarative spec for the frontend half of a plugin.\n//\n// Mirror of `definePlugin` on the server, but everything here is React /\n// browser-only. The host treats the value as data: collects routes,\n// widgets, and slot components from every loaded plugin and mounts them\n// alongside the host's own UI.\n// ---------------------------------------------------------------------------\n\nexport interface PageDecl {\n /** Path relative to the plugin's mount point, e.g. `/`, `/edit/$id`. */\n readonly path: string;\n readonly component: ComponentType;\n /** Optional sidebar nav metadata — the host renders these alongside its\n * own nav links. Omit to register a page without a nav entry. */\n readonly nav?: {\n readonly label: string;\n readonly section?: string;\n };\n}\n\nexport interface WidgetProps {\n readonly scopeId?: string;\n}\n\nexport interface WidgetDecl {\n readonly id: string;\n readonly component: ComponentType<WidgetProps>;\n readonly size?: \"half\" | \"full\";\n}\n\n/**\n * Open record of host-defined slot components a plugin can fill. Slot\n * names are part of the host UI contract — plugins opt in by registering\n * a component for the slot they care about. Adding a slot is a host-side\n * change; plugin authors don't define new slots.\n */\nexport type SlotComponent = ComponentType<Record<string, unknown>>;\n\n// ---------------------------------------------------------------------------\n// IntegrationPlugin / IntegrationPreset — UI contract for plugins that expose\n// \"integrations\" (OpenAPI specs, MCP servers, GraphQL endpoints, etc.). The\n// host owns the integration list / detail chrome; the plugin owns the\n// add-flow, edit form, and (optional) summary + sign-in buttons.\n//\n// Lives here, not in `@executor-js/react`, so it's part of the plugin\n// contract: a plugin's `./client` entry assembles its `integrationPlugin`\n// alongside `pages`/`widgets`, and the host derives the union list\n// from `virtual:executor/plugins-client`.\n// ---------------------------------------------------------------------------\n\nexport interface IntegrationPreset {\n /** Unique id (e.g. \"stripe\", \"github-graphql\"). */\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n /** URL passed as `initialUrl` to the add form. Omit for presets that\n * don't use a URL (e.g. stdio MCP presets). */\n readonly url?: string;\n /** Endpoint passed to agent-facing probe/add tools when their schema\n * uses `endpoint` instead of `url`. */\n readonly endpoint?: string;\n /** Optional icon URL (favicon, logo). */\n readonly icon?: string;\n /** Shown in the top-level grid on the integrations page when true. */\n readonly featured?: boolean;\n}\n\nexport interface IntegrationAccountHandoff {\n /** Changes on each handoff URL, so the accounts UI can open once per link. */\n readonly key: string;\n readonly owner?: \"org\" | \"user\";\n /** Auth template/method to preselect when present. */\n readonly template?: string;\n /** Non-secret connection label to prefill. */\n readonly label?: string;\n /** Present when the agent handed off a CONFIDENTIAL OAuth-app registration\n * (via `oauth.clients.createHandoff`): the accounts UI opens the\n * Register-OAuth-app form pre-filled with these NON-secret fields, and the\n * human types the client secret directly into the browser. */\n readonly oauthClient?: {\n /** Preselected client slug; when set the form's slug is fixed. */\n readonly slug?: string;\n readonly grant?: string;\n readonly clientId?: string;\n readonly authorizationUrl?: string;\n readonly tokenUrl?: string;\n readonly resource?: string;\n };\n}\n\n/** Outcome of applying an edit-sheet section's staged change. `summary` is\n * toasted on success; `ok: false` keeps the sheet open (the section renders\n * its own error inline). */\nexport type EditSheetApplyResult =\n | { readonly ok: true; readonly summary: string | null }\n | { readonly ok: false };\n\nexport interface EditSheetSectionProps {\n readonly sourceId: string;\n readonly onPendingChange?: (apply: (() => Promise<EditSheetApplyResult>) | null) => void;\n}\n\nexport interface IntegrationPlugin {\n /** Unique key matching the SDK plugin id (e.g. \"openapi\"). */\n readonly key: string;\n readonly label: string;\n readonly add: ComponentType<{\n /** Called when the integration has been registered. Receives the slug of\n * the just-registered integration, so the host can route to its detail\n * hub (`/integrations/<slug>`). Optional so existing no-arg calls still\n * typecheck while plugins are threading the slug through. */\n readonly onComplete: (slug?: string) => void;\n readonly onCancel: () => void;\n readonly initialUrl?: string;\n readonly initialPreset?: string;\n readonly initialNamespace?: string;\n }>;\n /** Legacy full-page edit surface. No host renders this anymore — plugin\n * configuration lives in the integration Edit sheet via `editSheet`. */\n readonly edit?: ComponentType<{\n readonly sourceId: string;\n readonly onSave: () => void;\n }>;\n /** Plugin-owned configuration rendered inside the integration's Edit sheet,\n * below the shared metadata fields (e.g. the OpenAPI spec-update controls).\n * The sheet has ONE Save: the section stages its pending change locally and\n * reports it through `onPendingChange` — a thunk that applies the staged\n * change. Save runs the metadata update, then the staged apply; a failed\n * apply keeps the sheet open with the section showing its own error. */\n readonly editSheet?: ComponentType<EditSheetSectionProps>;\n readonly summary?: ComponentType<{\n readonly sourceId: string;\n readonly variant?: \"badge\" | \"panel\";\n readonly onAction?: () => void;\n }>;\n /** Renders the integration's Accounts hub (auth methods + connections) inside\n * the detail page's Accounts tab. Plugins that declare auth methods implement\n * this; the page falls back to a generic accounts list when absent. */\n readonly accounts?: ComponentType<{\n readonly sourceId: string;\n readonly integrationName: string;\n readonly accountHandoff?: IntegrationAccountHandoff | null;\n }>;\n readonly presets?: readonly IntegrationPreset[];\n /** Trigger early download of the plugin's lazy component chunks (add/edit/etc.).\n * Call from the host on intent (hover/focus) so the chunks land before the\n * user navigates into the add page. Idempotent. */\n readonly preload?: () => void;\n}\n\n// ---------------------------------------------------------------------------\n// SecretProviderPlugin — UI contract for plugins that contribute secret\n// providers (1Password, WorkOS Vault, etc.). The host owns the secrets\n// page chrome; the plugin owns the settings card rendered inside.\n// ---------------------------------------------------------------------------\n\nexport interface SecretProviderPlugin {\n /** Unique key matching the SDK plugin id (e.g. \"onepassword\"). */\n readonly key: string;\n readonly label: string;\n readonly settings: ComponentType<Record<string, never>>;\n}\n\nexport interface ClientPluginSpec<TId extends string = string> {\n readonly id: TId;\n readonly pages?: readonly PageDecl[];\n readonly widgets?: readonly WidgetDecl[];\n readonly slots?: Record<string, SlotComponent>;\n /** Integration plugin contribution — populated by plugins that expose\n * `kind` rows in the core `source` table (openapi, mcp, graphql).\n * The host's integrations page derives its provider\n * list from the union of every loaded plugin's `integrationPlugin`. */\n readonly integrationPlugin?: IntegrationPlugin;\n /** Secret provider plugin contribution — populated by plugins that\n * also ship a `secretProviders` (or related) server-side capability\n * AND want to expose a settings card on the host's secrets page. */\n readonly secretProviderPlugin?: SecretProviderPlugin;\n}\n\n/**\n * Identity factory — returns the spec unchanged but pins the inferred\n * literal type of `id` so the host can index plugin records by id with\n * full autocomplete. Plugins export this as their package's default\n * (or named) export from `./client`.\n */\nexport const defineClientPlugin = <const TId extends string>(\n spec: ClientPluginSpec<TId>,\n): ClientPluginSpec<TId> => spec;\n\n// ---------------------------------------------------------------------------\n// createPluginAtomClient — typed reactive HTTP client for one plugin.\n//\n// Wraps the plugin's `HttpApiGroup` in a per-plugin `HttpApi`, then\n// hands back an `AtomHttpApi.Service` keyed to that bundle. The\n// resulting service exposes `.query(\"group\", \"endpoint\", opts)` and\n// `.mutation(\"group\", \"endpoint\")` factories — same shape as the host's\n// existing `ExecutorApiClient` (see packages/react/src/api/client.tsx).\n// Per-endpoint payload/response/error types flow through from the\n// imported group, so plugin client code typechecks without codegen.\n//\n// The plugin id (used for the Service Tag and the synthetic API id) is\n// read from `group.identifier` — the same string the plugin passed to\n// `HttpApiGroup.make(\"foo\")`. No second-source duplication.\n// ---------------------------------------------------------------------------\n\nexport interface CreatePluginAtomClientOptions {\n /** Override the base URL. Defaults to `/api` (host strips this prefix\n * when forwarding to the Effect handler) — same convention as the\n * core `ExecutorApiClient`. */\n readonly baseUrl?: string | (() => string);\n /** Optional dynamic Authorization header for hosts whose active\n * Executor Server Connection requires Basic or Bearer auth. */\n readonly authorizationHeader?: string | null | (() => string | null);\n /** Optional dynamic request headers supplied by the host shell. */\n readonly headers?:\n | Readonly<Record<string, string | null | undefined>>\n | (() => Readonly<Record<string, string | null | undefined>>);\n}\n\nexport interface PluginAtomClientRequestTransformOptions {\n readonly baseUrl?: () => string;\n readonly authorizationHeader?: string | null | (() => string | null);\n readonly headers?:\n | Readonly<Record<string, string | null | undefined>>\n | (() => Readonly<Record<string, string | null | undefined>>);\n}\n\n/** @internal */\nexport const applyPluginAtomClientRequestTransform = (\n request: HttpClientRequest.HttpClientRequest,\n options: PluginAtomClientRequestTransformOptions,\n): HttpClientRequest.HttpClientRequest => {\n let next = options.baseUrl ? HttpClientRequest.prependUrl(request, options.baseUrl()) : request;\n const authorization =\n typeof options.authorizationHeader === \"function\"\n ? options.authorizationHeader()\n : options.authorizationHeader;\n if (authorization) {\n next = HttpClientRequest.setHeader(next, \"authorization\", authorization);\n }\n const headers = typeof options.headers === \"function\" ? options.headers() : options.headers;\n if (headers) {\n for (const [name, value] of Object.entries(headers)) {\n if (value !== undefined && value !== null) {\n next = HttpClientRequest.setHeader(next, name, value);\n }\n }\n }\n return next;\n};\n\n/**\n * Build a typed reactive client for a plugin's HttpApiGroup.\n *\n * const FooClient = createPluginAtomClient(FooApi)\n * export const fooThings = FooClient.query(\"foo\", \"listThings\", { ... })\n * export const fooSync = FooClient.mutation(\"foo\", \"syncThing\")\n *\n * Each plugin gets a private service Tag (`Plugin_<id>Client`) keyed by\n * the group's `identifier`, so multiple plugins coexist in the same\n * React tree without colliding.\n */\nexport const createPluginAtomClient = <\n G extends HttpApiGroup.HttpApiGroup<string, HttpApiEndpoint.Any, boolean>,\n>(\n group: G,\n options: CreatePluginAtomClientOptions = {},\n) => {\n const { baseUrl = \"/api\", authorizationHeader, headers } = options;\n const pluginId = group.identifier;\n const bundle = HttpApi.make(`plugin-${pluginId}`).add(group);\n const getBaseUrl = typeof baseUrl === \"function\" ? baseUrl : null;\n const staticBaseUrl = typeof baseUrl === \"function\" ? undefined : baseUrl;\n const getAuthorizationHeader =\n typeof authorizationHeader === \"function\" ? authorizationHeader : null;\n const hasAuthorization = authorizationHeader !== undefined && authorizationHeader !== null;\n const hasHeaders = headers !== undefined;\n const transformClient =\n getBaseUrl || hasAuthorization || hasHeaders\n ? HttpClient.mapRequest((request) =>\n applyPluginAtomClientRequestTransform(request, {\n ...(getBaseUrl ? { baseUrl: getBaseUrl } : {}),\n ...(getAuthorizationHeader\n ? { authorizationHeader: getAuthorizationHeader }\n : authorizationHeader !== undefined\n ? { authorizationHeader }\n : {}),\n ...(headers !== undefined ? { headers } : {}),\n }),\n )\n : undefined;\n\n return AtomHttpApi.Service<`Plugin_${G[\"identifier\"]}Client`>()(`Plugin_${pluginId}Client`, {\n api: bundle,\n httpClient: FetchHttpClient.layer,\n ...(staticBaseUrl !== undefined ? { baseUrl: staticBaseUrl } : {}),\n ...(transformClient ? { transformClient } : {}),\n });\n};\n\n// ---------------------------------------------------------------------------\n// ExecutorPluginsProvider + hooks — host-level distribution of the loaded\n// `ClientPluginSpec[]` via React context.\n//\n// The host wraps once at the root of its tree (typically reading from\n// `virtual:executor/plugins-client`); pages and shared components consume\n// via the focused hooks (`useIntegrationPlugins` etc.) so they don't import\n// from any host-app aggregator file. Pages stay portable across hosts —\n// the same component renders against whatever plugin set the surrounding\n// `<ExecutorPluginsProvider>` provides.\n//\n// Hooks throw if no provider is in scope so missing setup fails loudly;\n// matches the pattern of `useScope` / `useAuth` already in the codebase.\n// ---------------------------------------------------------------------------\n\ninterface ExecutorPluginsContextValue {\n readonly plugins: readonly ClientPluginSpec[];\n readonly integrationPlugins: readonly IntegrationPlugin[];\n readonly secretProviderPlugins: readonly SecretProviderPlugin[];\n}\n\nconst ExecutorPluginsContext = createContext<ExecutorPluginsContextValue | null>(null);\nExecutorPluginsContext.displayName = \"ExecutorPluginsContext\";\n\nexport interface ExecutorPluginsProviderProps {\n readonly plugins: readonly ClientPluginSpec[];\n readonly children: ReactNode;\n}\n\nexport function ExecutorPluginsProvider(\n props: ExecutorPluginsProviderProps,\n): ReturnType<typeof createElement> {\n const { plugins, children } = props;\n const value = useMemo<ExecutorPluginsContextValue>(\n () => ({\n plugins,\n integrationPlugins: plugins.flatMap((p) =>\n p.integrationPlugin ? [p.integrationPlugin] : [],\n ),\n secretProviderPlugins: plugins.flatMap((p) =>\n p.secretProviderPlugin ? [p.secretProviderPlugin] : [],\n ),\n }),\n [plugins],\n );\n // Kick off lazy chunk downloads for every integration plugin once the host\n // mounts, so navigating into an add/edit page doesn't suspend.\n useEffect(() => {\n for (const ip of value.integrationPlugins) ip.preload?.();\n }, [value.integrationPlugins]);\n return createElement(ExecutorPluginsContext.Provider, { value }, children);\n}\n\nconst usePluginsCtx = (hookName: string): ExecutorPluginsContextValue => {\n const ctx = useContext(ExecutorPluginsContext);\n if (!ctx) {\n // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant\n throw new Error(`${hookName} must be called inside an <ExecutorPluginsProvider>.`);\n }\n return ctx;\n};\n\n/** Full list of loaded `ClientPluginSpec` values. */\nexport const useClientPlugins = (): readonly ClientPluginSpec[] =>\n usePluginsCtx(\"useClientPlugins\").plugins;\n\n/** Integration plugins extracted from `clientPlugins[].integrationPlugin`. */\nexport const useIntegrationPlugins = (): readonly IntegrationPlugin[] =>\n usePluginsCtx(\"useIntegrationPlugins\").integrationPlugins;\n\n/** Secret-provider plugins extracted from `clientPlugins[].secretProviderPlugin`. */\nexport const useSecretProviderPlugins = (): readonly SecretProviderPlugin[] =>\n usePluginsCtx(\"useSecretProviderPlugins\").secretProviderPlugins;\n"],"mappings":";;;AAWA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,eAAe;AAExB,SAAS,iBAAiB,YAAY,yBAAyB;AAC/D,YAAY,iBAAiB;AAO7B,SAAS,cAAc;AACvB,SAAS,WAAAA,UAAS,iBAAiB,oBAAoB;AAEvD,YAAY,iBAAiB;AAC7B,YAAY,UAAU;AACtB,YAAYC,kBAAiB;AAE7B,SAAS,cAAc,YAAY,cAAc,sBAAsB;AA4LhE,IAAM,qBAAqB,CAChC,SAC0B;AAyCrB,IAAM,wCAAwC,CACnD,SACA,YACwC;AACxC,MAAI,OAAO,QAAQ,UAAU,kBAAkB,WAAW,SAAS,QAAQ,QAAQ,CAAC,IAAI;AACxF,QAAM,gBACJ,OAAO,QAAQ,wBAAwB,aACnC,QAAQ,oBAAoB,IAC5B,QAAQ;AACd,MAAI,eAAe;AACjB,WAAO,kBAAkB,UAAU,MAAM,iBAAiB,aAAa;AAAA,EACzE;AACA,QAAM,UAAU,OAAO,QAAQ,YAAY,aAAa,QAAQ,QAAQ,IAAI,QAAQ;AACpF,MAAI,SAAS;AACX,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AACnD,UAAI,UAAU,UAAa,UAAU,MAAM;AACzC,eAAO,kBAAkB,UAAU,MAAM,MAAM,KAAK;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAaO,IAAM,yBAAyB,CAGpC,OACA,UAAyC,CAAC,MACvC;AACH,QAAM,EAAE,UAAU,QAAQ,qBAAqB,QAAQ,IAAI;AAC3D,QAAM,WAAW,MAAM;AACvB,QAAM,SA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,OAAO;AAAA,EACV;AAGA,YAAU,MAAM;AACd,eAAW,MAAM,MAAM,mBAAoB,IAAG,UAAU;AAAA,EAC1D,GAAG,CAAC,MAAM,kBAAkB,CAAC;AAC7B,SAAO,cAAc,uBAAuB,UAAU,EAAE,MAAM,GAAG,QAAQ;AAC3E;AAEA,IAAM,gBAAgB,CAAC,aAAkD;AACvE,QAAM,MAAM,WAAW,sBAAsB;AAC7C,MAAI,CAAC,KAAK;AAER,UAAM,IAAI,MAAM,GAAG,QAAQ,sDAAsD;AAAA,EACnF;AACA,SAAO;AACT;AAGO,IAAM,mBAAmB,MAC9B,cAAc,kBAAkB,EAAE;AAG7B,IAAM,wBAAwB,MACnC,cAAc,uBAAuB,EAAE;AAGlC,IAAM,2BAA2B,MACtC,cAAc,0BAA0B,EAAE;","names":["HttpApi","AtomHttpApi"]}
|
package/dist/core-schema.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export declare const coreTables: {
|
|
|
39
39
|
readonly refresh_item_id: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
40
40
|
readonly expires_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
|
|
41
41
|
readonly oauth_scope: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
42
|
+
readonly oauth_token_url: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
42
43
|
readonly provider_state: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
|
|
43
44
|
readonly created_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
|
|
44
45
|
readonly updated_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
|
|
@@ -178,6 +179,7 @@ export declare const coreSchema: {
|
|
|
178
179
|
readonly refresh_item_id: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
179
180
|
readonly expires_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
|
|
180
181
|
readonly oauth_scope: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
182
|
+
readonly oauth_token_url: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
|
|
181
183
|
readonly provider_state: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
|
|
182
184
|
readonly created_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
|
|
183
185
|
readonly updated_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-schema.d.ts","sourceRoot":"","sources":["../src/core-schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAiB5D,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,0EAA2B,CAAC;AACnE,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,wFAAsC,CAAC;AACtF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,gFAAiC,CAAC;AACxE,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,8FAA4C,CAAC;AAC3F,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,cAAc,OAAO,iFAChB,CAAC;AAC/C,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,0EAA2B,CAAC;AACrE,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,wFAAsC,CAAC;AACxF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,0EAAyB,CAAC;AACjE,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,0EAAoC,CAAC;AACpF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,yEAA8B,CAAC;AAmFtE,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"core-schema.d.ts","sourceRoot":"","sources":["../src/core-schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAiB5D,eAAO,MAAM,UAAU,GAAI,MA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cAAc,CAAC,CAAC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;AACnE,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAClD;;;4EAG4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;AAChF,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,qJAYW,CAAC;AAChD,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACrE,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,kBAAkB,GAAG,OAAO,CAAC;AAExE,eAAO,MAAM,mBAAmB,mDAIgB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,gBAC4B,CAAC"}
|
package/dist/core-tools.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export interface CoreToolsPluginOptions {
|
|
2
2
|
readonly webBaseUrl?: string;
|
|
3
|
+
/** The bound org's URL slug, prefixed onto browser-handoff URLs so they open
|
|
4
|
+
* the right org's console (`${webBaseUrl}/<orgSlug>/integrations/...`). */
|
|
5
|
+
readonly orgSlug?: string;
|
|
3
6
|
readonly includeProviders?: boolean;
|
|
4
7
|
}
|
|
5
8
|
export declare const coreToolsPlugin: import("./plugin").ConfiguredPlugin<"core-tools", {}, {}, CoreToolsPluginOptions, undefined, import("effect/Layer").Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
|
package/dist/core-tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../src/core-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../src/core-tools.ts"],"names":[],"mappings":"AAgfA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;gFAC4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,uMAgbzB,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeExecutorServerConnection,
|
|
13
13
|
normalizeExecutorServerOrigin,
|
|
14
14
|
originFromApiBaseUrl
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EJKXSREX.js";
|
|
16
16
|
import {
|
|
17
17
|
OAUTH2_PROVIDER_KEY,
|
|
18
18
|
OAUTH2_SESSION_TTL_MS,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
textColumn,
|
|
57
57
|
tool,
|
|
58
58
|
toolAddress
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-UWBP7WLB.js";
|
|
60
60
|
import {
|
|
61
61
|
ConnectionNotFoundError,
|
|
62
62
|
CredentialProviderNotRegisteredError,
|
|
@@ -85,8 +85,8 @@ import {
|
|
|
85
85
|
effectivePolicyFromSorted,
|
|
86
86
|
isValidPattern,
|
|
87
87
|
matchPattern
|
|
88
|
-
} from "./chunk-
|
|
89
|
-
import "./chunk-
|
|
88
|
+
} from "./chunk-PCSRC6WP.js";
|
|
89
|
+
import "./chunk-4XPVLX62.js";
|
|
90
90
|
import {
|
|
91
91
|
AuthTemplateSlug,
|
|
92
92
|
ConnectionAddress,
|
package/dist/executor.d.ts
CHANGED
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,KAAK,EAA6B,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQxE,OAAO,EAIL,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsC,KAAK,SAAS,EAAwB,MAAM,QAAQ,CAAC;AAElG,OAAO,KAAK,EACV,UAAU,EAEV,aAAa,EACb,qBAAqB,EAErB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAatB,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACL,uBAAuB,EACvB,oCAAoC,EAEpC,wBAAwB,EACxB,2BAA2B,EAC3B,iCAAiC,EAMjC,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,eAAe,EAGf,KAAK,EAGL,WAAW,EACX,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAA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AAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9D;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH;AAQD,eAAO,MAAM,aAAa,QAAO,UAGhC,CAAC;AAyyBF,eAAO,MAAM,cAAc,GAAI,KAAK,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,EACtF,QAAQ,cAAc,CAAC,QAAQ,CAAC,KAC/B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAijE/C,CAAC"}
|
package/dist/host-internal.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
collectTables,
|
|
6
6
|
createExecutor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UWBP7WLB.js";
|
|
8
8
|
import {
|
|
9
9
|
ConnectionNotFoundError,
|
|
10
10
|
CredentialProviderNotRegisteredError,
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
ToolNotFoundError,
|
|
23
23
|
ToolSchemaView,
|
|
24
24
|
UrlElicitation
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-PCSRC6WP.js";
|
|
26
|
+
import "./chunk-4XPVLX62.js";
|
|
27
27
|
import {
|
|
28
28
|
AuthTemplateSlug,
|
|
29
29
|
ConnectionName,
|
package/dist/oauth-client.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export interface OAuthStartInput {
|
|
|
86
86
|
export interface OAuthCompleteInput {
|
|
87
87
|
readonly state: OAuthState;
|
|
88
88
|
readonly code: string;
|
|
89
|
+
/** Non-standard regional host the authorization server returns on the
|
|
90
|
+
* callback (Datadog's `domain`/`site` params) so the code is redeemed at the
|
|
91
|
+
* org's actual region rather than the statically advertised one. Used only
|
|
92
|
+
* when it is a sibling subdomain of the client's configured token host. */
|
|
93
|
+
readonly callbackDomain?: string | null;
|
|
89
94
|
}
|
|
90
95
|
/** Probe a base/issuer URL for OAuth 2.1 authorization-server metadata so the
|
|
91
96
|
* onboarding UI can pre-fill a client's endpoints. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-client.d.ts","sourceRoot":"","sources":["../src/oauth-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,eAAe,EACf,UAAU,EACV,KAAK,KAAK,EACX,MAAM,OAAO,CAAC;AAYf,MAAM,MAAM,UAAU,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAErE;;wEAEwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,M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c,CAAC,CAAC;IAChG,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC5E,QAAQ,CAAC,KAAK,EAAE,CACd,KAAK,EAAE,eAAe,KACnB,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,eAAe,GAAG,cAAc,CAAC,CAAC;CACxE"}
|
package/dist/oauth-helpers.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export declare const buildAuthorizationUrl: (input: BuildAuthorizationUrlInput)
|
|
|
67
67
|
* consent app, Google folds those unrelated scopes into the new consent flow and
|
|
68
68
|
* can fail inside accounts.google.com before returning to our callback. */
|
|
69
69
|
export declare const providerAuthorizeExtras: (authorizationUrl: string) => Readonly<Record<string, string>>;
|
|
70
|
+
export declare const rebindTokenEndpointHostToCallbackDomain: (configuredTokenUrl: string, callbackDomain: string | null | undefined) => string;
|
|
70
71
|
export type ClientAuthMethod = "body" | "basic";
|
|
71
72
|
/**
|
|
72
73
|
* The token-endpoint client-auth transport used when a caller doesn't specify
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-helpers.d.ts","sourceRoot":"","sources":["../src/oauth-helpers.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAQ,MAAM,EAAa,MAAM,QAAQ,CAAC;;;;AAOjD,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;AAML,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,M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AAM,CAAC,mBAAmB,EAAE,WAAW,CAuCC,CAAC;AAMnD,eAAO,MAAM,kBAAkB,GAAI,OAAO;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,KAAG,OAKH,CAAC"}
|
package/dist/oauth-service.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface MintOAuthConnectionInput {
|
|
|
26
26
|
readonly refreshItemId: string | null;
|
|
27
27
|
readonly expiresAt: number | null;
|
|
28
28
|
readonly oauthScope: string | null;
|
|
29
|
+
/** Per-connection override for the token endpoint, persisted only when the
|
|
30
|
+
* code was redeemed at a region other than the client's configured token
|
|
31
|
+
* host (Datadog multi-site). Null means refresh uses the client's token URL. */
|
|
32
|
+
readonly oauthTokenUrl?: string | null;
|
|
29
33
|
}
|
|
30
34
|
/** Everything the OAuth service needs from the executor: fuma access for the
|
|
31
35
|
* owned `oauth_client` / `oauth_session` tables, the default credential
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-service.d.ts","sourceRoot":"","sources":["../src/oauth-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EAEf,KAAK,EAEN,MAAM,OAAO,CAAC;AACf,OAAO,EAcL,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,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YG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAgMD,eAAO,MAAM,gBAAgB,GAAI,MAAM,gBAAgB,KAAG,YA8qBzD,CAAC"}
|
|
@@ -9,6 +9,13 @@ export type ExecutorServerAuth = {
|
|
|
9
9
|
} | {
|
|
10
10
|
readonly kind: "bearer";
|
|
11
11
|
readonly token: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "oauth";
|
|
14
|
+
readonly accessToken: string;
|
|
15
|
+
readonly refreshToken?: string;
|
|
16
|
+
readonly expiresAt?: number;
|
|
17
|
+
readonly tokenEndpoint?: string;
|
|
18
|
+
readonly clientId?: string;
|
|
12
19
|
};
|
|
13
20
|
export interface ExecutorServerConnection {
|
|
14
21
|
readonly kind: ExecutorServerConnectionKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-connection.d.ts","sourceRoot":"","sources":["../src/server-connection.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,8BAA8B,0BAA0B,CAAC;AACtE,eAAO,MAAM,gCAAgC,aAAa,CAAC;AAE3D,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,iBAAiB,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,iBAAiB,GAAG,YAAY,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ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AM,iCAAiC,GAC5C,QAAO,6BAAkC,KACxC,wBAgBF,CAAC;AAqBF,eAAO,MAAM,oCAAoC,GAC/C,YAAY,wBAAwB,KACnC,MAAM,GAAG,IASX,CAAC;AAyDF,eAAO,MAAM,gCAAgC,GAC3C,KAAK,MAAM,KACV,2BAA2B,GAAG,IA6BhC,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAC/C,UAAU,2BAA2B,KACpC,MAAkD,CAAC"}
|
package/dist/shared.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
originFromApiBaseUrl,
|
|
12
12
|
parseExecutorLocalServerManifest,
|
|
13
13
|
serializeExecutorLocalServerManifest
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EJKXSREX.js";
|
|
15
15
|
import {
|
|
16
16
|
ConnectionNotFoundError,
|
|
17
17
|
CredentialProviderNotRegisteredError,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
effectivePolicyFromSorted,
|
|
43
43
|
isValidPattern,
|
|
44
44
|
matchPattern
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-PCSRC6WP.js";
|
|
46
46
|
import {
|
|
47
47
|
AuthTemplateSlug,
|
|
48
48
|
ConnectionAddress,
|
package/dist/testing.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
collectTables,
|
|
6
6
|
createExecutor,
|
|
7
7
|
definePlugin
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-UWBP7WLB.js";
|
|
9
|
+
import "./chunk-PCSRC6WP.js";
|
|
10
10
|
import "./chunk-I3X6242Q.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-4XPVLX62.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderItemId,
|
|
14
14
|
ProviderKey,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/oauth-helpers.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// OAuth 2.0 helpers — generic, isomorphic building blocks.\n//\n// Thin wrappers around `oauth4webapi` (stateless; pure Web Crypto +\n// `fetch`, no deps; runs unchanged in Node, CF Workers, and browsers).\n// Each public helper is a single `Effect.tryPromise` call that delegates\n// the RFC work to the library and normalises the failure surface into\n// `OAuth2Error`.\n//\n// What stays hand-rolled:\n// - `OAuth2Error` — our tagged error; we want a stable shape across\n// every token-endpoint call\n// - `shouldRefreshToken` — skew check, trivial\n// - `buildAuthorizationUrl` — the library doesn't expose a raw\n// authorization-URL builder (it prefers PAR); a 30-line manual\n// construction keeps the call sync and lets callers opt out of PAR\n// ---------------------------------------------------------------------------\n\nimport { Data, Effect, Predicate } from \"effect\";\nimport * as oauth from \"oauth4webapi\";\n\n// ---------------------------------------------------------------------------\n// Errors\n// ---------------------------------------------------------------------------\n\nexport class OAuth2Error extends Data.TaggedError(\"OAuth2Error\")<{\n readonly message: string;\n /**\n * RFC 6749 §5.2 error code, when the token endpoint returned one\n * (`invalid_grant`, `invalid_client`, `unauthorized_client`, ...).\n * Callers use this to distinguish terminal failures (a refresh token\n * the AS no longer honours → re-auth required) from transient ones.\n */\n readonly error?: string;\n readonly cause?: unknown;\n}> {}\n\n// ---------------------------------------------------------------------------\n// Token response shape (RFC 6749 §5.1)\n// ---------------------------------------------------------------------------\n\nexport type OAuth2TokenResponse = {\n readonly access_token: string;\n readonly token_type?: string;\n readonly refresh_token?: string;\n readonly expires_in?: number;\n readonly scope?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/** Refresh tokens this many ms before expiry to avoid mid-request expiration. */\nexport const OAUTH2_REFRESH_SKEW_MS = 60_000;\n\n/** Default token-endpoint timeout. */\nexport const OAUTH2_DEFAULT_TIMEOUT_MS = 20_000;\n\nexport interface OAuthEndpointUrlPolicy {\n readonly allowHttp?: boolean;\n}\n\nconst isLoopbackHttpUrl = (value: string): boolean => {\n if (!URL.canParse(value)) return false;\n const url = new URL(value);\n if (url.protocol !== \"http:\") return false;\n const hostname = url.hostname.toLowerCase();\n return (\n hostname === \"localhost\" ||\n hostname === \"0.0.0.0\" ||\n hostname === \"::1\" ||\n hostname === \"[::1]\" ||\n hostname.startsWith(\"127.\")\n );\n};\n\nexport const isSupportedOAuthEndpointUrl = (\n value: string,\n policy: OAuthEndpointUrlPolicy = {},\n): boolean => {\n if (!URL.canParse(value)) return false;\n const url = new URL(value);\n return (\n url.protocol === \"https:\" ||\n isLoopbackHttpUrl(value) ||\n (url.protocol === \"http:\" && policy.allowHttp === true)\n );\n};\n\nexport const assertSupportedOAuthEndpointUrl = (\n value: string,\n label = \"OAuth endpoint URL\",\n policy: OAuthEndpointUrlPolicy = {},\n): string => {\n if (isSupportedOAuthEndpointUrl(value, policy)) return value;\n // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: synchronous assertion helper used by URL constructors and Effect.try wrappers\n throw new TypeError(`${label} must use https: or loopback http:`);\n};\n\n// ---------------------------------------------------------------------------\n// PKCE (RFC 7636) — straight delegation to `oauth4webapi`\n// ---------------------------------------------------------------------------\n\nexport const createPkceCodeVerifier = (): string => oauth.generateRandomCodeVerifier();\n\nexport const createPkceCodeChallenge = (verifier: string): Promise<string> =>\n oauth.calculatePKCECodeChallenge(verifier);\n\n/** RFC 6749 `state` — an unguessable correlation token minted by `oauth.start`\n * and redeemed by `oauth.complete`. */\nexport const createOAuthState = (): string => oauth.generateRandomState();\n\n// ---------------------------------------------------------------------------\n// Authorization URL builder\n// ---------------------------------------------------------------------------\n\nexport type BuildAuthorizationUrlInput = {\n readonly authorizationUrl: string;\n readonly clientId: string;\n readonly redirectUrl: string;\n readonly scopes: readonly string[];\n readonly state: string;\n /** Pre-computed base64url S256 challenge (from `createPkceCodeChallenge`). */\n readonly codeChallenge: string;\n /** Separator between scopes. RFC 6749 says space; some providers use comma. */\n readonly scopeSeparator?: string;\n /** RFC 8707 Resource Indicator. MCP Authorization 2025-06-18 §\"Resource\n * Parameter Implementation\" requires clients to send this on every\n * authorization request, regardless of AS support. */\n readonly resource?: string;\n /** Provider-specific extras (e.g. Google's `access_type=offline`). */\n readonly extraParams?: Readonly<Record<string, string>>;\n readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;\n};\n\n/** Build an RFC 6749 §4.1.1 authorization URL. Sync; pre-computed\n * challenge lets this stay out of the Promise world. */\nexport const buildAuthorizationUrl = (input: BuildAuthorizationUrlInput): string => {\n const url = new URL(\n assertSupportedOAuthEndpointUrl(\n input.authorizationUrl,\n \"Authorization URL\",\n input.endpointUrlPolicy,\n ),\n );\n // Benign default kept by design: a single space is the RFC 6749 scope\n // separator. Callers targeting a legacy comma-separated provider pass\n // `scopeSeparator` explicitly (see the field's JSDoc).\n const separator = input.scopeSeparator ?? \" \";\n url.searchParams.set(\"client_id\", input.clientId);\n url.searchParams.set(\"redirect_uri\", input.redirectUrl);\n url.searchParams.set(\"response_type\", \"code\");\n if (input.scopes.length > 0) {\n url.searchParams.set(\"scope\", input.scopes.join(separator));\n }\n url.searchParams.set(\"state\", input.state);\n url.searchParams.set(\"code_challenge_method\", \"S256\");\n url.searchParams.set(\"code_challenge\", input.codeChallenge);\n if (input.resource) {\n url.searchParams.set(\"resource\", input.resource);\n }\n if (input.extraParams) {\n for (const [k, v] of Object.entries(input.extraParams)) {\n url.searchParams.set(k, v);\n }\n }\n return url.toString();\n};\n\n/** Provider-specific authorize-URL extras that are NOT RFC 6749 params, so the\n * generic flow must add them per-provider (keyed off the authorization host).\n *\n * Google: `access_type=offline` + `prompt=consent` are required to receive (and\n * keep receiving, across reconnects / scope changes) a REFRESH TOKEN — without\n * them Google issues an access-token-only grant that dies in ~1h and a\n * re-consent can silently keep the old scope set. Do not add\n * `include_granted_scopes=true` here: with historical grants on the same Google\n * consent app, Google folds those unrelated scopes into the new consent flow and\n * can fail inside accounts.google.com before returning to our callback. */\nexport const providerAuthorizeExtras = (\n authorizationUrl: string,\n): Readonly<Record<string, string>> => {\n // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL() throws on invalid input → no provider extras\n try {\n const host = new URL(authorizationUrl).host.toLowerCase();\n if (host === \"accounts.google.com\") {\n return { access_type: \"offline\", prompt: \"consent\" };\n }\n } catch {\n // Unparseable authorization URL — let buildAuthorizationUrl surface the error.\n }\n return {};\n};\n\n// ---------------------------------------------------------------------------\n// Error mapping — `oauth4webapi`'s `process*Response` failure shapes are\n// either a WWW-Authenticate challenge or an RFC 6749 §5.2 error body,\n// both exposed via `.error` / `.error_description`. Probing the envelope\n// preserves RFC 6749 error-code semantics (e.g., mapping `invalid_grant`\n// to reauth-required) across wrappers.\n// ---------------------------------------------------------------------------\n\nconst isOAuth2Error = Predicate.isTagged(\"OAuth2Error\") as (cause: unknown) => cause is OAuth2Error;\n\nconst responseFromOAuthErrorCause = (cause: unknown): Response | undefined => {\n if (cause instanceof Response) return cause;\n if (typeof cause !== \"object\" || cause === null) return undefined;\n const envelope = cause as {\n readonly cause?: unknown;\n readonly response?: unknown;\n };\n if (envelope.response instanceof Response) return envelope.response;\n if (envelope.cause instanceof Response) return envelope.cause;\n return undefined;\n};\n\nconst redactTokenEndpointBody = (body: string): string =>\n body\n .replaceAll(\n /(\"(?:access_token|refresh_token|id_token|client_secret)\"\\s*:\\s*\")[^\"]*(\")/gi,\n \"$1[redacted]$2\",\n )\n .replaceAll(\n /((?:access_token|refresh_token|id_token|client_secret|code)=)[^&\\s]*/gi,\n \"$1[redacted]\",\n );\n\nconst tokenEndpointHttpSummary = async (response: Response): Promise<string> => {\n const status = `HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : \"\"}`;\n const contentType = response.headers.get(\"content-type\");\n const url = response.url ? ` from ${response.url}` : \"\";\n const parts = [`${status}${url}`];\n if (contentType) parts.push(`content-type ${contentType}`);\n const preview = await bodyPreviewFromResponse(response);\n if (preview) parts.push(`body: ${preview}`);\n return parts.join(\"; \");\n};\n\nconst bodyPreviewFromResponse = async (response: Response): Promise<string | undefined> => {\n const text = await Promise.resolve()\n .then(() => response.clone().text())\n .then(\n (value) => value.trim(),\n () => \"\",\n );\n if (!text) return undefined;\n const redacted = redactTokenEndpointBody(text.replaceAll(/\\s+/g, \" \"));\n return redacted.length > 500 ? `${redacted.slice(0, 500)}...` : redacted;\n};\n\nconst toOAuth2Error = (cause: unknown): OAuth2Error => {\n if (isOAuth2Error(cause)) return cause;\n if (typeof cause === \"object\" && cause !== null) {\n const c = cause as {\n error?: unknown;\n error_description?: unknown;\n message?: unknown;\n };\n const code = typeof c.error === \"string\" ? c.error : undefined;\n const description =\n typeof c.error_description === \"string\"\n ? c.error_description\n : typeof c.message === \"string\"\n ? c.message\n : undefined;\n return new OAuth2Error({\n message: `OAuth token exchange failed: ${description ?? code ?? \"unknown error\"}`,\n error: code,\n cause,\n });\n }\n return new OAuth2Error({\n message: \"OAuth token exchange failed\",\n cause,\n });\n};\n\nconst toOAuth2ErrorWithHttpSummary = (cause: unknown): Effect.Effect<OAuth2Error> => {\n if (isOAuth2Error(cause)) return Effect.succeed(cause);\n const base = toOAuth2Error(cause);\n const response = responseFromOAuthErrorCause(cause);\n if (!response) return Effect.succeed(base);\n return Effect.promise(() => tokenEndpointHttpSummary(response)).pipe(\n Effect.map(\n (summary) =>\n new OAuth2Error({\n message: `${base.message} (${summary})`,\n error: base.error,\n cause,\n }),\n ),\n );\n};\n\nconst failOAuth2WithHttpSummary = (cause: unknown): Effect.Effect<never, OAuth2Error> =>\n toOAuth2ErrorWithHttpSummary(cause).pipe(Effect.flatMap((error) => Effect.fail(error)));\n\n// ---------------------------------------------------------------------------\n// oauth4webapi adapter helpers\n// ---------------------------------------------------------------------------\n\nexport type ClientAuthMethod = \"body\" | \"basic\";\n\n/**\n * The token-endpoint client-auth transport used when a caller doesn't specify\n * one. `\"body\"` is `client_secret_post` (the secret in the form body) — the\n * method our DCR registers (`token_endpoint_auth_method: client_secret_post`)\n * and the one every confidential client in the v2 model uses. EXPLICIT and\n * documented rather than a hidden inline `?? \"body\"`: callers that need\n * `client_secret_basic` pass `clientAuth: \"basic\"`. For PUBLIC clients (no\n * secret) the method is irrelevant — `pickClientAuth` returns `None()`.\n */\nexport const DEFAULT_CLIENT_AUTH_METHOD: ClientAuthMethod = \"body\";\n\nconst asFromTokenUrl = (\n tokenUrl: string,\n endpointUrlPolicy: OAuthEndpointUrlPolicy = {},\n): oauth.AuthorizationServer => {\n assertSupportedOAuthEndpointUrl(tokenUrl, \"Token URL\", endpointUrlPolicy);\n const url = new URL(tokenUrl);\n return {\n issuer: `${url.protocol}//${url.host}`,\n token_endpoint: tokenUrl,\n };\n};\n\nconst asFromTokenUrlAndIssuer = (\n tokenUrl: string,\n issuerUrl: string | null | undefined,\n options: {\n readonly idTokenSigningAlgValuesSupported?: readonly string[];\n readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;\n } = {},\n): oauth.AuthorizationServer => {\n const as = asFromTokenUrl(tokenUrl, options.endpointUrlPolicy);\n const withIssuer = issuerUrl ? { ...as, issuer: issuerUrl } : as;\n return options.idTokenSigningAlgValuesSupported\n ? {\n ...withIssuer,\n id_token_signing_alg_values_supported: [...options.idTokenSigningAlgValuesSupported],\n }\n : withIssuer;\n};\n\nconst oauth4webapiRequestOptions = (\n targetUrl: string,\n timeoutMs: number | undefined,\n endpointUrlPolicy: OAuthEndpointUrlPolicy = {},\n): Record<string, unknown> => {\n const options: Record<string, unknown> = {\n signal: AbortSignal.timeout(timeoutMs ?? OAUTH2_DEFAULT_TIMEOUT_MS),\n };\n if (\n isLoopbackHttpUrl(targetUrl) ||\n (URL.canParse(targetUrl) &&\n new URL(targetUrl).protocol === \"http:\" &&\n endpointUrlPolicy.allowHttp === true)\n ) {\n (options as { [oauth.allowInsecureRequests]?: boolean })[oauth.allowInsecureRequests] = true;\n }\n return options;\n};\n\n// Select the token-endpoint client authentication. The secret's presence is the\n// EXPLICIT public-vs-confidential discriminator in the v2 model: a registered\n// client either has a secret (confidential — authenticate it) or has none\n// (public PKCE — `None()`, RFC 7636). This is not a silent guess: `loadClient`\n// persists a non-empty secret for confidential clients and null/\"\" for public\n// ones, so an absent secret here unambiguously means \"public client\". The\n// `method` only chooses HOW a present secret is sent (post vs basic).\nconst pickClientAuth = (\n clientSecret: string | null | undefined,\n method: ClientAuthMethod,\n): oauth.ClientAuth => {\n if (!clientSecret) return oauth.None();\n return method === \"basic\"\n ? oauth.ClientSecretBasic(clientSecret)\n : oauth.ClientSecretPost(clientSecret);\n};\n\nconst tokenResponseFrom = (r: oauth.TokenEndpointResponse): OAuth2TokenResponse => ({\n access_token: r.access_token,\n token_type: r.token_type,\n refresh_token: r.refresh_token,\n expires_in: typeof r.expires_in === \"number\" ? r.expires_in : undefined,\n scope: r.scope,\n});\n\n// MCP source connections are pure OAuth 2.0 — we never request `openid` and\n// never consume `id_token`. Some providers (PostHog, etc.) front an OIDC\n// backend and emit an `id_token` anyway; oauth4webapi then strict-validates\n// its claims against the AS metadata and rejects mismatches we don't care\n// about. Strip the field before delegation.\nconst stripIdToken = async (response: Response): Promise<Response> => {\n const body = await response\n .clone()\n .json()\n .then(\n (value: unknown) => value,\n () => null,\n );\n if (!body || typeof body !== \"object\" || !(\"id_token\" in (body as Record<string, unknown>))) {\n return response;\n }\n const { id_token: _ignored, ...rest } = body as Record<string, unknown>;\n return new Response(JSON.stringify(rest), {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n};\n\nconst processTokenEndpointResponse = async (\n as: oauth.AuthorizationServer,\n client: oauth.Client,\n response: Response,\n): Promise<OAuth2TokenResponse> =>\n tokenResponseFrom(\n await oauth.processGenericTokenEndpointResponse(as, client, await stripIdToken(response)),\n );\n\n// ---------------------------------------------------------------------------\n// Exchange authorization code → tokens\n// ---------------------------------------------------------------------------\n\nexport type ExchangeAuthorizationCodeInput = {\n readonly tokenUrl: string;\n readonly issuerUrl?: string | null;\n readonly clientId: string;\n readonly clientSecret?: string | null;\n readonly redirectUrl: string;\n readonly codeVerifier: string;\n readonly code: string;\n readonly clientAuth?: ClientAuthMethod;\n readonly idTokenSigningAlgValuesSupported?: readonly string[];\n /** RFC 8707 Resource Indicator. MCP Auth spec MUST-requires this on\n * the token request when the client knows the resource it intends\n * to call. */\n readonly resource?: string;\n readonly timeoutMs?: number;\n readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;\n};\n\nexport const exchangeAuthorizationCode = (\n input: ExchangeAuthorizationCodeInput,\n): Effect.Effect<OAuth2TokenResponse, OAuth2Error> =>\n Effect.tryPromise({\n try: async () => {\n const as = asFromTokenUrlAndIssuer(input.tokenUrl, input.issuerUrl, {\n idTokenSigningAlgValuesSupported: input.idTokenSigningAlgValuesSupported,\n endpointUrlPolicy: input.endpointUrlPolicy,\n });\n const client: oauth.Client = { client_id: input.clientId };\n const clientAuth = pickClientAuth(\n input.clientSecret,\n input.clientAuth ?? DEFAULT_CLIENT_AUTH_METHOD,\n );\n // `authorizationCodeGrantRequest` requires its `callbackParameters`\n // to have been returned from `validateAuthResponse`. Our public API\n // takes the `code` directly (the UI already validated `state` by\n // looking up the session), so skip the library's state-validation\n // rail and go through the generic grant request instead.\n const params = new URLSearchParams({\n code: input.code,\n redirect_uri: input.redirectUrl,\n code_verifier: input.codeVerifier,\n });\n if (input.resource) {\n params.set(\"resource\", input.resource);\n }\n const response = await oauth.genericTokenEndpointRequest(\n as,\n client,\n clientAuth,\n \"authorization_code\",\n params,\n oauth4webapiRequestOptions(input.tokenUrl, input.timeoutMs, input.endpointUrlPolicy),\n );\n return await processTokenEndpointResponse(as, client, response);\n },\n catch: (cause) => cause,\n }).pipe(Effect.catch(failOAuth2WithHttpSummary));\n\n// ---------------------------------------------------------------------------\n// Exchange client credentials → tokens (RFC 6749 §4.4)\n// ---------------------------------------------------------------------------\n\nexport type ExchangeClientCredentialsInput = {\n readonly tokenUrl: string;\n readonly clientId: string;\n readonly clientSecret: string;\n readonly scopes?: readonly string[];\n readonly scopeSeparator?: string;\n readonly clientAuth?: ClientAuthMethod;\n /** RFC 8707 Resource Indicator. MCP Authorization 2025-06-18 requires this\n * on token requests when the client knows the protected resource. */\n readonly resource?: string;\n readonly timeoutMs?: number;\n readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;\n};\n\nexport const exchangeClientCredentials = (\n input: ExchangeClientCredentialsInput,\n): Effect.Effect<OAuth2TokenResponse, OAuth2Error> =>\n Effect.tryPromise({\n try: async () => {\n const as = asFromTokenUrl(input.tokenUrl, input.endpointUrlPolicy);\n const client: oauth.Client = { client_id: input.clientId };\n const clientAuth = pickClientAuth(\n input.clientSecret,\n input.clientAuth ?? DEFAULT_CLIENT_AUTH_METHOD,\n );\n const params = new URLSearchParams();\n if (input.scopes && input.scopes.length > 0) {\n params.set(\"scope\", input.scopes.join(input.scopeSeparator ?? \" \"));\n }\n if (input.resource) {\n params.set(\"resource\", input.resource);\n }\n const response = await oauth.clientCredentialsGrantRequest(\n as,\n client,\n clientAuth,\n params,\n oauth4webapiRequestOptions(input.tokenUrl, input.timeoutMs, input.endpointUrlPolicy),\n );\n const result = await oauth.processClientCredentialsResponse(as, client, response);\n return tokenResponseFrom(result);\n },\n catch: (cause) => cause,\n }).pipe(Effect.catch(failOAuth2WithHttpSummary));\n\n// ---------------------------------------------------------------------------\n// Refresh access token\n// ---------------------------------------------------------------------------\n\nexport type RefreshAccessTokenInput = {\n readonly tokenUrl: string;\n readonly issuerUrl?: string | null;\n readonly clientId: string;\n readonly clientSecret?: string | null;\n readonly refreshToken: string;\n readonly scopes?: readonly string[];\n readonly scopeSeparator?: string;\n readonly clientAuth?: ClientAuthMethod;\n readonly idTokenSigningAlgValuesSupported?: readonly string[];\n /** RFC 8707 Resource Indicator — MCP spec MUST-requires this on\n * refresh requests so the new access token's audience is bound to\n * the same resource. */\n readonly resource?: string;\n readonly timeoutMs?: number;\n readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;\n};\n\nexport const refreshAccessToken = (\n input: RefreshAccessTokenInput,\n): Effect.Effect<OAuth2TokenResponse, OAuth2Error> =>\n Effect.tryPromise({\n try: async () => {\n const as = asFromTokenUrlAndIssuer(input.tokenUrl, input.issuerUrl, {\n idTokenSigningAlgValuesSupported: input.idTokenSigningAlgValuesSupported,\n endpointUrlPolicy: input.endpointUrlPolicy,\n });\n const client: oauth.Client = { client_id: input.clientId };\n const clientAuth = pickClientAuth(\n input.clientSecret,\n input.clientAuth ?? DEFAULT_CLIENT_AUTH_METHOD,\n );\n const extraParams = new URLSearchParams();\n if (input.scopes && input.scopes.length > 0) {\n extraParams.set(\"scope\", input.scopes.join(input.scopeSeparator ?? \" \"));\n }\n if (input.resource) {\n extraParams.set(\"resource\", input.resource);\n }\n const additionalParameters =\n Array.from(extraParams.keys()).length > 0 ? extraParams : undefined;\n const response = await oauth.refreshTokenGrantRequest(\n as,\n client,\n clientAuth,\n input.refreshToken,\n {\n ...oauth4webapiRequestOptions(input.tokenUrl, input.timeoutMs, input.endpointUrlPolicy),\n additionalParameters,\n },\n );\n const result = await oauth.processRefreshTokenResponse(\n as,\n client,\n await stripIdToken(response),\n );\n return tokenResponseFrom(result);\n },\n catch: (cause) => cause,\n }).pipe(Effect.catch(failOAuth2WithHttpSummary));\n\n// ---------------------------------------------------------------------------\n// Refresh-needed predicate\n// ---------------------------------------------------------------------------\n\nexport const shouldRefreshToken = (input: {\n readonly expiresAt: number | null;\n readonly now?: number;\n readonly skewMs?: number;\n}): boolean => {\n if (input.expiresAt === null) return false;\n const now = input.now ?? Date.now();\n const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS;\n return input.expiresAt <= now + skew;\n};\n"],"mappings":";AAkBA,SAAS,MAAM,QAAQ,iBAAiB;AACxC,YAAY,WAAW;AAMhB,IAAM,cAAN,cAA0B,KAAK,YAAY,aAAa,EAU5D;AAAC;AAmBG,IAAM,yBAAyB;AAG/B,IAAM,4BAA4B;AAMzC,IAAM,oBAAoB,CAAC,UAA2B;AACpD,MAAI,CAAC,IAAI,SAAS,KAAK,EAAG,QAAO;AACjC,QAAM,MA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WAAW,MAAM,SAAS;AACzD,UAAM,aAAa;AAAA,MACjB,MAAM;AAAA,MACN,MAAM,cAAc;AAAA,IACtB;AACA,UAAM,cAAc,IAAI,gBAAgB;AACxC,QAAI,MAAM,UAAU,MAAM,OAAO,SAAS,GAAG;AAC3C,kBAAY,IAAI,SAAS,MAAM,OAAO,KAAK,MAAM,kBAAkB,GAAG,CAAC;AAAA,IACzE;AACA,QAAI,MAAM,UAAU;AAClB,kBAAY,IAAI,YAAY,MAAM,QAAQ;AAAA,IAC5C;AACA,UAAM,uBACJ,MAAM,KAAK,YAAY,KAAK,CAAC,EAAE,SAAS,IAAI,cAAc;AAC5D,UAAM,WAAW,MAAY;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;AAAA,QACE,GAAG,2BAA2B,MAAM,UAAU,MAAM,WAAW,MAAM,iBAAiB;AAAA,QACtF;AAAA,MACF;AAAA,IACF;AACA,UAAM,SAAS,MAAY;AAAA,MACzB;AAAA,MACA;AAAA,MACA,MAAM,aAAa,QAAQ;AAAA,IAC7B;AACA,WAAO,kBAAkB,MAAM;AAAA,EACjC;AAAA,EACA,OAAO,CAAC,UAAU;AACpB,CAAC,EAAE,KAAK,OAAO,MAAM,yBAAyB,CAAC;AAM1C,IAAM,qBAAqB,CAAC,UAIpB;AACb,MAAI,MAAM,cAAc,KAAM,QAAO;AACrC,QAAM,MAAM,MAAM,OAAO,KAAK,IAAI;AAClC,QAAM,OAAO,MAAM,UAAU;AAC7B,SAAO,MAAM,aAAa,MAAM;AAClC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server-connection.ts","../src/oauth-popup-types.ts","../src/api-errors.ts"],"sourcesContent":["import { Option, Schema } from \"effect\";\n\nexport const DEFAULT_EXECUTOR_SERVER_ORIGIN = \"http://127.0.0.1:4000\";\nexport const DEFAULT_EXECUTOR_SERVER_USERNAME = \"executor\";\n\nexport type ExecutorServerConnectionKind = \"http\" | \"desktop-sidecar\";\nexport type ExecutorLocalServerKind = \"cli-daemon\" | \"desktop-sidecar\" | \"foreground\";\n\nexport type ExecutorServerAuth =\n | {\n readonly kind: \"basic\";\n readonly username?: string;\n readonly password: string;\n }\n | {\n readonly kind: \"bearer\";\n readonly token: string;\n };\n\nexport interface ExecutorServerConnection {\n readonly kind: ExecutorServerConnectionKind;\n readonly key: string;\n readonly origin: string;\n readonly apiBaseUrl: string;\n readonly displayName: string;\n readonly auth?: ExecutorServerAuth;\n}\n\nexport interface ExecutorServerConnectionInput {\n readonly kind?: ExecutorServerConnectionKind;\n readonly key?: string;\n readonly origin?: string;\n readonly apiBaseUrl?: string;\n readonly displayName?: string;\n readonly auth?: ExecutorServerAuth;\n}\n\nexport interface ExecutorLocalServerManifest {\n readonly version: 1;\n readonly kind: ExecutorLocalServerKind;\n readonly pid: number;\n readonly startedAt: string;\n readonly dataDir: string;\n readonly scopeDir: string | null;\n readonly connection: ExecutorServerConnection;\n readonly owner: {\n readonly client: \"cli\" | \"desktop\";\n readonly version: string | null;\n readonly executablePath: string | null;\n };\n}\n\nconst stripTrailingSlash = (value: string): string => value.replace(/\\/+$/, \"\");\n\nconst displayNameFromOrigin = (origin: string): string =>\n origin.replace(/^https?:\\/\\//, \"\").replace(/\\/+$/, \"\");\n\nexport const normalizeExecutorServerOrigin = (raw: string): string => {\n const trimmed = stripTrailingSlash(raw.trim());\n if (!trimmed) return DEFAULT_EXECUTOR_SERVER_ORIGIN;\n\n const parsed = new URL(/^https?:\\/\\//.test(trimmed) ? trimmed : `http://${trimmed}`);\n if (parsed.pathname === \"/api\") {\n parsed.pathname = \"/\";\n }\n parsed.search = \"\";\n parsed.hash = \"\";\n return stripTrailingSlash(parsed.toString());\n};\n\nexport const apiBaseUrlForServerOrigin = (origin: string): string => `${origin}/api`;\n\nexport const originFromApiBaseUrl = (raw: string): string => {\n const parsed = new URL(raw);\n if (parsed.pathname.endsWith(\"/api\")) {\n parsed.pathname = parsed.pathname.slice(0, -\"/api\".length) || \"/\";\n }\n parsed.search = \"\";\n parsed.hash = \"\";\n return normalizeExecutorServerOrigin(parsed.toString());\n};\n\nexport const normalizeExecutorServerConnection = (\n input: ExecutorServerConnectionInput = {},\n): ExecutorServerConnection => {\n const origin = normalizeExecutorServerOrigin(\n input.origin ??\n (input.apiBaseUrl ? originFromApiBaseUrl(input.apiBaseUrl) : DEFAULT_EXECUTOR_SERVER_ORIGIN),\n );\n const apiBaseUrl = stripTrailingSlash(input.apiBaseUrl ?? apiBaseUrlForServerOrigin(origin));\n const kind = input.kind ?? \"http\";\n\n return {\n kind,\n key: input.key ?? `${kind}:${origin}`,\n origin,\n apiBaseUrl,\n displayName: input.displayName ?? displayNameFromOrigin(origin),\n ...(input.auth ? { auth: input.auth } : {}),\n };\n};\n\nconst encodeBasicCredentials = (credentials: string): string | null => {\n if (typeof globalThis.btoa === \"function\") {\n return globalThis.btoa(credentials);\n }\n\n const buffer = (\n globalThis as {\n readonly Buffer?: {\n readonly from: (value: string) => { readonly toString: (encoding: \"base64\") => string };\n };\n }\n ).Buffer;\n if (buffer) {\n return buffer.from(credentials).toString(\"base64\");\n }\n\n return null;\n};\n\nexport const getExecutorServerAuthorizationHeader = (\n connection: ExecutorServerConnection,\n): string | null => {\n const auth = connection.auth;\n if (!auth) return null;\n if (auth.kind === \"bearer\") return `Bearer ${auth.token}`;\n const encoded = encodeBasicCredentials(\n `${auth.username ?? DEFAULT_EXECUTOR_SERVER_USERNAME}:${auth.password}`,\n );\n return encoded ? `Basic ${encoded}` : null;\n};\n\nconst ExecutorServerAuthJson = Schema.Union([\n Schema.Struct({\n kind: Schema.Literal(\"basic\"),\n username: Schema.optional(Schema.String),\n password: Schema.String,\n }),\n Schema.Struct({\n kind: Schema.Literal(\"bearer\"),\n token: Schema.String,\n }),\n]);\n\nconst ExecutorServerConnectionJson = Schema.Struct({\n kind: Schema.optional(Schema.Literals([\"http\", \"desktop-sidecar\"])),\n key: Schema.optional(Schema.String),\n origin: Schema.String,\n apiBaseUrl: Schema.optional(Schema.String),\n displayName: Schema.optional(Schema.String),\n auth: Schema.optional(ExecutorServerAuthJson),\n});\n\nconst ExecutorLocalServerManifestJson = Schema.Struct({\n version: Schema.Literal(1),\n kind: Schema.Literals([\"cli-daemon\", \"desktop-sidecar\", \"foreground\"]),\n pid: Schema.Number,\n startedAt: Schema.String,\n dataDir: Schema.String,\n scopeDir: Schema.NullOr(Schema.String),\n connection: ExecutorServerConnectionJson,\n owner: Schema.Struct({\n client: Schema.Literals([\"cli\", \"desktop\"]),\n version: Schema.NullOr(Schema.String),\n executablePath: Schema.NullOr(Schema.String),\n }),\n});\n\nconst decodeUnknownJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);\nconst decodeExecutorLocalServerManifestJson = Schema.decodeUnknownOption(\n ExecutorLocalServerManifestJson,\n);\n\nconst canNormalizeServerOrigin = (origin: string): boolean => {\n const trimmed = stripTrailingSlash(origin.trim());\n if (!trimmed) return true;\n return URL.canParse(/^https?:\\/\\//.test(trimmed) ? trimmed : `http://${trimmed}`);\n};\n\nexport const parseExecutorLocalServerManifest = (\n raw: string,\n): ExecutorLocalServerManifest | null => {\n const json = decodeUnknownJsonOption(raw);\n if (Option.isNone(json)) return null;\n const decoded = decodeExecutorLocalServerManifestJson(json.value);\n if (Option.isNone(decoded)) return null;\n const parsed = decoded.value;\n if (\n !Number.isInteger(parsed.pid) ||\n parsed.pid <= 0 ||\n !canNormalizeServerOrigin(parsed.connection.origin)\n ) {\n return null;\n }\n\n const connection = normalizeExecutorServerConnection(parsed.connection);\n return {\n version: 1,\n kind: parsed.kind,\n pid: parsed.pid,\n startedAt: parsed.startedAt,\n dataDir: parsed.dataDir,\n scopeDir: parsed.scopeDir,\n connection,\n owner: {\n client: parsed.owner.client,\n version: parsed.owner.version,\n executablePath: parsed.owner.executablePath,\n },\n };\n};\n\nexport const serializeExecutorLocalServerManifest = (\n manifest: ExecutorLocalServerManifest,\n): string => `${JSON.stringify(manifest, null, 2)}\\n`;\n","// ---------------------------------------------------------------------------\n// OAuth popup result — the message shape exchanged between the popup window\n// (opened during authorization) and the opener (the onboarding UI). Both the\n// server-side HTML generator and the client-side popup opener agree on this\n// shape so that success / failure can be communicated reliably via both\n// `postMessage` and `BroadcastChannel`.\n// ---------------------------------------------------------------------------\n\n/** Message type literal used to identify our popup results. */\nexport const OAUTH_POPUP_MESSAGE_TYPE = \"executor:oauth-result\" as const;\n\nexport type OAuthPopupResult<TAuth> =\n | ({\n readonly type: typeof OAUTH_POPUP_MESSAGE_TYPE;\n readonly ok: true;\n readonly sessionId: string;\n } & TAuth)\n | {\n readonly type: typeof OAUTH_POPUP_MESSAGE_TYPE;\n readonly ok: false;\n readonly sessionId: string | null;\n /** Short user-facing summary. */\n readonly error: string;\n /** Full technical detail. Omitted when identical to `error`. */\n readonly errorDetails?: string;\n };\n\nexport const isOAuthPopupResult = <TAuth>(value: unknown): value is OAuthPopupResult<TAuth> =>\n typeof value === \"object\" &&\n value !== null &&\n (value as { type?: unknown }).type === OAUTH_POPUP_MESSAGE_TYPE;\n","// ---------------------------------------------------------------------------\n// Wire-level HTTP errors. Lives in the SDK so plugin `HttpApiGroup`\n// definitions (which sit on the SDK side of the dependency graph and\n// must stay publishable) can declare them without dragging in the\n// server-only `@executor-js/api` package. The HTTP edge in\n// `@executor-js/api` re-exports these and pairs them with the\n// translation/capture helpers used by handlers.\n// ---------------------------------------------------------------------------\n\nimport { Schema } from \"effect\";\n\n/** Public 500 surface. Opaque by schema — only `traceId` crosses the wire. */\nexport class InternalError extends Schema.TaggedErrorClass<InternalError>()(\n \"InternalError\",\n {\n /** Opaque correlation id for backend lookup (Sentry event id, log line, etc.). */\n traceId: Schema.String,\n },\n { httpApiStatus: 500 },\n) {}\n"],"mappings":";AAAA,SAAS,QAAQ,cAAc;AAExB,IAAM,iCAAiC;AACvC,IAAM,mCAAmC;AAiDhD,IAAM,qBAAqB,CAAC,UAA0B,MAAM,QAAQ,QAAQ,EAAE;AA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