The Open Framework for Building Agents
fix(eve): keep session projection types internal in eve/vue and eve/svelte (#4578)
roboeve[bot]2eb861a88d21
diff --git a/.changeset/internal-session-projection-types.md b/.changeset/internal-session-projection-types.mdnew file mode 100644index 000000000..fbce90345--- /dev/null+++ b/.changeset/internal-session-projection-types.md@@ -0,0 +1,5 @@+---+"eve": patch+---++`eve/vue` and `eve/svelte` no longer export the internal session projection types `SessionAuthorization`, `SessionCall`, `SessionCallStatus`, and `SessionProjection`, matching `eve/react`. Use `ToolCallStatus` and `toolCallState()` to read a tool call's status.diff --git a/packages/eve/src/svelte/index.ts b/packages/eve/src/svelte/index.tsindex 8c4e87afa..a12215c12 100644--- a/packages/eve/src/svelte/index.ts+++ b/packages/eve/src/svelte/index.ts@@ -17,12 +17,6 @@ export {export { conversationReducer } from "#client/conversation-reducer.js";export { openConversationInputs } from "#client/conversation-state.js";export { toolCallState, type ToolCallState, type ToolCallStatus } from "#client/tool-call-state.js";-export type {- SessionAuthorization,- SessionCall,- SessionCallStatus,- SessionProjection,-} from "#protocol/session-projection.js";export type {AgentObservation,ConversationAgentSession,diff --git a/packages/eve/src/vue/index.ts b/packages/eve/src/vue/index.tsindex dda7f8f86..b17474765 100644--- a/packages/eve/src/vue/index.ts+++ b/packages/eve/src/vue/index.ts@@ -17,12 +17,6 @@ export {export { conversationReducer } from "#client/conversation-reducer.js";export { openConversationInputs } from "#client/conversation-state.js";export { toolCallState, type ToolCallState, type ToolCallStatus } from "#client/tool-call-state.js";-export type {- SessionAuthorization,- SessionCall,- SessionCallStatus,- SessionProjection,-} from "#protocol/session-projection.js";export type {AgentObservation,ConversationAgentSession,diff --git a/packages/eve/test/frontend-binding-exports.test.ts b/packages/eve/test/frontend-binding-exports.test.tsnew file mode 100644index 000000000..21c19bf89--- /dev/null+++ b/packages/eve/test/frontend-binding-exports.test.ts@@ -0,0 +1,28 @@+import { readFileSync } from "node:fs";++import { describe, expect, it } from "vitest";++const EXPORT_FROM = /export\s+(?:type\s+)?\{([^}]*)\}\s+from\s+"([^"]+)"/g;+const BINDING_MODULE = /^#(?:react|vue|svelte)\//;++/** Names a binding entry point re-exports from shared modules, excluding its own hook module. */+function sharedExports(binding: "react" | "vue" | "svelte"): string[] {+ const source = readFileSync(new URL(`../src/${binding}/index.ts`, import.meta.url), "utf8");+ const names: string[] = [];+ for (const [, specifiers, from] of source.matchAll(EXPORT_FROM)) {+ if (BINDING_MODULE.test(from!)) continue;+ for (const specifier of specifiers!.split(",")) {+ const name = specifier.replace(/^\s*type\s+/, "").trim();+ if (name !== "") names.push(name);+ }+ }+ return names.sort();+}++describe("frontend binding entry points", () => {+ it("re-export the same shared client surface", () => {+ const react = sharedExports("react");+ expect(sharedExports("vue")).toEqual(react);+ expect(sharedExports("svelte")).toEqual(react);+ });+});