@zvada/agent-server 0.3.25 → 0.3.27

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.
Files changed (256) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +4 -1
  3. package/dist/client/client.js +27 -11
  4. package/dist/client/connection.js +35 -3
  5. package/dist/core/agents/acp/acp-agent.js +91 -14
  6. package/dist/core/agents/acp/mappings.js +5 -1
  7. package/dist/core/agents/claude-code/approvals.js +3 -2
  8. package/dist/core/agents/claude-code/claude-agent.js +12 -2
  9. package/dist/core/agents/claude-code/mcp.js +9 -1
  10. package/dist/core/agents/claude-code/models.js +16 -10
  11. package/dist/core/agents/claude-code/options.js +23 -2
  12. package/dist/core/agents/claude-code/session.js +21 -1
  13. package/dist/core/agents/claude-code/tools.js +9 -4
  14. package/dist/core/agents/claude-code/turn.js +2 -0
  15. package/dist/core/agents/codex-app-server/adapter.js +2 -0
  16. package/dist/core/agents/codex-app-server/client.js +8 -5
  17. package/dist/core/agents/codex-app-server/codex-agent.js +35 -2
  18. package/dist/core/agents/codex-app-server/effort.js +13 -6
  19. package/dist/core/agents/codex-app-server/mcp.js +35 -18
  20. package/dist/core/agents/codex-app-server/models.js +10 -10
  21. package/dist/core/agents/codex-app-server/options.js +11 -2
  22. package/dist/core/agents/codex-app-server/plan-approval.js +1 -1
  23. package/dist/core/agents/codex-app-server/session.js +11 -4
  24. package/dist/core/agents/codex-app-server/thread-settings.js +30 -11
  25. package/dist/core/agents/host-tools.js +493 -0
  26. package/dist/core/agents/mcp-config.js +6 -2
  27. package/dist/core/agents/scripted/scripted-agent.js +39 -6
  28. package/dist/core/agents/scripted/steps.js +5 -1
  29. package/dist/core/agents/session-agent.js +70 -2
  30. package/dist/core/agents/thinking-levels.js +8 -5
  31. package/dist/core/index.js +1 -0
  32. package/dist/core/presets.js +16 -3
  33. package/dist/core/processes/lifeline.js +9 -5
  34. package/dist/core/provision/pins.js +7 -16
  35. package/dist/core/provision/releases.js +25 -25
  36. package/dist/core/proxy/loopback.js +22 -4
  37. package/dist/core/runtime/agent-runtime.js +15 -5
  38. package/dist/core/runtime/event-processor.js +13 -8
  39. package/dist/core/runtime/origin-line.js +42 -0
  40. package/dist/core/runtime/request-broker.js +2 -1
  41. package/dist/core/runtime/steering.js +4 -3
  42. package/dist/core/runtime/turn.js +6 -4
  43. package/dist/operator/errors.js +97 -0
  44. package/dist/operator/index.js +10 -5
  45. package/dist/operator/mcp.js +7 -12
  46. package/dist/operator/operator.js +1336 -380
  47. package/dist/operator/refs.js +59 -0
  48. package/dist/operator/render.js +171 -74
  49. package/dist/operator/session-tools.js +87 -0
  50. package/dist/operator/types.js +30 -0
  51. package/dist/operator/view.js +82 -27
  52. package/dist/protocol/config.js +33 -6
  53. package/dist/protocol/conversation.js +3 -0
  54. package/dist/protocol/history.js +2 -1
  55. package/dist/protocol/index.js +1 -0
  56. package/dist/protocol/lifecycle.js +19 -0
  57. package/dist/protocol/model-catalog.js +58 -18
  58. package/dist/protocol/models.js +6 -27
  59. package/dist/protocol/origin.js +39 -0
  60. package/dist/protocol/reduce.js +2 -0
  61. package/dist/protocol/thinking.js +22 -9
  62. package/dist/protocol/wire-api.js +2 -2
  63. package/dist/protocol/wire.js +17 -0
  64. package/dist/server/bin.js +6 -4
  65. package/dist/server/routes.js +15 -5
  66. package/dist/types/client/client.d.ts.map +1 -1
  67. package/dist/types/client/connection.d.ts +14 -2
  68. package/dist/types/client/connection.d.ts.map +1 -1
  69. package/dist/types/client/turns.d.ts +2 -2
  70. package/dist/types/client/turns.d.ts.map +1 -1
  71. package/dist/types/core/agents/acp/acp-agent.d.ts +15 -0
  72. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  73. package/dist/types/core/agents/acp/mappings.d.ts +5 -1
  74. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  75. package/dist/types/core/agents/acp/requests.d.ts +2 -0
  76. package/dist/types/core/agents/acp/requests.d.ts.map +1 -1
  77. package/dist/types/core/agents/base.d.ts +2 -0
  78. package/dist/types/core/agents/base.d.ts.map +1 -1
  79. package/dist/types/core/agents/claude-code/approvals.d.ts +2 -1
  80. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  81. package/dist/types/core/agents/claude-code/claude-agent.d.ts +1 -0
  82. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  83. package/dist/types/core/agents/claude-code/mcp.d.ts +8 -1
  84. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  85. package/dist/types/core/agents/claude-code/models.d.ts +9 -5
  86. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  87. package/dist/types/core/agents/claude-code/options.d.ts +10 -1
  88. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  89. package/dist/types/core/agents/claude-code/session.d.ts +2 -0
  90. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  91. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  92. package/dist/types/core/agents/claude-code/turn.d.ts +3 -0
  93. package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -1
  94. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  95. package/dist/types/core/agents/codex-app-server/client.d.ts +2 -0
  96. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  97. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +11 -0
  98. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  99. package/dist/types/core/agents/codex-app-server/effort.d.ts +7 -7
  100. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  101. package/dist/types/core/agents/codex-app-server/mcp.d.ts +11 -3
  102. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  103. package/dist/types/core/agents/codex-app-server/models.d.ts +4 -1
  104. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  105. package/dist/types/core/agents/codex-app-server/options.d.ts +9 -2
  106. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  107. package/dist/types/core/agents/codex-app-server/requests.d.ts +2 -0
  108. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  109. package/dist/types/core/agents/codex-app-server/session.d.ts +6 -3
  110. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  111. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  112. package/dist/types/core/agents/host-tools.d.ts +162 -0
  113. package/dist/types/core/agents/host-tools.d.ts.map +1 -0
  114. package/dist/types/core/agents/mcp-config.d.ts +11 -2
  115. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  116. package/dist/types/core/agents/scripted/scripted-agent.d.ts +14 -1
  117. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
  118. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -1
  119. package/dist/types/core/agents/session-agent.d.ts +2 -7
  120. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  121. package/dist/types/core/agents/thinking-levels.d.ts +7 -3
  122. package/dist/types/core/agents/thinking-levels.d.ts.map +1 -1
  123. package/dist/types/core/index.d.ts +1 -0
  124. package/dist/types/core/index.d.ts.map +1 -1
  125. package/dist/types/core/presets.d.ts +11 -1
  126. package/dist/types/core/presets.d.ts.map +1 -1
  127. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  128. package/dist/types/core/provision/pins.d.ts +5 -4
  129. package/dist/types/core/provision/pins.d.ts.map +1 -1
  130. package/dist/types/core/proxy/loopback.d.ts.map +1 -1
  131. package/dist/types/core/runtime/agent-runtime.d.ts +4 -2
  132. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  133. package/dist/types/core/runtime/event-processor.d.ts +2 -2
  134. package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
  135. package/dist/types/core/runtime/origin-line.d.ts +15 -0
  136. package/dist/types/core/runtime/origin-line.d.ts.map +1 -0
  137. package/dist/types/core/runtime/request-broker.d.ts +1 -1
  138. package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
  139. package/dist/types/core/runtime/steering.d.ts +7 -4
  140. package/dist/types/core/runtime/steering.d.ts.map +1 -1
  141. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  142. package/dist/types/operator/errors.d.ts +83 -0
  143. package/dist/types/operator/errors.d.ts.map +1 -0
  144. package/dist/types/operator/index.d.ts +10 -5
  145. package/dist/types/operator/index.d.ts.map +1 -1
  146. package/dist/types/operator/mcp.d.ts +1 -1
  147. package/dist/types/operator/mcp.d.ts.map +1 -1
  148. package/dist/types/operator/operator.d.ts +15 -197
  149. package/dist/types/operator/operator.d.ts.map +1 -1
  150. package/dist/types/operator/refs.d.ts +25 -0
  151. package/dist/types/operator/refs.d.ts.map +1 -0
  152. package/dist/types/operator/render.d.ts +59 -19
  153. package/dist/types/operator/render.d.ts.map +1 -1
  154. package/dist/types/operator/session-tools.d.ts +61 -0
  155. package/dist/types/operator/session-tools.d.ts.map +1 -0
  156. package/dist/types/operator/types.d.ts +441 -0
  157. package/dist/types/operator/types.d.ts.map +1 -0
  158. package/dist/types/operator/view.d.ts +19 -29
  159. package/dist/types/operator/view.d.ts.map +1 -1
  160. package/dist/types/protocol/config.d.ts +32 -24
  161. package/dist/types/protocol/config.d.ts.map +1 -1
  162. package/dist/types/protocol/conversation.d.ts +48 -39
  163. package/dist/types/protocol/conversation.d.ts.map +1 -1
  164. package/dist/types/protocol/execution.d.ts +2 -18
  165. package/dist/types/protocol/execution.d.ts.map +1 -1
  166. package/dist/types/protocol/history.d.ts +1 -1
  167. package/dist/types/protocol/history.d.ts.map +1 -1
  168. package/dist/types/protocol/index.d.ts +1 -0
  169. package/dist/types/protocol/index.d.ts.map +1 -1
  170. package/dist/types/protocol/lifecycle.d.ts +48 -74
  171. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  172. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  173. package/dist/types/protocol/models.d.ts +4 -42
  174. package/dist/types/protocol/models.d.ts.map +1 -1
  175. package/dist/types/protocol/origin.d.ts +49 -0
  176. package/dist/types/protocol/origin.d.ts.map +1 -0
  177. package/dist/types/protocol/reduce.d.ts.map +1 -1
  178. package/dist/types/protocol/thinking.d.ts +19 -19
  179. package/dist/types/protocol/thinking.d.ts.map +1 -1
  180. package/dist/types/protocol/wire-api.d.ts +59 -106
  181. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  182. package/dist/types/protocol/wire.d.ts +81 -119
  183. package/dist/types/protocol/wire.d.ts.map +1 -1
  184. package/dist/types/server/routes.d.ts.map +1 -1
  185. package/docs/consuming.md +124 -132
  186. package/docs/deploy.md +6 -5
  187. package/docs/harnesses.md +79 -31
  188. package/docs/sync-history.md +2 -1
  189. package/package.json +4 -4
  190. package/src/client/client.ts +36 -9
  191. package/src/client/connection.ts +31 -1
  192. package/src/client/turns.ts +2 -1
  193. package/src/core/agents/acp/acp-agent.ts +123 -17
  194. package/src/core/agents/acp/mappings.ts +5 -1
  195. package/src/core/agents/acp/requests.ts +2 -0
  196. package/src/core/agents/base.ts +2 -0
  197. package/src/core/agents/claude-code/approvals.ts +4 -3
  198. package/src/core/agents/claude-code/claude-agent.ts +14 -2
  199. package/src/core/agents/claude-code/mcp.ts +11 -1
  200. package/src/core/agents/claude-code/models.ts +15 -10
  201. package/src/core/agents/claude-code/options.ts +33 -3
  202. package/src/core/agents/claude-code/session.ts +26 -1
  203. package/src/core/agents/claude-code/tools.ts +10 -4
  204. package/src/core/agents/claude-code/turn.ts +4 -0
  205. package/src/core/agents/codex-app-server/adapter.ts +2 -0
  206. package/src/core/agents/codex-app-server/client.ts +11 -5
  207. package/src/core/agents/codex-app-server/codex-agent.ts +45 -1
  208. package/src/core/agents/codex-app-server/effort.ts +15 -20
  209. package/src/core/agents/codex-app-server/mcp.ts +46 -23
  210. package/src/core/agents/codex-app-server/models.ts +10 -10
  211. package/src/core/agents/codex-app-server/options.ts +16 -2
  212. package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
  213. package/src/core/agents/codex-app-server/requests.ts +2 -0
  214. package/src/core/agents/codex-app-server/session.ts +19 -4
  215. package/src/core/agents/codex-app-server/thread-settings.ts +31 -11
  216. package/src/core/agents/host-tools.ts +649 -0
  217. package/src/core/agents/mcp-config.ts +15 -3
  218. package/src/core/agents/scripted/scripted-agent.ts +51 -5
  219. package/src/core/agents/scripted/steps.ts +5 -1
  220. package/src/core/agents/session-agent.ts +78 -2
  221. package/src/core/agents/thinking-levels.ts +9 -6
  222. package/src/core/index.ts +9 -0
  223. package/src/core/presets.ts +28 -4
  224. package/src/core/processes/lifeline.ts +9 -5
  225. package/src/core/provision/pins.ts +7 -16
  226. package/src/core/provision/releases.ts +25 -25
  227. package/src/core/proxy/loopback.ts +25 -4
  228. package/src/core/runtime/agent-runtime.ts +31 -7
  229. package/src/core/runtime/event-processor.ts +13 -6
  230. package/src/core/runtime/origin-line.ts +43 -0
  231. package/src/core/runtime/request-broker.ts +2 -0
  232. package/src/core/runtime/steering.ts +8 -4
  233. package/src/core/runtime/turn.ts +11 -4
  234. package/src/operator/errors.ts +218 -0
  235. package/src/operator/index.ts +18 -23
  236. package/src/operator/mcp.ts +7 -16
  237. package/src/operator/operator.ts +1583 -613
  238. package/src/operator/refs.ts +75 -0
  239. package/src/operator/render.ts +208 -98
  240. package/src/operator/session-tools.ts +126 -0
  241. package/src/operator/types.ts +505 -0
  242. package/src/operator/view.ts +93 -42
  243. package/src/protocol/config.ts +36 -7
  244. package/src/protocol/conversation.ts +3 -0
  245. package/src/protocol/history.ts +2 -1
  246. package/src/protocol/index.ts +1 -0
  247. package/src/protocol/lifecycle.ts +21 -0
  248. package/src/protocol/model-catalog.ts +58 -18
  249. package/src/protocol/models.ts +6 -26
  250. package/src/protocol/origin.ts +47 -0
  251. package/src/protocol/reduce.ts +4 -0
  252. package/src/protocol/thinking.ts +27 -14
  253. package/src/protocol/wire-api.ts +2 -2
  254. package/src/protocol/wire.ts +18 -0
  255. package/src/server/bin.ts +6 -4
  256. package/src/server/routes.ts +16 -5
