Skip to content

Commit ef2598e

Browse files
committed
chore: rebase onto main — align with renamed example dir and RPC namespace
main renamed examples/minimal-next-devframe-hub -> examples/next-devframe-hub and its RPC/command/instance ids to the example:next-devframe-hub convention (#143); this wave's additions (MCP serverName, registry instance id, e2e spec file + assertions, playwright cwd) now match. Same fix for files-inspector's example:files-inspector id/namespace. Also regenerates the recipes/common-rpc-functions + recipes/open-helpers dts snapshots for phase 2's Thenable<InferReturnType<RS>> handler-return widening (non-breaking — allowed to update without --allow-breaking).
1 parent 51938ad commit ef2598e

8 files changed

Lines changed: 43 additions & 43 deletions

File tree

examples/next-devframe-hub/src/client/devframe/next-devframe-hub.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export async function nextDevframeHub(
258258
// route as the SPAs, no side-car port involved.
259259
const mcpPath = '/__hub/__mcp'
260260
await nextHost.mountMcp(context, mcpPath, {
261-
serverName: 'minimal-next-devframe-hub',
261+
serverName: 'example:next-devframe-hub',
262262
})
263263

264264
const connectionMeta = {
@@ -279,8 +279,8 @@ export async function nextDevframeHub(
279279
port: nextPort,
280280
origin: `http://${hostName}:${nextPort}`,
281281
basePath: '/__hub/',
282-
id: 'minimal-next-devframe-hub',
283-
name: 'Minimal Next Devframe Hub',
282+
id: 'example:next-devframe-hub',
283+
name: 'Next Devframe Hub',
284284
rootDir: cwd,
285285
mcp: { path: mcpPath },
286286
startedAt: Date.now(),

plans/031-agent-native-mcp-wave.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ literal "/_next/mcp" shape on devframe primitives.
108108
- `examples/files-inspector`: register one gateway tool; e2e boots
109109
`dev --mcp`, runs `devframe connect` over stdio (MCP SDK client),
110110
asserts the connector discovers it and a proxied call round-trips.
111-
- `examples/minimal-next-devframe-hub`: e2e boots the Next dev server,
111+
- `examples/next-devframe-hub`: e2e boots the Next dev server,
112112
asserts the connector discovers the in-process hub endpoint.
113113
13. **Docs**`docs/adapters/mcp.md` (+ agent-native guide): `devframe
114114
connect` client config, the registry contract, `mountMcp` for custom

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default defineConfig({
8282
},
8383
{
8484
command: 'pnpm exec next dev src/client -p 9878',
85-
cwd: 'examples/minimal-next-devframe-hub',
85+
cwd: 'examples/next-devframe-hub',
8686
env: { PORT: '9878', DEVFRAME_INSTANCES_DIR: nextHubRegistry },
8787
url: 'http://localhost:9878/',
8888
timeout: 120_000,

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export declare const commonRpcFunctions: readonly [{
1414
returns: v.VoidSchema<undefined>;
1515
jsonSerializable?: boolean;
1616
agent?: RpcFunctionAgentOptions;
17-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>) | undefined;
18-
handler?: ((args_0: string, args_1: KnownEditor | undefined) => void) | undefined;
19-
dump?: RpcDump<[string, KnownEditor | undefined], void, undefined> | undefined;
17+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>) | undefined;
18+
handler?: ((args_0: string, args_1: KnownEditor | undefined) => Thenable<void>) | undefined;
19+
dump?: RpcDump<[string, KnownEditor | undefined], Thenable<void>, undefined> | undefined;
2020
snapshot?: boolean;
21-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>> | undefined;
22-
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>> | undefined;
21+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>> | undefined;
22+
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>> | undefined;
2323
}, {
2424
name: "devframe:open-in-finder";
2525
type?: "action" | undefined;
@@ -28,12 +28,12 @@ export declare const commonRpcFunctions: readonly [{
2828
returns: v.VoidSchema<undefined>;
2929
jsonSerializable?: boolean;
3030
agent?: RpcFunctionAgentOptions;
31-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
32-
handler?: ((args_0: string) => void) | undefined;
33-
dump?: RpcDump<[string], void, undefined> | undefined;
31+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>) | undefined;
32+
handler?: ((args_0: string) => Thenable<void>) | undefined;
33+
dump?: RpcDump<[string], Thenable<void>, undefined> | undefined;
3434
snapshot?: boolean;
35-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
36-
__promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
35+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>> | undefined;
36+
__promise?: Thenable<RpcFunctionSetupResult<[string], Thenable<void>>> | undefined;
3737
}];
3838
export declare const KNOWN_EDITORS: KnownEditor[];
3939
export declare const openInEditor: {
@@ -44,12 +44,12 @@ export declare const openInEditor: {
4444
returns: v.VoidSchema<undefined>;
4545
jsonSerializable?: boolean;
4646
agent?: RpcFunctionAgentOptions;
47-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>) | undefined;
48-
handler?: ((args_0: string, args_1: KnownEditor | undefined) => void) | undefined;
49-
dump?: RpcDump<[string, KnownEditor | undefined], void, undefined> | undefined;
47+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>) | undefined;
48+
handler?: ((args_0: string, args_1: KnownEditor | undefined) => Thenable<void>) | undefined;
49+
dump?: RpcDump<[string, KnownEditor | undefined], Thenable<void>, undefined> | undefined;
5050
snapshot?: boolean;
51-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>> | undefined;
52-
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>> | undefined;
51+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>> | undefined;
52+
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>> | undefined;
5353
};
5454
export declare const openInFinder: {
5555
name: "devframe:open-in-finder";
@@ -59,11 +59,11 @@ export declare const openInFinder: {
5959
returns: v.VoidSchema<undefined>;
6060
jsonSerializable?: boolean;
6161
agent?: RpcFunctionAgentOptions;
62-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
63-
handler?: ((args_0: string) => void) | undefined;
64-
dump?: RpcDump<[string], void, undefined> | undefined;
62+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>) | undefined;
63+
handler?: ((args_0: string) => Thenable<void>) | undefined;
64+
dump?: RpcDump<[string], Thenable<void>, undefined> | undefined;
6565
snapshot?: boolean;
66-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
67-
__promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
66+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>> | undefined;
67+
__promise?: Thenable<RpcFunctionSetupResult<[string], Thenable<void>>> | undefined;
6868
};
6969
// #endregion

tests/__snapshots__/tsnapi/devframe/recipes/open-helpers.snapshot.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export declare const openInEditor: {
1212
returns: v.VoidSchema<undefined>;
1313
jsonSerializable?: boolean;
1414
agent?: RpcFunctionAgentOptions;
15-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>) | undefined;
16-
handler?: ((args_0: string, args_1: KnownEditor | undefined) => void) | undefined;
17-
dump?: RpcDump<[string, KnownEditor | undefined], void, undefined> | undefined;
15+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>) | undefined;
16+
handler?: ((args_0: string, args_1: KnownEditor | undefined) => Thenable<void>) | undefined;
17+
dump?: RpcDump<[string, KnownEditor | undefined], Thenable<void>, undefined> | undefined;
1818
snapshot?: boolean;
19-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>> | undefined;
20-
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>> | undefined;
19+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>>> | undefined;
20+
__promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], Thenable<void>>> | undefined;
2121
};
2222
export declare const openInFinder: {
2323
name: "devframe:open-in-finder";
@@ -27,11 +27,11 @@ export declare const openInFinder: {
2727
returns: v.VoidSchema<undefined>;
2828
jsonSerializable?: boolean;
2929
agent?: RpcFunctionAgentOptions;
30-
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
31-
handler?: ((args_0: string) => void) | undefined;
32-
dump?: RpcDump<[string], void, undefined> | undefined;
30+
setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>) | undefined;
31+
handler?: ((args_0: string) => Thenable<void>) | undefined;
32+
dump?: RpcDump<[string], Thenable<void>, undefined> | undefined;
3333
snapshot?: boolean;
34-
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
35-
__promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
34+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], Thenable<void>>>> | undefined;
35+
__promise?: Thenable<RpcFunctionSetupResult<[string], Thenable<void>>> | undefined;
3636
};
3737
// #endregion

