@2kw/ai-mcp-server 8.0.0-dev.11 → 8.0.0-dev.12

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.
@@ -65,6 +65,18 @@ export interface PendingInput {
65
65
  mode: InputMode;
66
66
  answerUrl: string;
67
67
  }
68
+ /**
69
+ * A table or chart the agent showed the user (#1419): a `backbone:ui` item, its validated `props` as the
70
+ * server sent them. A client renders from `props`, never from the call's arguments.
71
+ */
72
+ export interface ShownComponent {
73
+ id: string;
74
+ callId: string;
75
+ /** `table` or `chart`; another value is a component this build does not know. */
76
+ component: string;
77
+ schemaVersion: number;
78
+ props: unknown;
79
+ }
68
80
  /** The end user's conversation mode (epic &59); the server matches these three values exactly. */
69
81
  export type ConversationMode = "plan" | "ask" | "auto";
70
82
  export declare const CONVERSATION_MODES: readonly ConversationMode[];
@@ -97,6 +109,7 @@ export interface RunEnvelope {
97
109
  pendingToolCalls: PendingToolCall[];
98
110
  pendingConnections: PendingConnection[];
99
111
  pendingInputs: PendingInput[];
112
+ components: ShownComponent[];
100
113
  incompleteReason: string | null;
101
114
  usage: {
102
115
  inputTokens: number;
@@ -108,6 +108,8 @@ const DECODED_ITEM_TYPES = new Set([
108
108
  "backbone:connector_auth_request",
109
109
  "backbone:input_request",
110
110
  "backbone:tool_image",
111
+ // A table or chart a finished ShowTable or ShowChart call showed (#1419): it never holds a run either.
112
+ "backbone:ui",
111
113
  "mcp_approval_request",
112
114
  "mcp_call",
113
115
  "mcp_list_tools",
@@ -302,6 +304,15 @@ export function buildRunEnvelope(result, agentRef, chatUrl = DEFAULT_CHAT_URL) {
302
304
  pendingToolCalls,
303
305
  pendingConnections,
304
306
  pendingInputs,
307
+ components: output
308
+ .filter((i) => i.type === "backbone:ui")
309
+ .map((i) => ({
310
+ id: String(i.id),
311
+ callId: String(i.call_id),
312
+ component: String(i.component),
313
+ schemaVersion: Number(i.schema_version),
314
+ props: i.props ?? null,
315
+ })),
305
316
  incompleteReason: result?.incomplete_details?.reason ?? null,
306
317
  usage: result?.usage
307
318
  ? { inputTokens: result.usage.input_tokens ?? 0, outputTokens: result.usage.output_tokens ?? 0 }
@@ -100,7 +100,7 @@ export function register(server, client) {
100
100
  return input === "" ? [] : input;
101
101
  };
102
102
  // ── create_response ─────────────────────────────────────────────────────
103
- server.tool("2kw_create_response", "Send a request through Backbone's OpenAI-compatible OpenResponses endpoint (POST /v1/responses). Model format: 'provider/model' for a direct gateway call via `model`, or use `agent` to invoke a stored agent by id or name (optionally 'ref@label', e.g. 'support-bot@latest'). With `agent`, `agentModel` runs this one request on another model from the agent version's `models` list. With `agent`, the reply is the run envelope as JSON (status, text, tool calls, pending approvals, response id, next step) followed by the model that answered; answer an approval pause with 2kw_decide_agent_approvals. A run paused on a relayed (client-side) tool call comes back with status requires_tool_output and `pendingToolCalls`; answer it with 2kw_decide_agent_approvals `outputs`. A run that needs the user's own sign-in to a connector pauses with status requires_tool_output and `pendingConnections` (label, host, reason): no tool here can answer that; tell the user to connect it in chat.2kw.ai → Connectors, as the envelope's `next` says; once they have, resume it with 2kw_create_response `previousResponseId` (and an empty `input`). A run where a connector asks the user a question pauses with status requires_tool_output and `pendingInputs` (label, tool, mode, answerUrl): the user answers it in chat at `answerUrl`, not here. Always non-streaming. " + MODE_RULE, {
103
+ server.tool("2kw_create_response", "Send a request through Backbone's OpenAI-compatible OpenResponses endpoint (POST /v1/responses). Model format: 'provider/model' for a direct gateway call via `model`, or use `agent` to invoke a stored agent by id or name (optionally 'ref@label', e.g. 'support-bot@latest'). With `agent`, `agentModel` runs this one request on another model from the agent version's `models` list. With `agent`, the reply is the run envelope as JSON (status, text, tool calls, pending approvals, the tables and charts the agent showed the user as `components`, response id, next step) followed by the model that answered; answer an approval pause with 2kw_decide_agent_approvals. A run paused on a relayed (client-side) tool call comes back with status requires_tool_output and `pendingToolCalls`; answer it with 2kw_decide_agent_approvals `outputs`. A run that needs the user's own sign-in to a connector pauses with status requires_tool_output and `pendingConnections` (label, host, reason): no tool here can answer that; tell the user to connect it in chat.2kw.ai → Connectors, as the envelope's `next` says; once they have, resume it with 2kw_create_response `previousResponseId` (and an empty `input`). A run where a connector asks the user a question pauses with status requires_tool_output and `pendingInputs` (label, tool, mode, answerUrl): the user answers it in chat at `answerUrl`, not here. Always non-streaming. " + MODE_RULE, {
104
104
  input: z
105
105
  .string()
106
106
  .describe("The input text (sent as a single user message). May be empty only with `previousResponseId`, to resume a paused response without a new message."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai-mcp-server",
3
- "version": "8.0.0-dev.11",
3
+ "version": "8.0.0-dev.12",
4
4
  "description": "MCP server for 2kw.ai — EU-hosted AI platform: OpenAI-compatible LLM gateway, schema-driven document extraction, transcription, agents with a knowledge base, and cost observability. 199 tools for Claude Code, Cursor, and Windsurf.",
5
5
  "mcpName": "ai.2kw/mcp-server",
6
6
  "keywords": [