devframe 0.8.2 → 0.9.0-beta.10
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-BPmX9fqK.d.mts +41 -0
- package/dist/_shared-CbZ_yhbz.mjs +68 -0
- package/dist/adapters/build.d.mts +10 -12
- package/dist/adapters/build.mjs +26 -29
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +156 -1
- package/dist/adapters/dev.d.mts +38 -46
- package/dist/adapters/dev.mjs +2 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +224 -0
- package/dist/adapters/initiate.mjs +2 -0
- package/dist/adapters/mcp.d.mts +24 -7
- package/dist/adapters/mcp.mjs +2 -2
- package/dist/{agent-tool-name-C3b5vEwJ.mjs → agent-tool-name-EgfoFO8C.mjs} +0 -3
- package/dist/cli/main.d.mts +0 -2
- package/dist/cli/main.mjs +4 -8
- package/dist/client/index.d.mts +71 -7
- package/dist/client/index.mjs +720 -1540
- package/dist/constants.d.mts +28 -7
- package/dist/constants.mjs +28 -7
- package/dist/{context-DoSozfvx.d.mts → context-B3YUu_95.d.mts} +19 -1
- package/dist/{host-h3-D2hYZvDK.mjs → context-CEe4PBz1.mjs} +25 -557
- package/dist/{context-CBg8iRbQ.mjs → context-xdynGSLP.mjs} +10 -1
- package/dist/dev--rAPzbvO.mjs +239 -0
- package/dist/{devframe-mQ4qZAuo.d.mts → devframe-DJMg0WLe.d.mts} +181 -134
- package/dist/{diagnostics-hwjXp_UV.mjs → diagnostics-CD8nlgll.mjs} +1 -3
- package/dist/{diagnostics-D7wM2cwM.mjs → diagnostics-DOQPnQmX.mjs} +51 -5
- package/dist/dist-eNI9qM_I.mjs +228 -0
- package/dist/host-agent-xLCSe65D.mjs +264 -0
- package/dist/host-h3-Crkzm42q.mjs +26 -0
- package/dist/{fetch-BKaD0Vb3.mjs → http-DYpK0cUi.mjs} +42 -11
- package/dist/{index-b64Uuhy2.d.mts → index-CB-fSUyn.d.mts} +2 -2
- package/dist/{index-Dbw1p5ch.d.mts → index-tdrk1bzV.d.mts} +3 -32
- package/dist/index.d.mts +12 -5
- package/dist/index.mjs +8 -1
- package/dist/{instance-registry-BnnA2Eoh.mjs → instance-registry-WvQkt42E.mjs} +9 -8
- package/dist/instance-shell-CMFyszWJ.mjs +486 -0
- package/dist/instance-shell-CljiKq1c.d.mts +255 -0
- package/dist/internal/index.d.mts +397 -0
- package/dist/internal/index.mjs +9 -0
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -1
- package/dist/node/hub-internals.d.mts +2 -14
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +4 -268
- package/dist/node/index.mjs +3 -5
- package/dist/nostics-CzECRXpE.mjs +59 -0
- package/dist/nostics-SPGDgHEP.d.mts +33 -0
- package/dist/recipes/common-rpc-functions.d.mts +4 -4
- package/dist/recipes/interactive-auth.d.mts +3 -3
- package/dist/recipes/interactive-auth.mjs +8 -8
- package/dist/remote-assets-Bg4gCUZ_.d.mts +123 -0
- package/dist/remote-assets-nTTxY2MU.mjs +636 -0
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/rpc/dump.d.mts +77 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +3 -3
- package/dist/rpc/index.mjs +4 -18
- package/dist/rpc/transports/sse-client.d.mts +2 -0
- package/dist/rpc/transports/sse-client.mjs +142 -0
- package/dist/rpc/transports/sse-server.d.mts +61 -0
- package/dist/rpc/transports/sse-server.mjs +209 -0
- package/dist/rpc/transports/ws-bun.d.mts +35 -0
- package/dist/rpc/transports/ws-bun.mjs +31 -0
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +10 -18
- package/dist/rpc/transports/ws-server.d.mts +2 -2
- package/dist/rpc/transports/ws-server.mjs +2 -235
- package/dist/rpc-core-Cc4lucI0.d.mts +48 -0
- package/dist/rpc-core-DMTe-hLo.mjs +81 -0
- package/dist/{serialization-C8Mnw9hK.mjs → serialization-BGzEwAdr.mjs} +2 -2
- package/dist/{shared-state-6kHolYZy.mjs → shared-state-fRRbRUtD.mjs} +1 -1
- package/dist/sse-client-CFBOIaUi.d.mts +37 -0
- package/dist/state-Cc1IeSmQ.mjs +1291 -0
- package/dist/{dump-CgZShDRB.mjs → static-BPZ1_OPA.mjs} +3 -266
- package/dist/storage-CYye7P7L.mjs +137 -0
- package/dist/types/index.d.mts +6 -4
- package/dist/types/index.mjs +1 -6
- package/dist/{types-CnJSgRVa.d.mts → types-Djq7CBXh.d.mts} +0 -7
- package/dist/utils/agent-tool-name.d.mts +0 -3
- package/dist/utils/agent-tool-name.mjs +0 -3
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/get-port.d.mts +17 -0
- package/dist/utils/get-port.mjs +2 -0
- package/dist/utils/launch-editor.mjs +1 -25
- package/dist/utils/nostics.d.mts +2 -0
- package/dist/utils/nostics.mjs +2 -0
- package/dist/utils/open.d.mts +2 -10
- package/dist/utils/open.mjs +56 -1
- package/dist/utils/remote-assets.d.mts +15 -0
- package/dist/utils/remote-assets.mjs +2 -0
- package/dist/utils/serve-static.d.mts +13 -5
- package/dist/utils/serve-static.mjs +119 -9
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/simple-schema.d.mts +101 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/validation-CpXFB6Dz.mjs +266 -0
- package/dist/wire-codec-0K-o5MYW.mjs +56 -0
- package/dist/{ws-client-B6Tnr0ic.d.mts → ws-client-DhjNyQo3.d.mts} +7 -2
- package/dist/ws-server-BdSLrhxE.mjs +267 -0
- package/dist/{ws-server-uKQcClcJ.d.mts → ws-server-D1d3QM9f.d.mts} +90 -9
- package/package.json +13 -12
- package/skills/devframe/SKILL.md +91 -93
- package/dist/_shared-bWRzeSa0.mjs +0 -19
- package/dist/adapters/cli.d.mts +0 -11
- package/dist/adapters/cli.mjs +0 -6
- package/dist/cac-D4_9ok0z.mjs +0 -157
- package/dist/dev-Bc49u3qg.mjs +0 -439
- package/dist/diagnostics-reporter-CsIG85Q5.mjs +0 -38
- package/dist/helpers/vite.d.mts +0 -100
- package/dist/helpers/vite.mjs +0 -105
- package/dist/http-C4T68YV6.mjs +0 -38
- package/dist/index-vAX6bYuc.d.mts +0 -78
- package/dist/open-Deb5xmIT.mjs +0 -547
- package/dist/recipes/open-helpers.d.mts +0 -6
- package/dist/recipes/open-helpers.mjs +0 -6
- package/dist/server-CD8XmBXl.mjs +0 -167
- package/dist/server-UHWae43Q.d.mts +0 -149
- package/dist/simple-schema-BDzLeJDk.d.mts +0 -102
- package/dist/state-BeUHDDjk.mjs +0 -108
- package/dist/storage-CTNVbuFB.mjs +0 -1122
- package/dist/utils/promise.d.mts +0 -8
- package/dist/utils/promise.mjs +0 -15
- package/dist/utils/scope.d.mts +0 -11
- package/dist/utils/scope.mjs +0 -15
- package/skills/devframe/templates/spa-devframe.ts +0 -38
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { K as DevframeRpcClientFunctions, R as DevframeNodeRpcSession, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, q as DevframeRpcServerFunctions, s as DevframeSseOptions, u as DevframeAuthHandler } from "./devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
|
|
3
|
+
import "./index-CB-fSUyn.mjs";
|
|
4
|
+
import { BirpcGroup } from "birpc";
|
|
5
|
+
import { NodeAdapter } from "crossws/adapters/node";
|
|
6
|
+
import { Buffer } from "node:buffer";
|
|
7
|
+
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
8
|
+
import { Duplex } from "node:stream";
|
|
9
|
+
import { H3 } from "h3";
|
|
10
|
+
//#region src/node/instance-registry.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* One running devframe instance, as recorded in the instance registry.
|
|
13
|
+
* Records are self-describing JSON — additive fields are safe.
|
|
14
|
+
*/
|
|
15
|
+
interface DevframeInstanceRecord {
|
|
16
|
+
/** Process id of the dev server. */
|
|
17
|
+
pid: number;
|
|
18
|
+
/** Listening port. */
|
|
19
|
+
port: number;
|
|
20
|
+
/** Dialable HTTP origin, e.g. `http://127.0.0.1:9876`. */
|
|
21
|
+
origin: string;
|
|
22
|
+
/** Base path the devframe is mounted at (trailing slash). */
|
|
23
|
+
basePath: string;
|
|
24
|
+
/** Definition id. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Definition display name. */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** Working directory the instance was started from. */
|
|
29
|
+
rootDir: string;
|
|
30
|
+
/**
|
|
31
|
+
* Absolute URL path of the MCP Streamable-HTTP endpoint on `origin`, or
|
|
32
|
+
* `null` when the instance runs without an MCP route.
|
|
33
|
+
*/
|
|
34
|
+
mcp: {
|
|
35
|
+
path: string;
|
|
36
|
+
} | null;
|
|
37
|
+
/** Epoch-ms timestamp of registration. */
|
|
38
|
+
startedAt: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handle returned by {@link registerDevframeInstance}.
|
|
42
|
+
*/
|
|
43
|
+
interface DevframeInstanceRegistration {
|
|
44
|
+
/** The registry file backing this registration. */
|
|
45
|
+
readonly file: string;
|
|
46
|
+
/** Remove the record (idempotent). Call on server close. */
|
|
47
|
+
unregister: () => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Record a running devframe instance in the global instance registry so
|
|
51
|
+
* discovery tooling (`devframe connect`, editor integrations) can find it
|
|
52
|
+
* without port guessing.
|
|
53
|
+
*
|
|
54
|
+
* `createDevServer` registers automatically; custom hosts that serve a
|
|
55
|
+
* devframe in-process (e.g. `@devframes/next`'s host inside a Next dev
|
|
56
|
+
* server) call this explicitly with the origin they are reachable at.
|
|
57
|
+
*
|
|
58
|
+
* The record is written atomically to `<dir>/<pid>-<port>.json` and removed
|
|
59
|
+
* by {@link DevframeInstanceRegistration.unregister}. Records surviving a
|
|
60
|
+
* crash are pruned by readers whose liveness probe fails. Registration never
|
|
61
|
+
* throws — a write failure degrades to a coded warning (`DF0045`), since a
|
|
62
|
+
* dev server must not die over discovery metadata.
|
|
63
|
+
*/
|
|
64
|
+
declare function registerDevframeInstance(record: DevframeInstanceRecord, options?: {
|
|
65
|
+
instancesDir?: string;
|
|
66
|
+
}): DevframeInstanceRegistration;
|
|
67
|
+
/**
|
|
68
|
+
* Read the registry and split records into live and dead by probing each
|
|
69
|
+
* one's `__connection.json`, deleting dead records (prune-on-read). Live
|
|
70
|
+
* records carry the dialable origin the probe confirmed (a `localhost`
|
|
71
|
+
* record may come back as `127.0.0.1` / `[::1]`).
|
|
72
|
+
*
|
|
73
|
+
* A liveness probe only proves *something* answers on the record's port, so
|
|
74
|
+
* records left behind by killed processes shadow the server currently bound
|
|
75
|
+
* there: per `(port, basePath)` only the newest record survives, older
|
|
76
|
+
* ghosts are pruned with the dead.
|
|
77
|
+
*/
|
|
78
|
+
declare function listLiveDevframeInstances(options?: {
|
|
79
|
+
instancesDir?: string;
|
|
80
|
+
timeoutMs?: number;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
live: DevframeInstanceRecord[];
|
|
83
|
+
pruned: DevframeInstanceRecord[];
|
|
84
|
+
}>;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/node/instance-shell.d.ts
|
|
87
|
+
/**
|
|
88
|
+
* The live handle for a bound HTTP + WebSocket RPC server — what the
|
|
89
|
+
* side-car / shared-server tiers produce and what {@link createDevServer}
|
|
90
|
+
* re-exposes through its own return contract.
|
|
91
|
+
*/
|
|
92
|
+
interface StartedServer {
|
|
93
|
+
/** Listening origin, e.g. `http://localhost:9999`. */
|
|
94
|
+
origin: string;
|
|
95
|
+
port: number;
|
|
96
|
+
app: H3;
|
|
97
|
+
/**
|
|
98
|
+
* The crossws node adapter driving the RPC socket (connected peers,
|
|
99
|
+
* pub/sub). Absent when the WebSocket transport is disabled (`ws: false`).
|
|
100
|
+
*/
|
|
101
|
+
ws?: NodeAdapter;
|
|
102
|
+
rpcGroup: BirpcGroup<DevframeRpcClientFunctions, DevframeRpcServerFunctions, false>;
|
|
103
|
+
/**
|
|
104
|
+
* The {@link ConnectionMeta} descriptor for this server — the same shape a
|
|
105
|
+
* `__connection.json` route should serve so a devframe client's
|
|
106
|
+
* `resolveWsUrl` can dial back in.
|
|
107
|
+
*/
|
|
108
|
+
connectionMeta: () => ConnectionMeta;
|
|
109
|
+
close: () => Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* How the instance's RPC socket is bound:
|
|
113
|
+
*
|
|
114
|
+
* - `sidecar` — its own HTTP+WS server on a dedicated port (`ws.port` /
|
|
115
|
+
* `ws.sidecar`), advertised with that port.
|
|
116
|
+
* - `server` — a shared upgrade route on the host's `node:http` server.
|
|
117
|
+
* - `external` — no local transport: `ws.url` alone names a server that owns
|
|
118
|
+
* both the socket and its auth.
|
|
119
|
+
* - `unbound` — the transport exists but nothing is bound to it yet; the host
|
|
120
|
+
* drives it through {@link InstanceShell.handleUpgrade} /
|
|
121
|
+
* {@link InstanceShell.attach}.
|
|
122
|
+
* - `disabled` — `ws: false`: no WebSocket at all; clients connect over the
|
|
123
|
+
* SSE endpoint instead (`backend: 'sse'`).
|
|
124
|
+
*/
|
|
125
|
+
type InstanceWsTier = 'sidecar' | 'server' | 'external' | 'unbound' | 'disabled';
|
|
126
|
+
/** The live shell surface an `init` / `mount` callback can reach. */
|
|
127
|
+
interface InstanceShellApi {
|
|
128
|
+
/** The normalized mount base, with leading and trailing slash. */
|
|
129
|
+
base: string;
|
|
130
|
+
/** The h3 app every route is mounted on. */
|
|
131
|
+
app: H3;
|
|
132
|
+
/** The public origin, once known (pinned, or derived from the first request). */
|
|
133
|
+
origin: () => string | undefined;
|
|
134
|
+
/** The connection meta, once the transport has resolved. */
|
|
135
|
+
connectionMeta: () => ConnectionMeta | undefined;
|
|
136
|
+
}
|
|
137
|
+
/** What an instance's own initialization contributes to the shell. */
|
|
138
|
+
interface InstanceShellInit<TContext extends DevframeNodeContext> {
|
|
139
|
+
/** The context every mounted surface shares. */
|
|
140
|
+
context: TContext;
|
|
141
|
+
/** The `mcp` entry to advertise, when an MCP route was mounted. */
|
|
142
|
+
mcp?: ConnectionMeta['mcp'];
|
|
143
|
+
/** Torn down before the transport on `close()` (e.g. MCP sessions). */
|
|
144
|
+
dispose?: () => Promise<void>;
|
|
145
|
+
}
|
|
146
|
+
interface CreateInstanceShellOptions<TContext extends DevframeNodeContext> {
|
|
147
|
+
/** Normalized mount base (leading and trailing slash). */
|
|
148
|
+
base: string;
|
|
149
|
+
/** h3 app to mount on. A fresh one is created when omitted. */
|
|
150
|
+
app?: H3;
|
|
151
|
+
/** Public origin, or a getter. Derived from the first request when omitted. */
|
|
152
|
+
origin?: string | (() => string);
|
|
153
|
+
/** Resolved auth intent: `undefined`/`true` gates, `false` opts out, a handler installs a scheme. */
|
|
154
|
+
auth?: boolean | DevframeAuthHandler;
|
|
155
|
+
/** Host `node:http` server to share the WS upgrade with. */
|
|
156
|
+
server?: Server;
|
|
157
|
+
/** Explicit WebSocket control — see {@link DevframeWsOptions}. `false` disables the socket (SSE-only). */
|
|
158
|
+
ws?: DevframeWsOptions | false;
|
|
159
|
+
/** SSE endpoint control — enabled by default; `false` disables, an object renames the route. */
|
|
160
|
+
sse?: boolean | DevframeSseOptions;
|
|
161
|
+
/** Bind host for a side-car WebSocket server. Default: `localhost`. */
|
|
162
|
+
host?: string;
|
|
163
|
+
/** Extra WS-upgrade origins beyond the loopback default; `false` disables the gate. */
|
|
164
|
+
allowedOrigins?: readonly string[] | WsOriginRegistry | false;
|
|
165
|
+
/** Destroy off-route upgrades on a shared `server`. */
|
|
166
|
+
destroyUnmatchedUpgrades?: boolean;
|
|
167
|
+
onPeerConnect?: (connection: DevframeRpcConnection, session: DevframeNodeRpcSession) => void;
|
|
168
|
+
onPeerDisconnect?: (connection: DevframeRpcConnection, meta: DevframeNodeRpcSessionMeta) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Advertise the WS and SSE routes as base-absolute paths (`<base>__ws` /
|
|
171
|
+
* `<base>__sse`) instead of the base-relative default. A hub serves one
|
|
172
|
+
* meta document from several bases, so its clients need the absolute form
|
|
173
|
+
* to resolve the same endpoints.
|
|
174
|
+
*/
|
|
175
|
+
absoluteWsPath?: boolean;
|
|
176
|
+
/** Pick the first port a `ws.sidecar` server tries. Default: a random free port. */
|
|
177
|
+
resolveSidecarPort?: (host: string) => Promise<number>;
|
|
178
|
+
/**
|
|
179
|
+
* Publish this instance in the global registry (`~/.devframe/instances/`)
|
|
180
|
+
* once its public origin is known — a dynamic import so the registry code
|
|
181
|
+
* stays out of instances that opt out. Omit to skip registration.
|
|
182
|
+
*/
|
|
183
|
+
register?: InstanceRegisterConfig;
|
|
184
|
+
/** Create the context and mount everything that must precede the transport. */
|
|
185
|
+
init: (api: InstanceShellApi) => Promise<InstanceShellInit<TContext>>;
|
|
186
|
+
/** Mount the routes that describe the resolved transport (discovery, SPA). */
|
|
187
|
+
mount?: (context: TContext, meta: ConnectionMeta, api: InstanceShellApi) => void | Promise<void>;
|
|
188
|
+
/** Throw the instance's own diagnostic for `connectionMeta()` before readiness. */
|
|
189
|
+
onMetaUnavailable: () => never;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The identity a shell needs to publish itself in the global instance
|
|
193
|
+
* registry — the parts it can't derive on its own. The shell fills in
|
|
194
|
+
* `pid` / `origin` / `port` / `basePath` / `mcp` / `startedAt` once the
|
|
195
|
+
* origin resolves, then merges {@link InstanceRegisterConfig.overrides} last.
|
|
196
|
+
*/
|
|
197
|
+
interface InstanceRegisterConfig {
|
|
198
|
+
/** Definition id (or a synthetic one for a hub). */
|
|
199
|
+
id: string;
|
|
200
|
+
/** Display name. */
|
|
201
|
+
name?: string;
|
|
202
|
+
/** Working directory the instance runs from. Default: `process.cwd()`. */
|
|
203
|
+
rootDir?: string;
|
|
204
|
+
/** Fields overriding the shell-derived record (from the public option's object form). */
|
|
205
|
+
overrides?: Partial<DevframeInstanceRecord>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Translate the public `register?: boolean | Partial<DevframeInstanceRecord>`
|
|
209
|
+
* option into a shell {@link InstanceRegisterConfig}, or `undefined` when
|
|
210
|
+
* registration is opted out. The object form supplies record overrides on top
|
|
211
|
+
* of the caller-provided identity defaults.
|
|
212
|
+
*/
|
|
213
|
+
declare function resolveInstanceRegister(option: boolean | Partial<DevframeInstanceRecord> | undefined, defaults: {
|
|
214
|
+
id: string;
|
|
215
|
+
name?: string;
|
|
216
|
+
rootDir?: string;
|
|
217
|
+
}): InstanceRegisterConfig | undefined;
|
|
218
|
+
/** Live internals the first-party adapters read off an instance. */
|
|
219
|
+
interface InstanceShellInternals {
|
|
220
|
+
readonly started?: StartedServer;
|
|
221
|
+
readonly authHandler?: DevframeAuthHandler;
|
|
222
|
+
}
|
|
223
|
+
interface InstanceShell<TContext extends DevframeNodeContext> {
|
|
224
|
+
base: string;
|
|
225
|
+
handler: (request: Request) => Promise<Response>;
|
|
226
|
+
nodeMiddleware: (req: IncomingMessage, res: ServerResponse, next?: (err?: unknown) => void) => void;
|
|
227
|
+
ready: Promise<void>;
|
|
228
|
+
context: Promise<TContext>;
|
|
229
|
+
connectionMeta: () => ConnectionMeta;
|
|
230
|
+
/** Complete a host server's `upgrade` event on the instance's socket. */
|
|
231
|
+
handleUpgrade: (req: IncomingMessage, socket: Duplex, head: Buffer) => void;
|
|
232
|
+
/** Route a host server's `upgrade` events to the instance's socket. */
|
|
233
|
+
attach: (server: Server) => () => void;
|
|
234
|
+
close: () => Promise<void>;
|
|
235
|
+
internals: InstanceShellInternals;
|
|
236
|
+
}
|
|
237
|
+
/** Compare two URL paths ignoring a trailing slash. */
|
|
238
|
+
declare function samePath(a: string, b: string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* The shared machinery behind `initDevframe` and `initHub`: one mount base,
|
|
241
|
+
* one h3 app, one lazily-derived public origin (and the auth banner that waits
|
|
242
|
+
* for it), one WebSocket binding, and the fetch / connect-middleware pair that
|
|
243
|
+
* serves them. Each factory supplies only what makes it itself — its context,
|
|
244
|
+
* its routes, its diagnostics — through `init` / `mount`.
|
|
245
|
+
*
|
|
246
|
+
* Nothing here listens on a port unless a side-car was explicitly requested:
|
|
247
|
+
* the default tier leaves the socket `unbound`, so a host chains it onto its
|
|
248
|
+
* own server through {@link InstanceShell.attach} /
|
|
249
|
+
* {@link InstanceShell.handleUpgrade}.
|
|
250
|
+
*
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
253
|
+
declare function createInstanceShell<TContext extends DevframeNodeContext>(options: CreateInstanceShellOptions<TContext>): InstanceShell<TContext>;
|
|
254
|
+
//#endregion
|
|
255
|
+
export { InstanceShellInit as a, StartedServer as c, samePath as d, DevframeInstanceRecord as f, registerDevframeInstance as h, InstanceShellApi as i, createInstanceShell as l, listLiveDevframeInstances as m, InstanceRegisterConfig as n, InstanceShellInternals as o, DevframeInstanceRegistration as p, InstanceShell as r, InstanceWsTier as s, CreateInstanceShellOptions as t, resolveInstanceRegister as u };
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { Ct as DevframeAgentHost$1, P as DevframeHost, St as AgentToolProviderHandle, Tt as EventEmitter, _t as AgentResourceContent, bt as AgentToolInput, g as DevframeNodeContext, gt as AgentResource, ht as AgentManifest, mt as AgentHandle, vt as AgentResourceInput, wt as DevframeAgentHostEvents, xt as AgentToolProvider, yt as AgentTool } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { v as RpcFunctionDefinitionAny } from "../types-Djq7CBXh.mjs";
|
|
3
|
+
import { a as RemoteAssetsStore } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
4
|
+
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, h as registerDevframeInstance, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-CljiKq1c.mjs";
|
|
5
|
+
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-BPmX9fqK.mjs";
|
|
6
|
+
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-Cc4lucI0.mjs";
|
|
7
|
+
//#region src/node/agent-args.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* How {@link coerceAgentPositionalArgs} treats an args object that carries
|
|
10
|
+
* neither declared schemas nor `arg0`/`arg1`/… keys:
|
|
11
|
+
*
|
|
12
|
+
* - `'wrap'` — pass the object itself as the single positional argument.
|
|
13
|
+
* RPC-backed tools use this: an untyped RPC may take one raw object.
|
|
14
|
+
* - `'drop'` — call with zero arguments. Command-backed tools use this:
|
|
15
|
+
* a handler's positional parameters come solely from its declared
|
|
16
|
+
* `agent.args` schemas, so undeclared payload is ignored.
|
|
17
|
+
*/
|
|
18
|
+
type AgentArgsFallback = 'wrap' | 'drop';
|
|
19
|
+
/**
|
|
20
|
+
* Map the args payload an agent surface receives (MCP sends an object
|
|
21
|
+
* keyed `arg0`/`arg1`/…, matching the schema the adapter advertises) onto
|
|
22
|
+
* a handler's positional parameters. Shared by the agent host's RPC
|
|
23
|
+
* bridge and the hub's command-derived tools so the coercion cannot
|
|
24
|
+
* drift between them.
|
|
25
|
+
*
|
|
26
|
+
* - an array passes through as-is
|
|
27
|
+
* - `null`/`undefined` become a zero-argument call
|
|
28
|
+
* - with declared schemas, each schema reads its own `argN` key, in order
|
|
29
|
+
* - without schemas, `arg0`/`arg1`/… keys are collected when present
|
|
30
|
+
* - an empty object becomes a zero-argument call
|
|
31
|
+
* - anything else follows the {@link AgentArgsFallback}
|
|
32
|
+
*/
|
|
33
|
+
declare function coerceAgentPositionalArgs(args: unknown, schemas: readonly unknown[] | undefined, fallback?: AgentArgsFallback): unknown[];
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/node/diagnostics.d.ts
|
|
36
|
+
declare const diagnostics: import("nostics").Diagnostics<{
|
|
37
|
+
readonly DF0006: {
|
|
38
|
+
readonly why: (p: {
|
|
39
|
+
name: string;
|
|
40
|
+
}) => string;
|
|
41
|
+
};
|
|
42
|
+
readonly DF0007: {
|
|
43
|
+
readonly why: "AsyncLocalStorage is not set, it likely to be an internal bug of the Devframe foundation";
|
|
44
|
+
};
|
|
45
|
+
readonly DF0008: {
|
|
46
|
+
readonly why: (p: {
|
|
47
|
+
distDir: string;
|
|
48
|
+
}) => string;
|
|
49
|
+
};
|
|
50
|
+
readonly DF0012: {
|
|
51
|
+
readonly why: (p: {
|
|
52
|
+
filepath: string;
|
|
53
|
+
}) => string;
|
|
54
|
+
};
|
|
55
|
+
readonly DF0013: {
|
|
56
|
+
readonly why: (p: {
|
|
57
|
+
key: string;
|
|
58
|
+
}) => string;
|
|
59
|
+
};
|
|
60
|
+
readonly DF0014: {
|
|
61
|
+
readonly why: (p: {
|
|
62
|
+
name: string;
|
|
63
|
+
}) => string;
|
|
64
|
+
readonly fix: "Provide a short description (~1–3 sentences) explaining what the tool does and when agents should invoke it.";
|
|
65
|
+
};
|
|
66
|
+
readonly DF0015: {
|
|
67
|
+
readonly why: (p: {
|
|
68
|
+
id: string;
|
|
69
|
+
}) => string;
|
|
70
|
+
readonly fix: "Tool ids must be unique across RPC functions with an `agent` field and tools registered via `ctx.agent.registerTool()`.";
|
|
71
|
+
};
|
|
72
|
+
readonly DF0016: {
|
|
73
|
+
readonly why: (p: {
|
|
74
|
+
id: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
};
|
|
77
|
+
readonly DF0017: {
|
|
78
|
+
readonly why: (p: {
|
|
79
|
+
transport: string;
|
|
80
|
+
reason: string;
|
|
81
|
+
}) => string;
|
|
82
|
+
};
|
|
83
|
+
readonly DF0029: {
|
|
84
|
+
readonly why: (p: {
|
|
85
|
+
channel: string;
|
|
86
|
+
id: string;
|
|
87
|
+
dropped: number;
|
|
88
|
+
}) => string;
|
|
89
|
+
readonly fix: "The consumer is too slow for the producer. Raise `highWaterMark` on the subscription, slow the producer, or batch chunks.";
|
|
90
|
+
};
|
|
91
|
+
readonly DF0030: {
|
|
92
|
+
readonly why: (p: {
|
|
93
|
+
channel: string;
|
|
94
|
+
id: string;
|
|
95
|
+
}) => string;
|
|
96
|
+
readonly fix: "Ensure the server-side producer is running before clients subscribe, or check for typos in the stream id.";
|
|
97
|
+
};
|
|
98
|
+
readonly DF0031: {
|
|
99
|
+
readonly why: (p: {
|
|
100
|
+
channel: string;
|
|
101
|
+
id: string;
|
|
102
|
+
}) => string;
|
|
103
|
+
readonly fix: "Track the producer lifecycle — guard writes with the `stream.signal.aborted` flag.";
|
|
104
|
+
};
|
|
105
|
+
readonly DF0032: {
|
|
106
|
+
readonly why: (p: {
|
|
107
|
+
channel: string;
|
|
108
|
+
}) => string;
|
|
109
|
+
readonly fix: "Each channel name must be unique within a context. Pick a different name or reuse the existing channel handle.";
|
|
110
|
+
};
|
|
111
|
+
readonly DF0033: {
|
|
112
|
+
readonly why: (p: {
|
|
113
|
+
id: string;
|
|
114
|
+
reason: string;
|
|
115
|
+
}) => string;
|
|
116
|
+
readonly fix: "Verify the bridge port is free and the devframe setup function does not throw. Pin a port via `cli.port` / `cli.portRange` on the definition, or via `port` on `devframeViteBridge` (`@devframes/vite`).";
|
|
117
|
+
};
|
|
118
|
+
readonly DF0034: {
|
|
119
|
+
readonly why: (p: {
|
|
120
|
+
namespace: string;
|
|
121
|
+
name: string;
|
|
122
|
+
}) => string;
|
|
123
|
+
readonly fix: "A scoped context auto-namespaces ids. Pass a bare name without a \":\" separator (e.g. `register({ name: \"get-cwd\" })`), or use the unscoped `ctx.base.rpc.register` for a fully-qualified name.";
|
|
124
|
+
};
|
|
125
|
+
readonly DF0035: {
|
|
126
|
+
readonly why: (p: {
|
|
127
|
+
filepath: string;
|
|
128
|
+
}) => string;
|
|
129
|
+
readonly fix: "Check that the storage directory is writable and has free space.";
|
|
130
|
+
};
|
|
131
|
+
readonly DF0036: {
|
|
132
|
+
readonly why: (p: {
|
|
133
|
+
name: string;
|
|
134
|
+
}) => string;
|
|
135
|
+
readonly fix: "Complete the auth handshake (or connect with a static/pre-shared token) before calling a trusted method. Untrusted callers may only call `anonymous:`-prefixed methods — see `isAnonymousRpcMethod`.";
|
|
136
|
+
};
|
|
137
|
+
readonly DF0037: {
|
|
138
|
+
readonly why: (p: {
|
|
139
|
+
id: string;
|
|
140
|
+
}) => string;
|
|
141
|
+
readonly fix: "Service ids are unique per context. Revoke the existing provider first (the `provide()` call returns a revoke function), or namespace the id with your plugin id to avoid collisions.";
|
|
142
|
+
};
|
|
143
|
+
readonly DF0042: {
|
|
144
|
+
readonly why: (p: {
|
|
145
|
+
id: string;
|
|
146
|
+
}) => string;
|
|
147
|
+
readonly fix: "Pass `{ force: true }` to `createBuild()` if the degraded export is still useful to you, or drop `capabilities.build: false` on the definition.";
|
|
148
|
+
};
|
|
149
|
+
readonly DF0045: {
|
|
150
|
+
readonly why: (p: {
|
|
151
|
+
file: string;
|
|
152
|
+
reason: string;
|
|
153
|
+
}) => string;
|
|
154
|
+
readonly fix: "Discovery tooling (`devframe connect`) will not see this instance. Check that the registry directory is writable, point `DEVFRAME_INSTANCES_DIR` at a writable directory, or set `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` to opt out of registration.";
|
|
155
|
+
};
|
|
156
|
+
readonly DF0046: {
|
|
157
|
+
readonly why: (p: {
|
|
158
|
+
reason: string;
|
|
159
|
+
}) => string;
|
|
160
|
+
readonly fix: "Install it next to devframe (e.g. `npm install @modelcontextprotocol/server`) and run `devframe connect` again.";
|
|
161
|
+
};
|
|
162
|
+
readonly DF0047: {
|
|
163
|
+
readonly why: (p: {
|
|
164
|
+
name: string;
|
|
165
|
+
id: string;
|
|
166
|
+
existing: string;
|
|
167
|
+
}) => string;
|
|
168
|
+
readonly fix: "Wire names derive from tool ids (characters outside [a-zA-Z0-9_-] become \"_\"). Rename one of the two ids so they sanitize to distinct names.";
|
|
169
|
+
};
|
|
170
|
+
readonly DF0048: {
|
|
171
|
+
readonly why: (p: {
|
|
172
|
+
key: string;
|
|
173
|
+
}) => string;
|
|
174
|
+
readonly fix: "Call the devframe_state_read tool without arguments to list the available keys, then retry with one of them.";
|
|
175
|
+
};
|
|
176
|
+
readonly DF0049: {
|
|
177
|
+
readonly why: "The devframe_connect_call-tool tool requires { port: number, tool: string }.";
|
|
178
|
+
readonly fix: "Call devframe_connect_list-instances to get the port and tool names, then retry.";
|
|
179
|
+
};
|
|
180
|
+
readonly DF0050: {
|
|
181
|
+
readonly why: (p: {
|
|
182
|
+
port: number;
|
|
183
|
+
}) => string;
|
|
184
|
+
readonly fix: "Call devframe_connect_list-instances for the current instance list — the instance may have stopped or changed port.";
|
|
185
|
+
};
|
|
186
|
+
readonly DF0051: {
|
|
187
|
+
readonly why: (p: {
|
|
188
|
+
port: number;
|
|
189
|
+
}) => string;
|
|
190
|
+
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.";
|
|
191
|
+
};
|
|
192
|
+
readonly DF0052: {
|
|
193
|
+
readonly why: (p: {
|
|
194
|
+
host: string;
|
|
195
|
+
port: number;
|
|
196
|
+
reason: string;
|
|
197
|
+
}) => string;
|
|
198
|
+
readonly fix: "The port is likely already taken by another process (often a previous devframe instance). Free it, or pick another via `--port`, `cli.port` / `cli.portRange` on the definition, or `port` on `devframeViteBridge` (`@devframes/vite`). The original node error is available as `error.cause`.";
|
|
199
|
+
};
|
|
200
|
+
readonly DF0054: {
|
|
201
|
+
readonly why: (p: {
|
|
202
|
+
id: string;
|
|
203
|
+
}) => string;
|
|
204
|
+
readonly fix: "Await `instance.ready` (or any request through `instance.handler`) before reading `connectionMeta()` — the WebSocket binding it describes is only known once initialization completes.";
|
|
205
|
+
};
|
|
206
|
+
readonly DF0055: {
|
|
207
|
+
readonly why: (p: {
|
|
208
|
+
tier: string;
|
|
209
|
+
}) => string;
|
|
210
|
+
readonly fix: "Drop `handleUpgrade`/`attach` and let the configured transport serve the socket, or remove `server` / `ws.port` / `ws.sidecar` from the options so the instance leaves the binding to you.";
|
|
211
|
+
};
|
|
212
|
+
readonly DF0056: {
|
|
213
|
+
readonly why: (p: {
|
|
214
|
+
url: string;
|
|
215
|
+
}) => string;
|
|
216
|
+
readonly fix: "The server behind `ws.url` owns the transport (and its auth). Drop `ws.url` to have the instance serve the socket, or pair it with `server` / `ws.port` / `ws.sidecar` for the tunnel pattern, where a local binding is advertised through the relay.";
|
|
217
|
+
};
|
|
218
|
+
readonly DF0057: {
|
|
219
|
+
readonly why: () => string;
|
|
220
|
+
readonly fix: "Clients connect over the SSE endpoint instead — no upgrade wiring is needed. Remove `ws: false` if the instance should serve a WebSocket after all.";
|
|
221
|
+
};
|
|
222
|
+
readonly DF0058: {
|
|
223
|
+
readonly why: (p: {
|
|
224
|
+
id: string;
|
|
225
|
+
}) => string;
|
|
226
|
+
readonly fix: "Pass `{ force: true }` to `createDevServer()` to run it anyway, or drop `capabilities.dev: false` on the definition.";
|
|
227
|
+
};
|
|
228
|
+
readonly DF0059: {
|
|
229
|
+
readonly why: (p: {
|
|
230
|
+
package: string;
|
|
231
|
+
version: string;
|
|
232
|
+
provider: string;
|
|
233
|
+
reason: string;
|
|
234
|
+
}) => string;
|
|
235
|
+
readonly fix: "Requests fall back to probing the provider per file. Check network access to the provider, or install the assets package locally so no listing is needed.";
|
|
236
|
+
};
|
|
237
|
+
readonly DF0060: {
|
|
238
|
+
readonly why: (p: {
|
|
239
|
+
url: string;
|
|
240
|
+
package: string;
|
|
241
|
+
reason: string;
|
|
242
|
+
}) => string;
|
|
243
|
+
readonly fix: "Install the assets package locally (`npm install <package>`) to serve it with zero network, or check network access to the configured provider.";
|
|
244
|
+
};
|
|
245
|
+
readonly DF0061: {
|
|
246
|
+
readonly why: (p: {
|
|
247
|
+
package: string;
|
|
248
|
+
required: string;
|
|
249
|
+
installed: string;
|
|
250
|
+
}) => string;
|
|
251
|
+
readonly fix: "Align the installed assets package with the version its node package declares — they are published in lockstep.";
|
|
252
|
+
};
|
|
253
|
+
readonly DF0062: {
|
|
254
|
+
readonly why: (p: {
|
|
255
|
+
package: string;
|
|
256
|
+
required: string;
|
|
257
|
+
installed: string;
|
|
258
|
+
}) => string;
|
|
259
|
+
readonly fix: "Install the exact declared version to serve byte-identical assets.";
|
|
260
|
+
};
|
|
261
|
+
readonly DF0063: {
|
|
262
|
+
readonly why: (p: {
|
|
263
|
+
filepath: string;
|
|
264
|
+
reason: string;
|
|
265
|
+
}) => string;
|
|
266
|
+
readonly fix: "The response was still served; only caching failed. Check that the cache directory is writable and has free space.";
|
|
267
|
+
};
|
|
268
|
+
readonly DF0064: {
|
|
269
|
+
readonly why: (p: {
|
|
270
|
+
package: string;
|
|
271
|
+
version: string;
|
|
272
|
+
reason: string;
|
|
273
|
+
}) => string;
|
|
274
|
+
readonly fix: "Static builds need every asset file up front. Install the assets package locally, or ensure the provider (and its file-listing API) is reachable during the build.";
|
|
275
|
+
};
|
|
276
|
+
readonly DF0065: {
|
|
277
|
+
readonly why: (p: {
|
|
278
|
+
field: "package" | "version";
|
|
279
|
+
value: string;
|
|
280
|
+
}) => string;
|
|
281
|
+
readonly fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`) — they are interpolated into CDN URLs and the cache path.";
|
|
282
|
+
};
|
|
283
|
+
}, readonly [(d: import("nostics").Diagnostic, { method }?: {
|
|
284
|
+
method?: "log" | "warn" | "error";
|
|
285
|
+
}) => void]>;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/node/host-agent.d.ts
|
|
288
|
+
/**
|
|
289
|
+
* Framework-neutral host aggregating the agent-exposed surface of a
|
|
290
|
+
* devframe. Auto-discovers RPC functions with an `agent` field from
|
|
291
|
+
* `ctx.rpc.definitions`, and accepts plugin-registered tools /
|
|
292
|
+
* resources via `registerTool` / `registerResource`.
|
|
293
|
+
*/
|
|
294
|
+
declare class DevframeAgentHost implements DevframeAgentHost$1 {
|
|
295
|
+
readonly context: DevframeNodeContext;
|
|
296
|
+
readonly events: EventEmitter<DevframeAgentHostEvents>;
|
|
297
|
+
private readonly tools;
|
|
298
|
+
private readonly resources;
|
|
299
|
+
private readonly providers;
|
|
300
|
+
private _rpcUnsubscribe;
|
|
301
|
+
constructor(context: DevframeNodeContext);
|
|
302
|
+
registerTool(input: AgentToolInput): AgentHandle;
|
|
303
|
+
unregisterTool(id: string): boolean;
|
|
304
|
+
registerToolProvider(provider: AgentToolProvider): AgentToolProviderHandle;
|
|
305
|
+
registerResource(input: AgentResourceInput): AgentHandle;
|
|
306
|
+
unregisterResource(id: string): boolean;
|
|
307
|
+
list(): AgentManifest;
|
|
308
|
+
getTool(id: string): AgentTool | undefined;
|
|
309
|
+
getResource(id: string): AgentResource | undefined;
|
|
310
|
+
invoke(id: string, args: unknown): Promise<unknown>;
|
|
311
|
+
read(id: string): Promise<AgentResourceContent>;
|
|
312
|
+
/** @internal */
|
|
313
|
+
_dispose(): void;
|
|
314
|
+
private _validateToolId;
|
|
315
|
+
private _projectTool;
|
|
316
|
+
/** Query every registered provider, projecting inputs to serializable tools. */
|
|
317
|
+
private _collectProviderTools;
|
|
318
|
+
private _collectRpcTools;
|
|
319
|
+
private _findRpcDefinition;
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/node/host-h3.d.ts
|
|
323
|
+
interface CreateH3DevframeHostOptions {
|
|
324
|
+
/**
|
|
325
|
+
* Host the standalone server listens on, e.g. `http://localhost:9999`.
|
|
326
|
+
* Consumed by `resolveOrigin` for dock entries that need an absolute URL.
|
|
327
|
+
* Pass a function for hosts that only learn their public origin later
|
|
328
|
+
* (e.g. `createHandler` derives it from the first incoming request).
|
|
329
|
+
*/
|
|
330
|
+
origin: string | (() => string);
|
|
331
|
+
/**
|
|
332
|
+
* Register a static-file handler at `base` serving files from `source` —
|
|
333
|
+
* a local directory or a resolved remote-assets back-proxy store (both
|
|
334
|
+
* accepted by `devframe/utils/serve-static`). `mountStatic` forwards to
|
|
335
|
+
* it; when omitted the host serves no SPA (bridge mode, where the SPA is
|
|
336
|
+
* hosted elsewhere).
|
|
337
|
+
*/
|
|
338
|
+
mount?: (base: string, source: string | RemoteAssetsStore) => void | Promise<void>;
|
|
339
|
+
/**
|
|
340
|
+
* Namespace for storage paths returned by `getStorageDir`. Workspace
|
|
341
|
+
* state (committable) lives under `${workspaceRoot}/.devframe/`, project
|
|
342
|
+
* state under `${workspaceRoot}/node_modules/.<appName>/devframe/`, and
|
|
343
|
+
* global state under `${homedir()}/.<appName>/devframe/`. Pick the
|
|
344
|
+
* devtool's id (or another stable, filesystem-safe identifier) so the
|
|
345
|
+
* standalone host doesn't collide with other tools' storage.
|
|
346
|
+
*/
|
|
347
|
+
appName: string;
|
|
348
|
+
/**
|
|
349
|
+
* Workspace root used as the parent of the per-project storage
|
|
350
|
+
* directory. Defaults to `process.cwd()`.
|
|
351
|
+
*/
|
|
352
|
+
workspaceRoot?: string;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* h3-backed {@link DevframeHost} — used by the standalone CLI adapter.
|
|
356
|
+
*/
|
|
357
|
+
declare function createH3DevframeHost(options: CreateH3DevframeHostOptions): DevframeHost;
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/node/utils.d.ts
|
|
360
|
+
declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/rpc/wire-codec.d.ts
|
|
363
|
+
/**
|
|
364
|
+
* The per-connection `serialize`/`deserialize` pair for a live RPC wire.
|
|
365
|
+
*
|
|
366
|
+
* @internal
|
|
367
|
+
*/
|
|
368
|
+
interface RpcWireCodec {
|
|
369
|
+
serialize: (msg: any) => string;
|
|
370
|
+
deserialize: (raw: string) => any;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Build the per-connection wire codec every live transport (WS server, WS
|
|
374
|
+
* client, SSE server, SSE client) shares: per-method dispatch between strict
|
|
375
|
+
* JSON (methods declared `jsonSerializable: true`) and `s:`-prefixed
|
|
376
|
+
* structured-clone (everything else, including all error envelopes), with a
|
|
377
|
+
* request-id → method map so a response independently picks the same
|
|
378
|
+
* encoder as its request. One codec per connection — request-id spaces
|
|
379
|
+
* don't collide across connections.
|
|
380
|
+
*
|
|
381
|
+
* @internal
|
|
382
|
+
*/
|
|
383
|
+
declare function createRpcWireCodec(definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>): RpcWireCodec;
|
|
384
|
+
/**
|
|
385
|
+
* Peek at a wire frame's birpc envelope without engaging a codec's
|
|
386
|
+
* request-id bookkeeping — used by the SSE transport to route a frame
|
|
387
|
+
* (park a POST for its response / answer with a bare 202) before it is
|
|
388
|
+
* handed to birpc proper.
|
|
389
|
+
*
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
392
|
+
declare function peekRpcWireFrame(raw: string): {
|
|
393
|
+
t?: string;
|
|
394
|
+
i?: string;
|
|
395
|
+
};
|
|
396
|
+
//#endregion
|
|
397
|
+
export { type AgentArgsFallback, type ContextRpcServer, type CreateContextRpcServerOptions, CreateH3DevframeHostOptions, type CreateInstanceShellOptions, DevframeAgentHost, type DevframeInstanceRecord, type DevframeInstanceRegistration, type InstanceRegisterConfig, type InstanceShell, type InstanceShellApi, type InstanceShellInit, type InstanceShellInternals, type InstanceWsTier, type RpcWireCodec, type StartedServer, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, listLiveDevframeInstances, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveInstanceRegister, samePath };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-0K-o5MYW.mjs";
|
|
2
|
+
import { t as diagnostics } from "../diagnostics-DOQPnQmX.mjs";
|
|
3
|
+
import { n as coerceAgentPositionalArgs, t as DevframeAgentHost } from "../host-agent-xLCSe65D.mjs";
|
|
4
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-CbZ_yhbz.mjs";
|
|
5
|
+
import { t as createH3DevframeHost } from "../host-h3-Crkzm42q.mjs";
|
|
6
|
+
import { i as registerDevframeInstance, n as listLiveDevframeInstances } from "../instance-registry-WvQkt42E.mjs";
|
|
7
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-CMFyszWJ.mjs";
|
|
8
|
+
import { t as createContextRpcServer } from "../rpc-core-DMTe-hLo.mjs";
|
|
9
|
+
export { DevframeAgentHost, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, listLiveDevframeInstances, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveInstanceRegister, samePath };
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-
|
|
1
|
+
import { u as DevframeAuthHandler } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-CB-fSUyn.mjs";
|
|
3
3
|
export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-DZbJ7Cl0.mjs";
|
|
2
|
-
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-
|
|
2
|
+
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-Cc1IeSmQ.mjs";
|
|
3
3
|
export { buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|