()
| 13 | const base64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB" |
| 14 | |
| 15 | const capture = () => { |
| 16 | const published: Array<{ readonly type: string; readonly data: unknown }> = [] |
| 17 | const events = EventV2.Service.of({ |
| 18 | publish: (definition, data) => |
| 19 | Effect.sync(() => { |
| 20 | const event = { id: EventV2.ID.create(), type: definition.type, data } as EventV2.Payload<typeof definition> |
| 21 | published.push({ |
| 22 | type: definition.durable |
| 23 | ? EventV2.versionedType(definition.type, definition.durable.version) |
| 24 | : definition.type, |
| 25 | data, |
| 26 | }) |
| 27 | return event |
| 28 | }), |
| 29 | subscribe: () => Stream.empty, |
| 30 | all: () => Stream.empty, |
| 31 | durable: () => Stream.empty, |
| 32 | listen: () => Effect.succeed(Effect.void), |
| 33 | project: () => Effect.void, |
| 34 | replay: () => Effect.void, |
| 35 | replayAll: () => Effect.succeed(undefined), |
| 36 | remove: () => Effect.void, |
| 37 | claim: () => Effect.void, |
| 38 | }) |
| 39 | return { |
| 40 | published, |
| 41 | publisher: createLLMEventPublisher(events, { |
| 42 | sessionID, |
| 43 | agent: "build", |
| 44 | model: { |
| 45 | id: ModelV2.ID.make("model"), |
| 46 | providerID: ProviderV2.ID.make("provider"), |
| 47 | }, |
| 48 | }), |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | const call = LLMEvent.toolCall({ id: "call-image", name: "read", input: { path: "pixel.png" } }) |
| 53 | const result = LLMEvent.toolResult({ |
no test coverage detected