Download packages/agent-core-v2/src/agent/interaction/interactionOps.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/agent/interaction/interactionOps.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/agent/interaction/interactionOps.ts
-
curl -L -o interactionOps.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/agent/interaction/interactionOps.ts
1.65 kB
| /* oxlint-disable typescript-eslint/no-unsafe-declaration-merging, eslint-plugin-import/namespace -- Event2 class+payload-interface declaration merging is the sanctioned event-declaration idiom. */ | |
| import { z } from 'zod'; | |
| import { AgentEvent2, registerEvent2Class } from '#/app/event/event2'; | |
| import type { InteractionKind } from '#/human/interaction/interaction'; | |
| const interactionRequestSchema = z.object({ | |
| agentId: z.string(), | |
| id: z.string(), | |
| kind: z.enum(['approval', 'question', 'user_tool']), | |
| toolCallId: z.string().optional(), | |
| request: z.unknown(), | |
| }); | |
| export class InteractionRequestEvent extends AgentEvent2< | |
| z.infer<typeof interactionRequestSchema> | |
| > { | |
| static override readonly type = 'interaction.request'; | |
| static override readonly durable = true; | |
| static override readonly schema = interactionRequestSchema; | |
| } | |
| export interface InteractionRequestEvent { | |
| readonly agentId: string; | |
| readonly id: string; | |
| readonly kind: InteractionKind; | |
| readonly toolCallId?: string; | |
| readonly request: unknown; | |
| } | |
| const interactionResolvedSchema = z.object({ | |
| agentId: z.string(), | |
| id: z.string(), | |
| response: z.unknown(), | |
| }); | |
| export class InteractionResolvedEvent extends AgentEvent2< | |
| z.infer<typeof interactionResolvedSchema> | |
| > { | |
| static override readonly type = 'interaction.resolved'; | |
| static override readonly durable = true; | |
| static override readonly schema = interactionResolvedSchema; | |
| } | |
| export interface InteractionResolvedEvent { | |
| readonly agentId: string; | |
| readonly id: string; | |
| readonly response: unknown; | |
| } | |
| registerEvent2Class(InteractionRequestEvent); | |
| registerEvent2Class(InteractionResolvedEvent); | |