eve 0.30.8 → 0.31.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.
Files changed (211) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +5 -6
  3. package/dist/src/acp/adapter.d.ts +10 -4
  4. package/dist/src/acp/adapter.js +1 -1
  5. package/dist/src/channel/adapter-context.d.ts +1 -1
  6. package/dist/src/channel/adapter.d.ts +2 -4
  7. package/dist/src/channel/adapter.js +1 -1
  8. package/dist/src/channel/channel-address.d.ts +58 -0
  9. package/dist/src/channel/channel-address.js +1 -0
  10. package/dist/src/channel/channel-operations.d.ts +72 -0
  11. package/dist/src/channel/channel-operations.js +1 -0
  12. package/dist/src/channel/compiled-channel.d.ts +10 -6
  13. package/dist/src/channel/cross-channel-receive.d.ts +13 -25
  14. package/dist/src/channel/cross-channel-receive.js +2 -2
  15. package/dist/src/channel/receive-target.d.ts +1 -2
  16. package/dist/src/channel/routes.d.ts +21 -149
  17. package/dist/src/channel/schedule.d.ts +1 -1
  18. package/dist/src/channel/schedule.js +1 -1
  19. package/dist/src/channel/send-input.d.ts +6 -0
  20. package/dist/src/channel/send-input.js +1 -0
  21. package/dist/src/channel/session.d.ts +44 -30
  22. package/dist/src/channel/session.js +1 -1
  23. package/dist/src/channel/types.d.ts +8 -35
  24. package/dist/src/chunks/{use-eve-agent-DDoDDmJ2.js → use-eve-agent-CF5D6jSV.js} +339 -367
  25. package/dist/src/chunks/{use-eve-agent-Bx-ONuyb.js → use-eve-agent-DbYZLG0h.js} +342 -368
  26. package/dist/src/cli/commands/agent-prompt/build-and-verify.md +1 -2
  27. package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
  28. package/dist/src/cli/commands/info.d.ts +1 -1
  29. package/dist/src/cli/commands/info.js +1 -1
  30. package/dist/src/cli/dev/tui/runner.d.ts +1 -1
  31. package/dist/src/cli/dev/tui/runner.js +1 -1
  32. package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
  33. package/dist/src/cli/dev/tui/tui.js +1 -1
  34. package/dist/src/cli/invoke/invoke.d.ts +1 -1
  35. package/dist/src/cli/invoke/invoke.js +1 -1
  36. package/dist/src/cli/invoke/result.d.ts +0 -11
  37. package/dist/src/cli/invoke/result.js +1 -1
  38. package/dist/src/client/client-error.d.ts +2 -0
  39. package/dist/src/client/client-error.js +1 -1
  40. package/dist/src/client/client.d.ts +7 -14
  41. package/dist/src/client/client.js +1 -1
  42. package/dist/src/client/eve-agent-store.d.ts +4 -4
  43. package/dist/src/client/eve-agent-store.js +1 -1
  44. package/dist/src/client/index.d.ts +2 -1
  45. package/dist/src/client/index.js +1 -1
  46. package/dist/src/client/message-response.d.ts +2 -7
  47. package/dist/src/client/message-response.js +1 -1
  48. package/dist/src/client/open-stream.js +1 -1
  49. package/dist/src/client/session-controls.d.ts +29 -0
  50. package/dist/src/client/session-controls.js +1 -0
  51. package/dist/src/client/session-utils.d.ts +0 -20
  52. package/dist/src/client/session-utils.js +1 -1
  53. package/dist/src/client/session.d.ts +26 -90
  54. package/dist/src/client/session.js +1 -1
  55. package/dist/src/client/sessions.d.ts +20 -0
  56. package/dist/src/client/sessions.js +1 -0
  57. package/dist/src/client/types.d.ts +26 -47
  58. package/dist/src/compiler/normalize-subagent.js +1 -1
  59. package/dist/src/evals/cli/eval-client.js +1 -1
  60. package/dist/src/evals/context.js +1 -1
  61. package/dist/src/evals/session.d.ts +7 -6
  62. package/dist/src/evals/session.js +1 -1
  63. package/dist/src/evals/types.d.ts +9 -9
  64. package/dist/src/execution/agent-handle-dispatch.js +1 -1
  65. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  66. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  67. package/dist/src/execution/remote-agent-dispatch.d.ts +1 -3
  68. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  69. package/dist/src/execution/runtime-context.js +1 -1
  70. package/dist/src/execution/runtime-errors.d.ts +1 -1
  71. package/dist/src/execution/session-command-token.d.ts +2 -0
  72. package/dist/src/execution/session-command-token.js +1 -1
  73. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  74. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  75. package/dist/src/execution/turn-control-receiver.d.ts +2 -2
  76. package/dist/src/execution/turn-workflow.js +1 -1
  77. package/dist/src/execution/workflow-entry.js +1 -1
  78. package/dist/src/execution/workflow-runtime.js +1 -1
  79. package/dist/src/harness/cancelled-turn-emission.d.ts +1 -1
  80. package/dist/src/harness/cancelled-turn-emission.js +1 -1
  81. package/dist/src/harness/emission.d.ts +1 -1
  82. package/dist/src/harness/emission.js +1 -1
  83. package/dist/src/harness/handles/prompt.d.ts +22 -3
  84. package/dist/src/harness/handles/prompt.js +1 -1
  85. package/dist/src/harness/handles/store.d.ts +0 -5
  86. package/dist/src/harness/handles/store.js +1 -1
  87. package/dist/src/harness/runtime-actions.js +1 -1
  88. package/dist/src/harness/session-limit-enforcement.js +1 -1
  89. package/dist/src/harness/tool-loop.js +1 -1
  90. package/dist/src/internal/application/package.js +1 -1
  91. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  92. package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
  93. package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.d.ts +15 -0
  94. package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -0
  95. package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +14 -2
  96. package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
  97. package/dist/src/internal/nitro/host/dev-server-http.js +1 -1
  98. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +2 -5
  99. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  100. package/dist/src/internal/nitro/routes/channel-route-context.d.ts +4 -3
  101. package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
  102. package/dist/src/packages/eve-catalog/src/index.js +1 -1
  103. package/dist/src/protocol/cancel-turn.d.ts +9 -4
  104. package/dist/src/protocol/cancel-turn.js +1 -1
  105. package/dist/src/protocol/message.d.ts +4 -14
  106. package/dist/src/protocol/message.js +2 -2
  107. package/dist/src/protocol/reset-session.d.ts +1 -1
  108. package/dist/src/protocol/routes.d.ts +27 -47
  109. package/dist/src/protocol/routes.js +1 -1
  110. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +19 -21
  111. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  112. package/dist/src/public/channels/discord/discordChannel.d.ts +4 -4
  113. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  114. package/dist/src/public/channels/eve.d.ts +11 -10
  115. package/dist/src/public/channels/eve.js +1 -1
  116. package/dist/src/public/channels/github/dispatch.d.ts +8 -8
  117. package/dist/src/public/channels/github/dispatch.js +1 -1
  118. package/dist/src/public/channels/github/githubChannel.d.ts +3 -3
  119. package/dist/src/public/channels/github/githubChannel.js +1 -1
  120. package/dist/src/public/channels/github/pr-context.d.ts +1 -1
  121. package/dist/src/public/channels/index.d.ts +1 -1
  122. package/dist/src/public/channels/linear/linearChannel.d.ts +3 -3
  123. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  124. package/dist/src/public/channels/slack/index.d.ts +1 -1
  125. package/dist/src/public/channels/slack/interactions.d.ts +3 -4
  126. package/dist/src/public/channels/slack/interactions.js +1 -1
  127. package/dist/src/public/channels/slack/session-operations.d.ts +37 -0
  128. package/dist/src/public/channels/slack/session-operations.js +1 -0
  129. package/dist/src/public/channels/slack/slackChannel.d.ts +55 -74
  130. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  131. package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -3
  132. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  133. package/dist/src/public/channels/telegram/telegramChannel.d.ts +4 -4
  134. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  135. package/dist/src/public/channels/twilio/twilioChannel.d.ts +3 -3
  136. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  137. package/dist/src/public/definitions/callback-context.d.ts +1 -2
  138. package/dist/src/public/definitions/channel.d.ts +21 -86
  139. package/dist/src/public/definitions/channel.js +1 -1
  140. package/dist/src/public/definitions/remote-agent.js +1 -1
  141. package/dist/src/public/definitions/schedule.d.ts +16 -16
  142. package/dist/src/public/schedules/index.d.ts +1 -1
  143. package/dist/src/react/use-eve-agent.d.ts +7 -4
  144. package/dist/src/react/use-eve-agent.js +1 -1
  145. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +11 -0
  146. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
  147. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  148. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  149. package/dist/src/runtime/prompt/compose.js +1 -1
  150. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  151. package/dist/src/runtime/types.d.ts +2 -2
  152. package/dist/src/services/inspect-application.d.ts +1 -1
  153. package/dist/src/services/inspect-application.js +1 -1
  154. package/dist/src/setup/channel-add-conflicts.js +1 -1
  155. package/dist/src/setup/scaffold/create/project.js +1 -1
  156. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  157. package/dist/src/setup/scaffold/create/web-template.js +29 -17
  158. package/dist/src/shared/channel-definition.d.ts +7 -7
  159. package/dist/src/shared/schedule-definition.d.ts +2 -2
  160. package/dist/src/svelte/index.js +1 -1
  161. package/dist/src/svelte/use-eve-agent.d.ts +8 -5
  162. package/dist/src/svelte/use-eve-agent.js +1 -1
  163. package/dist/src/vue/index.js +1 -1
  164. package/dist/src/vue/use-eve-agent.d.ts +8 -5
  165. package/dist/src/vue/use-eve-agent.js +1 -1
  166. package/docs/README.md +6 -6
  167. package/docs/channels/chat-sdk.mdx +5 -6
  168. package/docs/channels/custom.mdx +116 -144
  169. package/docs/channels/discord.mdx +1 -1
  170. package/docs/channels/eve.mdx +76 -30
  171. package/docs/channels/github.mdx +1 -1
  172. package/docs/channels/linear.mdx +6 -8
  173. package/docs/channels/overview.mdx +2 -2
  174. package/docs/channels/slack.mdx +46 -15
  175. package/docs/channels/telegram.mdx +1 -1
  176. package/docs/channels/twilio.mdx +1 -1
  177. package/docs/concepts/default-harness.md +11 -3
  178. package/docs/concepts/execution-model-and-durability.mdx +17 -5
  179. package/docs/concepts/sessions-runs-and-streaming.md +42 -16
  180. package/docs/evals/cases.mdx +3 -3
  181. package/docs/evals/targets.mdx +1 -1
  182. package/docs/guides/auth-and-route-protection.md +2 -1
  183. package/docs/guides/client/continuations.mdx +50 -77
  184. package/docs/guides/client/messages.mdx +29 -33
  185. package/docs/guides/client/output-schema.mdx +7 -14
  186. package/docs/guides/client/overview.mdx +40 -11
  187. package/docs/guides/client/streaming.mdx +17 -23
  188. package/docs/guides/frontend/nuxt.mdx +1 -1
  189. package/docs/guides/frontend/overview.mdx +40 -36
  190. package/docs/guides/frontend/sveltekit.mdx +1 -1
  191. package/docs/guides/frontend/use-eve-agent-svelte.mdx +19 -23
  192. package/docs/guides/frontend/use-eve-agent-vue.mdx +21 -25
  193. package/docs/guides/instrumentation.md +1 -1
  194. package/docs/patterns/dynamic-scheduling.md +16 -15
  195. package/docs/schedules.mdx +10 -11
  196. package/docs/subagents.mdx +1 -1
  197. package/docs/tools/human-in-the-loop.md +1 -1
  198. package/docs/tutorial/ship-it.mdx +1 -1
  199. package/package.json +1 -1
  200. package/dist/src/channel/cancel.d.ts +0 -6
  201. package/dist/src/channel/cancel.js +0 -1
  202. package/dist/src/channel/clear-session.d.ts +0 -4
  203. package/dist/src/channel/clear-session.js +0 -1
  204. package/dist/src/channel/compact-session.d.ts +0 -4
  205. package/dist/src/channel/compact-session.js +0 -1
  206. package/dist/src/channel/reset-session.d.ts +0 -6
  207. package/dist/src/channel/reset-session.js +0 -1
  208. package/dist/src/channel/resolve-active-session.d.ts +0 -4
  209. package/dist/src/channel/resolve-active-session.js +0 -1
  210. package/dist/src/channel/send.d.ts +0 -6
  211. package/dist/src/channel/send.js +0 -1
