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.
- package/CHANGELOG.md +29 -0
- package/README.md +5 -6
- package/dist/src/acp/adapter.d.ts +10 -4
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/adapter-context.d.ts +1 -1
- package/dist/src/channel/adapter.d.ts +2 -4
- package/dist/src/channel/adapter.js +1 -1
- package/dist/src/channel/channel-address.d.ts +58 -0
- package/dist/src/channel/channel-address.js +1 -0
- package/dist/src/channel/channel-operations.d.ts +72 -0
- package/dist/src/channel/channel-operations.js +1 -0
- package/dist/src/channel/compiled-channel.d.ts +10 -6
- package/dist/src/channel/cross-channel-receive.d.ts +13 -25
- package/dist/src/channel/cross-channel-receive.js +2 -2
- package/dist/src/channel/receive-target.d.ts +1 -2
- package/dist/src/channel/routes.d.ts +21 -149
- package/dist/src/channel/schedule.d.ts +1 -1
- package/dist/src/channel/schedule.js +1 -1
- package/dist/src/channel/send-input.d.ts +6 -0
- package/dist/src/channel/send-input.js +1 -0
- package/dist/src/channel/session.d.ts +44 -30
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +8 -35
- package/dist/src/chunks/{use-eve-agent-DDoDDmJ2.js → use-eve-agent-CF5D6jSV.js} +339 -367
- package/dist/src/chunks/{use-eve-agent-Bx-ONuyb.js → use-eve-agent-DbYZLG0h.js} +342 -368
- package/dist/src/cli/commands/agent-prompt/build-and-verify.md +1 -2
- package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
- package/dist/src/cli/commands/info.d.ts +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/invoke/invoke.d.ts +1 -1
- package/dist/src/cli/invoke/invoke.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +0 -11
- package/dist/src/cli/invoke/result.js +1 -1
- package/dist/src/client/client-error.d.ts +2 -0
- package/dist/src/client/client-error.js +1 -1
- package/dist/src/client/client.d.ts +7 -14
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +4 -4
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +2 -1
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-response.d.ts +2 -7
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.d.ts +29 -0
- package/dist/src/client/session-controls.js +1 -0
- package/dist/src/client/session-utils.d.ts +0 -20
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.d.ts +26 -90
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/sessions.d.ts +20 -0
- package/dist/src/client/sessions.js +1 -0
- package/dist/src/client/types.d.ts +26 -47
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/session.d.ts +7 -6
- package/dist/src/evals/session.js +1 -1
- package/dist/src/evals/types.d.ts +9 -9
- package/dist/src/execution/agent-handle-dispatch.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/remote-agent-dispatch.d.ts +1 -3
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/runtime-errors.d.ts +1 -1
- package/dist/src/execution/session-command-token.d.ts +2 -0
- package/dist/src/execution/session-command-token.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.js +1 -1
- package/dist/src/execution/turn-control-receiver.d.ts +2 -2
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/harness/cancelled-turn-emission.d.ts +1 -1
- package/dist/src/harness/cancelled-turn-emission.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/handles/prompt.d.ts +22 -3
- package/dist/src/harness/handles/prompt.js +1 -1
- package/dist/src/harness/handles/store.d.ts +0 -5
- package/dist/src/harness/handles/store.js +1 -1
- package/dist/src/harness/runtime-actions.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.d.ts +15 -0
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -0
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +14 -2
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/host/dev-server-http.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +2 -5
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +4 -3
- package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/protocol/cancel-turn.d.ts +9 -4
- package/dist/src/protocol/cancel-turn.js +1 -1
- package/dist/src/protocol/message.d.ts +4 -14
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/reset-session.d.ts +1 -1
- package/dist/src/protocol/routes.d.ts +27 -47
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +19 -21
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +4 -4
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/eve.d.ts +11 -10
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/github/dispatch.d.ts +8 -8
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +3 -3
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/pr-context.d.ts +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/linear/linearChannel.d.ts +3 -3
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +3 -4
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/session-operations.d.ts +37 -0
- package/dist/src/public/channels/slack/session-operations.js +1 -0
- package/dist/src/public/channels/slack/slackChannel.d.ts +55 -74
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -3
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +4 -4
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +3 -3
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -2
- package/dist/src/public/definitions/channel.d.ts +21 -86
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/remote-agent.js +1 -1
- package/dist/src/public/definitions/schedule.d.ts +16 -16
- package/dist/src/public/schedules/index.d.ts +1 -1
- package/dist/src/react/use-eve-agent.d.ts +7 -4
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +11 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/types.d.ts +2 -2
- package/dist/src/services/inspect-application.d.ts +1 -1
- package/dist/src/services/inspect-application.js +1 -1
- package/dist/src/setup/channel-add-conflicts.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +29 -17
- package/dist/src/shared/channel-definition.d.ts +7 -7
- package/dist/src/shared/schedule-definition.d.ts +2 -2
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +8 -5
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +8 -5
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +6 -6
- package/docs/channels/chat-sdk.mdx +5 -6
- package/docs/channels/custom.mdx +116 -144
- package/docs/channels/discord.mdx +1 -1
- package/docs/channels/eve.mdx +76 -30
- package/docs/channels/github.mdx +1 -1
- package/docs/channels/linear.mdx +6 -8
- package/docs/channels/overview.mdx +2 -2
- package/docs/channels/slack.mdx +46 -15
- package/docs/channels/telegram.mdx +1 -1
- package/docs/channels/twilio.mdx +1 -1
- package/docs/concepts/default-harness.md +11 -3
- package/docs/concepts/execution-model-and-durability.mdx +17 -5
- package/docs/concepts/sessions-runs-and-streaming.md +42 -16
- package/docs/evals/cases.mdx +3 -3
- package/docs/evals/targets.mdx +1 -1
- package/docs/guides/auth-and-route-protection.md +2 -1
- package/docs/guides/client/continuations.mdx +50 -77
- package/docs/guides/client/messages.mdx +29 -33
- package/docs/guides/client/output-schema.mdx +7 -14
- package/docs/guides/client/overview.mdx +40 -11
- package/docs/guides/client/streaming.mdx +17 -23
- package/docs/guides/frontend/nuxt.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +40 -36
- package/docs/guides/frontend/sveltekit.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +19 -23
- package/docs/guides/frontend/use-eve-agent-vue.mdx +21 -25
- package/docs/guides/instrumentation.md +1 -1
- package/docs/patterns/dynamic-scheduling.md +16 -15
- package/docs/schedules.mdx +10 -11
- package/docs/subagents.mdx +1 -1
- package/docs/tools/human-in-the-loop.md +1 -1
- package/docs/tutorial/ship-it.mdx +1 -1
- package/package.json +1 -1
- package/dist/src/channel/cancel.d.ts +0 -6
- package/dist/src/channel/cancel.js +0 -1
- package/dist/src/channel/clear-session.d.ts +0 -4
- package/dist/src/channel/clear-session.js +0 -1
- package/dist/src/channel/compact-session.d.ts +0 -4
- package/dist/src/channel/compact-session.js +0 -1
- package/dist/src/channel/reset-session.d.ts +0 -6
- package/dist/src/channel/reset-session.js +0 -1
- package/dist/src/channel/resolve-active-session.d.ts +0 -4
- package/dist/src/channel/resolve-active-session.js +0 -1
- package/dist/src/channel/send.d.ts +0 -6
- 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 [
|
|
50
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
const sessionId = sessionIdRef.current;
|
|
66
|
+
if (sessionId === undefined) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
[
|
|
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({
|
|
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(
|
|
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(
|
|
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.
|
|
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 {
|
|
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
|
|
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>,
|
|
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} (`
|
|
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
|
-
* `{
|
|
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.
|
package/dist/src/svelte/index.js
CHANGED
|
@@ -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,
|
|
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
|
|
37
|
-
readonly send: <TOutput = unknown>(
|
|
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:
|
|
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?:
|
|
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
|
package/dist/src/vue/index.js
CHANGED
|
@@ -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,
|
|
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
|
|
36
|
-
readonly send: <TOutput = unknown>(
|
|
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<
|
|
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?:
|
|
84
|
+
readonly initialSession?: ClientSessionState;
|
|
82
85
|
/**
|
|
83
86
|
* Project submitted user messages before eve confirms them with a
|
|
84
87
|
* `message.received` stream event.
|
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
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|