@devframes/plugin-inspect 0.9.11 → 0.9.15

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.
@@ -6,6 +6,5 @@ import { CacHandle } from "devframe/adapters/cac";
6
6
  * default {@link createInspectDevframe} definition with devframe's
7
7
  * `dev` / `build` / `mcp` command shell.
8
8
  */
9
- declare function createInspectCli(): CacHandle;
10
- //#endregion
11
- export { createInspectCli };
9
+ export declare function createInspectCli(): CacHandle;
10
+ //#endregion
package/dist/node/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createInspectDevframe } from "../node-C5uLV826.mjs";
1
+ import { t as createInspectDevframe } from "../node-f359n-2O.mjs";
2
2
  import { createCac } from "devframe/adapters/cac";
3
3
  //#region src/node/cli.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { t as createInspectDevframe } from "../node-C5uLV826.mjs";
1
+ import { t as createInspectDevframe } from "../node-f359n-2O.mjs";
2
2
  export { createInspectDevframe, createInspectDevframe as default };
@@ -5,7 +5,7 @@ import { RpcDefinitionsToFunctions } from "devframe/rpc";
5
5
  * The introspection RPC functions registered by the inspector plugin.
6
6
  * Namespaced `devframes:plugin:inspect:*` per the plugin convention.
7
7
  */