@@ -46,9 +46,8 @@ type Cancellation = {
46
46
  };
47
47
 
48
48
  export function AgentChat() {
49
- const [session] = useState(() =>
50
- new Client({ host: "", preserveCompletedSessions: true }).session(),
51
- );
49
+ const [client] = useState(() => new Client({ host: "" }));
50
+ const sessionIdRef = useRef<string | undefined>(undefined);
52
51
  const cancellationRef = useRef<Cancellation>({ requested: false });
53
52
  const [cancellationError, setCancellationError] = useState<string>();
54
53
  const [cancellationState, setCancellationState] = useState<CancellationState>("idle");
@@ -63,18 +62,26 @@ export function AgentChat() {
63
62
  cancellation.sentTurnId = turnId;
64
63
  setCancellationState("cancelling");
65
64
 
66
- void session.cancel({ turnId }).catch((error: unknown) => {
67
- if (cancellationRef.current !== cancellation) {
68
- return;
69
- }
65
+ const sessionId = sessionIdRef.current;
66
+ if (sessionId === undefined) {
67
+ return;
68
+ }
70
69
 
71
- cancellation.requested = false;
72
- cancellation.sentTurnId = undefined;
73
- setCancellationError(toErrorMessage(error));
74
- setCancellationState("idle");
75
- });
70
+ void client.sessions
71
+ .attach(sessionId)
72
+ .cancel({ turnId })
73
+ .catch((error: unknown) => {
74
+ if (cancellationRef.current !== cancellation) {
75
+ return;
76
+ }
77
+
78
+ cancellation.requested = false;
79
+ cancellation.sentTurnId = undefined;
80
+ setCancellationError(toErrorMessage(error));
81
+ setCancellationState("idle");
82
+ });
76
83
  },
77
- [session],
84
+ [client],
78
85
  );
