@executor-js/sdk 1.5.11 → 1.5.13

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.
Files changed (42) hide show
  1. package/dist/{chunk-UKOTOKXM.js → chunk-6EED5LAL.js} +33 -1
  2. package/dist/{chunk-UKOTOKXM.js.map → chunk-6EED5LAL.js.map} +1 -1
  3. package/dist/{chunk-YPVKRUZV.js → chunk-WKKKHDH2.js} +554 -378
  4. package/dist/chunk-WKKKHDH2.js.map +1 -0
  5. package/dist/client.d.ts +26 -1
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +13 -3
  8. package/dist/client.js.map +1 -1
  9. package/dist/connection.d.ts +13 -0
  10. package/dist/connection.d.ts.map +1 -1
  11. package/dist/core-schema.d.ts +10 -2
  12. package/dist/core-schema.d.ts.map +1 -1
  13. package/dist/core-tools.d.ts.map +1 -1
  14. package/dist/core.js +10 -38
  15. package/dist/core.js.map +1 -1
  16. package/dist/elicitation.d.ts +1 -0
  17. package/dist/elicitation.d.ts.map +1 -1
  18. package/dist/errors.d.ts +9 -0
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/executor.d.ts +5 -1
  21. package/dist/executor.d.ts.map +1 -1
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +2 -2
  25. package/dist/integration.d.ts +8 -0
  26. package/dist/integration.d.ts.map +1 -1
  27. package/dist/plugin.d.ts +4 -1
  28. package/dist/plugin.d.ts.map +1 -1
  29. package/dist/promise.d.ts +1 -1
  30. package/dist/promise.d.ts.map +1 -1
  31. package/dist/public-origin.d.ts +35 -0
  32. package/dist/public-origin.d.ts.map +1 -0
  33. package/dist/public-origin.test.d.ts +2 -0
  34. package/dist/public-origin.test.d.ts.map +1 -0
  35. package/dist/shared.d.ts +1 -1
  36. package/dist/shared.d.ts.map +1 -1
  37. package/dist/shared.js +1 -1
  38. package/dist/testing.js +2 -2
  39. package/dist/tool-result.d.ts +18 -1
  40. package/dist/tool-result.d.ts.map +1 -1
  41. package/package.json +7 -1
  42. package/dist/chunk-YPVKRUZV.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -59,6 +59,19 @@ export interface IntegrationAccountHandoff {
59
59
  /** Non-secret connection label to prefill. */
60
60
  readonly label?: string;
61
61
  }
