@thehammer/danx-dashboard-mcp 0.1.321 → 0.1.322

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.
@@ -4,6 +4,16 @@ export const PLUGIN_PREVIEW_ROUTE = "/plugin-preview";
4
4
  export const PLUGIN_PREVIEW_FILES = "/__plugin-preview__/";
5
5
  export const PLUGIN_PREVIEW_ATTRIBUTE = "data-plugin-preview";
6
6
  export const PLUGIN_PREVIEW_MANIFEST_GLOBAL = "__DANX_PLUGIN_PREVIEW_MANIFEST__";
7
+ // Restated from `src/plugins/plugin-manifest.ts` (`CARD_VIEW_EXPORT`, `CARD_LIST_VIEW_EXPORT`): this package cannot import the app's source.
8
+ const CARD_VIEW_EXPORT = "CardView";
9
+ const CARD_LIST_VIEW_EXPORT = "CardListView";
10
+ export function previewModeOf(exports) {
11
+ if (exports.includes(CARD_VIEW_EXPORT))
12
+ return "card";
13
+ if (exports.includes(CARD_LIST_VIEW_EXPORT))
14
+ return "list";
15
+ throw new Error(`plugin preview: the revision exports neither ${CARD_VIEW_EXPORT} nor ${CARD_LIST_VIEW_EXPORT}, so there is no view to draw`);
16
+ }
7
17
  /** The ceiling on one render, from page load to the page saying `ready` or `failed`. A page that reports is waited on only as long as it takes. */
8
18
  export const RENDER_WAIT_MS = 30_000;
9
19
  /** The content types of the files a plugin may carry: restated from the server's `PLUGIN_FILE_TYPES` (`src/plugins/manifest-validation.ts`, minus its charset suffix); `src/dispatch/design-publish-restated-constants.test.ts` ties them. */
@@ -51,7 +61,7 @@ export async function capturePluginRender(built, dashboardUrl, where) {
51
61
  const origin = new URL(dashboardUrl).origin;
52
62
  const served = servedFiles(built);
53
63
  return captureWith(where, false, async (page) => {
54
- await page.addInitScript(`window[${JSON.stringify(PLUGIN_PREVIEW_MANIFEST_GLOBAL)}] = ${JSON.stringify({ entry: built.manifest.entry, styles: built.manifest.styles })};`);
64
+ await page.addInitScript(`window[${JSON.stringify(PLUGIN_PREVIEW_MANIFEST_GLOBAL)}] = ${JSON.stringify({ entry: built.manifest.entry, styles: built.manifest.styles, runtime: built.manifest.runtime, mode: previewModeOf(built.manifest.exports) })};`);
55
65
  await page.route(`${origin}${PLUGIN_PREVIEW_FILES}**`, (route) => answer(route, PLUGIN_PREVIEW_FILES, served));
56
66
  const response = await page.goto(`${origin}${PLUGIN_PREVIEW_ROUTE}`, { waitUntil: "load" });
57
67
  const status = response?.status();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.321",
3
+ "version": "0.1.322",
4
4
  "description": "Stdio MCP server fronting danxbot's dashboard API for agents (operator sessions and dispatched workers alike): the generic danxbot_api/danxbot_api_list/danxbot_api_spec tools reach any route the caller's credential may call, plus dedicated agent-specific tools (plan_connect, request_permission, attach_file, and danxbot_slack_reply) (DX-3465, PLN-11 R-25).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "test:watch": "vitest"
32
32
  },
33
33
  "dependencies": {
34
- "@danxbot/plugin-sdk": "0.1.4",
34
+ "@danxbot/plugin-sdk": "0.2.1",
35
35
  "@modelcontextprotocol/sdk": "1.29.0",
36
36
  "@thehammer/danx-session-telemetry": "0.1.52",
37
37
  "zod": "^3.25.76"