@roll-agent/sdk 0.7.2 → 1.0.0

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/dist/context.d.ts CHANGED
@@ -10,13 +10,8 @@ export interface AgentLogger {
10
10
  }
11
11
  /** 单次 MCP Sampling 文本生成选项。 */
12
12
  export declare const AgentGenerateTextOptionsSchema: z.ZodObject<{
13
- /** MCP Sampling 输出上限;省略时为 1024,最大 8192。 */
14
13
  maxOutputTokens: z.ZodOptional<z.ZodNumber>;
15
- }, "strict", z.ZodTypeAny, {
16
- maxOutputTokens?: number | undefined;
17
- }, {
18
- maxOutputTokens?: number | undefined;
19
- }>;
14
+ }, z.core.$strict>;
20
15
  export type AgentGenerateTextOptions = Readonly<z.infer<typeof AgentGenerateTextOptionsSchema>>;
21
16
  /** Agent 上下文中的 LLM 接口(通过 MCP Sampling 访问指挥官 LLM) */
22
17
  export interface AgentLLM {
@@ -47,5 +47,5 @@ type McpToolResult = {
47
47
  structuredContent?: Record<string, unknown>;
48
48
  _meta?: Record<string, unknown>;
49
49
  };
50
- export declare function executeToolForMcp(tool: AnyToolDefinition, ctx: AgentContext, params: Record<string, unknown>, signal?: AbortSignal): Promise<McpToolResult>;
50
+ export declare function executeToolForMcp(tool: AnyToolDefinition, ctx: AgentContext, params: unknown, signal?: AbortSignal): Promise<McpToolResult>;
51
51
  export {};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{APP_OUTPUT_META_KEY as e}from"@roll-agent/protocol/app-output";import{OBSERVATION_RETENTION_META_KEY as t}from"@roll-agent/protocol/observation-retention";import{AjvJsonSchemaValidator as o}from"@modelcontextprotocol/sdk/validation/ajv";import{isDeepStrictEqual as n}from"node:util";import{z as r}from"zod";import{toJsonSchemaCompat as s}from"@modelcontextprotocol/sdk/server/zod-json-schema-compat.js";import{APP_OUTPUT_LIMITS as a,APP_OUTPUT_STATUS_META_KEY as i,appOutputDeclarationSchema as c,validateAppOutputContract as p}from"@roll-agent/protocol/app-output";function u(e,t=new Set){if(!t.has(e))if(t.add(e),e instanceof r.ZodObject){for(const o of Object.values(e.shape))o instanceof r.ZodType&&u(o,t);e._def.catchall instanceof r.ZodNever||u(e._def.catchall,t)}else if(e instanceof r.ZodArray)u(e.element,t);else if(e instanceof r.ZodOptional||e instanceof r.ZodNullable||e instanceof r.ZodReadonly||e instanceof r.ZodBranded)u(e.unwrap(),t);else if(e instanceof r.ZodUnion)for(const o of e.options)u(o,t);else if(e instanceof r.ZodDiscriminatedUnion)for(const o of e.options)u(o,t);else if(e instanceof r.ZodTuple){for(const o of e.items)u(o,t);e._def.rest&&u(e._def.rest,t)}else if(e instanceof r.ZodRecord)u(e.keySchema,t),u(e.valueSchema,t);else if(e instanceof r.ZodString||e instanceof r.ZodNumber||e instanceof r.ZodBoolean){if(e._def.coerce)throw new Error("appOutput does not support coercion");if(e instanceof r.ZodString)for(const t of e._def.checks)if(["trim","toLowerCase","toUpperCase"].includes(t.kind)||"regex"===t.kind&&""!==t.regex.flags)throw new Error("appOutput cannot represent string transformations or regex flags")}else if(e instanceof r.ZodLiteral){const t=e.value;if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&("number"!=typeof t||!Number.isFinite(t)))throw new Error("appOutput requires JSON-compatible literals")}else if(!(e instanceof r.ZodNull||e instanceof r.ZodEnum||e instanceof r.ZodNativeEnum))throw new Error(`appOutput cannot represent ${e.constructor.name} as JSON Schema`)}function f(e){if(!e.appOutput)return;if(!(e.output instanceof r.ZodObject))throw new Error("appOutput requires an object output schema");u(e.output);const t=c.parse(e.appOutput),n=p({...t,outputSchema:s(e.output,{pipeStrategy:"output"})});return(new o).getValidator(n.outputSchema),{declaration:t,contract:n}}function l(e){return{isError:!0,_meta:{[i]:e,"roll/executionStatus":"completed"},content:[{type:"text",text:"Tool execution completed; application output unavailable. Do not repeat the operation."}]}}async function d(e,t){try{const o=await e.safeParseAsync(t);if(!o.success||!n(o.data,t))return l("invalid");const r=JSON.stringify(t);if(void 0===r)return l("invalid");if(Buffer.byteLength(r,"utf8")>a.resultBytes)return l("too_large");const s=JSON.parse(r);return!n(s,t)||"object"!=typeof s||null===s||Array.isArray(s)?l("invalid"):{content:[{type:"text",text:r}],structuredContent:s}}catch{return l("invalid")}}import{createServer as m}from"node:http";import{randomUUID as y}from"node:crypto";import{McpServer as g}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as w}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as h}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{z as v}from"zod";var S=v.object({maxOutputTokens:v.number().int().min(1).max(8192).optional()}).strict(),x={debug:0,info:1,warn:2,error:3};function b(e,t="info"){const o=x[t],n=(t,n)=>{if(x[t]<o)return;const r=(new Date).toISOString(),s=t.toUpperCase().padEnd(5);console.error(`${r} [${s}] [${e}] ${n}`)};return{debug:e=>n("debug",e),info:e=>n("info",e),warn:e=>n("warn",e),error:e=>n("error",e)}}import{z as T}from"zod";var O=8;function Z(e){let t=e;for(let e=0;e<O;e+=1)if(t instanceof T.ZodEffects)t=t.innerType();else if(t instanceof T.ZodOptional||t instanceof T.ZodNullable||t instanceof T.ZodBranded||t instanceof T.ZodReadonly)t=t.unwrap();else if(t instanceof T.ZodDefault)t=t.removeDefault();else{if(!(t instanceof T.ZodCatch))return t;t=t.removeCatch()}return t}async function E(e,t){const o=await e.safeParseAsync(t);if(!o.success)throw new Error(`Tool input validation failed: ${j(o.error)}`);return o.data}function j(e){return e.issues.map(e=>{const t=e.path.join(".");return t.length>0?`${t}: ${e.message}`:e.message}).join("; ")}var N=class extends Error{payload;constructor(e){super(e.message),this.name="StructuredToolError",this.payload=e}};function $(e){return e instanceof N||e instanceof Error&&"payload"in e&&k(e.payload)}function k(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;const t=e,o=t.details;return"string"==typeof t.code&&"string"==typeof t.message&&(void 0===o||"object"==typeof o&&null!==o&&!Array.isArray(o))}var A="roll/resourceHints";function I(e){return e??L()??"info"}function L(){const e=process.env.ROLL_AGENT_LOG_LEVEL;if("debug"===e||"info"===e||"warn"===e||"error"===e)return e}function C(e,t,o){return{llm:{generateText:async(e,t)=>{const n=S.parse(t??{}).maxOutputTokens??1024,r=await o.server.createMessage({messages:[{role:"user",content:{type:"text",text:e}}],maxTokens:n}).catch(e=>{throw new Error("LLM sampling unavailable. Ensure roll-core client enables sampling capability.",{cause:e})});if("maxTokens"===r.stopReason)throw new Error(`LLM sampling output truncated at maxOutputTokens=${n} (MCP stopReason=maxTokens).`);const s=R(r.content);if(void 0===s)throw new Error("Sampling response did not include text content");return s}},logger:b(e,t)}}function R(e){if("object"==typeof e&&null!==e&&"type"in e&&"text"===e.type&&"text"in e){const t=e.text;return"string"==typeof t?t:void 0}if(Array.isArray(e))for(const t of e){const e=R(t);if(void 0!==e)return e}}function _(e,t={}){return{...e,listen:async o=>{const n=o?.transport??{type:"stdio"},r=I(t.logLevel);"http"===n.type?await M(e,r,n.port,n.host,t.onShutdown):await J(e,r,t.onShutdown)}}}function H(e){let t;const o=o=>{t??=e(o).catch(()=>{process.exit(1)})};process.once("SIGTERM",()=>{o("SIGTERM")}),process.once("SIGINT",()=>{o("SIGINT")})}async function J(e,t,o){const n=new g({name:e.name,version:"0.0.1"}),r=C(e.name,t,n);for(const t of e.tools)P(n,t,r);const s=new w;await n.connect(s),r.logger.info("MCP Server running on stdio");H(async e=>{r.logger.info(`${e} received, shutting down...`),o&&await o(),await n.close(),process.exit(0)})}async function M(e,t,o,n,r){const s=b(e.name,t),a=new Map,i=m(async(o,n)=>{if("/mcp"!==new URL(o.url??"/",`http://${o.headers.host??"localhost"}`).pathname)return n.writeHead(404,{"Content-Type":"application/json"}),void n.end(JSON.stringify({error:"Not found"}));const r="string"==typeof o.headers["mcp-session-id"]?o.headers["mcp-session-id"]:void 0;if(r){const e=a.get(r);if(e){try{await e.transport.handleRequest(o,n)}catch(e){s.error(`Error handling request for session ${r}: ${String(e)}`),n.headersSent||(n.writeHead(500,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Internal server error"})))}return}return n.writeHead(404,{"Content-Type":"application/json"}),void n.end(JSON.stringify({error:"Session not found"}))}try{const r=new h({sessionIdGenerator:()=>y()}),i=new g({name:e.name,version:"0.0.1"}),c=C(e.name,t,i);for(const t of e.tools)P(i,t,c);r.onclose=()=>{const e=r.sessionId;e&&(a.delete(e),s.info(`Session ${e} closed`))},r.onerror=e=>{s.error(`Transport error (session ${r.sessionId??"unknown"}): ${e.message}`)},await i.connect(r),await r.handleRequest(o,n),r.sessionId&&a.set(r.sessionId,{transport:r,server:i})}catch(e){s.error(`Error creating new session: ${String(e)}`),n.headersSent||(n.writeHead(500,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Failed to create session"})))}});i.on("error",e=>{s.error(`HTTP server error: ${e.message}`)});const c=n??"127.0.0.1";i.listen(o,c,()=>{s.info(`MCP Server running on http://${c}:${o}/mcp`)});H(async e=>{s.info(`${e} received, shutting down HTTP server...`),await new Promise(e=>{i.close(()=>e())});const t=[];for(const[,e]of a)t.push(e.server.close());await Promise.all(t),a.clear(),r&&await r(),process.exit(0)})}function P(o,n,r){const s=f(n),a={...n._meta??{},...s?{[e]:s.declaration}:{},...n.resourceHints&&n.resourceHints.length>0?{[A]:n.resourceHints}:{},...n.observationRetention?{[t]:n.observationRetention}:{}};o.registerTool(n.name,{description:n.description,inputSchema:Z(n.input),...s?{outputSchema:n.output}:{},...n.annotations?{annotations:n.annotations}:{},...Object.keys(a).length>0?{_meta:a}:{}},async(e,t)=>await z(n,r,e,t.signal))}function G(e){if("object"!=typeof e||null===e||Array.isArray(e))return{payload:e,images:[]};const t=e,o=t.mcpImages;if(!Array.isArray(o))return{payload:e,images:[]};const n=o.filter(e=>"object"==typeof e&&null!==e&&"string"==typeof e.data&&"string"==typeof e.mimeType),{mcpImages:r,...s}=t;return{payload:s,images:n}}async function z(e,t,o,n){const r=f(e),s=await E(e.input,o),a=void 0===n?t:{...t,signal:n};try{const t=await e.execute(s,a);if(r)return await d(e.output,t);const{payload:o,images:n}=G(t);return{content:[{type:"text",text:JSON.stringify(o)},...n.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}))]}}catch(e){if($(e))return{isError:!0,content:[{type:"text",text:JSON.stringify(e.payload)}]};throw e}}function q(e){return e}var B={read:"read",write:"write"},D={file:"file",browserSession:"browser-session",conversation:"conversation",custom:"custom"};export{N as StructuredToolError,B as TOOL_RESOURCE_ACCESS_MODES,D as TOOL_RESOURCE_HINT_KINDS,b as createAgentLogger,_ as defineAgent,q as defineTool,$ as isStructuredToolError};
