eve 0.60.1 → 0.61.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.
- package/CHANGELOG.md +22 -0
- package/dist/src/chunks/{use-eve-agent-Dmc6sX4d.js → use-eve-agent-C5-yqRuq.js} +177 -85
- package/dist/src/chunks/{use-eve-agent-jSR8P4nK.js → use-eve-agent-CVWk5KKy.js} +177 -85
- package/dist/src/cli/agent-command.js +1 -1
- package/dist/src/cli/dev/local-server-child.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/client/client.d.ts +3 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/eve-agent-projection.d.ts +1 -0
- package/dist/src/client/eve-agent-projection.js +1 -1
- package/dist/src/client/eve-agent-store-helpers.js +1 -1
- package/dist/src/client/eve-agent-store-state.d.ts +4 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/message-response.d.ts +5 -0
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/optimistic-message-submissions.d.ts +22 -0
- package/dist/src/client/optimistic-message-submissions.js +1 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +7 -7
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/log-format.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +5 -3
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/types.d.ts +22 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/runs.d.ts +12 -1
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +7 -7
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-3SKHZsSX.js → attribute-changes-A6HfMNG3.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{dist-DearXsdS.js → dist-D38gP7YF.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/frames-QcJfYHmh.js +3 -0
- package/dist/src/compiled/_chunks/workflow/helpers-6kObVbfS.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{logger-CxBCNokg.js → logger-NN5YHpYy.js} +6 -5
- package/dist/src/compiled/_chunks/workflow/{resume-hook-B7_MC7FC.js → resume-hook-CAqlhwic.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-jGFog1uQ.js → run-DJevv8zz.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-VRHEKI6l.js → serialization-C5KgPESk.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/sleep-CbUwdv6O.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-DDJySKt-.js → wait-until-BMY_tOr-.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{ws-transport-CEFNBXPC.js → ws-transport-DSDcKH08.js} +1 -1
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +18 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +5 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/agent-router.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
- package/dist/src/execution/tools/subagent/metadata.js +1 -1
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-runtime-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +1 -0
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/extension-distribution.js +1 -1
- package/dist/src/internal/nitro/host.js +1 -1
- package/dist/src/internal/node-esm-compat-banner.js +3 -3
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/nitro-step-entry.d.ts +1 -0
- package/dist/src/internal/workflow-bundle/nitro-step-entry.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-directive-ast.d.ts +1 -0
- package/dist/src/internal/workflow-bundle/workflow-directive-ast.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +1 -1
- package/dist/src/protocol/message.d.ts +4 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/tools/index.d.ts +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/services/dev-client/agent-info-probe.d.ts +1 -0
- package/dist/src/services/dev-client/agent-info-probe.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/map-concurrent.d.ts +2 -0
- package/dist/src/shared/map-concurrent.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.d.ts +2 -0
- package/dist/src/tools/dynamic.d.ts +1 -0
- package/dist/src/tools/provided/agent-router.d.ts +1 -1
- package/dist/src/tools/provided/agent-router.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +5 -3
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/built-in-tools.md +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +32 -32
- package/docs/guides/client/overview.mdx +2 -0
- package/docs/guides/frontend/overview.mdx +7 -3
- package/docs/reference/typescript-api.md +1 -1
- package/docs/subagents/index.mdx +3 -3
- package/docs/tools/overview.mdx +17 -0
- package/docs/tools/workflows.mdx +46 -23
- package/package.json +7 -7
- package/dist/src/compiled/_chunks/workflow/frames-Bm_yZi8X.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-K7otPd_U.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-60eDbac6.js +0 -1
|
@@ -31,7 +31,9 @@ export declare class Client {
|
|
|
31
31
|
* shape). Inspection is best-effort: a working connection does not depend on
|
|
32
32
|
* this route, so connection probes treat this distinctly from a failed request.
|
|
33
33
|
*/
|
|
34
|
-
info(
|
|
34
|
+
info(options?: {
|
|
35
|
+
readonly signal?: AbortSignal;
|
|
36
|
+
}): Promise<AgentInfoResult>;
|
|
35
37
|
/**
|
|
36
38
|
* Performs an authenticated fetch against a path on this eve target.
|
|
37
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_HEALTH_ROUTE_PATH,EVE_INFO_ROUTE_PATH}from"#protocol/routes.js";import{encodeBasicCredentials}from"#internal/http/basic-auth.js";import{AgentInfoResponseError}from"#client/agent-info-error.js";import{HealthResponseError}from"#client/health-response-error.js";import{HealthResultSchema}from"#client/health-schema.js";import{AgentInfoResultSchema}from"#client/agent-info-schema.js";import{ClientError}from"#client/client-error.js";import{ClientSessions}from"#client/sessions.js";import{createClientUrl}from"#client/url.js";import{VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER}from"#client/types.js";var Client=class{#e;#t;#n;#r;sessions;constructor(e){this.#n=e.host,this.#e=e.auth,this.#t=e.headers,this.#r=e.redirect,this.sessions=new ClientSessions({host:this.#n,redirect:this.#r,resolveHeaders:e=>this.#i(e)})}async health(){let e=createClientUrl(this.#n,EVE_HEALTH_ROUTE_PATH),t=await this.#i(),n=await fetch(e,withRedirectPolicy({headers:t},this.#r));if(!n.ok){let e=await n.text();throw new ClientError(n.status,e,n.headers)}let r;try{r=await n.json()}catch{throw new HealthResponseError}let i=HealthResultSchema.safeParse(r);if(!i.success)throw new HealthResponseError(i.error.issues.slice(0,5).map(e=>{let t=e.path.join(`.`);return t.length===0?e.message:`${t}: ${e.message}`}));return i.data}async info(){let
|
|
1
|
+
import{EVE_HEALTH_ROUTE_PATH,EVE_INFO_ROUTE_PATH}from"#protocol/routes.js";import{encodeBasicCredentials}from"#internal/http/basic-auth.js";import{AgentInfoResponseError}from"#client/agent-info-error.js";import{HealthResponseError}from"#client/health-response-error.js";import{HealthResultSchema}from"#client/health-schema.js";import{AgentInfoResultSchema}from"#client/agent-info-schema.js";import{ClientError}from"#client/client-error.js";import{ClientSessions}from"#client/sessions.js";import{createClientUrl}from"#client/url.js";import{VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER}from"#client/types.js";var Client=class{#e;#t;#n;#r;sessions;constructor(e){this.#n=e.host,this.#e=e.auth,this.#t=e.headers,this.#r=e.redirect,this.sessions=new ClientSessions({host:this.#n,redirect:this.#r,resolveHeaders:e=>this.#i(e)})}async health(){let e=createClientUrl(this.#n,EVE_HEALTH_ROUTE_PATH),t=await this.#i(),n=await fetch(e,withRedirectPolicy({headers:t},this.#r));if(!n.ok){let e=await n.text();throw new ClientError(n.status,e,n.headers)}let r;try{r=await n.json()}catch{throw new HealthResponseError}let i=HealthResultSchema.safeParse(r);if(!i.success)throw new HealthResponseError(i.error.issues.slice(0,5).map(e=>{let t=e.path.join(`.`);return t.length===0?e.message:`${t}: ${e.message}`}));return i.data}async info(e={}){let t=await this.fetch(EVE_INFO_ROUTE_PATH,e);if(!t.ok){let e=await t.text();throw new ClientError(t.status,e,t.headers)}let n;try{n=await t.json()}catch{throw new AgentInfoResponseError}let r=AgentInfoResultSchema.safeParse(n);if(!r.success)throw new AgentInfoResponseError(r.error.issues.slice(0,5).map(e=>{let t=e.path.join(`.`);return t.length===0?e.message:`${t}: ${e.message}`}));return r.data}async fetch(e,t={}){let n=createClientUrl(this.#n,e),r=await this.#i(headersInitToRecord(t.headers));return await fetch(n,withRedirectPolicy({...t,headers:r},this.#r))}async#i(e){let t=new Headers,[n,r]=await Promise.all([resolveHeadersValue(this.#t),this.#a()]);for(let[e,r]of Object.entries(n))t.set(e,r);for(let[e,n]of Object.entries(r))t.set(e,n);if(e)for(let[n,r]of Object.entries(e))t.set(n,r);return t}async#a(){let e=this.#e;if(!e)return{};if(`vercelOidc`in e){let t=(await resolveTokenValue(e.vercelOidc.token)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`,[VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER]:t}}if(`bearer`in e){let t=(await resolveTokenValue(e.bearer)).trim();return t.length===0?{}:{authorization:`Bearer ${t}`}}if(`basic`in e){let t=await resolveTokenValue(e.basic.password);return{authorization:`Basic ${encodeBasicCredentials(e.basic.username,t)}`}}return{}}};async function resolveTokenValue(e){return typeof e==`function`?e():e}async function resolveHeadersValue(e){return e===void 0?{}:typeof e==`function`?await e():e}function headersInitToRecord(e){return e===void 0?{}:Object.fromEntries(new Headers(e).entries())}function withRedirectPolicy(e,t){return t===void 0?e:{...e,redirect:t}}export{Client};
|
|
@@ -6,5 +6,6 @@ export declare class EveAgentProjection<TData> {
|
|
|
6
6
|
get data(): TData;
|
|
7
7
|
reset(): void;
|
|
8
8
|
append(event: EveAgentReducerEvent): void;
|
|
9
|
+
remove(predicate: (event: EveAgentReducerEvent) => boolean): void;
|
|
9
10
|
replace(predicate: (event: EveAgentReducerEvent) => boolean, replacement: EveAgentReducerEvent): void;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var EveAgentProjection=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=t,this.#n=this.#r()}get data(){return this.#n}reset(){this.#t=[],this.#n=this.#e.initial()}append(e){this.#t=[...this.#t,e],this.#n=this.#e.reduce(this.#n,e)}replace(e,t){let n=this.#t.findIndex(e);this.#t=n===-1?[...this.#t,t]:this.#t.map((e,r)=>r===n?t:e),this.#n=this.#r()}#r(){let e=this.#e.initial();for(let t of this.#t)e=this.#e.reduce(e,t);return e}};export{EveAgentProjection};
|
|
1
|
+
var EveAgentProjection=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=t,this.#n=this.#r()}get data(){return this.#n}reset(){this.#t=[],this.#n=this.#e.initial()}append(e){this.#t=[...this.#t,e],this.#n=this.#e.reduce(this.#n,e)}remove(e){this.#t=this.#t.filter(t=>!e(t)),this.#n=this.#r()}replace(e,t){let n=this.#t.findIndex(e);this.#t=n===-1?[...this.#t,t]:this.#t.map((e,r)=>r===n?t:e),this.#n=this.#r()}#r(){let e=this.#e.initial();for(let t of this.#t)e=this.#e.reduce(e,t);return e}};export{EveAgentProjection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{updatePendingAuthorizations}from"#client/session-utils.js";function isSettledSessionTail(e){let t=e.at(-1);return t!==void 0&&isCurrentTurnBoundaryEvent(t)&&(t.type!==`session.waiting`||collectPendingAuthorizations(e).size===0)}function collectPendingAuthorizations(e){let t=new Set;for(let n of e)updatePendingAuthorizations(t,n);return t}function assertExclusiveTurnInput(e){if(e.message!==void 0==(e.inputResponses!==void 0))throw Error(`A turn requires exactly one of message or inputResponses.`)}let submissionSequence=0;function createSubmissionId(){let e=globalThis.crypto?.randomUUID;return e===void 0?(submissionSequence+=1,`submission_${submissionSequence.toString()}`):e.call(globalThis.crypto)}function createAbortSignal(e,t){return e?AbortSignal.any([e,t]):t}function summarizeUserContent(e){if(typeof e==`string`)return e;let t=[];for(let n of e)n.type===`text`?t.push(n.text):n.type===`file`&&t.push(n.filename?`[file: ${n.filename}]`:`[file]`);return t.join(`
|
|
2
|
-
`)}function isAbortError(e){return e instanceof Error&&e.name===`AbortError`}function toTerminalStreamFailureError(e){if(e.type!==`session.failed`)return;let t=Error(e.data.message);return t.name=e.data.code,t}function createActiveTurn(e){let t=Promise.withResolvers(),n=Promise.withResolvers(),r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>e(r),completion:n.promise,followUpDispatches:new Set,receivedFollowUps:0,receivedFollowUpEvents:new
|
|
2
|
+
`)}function isAbortError(e){return e instanceof Error&&e.name===`AbortError`}function toTerminalStreamFailureError(e){if(e.type!==`session.failed`)return;let t=Error(e.data.message);return t.name=e.data.code,t}function createActiveTurn(e){let t=Promise.withResolvers(),n=Promise.withResolvers(),r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>e(r),completion:n.promise,followUpDispatches:new Set,receivedFollowUps:0,receivedFollowUpEvents:new Map,followUpSubmissionIds:new Set,resolveCompletion:n.resolve,response:t.promise,resolveResponse:t.resolve};return r}async function followSteeredTurns(e,t,n){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(!(e.receivedFollowUps>=e.acceptedFollowUps))for await(let r of t){if(!n())return;if(e.receivedFollowUps+=e.receivedFollowUpEvents.get(r)??0,e.receivedFollowUpEvents.delete(r),isCurrentTurnBoundaryEvent(r)){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(e.receivedFollowUps>=e.acceptedFollowUps)return}}}async function waitWithSignal(e,t){if(t===void 0)return await e;let n=Promise.withResolvers(),onAbort=()=>n.reject(t.reason);t.addEventListener(`abort`,onAbort,{once:!0}),t.aborted&&onAbort();try{return await Promise.race([n.promise,e])}finally{t.removeEventListener(`abort`,onAbort)}}export{assertExclusiveTurnInput,collectPendingAuthorizations,createAbortSignal,createActiveTurn,createSubmissionId,followSteeredTurns,isAbortError,isSettledSessionTail,summarizeUserContent,toTerminalStreamFailureError,waitWithSignal};
|
|
@@ -54,8 +54,11 @@ export interface EveAgentStoreInit<TData> {
|
|
|
54
54
|
}
|
|
55
55
|
export interface PendingMessageSubmission {
|
|
56
56
|
readonly createdAt: number;
|
|
57
|
+
readonly eventStartIndex: number;
|
|
57
58
|
readonly id: string;
|
|
58
59
|
readonly message: string;
|
|
60
|
+
readonly requiresDeliveryId: boolean;
|
|
61
|
+
readonly deliveryId?: string;
|
|
59
62
|
}
|
|
60
63
|
export interface ActiveTurn {
|
|
61
64
|
readonly abortController: AbortController;
|
|
@@ -64,7 +67,7 @@ export interface ActiveTurn {
|
|
|
64
67
|
readonly completion: Promise<void>;
|
|
65
68
|
readonly followUpDispatches: Set<Promise<void>>;
|
|
66
69
|
receivedFollowUps: number;
|
|
67
|
-
readonly receivedFollowUpEvents:
|
|
70
|
+
readonly receivedFollowUpEvents: Map<MessageStreamEvent, number>;
|
|
68
71
|
readonly followUpSubmissionIds: Set<string>;
|
|
69
72
|
readonly resolveCompletion: () => void;
|
|
70
73
|
readonly response: Promise<MessageResponse | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toError}from"#shared/errors.js";import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{updatePendingAuthorizations}from"#client/session-utils.js";import{Client}from"#client/client.js";import{consumeMessageResponse}from"#client/message-response.js";import{SessionEventStream}from"#client/session-event-stream.js";import{EveAgentProjection}from"#client/eve-agent-projection.js";import{assertExclusiveTurnInput,createAbortSignal,createActiveTurn,createSubmissionId,followSteeredTurns,isAbortError,isSettledSessionTail,summarizeUserContent,toTerminalStreamFailureError,waitWithSignal}from"#client/eve-agent-store-helpers.js";const detachStore=Symbol(`detachEveAgentStore`),attachStore=Symbol(`attachEveAgentStore`);var EveAgentStore=class{#e;#t;#n=!1;#r;#i=new Set;#a;#o;#s;#c=new Set;#l=createEventDeduper();#u;#d={};#f;#p;#m=[];#h=0;#g;#_;#v;#y;#b;#x=`ready`;constructor(e){this.#t=e.prewarm??!1,this.#a=e.session!==void 0,this.#e=this.#a?void 0:new Client({auth:e.auth,headers:e.headers,host:e.host??``});let t=[];for(let n of e.initialEvents??[])this.#l.admit(n)&&t.push(n),updatePendingAuthorizations(this.#i,n);this.#p=t,this.#s=new EveAgentProjection(e.reducer,this.#p),this.#o=e.optimistic??!0,this.#y=e.session??(e.initialSession===void 0?void 0:this.#e?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex})),this.#b=this.#I()}get snapshot(){return this.#b}setCallbacks(e){this.#d=e}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}prewarm(){if(this.#g!==void 0)return this.#g;if(this.#y!==void 0||this.#a)return Promise.resolve();if(this.#u!==void 0)return this.#u.response.then(e=>{if(e===void 0)throw this.#f??new DOMException(`Session creation was aborted.`,`AbortError`)});let e=this.#e;if(e===void 0)return Promise.reject(Error(`This eve agent store does not own a session client.`));let t=this.#h,n=new AbortController;this.#_=n;let r=(async()=>{try{let r=await e.sessions.create({signal:n.signal});if(t!==this.#h)return;this.#y=r.session,this.#f=void 0,this.#x===`error`&&(this.#x=`ready`),this.#d.onSessionChange?.(r.session.state),this.#L(),this.#E()}catch(e){throw t===this.#h&&this.#u===void 0&&this.#f===void 0&&(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f),this.#L()),e}})();this.#g=r;let clear=()=>{this.#g===r&&(this.#g=void 0,this.#_=void 0)};return r.then(clear,clear),r}async send(e){return await this.#S(e,this.#d.prepareSend)}async#S(e,t){if(this.#u!==void 0){if(this.#x===`resuming`)throw Error(`eve session is resuming.`);return await this.#w(this.#u,e,t)}let n=createActiveTurn(e=>e.acceptedFollowUps>0&&this.#y!==void 0?this.#y.cancel():e.response.then(e=>e===void 0?{status:`no_active_turn`}:e.cancel()));this.#u=n,this.#f=void 0,this.#x=`submitted`,this.#L();let r;try{let i=await(t===void 0?e:waitWithSignal(Promise.resolve(t(e)),createAbortSignal(e.signal,n.abortController.signal)));if(assertExclusiveTurnInput(i),!this.#k(n))return;this.#A(i),this.#j(i),this.#L();let a={...i,signal:createAbortSignal(i.signal,n.abortController.signal)},o=await this.#T(a),s=o.response;if(r=o.reader,!this.#k(n))return;n.resolveResponse(s);for await(let e of consumeMessageResponse(s,r)){if(!this.#k(n))return;n.receivedFollowUpEvents.delete(e)&&(n.receivedFollowUps+=1)}if(!this.#k(n)||(await followSteeredTurns(n,r,()=>this.#k(n)),!this.#k(n)))return;this.#x=this.#f===void 0?`ready`:`error`}catch(e){if(!this.#k(n))return;if(isAbortError(e))this.#x=`ready`,this.#F(toError(e));else{let t=this.#f!==void 0;this.#f??=toError(e),this.#x=`error`,this.#F(this.#f),t||this.#d.onError?.(this.#f)}}finally{r?.[Symbol.dispose](),this.#O(n)}}resume(){if(this.#v!==void 0)return this.#v;let e=this.#C();this.#v=e;let clear=()=>{this.#v===e&&(this.#v=void 0)};return e.then(clear,clear),e}async#C(){if(this.#x===`resuming`||this.#x===`streaming`||this.#x===`submitted`)throw Error(`eve session is already processing a turn.`);if(this.#y===void 0)throw Error(`An eve session is required before resuming.`);let e=this.#y,t=createActiveTurn(()=>e.cancel());this.#u=t,t.resolveResponse(void 0),this.#f=void 0,this.#x=`resuming`,this.#L();try{let n=this.#E({catchUp:!0,startIndex:this.#p.length===e.state.streamIndex?e.state.streamIndex:0});using r=n.subscribe(t.abortController.signal);if(await n.caughtUp,!this.#k(t))return;r.discard();let i=this.#p.at(-1);if(i!==void 0&&this.#P(i),i!==void 0&&this.#f===void 0&&!isSettledSessionTail(this.#p)){this.#x=`streaming`,this.#L();for await(let e of r){if(!this.#k(t))return;if(t.receivedFollowUpEvents.delete(e)&&(t.receivedFollowUps+=1),isCurrentTurnBoundaryEvent(e)&&this.#i.size===0)break}}await followSteeredTurns(t,r,()=>this.#k(t)),this.#k(t)&&(this.#x=this.#f===void 0?`ready`:`error`)}catch(e){if(!this.#k(t))return;isAbortError(e)?this.#x=`ready`:(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f))}finally{this.#O(t)}}cancel(){let e=this.#u;return e===void 0?this.#x===`streaming`&&this.#y!==void 0?this.#y.cancel():Promise.resolve({status:`no_active_turn`}):e.cancel()}[attachStore](){this.#n=!0,this.#t&&this.#y===void 0&&this.prewarm().catch(()=>{})}[detachStore](){this.#n=!1,this.#r?.close(),this.#r=void 0,this.#u?.abortController.abort(),this.#D(),this.#v=void 0}reset(){this.#r?.close(),this.#r=void 0,this.#i.clear();let e=this.#u;this.#u=void 0,e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),this.#D(),this.#v=void 0,this.#a||(this.#y=void 0),this.#p=[],this.#l=createEventDeduper(),this.#m=[],this.#s.reset(),this.#f=void 0,this.#x=`ready`,this.#d.onSessionChange?.(this.#y?.state),this.#L(),this.#t&&this.#n&&this.prewarm().catch(()=>{})}async#w(e,t,n){if(t.message===void 0||t.turnPolicy!==`steer`)throw Error(`eve session is already processing a turn. Send a message with turnPolicy: "steer" to guide it at the next boundary.`);let r=this.#h,i=createAbortSignal(t.signal,e.abortController.signal),a=await waitWithSignal(Promise.resolve(n?.(t)),i)??t;if(r!==this.#h)return;if(assertExclusiveTurnInput(a),a.message===void 0||a.turnPolicy!==`steer`)throw Error(`An in-flight follow-up requires a message with turnPolicy: "steer".`);if(!this.#k(e))return await this.#S(a);let o=this.#A(a);o!==void 0&&e.followUpSubmissionIds.add(o),this.#L(),this.#E({headers:a.headers,streamReconnectPolicy:a.streamReconnectPolicy});let s;s=(async()=>{try{let t=createAbortSignal(a.signal,e.abortController.signal);if(await waitWithSignal(e.response,t),!this.#k(e)||this.#y===void 0)throw Error(`The active eve turn ended before the follow-up could be sent.`);let{message:n,...r}=a;await this.#y.send(n,{...r,signal:t}),e.acceptedFollowUps+=1}catch(t){throw this.#k(e)&&(this.#F(toError(t),o),this.#L()),t}finally{e.followUpDispatches.delete(s)}})(),e.followUpDispatches.add(s),await s,await e.completion}async#T(e){let t={headers:e.headers,streamReconnectPolicy:e.streamReconnectPolicy};if(this.#g!==void 0&&(await waitWithSignal(this.#g.catch(e=>{if(this.#y!==void 0)throw e}),e.signal),e.signal?.throwIfAborted()),this.#y===void 0){if(this.#e===void 0)throw Error(`An external eve session is required before sending.`);if(e.message===void 0)throw Error(`Cannot answer an input request before the session starts.`);let n=await this.#e.sessions.create({...e,message:e.message});return e.signal?.throwIfAborted(),this.#y=n.session,this.#d.onSessionChange?.(n.session.state),this.#L(),{response:n.response,reader:this.#E(t).subscribe(e.signal)}}let n=this.#E(t).subscribe(e.signal);try{if(e.inputResponses===void 0){let{message:t,...r}=e;return{response:await this.#y.send(t,r),reader:n}}let{inputResponses:t,...r}=e;return{response:await this.#y.respond(t,r),reader:n}}catch(e){throw n[Symbol.dispose](),e}}#E(e={}){if(this.#r!==void 0&&!this.#r.ended)return this.#r.setOptions(e),this.#r;if(this.#y===void 0)throw Error(`A session is required before opening its stream.`);let t=this.#y,n=this.#h;return this.#r=new SessionEventStream(t,{...e,onEvent:e=>{n===this.#h&&this.#M(e)},onError:e=>{n===this.#h&&(this.#r=void 0,this.#u===void 0&&(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f),this.#L()))}}),this.#r}#D(){this.#h+=1,this.#_?.abort(),this.#_=void 0,this.#g=void 0}#O(e){if(this.#k(e)){e.resolveResponse(void 0),this.#u=void 0;try{this.#d.onSessionChange?.(this.#y?.state),this.#L(),this.#d.onFinish?.(this.#b)}finally{e.resolveCompletion()}}}#k(e){return this.#u===e}#A(e){if(e.message===void 0)return;let t=createSubmissionId(),n={createdAt:Date.now(),id:t,message:summarizeUserContent(e.message)};return this.#m=[...this.#m,n],this.#o&&this.#s.append({data:{createdAt:n.createdAt,message:n.message,submissionId:n.id},type:`client.message.submitted`}),t}#j(e){e.inputResponses!==void 0&&e.inputResponses.length!==0&&this.#s.append({data:{createdAt:Date.now(),responses:e.inputResponses},type:`client.input.responded`})}#M(e){if(!this.#l.admit(e))return;let t=this.#x===`streaming`;updatePendingAuthorizations(this.#i,e),this.#p=[...this.#p,e],this.#N(e),this.#d.onEvent?.(e),this.#P(e);let n=isCurrentTurnBoundaryEvent(e)&&this.#i.size===0;this.#x!==`resuming`&&this.#f===void 0&&(`data`in e&&`turnId`in e.data&&(this.#x=`streaming`),this.#u===void 0&&n&&(this.#x=`ready`)),this.#d.onSessionChange?.(this.#y?.state),this.#L(),this.#u===void 0&&t&&n&&this.#d.onFinish?.(this.#b)}#N(e){let t=this.#m[0];if(e.type===`message.received`&&t!==void 0){let n=t.id;this.#u?.followUpSubmissionIds.delete(n)&&this.#u.receivedFollowUpEvents.add(e),this.#m=this.#m.slice(1),this.#s.replace(e=>e.type===`client.message.submitted`&&e.data.submissionId===n,e);return}this.#s.append(e)}#P(e){let t=toTerminalStreamFailureError(e);t!==void 0&&(this.#x=`error`,this.#F(t),this.#f===void 0&&(this.#f=t,this.#d.onError?.(t)))}#F(e,t){let n=t===void 0?this.#m[0]:this.#m.find(e=>e.id===t);n!==void 0&&(this.#m=this.#m.filter(e=>e.id!==n.id),this.#s.replace(e=>e.type===`client.message.submitted`&&e.data.submissionId===n.id,{data:{createdAt:n.createdAt,error:{message:e.message},message:n.message,submissionId:n.id},type:`client.message.failed`}))}#I(){return{data:this.#s.data,error:this.#f,events:this.#p,session:this.#y?.state,status:this.#x}}#L(){this.#b=this.#I();for(let e of this.#c)e()}};function detachEveAgentStore(e){e[detachStore]()}function attachEveAgentStore(e){e[attachStore]()}export{EveAgentStore,attachEveAgentStore,detachEveAgentStore};
|
|
1
|
+
import{toError}from"#shared/errors.js";import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{updatePendingAuthorizations}from"#client/session-utils.js";import{Client}from"#client/client.js";import{consumeMessageResponse,getMessageResponseDeliveryId}from"#client/message-response.js";import{SessionEventStream}from"#client/session-event-stream.js";import{EveAgentProjection}from"#client/eve-agent-projection.js";import{OptimisticMessageSubmissions}from"#client/optimistic-message-submissions.js";import{assertExclusiveTurnInput,createAbortSignal,createActiveTurn,followSteeredTurns,isAbortError,isSettledSessionTail,toTerminalStreamFailureError,waitWithSignal}from"#client/eve-agent-store-helpers.js";const detachStore=Symbol(`detachEveAgentStore`),attachStore=Symbol(`attachEveAgentStore`);var EveAgentStore=class{#e;#t;#n=!1;#r;#i=new Set;#a;#o;#s;#c=new Set;#l=createEventDeduper();#u;#d={};#f;#p;#m;#h=0;#g;#_;#v;#y;#b;#x=`ready`;constructor(e){this.#t=e.prewarm??!1,this.#a=e.session!==void 0,this.#e=this.#a?void 0:new Client({auth:e.auth,headers:e.headers,host:e.host??``});let t=[];for(let n of e.initialEvents??[])this.#l.admit(n)&&t.push(n),updatePendingAuthorizations(this.#i,n);this.#p=t,this.#s=new EveAgentProjection(e.reducer,this.#p),this.#o=e.optimistic??!0,this.#m=new OptimisticMessageSubmissions(this.#s,this.#o),this.#y=e.session??(e.initialSession===void 0?void 0:this.#e?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex})),this.#b=this.#P()}get snapshot(){return this.#b}setCallbacks(e){this.#d=e}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}prewarm(){if(this.#g!==void 0)return this.#g;if(this.#y!==void 0||this.#a)return Promise.resolve();if(this.#u!==void 0)return this.#u.response.then(e=>{if(e===void 0)throw this.#f??new DOMException(`Session creation was aborted.`,`AbortError`)});let e=this.#e;if(e===void 0)return Promise.reject(Error(`This eve agent store does not own a session client.`));let t=this.#h,n=new AbortController;this.#_=n;let r=(async()=>{try{let r=await e.sessions.create({signal:n.signal});if(t!==this.#h)return;this.#y=r.session,this.#f=void 0,this.#x===`error`&&(this.#x=`ready`),this.#d.onSessionChange?.(r.session.state),this.#F(),this.#E()}catch(e){throw t===this.#h&&this.#u===void 0&&this.#f===void 0&&(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f),this.#F()),e}})();this.#g=r;let clear=()=>{this.#g===r&&(this.#g=void 0,this.#_=void 0)};return r.then(clear,clear),r}async send(e){return await this.#S(e,this.#d.prepareSend)}async#S(e,t){if(this.#u!==void 0){if(this.#x===`resuming`)throw Error(`eve session is resuming.`);return await this.#w(this.#u,e,t)}let n=createActiveTurn(e=>e.acceptedFollowUps>0&&this.#y!==void 0?this.#y.cancel():e.response.then(e=>e===void 0?{status:`no_active_turn`}:e.cancel()));this.#u=n,this.#f=void 0,this.#x=`submitted`,this.#F();let r;try{let i=await(t===void 0?e:waitWithSignal(Promise.resolve(t(e)),createAbortSignal(e.signal,n.abortController.signal)));if(assertExclusiveTurnInput(i),!this.#k(n))return;let a=this.#m.submit(i,this.#p.length);this.#A(i),this.#F();let o={...i,signal:createAbortSignal(i.signal,n.abortController.signal)},s=await this.#T(o),c=s.response;if(r=s.reader,!this.#k(n))return;n.resolveResponse(c),this.#M(this.#m.correlate(a,getMessageResponseDeliveryId(c),this.#p))&&this.#F();for await(let e of consumeMessageResponse(c,r)){if(!this.#k(n))return;n.receivedFollowUps+=n.receivedFollowUpEvents.get(e)??0,n.receivedFollowUpEvents.delete(e)}if(!this.#k(n)||(await followSteeredTurns(n,r,()=>this.#k(n)),!this.#k(n)))return;this.#x=this.#f===void 0?`ready`:`error`}catch(e){if(!this.#k(n))return;if(isAbortError(e))this.#x=`ready`,this.#m.fail(toError(e));else{let t=this.#f!==void 0;this.#f??=toError(e),this.#x=`error`,this.#m.fail(this.#f),t||this.#d.onError?.(this.#f)}}finally{r?.[Symbol.dispose](),this.#O(n)}}resume(){if(this.#v!==void 0)return this.#v;let e=this.#C();this.#v=e;let clear=()=>{this.#v===e&&(this.#v=void 0)};return e.then(clear,clear),e}async#C(){if(this.#x===`resuming`||this.#x===`streaming`||this.#x===`submitted`)throw Error(`eve session is already processing a turn.`);if(this.#y===void 0)throw Error(`An eve session is required before resuming.`);let e=this.#y,t=createActiveTurn(()=>e.cancel());this.#u=t,t.resolveResponse(void 0),this.#f=void 0,this.#x=`resuming`,this.#F();try{let n=this.#E({catchUp:!0,startIndex:this.#p.length===e.state.streamIndex?e.state.streamIndex:0});using r=n.subscribe(t.abortController.signal);if(await n.caughtUp,!this.#k(t))return;r.discard();let i=this.#p.at(-1);if(i!==void 0&&this.#N(i),i!==void 0&&this.#f===void 0&&!isSettledSessionTail(this.#p)){this.#x=`streaming`,this.#F();for await(let e of r){if(!this.#k(t))return;if(t.receivedFollowUps+=t.receivedFollowUpEvents.get(e)??0,t.receivedFollowUpEvents.delete(e),isCurrentTurnBoundaryEvent(e)&&this.#i.size===0)break}}await followSteeredTurns(t,r,()=>this.#k(t)),this.#k(t)&&(this.#x=this.#f===void 0?`ready`:`error`)}catch(e){if(!this.#k(t))return;isAbortError(e)?this.#x=`ready`:(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f))}finally{this.#O(t)}}cancel(){let e=this.#u;return e===void 0?this.#x===`streaming`&&this.#y!==void 0?this.#y.cancel():Promise.resolve({status:`no_active_turn`}):e.cancel()}[attachStore](){this.#n=!0,this.#t&&this.#y===void 0&&this.prewarm().catch(()=>{})}[detachStore](){this.#n=!1,this.#r?.close(),this.#r=void 0,this.#u?.abortController.abort(),this.#D(),this.#v=void 0}reset(){this.#r?.close(),this.#r=void 0,this.#i.clear();let e=this.#u;this.#u=void 0,e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),this.#D(),this.#v=void 0,this.#a||(this.#y=void 0),this.#p=[],this.#l=createEventDeduper(),this.#m.reset(),this.#s.reset(),this.#f=void 0,this.#x=`ready`,this.#d.onSessionChange?.(this.#y?.state),this.#F(),this.#t&&this.#n&&this.prewarm().catch(()=>{})}async#w(e,t,n){if(t.message===void 0||t.turnPolicy!==`steer`)throw Error(`eve session is already processing a turn. Send a message with turnPolicy: "steer" to guide it at the next boundary.`);let r=this.#h,i=createAbortSignal(t.signal,e.abortController.signal),a=await waitWithSignal(Promise.resolve(n?.(t)),i)??t;if(r!==this.#h)return;if(assertExclusiveTurnInput(a),a.message===void 0||a.turnPolicy!==`steer`)throw Error(`An in-flight follow-up requires a message with turnPolicy: "steer".`);if(!this.#k(e))return await this.#S(a);let o=this.#m.submit(a,this.#p.length);o!==void 0&&e.followUpSubmissionIds.add(o),this.#F(),this.#E({headers:a.headers,streamReconnectPolicy:a.streamReconnectPolicy});let s;s=(async()=>{try{let t=createAbortSignal(a.signal,e.abortController.signal);if(await waitWithSignal(e.response,t),!this.#k(e)||this.#y===void 0)throw Error(`The active eve turn ended before the follow-up could be sent.`);let{message:n,...r}=a,i=await this.#y.send(n,{...r,signal:t});e.acceptedFollowUps+=1,this.#M(this.#m.correlate(o,getMessageResponseDeliveryId(i),this.#p))&&this.#F()}catch(t){throw this.#k(e)&&(this.#m.fail(toError(t),o),this.#F()),t}finally{e.followUpDispatches.delete(s)}})(),e.followUpDispatches.add(s),await s,await e.completion}async#T(e){let t={headers:e.headers,streamReconnectPolicy:e.streamReconnectPolicy};if(this.#g!==void 0&&(await waitWithSignal(this.#g.catch(e=>{if(this.#y!==void 0)throw e}),e.signal),e.signal?.throwIfAborted()),this.#y===void 0){if(this.#e===void 0)throw Error(`An external eve session is required before sending.`);if(e.message===void 0)throw Error(`Cannot answer an input request before the session starts.`);let n=await this.#e.sessions.create({...e,message:e.message});return e.signal?.throwIfAborted(),this.#y=n.session,this.#d.onSessionChange?.(n.session.state),this.#F(),{response:n.response,reader:this.#E(t).subscribe(e.signal)}}let n=this.#E(t).subscribe(e.signal);try{if(e.inputResponses===void 0){let{message:t,...r}=e;return{response:await this.#y.send(t,r),reader:n}}let{inputResponses:t,...r}=e;return{response:await this.#y.respond(t,r),reader:n}}catch(e){throw n[Symbol.dispose](),e}}#E(e={}){if(this.#r!==void 0&&!this.#r.ended)return this.#r.setOptions(e),this.#r;if(this.#y===void 0)throw Error(`A session is required before opening its stream.`);let t=this.#y,n=this.#h;return this.#r=new SessionEventStream(t,{...e,onEvent:e=>{n===this.#h&&this.#j(e)},onError:e=>{n===this.#h&&(this.#r=void 0,this.#u===void 0&&(this.#f=toError(e),this.#x=`error`,this.#d.onError?.(this.#f),this.#F()))}}),this.#r}#D(){this.#h+=1,this.#_?.abort(),this.#_=void 0,this.#g=void 0}#O(e){if(this.#k(e)){e.resolveResponse(void 0),this.#u=void 0;try{this.#d.onSessionChange?.(this.#y?.state),this.#F(),this.#d.onFinish?.(this.#b)}finally{e.resolveCompletion()}}}#k(e){return this.#u===e}#A(e){e.inputResponses!==void 0&&e.inputResponses.length!==0&&this.#s.append({data:{createdAt:Date.now(),responses:e.inputResponses},type:`client.input.responded`})}#j(e){if(!this.#l.admit(e))return;let t=this.#x===`streaming`;updatePendingAuthorizations(this.#i,e),this.#p=[...this.#p,e],this.#M(this.#m.apply(e)),this.#d.onEvent?.(e),this.#N(e);let n=isCurrentTurnBoundaryEvent(e)&&this.#i.size===0;this.#x!==`resuming`&&this.#f===void 0&&(`data`in e&&`turnId`in e.data&&(this.#x=`streaming`),this.#u===void 0&&n&&(this.#x=`ready`)),this.#d.onSessionChange?.(this.#y?.state),this.#F(),this.#u===void 0&&t&&n&&this.#d.onFinish?.(this.#b)}#M(e){if(e===void 0)return!1;let t=0;for(let n of e.ids)this.#u?.followUpSubmissionIds.delete(n)&&(t+=1);if(t>0&&this.#u!==void 0){if(e.alreadyProjected)this.#u.receivedFollowUps+=t;else{let n=this.#u.receivedFollowUpEvents.get(e.event)??0;this.#u.receivedFollowUpEvents.set(e.event,n+t)}}return!0}#N(e){let t=toTerminalStreamFailureError(e);t!==void 0&&(this.#x=`error`,this.#m.failAll(t),this.#f===void 0&&(this.#f=t,this.#d.onError?.(t)))}#P(){return{data:this.#s.data,error:this.#f,events:this.#p,session:this.#y?.state,status:this.#x}}#F(){this.#b=this.#P();for(let e of this.#c)e()}};function detachEveAgentStore(e){e[detachStore]()}function attachEveAgentStore(e){e[attachStore]()}export{EveAgentStore,attachEveAgentStore,detachEveAgentStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAuthorizationCompletedPart,createAuthorizationRequiredPart}from"#client/authorization-message-parts.js";import{approvedApproval,createToolMetadata,mergeToolMetadata,normalizeActionRequest,normalizeActionResult,stringifyUnknown,toMessageInputRequest}from"#client/message-action-parts.js";import{optimisticUserMessageId,partKey,projectReceivedParts,removeStreamingToolPartsForTurn,upsertMessage}from"#client/message-reducer-primitives.js";import{messageRun}from"#client/message-run-parts.js";function defaultMessageReducer(){return{initial(){return{messages:[]}},reduce(e,t){return reduceMessageData(e,t)}}}function reduceMessageData(e,t){switch(t.type){case`client.message.submitted`:return upsertMessage(e,{id:optimisticUserMessageId(t.data.submissionId),metadata:{optimistic:!0,status:`submitted`},parts:[{type:`text`,text:t.data.message}],role:`user`});case`client.message.failed`:return upsertMessage(e,{id:optimisticUserMessageId(t.data.submissionId),metadata:{optimistic:!0,status:`failed`},parts:[{type:`text`,text:t.data.message}],role:`user`});case`client.input.responded`:{let n=e;for(let e of t.data.responses)n=respondToInputRequest(n,e);return n}case`input.resolved`:{let n=e;for(let e of t.data.resolutions)n=resolveInputRequest(n,e);return n}case`message.received`:return upsertMessage(e,{id:`${t.data.turnId}:user`,metadata:{status:`complete`,turnId:t.data.turnId},parts:projectReceivedParts(t.data.parts,t.data.message),role:`user`});case`step.started`:return updateAssistantMessage(e,t.data.turnId,e=>ensureStepStartPart(e,t.data.stepIndex));case`reasoning.appended`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.append(ensureStepStartPart(e,t.data.stepIndex),{delta:t.data.reasoningDelta,stepIndex:t.data.stepIndex,type:`reasoning`}));case`reasoning.completed`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.upsert(ensureStepStartPart(e,t.data.stepIndex),{state:`done`,stepIndex:t.data.stepIndex,text:t.data.reasoning,type:`reasoning`}));case`action.input.appended`:{let n=findToolPart(e,t.data.callId);if(n!==void 0&&n.state!==`input-streaming`)return e;let r={input:void 0,inputText:(n?.state===`input-streaming`?n.inputText:``)+t.data.inputTextDelta,state:`input-streaming`,stepIndex:t.data.stepIndex,toolCallId:t.data.callId,toolMetadata:n?.toolMetadata??{eve:{kind:`unknown`,name:t.data.toolName}},toolName:t.data.toolName,type:`dynamic-tool`};return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),r)):updateToolPart(e,t.data.callId,r)}case`actions.requested`:{let n=e;for(let e of t.data.actions){let r=normalizeActionRequest(e);n=updateAssistantMessage(n,t.data.turnId,n=>upsertPart(ensureStepStartPart(n,t.data.stepIndex),{input:`input`in e?e.input:void 0,state:`input-available`,stepIndex:t.data.stepIndex,toolCallId:e.callId,toolMetadata:createToolMetadata(r),toolName:r.toolName,type:`dynamic-tool`}))}return n}case`input.requested`:{let n=e;for(let e of t.data.requests){let r=normalizeActionRequest(e.action);n=updateAssistantMessage(n,t.data.turnId,n=>upsertPart(ensureStepStartPart(n,t.data.stepIndex),{approval:{id:e.requestId},input:e.action.input,state:`approval-requested`,stepIndex:t.data.stepIndex,toolCallId:e.action.callId,toolMetadata:createToolMetadata(r,{inputRequest:toMessageInputRequest(e)}),toolName:r.toolName,type:`dynamic-tool`}))}return n}case`approval.candidate`:return e;case`approval.settled`:{let n=findToolPartByApprovalId(e,t.data.requestId);return n===void 0?e:t.data.outcome===`approved`?updateToolPart(e,n.toolCallId,{approval:{approved:!0,id:t.data.requestId,reason:void 0},input:n.input,state:`approval-responded`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`}):updateToolPart(e,n.toolCallId,{approval:{approved:!1,id:t.data.requestId,reason:`Tool execution was cancelled.`},input:n.input,state:`output-denied`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`})}case`action.result`:{let n=normalizeActionResult(t.data.result),r=findToolPart(e,t.data.result.callId),i=t.data.error?.code===`TOOL_EXECUTION_DENIED`,a=t.data.status===`failed`&&!i,o=r?.approval?.id??t.data.result.callId,s=mergeToolMetadata(r?.toolMetadata,createToolMetadata(n)),c={input:r?.input,stepIndex:t.data.stepIndex,toolCallId:t.data.result.callId,toolMetadata:s,toolName:r?.toolName??n.toolName,type:`dynamic-tool`},l;return l=i?{...c,approval:{approved:!1,id:o,reason:t.data.error?.message},state:`output-denied`}:a?{...c,approval:approvedApproval(r),errorText:t.data.error?.message??stringifyUnknown(t.data.result.output),state:`output-error`}:{...c,approval:approvedApproval(r),output:t.data.result.output,state:`output-available`},r===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),l)):updateToolPart(e,t.data.result.callId,l)}case`action.partial`:{let n=findToolPart(e,t.data.result.callId);if(n!==void 0&&isSettledToolPart(n))return e;let r=normalizeActionResult(t.data.result),i={approval:approvedApproval(n),input:n?.input,output:t.data.result.output,partial:!0,state:`output-available`,stepIndex:t.data.stepIndex,toolCallId:t.data.result.callId,toolMetadata:mergeToolMetadata(n?.toolMetadata,createToolMetadata(r)),toolName:n?.toolName??r.toolName,type:`dynamic-tool`};return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),i)):updateToolPart(e,t.data.result.callId,i)}case`authorization.required`:return updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),createAuthorizationRequiredPart(t)));case`authorization.completed`:return completeAuthorization(e,t);case`message.appended`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.append(ensureStepStartPart(e,t.data.stepIndex),{delta:t.data.messageDelta,stepIndex:t.data.stepIndex,type:`text`}));case`message.completed`:return updateAssistantMessage(e,t.data.turnId,e=>t.data.message===null?removeTextPart(e,t.data.stepIndex):messageRun.upsert(ensureStepStartPart(e,t.data.stepIndex),{state:`done`,stepIndex:t.data.stepIndex,text:t.data.message,type:`text`}));case`result.completed`:return updateAssistantMetadata(e,t.data.turnId,{result:t.data.result});case`turn.completed`:return updateAssistantMessage(e,t.data.turnId,e=>({...e,metadata:{...e.metadata,status:`complete`},parts:removeStreamingToolParts(e.parts)}));case`turn.cancelled`:return updateAssistantMessage(e,t.data.turnId,e=>({...e,metadata:{...e.metadata,status:`complete`},parts:removeStreamingToolParts(e.parts.map(e=>(e.type===`text`||e.type===`reasoning`)&&e.state===`streaming`?{...e,state:`done`}:e))}));case`turn.failed`:return removeStreamingToolPartsForTurn(e,t.data.turnId);case`session.failed`:return e;default:return e}}function removeStreamingToolParts(e){return e.filter(e=>e.type!==`dynamic-tool`||e.state!==`input-streaming`)}function respondToInputRequest(e,t){let n=findToolPartByApprovalId(e,t.requestId);if(!n)return e;let r={id:t.requestId};return t.text!==void 0&&(r.reason=t.text),updateToolPart(e,n.toolCallId,{approval:r,input:n.input,state:`approval-responded`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:mergeToolMetadata(n.toolMetadata,{eve:{inputResponse:t,kind:n.toolMetadata?.eve?.kind??`unknown`,name:n.toolMetadata?.eve?.name??n.toolName}}),toolName:n.toolName,type:`dynamic-tool`})}function resolveInputRequest(e,t){if(t.response!==void 0)return respondToInputRequest(e,t.response);let n=findToolPartByApprovalId(e,t.requestId);return n?updateToolPart(e,n.toolCallId,{input:n.input,output:{status:t.outcome},state:`output-available`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`}):e}function updateAssistantMessage(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.metadata?.turnId===t)??createAssistantMessage(t);return upsertMessage(e,n(r))}function updateAssistantMetadata(e,t,n){return updateAssistantMessage(e,t,e=>({...e,metadata:{...e.metadata,...n}}))}function createAssistantMessage(e){return{id:`${e}:assistant`,metadata:{status:`streaming`,turnId:e},parts:[],role:`assistant`}}function ensureStepStartPart(e,t){let n=e.parts.filter(e=>e.type===`step-start`).length;if(n>t)return e;let r=t-n+1;return{...e,parts:[...e.parts,...Array.from({length:r},()=>({type:`step-start`}))]}}function upsertPart(e,t){let n=e.parts.findIndex(e=>partKey(e)===partKey(t)),r=n===-1?[...e.parts,t]:[...e.parts.slice(0,n),t,...e.parts.slice(n+1)];return{...e,metadata:{...e.metadata,status:t.type===`text`&&t.state===`done`?`complete`:`streaming`},parts:r}}function removeTextPart(e,t){let n=e.parts.filter(e=>e.type!==`text`||e.stepIndex!==t);return n.length===e.parts.length?e:{...e,metadata:{...e.metadata,status:`complete`},parts:n}}function updateToolPart(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`dynamic-tool`&&e.toolCallId===t));return r?upsertMessage(e,upsertPart(r,n)):e}function completeAuthorization(e,t){let n=findLatestPendingAuthorizationPart(e,t.data.name),r=createAuthorizationCompletedPart(t,n);return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),r)):updateAuthorizationPart(e,n,r)}function updateAuthorizationPart(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e===t));return r?upsertMessage(e,upsertPart(r,n)):e}function findToolPart(e,t){for(let n of e.messages)for(let e of n.parts)if(e.type===`dynamic-tool`&&e.toolCallId===t)return e}function isSettledToolPart(e){return e.state===`output-denied`||e.state===`output-error`||e.state===`output-available`&&e.partial!==!0}function findLatestPendingAuthorizationPart(e,t){for(let n=e.messages.length-1;n>=0;--n){let r=e.messages[n];if(r?.role===`assistant`)for(let e=r.parts.length-1;e>=0;--e){let n=r.parts[e];if(n?.type===`authorization`&&n.state===`required`&&n.name===t)return n}}}function findToolPartByApprovalId(e,t){for(let n of e.messages)for(let e of n.parts)if(e.type===`dynamic-tool`&&e.approval?.id===t)return e}export{defaultMessageReducer};
|
|
1
|
+
import{createAuthorizationCompletedPart,createAuthorizationRequiredPart}from"#client/authorization-message-parts.js";import{approvedApproval,createToolMetadata,mergeToolMetadata,normalizeActionRequest,normalizeActionResult,stringifyUnknown,toMessageInputRequest}from"#client/message-action-parts.js";import{optimisticUserMessageId,partKey,projectReceivedParts,removeStreamingToolPartsForTurn,upsertMessage}from"#client/message-reducer-primitives.js";import{messageRun}from"#client/message-run-parts.js";function receivedMessageEventId(e){return e.meta.id??`${e.data.turnId}:${e.data.sequence}`}function defaultMessageReducer(){return{initial(){return{messages:[]}},reduce(e,t){return reduceMessageData(e,t)}}}function reduceMessageData(e,t){switch(t.type){case`client.message.submitted`:return upsertMessage(e,{id:optimisticUserMessageId(t.data.submissionId),metadata:{optimistic:!0,status:`submitted`},parts:[{type:`text`,text:t.data.message}],role:`user`});case`client.message.failed`:return upsertMessage(e,{id:optimisticUserMessageId(t.data.submissionId),metadata:{optimistic:!0,status:`failed`},parts:[{type:`text`,text:t.data.message}],role:`user`});case`client.input.responded`:{let n=e;for(let e of t.data.responses)n=respondToInputRequest(n,e);return n}case`input.resolved`:{let n=e;for(let e of t.data.resolutions)n=resolveInputRequest(n,e);return n}case`message.received`:return t.data.kind===`execution.background_task`?e:upsertMessage(e,{id:`${receivedMessageEventId(t)}:user`,metadata:{status:`complete`,turnId:t.data.turnId},parts:projectReceivedParts(t.data.parts,t.data.message),role:`user`});case`step.started`:return updateAssistantMessage(e,t.data.turnId,e=>ensureStepStartPart(e,t.data.stepIndex));case`reasoning.appended`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.append(ensureStepStartPart(e,t.data.stepIndex),{delta:t.data.reasoningDelta,stepIndex:t.data.stepIndex,type:`reasoning`}));case`reasoning.completed`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.upsert(ensureStepStartPart(e,t.data.stepIndex),{state:`done`,stepIndex:t.data.stepIndex,text:t.data.reasoning,type:`reasoning`}));case`action.input.appended`:{let n=findToolPart(e,t.data.callId);if(n!==void 0&&n.state!==`input-streaming`)return e;let r={input:void 0,inputText:(n?.state===`input-streaming`?n.inputText:``)+t.data.inputTextDelta,state:`input-streaming`,stepIndex:t.data.stepIndex,toolCallId:t.data.callId,toolMetadata:n?.toolMetadata??{eve:{kind:`unknown`,name:t.data.toolName}},toolName:t.data.toolName,type:`dynamic-tool`};return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),r)):updateToolPart(e,t.data.callId,r)}case`actions.requested`:{let n=e;for(let e of t.data.actions){let r=normalizeActionRequest(e);n=updateAssistantMessage(n,t.data.turnId,n=>upsertPart(ensureStepStartPart(n,t.data.stepIndex),{input:`input`in e?e.input:void 0,state:`input-available`,stepIndex:t.data.stepIndex,toolCallId:e.callId,toolMetadata:createToolMetadata(r),toolName:r.toolName,type:`dynamic-tool`}))}return n}case`input.requested`:{let n=e;for(let e of t.data.requests){let r=normalizeActionRequest(e.action);n=updateAssistantMessage(n,t.data.turnId,n=>upsertPart(ensureStepStartPart(n,t.data.stepIndex),{approval:{id:e.requestId},input:e.action.input,state:`approval-requested`,stepIndex:t.data.stepIndex,toolCallId:e.action.callId,toolMetadata:createToolMetadata(r,{inputRequest:toMessageInputRequest(e)}),toolName:r.toolName,type:`dynamic-tool`}))}return n}case`approval.candidate`:return e;case`approval.settled`:{let n=findToolPartByApprovalId(e,t.data.requestId);return n===void 0?e:t.data.outcome===`approved`?updateToolPart(e,n.toolCallId,{approval:{approved:!0,id:t.data.requestId,reason:void 0},input:n.input,state:`approval-responded`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`}):updateToolPart(e,n.toolCallId,{approval:{approved:!1,id:t.data.requestId,reason:`Tool execution was cancelled.`},input:n.input,state:`output-denied`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`})}case`action.result`:{let n=normalizeActionResult(t.data.result),r=findToolPart(e,t.data.result.callId),i=t.data.error?.code===`TOOL_EXECUTION_DENIED`,a=t.data.status===`failed`&&!i,o=r?.approval?.id??t.data.result.callId,s=mergeToolMetadata(r?.toolMetadata,createToolMetadata(n)),c={input:r?.input,stepIndex:t.data.stepIndex,toolCallId:t.data.result.callId,toolMetadata:s,toolName:r?.toolName??n.toolName,type:`dynamic-tool`},l;return l=i?{...c,approval:{approved:!1,id:o,reason:t.data.error?.message},state:`output-denied`}:a?{...c,approval:approvedApproval(r),errorText:t.data.error?.message??stringifyUnknown(t.data.result.output),state:`output-error`}:{...c,approval:approvedApproval(r),output:t.data.result.output,state:`output-available`},r===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),l)):updateToolPart(e,t.data.result.callId,l)}case`action.partial`:{let n=findToolPart(e,t.data.result.callId);if(n!==void 0&&isSettledToolPart(n))return e;let r=normalizeActionResult(t.data.result),i={approval:approvedApproval(n),input:n?.input,output:t.data.result.output,partial:!0,state:`output-available`,stepIndex:t.data.stepIndex,toolCallId:t.data.result.callId,toolMetadata:mergeToolMetadata(n?.toolMetadata,createToolMetadata(r)),toolName:n?.toolName??r.toolName,type:`dynamic-tool`};return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),i)):updateToolPart(e,t.data.result.callId,i)}case`authorization.required`:return updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),createAuthorizationRequiredPart(t)));case`authorization.completed`:return completeAuthorization(e,t);case`message.appended`:return updateAssistantMessage(e,t.data.turnId,e=>messageRun.append(ensureStepStartPart(e,t.data.stepIndex),{delta:t.data.messageDelta,stepIndex:t.data.stepIndex,type:`text`}));case`message.completed`:return updateAssistantMessage(e,t.data.turnId,e=>t.data.message===null?removeTextPart(e,t.data.stepIndex):messageRun.upsert(ensureStepStartPart(e,t.data.stepIndex),{state:`done`,stepIndex:t.data.stepIndex,text:t.data.message,type:`text`}));case`result.completed`:return updateAssistantMetadata(e,t.data.turnId,{result:t.data.result});case`turn.completed`:return updateAssistantMessage(e,t.data.turnId,e=>({...e,metadata:{...e.metadata,status:`complete`},parts:removeStreamingToolParts(e.parts)}));case`turn.cancelled`:return updateAssistantMessage(e,t.data.turnId,e=>({...e,metadata:{...e.metadata,status:`complete`},parts:removeStreamingToolParts(e.parts.map(e=>(e.type===`text`||e.type===`reasoning`)&&e.state===`streaming`?{...e,state:`done`}:e))}));case`turn.failed`:return removeStreamingToolPartsForTurn(e,t.data.turnId);case`session.failed`:return e;default:return e}}function removeStreamingToolParts(e){return e.filter(e=>e.type!==`dynamic-tool`||e.state!==`input-streaming`)}function respondToInputRequest(e,t){let n=findToolPartByApprovalId(e,t.requestId);if(!n)return e;let r={id:t.requestId};return t.text!==void 0&&(r.reason=t.text),updateToolPart(e,n.toolCallId,{approval:r,input:n.input,state:`approval-responded`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:mergeToolMetadata(n.toolMetadata,{eve:{inputResponse:t,kind:n.toolMetadata?.eve?.kind??`unknown`,name:n.toolMetadata?.eve?.name??n.toolName}}),toolName:n.toolName,type:`dynamic-tool`})}function resolveInputRequest(e,t){if(t.response!==void 0)return respondToInputRequest(e,t.response);let n=findToolPartByApprovalId(e,t.requestId);return n?updateToolPart(e,n.toolCallId,{input:n.input,output:{status:t.outcome},state:`output-available`,stepIndex:n.stepIndex,toolCallId:n.toolCallId,toolMetadata:n.toolMetadata,toolName:n.toolName,type:`dynamic-tool`}):e}function updateAssistantMessage(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.metadata?.turnId===t)??createAssistantMessage(t);return upsertMessage(e,n(r))}function updateAssistantMetadata(e,t,n){return updateAssistantMessage(e,t,e=>({...e,metadata:{...e.metadata,...n}}))}function createAssistantMessage(e){return{id:`${e}:assistant`,metadata:{status:`streaming`,turnId:e},parts:[],role:`assistant`}}function ensureStepStartPart(e,t){let n=e.parts.filter(e=>e.type===`step-start`).length;if(n>t)return e;let r=t-n+1;return{...e,parts:[...e.parts,...Array.from({length:r},()=>({type:`step-start`}))]}}function upsertPart(e,t){let n=e.parts.findIndex(e=>partKey(e)===partKey(t)),r=n===-1?[...e.parts,t]:[...e.parts.slice(0,n),t,...e.parts.slice(n+1)];return{...e,metadata:{...e.metadata,status:t.type===`text`&&t.state===`done`?`complete`:`streaming`},parts:r}}function removeTextPart(e,t){let n=e.parts.filter(e=>e.type!==`text`||e.stepIndex!==t);return n.length===e.parts.length?e:{...e,metadata:{...e.metadata,status:`complete`},parts:n}}function updateToolPart(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`dynamic-tool`&&e.toolCallId===t));return r?upsertMessage(e,upsertPart(r,n)):e}function completeAuthorization(e,t){let n=findLatestPendingAuthorizationPart(e,t.data.name),r=createAuthorizationCompletedPart(t,n);return n===void 0?updateAssistantMessage(e,t.data.turnId,e=>upsertPart(ensureStepStartPart(e,t.data.stepIndex),r)):updateAuthorizationPart(e,n,r)}function updateAuthorizationPart(e,t,n){let r=e.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e===t));return r?upsertMessage(e,upsertPart(r,n)):e}function findToolPart(e,t){for(let n of e.messages)for(let e of n.parts)if(e.type===`dynamic-tool`&&e.toolCallId===t)return e}function isSettledToolPart(e){return e.state===`output-denied`||e.state===`output-error`||e.state===`output-available`&&e.partial!==!0}function findLatestPendingAuthorizationPart(e,t){for(let n=e.messages.length-1;n>=0;--n){let r=e.messages[n];if(r?.role===`assistant`)for(let e=r.parts.length-1;e>=0;--e){let n=r.parts[e];if(n?.type===`authorization`&&n.state===`required`&&n.name===t)return n}}}function findToolPartByApprovalId(e,t){for(let n of e.messages)for(let e of n.parts)if(e.type===`dynamic-tool`&&e.approval?.id===t)return e}export{defaultMessageReducer};
|
|
@@ -6,9 +6,11 @@ import type { CancelSessionResult, MessageResult } from "#client/types.js";
|
|
|
6
6
|
interface MessageResponseInput {
|
|
7
7
|
readonly cancelTurn: (turnId: string) => Promise<CancelSessionResult>;
|
|
8
8
|
readonly createStream: (source?: AsyncIterable<MessageStreamEvent>) => AsyncGenerator<MessageStreamEvent>;
|
|
9
|
+
readonly deliveryId?: string;
|
|
9
10
|
readonly sessionId: string;
|
|
10
11
|
}
|
|
11
12
|
declare const consumeResponse: unique symbol;
|
|
13
|
+
declare const acceptedDeliveryId: unique symbol;
|
|
12
14
|
/**
|
|
13
15
|
* The response from {@link ClientSession.send}.
|
|
14
16
|
*
|
|
@@ -22,6 +24,7 @@ export declare class MessageResponse<TOutput = unknown> implements AsyncIterable
|
|
|
22
24
|
* Session ID assigned by the server.
|
|
23
25
|
*/
|
|
24
26
|
readonly sessionId: string;
|
|
27
|
+
readonly [acceptedDeliveryId]: string | undefined;
|
|
25
28
|
/** @internal */
|
|
26
29
|
constructor(input: MessageResponseInput);
|
|
27
30
|
/**
|
|
@@ -44,6 +47,8 @@ export declare class MessageResponse<TOutput = unknown> implements AsyncIterable
|
|
|
44
47
|
[Symbol.asyncIterator](): AsyncIterator<MessageStreamEvent>;
|
|
45
48
|
[consumeResponse](source?: AsyncIterable<MessageStreamEvent>): AsyncGenerator<MessageStreamEvent>;
|
|
46
49
|
}
|
|
50
|
+
/** @internal Returns the accepted message identity without consuming its response stream. */
|
|
51
|
+
export declare function getMessageResponseDeliveryId(response: MessageResponse): string | undefined;
|
|
47
52
|
/** @internal Observe a turn through the frontend's existing session stream. */
|
|
48
53
|
export declare function consumeMessageResponse(response: MessageResponse, source: AsyncIterable<MessageStreamEvent>): AsyncIterable<MessageStreamEvent>;
|
|
49
54
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{summarizeTurnEvents}from"#client/session-utils.js";import{extractCompletedResult}from"#client/output-schema.js";const consumeResponse=Symbol(`consumeMessageResponse`);var MessageResponse=class{sessionId;#e;#t;#n=!1;#r;#i=!1;#a=Promise.withResolvers();constructor(e){this.#e=e.cancelTurn,this.sessionId=e.sessionId,this.#r=e.createStream}cancel(){if(this.#i)return Promise.resolve({status:`no_active_turn`});if(this.#t!==void 0)return this.#t;let e=this.#a.promise.then(e=>e===void 0?{status:`no_active_turn`}:this.#e(e));return this.#t=e,e.catch(()=>{!this.#i&&this.#t===e&&(this.#t=void 0)}),e}async result(){let e=[];for await(let t of this)e.push(t);let t=summarizeTurnEvents(e);return{data:extractCompletedResult(e),events:e,inputRequests:t.inputRequests,message:t.message,sessionId:this.sessionId,status:t.status}}[Symbol.asyncIterator](){return this[consumeResponse]()}[consumeResponse](e){if(this.#n)throw Error(`MessageResponse has already been consumed.`);return this.#n=!0,this.#o(e)}async*#o(e){try{for await(let t of this.#r(e))t.type===`turn.started`?this.#a.resolve(t.data.turnId):isCurrentTurnBoundaryEvent(t)&&(this.#i=!0,this.#a.resolve(void 0)),yield t}finally{this.#a.resolve(void 0)}}};function consumeMessageResponse(e,t){return e[consumeResponse](t)}export{MessageResponse,consumeMessageResponse};
|
|
1
|
+
import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{summarizeTurnEvents}from"#client/session-utils.js";import{extractCompletedResult}from"#client/output-schema.js";const consumeResponse=Symbol(`consumeMessageResponse`),acceptedDeliveryId=Symbol(`acceptedDeliveryId`);var MessageResponse=class{sessionId;[acceptedDeliveryId];#e;#t;#n=!1;#r;#i=!1;#a=Promise.withResolvers();constructor(e){this.#e=e.cancelTurn,this.sessionId=e.sessionId,this[acceptedDeliveryId]=e.deliveryId,this.#r=e.createStream}cancel(){if(this.#i)return Promise.resolve({status:`no_active_turn`});if(this.#t!==void 0)return this.#t;let e=this.#a.promise.then(e=>e===void 0?{status:`no_active_turn`}:this.#e(e));return this.#t=e,e.catch(()=>{!this.#i&&this.#t===e&&(this.#t=void 0)}),e}async result(){let e=[];for await(let t of this)e.push(t);let t=summarizeTurnEvents(e);return{data:extractCompletedResult(e),events:e,inputRequests:t.inputRequests,message:t.message,sessionId:this.sessionId,status:t.status}}[Symbol.asyncIterator](){return this[consumeResponse]()}[consumeResponse](e){if(this.#n)throw Error(`MessageResponse has already been consumed.`);return this.#n=!0,this.#o(e)}async*#o(e){try{for await(let t of this.#r(e))t.type===`turn.started`?this.#a.resolve(t.data.turnId):isCurrentTurnBoundaryEvent(t)&&(this.#i=!0,this.#a.resolve(void 0)),yield t}finally{this.#a.resolve(void 0)}}};function getMessageResponseDeliveryId(e){return e[acceptedDeliveryId]}function consumeMessageResponse(e,t){return e[consumeResponse](t)}export{MessageResponse,consumeMessageResponse,getMessageResponseDeliveryId};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EveAgentProjection } from "#client/eve-agent-projection.js";
|
|
2
|
+
import type { MessageStreamEvent } from "#protocol/message.js";
|
|
3
|
+
import type { SendTurnPayload } from "#client/types.js";
|
|
4
|
+
interface ReconciledSubmissions {
|
|
5
|
+
readonly alreadyProjected: boolean;
|
|
6
|
+
readonly event: Extract<MessageStreamEvent, {
|
|
7
|
+
readonly type: "message.received";
|
|
8
|
+
}>;
|
|
9
|
+
readonly ids: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** Owns optimistic message projection and server-delivery reconciliation. */
|
|
12
|
+
export declare class OptimisticMessageSubmissions<TData> {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(projection: EveAgentProjection<TData>, optimistic: boolean);
|
|
15
|
+
reset(): void;
|
|
16
|
+
submit(input: SendTurnPayload, eventStartIndex: number): string | undefined;
|
|
17
|
+
apply(event: MessageStreamEvent): ReconciledSubmissions | undefined;
|
|
18
|
+
correlate(submissionId: string | undefined, deliveryId: string | undefined, events: readonly MessageStreamEvent[]): ReconciledSubmissions | undefined;
|
|
19
|
+
fail(error: Error, submissionId?: string): void;
|
|
20
|
+
failAll(error: Error): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"#client/eve-agent-projection.js";import{createSubmissionId,summarizeUserContent}from"#client/eve-agent-store-helpers.js";var OptimisticMessageSubmissions=class{#e;#t;#n=[];constructor(e,t){this.#t=e,this.#e=t}reset(){this.#n=[]}submit(e,t){if(e.message===void 0)return;let n={createdAt:Date.now(),eventStartIndex:t,id:createSubmissionId(),message:summarizeUserContent(e.message),requiresDeliveryId:!0};return this.#n=[...this.#n,n],this.#e&&this.#t.append({data:{createdAt:n.createdAt,message:n.message,submissionId:n.id},type:`client.message.submitted`}),n.id}apply(e){if(e.type!==`message.received`){this.#t.append(e);return}if(e.data.kind===`execution.background_task`){this.#t.append(e);return}let t=this.#r(e);if(t.length===0){this.#t.append(e);return}return this.#i(t,e,!1)}correlate(e,t,n){if(e===void 0)return;this.#n=this.#n.map(n=>n.id===e?{...n,deliveryId:t,requiresDeliveryId:t!==void 0}:n);let r=this.#n.find(t=>t.id===e);if(r!==void 0)for(let t of n.slice(r.eventStartIndex)){if(t.type!==`message.received`||t.data.kind===`execution.background_task`)continue;let n=this.#r(t);if(n.some(t=>t.id===e))return this.#i(n,t,!0)}}fail(e,t){let n=t===void 0?this.#n[0]:this.#n.find(e=>e.id===t);n!==void 0&&(this.#n=this.#n.filter(e=>e.id!==n.id),this.#t.replace(e=>e.type===`client.message.submitted`&&e.data.submissionId===n.id,{data:{createdAt:n.createdAt,error:{message:e.message},message:n.message,submissionId:n.id},type:`client.message.failed`}))}failAll(e){for(let t of this.#n)this.fail(e,t.id)}#r(e){return this.#n.filter(t=>t.deliveryId===void 0?!t.requiresDeliveryId:e.meta.deliveryIds?.includes(t.deliveryId)===!0)}#i(e,t,n){let r=e.map(e=>e.id),i=new Set(r);return this.#n=this.#n.filter(e=>!i.has(e.id)),n||this.#t.replace(e=>e.type===`client.message.submitted`&&e.data.submissionId===r[0],t),this.#t.remove(e=>e.type===`client.message.submitted`&&i.has(e.data.submissionId)),{alreadyProjected:n,event:t,ids:r}}};export{OptimisticMessageSubmissions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_SESSION_ROUTE_PATH,createEveSessionRoutePath}from"#protocol/routes.js";import{EVE_SESSION_ID_HEADER,isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{updatePendingAuthorizations}from"#client/session-utils.js";import{ClientError}from"#client/client-error.js";import{createClientUrl}from"#client/url.js";import{MessageResponse}from"#client/message-response.js";import{followStreamIterable,sleep}from"#client/open-stream.js";import{cancelClientSession,clearClientSession,compactClientSession,resetClientSession}from"#client/session-controls.js";import{serializeOutputSchema}from"#tools/schema.js";const followSession=Symbol(`followClientSession`);var ClientSession=class ClientSession{#e;#t;constructor(e,t){this.#e=e,this.#t=t}static async create(e,t){let n=await postTurn(e,EVE_SESSION_ROUTE_PATH,t,!0),{sessionId:r}=await readAcceptedMessage(n),i=new ClientSession(e,{sessionId:r,streamIndex:0});return{response:i.#r(n,t,0),session:i}}static async prewarm(e,t={}){let{sessionId:n}=await readAcceptedMessage(await postCreateSession(e,t));return new ClientSession(e,{sessionId:n,streamIndex:0})}get state(){return this.#t}async snapshot(e){e?.signal?.throwIfAborted();let t=[];for await(let n of this.#s({follow:!1,signal:e?.signal,startIndex:0}))t.push(n);return e?.signal?.throwIfAborted(),{events:t,session:{sessionId:this.#t.sessionId,streamIndex:t.length}}}async send(e,t={}){return await this.#n({...t,message:e},!0)}async respond(e,t={}){if(e.length===0)throw Error(`ClientSession.respond() requires at least one input response.`);return await this.#n({...t,inputResponses:e},!1)}async#n(e,t){let n=this.#t.streamIndex,r=createEveSessionRoutePath(this.#t.sessionId),i=t?await postSessionSend(this.#e,r,e):await postTurn(this.#e,r,e,!1),{sessionId:a,deliveryId:o}=await readAcceptedMessage(i,this.#t.sessionId);if(a!==this.#t.sessionId)throw Error(`Message route returned a different session id.`);if(e.message!==void 0&&o===void 0)throw Error(`Message route did not return a delivery id. Update the server before sending with this client.`);return this.#r(i,e,n,e.message===void 0?void 0:o)}async cancel(e){return await cancelClientSession({context:this.#e,options:e,sessionId:this.#t.sessionId})}async clear(){return await clearClientSession({context:this.#e,sessionId:this.#t.sessionId})}async compact(){return await compactClientSession({context:this.#e,sessionId:this.#t.sessionId})}async reset(e){return await resetClientSession({context:this.#e,options:e,sessionId:this.#t.sessionId})}stream(e){if(e?.follow===!1&&(e.startIndex??this.#t.streamIndex)<0)throw Error(`stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.`);return this.#a(e)}[followSession](e){return this.#a({...e,keepAlive:!0})}#r(e,t,n,r){return e.body?.cancel().catch(()=>{}),new MessageResponse({cancelTurn:async e=>await this.cancel({turnId:e}),createStream:e=>this.#i(n,t,r,e),sessionId:this.#t.sessionId})}async*#i(e,t,n,r){let i=0,a=n===void 0,o=!1,s=new Set;try{for await(let c of r??this.#s({headers:t.headers,keepAlive:!0,signal:t.signal,startIndex:e,streamReconnectPolicy:t.streamReconnectPolicy})){if(i+=1,n!==void 0){let e=c.meta?.deliveryIds?.includes(n)===!0,t=c.type===`session.failed`||c.type===`session.completed`;if(!e&&t&&(!a||c.type===`session.completed`))throw Error(`The session ended before the accepted message reached its turn boundary.`);if(!a&&!e||!t&&c.meta?.deliveryIds!==void 0&&!e)continue;a=!0}if(updatePendingAuthorizations(s,c),o=isCurrentTurnBoundaryEvent(c)&&(c.type!==`session.waiting`||s.size===0),yield c,o)break}if(n!==void 0&&!o&&!t.signal?.aborted)throw Error(`The response stream ended before the accepted message reached its turn boundary.`)}finally{this.#o(e+i)}}async*#a(e){let t=e?.startIndex??this.#t.streamIndex,n=0;for await(let r of this.#s({follow:e?.follow,headers:e?.headers,keepAlive:e?.keepAlive,onCaughtUp:e?.onCaughtUp,resolveHeaders:e?.resolveHeaders,resolveReconnectPolicy:e?.resolveReconnectPolicy,signal:e?.signal,startIndex:t,streamReconnectPolicy:e?.streamReconnectPolicy}))n+=1,t>=0&&this.#o(t+n),yield r}#o(e){this.#t={sessionId:this.#t.sessionId,streamIndex:Math.max(this.#t.streamIndex,e)}}#s(e){return followStreamIterable({onCaughtUp:e.onCaughtUp,follow:e.follow,host:this.#e.host,keepAlive:e.keepAlive,resolveHeaders:()=>this.#e.resolveHeaders(e.resolveHeaders?.()??e.headers),redirect:this.#e.redirect,sessionId:this.#t.sessionId,signal:e.signal,startIndex:e.startIndex,streamReconnectPolicy:e.streamReconnectPolicy,resolveReconnectPolicy:e.resolveReconnectPolicy})}};function followClientSession(e,t){return e[followSession](t)}async function postSessionSend(e,t,n){let r=Date.now()+2e4,i=250;for(;;){try{return await postTurn(e,t,n,!1)}catch(e){if(!isSessionNotReady(e))throw e;let t=r-Date.now();if(t<=0)throw e;await sleep(Math.min(i,t),n.signal)}n.signal?.throwIfAborted(),i=Math.min(i*2,2e3)}}async function postCreateSession(e,t){let n=await e.resolveHeaders(t.headers),r=await fetch(createClientUrl(e.host,EVE_SESSION_ROUTE_PATH),{headers:n,method:`POST`,redirect:e.redirect,signal:t.signal??null});if(!r.ok){let e=await r.text();throw new ClientError(r.status,e,r.headers)}return r}function isSessionNotReady(e){return e instanceof ClientError&&e.status===409&&e.code===`session_not_ready`}async function postTurn(e,t,n,r){let i=createMessageBody(n,r);if(i===null)throw Error(r?`Creating a session requires a non-empty message.`:`A session turn requires a non-empty message or inputResponses.`);let a=await e.resolveHeaders(n.headers);a.set(`content-type`,`application/json`);let o=await fetch(createClientUrl(e.host,t),{body:JSON.stringify(i),headers:a,method:`POST`,redirect:e.redirect,signal:n.signal??null});if(!o.ok){let e=await o.text();throw new ClientError(o.status,e,o.headers)}return o}async function readAcceptedMessage(e,t){let n=await e.json(),r=(typeof n.sessionId==`string`?n.sessionId:void 0)??e.headers.get(EVE_SESSION_ID_HEADER)?.trim()??t;if(!r)throw Error(`Message route did not return a session id.`);return{sessionId:r,deliveryId:typeof n.deliveryId==`string`&&n.deliveryId.length>0?n.deliveryId:void 0}}function createMessageBody(e,t){let n={};e.message!==void 0&&(n.message=e.message),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses),!t&&e.message!==void 0&&e.turnPolicy!==void 0&&(n.turnPolicy=e.turnPolicy),e.clientContext!==void 0&&(n.clientContext=e.clientContext);let r=serializeOutputSchema(e.outputSchema);return r!==void 0&&(n.outputSchema=r),t&&n.message===void 0||n.message===void 0&&n.inputResponses===void 0?null:n}export{ClientSession,followClientSession};
|
|
1
|
+
import{EVE_SESSION_ROUTE_PATH,createEveSessionRoutePath}from"#protocol/routes.js";import{EVE_SESSION_ID_HEADER,isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{updatePendingAuthorizations}from"#client/session-utils.js";import{ClientError}from"#client/client-error.js";import{createClientUrl}from"#client/url.js";import{MessageResponse}from"#client/message-response.js";import{followStreamIterable,sleep}from"#client/open-stream.js";import{cancelClientSession,clearClientSession,compactClientSession,resetClientSession}from"#client/session-controls.js";import{serializeOutputSchema}from"#tools/schema.js";const followSession=Symbol(`followClientSession`);var ClientSession=class ClientSession{#e;#t;constructor(e,t){this.#e=e,this.#t=t}static async create(e,t){let n=await postTurn(e,EVE_SESSION_ROUTE_PATH,t,!0),{sessionId:r}=await readAcceptedMessage(n),i=new ClientSession(e,{sessionId:r,streamIndex:0});return{response:i.#r(n,t,0),session:i}}static async prewarm(e,t={}){let{sessionId:n}=await readAcceptedMessage(await postCreateSession(e,t));return new ClientSession(e,{sessionId:n,streamIndex:0})}get state(){return this.#t}async snapshot(e){e?.signal?.throwIfAborted();let t=[];for await(let n of this.#s({follow:!1,signal:e?.signal,startIndex:0}))t.push(n);return e?.signal?.throwIfAborted(),{events:t,session:{sessionId:this.#t.sessionId,streamIndex:t.length}}}async send(e,t={}){return await this.#n({...t,message:e},!0)}async respond(e,t={}){if(e.length===0)throw Error(`ClientSession.respond() requires at least one input response.`);return await this.#n({...t,inputResponses:e},!1)}async#n(e,t){let n=this.#t.streamIndex,r=createEveSessionRoutePath(this.#t.sessionId),i=t?await postSessionSend(this.#e,r,e):await postTurn(this.#e,r,e,!1),{sessionId:a,deliveryId:o}=await readAcceptedMessage(i,this.#t.sessionId);if(a!==this.#t.sessionId)throw Error(`Message route returned a different session id.`);if(e.message!==void 0&&o===void 0)throw Error(`Message route did not return a delivery id. Update the server before sending with this client.`);return this.#r(i,e,n,e.message===void 0?void 0:o)}async cancel(e){return await cancelClientSession({context:this.#e,options:e,sessionId:this.#t.sessionId})}async clear(){return await clearClientSession({context:this.#e,sessionId:this.#t.sessionId})}async compact(){return await compactClientSession({context:this.#e,sessionId:this.#t.sessionId})}async reset(e){return await resetClientSession({context:this.#e,options:e,sessionId:this.#t.sessionId})}stream(e){if(e?.follow===!1&&(e.startIndex??this.#t.streamIndex)<0)throw Error(`stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.`);return this.#a(e)}[followSession](e){return this.#a({...e,keepAlive:!0})}#r(e,t,n,r){return e.body?.cancel().catch(()=>{}),new MessageResponse({cancelTurn:async e=>await this.cancel({turnId:e}),createStream:e=>this.#i(n,t,r,e),deliveryId:r,sessionId:this.#t.sessionId})}async*#i(e,t,n,r){let i=0,a=n===void 0,o=!1,s=new Set;try{for await(let c of r??this.#s({headers:t.headers,keepAlive:!0,signal:t.signal,startIndex:e,streamReconnectPolicy:t.streamReconnectPolicy})){if(i+=1,n!==void 0){let e=c.meta?.deliveryIds?.includes(n)===!0,t=c.type===`session.failed`||c.type===`session.completed`;if(!e&&t&&(!a||c.type===`session.completed`))throw Error(`The session ended before the accepted message reached its turn boundary.`);if(!a&&!e||!t&&c.meta?.deliveryIds!==void 0&&!e)continue;a=!0}if(updatePendingAuthorizations(s,c),o=isCurrentTurnBoundaryEvent(c)&&(c.type!==`session.waiting`||s.size===0),yield c,o)break}if(n!==void 0&&!o&&!t.signal?.aborted)throw Error(`The response stream ended before the accepted message reached its turn boundary.`)}finally{this.#o(e+i)}}async*#a(e){let t=e?.startIndex??this.#t.streamIndex,n=0;for await(let r of this.#s({follow:e?.follow,headers:e?.headers,keepAlive:e?.keepAlive,onCaughtUp:e?.onCaughtUp,resolveHeaders:e?.resolveHeaders,resolveReconnectPolicy:e?.resolveReconnectPolicy,signal:e?.signal,startIndex:t,streamReconnectPolicy:e?.streamReconnectPolicy}))n+=1,t>=0&&this.#o(t+n),yield r}#o(e){this.#t={sessionId:this.#t.sessionId,streamIndex:Math.max(this.#t.streamIndex,e)}}#s(e){return followStreamIterable({onCaughtUp:e.onCaughtUp,follow:e.follow,host:this.#e.host,keepAlive:e.keepAlive,resolveHeaders:()=>this.#e.resolveHeaders(e.resolveHeaders?.()??e.headers),redirect:this.#e.redirect,sessionId:this.#t.sessionId,signal:e.signal,startIndex:e.startIndex,streamReconnectPolicy:e.streamReconnectPolicy,resolveReconnectPolicy:e.resolveReconnectPolicy})}};function followClientSession(e,t){return e[followSession](t)}async function postSessionSend(e,t,n){let r=Date.now()+2e4,i=250;for(;;){try{return await postTurn(e,t,n,!1)}catch(e){if(!isSessionNotReady(e))throw e;let t=r-Date.now();if(t<=0)throw e;await sleep(Math.min(i,t),n.signal)}n.signal?.throwIfAborted(),i=Math.min(i*2,2e3)}}async function postCreateSession(e,t){let n=await e.resolveHeaders(t.headers),r=await fetch(createClientUrl(e.host,EVE_SESSION_ROUTE_PATH),{headers:n,method:`POST`,redirect:e.redirect,signal:t.signal??null});if(!r.ok){let e=await r.text();throw new ClientError(r.status,e,r.headers)}return r}function isSessionNotReady(e){return e instanceof ClientError&&e.status===409&&e.code===`session_not_ready`}async function postTurn(e,t,n,r){let i=createMessageBody(n,r);if(i===null)throw Error(r?`Creating a session requires a non-empty message.`:`A session turn requires a non-empty message or inputResponses.`);let a=await e.resolveHeaders(n.headers);a.set(`content-type`,`application/json`);let o=await fetch(createClientUrl(e.host,t),{body:JSON.stringify(i),headers:a,method:`POST`,redirect:e.redirect,signal:n.signal??null});if(!o.ok){let e=await o.text();throw new ClientError(o.status,e,o.headers)}return o}async function readAcceptedMessage(e,t){let n=await e.json(),r=(typeof n.sessionId==`string`?n.sessionId:void 0)??e.headers.get(EVE_SESSION_ID_HEADER)?.trim()??t;if(!r)throw Error(`Message route did not return a session id.`);return{sessionId:r,deliveryId:typeof n.deliveryId==`string`&&n.deliveryId.length>0?n.deliveryId:void 0}}function createMessageBody(e,t){let n={};e.message!==void 0&&(n.message=e.message),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses),!t&&e.message!==void 0&&e.turnPolicy!==void 0&&(n.turnPolicy=e.turnPolicy),e.clientContext!==void 0&&(n.clientContext=e.clientContext);let r=serializeOutputSchema(e.outputSchema);return r!==void 0&&(n.outputSchema=r),t&&n.message===void 0||n.message===void 0&&n.inputResponses===void 0?null:n}export{ClientSession,followClientSession};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"moduleFingerprints": {
|
|
3
|
-
"@eve/catalog": "
|
|
3
|
+
"@eve/catalog": "c6e21e67b8ebd4cb61ab42552273288aa5cddd999da91cb6b265868a3db98edb",
|
|
4
4
|
"just-secrets": "1ce67d437d0bb06df02e4e99180a3c5f5edf0010314010226e97b96d462bba5d",
|
|
5
5
|
"@workflow/world-local": "eeaeed751310cf36666c3daa07f305f431710951b0523b97dcdca3d6e69b1061"
|
|
6
6
|
},
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"@vercel/oidc": "3.8.0",
|
|
46
46
|
"@vercel/otel": "2.1.3",
|
|
47
47
|
"@vercel/sandbox": "3.3.0",
|
|
48
|
-
"@workflow/builders": "5.0.0-beta.
|
|
49
|
-
"@workflow/core": "5.0.0-beta.
|
|
48
|
+
"@workflow/builders": "5.0.0-beta.53",
|
|
49
|
+
"@workflow/core": "5.0.0-beta.53",
|
|
50
50
|
"@workflow/errors": "5.0.0-beta.21",
|
|
51
51
|
"@workflow/serde": "5.0.0-beta.2",
|
|
52
|
-
"@workflow/world": "5.0.0-beta.
|
|
53
|
-
"@workflow/world-local": "5.0.0-beta.
|
|
54
|
-
"@workflow/world-vercel": "5.0.0-beta.
|
|
52
|
+
"@workflow/world": "5.0.0-beta.36",
|
|
53
|
+
"@workflow/world-local": "5.0.0-beta.45",
|
|
54
|
+
"@workflow/world-vercel": "5.0.0-beta.48",
|
|
55
55
|
"zod": "4.5.4",
|
|
56
56
|
"zod-validation-error": "5.0.0"
|
|
57
57
|
},
|
|
58
|
-
"scriptHash": "
|
|
58
|
+
"scriptHash": "66af64b374a8b6414bfee18ba641bc70e95ebd7bd0b3470e2769b7862c9ef81c",
|
|
59
59
|
"toolVersions": {
|
|
60
60
|
"rolldown": "1.2.8",
|
|
61
61
|
"typescript": "7.0.2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return[e.mcp?`mcp`:null,e.openapi?`openapi`:null].filter(e=>e!==null)}const t=[{slug:`slack`,name:`Slack`,kind:`channel`,tagline:`Mention your agent in channels and DMs, with Connect-managed auth.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0}},{slug:`discord`,name:`Discord`,kind:`channel`,tagline:`Run your agent as a Discord bot across servers and threads.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`teams`,name:`Microsoft Teams`,kind:`channel`,tagline:`Bring your agent into Teams chats and channels.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`telegram`,name:`Telegram`,kind:`channel`,tagline:`Connect your agent to a Telegram bot for 1:1 and group chats.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`twilio`,name:`Twilio`,kind:`channel`,tagline:`Put your agent on a phone number: SMS and speech-transcribed calls.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`blooio`,name:`Blooio`,kind:`channel`,tagline:`Send and receive iMessage, RCS, and SMS through Blooio.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`github`,name:`GitHub`,kind:`channel`,tagline:`Drive your agent from issues, pull requests, and comments, with guided Connect setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`linear-agent`,name:`Linear Agent`,kind:`channel`,tagline:`Delegate Linear issues and comments through Agent Sessions, with guided Connect setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`eve`,name:`Web Chat`,kind:`channel`,tagline:`Embed a first-party web chat UI backed by your agent.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0}},{slug:`buzz`,name:`Buzz`,kind:`channel`,tagline:`Talk to your eve agent from Buzz through its ACP desktop harness.`,surfaces:{scaffoldable:!1,registry:!1,gallery:!0}},{slug:`chat-sdk-gchat`,name:`Google Chat`,kind:`channel`,tagline:`Google Chat spaces and DMs via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-whatsapp`,name:`WhatsApp`,kind:`channel`,tagline:`Customer messaging through WhatsApp Business Cloud via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-x`,name:`X`,kind:`channel`,tagline:`Public mentions and DMs on X via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-messenger`,name:`Messenger`,kind:`channel`,tagline:`Facebook Messenger bots with templates, buttons, and reactions via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-zernio`,name:`Zernio`,kind:`channel`,tagline:`Reach seven social and messaging platforms through one Zernio integration.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-velt`,name:`Velt`,kind:`channel`,tagline:`Add agents to anchored comments across documents, canvases, PDFs, and video.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-sendblue`,name:`Sendblue`,kind:`channel`,tagline:`Send and receive iMessage, SMS, and RCS through Sendblue.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-novu`,name:`Novu`,kind:`channel`,tagline:`Reach Slack, Teams, WhatsApp, Telegram, and email through Novu.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-liveblocks`,name:`Liveblocks`,kind:`channel`,tagline:`Bring your agent into Liveblocks comment threads, mentions, and reactions.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`linq`,name:`Linq`,kind:`channel`,tagline:`iMessage and SMS conversations through Linq, with guided Connect or portable setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-kapso`,name:`Kapso`,kind:`channel`,tagline:`Managed WhatsApp conversations, media, buttons, and history through Kapso.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`photon`,name:`Photon`,kind:`channel`,tagline:`iMessage through Photon, with guided project and phone setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-dial`,name:`Dial`,kind:`channel`,tagline:`Give your agent a phone number for SMS, MMS, iMessage, and voice transcripts.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-agentphone`,name:`AgentPhone`,kind:`channel`,tagline:`SMS, MMS, iMessage, and voice conversations through AgentPhone.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-lark`,name:`Lark / Feishu`,kind:`channel`,tagline:`Lark and Feishu chats with native card streaming via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-beeper`,name:`Beeper`,kind:`channel`,tagline:`Matrix rooms and bridged messaging networks through Beeper.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-resend`,name:`Resend`,kind:`channel`,tagline:`Send and receive threaded email through Resend via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`agent-browser`,name:`agent-browser`,kind:`extension`,tagline:`Add browser automation tools backed by agent-browser to an eve agent.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`blitzreels`,name:`BlitzReels`,kind:`extension`,tagline:`Turn long videos into short clips, generate media, repair edits, and export.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`mux-video`,name:`Mux Video`,kind:`extension`,tagline:`Create and inspect video assets, make clips, and run Mux Robots workflows.`,surfaces:{scaffoldable:!1,registry:!1,gallery:!0}},{slug:`browserbase`,name:`Browserbase`,kind:`extension`,tagline:`Search, fetch, and automate the web with Browserbase and Stagehand.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`github-tools`,name:`GitHub Tools`,kind:`extension`,tagline:`Add scoped GitHub tools with Vercel Connect authentication and approval rules.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`jetty`,name:`Jetty`,kind:`extension`,tagline:`Grade agent turns, compare experiments, and store durable evaluation trajectories.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`kernel`,name:`KERNEL`,kind:`extension`,tagline:`Let your eve agent use the Internet with KERNEL browser infra, o11y, and stealth. Integrated natively with Vercel Connect and AI Gateway.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`file`,name:`File memory`,kind:`memory`,tagline:`Store durable per-principal memory in a private Vercel Blob store provisioned for the agent.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`supermemory`,name:`Supermemory`,kind:`memory`,tagline:`Give your agents long-term memory, user profiles, and SuperRAG across conversations and context.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`upstash-agentkit`,name:`Upstash AgentKit`,kind:`memory`,tagline:`Give your agents ranked recall and automatic capture on Upstash Redis, or a Redis backend for file memory.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`arcana`,name:`Kybernesis Arcana`,kind:`memory`,tagline:`Give your agents workspace-scoped long-term memory with automatic recall and deliberate storage.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`hindsight`,name:`Hindsight`,kind:`extension`,tagline:`Recall relevant context before every turn and retain each exchange automatically.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`browser-use`,name:`Browser Use`,kind:`connection`,tagline:`Run managed browser automation tasks through Browser Use's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Browser Use: run browser automation tasks, inspect sessions, and manage browser profiles.`,mcp:{url:`https://api.browser-use.com/v3/mcp`}}},{slug:`vercel`,name:`Vercel`,kind:`connection`,tagline:`Manage Vercel projects, deployments, and logs through Vercel's MCP server.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Vercel: manage projects and deployments, inspect logs, and search documentation.`,mcp:{url:`https://mcp.vercel.com`}}},{slug:`linear`,name:`Linear`,kind:`connection`,tagline:`Issues, projects, cycles, and comments via Linear's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Linear workspace: issues, projects, cycles, and comments.`,mcp:{url:`https://mcp.linear.app/mcp`}}},{slug:`notion`,name:`Notion`,kind:`connection`,tagline:`Search and edit Notion pages and databases over MCP or OpenAPI.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Notion workspace: search and edit pages and databases.`,mcp:{url:`https://mcp.notion.com/mcp`},openapi:{spec:`https://developers.notion.com/openapi.json`,baseUrl:`https://api.notion.com`,headers:{"Notion-Version":`2022-06-28`}}}},{slug:`datadog`,name:`Datadog`,kind:`connection`,tagline:`Query metrics, monitors, and logs through Datadog's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Datadog: query metrics, monitors, logs, and incidents.`,mcp:{url:`https://mcp.datadoghq.com/api/mcp`}}},{slug:`honeycomb`,name:`Honeycomb`,kind:`connection`,tagline:`Explore traces and run queries through Honeycomb's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Honeycomb: explore traces, run queries, and inspect datasets.`,mcp:{url:`https://mcp.honeycomb.io/mcp`}}},{slug:`agentcard`,name:`Agentcard`,kind:`connection`,tagline:`let agents buy online`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:"Agentcard: the agent's wallet. Shop and check out at real merchants (DoorDash, Good Eggs, flights) with the conversational `buy` tool (thread conversation_id on follow-ups), issue a single-use virtual card to pay at any checkout, let the user add their own card, and manage the cash that funds it: balance, top-ups, transactions, KYC, human support.",mcp:{url:`https://mcp.agentcard.sh/mcp`}}},{slug:`airtable`,name:`Airtable`,kind:`connection`,tagline:`Bases, tables, and records through Airtable's MCP server.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Airtable: bases, tables, and records.`,mcp:{url:`https://mcp.airtable.com/mcp`}}},{slug:`bitly`,name:`Bitly`,kind:`connection`,tagline:`Shorten links, generate QR Codes, and track performance.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Bitly: shorten links, generate QR Codes, and track link performance.`,mcp:{url:`https://api-ssl.bitly.com/v4/mcp`}}},{slug:`brex`,name:`Brex`,kind:`connection`,tagline:`Expenses, cards, and cash through Brex's finance automation.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Brex: expenses, cards, budgets, and cash.`,mcp:{url:`https://api.brex.com/mcp`}}},{slug:`candid`,name:`Candid`,kind:`connection`,tagline:`Research nonprofits and funders using Candid's data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Candid: research nonprofits, funders, and grants.`,mcp:{url:`https://mcp.candid.org/mcp`}}},{slug:`clickhouse`,name:`ClickHouse`,kind:`connection`,tagline:`Query and explore your ClickHouse Cloud data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`ClickHouse Cloud: query and explore databases and tables.`,mcp:{url:`https://mcp.clickhouse.cloud/mcp`}}},{slug:`cloudinary`,name:`Cloudinary`,kind:`connection`,tagline:`Manage, transform, and deliver your images and videos.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Cloudinary: manage, transform, and deliver image and video assets.`,mcp:{url:`https://asset-management.mcp.cloudinary.com/sse`}}},{slug:`coda`,name:`Coda`,kind:`connection`,tagline:`Create, search, and update docs and tables.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Coda: create, search, and update docs and tables.`,mcp:{url:`https://coda.io/apis/mcp`}}},{slug:`context`,name:`context.dev`,kind:`connection`,tagline:`search, scrape, extract, and monitor live web data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`context.dev: search the live web, scrape and crawl sites, extract structured data, parse files, retrieve brand intelligence, monitor changes, and run batch jobs.`,mcp:{url:`https://mcp.context.dev/mcp`}}},{slug:`egnyte`,name:`Egnyte`,kind:`connection`,tagline:`Securely access and analyze Egnyte content.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Egnyte: search, access, and analyze governed content.`,mcp:{url:`https://mcp-server.egnyte.com/mcp`}}},{slug:`embat`,name:`Embat`,kind:`connection`,tagline:`Ask Embat about cash, debt, payments, and accounting.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Embat: cash, debt, payments, and accounting.`,mcp:{url:`https://tellme.embat.io/mcp`}}},{slug:`hugging-face`,name:`Hugging Face`,kind:`connection`,tagline:`Access the Hugging Face Hub and thousands of Gradio apps.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Hugging Face: models, datasets, Spaces, and Gradio apps on the Hub.`,mcp:{url:`https://huggingface.co/mcp?login&gradio=none`}}},{slug:`local-falcon`,name:`Local Falcon`,kind:`connection`,tagline:`AI visibility and local search intelligence.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Local Falcon: local search rankings and AI visibility reports.`,mcp:{url:`https://mcp.localfalcon.com`}}},{slug:`make`,name:`Make`,kind:`connection`,tagline:`Run Make scenarios and manage your Make account.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Make: run scenarios and manage automations.`,mcp:{url:`https://mcp.make.com`}}},{slug:`manufact`,name:`Manufact`,kind:`connection`,tagline:`Deploy and monitor MCP servers with Manufact.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Manufact: deploy and monitor MCP servers.`,mcp:{url:`https://mcp.manufact.com/mcp`}}},{slug:`mem0`,name:`Mem0`,kind:`connection`,tagline:`Persistent memory for AI agents and assistants.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Mem0: store and retrieve persistent agent memory.`,mcp:{url:`https://mcp.mem0.ai/mcp`}}},{slug:`miro`,name:`Miro`,kind:`connection`,tagline:`Access and create content on Miro boards.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Miro: read and create content on boards.`,mcp:{url:`https://mcp.miro.com/`}}},{slug:`mixpanel`,name:`Mixpanel`,kind:`connection`,tagline:`Analyze, query, and manage your Mixpanel data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Mixpanel: analyze, query, and manage analytics data.`,mcp:{url:`https://mcp.mixpanel.com/mcp`}}},{slug:`natural`,name:`Natural`,kind:`connection`,tagline:`Send, request, and manage payments with Natural.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Natural: agentic payments — send and request payments, check balances, and move funds.`,mcp:{url:`https://mcp.natural.com/mcp`}}},{slug:`neon`,name:`Neon`,kind:`connection`,tagline:`Manage Neon projects, run queries, and make schema changes.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Neon: manage projects, run queries, and make schema changes.`,mcp:{url:`https://mcp.neon.tech/mcp`}}},{slug:`netlify`,name:`Netlify`,kind:`connection`,tagline:`Create, deploy, manage, and secure websites on Netlify.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Netlify: create, deploy, manage, and secure sites.`,mcp:{url:`https://netlify-mcp.netlify.app/mcp`}}},{slug:`oreilly`,name:`O'Reilly`,kind:`connection`,tagline:`Discover O'Reilly's expert learning content.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`O'Reilly: search books, courses, and learning content.`,mcp:{url:`https://api.oreilly.com/api/content-discovery/v1/mcp/`}}},{slug:`planetscale`,name:`PlanetScale`,kind:`connection`,tagline:`Authenticated access to your PlanetScale Postgres and MySQL databases.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`PlanetScale: query Postgres and MySQL databases.`,mcp:{url:`https://mcp.pscale.dev/mcp/planetscale`}}},{slug:`posthog`,name:`PostHog`,kind:`connection`,tagline:`Query, analyze, and manage your PostHog insights.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`PostHog: insights, events, and feature flags.`,mcp:{url:`https://mcp.posthog.com/mcp`}}},{slug:`postman`,name:`Postman`,kind:`connection`,tagline:`Give API context to your coding agents with Postman.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Postman: APIs, collections, and workspaces.`,mcp:{url:`https://mcp.postman.com/minimal`}}},{slug:`razorpay`,name:`Razorpay`,kind:`connection`,tagline:`Razorpay payments, settlements, and dashboard data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Razorpay: payments, settlements, and dashboard data.`,mcp:{url:`https://mcp.razorpay.com/mcp`}}},{slug:`sentry`,name:`Sentry`,kind:`connection`,tagline:`Search, query, and debug errors intelligently.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Sentry: search, query, and debug errors and issues.`,mcp:{url:`https://mcp.sentry.dev/mcp`}}},{slug:`similarweb`,name:`Similarweb`,kind:`connection`,tagline:`Real-time web, mobile app, and market data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Similarweb: web traffic, app, and market intelligence data.`,mcp:{url:`https://mcp.similarweb.com`}}},{slug:`shopify`,name:`Shopify`,kind:`connection`,tagline:`Search products and manage carts and checkouts on a Shopify storefront.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Search products and build carts and checkouts on a Shopify storefront.`,mcp:{url:`https://{shop}.myshopify.com/api/ucp/mcp`}}},{slug:`stripe`,name:`Stripe`,kind:`connection`,tagline:`Payment processing and financial infrastructure tools.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Stripe: payments, customers, billing, and financial infrastructure.`,mcp:{url:`https://mcp.stripe.com`}}},{slug:`supabase`,name:`Supabase`,kind:`connection`,tagline:`Manage databases, authentication, and storage.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Supabase: databases, authentication, and storage.`,mcp:{url:`https://mcp.supabase.com/mcp`}}},{slug:`ticket-tailor`,name:`Ticket Tailor`,kind:`connection`,tagline:`Manage tickets, orders, and events with Ticket Tailor.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Ticket Tailor: events, tickets, and orders.`,mcp:{url:`https://mcp.tickettailor.ai/mcp`}}},{slug:`ticktick`,name:`TickTick`,kind:`connection`,tagline:`Search, create, and manage your tasks and habits in TickTick.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`TickTick: tasks, habits, and lists.`,mcp:{url:`https://mcp.ticktick.com`}}},{slug:`tinybird`,name:`Tinybird`,kind:`connection`,tagline:`Query pipes and data sources in your Tinybird Workspace.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Tinybird: query pipes and data sources, and run SQL. A token grants one Workspace, so add a connection per Workspace.`,mcp:{url:`https://mcp.tinybird.co`}}},{slug:`todoist`,name:`Todoist`,kind:`connection`,tagline:`Search, complete, and manage your tasks in Todoist.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Todoist: search, complete, and manage tasks.`,mcp:{url:`https://ai.todoist.net/mcp`}}},{slug:`webflow`,name:`Webflow`,kind:`connection`,tagline:`Manage Webflow CMS, pages, assets, and sites.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Webflow: CMS items, pages, assets, and sites.`,mcp:{url:`https://mcp.webflow.com/mcp`}}},{slug:`wix`,name:`Wix`,kind:`connection`,tagline:`Manage and build sites and apps on Wix.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Wix: manage and build sites and apps.`,mcp:{url:`https://mcp.wix.com/mcp`}}},{slug:`zapier`,name:`Zapier`,kind:`connection`,tagline:`Automate workflows across thousands of apps.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Zapier: run and manage automations across apps.`,mcp:{url:`https://mcp.zapier.com/api/v1/connect`}}},{slug:`zomato`,name:`Zomato`,kind:`connection`,tagline:`Online food ordering and delivery through Zomato.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Zomato: food ordering and delivery.`,mcp:{url:`https://mcp-server.zomato.com/mcp`}}},{slug:`braintrust`,name:`Braintrust`,kind:`instrumentation`,tagline:`Export AI SDK spans to Braintrust for tracing, evals, and monitoring.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`posthog-instrumentation`,name:`PostHog`,kind:`instrumentation`,tagline:`Send agent traces and generations to PostHog AI Observability.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`sentry-instrumentation`,name:`Sentry`,kind:`instrumentation`,tagline:`Send agent traces to Sentry's OTLP endpoint for tracing and debugging.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`datadog-instrumentation`,name:`Datadog`,kind:`instrumentation`,tagline:`Export agent traces to Datadog APM alongside the rest of your stack.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`honeycomb-instrumentation`,name:`Honeycomb`,kind:`instrumentation`,tagline:`Send OpenTelemetry traces to Honeycomb and query every agent turn.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`arize`,name:`Arize`,kind:`instrumentation`,tagline:`Export traces to Arize AX for LLM observability and evaluation.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`raindrop`,name:`Raindrop`,kind:`instrumentation`,tagline:`Send agent traces to Raindrop to detect and debug AI product issues.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`jaeger`,name:`Jaeger`,kind:`instrumentation`,tagline:`Trace your agent with a local or self-hosted Jaeger OTLP backend.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}}],n=new Map(t.map(e=>[e.slug,e]));function r(e){return n.get(e)}function i(e){return t.filter(t=>t.kind===e)}function a(){return i(`connection`)}function o(){return i(`channel`)}function s(){return i(`extension`)}function c(){return i(`instrumentation`)}function l(){return i(`memory`)}export{t as INTEGRATIONS,o as channelEntries,a as connectionEntries,e as connectionProtocols,s as extensionEntries,r as getIntegrationEntry,c as instrumentationEntries,i as integrationsByKind,l as memoryEntries};
|
|
1
|
+
function e(e){return[e.mcp?`mcp`:null,e.openapi?`openapi`:null].filter(e=>e!==null)}const t=[{slug:`slack`,name:`Slack`,kind:`channel`,tagline:`Mention your agent in channels and DMs, with Connect-managed auth.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0}},{slug:`discord`,name:`Discord`,kind:`channel`,tagline:`Run your agent as a Discord bot across servers and threads.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`teams`,name:`Microsoft Teams`,kind:`channel`,tagline:`Bring your agent into Teams chats and channels.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`telegram`,name:`Telegram`,kind:`channel`,tagline:`Connect your agent to a Telegram bot for 1:1 and group chats.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`twilio`,name:`Twilio`,kind:`channel`,tagline:`Put your agent on a phone number: SMS and speech-transcribed calls.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`blooio`,name:`Blooio`,kind:`channel`,tagline:`Send and receive iMessage, RCS, and SMS through Blooio.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`github`,name:`GitHub`,kind:`channel`,tagline:`Drive your agent from issues, pull requests, and comments, with guided Connect setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`linear-agent`,name:`Linear Agent`,kind:`channel`,tagline:`Delegate Linear issues and comments through Agent Sessions, with guided Connect setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`eve`,name:`Web Chat`,kind:`channel`,tagline:`Embed a first-party web chat UI backed by your agent.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0}},{slug:`buzz`,name:`Buzz`,kind:`channel`,tagline:`Talk to your eve agent from Buzz through its ACP desktop harness.`,surfaces:{scaffoldable:!1,registry:!1,gallery:!0}},{slug:`chat-sdk-gchat`,name:`Google Chat`,kind:`channel`,tagline:`Google Chat spaces and DMs via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-whatsapp`,name:`WhatsApp`,kind:`channel`,tagline:`Customer messaging through WhatsApp Business Cloud via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-x`,name:`X`,kind:`channel`,tagline:`Public mentions and DMs on X via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-messenger`,name:`Messenger`,kind:`channel`,tagline:`Facebook Messenger bots with templates, buttons, and reactions via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-zernio`,name:`Zernio`,kind:`channel`,tagline:`Reach seven social and messaging platforms through one Zernio integration.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-velt`,name:`Velt`,kind:`channel`,tagline:`Add agents to anchored comments across documents, canvases, PDFs, and video.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-sendblue`,name:`Sendblue`,kind:`channel`,tagline:`Send and receive iMessage, SMS, and RCS through Sendblue.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-novu`,name:`Novu`,kind:`channel`,tagline:`Reach Slack, Teams, WhatsApp, Telegram, and email through Novu.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-liveblocks`,name:`Liveblocks`,kind:`channel`,tagline:`Bring your agent into Liveblocks comment threads, mentions, and reactions.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`linq`,name:`Linq`,kind:`channel`,tagline:`iMessage and SMS conversations through Linq, with guided Connect or portable setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-kapso`,name:`Kapso`,kind:`channel`,tagline:`Managed WhatsApp conversations, media, buttons, and history through Kapso.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`photon`,name:`Photon`,kind:`channel`,tagline:`iMessage through Photon, with guided project and phone setup.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-dial`,name:`Dial`,kind:`channel`,tagline:`Give your agent a phone number for SMS, MMS, iMessage, and voice transcripts.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-agentphone`,name:`AgentPhone`,kind:`channel`,tagline:`SMS, MMS, iMessage, and voice conversations through AgentPhone.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-lark`,name:`Lark / Feishu`,kind:`channel`,tagline:`Lark and Feishu chats with native card streaming via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-beeper`,name:`Beeper`,kind:`channel`,tagline:`Matrix rooms and bridged messaging networks through Beeper.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-resend`,name:`Resend`,kind:`channel`,tagline:`Send and receive threaded email through Resend via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`chat-sdk-gmail`,name:`Gmail`,kind:`channel`,tagline:`Turn labelled Gmail threads into agent conversations via the Chat SDK.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`agent-browser`,name:`agent-browser`,kind:`extension`,tagline:`Add browser automation tools backed by agent-browser to an eve agent.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`blitzreels`,name:`BlitzReels`,kind:`extension`,tagline:`Turn long videos into short clips, generate media, repair edits, and export.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`mux-video`,name:`Mux Video`,kind:`extension`,tagline:`Create and inspect video assets, make clips, and run Mux Robots workflows.`,surfaces:{scaffoldable:!1,registry:!1,gallery:!0}},{slug:`browserbase`,name:`Browserbase`,kind:`extension`,tagline:`Search, fetch, and automate the web with Browserbase and Stagehand.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`github-tools`,name:`GitHub Tools`,kind:`extension`,tagline:`Add scoped GitHub tools with Vercel Connect authentication and approval rules.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`jetty`,name:`Jetty`,kind:`extension`,tagline:`Grade agent turns, compare experiments, and store durable evaluation trajectories.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`kernel`,name:`KERNEL`,kind:`extension`,tagline:`Let your eve agent use the Internet with KERNEL browser infra, o11y, and stealth. Integrated natively with Vercel Connect and AI Gateway.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`file`,name:`File memory`,kind:`memory`,tagline:`Store durable per-principal memory in a private Vercel Blob store provisioned for the agent.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`supermemory`,name:`Supermemory`,kind:`memory`,tagline:`Give your agents long-term memory, user profiles, and SuperRAG across conversations and context.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`upstash-agentkit`,name:`Upstash AgentKit`,kind:`memory`,tagline:`Give your agents ranked recall and automatic capture on Upstash Redis, or a Redis backend for file memory.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`arcana`,name:`Kybernesis Arcana`,kind:`memory`,tagline:`Give your agents workspace-scoped long-term memory with automatic recall and deliberate storage.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`hindsight`,name:`Hindsight`,kind:`extension`,tagline:`Recall relevant context before every turn and retain each exchange automatically.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`browser-use`,name:`Browser Use`,kind:`connection`,tagline:`Run managed browser automation tasks through Browser Use's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Browser Use: run browser automation tasks, inspect sessions, and manage browser profiles.`,mcp:{url:`https://api.browser-use.com/v3/mcp`}}},{slug:`vercel`,name:`Vercel`,kind:`connection`,tagline:`Manage Vercel projects, deployments, and logs through Vercel's MCP server.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Vercel: manage projects and deployments, inspect logs, and search documentation.`,mcp:{url:`https://mcp.vercel.com`}}},{slug:`linear`,name:`Linear`,kind:`connection`,tagline:`Issues, projects, cycles, and comments via Linear's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Linear workspace: issues, projects, cycles, and comments.`,mcp:{url:`https://mcp.linear.app/mcp`}}},{slug:`notion`,name:`Notion`,kind:`connection`,tagline:`Search and edit Notion pages and databases over MCP or OpenAPI.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Notion workspace: search and edit pages and databases.`,mcp:{url:`https://mcp.notion.com/mcp`},openapi:{spec:`https://developers.notion.com/openapi.json`,baseUrl:`https://api.notion.com`,headers:{"Notion-Version":`2022-06-28`}}}},{slug:`datadog`,name:`Datadog`,kind:`connection`,tagline:`Query metrics, monitors, and logs through Datadog's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Datadog: query metrics, monitors, logs, and incidents.`,mcp:{url:`https://mcp.datadoghq.com/api/mcp`}}},{slug:`honeycomb`,name:`Honeycomb`,kind:`connection`,tagline:`Explore traces and run queries through Honeycomb's MCP server.`,surfaces:{scaffoldable:!0,registry:!0,gallery:!0},connection:{description:`Honeycomb: explore traces, run queries, and inspect datasets.`,mcp:{url:`https://mcp.honeycomb.io/mcp`}}},{slug:`agentcard`,name:`Agentcard`,kind:`connection`,tagline:`let agents buy online`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:"Agentcard: the agent's wallet. Shop and check out at real merchants (DoorDash, Good Eggs, flights) with the conversational `buy` tool (thread conversation_id on follow-ups), issue a single-use virtual card to pay at any checkout, let the user add their own card, and manage the cash that funds it: balance, top-ups, transactions, KYC, human support.",mcp:{url:`https://mcp.agentcard.sh/mcp`}}},{slug:`airtable`,name:`Airtable`,kind:`connection`,tagline:`Bases, tables, and records through Airtable's MCP server.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Airtable: bases, tables, and records.`,mcp:{url:`https://mcp.airtable.com/mcp`}}},{slug:`bitly`,name:`Bitly`,kind:`connection`,tagline:`Shorten links, generate QR Codes, and track performance.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Bitly: shorten links, generate QR Codes, and track link performance.`,mcp:{url:`https://api-ssl.bitly.com/v4/mcp`}}},{slug:`brex`,name:`Brex`,kind:`connection`,tagline:`Expenses, cards, and cash through Brex's finance automation.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Brex: expenses, cards, budgets, and cash.`,mcp:{url:`https://api.brex.com/mcp`}}},{slug:`candid`,name:`Candid`,kind:`connection`,tagline:`Research nonprofits and funders using Candid's data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Candid: research nonprofits, funders, and grants.`,mcp:{url:`https://mcp.candid.org/mcp`}}},{slug:`clickhouse`,name:`ClickHouse`,kind:`connection`,tagline:`Query and explore your ClickHouse Cloud data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`ClickHouse Cloud: query and explore databases and tables.`,mcp:{url:`https://mcp.clickhouse.cloud/mcp`}}},{slug:`cloudinary`,name:`Cloudinary`,kind:`connection`,tagline:`Manage, transform, and deliver your images and videos.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Cloudinary: manage, transform, and deliver image and video assets.`,mcp:{url:`https://asset-management.mcp.cloudinary.com/sse`}}},{slug:`coda`,name:`Coda`,kind:`connection`,tagline:`Create, search, and update docs and tables.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Coda: create, search, and update docs and tables.`,mcp:{url:`https://coda.io/apis/mcp`}}},{slug:`context`,name:`context.dev`,kind:`connection`,tagline:`search, scrape, extract, and monitor live web data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`context.dev: search the live web, scrape and crawl sites, extract structured data, parse files, retrieve brand intelligence, monitor changes, and run batch jobs.`,mcp:{url:`https://mcp.context.dev/mcp`}}},{slug:`egnyte`,name:`Egnyte`,kind:`connection`,tagline:`Securely access and analyze Egnyte content.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Egnyte: search, access, and analyze governed content.`,mcp:{url:`https://mcp-server.egnyte.com/mcp`}}},{slug:`embat`,name:`Embat`,kind:`connection`,tagline:`Ask Embat about cash, debt, payments, and accounting.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Embat: cash, debt, payments, and accounting.`,mcp:{url:`https://tellme.embat.io/mcp`}}},{slug:`hugging-face`,name:`Hugging Face`,kind:`connection`,tagline:`Access the Hugging Face Hub and thousands of Gradio apps.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Hugging Face: models, datasets, Spaces, and Gradio apps on the Hub.`,mcp:{url:`https://huggingface.co/mcp?login&gradio=none`}}},{slug:`local-falcon`,name:`Local Falcon`,kind:`connection`,tagline:`AI visibility and local search intelligence.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Local Falcon: local search rankings and AI visibility reports.`,mcp:{url:`https://mcp.localfalcon.com`}}},{slug:`make`,name:`Make`,kind:`connection`,tagline:`Run Make scenarios and manage your Make account.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Make: run scenarios and manage automations.`,mcp:{url:`https://mcp.make.com`}}},{slug:`manufact`,name:`Manufact`,kind:`connection`,tagline:`Deploy and monitor MCP servers with Manufact.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Manufact: deploy and monitor MCP servers.`,mcp:{url:`https://mcp.manufact.com/mcp`}}},{slug:`mem0`,name:`Mem0`,kind:`connection`,tagline:`Persistent memory for AI agents and assistants.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Mem0: store and retrieve persistent agent memory.`,mcp:{url:`https://mcp.mem0.ai/mcp`}}},{slug:`miro`,name:`Miro`,kind:`connection`,tagline:`Access and create content on Miro boards.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Miro: read and create content on boards.`,mcp:{url:`https://mcp.miro.com/`}}},{slug:`mixpanel`,name:`Mixpanel`,kind:`connection`,tagline:`Analyze, query, and manage your Mixpanel data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Mixpanel: analyze, query, and manage analytics data.`,mcp:{url:`https://mcp.mixpanel.com/mcp`}}},{slug:`natural`,name:`Natural`,kind:`connection`,tagline:`Send, request, and manage payments with Natural.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Natural: agentic payments — send and request payments, check balances, and move funds.`,mcp:{url:`https://mcp.natural.com/mcp`}}},{slug:`neon`,name:`Neon`,kind:`connection`,tagline:`Manage Neon projects, run queries, and make schema changes.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Neon: manage projects, run queries, and make schema changes.`,mcp:{url:`https://mcp.neon.tech/mcp`}}},{slug:`netlify`,name:`Netlify`,kind:`connection`,tagline:`Create, deploy, manage, and secure websites on Netlify.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Netlify: create, deploy, manage, and secure sites.`,mcp:{url:`https://netlify-mcp.netlify.app/mcp`}}},{slug:`oreilly`,name:`O'Reilly`,kind:`connection`,tagline:`Discover O'Reilly's expert learning content.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`O'Reilly: search books, courses, and learning content.`,mcp:{url:`https://api.oreilly.com/api/content-discovery/v1/mcp/`}}},{slug:`planetscale`,name:`PlanetScale`,kind:`connection`,tagline:`Authenticated access to your PlanetScale Postgres and MySQL databases.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`PlanetScale: query Postgres and MySQL databases.`,mcp:{url:`https://mcp.pscale.dev/mcp/planetscale`}}},{slug:`posthog`,name:`PostHog`,kind:`connection`,tagline:`Query, analyze, and manage your PostHog insights.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`PostHog: insights, events, and feature flags.`,mcp:{url:`https://mcp.posthog.com/mcp`}}},{slug:`postman`,name:`Postman`,kind:`connection`,tagline:`Give API context to your coding agents with Postman.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Postman: APIs, collections, and workspaces.`,mcp:{url:`https://mcp.postman.com/minimal`}}},{slug:`razorpay`,name:`Razorpay`,kind:`connection`,tagline:`Razorpay payments, settlements, and dashboard data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Razorpay: payments, settlements, and dashboard data.`,mcp:{url:`https://mcp.razorpay.com/mcp`}}},{slug:`sentry`,name:`Sentry`,kind:`connection`,tagline:`Search, query, and debug errors intelligently.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Sentry: search, query, and debug errors and issues.`,mcp:{url:`https://mcp.sentry.dev/mcp`}}},{slug:`similarweb`,name:`Similarweb`,kind:`connection`,tagline:`Real-time web, mobile app, and market data.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Similarweb: web traffic, app, and market intelligence data.`,mcp:{url:`https://mcp.similarweb.com`}}},{slug:`shopify`,name:`Shopify`,kind:`connection`,tagline:`Search products and manage carts and checkouts on a Shopify storefront.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Search products and build carts and checkouts on a Shopify storefront.`,mcp:{url:`https://{shop}.myshopify.com/api/ucp/mcp`}}},{slug:`stripe`,name:`Stripe`,kind:`connection`,tagline:`Payment processing and financial infrastructure tools.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Stripe: payments, customers, billing, and financial infrastructure.`,mcp:{url:`https://mcp.stripe.com`}}},{slug:`supabase`,name:`Supabase`,kind:`connection`,tagline:`Manage databases, authentication, and storage.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Supabase: databases, authentication, and storage.`,mcp:{url:`https://mcp.supabase.com/mcp`}}},{slug:`ticket-tailor`,name:`Ticket Tailor`,kind:`connection`,tagline:`Manage tickets, orders, and events with Ticket Tailor.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Ticket Tailor: events, tickets, and orders.`,mcp:{url:`https://mcp.tickettailor.ai/mcp`}}},{slug:`ticktick`,name:`TickTick`,kind:`connection`,tagline:`Search, create, and manage your tasks and habits in TickTick.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`TickTick: tasks, habits, and lists.`,mcp:{url:`https://mcp.ticktick.com`}}},{slug:`tinybird`,name:`Tinybird`,kind:`connection`,tagline:`Query pipes and data sources in your Tinybird Workspace.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Tinybird: query pipes and data sources, and run SQL. A token grants one Workspace, so add a connection per Workspace.`,mcp:{url:`https://mcp.tinybird.co`}}},{slug:`todoist`,name:`Todoist`,kind:`connection`,tagline:`Search, complete, and manage your tasks in Todoist.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Todoist: search, complete, and manage tasks.`,mcp:{url:`https://ai.todoist.net/mcp`}}},{slug:`webflow`,name:`Webflow`,kind:`connection`,tagline:`Manage Webflow CMS, pages, assets, and sites.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Webflow: CMS items, pages, assets, and sites.`,mcp:{url:`https://mcp.webflow.com/mcp`}}},{slug:`wix`,name:`Wix`,kind:`connection`,tagline:`Manage and build sites and apps on Wix.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Wix: manage and build sites and apps.`,mcp:{url:`https://mcp.wix.com/mcp`}}},{slug:`zapier`,name:`Zapier`,kind:`connection`,tagline:`Automate workflows across thousands of apps.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Zapier: run and manage automations across apps.`,mcp:{url:`https://mcp.zapier.com/api/v1/connect`}}},{slug:`zomato`,name:`Zomato`,kind:`connection`,tagline:`Online food ordering and delivery through Zomato.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0},connection:{description:`Zomato: food ordering and delivery.`,mcp:{url:`https://mcp-server.zomato.com/mcp`}}},{slug:`braintrust`,name:`Braintrust`,kind:`instrumentation`,tagline:`Export AI SDK spans to Braintrust for tracing, evals, and monitoring.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`posthog-instrumentation`,name:`PostHog`,kind:`instrumentation`,tagline:`Send agent traces and generations to PostHog AI Observability.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`sentry-instrumentation`,name:`Sentry`,kind:`instrumentation`,tagline:`Send agent traces to Sentry's OTLP endpoint for tracing and debugging.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`datadog-instrumentation`,name:`Datadog`,kind:`instrumentation`,tagline:`Export agent traces to Datadog APM alongside the rest of your stack.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`honeycomb-instrumentation`,name:`Honeycomb`,kind:`instrumentation`,tagline:`Send OpenTelemetry traces to Honeycomb and query every agent turn.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`arize`,name:`Arize`,kind:`instrumentation`,tagline:`Export traces to Arize AX for LLM observability and evaluation.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`raindrop`,name:`Raindrop`,kind:`instrumentation`,tagline:`Send agent traces to Raindrop to detect and debug AI product issues.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}},{slug:`jaeger`,name:`Jaeger`,kind:`instrumentation`,tagline:`Trace your agent with a local or self-hosted Jaeger OTLP backend.`,surfaces:{scaffoldable:!1,registry:!0,gallery:!0}}],n=new Map(t.map(e=>[e.slug,e]));function r(e){return n.get(e)}function i(e){return t.filter(t=>t.kind===e)}function a(){return i(`connection`)}function o(){return i(`channel`)}function s(){return i(`extension`)}function c(){return i(`instrumentation`)}function l(){return i(`memory`)}export{t as INTEGRATIONS,o as channelEntries,a as connectionEntries,e as connectionProtocols,s as extensionEntries,r as getIntegrationEntry,c as instrumentationEntries,i as integrationsByKind,l as memoryEntries};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_chunks/workflow/dist-
|
|
1
|
+
import"../../_chunks/workflow/dist-D38gP7YF.js";import{An as e,Kn as t,Vn as n}from"../../_chunks/workflow/logger-NN5YHpYy.js";import{i as r,u as i}from"../../_chunks/workflow/dist-xTushGCp.js";import{G as a,W as o,b as s,ct as c,i as l,it as u,lt as d,nt as f,rt as p,st as m,tt as h,ut as g,w as _}from"../../_chunks/workflow/serialization-C5KgPESk.js";import{a as v,i as y,r as b,t as x}from"../../_chunks/workflow/attribute-changes-A6HfMNG3.js";import{n as S}from"../../_chunks/workflow/resume-hook-CAqlhwic.js";import{t as C}from"../../_chunks/workflow/sleep-CbUwdv6O.js";function w(e){y(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,w)}function T(e){y(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,T)}function E({schema:e}={}){function t(e){y(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await S(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
|
|
2
2
|
`)}`)}return await S(t,r.value)}}}async function D(e,n={}){let i=a.getStore(),o=i?.workflowMetadata?.workflowRunId;if(!o)throw new r(`setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let s=x(e,n);if(s.length!==0){if(i.runReadyBarrier)try{await i.runReadyBarrier}catch{}await(await t()).events.create(o,{eventType:`attr_set`,specVersion:7,eventData:{changes:s,writer:{type:`step`,stepId:i.stepMetadata.stepId,attempt:i.stepMetadata.attempt},...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}}function O(){let e=a.getStore();return e||b(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,O),e.stepMetadata}function k(){let e=a.getStore();return e||v(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,k),e.workflowMetadata}function A(t={}){let r=a.getStore();r||v(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,A);let{namespace:i}=t,y=r.workflowMetadata.workflowRunId,b=o(y,i);r.writables??=new Map;let x=r.writables,S=x.get(b);if(S)return S.writable;let C=h();C.deferReleaseSettlement=r.streamStates!==void 0;let w=_(s(globalThis,r.ops,y,r.encryptionKey,!0,r.runReadyBarrier),r.encryptionKey),T=new l(y,b,r.runReadyBarrier);r.streamStates??=[],r.streamStates.push(C),r.ops.push(C.promise),f(w.readable,T,C).catch(()=>{});let E=u(w.writable,C);return p(E,C),Object.defineProperty(E,m,{value:b,writable:!1}),Object.defineProperty(E,g,{value:y,writable:!1}),r.workflowDeploymentId&&Object.defineProperty(E,c,{value:r.workflowDeploymentId,writable:!1}),e(r.encryptionKey)&&Object.defineProperty(E,d,{value:n(r.encryptionKey.keyPair.publicKey),writable:!1}),x.set(b,{writable:E,state:C}),E}export{r as FatalError,i as RetryableError,w as createHook,T as createWebhook,E as defineHook,O as getStepMetadata,k as getWorkflowMetadata,A as getWritable,D as setAttributes,C as sleep};
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
* user error · FatalError
|
|
8
8
|
* run wrun_…
|
|
9
9
|
* step step_… · add (./workflows/x)
|
|
10
|
+
* cause TypeError: fetch failed
|
|
10
11
|
* hint: Move the call to a step function.
|
|
11
12
|
* FatalError: …
|
|
12
13
|
* at … (trimmed stack, internals collapsed)
|
|
13
14
|
*
|
|
15
|
+
* The stack body comes from the message when the caller embedded it there,
|
|
16
|
+
* and from the `errorStack` metadata field otherwise.
|
|
17
|
+
*
|
|
14
18
|
* Without this composition, callers passing `${framing}\n${stack}` as the
|
|
15
19
|
* message and structured fields as the metadata object got `util.inspect`'s
|
|
16
20
|
* default object dump appended *after* the stack, which buries the run ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,E as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S,w as C,x as w,y as T}from"../../../_chunks/workflow/helpers-
|
|
1
|
+
import{C as e,E as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S,w as C,x as w,y as T}from"../../../_chunks/workflow/helpers-6kObVbfS.js";export{b as SLOT_GAP_RECHECK_ATTEMPTS,h as absorbSkippedSlotReport,v as appendEventLog,f as appendUniqueEvents,a as findEventSlotGap,g as getQueueOverhead,y as getWorkflowQueueName,s as handleHealthCheckMessage,p as healthCheck,x as insertEventByEventId,c as isSlotGapCheckEnabled,l as loadWorkflowRunEvents,_ as maxEventSlot,m as memoizeEncryptionKey,d as mergeReportedEvents,u as parseHealthCheckPayload,i as preconditionEventDelta,S as queueMessage,T as queueMessages,o as resolveRunEncryptionKey,w as rootRunIdFrom,n as runDispatchContext,e as settleEventSlotGap,C as slotSnapshotParams,r as stepDispatchIdempotencyKey,t as withHealthCheck};
|