@devframes/plugin-inspect 0.9.9 → 0.9.11

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/bin.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import process from 'node:process'
3
- import { createInspectCli } from './dist/cli.mjs'
3
+ import { createInspectCli } from './dist/node/cli.mjs'
4
4
 
5
5
  async function main() {
6
6
  const cli = createInspectCli()
@@ -1,5 +1,5 @@
1
- import { AgentManifest } from "devframe";
2
- //#region src/types.d.ts
1
+ import { DevframeDefinition } from "devframe";
2
+ //#region src/node/types.d.ts
3
3
  /**
4
4
  * Agent-exposure projection surfaced for each RPC function. Mirrors the
5
5
  * serializable fields of `RpcFunctionAgentOptions` (the handler-free
@@ -122,4 +122,37 @@ interface InvokeResult {
122
122
  durationMs: number;
123
123
  }
124
124
  //#endregion
125
- export { RpcFunctionAgentInfo as a, InvokeResult as i, DevframeInspectCommandInfo as n, RpcFunctionInfo as o, DevframeInspectInstanceInfo as r, AgentManifest as t };
125
+ //#region src/node/index.d.ts
126
+ interface InspectDevframeOptions {
127
+ /** Override the devframe id (and default CLI command / mount path). */
128
+ id?: string;
129
+ /** Override the display name shown in a host dock. */
130
+ name?: string;
131
+ /** Override the dock icon. */
132
+ icon?: string;
133
+ /**
134
+ * Override the mount path. Left unset, the SPA mounts at `/` standalone
135
+ * and `/__<id>/` when hosted (Vite/embedded).
136
+ */
137
+ basePath?: string;
138
+ /** Preferred standalone CLI port. */
139
+ port?: number;
140
+ /**
141
+ * Require the trust handshake on the standalone server. Enabled by
142
+ * default; `--open` embeds the current OTP in the opened URL, so the
143
+ * tab authenticates automatically without extra prompts. Hosted adapters
144
+ * manage their own auth and ignore this.
145
+ */
146
+ auth?: boolean;
147
+ }
148
+ /**
149
+ * Build a {@link DevframeDefinition} for the Devframe Inspector. The
150
+ * same definition runs standalone (`/cli`, `/build`) and mounts
151
+ * into a host (`/vite`, hub).
152
+ *
153
+ * @experimental This plugin is experimental and may change without a major
154
+ * version bump until it stabilizes.
155
+ */
156
+ declare function createInspectDevframe(options?: InspectDevframeOptions): DevframeDefinition;
157
+ //#endregion
158
+ export { InvokeResult as a, DevframeInspectInstanceInfo as i, createInspectDevframe as n, RpcFunctionInfo as o, DevframeInspectCommandInfo as r, InspectDevframeOptions as t };
@@ -1,5 +1,5 @@
1
1
  import { CacHandle } from "devframe/adapters/cac";
