eve 0.33.0 → 0.33.1

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 (47) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +3 -9
  3. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  4. package/dist/src/execution/durable-session-store.d.ts +5 -0
  5. package/dist/src/execution/durable-session-store.js +1 -1
  6. package/dist/src/execution/parked-delivery-wait.d.ts +8 -0
  7. package/dist/src/execution/parked-delivery-wait.js +1 -1
  8. package/dist/src/execution/route-child-delivery.js +1 -1
  9. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  10. package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -0
  11. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  12. package/dist/src/execution/turn-workflow.js +1 -1
  13. package/dist/src/execution/workflow-entry.js +1 -1
  14. package/dist/src/execution/workflow-steps.d.ts +4 -1
  15. package/dist/src/execution/workflow-steps.js +1 -1
  16. package/dist/src/harness/hitl/approval-input-requests.d.ts +13 -0
  17. package/dist/src/harness/hitl/approval-input-requests.js +1 -0
  18. package/dist/src/harness/hitl/pending-input-resolution.d.ts +51 -0
  19. package/dist/src/harness/hitl/pending-input-resolution.js +1 -0
  20. package/dist/src/harness/hitl/question-input-requests.d.ts +15 -0
  21. package/dist/src/harness/hitl/question-input-requests.js +1 -0
  22. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +10 -0
  23. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -0
  24. package/dist/src/harness/input-requests.d.ts +17 -105
  25. package/dist/src/harness/input-requests.js +1 -1
  26. package/dist/src/harness/pending-input-batches.d.ts +77 -0
  27. package/dist/src/harness/pending-input-batches.js +1 -0
  28. package/dist/src/harness/proxy-input-requests.d.ts +13 -3
  29. package/dist/src/harness/proxy-input-requests.js +1 -1
  30. package/dist/src/harness/session-limit-enforcement.js +1 -1
  31. package/dist/src/harness/tool-loop.js +2 -2
  32. package/dist/src/internal/application/package.js +1 -1
  33. package/dist/src/setup/scaffold/create/project.js +1 -1
  34. package/dist/src/setup/scaffold/create/web-template.d.ts +9 -0
  35. package/dist/src/setup/scaffold/create/web-template.js +291 -1
  36. package/dist/src/setup/scaffold/index.d.ts +1 -1
  37. package/dist/src/setup/scaffold/update/channels.d.ts +4 -13
  38. package/dist/src/setup/scaffold/update/channels.js +2 -2
  39. package/dist/src/setup/scaffold/update/web-options.d.ts +15 -0
  40. package/dist/src/setup/scaffold/update/web-options.js +1 -0
  41. package/dist/src/setup/vercel-project.js +0 -0
  42. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  43. package/docs/guides/frontend/overview.mdx +31 -10
  44. package/docs/guides/frontend/use-eve-agent-svelte.mdx +37 -15
  45. package/docs/guides/frontend/use-eve-agent-vue.mdx +38 -15
  46. package/docs/tools/human-in-the-loop.md +2 -2
  47. package/package.json +1 -1
@@ -88,28 +88,51 @@ async function onFileChange(event: Event) {
88
88
 
89
89
  ## Human-in-the-loop prompts
90
90
 
91
- A tool opts into approval with `approval` ([Tools](../../tools)). When it triggers, the pending request shows up as a `dynamic-tool` part on the latest message at `part.toolMetadata?.eve?.inputRequest`. Read it, then answer through the same session with `respond(inputResponses)`:
91
+ A tool opts into approval with `approval` ([Tools](../../tools)). When it triggers, the pending request shows up on a `dynamic-tool` part at `part.toolMetadata?.eve?.inputRequest`. Scan every message because an unrelated turn can add newer messages while the approval stays open, then answer through the same session with `respond(inputResponses)`:
92
92
 
93
- ```ts
94
- import type { EveDynamicToolPart, EveMessagePart } from "eve/vue";
93
+ ```vue
94
+ <script setup lang="ts">
95
+ import { computed } from "vue";
96
+ import { useEveAgent } from "eve/vue";
95
97
 
96
98
  const { data, respond } = useEveAgent();
97
99
 
98
- const isDynamicToolPart = (part: EveMessagePart): part is EveDynamicToolPart =>
99
- part.type === "dynamic-tool";
100
-
101
- const request = data.value.messages
102
- .at(-1)
103
- ?.parts.filter(isDynamicToolPart)
104
- .map((part) => part.toolMetadata?.eve?.inputRequest)
105
- .find((value) => value !== undefined);
100
+ const pendingRequests = computed(() =>
101
+ data.value.messages.flatMap((message) =>
102
+ message.parts.flatMap((part) => {
103
+ if (part.type !== "dynamic-tool" || part.state !== "approval-requested") return [];
104
+ const request = part.toolMetadata?.eve?.inputRequest;
105
+ return request ? [request] : [];
106
+ }),
107
+ ),
108
+ );
109
+ </script>
106
110
 
107
- if (request) {
108
- await respond([{ requestId: request.requestId, optionId: "approve" }]);
109
- }
111
+ <template>
112
+ <fieldset v-for="request in pendingRequests" :key="request.requestId">
113
+ <legend>
114
+ {{
115
+ request.kind === "tool-approval"
116
+ ? "Approval required"
117
+ : request.kind === "question"
118
+ ? "Question"
119
+ : "Session limit"
120
+ }}
121
+ </legend>
122
+ <p>{{ request.prompt }}</p>
123
+ <button
124
+ v-for="option in request.options ?? []"
125
+ :key="option.id"
126
+ type="button"
127
+ @click="respond([{ requestId: request.requestId, optionId: option.id }])"
128
+ >
129
+ {{ option.label }}
130
+ </button>
131
+ </fieldset>
132
+ </template>
110
133
  ```
111
134
 
112
- The find-and-answer flow is the same across every framework. The [React hook reference](./overview) covers the longer walkthrough.
135
+ For a question with `allowFreeform`, bind a text input and send `{ requestId, text }`. The [React hook reference](./overview) covers the shared behavior.
113
136
 
114
137
  ## Stop, reset, and resume
115
138
 
@@ -109,7 +109,7 @@ semantics.
109
109
 
110
110
  The run picks back up exactly where it parked. Because the pause is durable, nothing is held in memory while it waits — the process can restart and the parked turn survives.
111
111
 
112
- For approval requests, unrelated follow-up text does not deny the tool call. eve keeps the approval pending and holds that text until the approval is answered, then replays it as the next message in the session.
112
+ For approval requests, unrelated follow-up text does not deny the tool call — and it does not wait behind it either. The message runs as an ordinary turn while the approval stays pending and answerable; a later structured answer still resolves the original tool call. Text that exactly matches an option (like `approve`) still resolves the request directly.
113
113
 
114
114
  See [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming) for the full event and resume contract that this builds on.
115
115
 
@@ -117,7 +117,7 @@ See [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming) for
117
117
 
118
118
  Channels turn requests into native UI: the Slack adapter renders approvals as buttons and questions as select menus, and writes the user's choice back as the answer. You get this for free on every [channel](/docs/channels/overview).
119
119
 
120
- From your own frontend, read the pending request off the latest message and answer through the same session — see [Building a frontend](/docs/guides/frontend/overview#human-in-the-loop-prompts) for the client-side reducer and `inputResponses` shape.
120
+ From your own frontend, scan all messages for pending requests and answer through the same session — see [Building a frontend](/docs/guides/frontend/overview#human-in-the-loop-prompts) for the client-side reducer and `inputResponses` shape.
121
121
 
122
122
  ## What to read next
123
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [