Repository navigation
docs(research): a smaller public surface for eve 1.0 - #4930
OwenKephart wants to merge 13 commits into
Conversation
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
| interface Delivery<TOutput = unknown> extends AsyncIterable<SessionStreamEvent> { | ||
| readonly sessionId: string; | ||
| readonly deliveryId: string; | ||
| result(): Promise<DeliveryResult<TOutput>>; // { status: RequestStatus, sessionEnded, reply?, data?, interactions } |
There was a problem hiding this comment.
result() resolves once the request stops making progress, but RequestStatus includes "working". Every caller then has to handle a status that can't come back from a settled result. Today's MessageResult.status has no running value (packages/eve/src/client/types.ts:315-323 at #4855). Type it as Exclude<RequestStatus, "working">, or name a SettledRequestStatus, so RequestStatus only shows up where a live view can still be working (requestStatus(view, id)).
There was a problem hiding this comment.
Clarified that DeliveryResult.status excludes working; the live requestStatus selector retains it. The implemented delivery result uses a settled status.
| response: ({ responder }) => (isApprover(responder) ? "admit" : { refuse: "Not an approver." }), | ||
| ``` | ||
|
|
||
| - A request policy returns `"allow" | "ask" | "deny" | { deny: string }`; booleans go, and one |
There was a problem hiding this comment.
The type here doesn't accept the example's implicit return on line 228 (// returning nothing allows), so a typed ApprovalPolicy would reject it. Accepting undefined too gives allow two spellings ("allow" and nothing), which is a fifth form beside the "four approval decisions" counted earlier. That's the same kind of overlap this section criticizes in "approved" vs "not-applicable". Pick one: either void is the only allow, or "allow" is required and the example returns it.
There was a problem hiding this comment.
The approval-policy rewrite was withdrawn in the current plan. It retains the existing policy vocabulary and implements keyed once(), so the inconsistent allow/void example is gone.
| } | ||
| return (toolInput?.amount ?? 0) > 1000 ? "user-approval" : "not-applicable"; | ||
| }, | ||
| response: ({ responder }) => |
There was a problem hiding this comment.
The "before" example doesn't match the current API. ApprovalResponseContext has auth, request, response, and session, with no top-level responder. The responder is response.principal (packages/eve/src/approval/definition.ts:111-127 at #4855). Use ({ response }) => isApprover(response.principal) ? ... here. If line 230's responder is a deliberate context change, list it with the other approval changes.
There was a problem hiding this comment.
The obsolete response-policy example is gone from the current plan; no top-level responder context change is proposed.
|
|
||
| ### Smaller consolidations | ||
|
|
||
| - **Connections:** one ownership field, `principalType: "app" | "user"`; the deprecated |
There was a problem hiding this comment.
This has the deprecation backwards. At #4855, credentialOwner is the preferred field for non-interactive connection auth, and principalType is the one marked @deprecated Use credentialOwner for connection credential ownership (packages/eve/src/shared/connection-types.ts:168-183). Keeping principalType is defensible, since the docs and interactive auth use it, but the doc should say that this reverses the current deprecation and that credentialOwner is what goes.
There was a problem hiding this comment.
The research now explicitly says that choosing principalType reverses the deprecation at #4855.
| fact zod schemas (vendored zod types in `.d.ts`) stay internal. `foldEvents`, `emptySessionView`, | ||
| and `emptyPreviews` are the public fold. Components read the frontend snapshot's `view` instead | ||
| of folding. | ||
| - **Built-in tools:** the 14 `…_INPUT_SCHEMA` / `…_OUTPUT_SCHEMA` constants, which the documented |
There was a problem hiding this comment.
I count 12 public schema constants at #4855, not 14. They're one input/output pair each in public/tools/{bash,read-file,write-file,web-fetch,glob,grep}.ts, and no other public tool entry exports one. That puts Built-in tools at about 49 after, not ~47 (line 81).
There was a problem hiding this comment.
Corrected the statement to 12 public schema constants. The table now also has a separately measured #4954 column rather than deriving all reductions from that earlier estimate.
|
|
||
| ```ts | ||
| // before | ||
| import type { CallRow, SessionView, SessionStreamEvent } from "eve/client"; |
There was a problem hiding this comment.
CallRow isn't importable from eve/client today. The client barrel re-exports #protocol/session-events with export type *, plus only SessionView and SessionPreviews from the projection (packages/eve/src/client/index.ts:108-117 at #4855). Swap in a fact type that's actually re-exported there, so the "before" line compiles. Also check that the 175 count measures the session-events wildcard and not all of eve/events.
There was a problem hiding this comment.
Replaced CallRow in the before import with SessionStarted, which the client wildcard actually re-exported. The audit scope explanation distinguishes event wildcard counts from the whole events entry.
| so `followSubagents` becomes `followAgents`. Both `auto` exports keep their names. | ||
| - **Channel CORS:** `EveChannelCors` merges into `ChannelCors`, which also accepts one origin | ||
| string. | ||
| - **Memory providers:** the keys are named after v26 events hooks now reject; they take names for |
There was a problem hiding this comment.
Not all four keys are named after events hooks reject. turn.started is still in v27's HookEventMap (packages/eve/src/public/definitions/hook.ts:22). Only turn.completed, compaction.requested, and compaction.completed are gone. Maybe say the keys mix one live event name with three retired ones.
There was a problem hiding this comment.
Corrected the wording: one live event name is mixed with three retired v26 names. Memory-key migration stays with its separate PR.
| - Tell the teams whose code imports a removed or moved name: vercel-site's Agent Builder | ||
| (`eve/setup/scaffold`) and agent-factory (`parseLinearWebhookEvent` in a test). |
There was a problem hiding this comment.
This is a public repo, and these lines (and line 404) name internal consumer repos and products. Use generic wording like "known downstream consumers of eve/setup/scaffold and parseLinearWebhookEvent" and keep the specific names in an internal tracker.
There was a problem hiding this comment.
Replaced the named internal consumer/product examples with generic downstream descriptions.
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: OwenKephart <owen.kephart@vercel.com>
…kers Signed-off-by: OwenKephart <owen.kephart@vercel.com>
… gaps Extend the pre-1.0 cleanup plan with findings from an audit of the assembled #4954 surface: types that resolve to packages an app may not have, the AI SDK's experimental decision API in stable signatures, remaining same-name collisions, extension and wire-framing internals, deprecated aliases, one channel and principal vocabulary, naming conventions, importable authoring types, and the checks that keep the surface from drifting. Refresh the counts with measurements at #4954. Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>
51681e8 to
cd0a2f8
Compare
Signed-off-by: owenkephart <owen.kephart@vercel.com> Co-Authored-By: owenkephart <owen.kephart@vercel.com>
Summary
At 1.0, every name eve exports becomes a compatibility promise. Today eve exports 2,005 names over 84 entry points, and docs, apps, and e2e use only about 450 of them. This research doc commits 1.0 to about 1,400 names, one shape per concept, and types that eve owns. It consolidates parallel APIs, gives each name one entry point and one meaning, keeps internal helpers internal, and removes public types that resolve to packages an app may not install. A checked export list makes each new public name a deliberate diff.
The doc puts the changes most apps will notice first, and collapses the rest. Changes to the session stream fold into the v27 stack (#4855) before it merges. This PR is stacked on #4356.
Validation
oxfmtanddocs:checkon the doc.aiand@types/nodetypechecked every entry against declarations emitted at refactor(api)!: curate public exports and own authoring types #4954. WithskipLibCheck: true, 43 exported types or values wereanyor hadanyfields.Review follow-through
The research review now distinguishes settled results from live request status, corrects baseline import/count examples, and uses generic downstream descriptions. It also distinguishes Linear activity signals from cancellation and requires a real decision implementation. The principal migration remains coordinated with Connect.
Checklist
evepackagegit commit --signoff)