diff --git a/alias.ts b/alias.ts index 90c945255..6ce18ae2b 100644 --- a/alias.ts +++ b/alias.ts @@ -96,7 +96,6 @@ export const alias = { '@devframes/plugin-terminals': p('terminals/src/node/index.ts'), '@devframes/plugin-git': p('git/src/node/index.ts'), 'devframe/recipes/interactive-auth': r('devframe/src/recipes/interactive-auth.ts'), - 'devframe/recipes/common-rpc-functions': r('devframe/src/recipes/common-rpc-functions.ts'), 'devframe/client': r('devframe/src/client/index.ts'), 'devframe': r('devframe/src'), '@devframes/plugin-data-inspector/inject': p('data-inspector/src/inject/index.ts'), diff --git a/docs/content/1.guide/12.in-page-channel.md b/docs/content/1.guide/12.in-page-channel.md index 732bb6be8..d23a34352 100644 --- a/docs/content/1.guide/12.in-page-channel.md +++ b/docs/content/1.guide/12.in-page-channel.md @@ -66,7 +66,7 @@ Channel names are namespaced with the devframe id, like RPC ids. Function names The required `functions` option and optional `events` option declare every incoming name on the endpoint's protocol side; use `{}` for an empty direction. Functions require a `handler`. Events accept an optional `handler`, and `{}` registers an event for runtime subscriptions through `on()`. Handlers are contextually typed from the shared protocol and support Standard-Schema argument validation and `jsonSerializable` metadata. `defineChannelFunction` retains the named definition shape for lower-level authoring. -`call()` accepts names from `functions`, including actions returning `void` or `Promise`: callers can await completion and catch errors or timeouts. `emit()`, its deprecated alias `callEvent()`, and `on()` use the names declared in `events`. Function and event names have separate namespaces. +`call()` accepts names from `functions`, including actions returning `void` or `Promise`: callers can await completion and catch errors or timeouts. `emit()` and `on()` use the names declared in `events`. Function and event names have separate namespaces. ```ts import type { MyChannelProtocol } from '../shared/protocol' diff --git a/docs/content/1.guide/18.hub-initiate.md b/docs/content/1.guide/18.hub-initiate.md index bfbd648cf..3f4478ef6 100644 --- a/docs/content/1.guide/18.hub-initiate.md +++ b/docs/content/1.guide/18.hub-initiate.md @@ -82,7 +82,7 @@ Registrations are validated fail-fast: one module per type (`DF8108`), an existi The hub's **single Auth** is one gate at the shared transport for every mounted devframe, built-ins, and the MCP route; one handshake (OTP, magic link, or pre-shared token) unlocks the namespace; `auth: false` disables it for localhost. -The aggregate MCP route mounts through the `'auto'` default once any mounted devframe (or an agent-flagged hub command) exposes agent tools; `mcp: true` forces it on, `mcp: false` off. It has its own origin gate, independent of this RPC Auth: the mounted route trusts same-machine callers, and `mcp: { authorization }` adds an identity check when the hub is reachable beyond loopback. A mounted devframe's own `mcp` setting is ignored: the hub exposes one aggregate route over them all, and warns ([`DF8005`](/errors/DF8005)) when a devframe asks for MCP while the hub set `mcp: false`. +The aggregate MCP route mounts through the `'auto'` default once any mounted devframe (or an agent-flagged hub command) exposes agent tools; `mcp: true` forces it on, `mcp: false` off. It has its own origin gate, independent of this RPC Auth: the mounted route trusts same-machine callers, and `mcp: { authorization }` adds an identity check when the hub is reachable beyond loopback. The hub exposes one aggregate route over every mounted devframe's tools. ## Singular vs hub mounting diff --git a/docs/content/1.guide/6.client-assets.md b/docs/content/1.guide/6.client-assets.md index 24d64a631..baa6b47e2 100644 --- a/docs/content/1.guide/6.client-assets.md +++ b/docs/content/1.guide/6.client-assets.md @@ -29,7 +29,7 @@ export default defineDevframe({ devframe serves it with SPA fallback (unknown paths → `index.html`) and no-store dev caching. Build the SPA with a relative base (`vite: { base: './' }`); it reads its runtime base from `document.baseURI`. -The [`dev`](/adapters/dev), [`build`](/adapters/build), and [Vite](/frameworks/vite) adapters share `clientAssets`; the deprecated `cli.distDir` is a fallback when it's unset. +The [`dev`](/adapters/dev), [`build`](/adapters/build), and [Vite](/frameworks/vite) adapters all read `clientAssets`. ## Programmatic hosting from `setup` diff --git a/docs/content/2.adapters/3.dev.md b/docs/content/2.adapters/3.dev.md index 4e8234f4c..55296a987 100644 --- a/docs/content/2.adapters/3.dev.md +++ b/docs/content/2.adapters/3.dev.md @@ -27,7 +27,7 @@ Returns a `StartedServer`: origin, port, h3 app, WS server, RPC group, `close()` | `host` | `def.cli?.host ?? 'localhost'` | Bind host. | | `port` | resolved via `resolveDevServerPort` | Listen port. | | `flags` | `{}` | To `setup(ctx, { flags })`. | -| `distDir` | `def.clientAssets` (falls back to deprecated `def.cli?.distDir`) | SPA dist; unset = bridge mode. | +| `distDir` | `def.clientAssets` | SPA dist; unset = bridge mode. | | `basePath` | `resolveBasePath(def, 'standalone')` | Mount override. | | `app` | fresh h3 app | Mount onto. | | `openBrowser` | resolves from `flags.open` / `def.cli?.open` | `false` off; string opens a path. | diff --git a/docs/content/5.add-ons/1.devframes/4.a11y.md b/docs/content/5.add-ons/1.devframes/4.a11y.md index 30e425284..6ed566470 100644 --- a/docs/content/5.add-ons/1.devframes/4.a11y.md +++ b/docs/content/5.add-ons/1.devframes/4.a11y.md @@ -42,10 +42,10 @@ The hub serves the bundle same-origin and a client runtime imports it into the h A host can also mount the module itself, for example a Vite host via `/@fs/`: ```ts -import createA11yDevframe, { a11yPageScriptBundlePath } from '@devframes/plugin-a11y' +import createA11yDevframe, { a11yClientScriptBundlePath } from '@devframes/plugin-a11y' await ctx.install(createA11yDevframe(), { - dock: { clientScript: { importFrom: `/@fs/${a11yPageScriptBundlePath}` } }, + dock: { clientScript: { importFrom: `/@fs/${a11yClientScriptBundlePath}` } }, }) ``` diff --git a/docs/content/6.errors/DF8005.md b/docs/content/6.errors/DF8005.md deleted file mode 100644 index 67067d357..000000000 --- a/docs/content/6.errors/DF8005.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: 'DF8005: Devframe MCP Ignored While Hub MCP Is Off' -description: 'Devframe "{id}" requests an MCP route, but the hub''s aggregate MCP is off (`mcp: false`), so its tools are not exposed over MCP.' ---- - -## Message - -> Devframe "`{id}`" requests an MCP route, but the hub's aggregate MCP is off (`mcp: false`), so its tools are not exposed over MCP. - -## Cause - -A hub exposes **one aggregate MCP endpoint** over every mounted devframe (tool ids are already namespaced per plugin), so a mounted devframe's own `mcp` setting is ignored: the hub's own `mcp` governs the route. This warning fires when a mounted devframe's definition enables MCP through the deprecated `cli.mcp` field while the hub set `mcp: false`, so that devframe's tools are not reachable over MCP. - -## Example - -The hub below turned MCP off, but a mounted devframe's definition requests MCP: - -```ts -initHub({ - base: DEVFRAMES_HUB_BASE, - mcp: false, - devframes: [myDevframe], // myDevframe's definition requests MCP, so DF8005 -}) -``` - -## Fix - -- Drop `mcp: false` from `initHub`: the `'auto'` default mounts the aggregate route once agent tools exist, and `mcp: true` / `mcp: { authorization }` force or harden it. -- Or drop `mcp` from the mounted devframe to silence the warning; it has no effect inside a hub. - -## Source - -- [`packages/hub/src/node/assemble.ts`](https://github.com/devframes/devframe/blob/main/packages/hub/src/node/assemble.ts): `mountDevframes()` emits this while mounting each devframe when the hub turned MCP off but the devframe requests one. diff --git a/docs/content/6.errors/index.md b/docs/content/6.errors/index.md index b70aabb01..eee53bd30 100644 --- a/docs/content/6.errors/index.md +++ b/docs/content/6.errors/index.md @@ -97,7 +97,6 @@ Emitted by `@devframes/hub` while assembling and mounting the unified surface. | [DF8002](/errors/DF8002) | error | Both devframes and context Passed to initHub | | [DF8003](/errors/DF8003) | error | connectionMeta() Before Hub Instance Ready | | [DF8004](/errors/DF8004) | error | Devframe Id Is Not a Mountable URL Segment | -| [DF8005](/errors/DF8005) | warning | Devframe MCP Ignored While Hub MCP Is Off | ## Hub: docks & mounting (DF81xx) diff --git a/docs/content/7.migrations/1.migration-0.10.md b/docs/content/7.migrations/1.migration-0.10.md index 4ef2aca3a..3bb3a7dc9 100644 --- a/docs/content/7.migrations/1.migration-0.10.md +++ b/docs/content/7.migrations/1.migration-0.10.md @@ -43,3 +43,21 @@ npm install @devframes/agentic ``` Code that imported SDK types directly for devframe's MCP options no longer needs to: the full option surface is typed on `devframe/adapters/mcp` and `devframe/types` without any SDK types. + +## Removed deprecated APIs + +0.10 drops the symbols deprecated during the 0.9 line. Each has a drop-in replacement: + +| Removed | Use instead | +| ------- | ----------- | +| `cli.mcp` on a definition | Pass `mcp` to the host (`createCac` / `--mcp`, `createDevServer`, `initDevframe`, `initHub`) | +| `cli.distDir` on a definition | Top-level `clientAssets` on the definition | +| `resolveClientAssets` (from `devframe`) | Read `definition.clientAssets` directly | +| `createDevframeClientHost`, `DevframeClientHost`, `DevframeClientHostOptions` (`@devframes/hub/client`) | `createDevframeClientRuntime`, `DevframeClientRuntime`, `DevframeClientRuntimeOptions` | +| `coerceAgentPositionalArgs`, `AgentArgsFallback` (`devframe/internal`) | `toolInputToRpcArgs` / `toolInputToCommandArgs` | +| `openInEditor`, `openInFinder`, `commonRpcFunctions` (`devframe/recipes/common-rpc-functions`) | The [`@devframes/service-open`](/add-ons/services/open) wire service | +| `callEvent()` on an in-page channel | `emit()` | +| `a11yPageScriptBundlePath`, `a11yAgentBundlePath` (`@devframes/plugin-a11y`) | `a11yClientScriptBundlePath` | +| `AGENT_DISCOVERY_FILE`, `AgentDiscovery`, `DataInspectorAgent` (`@devframes/plugin-data-inspector/inject`) | `DISCOVERY_FILE`, `InjectDiscovery`, `DataInspectorEndpoint` | + +Dropping `cli.mcp` also removes the hub's `DF8005` warning: a hub's aggregate MCP route already covers every mounted devframe's tools, so a per-devframe MCP request no longer exists to conflict with it. diff --git a/docs/content/8.references/5.browser-api.md b/docs/content/8.references/5.browser-api.md index 38dc018e9..adee7668a 100644 --- a/docs/content/8.references/5.browser-api.md +++ b/docs/content/8.references/5.browser-api.md @@ -50,7 +50,7 @@ The values of `rpc.status`: [Handling connection and auth errors](/guide/client# The browser-only endpoint methods of the [in-page channel](/guide/in-page-channel). `emit()` sends to the opposite endpoint; `on()` handles events arriving from that endpoint. -`InPageChannelProtocol` separates `functions` and `events`. Each section has optional `pageScript` and `panel` maps naming the receiving direction. Endpoint options require a complete `functions` map with handlers; `events` is optional, and when provided can include optional handlers (use `{}` to declare an event without a handler for `channel.on()`). `call()` uses function names regardless of return type, while `emit()`, `callEvent()` (deprecated), and `on()` use event names. A function returning `void` or `Promise` remains an awaitable request/response call. +`InPageChannelProtocol` separates `functions` and `events`. Each section has optional `pageScript` and `panel` maps naming the receiving direction. Endpoint options require a complete `functions` map with handlers; `events` is optional, and when provided can include optional handlers (use `{}` to declare an event without a handler for `channel.on()`). `call()` uses function names regardless of return type, while `emit()` and `on()` use event names. A function returning `void` or `Promise` remains an awaitable request/response call. | Method or property | Page-script endpoint | Panel endpoint | |--------------------|-------------|-------| diff --git a/examples/demo-dock-client/src/node.ts b/examples/demo-dock-client/src/node.ts index 2fc9bf4e1..8454fb152 100644 --- a/examples/demo-dock-client/src/node.ts +++ b/examples/demo-dock-client/src/node.ts @@ -5,6 +5,6 @@ import { fileURLToPath } from 'node:url' * (`dist/bundle.mjs`, nanoevents inlined). A host without bare-specifier * resolution mounts this file's directory statically and passes the served * URL as the dock's `importFrom`, the same pattern as - * `@devframes/plugin-a11y`'s `a11yPageScriptBundlePath`. + * `@devframes/plugin-a11y`'s `a11yClientScriptBundlePath`. */ export const demoDockClientBundlePath: string = fileURLToPath(new URL('./bundle.mjs', import.meta.url)) diff --git a/knip.jsonc b/knip.jsonc index 44782507e..db19dee20 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -21,13 +21,7 @@ "ignoreIssues": { "plugins/*/src/node/index.ts": ["duplicates"], "plugins/*/src/index.ts": ["duplicates"], - "services/*/src/index.ts": ["duplicates"], - // Deprecated rename aliases (old name re-exported next to its canonical - // replacement, kept for back-compat until the next major): the terms-page - // renames left `createDevframeClientHost` → `createDevframeClientRuntime` - // and `AGENT_DISCOVERY_FILE` → `DISCOVERY_FILE` aliases behind. - "packages/hub/src/client/host.ts": ["duplicates"], - "plugins/data-inspector/src/inject/index.ts": ["duplicates"] + "services/*/src/index.ts": ["duplicates"] }, "workspaces": { ".": { @@ -142,7 +136,7 @@ "src/internal/index.ts", "src/node/index.ts", "src/node/{auth,hub-internals}/index.ts", - "src/recipes/{common-rpc-functions,interactive-auth}.ts", + "src/recipes/interactive-auth.ts", "src/rpc/{index,client,server}.ts", "src/rpc/dump/index.ts", "src/rpc/transports/{sse-client,sse-server,ws-bun,ws-deno,ws-client,ws-server}.ts", @@ -207,7 +201,7 @@ }, "plugins/inspect": { // The lockstep assets package is referenced only as a runtime string - // (`${pkg.name}--assets` in `cli.distDir`), never imported, so knip + // (`${pkg.name}--assets` in `clientAssets`), never imported, so knip // can't see the dev-only workspace link that makes it resolvable in // the monorepo. Repeat the `plugins/*` entry glob (a workspace config // replaces, not merges, it). @@ -225,7 +219,7 @@ "project": [] }, // Each plugin's lockstep `--assets` package is referenced only as a - // runtime string (`${pkg.name}--assets` in `cli.distDir`), never imported, + // runtime string (`${pkg.name}--assets` in `clientAssets`), never imported, // so knip can't see the dev-only workspace link. A workspace config // replaces (not merges) the `plugins/*` glob's `entry`, so repeat it. "plugins/og": { diff --git a/packages/agentic/src/connect/index.ts b/packages/agentic/src/connect/index.ts index c27bf0026..8db145c99 100644 --- a/packages/agentic/src/connect/index.ts +++ b/packages/agentic/src/connect/index.ts @@ -82,7 +82,7 @@ const INDEX_TOOL = toAgentToolName('devframe:connect:list-instances') const CALL_TOOL = toAgentToolName('devframe:connect:call-tool') const MCP_DISABLED_HINT - = 'This instance runs without an MCP route. Restart it with the --mcp flag (or set `cli.mcp: true` on its definition) to expose its tools, then list instances again.' + = 'This instance runs without an MCP route. Restart it with the --mcp flag to expose its tools, then list instances again.' const GATEWAY_TOOLS: Tool[] = [ { diff --git a/packages/devframe/package.json b/packages/devframe/package.json index e505fc6ee..728a5d7be 100644 --- a/packages/devframe/package.json +++ b/packages/devframe/package.json @@ -33,7 +33,6 @@ "./node": "./dist/node/index.mjs", "./node/auth": "./dist/node/auth.mjs", "./node/hub-internals": "./dist/node/hub-internals.mjs", - "./recipes/common-rpc-functions": "./dist/recipes/common-rpc-functions.mjs", "./recipes/interactive-auth": "./dist/recipes/interactive-auth.mjs", "./rpc": "./dist/rpc/index.mjs", "./rpc/client": "./dist/rpc/client.mjs", diff --git a/packages/devframe/src/adapters/_shared.ts b/packages/devframe/src/adapters/_shared.ts index 7c22a84ff..6d6a7e2e9 100644 --- a/packages/devframe/src/adapters/_shared.ts +++ b/packages/devframe/src/adapters/_shared.ts @@ -124,9 +124,8 @@ export async function loadAutoMcpAdapter( /** * Resolve the `mcp` entry a `__connection.json` should advertise for a dev - * server started with the given `mcp` option (falling back to `def.cli?.mcp`, - * exactly like `createDevServer`), or `undefined` when the route is - * disabled. `'auto'` (the omitted default) resolves at mount time against + * server started with the given `mcp` option, or `undefined` when the route + * is disabled. `'auto'` (the omitted default) resolves at mount time against * the live agent surface, so hand-rolled meta advertises it only for an * explicit setting; the adapters advertise the actually-mounted route * themselves. @@ -138,11 +137,10 @@ export async function loadAutoMcpAdapter( * same-server default). */ export function resolveMcpConnectionMeta( - def: DevframeDefinition, mcp: McpSetting | undefined, port?: number, ): ConnectionMeta['mcp'] { - const config = resolveMcpConfig(mcp ?? def.cli?.mcp) + const config = resolveMcpConfig(mcp) if (!config) return undefined const route = withoutLeadingSlash(config.path ?? DEVFRAME_MCP_ROUTE) diff --git a/packages/devframe/src/adapters/build.ts b/packages/devframe/src/adapters/build.ts index c5128643c..2e58d440e 100644 --- a/packages/devframe/src/adapters/build.ts +++ b/packages/devframe/src/adapters/build.ts @@ -8,7 +8,6 @@ import process from 'node:process' import { colors as c } from 'devframe/utils/colors' import { resolveStaticAssetsSource } from 'devframe/utils/remote-assets' import { resolve } from 'pathe' -import { resolveClientAssets } from '../client-assets' import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, @@ -25,9 +24,8 @@ export interface CreateBuildOptions { /** * Override the SPA dist to copy into `outDir`: a local directory or a * remote-assets declaration (materialized in full at build time). When - * omitted the adapter reads `devframe.clientAssets` (or the deprecated - * `devframe.cli?.distDir`); authors typically set this once on the - * definition itself. + * omitted the adapter reads `devframe.clientAssets`; authors typically set + * this once on the definition itself. */ distDir?: StaticAssetsSource /** @@ -61,7 +59,7 @@ export async function createBuild(d: DevframeDefinition, options: CreateBuildOpt throw diagnostics.DF0042({ id: d.id }) const outDir = resolve(options.outDir ?? 'dist-static') - const distSource = options.distDir ?? resolveClientAssets(d) + const distSource = options.distDir ?? d.clientAssets if (!distSource) throw new Error(`[devframe] createBuild: no client assets for "${d.id}". Set \`clientAssets\` on the definition or pass it as an option.`) diff --git a/packages/devframe/src/adapters/cac.ts b/packages/devframe/src/adapters/cac.ts index 82379df8b..52d209bb9 100644 --- a/packages/devframe/src/adapters/cac.ts +++ b/packages/devframe/src/adapters/cac.ts @@ -27,9 +27,8 @@ export interface CreateCacOptions { * Expose a route-based MCP server alongside the dev server, speaking the * MCP Streamable-HTTP transport at `__mcp`. Whether to expose MCP is * a hosting decision made at the CLI assembly stage, so it lives here rather - * than on the definition. When unset, falls back to the definition's - * deprecated `cli.mcp`, then to the `'auto'` default (mount once the agent - * surface is non-empty). See {@link McpSetting}. + * than on the definition. When unset, falls back to the `'auto'` default + * (mount once the agent surface is non-empty). See {@link McpSetting}. * * The `--mcp` / `--no-mcp` flags override this per run. */ @@ -82,8 +81,8 @@ export function createCac(d: DevframeDefinition, options: CreateCacOptions = {}) // Only `--mcp` is declared: CAC's `--no-*` auto-negation would inject a // `true` default, forcing the route on. Declaring just `--mcp` keeps the // tri-state: absent → `undefined` (falls through to `options.mcp`, then - // `cli.mcp`, then the `'auto'` default), `--mcp` → `true` (mount - // unconditionally), `--no-mcp` → `false` (handled by CAC's `--no-` prefix). + // the `'auto'` default), `--mcp` → `true` (mount unconditionally), + // `--no-mcp` → `false` (handled by CAC's `--no-` prefix). .option('--mcp', 'Force the MCP route on (use --no-mcp to disable; default mounts it once agent tools exist)') // Register typed flags from the definition ahead of `cli.configure` @@ -107,8 +106,8 @@ export function createCac(d: DevframeDefinition, options: CreateCacOptions = {}) const port = (flags.port as number | undefined) ?? await resolveDevServerPort(d, { host, defaultPort }) // `--mcp` / `--no-mcp` map to a boolean override; when neither is passed // CAC leaves `mcp` undefined so we fall back to the assembly-stage - // `options.mcp`, and `createDevServer` falls through to `def.cli?.mcp`, - // then to the `'auto'` default. + // `options.mcp`, and `createDevServer` falls through to the `'auto'` + // default. const mcp = (flags.mcp as boolean | undefined) ?? options.mcp await createDevServer(d, { host, diff --git a/packages/devframe/src/adapters/dev.ts b/packages/devframe/src/adapters/dev.ts index 0e02914a2..bc1fe6165 100644 --- a/packages/devframe/src/adapters/dev.ts +++ b/packages/devframe/src/adapters/dev.ts @@ -32,7 +32,7 @@ export interface CreateDevServerOptions { */ flags?: Record /** - * Override the definition's `clientAssets` (or deprecated `cli.distDir`). + * Override the definition's `clientAssets`. * When neither this option nor the definition's client assets are set, the * dev server runs in **bridge mode**: only `__connection.json` and the WS * endpoint are mounted; the SPA is expected to be hosted elsewhere (e.g. by @@ -92,9 +92,9 @@ export interface CreateDevServerOptions { auth?: boolean | DevframeAuthHandler /** * Expose a route-based MCP server on the dev server (Streamable-HTTP). - * Overrides `def.cli?.mcp`; `undefined` falls through to it, then to the - * `'auto'` default (mount once the agent surface is non-empty). `false` - * disables the route regardless. See {@link McpSetting}. + * `undefined` falls through to the `'auto'` default (mount once the agent + * surface is non-empty). `false` disables the route regardless. See + * {@link McpSetting}. */ mcp?: McpSetting /** diff --git a/packages/devframe/src/adapters/initiate.ts b/packages/devframe/src/adapters/initiate.ts index dd00e68be..71a3b7d22 100644 --- a/packages/devframe/src/adapters/initiate.ts +++ b/packages/devframe/src/adapters/initiate.ts @@ -16,7 +16,6 @@ import { mountStaticHandler } from 'devframe/utils/serve-static' import { H3 } from 'h3' import { resolve } from 'pathe' import { joinURL, withoutLeadingSlash } from 'ufo' -import { resolveClientAssets } from '../client-assets' import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_MCP_ROUTE } from '../constants' import { importAgenticMcp } from '../node/agentic' import { createHostContext } from '../node/context' @@ -37,8 +36,8 @@ export interface InitDevframeOptions { */ base: string /** - * Override the definition's `clientAssets` (or deprecated `cli.distDir`). - * When neither is set (or `false` is passed to suppress the definition's + * Override the definition's `clientAssets`. + * When it is unset (or `false` is passed to suppress the definition's * own client assets), the handler runs in **bridge mode**: only * `__connection.json`, the WS endpoint, and the MCP route (when enabled) are * served; the SPA is hosted elsewhere. @@ -91,9 +90,9 @@ export interface InitDevframeOptions { auth?: boolean | DevframeAuthHandler /** * Expose a route-based MCP server (Streamable-HTTP) at `__mcp` and - * advertise it in `__connection.json`. Overrides `def.cli?.mcp`; - * `undefined` falls through to it, then to the `'auto'` default (mount - * once the agent surface is non-empty). See {@link McpSetting}. + * advertise it in `__connection.json`. `undefined` falls through to the + * `'auto'` default (mount once the agent surface is non-empty). See + * {@link McpSetting}. */ mcp?: McpSetting /** @@ -255,7 +254,7 @@ export function initDevframe( options: InitDevframeOptions, ): DevframeInstance { const base = normalizeBasePath(options.base) - const distDir = options.distDir === false ? undefined : options.distDir ?? resolveClientAssets(def) + const distDir = options.distDir === false ? undefined : options.distDir ?? def.clientAssets const app = options.app ?? new H3() const host = options.host ?? def.cli?.host ?? 'localhost' @@ -307,7 +306,7 @@ export function initDevframe( await context.services.ready() await def.setup(context, setupInfo) - const mcp = await mountMcpRoute(app, context, def, base, options.mcp ?? def.cli?.mcp ?? 'auto') + const mcp = await mountMcpRoute(app, context, def, base, options.mcp ?? 'auto') return { context, diff --git a/packages/devframe/src/client-assets.ts b/packages/devframe/src/client-assets.ts deleted file mode 100644 index 12d8aae92..000000000 --- a/packages/devframe/src/client-assets.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { DevframeDefinition, StaticAssetsSource } from 'devframe/types' - -/** - * Resolve a definition's client assets source: the built SPA served as its - * UI. Prefers the top-level {@link DevframeDefinition.clientAssets} and falls - * back to the deprecated `cli.distDir`, so both the new and legacy shapes - * resolve. Returns `undefined` when neither is set (bridge mode, where the SPA is - * hosted elsewhere). - * - * Internal: exposed to first-party integrations via `devframe/internal`, not - * part of the stable public API. - */ -export function resolveClientAssets(d: DevframeDefinition): StaticAssetsSource | undefined { - return d.clientAssets ?? d.cli?.distDir -} diff --git a/packages/devframe/src/constants.ts b/packages/devframe/src/constants.ts index 4da1f2bfb..d688c9ccd 100644 --- a/packages/devframe/src/constants.ts +++ b/packages/devframe/src/constants.ts @@ -43,7 +43,8 @@ export const DEVFRAME_SSE_SESSION_HEADER = 'x-birpc-session' * Route the Streamable-HTTP MCP endpoint is bound to, relative to a * devframe's base path. Sits next to `__connection.json` and the WS route * so an MCP client reaches it on the same origin the SPA loaded from; the - * dev server shares one port for HTTP, WS, and MCP. Opt-in via `cli.mcp`. + * dev server shares one port for HTTP, WS, and MCP. Opt-in via the host's + * `mcp` setting. */ export const DEVFRAME_MCP_ROUTE = '__mcp' export const DEVFRAME_RPC_DUMP_MANIFEST_FILENAME = '__rpc-dump/index.json' diff --git a/packages/devframe/src/define.ts b/packages/devframe/src/define.ts index 401f71473..8bd2cc4ed 100644 --- a/packages/devframe/src/define.ts +++ b/packages/devframe/src/define.ts @@ -1,6 +1,5 @@ -import type { DevframeDefinition, DevframeNodeContext, StaticAssetsSource } from 'devframe/types' +import type { DevframeDefinition, DevframeNodeContext } from 'devframe/types' import { createDefineWrapperWithContext } from 'devframe/rpc' -import { resolveClientAssets as resolveClientAssetsInternal } from './client-assets' export const defineRpcFunction = createDefineWrapperWithContext() @@ -11,12 +10,3 @@ export const defineRpcFunction = createDefineWrapperWithContext { panel.emit('save', 'draft') // @ts-expect-error An asynchronous void action is still a function. panel.emit('reset') - // @ts-expect-error The deprecated alias has the same restriction. - panel.callEvent('save', 'draft') // @ts-expect-error A panel void action is still a function. pageScript.emit('save', 'draft') - // @ts-expect-error A panel asynchronous void action is still a function. - pageScript.callEvent('reset') // @ts-expect-error Functions cannot receive event listeners. pageScript.on('save', () => {}) // @ts-expect-error Functions cannot receive event listeners. diff --git a/packages/devframe/src/in-page-channel/page-script.ts b/packages/devframe/src/in-page-channel/page-script.ts index f00846c61..dbcab8205 100644 --- a/packages/devframe/src/in-page-channel/page-script.ts +++ b/packages/devframe/src/in-page-channel/page-script.ts @@ -201,7 +201,6 @@ export function createPageScriptChannel

( }, events: { on: events.on, once: events.once }, emit, - callEvent: emit, on: (fnName, listener) => registry.on(fnName, listener as (...args: unknown[]) => void), sharedState: stateHost, addPanelPort: port => addPeer(port, `transport:${nanoid(8)}`), diff --git a/packages/devframe/src/in-page-channel/panel.ts b/packages/devframe/src/in-page-channel/panel.ts index 559b63b35..c5d75ebc9 100644 --- a/packages/devframe/src/in-page-channel/panel.ts +++ b/packages/devframe/src/in-page-channel/panel.ts @@ -292,7 +292,6 @@ export function connectPanelChannel

( }, call: (fnName, ...args) => enqueueCall(channelMethod('function', fnName), serializeArgs(codec, args)) as Promise, emit: (fnName, ...args) => sendEvent(channelMethod('event', fnName), serializeArgs(codec, args)), - callEvent: (fnName, ...args) => sendEvent(channelMethod('event', fnName), serializeArgs(codec, args)), on: (fnName, listener) => registry.on(fnName, listener as (...args: unknown[]) => void), sharedState: stateHost, close: () => { diff --git a/packages/devframe/src/in-page-channel/types.test-d.ts b/packages/devframe/src/in-page-channel/types.test-d.ts index 16d718baa..3e0db4735 100644 --- a/packages/devframe/src/in-page-channel/types.test-d.ts +++ b/packages/devframe/src/in-page-channel/types.test-d.ts @@ -164,7 +164,6 @@ describe('In-page script channel', () => { describe('Function calling', () => { it('types fire-and-forget calls to panel functions', () => { expectTypeOf(channel.emit('notify', 'ready')).toEqualTypeOf() - expectTypeOf(channel.callEvent('notify', 'ready')).toEqualTypeOf() // @ts-expect-error In-page script functions cannot be called on panels. channel.emit('echo', 'ready') @@ -185,8 +184,6 @@ describe('In-page script channel', () => { mixedChannel.emit('notify', 'ready') // @ts-expect-error Queries cannot be emitted as events. mixedChannel.emit('confirm', 'continue?') - // @ts-expect-error The deprecated alias has the same event-only contract. - mixedChannel.callEvent('confirm', 'continue?') }) it('types calls to connected panels', () => { @@ -361,7 +358,6 @@ describe('Panel channel', () => { it('types fire-and-forget calls to in-page script functions', () => { expectTypeOf(channel.emit('save', 'draft')).toEqualTypeOf() - expectTypeOf(channel.callEvent('save', 'draft')).toEqualTypeOf() // @ts-expect-error Panel functions cannot be emitted to the in-page script. channel.emit('notify', 'hello') @@ -371,8 +367,6 @@ describe('Panel channel', () => { channel.emit('sum', 1, 2) // @ts-expect-error `save` requires a string. channel.emit('save', false) - // @ts-expect-error The deprecated alias has the same event-only contract. - channel.callEvent('echo', 'hello') }) it('types channel state', () => { diff --git a/packages/devframe/src/in-page-channel/types.ts b/packages/devframe/src/in-page-channel/types.ts index 39f51b893..5748c732d 100644 --- a/packages/devframe/src/in-page-channel/types.ts +++ b/packages/devframe/src/in-page-channel/types.ts @@ -355,11 +355,6 @@ export interface PageScriptChannel

{ name: K, ...args: FnArgs[K]> ) => void - /** @deprecated Use `emit()` instead. */ - callEvent: & string>( - name: K, - ...args: FnArgs[K]> - ) => void /** Subscribe to an event emitted by a panel. Returns an unsubscribe function. */ on: & string>( name: K, @@ -412,11 +407,6 @@ export interface PanelChannel

{ name: K, ...args: FnArgs[K]> ) => void - /** @deprecated Use `emit()` instead. */ - callEvent: & string>( - name: K, - ...args: FnArgs[K]> - ) => void /** Subscribe to an event emitted by the page script. Returns an unsubscribe function. */ on: & string>( name: K, diff --git a/packages/devframe/src/internal/index.ts b/packages/devframe/src/internal/index.ts index 8094d6ef3..c49ce87a7 100644 --- a/packages/devframe/src/internal/index.ts +++ b/packages/devframe/src/internal/index.ts @@ -29,11 +29,6 @@ // - `resolveBasePath` / `normalizeBasePath`: the mount-base resolution // `initDevframe` itself uses; a bridge (`@devframes/vite`) that mounts a // devframe onto a host it doesn't own reuses the exact same defaulting. -// - `resolveClientAssets`: the definition → static-assets-source -// resolution every UI-serving adapter uses (`clientAssets`, falling back to -// the legacy `cli.distDir`), so a bridge that serves a devframe's SPA itself -// (`@devframes/vite`, `@devframes/next`, the hub's `ctx.install`) resolves it -// identically. // - `diagnostics`: devframe core's structured diagnostics instance // (`DF00xx`), so a first-party integration built outside this package can // report against the same registered codes instead of minting its own. @@ -50,7 +45,6 @@ export { loadAutoMcpAdapter, normalizeBasePath, resolveBasePath, resolveMcpConfi export type { ResolvedMcpConfig } from '../adapters/_shared' export { formatMcpError, stringifyForMcp } from '../agent/stringify' export { argsToJsonSchema, returnToJsonSchema } from '../agent/to-json-schema' -export { resolveClientAssets } from '../client-assets' export { importAgenticMcp } from '../node/agentic' export type { AgenticMcpModule, MountedMcpHttp, MountMcpHttpOptions } from '../node/agentic' export { diagnostics } from '../node/diagnostics' @@ -75,5 +69,4 @@ export type { ContextRpcServer, CreateContextRpcServerOptions } from '../node/rp export { normalizeHttpServerUrl } from '../node/utils' export { createRpcWireCodec, peekRpcWireFrame } from '../rpc/wire-codec' export type { RpcWireCodec } from '../rpc/wire-codec' -export { coerceAgentPositionalArgs, toolInputToCommandArgs } from '../tool-input' -export type { AgentArgsFallback } from '../tool-input' +export { toolInputToCommandArgs } from '../tool-input' diff --git a/packages/devframe/src/node/diagnostics.ts b/packages/devframe/src/node/diagnostics.ts index ef2c8dea6..7a5b9a956 100644 --- a/packages/devframe/src/node/diagnostics.ts +++ b/packages/devframe/src/node/diagnostics.ts @@ -110,7 +110,7 @@ export const diagnostics = defineDiagnostics({ }, DF0051: { why: (p: { port: number }) => `The devframe instance on port ${p.port} has no MCP endpoint.`, - fix: 'Restart the instance with the --mcp flag (or set `cli.mcp: true` on its definition) to expose its tools, then list instances again.', + fix: 'Restart the instance with the --mcp flag to expose its tools, then list instances again.', }, DF0052: { why: (p: { host: string, port: number, reason: string }) => `Failed to listen on ${p.host}:${p.port}: ${p.reason}`, diff --git a/packages/devframe/src/recipes/__tests__/common-rpc-functions.test.ts b/packages/devframe/src/recipes/__tests__/common-rpc-functions.test.ts deleted file mode 100644 index 9057c4344..000000000 --- a/packages/devframe/src/recipes/__tests__/common-rpc-functions.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { StandardSchemaV1 } from '@standard-schema/spec' -import { describe, expect, it } from 'vitest' -import { commonRpcFunctions, KNOWN_EDITORS, openInEditor, openInFinder } from '../common-rpc-functions' - -/** Synchronously check whether a value satisfies a Standard Schema. */ -function accepts(schema: StandardSchemaV1, value: unknown): boolean { - const result = schema['~standard'].validate(value) - if (result instanceof Promise) - throw new TypeError('unexpected async validator') - return !result.issues -} - -describe('recipes/common-rpc-functions', () => { - it('exposes `openInEditor` as a devframe-namespaced action', () => { - expect(openInEditor.name).toBe('devframe:open-in-editor') - expect(openInEditor.type).toBe('action') - expect(openInEditor.args).toHaveLength(2) - expect(typeof openInEditor.handler).toBe('function') - }) - - it('restricts `openInEditor`\'s optional second argument to `KNOWN_EDITORS`', () => { - expect(KNOWN_EDITORS).toContain('code') - expect(KNOWN_EDITORS).toContain('vim') - - const editorSchema = openInEditor.args[1] - expect(accepts(editorSchema, undefined)).toBe(true) - for (const editor of KNOWN_EDITORS) - expect(accepts(editorSchema, editor)).toBe(true) - expect(accepts(editorSchema, 'not-a-real-editor')).toBe(false) - }) - - it('exposes `openInFinder` as a devframe-namespaced action', () => { - expect(openInFinder.name).toBe('devframe:open-in-finder') - expect(openInFinder.type).toBe('action') - expect(openInFinder.args).toHaveLength(1) - expect(typeof openInFinder.handler).toBe('function') - }) - - it('bundles both helpers in `commonRpcFunctions`', () => { - expect(commonRpcFunctions).toHaveLength(2) - expect(commonRpcFunctions).toContain(openInEditor) - expect(commonRpcFunctions).toContain(openInFinder) - }) -}) diff --git a/packages/devframe/src/recipes/common-rpc-functions.ts b/packages/devframe/src/recipes/common-rpc-functions.ts deleted file mode 100644 index 378e0e3d6..000000000 --- a/packages/devframe/src/recipes/common-rpc-functions.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { s } from 'devframe/utils/simple-schema' -import { defineRpcFunction } from '../rpc/define' - -/** - * Editor commands that `launch-editor` (the library behind - * `devframe/utils/launch-editor`) recognizes with a tailored - * `file:line:column` invocation. `openInEditor`'s optional second argument - * is restricted to this union, so the RPC surface can't be used to spawn an - * arbitrary command. - */ -export type KnownEditor - = | 'atom' - | 'subl' - | 'sublime' - | 'sublime_text' - | 'wstorm' - | 'charm' - | 'zed' - | 'notepad++' - | 'vim' - | 'mvim' - | 'joe' - | 'gvim' - | 'emacs' - | 'emacsclient' - | 'rmate' - | 'mate' - | 'code' - | 'code-insiders' - | 'codium' - | 'vscodium' - | 'trae' - | 'antigravity' - | 'cursor' - | 'appcode' - | 'clion' - | 'idea' - | 'phpstorm' - | 'pycharm' - | 'rubymine' - | 'webstorm' - | 'goland' - | 'rider' - -/** Runtime list of every {@link KnownEditor}. */ -export const KNOWN_EDITORS: KnownEditor[] = [ - 'atom', - 'subl', - 'sublime', - 'sublime_text', - 'wstorm', - 'charm', - 'zed', - 'notepad++', - 'vim', - 'mvim', - 'joe', - 'gvim', - 'emacs', - 'emacsclient', - 'rmate', - 'mate', - 'code', - 'code-insiders', - 'codium', - 'vscodium', - 'trae', - 'antigravity', - 'cursor', - 'appcode', - 'clion', - 'idea', - 'phpstorm', - 'pycharm', - 'rubymine', - 'webstorm', - 'goland', - 'rider', -] - -/** - * Prebuilt RPC action that opens a file in the user's configured editor. - * - * Registered name: `devframe:open-in-editor`. - * - * The optional second argument picks the editor command explicitly (must be - * one of {@link KNOWN_EDITORS}); otherwise it's auto-detected per - * `devframe/utils/launch-editor`. - * - * ```ts - * import { openInEditor } from 'devframe/recipes/common-rpc-functions' - * - * defineDevframe({ - * id: 'my-tool', - * name: 'My Tool', - * setup(ctx) { - * ctx.rpc.register(openInEditor) - * }, - * }) - * ``` - * - * @deprecated Use the `@devframes/service-open` wire service instead: one - * host-level installation shared by every plugin and feature-detectable from - * clients, with workspace-root path containment on top of the editor gating. - */ -export const openInEditor = defineRpcFunction({ - name: 'devframe:open-in-editor', - type: 'action', - jsonSerializable: true, - args: [s.string(), s.optional(s.picklist(KNOWN_EDITORS))], - returns: s.void(), - async handler(filename: string, editor?: KnownEditor) { - const { launchEditor } = await import('devframe/utils/launch-editor') - launchEditor(filename, editor) - }, -}) - -/** - * Prebuilt RPC action that reveals a path in the OS file explorer. - * - * Registered name: `devframe:open-in-finder`. - * - * ```ts - * import { openInFinder } from 'devframe/recipes/common-rpc-functions' - * - * ctx.rpc.register(openInFinder) - * ``` - * - * @deprecated Use the `@devframes/service-open` wire service instead: one - * host-level installation shared by every plugin and feature-detectable from - * clients, with workspace-root path containment. - */ -export const openInFinder = defineRpcFunction({ - name: 'devframe:open-in-finder', - type: 'action', - jsonSerializable: true, - args: [s.string()], - returns: s.void(), - async handler(path: string) { - const { open } = await import('devframe/utils/open') - await open(path) - }, -}) - -/** - * Convenience array bundling both helpers so callers can register them - * in a single `forEach`. - * - * ```ts - * import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions' - * - * commonRpcFunctions.forEach(fn => ctx.rpc.register(fn)) - * ``` - * - * @deprecated Use the `@devframes/service-open` wire service instead. - */ -export const commonRpcFunctions = [openInEditor, openInFinder] as const diff --git a/packages/devframe/src/tool-input.ts b/packages/devframe/src/tool-input.ts index a15f5bd48..42fe6aa2d 100644 --- a/packages/devframe/src/tool-input.ts +++ b/packages/devframe/src/tool-input.ts @@ -33,18 +33,3 @@ export function toolInputToRpcArgs(input: unknown, argumentCount?: number): unkn export function toolInputToCommandArgs(input: unknown, argumentCount?: number): unknown[] { return collectPositionalArgs(input, argumentCount) ?? [] } - -/** @deprecated Use {@link toolInputToRpcArgs} or {@link toolInputToCommandArgs}. */ -export type AgentArgsFallback = 'wrap' | 'drop' - -/** @deprecated Use {@link toolInputToRpcArgs} or {@link toolInputToCommandArgs}. */ -export function coerceAgentPositionalArgs( - input: unknown, - schemas: readonly unknown[] | undefined, - fallback: AgentArgsFallback = 'wrap', -): unknown[] { - const argumentCount = schemas?.length - return fallback === 'drop' - ? toolInputToCommandArgs(input, argumentCount) - : toolInputToRpcArgs(input, argumentCount) -} diff --git a/packages/devframe/src/types/context.ts b/packages/devframe/src/types/context.ts index 5af5215ce..1d7881c99 100644 --- a/packages/devframe/src/types/context.ts +++ b/packages/devframe/src/types/context.ts @@ -167,7 +167,7 @@ export interface ConnectionMeta { sse?: string | ConnectionMetaSse /** * Present when the dev server exposes a route-based MCP endpoint - * (`cli.mcp`). Advertises the MCP Streamable-HTTP route so in-browser + * (the host's `mcp` setting). Advertises the MCP Streamable-HTTP route so in-browser * tooling (e.g. an MCP inspector) can discover it without guessing the * path. `path` is relative to `__connection.json`'s location, like the * WebSocket `path`. `port` is set when the endpoint lives on a side-car diff --git a/packages/devframe/src/types/devframe.ts b/packages/devframe/src/types/devframe.ts index 97323eadb..0735a3093 100644 --- a/packages/devframe/src/types/devframe.ts +++ b/packages/devframe/src/types/devframe.ts @@ -106,8 +106,8 @@ export type McpAuthorization /** * The route-based MCP setting accepted everywhere a host mounts a devframe - * (`cli.mcp`, `initDevframe` / `initHub` / `createDevServer` options, the - * framework kits): + * (`initDevframe` / `initHub` / `createDevServer` options, `createCac` / + * `--mcp`, the framework kits): * * - `'auto'`, the default: mount the route when the devframe exposes an * agent surface (an `agent`-flagged RPC function, or a tool / resource / @@ -205,36 +205,6 @@ export interface DevframeCliOptions { * @default true */ auth?: boolean | DevframeAuthHandler - /** - * Expose a route-based MCP server alongside the standalone dev server, - * speaking the MCP Streamable-HTTP transport at `/__mcp` (relative to the - * base path). It surfaces the same `ctx.agent` tools + shared-state - * resources as the stdio `mcp` command, but against the live server. - * - * Defaults to `'auto'`: the route mounts once the devframe exposes an - * agent surface (an `agent`-flagged RPC, a registered tool / resource). - * See {@link McpSetting} for the full contract, and - * {@link McpRouteOptions} for the route path, origin allow-list, and - * {@link McpAuthorization} identity check. - * - * The `--mcp` / `--no-mcp` CLI flags override this per run. Whether to expose - * MCP is a hosting decision, so programmatic hosts pass it to - * `initDevframe` / `initHub` / `createDevServer` instead. - * - * @deprecated Whether to expose MCP is a hosting decision, not a capability - * of the tool. Pass `mcp` to `createCac` (or the programmatic host) instead. - * This field is still read as a fallback, and will be removed in a future - * release. - */ - mcp?: McpSetting - /** - * Author's SPA dist, served as the devframe's UI. - * - * @deprecated Moved to the top-level {@link DevframeDefinition.clientAssets}. - * Set `clientAssets` on the definition instead. This field is still read as a - * fallback when `clientAssets` is unset, so existing definitions keep working. - */ - distDir?: StaticAssetsSource /** * How the browser reaches the RPC WebSocket. Defaults to sharing the HTTP * port on the `__ws` route. See {@link DevframeWsOptions} for the @@ -449,8 +419,7 @@ export interface DevframeDefinition { * ship inside the node package. * * Consumed by every adapter that serves the UI (`dev`, `build`, `vite`, - * `next`, and the hub install path). When unset, the deprecated - * {@link DevframeCliOptions.distDir} is read as a fallback. + * `next`, and the hub install path). */ clientAssets?: StaticAssetsSource /** RPC-level configuration for this devframe (see {@link DevframeRpcOptions}). */ diff --git a/packages/devframe/src/utils/launch-editor.ts b/packages/devframe/src/utils/launch-editor.ts index 864b955ec..b7aef3a95 100644 --- a/packages/devframe/src/utils/launch-editor.ts +++ b/packages/devframe/src/utils/launch-editor.ts @@ -1,5 +1,80 @@ import launchImpl from 'launch-editor' +/** + * Editor commands `launch-editor` recognizes with a tailored + * `file:line:column` invocation. Callers that gate an RPC surface's editor + * argument to this union keep it from spawning an arbitrary command. + */ +export type KnownEditor + = | 'atom' + | 'subl' + | 'sublime' + | 'sublime_text' + | 'wstorm' + | 'charm' + | 'zed' + | 'notepad++' + | 'vim' + | 'mvim' + | 'joe' + | 'gvim' + | 'emacs' + | 'emacsclient' + | 'rmate' + | 'mate' + | 'code' + | 'code-insiders' + | 'codium' + | 'vscodium' + | 'trae' + | 'antigravity' + | 'cursor' + | 'appcode' + | 'clion' + | 'idea' + | 'phpstorm' + | 'pycharm' + | 'rubymine' + | 'webstorm' + | 'goland' + | 'rider' + +/** Runtime list of every {@link KnownEditor}. */ +export const KNOWN_EDITORS: KnownEditor[] = [ + 'atom', + 'subl', + 'sublime', + 'sublime_text', + 'wstorm', + 'charm', + 'zed', + 'notepad++', + 'vim', + 'mvim', + 'joe', + 'gvim', + 'emacs', + 'emacsclient', + 'rmate', + 'mate', + 'code', + 'code-insiders', + 'codium', + 'vscodium', + 'trae', + 'antigravity', + 'cursor', + 'appcode', + 'clion', + 'idea', + 'phpstorm', + 'pycharm', + 'rubymine', + 'webstorm', + 'goland', + 'rider', +] + /** * Open a file in the user's editor. * diff --git a/packages/devframe/tsdown.config.ts b/packages/devframe/tsdown.config.ts index 4a87c2500..f33f28d1f 100644 --- a/packages/devframe/tsdown.config.ts +++ b/packages/devframe/tsdown.config.ts @@ -118,7 +118,6 @@ const serverEntries = { 'adapters/initiate': 'src/adapters/initiate.ts', 'adapters/mcp': 'src/adapters/mcp.ts', 'cli/main': 'src/cli/main.ts', - 'recipes/common-rpc-functions': 'src/recipes/common-rpc-functions.ts', 'recipes/interactive-auth': 'src/recipes/interactive-auth.ts', } diff --git a/packages/hub/src/client/host.ts b/packages/hub/src/client/host.ts index 3243ac3d5..301477613 100644 --- a/packages/hub/src/client/host.ts +++ b/packages/hub/src/client/host.ts @@ -685,12 +685,3 @@ function groupByCategory(entries: DevframeDockEntry[], categoryOrder: Record (categoryOrder[a] ?? 0) - (categoryOrder[b] ?? 0), ) } - -/** @deprecated Renamed; use {@link DevframeClientRuntimeOptions}. */ -export type DevframeClientHostOptions = DevframeClientRuntimeOptions - -/** @deprecated Renamed; use {@link DevframeClientRuntime}. */ -export type DevframeClientHost = DevframeClientRuntime - -/** @deprecated Renamed; use {@link createDevframeClientRuntime}. */ -export const createDevframeClientHost: typeof createDevframeClientRuntime = createDevframeClientRuntime diff --git a/packages/hub/src/node/__tests__/initiate.test.ts b/packages/hub/src/node/__tests__/initiate.test.ts index 1a58e82fe..5ef4d164b 100644 --- a/packages/hub/src/node/__tests__/initiate.test.ts +++ b/packages/hub/src/node/__tests__/initiate.test.ts @@ -6,7 +6,7 @@ import { join } from 'node:path' import { createRpcClient } from 'devframe/rpc/client' import { createWsRpcChannel } from 'devframe/rpc/transports/ws-client' import { getPort } from 'get-port-please' -import { describe, expect, it, vi } from 'vitest' +import { describe, expect, it } from 'vitest' import { DOCK_RENDERERS_STATE_KEY } from '../../constants' import { DEVFRAMES_HUB_BASE, initHub } from '../initiate' @@ -351,35 +351,6 @@ describe('initHub', () => { } }) - it('warns (DF8005) when a mounted devframe asks for MCP but the hub MCP is off', async () => { - const wsPort = await getPort({ port: 18235, host: '127.0.0.1' }) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - // The hub turned MCP off, but `beta` declares `cli.mcp: true`; the hub's - // single aggregate route governs MCP, so beta's request is a no-op and warns. - const hub = initHub({ - base: DEVFRAMES_HUB_BASE, - auth: false, - host: '127.0.0.1', - ws: { port: wsPort }, - mcp: false, - devframes: [makeFrame('alpha'), { ...makeFrame('beta'), cli: { mcp: true } }], - }) - - try { - await hub.ready - expect(hub.connectionMeta().mcp).toBeUndefined() - const warned = warn.mock.calls.map((args: unknown[]) => String(args[0])).join('\n') - expect(warned).toMatch(/DF8005/) - expect(warned).toContain('beta') - // `alpha` didn't ask for MCP, so it isn't named. - expect(warned).not.toContain('"alpha"') - } - finally { - warn.mockRestore() - await hub.close() - } - }) - it('single hub Auth: one gate covers every frame on the shared socket', async () => { const wsPort = await getPort({ port: 18240, host: '127.0.0.1' }) const hub = initHub({ base: DEVFRAMES_HUB_BASE, host: '127.0.0.1', ws: { port: wsPort }, devframes: [makeFrame('alpha')] }) diff --git a/packages/hub/src/node/__tests__/install-devframe.test.ts b/packages/hub/src/node/__tests__/install-devframe.test.ts index e48188e4a..1bd28d691 100644 --- a/packages/hub/src/node/__tests__/install-devframe.test.ts +++ b/packages/hub/src/node/__tests__/install-devframe.test.ts @@ -171,7 +171,7 @@ describe('ctx.install', () => { const ctx = createContext() const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - await ctx.install(makeDevframe({ cli: { distDir: '/tmp/demo-dist' } })) + await ctx.install(makeDevframe({ clientAssets: '/tmp/demo-dist' })) expect(warn).toHaveBeenCalledTimes(1) expect(warn.mock.calls[0].join(' ')).toContain('DF8106') diff --git a/packages/hub/src/node/assemble.ts b/packages/hub/src/node/assemble.ts index fea387077..0ba5b4c31 100644 --- a/packages/hub/src/node/assemble.ts +++ b/packages/hub/src/node/assemble.ts @@ -107,7 +107,6 @@ export async function mountDevframes( ctx: DevframeHubContext, devframes: HubDevframeEntry[], base: string, - hubMcpEnabled: boolean, ): Promise<(() => Promise)[]> { const setups: (() => Promise)[] = [] for (const { devframe: def, dock } of devframes) { @@ -118,13 +117,6 @@ export async function mountDevframes( // segment entirely. if (!/^[\w.-]+$/.test(def.id)) throw diagnostics.DF8004({ id: def.id }) - // A hub exposes one aggregate MCP route over every mounted devframe, so a - // devframe's own `mcp` request is only meaningful when the hub's own MCP - // can mount (an explicit setting or the `'auto'` default). Warn when the - // hub turned it off, rather than silently dropping the devframe's - // intended agent surface. - if (!hubMcpEnabled && def.cli?.mcp) - diagnostics.DF8005({ id: def.id }) const frameBase = withTrailingSlash(joinURL(base, def.id)) const run = await prepareDevframe(ctx, def, { base: frameBase, ...(dock ? { dock } : {}) }) if (run) diff --git a/packages/hub/src/node/build.ts b/packages/hub/src/node/build.ts index d9f2cbabf..59dd0046e 100644 --- a/packages/hub/src/node/build.ts +++ b/packages/hub/src/node/build.ts @@ -183,7 +183,7 @@ async function createAndMountContext(options: BuildHubOptions, base: string, cwd const devframes = await resolveDevframesInput(options.devframes ?? []) for (const input of options.services ?? []) void ctx.services.install(input) - const setups = await mountDevframes(ctx, devframes, base, false) + const setups = await mountDevframes(ctx, devframes, base) await ctx.services.ready() for (const run of setups) diff --git a/packages/hub/src/node/diagnostics.ts b/packages/hub/src/node/diagnostics.ts index fdef08e6a..55933c41d 100644 --- a/packages/hub/src/node/diagnostics.ts +++ b/packages/hub/src/node/diagnostics.ts @@ -30,10 +30,6 @@ export const diagnostics = defineDiagnostics({ why: (p: { id: string }) => `Devframe id "${p.id}" is not a mountable URL segment, and the hub mounts each frame at \`/\`.`, fix: 'Ids become route segments, so they may only contain letters, digits, `_`, `-`, and `.`; `:` and `*` are route-pattern markers to the underlying router, and `/` would escape the segment. Set a route-safe `id` on the definition (e.g. `my_plugin` instead of `my:plugin`).', }, - DF8005: { - why: (p: { id: string }) => `Devframe "${p.id}" requests an MCP route, but the hub's aggregate MCP is off (\`mcp: false\`), so its tools are not exposed over MCP.`, - fix: 'A hub exposes one aggregate MCP endpoint over every mounted devframe, so per-devframe `mcp` settings are ignored. Drop `mcp: false` from `initHub` (the `\'auto\'` default mounts the aggregate route once agent tools exist) to surface this devframe\'s tools, or drop `mcp` from the devframe to silence this warning.', - }, DF8006: { why: (p: { urlBase: string, base: string }) => `A static hub build writes each mount either under its base ("${p.base}") or as an absolute-path sibling of it, but "${p.urlBase}" is neither.`, fix: 'buildHub maps a mount under the hub base into its `outDir`, and any other mount to the deploy root (`outDir`\'s parent) by its absolute path. Give the mount an absolute base (starting with `/`) so it resolves to one of those.', diff --git a/packages/hub/src/node/initiate.ts b/packages/hub/src/node/initiate.ts index c43626958..723333d3c 100644 --- a/packages/hub/src/node/initiate.ts +++ b/packages/hub/src/node/initiate.ts @@ -256,9 +256,8 @@ export interface InitHubOptions { * exposes an agent surface. `true` mounts it * unconditionally with the loopback origin gate (trusting same-machine * callers), an object opts into an {@link McpRouteOptions.authorization} - * identity check, `false` keeps it off. A mounted devframe's own `mcp` - * setting is ignored: the hub's aggregate route covers them all (`DF8005` - * warns when one asks for MCP while this is `false`). + * identity check, `false` keeps it off. The hub's aggregate route covers + * every mounted devframe's tools. */ mcp?: McpSetting /** @@ -464,7 +463,7 @@ export function initHub(options: InitHubOptions): HubInstance { // collection alongside every devframe's own declared services. for (const input of options.services ?? []) void ctx.services.install(input) - const setups = await mountDevframes(ctx, devframes, base, options.mcp !== false) + const setups = await mountDevframes(ctx, devframes, base) // Construct every collected service once, then run the setups, so a // devframe's setup consumes services (its own or another devframe's) diff --git a/packages/hub/src/node/install-devframe.ts b/packages/hub/src/node/install-devframe.ts index 874dd0d42..9bd026feb 100644 --- a/packages/hub/src/node/install-devframe.ts +++ b/packages/hub/src/node/install-devframe.ts @@ -2,7 +2,6 @@ import type { DevframeDefinition } from 'devframe/types' import type { ClientScriptEntry, DevframeViewIframe } from '../types/docks' import type { DevframeHubContext, HubMountedFrame } from './context' import { existsSync } from 'node:fs' -import { resolveClientAssets } from 'devframe/internal' import { resolveBasePath } from 'devframe/node/hub-internals' import { basename, dirname, isAbsolute, resolve } from 'pathe' import { joinURL, withTrailingSlash } from 'ufo' @@ -72,7 +71,7 @@ async function serveDevframeAssets( id: string, base: string, ): Promise { - const clientAssets = resolveClientAssets(d) + const clientAssets = d.clientAssets if (!clientAssets) return // Serve the hub's connection meta under the devframe's base so its SPA diff --git a/packages/json-render-ui/src/spa.ts b/packages/json-render-ui/src/spa.ts index 58c0fe0c3..b0a74e89f 100644 --- a/packages/json-render-ui/src/spa.ts +++ b/packages/json-render-ui/src/spa.ts @@ -19,8 +19,8 @@ export const jsonRenderSpaDir: string = fileURLToPath(new URL('./spa/', import.m /** * Wrap a devframe definition so it serves the prebuilt {@link jsonRenderSpaDir * standalone SPA}. Defaults `clientAssets` to the SPA assets (an explicit - * `clientAssets`, or the deprecated `cli.distDir`, still wins). The author - * supplies everything else (id, name, `setup`, port, …) as usual. + * `clientAssets` still wins). The author supplies everything else (id, name, + * `setup`, port, …) as usual. * * ```ts * export default createJsonRenderDevframe({ @@ -33,6 +33,6 @@ export const jsonRenderSpaDir: string = fileURLToPath(new URL('./spa/', import.m export function createJsonRenderDevframe(definition: DevframeDefinition): DevframeDefinition { return { ...definition, - clientAssets: definition.clientAssets ?? definition.cli?.distDir ?? jsonRenderSpaDir, + clientAssets: definition.clientAssets ?? jsonRenderSpaDir, } } diff --git a/packages/next/src/handler.ts b/packages/next/src/handler.ts index d245448d8..6356fbf70 100644 --- a/packages/next/src/handler.ts +++ b/packages/next/src/handler.ts @@ -4,7 +4,7 @@ import { homedir } from 'node:os' import { join } from 'node:path' import process from 'node:process' import { initDevframe } from 'devframe/initiate' -import { normalizeBasePath, resolveBasePath, resolveClientAssets } from 'devframe/internal' +import { normalizeBasePath, resolveBasePath } from 'devframe/internal' export interface CreateDevframeNextHandlerOptions { /** @@ -43,10 +43,9 @@ export interface CreateDevframeNextHandlerOptions { /** * Expose the route-based MCP server (Streamable-HTTP) at `__mcp`, * on the Next app's own origin, through the same catch-all route as the - * SPA, and advertise it in the handler's `__connection.json`. Overrides - * `def.cli?.mcp`, `undefined` falls through to it, then to the `'auto'` - * default (mount once the agent surface is non-empty); `false` disables - * the route regardless. + * SPA, and advertise it in the handler's `__connection.json`. `undefined` + * falls through to the `'auto'` default (mount once the agent surface is + * non-empty); `false` disables the route regardless. */ mcp?: InitDevframeOptions['mcp'] /** @@ -118,7 +117,7 @@ export function createDevframeNextHandler( def: DevframeDefinition, options: CreateDevframeNextHandlerOptions = {}, ): DevframeNextHandler { - const distDir = resolveClientAssets(def) + const distDir = def.clientAssets if (!distDir) { throw new Error( `[@devframes/next] createDevframeNextHandler("${def.id}") needs a built SPA to serve, but "clientAssets" is not set on the devframe definition.`, diff --git a/packages/next/src/hub-client.tsx b/packages/next/src/hub-client.tsx index aa768ab71..e5f8377df 100644 --- a/packages/next/src/hub-client.tsx +++ b/packages/next/src/hub-client.tsx @@ -5,7 +5,7 @@ import { createDevframeClientRuntime } from '@devframes/hub/client' import { DEVFRAMES_HUB_BASE } from '@devframes/hub/constants' import { useEffect, useState } from 'react' -export type { DevframeClientHost, DevframeClientHostOptions, DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' +export type { DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' export interface UseDevframeHubClientOptions extends DevframeClientRuntimeOptions { /** diff --git a/packages/next/test/handler.test.ts b/packages/next/test/handler.test.ts index 0572200dc..6d51c7891 100644 --- a/packages/next/test/handler.test.ts +++ b/packages/next/test/handler.test.ts @@ -64,21 +64,6 @@ describe('createDevframeNextHandler', () => { expect(() => createDevframeNextHandler(def)).toThrow(/clientAssets/) }) - it('falls back to the deprecated cli.distDir', async () => { - const dist = mkdtempSync(join(tmpdir(), 'df-next-legacy-')) - writeFileSync(join(dist, 'index.html'), 'ok') - - const def = makeDef('') - def.clientAssets = undefined - def.cli = { distDir: dist } - - handler = createDevframeNextHandler(def, { host: '127.0.0.1' }) - await handler.ready - - const index = await handler.fetch(new Request('http://localhost:3000/__test-next/')) - expect(index.status).toBe(200) - }) - it('forwards the mcp option and advertises the side-car endpoint', async () => { const dist = mkdtempSync(join(tmpdir(), 'df-next-mcp-')) writeFileSync(join(dist, 'index.html'), 'ok') diff --git a/packages/nuxt/src/hub-client.ts b/packages/nuxt/src/hub-client.ts index 647a13ba4..47604a402 100644 --- a/packages/nuxt/src/hub-client.ts +++ b/packages/nuxt/src/hub-client.ts @@ -4,7 +4,7 @@ import { createDevframeClientRuntime } from '@devframes/hub/client' import { DEVFRAMES_HUB_BASE } from '@devframes/hub/constants' import { onScopeDispose, shallowRef } from 'vue' -export type { DevframeClientHost, DevframeClientHostOptions, DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' +export type { DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' export interface UseDevframeHubClientOptions extends DevframeClientRuntimeOptions { /** diff --git a/packages/vite/src/hub-client.ts b/packages/vite/src/hub-client.ts index 13e55d36a..48f054f37 100644 --- a/packages/vite/src/hub-client.ts +++ b/packages/vite/src/hub-client.ts @@ -2,7 +2,7 @@ import type { DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devfr import { createDevframeClientRuntime } from '@devframes/hub/client' import { DEVFRAMES_HUB_BASE } from '@devframes/hub/constants' -export type { DevframeClientHost, DevframeClientHostOptions, DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' +export type { DevframeClientRuntime, DevframeClientRuntimeOptions } from '@devframes/hub/client' export interface MountDevframeHubClientOptions extends DevframeClientRuntimeOptions { /** diff --git a/packages/vite/src/single.ts b/packages/vite/src/single.ts index 6c289d235..d923a4aa4 100644 --- a/packages/vite/src/single.ts +++ b/packages/vite/src/single.ts @@ -6,7 +6,7 @@ import type { IncomingMessage, Server as NodeHttpServer, ServerResponse } from ' import type { Plugin } from 'vite' import process from 'node:process' import { initDevframe } from 'devframe/initiate' -import { diagnostics, normalizeBasePath, resolveBasePath, resolveClientAssets } from 'devframe/internal' +import { diagnostics, normalizeBasePath, resolveBasePath } from 'devframe/internal' import { resolveStaticAssetsSource } from 'devframe/utils/remote-assets' import { serveStaticNodeMiddleware } from 'devframe/utils/serve-static' import { join, resolve } from 'pathe' @@ -62,7 +62,7 @@ export interface DevframeVitePluginOptions { */ export function devframeVitePlugin(d: DevframeDefinition, options: DevframeVitePluginOptions = {}): DevframeVitePlugin { const base = normalizeMountBase(options.base ?? resolveBasePath(d, 'hosted')) - const distDir = resolveClientAssets(d) + const distDir = d.clientAssets return { name: `devframe:${d.id}`, @@ -115,9 +115,9 @@ export interface DevframeViteBridgeOptions { /** * Expose the bridge's route-based MCP server (Streamable-HTTP) at * `__mcp` (on the Vite app's own origin) and advertise it in the - * bridge's `__connection.json`. Overrides `def.cli?.mcp`, `undefined` - * falls through to it, then to the `'auto'` default (mount once the agent - * surface is non-empty); `false` disables the route regardless. + * bridge's `__connection.json`. `undefined` falls through to the `'auto'` + * default (mount once the agent surface is non-empty); `false` disables the + * route regardless. */ mcp?: McpSetting /** diff --git a/plugins/a11y/README.md b/plugins/a11y/README.md index 664e34ff7..26114774a 100644 --- a/plugins/a11y/README.md +++ b/plugins/a11y/README.md @@ -61,7 +61,7 @@ path, so the hub serves it same-origin and `devframes: ['@devframes/plugin-a11y' works with no host wiring. The hub's client runtime (`createDevframeClientRuntime` from `@devframes/hub/client`) then imports it into the host page and calls its default export with the client-script context. A host can also serve the module itself (e.g. -via `/@fs/…` under Vite) by attaching `a11yPageScriptBundlePath` as a per-mount +via `/@fs/…` under Vite) by attaching `a11yClientScriptBundlePath` as a per-mount `clientScript`. Booted that way, the page script also mirrors the active route's scan into the hub's **messages feed**: a summary entry driven through the loading → idle lifecycle plus one entry per violated rule, @@ -119,7 +119,7 @@ pnpm -C plugins/a11y dev # from source: same, at /__devframes_plugin_a11 | Path | Export | Purpose | |------|--------|---------| -| `src/index.ts` | `.` | `createA11yDevframe()` (also the default export), declaring the page script as its dock's client script; `a11yPageScriptBundlePath` is that module, for hosts that serve it themselves | +| `src/index.ts` | `.` | `createA11yDevframe()` (also the default export), declaring the page script as its dock's client script; `a11yClientScriptBundlePath` is that module, for hosts that serve it themselves | | `src/node/index.ts` | `/node` | `setupA11y(ctx, options?)` registers the RPC functions with the runtime config | | `src/cli.ts` | `/cli` | `createA11yCli()` backs the `devframes_plugin_a11y` bin | | `src/client/index.ts` | `/client` | `connectA11y()`, a typed browser RPC client wrapper | diff --git a/plugins/a11y/src/node/index.ts b/plugins/a11y/src/node/index.ts index 2bc451801..e1a028799 100644 --- a/plugins/a11y/src/node/index.ts +++ b/plugins/a11y/src/node/index.ts @@ -46,12 +46,6 @@ function resolveClientScriptBundle(): string { } } -/** @deprecated Renamed; use {@link a11yClientScriptBundlePath}. */ -export const a11yPageScriptBundlePath: string = a11yClientScriptBundlePath - -/** @deprecated Renamed; use {@link a11yClientScriptBundlePath}. */ -export const a11yAgentBundlePath: string = a11yClientScriptBundlePath - export interface A11yDevframeOptions { /** Override the devframe id (and the default CLI command / mount path). */ id?: string @@ -114,10 +108,10 @@ export function createA11yDevframe(options: A11yDevframeOptions = {}): DevframeD category: '~builtin', clientScript: { importFrom: a11yClientScriptBundlePath }, }, + clientAssets: distDir, cli: { command: id, port: options.port ?? 9899, - distDir, }, setup(ctx) { setupA11y(ctx, { diff --git a/plugins/a11y/tests/_utils.ts b/plugins/a11y/tests/_utils.ts index 10cd29a13..68cc9cd5b 100644 --- a/plugins/a11y/tests/_utils.ts +++ b/plugins/a11y/tests/_utils.ts @@ -18,7 +18,7 @@ const devframe = createA11yDevframe() /** Resolve the Solid panel SPA to a local dir, the workspace-linked `--assets` package in dev. */ function localSpaDir(): string { - const resolved = resolveStaticAssetsSource(devframe.cli!.distDir!, resolve(os.tmpdir(), 'devframes_plugin_a11y-test'), devframe.importMetaUrl) + const resolved = resolveStaticAssetsSource(devframe.clientAssets!, resolve(os.tmpdir(), 'devframes_plugin_a11y-test'), devframe.importMetaUrl) if (typeof resolved !== 'string') throw new TypeError('[devframes_plugin_a11y] client SPA missing; run `pnpm -C plugins/a11y run build` first.') return resolved diff --git a/plugins/assets/src/node/index.ts b/plugins/assets/src/node/index.ts index 27239d30f..d7d3cb149 100644 --- a/plugins/assets/src/node/index.ts +++ b/plugins/assets/src/node/index.ts @@ -121,10 +121,10 @@ export function createAssetsDevframe(options: AssetsDevframeOptions = {}): Devfr icon: options.icon ?? 'ph:image-square-duotone', basePath: options.basePath, capabilities: { build: options.build ?? false }, + clientAssets: distDir, cli: { command: 'devframe-assets', port: options.port ?? DEFAULT_PORT, - distDir, auth: options.auth ?? true, configure(cli) { cli.option('--read-only', 'Disable upload, rename, delete, and folder creation') diff --git a/plugins/code-server/src/node/index.ts b/plugins/code-server/src/node/index.ts index c8ed93e15..f6e8afb1c 100644 --- a/plugins/code-server/src/node/index.ts +++ b/plugins/code-server/src/node/index.ts @@ -60,12 +60,12 @@ export function createCodeServerDevframe(options: CodeServerOptions = {}): Devfr * `/__/` when hosted. Authors override via `options.basePath`. */ basePath: options.basePath, + clientAssets: resolvedDist, cli: { command: options.command ?? 'devframe-code-server', port: options.port ?? DEFAULT_PORT, portRange: options.portRange, random: options.random, - distDir: resolvedDist, /** * Gate the standalone launcher by default; `maybeOpenBrowser` folds the * current OTP into the `--open` URL so the tab lands already trusted. diff --git a/plugins/data-inspector/src/inject/index.ts b/plugins/data-inspector/src/inject/index.ts index 9ca7cdbd3..4df2793bf 100644 --- a/plugins/data-inspector/src/inject/index.ts +++ b/plugins/data-inspector/src/inject/index.ts @@ -229,12 +229,3 @@ if (process.env.DEVFRAME_DATA_INSPECTOR === '1' || process.env.DEVFRAME_DATA_INS console.error('[data-inspector] inject endpoint failed to start:', error) }) } - -/** @deprecated Renamed; use {@link DISCOVERY_FILE} (the file moved to `discovery.json`; `attach` still falls back to the old `agent.json`). */ -export const AGENT_DISCOVERY_FILE: string = DISCOVERY_FILE - -/** @deprecated Renamed; use {@link InjectDiscovery}. */ -export type AgentDiscovery = InjectDiscovery - -/** @deprecated Renamed; use {@link DataInspectorEndpoint}. */ -export type DataInspectorAgent = DataInspectorEndpoint diff --git a/plugins/data-inspector/src/node/index.ts b/plugins/data-inspector/src/node/index.ts index 89e23411a..53d5b3f1a 100644 --- a/plugins/data-inspector/src/node/index.ts +++ b/plugins/data-inspector/src/node/index.ts @@ -73,10 +73,10 @@ export function createDataInspectorDevframe(options: DataInspectorDevframeOption description: pkg.description, icon: options.icon ?? 'ph:crosshair-duotone', basePath: options.basePath, + clientAssets: remoteAssets, cli: { command: 'data-inspector', port: options.port ?? DEFAULT_PORT, - distDir: remoteAssets, auth: options.auth ?? true, }, dock: { category: '~builtin' }, diff --git a/plugins/git/src/node/index.ts b/plugins/git/src/node/index.ts index 15ecc67f4..9d25e294f 100644 --- a/plugins/git/src/node/index.ts +++ b/plugins/git/src/node/index.ts @@ -67,10 +67,10 @@ export function createGitDevframe(options: GitDevframeOptions = {}): DevframeDef description: pkg.description, icon: 'ph:git-branch-duotone', basePath: options.basePath, + clientAssets: distDir, cli: { command: 'devframe-git', port: options.port ?? 9710, - distDir, /** * Gate the standalone server by default; `maybeOpenBrowser` folds the * current OTP into the `--open` URL so the tab lands already trusted. diff --git a/plugins/git/test/_utils.ts b/plugins/git/test/_utils.ts index 083df75bd..e9c0d04b9 100644 --- a/plugins/git/test/_utils.ts +++ b/plugins/git/test/_utils.ts @@ -54,7 +54,7 @@ export async function startDashboardServer( ): Promise { const devframe = createGitDevframe(options) // The client SPA ships in the workspace-linked `--assets` package in dev. - const distDir = resolveStaticAssetsSource(devframe.cli!.distDir!, resolve(tmpdir(), 'devframes_plugin_git-test'), devframe.importMetaUrl) + const distDir = resolveStaticAssetsSource(devframe.clientAssets!, resolve(tmpdir(), 'devframes_plugin_git-test'), devframe.importMetaUrl) if (typeof distDir !== 'string') throw new TypeError('these tests serve the local client SPA; build the plugin first') // The factory leaves basePath adapter-resolved; standalone defaults to '/'. diff --git a/plugins/inspect/src/node/index.ts b/plugins/inspect/src/node/index.ts index be930c177..06346e3a2 100644 --- a/plugins/inspect/src/node/index.ts +++ b/plugins/inspect/src/node/index.ts @@ -58,10 +58,10 @@ export function createInspectDevframe(options: InspectDevframeOptions = {}): Dev description: pkg.description, icon: options.icon ?? 'ph:stethoscope-duotone', basePath: options.basePath, + clientAssets: distDir, cli: { command: id, port: options.port ?? 9012, - distDir, /** * Gate the standalone server by default; `maybeOpenBrowser` folds the * current OTP into the `--open` URL so the tab lands already trusted. diff --git a/plugins/inspect/test/_utils.ts b/plugins/inspect/test/_utils.ts index 201259e2b..4516d0ba3 100644 --- a/plugins/inspect/test/_utils.ts +++ b/plugins/inspect/test/_utils.ts @@ -20,14 +20,14 @@ import { serveTestContext } from '../../../tests/helpers/serve-test-context' const inspectDevframe = createInspectDevframe() /** - * Resolve the inspector's SPA to a local directory. Its `distDir` is a + * Resolve the inspector's SPA to a local directory. Its `clientAssets` is a * remote-assets declaration; in this monorepo the lockstep * `@devframes/plugin-inspect--assets` package is workspace-linked, so * resolution short-circuits to its built `dist`. A store (rather than a * string) means that build hasn't run. */ function localSpaDir(): string { - const resolved = resolveStaticAssetsSource(inspectDevframe.cli!.distDir!, path.join(os.tmpdir(), 'devframes_plugin_inspect-test'), inspectDevframe.importMetaUrl) + const resolved = resolveStaticAssetsSource(inspectDevframe.clientAssets!, path.join(os.tmpdir(), 'devframes_plugin_inspect-test'), inspectDevframe.importMetaUrl) if (typeof resolved !== 'string') { throw new TypeError( '[devframes_plugin_inspect] client SPA missing; run `pnpm -C plugins/inspect run build` first.', diff --git a/plugins/messages/src/node/index.ts b/plugins/messages/src/node/index.ts index 377ac9442..001870b62 100644 --- a/plugins/messages/src/node/index.ts +++ b/plugins/messages/src/node/index.ts @@ -58,10 +58,10 @@ export function createMessagesDevframe(options: MessagesDevframeOptions = {}): D description: pkg.description, icon: options.icon ?? 'ph:notification-duotone', basePath: options.basePath, + clientAssets: remoteAssets, cli: { command: id, port: options.port ?? DEFAULT_PORT, - distDir: remoteAssets, /** * Gate the standalone server by default; `maybeOpenBrowser` folds the * current OTP into the `--open` URL so the tab lands already trusted. diff --git a/plugins/messages/test/_utils.ts b/plugins/messages/test/_utils.ts index 3f91ba13d..de6eab6a4 100644 --- a/plugins/messages/test/_utils.ts +++ b/plugins/messages/test/_utils.ts @@ -23,7 +23,7 @@ const SPA_DIST = localDistDir() /** Resolve the SPA to a local dir: the workspace-linked `--assets` package in dev. */ function localDistDir(): string { - const resolved = resolveStaticAssetsSource(messagesDevframe.cli!.distDir!, path.join(os.tmpdir(), 'devframes_plugin_messages-test'), messagesDevframe.importMetaUrl) + const resolved = resolveStaticAssetsSource(messagesDevframe.clientAssets!, path.join(os.tmpdir(), 'devframes_plugin_messages-test'), messagesDevframe.importMetaUrl) if (typeof resolved !== 'string') throw new TypeError('these tests serve the local client SPA; build the plugin first') return resolved diff --git a/plugins/og/src/node/index.ts b/plugins/og/src/node/index.ts index f7bbc931e..647832df0 100644 --- a/plugins/og/src/node/index.ts +++ b/plugins/og/src/node/index.ts @@ -46,10 +46,10 @@ export function createOgDevframe(options: OgDevframeOptions = {}): DevframeDefin description: pkg.description, icon: options.icon ?? 'ph:image-square-duotone', basePath: options.basePath, + clientAssets: remoteAssets, cli: { command: id, port: options.port ?? 9016, - distDir: remoteAssets, auth: options.auth ?? true, }, dock: { category: '~builtin' }, diff --git a/plugins/og/test/_utils.ts b/plugins/og/test/_utils.ts index e64e32462..77a0930a7 100644 --- a/plugins/og/test/_utils.ts +++ b/plugins/og/test/_utils.ts @@ -30,7 +30,7 @@ const testDevframe = createOgDevframe({ fetch: testFetch }) /** Resolve the SPA to a local dir: the workspace-linked `--assets` package in dev. */ function localSpaDir(): string { - const resolved = resolveStaticAssetsSource(testDevframe.cli!.distDir!, path.join(os.tmpdir(), 'devframes_plugin_og-test'), testDevframe.importMetaUrl) + const resolved = resolveStaticAssetsSource(testDevframe.clientAssets!, path.join(os.tmpdir(), 'devframes_plugin_og-test'), testDevframe.importMetaUrl) if (typeof resolved !== 'string') throw new TypeError('Open Graph client SPA missing. Run the plugin build first.') return resolved diff --git a/plugins/terminals/src/node/index.ts b/plugins/terminals/src/node/index.ts index eb759698f..735dc4ec4 100644 --- a/plugins/terminals/src/node/index.ts +++ b/plugins/terminals/src/node/index.ts @@ -70,10 +70,10 @@ export function createTerminalsDevframe(options: TerminalsOptions = {}): Devfram * `/__/` when hosted. Authors override via `options.basePath`. */ basePath: options.basePath, + clientAssets: distDir, cli: { command: options.command ?? 'devframe-terminals', port: options.port ?? DEFAULT_PORT, - distDir, /** * Gate the standalone server by default, since shell access is sensitive. * `maybeOpenBrowser` folds the current OTP into the `--open` URL so diff --git a/services/open/src/index.ts b/services/open/src/index.ts index c94cb03ca..b5dacb96b 100644 --- a/services/open/src/index.ts +++ b/services/open/src/index.ts @@ -1,8 +1,8 @@ -import type { KnownEditor } from 'devframe/recipes/common-rpc-functions' import type { DevframeServiceDefinition } from 'devframe/types' +import type { KnownEditor } from 'devframe/utils/launch-editor' import { realpath } from 'node:fs/promises' import { defineRpcFunction } from 'devframe' -import { KNOWN_EDITORS } from 'devframe/recipes/common-rpc-functions' +import { KNOWN_EDITORS } from 'devframe/utils/launch-editor' import { s } from 'devframe/utils/simple-schema' import { dirname, isAbsolute, normalize, relative, resolve } from 'pathe' import pkg from '../package.json' with { type: 'json' } @@ -77,8 +77,7 @@ declare module 'devframe' { /** * The open wire service: `open-in-editor` / `open-in-finder` RPC shared by - * every plugin on the host, replacing per-plugin registrations of the - * (deprecated) `devframe/recipes/common-rpc-functions` recipes. Paths may be + * every plugin on the host. Paths may be * absolute or relative to the `workspaceRoot`; the service refuses paths * outside the workspace root and the configured extra * {@link OpenServiceOptions.roots} (`DS_OPEN_0002`), and gates editor diff --git a/services/open/test/service.test.ts b/services/open/test/service.test.ts index c444e3f4a..0a147efba 100644 --- a/services/open/test/service.test.ts +++ b/services/open/test/service.test.ts @@ -11,7 +11,10 @@ import { createOpenService } from '../src/index' const launchEditor = vi.fn() const open = vi.fn() -vi.mock('devframe/utils/launch-editor', () => ({ launchEditor: (...args: unknown[]) => launchEditor(...args) })) +vi.mock('devframe/utils/launch-editor', async importOriginal => ({ + ...await importOriginal(), + launchEditor: (...args: unknown[]) => launchEditor(...args), +})) vi.mock('devframe/utils/open', () => ({ open: async (...args: unknown[]) => open(...args) })) const tempDirs: string[] = [] diff --git a/starter/src/client/vite.config.ts b/starter/src/client/vite.config.ts index bef658294..58fddd1ff 100644 --- a/starter/src/client/vite.config.ts +++ b/starter/src/client/vite.config.ts @@ -1,7 +1,7 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' -// Builds the standalone SPA into `dist/client` (the definition's `cli.distDir`). +// Builds the standalone SPA into `dist/client` (the definition's `clientAssets`). // `base: './'` keeps every asset URL relative so the same bundle works under // any mount path - the CLI static build, the single playground, or a hub dock. export default defineConfig({ diff --git a/starter/src/devframe.ts b/starter/src/devframe.ts index a2085dcea..6e94f6111 100644 --- a/starter/src/devframe.ts +++ b/starter/src/devframe.ts @@ -4,7 +4,7 @@ import pkg from '../package.json' with { type: 'json' } import { NAMESPACE, serverFunctions } from './rpc/index.ts' import { BASE_PATH } from './shared/base-path.ts' -const distDir = fileURLToPath(new URL('../dist/client', import.meta.url)) +const clientAssets = fileURLToPath(new URL('../dist/client', import.meta.url)) /** * The single `DevframeDefinition` every surface consumes: the CLI @@ -21,10 +21,10 @@ export default defineDevframe({ description: pkg.description, icon: 'ph:rocket-launch-duotone', basePath: BASE_PATH, + clientAssets, cli: { command: 'devframe-starter', port: 7391, - distDir, // `auth` is deliberately left unset: gated by default (devframe's // interactive OTP handshake - a 6-digit code printed to the terminal // that trusts the browser before it can call any RPC function). diff --git a/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.d.ts index 21e6ccb98..d3648d3ac 100644 --- a/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.d.ts @@ -201,10 +201,6 @@ export interface WhenClauseContext { // #region Types export type ConnectRemoteDevframeOptions = Omit; export type DevframeClientContext = DocksContext; -/** @deprecated */ -export type DevframeClientHost = DevframeClientRuntime; -/** @deprecated */ -export type DevframeClientHostOptions = DevframeClientRuntimeOptions; export type DockClientType = 'embedded' | 'standalone'; export type DockRenderer = (_: DockRendererMountOptions) => DockRendererInstance | Promise; export type DockRendererManifest = Record; @@ -268,8 +264,6 @@ export declare function watchFrameLocation(_: WatchFrameLocationOptions): () => // #region Variables export declare const CLIENT_CONTEXT_KEY: string; -/** @deprecated */ -export declare const createDevframeClientHost: typeof createDevframeClientRuntime; export declare const FRAME_NAV_CHANNEL: string; export declare const FRAME_NAV_VERSION: number; // #endregion diff --git a/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.js b/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.js index 0f1b65ec6..73a7ec354 100644 --- a/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.js +++ b/tests/__snapshots__/tsnapi/@devframes/hub/client.snapshot.js @@ -18,8 +18,6 @@ export function watchFrameLocation(_) {} // #region Variables export var CLIENT_CONTEXT_KEY /* const */ -/** @deprecated */ -export var createDevframeClientHost /* const */ export var FRAME_NAV_CHANNEL /* const */ export var FRAME_NAV_VERSION /* const */ // #endregion diff --git a/tests/__snapshots__/tsnapi/@devframes/next/hub/client.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/next/hub/client.snapshot.d.ts index a4d8ffc6e..2e5fdc0c3 100644 --- a/tests/__snapshots__/tsnapi/@devframes/next/hub/client.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/next/hub/client.snapshot.d.ts @@ -12,8 +12,6 @@ export declare function useDevframeHubClient(_?: UseDevframeHubClientOptions): D // #endregion // #region Other -export { DevframeClientHost } -export { DevframeClientHostOptions } export { DevframeClientRuntime } export { DevframeClientRuntimeOptions } // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/nuxt/hub/client.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/nuxt/hub/client.snapshot.d.ts index 4397001df..a526a7f22 100644 --- a/tests/__snapshots__/tsnapi/@devframes/nuxt/hub/client.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/nuxt/hub/client.snapshot.d.ts @@ -12,8 +12,6 @@ export declare function useDevframeHubClient(_?: UseDevframeHubClientOptions): R // #endregion // #region Other -export { DevframeClientHost } -export { DevframeClientHostOptions } export { DevframeClientRuntime } export { DevframeClientRuntimeOptions } // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.d.ts index c19f6bb80..caf870c27 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.d.ts @@ -23,11 +23,7 @@ export declare function createA11yDevframe(_?: A11yDevframeOptions): DevframeDef // #endregion // #region Variables -/** @deprecated */ -export declare const a11yAgentBundlePath: string; export declare const a11yClientScriptBundlePath: string; -/** @deprecated */ -export declare const a11yPageScriptBundlePath: string; // #endregion // #region Default Export diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.js b/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.js index 0da1bcf27..059445f53 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.js +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-a11y/index.snapshot.js @@ -6,8 +6,6 @@ export default createA11yDevframe // #endregion // #region Other -export { a11yAgentBundlePath } export { a11yClientScriptBundlePath } -export { a11yPageScriptBundlePath } export { createA11yDevframe } // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.d.ts index ef6cf376f..40fa56d5e 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.d.ts @@ -24,21 +24,12 @@ export interface InjectDiscovery { } // #endregion -// #region Types -/** @deprecated */ -export type AgentDiscovery = InjectDiscovery; -/** @deprecated */ -export type DataInspectorAgent = DataInspectorEndpoint; -// #endregion - // #region Functions export declare function createGlobalThisDataSource(): DataSourceEntry; export declare function exposeDataInspector(_?: ExposeDataInspectorOptions): Promise; // #endregion // #region Variables -/** @deprecated */ -export declare const AGENT_DISCOVERY_FILE: string; export declare const DISCOVERY_FILE: string; // #endregion diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.js b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.js index 66517555f..efe87743b 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.js +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/inject.snapshot.js @@ -7,7 +7,5 @@ export async function exposeDataInspector(_) {} // #endregion // #region Variables -/** @deprecated */ -export var AGENT_DISCOVERY_FILE /* const */ export var DISCOVERY_FILE /* const */ // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/vite/hub/client.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/vite/hub/client.snapshot.d.ts index 05538edd8..cff26b9a7 100644 --- a/tests/__snapshots__/tsnapi/@devframes/vite/hub/client.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/vite/hub/client.snapshot.d.ts @@ -12,8 +12,6 @@ export declare function mountDevframeHubClient(_?: MountDevframeHubClientOptions // #endregion // #region Other -export { DevframeClientHost } -export { DevframeClientHostOptions } export { DevframeClientRuntime } export { DevframeClientRuntimeOptions } // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/in-page-channel.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/in-page-channel.snapshot.d.ts index 5c8b85f6a..c18c9dcd5 100644 --- a/tests/__snapshots__/tsnapi/devframe/in-page-channel.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/in-page-channel.snapshot.d.ts @@ -34,7 +34,6 @@ export interface PageScriptChannel

{ readonly panels: readonly PanelPeer

[]; readonly events: Pick>, 'on' | 'once'>; emit: & string>(_: K, ..._: FnArgs[K]>) => void; - callEvent: & string>(_: K, ..._: FnArgs[K]>) => void; on: & string>(_: K, _: (..._: FnArgs[K]>) => void) => () => void; readonly sharedState: InPageSharedStateHost

; addPanelPort: (_: MessagePort) => PanelPeer

; @@ -50,7 +49,6 @@ export interface PanelChannel

{ whenConnected: (_?: number) => Promise; call: & string>(_: K, ..._: FnArgs[K]>) => Promise[K]>>; emit: & string>(_: K, ..._: FnArgs[K]>) => void; - callEvent: & string>(_: K, ..._: FnArgs[K]>) => void; on: & string>(_: K, _: (..._: FnArgs[K]>) => void) => () => void; readonly sharedState: InPageSharedStateHost

; close: () => void; diff --git a/tests/__snapshots__/tsnapi/devframe/index.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/index.snapshot.d.ts index 0f8c1490c..42e955edd 100644 --- a/tests/__snapshots__/tsnapi/devframe/index.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/index.snapshot.d.ts @@ -136,8 +136,6 @@ export interface DevframeCliOptions { host?: string; open?: boolean | string; auth?: boolean | DevframeAuthHandler; - mcp?: McpSetting; - distDir?: StaticAssetsSource; ws?: DevframeWsOptions | false; sse?: boolean | DevframeSseOptions; configure?: (_: CAC) => void; @@ -567,8 +565,6 @@ export type StaticAssetsSource = string | RemoteAssets; // #region Functions export declare function defineDevframe(_: DevframeDefinition): DevframeDefinition; -/** @deprecated */ -export declare function resolveClientAssets(_: DevframeDefinition): StaticAssetsSource | undefined; // #endregion // #region Variables diff --git a/tests/__snapshots__/tsnapi/devframe/index.snapshot.js b/tests/__snapshots__/tsnapi/devframe/index.snapshot.js index d46bb1978..e681572ed 100644 --- a/tests/__snapshots__/tsnapi/devframe/index.snapshot.js +++ b/tests/__snapshots__/tsnapi/devframe/index.snapshot.js @@ -3,8 +3,6 @@ */ // #region Functions export function defineDevframe(_) {} -/** @deprecated */ -export function resolveClientAssets(_) {} // #endregion // #region Variables diff --git a/tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts index 00cc7f772..34d143ddc 100644 --- a/tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts @@ -14,11 +14,6 @@ export interface RpcWireCodec { } // #endregion -// #region Types -/** @deprecated */ -export type AgentArgsFallback = 'wrap' | 'drop'; -// #endregion - // #region Classes export declare class DevframeAgentHost implements DevframeAgentHost$1 { readonly context: DevframeNodeContext; @@ -50,8 +45,6 @@ export declare class DevframeAgentHost implements DevframeAgentHost$1 { // #region Functions export declare function argsToJsonSchema(_: readonly StandardSchemaV1[] | undefined): unknown; -/** @deprecated */ -export declare function coerceAgentPositionalArgs(_: unknown, _: readonly unknown[] | undefined, _?: AgentArgsFallback): unknown[]; export declare function createH3DevframeHost(_: CreateH3DevframeHostOptions): DevframeHost; export declare function createRpcWireCodec(_?: ReadonlyMap>): RpcWireCodec; export declare function formatMcpError(_: unknown): string; @@ -61,7 +54,6 @@ export declare function peekRpcWireFrame(_: string): { t?: string; i?: string; }; -export declare function resolveClientAssets(_: DevframeDefinition): StaticAssetsSource | undefined; export declare function returnToJsonSchema(_: StandardSchemaV1 | undefined): unknown; export declare function stringifyForMcp(_: unknown): string; export declare function toolInputToCommandArgs(_: unknown, _?: number): unknown[]; @@ -222,7 +214,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{ readonly why: (p: { port: number; }) => string; - readonly fix: "Restart the instance with the --mcp flag (or set `cli.mcp: true` on its definition) to expose its tools, then list instances again."; + readonly fix: "Restart the instance with the --mcp flag to expose its tools, then list instances again."; }; readonly DF0052: { readonly why: (p: { diff --git a/tests/__snapshots__/tsnapi/devframe/internal.snapshot.js b/tests/__snapshots__/tsnapi/devframe/internal.snapshot.js index a4f777409..30cfdb0d0 100644 --- a/tests/__snapshots__/tsnapi/devframe/internal.snapshot.js +++ b/tests/__snapshots__/tsnapi/devframe/internal.snapshot.js @@ -9,7 +9,6 @@ export function stringifyForMcp(_) {} // #endregion // #region Other -export { coerceAgentPositionalArgs } export { createContextRpcServer } export { createH3DevframeHost } export { createInstanceShell } @@ -26,7 +25,6 @@ export { peekRpcWireFrame } export { probeDevframeOrigin } export { registerDevframeInstance } export { resolveBasePath } -export { resolveClientAssets } export { resolveInstanceRegister } export { resolveMcpConfig } export { samePath } diff --git a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts deleted file mode 100644 index b7d58b197..000000000 --- a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Generated by tsnapi — public API snapshot of `devframe/recipes/common-rpc-functions` - */ -// #region Types -export type KnownEditor = 'atom' | 'subl' | 'sublime' | 'sublime_text' | 'wstorm' | 'charm' | 'zed' | 'notepad++' | 'vim' | 'mvim' | 'joe' | 'gvim' | 'emacs' | 'emacsclient' | 'rmate' | 'mate' | 'code' | 'code-insiders' | 'codium' | 'vscodium' | 'trae' | 'antigravity' | 'cursor' | 'appcode' | 'clion' | 'idea' | 'phpstorm' | 'pycharm' | 'rubymine' | 'webstorm' | 'goland' | 'rider'; -// #endregion - -// #region Variables -/** @deprecated */ -export declare const commonRpcFunctions: readonly [RpcFunctionDefinitionWithSchemas<"devframe:open-in-editor", "action", readonly [SimpleSchema, SimpleSchema], SimpleSchema, undefined>, RpcFunctionDefinitionWithSchemas<"devframe:open-in-finder", "action", readonly [SimpleSchema], SimpleSchema, undefined>]; -export declare const KNOWN_EDITORS: KnownEditor[]; -/** @deprecated */ -export declare const openInEditor: RpcFunctionDefinitionWithSchemas<"devframe:open-in-editor", "action", readonly [SimpleSchema, SimpleSchema], SimpleSchema, undefined>; -/** @deprecated */ -export declare const openInFinder: RpcFunctionDefinitionWithSchemas<"devframe:open-in-finder", "action", readonly [SimpleSchema], SimpleSchema, undefined>; -// #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.js b/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.js deleted file mode 100644 index 3b2ac5299..000000000 --- a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Generated by tsnapi — public API snapshot of `devframe/recipes/common-rpc-functions` - */ -// #region Variables -/** @deprecated */ -export var commonRpcFunctions /* const */ -export var KNOWN_EDITORS /* const */ -/** @deprecated */ -export var openInEditor /* const */ -/** @deprecated */ -export var openInFinder /* const */ -// #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/recipes/interactive-auth.snapshot.js b/tests/__snapshots__/tsnapi/devframe/recipes/interactive-auth.snapshot.js index cfe788e77..f9024f6af 100644 --- a/tests/__snapshots__/tsnapi/devframe/recipes/interactive-auth.snapshot.js +++ b/tests/__snapshots__/tsnapi/devframe/recipes/interactive-auth.snapshot.js @@ -1,7 +1,7 @@ /** * Generated by tsnapi — public API snapshot of `devframe/recipes/interactive-auth` */ -// #region Functions -export function createAuthBanner(_) {} -export function createInteractiveAuth(_, _) {} +// #region Other +export { createAuthBanner } +export { createInteractiveAuth } // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.d.ts index 0632e8cdb..d4bf3e8ef 100644 --- a/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.d.ts @@ -1,6 +1,14 @@ /** * Generated by tsnapi — public API snapshot of `devframe/utils/launch-editor` */ +// #region Types +export type KnownEditor = 'atom' | 'subl' | 'sublime' | 'sublime_text' | 'wstorm' | 'charm' | 'zed' | 'notepad++' | 'vim' | 'mvim' | 'joe' | 'gvim' | 'emacs' | 'emacsclient' | 'rmate' | 'mate' | 'code' | 'code-insiders' | 'codium' | 'vscodium' | 'trae' | 'antigravity' | 'cursor' | 'appcode' | 'clion' | 'idea' | 'phpstorm' | 'pycharm' | 'rubymine' | 'webstorm' | 'goland' | 'rider'; +// #endregion + // #region Functions export declare function launchEditor(_: string, _?: string): void; +// #endregion + +// #region Variables +export declare const KNOWN_EDITORS: KnownEditor[]; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.js b/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.js index 6a853fac9..adb376fa3 100644 --- a/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.js +++ b/tests/__snapshots__/tsnapi/devframe/utils/launch-editor.snapshot.js @@ -3,4 +3,8 @@ */ // #region Functions export function launchEditor(_, _) {} +// #endregion + +// #region Variables +export var KNOWN_EDITORS /* const */ // #endregion \ No newline at end of file diff --git a/tsconfig.base.json b/tsconfig.base.json index f273c2b41..bd25e32e7 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -271,9 +271,6 @@ "devframe/recipes/interactive-auth": [ "./packages/devframe/src/recipes/interactive-auth.ts" ], - "devframe/recipes/common-rpc-functions": [ - "./packages/devframe/src/recipes/common-rpc-functions.ts" - ], "devframe/client": [ "./packages/devframe/src/client/index.ts" ],