79
86
 
80
87
  const handleEvent = useCallback(
@@ -90,7 +97,12 @@ export function AgentChat() {
90
97
  [cancelTurn],
91
98
  );
92
99
 
93
- const agent = useEveAgent({ onEvent: handleEvent, session });
100
+ const agent = useEveAgent({
101
+ onEvent: handleEvent,
102
+ onSessionChange(session) {
103
+ sessionIdRef.current = session?.sessionId;
104
+ },
105
+ });
94
106
  const isBusy = agent.status === "submitted" || agent.status === "streaming";
95
107
  const isEmpty = agent.data.messages.length === 0;
96
108
  const errorMessage = cancellationError ?? agent.error?.message;
@@ -124,7 +136,7 @@ export function AgentChat() {
124
136
  prepareTurn();
125
137
 
126
138
  if (message.files.length === 0) {
127
- await agent.send({ message: text });
139
+ await agent.send(text);
128
140
  return;
129
141
  }
130
142
 
@@ -141,7 +153,7 @@ export function AgentChat() {
141
153
  });
142
154
  }
143
155
 
144
- await agent.send({ message: parts });
156
+ await agent.send(parts);
145
157
  };
146
158
 
147
159
  const composer = (
@@ -187,7 +199,7 @@ export function AgentChat() {
187
199
  message={message}
188
200
  onInputResponses={(inputResponses) => {
189
201
  prepareTurn();
190
- return agent.send({ inputResponses });
202
+ return agent.respond(inputResponses);
191
203
  }}
192
204
  />
193
205
  ))}