@@ -6,8 +6,11 @@
6
6
  * name alone is ambiguous.
7
7
  */
8
8
  import type { ElicitationOutcome, PermissionOutcome } from "../protocol/lifecycle.ts";
9
+ import type { Origin, ReportedOrigin } from "../protocol/origin.ts";
9
10
  import type { Part, UnknownPart } from "../protocol/parts.ts";
10
- import { type SessionView, type ViewMessage, type Waiting } from "./view.ts";
11
+ import type { Hint } from "./errors.ts";
12
+ import type { SessionView, Waiting } from "./types.ts";
13
+ import type { ViewMessage } from "./view.ts";
11
14
  /** The marker every line of untrusted text begins with. */
12
15
  export declare const QUOTE = " | ";
13
16
  /** The most messages `read_session` reads. */
@@ -22,7 +25,12 @@ export declare const quoted: (text: string) => string;
22
25
  * The next step, as the tool call that takes it:
23
26
  * `-> answer_request(session: "voyager", answer: "<your answer>")`.
24
27
  */
25
- export declare function callHint(tool: string, args?: Record<string, string | number | boolean>): string;
28
+ /**
29
+ * A value as JSON on one line, losslessly: `\uXXXX` for what JSON leaves raw
30
+ * (U+2028, C1, bidi controls), so it reads back the same and breaks no line.
31
+ */
32
+ export declare const json: (value: unknown) => string;
33
+ export declare function callHint(tool: string, args?: Record<string, unknown>): string;
26
34
  /**
27
35
  * One tool call on one line: its name, what it acted on, and whether it failed.
28
36
  * `working: false` (its session runs no turn) shows a tool left open as
@@ -39,32 +47,64 @@ export declare function toolLine(part: Part | UnknownPart, root?: string, workin
39
47
  */
