@assistant-ui/eve 0.0.18 → 0.0.19

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.
@@ -1,20 +1,19 @@
1
- import { AppendMessage, RespondToToolApprovalOptions, ThreadMessage } from "@assistant-ui/core";
2
- import { EveAuthorizationOutcome, EveAuthorizationPart, EveMessage, EveMessageData, EveMessageInputRequest } from "eve/react";
3
- import { InputResponse } from "eve/client";
4
- //#region src/convertEveMessages.d.ts
1
+ import { type AppendMessage, type RespondToToolApprovalOptions, type ThreadMessage } from "@assistant-ui/core";
2
+ import type { EveAuthorizationOutcome, EveAuthorizationPart, EveMessage, EveMessageData, EveMessageInputRequest } from "eve/react";
3
+ import type { InputResponse } from "eve/client";
5
4
  export type ConvertEveMessagesOptions = {
6
- /**
7
- * Marks the last assistant message as running while Eve is submitting or
8
- * streaming. When omitted, a message carrying Eve's `"streaming"` marker is
9
- * treated as running; pass `false` to settle interrupted messages to a
10
- * terminal status.
11
- */
12
- readonly isRunning?: boolean | undefined;
13
- /**
14
- * The Eve session error, mapped onto the assistant message it interrupted.
15
- */
16
- readonly error?: unknown;
17
- readonly getCreatedAt?: ((message: EveMessage) => Date) | undefined;
5
+ /**
6
+ * Marks the last assistant message as running while Eve is submitting or
7
+ * streaming. When omitted, a message carrying Eve's `"streaming"` marker is
8
+ * treated as running; pass `false` to settle interrupted messages to a
9
+ * terminal status.
10
+ */
11
+ readonly isRunning?: boolean | undefined;
12
+ /**
13
+ * The Eve session error, mapped onto the assistant message it interrupted.
14
+ */
15
+ readonly error?: unknown;
16
+ readonly getCreatedAt?: ((message: EveMessage) => Date) | undefined;
18
17
  };
19
18
  /**
20
19
  * Payload of the `authorization` data part the Eve runtime emits for a
@@ -28,16 +27,16 @@ export type ConvertEveMessagesOptions = {
28
27
  * re-identify a challenge among several.
29
28
  */
30
29
  export type EveAuthorizationData = {
31
- readonly state: EveAuthorizationPart["state"];
32
- readonly name: string;
33
- readonly displayName?: string;
34
- readonly description?: string;
35
- readonly url?: string;
36
- readonly userCode?: string;
37
- readonly instructions?: string;
38
- readonly expiresAt?: string;
39
- readonly outcome?: EveAuthorizationOutcome;
40
- readonly reason?: string;
30
+ readonly state: EveAuthorizationPart["state"];
31
+ readonly name: string;
32
+ readonly displayName?: string;
33
+ readonly description?: string;
34
+ readonly url?: string;
35
+ readonly userCode?: string;
36
+ readonly instructions?: string;
37
+ readonly expiresAt?: string;
38
+ readonly outcome?: EveAuthorizationOutcome;
39
+ readonly reason?: string;
41
40
  };
42
41
  /**
43
42
  * Converts a single Eve message into an assistant-ui thread message.
@@ -53,13 +52,13 @@ export declare const convertEveMessages: (data: EveMessageData, options?: Conver
53
52
  * assignability to the send call site, checked against the installed version.
54
53
  */
55
54
  export type EveMessageContent = string | ({
56
- readonly type: "text";
57
- readonly text: string;
55
+ readonly type: "text";
56
+ readonly text: string;
58
57
  } | {
59
- readonly type: "file";
60
- readonly data: string;
61
- readonly mediaType: string;
62
- readonly filename?: string;
58
+ readonly type: "file";
59
+ readonly data: string;
60
+ readonly mediaType: string;
61
+ readonly filename?: string;
63
62
  })[];
64
63
  /**
65
64
  * Converts an assistant-ui append message into the message payload accepted by
@@ -97,5 +96,4 @@ export declare const findEveInputRequest: (data: EveMessageData, approvalId: str
97
96
  * a guess about one.
98
97
  */
