@devframes/plugin-inspect 0.9.12 → 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-BvkEPG3A.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-BvkEPG3A.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-Crj317XM.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-Crj317XM.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.12";
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
@@ -222,11 +222,45 @@ const listCommands = defineRpcFunction({
222
222
  } })
223
223
  });
224
224
  //#endregion
225
- //#region src/node/rpc/functions/_schema.ts
225
+ //#region src/function-info.ts
226
226
  const FALLBACK_SCHEMA = Object.freeze({
227
227
  type: "object",
228
228
  additionalProperties: true
229
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
+ }
230
264
  /**
231
265
  * Convert a schema to JSON Schema for the inspector, vendor-neutrally.
232
266
  *
@@ -268,7 +302,6 @@ function argsSchemaToJson(args) {
268
302
  }
269
303
  //#endregion
270
304
  //#region src/node/rpc/functions/list-functions.ts
271
- const INVOKABLE_TYPES = /* @__PURE__ */ new Set(["query", "static"]);
272
305
  /**
273
306
  * Enumerate every RPC function registered on the connection, projecting
274
307
  * each definition's metadata into a JSON-safe {@link RpcFunctionInfo}.
@@ -286,32 +319,7 @@ const listFunctions = defineRpcFunction({
286
319
  },
287
320
  setup: (ctx) => ({ handler: async () => {
288
321
  const out = [];
289
- for (const [name, fn] of ctx.rpc.definitions) {
290
- const type = fn.type ?? "query";
291
- let agent;
292
- if (fn.agent) agent = {
293
- description: fn.agent.description,
294
- title: fn.agent.title,
295
- safety: fn.agent.safety,
296
- tags: fn.agent.tags
297
- };
298
- out.push({
299
- name,
300
- type,
301
- jsonSerializable: fn.jsonSerializable === true,
302
- snapshot: fn.snapshot === true,
303
- cacheable: fn.cacheable === true,
304
- hasArgs: !!fn.args,
305
- hasReturns: !!fn.returns,
306
- hasDump: !!fn.dump,
307
- hasSetup: !!fn.setup,
308
- hasHandler: !!fn.handler,
309
- invokable: INVOKABLE_TYPES.has(type),
310
- agent,
311
- argsSchema: argsSchemaToJson(fn.args),
312
- returnsSchema: returnSchemaToJson(fn.returns)
313
- });
314
- }
322
+ for (const [name, fn] of ctx.rpc.definitions) out.push(projectRpcFunctionInfo(name, fn));
315
323
  out.sort((a, b) => a.name.localeCompare(b.name));
316
324
  return out;
317
325
  } })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-inspect",
3
3
  "type": "module",
4
- "version": "0.9.12",
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.12",
39
- "devframe": "0.9.12",
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.12",
56
- "@devframes/plugin-inspect--assets": "0.9.12",
57
- "@devframes/vite": "0.9.12",
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.12",
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
  },