40
48
  export declare function personOnly(waiting: Waiting): string | undefined;
41
49
  /**
42
- * What the agent waits on, and the exact call that answers it. What only the
43
- * person can answer (`personOnly`) is one line, with no call. Paths under
44
- * `root` read relative to it.
50
+ * One request's context: named by the broker's own id when more than one
51
+ * waits, and offered the answer only when this caller may give that one.
52
+ */
53
+ export declare function perRequest<C extends WaitingContext>(context: C, waiting: Waiting): C;
54
+ /** What a request waiting in a session is, in the words a model reads. */
55
+ export interface WaitingContext {
56
+ /** How hints name the session. */
57
+ ref: string;
58
+ /** The request's handle, said when the session waits on more than one. */
59
+ handle?: string;
60
+ /** Whether this caller may answer it: the answer hint is offered only then. */
61
+ canAnswer?: boolean;
62
+ /** Whether this caller may answer each waiting request, by the one rule the write uses. */
63
+ answerable?: ReadonlySet<string>;
64
+ /** Paths under it read relative to it. */
65
+ root?: string;
66
+ hint: Hint;
67
+ }
68
+ /**
69
+ * What the agent waits on, and the call that answers it, when that tool is
70
+ * installed. What only the person can answer (`personOnly`) is one line, with
71
+ * no call.
45
72
  */