tests/e2e/devframe-connect.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ test.describe('devframe connect (files-inspector)', () => {
1515
// MCP endpoint and tool list.
1616
const index = parseToolText(await client.callTool({ name: 'devframe:connect:list-instances', arguments: {} }))
1717
const instance = index.instances.find(
18-
(entry: any) => entry.id === 'devframe-files-inspector' && entry.port === 9876,
18+
(entry: any) => entry.id === 'example:files-inspector' && entry.port === 9876,
1919
)
2020
expect(instance).toBeDefined()
2121
// The probe may adopt an explicit address family for a `localhost`
2222
// origin — accept either spelling.
2323
expect(instance.mcp.url).toMatch(/^http:\/\/(?:localhost|127\.0\.0\.1):9876\/__devframe-files-inspector\/__mcp$/)
2424
const toolNames = instance.mcp.tools.map((t: any) => t.name)
2525
expect(toolNames).toContain('devframe:state:read')
26-
expect(toolNames).toContain('devframe-files-inspector:docs')
26+
expect(toolNames).toContain('example:files-inspector:docs')
2727

2828
// Call: proxy the gateway tool through the connector.
2929
const call = parseToolText(await client.callTool({
3030
name: 'devframe:connect:call-tool',
31-
arguments: { port: 9876, tool: 'devframe-files-inspector:docs' },
31+
arguments: { port: 9876, tool: 'example:files-inspector:docs' },
3232
}))
3333
expect(call.isError).toBe(false)
3434
const inner = JSON.parse(call.content[0].text)

tests/e2e/minimal-next-devframe-hub-dev.spec.ts renamed to tests/e2e/next-devframe-hub-dev.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { parseToolText, withConnectClient } from './_support/mcp-connect'
55
const ORIGIN = 'http://localhost:9878'
66
const REGISTRY = fileURLToPath(new URL('./.registries/next-hub', import.meta.url))
77

8-
test.describe('devframe connect (minimal-next-devframe-hub)', () => {
8+
test.describe('devframe connect (next-devframe-hub)', () => {
99
test('discovers the in-process hub endpoint and calls an agent-flagged command', async () => {
1010
test.setTimeout(180_000)
1111

@@ -32,7 +32,7 @@ test.describe('devframe connect (minimal-next-devframe-hub)', () => {
3232
// Index: the hub registered itself (explicitly — it runs in-process,
3333
// not via createDevServer) with the Next server's own origin.
3434
const index = parseToolText(await client.callTool({ name: 'devframe:connect:list-instances', arguments: {} }))
35-
const hub = index.instances.find((entry: any) => entry.id === 'minimal-next-devframe-hub')
35+
const hub = index.instances.find((entry: any) => entry.id === 'example:next-devframe-hub')
3636
expect(hub).toBeDefined()
3737
// The probe may adopt an explicit address family for the recorded
3838
// `localhost` origin — accept either spelling.
@@ -41,14 +41,14 @@ test.describe('devframe connect (minimal-next-devframe-hub)', () => {
4141
// The hub's agent surface flows through: the agent-flagged hub command,
4242
// the built-in devframe:state:read, and the git plugin's agent-flagged reads.
4343
const toolNames = hub.mcp.tools.map((t: any) => t.name)
44-
expect(toolNames).toContain('minimal-next-devframe-hub:ping')
44+
expect(toolNames).toContain('example:next-devframe-hub:ping')
4545
expect(toolNames).toContain('devframe:state:read')
4646
expect(toolNames).toContain('devframes:plugin:git:status')
4747

4848
// Call the agent-flagged hub command through the connector.
4949
const ping = parseToolText(await client.callTool({
5050
name: 'devframe:connect:call-tool',
51-
arguments: { port: 9878, tool: 'minimal-next-devframe-hub:ping' },
51+
arguments: { port: 9878, tool: 'example:next-devframe-hub:ping' },
5252
}))
5353
expect(ping.isError).toBe(false)
5454
expect(ping.content[0].text).toBe('pong')

0 commit comments

Comments
 (0)