62
+ /** Outcome of applying an edit-sheet section's staged change. `summary` is
63
+ * toasted on success; `ok: false` keeps the sheet open (the section renders
64
+ * its own error inline). */
65
+ export type EditSheetApplyResult = {
66
+ readonly ok: true;
67
+ readonly summary: string | null;
68
+ } | {
69
+ readonly ok: false;
70
+ };
71
+ export interface EditSheetSectionProps {
72
+ readonly sourceId: string;
73
+ readonly onPendingChange?: (apply: (() => Promise<EditSheetApplyResult>) | null) => void;
74
+ }
62
75
  export interface IntegrationPlugin {
63
76
  /** Unique key matching the SDK plugin id (e.g. "openapi"). */
64
77
  readonly key: string;
@@ -74,10 +87,19 @@ export interface IntegrationPlugin {
74
87
  readonly initialPreset?: string;
75
88
  readonly initialNamespace?: string;
76
89
  }>;
77
- readonly edit: ComponentType<{
90
+ /** Legacy full-page edit surface. No host renders this anymore — plugin
91
+ * configuration lives in the integration Edit sheet via `editSheet`. */
92
+ readonly edit?: ComponentType<{
78
93
  readonly sourceId: string;
79
94
  readonly onSave: () => void;
80
95
  }>;
96
+ /** Plugin-owned configuration rendered inside the integration's Edit sheet,
97
+ * below the shared metadata fields (e.g. the OpenAPI spec-update controls).
98
+ * The sheet has ONE Save: the section stages its pending change locally and
99
+ * reports it through `onPendingChange` — a thunk that applies the staged
100
+ * change. Save runs the metadata update, then the staged apply; a failed
101
+ * apply keeps the sheet open with the section showing its own error. */
102
+ readonly editSheet?: ComponentType<EditSheetSectionProps>;
81
103
  readonly summary?: ComponentType<{
82
104
  readonly sourceId: string;
83
105
  readonly variant?: "badge" | "panel";
@@ -133,10 +155,13 @@ export interface CreatePluginAtomClientOptions {
133
155
  /** Optional dynamic Authorization header for hosts whose active
134
156
  * Executor Server Connection requires Basic or Bearer auth. */
135
157
  readonly authorizationHeader?: string | null | (() => string | null);
158
+ /** Optional dynamic request headers supplied by the host shell. */
159
+ readonly headers?: Readonly<Record<string, string | null | undefined>> | (() => Readonly<Record<string, string | null | undefined>>);
136
160
  }
137
161
  export interface PluginAtomClientRequestTransformOptions {
138
162
  readonly baseUrl?: () => string;
139
163
  readonly authorizationHeader?: string | null | (() => string | null);
164
+ readonly headers?: Readonly<Record<string, string | null | undefined>> | (() => Readonly<Record<string, string | null | undefined>>);
140
165
  }
141
166
  /** @internal */
142
167
  export declare const applyPluginAtomClientRequestTransform: (request: HttpClientRequest.HttpClientRequest, options: PluginAtomClientRequestTransformOptions) => HttpClientRequest.HttpClientRequest;
@@ -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,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAW5F,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CA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AAM,CAAC;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IACrE,QAAQ,CAAC,OAAO,CAAC,EACb,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GACnD,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,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 CHANGED
@@ -24,20 +24,30 @@ var applyPluginAtomClientRequestTransform = (request, options) => {
24
24
  if (authorization) {
25
25
  next = HttpClientRequest.setHeader(next, "authorization", authorization);
26
26
  }
27
+ const headers = typeof options.headers === "function" ? options.headers() : options.headers;
28
+ if (headers) {
29
+ for (const [name, value] of Object.entries(headers)) {
30
+ if (value !== void 0 && value !== null) {
31
+ next = HttpClientRequest.setHeader(next, name, value);
32
+ }
33
+ }
34
+ }
27
35
  return next;
28
36
  };
29
37
  var createPluginAtomClient = (group, options = {}) => {
30
- const { baseUrl = "/api", authorizationHeader } = options;
38
+ const { baseUrl = "/api", authorizationHeader, headers } = options;
31
39
  const pluginId = group.identifier;
32
40
  const bundle = HttpApi.make(`plugin-${pluginId}`).add(group);
33
41
  const getBaseUrl = typeof baseUrl === "function" ? baseUrl : null;
34
42
  const staticBaseUrl = typeof baseUrl === "function" ? void 0 : baseUrl;
35
43
  const getAuthorizationHeader = typeof authorizationHeader === "function" ? authorizationHeader : null;
36
44
  const hasAuthorization = authorizationHeader !== void 0 && authorizationHeader !== null;
37
- const transformClient = getBaseUrl || hasAuthorization ? HttpClient.mapRequest(
45
+ const hasHeaders = headers !== void 0;
46
+ const transformClient = getBaseUrl || hasAuthorization || hasHeaders ? HttpClient.mapRequest(
38
47
  (request) => applyPluginAtomClientRequestTransform(request, {
39
48
  ...getBaseUrl ? { baseUrl: getBaseUrl } : {},
40
- ...getAuthorizationHeader ? { authorizationHeader: getAuthorizationHeader } : authorizationHeader !== void 0 ? { authorizationHeader } : {}
49
+ ...getAuthorizationHeader ? { authorizationHeader: getAuthorizationHeader } : authorizationHeader !== void 0 ? { authorizationHeader } : {},
50
+ ...headers !== void 0 ? { headers } : {}
41
51
  })
42
52
  ) : void 0;
43
53
  return AtomHttpApi.Service()(`Plugin_${pluginId}Client`, {
@@ -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\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 readonly edit: ComponentType<{\n readonly sourceId: string;\n readonly onSave: () => void;\n }>;\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}\n\nexport interface PluginAtomClientRequestTransformOptions {\n readonly baseUrl?: () => string;\n readonly authorizationHeader?: string | null | (() => string | null);\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 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 } = 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 transformClient =\n getBaseUrl || hasAuthorization\n ? HttpClient.mapRequest((request) =>\n applyPluginAtomClientRequestTransform(request, {\n ...(getBaseUrl ? { baseUrl: getBaseUrl } : {}),\n ...(getAuthorizationHeader\n ? { authorizationHeader: getAuthorizationHeader }\n : authorizationHeader !== undefined\n ? { authorizationHeader }\n : {}),\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;AA0JhE,IAAM,qBAAqB,CAChC,SAC0B;AAkCrB,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,SAAO;AACT;AAaO,IAAM,yBAAyB,CAGpC,OACA,UAAyC,CAAC,MACvC;AACH,QAAM,EAAE,UAAU,QAAQ,oBAAoB,IAAI;AAClD,QAAM,WAAW,MAAM;AACvB,QAAM,SAAS,QAAQ,KAAK,UAAU,QAAQ,EAAE,EAAE,IAAI,KAAK;AAC3D,QAAM,aAAa,OAAO,YAAY,aAAa,UAAU;AAC7D,QAAM,gBAAgB,OAAO,YAAY,aAAa,SAAY;AAClE,QAAM,yBACJ,OAAO,wBAAwB,aAAa,sBAAsB;AACpE,QAAM,mBAAmB,wBAAwB,UAAa,wBAAwB;AACtF,QAAM,kBACJ,cAAc,mBACV,WAAW;AAAA,IAAW,CAAC,YACrB,sCAAsC,SAAS;AAAA,MAC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AAM,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}\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,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,SAAS,QAAQ,KAAK,UAAU,QAAQ,EAAE,EAAE,IAAI,KAAK;AAC3D,QAAM,aAAa,OAAO,YAAY,aAAa,UAA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AG,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"]}
@@ -14,6 +14,11 @@ export interface Connection {
14
14
  readonly address: ConnectionAddress;
15
15
  /** Optional human label (which account). Not load-bearing. */
16
16
  readonly identityLabel?: string | null;
17
+ /** User-curated description of what this connection is for. Agent-visible:
18
+ * surfaces next to the connection's prefix in the execute-tool inventory
19
+ * and in `connections.list`, so it is the place to give agents context a
20
+ * spec can't (e.g. "the staging CRM — reads only"). */
21
+ readonly description?: string | null;
17
22
  /** Epoch ms when an OAuth access token expires; null/absent for static creds. */
18
23
  readonly expiresAt?: number | null;
19
24
  /** The OAuth app (`oauth_client` slug) that minted this connection, when it
@@ -77,5 +82,13 @@ export type CreateConnectionInput = {
77
82
  readonly integration: IntegrationSlug;
78
83
  readonly template: AuthTemplateSlug;
79
84
  readonly identityLabel?: string | null;
85
+ readonly description?: string | null;
80
86
  } & ConnectionValueInput;
87
+ /** Edit a connection's user-curated metadata. Only the provided fields change;
88
+ * credentials and OAuth lifecycle are untouchable here (recreate or refresh
89
+ * instead). */
90
+ export interface UpdateConnectionInput {
91
+ readonly description?: string | null;
92
+ readonly identityLabel?: string | null;
93
+ }
81
94
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO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AC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAA;KAAE,CAAA;CAAE,GAClF;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;CAAE,CAAC;AAE/D;;6BAE6B;AAC7B,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,GAAG,oBAAoB,CAAC;AAEzB;;gBAEgB;AAChB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC"}
@@ -13,8 +13,10 @@ export declare const coreTables: {
13
13
  readonly integration: import("@executor-js/fumadb/schema").Table<{
14
14
  readonly slug: import("@executor-js/fumadb/schema").Column<"varchar(255)", string, string>;
15
15
  readonly plugin_id: import("@executor-js/fumadb/schema").Column<"string", string, string>;
16
- readonly description: import("@executor-js/fumadb/schema").Column<"string", string, string>;
16
+ readonly name: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
17
+ readonly description: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
17
18
  readonly config: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
19
+ readonly config_revised_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
18
20
  readonly can_remove: import("@executor-js/fumadb/schema").Column<"bool", boolean | null, boolean>;
19
21
  readonly can_refresh: import("@executor-js/fumadb/schema").Column<"bool", boolean | null, boolean>;
20
22
  readonly created_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
@@ -30,6 +32,8 @@ export declare const coreTables: {
30
32
  readonly provider: import("@executor-js/fumadb/schema").Column<"string", string, string>;
31
33
  readonly item_ids: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
32
34
  readonly identity_label: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
35
+ readonly description: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
36
+ readonly tools_synced_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
33
37
  readonly oauth_client: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
34
38
  readonly oauth_client_owner: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
35
39
  readonly refresh_item_id: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
@@ -148,8 +152,10 @@ export declare const coreSchema: {
148
152
  readonly integration: import("@executor-js/fumadb/schema").Table<{
149
153
  readonly slug: import("@executor-js/fumadb/schema").Column<"varchar(255)", string, string>;
150
154
  readonly plugin_id: import("@executor-js/fumadb/schema").Column<"string", string, string>;
151
- readonly description: import("@executor-js/fumadb/schema").Column<"string", string, string>;
155
+ readonly name: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
156
+ readonly description: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
152
157
  readonly config: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
158
+ readonly config_revised_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
153
159
  readonly can_remove: import("@executor-js/fumadb/schema").Column<"bool", boolean | null, boolean>;
154
160
  readonly can_refresh: import("@executor-js/fumadb/schema").Column<"bool", boolean | null, boolean>;
155
161
  readonly created_at: import("@executor-js/fumadb/schema").Column<"timestamp", Date, Date>;
@@ -165,6 +171,8 @@ export declare const coreSchema: {
165
171
  readonly provider: import("@executor-js/fumadb/schema").Column<"string", string, string>;
166
172
  readonly item_ids: import("@executor-js/fumadb/schema").Column<"json", unknown, unknown>;
167
173
  readonly identity_label: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
174
+ readonly description: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
175
+ readonly tools_synced_at: import("@executor-js/fumadb/schema").Column<"bigint", bigint | null, bigint | null>;
168
176
  readonly oauth_client: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
169
177
  readonly oauth_client_owner: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
170
178
  readonly refresh_item_id: import("@executor-js/fumadb/schema").Column<"string", string | null, string | null>;
@@ -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,M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OAAO,OAAO,KAAG,KAAK,IAAI,gBAC4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../src/core-tools.ts"],"names":[],"mappings":"AA4XA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,uMAgWzB,CAAC"}
1
+ {"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../src/core-tools.ts"],"names":[],"mappings":"AA8XA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,uMAgWzB,CAAC"}
package/dist/core.js CHANGED
@@ -19,7 +19,9 @@ import {
19
19
  ORG_SUBJECT,
20
20
  StorageError,
21
21
  TOOL_POLICY_ACTIONS,
22
+ ToolResult,
22
23
  UniqueViolationError,
24
+ annotateToolResultOutcome,
23
25
  bigintColumn,
24
26
  boolColumn,
25
27
  buildToolTypeScriptPreview,
@@ -35,6 +37,7 @@ import {
35
37
  executorUnscopedPolicyName,
36
38
  isStorageFailure,
37
39
  isToolPolicyAction,
40
+ isToolResult,
38
41
  jsonColumn,
39
42
  keyColumn,
40
43
  makeFumaBlobStore,
@@ -50,7 +53,7 @@ import {
50
53
  textColumn,
51
54
  tool,
52
55
  toolAddress
53
- } from "./chunk-YPVKRUZV.js";
56
+ } from "./chunk-WKKKHDH2.js";
54
57
  import {
55
58
  ConnectionNotFoundError,
56
59
  CredentialProviderNotRegisteredError,
@@ -79,7 +82,7 @@ import {
79
82
  effectivePolicyFromSorted,
80
83
  isValidPattern,
81
84
  matchPattern
82
- } from "./chunk-UKOTOKXM.js";
85
+ } from "./chunk-6EED5LAL.js";
83
86
  import "./chunk-EIHWBY6T.js";
84
87
  import {
85
88
  AuthTemplateSlug,
@@ -103,7 +106,7 @@ import {
103
106
  import "./chunk-7D4SUZUM.js";
104
107
 
105
108
  // src/index.ts
106
- import { Context, Effect as Effect3, Layer, Schema as Schema3, Data as Data2, Option as Option2 } from "effect";
109
+ import { Context, Effect as Effect3, Layer, Schema as Schema2, Data as Data2, Option as Option2 } from "effect";
107
110
  import {
108
111
  HttpApi,
109
112
  HttpApiBuilder,
@@ -141,38 +144,6 @@ var mergeAuthTemplates = (existing, incoming) => {
141
144
  return result;
142
145
  };
143
146
 
144
- // src/tool-result.ts
145
- import { Schema } from "effect";
146
- var ToolErrorSchema = Schema.Struct({
147
- code: Schema.String,
148
- message: Schema.String,
149
- status: Schema.optional(Schema.Number),
150
- details: Schema.optional(Schema.Unknown),
151
- retryable: Schema.optional(Schema.Boolean)
152
- });
153
- var ToolHttpMetaSchema = Schema.Struct({
154
- status: Schema.Number,
155
- headers: Schema.Record(Schema.String, Schema.String)
156
- });
157
- var ToolResult = {
158
- ok: (data, meta) => ({
159
- ok: true,
160
- data,
161
- ...meta?.http ? { http: meta.http } : {}
162
- }),
163
- fail: (error) => ({ ok: false, error })
164
- };
165
- var ToolResultSchema = Schema.Union([
166
- Schema.Struct({
167
- ok: Schema.Literal(true),
168
- data: Schema.Unknown,
169
- http: Schema.optional(ToolHttpMetaSchema)
170
- }),
171
- Schema.Struct({ ok: Schema.Literal(false), error: ToolErrorSchema })
172
- ]);
173
- var isUnknownToolResult = Schema.is(ToolResultSchema);
174
- var isToolResult = (value) => isUnknownToolResult(value);
175
-
176
147
  // src/sqlite-data-migrations.ts
177
148
  import { Data, Effect } from "effect";
178
149
  var DataMigrationError = class extends Data.TaggedError("DataMigrationError") {
@@ -226,8 +197,8 @@ var runSqliteDataMigrations = (client, migrations) => Effect.gen(function* () {
226
197
  });
227
198
 
228
199
  // src/sqlite-config-blob-migration.ts
229
- import { Effect as Effect2, Option, Schema as Schema2 } from "effect";
230
- var decodeJsonOption = Schema2.decodeUnknownOption(Schema2.UnknownFromJsonString);
200
+ import { Effect as Effect2, Option, Schema } from "effect";
201
+ var decodeJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);
231
202
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
232
203
  var runSqliteConfigBlobMigration = (client, options) => Effect2.gen(function* () {
233
204
  const execute2 = (stmt) => Effect2.tryPromise({
@@ -369,7 +340,7 @@ export {
369
340
  PolicyId,
370
341
  ProviderItemId,
371
342
  ProviderKey,
372
- Schema3 as Schema,
343
+ Schema2 as Schema,
373
344
  StorageError,
374
345
  Subject,
375
346
  TOOL_POLICY_ACTIONS,
@@ -384,6 +355,7 @@ export {
384
355
  ToolSchemaView,
385
356
  UniqueViolationError,
386
357
  UrlElicitation,
358
+ annotateToolResultOutcome,
387
359
  apiBaseUrlForServerOrigin,
388
360
  authToolFailure,
389
361
  bigintColumn,