46
- export declare function describeWaiting(waiting: Waiting, ref: string, root?: string): string;
73
+ export declare function describeWaiting(waiting: Waiting, context: WaitingContext): string;
47
74
  /** The agent's words since the person last spoke. */
48
75
  export declare function lastReply(messages: readonly ViewMessage[]): string;
76
+ /** Every message of a view, oldest first. */
77
+ export declare const messagesOf: (view: Pick<SessionView, "turns">) => ViewMessage[];
78
+ /** How the waits and outcomes word a view; `waited` is how long the call waited. */
79
+ export interface OutcomeContext extends WaitingContext {
80
+ waited?: number;
81
+ /** The host's line of facts for a settled turn. */
82
+ note?: string;
83
+ }
49
84
  /**
50
- * How a turn stands: finished, waiting on the person, failed, or still going.
51
- * `waitedSeconds` is how long this call waited; `note` is the host's line of
52
- * facts for a turn that is not working any more; paths under `root` in what it
53
- * waits on read relative to it.
85
+ * How a session stands: done, stopped, waiting on someone, failed, or still
86
+ * going. Each request it waits on is said with the call that answers it.
54
87
  */
55
- export declare function renderOutcome(view: SessionView, ref: string, waitedSeconds?: number, note?: string, root?: string): string;
56
- export interface RenderOptions {
57
- /** How many recent messages (default 10). */
88
+ export declare function renderOutcome(view: SessionView, context: OutcomeContext): string;
89
+ /** Who a user message is from, as `read_session` labels it; `you` is the caller's own origin. */
90
+ export declare function senderLabel(origin: ReportedOrigin | undefined, you: Origin): string;
91
+ /** Whether two origins are the same sender. */
92
+ export declare function sameOrigin(a: ReportedOrigin | undefined, b: ReportedOrigin | undefined): boolean;
93
+ export interface RenderOptions extends WaitingContext {
94
+ /** How many recent messages (default 10); with `all`, every message the host gave (a cursor's page). */
58
95
  last?: number;
59
- /** Paths in tool lines are shown relative to this folder. */
60
- root?: string;
96
+ all?: boolean;
97
+ /** The caller's own origin: its messages read `[you]`. */
98
+ you: Origin;
99
+ /** The header line (the session, its id, who started it). */
100
+ header?: string;
61
101
  }
62
102
  /**
63
- * The conversation, condensed: what was asked, what the agent said, which
64
- * tools it ran, and under a call that asked the person its questions and
65
- * what the agent was told (or its plan).
103
+ * The conversation, condensed: each user message under its own sender, what
104
+ * the agent said, which tools it ran (with what a call asked the person),
105
+ * how each turn ended, and what the session waits on.
66
106
  */
67
- export declare function renderConversation(view: SessionView, ref: string, options?: RenderOptions): string;
107
+ export declare function renderConversation(view: SessionView, options: RenderOptions): string;
68
108
  /** A person's words as the engine takes them, for the request the agent waits on. */
69
109
  export type Answer = {
70
110
  kind: "question";
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/operator/render.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,OAAO,EAGZ,MAAM,WAAW,CAAC;AAUnB,2DAA2D;AAC3D,eAAO,MAAM,KAAK,SAAS,CAAC;AAU5B,8CAA8C;AAC9C,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,0EAA0E;AAC1E,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED,6FAA6F;AAC7F,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,WAAkC,CAAC;AAWtE;;;GAGG;AACH,wBAAgB,QAAQ,CACvB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,M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AE,MAAM,GAAG,MAAM,CASnF;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,CAAC,EAAE,cAAc,GAAG,SAAS,EAAE,CAAC,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAUhG;AAaD,MAAM,WAAW,aAAc,SAAQ,cAAc;IACpD,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAgDpF;AAED,qFAAqF;AACrF,MAAM,MAAM,MAAM,GACf;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GACpE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAQvE;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAsChE"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The operator as a session's own tools: what a host returns from the
3
+ * engine's `hostTools` (LLP 0018 (host tools)), its other tools for the
4
+ * session in the same one source. The shapes are the engine's, said here by
5
+ * structure: the operator imports nothing of the engine's core.
6
+ */
7
+ import type { Operator } from "./types.ts";
8
+ /**
9
+ * What a host adds to the instructions of every session that has these
10
+ * tools, or can receive messages from sessions that do.
11
+ */
12
+ export declare const OPERATOR_GUIDANCE: string;
13
+ /** Who calls, as the engine fills it at the moment of the call (`HostToolCaller`). */
14
+ export interface SessionToolCaller {
15
+ sessionId: string;
16
+ harness: string;
17
+ turnId: string;
18
+ permissionMode: string;
19
+ }
20
+ /** A tool as the engine delivers it (`HostTool`). */
21
+ export interface SessionTool {
22
+ name: string;
23
+ description: string;
24
+ inputSchema: Record<string, unknown>;
25
+ annotations?: {
26
+ readOnly?: boolean;
27
+ destructive?: boolean;
28
+ };
29
+ }
30
+ export type SessionToolContent = {
31
+ type: "text";
32
+ text: string;
33
+ } | {
34
+ type: "image";
35
+ data: string;
36
+ mimeType: string;
37
+ };
38
+ /** A session's one source of tools (`HostToolSource`). */
39
+ export interface SessionToolSource {
40
+ name: string;
41
+ tools: readonly SessionTool[];
42
+ instructions?: string;
43
+ timeoutMs?: number;
44
+ call(name: string, args: Record<string, unknown>, caller: SessionToolCaller, signal: AbortSignal): Promise<{
45
+ content: SessionToolContent[];
46
+ isError?: boolean;
47
+ }>;
48
+ }
49
+ /**
50
+ * A session's tools: the operator's, and the host's other tools for the
51
+ * session (`with`) in the same source, as the engine gives a session one.
52
+ * The caller is the engine's, so no model can name another; a refusal is an
53
+ * `isError` result in its words, any other failure `refused (failed)` with
54
+ * none of its text; a call the agent gives up ends its wait.
55
+ */
56
+ export declare function operatorSessionTools<Auth>(operator: Operator<Auth>, options: {
57
+ name: string;
58
+ with?: SessionToolSource;
59
+ instructions?: string;
60
+ }): SessionToolSource;
61
+ //# sourceMappingURL=session-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-tools.d.ts","sourceRoot":"","sources":["../../../src/operator/session-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAiBnB,CAAC;AAEZ,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACvB;AAED,qDAA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
+ * tools report it, the host the product implements, and the refusals.
4
+ * `Origin` is the protocol's (it rides `turn/start` and `turn/steer`).
5
+ */
6
+ import type { z } from "zod";
7
+ import type { ReportedPermissionMode } from "../protocol/config.ts";
8
+ import type { AgentHarness } from "../protocol/harness.ts";
9
+ import type { Origin } from "../protocol/origin.ts";
10
+ import type { ThinkingLevel } from "../protocol/thinking.ts";
11
+ import type { Answer } from "./render.ts";
12
+ import type { DecisionRequest, QuestionRequest, ViewMessage } from "./view.ts";
13
+ export type { Origin };
14
+ /**
15
+ * A session's own agent calling the tools. Filled by the engine's delivery
16
+ * of the tools to the session, never by the model.
17
+ */
18
+ export interface SessionCaller {
19
+ kind: "session";
20
+ sessionId: string;
21
+ /** The turn the call is made in: a tool call always happens inside one. */
22
+ turnId: string;
23
+ harness: AgentHarness;
24
+ /** The session's mode live at the call, not the turn's start config: `plan` may only read. */
25
+ permissionMode: ReportedPermissionMode;
26
+ /** Aborts when the agent gives the call up: a held wait answers at once. */
27
+ signal?: AbortSignal;
28
+ }
29
+ /**
30
+ * Anyone outside a session: an assistant, a paired device, the product's
31
+ * own window. `Auth` is the host's (its token, its access row): the package
32
+ * passes it through to the host and reads nothing of it.
33
+ */
34
+ export interface ExternalCaller<Auth = unknown> {
35
+ kind: "external";
36
+ /** Stable per caller; with the kind, keys repeats and rates. */
37
+ id: string;
38
+ /** Whose words its messages are: the person's own window or device, or an assistant's. */
39
+ speaksAs: "person" | "assistant";
40
+ /** How the host shows it ("ChatGPT"); an assistant's origin carries it. */
41
+ name?: string;
42
+ /** Epoch ms its connection ends: no call waits past it (less a margin). */
43
+ endsAt?: number;
44
+ /** Aborts when the caller gives the call up (its request closed): a held wait answers at once. */
45
+ signal?: AbortSignal;
46
+ auth: Auth;
47
+ }
48
+ export type Caller<Auth = unknown> = SessionCaller | ExternalCaller<Auth>;
49
+ /** `session:<id>` or `external:<id>`: every map the package keeps is keyed by it. */
50
+ export type CallerKey = `session:${string}` | `external:${string}`;
51
+ /**
52
+ * - `setting_up`: its workspace is being prepared; no turn can run yet.
53
+ * - `idle`: no turn runs; the last one finished (or none ran).
54
+ * - `working`: a turn runs.
55
+ * - `needs_input`: a turn waits on a question, a plan or a permission.
56
+ * - `stopped`: the last turn was cancelled, and nothing ran since.
57
+ * - `error`: the last turn failed, or the workspace could not be set up.
58
+ * - `archived`: put away; read only.
59
+ */
60
+ export type SessionStatus = "setting_up" | "idle" | "working" | "needs_input" | "stopped" | "error" | "archived";
61
+ /** `list_sessions`'s `started_by` filter, from the caller's side. */
62
+ export type StartedByFilter = "me" | "agents" | "person" | "any";
63
+ export interface ProjectRef {
64
+ id: string;
65
+ /** Unique among the caller's projects, case-insensitively. May hold `/` (`owner/name`). */
66
+ name: string;
67
+ }
68
+ export interface WorkspaceRef {
69
+ id: string;
70
+ /** Unique in its project, case-insensitively; holds neither `/` nor `:`. */
71
+ name: string;
72
+ }
73
+ /** One session as the host lists it. */
74
+ export interface Entry {
75
+ /**
76
+ * The engine's `sessionId`, minted when the session is asked for, before
77
+ * its workspace is set up: one identity for the session's whole life.
78
+ */
79
+ id: string;
80
+ project?: ProjectRef;
81
+ /** A host with no workspaces gives each session one of its own. */
82
+ workspace: WorkspaceRef;
83
+ /** Its number in its workspace, from 1, never reused. Absent: the tools print its id. */
84
+ chat?: number;
85
+ /** The chat a bare workspace name means. */
86
+ current: boolean;
87
+ status: SessionStatus;
88
+ title?: string;
89
+ harness?: AgentHarness;
90
+ model?: string;
91
+ /**
92
+ * Who started it: the start's origin, kept by the host. An external caller
93
+ * speaking as the person starts as the person, at account scope.
94
+ */
95
+ startedBy: Origin;
96
+ startedAt?: number;
97
+ lastActivityAt?: number;
98
+ /** Why `error`, when setup failed (a failed turn's error is the view's). */
99
+ error?: string;
100
+ /** A few words the host adds to the row (lines changed, a pull request). */
101
+ note?: string;
102
+ /** Paths in this session's tool lines are shown relative to this folder. */
103
+ root?: string;
104
+ }
105
+ /** A place in a session's conversation, minted by the host; the package never reads it. */
106
+ export type Cursor = string & {
107
+ readonly __operatorCursor: true;
108
+ };
109
+ export type TurnOutcome = "running" | "done" | "cancelled" | "failed";
110
+ export interface ViewTurn {
111
+ turnId: string;
112
+ outcome: TurnOutcome;
113
+ /** Who stopped it, when the host knows (`cancelled`). */
114
+ cancelledBy?: Origin;
115
+ /** Why it failed (`failed`). */
116
+ error?: string;
117
+ /** Each user message carries its own sender (`ViewMessage.origin`): a turn can mix them. */
118
+ messages: readonly ViewMessage[];
119
+ startedAt?: number;
120
+ endedAt?: number;
121
+ }
122
+ /**
123
+ * What a session waits on, with the kind the engine's broker said explicitly
124
+ * (`permission.requested`'s `purpose`): a plan only when it says `plan`. A
125
+ * model names one by the broker's own `requestId`.
126
+ */
127
+ export type Waiting = {
128
+ kind: "question";
129
+ request: QuestionRequest;
130
+ } | {
131
+ kind: "plan" | "permission";
132
+ request: DecisionRequest;
133
+ };
134
+ /** How a turn ended, by its id, whatever page of the transcript is read. */
135
+ export interface TurnEnded {
136
+ turnId: string;
137
+ outcome: "done" | "cancelled" | "failed";
138
+ /** Who stopped it, when the host knows. */
139
+ cancelledBy?: Origin;
140
+ }
141
+ /** One turn, looked up by id. */
142
+ export type TurnFact = {
143
+ state: "running";
144
+ } | ({
145
+ state: "ended";
146
+ } & Omit<TurnEnded, "turnId">) | {
147
+ state: "unknown";
148
+ };
149
+ export interface SessionView {
150
+ status: SessionStatus;
151
+ /** The running turn's id, if one runs: independent of `turns`' page. */
152
+ running?: string;
153
+ /** The last turn that ended, and how: independent of `turns`' page. */
154
+ lastEnded?: TurnEnded;
155
+ /** Oldest first; after `after`, only what followed it (a turn still running may repeat). */
156
+ turns: readonly ViewTurn[];
157
+ waiting: readonly Waiting[];
158
+ /** The host holds earlier turns than these. */
159
+ older?: boolean;
160
+ /** Where this read ended: the next read's `after`. Absent: the host has no cursors. */
161
+ cursor?: Cursor;
162
+ }
163
+ export interface ViewOptions {
164
+ /** The most recent messages wanted. A host may give more; the package cuts. */
165
+ last?: number;
166
+ /** Only what came after this place. A cursor the host cannot read is `stale_cursor`. */
167
+ after?: Cursor;
168
+ }
169
+ export interface ListFilter {
170
+ project?: ProjectRef;
171
+ workspace?: WorkspaceRef;
172
+ status?: readonly SessionStatus[];
173
+ /** Archived ones too: name resolution asks for the complete set. */
174
+ includeArchived?: boolean;
175
+ }
176
+ export interface StartInput {
177
+ /** The first task's turn id, minted by the package: deliver the first message as this turn. */
178
+ turnId: string;
179
+ project: ProjectRef;
180
+ /** A new chat in this workspace; absent: a new workspace. */
181
+ workspace?: WorkspaceRef;
182
+ harness?: AgentHarness;
183
+ model?: string;
184
+ thinkingLevel?: ThinkingLevel;
185
+ title?: string;
186
+ /** The first message: the host delivers it as the session's first turn, at once or once set up. */
187
+ message: string;
188
+ origin: Origin;
189
+ }
190
+ export interface SendInput {
191
+ /** Minted by the package; a retry after no answer uses it again, and the engine converges on it. */
192
+ turnId: string;
193
+ message: string;
194
+ origin: Origin;
195
+ }
196
+ /**
197
+ * What a cancel did: the turn stopped (it has ended: a host whose stop is
198
+ * asynchronous waits for the end, briefly, before saying so), there was none,
199
+ * the stop is asked and its end not yet seen (`unconfirmed`: an archive then
200
+ * archives nothing), or (a session being set up) its first task was dropped.
201
+ */
202
+ export type CancelOutcome = "stopped" | "not_running" | "unconfirmed" | "first_task_dropped";
203
+ export type ArchiveTarget = {
204
+ kind: "session";
205
+ id: string;
206
+ } | {
207
+ kind: "workspace";
208
+ id: string;
209
+ };
210
+ export interface ModelEntry {
211
+ harness: AgentHarness;
212
+ id: string;
213
+ label: string;
214
+ thinkingLevels: readonly ThinkingLevel[];
215
+ defaultThinkingLevel?: ThinkingLevel;
216
+ /** The model a new session on this harness starts on. */
217
+ default?: boolean;
218
+ /** The harness a new session starts on when none is named. */
219
+ defaultHarness?: boolean;
220
+ }
221
+ /** Every refusal the tools give, and nothing else (LLP 0019, Errors). */
222
+ export declare const OPERATOR_ERROR_CODES: readonly ["invalid_input", "not_found", "ambiguous", "archived", "self", "read_only", "access", "not_yours", "has_children", "busy", "not_waiting", "person_only", "setup_failed", "limit_depth", "limit_sessions", "limit_setting_up", "limit_rate", "limit_resources", "stale_cursor", "unsupported", "failed"];
223
+ export type OperatorErrorCode = (typeof OPERATOR_ERROR_CODES)[number];
224
+ /** A refusal as the host gives one (`authorize`, `admit`, or thrown from a method as `Refused`). */
225
+ export interface Refusal {
226
+ code: OperatorErrorCode;
227
+ /** The sessions it is about, by id (a busy member, the children not archived). */
228
+ sessions?: readonly string[];
229
+ /** The state the host saw at its commit (`busy`): the words follow it, not the preflight read. */
230
+ state?: SessionStatus;
231
+ /** The host's words, one line, trusted: said after the code's sentence. */
232
+ detail?: string;
233
+ /** Seconds after which the same call may succeed. */
234
+ retryAfter?: number;
235
+ }
236
+ /**
237
+ * What a tool does, for the rules, declared honestly: anything that changes
238
+ * something or posts outside is `write`. `read` runs in plan mode.
239
+ */
240
+ export type Effect = "read" | "write" | "destructive";
241
+ /**
242
+ * Limits, each a host may change. The defaults are LLP 0019's.
243
+ * `depth` and `sessionsPerStarter` bind session callers only. A cap across
244
+ * the host (workspaces being set up, disk, memory) is the host's, enforced
245
+ * inside its own `start`: one starter's lock cannot hold it.
246
+ */
247
+ export interface Limits {
248
+ /** A session started by a chain this long may start no more. Default 3. */
249
+ depth: number;
250
+ /** Sessions one session started that are not archived. Default 12. */
251
+ sessionsPerStarter: number;
252
+ /** Starts per caller in any 60 seconds. Default 10. */
253
+ startsPerMinute: number;
254
+ }
255
+ /** How long a held call may wait, by caller kind: a default and a cap, in seconds. */
256
+ export interface WaitCaps {
257
+ /** Default 120 and 240 (Codex cuts a tool call at 300 s unless told otherwise). */
258
+ session: {
259
+ default: number;
260
+ max: number;
261
+ };
262
+ /** Default 60 and 90; never past `endsAt` less 5 s. */
263
+ external: {
264
+ default: number;
265
+ max: number;
266
+ };
267
+ }
268
+ /** What `admit` is asked before a start: the host's resource probes. */
269
+ export interface AdmitRequest {
270
+ kind: "start";
271
+ project: ProjectRef;
272
+ /** Absent: a new workspace would be set up. */
273
+ workspace?: WorkspaceRef;
274
+ origin: Origin;
275
+ }
276
+ /**
277
+ * The facts the rules and limits rest on, authoritative, not filtered by
278
+ * what a caller may see. Required of a host that enables session callers.
279
+ */
280
+ export interface PolicyFacts {
281
+ /** The sessions this session started, not archived. */
282
+ startedBy(sessionId: string): Promise<Entry[]>;
283
+ /** Who started this session, and who started that one, nearest first. */
284
+ lineage(sessionId: string): Promise<Origin[]>;
285
+ /** Every session in the workspace with its status, archived ones excluded. */
286
+ inWorkspace(workspaceId: string): Promise<Entry[]>;
287
+ }
288
+ /**
289
+ * The product, to the package. `list`, `view`, `send` and `onChange` are
290
+ * required; every other method is a capability, and a tool that needs one
291
+ * the host lacks is not listed. The host keeps its own check at each
292
+ * mutation; the package's rules are in addition.
293
+ */
294
+ export interface OperatorHost<Auth = unknown> {
295
+ /** The sessions this caller may see, filtered as asked (the package filters again). */
296
+ list(caller: Caller<Auth>, filter: ListFilter): Promise<Entry[]>;
297
+ view(caller: Caller<Auth>, sessionId: string, options: ViewOptions): Promise<SessionView>;
298
+ /**
299
+ * Start the turn `input.turnId` now, carrying `origin` to the wire. The
300
+ * same turn id again converges on the first (the engine's rule). A host
301
+ * that finds the session busy refuses `busy` (an `OperatorError`, or
302
+ * `Refused`), any other definite refusal is one of those too, and a
303
+ * failure whose outcome is unknown throws a plain error: the package tries
304
+ * again with the same turn id.
305
+ */
306
+ send(caller: Caller<Auth>, sessionId: string, input: SendInput): Promise<void>;
307
+ /** One turn by id: running, ended (how, and by whom when stopped), or unknown. */
308
+ turn(caller: Caller<Auth>, sessionId: string, turnId: string): Promise<TurnFact>;
309
+ /**
310
+ * Call `listener` with the sessions that may have changed, for as long as
311
+ * the returned function is not called. Waits rest on it.
312
+ */
313
+ onChange(listener: (sessionIds: readonly string[]) => void): () => void;
314
+ /** One entry by session id or workspace id (its current chat), archived ones included. */
315
+ entry?(caller: Caller<Auth>, id: string): Promise<Entry | undefined>;
316
+ /** Every project this caller could start in, those with no session included. */
317
+ projects?(caller: Caller<Auth>): Promise<ProjectRef[]>;
318
+ /**
319
+ * Make the session (and its workspace, when none is named) and return its
320
+ * entry at once, its session id minted now: `idle`, or `setting_up` while
321
+ * its workspace is prepared. Keep `input.origin` as its `startedBy`. The
322
+ * host OWNS delivering `input.message` as its first turn (`input.turnId`),
323
+ * at once or once set up, and reports what became of it through the
324
+ * session's status (an `error` with why when it could not be delivered).
325
+ * The package's checks are preflight; the host enforces, atomically at
326
+ * its commit, by throwing `Refused`: no start into an archived workspace
327
+ * or by an archived starter (`archived`), and its caps across starters
328
+ * (`limit_setting_up` or `limit_resources`, with `retryAfter`). Enables
329
+ * `start_session`.
330
+ */
331
+ start?(caller: Caller<Auth>, input: StartInput): Promise<Entry>;
332
+ /**
333
+ * Stop this turn, and only it; with no turn (a session being set up), drop
334
+ * the first task the host holds for it. Enables `stop_sessions` and
335
+ * `when: interrupt`.
336
+ */
337
+ cancel?(caller: Caller<Auth>, sessionId: string, turnId?: string): Promise<CancelOutcome>;
338
+ /** Answer exactly this request; `accepted: false` when it no longer waits. Enables `answer_request`. */
339
+ respond?(caller: Caller<Auth>, sessionId: string, answer: Answer): Promise<{
340
+ accepted: boolean;
341
+ }>;
342
+ /**
343
+ * Archive one target. The package's checks are preflight; the host
344
+ * enforces eligibility atomically at its commit, throwing `Refused` with
345
+ * the sessions concerned and the state it saw: a member being set up
346
+ * (`busy`, `state: "setting_up"`), a member still working or waiting, the
347
+ * caller's own included, since a stop must be confirmed first (`busy`; a
348
+ * member the caller did not start, `not_yours`), a member that started
349
+ * sessions not archived, lineage included (`has_children`).
350
+ * Enables `archive`.
351
+ */
352
+ archive?(caller: Caller<Auth>, target: ArchiveTarget): Promise<{
353
+ note?: string;
354
+ }>;
355
+ /** The models a new session can run. Enables `list_models`. */
356
+ models?(caller: Caller<Auth>): Promise<ModelEntry[]>;
357
+ /**
358
+ * Whether this outside caller may run this tool now, read from the host's
359
+ * store at the call: asked before every tool and again just before every
360
+ * write the package makes (each send, cancel, answer, start, archive). The tool's
361
+ * name lets a host allow one write tool to a low-access caller.
362
+ */
363
+ authorize?(caller: ExternalCaller<Auth>, call: {
364
+ effect: Effect;
365
+ tool: string;
366
+ }): Refusal | undefined | Promise<Refusal | undefined>;
367
+ /** Required with session callers: the facts the rules and limits rest on. */
368
+ policy?: PolicyFacts;
369
+ /** Resource probes before a start (disk, memory): a `limit_resources` refusal, or none. */
370
+ admit?(caller: Caller<Auth>, request: AdmitRequest): Promise<Refusal | undefined>;
371
+ /** One line of host facts once a turn settles ("changes: a.ts (+4 -0)"). */
372
+ outcome?(caller: Caller<Auth>, entry: Entry): Promise<string | undefined>;
373
+ /** One line `whoami` adds for this caller ("access: read"). */
374
+ describe?(caller: Caller<Auth>): Promise<string | undefined>;
375
+ }
376
+ /**
377
+ * A tool the host adds beside the package's. It declares only its effect;
378
+ * the package applies plan mode and `authorize` (with its name) to it and
379
+ * nothing else. It may not change sessions: that is the package's tools'.
380
+ */
381
+ export interface ExtraTool<Auth = unknown> {
382
+ name: string;
383
+ title: string;
384
+ description: string;
385
+ input: z.ZodObject;
386
+ effect: Effect;
387
+ /** It reaches past this host (sends something elsewhere): MCP's `openWorldHint`. */
388
+ openWorld?: boolean;
389
+ /** `call`: the call's deadline (epoch ms) and its caller's signal, so a long run answers in time. */
390
+ run(args: never, caller: Caller<Auth>, call: CallScope): Promise<string>;
391
+ }
392
+ /**
393
+ * A call's time, as a host's own tool sees it: the deadline the package's
394
+ * waits keep (the caller's wait, capped, never past its connection) and the
395
+ * caller's signal.
396
+ */
397
+ export interface CallScope {
398
+ deadline: number;
399
+ signal?: AbortSignal;
400
+ }
401
+ /** A tool as any transport lists it. */
402
+ export interface ToolInfo {
403
+ name: string;
404
+ title: string;
405
+ description: string;
406
+ /** JSON Schema of the arguments (an object). */
407
+ inputSchema: unknown;
408
+ readOnly: boolean;
409
+ /** It reaches past this host: MCP's `openWorldHint`. */
410
+ openWorld?: boolean;
411
+ /** It may undo or lose work: MCP's `destructiveHint`. */
412
+ destructive?: boolean;
413
+ }
414
+ /** Time, for the waits and the limits. Tests pass their own; the default is the wall clock. */
415
+ export interface OperatorClock {
416
+ now(): number;
417
+ /** Resolve after `ms`, or as soon as `signal` aborts. */
418
+ pause(ms: number, signal: AbortSignal): Promise<void>;
419
+ }
420
+ export interface OperatorOptions<Auth = unknown> {
421
+ limits?: Partial<Limits>;
422
+ waits?: Partial<WaitCaps>;
423
+ extra?: ExtraTool<Auth>[];
424
+ clock?: OperatorClock;
425
+ /**
426
+ * Shown each unexpected failure a call answers without (a `refused (failed)`,
427
+ * an outcome that could not be read), once, with the tool and the caller:
428
+ * for the host's reports. Never a refusal. It cannot change the answer,
429
+ * and a throw inside it is swallowed.
430
+ */
431
+ onError?: (error: unknown, tool: string, caller: Caller<Auth>) => void;
432
+ }
433
+ export interface Operator<Auth = unknown> {
434
+ /** The same for every caller: an assistant keeps the list it got when it connected. */
435
+ tools(): ToolInfo[];
436
+ /** Run one tool and answer in text. Refusals are `OperatorError`s. */
437
+ call(name: string, args: unknown, caller: Caller<Auth>): Promise<string>;
438
+ /** The entry a reference names (LLP 0019, References). */
439
+ find(caller: Caller<Auth>, ref: string): Promise<Entry>;
440
+ }
441
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operator/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,e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