2
- //#region src/cli.d.ts
2
+ //#region src/node/cli.d.ts
3
3
  /**
4
4
  * Build the standalone CLI for the inspector; backs the package `bin`
5
5
  * (`devframe-inspect`) and `pnpx @devframes/plugin-inspect`. Wraps the
@@ -1,6 +1,6 @@
1
- import { t as createInspectDevframe } from "./src-CrLV9vzl.mjs";
1
+ import { t as createInspectDevframe } from "../node-C5uLV826.mjs";
2
2
  import { createCac } from "devframe/adapters/cac";
3
- //#region src/cli.ts
3
+ //#region src/node/cli.ts
4
4
  /**
5
5
  * Build the standalone CLI for the inspector; backs the package `bin`
6
6
  * (`devframe-inspect`) and `pnpx @devframes/plugin-inspect`. Wraps the
@@ -1,11 +1,2 @@
1
- import { serverFunctions } from "../rpc/index.mjs";
2
- import { DevframeNodeContext } from "devframe";
3
- //#region src/node/index.d.ts
4
- /**
5
- * Register the inspector's introspection RPC functions on a devframe
6
- * node context. Called from the definition's `setup(ctx)` and reusable
7
- * by host adapters that wire their own context.
8
- */
9
- declare function setupInspect(ctx: DevframeNodeContext): void;
10
- //#endregion
11
- export { serverFunctions, setupInspect };
1
+ import { a as InvokeResult, n as createInspectDevframe, o as RpcFunctionInfo, r as DevframeInspectCommandInfo, t as InspectDevframeOptions } from "../index-D7_vorUr.mjs";
2
+ export { type DevframeInspectCommandInfo, InspectDevframeOptions, type InvokeResult, type RpcFunctionInfo, createInspectDevframe, createInspectDevframe as default };
@@ -1,12 +1,2 @@
1
- import { t as serverFunctions } from "../rpc-CiPeBIvA.mjs";
2
- //#region src/node/index.ts
3
- /**
4
- * Register the inspector's introspection RPC functions on a devframe
5
- * node context. Called from the definition's `setup(ctx)` and reusable
6
- * by host adapters that wire their own context.
7
- */
8
- function setupInspect(ctx) {
9
- for (const fn of serverFunctions) ctx.rpc.register(fn);
10
- }
11
- //#endregion
12
- export { serverFunctions, setupInspect };
1
+ import { t as createInspectDevframe } from "../node-C5uLV826.mjs";
2
+ export { createInspectDevframe, createInspectDevframe as default };
@@ -1,7 +1,6 @@
1
- import { i as InvokeResult, n as DevframeInspectCommandInfo, o as RpcFunctionInfo, r as DevframeInspectInstanceInfo } from "../types-DS3xLMMU.mjs";
2
- import "../index-DhCFtfqC.mjs";
1
+ import { a as InvokeResult, i as DevframeInspectInstanceInfo, o as RpcFunctionInfo, r as DevframeInspectCommandInfo } from "../../index-D7_vorUr.mjs";
3
2
  import { RpcDefinitionsToFunctions } from "devframe/rpc";
4
- //#region src/rpc/index.d.ts
3
+ //#region src/node/rpc/index.d.ts
5
4
  /**
6
5
  * The introspection RPC functions registered by the inspector plugin.
7
6
  * Namespaced `devframes:plugin:inspect:*` per the plugin convention.
@@ -0,0 +1,2 @@
1
+ import { t as serverFunctions } from "../../rpc-C0wtIiYp.mjs";
2
+ export { serverFunctions };
@@ -0,0 +1,11 @@
1
+ import { serverFunctions } from "./rpc/index.mjs";
2
+ import { DevframeNodeContext } from "devframe";
3
+ //#region src/node/setup.d.ts
4
+ /**
5
+ * Register the inspector's introspection RPC functions on a devframe
6
+ * node context. Called from the definition's `setup(ctx)` and reusable
7
+ * by host adapters that wire their own context.
8
+ */
9
+ declare function setupInspect(ctx: DevframeNodeContext): void;
10
+ //#endregion
11
+ export { serverFunctions, setupInspect };
@@ -0,0 +1,12 @@
1
+ import { t as serverFunctions } from "../rpc-C0wtIiYp.mjs";
2
+ //#region src/node/setup.ts
3
+ /**
4
+ * Register the inspector's introspection RPC functions on a devframe
5
+ * node context. Called from the definition's `setup(ctx)` and reusable
6
+ * by host adapters that wire their own context.
7
+ */
8
+ function setupInspect(ctx) {
9
+ for (const fn of serverFunctions) ctx.rpc.register(fn);
10
+ }
11
+ //#endregion
12
+ export { serverFunctions, setupInspect };
@@ -1,12 +1,12 @@
1
- import { setupInspect } from "./node/index.mjs";
1
+ 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.9";
5
+ var version = "0.9.11";
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
- //#region src/index.ts
9
+ //#region src/node/index.ts
10
10
  /** Default devframe id, driving the hosted mount path `/__<id>/`. */
