@rebasepro/server 0.29.2 → 0.29.3

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * EXPERIMENTAL. The admin panel's MCP endpoint: `POST /api/admin/apps/mcp`,
3
+ * for the person signed in to the admin panel.
4
+ *
5
+ * The admin panel opens a saved app (`apps/saved-apps.ts`) the way Claude
6
+ * opens one: the MCP App view in a sandboxed frame, its tool calls relayed
7
+ * here. So an app runs in the admin panel exactly as in the conversation —
8
+ * the same compiled code, the same view, the same data tools as the same
9
+ * person under their RLS — and the frame holds no session: it has no network
10
+ * of its own, and the page relays its calls.
11
+ *
12
+ * What it accepts: the backend's own session, through the auth adapter as
13
+ * every data request is authenticated, with the roles the database holds now.
14
+ * Not an anonymous session. A caller gets the `data:*` scopes, which reach no
15
+ * further than the REST data API does for the same person: every call still
16
+ * runs under their RLS.
17
+ *
18
+ * Independent of `REBASE_MCP_ENABLED`: no credential leaves the backend.
19
+ *
20
+ * @module
21
+ */
22
+ import type { Hono } from "hono";
23
+ import type { HonoEnv } from "../api/types.js";
24
+ import { type McpRoutesConfig } from "./mcp-routes.js";
25
+ /** Where it is mounted, under `basePath`. */
26
+ export declare const ADMIN_APPS_MCP_PATH = "/admin/apps/mcp";
27
+ export type AdminAppsMcpConfig = Omit<McpRoutesConfig, "authenticate" | "resolveApiKey" | "identity" | "jwt" | "vocabulary">;
28
+ export declare function createAdminAppsMcpRoutes(config: AdminAppsMcpConfig): Hono<HonoEnv>;
@@ -23,8 +23,8 @@
23
23
  */
24
24
  import type { AuthAdapter, CallerCredential, CollectionConfig, DataDriver } from "@rebasepro/types";
25
25
  import type { McpConfirmationPlan } from "./confirmation.js";
26
- import { SHOW_APP_CODE_GUIDE, SHOW_APP_ESSENTIALS, SHOW_APP_GUIDE_TOOL } from "./show-app-guide.js";
27
- export { SHOW_APP_CODE_GUIDE, SHOW_APP_ESSENTIALS, SHOW_APP_GUIDE_TOOL };
26
+ import { SHOW_APP_CODE_GUIDE, SHOW_APP_ESSENTIALS, SHOW_APP_GUIDE_TOOL, showAppArtifactGuide } from "./show-app-guide.js";
27
+ export { SHOW_APP_CODE_GUIDE, SHOW_APP_ESSENTIALS, SHOW_APP_GUIDE_TOOL, showAppArtifactGuide };
28
28
  /** The identity a tool call runs as. Comes from the verified access token. */
29
29
  export interface McpCaller {
30
30
  uid: string;
@@ -98,6 +98,14 @@ export interface McpToolDefinition {
98
98
  * so the reply is not twice its size. Defaults to true.
99
99
  */
100
100
  structuredContent?: boolean;
101
+ /**
102
+ * The JSON Schema of the structured result, listed with the tool so a
103
+ * client — or a page calling the tool through one, such as a Claude
104
+ * artifact — reads the shape rather than guesses it. A client may check
105
+ * every result against it, so it describes what every result holds and
106
+ * no more: loose where a result varies.
107
+ */
108
+ outputSchema?: Record<string, unknown>;
101
109
  /**
102
110
  * The MCP App view a host shows this tool's result in (see
103
111
  * `mcp-apps.ts`). A tool with one is offered only where that view is
@@ -18,3 +18,12 @@ export declare const SHOW_APP_GUIDE_TOOL = "show_app_guide";
18
18
  */
19
19
  export declare const SHOW_APP_ESSENTIALS = "\nCall show_app_guide before writing the code: it gives every hook, component and prop an app may use, with a worked example. Props guessed from other libraries draw nothing. In short:\n- One TSX module, default-exporting a React component with no props. Its only imports: \"react\"; \"@rebasepro/app\" (useRows, useRow, useRowCount, useAggregate, useRowWrites: the project's rows as the user); \"@rebasepro/cms\" (CollectionPanel, RecordForm, FormField, RecordDetail, FieldValue, useSidePanel: the admin panel's own views and forms); \"@rebasepro/ui\" (the UI kit: SplitView, KpiGrid, KpiTile, ChartCard, BarChart, TimeSeriesChart, Card, Button, Tabs, \u2026).\n- A list and a form: <SplitView master={\u2026} detail={\u2026} selected={\u2026} onClearSelection={\u2026} /> inside a parent with a height (style={{ height: 560 }}), never grid columns side by side.\n- Figures and charts: KpiTile and BarChart, not drawn by hand.\n- Tailwind's standard utilities only: an arbitrary value (h-[560px]) does nothing.";
20
20
  export declare const SHOW_APP_CODE_GUIDE: string;
21
+ /**
22
+ * EXPERIMENTAL. The guide's last part, where the artifact kit is served: how
23
+ * to make the same app a Claude artifact — a page that keeps, that its owner
24
+ * shares inside their organization, and that reads the project as whoever
25
+ * opens it, through their own Rebase connector. Only for a server that knows
26
+ * where the kit is (`kitUrl`, the published `rebase-artifact.js`), so nothing
27
+ * points the model at a script that is not there.
28
+ */
29
+ export declare function showAppArtifactGuide(kitUrl: string): string;