1
+ import{APP_OUTPUT_META_KEY as e}from"@roll-agent/protocol/app-output";import{OBSERVATION_RETENTION_META_KEY as t}from"@roll-agent/protocol/observation-retention";import{AjvJsonSchemaValidator as o}from"@modelcontextprotocol/sdk/validation/ajv";import{isDeepStrictEqual as n}from"node:util";import{z as r}from"zod";import{toJsonSchemaCompat as s}from"@modelcontextprotocol/sdk/server/zod-json-schema-compat.js";import{APP_OUTPUT_LIMITS as a,APP_OUTPUT_STATUS_META_KEY as i,appOutputDeclarationSchema as c,validateAppOutputContract as p}from"@roll-agent/protocol/app-output";function f(e,t=new Set){if(!t.has(e)){t.add(e);for(const t of e._zod.def.checks??[]){if("custom"===t._zod.def.check||"overwrite"===t._zod.def.check||"property"===t._zod.def.check)throw new Error("appOutput cannot represent custom refinements or transformations");if(t instanceof r.core.$ZodCustomStringFormat&&(!t._zod.def.pattern||t._zod.def.pattern.flags))throw new Error("appOutput cannot represent function-based or flagged string formats");if(t instanceof r.core.$ZodCheckStringFormat&&"regex"===t._zod.def.format&&t._zod.def.pattern?.flags)throw new Error("appOutput cannot represent regex flags")}if(e instanceof r.ZodObject){for(const o of Object.values(e.shape))o instanceof r.ZodType&&f(o,t);const o=e._zod.def.catchall;void 0===o||o instanceof r.ZodNever||f(o,t)}else if(e instanceof r.ZodArray)f(e.element,t);else if(e instanceof r.ZodOptional||e instanceof r.ZodNullable||e instanceof r.ZodReadonly)f(e.unwrap(),t);else if(e instanceof r.ZodUnion)for(const o of e.options)f(o,t);else if(e instanceof r.ZodTuple){for(const o of e._zod.def.items)f(o,t);e._zod.def.rest&&f(e._zod.def.rest,t)}else if(e instanceof r.ZodRecord)f(e.keyType,t),f(e.valueType,t);else if(e instanceof r.ZodString||e instanceof r.ZodNumber||e instanceof r.ZodBoolean){if(e._zod.def.coerce)throw new Error("appOutput does not support coercion")}else if(e instanceof r.ZodLiteral){for(const t of e.values)if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&("number"!=typeof t||!Number.isFinite(t)))throw new Error("appOutput requires JSON-compatible literals")}else if(!(e instanceof r.ZodNull||e instanceof r.ZodEnum))throw new Error(`appOutput cannot represent ${e.constructor.name} as JSON Schema`)}}function u(e){if(!e.appOutput)return;if(!(e.output instanceof r.ZodObject))throw new Error("appOutput requires an object output schema");f(e.output);const t=c.parse(e.appOutput),n=p({...t,outputSchema:s(e.output,{pipeStrategy:"output"})});return(new o).getValidator(n.outputSchema),{declaration:t,contract:n}}function d(e){return{isError:!0,_meta:{[i]:e,"roll/executionStatus":"completed"},content:[{type:"text",text:"Tool execution completed; application output unavailable. Do not repeat the operation."}]}}async function l(e,t){try{const o=await e.safeParseAsync(t);if(!o.success||!n(o.data,t))return d("invalid");const r=JSON.stringify(t);if(void 0===r)return d("invalid");if(Buffer.byteLength(r,"utf8")>a.resultBytes)return d("too_large");const s=JSON.parse(r);return!n(s,t)||"object"!=typeof s||null===s||Array.isArray(s)?d("invalid"):{content:[{type:"text",text:r}],structuredContent:s}}catch{return d("invalid")}}import{createServer as m}from"node:http";import{randomUUID as y}from"node:crypto";import{McpServer as g}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as w}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as h}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{z as v}from"zod";var S=v.object({maxOutputTokens:v.number().int().min(1).max(8192).optional()}).strict(),b={debug:0,info:1,warn:2,error:3};function x(e,t="info"){const o=b[t],n=(t,n)=>{if(b[t]<o)return;const r=(new Date).toISOString(),s=t.toUpperCase().padEnd(5);console.error(`${r} [${s}] [${e}] ${n}`)};return{debug:e=>n("debug",e),info:e=>n("info",e),warn:e=>n("warn",e),error:e=>n("error",e)}}import{z as T}from"zod";var O=8;function Z(e){let t=e;for(let e=0;e<O;e+=1)if(t instanceof T.ZodPipe)t=t.in instanceof T.ZodTransform?t.out:t.in;else{if(!(t instanceof T.ZodOptional||t instanceof T.ZodNullable||t instanceof T.ZodDefault||t instanceof T.ZodPrefault||t instanceof T.ZodCatch||t instanceof T.ZodReadonly))return t instanceof T.ZodObject&&t._zod.def.checks?.length?t.clone({...t._zod.def,checks:[]}):t;t=t.unwrap()}return t}async function E(e,t){const o=await e.safeParseAsync(t);if(!o.success)throw new Error(`Tool input validation failed: ${j(o.error)}`);return o.data}function j(e){return e.issues.map(e=>{const t=e.path.join(".");return t.length>0?`${t}: ${e.message}`:e.message}).join("; ")}var $=class extends Error{payload;constructor(e){super(e.message),this.name="StructuredToolError",this.payload=e}};function _(e){return e instanceof $||e instanceof Error&&"payload"in e&&k(e.payload)}function k(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;const t=e,o=t.details;return"string"==typeof t.code&&"string"==typeof t.message&&(void 0===o||"object"==typeof o&&null!==o&&!Array.isArray(o))}var z="roll/resourceHints";function N(e){return e??A()??"info"}function A(){const e=process.env.ROLL_AGENT_LOG_LEVEL;if("debug"===e||"info"===e||"warn"===e||"error"===e)return e}function I(e,t,o){return{llm:{generateText:async(e,t)=>{const n=S.parse(t??{}).maxOutputTokens??1024,r=await o.server.createMessage({messages:[{role:"user",content:{type:"text",text:e}}],maxTokens:n}).catch(e=>{throw new Error("LLM sampling unavailable. Ensure roll-core client enables sampling capability.",{cause:e})});if("maxTokens"===r.stopReason)throw new Error(`LLM sampling output truncated at maxOutputTokens=${n} (MCP stopReason=maxTokens).`);const s=L(r.content);if(void 0===s)throw new Error("Sampling response did not include text content");return s}},logger:x(e,t)}}function L(e){if("object"==typeof e&&null!==e&&"type"in e&&"text"===e.type&&"text"in e){const t=e.text;return"string"==typeof t?t:void 0}if(Array.isArray(e))for(const t of e){const e=L(t);if(void 0!==e)return e}}function R(e,t={}){return{...e,listen:async o=>{const n=o?.transport??{type:"stdio"},r=N(t.logLevel);"http"===n.type?await P(e,r,n.port,n.host,t.onShutdown):await H(e,r,t.onShutdown)}}}function C(e){let t;const o=o=>{t??=e(o).catch(()=>{process.exit(1)})};process.once("SIGTERM",()=>{o("SIGTERM")}),process.once("SIGINT",()=>{o("SIGINT")})}async function H(e,t,o){const n=new g({name:e.name,version:"0.0.1"}),r=I(e.name,t,n);for(const t of e.tools)J(n,t,r);const s=new w;await n.connect(s),r.logger.info("MCP Server running on stdio");C(async e=>{r.logger.info(`${e} received, shutting down...`),o&&await o(),await n.close(),process.exit(0)})}async function P(e,t,o,n,r){const s=x(e.name,t),a=new Map,i=m(async(o,n)=>{if("/mcp"!==new URL(o.url??"/",`http://${o.headers.host??"localhost"}`).pathname)return n.writeHead(404,{"Content-Type":"application/json"}),void n.end(JSON.stringify({error:"Not found"}));const r="string"==typeof o.headers["mcp-session-id"]?o.headers["mcp-session-id"]:void 0;if(r){const e=a.get(r);if(e){try{await e.transport.handleRequest(o,n)}catch(e){s.error(`Error handling request for session ${r}: ${String(e)}`),n.headersSent||(n.writeHead(500,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Internal server error"})))}return}return n.writeHead(404,{"Content-Type":"application/json"}),void n.end(JSON.stringify({error:"Session not found"}))}try{const r=new h({sessionIdGenerator:()=>y()}),i=new g({name:e.name,version:"0.0.1"}),c=I(e.name,t,i);for(const t of e.tools)J(i,t,c);r.onclose=()=>{const e=r.sessionId;e&&(a.delete(e),s.info(`Session ${e} closed`))},r.onerror=e=>{s.error(`Transport error (session ${r.sessionId??"unknown"}): ${e.message}`)},await i.connect(r),await r.handleRequest(o,n),r.sessionId&&a.set(r.sessionId,{transport:r,server:i})}catch(e){s.error(`Error creating new session: ${String(e)}`),n.headersSent||(n.writeHead(500,{"Content-Type":"application/json"}),n.end(JSON.stringify({error:"Failed to create session"})))}});i.on("error",e=>{s.error(`HTTP server error: ${e.message}`)});const c=n??"127.0.0.1";i.listen(o,c,()=>{s.info(`MCP Server running on http://${c}:${o}/mcp`)});C(async e=>{s.info(`${e} received, shutting down HTTP server...`),await new Promise(e=>{i.close(()=>e())});const t=[];for(const[,e]of a)t.push(e.server.close());await Promise.all(t),a.clear(),r&&await r(),process.exit(0)})}function J(o,n,r){const s=u(n),a={...n._meta??{},...s?{[e]:s.declaration}:{},...n.resourceHints&&n.resourceHints.length>0?{[z]:n.resourceHints}:{},...n.observationRetention?{[t]:n.observationRetention}:{}};o.registerTool(n.name,{description:n.description,inputSchema:Z(n.input),...s?{outputSchema:n.output}:{},...n.annotations?{annotations:n.annotations}:{},...Object.keys(a).length>0?{_meta:a}:{}},async(e,t)=>await G(n,r,e,t.signal))}function M(e){if("object"!=typeof e||null===e||Array.isArray(e))return{payload:e,images:[]};const t=e,o=t.mcpImages;if(!Array.isArray(o))return{payload:e,images:[]};const n=o.filter(e=>"object"==typeof e&&null!==e&&"string"==typeof e.data&&"string"==typeof e.mimeType),{mcpImages:r,...s}=t;return{payload:s,images:n}}async function G(e,t,o,n){const r=u(e),s=await E(e.input,o),a=void 0===n?t:{...t,signal:n};try{const t=await e.execute(s,a);if(r)return await l(e.output,t);const{payload:o,images:n}=M(t);return{content:[{type:"text",text:JSON.stringify(o)},...n.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}))]}}catch(e){if(_(e))return{isError:!0,content:[{type:"text",text:JSON.stringify(e.payload)}]};throw e}}function q(e){return e}var F={read:"read",write:"write"},B={file:"file",browserSession:"browser-session",conversation:"conversation",custom:"custom"};export{$ as StructuredToolError,F as TOOL_RESOURCE_ACCESS_MODES,B as TOOL_RESOURCE_HINT_KINDS,x as createAgentLogger,R as defineAgent,q as defineTool,_ as isStructuredToolError};
@@ -1,3 +1,3 @@
1
1
  import { z } from "zod";
2
- export declare function getMcpCompatibleInputSchema(schema: z.ZodType): z.ZodTypeAny;
2
+ export declare function getMcpCompatibleInputSchema(schema: z.ZodType): z.core.$ZodType;
3
3
  export declare function parseToolInput(schema: z.ZodType, input: unknown): Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/sdk",
3
- "version": "0.7.2",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,9 +26,9 @@
26
26
  "node": ">=22.6.0"
27
27
  },
28
28
  "dependencies": {
29
- "@modelcontextprotocol/sdk": "1.31.0",
30
- "zod": "^3.25.76",
31
- "@roll-agent/protocol": "0.9.0"
29
+ "@modelcontextprotocol/sdk": "1.32.0",
30
+ "zod": "4.6.6",
31
+ "@roll-agent/protocol": "0.10.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.0.0"