99
98
  export declare const toEveInputResponse: (response: RespondToToolApprovalOptions, inputRequest?: EveMessageInputRequest) => InputResponse;
100
- //#endregion
101
99
  //# sourceMappingURL=convertEveMessages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertEveMessages.d.ts","names":[],"sources":["../src/convertEveMessages.ts"],"mappings":";;;;YAqDY;;;;;;;WAOD;;;;WAIA;WACA,iBAAiB,SAAS,eAAe;;;;;;;;;;;;;YA0PxC;WACD,OAAO;WACP;WACA;WACA;WACA;WACA;WACA;WACA;WACA,UAAU;WACV;;;;;qBA6IE,oBACX,SAAS,YACT,eACA,mBAAmB,cACnB,UAAS,8BACR;;;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reamEvent } from "eve/client";
3
2
  export type TurnTimestamps = {
4
- readonly user?: Date;
5
- readonly assistant?: Date;
3
+ readonly user?: Date;
4
+ readonly assistant?: Date;
6
5
  };
7
6
  export type TurnTimestampCache = {
8
- lastEvents: readonly MessageStreamEvent[];
9
- timestamps: ReadonlyMap<string, TurnTimestamps>;
7
+ lastEvents: readonly MessageStreamEvent[];
8
+ timestamps: ReadonlyMap<string, TurnTimestamps>;
10
9
  };
11
10
  export declare const createTurnTimestampCache: () => TurnTimestampCache;
12
11
  /**
@@ -18,5 +17,4 @@ export declare const createTurnTimestampCache: () => TurnTimestampCache;
18
17
  * makes the render-phase cache writes safe when React discards a render.
19
18
  */
20
19
  export declare const collectTurnTimestamps: (events: readonly MessageStreamEvent[], cache: TurnTimestampCache) => ReadonlyMap<string, TurnTimestamps>;
21
- //#endregion
22
20
  //# sourceMappingURL=deriveCreatedAt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deriveCreatedAt.d.ts","names":[],"sources":["../src/deriveCreatedAt.ts"],"mappings":";;YAEY;WACD,OAAO;WACP,YAAY;;YAGX;EACV,qBAAqB;EACrB,YAAY,oBAAoB;;qBAiCrB,gCAA+B;;;;;;;;;qBAa/B,wBACX,iBAAiB,sBACjB,OAAO,uBACN,oBAAoB"}
