@devframes/plugin-inspect 0.9.8 → 0.9.9

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/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  A built-in devframe that inspects *its own* connection (and, when mounted in a
8
8
  hub, the hub's): browse every registered RPC function with its metadata,
9
9
  invoke read-only `query`/`static` functions and inspect the results, watch
10
- shared-state keys update live, explore the agent-exposed API, and — while
11
- running against a live backend — list the other devframe dev servers running
10
+ shared-state keys update live, explore the agent-exposed API, and (while
11
+ running against a live backend) list the other devframe dev servers running
12
12
  alongside it.
13
13
 
14
14
  Ported in spirit from the RPC & State panels of
@@ -21,7 +21,7 @@ framework-neutral client (`connectDevframe`, `rpc.sharedState`) with a Vue + Vit
21
21
  pnpx @devframes/plugin-inspect
22
22
  ```
23
23
 
24
- Opens the inspector against a fresh standalone devframe connection — useful as a
24
+ Opens the inspector against a fresh standalone devframe connection, useful as a
25
25
  reference and for poking at the introspection RPCs themselves.
26
26
 
27
27
  ## Mount into a Vite host
@@ -56,7 +56,7 @@ All functions are namespaced `devframes:plugin:inspect:*`:
56
56
  | `list-functions` | `query` (snapshot) | Every registered RPC function with metadata (type, JSON-serializable/snapshot flags, args/return JSON Schema, agent exposure). |
57
57
  | `invoke` | `action` | Invokes a read-only `query`/`static` function by name and returns a result envelope. Refuses `action`/`event` functions. |
58
58
  | `list-state-keys` | `query` (snapshot) | The keys of every shared-state entry on the connection. |
59
- | `describe-agent` | `query` (snapshot) | The agent manifest — tools and readable resources. |
59
+ | `describe-agent` | `query` (snapshot) | The agent manifest: tools and readable resources. |
60
60
  | `list-instances` | `query` (live) | Every devframe dev server currently running on the machine, discovered through the shared instance registry. Powers the read-only Instances tab. |
61
61
 
62
62
  The three snapshot `query` functions are agent-exposed (read-only) and bake into
package/dist/cli.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CacHandle } from "devframe/adapters/cac";
2
2
  //#region src/cli.d.ts
3
3
  /**
4
- * Build the standalone CLI for the inspector — backs the package `bin`
4
+ * Build the standalone CLI for the inspector; backs the package `bin`
5
5
  * (`devframe-inspect`) and `pnpx @devframes/plugin-inspect`. Wraps the
6
6
  * default {@link createInspectDevframe} definition with devframe's
7
7
  * `dev` / `build` / `mcp` command shell.
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { t as createInspectDevframe } from "./src-DM5I2krP.mjs";
1
+ import { t as createInspectDevframe } from "./src-CrLV9vzl.mjs";
2
2
  import { createCac } from "devframe/adapters/cac";
3
3
  //#region src/cli.ts
4
4
  /**
5
- * Build the standalone CLI for the inspector — backs the package `bin`
5
+ * Build the standalone CLI for the inspector; backs the package `bin`
6
6
  * (`devframe-inspect`) and `pnpx @devframes/plugin-inspect`. Wraps the
7
7
  * default {@link createInspectDevframe} definition with devframe's
8
8
  * `dev` / `build` / `mcp` command shell.
@@ -1,4 +1,4 @@
1
- import { a as RpcFunctionAgentInfo, i as InvokeResult, n as DevframeInspectCommandInfo, o as RpcFunctionInfo, r as DevframeInspectInstanceInfo, t as AgentManifest } from "../types-CiRcsiuh.mjs";
1
+ import { a as RpcFunctionAgentInfo, i as InvokeResult, n as DevframeInspectCommandInfo, o as RpcFunctionInfo, r as DevframeInspectInstanceInfo, t as AgentManifest } from "../types-DS3xLMMU.mjs";
2
2
  import { DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions } from "devframe/client";
3
3
  //#region src/client/index.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "./types-CiRcsiuh.mjs";
1
+ import "./types-DS3xLMMU.mjs";
2
2
  import { DevframeDefinition } from "devframe";
3
3
  //#region src/index.d.ts
4
4
  interface InspectDevframeOptions {
@@ -17,7 +17,7 @@ interface InspectDevframeOptions {
17
17
  port?: number;
18
18
  /**
19
19
  * Require the trust handshake on the standalone server. Enabled by
20
- * default — `--open` embeds the current OTP in the opened URL, so the
20
+ * default; `--open` embeds the current OTP in the opened URL, so the
21
21
  * tab authenticates automatically without extra prompts. Hosted adapters
22
22
  * manage their own auth and ignore this.
23
23
  */
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { i as InvokeResult, o as RpcFunctionInfo } from "./types-CiRcsiuh.mjs";
2
- import { n as createInspectDevframe, t as InspectDevframeOptions } from "./index-BeAbhMoX.mjs";
1
+ import { i as InvokeResult, o as RpcFunctionInfo } from "./types-DS3xLMMU.mjs";
2
+ import { n as createInspectDevframe, t as InspectDevframeOptions } from "./index-DhCFtfqC.mjs";
3
3
  export { InspectDevframeOptions, type InvokeResult, type RpcFunctionInfo, createInspectDevframe, createInspectDevframe as default };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createInspectDevframe } from "./src-DM5I2krP.mjs";
1
+ import { t as createInspectDevframe } from "./src-CrLV9vzl.mjs";
2
2
  export { createInspectDevframe, createInspectDevframe as default };
@@ -1,4 +1,4 @@
1
- import { t as serverFunctions } from "../rpc-IoEVPxbU.mjs";
1
+ import { t as serverFunctions } from "../rpc-CiPeBIvA.mjs";
2
2
  //#region src/node/index.ts
3
3
  /**
4
4
  * Register the inspector's introspection RPC functions on a devframe
@@ -1,5 +1,5 @@
1
- import { i as InvokeResult, n as DevframeInspectCommandInfo, o as RpcFunctionInfo, r as DevframeInspectInstanceInfo } from "../types-CiRcsiuh.mjs";
2
- import "../index-BeAbhMoX.mjs";
1
+ import { i as InvokeResult, n as DevframeInspectCommandInfo, o as RpcFunctionInfo, r as DevframeInspectInstanceInfo } from "../types-DS3xLMMU.mjs";
2
+ import "../index-DhCFtfqC.mjs";
3
3
  import { RpcDefinitionsToFunctions } from "devframe/rpc";
4
4
  //#region src/rpc/index.d.ts
5
5
  /**
@@ -1,2 +1,2 @@
1
- import { t as serverFunctions } from "../rpc-IoEVPxbU.mjs";
1
+ import { t as serverFunctions } from "../rpc-CiPeBIvA.mjs";
2
2
  export { serverFunctions };
@@ -43,15 +43,15 @@ const diagnostics = defineDiagnostics({
43
43
  docsBase: "https://devfra.me/errors",
44
44
  codes: {
45
45
  DP_INSPECT_0001: {
46
- why: (p) => `Cannot invoke "${p.name}" — no RPC function with that name is registered on this connection.`,
46
+ why: (p) => `Cannot invoke "${p.name}": no RPC function with that name is registered on this connection.`,
47
47
  fix: "Call `devframes:plugin:inspect:list-functions` to see the registered names, or check for a typo."
48
48
  },
49
49
  DP_INSPECT_0002: {
50
- why: (p) => `Refusing to invoke "${p.name}" — only read-only "query" and "static" functions are invokable from the inspector, but this one is "${p.type}".`,
50
+ why: (p) => `Refusing to invoke "${p.name}": only read-only "query" and "static" functions are invokable from the inspector, but this one is "${p.type}".`,
51
51
  fix: "The inspector deliberately blocks `action`/`event` functions to avoid triggering side effects. Invoke those through their own UI instead."
52
52
  },
53
53
  DP_INSPECT_0003: {
54
- why: (p) => `Cannot execute command "${p.id}" — this connection has no hub commands host.`,
54
+ why: (p) => `Cannot execute command "${p.id}": this connection has no hub commands host.`,
55
55
  fix: "Commands are a `@devframes/hub` feature. Mount this devframe inside a hub that registers commands via `ctx.commands.register()`, or check `devframes:plugin:inspect:list-commands` (returns an empty list outside a hub)."
56
56
  }
57
57
  }
@@ -76,7 +76,7 @@ function resolveHubCommands(ctx) {
76
76
  * serializable shape the inspector sends over RPC, recursing into
77
77
  * children. `hasHandler` survives the projection even though the hub's
78
78
  * own `commands.list()` strips `handler` entirely before it's callable
79
- * from here — reading the raw command straight off `host.commands`
79
+ * from here; reading the raw command straight off `host.commands`
80
80
  * preserves that flag.
81
81
  */
82
82
  function projectCommand(cmd) {
@@ -95,7 +95,7 @@ function projectCommand(cmd) {
95
95
  /**
96
96
  * Execute a hub command by id and return a result envelope, mirroring
97
97
  * `devframes:plugin:inspect:invoke`. Unlike that function, this one is not
98
- * gated to read-only types — a command is, by construction, something a
98
+ * gated to read-only types, since a command is, by construction, something a
99
99
  * user explicitly runs (unlike an arbitrary RPC `action`, which may be a
100
100
  * side effect the inspector shouldn't fire unprompted).
101
101
  *
@@ -137,7 +137,7 @@ const INVOKABLE_TYPES$1 = /* @__PURE__ */ new Set(["query", "static"]);
137
137
  /**
138
138
  * Invoke a read-only RPC function by name and return a result envelope.
139
139
  *
140
- * Deliberately gated to `query` / `static` functions — `action` and
140
+ * Deliberately gated to `query` / `static` functions, because `action` and
141
141
  * `event` functions may carry side effects, so the inspector refuses to
142
142
  * fire them (`DP_INSPECT_0002`). Uses structured-clone serialization
143
143
  * (default) so arbitrary return values round-trip without the strict-JSON
@@ -205,9 +205,9 @@ const invokeAgentTool = defineInspectRpc({
205
205
  //#endregion
206
206
  //#region src/rpc/functions/list-commands.ts
207
207
  /**
208
- * Enumerate every command registered on the hub's commands host — id,
208
+ * Enumerate every command registered on the hub's commands host (id,
209
209
  * title, description, icon, category, whether it carries its own handler,
210
- * and nested children — when this connection is mounted inside a hub
210
+ * and nested children) when this connection is mounted inside a hub
211
211
  * (`@devframes/hub`). Returns an empty list on a plain devframe connection,
212
212
  * so the inspector's Commands tab degrades gracefully rather than erroring.
213
213
  * `snapshot: true` bakes the (possibly empty) list into the static dump so
@@ -242,7 +242,7 @@ const FALLBACK_SCHEMA = Object.freeze({
242
242
  * Uses the schema's own [Standard JSON Schema](https://standardschema.dev/)
243
243
  * converter (`~standard.jsonSchema`, implemented by e.g. zod 4) when the
244
244
  * validator provides one, and degrades to a permissive object schema
245
- * otherwise (e.g. valibot, which has no native converter) — so introspection
245
+ * otherwise (e.g. valibot, which has no native converter), so introspection
246
246
  * never throws and never pulls in a converter library for a validator devframe
247
247
  * doesn't otherwise depend on.
248
248
  */
@@ -290,7 +290,7 @@ const listFunctions = defineInspectRpc({
290
290
  jsonSerializable: true,
291
291
  snapshot: true,
292
292
  agent: {
293
- description: "List every RPC function registered on this devframe connection, with metadata (name, type, JSON-serializable/snapshot flags, args/return schema, agent exposure). Read-only — the canonical way to discover what the running devframe can do.",
293
+ description: "List every RPC function registered on this devframe connection, with metadata (name, type, JSON-serializable/snapshot flags, args/return schema, agent exposure). Read-only, the canonical way to discover what the running devframe can do.",
294
294
  title: "List RPC functions"
295
295
  },
296
296
  setup: (ctx) => ({ handler: async () => {
@@ -330,11 +330,11 @@ const listFunctions = defineInspectRpc({
330
330
  /**
331
331
  * Enumerate every devframe dev server currently running on this machine,
332
332
  * discovered through the shared instance registry (`~/.devframe/instances/`)
333
- * with a `__connection.json` liveness probe — the same discovery that backs
333
+ * with a `__connection.json` liveness probe, the same discovery that backs
334
334
  * the `devframe connect` bin. Powers the inspector's read-only Instances tab.
335
335
  *
336
336
  * Deliberately **not** `snapshot` (the set of live processes is meaningless
337
- * baked into a static dump — the Instances tab is hidden in `build`/`spa`
337
+ * baked into a static dump, so the Instances tab is hidden in `build`/`spa`
338
338
  * mode) and **not** agent-exposed (the `devframe connect` bin already offers
339
339
  * instance discovery to agents over MCP, so exposing it here would duplicate
340
340
  * that surface).
@@ -2,12 +2,12 @@ import { setupInspect } from "./node/index.mjs";
2
2
  import { defineDevframe } from "devframe";
3
3
  //#region package.json
4
4
  var name = "@devframes/plugin-inspect";
5
- var version = "0.9.8";
5
+ var version = "0.9.9";
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
9
9
  //#region src/index.ts
10
- /** Default devframe id — drives the hosted mount path `/__<id>/`. */
10
+ /** Default devframe id, driving the hosted mount path `/__<id>/`. */
11
11
  const DEFAULT_ID = "devframes_plugin_inspect";
12
12
  const distDir = {
13
13
  package: `${name}--assets`,
@@ -37,6 +37,11 @@ function createInspectDevframe(options = {}) {
37
37
  command: id,
38
38
  port: options.port ?? 9012,
39
39
  distDir,
40
+ /**
41
+ * Gate the standalone server by default; `maybeOpenBrowser` folds the
42
+ * current OTP into the `--open` URL so the tab lands already trusted.
43
+ * Hosted adapters (Vite/hub) supply their own auth layer and ignore this.
44
+ */
40
45
  auth: options.auth ?? true
41
46
  },
42
47
  dock: { category: "~builtin" },
@@ -14,14 +14,14 @@ interface RpcFunctionAgentInfo {
14
14
  }
15
15
  /**
16
16
  * Serializable description of a single registered RPC function. Returned
17
- * by `devframes:plugin:inspect:list-functions`. JSON-safe by construction
18
- * — Standard Schema args/return schemas are projected to JSON Schema (best
17
+ * by `devframes:plugin:inspect:list-functions`. JSON-safe by construction:
18
+ * Standard Schema args/return schemas are projected to JSON Schema (best
19
19
  * effort), never sent as live objects.
20
20
  */
21
21
  interface RpcFunctionInfo {
22
22
  /** Full namespaced function name (e.g. `my-plugin:do-thing`). */
23
23
  name: string;
24
- /** Function type — `query`, `static`, `action`, or `event`. */
24
+ /** Function type: `query`, `static`, `action`, or `event`. */
25
25
  type: 'query' | 'static' | 'action' | 'event';
26
26
  /** Whether args/return are declared strictly JSON-serializable. */
27
27
  jsonSerializable: boolean;
@@ -52,7 +52,7 @@ interface RpcFunctionInfo {
52
52
  * Serializable projection of a single command registered on a hub's
53
53
  * commands host (`DevframeServerCommandEntry`/`DevframeCommandBase` in
54
54
  * `@devframes/hub`), returned by `devframes:plugin:inspect:list-commands`.
55
- * Populated only when this connection is mounted inside a hub — a plain
55
+ * Populated only when this connection is mounted inside a hub; a plain
56
56
  * devframe connection (no hub) returns an empty list.
57
57
  */
58
58
  interface DevframeInspectCommandInfo {
@@ -74,7 +74,7 @@ interface DevframeInspectCommandInfo {
74
74
  /**
75
75
  * Serializable projection of a single running devframe instance discovered
76
76
  * in the machine-wide instance registry (`~/.devframe/instances/`), returned
77
- * by `devframes:plugin:inspect:list-instances`. A live, node-only view — the
77
+ * by `devframes:plugin:inspect:list-instances`. A live, node-only view; the
78
78
  * inspector's Instances tab renders these as a read-only directory of the
79
79
  * other devframes running alongside this one.
80
80
  */
@@ -89,7 +89,7 @@ interface DevframeInspectInstanceInfo {
89
89
  origin: string;
90
90
  /** Base path the devframe is mounted at (trailing slash). */
91
91
  basePath: string;
92
- /** Full SPA URL (`origin` + `basePath`) — the link the tab opens. */
92
+ /** Full SPA URL (`origin` + `basePath`), the link the tab opens. */
93
93
  url: string;
94
94
  /** Process id of the instance's dev server. */
95
95
  pid: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-inspect",
3
3
  "type": "module",
4
- "version": "0.9.8",
4
+ "version": "0.9.9",
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",
@@ -36,8 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "peerDependencies": {
39
- "@devframes/plugin-inspect--assets": "0.9.8",
40
- "devframe": "0.9.8",
39
+ "@devframes/plugin-inspect--assets": "0.9.9",
40
+ "devframe": "0.9.9",
41
41
  "vite": "^7.0.0 || ^8.0.0"
42
42
  },
43
43
  "peerDependenciesMeta": {
@@ -53,9 +53,9 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@antfu/design": "^0.4.0",
56
- "@devframes/hub": "0.9.8",
57
- "@devframes/plugin-inspect--assets": "0.9.8",
58
- "@devframes/vite": "0.9.8",
56
+ "@devframes/hub": "0.9.9",
57
+ "@devframes/plugin-inspect--assets": "0.9.9",
58
+ "@devframes/vite": "0.9.9",
59
59
  "@iconify-json/ph": "^1.2.2",
60
60
  "@standard-schema/spec": "^1.1.0",
61
61
  "@storybook/addon-docs": "^10.5.10",
@@ -63,7 +63,7 @@
63
63
  "@unocss/preset-icons": "^66.8.1",
64
64
  "@vitejs/plugin-vue": "^6.0.8",
65
65
  "colorjs.io": "^0.7.1",
66
- "devframe": "0.9.8",
66
+ "devframe": "0.9.9",
67
67
  "floating-vue": "^5.2.2",
68
68
  "h3": "^2.0.1-rc.29",
69
69
  "reka-ui": "^2.10.4",