Skip to content

Commit dfe53ae

Browse files
committed
Remove executor jsonc source sync
1 parent e7e3283 commit dfe53ae

9 files changed

Lines changed: 41 additions & 552 deletions

File tree

apps/desktop/scripts/smoke-sidecar.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
*
88
* Flow:
99
* 1. Spin up a tiny local OpenAPI server (one operation, returns 42).
10-
* 2. Write a temp executor.jsonc that points at it as a source.
11-
* 3. Spawn the compiled `executor-sidecar` binary with EXECUTOR_PORT=0
10+
* 2. Spawn the compiled `executor-sidecar` binary with EXECUTOR_PORT=0
1211
* and parse the `EXECUTOR_READY:<port>` sentinel.
13-
* 4. Connect via MCP streamable HTTP, call the `execute` tool with code
14-
* that invokes the OpenAPI tool, assert the answer round-trips as 42.
12+
* 3. Connect via MCP streamable HTTP, call the `execute` tool with code
13+
* that registers and invokes the OpenAPI tool, assert the answer
14+
* round-trips as 42.
1515
*
1616
* Run after `bun ./scripts/build-sidecar.ts`. Exits non-zero on any
1717
* deviation so it can gate CI.
1818
*/
19-
import { mkdtemp, rm, writeFile } from "node:fs/promises";
19+
import { mkdtemp, rm } from "node:fs/promises";
2020
import { tmpdir } from "node:os";
2121
import { join, resolve } from "node:path";
2222
import { spawn, type Subprocess } from "bun";
@@ -182,18 +182,6 @@ const main = async () => {
182182
console.log(`[smoke-sidecar] scope: ${scopeDir}`);
183183
console.log(`[smoke-sidecar] openapi: ${openapi.origin}`);
184184

185-
const config = {
186-
sources: [
187-
{
188-
kind: "openapi",
189-
spec: `${openapi.origin}/openapi.json`,
190-
baseUrl: openapi.origin,
191-
namespace: "petstore",
192-
},
193-
],
194-
};
195-
await writeFile(join(scopeDir, "executor.jsonc"), JSON.stringify(config, null, 2));
196-
197185
const proc = spawn({
198186
cmd: [BINARY],
199187
env: {
@@ -241,9 +229,17 @@ const main = async () => {
241229
if (!hasExecute) fail(`MCP tools/list missing "execute": ${JSON.stringify(tools.tools)}`);
242230

243231
// Drive the running OpenAPI server through a multi-step orchestration
244-
// in one execute. Covers: array list response, path param dispatch, and
245-
// object responses — all going out over real HTTP from inside QuickJS.
232+
// in one execute. Covers: source registration, array list response, path
233+
// param dispatch, and object responses — all going out over real HTTP from
234+
// inside QuickJS.
246235
const code = `
236+
const scope = (await tools.executor.scopes.list({})).scopes[0].name;
237+
await tools.executor.openapi.addSource({
238+
scope,
239+
spec: ${JSON.stringify(`${openapi.origin}/openapi.json`)},
240+
baseUrl: ${JSON.stringify(openapi.origin)},
241+
namespace: "petstore",
242+
});
247243
const list = await tools.petstore.pets.listPets({});
248244
const fetched = await tools.petstore.pets.getPet({ petId: list[1].id });
249245
return {

apps/desktop/src/main/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import { SERVER_SETTINGS_USERNAME, type DesktopServerSettings } from "../shared/
2828

2929
// Pin userData to a friendly app-name-scoped dir BEFORE app.ready so every
3030
// Electron-side consumer (electron-store, electron-log, window-state) lands
31-
// at a predictable spot. User-mutable executor state (executor.jsonc,
32-
// data.db) is pinned separately to ~/.executor in main/sidecar.ts — that
33-
// path matches the CLI's default.
31+
// at a predictable spot. User-mutable executor state (data.db and the optional
32+
// executor.jsonc plugin manifest) is pinned separately to ~/.executor in
33+
// main/sidecar.ts — that path matches the CLI's default.
3434
app.setName("Executor");
3535
app.setPath("userData", join(app.getPath("appData"), "Executor"));
3636

apps/desktop/src/main/sidecar.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ export async function startSidecar(options: StartOptions = {}): Promise<SidecarC
7474
);
7575
}
7676

77-
// executor.jsonc and data.db go to ~/.executor — the same path the CLI's
78-
// `executor web` uses. Desktop and CLI share state on the same machine so
79-
// sources/secrets/policies set up in one show up in the other, and
80-
// user-facing commands like `executor mcp --scope ~/.executor` stay
81-
// copy-paste-friendly. Electron's userData (set in main/index.ts) is
82-
// still used for electron-store, electron-log, and window-state — those
83-
// stay app-scoped to avoid colliding with anything else under HOME.
77+
// data.db and the optional executor.jsonc plugin manifest live under
78+
// ~/.executor — the same path the CLI's `executor web` uses. Desktop and CLI
79+
// share state on the same machine so sources/secrets/policies set up in one
80+
// show up in the other, and user-facing commands like
81+
// `executor mcp --scope ~/.executor` stay copy-paste-friendly. Electron's
82+
// userData (set in main/index.ts) is still used for electron-store,
83+
// electron-log, and window-state — those stay app-scoped to avoid colliding
84+
// with anything else under HOME.
8485
const scopeDir = join(homedir(), ".executor");
8586
mkdirSync(scopeDir, { recursive: true });
8687

apps/local/executor.config.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineExecutorConfig } from "@executor-js/sdk";
2-
import type { ConfigFileSink } from "@executor-js/config";
32
import { openApiHttpPlugin } from "@executor-js/plugin-openapi/api";
43
import { mcpHttpPlugin } from "@executor-js/plugin-mcp/api";
54
import { googleDiscoveryHttpPlugin } from "@executor-js/plugin-google-discovery/api";
@@ -14,24 +13,19 @@ import { desktopSettingsPlugin } from "@executor-js/plugin-desktop-settings/serv
1413
//
1514
// Consumed by:
1615
// - the schema-gen CLI (reads `plugin.schema` only; calls `plugins({})`)
17-
// - the host runtime (calls `plugins({ configFile })` with a real sink)
16+
// - the host runtime
1817
//
19-
// `TDeps` is inferred from the factory parameter annotation directly.
2018
// First-party and third-party plugins use the same import-and-call flow.
2119
// ---------------------------------------------------------------------------
2220

23-
interface LocalPluginDeps {
24-
readonly configFile?: ConfigFileSink;
25-
}
26-
2721
export default defineExecutorConfig({
2822
dialect: "sqlite",
29-
plugins: ({ configFile }: LocalPluginDeps = {}) =>
23+
plugins: () =>
3024
[
31-
openApiHttpPlugin({ configFile }),
32-
mcpHttpPlugin({ dangerouslyAllowStdioMCP: true, configFile }),
25+
openApiHttpPlugin(),
26+
mcpHttpPlugin({ dangerouslyAllowStdioMCP: true }),
3327
googleDiscoveryHttpPlugin(),
34-
graphqlHttpPlugin({ configFile }),
28+
graphqlHttpPlugin(),
3529
keychainPlugin(),
3630
fileSecretsPlugin(),
3731
onepasswordHttpPlugin(),

apps/local/src/server/config-sync.boot.test.ts

Lines changed: 0 additions & 225 deletions
This file was deleted.

0 commit comments

Comments
 (0)