@@ -1,5 +1,7 @@
1
1
  import { type ChannelCors } from "#channel/cors.js";
2
- import type { RouteDefinition, SendFn } from "#channel/routes.js";
2
+ import type { UserContent } from "ai";
3
+ import type { ChannelReceiveContext } from "#channel/channel-operations.js";
4
+ import type { RouteDefinition } from "#channel/routes.js";
3
5
  import type { Session, SessionHandle } from "#channel/session.js";
4
6
  import type { SessionAuthContext } from "#channel/types.js";
5
7
  /**
@@ -22,7 +24,7 @@ export type FetchFileFunction = (url: string) => Promise<Buffer | FetchFileResul
22
24
  * schedule proactively routes a message to it.
23
25
  */
24
26
  export interface GenericReceiveInput<TReceiveTarget = Record<string, unknown>> {
25
- readonly message: string;
27
+ readonly message: string | UserContent;
26
28
  readonly target: Readonly<TReceiveTarget>;
27
29
  readonly auth: SessionAuthContext | null;
28
30
  }
@@ -54,14 +56,12 @@ export interface GenericChannelDefinition<TEvents, TState = undefined, TCtx = vo
54
56
  *
55
57
  * Return the channel-owned context (thread handles, API clients, etc.). The
56
58
  * framework passes it as the `channel` argument to event handlers (with
57
- * {@link ChannelSessionOps} injected) and passes {@link SessionContext} as a
58
- * separate `ctx` argument.
59
+ * {@link ChannelContinuationOps} injected) and passes {@link SessionContext}
60
+ * as a separate `ctx` argument.
59
61
  */
