devframe 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_shared-BAGBgTUO.d.mts → _shared-BPovvJW8.d.mts} +1 -1
- package/dist/adapters/build.d.mts +11 -2
- package/dist/adapters/build.mjs +40 -4
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +1 -1
- package/dist/adapters/dev.d.mts +4 -4
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +3 -3
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/cli/main.mjs +2 -2
- package/dist/client/index.d.mts +5 -5
- package/dist/{context-af2w_F0_.mjs → context-BUJGvlje.mjs} +1 -1
- package/dist/{context-al99DDJ8.d.mts → context-CO7eZHJy.d.mts} +1 -1
- package/dist/{context-riPPHGiu.mjs → context-CQW0lSw8.mjs} +10 -5
- package/dist/{devframe-mbfgpQQC.d.mts → context-_i51nYOs.d.mts} +1199 -1170
- package/dist/{dev-BKm_HisC.mjs → dev-lpIvwagf.mjs} +5 -5
- package/dist/{diagnostics-DI1HGj2I.mjs → diagnostics-BXWW3VK-.mjs} +4 -0
- package/dist/{host-agent-DVDLqjvj.mjs → host-agent-B84av916.mjs} +1 -1
- package/dist/{http-POepPnaQ.mjs → http-BKiqHcXX.mjs} +2 -2
- package/dist/{index-Dipgo9ji.d.mts → index-CEvd-YXD.d.mts} +2 -2
- package/dist/{index-tdrk1bzV.d.mts → index-DOg4S5wk.d.mts} +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/{instance-registry-Dy28drtm.mjs → instance-registry-BjlMQbFB.mjs} +1 -1
- package/dist/{instance-shell-GqTY93gC.mjs → instance-shell-B-uevnK-.mjs} +4 -4
- package/dist/{instance-shell-mU5j5xWn.d.mts → instance-shell-BHvBIGP4.d.mts} +3 -3
- package/dist/internal/index.d.mts +11 -5
- package/dist/internal/index.mjs +5 -5
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +1 -1
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/recipes/common-rpc-functions.d.mts +3 -3
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +1 -1
- package/dist/{remote-assets-CqxiyltC.mjs → remote-assets-DezQmPQU.mjs} +1 -1
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/transports/sse-client.d.mts +1 -1
- package/dist/rpc/transports/sse-server.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +2 -2
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/{rpc-core-dV69u4lY.d.mts → rpc-core-CDZoGYiD.d.mts} +3 -3
- package/dist/{rpc-core-DRYnbxdD.mjs → rpc-core-DlHd276T.mjs} +1 -1
- package/dist/{sse-client-CFBOIaUi.d.mts → sse-client-CdGD_B8_.d.mts} +1 -1
- package/dist/{storage-BNqSAOxA.mjs → storage-BXNVhKyR.mjs} +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/{types-Djq7CBXh.d.mts → types-BBLeGfpt.d.mts} +1 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/remote-assets.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{ws-client-DhjNyQo3.d.mts → ws-client-Bo2t6hES.d.mts} +1 -1
- package/dist/{ws-server-D1d3QM9f.d.mts → ws-server-DLtEoLdR.d.mts} +1 -1
- package/package.json +1 -1
- package/skills/devframe/SKILL.md +313 -292
- package/skills/devframe/templates/counter-devframe.ts +8 -3
- package/skills/devframe/templates/hub.ts +50 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// Smallest possible devframe. The
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// Smallest possible devframe. The same definition serves anywhere:
|
|
2
|
+
// - standard handler: initDevframe(counter, { base: '/__counter/' }).handler
|
|
3
|
+
// - standalone CLI: createCac(counter).parse()
|
|
4
|
+
// - composed in a hub: initHub({ devframes: [counter], ... })
|
|
5
|
+
// A host derives its dock entry from `id` / `name` / `icon` automatically.
|
|
4
6
|
import { defineDevframe, defineRpcFunction } from 'devframe'
|
|
5
7
|
// Recommended: source version/packageName/homepage/description from your
|
|
6
8
|
// package.json so the published metadata stays in sync. The import-attribute
|
|
@@ -14,6 +16,9 @@ export default defineDevframe({
|
|
|
14
16
|
name: 'Counter',
|
|
15
17
|
version: pkg.version,
|
|
16
18
|
packageName: pkg.name,
|
|
19
|
+
// Always pass import.meta.url — the base the host resolves the tool's own
|
|
20
|
+
// companion packages (assets, services) against.
|
|
21
|
+
importMetaUrl: import.meta.url,
|
|
17
22
|
homepage: pkg.homepage,
|
|
18
23
|
description: pkg.description,
|
|
19
24
|
icon: 'ph:counter-duotone',
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Compose many devframes into one devtools host behind a single standard
|
|
2
|
+
// handler. Every mounted devframe runs against ONE shared hub context:
|
|
3
|
+
// a merged RPC registry (frames can call each other), one shared-state
|
|
4
|
+
// store, one WebSocket transport, and one auth gate.
|
|
5
|
+
//
|
|
6
|
+
// `hub.handler` is a Web-Standard `(request: Request) => Promise<Response>`;
|
|
7
|
+
// mount it on a catch-all route (Hono, Nitro, Next, SvelteKit, ...) exactly
|
|
8
|
+
// like an `initDevframe` instance. `hub.nodeMiddleware` is the Connect-style
|
|
9
|
+
// form for Vite/Rsbuild. See docs/adapters/initiate.md for the mount snippets
|
|
10
|
+
// and the WebSocket-binding precedence (`ws.port` / `server` / `ws.sidecar` /
|
|
11
|
+
// host-attached `hub.attach(server)`).
|
|
12
|
+
import { createUi } from '@devframes/hub-ui'
|
|
13
|
+
import { DEVFRAMES_HUB_BASE, initHub } from '@devframes/hub/initiate'
|
|
14
|
+
|
|
15
|
+
// A plugin's default export is its `create<X>Devframe` factory — call it to
|
|
16
|
+
// get an instance (optionally with options). Swap these for your own.
|
|
17
|
+
import createInspectDevframe from '@devframes/plugin-inspect'
|
|
18
|
+
import createTerminalsDevframe from '@devframes/plugin-terminals'
|
|
19
|
+
|
|
20
|
+
export const hub = initHub({
|
|
21
|
+
// Required — the conventional `/__devframes/`. The instance echoes the
|
|
22
|
+
// normalized value back as `hub.base`; reference that, not the literal.
|
|
23
|
+
base: DEVFRAMES_HUB_BASE,
|
|
24
|
+
|
|
25
|
+
devframes: [
|
|
26
|
+
createInspectDevframe(),
|
|
27
|
+
createTerminalsDevframe(),
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
// The reference viewer + a floating dock injected via one
|
|
31
|
+
// `<script type="module" src="/__devframes/embedded.js">` tag.
|
|
32
|
+
// Pass `ui: false` for a headless hub you drive with your own UI over the
|
|
33
|
+
// shared-state protocol (see @devframes/hub/client).
|
|
34
|
+
ui: createUi(),
|
|
35
|
+
|
|
36
|
+
// Runs against the shared hub context — register cross-tool commands,
|
|
37
|
+
// docks, message handlers here.
|
|
38
|
+
configure(ctx) {
|
|
39
|
+
ctx.commands.register({
|
|
40
|
+
id: 'app:hello',
|
|
41
|
+
title: 'Hello',
|
|
42
|
+
handler: () => 'hi',
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// hub.handler — the whole devtools ecosystem as Request -> Response
|
|
48
|
+
// hub.nodeMiddleware — Connect-style middleware
|
|
49
|
+
// hub.attach(server) — hand the hub a node server's upgrade events
|
|
50
|
+
// hub.close() — tear the transport down
|