@roll-agent/sdk 0.5.1 → 0.7.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.
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { type AppOutputContract, type AppOutputDeclaration } from "@roll-agent/protocol/app-output";
3
+ import type { AnyToolDefinition } from "./types/index.ts";
4
+ export declare function prepareAppOutput(tool: AnyToolDefinition): {
5
+ readonly declaration: AppOutputDeclaration;
6
+ readonly contract: AppOutputContract;
7
+ } | undefined;
8
+ export declare function projectAppOutput(schema: z.ZodType, result: unknown): Promise<{
9
+ isError: true;
10
+ _meta: {
11
+ "roll/appOutputStatus": "invalid" | "too_large";
12
+ "roll/executionStatus": string;
13
+ };
14
+ content: [{
15
+ type: "text";
16
+ text: string;
17
+ }];
18
+ } | {
19
+ content: [{
20
+ type: "text";
21
+ text: string;
22
+ }];
23
+ structuredContent: Record<string, unknown>;
24
+ }>;
package/dist/context.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  /** Agent 日志级别 */
2
3
  export type LogLevel = "debug" | "info" | "warn" | "error";
3
4
  /** Agent 上下文中的日志接口 */
@@ -7,9 +8,20 @@ export interface AgentLogger {
7
8
  readonly warn: (message: string) => void;
8
9
  readonly error: (message: string) => void;
9
10
  }
11
+ /** 单次 MCP Sampling 文本生成选项。 */
12
+ export declare const AgentGenerateTextOptionsSchema: z.ZodObject<{
13
+ /** MCP Sampling 输出上限;省略时为 1024,最大 8192。 */
14
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
15
+ }, "strict", z.ZodTypeAny, {
16
+ maxOutputTokens?: number | undefined;
17
+ }, {
18
+ maxOutputTokens?: number | undefined;
19
+ }>;
20
+ export type AgentGenerateTextOptions = Readonly<z.infer<typeof AgentGenerateTextOptionsSchema>>;
10
21
  /** Agent 上下文中的 LLM 接口(通过 MCP Sampling 访问指挥官 LLM) */
11
22
  export interface AgentLLM {
12
- readonly generateText: (prompt: string) => Promise<string>;
23
+ /** 明确达到输出上限的响应会抛错,不返回可能被截断的文本。 */
24
+ readonly generateText: (prompt: string, options?: AgentGenerateTextOptions) => Promise<string>;
13
25
  }
14
26
  /** Agent 运行时上下文 */
