@camelai/agent-runtime 0.3.0 → 0.5.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.
@@ -15,23 +15,7 @@ export interface SessionCredentials {
15
15
  token: string;
16
16
  expiresAt: number | null;
17
17
  }
18
- export type RequestMethod = "prompt" | "execute" | "status" | "abort" | "history" | "continue" | "steer" | "followUp" | "configure";
19
- export type CallRecord = {
20
- id: string;
21
- toolCallId?: string;
22
- requestId?: string;
23
- createdAt?: number;
24
- name: string;
25
- args: Record<string, unknown>;
26
- deadline: number;
27
- /** `uncertain`: claimed, but the outcome was lost; the model was told it is unknown. */
28
- state: "offered" | "started" | "completed" | "cancelled" | "uncertain";
29
- outcome?: Outcome;
30
- /** A result that arrived after the call was already settled as uncertain. */
31
- lateOutcome?: Outcome;
32
- /** Where the turn came from, set by the runtime (e.g. a channel and its sender), so tools can authorize. */
33
- origin?: Record<string, unknown>;
34
- };
18
+ export type RequestMethod = "prompt" | "execute" | "status" | "abort" | "history" | "continue" | "steer" | "followUp" | "configure" | "resume";
35
19
  export type RequestRecord = {
36
20
  id: string;
37
21
  startedAt?: number;
@@ -47,14 +31,15 @@ export type RequestRecord = {
47
31
  began?: number;
48
32
  /** Kept until the run begins, so a queued run survives a restart and runs exactly once. */
49
33
  params?: unknown;
34
+ /** Times a new owner resumed this run's turn after the node running it was lost. */
35
+ resumes?: number;
36
+ /** Who the application said is acting in this run: passed to its tool calls (`act` in identity tokens). */
37
+ actor?: string;
38
+ /** A `resume` run's suspension: the run whose turn waited on human input, which this one continues. */
39
+ suspension?: string;
50
40
  };
41
+ /** Events on an agent's stream. `mcp` carries the runtime's JSON-RPC messages to the application's attached MCP server: live only, with no id, never replayed. */
51
42
  export type ClientEvent = {
52
- type: "tool_call";
53
- call: CallRecord;
54
- } | {
55
- type: "tool_cancel";
56
- id: string;
57
- } | {
58
43
  type: "event";
59
44
  requestId: string;
60
45
  event: any;
@@ -62,10 +47,12 @@ export type ClientEvent = {
62
47
  type: "response";
63
48
  id: string;
64
49
  outcome: Outcome;
50
+ } | {
51
+ type: "mcp";
52
+ message: Record<string, unknown>;
65
53
  };
66
54
  export type SessionState = {
67
55
  cursor: number;
68
- calls: CallRecord[];
69
56
  requests: RequestRecord[];
70
57
  };
71
58
  /** A tool an application offers its agent; shared by the SDKs and the runtime. */
@@ -76,4 +63,6 @@ export interface ToolDefinition {
76
63
  resultFormat?: "json" | "content";
77
64
  exposure?: "direct" | "codemode" | "both";
78
65
  executionMode?: "sequential" | "parallel";
66
+ /** The user approves each call before it runs (a source's approval policy, or the tool's own needsApproval); such a tool is declared directly. */
67
+ needsApproval?: boolean;
79
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camelai/agent-runtime",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "SDK for the camelAI hosted agent runtime: define tools in your app, and the runtime runs the model loop, history and sandbox.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,6 +24,18 @@
24
24
  "./node": {
25
25
  "types": "./dist/clients/node.d.ts",
26
26
  "default": "./dist/clients/node.js"
27
+ },
28
+ "./mcp": {
29
+ "types": "./dist/clients/mcp.d.ts",
30
+ "default": "./dist/clients/mcp.js"
31
+ },
32
+ "./server": {
33
+ "types": "./dist/clients/server.d.ts",
34
+ "default": "./dist/clients/server.js"
35
+ },
36
+ "./testing": {
37
+ "types": "./dist/clients/testing.d.ts",
38
+ "default": "./dist/clients/testing.js"
27
39
  }
28
40
  },
29
41
  "files": [
@@ -38,5 +50,13 @@
38
50
  "dependencies": {
39
51
  "typebox": "1.1.38"
40
52
  },
41
- "homepage": "https://agents.camelai.dev"
53
+ "homepage": "https://agents.camelai.dev",
54
+ "peerDependencies": {
55
+ "@modelcontextprotocol/sdk": "^1.30.1"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "@modelcontextprotocol/sdk": {
59
+ "optional": true
60
+ }
61
+ }
42
62
  }