60
62
  context?(state: NonNullable<TState>, session: SessionHandle): TCtx;
61
63
  readonly routes: readonly RouteDefinition<TState>[];
62
- receive?(input: GenericReceiveInput<TReceiveTarget>, args: {
63
- send: SendFn<TState>;
64
- }): Promise<Session>;
64
+ receive?(input: GenericReceiveInput<TReceiveTarget>, ctx: ChannelReceiveContext<TState>): Promise<Session>;
65
65
  readonly events?: TEvents;
66
66
  /**
67
67
  * Fetches bytes for a `URL` object encountered on a `FilePart.data` by the
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `run` form of {@link ScheduleDefinition} invokes this handler when a
3
- * schedule's cron fires. It receives {@link ScheduleHandlerArgs} (`receive`,
3
+ * schedule's cron fires. It receives {@link ScheduleHandlerArgs} (`to`,
4
4
  * `waitUntil`, `appAuth`) and may return synchronously or as a promise.
5
5
  */
6
6
  export type GenericScheduleRunHandler<TArgs> = (args: TArgs) => Promise<void> | void;
@@ -18,7 +18,7 @@ export interface GenericScheduleDefinitionFields<TArgs> {
18
18
  * on the prompt and discards the output (equivalent to the `<name>.md`
19
19
  * markdown form).
20
20
  * - `run`: full handler ({@link GenericScheduleRunHandler}). Receives
21
- * `{ receive, waitUntil, appAuth }` and decides what to do.
21
+ * `{ to, waitUntil, appAuth }` and decides what to do.
22
22
  *
23
23
  * Identity is derived from the file path under `agent/schedules/`; authored
24
24
  * definitions do not carry a `name` field.
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-Bx-ONuyb.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DbYZLG0h.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,8 +1,9 @@
1
+ import type { UserContent } from "ai";
1
2
  import { type EveAgentStoreCallbacks, type EveAgentStoreSnapshot, type EveAgentStoreStatus, type PrepareSend } from "#client/eve-agent-store.js";
2
3
  import { type EveMessageData } from "#client/message-reducer.js";
3
4
  import type { EveAgentReducer } from "#client/reducer.js";
4
5
  import type { ClientSession } from "#client/session.js";
5
- import type { ClientAuth, HeadersValue, SendTurnPayload, SessionState } from "#client/types.js";
6
+ import type { ClientAuth, HeadersValue, RespondTurnOptions, SendTurnOptions, ClientSessionState } from "#client/types.js";
6
7
  import type { MessageStreamEvent } from "#protocol/message.js";
7
8
  export type { PrepareSend };
8
9
  /**
@@ -33,10 +34,12 @@ export interface UseEveAgentReturn<TData> {
33
34
  readonly events: readonly MessageStreamEvent[];
34
35
  /** Clear all state and start a new session. */
35
36
  readonly reset: () => void;
36
- /** Send a turn with full structured input (message, attachments, input responses). */
37
- readonly send: <TOutput = unknown>(input: SendTurnPayload<TOutput>) => Promise<void>;
37
+ /** Send a message with optional turn settings. */
38
+ readonly send: <TOutput = unknown>(message: string | UserContent, options?: SendTurnOptions<TOutput>) => Promise<void>;
39
+ /** Answer pending HITL input requests. */
40
+ readonly respond: <TOutput = unknown>(inputResponses: Parameters<ClientSession["respond"]>[0], options?: RespondTurnOptions<TOutput>) => Promise<void>;
38
41
  /** Current session identity and stream cursor. */
39
- readonly session: SessionState;
42
+ readonly session: ClientSessionState | undefined;
40
43
  /** Lifecycle phase: `"ready"` (idle), `"submitted"` (request sent, awaiting first event), `"streaming"` (events arriving), or `"error"`. */
41
44
  readonly status: UseEveAgentStatus;
42
45
  /** Abort the in-flight request. */
@@ -79,7 +82,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
79
82
  /** Ordered prefix of the session stream used to rehydrate projected state. */
80
83
  readonly initialEvents?: readonly MessageStreamEvent[];
81
84
  /** Seed session identity and stream cursor for resuming a prior conversation. */
82
- readonly initialSession?: SessionState;
85
+ readonly initialSession?: ClientSessionState;
83
86
  /**
84
87
  * Project submitted user messages before eve confirms them with a
85
88
  * `message.received` stream event. Optimistic events are reducer-facing
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-Bx-ONuyb.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-DbYZLG0h.js";
2
2
 
3
3
  export { useEveAgent };
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DDoDDmJ2.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-CF5D6jSV.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,10 +1,11 @@
1
1
  import { type ComputedRef } from "vue";
2
+ import type { UserContent } from "ai";
2
3
  import { type EveAgentStoreCallbacks, type EveAgentStoreSnapshot, type EveAgentStoreStatus, type PrepareSend } from "#client/eve-agent-store.js";
3
4
  import type { EveAgentReducer } from "#client/reducer.js";
4
5
  import type { ClientSession } from "#client/session.js";
5
6
  import { type EveMessageData } from "#client/message-reducer.js";
6
7
  import type { MessageStreamEvent } from "#protocol/message.js";
7
- import type { ClientAuth, HeadersValue, SendTurnPayload, SessionState } from "#client/types.js";
8
+ import type { ClientAuth, HeadersValue, RespondTurnOptions, SendTurnOptions, ClientSessionState } from "#client/types.js";
8
9
  export type { PrepareSend };
9
10
  /**
10
11
  * Lifecycle phase of a `useEveAgent` session: `"ready"` (idle), `"submitted"`
@@ -32,10 +33,12 @@ export interface UseEveAgentReturn<TData> {
32
33
  readonly events: ComputedRef<readonly MessageStreamEvent[]>;
33
34
  /** Clear all state and start a new session. */
34
35
  readonly reset: () => void;
35
- /** Send a turn with full structured input (message, attachments, input responses). */
36
- readonly send: <TOutput = unknown>(input: SendTurnPayload<TOutput>) => Promise<void>;
36
+ /** Send a message with optional turn settings. */
37
+ readonly send: <TOutput = unknown>(message: string | UserContent, options?: SendTurnOptions<TOutput>) => Promise<void>;
38
+ /** Answer pending HITL input requests. */
39
+ readonly respond: <TOutput = unknown>(inputResponses: Parameters<ClientSession["respond"]>[0], options?: RespondTurnOptions<TOutput>) => Promise<void>;
37
40
  /** Current session identity and stream cursor. */
38
- readonly session: ComputedRef<SessionState>;
41
+ readonly session: ComputedRef<ClientSessionState | undefined>;
39
42
  /** Lifecycle phase: `"ready"` (idle), `"submitted"` (request sent, awaiting first event), `"streaming"` (events arriving), or `"error"`. */
40
43
  readonly status: ComputedRef<UseEveAgentStatus>;
41
44
  /** Abort the in-flight request. */
@@ -78,7 +81,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
78
81
  /** Ordered prefix of the session stream used to rehydrate projected state. */
79
82
  readonly initialEvents?: readonly MessageStreamEvent[];
80
83
  /** Prior session cursor to resume from on mount. */
81
- readonly initialSession?: SessionState;
84
+ readonly initialSession?: ClientSessionState;
82
85
  /**
83
86
  * Project submitted user messages before eve confirms them with a
84
87
  * `message.received` stream event.
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DDoDDmJ2.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-CF5D6jSV.js";
2
2
 
3
3
  export { useEveAgent };
package/docs/README.md CHANGED
@@ -86,21 +86,21 @@ eve then gives you:
86
86
  The public surface stays filesystem-first, but the implementation model underneath is still useful to
87
87
  know:
88
88
 
89
- - channels normalize inbound transport input and define the `continuationToken`
89
+ - channels normalize inbound transport input and map platform addresses to sessions
90
90
  - the harness does one unit of AI work and decides whether to continue, wait, or finish
91
91
  - the runtime persists session state, streams events, and owns workflow orchestration
92
92
 
93
- That is why eve exposes two identifiers:
94
-
95
- - `continuationToken` for the next user message
96
- - `sessionId` for streaming and inspection
93
+ The default HTTP API exposes one durable `sessionId` for messages, controls, and
94
+ streaming. Platform channels additionally own channel-local continuation
95
+ addresses so a Slack thread or custom conversation ID can point at its current
96
+ session without leaking that routing identity into the HTTP client contract.
97
97
 
98
98
  ## How to use these docs
99
99
 
100
100
  - Start with the authored filesystem shape and `agent.ts`.
101
101
  - Then add runtime surfaces in this order: skills, tools, workspace, sandbox, channels.
102
102
  - Then learn the durable runtime model: HITL, session context, sessions, streaming, and
103
- continuation-token follow-ups.
103
+ ID-addressed follow-ups and channel address routing.
104
104
  - Then add advanced features: subagents, schedules, route protection, deployment.
105
105
 
106
106
  ## Good companions in this repo
@@ -177,14 +177,13 @@ chatSdkChannel({
177
177
 
178
178
  ### Proactive sessions
179
179
 
180
- Start a session without an inbound webhook through `channel.receive({ message, target, auth })` — from a schedule `run` handler, or `args.receive(channel, ...)` from another channel. The target is a serialized Chat SDK thread, or `{ threadId, adapterName }` when you only have a provider-native thread id:
180
+ Start a session without an inbound webhook through `to(channel, target).send(message, { auth })` from a schedule `run` handler, or `ctx.to(channel, target).send(message, { auth })` from another channel. The target is a serialized Chat SDK thread, or `{ threadId, adapterName }` when you only have a provider-native thread id:
181
181
 
182
182
  ```ts
183
- await channel.receive({
184
- message: "Your weekly digest is ready.",
185
- target: { adapterName: "resend", threadId: "resend:user@example.com" },
186
- auth: null,
187
- });
183
+ await to(channel, { adapterName: "resend", threadId: "resend:user@example.com" }).send(
184
+ "Your weekly digest is ready.",
185
+ { auth: null },
186
+ );
188
187
  ```
189
188
 
190
189
  ### Attachments