15
27
  export interface AgentContext {
@@ -9,6 +9,13 @@ export interface DefineAgentOptions {
9
9
  readonly onShutdown?: () => Promise<void>;
10
10
  }
11
11
  export declare function resolveAgentLogLevel(explicit?: LogLevel): LogLevel;
12
+ /**
13
+ * 创建 AgentContext。
14
+ *
15
+ * - logger: 使用结构化日志,输出到 stderr(避免干扰 stdio 协议)
16
+ * - llm: 通过 MCP Sampling 请求指挥官 LLM(server.createMessage)
17
+ */
18
+ export declare function createContext(agentName: string, logLevel: LogLevel, server: McpServer): AgentContext;
12
19
  /**
13
20
  * 定义一个 Agent 并返回可运行实例。
14
21
  *
@@ -37,6 +44,8 @@ type McpToolResult = {
37
44
  type: "text";
38
45
  text: string;
39
46
  }, ...McpToolContentBlock[]];
47
+ structuredContent?: Record<string, unknown>;
48
+ _meta?: Record<string, unknown>;
40
49
  };
41
50
  export declare function executeToolForMcp(tool: AnyToolDefinition, ctx: AgentContext, params: Record<string, unknown>, signal?: AbortSignal): Promise<McpToolResult>;
42
51
  export {};
package/dist/index.d.ts CHANGED
@@ -2,8 +2,9 @@ export { defineAgent } from "./define-agent.ts";
2
2
  export type { DefineAgentOptions, ToolResultImage } from "./define-agent.ts";
3
3
  export { defineTool } from "./define-tool.ts";
4
4
  export { createAgentLogger } from "./context.ts";
5
- export type { AgentContext, AgentLogger, AgentLLM, LogLevel } from "./context.ts";
5
+ export type { AgentContext, AgentGenerateTextOptions, AgentLogger, AgentLLM, LogLevel, } from "./context.ts";
6
6
  export { StructuredToolError, isStructuredToolError } from "./tool-error.ts";
7
7
  export type { StructuredToolErrorPayload } from "./tool-error.ts";
8
8
  export type { AnyToolDefinition, ToolDefinition, AgentDefinition, RunnableAgent, TransportConfig, ListenOptions, ToolResourceAccessMode, ToolResourceHint, ToolResourceHintKind, } from "./types/index.ts";
9
9
  export { TOOL_RESOURCE_ACCESS_MODES, TOOL_RESOURCE_HINT_KINDS } from "./types/index.ts";
10
+ export type { AppOutputDeclaration, AppOutputContract } from "@roll-agent/protocol/app-output";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createServer as e}from"node:http";import{randomUUID as n}from"node:crypto";import{McpServer as t}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as r}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as o}from"@modelcontextprotocol/sdk/server/streamableHttp.js";var s={debug:0,info:1,warn:2,error:3};function i(e,n="info"){const t=s[n],r=(n,r)=>{if(s[n]<t)return;const o=(new Date).toISOString(),i=n.toUpperCase().padEnd(5);console.error(`${o} [${i}] [${e}] ${r}`)};return{debug:e=>r("debug",e),info:e=>r("info",e),warn:e=>r("warn",e),error:e=>r("error",e)}}import{z as a}from"zod";var c=8;function l(e){let n=e;for(let e=0;e<c;e+=1)if(n instanceof a.ZodEffects)n=n.innerType();else if(n instanceof a.ZodOptional||n instanceof a.ZodNullable||n instanceof a.ZodBranded||n instanceof a.ZodReadonly)n=n.unwrap();else if(n instanceof a.ZodDefault)n=n.removeDefault();else{if(!(n instanceof a.ZodCatch))return n;n=n.removeCatch()}return n}async function p(e,n){const t=await e.safeParseAsync(n);if(!t.success)throw new Error(`Tool input validation failed: ${f(t.error)}`);return t.data}function f(e){return e.issues.map(e=>{const n=e.path.join(".");return n.length>0?`${n}: ${e.message}`:e.message}).join("; ")}var d=class extends Error{payload;constructor(e){super(e.message),this.name="StructuredToolError",this.payload=e}};function u(e){return e instanceof d||e instanceof Error&&"payload"in e&&y(e.payload)}function y(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;const n=e,t=n.details;return"string"==typeof n.code&&"string"==typeof n.message&&(void 0===t||"object"==typeof t&&null!==t&&!Array.isArray(t))}var m="roll/resourceHints";function g(e){return e??w()??"info"}function w(){const e=process.env.ROLL_AGENT_LOG_LEVEL;if("debug"===e||"info"===e||"warn"===e||"error"===e)return e}function h(e,n,t){return{llm:{generateText:async e=>{try{const n=v((await t.server.createMessage({messages:[{role:"user",content:{type:"text",text:e}}],maxTokens:1024})).content);if(void 0===n)throw new Error("Sampling response did not include text content");return n}catch(e){throw new Error("LLM sampling unavailable. Ensure roll-core client enables sampling capability.",{cause:e})}}},logger:i(e,n)}}function v(e){if("object"==typeof e&&null!==e&&"type"in e&&"text"===e.type&&"text"in e){const n=e.text;return"string"==typeof n?n:void 0}if(Array.isArray(e))for(const n of e){const e=v(n);if(void 0!==e)return e}}function S(e,n={}){return{...e,listen:async t=>{const r=t?.transport??{type:"stdio"},o=g(n.logLevel);"http"===r.type?await $(e,o,r.port,r.host,n.onShutdown):await x(e,o,n.onShutdown)}}}function T(e){let n;const t=t=>{n??=e(t).catch(()=>{process.exit(1)})};process.once("SIGTERM",()=>{t("SIGTERM")}),process.once("SIGINT",()=>{t("SIGINT")})}async function x(e,n,o){const s=new t({name:e.name,version:"0.0.1"}),i=h(e.name,n,s);for(const n of e.tools)b(s,n,i);const a=new r;await s.connect(a),i.logger.info("MCP Server running on stdio");T(async e=>{i.logger.info(`${e} received, shutting down...`),o&&await o(),await s.close(),process.exit(0)})}async function $(r,s,a,c,l){const p=i(r.name,s),f=new Map,d=e(async(e,i)=>{if("/mcp"!==new URL(e.url??"/",`http://${e.headers.host??"localhost"}`).pathname)return i.writeHead(404,{"Content-Type":"application/json"}),void i.end(JSON.stringify({error:"Not found"}));const a="string"==typeof e.headers["mcp-session-id"]?e.headers["mcp-session-id"]:void 0;if(a){const n=f.get(a);if(n){try{await n.transport.handleRequest(e,i)}catch(e){p.error(`Error handling request for session ${a}: ${String(e)}`),i.headersSent||(i.writeHead(500,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Internal server error"})))}return}return i.writeHead(404,{"Content-Type":"application/json"}),void i.end(JSON.stringify({error:"Session not found"}))}try{const a=new o({sessionIdGenerator:()=>n()}),c=new t({name:r.name,version:"0.0.1"}),l=h(r.name,s,c);for(const e of r.tools)b(c,e,l);a.onclose=()=>{const e=a.sessionId;e&&(f.delete(e),p.info(`Session ${e} closed`))},a.onerror=e=>{p.error(`Transport error (session ${a.sessionId??"unknown"}): ${e.message}`)},await c.connect(a),await a.handleRequest(e,i),a.sessionId&&f.set(a.sessionId,{transport:a,server:c})}catch(e){p.error(`Error creating new session: ${String(e)}`),i.headersSent||(i.writeHead(500,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Failed to create session"})))}});d.on("error",e=>{p.error(`HTTP server error: ${e.message}`)});const u=c??"127.0.0.1";d.listen(a,u,()=>{p.info(`MCP Server running on http://${u}:${a}/mcp`)});T(async e=>{p.info(`${e} received, shutting down HTTP server...`),await new Promise(e=>{d.close(()=>e())});const n=[];for(const[,e]of f)n.push(e.server.close());await Promise.all(n),f.clear(),l&&await l(),process.exit(0)})}function b(e,n,t){const r={...n._meta??{},...n.resourceHints&&n.resourceHints.length>0?{[m]:n.resourceHints}:{}};e.registerTool(n.name,{description:n.description,inputSchema:l(n.input),...n.annotations?{annotations:n.annotations}:{},...Object.keys(r).length>0?{_meta:r}:{}},async(e,r)=>await j(n,t,e,r.signal))}function E(e){if("object"!=typeof e||null===e||Array.isArray(e))return{payload:e,images:[]};const n=e,t=n.mcpImages;if(!Array.isArray(t))return{payload:e,images:[]};const r=t.filter(e=>"object"==typeof e&&null!==e&&"string"==typeof e.data&&"string"==typeof e.mimeType),{mcpImages:o,...s}=n;return{payload:s,images:r}}async function j(e,n,t,r){const o=await p(e.input,t),s=void 0===r?n:{...n,signal:r};try{const n=await e.execute(o,s),{payload:t,images:r}=E(n);return{content:[{type:"text",text:JSON.stringify(t)},...r.map(e=>({type:"image",data:e.data,mimeType:e.mimeType}))]}}catch(e){if(u(e))return{isError:!0,content:[{type:"text",text:JSON.stringify(e.payload)}]};throw e}}function I(e){return e}var A={read:"read",write:"write"},H={file:"file",browserSession:"browser-session",conversation:"conversation",custom:"custom"};export{d as StructuredToolError,A as TOOL_RESOURCE_ACCESS_MODES,H as TOOL_RESOURCE_HINT_KINDS,i as createAgentLogger,S as defineAgent,I as defineTool,u 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 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,3 +1,5 @@
1
+ import type { AppOutputDeclaration } from "@roll-agent/protocol/app-output";
2
+ import type { ObservationRetentionDeclaration } from "@roll-agent/protocol/observation-retention";
1
3
  import type { z } from "zod";
2
4
  import type { ToolAnnotations as McpToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
3
5
  import type { AgentContext } from "../context.ts";
@@ -29,6 +31,12 @@ export interface AnyToolDefinition {
29
31
  readonly output: z.ZodType;
30
32
  readonly annotations?: McpToolAnnotations;
31
33
  readonly resourceHints?: readonly ToolResourceHint[];
34
+ /** Opt-in model-history retention contract; execution result remains unchanged. */
35
+ readonly observationRetention?: ObservationRetentionDeclaration;
36
+ /** Explicit opt-in to the persistent application result channel. */
37
+ readonly appOutput?: Omit<AppOutputDeclaration, "remoteReadable"> & {
38
+ readonly remoteReadable?: boolean;
39
+ };
32
40
  readonly _meta?: Readonly<Record<string, unknown>>;
33
41
  readonly execute: (input: never, ctx: AgentContext) => Promise<unknown>;
34
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/sdk",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,7 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@modelcontextprotocol/sdk": "^1.30.0",
30
- "zod": "^3.25.76"
30
+ "zod": "^3.25.76",
31
+ "@roll-agent/protocol": "0.8.0"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@types/node": "^22.0.0"