@executor-js/sdk 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +21 -29
  2. package/dist/api-errors.d.ts +10 -0
  3. package/dist/api-errors.d.ts.map +1 -0
  4. package/dist/blob.d.ts.map +1 -1
  5. package/dist/chunk-6SQWMOM4.js +51 -0
  6. package/dist/chunk-6SQWMOM4.js.map +1 -0
  7. package/dist/chunk-FPV6KONN.js +78 -0
  8. package/dist/chunk-FPV6KONN.js.map +1 -0
  9. package/dist/chunk-VLVPSIQ4.js +5532 -0
  10. package/dist/chunk-VLVPSIQ4.js.map +1 -0
  11. package/dist/client.d.ts +132 -0
  12. package/dist/client.d.ts.map +1 -0
  13. package/dist/client.js +81 -0
  14. package/dist/client.js.map +1 -0
  15. package/dist/client.test.d.ts +2 -0
  16. package/dist/client.test.d.ts.map +1 -0
  17. package/dist/config.d.ts +17 -7
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/connections.d.ts +7 -0
  20. package/dist/connections.d.ts.map +1 -1
  21. package/dist/core-schema.d.ts +83 -3
  22. package/dist/core-schema.d.ts.map +1 -1
  23. package/dist/core.js +113 -50
  24. package/dist/core.js.map +1 -1
  25. package/dist/credential-bindings.d.ts +173 -0
  26. package/dist/credential-bindings.d.ts.map +1 -0
  27. package/dist/credential-bindings.test.d.ts +2 -0
  28. package/dist/credential-bindings.test.d.ts.map +1 -0
  29. package/dist/errors.d.ts +27 -5
  30. package/dist/errors.d.ts.map +1 -1
  31. package/dist/executor.d.ts +47 -13
  32. package/dist/executor.d.ts.map +1 -1
  33. package/dist/hosted-http-client.d.ts +17 -0
  34. package/dist/hosted-http-client.d.ts.map +1 -0
  35. package/dist/hosted-http-client.test.d.ts +2 -0
  36. package/dist/hosted-http-client.test.d.ts.map +1 -0
  37. package/dist/ids.d.ts +2 -0
  38. package/dist/ids.d.ts.map +1 -1
  39. package/dist/index.d.ts +17 -10
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +16 -18
  42. package/dist/index.js.map +1 -1
  43. package/dist/oauth-discovery.d.ts +19 -4
  44. package/dist/oauth-discovery.d.ts.map +1 -1
  45. package/dist/oauth-helpers.d.ts +21 -0
  46. package/dist/oauth-helpers.d.ts.map +1 -1
  47. package/dist/oauth-popup-types.d.ts.map +1 -1
  48. package/dist/oauth-service.d.ts +16 -5
  49. package/dist/oauth-service.d.ts.map +1 -1
  50. package/dist/oauth.d.ts +19 -16
  51. package/dist/oauth.d.ts.map +1 -1
  52. package/dist/oxlint-plugin-executor.test.d.ts +2 -0
  53. package/dist/oxlint-plugin-executor.test.d.ts.map +1 -0
  54. package/dist/plugin.d.ts +123 -22
  55. package/dist/plugin.d.ts.map +1 -1
  56. package/dist/policies.d.ts +10 -15
  57. package/dist/policies.d.ts.map +1 -1
  58. package/dist/promise-executor.d.ts.map +1 -1
  59. package/dist/promise.d.ts +5 -3
  60. package/dist/promise.d.ts.map +1 -1
  61. package/dist/schema-types.d.ts.map +1 -1
  62. package/dist/scoped-adapter.d.ts +17 -2
  63. package/dist/scoped-adapter.d.ts.map +1 -1
  64. package/dist/secrets.d.ts +12 -0
  65. package/dist/secrets.d.ts.map +1 -1
  66. package/dist/test-config.d.ts +10 -0
  67. package/dist/test-config.d.ts.map +1 -0
  68. package/dist/testing.d.ts +30 -8
  69. package/dist/testing.d.ts.map +1 -1
  70. package/dist/testing.js +56 -0
  71. package/dist/testing.js.map +1 -0
  72. package/dist/types.d.ts +11 -3
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/usage-visibility.test.d.ts +2 -0
  75. package/dist/usage-visibility.test.d.ts.map +1 -0
  76. package/dist/usages.d.ts +20 -0
  77. package/dist/usages.d.ts.map +1 -0
  78. package/package.json +36 -4
  79. package/dist/chunk-6LMMN2GP.js +0 -4396
  80. package/dist/chunk-6LMMN2GP.js.map +0 -1