8
- declare const serverFunctions: readonly [{
8
+ export declare const serverFunctions: readonly [{
9
9
  name: "devframes:plugin:inspect:list-functions";
10
10
  type?: "query" | undefined;
11
11
  cacheable?: boolean;
@@ -135,5 +135,4 @@ declare const serverFunctions: readonly [{
135
135
  declare module 'devframe' {
136
136
  interface DevframeRpcServerFunctions extends RpcDefinitionsToFunctions<typeof serverFunctions> {}
137
137
  }
138
- //#endregion
139
- export { serverFunctions };
138
+ //#endregion
@@ -1,2 +1,2 @@
1
- import { t as serverFunctions } from "../../rpc-C0wtIiYp.mjs";
1
+ import { t as serverFunctions } from "../../rpc-B1wXP13m.mjs";
2
2
  export { serverFunctions };
@@ -6,6 +6,6 @@ import { DevframeNodeContext } from "devframe";
6
6
  * node context. Called from the definition's `setup(ctx)` and reusable
7
7
  * by host adapters that wire their own context.
8
8
  */
9
- declare function setupInspect(ctx: DevframeNodeContext): void;
9
+ export declare function setupInspect(ctx: DevframeNodeContext): void;
10
10
  //#endregion
11
- export { serverFunctions, setupInspect };
11
+ export { serverFunctions };
@@ -1,4 +1,4 @@
1
- import { t as serverFunctions } from "../rpc-C0wtIiYp.mjs";
1
+ import { t as serverFunctions } from "../rpc-B1wXP13m.mjs";
2
2
  //#region src/node/setup.ts
3
3
  /**
4
4
  * Register the inspector's introspection RPC functions on a devframe
@@ -2,7 +2,7 @@ import { setupInspect } from "./node/setup.mjs";
2
2
  import { defineDevframe } from "devframe";
3
3
  //#region package.json
4
4
  var name = "@devframes/plugin-inspect";
5
- var version = "0.9.11";
5
+ var version = "0.9.15";
6
6
  var description = "Devframe plugin that inspects the RPC registry, shared state, and agent surface of a connection.";
7
7
  var homepage = "https://github.com/devframes/devframe#readme";
8
8
  //#endregion
@@ -1,16 +1,7 @@
1
- import { createDefineWrapperWithContext } from "devframe/rpc";
1
+ import { defineRpcFunction } from "devframe";
2
2
  import { defineDiagnostics } from "devframe/utils/nostics";
3
3
  import process from "node:process";
4
4
  import { listLiveDevframeInstances } from "devframe/internal";
5
- //#region src/node/rpc/functions/_define.ts
6
- /**
7
- * `defineRpcFunction` pre-bound to the framework-neutral
8
- * {@link DevframeNodeContext}, so each inspector function's `setup(ctx)`
9
- * receives the typed node context (`ctx.rpc`, `ctx.agent`, …) instead of
10
- * the default `undefined` context.
11
- */
12
- const defineInspectRpc = createDefineWrapperWithContext();
13
- //#endregion
14
5
  //#region src/node/rpc/functions/describe-agent.ts
15
6
  /**
16
7
  * Surface the agent-exposed surface of the connection: the unified
@@ -18,7 +9,7 @@ const defineInspectRpc = createDefineWrapperWithContext();
18
9
  * host-registered tools) and readable resources. `snapshot: true` bakes
19
10
  * the manifest into the static dump for `build`/`spa` mode.
20
11
  */
21
- const describeAgent = defineInspectRpc({
12
+ const describeAgent = defineRpcFunction({
22
13
  name: "devframes:plugin:inspect:describe-agent",
23
14
  type: "query",
24
15
  jsonSerializable: true,
@@ -104,7 +95,7 @@ function projectCommand(cmd) {
104
95
  * group-only command with no handler, surfaces as `{ ok: false, error }`
105
96
  * from the hub's own `commands.execute()` instead of throwing.
106
97
  */
107
- const executeCommand = defineInspectRpc({
98
+ const executeCommand = defineRpcFunction({
108
99
  name: "devframes:plugin:inspect:execute-command",
109
100
  type: "action",
110
101
  setup: (ctx) => ({ handler: async (id, args = []) => {
@@ -143,7 +134,7 @@ const INVOKABLE_TYPES$1 = /* @__PURE__ */ new Set(["query", "static"]);
143
134
  * (default) so arbitrary return values round-trip without the strict-JSON
144
135
  * constraints that `jsonSerializable: true` would impose.
145
136
  */
146
- const invoke = defineInspectRpc({
137
+ const invoke = defineRpcFunction({
147
138
  name: "devframes:plugin:inspect:invoke",
148
139
  type: "action",
149
140
  setup: (ctx) => ({ handler: async (name, args = []) => {
@@ -177,7 +168,7 @@ const invoke = defineInspectRpc({
177
168
  });
178
169
  //#endregion
179
170
  //#region src/node/rpc/functions/invoke-agent-tool.ts
180
- const invokeAgentTool = defineInspectRpc({
171
+ const invokeAgentTool = defineRpcFunction({
181
172
  name: "devframes:plugin:inspect:invoke-agent-tool",
182
173
  type: "action",
183
174
  setup: (ctx) => ({ handler: async (id, args) => {
@@ -213,7 +204,7 @@ const invokeAgentTool = defineInspectRpc({
213
204
  * `snapshot: true` bakes the (possibly empty) list into the static dump so
214
205
  * the inspector still lists commands in `build`/`spa` mode.
215
206
  */
216
- const listCommands = defineInspectRpc({
207
+ const listCommands = defineRpcFunction({
217
208
  name: "devframes:plugin:inspect:list-commands",
218
209
  type: "query",
219
210
  jsonSerializable: true,
@@ -231,11 +222,45 @@ const listCommands = defineInspectRpc({
231
222
  } })
232
223
  });
233
224
  //#endregion
234
- //#region src/node/rpc/functions/_schema.ts
225
+ //#region src/function-info.ts
235
226
  const FALLBACK_SCHEMA = Object.freeze({
236
227
  type: "object",
237
228
  additionalProperties: true
238
229
  });
230
+ /** Function types the inspector invokes (read-only; no side effects). */
231
+ const INVOKABLE_TYPES = /* @__PURE__ */ new Set(["query", "static"]);
232
+ /**
233
+ * Project one registered RPC definition into the JSON-safe
234
+ * {@link RpcFunctionInfo} the inspector renders. Shared by the node-side
235
+ * `list-functions` RPC and the browser-side Client tab (which projects
236
+ * `rpc.client` definitions locally), so the two listings cannot drift.
237
+ */
238
+ function projectRpcFunctionInfo(name, fn) {
239
+ const type = fn.type ?? "query";
240
+ let agent;
241
+ if (fn.agent) agent = {
242
+ description: fn.agent.description,
243
+ title: fn.agent.title,
244
+ safety: fn.agent.safety,
245
+ tags: fn.agent.tags
246
+ };
247
+ return {
248
+ name,
249
+ type,
250
+ jsonSerializable: fn.jsonSerializable === true,
251
+ snapshot: fn.snapshot === true,
252
+ cacheable: fn.cacheable === true,
253
+ hasArgs: !!fn.args,
254
+ hasReturns: !!fn.returns,
255
+ hasDump: !!fn.dump,
256
+ hasSetup: !!fn.setup,
257
+ hasHandler: !!fn.handler,
258
+ invokable: INVOKABLE_TYPES.has(type),
259
+ agent,
260
+ argsSchema: argsSchemaToJson(fn.args),
261
+ returnsSchema: returnSchemaToJson(fn.returns)
262
+ };
263
+ }
239
264
  /**
240
265
  * Convert a schema to JSON Schema for the inspector, vendor-neutrally.
241
266
  *
@@ -277,14 +302,13 @@ function argsSchemaToJson(args) {
277
302
  }
278
303
  //#endregion
279
304
  //#region src/node/rpc/functions/list-functions.ts
280
- const INVOKABLE_TYPES = /* @__PURE__ */ new Set(["query", "static"]);
281
305
  /**
282
306
  * Enumerate every RPC function registered on the connection, projecting
283
307
  * each definition's metadata into a JSON-safe {@link RpcFunctionInfo}.
284
308
  * `snapshot: true` bakes the registry into the static dump so the
285
309
  * inspector still lists functions in `build`/`spa` mode.
286
310
  */
287
- const listFunctions = defineInspectRpc({
311
+ const listFunctions = defineRpcFunction({
288
312
  name: "devframes:plugin:inspect:list-functions",
289
313
  type: "query",
290
314
  jsonSerializable: true,
@@ -295,32 +319,7 @@ const listFunctions = defineInspectRpc({
295
319
  },
296
320
  setup: (ctx) => ({ handler: async () => {
297
321
  const out = [];
298
- for (const [name, fn] of ctx.rpc.definitions) {
299
- const type = fn.type ?? "query";
300
- let agent;
301
- if (fn.agent) agent = {
302
- description: fn.agent.description,
303
- title: fn.agent.title,
304
- safety: fn.agent.safety,
305
- tags: fn.agent.tags
306
- };
307
- out.push({
308
- name,
309
- type,
310
- jsonSerializable: fn.jsonSerializable === true,
311
- snapshot: fn.snapshot === true,
312
- cacheable: fn.cacheable === true,
313
- hasArgs: !!fn.args,
314
- hasReturns: !!fn.returns,
315
- hasDump: !!fn.dump,
316
- hasSetup: !!fn.setup,
317
- hasHandler: !!fn.handler,
318
- invokable: INVOKABLE_TYPES.has(type),
319
- agent,
320
- argsSchema: argsSchemaToJson(fn.args),
321
- returnsSchema: returnSchemaToJson(fn.returns)
322
- });
323
- }
322
+ for (const [name, fn] of ctx.rpc.definitions) out.push(projectRpcFunctionInfo(name, fn));
324
323
  out.sort((a, b) => a.name.localeCompare(b.name));
325
324
  return out;
326
325
  } })
@@ -339,7 +338,7 @@ const listFunctions = defineInspectRpc({
339
338
  * instance discovery to agents over MCP, so exposing it here would duplicate
340
339
  * that surface).
341
340
  */
342
- const listInstances = defineInspectRpc({
341
+ const listInstances = defineRpcFunction({
343
342
  name: "devframes:plugin:inspect:list-instances",
344
343
  type: "query",
345
344
  jsonSerializable: true,
@@ -370,7 +369,7 @@ const listInstances = defineInspectRpc({
370
369
  const serverFunctions = [
371
370
  listFunctions,
372
371
  invoke,
373
- defineInspectRpc({
372
+ defineRpcFunction({
374
373
  name: "devframes:plugin:inspect:list-state-keys",
375
374
  type: "query",
376
375
  jsonSerializable: true,
@@ -385,7 +384,7 @@ const serverFunctions = [
385
384
  }),
386
385
  describeAgent,
387
386
  invokeAgentTool,
388
- defineInspectRpc({
387
+ defineRpcFunction({
389
388
  name: "devframes:plugin:inspect:read-agent-resource",
390
389
  type: "action",
391
390
  setup: (ctx) => ({ handler: async (id) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-inspect",
3
3
  "type": "module",
4
- "version": "0.9.11",
4
+ "version": "0.9.15",
5
5
  "description": "Devframe plugin that inspects the RPC registry, shared state, and agent surface of a connection.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  "dist"
36
36
  ],
37
37
  "peerDependencies": {
38
- "@devframes/plugin-inspect--assets": "0.9.11",
39
- "devframe": "0.9.11",
38
+ "@devframes/plugin-inspect--assets": "0.9.15",
39
+ "devframe": "0.9.15",
40
40
  "vite": "^7.0.0 || ^8.0.0"
41
41
  },
42
42
  "peerDependenciesMeta": {
@@ -52,25 +52,25 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@antfu/design": "^0.4.0",
55
- "@devframes/hub": "0.9.11",
56
- "@devframes/plugin-inspect--assets": "0.9.11",
57
- "@devframes/vite": "0.9.11",
55
+ "@devframes/hub": "0.9.15",
56
+ "@devframes/plugin-inspect--assets": "0.9.15",
57
+ "@devframes/vite": "0.9.15",
58
58
  "@iconify-json/ph": "^1.2.2",
59
59
  "@standard-schema/spec": "^1.1.0",
60
- "@storybook/addon-docs": "^10.5.10",
61
- "@storybook/vue3-vite": "^10.5.10",
62
- "@unocss/preset-icons": "^66.8.1",
60
+ "@storybook/addon-docs": "^10.6.0",
61
+ "@storybook/vue3-vite": "^10.6.0",
62
+ "@unocss/preset-icons": "^66.10.0",
63
63
  "@vitejs/plugin-vue": "^6.0.8",
64
64
  "colorjs.io": "^0.7.1",
65
- "devframe": "0.9.11",
65
+ "devframe": "0.9.15",
66
66
  "floating-vue": "^5.2.2",
67
- "h3": "^2.0.1-rc.29",
67
+ "h3": "^2.0.1-rc.31",
68
68
  "reka-ui": "^2.10.4",
69
- "storybook": "^10.5.10",
70
- "tsdown": "^0.22.14",
71
- "unocss": "^66.8.1",
69
+ "storybook": "^10.6.0",
70
+ "tsdown": "^0.23.0",
71
+ "unocss": "^66.10.0",
72
72
  "vite": "^8.2.2",
73
- "vitest": "^4.1.11",
73
+ "vitest": "^5.0.0",
74
74
  "vue": "^3.5.42",
75
75
  "ws": "^8.21.3"
76
76
  },