@caplets/core 0.18.6 → 0.18.8

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.
@@ -1,14 +1,34 @@
1
- import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
1
  export type TextContentBlock = {
3
2
  type: "text";
4
3
  text: string;
5
4
  };
5
+ type ContentBlockLike = {
6
+ type: string;
7
+ text?: string;
8
+ } & Record<string, unknown>;
9
+ type CallToolResultLike = {
10
+ content?: ContentBlockLike[];
11
+ structuredContent?: unknown;
12
+ isError?: boolean | undefined;
13
+ };
14
+ export type ResultMarkdownContext = {
15
+ title?: string | undefined;
16
+ backend?: string | undefined;
17
+ operation?: string | undefined;
18
+ tool?: string | undefined;
19
+ uri?: string | undefined;
20
+ prompt?: string | undefined;
21
+ fields?: string[] | undefined;
22
+ isError?: boolean | undefined;
23
+ };
6
24
  export declare function structuredOnlyContent(): [];
7
25
  export declare function textContent(text: string): TextContentBlock[];
8
26
  export declare function compactJsonText(value: unknown, maxLength?: number): string;
9
27
  export declare function compactText(value: string, maxLength?: number): string;
10
- export declare function resultKeys(value: unknown): string;
11
- export declare function statusSummary(value: unknown): string;
12
- export declare function compactStructuredContent(value: unknown): TextContentBlock[];
13
- export declare function compactCallToolResultContent(result: CallToolResult): TextContentBlock[];
28
+ export declare function markdownStructuredContent(value: unknown, context?: ResultMarkdownContext): TextContentBlock[];
29
+ export declare function markdownCallToolResultContent(result: CallToolResultLike, context?: ResultMarkdownContext): TextContentBlock[];
30
+ export declare function compactStructuredContent(value: unknown, context?: ResultMarkdownContext): TextContentBlock[];
31
+ export declare function compactCallToolResultContent(result: CallToolResultLike, context?: ResultMarkdownContext): TextContentBlock[];
32
+ export declare function hasRenderableStructuredContent(value: unknown): boolean;
14
33
  export declare function byteLimitHint(maxBytes: number): string;
34
+ export {};
package/dist/runtime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
1
+ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport";
2
2
  import type { CapletsConfig } from "./config";
3
3
  import { type ToolServer } from "./serve/session";
4
4
  type CapletsRuntimeOptions = {
@@ -1,5 +1,5 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport";
3
3
  import type { CapletsEngine } from "../engine";
4
4
  export type ToolServer = Pick<McpServer, "registerTool" | "connect" | "close">;
5
5
  export type CapletsMcpSessionOptions = {
@@ -1,2 +1,2 @@
1
- import type { Tool } from "@modelcontextprotocol/sdk/types.js";
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types";
2
2
  export declare function searchToolList<T>(tools: Tool[], query: string, limit: number, compact: (tool: Tool) => T): T[];
package/dist/tools.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
1
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types";
2
2
  import type { CapletSetManager } from "./caplet-sets";
3
3
  import type { CapletConfig } from "./config";
4
4
  import type { CliToolsManager } from "./cli-tools";
@@ -7,6 +7,7 @@ import type { GraphQLManager } from "./graphql";
7
7
  import type { HttpActionManager } from "./http-actions";
8
8
  import type { OpenApiManager } from "./openapi";
9
9
  import type { ServerRegistry } from "./registry";
10
+ import { type ResultMarkdownContext } from "./result-content";
10
11
  export { generatedToolInputSchema } from "./generated-tool-input-schema";
11
12
  export type GeneratedServerToolRequest = RequiredOperationRequest;
12
13
  export declare function handleServerTool(server: CapletConfig, request: unknown, registry: ServerRegistry, downstream: DownstreamManager, openapi?: OpenApiManager, graphql?: GraphQLManager, http?: HttpActionManager, cli?: CliToolsManager, caplets?: CapletSetManager): Promise<any>;
@@ -81,5 +82,5 @@ export declare function metadataFor(server: CapletConfig, operation: RequiredOpe
81
82
  export declare function annotateMcpResult<T extends object>(result: T, metadata: CapletResultMetadata): T;
82
83
  export declare function jsonResult(value: unknown, metadata?: CapletResultMetadata): CallToolResult;
83
84
  export declare function annotateCallToolResult<T extends object>(result: T, metadata: CapletResultMetadata): T & CallToolResult;
84
- export declare function projectCallToolResult<T extends object>(result: T, outputSchema: unknown, fields: string[]): T & CallToolResult;
85
+ export declare function projectCallToolResult<T extends object>(result: T, outputSchema: unknown, fields: string[], context?: ResultMarkdownContext): T & CallToolResult;
85
86
  export declare function extractArtifacts(result: unknown): CapletArtifact[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caplets/core",
3
- "version": "0.18.6",
3
+ "version": "0.18.8",
4
4
  "description": "Core runtime library for Caplets progressive disclosure gateways.",
5
5
  "keywords": [
6
6
  "caplets",
@@ -58,8 +58,8 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^25.9.1",
61
- "@typescript/native-preview": "7.0.0-dev.20260526.1",
62
- "rolldown": "^1.0.2",
61
+ "@typescript/native-preview": "7.0.0-dev.20260527.2",
62
+ "rolldown": "^1.0.3",
63
63
  "typescript": "^6.0.3",
64
64
  "vitest": "^4.1.7"
65
65
  },