11
11
  const DEFAULT_ID = "devframes_plugin_inspect";
12
12
  const distDir = {
@@ -2,7 +2,7 @@ import { createDefineWrapperWithContext } from "devframe/rpc";
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/rpc/functions/_define.ts
5
+ //#region src/node/rpc/functions/_define.ts
6
6
  /**
7
7
  * `defineRpcFunction` pre-bound to the framework-neutral
8
8
  * {@link DevframeNodeContext}, so each inspector function's `setup(ctx)`
@@ -11,7 +11,7 @@ import { listLiveDevframeInstances } from "devframe/internal";
11
11
  */
12
12
  const defineInspectRpc = createDefineWrapperWithContext();
13
13
  //#endregion
14
- //#region src/rpc/functions/describe-agent.ts
14
+ //#region src/node/rpc/functions/describe-agent.ts
15
15
  /**
16
16
  * Surface the agent-exposed surface of the connection: the unified
17
17
  * manifest of tools (RPC functions flagged with `agent`, plus
@@ -32,7 +32,7 @@ const describeAgent = defineInspectRpc({
32
32
  } })
33
33
  });
34
34
  //#endregion
35
- //#region src/diagnostics.ts
35
+ //#region src/node/diagnostics.ts
36
36
  /**
37
37
  * Structured diagnostics for `@devframes/plugin-inspect`. Node-side only.
38
38
  * Codes use the plugin-private `DP_INSPECT_` band (see the built-in
@@ -57,7 +57,7 @@ const diagnostics = defineDiagnostics({
57
57
  }
58
58
  });
59
59
  //#endregion
60
- //#region src/rpc/functions/_hub-commands.ts
60
+ //#region src/node/rpc/functions/_hub-commands.ts
61
61
  function looksLikeHubCommandsHost(value) {
62
62
  return !!value && typeof value === "object" && value.commands instanceof Map && typeof value.execute === "function";
63
63
  }
@@ -91,7 +91,7 @@ function projectCommand(cmd) {
91
91
  };
92
92
  }
93
93
  //#endregion
94
- //#region src/rpc/functions/execute-command.ts
94
+ //#region src/node/rpc/functions/execute-command.ts
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
@@ -132,7 +132,7 @@ const executeCommand = defineInspectRpc({
132
132
  } })
133
133
  });
134
134
  //#endregion
135
- //#region src/rpc/functions/invoke.ts
135
+ //#region src/node/rpc/functions/invoke.ts
136
136
  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.
@@ -176,7 +176,7 @@ const invoke = defineInspectRpc({
176
176
  } })
177
177
  });
178
178
  //#endregion
179
- //#region src/rpc/functions/invoke-agent-tool.ts
179
+ //#region src/node/rpc/functions/invoke-agent-tool.ts
180
180
  const invokeAgentTool = defineInspectRpc({
181
181
  name: "devframes:plugin:inspect:invoke-agent-tool",
182
182
  type: "action",
@@ -203,7 +203,7 @@ const invokeAgentTool = defineInspectRpc({
203
203
  } })
204
204
  });
205
205
  //#endregion
206
- //#region src/rpc/functions/list-commands.ts
206
+ //#region src/node/rpc/functions/list-commands.ts
207
207
  /**
208
208
  * Enumerate every command registered on the hub's commands host (id,
209
209
  * title, description, icon, category, whether it carries its own handler,
@@ -231,7 +231,7 @@ const listCommands = defineInspectRpc({
231
231
  } })
232
232
  });
233
233
  //#endregion
234
- //#region src/rpc/functions/_schema.ts
234
+ //#region src/node/rpc/functions/_schema.ts
235
235
  const FALLBACK_SCHEMA = Object.freeze({
236
236
  type: "object",
237
237
  additionalProperties: true
@@ -276,7 +276,7 @@ function argsSchemaToJson(args) {
276
276
  };
277
277
  }
278
278
  //#endregion
279
- //#region src/rpc/functions/list-functions.ts
279
+ //#region src/node/rpc/functions/list-functions.ts
280
280
  const INVOKABLE_TYPES = /* @__PURE__ */ new Set(["query", "static"]);
281
281
  /**
282
282
  * Enumerate every RPC function registered on the connection, projecting
@@ -326,7 +326,7 @@ const listFunctions = defineInspectRpc({
326
326
  } })
327
327
  });
328
328
  //#endregion
329
- //#region src/rpc/functions/list-instances.ts
329
+ //#region src/node/rpc/functions/list-instances.ts
330
330
  /**
331
331
  * Enumerate every devframe dev server currently running on this machine,
332
332
  * discovered through the shared instance registry (`~/.devframe/instances/`)
@@ -362,7 +362,7 @@ const listInstances = defineInspectRpc({
362
362
  } })
363
363
  });
364
364
  //#endregion
365
- //#region src/rpc/index.ts
365
+ //#region src/node/rpc/index.ts
366
366
  /**
367
367
  * The introspection RPC functions registered by the inspector plugin.
368
368
  * Namespaced `devframes:plugin:inspect:*` per the plugin convention.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-inspect",
3
3
  "type": "module",
4
- "version": "0.9.9",
4
+ "version": "0.9.11",
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",
@@ -21,13 +21,12 @@
21
21
  ],
22
22
  "sideEffects": false,
23
23
  "exports": {
24
- ".": "./dist/index.mjs",
25
- "./client": "./dist/client/index.mjs",
26
- "./cli": "./dist/cli.mjs",
27
- "./node": "./dist/node/index.mjs",
24
+ ".": "./dist/node/index.mjs",
25
+ "./cli": "./dist/node/cli.mjs",
26
+ "./node": "./dist/node/setup.mjs",
28
27
  "./package.json": "./package.json"
29
28
  },
30
- "types": "./dist/index.d.mts",
29
+ "types": "./dist/node/index.d.mts",
31
30
  "bin": {
32
31
  "devframe-inspect": "./bin.mjs"
33
32
  },
@@ -36,8 +35,8 @@
36
35
  "dist"
37
36
  ],
38
37
  "peerDependencies": {
39
- "@devframes/plugin-inspect--assets": "0.9.9",
40
- "devframe": "0.9.9",
38
+ "@devframes/plugin-inspect--assets": "0.9.11",
39
+ "devframe": "0.9.11",
41
40
  "vite": "^7.0.0 || ^8.0.0"
42
41
  },
43
42
  "peerDependenciesMeta": {
@@ -53,9 +52,9 @@
53
52
  },
54
53
  "devDependencies": {
55
54
  "@antfu/design": "^0.4.0",
56
- "@devframes/hub": "0.9.9",
57
- "@devframes/plugin-inspect--assets": "0.9.9",
58
- "@devframes/vite": "0.9.9",
55
+ "@devframes/hub": "0.9.11",
56
+ "@devframes/plugin-inspect--assets": "0.9.11",
57
+ "@devframes/vite": "0.9.11",
59
58
  "@iconify-json/ph": "^1.2.2",
60
59
  "@standard-schema/spec": "^1.1.0",
61
60
  "@storybook/addon-docs": "^10.5.10",
@@ -63,7 +62,7 @@
63
62
  "@unocss/preset-icons": "^66.8.1",
64
63
  "@vitejs/plugin-vue": "^6.0.8",
65
64
  "colorjs.io": "^0.7.1",
66
- "devframe": "0.9.9",
65
+ "devframe": "0.9.11",
67
66
  "floating-vue": "^5.2.2",
68
67
  "h3": "^2.0.1-rc.29",
69
68
  "reka-ui": "^2.10.4",
@@ -76,12 +75,15 @@
76
75
  "ws": "^8.21.3"
77
76
  },
78
77
  "scripts": {
79
- "build": "tsdown && vite build --config src/spa/vite.config.ts",
80
- "dev": "vite --config src/spa/vite.config.ts",
78
+ "build": "tsdown && vite build --config app/vite.config.ts",
79
+ "build:app": "vite build --config app/vite.config.ts",
81
80
  "watch": "tsdown --watch",
81
+ "dev": "vite --config app/vite.config.ts --host",
82
+ "play": "pnpm run build && node playgrounds/server.mjs",
82
83
  "cli:build": "node bin.mjs build --out-dir dist/static",
83
84
  "storybook": "storybook dev -p 6012",
84
85
  "build-storybook": "storybook build",
86
+ "typecheck": "tsc --noEmit",
85
87
  "test": "vitest run"
86
88
  }
87
89
  }
@@ -1,11 +0,0 @@
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
- import { DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions } from "devframe/client";
3
- //#region src/client/index.d.ts
4
- /**
5
- * Connect to the inspector's devframe backend. A thin, typed wrapper
6
- * around devframe's {@link connectDevframe}; the SPA derives its base
7
- * from `document.baseURI`, so no options are required in the common case.
8
- */
9
- declare function connectInspect(options?: DevframeRpcClientOptions): Promise<DevframeRpcClient>;
10
- //#endregion
11
- export { type AgentManifest, type DevframeConnectionStatus, type DevframeInspectCommandInfo, type DevframeInspectInstanceInfo, type DevframeRpcClient, type InvokeResult, type RpcFunctionAgentInfo, type RpcFunctionInfo, connectInspect };
@@ -1,12 +0,0 @@
1
- import { connectDevframe } from "devframe/client";
2
- //#region src/client/index.ts
3
- /**
4
- * Connect to the inspector's devframe backend. A thin, typed wrapper
5
- * around devframe's {@link connectDevframe}; the SPA derives its base
6
- * from `document.baseURI`, so no options are required in the common case.
7
- */
8
- function connectInspect(options) {
9
- return connectDevframe(options);
10
- }
11
- //#endregion
12
- export { connectInspect };
@@ -1,36 +0,0 @@
1
- import "./types-DS3xLMMU.mjs";
2
- import { DevframeDefinition } from "devframe";
3
- //#region src/index.d.ts
4
- interface InspectDevframeOptions {
5
- /** Override the devframe id (and default CLI command / mount path). */
6
- id?: string;
7
- /** Override the display name shown in a host dock. */
8
- name?: string;
9
- /** Override the dock icon. */
10
- icon?: string;
11
- /**
12
- * Override the mount path. Left unset, the SPA mounts at `/` standalone
13
- * and `/__<id>/` when hosted (Vite/embedded).
14
- */
15
- basePath?: string;
16
- /** Preferred standalone CLI port. */
17
- port?: number;
18
- /**
19
- * Require the trust handshake on the standalone server. Enabled by
20
- * default; `--open` embeds the current OTP in the opened URL, so the
21
- * tab authenticates automatically without extra prompts. Hosted adapters
22
- * manage their own auth and ignore this.
23
- */
24
- auth?: boolean;
25
- }
26
- /**
27
- * Build a {@link DevframeDefinition} for the Devframe Inspector. The
28
- * same definition runs standalone (`/cli`, `/build`) and mounts
29
- * into a host (`/vite`, hub).
30
- *
31
- * @experimental This plugin is experimental and may change without a major
32
- * version bump until it stabilizes.
33
- */
34
- declare function createInspectDevframe(options?: InspectDevframeOptions): DevframeDefinition;
35
- //#endregion
36
- export { createInspectDevframe as n, InspectDevframeOptions as t };
package/dist/index.d.mts DELETED
@@ -1,3 +0,0 @@
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
- export { InspectDevframeOptions, type InvokeResult, type RpcFunctionInfo, createInspectDevframe, createInspectDevframe as default };
package/dist/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { t as createInspectDevframe } from "./src-CrLV9vzl.mjs";
2
- export { createInspectDevframe, createInspectDevframe as default };
@@ -1,2 +0,0 @@
1
- import { t as serverFunctions } from "../rpc-CiPeBIvA.mjs";
2
- export { serverFunctions };