@@ -0,0 +1,132 @@
1
+ import { createElement, type ComponentType, type ReactNode } from "react";
2
+ import type { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
+ import * as AtomHttpApi from "effect/unstable/reactivity/AtomHttpApi";
4
+ export { Schema } from "effect";
5
+ export { HttpApi, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
6
+ export * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
7
+ export * as Atom from "effect/unstable/reactivity/Atom";
8
+ export * as AtomHttpApi from "effect/unstable/reactivity/AtomHttpApi";
9
+ export { useAtomValue, useAtomSet, useAtomMount, useAtomRefresh } from "@effect/atom-react";
10
+ export interface PageDecl {
11
+ /** Path relative to the plugin's mount point, e.g. `/`, `/edit/$id`. */
12
+ readonly path: string;
13
+ readonly component: ComponentType;
14
+ /** Optional sidebar nav metadata — the host renders these alongside its
15
+ * own nav links. Omit to register a page without a nav entry. */
16
+ readonly nav?: {
17
+ readonly label: string;
18
+ readonly section?: string;
19
+ };
20
+ }
21
+ export interface WidgetProps {
22
+ readonly scopeId?: string;
23
+ }
24
+ export interface WidgetDecl {
25
+ readonly id: string;
26
+ readonly component: ComponentType<WidgetProps>;
27
+ readonly size?: "half" | "full";
28
+ }
29
+ /**
30
+ * Open record of host-defined slot components a plugin can fill. Slot
31
+ * names are part of the host UI contract — plugins opt in by registering
32
+ * a component for the slot they care about. Adding a slot is a host-side
33
+ * change; plugin authors don't define new slots.
34
+ */
35
+ export type SlotComponent = ComponentType<Record<string, unknown>>;
36
+ export interface SourcePreset {
37
+ /** Unique id (e.g. "stripe", "github-graphql"). */
38
+ readonly id: string;
39
+ readonly name: string;
40
+ readonly summary: string;
41
+ /** URL passed as `initialUrl` to the add form. Omit for presets that
42
+ * don't use a URL (e.g. stdio MCP presets). */
43
+ readonly url?: string;
44
+ /** Optional icon URL (favicon, logo). */
45
+ readonly icon?: string;
46
+ /** Shown in the top-level grid on the sources page when true. */
47
+ readonly featured?: boolean;
48
+ }
49
+ export interface SourcePlugin {
50
+ /** Unique key matching the SDK plugin id (e.g. "openapi"). */
51
+ readonly key: string;
52
+ readonly label: string;
53
+ readonly add: ComponentType<{
54
+ readonly onComplete: () => void;
55
+ readonly onCancel: () => void;
56
+ readonly initialUrl?: string;
57
+ readonly initialPreset?: string;
58
+ readonly initialNamespace?: string;
59
+ }>;
60
+ readonly edit: ComponentType<{
61
+ readonly sourceId: string;
62
+ readonly onSave: () => void;
63
+ }>;
64
+ readonly summary?: ComponentType<{
65
+ readonly sourceId: string;
66
+ readonly variant?: "badge" | "panel";
67
+ readonly onAction?: () => void;
68
+ }>;
69
+ readonly presets?: readonly SourcePreset[];
70
+ /** Trigger early download of the plugin's lazy component chunks (add/edit/etc.).
71
+ * Call from the host on intent (hover/focus) so the chunks land before the
72
+ * user navigates into the add page. Idempotent. */
73
+ readonly preload?: () => void;
74
+ }
75
+ export interface SecretProviderPlugin {
76
+ /** Unique key matching the SDK plugin id (e.g. "onepassword"). */
77
+ readonly key: string;
78
+ readonly label: string;
79
+ readonly settings: ComponentType<Record<string, never>>;
80
+ }
81
+ export interface ClientPluginSpec<TId extends string = string> {
82
+ readonly id: TId;
83
+ readonly pages?: readonly PageDecl[];
84
+ readonly widgets?: readonly WidgetDecl[];
85
+ readonly slots?: Record<string, SlotComponent>;
86
+ /** Source plugin contribution — populated by plugins that expose
87
+ * `kind` rows in the core `source` table (openapi, mcp, graphql,
88
+ * google-discovery). The host's sources page derives its provider
89
+ * list from the union of every loaded plugin's `sourcePlugin`. */
90
+ readonly sourcePlugin?: SourcePlugin;
91
+ /** Secret provider plugin contribution — populated by plugins that
92
+ * also ship a `secretProviders` (or related) server-side capability
93
+ * AND want to expose a settings card on the host's secrets page. */
94
+ readonly secretProviderPlugin?: SecretProviderPlugin;
95
+ }
96
+ /**
97
+ * Identity factory — returns the spec unchanged but pins the inferred
98
+ * literal type of `id` so the host can index plugin records by id with
99
+ * full autocomplete. Plugins export this as their package's default
100
+ * (or named) export from `./client`.
101
+ */
102
+ export declare const defineClientPlugin: <const TId extends string>(spec: ClientPluginSpec<TId>) => ClientPluginSpec<TId>;
103
+ export interface CreatePluginAtomClientOptions {
104
+ /** Override the base URL. Defaults to `/api` (host strips this prefix
105
+ * when forwarding to the Effect handler) — same convention as the
106
+ * core `ExecutorApiClient`. */
107
+ readonly baseUrl?: string | (() => string);
108
+ }
109
+ /**
110
+ * Build a typed reactive client for a plugin's HttpApiGroup.
111
+ *
112
+ * const FooClient = createPluginAtomClient(FooApi)
113
+ * export const fooThings = FooClient.query("foo", "listThings", { ... })
114
+ * export const fooSync = FooClient.mutation("foo", "syncThing")
115
+ *
116
+ * Each plugin gets a private service Tag (`Plugin_<id>Client`) keyed by
117
+ * the group's `identifier`, so multiple plugins coexist in the same
118
+ * React tree without colliding.
119
+ */
120
+ export declare const createPluginAtomClient: <G extends HttpApiGroup.HttpApiGroup<string, HttpApiEndpoint.Any, boolean>>(group: G, options?: CreatePluginAtomClientOptions) => AtomHttpApi.AtomHttpApiClient<`Plugin_${G["identifier"]}Client`, `Plugin_${string}Client`, G>;
121
+ export interface ExecutorPluginsProviderProps {
122
+ readonly plugins: readonly ClientPluginSpec[];
123
+ readonly children: ReactNode;
124
+ }
125
+ export declare function ExecutorPluginsProvider(props: ExecutorPluginsProviderProps): ReturnType<typeof createElement>;
126
+ /** Full list of loaded `ClientPluginSpec` values. */
127
+ export declare const useClientPlugins: () => readonly ClientPluginSpec[];
128
+ /** Source plugins extracted from `clientPlugins[].sourcePlugin`. */
129
+ export declare const useSourcePlugins: () => readonly SourcePlugin[];
130
+ /** Secret-provider plugins extracted from `clientPlugins[].secretProviderPlugin`. */
131
+ export declare const useSecretProviderPlugins: () => readonly SecretProviderPlugin[];
132
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +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,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CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,4BAA4B,GAClC,UAAU,CAAC,OAAO,aAAa,CAAC,CAkBlC;AAWD,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,QAAO,SAAS,gBAAgB,EAClB,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,QAAO,SAAS,YAAY,EACR,CAAC;AAElD,qFAAqF;AACrF,eAAO,MAAM,wBAAwB,QAAO,SAAS,oBAAoB,EACR,CAAC"}
package/dist/client.js ADDED
@@ -0,0 +1,81 @@
1
+ // src/client.ts
2
+ import {
3
+ createContext,
4
+ createElement,
5
+ useContext,
6
+ useEffect,
7
+ useMemo
8
+ } from "react";
9
+ import { HttpApi } from "effect/unstable/httpapi";
10
+ import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
11
+ import * as AtomHttpApi from "effect/unstable/reactivity/AtomHttpApi";
12
+ import { Schema } from "effect";
13
+ import { HttpApi as HttpApi2, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
14
+ import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
15
+ import * as Atom from "effect/unstable/reactivity/Atom";
16
+ import * as AtomHttpApi2 from "effect/unstable/reactivity/AtomHttpApi";
17
+ import { useAtomValue, useAtomSet, useAtomMount, useAtomRefresh } from "@effect/atom-react";
18
+ var defineClientPlugin = (spec) => spec;
19
+ var createPluginAtomClient = (group, options = {}) => {
20
+ const { baseUrl = "/api" } = options;
21
+ const pluginId = group.identifier;
22
+ const bundle = HttpApi.make(`plugin-${pluginId}`).add(group);
23
+ return AtomHttpApi.Service()(`Plugin_${pluginId}Client`, {
24
+ api: bundle,
25
+ httpClient: FetchHttpClient.layer,
26
+ ...typeof baseUrl === "function" ? {
27
+ transformClient: HttpClient.mapRequest(
28
+ (request) => HttpClientRequest.prependUrl(request, baseUrl())
29
+ )
30
+ } : { baseUrl }
31
+ });
32
+ };
33
+ var ExecutorPluginsContext = createContext(null);
34
+ ExecutorPluginsContext.displayName = "ExecutorPluginsContext";
35
+ function ExecutorPluginsProvider(props) {
36
+ const { plugins, children } = props;
37
+ const value = useMemo(
38
+ () => ({
39
+ plugins,
40
+ sourcePlugins: plugins.flatMap((p) => p.sourcePlugin ? [p.sourcePlugin] : []),
41
+ secretProviderPlugins: plugins.flatMap(
42
+ (p) => p.secretProviderPlugin ? [p.secretProviderPlugin] : []
43
+ )
44
+ }),
45
+ [plugins]
46
+ );
47
+ useEffect(() => {
48
+ for (const sp of value.sourcePlugins) sp.preload?.();
49
+ }, [value.sourcePlugins]);
50
+ return createElement(ExecutorPluginsContext.Provider, { value }, children);
51
+ }
52
+ var usePluginsCtx = (hookName) => {
53
+ const ctx = useContext(ExecutorPluginsContext);
54
+ if (!ctx) {
55
+ throw new Error(`${hookName} must be called inside an <ExecutorPluginsProvider>.`);
56
+ }
57
+ return ctx;
58
+ };
59
+ var useClientPlugins = () => usePluginsCtx("useClientPlugins").plugins;
60
+ var useSourcePlugins = () => usePluginsCtx("useSourcePlugins").sourcePlugins;
61
+ var useSecretProviderPlugins = () => usePluginsCtx("useSecretProviderPlugins").secretProviderPlugins;
62
+ export {
63
+ AsyncResult,
64
+ Atom,
65
+ AtomHttpApi2 as AtomHttpApi,
66
+ ExecutorPluginsProvider,
67
+ HttpApi2 as HttpApi,
68
+ HttpApiEndpoint,
69
+ HttpApiGroup,
70
+ Schema,
71
+ createPluginAtomClient,
72
+ defineClientPlugin,
73
+ useAtomMount,
74
+ useAtomRefresh,
75
+ useAtomSet,
76
+ useAtomValue,
77
+ useClientPlugins,
78
+ useSecretProviderPlugins,
79
+ useSourcePlugins
80
+ };
81
+ //# sourceMappingURL=client.js.map
@@ -0,0 +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// SourcePlugin / SourcePreset — UI contract for plugins that expose\n// \"sources\" (OpenAPI specs, MCP servers, GraphQL endpoints, etc.). The\n// host owns the source 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 `sourcePlugin`\n// alongside `pages`/`widgets`, and the host derives the union list\n// from `virtual:executor/plugins-client`.\n// ---------------------------------------------------------------------------\n\nexport interface SourcePreset {\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 /** Optional icon URL (favicon, logo). */\n readonly icon?: string;\n /** Shown in the top-level grid on the sources page when true. */\n readonly featured?: boolean;\n}\n\nexport interface SourcePlugin {\n /** Unique key matching the SDK plugin id (e.g. \"openapi\"). */\n readonly key: string;\n readonly label: string;\n readonly add: ComponentType<{\n readonly onComplete: () => 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 readonly presets?: readonly SourcePreset[];\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 /** Source plugin contribution — populated by plugins that expose\n * `kind` rows in the core `source` table (openapi, mcp, graphql,\n * google-discovery). The host's sources page derives its provider\n * list from the union of every loaded plugin's `sourcePlugin`. */\n readonly sourcePlugin?: SourcePlugin;\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}\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\" } = options;\n const pluginId = group.identifier;\n const bundle = HttpApi.make(`plugin-${pluginId}`).add(group);\n return AtomHttpApi.Service<`Plugin_${G[\"identifier\"]}Client`>()(`Plugin_${pluginId}Client`, {\n api: bundle,\n httpClient: FetchHttpClient.layer,\n ...(typeof baseUrl === \"function\"\n ? {\n transformClient: HttpClient.mapRequest((request) =>\n HttpClientRequest.prependUrl(request, baseUrl()),\n ),\n }\n : { baseUrl }),\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 (`useSourcePlugins` 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 sourcePlugins: readonly SourcePlugin[];\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 sourcePlugins: plugins.flatMap((p) => (p.sourcePlugin ? [p.sourcePlugin] : [])),\n secretProviderPlugins: plugins.flatMap((p) =>\n p.secretProviderPlugin ? [p.secretProviderPlugin] : [],\n ),\n }),\n [plugins],\n );\n // Kick off lazy chunk downloads for every source plugin once the host\n // mounts, so navigating into an add/edit page doesn't suspend.\n useEffect(() => {\n for (const sp of value.sourcePlugins) sp.preload?.();\n }, [value.sourcePlugins]);\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/** Source plugins extracted from `clientPlugins[].sourcePlugin`. */\nexport const useSourcePlugins = (): readonly SourcePlugin[] =>\n usePluginsCtx(\"useSourcePlugins\").sourcePlugins;\n\n/** Secret-provider plugins extracted from `clientPlugins[].secretProviderPlugin`. */\nexport const useSecretProviderPlugins = (): readonly SecretProviderPlugin[] =>\n usePluginsCtx(\"useSecretProviderPlugins\").secretProvider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,EACV;AAGA,YAAU,MAAM;AACd,eAAW,MAAM,MAAM,cAAe,IAAG,UAAU;AAAA,EACrD,GAAG,CAAC,MAAM,aAAa,CAAC;AACxB,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,mBAAmB,MAC9B,cAAc,kBAAkB,EAAE;AAG7B,IAAM,2BAA2B,MACtC,cAAc,0BAA0B,EAAE;","names":["HttpApi","AtomHttpApi"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../src/client.test.ts"],"names":[],"mappings":""}
package/dist/config.d.ts CHANGED
@@ -1,14 +1,24 @@
1
1
  import type { AnyPlugin } from "./plugin";
2
2
  export type ExecutorDialect = "pg" | "sqlite" | "mysql";
3
- export interface ExecutorCliConfig {
3
+ export type ExecutorPluginsFactory<TDeps extends object = object, TPlugins extends readonly AnyPlugin[] = readonly AnyPlugin[]> = (deps?: TDeps) => TPlugins;
4
+ export interface ExecutorCliConfig<TDeps extends object = object, TPlugins extends readonly AnyPlugin[] = readonly AnyPlugin[]> {
4
5
  readonly dialect: ExecutorDialect;
5
- readonly plugins: readonly AnyPlugin[];
6
+ readonly plugins: ExecutorPluginsFactory<TDeps, TPlugins>;
6
7
  }
7
8
  /**
8
- * Declare an executor config for the CLI to consume. The CLI imports
9
- * this file via jiti and reads `plugins` + `dialect` to generate the
10
- * drizzle schema. Plugin runtime credentials can be stubs only
11
- * `plugin.schema` is read.
9
+ * Declare an executor config. The CLI imports this file via jiti and
10
+ * reads `plugins` + `dialect` to generate the drizzle schema; the host
11
+ * runtime imports the same file to instantiate plugins. Plugin runtime
12
+ * credentials passed to the factory may be stubs from the CLI — only
13
+ * `plugin.schema` is read there.
14
+ *
15
+ * The `const TPlugins` modifier preserves the tuple-literal inference
16
+ * from the factory's return so per-plugin extension typing flows through
17
+ * (`ReturnType<typeof config.plugins>` keeps `[OpenApi, Mcp, ...]`).
18
+ *
19
+ * `TDeps` is inferred from the factory's parameter — apps annotate
20
+ * the destructure (e.g., `({ configFile }: { configFile?: ConfigFileSink })`)
21
+ * directly. No global module augmentation needed.
12
22
  */
13
- export declare const defineExecutorConfig: <const T extends ExecutorCliConfig>(config: T) => T;
23
+ export declare const defineExecutorConfig: <TDeps extends object, const TPlugins extends readonly AnyPlugin[]>(config: ExecutorCliConfig<TDeps, TPlugins>) => ExecutorCliConfig<TDeps, TPlugins>;
14
24
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,CAAC,CAAC,SAAS,iBAAiB,EACpE,QAAQ,CAAC,KACR,CAAW,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,sBAAsB,CAChC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE,IAC1D,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,QAAQ,CAAC;AAE/B,MAAM,WAAW,iBAAiB,CAChC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE;IAE5D,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;CAC3D;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EAE3C,QAAQ,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,KACzC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAW,CAAC"}
@@ -103,5 +103,12 @@ declare const UpdateConnectionTokensInput_base: Schema.Class<UpdateConnectionTok
103
103
  }>, {}>;
104
104
  export declare class UpdateConnectionTokensInput extends UpdateConnectionTokensInput_base {
105
105
  }
106
+ declare const RemoveConnectionInput_base: Schema.Class<RemoveConnectionInput, Schema.Struct<{
107
+ readonly id: Schema.brand<Schema.String, "ConnectionId">;
108
+ /** Scope id whose connection row and owned token secrets should be removed. */
109
+ readonly targetScope: Schema.brand<Schema.String, "ScopeId">;
110
+ }>, {}>;
111
+ export declare class RemoveConnectionInput extends RemoveConnectionInput_base {
112
+ }
106
113
  export {};
107
114
  //# sourceMappingURL=connections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../src/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,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AAC;CAAG;AASL,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACvD,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAaD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACzD;AAcD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,CACjB,KAAK,EAAE,sBAAsB,KAC1B,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;CACrE;;;;;;;;;;AASD,qBAAa,2BAA4B,SAAQ,gCAU/C;CAAG;;;IAMH,+EAA+E;;;AAJjF,qBAAa,qBAAsB,SAAQ,0BAMzC;CAAG"}
@@ -1,4 +1,5 @@
1
1
  import type { InferDBFieldsOutput } from "@executor-js/storage-core";
2
+ export declare const credentialBindingKinds: ["text", "secret", "connection"];
2
3
  export declare const coreSchema: {
3
4
  readonly source: {
4
5
  readonly fields: {
@@ -177,9 +178,8 @@ export declare const coreSchema: {
177
178
  readonly required: true;
178
179
  readonly index: true;
179
180
  };
180
- /** Routing key into `plugin.connectionProviders`. Typical shape
181
- * is `${pluginId}:${kind}` (e.g. `openapi:oauth2`, `mcp:oauth2`,
182
- * `google-discovery:google`). Mirrors `secret.provider`. */
181
+ /** Routing key into `plugin.connectionProviders`. OAuth2 connections
182
+ * use the shared `oauth2` provider. Mirrors `secret.provider`. */
183
183
  readonly provider: {
184
184
  readonly type: "string";
185
185
  readonly required: true;
@@ -279,6 +279,72 @@ export declare const coreSchema: {
279
279
  };
280
280
  };
281
281
  };
282
+ readonly credential_binding: {
283
+ readonly fields: {
284
+ readonly id: {
285
+ readonly type: "string";
286
+ readonly required: true;
287
+ };
288
+ readonly scope_id: {
289
+ readonly type: "string";
290
+ readonly required: true;
291
+ readonly index: true;
292
+ };
293
+ readonly plugin_id: {
294
+ readonly type: "string";
295
+ readonly required: true;
296
+ readonly index: true;
297
+ };
298
+ readonly source_id: {
299
+ readonly type: "string";
300
+ readonly required: true;
301
+ readonly index: true;
302
+ };
303
+ readonly source_scope_id: {
304
+ readonly type: "string";
305
+ readonly required: true;
306
+ readonly index: true;
307
+ };
308
+ readonly slot_key: {
309
+ readonly type: "string";
310
+ readonly required: true;
311
+ readonly index: true;
312
+ };
313
+ /** "text" | "secret" | "connection". */
314
+ readonly kind: {
315
+ readonly type: ["text", "secret", "connection"];
316
+ readonly required: true;
317
+ readonly index: true;
318
+ };
319
+ readonly text_value: {
320
+ readonly type: "string";
321
+ readonly required: false;
322
+ };
323
+ readonly secret_id: {
324
+ readonly type: "string";
325
+ readonly required: false;
326
+ readonly index: true;
327
+ };
328
+ readonly secret_scope_id: {
329
+ readonly type: "string";
330
+ readonly required: false;
331
+ readonly index: true;
332
+ };
333
+ readonly connection_id: {
334
+ readonly type: "string";
335
+ readonly required: false;
336
+ readonly index: true;
337
+ };
338
+ readonly created_at: {
339
+ readonly type: "date";
340
+ readonly required: true;
341
+ };
342
+ readonly updated_at: {
343
+ readonly type: "date";
344
+ readonly required: true;
345
+ };
346
+ };
347
+ };
282
348
  readonly tool_policy: {
283
349
  readonly fields: {
284
350
  readonly id: {
@@ -327,6 +393,19 @@ export type ToolRow = InferDBFieldsOutput<CoreSchema["tool"]["fields"]> & Record
327
393
  export type DefinitionRow = InferDBFieldsOutput<CoreSchema["definition"]["fields"]> & Record<string, unknown>;
328
394
  export type SecretRow = InferDBFieldsOutput<CoreSchema["secret"]["fields"]> & Record<string, unknown>;
329
395
  export type ConnectionRow = InferDBFieldsOutput<CoreSchema["connection"]["fields"]> & Record<string, unknown>;
396
+ type CredentialBindingRowFields = InferDBFieldsOutput<CoreSchema["credential_binding"]["fields"]>;
397
+ type CredentialBindingRowBase = Omit<CredentialBindingRowFields, "kind" | "text_value" | "secret_id" | "secret_scope_id" | "connection_id">;
398
+ export type CredentialBindingRow = CredentialBindingRowBase & ({
399
+ kind: "text";
400
+ text_value: string;
401
+ } | {
402
+ kind: "secret";
403
+ secret_id: string;
404
+ secret_scope_id?: string;
405
+ } | {
406
+ kind: "connection";
407
+ connection_id: string;
408
+ }) & Record<string, unknown>;
330
409
  export type ToolPolicyRow = InferDBFieldsOutput<CoreSchema["tool_policy"]["fields"]> & Record<string, unknown>;
331
410
  export type ToolPolicyAction = "approve" | "require_approval" | "block";
332
411
  export declare const TOOL_POLICY_ACTIONS: readonly ["approve", "require_approval", "block"];
@@ -369,4 +448,5 @@ export interface DefinitionsInput {
369
448
  readonly scope: string;
370
449
  readonly definitions: Record<string, unknown>;
371
450
  }
451
+ export {};
372
452
  //# sourceMappingURL=core-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-schema.d.ts","sourceRoot":"","sources":["../src/core-schema.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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