1
+ {"version":3,"file":"deriveCreatedAt.d.ts","sourceRoot":"","sources":["../src/deriveCreatedAt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC1C,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACjD,CAAC;AAgCF,eAAO,MAAM,wBAAwB,QAAO,kBAG1C,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,kBAAkB,EAAE,EACrC,OAAO,kBAAkB,KACxB,WAAW,CAAC,MAAM,EAAE,cAAc,CA0CpC,CAAC"}
@@ -50,6 +50,7 @@ const collectTurnTimestamps = (events, cache) => {
50
50
  }
51
51
  for (let i = resumesScan ? scanned.length : 0; i < events.length; i++) {
52
52
  const event = events[i];
53
+ if (!Object.prototype.hasOwnProperty.call(ROLE_BY_EVENT_TYPE, event.type)) continue;
53
54
  const role = ROLE_BY_EVENT_TYPE[event.type];
54
55
  if (role === void 0) continue;
55
56
  const data = event.data;
@@ -1 +1 @@
1
- {"version":3,"file":"deriveCreatedAt.js","names":[],"sources":["../src/deriveCreatedAt.ts"],"sourcesContent":["import type { MessageStreamEvent } from \"eve/client\";\n\nexport type TurnTimestamps = {\n readonly user?: Date;\n readonly assistant?: Date;\n};\n\nexport type TurnTimestampCache = {\n lastEvents: readonly MessageStreamEvent[];\n timestamps: ReadonlyMap<string, TurnTimestamps>;\n};\n\n/**\n * The reducer cases eve projects into a message: `message.received` creates\n * `${turnId}:user`, and every assistant entry reaches `updateAssistantMessage`,\n * which creates `${turnId}:assistant` for a turn that has none. It enumerates\n * that reducer across the `>=0.32.0` peer range rather than stating a rule\n * about turn ids, because `turn.started` and the compaction events carry one\n * before the model runs. An event eve adds to the creating set later is absent\n * here and falls back to the wall clock instead of stamping a wrong time.\n */\nconst ROLE_BY_EVENT_TYPE: Partial<\n Record<MessageStreamEvent[\"type\"], keyof TurnTimestamps>\n> = {\n \"message.received\": \"user\",\n \"step.started\": \"assistant\",\n \"reasoning.appended\": \"assistant\",\n \"reasoning.completed\": \"assistant\",\n \"action.input.appended\": \"assistant\",\n \"actions.requested\": \"assistant\",\n \"input.requested\": \"assistant\",\n \"action.result\": \"assistant\",\n \"action.partial\": \"assistant\",\n \"authorization.required\": \"assistant\",\n \"authorization.completed\": \"assistant\",\n \"message.appended\": \"assistant\",\n \"message.completed\": \"assistant\",\n \"result.completed\": \"assistant\",\n \"turn.completed\": \"assistant\",\n \"turn.cancelled\": \"assistant\",\n};\n\nexport const createTurnTimestampCache = (): TurnTimestampCache => ({\n lastEvents: [],\n timestamps: new Map(),\n});\n\n/**\n * Eve appends to its log (`[...events, event]`), so a snapshot that keeps the\n * previous scan's last element by identity shares the whole prefix and the\n * scan resumes there. Any other snapshot is re-derived into a fresh map: turn\n * ids are per-session sequence numbers that recur after `reset()`, so entries\n * must not outlive the log that produced them. Re-derivation is also what\n * makes the render-phase cache writes safe when React discards a render.\n */\nexport const collectTurnTimestamps = (\n events: readonly MessageStreamEvent[],\n cache: TurnTimestampCache,\n): ReadonlyMap<string, TurnTimestamps> => {\n if (events === cache.lastEvents) return cache.timestamps;\n\n const scanned = cache.lastEvents;\n const resumesScan =\n scanned.length === 0 ||\n events[scanned.length - 1] === scanned[scanned.length - 1];\n\n let timestamps = cache.timestamps;\n let draft: Map<string, TurnTimestamps> | undefined;\n if (!resumesScan) {\n draft = new Map();\n timestamps = draft;\n }\n for (let i = resumesScan ? scanned.length : 0; i < events.length; i++) {\n const event = events[i]!;\n const role = ROLE_BY_EVENT_TYPE[event.type];\n if (role === undefined) continue;\n const data: unknown = (event as { readonly data?: unknown }).data;\n if (typeof data !== \"object\" || data === null) continue;\n const turnId = (data as { readonly turnId?: unknown }).turnId;\n if (typeof turnId !== \"string\") continue;\n const known = timestamps.get(turnId);\n if (known?.[role] !== undefined) continue;\n const at: unknown = (event as { readonly meta?: { readonly at?: unknown } })\n .meta?.at;\n if (typeof at !== \"string\") continue;\n const date = new Date(at);\n if (Number.isNaN(date.getTime())) continue;\n draft ??= new Map(timestamps);\n draft.set(turnId, { ...known, [role]: date });\n timestamps = draft;\n }\n\n cache.lastEvents = events;\n cache.timestamps = timestamps;\n return timestamps;\n};\n"],"mappings":";;;;;;;;;;AAqBA,MAAM,qBAEF;CACF,o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CACnB,MAAM,aAAa;CACnB,OAAO;AACT"}
1
+ {"version":3,"file":"deriveCreatedAt.js","names":[],"sources":["../src/deriveCreatedAt.ts"],"sourcesContent":["import type { MessageStreamEvent } from \"eve/client\";\n\nexport type TurnTimestamps = {\n readonly user?: Date;\n readonly assistant?: Date;\n};\n\nexport type TurnTimestampCache = {\n lastEvents: readonly MessageStreamEvent[];\n timestamps: ReadonlyMap<string, TurnTimestamps>;\n};\n\n/**\n * The reducer cases eve projects into a message: `message.received` creates\n * `${turnId}:user`, and every assistant entry reaches `updateAssistantMessage`,\n * which creates `${turnId}:assistant` for a turn that has none. It enumerates\n * that reducer across the `>=0.32.0` peer range rather than stating a rule\n * about turn ids, because `turn.started` and the compaction events carry one\n * before the model runs. An event eve adds to the creating set later is absent\n * here and falls back to the wall clock instead of stamping a wrong time.\n */\nconst ROLE_BY_EVENT_TYPE: Partial<\n Record<MessageStreamEvent[\"type\"], keyof TurnTimestamps>\n> = {\n \"message.received\": \"user\",\n \"step.started\": \"assistant\",\n \"reasoning.appended\": \"assistant\",\n \"reasoning.completed\": \"assistant\",\n \"action.input.appended\": \"assistant\",\n \"actions.requested\": \"assistant\",\n \"input.requested\": \"assistant\",\n \"action.result\": \"assistant\",\n \"action.partial\": \"assistant\",\n \"authorization.required\": \"assistant\",\n \"authorization.completed\": \"assistant\",\n \"message.appended\": \"assistant\",\n \"message.completed\": \"assistant\",\n \"result.completed\": \"assistant\",\n \"turn.completed\": \"assistant\",\n \"turn.cancelled\": \"assistant\",\n};\n\nexport const createTurnTimestampCache = (): TurnTimestampCache => ({\n lastEvents: [],\n timestamps: new Map(),\n});\n\n/**\n * Eve appends to its log (`[...events, event]`), so a snapshot that keeps the\n * previous scan's last element by identity shares the whole prefix and the\n * scan resumes there. Any other snapshot is re-derived into a fresh map: turn\n * ids are per-session sequence numbers that recur after `reset()`, so entries\n * must not outlive the log that produced them. Re-derivation is also what\n * makes the render-phase cache writes safe when React discards a render.\n */\nexport const collectTurnTimestamps = (\n events: readonly MessageStreamEvent[],\n cache: TurnTimestampCache,\n): ReadonlyMap<string, TurnTimestamps> => {\n if (events === cache.lastEvents) return cache.timestamps;\n\n const scanned = cache.lastEvents;\n const resumesScan =\n scanned.length === 0 ||\n events[scanned.length - 1] === scanned[scanned.length - 1];\n\n let timestamps = cache.timestamps;\n let draft: Map<string, TurnTimestamps> | undefined;\n if (!resumesScan) {\n draft = new Map();\n timestamps = draft;\n }\n for (let i = resumesScan ? scanned.length : 0; i < events.length; i++) {\n const event = events[i]!;\n // `type` arrives off the wire, so an inherited member such as\n // `__proto__` would resolve here instead of missing, and be used as a\n // timestamp key. Only the table's own entries count.\n if (!Object.prototype.hasOwnProperty.call(ROLE_BY_EVENT_TYPE, event.type))\n continue;\n const role = ROLE_BY_EVENT_TYPE[event.type];\n if (role === undefined) continue;\n const data: unknown = (event as { readonly data?: unknown }).data;\n if (typeof data !== \"object\" || data === null) continue;\n const turnId = (data as { readonly turnId?: unknown }).turnId;\n if (typeof turnId !== \"string\") continue;\n const known = timestamps.get(turnId);\n if (known?.[role] !== undefined) continue;\n const at: unknown = (event as { readonly meta?: { readonly at?: unknown } })\n .meta?.at;\n if (typeof at !== \"string\") continue;\n const date = new Date(at);\n if (Number.isNaN(date.getTime())) continue;\n draft ??= new Map(timestamps);\n draft.set(turnId, { ...known, [role]: date });\n timestamps = draft;\n }\n\n cache.lastEvents = events;\n cache.timestamps = timestamps;\n return timestamps;\n};\n"],"mappings":";;;;;;;;;;AAqBA,MAAM,qBAEF;CACF,oBAAoB;CACpB,gBAAgB;CAChB,sBAAsB;CACtB,uBAAuB;CACvB,yBAAyB;CACzB,qBAAqB;CACrB,mBAAmB;CACnB,iBAAiB;CACjB,kBAAkB;CAClB,0BAA0B;CAC1B,2BAA2B;CAC3B,oBAAoB;CACpB,qBAAqB;CACrB,oBAAoB;CACpB,kBAAkB;CAClB,kBAAkB;AACpB;AAEA,MAAa,kCAAsD;CACjE,YAAY,CAAC;CACb,4BAAY,IAAI,IAAI;AACtB;;;;;;;;;AAUA,MAAa,yBACX,QACA,UACwC;CACxC,IAAI,WAAW,MAAM,YAAY,OAAO,MAAM;CAE9C,MAAM,UAAU,MAAM;CACtB,MAAM,cACJ,QAAQ,WAAW,KACnB,OAAO,QAAQ,SAAS,OAAO,QAAQ,QAAQ,SAAS;CAE1D,IAAI,aAAa,MAAM;CACvB,IAAI;CACJ,IAAI,CAAC,aAAa;EAChB,wBAAQ,IAAI,IAAI;EAChB,aAAa;CACf;CACA,KAAK,IAAI,IAAI,cAAc,QAAQ,SAAS,GAAG,IAAI,OAAO,QAAQ,KAAK;EACrE,MAAM,QAAQ,OAAO;EAIrB,IAAI,CAAC,OAAO,UAAU,eAAe,KAAK,oBAAoB,MAAM,IAAI,GACtE;EACF,MAAM,OAAO,mBAAmB,MAAM;EACtC,IAAI,SAAS,KAAA,GAAW;EACxB,MAAM,OAAiB,MAAsC;EAC7D,IAAI,OAAO,SAAS,YAAY,SAAS,MAAM;EAC/C,MAAM,SAAU,KAAuC;EACvD,IAAI,OAAO,WAAW,UAAU;EAChC,MAAM,QAAQ,WAAW,IAAI,MAAM;EACnC,IAAI,QAAQ,UAAU,KAAA,GAAW;EACjC,MAAM,KAAe,MAClB,MAAM;EACT,IAAI,OAAO,OAAO,UAAU;EAC5B,MAAM,OAAO,IAAI,KAAK,EAAE;EACxB,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,GAAG;EAClC,UAAU,IAAI,IAAI,UAAU;EAC5B,MAAM,IAAI,QAAQ;GAAE,GAAG;IAAQ,OAAO;EAAK,CAAC;EAC5C,aAAa;CACf;CAEA,MAAM,aAAa;CACnB,MAAM,aAAa;CACnB,OAAO;AACT"}
@@ -1,6 +1,4 @@
1
- import { EveMessageData, UseEveAgentHelpers } from "eve/react";
2
- //#region src/eveExtras.d.ts
1
+ import type { EveMessageData, UseEveAgentHelpers } from "eve/react";
3
2
  export type EveRuntimeExtras = Pick<UseEveAgentHelpers<EveMessageData>, "error" | "events" | "session" | "reset">;
4
3
  export declare const eveExtras: import("@assistant-ui/core/react").RuntimeExtras<EveRuntimeExtras>;
5
- //#endregion
6
4
  //# sourceMappingURL=eveExtras.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eveExtras.d.ts","names":[],"sources":["../src/eveExtras.ts"],"mappings":";;YAGY,mBAAmB,KAC7B,mBAAmB;qBAIR,8CAAS,cAAA"}
1
+ {"version":3,"file":"eveExtras.d.ts","sourceRoot":"","sources":["../src/eveExtras.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,kBAAkB,CAAC,cAAc,CAAC,EAClC,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CACzC,CAAC;AAEF,eAAO,MAAM,SAAS,oEACuC,CAAC"}
package/dist/hooks.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { EveRuntimeExtras } from "./eveExtras.js";
2
- //#region src/hooks.d.ts
1
+ import type { EveRuntimeExtras } from "./eveExtras.js";
3
2
  /** Read the last Eve session error from the runtime extras. */
4
3
  export declare const useEveError: () => Error | undefined;
5
4
  /**
@@ -20,5 +19,4 @@ export declare const useEveEvents: () => EveRuntimeExtras["events"];
20
19
  * outside an Eve runtime; invoking the returned function there throws.
21
20
  */
22
21
  export declare const useEveReset: () => () => void;
23
- //#endregion
24
22
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","names":[],"sources":["../src/hooks.ts"],"mappings":";;;qBASa,mBAAW;;;;;;qBAOX,qBAAoB;;;;;qBAOpB,oBAAmB;;;;;;;qBASnB"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAoB;AAIpD,+DAA+D;AAC/D,eAAO,MAAM,WAAW,yBAAiD,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAO,gBAAgB,CAAC,SAAS,CAAC,GAAG,SACnB,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAO,gBAAgB,CAAC,QAAQ,CACX,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kBAGvB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- /// <reference types="@assistant-ui/core/react" />
2
- import { ConvertEveMessagesOptions, EveAuthorizationData, EveMessageContent, convertEveMessage, convertEveMessages, getEveMessageContent, toEveInputResponse } from "./convertEveMessages.js";
3
- import { EveRuntimeExtras } from "./eveExtras.js";
4
- import { useEveError, useEveEvents, useEveReset, useEveSession } from "./hooks.js";
5
- import { UseEveAgentRuntimeOptions, useEveAgentRuntime } from "./useEveAgentRuntime.js";
6
- export { type ConvertEveMessagesOptions, type EveAuthorizationData, type EveMessageContent, type EveRuntimeExtras, type UseEveAgentRuntimeOptions, convertEveMessage, convertEveMessages, getEveMessageContent, toEveInputResponse, useEveAgentRuntime, useEveError, useEveEvents, useEveReset, useEveSession };
1
+ /// <reference types="@assistant-ui/core/react" preserve="true" />
2
+ export { convertEveMessage, convertEveMessages, getEveMessageContent, toEveInputResponse, } from "./convertEveMessages.js";
3
+ export type { ConvertEveMessagesOptions, EveAuthorizationData, EveMessageContent, } from "./convertEveMessages.js";
4
+ export { useEveAgentRuntime } from "./useEveAgentRuntime.js";
5
+ export type { UseEveAgentRuntimeOptions } from "./useEveAgentRuntime.js";
6
+ export { useEveError, useEveEvents, useEveReset, useEveSession } from "./hooks.js";
7
+ export type { EveRuntimeExtras } from "./eveExtras.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,gCAA6B;AAC9B,YAAY,EACV,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,GAClB,gCAA6B;AAC9B,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAC1D,YAAY,EAAE,yBAAyB,EAAE,gCAA6B;AACtE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAgB;AAChF,YAAY,EAAE,gBAAgB,EAAE,uBAAoB"}
@@ -1,14 +1,13 @@
1
- import { AttachmentAdapter, DictationAdapter, ExternalStoreSharedOptions, FeedbackAdapter, RealtimeVoiceAdapter, SpeechSynthesisAdapter } from "@assistant-ui/core";
2
- import { EveMessageData, UseEveAgentOptions } from "eve/react";
3
- //#region src/useEveAgentRuntime.d.ts
1
+ import { type AttachmentAdapter, type DictationAdapter, type ExternalStoreSharedOptions, type FeedbackAdapter, type RealtimeVoiceAdapter, type SpeechSynthesisAdapter } from "@assistant-ui/core";
2
+ import { type EveMessageData, type UseEveAgentOptions } from "eve/react";
4
3
  export type UseEveAgentRuntimeOptions = Omit<UseEveAgentOptions<EveMessageData>, "reducer"> & ExternalStoreSharedOptions & {
5
- readonly adapters?: {
6
- readonly attachments?: AttachmentAdapter | undefined;
7
- readonly speech?: SpeechSynthesisAdapter | undefined;
8
- readonly dictation?: DictationAdapter | undefined;
9
- readonly voice?: RealtimeVoiceAdapter | undefined;
10
- readonly feedback?: FeedbackAdapter | undefined;
11
- } | undefined;
4
+ readonly adapters?: {
5
+ readonly attachments?: AttachmentAdapter | undefined;
6
+ readonly speech?: SpeechSynthesisAdapter | undefined;
7
+ readonly dictation?: DictationAdapter | undefined;
8
+ readonly voice?: RealtimeVoiceAdapter | undefined;
9
+ readonly feedback?: FeedbackAdapter | undefined;
10
+ } | undefined;
12
11
  };
13
12
  /**
14
13
  * Connects Eve's `useEveAgent` hook to assistant-ui's runtime contract.
@@ -18,5 +17,4 @@ export type UseEveAgentRuntimeOptions = Omit<UseEveAgentOptions<EveMessageData>,
18
17
  * tool approval UI.
19
18
  */
20
19
  export declare const useEveAgentRuntime: (options?: UseEveAgentRuntimeOptions) => import("@assistant-ui/core").AssistantRuntime;
21
- //#endregion
22
20
  //# sourceMappingURL=useEveAgentRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEveAgentRuntime.d.ts","names":[],"sources":["../src/useEveAgentRuntime.ts"],"mappings":";;;YA+HY,4BAA4B,KACtC,mBAAmB,8BAGnB;WACW;aAEM,cAAc;aACd,SAAS;aACT,YAAY;aACZ,QAAQ;aACR,WAAW;;;;;;;;;;qBAYjB,qBAAsB,UAAS,2DAA8B"}
1
+ {"version":3,"file":"useEveAgentRuntime.d.ts","sourceRoot":"","sources":["../src/useEveAgentRuntime.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAG5B,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AA6FnB,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,kBAAkB,CAAC,cAAc,CAAC,EAClC,SAAS,CACV,GACC,0BAA0B,GAAG;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EACd;QACE,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;QACrD,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;QACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;QAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;QAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;KACjD,GACD,SAAS,CAAC;CACf,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAS,yBAA8B,kDA6WzE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/eve",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Eve runtime adapter for assistant-ui",
5
5
  "keywords": [
6
6
  "eve",
@@ -28,8 +28,8 @@
28
28
  ],
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@assistant-ui/core": "^0.3.20",
32
- "@assistant-ui/store": "^0.3.14"
31
+ "@assistant-ui/core": "^0.3.21",
32
+ "@assistant-ui/store": "^0.3.15"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@types/react": "*",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "devDependencies": {
45
- "@assistant-ui/x-buildutils": "0.0.28",
45
+ "@assistant-ui/x-buildutils": "0.0.29",
46
46
  "@testing-library/dom": "^10.4.2",
47
47
  "@testing-library/react": "^16.3.3",
48
48
  "@types/react": "^19.3.0",
@@ -187,3 +187,25 @@ describe("collectTurnTimestamps", () => {
187
187
  expect(timestamps.get(TURN)?.assistant).toBe(undefined);
188
188
  });
189
189
  });
190
+
191
+ describe("collectTurnTimestamps prototype-inherited event types", () => {
192
+ // `type` arrives off the wire, so a lookup on a plain object literal can
193
+ // resolve an inherited member instead of missing.
194
+ it.each(["__proto__", "constructor", "toString"])(
195
+ "ignores an event whose type is %s",
196
+ (type) => {
197
+ const cache = createTurnTimestampCache();
198
+ const events = [
199
+ {
200
+ type,
201
+ data: { sequence: 1, turnId: TURN },
202
+ meta: { at: "2026-01-01T00:00:00.000Z", id: "evt_x" },
203
+ },
204
+ ] as unknown as MessageStreamEvent[];
205
+
206
+ const timestamps = collectTurnTimestamps(events, cache);
207
+
208
+ expect(timestamps.get(TURN)).toBeUndefined();
209
+ },
210
+ );
211
+ });
@@ -72,6 +72,11 @@ export const collectTurnTimestamps = (
72
72
  }
73
73
  for (let i = resumesScan ? scanned.length : 0; i < events.length; i++) {
74
74
  const event = events[i]!;
75
+ // `type` arrives off the wire, so an inherited member such as
76
+ // `__proto__` would resolve here instead of missing, and be used as a
77
+ // timestamp key. Only the table's own entries count.
78
+ if (!Object.prototype.hasOwnProperty.call(ROLE_BY_EVENT_TYPE, event.type))
79
+ continue;
75
80
  const role = ROLE_BY_EVENT_TYPE[event.type];
76
81
  if (role === undefined) continue;
77
82
  const data: unknown = (event as { readonly data?: unknown }).data;
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference types="@assistant-ui/core/react" />
1
+ /// <reference types="@assistant-ui/core/react" preserve="true" />
2
2
 
3
3
  export {
4
4
  convertEveMessage,