@otakumesi/heph 0.0.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.
@@ -0,0 +1,1075 @@
1
+ import { z } from "zod";
2
+
3
+ //#region ../core/src/types.d.ts
4
+ type JsonPrimitive = string | number | boolean | null;
5
+ type JsonValue = JsonPrimitive | JsonValue[] | {
6
+ [key: string]: JsonValue;
7
+ };
8
+ type JsonObject = {
9
+ [key: string]: JsonValue;
10
+ };
11
+ type JsonSchema = Record<string, unknown>;
12
+ type AgentSessionId = string;
13
+ type RunId = string;
14
+ type MessageId = string;
15
+ type RunEventId = string;
16
+ type MemoryId = string;
17
+ type InboxEventId = string;
18
+ type DeferredToolOperationId = string;
19
+ type AgentSpecId = string;
20
+ type McpBindingId = string;
21
+ type SkillBindingId = string;
22
+ type ApprovalRequestId = string;
23
+ interface AuthContext {
24
+ subject: string;
25
+ userId?: string | undefined;
26
+ tenantId?: string | undefined;
27
+ roles?: string[] | undefined;
28
+ scopes?: string[] | undefined;
29
+ actorType?: "user" | "service" | "anonymous" | undefined;
30
+ claims?: Record<string, unknown> | undefined;
31
+ }
32
+ interface AuthAdapter {
33
+ authenticate(request: Request): Promise<AuthContext | null>;
34
+ }
35
+ interface SourceRef {
36
+ type: "message" | "run_event" | "artifact" | "manual" | "memory" | "inbox_event" | "mcp_binding" | "skill_binding" | "approval_request" | "deferred_tool_operation";
37
+ id: string;
38
+ }
39
+ interface AgentSession {
40
+ id: AgentSessionId;
41
+ agentSpecId: AgentSpecId;
42
+ agentSpecVersion: string | null;
43
+ state: Record<string, unknown>;
44
+ activeRunId: RunId | null;
45
+ auth: AuthContext | null;
46
+ metadata: Record<string, unknown>;
47
+ createdAt: Date;
48
+ updatedAt: Date;
49
+ }
50
+ type RunStatus = "queued" | "running" | "paused" | "completed" | "failed" | "cancelled";
51
+ type RunInput = {
52
+ type: "user.message" | "steering.message" | "follow_up.message";
53
+ text: string;
54
+ messageIds?: MessageId[];
55
+ payload?: unknown;
56
+ } | {
57
+ type: "approval.granted" | "approval.rejected" | "run.cancel_requested" | "webhook.received" | "system.event";
58
+ payload?: unknown;
59
+ messageIds?: MessageId[];
60
+ };
61
+ interface RunError {
62
+ code?: string;
63
+ message: string;
64
+ details?: Record<string, unknown>;
65
+ }
66
+ interface Run {
67
+ id: RunId;
68
+ agentId: AgentSessionId;
69
+ agentSpecId: AgentSpecId;
70
+ agentSpecVersion: string | null;
71
+ status: RunStatus;
72
+ input: RunInput;
73
+ auth: AuthContext | null;
74
+ contextManifest: ContextManifest | null;
75
+ skillManifest: SkillManifest | null;
76
+ toolManifest: ToolManifest | null;
77
+ error: RunError | null;
78
+ metadata: Record<string, unknown>;
79
+ queuedAt: Date;
80
+ startedAt: Date | null;
81
+ completedAt: Date | null;
82
+ createdAt: Date;
83
+ updatedAt: Date;
84
+ }
85
+ type MessageRole = "system" | "developer" | "user" | "assistant" | "tool";
86
+ interface Message {
87
+ id: MessageId;
88
+ agentId: AgentSessionId;
89
+ role: MessageRole;
90
+ content: string;
91
+ sourceRunId: RunId | null;
92
+ auth: AuthContext | null;
93
+ metadata: Record<string, unknown>;
94
+ createdAt: Date;
95
+ }
96
+ type InboxEventStatus = "pending" | "processing" | "processed" | "failed";
97
+ interface InboxEvent {
98
+ id: InboxEventId;
99
+ agentId: AgentSessionId;
100
+ type: RunInput["type"];
101
+ input: RunInput;
102
+ status: InboxEventStatus;
103
+ runId: RunId | null;
104
+ auth: AuthContext | null;
105
+ metadata: Record<string, unknown>;
106
+ createdAt: Date;
107
+ updatedAt: Date;
108
+ claimedAt: Date | null;
109
+ processedAt: Date | null;
110
+ failedAt: Date | null;
111
+ error: RunError | null;
112
+ }
113
+ type RunEventType = "run.cancel_requested" | "run.queued" | "run.started" | "run.steering_received" | "run.paused" | "run.completed" | "run.failed" | "run.cancelled" | "turn.started" | "turn.completed" | "message.started" | "message.delta" | "message.completed" | "tool.started" | "tool.updated" | "tool.deferred" | "tool.completed" | "tool.failed" | "deferred_tool.completed" | "deferred_tool.failed" | "skill_manifest.created" | "tool_manifest.created" | "approval.requested" | "approval.granted" | "approval.rejected" | "context.rendered";
114
+ interface RunEvent {
115
+ id: RunEventId;
116
+ runId: RunId;
117
+ seq: number;
118
+ type: RunEventType;
119
+ payload: Record<string, unknown>;
120
+ sourceRefs: SourceRef[];
121
+ createdAt: Date;
122
+ }
123
+ interface MemoryScope {
124
+ type: "user" | "project" | "team" | "agent" | "session";
125
+ id: string;
126
+ }
127
+ interface MemoryItem {
128
+ id: MemoryId;
129
+ scope: MemoryScope;
130
+ kind: "fact" | "preference" | "decision" | "summary" | "entity" | "lesson";
131
+ content: string;
132
+ sourceRefs: SourceRef[];
133
+ importance: number | null;
134
+ confidence: number | null;
135
+ embeddingRef: string | null;
136
+ expiresAt: Date | null;
137
+ createdAt: Date;
138
+ updatedAt: Date;
139
+ }
140
+ type ContextBlockType = "policy" | "agent_identity" | "state" | "memory" | "message_summary" | "message_history" | "context_provider" | "skill" | "tool_manifest" | "artifact" | "team" | "input";
141
+ interface ContextBlock {
142
+ key: string;
143
+ type: ContextBlockType;
144
+ content: string;
145
+ priority?: number;
146
+ sourceRefs?: SourceRef[];
147
+ metadata?: Record<string, unknown>;
148
+ }
149
+ interface ContextSlot {
150
+ required?: boolean;
151
+ maxTokens?: number;
152
+ }
153
+ interface ContextTemplateMessage {
154
+ role: Extract<MessageRole, "system" | "developer" | "user" | "assistant">;
155
+ content: string;
156
+ }
157
+ interface ContextTemplate$1 {
158
+ id: string;
159
+ version: string;
160
+ slots: Record<string, ContextSlot>;
161
+ messages: ContextTemplateMessage[];
162
+ }
163
+ interface ContextManifestBlock {
164
+ key: string;
165
+ type: ContextBlockType;
166
+ tokens: number;
167
+ sourceRefs: SourceRef[];
168
+ truncated: boolean;
169
+ }
170
+ interface ContextManifest {
171
+ runId: RunId;
172
+ contextTemplateId: string;
173
+ contextTemplateVersion: string;
174
+ blocks: ContextManifestBlock[];
175
+ totalTokens: number;
176
+ createdAt: Date;
177
+ }
178
+ interface RenderedContext {
179
+ messages: ContextTemplateMessage[];
180
+ manifest: ContextManifest;
181
+ }
182
+ interface ToolExecutionContext<TApp = unknown> {
183
+ auth: AuthContext | null;
184
+ agent: AgentSession;
185
+ run: Run;
186
+ app: TApp;
187
+ signal: AbortSignal;
188
+ }
189
+ type ToolConcurrencyKeyFn<TInput> = (args: {
190
+ input: TInput;
191
+ auth: AuthContext | null;
192
+ agent: AgentSession;
193
+ }) => string;
194
+ interface Tool$1<TInput = unknown, TResult = unknown, TApp = unknown> {
195
+ id: string;
196
+ description: string;
197
+ inputSchema: z.ZodType;
198
+ jsonSchema: JsonSchema;
199
+ sideEffect: boolean;
200
+ requiresApproval: boolean;
201
+ concurrencyKey?: ToolConcurrencyKeyFn<TInput>;
202
+ execute(input: TInput, ctx: ToolExecutionContext<TApp>): Promise<TResult> | TResult;
203
+ }
204
+ type ToolManifestSource = "local" | "mcp";
205
+ interface ToolManifest {
206
+ runId: RunId;
207
+ tools: ToolManifestTool[];
208
+ createdAt: Date;
209
+ }
210
+ type ToolManifestTool = LocalToolManifestTool | McpToolManifestTool;
211
+ interface ToolManifestToolBase {
212
+ id: string;
213
+ displayName: string;
214
+ source: ToolManifestSource;
215
+ description: string;
216
+ inputSchema: JsonSchema;
217
+ sideEffect: boolean | null;
218
+ requiresApproval: boolean;
219
+ metadata: Record<string, unknown>;
220
+ }
221
+ interface LocalToolManifestTool extends ToolManifestToolBase {
222
+ source: "local";
223
+ localToolId: string;
224
+ }
225
+ interface McpToolManifestTool extends ToolManifestToolBase {
226
+ source: "mcp";
227
+ bindingId: McpBindingId;
228
+ capabilityId: string;
229
+ remoteToolName: string;
230
+ transport: "streamable_http";
231
+ }
232
+ interface ToolDefinition<TSchema extends z.ZodType, TResult = unknown, TApp = unknown> {
233
+ id: string;
234
+ description: string;
235
+ inputSchema: TSchema;
236
+ sideEffect?: boolean;
237
+ requiresApproval?: boolean;
238
+ concurrencyKey?: ToolConcurrencyKeyFn<z.infer<TSchema>>;
239
+ execute(input: z.infer<TSchema>, ctx: ToolExecutionContext<TApp>): Promise<TResult> | TResult;
240
+ }
241
+ type SkillBindingSource = {
242
+ type: "local";
243
+ pathOrRef: string;
244
+ } | {
245
+ type: "host-resolved";
246
+ pathOrRef?: string | undefined;
247
+ };
248
+ type SkillBindingStatus = "active" | "removed";
249
+ type SkillAllowReferences = string[] | "all";
250
+ interface SkillResourceRef {
251
+ id: string;
252
+ pathOrRef: string;
253
+ contentType: string | null;
254
+ metadata: Record<string, unknown>;
255
+ }
256
+ interface SkillPackage {
257
+ id: string;
258
+ name: string;
259
+ description: string;
260
+ version: string | null;
261
+ instructions: string;
262
+ source: SkillBindingSource;
263
+ references: SkillResourceRef[];
264
+ assets: SkillResourceRef[];
265
+ templates: SkillResourceRef[];
266
+ metadata: Record<string, unknown>;
267
+ loadedAt: Date;
268
+ }
269
+ interface SkillCatalog {
270
+ getSkill(id: string): Promise<SkillPackage | null>;
271
+ listSkills?(): Promise<SkillPackage[]>;
272
+ }
273
+ interface SkillManifest {
274
+ runId: RunId;
275
+ skills: SkillManifestEntry[];
276
+ createdAt: Date;
277
+ }
278
+ interface SkillManifestEntry {
279
+ bindingId: SkillBindingId;
280
+ skillId: string;
281
+ name: string;
282
+ version: string | null;
283
+ description: string;
284
+ instructions: string;
285
+ descriptionHash: string;
286
+ instructionHash: string;
287
+ source: SkillBindingSource;
288
+ availableReferences: SkillResourceRef[];
289
+ availableAssets: SkillResourceRef[];
290
+ availableTemplates: SkillResourceRef[];
291
+ metadata: Record<string, unknown>;
292
+ }
293
+ interface ContextProviderContext<TApp = unknown> {
294
+ auth: AuthContext | null;
295
+ agent: AgentSession;
296
+ run: Run;
297
+ spec: AgentSpec$1<TApp>;
298
+ input: RunInput;
299
+ stores: HephStores;
300
+ app: TApp;
301
+ }
302
+ interface ContextProvider$1<TApp = unknown> {
303
+ id: string;
304
+ load(ctx: ContextProviderContext<TApp>): Promise<ContextBlock | ContextBlock[] | null | undefined>;
305
+ }
306
+ interface ContextProviderDefinition<TApp = unknown> {
307
+ id: string;
308
+ load(ctx: ContextProviderContext<TApp>): Promise<ContextBlock | ContextBlock[] | null | undefined>;
309
+ }
310
+ interface AgentSpec$1<TApp = unknown> {
311
+ id: AgentSpecId;
312
+ version: string | null;
313
+ instructions: string;
314
+ model: string | null;
315
+ tools: Tool$1<any, any, TApp>[];
316
+ mcp: McpAgentPolicy | null;
317
+ skills: SkillAgentPolicy | null;
318
+ contextProviders: ContextProvider$1<TApp>[];
319
+ contextTemplate: ContextTemplate$1 | null;
320
+ metadata: Record<string, unknown>;
321
+ }
322
+ interface AgentDefinition<TApp = unknown> {
323
+ id: AgentSpecId;
324
+ version?: string;
325
+ instructions: string;
326
+ model?: string;
327
+ tools?: Tool$1<any, any, TApp>[];
328
+ mcp?: McpAgentPolicy | string[] | null;
329
+ allowAllMcpTools?: boolean;
330
+ skills?: SkillAgentPolicy | string[] | "all" | null;
331
+ contextProviders?: ContextProvider$1<TApp>[];
332
+ context?: ContextProvider$1<TApp>[];
333
+ contextTemplate?: ContextTemplate$1;
334
+ metadata?: Record<string, unknown>;
335
+ }
336
+ interface McpAgentPolicy {
337
+ allowCapabilities: string[];
338
+ allowAllTools?: boolean;
339
+ }
340
+ interface SkillAgentPolicy {
341
+ allow: string[] | "all";
342
+ }
343
+ type McpAllowTools = string[] | "all";
344
+ type McpBindingStatus = "active" | "removed";
345
+ interface McpBinding {
346
+ id: McpBindingId;
347
+ agentId: AgentSessionId;
348
+ capabilityId: string;
349
+ accountRef: string | null;
350
+ allowTools: McpAllowTools;
351
+ status: McpBindingStatus;
352
+ metadata: Record<string, unknown>;
353
+ createdAt: Date;
354
+ updatedAt: Date;
355
+ removedAt: Date | null;
356
+ }
357
+ interface CreateMcpBindingStoreInput {
358
+ id?: McpBindingId;
359
+ agentId: AgentSessionId;
360
+ capabilityId: string;
361
+ accountRef?: string | null | undefined;
362
+ allowTools: McpAllowTools;
363
+ metadata?: Record<string, unknown> | undefined;
364
+ }
365
+ interface SkillBinding {
366
+ id: SkillBindingId;
367
+ agentId: AgentSessionId;
368
+ skillId: string;
369
+ name: string;
370
+ version: string | null;
371
+ source: SkillBindingSource;
372
+ allowReferences: SkillAllowReferences;
373
+ status: SkillBindingStatus;
374
+ metadata: Record<string, unknown>;
375
+ createdAt: Date;
376
+ updatedAt: Date;
377
+ removedAt: Date | null;
378
+ }
379
+ interface CreateSkillBindingStoreInput {
380
+ id?: SkillBindingId;
381
+ agentId: AgentSessionId;
382
+ skillId: string;
383
+ name: string;
384
+ version?: string | null | undefined;
385
+ source: SkillBindingSource;
386
+ allowReferences?: SkillAllowReferences | undefined;
387
+ metadata?: Record<string, unknown> | undefined;
388
+ }
389
+ type ApprovalRequestStatus = "pending" | "granted" | "rejected";
390
+ interface ApprovalRequest {
391
+ id: ApprovalRequestId;
392
+ agentId: AgentSessionId;
393
+ runId: RunId;
394
+ toolId: string;
395
+ input: unknown;
396
+ status: ApprovalRequestStatus;
397
+ requestedBy: AuthContext | null;
398
+ decidedBy: AuthContext | null;
399
+ metadata: Record<string, unknown>;
400
+ createdAt: Date;
401
+ updatedAt: Date;
402
+ decidedAt: Date | null;
403
+ }
404
+ type DeferredToolOperationStatus = "pending" | "completed" | "failed" | "cancelled";
405
+ type DeferredToolResumePolicy = "auto" | "manual";
406
+ interface DeferredToolOperation {
407
+ id: DeferredToolOperationId;
408
+ agentId: AgentSessionId;
409
+ runId: RunId;
410
+ toolId: string;
411
+ toolCallId: string | null;
412
+ status: DeferredToolOperationStatus;
413
+ resumePolicy: DeferredToolResumePolicy;
414
+ auth: AuthContext | null;
415
+ result: unknown;
416
+ error: RunError | null;
417
+ metadata: Record<string, unknown>;
418
+ createdAt: Date;
419
+ updatedAt: Date;
420
+ completedAt: Date | null;
421
+ }
422
+ interface CreateDeferredToolOperationStoreInput {
423
+ id?: DeferredToolOperationId;
424
+ agentId: AgentSessionId;
425
+ runId: RunId;
426
+ toolId: string;
427
+ toolCallId?: string | null | undefined;
428
+ resumePolicy?: DeferredToolResumePolicy | undefined;
429
+ auth?: AuthContext | null | undefined;
430
+ metadata?: Record<string, unknown> | undefined;
431
+ }
432
+ interface CompleteDeferredToolOperationStoreInput {
433
+ id: DeferredToolOperationId;
434
+ status: Extract<DeferredToolOperationStatus, "completed" | "failed" | "cancelled">;
435
+ result?: unknown;
436
+ error?: RunError | null | undefined;
437
+ metadata?: Record<string, unknown> | undefined;
438
+ }
439
+ interface CreateApprovalRequestStoreInput {
440
+ id?: ApprovalRequestId;
441
+ agentId: AgentSessionId;
442
+ runId: RunId;
443
+ toolId: string;
444
+ input: unknown;
445
+ requestedBy?: AuthContext | null | undefined;
446
+ metadata?: Record<string, unknown> | undefined;
447
+ }
448
+ interface DecideApprovalRequestStoreInput {
449
+ id: ApprovalRequestId;
450
+ decision: Extract<ApprovalRequestStatus, "granted" | "rejected">;
451
+ decidedBy?: AuthContext | null | undefined;
452
+ metadata?: Record<string, unknown> | undefined;
453
+ }
454
+ interface McpCatalogTool {
455
+ name: string;
456
+ description?: string | undefined;
457
+ inputSchema?: JsonSchema | undefined;
458
+ sideEffect?: boolean | null | undefined;
459
+ requiresApproval?: boolean | undefined;
460
+ metadata?: Record<string, unknown> | undefined;
461
+ }
462
+ interface McpResolvedCredentials {
463
+ headers?: Record<string, string> | undefined;
464
+ }
465
+ interface McpBindingResolverContext<TApp = unknown> {
466
+ auth: AuthContext | null;
467
+ agent: AgentSession;
468
+ binding: McpBinding;
469
+ app: TApp;
470
+ }
471
+ interface McpCredentialResolverContext<TApp = unknown> extends McpBindingResolverContext<TApp> {
472
+ run?: Run | undefined;
473
+ }
474
+ interface ResolvedMcpBinding<TApp = unknown> {
475
+ transport: "streamable_http";
476
+ endpoint: string;
477
+ tools: McpCatalogTool[];
478
+ resolveCredentials?: ((ctx: McpCredentialResolverContext<TApp>) => McpResolvedCredentials | Promise<McpResolvedCredentials>) | undefined;
479
+ metadata?: Record<string, unknown> | undefined;
480
+ }
481
+ interface McpBindingResolver<TApp = unknown> {
482
+ resolve(ctx: McpBindingResolverContext<TApp>): ResolvedMcpBinding<TApp> | Promise<ResolvedMcpBinding<TApp>>;
483
+ }
484
+ interface McpToolCallContext<TApp = unknown> {
485
+ auth: AuthContext | null;
486
+ agent: AgentSession;
487
+ run: Run;
488
+ binding: McpBinding;
489
+ manifestTool: McpToolManifestTool;
490
+ resolved: ResolvedMcpBinding<TApp>;
491
+ input: unknown;
492
+ app: TApp;
493
+ signal?: AbortSignal | undefined;
494
+ }
495
+ interface McpToolExecutor<TApp = unknown> {
496
+ callTool(ctx: McpToolCallContext<TApp>): Promise<unknown>;
497
+ }
498
+ interface CreateAgentSessionStoreInput {
499
+ id?: AgentSessionId;
500
+ agentSpecId: AgentSpecId;
501
+ agentSpecVersion?: string | null | undefined;
502
+ state?: Record<string, unknown> | undefined;
503
+ auth?: AuthContext | null | undefined;
504
+ metadata?: Record<string, unknown> | undefined;
505
+ }
506
+ interface CreateRunStoreInput {
507
+ id?: RunId;
508
+ agentId: AgentSessionId;
509
+ agentSpecId: AgentSpecId;
510
+ agentSpecVersion?: string | null | undefined;
511
+ status: RunStatus;
512
+ input: RunInput;
513
+ auth?: AuthContext | null | undefined;
514
+ metadata?: Record<string, unknown> | undefined;
515
+ }
516
+ interface AppendMessageInput {
517
+ id?: MessageId;
518
+ agentId: AgentSessionId;
519
+ role: MessageRole;
520
+ content: string;
521
+ sourceRunId?: RunId | null | undefined;
522
+ auth?: AuthContext | null | undefined;
523
+ metadata?: Record<string, unknown> | undefined;
524
+ }
525
+ interface AppendInboxEventInput {
526
+ id?: InboxEventId;
527
+ agentId: AgentSessionId;
528
+ input: RunInput;
529
+ auth?: AuthContext | null | undefined;
530
+ metadata?: Record<string, unknown> | undefined;
531
+ }
532
+ interface AppendRunEventInput {
533
+ id?: RunEventId;
534
+ runId: RunId;
535
+ type: RunEventType;
536
+ payload?: Record<string, unknown> | undefined;
537
+ sourceRefs?: SourceRef[] | undefined;
538
+ }
539
+ interface PutMemoryInput {
540
+ id?: MemoryId;
541
+ scope: MemoryScope;
542
+ kind: MemoryItem["kind"];
543
+ content: string;
544
+ sourceRefs: SourceRef[];
545
+ importance?: number | null;
546
+ confidence?: number | null;
547
+ embeddingRef?: string | null;
548
+ expiresAt?: Date | null;
549
+ }
550
+ interface SearchMemoryInput {
551
+ query?: string;
552
+ scopes?: MemoryScope[];
553
+ topK?: number;
554
+ }
555
+ interface StateStore {
556
+ createAgentSession(input: CreateAgentSessionStoreInput): Promise<AgentSession>;
557
+ getAgentSession(id: AgentSessionId): Promise<AgentSession | null>;
558
+ updateAgentSession(id: AgentSessionId, patch: Partial<Omit<AgentSession, "id" | "createdAt">>): Promise<AgentSession>;
559
+ createRun(input: CreateRunStoreInput): Promise<Run>;
560
+ getRun(id: RunId): Promise<Run | null>;
561
+ updateRun(id: RunId, patch: Partial<Omit<Run, "id" | "createdAt">>): Promise<Run>;
562
+ listRunsByAgent(agentId: AgentSessionId): Promise<Run[]>;
563
+ }
564
+ interface MessageStore {
565
+ appendMessage(input: AppendMessageInput): Promise<Message>;
566
+ listMessages(agentId: AgentSessionId, options?: {
567
+ limit?: number;
568
+ }): Promise<Message[]>;
569
+ }
570
+ interface InboxStore {
571
+ appendInboxEvent(input: AppendInboxEventInput): Promise<InboxEvent>;
572
+ getInboxEvent(id: InboxEventId): Promise<InboxEvent | null>;
573
+ listInboxEvents(agentId: AgentSessionId, options?: {
574
+ status?: InboxEventStatus;
575
+ types?: RunInput["type"][];
576
+ limit?: number;
577
+ }): Promise<InboxEvent[]>;
578
+ claimPendingInboxEvents(agentId: AgentSessionId, options?: {
579
+ types?: RunInput["type"][];
580
+ limit?: number;
581
+ }): Promise<InboxEvent[]>;
582
+ markInboxEventsProcessed(ids: InboxEventId[], runId: RunId): Promise<InboxEvent[]>;
583
+ markInboxEventsFailed(ids: InboxEventId[], error: RunError): Promise<InboxEvent[]>;
584
+ }
585
+ interface EventLog {
586
+ appendRunEvent(input: AppendRunEventInput): Promise<RunEvent>;
587
+ listRunEvents(runId: RunId, options?: {
588
+ after?: number;
589
+ limit?: number;
590
+ }): Promise<RunEvent[]>;
591
+ }
592
+ interface MemoryStore {
593
+ putMemory(input: PutMemoryInput): Promise<MemoryItem>;
594
+ searchMemory(input: SearchMemoryInput): Promise<MemoryItem[]>;
595
+ }
596
+ interface McpBindingStore {
597
+ createMcpBinding(input: CreateMcpBindingStoreInput): Promise<McpBinding>;
598
+ getMcpBinding(id: McpBindingId): Promise<McpBinding | null>;
599
+ listMcpBindings(agentId: AgentSessionId, options?: {
600
+ status?: McpBindingStatus | "all" | undefined;
601
+ }): Promise<McpBinding[]>;
602
+ removeMcpBinding(id: McpBindingId): Promise<McpBinding>;
603
+ }
604
+ interface SkillBindingStore {
605
+ createSkillBinding(input: CreateSkillBindingStoreInput): Promise<SkillBinding>;
606
+ getSkillBinding(id: SkillBindingId): Promise<SkillBinding | null>;
607
+ listSkillBindings(agentId: AgentSessionId, options?: {
608
+ status?: SkillBindingStatus | "all" | undefined;
609
+ }): Promise<SkillBinding[]>;
610
+ removeSkillBinding(id: SkillBindingId): Promise<SkillBinding>;
611
+ }
612
+ interface ApprovalStore {
613
+ createApprovalRequest(input: CreateApprovalRequestStoreInput): Promise<ApprovalRequest>;
614
+ getApprovalRequest(id: ApprovalRequestId): Promise<ApprovalRequest | null>;
615
+ listApprovalRequests(runId: RunId, options?: {
616
+ status?: ApprovalRequestStatus | "all" | undefined;
617
+ }): Promise<ApprovalRequest[]>;
618
+ decideApprovalRequest(input: DecideApprovalRequestStoreInput): Promise<ApprovalRequest>;
619
+ }
620
+ interface DeferredToolOperationStore {
621
+ createDeferredToolOperation(input: CreateDeferredToolOperationStoreInput): Promise<DeferredToolOperation>;
622
+ getDeferredToolOperation(id: DeferredToolOperationId): Promise<DeferredToolOperation | null>;
623
+ completeDeferredToolOperation(input: CompleteDeferredToolOperationStoreInput): Promise<DeferredToolOperation>;
624
+ }
625
+ interface HephStores {
626
+ state: StateStore;
627
+ messages: MessageStore;
628
+ inbox: InboxStore;
629
+ events: EventLog;
630
+ memory: MemoryStore;
631
+ mcpBindings: McpBindingStore;
632
+ skillBindings: SkillBindingStore;
633
+ approvals: ApprovalStore;
634
+ deferredToolOperations: DeferredToolOperationStore;
635
+ }
636
+ //#endregion
637
+ //#region ../core/src/context.d.ts
638
+ interface ContextRendererOptions {
639
+ template: ContextTemplate$1;
640
+ blocks: ContextBlock[];
641
+ runId: RunId;
642
+ input: string;
643
+ runtime?: Record<string, string>;
644
+ }
645
+ declare class ContextRenderer {
646
+ render(options: ContextRendererOptions): RenderedContext;
647
+ }
648
+ declare const defaultContextTemplate: ContextTemplate$1;
649
+ declare function estimateTokens(content: string): number;
650
+ declare function messagesToText(messages: ContextTemplateMessage[]): string;
651
+ //#endregion
652
+ //#region ../core/src/definitions.d.ts
653
+ declare function defineAgent<TApp = unknown>(definition: AgentDefinition<TApp>): AgentSpec$1<TApp>;
654
+ declare function defineContextProvider<TApp = unknown>(definition: ContextProviderDefinition<TApp>): ContextProvider$1<TApp>;
655
+ declare function defineContextTemplate(template: ContextTemplate$1): ContextTemplate$1;
656
+ declare function defineTool<TSchema extends z.ZodType, TResult = unknown, TApp = unknown>(definition: ToolDefinition<TSchema, TResult, TApp>): Tool$1<z.infer<TSchema>, TResult, TApp>;
657
+ declare const AgentSpec: {
658
+ define: typeof defineAgent;
659
+ };
660
+ declare const ContextProvider: {
661
+ define: typeof defineContextProvider;
662
+ };
663
+ declare const ContextTemplate: {
664
+ define: typeof defineContextTemplate;
665
+ };
666
+ declare const Tool: {
667
+ define: typeof defineTool;
668
+ };
669
+ //#endregion
670
+ //#region ../core/src/errors.d.ts
671
+ type HephErrorCode = "HEPH1001" | "HEPH2001" | "HEPH3001" | "HEPH3002" | "HEPH3003" | "HEPH3004" | "HEPH3005" | "HEPH4001" | "HEPH4002" | "HEPH4003" | "HEPH4004" | "HEPH4005" | "HEPH4006" | "HEPH5001" | "HEPH6001" | "HEPH6002" | "HEPH6003" | "HEPH6004" | "HEPH6005" | "HEPH7001" | "HEPH7002" | "HEPH8001" | "HEPH8002" | "HEPH8003" | "HEPH8004" | "HEPH9001" | "HEPH9002" | "HEPH9003";
672
+ interface HephErrorOptions {
673
+ code: HephErrorCode;
674
+ title: string;
675
+ message?: string;
676
+ details?: Record<string, unknown>;
677
+ cause?: unknown;
678
+ status?: number;
679
+ }
680
+ declare class HephError extends Error {
681
+ readonly code: HephErrorCode;
682
+ readonly title: string;
683
+ readonly details?: Record<string, unknown>;
684
+ readonly status?: number;
685
+ constructor(options: HephErrorOptions);
686
+ }
687
+ declare function isHephError(error: unknown): error is HephError;
688
+ declare function toErrorDetails(error: unknown): Record<string, unknown>;
689
+ //#endregion
690
+ //#region ../core/src/queue.d.ts
691
+ type HephJob = {
692
+ type: "schedule_agent";
693
+ agentId: string;
694
+ } | {
695
+ type: "execute_run";
696
+ agentId: string;
697
+ runId: string;
698
+ } | {
699
+ type: "resume_run";
700
+ agentId: string;
701
+ runId: string;
702
+ } | {
703
+ type: "cancel_run";
704
+ agentId: string;
705
+ runId: string;
706
+ } | {
707
+ type: "ingest_memory";
708
+ agentId: string;
709
+ runId?: string;
710
+ };
711
+ interface EnqueueOptions {
712
+ delayMs?: number;
713
+ idempotencyKey?: string;
714
+ }
715
+ interface QueueAdapter {
716
+ enqueue(job: HephJob, options?: EnqueueOptions): Promise<void>;
717
+ startConsumer?(handler: (job: HephJob) => Promise<void>): Promise<void>;
718
+ handleBatch?(rawEvent: unknown, handler: (job: HephJob) => Promise<void>): Promise<void>;
719
+ onIdle?(): Promise<void>;
720
+ }
721
+ interface InProcessQueueOptions {
722
+ concurrency?: number;
723
+ onError?: (error: unknown, job: HephJob) => void;
724
+ }
725
+ declare class InProcessQueue implements QueueAdapter {
726
+ private readonly concurrency;
727
+ private readonly onError;
728
+ private readonly jobs;
729
+ private readonly activeAgents;
730
+ private readonly idleResolvers;
731
+ private activeCount;
732
+ private scheduled;
733
+ private handler;
734
+ constructor(options?: InProcessQueueOptions);
735
+ startConsumer(handler: (job: HephJob) => Promise<void>): Promise<void>;
736
+ enqueue(job: HephJob): Promise<void>;
737
+ onIdle(): Promise<void>;
738
+ private schedule;
739
+ private pump;
740
+ private isIdle;
741
+ private resolveIdleIfNeeded;
742
+ }
743
+ //#endregion
744
+ //#region ../core/src/runtime.d.ts
745
+ interface AgentSpecResolverContext {
746
+ auth: AuthContext | null;
747
+ }
748
+ interface AgentSpecResolver<TApp = unknown> {
749
+ resolve(id: AgentSpecId, ctx: AgentSpecResolverContext): Promise<AgentSpec$1<TApp> | null>;
750
+ }
751
+ type AgentSpecRegistration<TApp = unknown> = AgentSpec$1<TApp>[] | Record<string, AgentSpec$1<TApp>> | AgentSpecResolver<TApp>;
752
+ interface CreateHephOptions<TApp = unknown> {
753
+ agents: AgentSpecRegistration<TApp>;
754
+ stores?: HephStores;
755
+ queue?: QueueAdapter;
756
+ executor?: RunExecutor<TApp>;
757
+ app?: TApp;
758
+ inbox?: {
759
+ maxEventsPerRun?: number | null | undefined;
760
+ textSeparator?: string | undefined;
761
+ };
762
+ execution?: {
763
+ mode?: "single-process" | "platform-queue" | "split-worker";
764
+ concurrency?: number;
765
+ autoStartConsumer?: boolean;
766
+ };
767
+ runtimePolicy?: string;
768
+ toolPolicy?: string;
769
+ mcp?: {
770
+ resolver?: McpBindingResolver<TApp> | undefined;
771
+ toolExecutor?: McpToolExecutor<TApp> | undefined;
772
+ };
773
+ skills?: {
774
+ catalog?: SkillCatalog | undefined;
775
+ };
776
+ }
777
+ interface CreateAgentSessionInput {
778
+ spec: AgentSpecId;
779
+ skills?: string[] | undefined;
780
+ auth?: AuthContext | null | undefined;
781
+ state?: Record<string, unknown> | undefined;
782
+ metadata?: Record<string, unknown> | undefined;
783
+ }
784
+ interface CreateAgentAndRunInput extends CreateAgentSessionInput {
785
+ input: string | RunInput;
786
+ }
787
+ interface CreateRunInput {
788
+ agentId: AgentSessionId;
789
+ input: string | RunInput;
790
+ auth?: AuthContext | null | undefined;
791
+ metadata?: Record<string, unknown> | undefined;
792
+ enqueue?: boolean | undefined;
793
+ }
794
+ interface AppendAgentMessageInput {
795
+ agentId: AgentSessionId;
796
+ content: string;
797
+ type?: "user.message" | "steering.message" | undefined;
798
+ auth?: AuthContext | null | undefined;
799
+ metadata?: Record<string, unknown> | undefined;
800
+ schedule?: boolean | undefined;
801
+ }
802
+ interface AppendAgentMessageResult {
803
+ message: Message;
804
+ inboxEvent: InboxEvent;
805
+ message_id: MessageId;
806
+ inbox_event_id: InboxEventId;
807
+ scheduled: boolean;
808
+ }
809
+ interface AddMcpBindingInput {
810
+ agentId: AgentSessionId;
811
+ capabilityId: string;
812
+ accountRef?: string | null | undefined;
813
+ allowTools: McpAllowTools;
814
+ auth?: AuthContext | null | undefined;
815
+ metadata?: Record<string, unknown> | undefined;
816
+ }
817
+ interface RemoveMcpBindingInput {
818
+ agentId: AgentSessionId;
819
+ bindingId: McpBindingId;
820
+ }
821
+ interface CallToolInput {
822
+ toolId: string;
823
+ input?: unknown;
824
+ auth?: AuthContext | null | undefined;
825
+ approvalRequestId?: ApprovalRequestId | undefined;
826
+ signal?: AbortSignal | undefined;
827
+ }
828
+ interface ToolCallResult {
829
+ toolId: string;
830
+ result: unknown;
831
+ ok: true;
832
+ }
833
+ interface FailedToolCallResult {
834
+ toolId: string;
835
+ error: RunError;
836
+ ok: false;
837
+ }
838
+ type ToolCallAttemptResult = ToolCallResult | FailedToolCallResult;
839
+ interface DeferToolResultInput {
840
+ runId: RunId;
841
+ toolId: string;
842
+ operationId?: DeferredToolOperationId | undefined;
843
+ toolCallId?: string | null | undefined;
844
+ resumePolicy?: DeferredToolResumePolicy | undefined;
845
+ auth?: AuthContext | null | undefined;
846
+ metadata?: Record<string, unknown> | undefined;
847
+ }
848
+ interface CompleteDeferredToolResultInput {
849
+ operationId: DeferredToolOperationId;
850
+ status?: "completed" | "failed" | "cancelled" | undefined;
851
+ result?: unknown;
852
+ content?: string | undefined;
853
+ error?: RunError | null | undefined;
854
+ auth?: AuthContext | null | undefined;
855
+ metadata?: Record<string, unknown> | undefined;
856
+ schedule?: boolean | undefined;
857
+ }
858
+ interface CompleteDeferredToolResultResult {
859
+ operation: DeferredToolOperation;
860
+ message: Message;
861
+ inboxEvent: InboxEvent | null;
862
+ scheduled: boolean;
863
+ }
864
+ interface CreateAgentAndRunResult {
865
+ agent: AgentSession;
866
+ run: Run;
867
+ message: Message | null;
868
+ inboxEvent: InboxEvent | null;
869
+ agent_id: AgentSessionId;
870
+ agent_spec_id: AgentSpecId;
871
+ run_id: RunId;
872
+ }
873
+ interface HephRuntime<TApp = unknown> {
874
+ stores: HephStores;
875
+ queue: QueueAdapter;
876
+ agents: {
877
+ create(input: CreateAgentSessionInput): Promise<AgentSession>;
878
+ createAndRun(input: CreateAgentAndRunInput): Promise<CreateAgentAndRunResult>;
879
+ appendMessage(input: AppendAgentMessageInput): Promise<AppendAgentMessageResult>;
880
+ schedule(agentId: AgentSessionId): Promise<Run | null>;
881
+ get(agentId: AgentSessionId): Promise<AgentSession | null>;
882
+ addMcpBinding(input: AddMcpBindingInput): Promise<McpBinding>;
883
+ listMcpBindings(agentId: AgentSessionId): Promise<McpBinding[]>;
884
+ removeMcpBinding(input: RemoveMcpBindingInput): Promise<McpBinding>;
885
+ };
886
+ runs: {
887
+ create(input: CreateRunInput): Promise<Run>;
888
+ get(runId: RunId): Promise<Run | null>;
889
+ cancel(runId: RunId): Promise<Run>;
890
+ };
891
+ messages: {
892
+ append(input: {
893
+ agentId: AgentSessionId;
894
+ role: "user" | "assistant" | "tool" | "developer" | "system";
895
+ content: string;
896
+ auth?: AuthContext | null | undefined;
897
+ metadata?: Record<string, unknown> | undefined;
898
+ }): Promise<Message>;
899
+ list(agentId: AgentSessionId, options?: {
900
+ limit?: number;
901
+ }): Promise<Message[]>;
902
+ };
903
+ approvals: {
904
+ get(approvalRequestId: ApprovalRequestId): Promise<ApprovalRequest | null>;
905
+ list(runId: RunId): Promise<ApprovalRequest[]>;
906
+ decide(input: {
907
+ approvalRequestId: ApprovalRequestId;
908
+ decision: "granted" | "rejected";
909
+ auth?: AuthContext | null | undefined;
910
+ metadata?: Record<string, unknown> | undefined;
911
+ }): Promise<ApprovalRequest>;
912
+ };
913
+ tools: {
914
+ call(runId: RunId, input: CallToolInput): Promise<ToolCallResult>;
915
+ tryCall(runId: RunId, input: CallToolInput): Promise<ToolCallAttemptResult>;
916
+ };
917
+ operations: {
918
+ deferToolResult(input: DeferToolResultInput): Promise<DeferredToolOperation>;
919
+ get(operationId: DeferredToolOperationId): Promise<DeferredToolOperation | null>;
920
+ complete(input: CompleteDeferredToolResultInput): Promise<CompleteDeferredToolResultResult>;
921
+ };
922
+ renderRunContext(runId: RunId): Promise<RenderedContext>;
923
+ handleJob(job: HephJob): Promise<void>;
924
+ startWorker(): Promise<void>;
925
+ drain(): Promise<void>;
926
+ }
927
+ declare class StreamableHttpMcpToolExecutor<TApp = unknown> implements McpToolExecutor<TApp> {
928
+ callTool(ctx: Parameters<McpToolExecutor<TApp>["callTool"]>[0]): Promise<unknown>;
929
+ }
930
+ declare function createHeph<TApp = unknown>(options: CreateHephOptions<TApp>): HephRuntime<TApp>;
931
+ //#endregion
932
+ //#region ../core/src/executor.d.ts
933
+ interface RunExecutionContext<TApp = unknown> {
934
+ auth: AuthContext | null;
935
+ agent: AgentSession;
936
+ spec: AgentSpec$1<TApp>;
937
+ run: Run;
938
+ renderedContext: RenderedContext;
939
+ stores: HephStores;
940
+ app: TApp;
941
+ signal: AbortSignal;
942
+ emit(event: Omit<AppendRunEventInput, "runId">): Promise<void>;
943
+ appendMessage(input: Omit<AppendMessageInput, "agentId" | "auth">): Promise<Message>;
944
+ tools: {
945
+ call(input: CallToolInput): Promise<ToolCallResult>;
946
+ tryCall(input: CallToolInput): Promise<ToolCallAttemptResult>;
947
+ };
948
+ callTool(input: CallToolInput): Promise<ToolCallResult>;
949
+ tryCallTool(input: CallToolInput): Promise<ToolCallAttemptResult>;
950
+ deferToolResult(input: Omit<DeferToolResultInput, "runId"> & {
951
+ runId?: Run["id"];
952
+ }): Promise<DeferredToolOperation>;
953
+ }
954
+ interface RunExecutor<TApp = unknown> {
955
+ execute(ctx: RunExecutionContext<TApp>): Promise<void>;
956
+ }
957
+ declare class MinimalRunExecutor<TApp = unknown> implements RunExecutor<TApp> {
958
+ execute(ctx: RunExecutionContext<TApp>): Promise<void>;
959
+ }
960
+ //#endregion
961
+ //#region ../core/src/ids.d.ts
962
+ type IdPrefix = "agent_" | "run_" | "msg_" | "evt_" | "mem_" | "inbox_" | "op_" | "mcpbind_" | "skillbind_" | "approval_";
963
+ declare function createId(prefix: IdPrefix): string;
964
+ declare function createAgentSessionId(): string;
965
+ declare function createRunId(): string;
966
+ declare function createMessageId(): string;
967
+ declare function createRunEventId(): string;
968
+ declare function createMemoryId(): string;
969
+ declare function createInboxEventId(): string;
970
+ declare function createDeferredToolOperationId(): string;
971
+ declare function createMcpBindingId(): string;
972
+ declare function createSkillBindingId(): string;
973
+ declare function createApprovalRequestId(): string;
974
+ //#endregion
975
+ //#region ../core/src/providers.d.ts
976
+ interface RecentMessagesOptions {
977
+ limit?: number;
978
+ }
979
+ declare function recentMessages(options?: RecentMessagesOptions): ContextProvider$1;
980
+ declare function threadState(): ContextProvider$1;
981
+ interface MemorySearchOptions {
982
+ topK?: number;
983
+ scopes?: MemoryScope[];
984
+ }
985
+ declare function memorySearch(options?: MemorySearchOptions): ContextProvider$1;
986
+ declare function block(block: ContextBlock): ContextBlock;
987
+ //#endregion
988
+ //#region ../core/src/skills.d.ts
989
+ declare function createInMemorySkillCatalog(skills: SkillPackage[]): SkillCatalog;
990
+ //#endregion
991
+ //#region ../core/src/stores.d.ts
992
+ declare class InMemoryHephStore implements StateStore, MessageStore, InboxStore, EventLog, MemoryStore, McpBindingStore, SkillBindingStore, ApprovalStore, DeferredToolOperationStore, HephStores {
993
+ readonly state: StateStore;
994
+ readonly messages: MessageStore;
995
+ readonly inbox: InboxStore;
996
+ readonly events: EventLog;
997
+ readonly memory: MemoryStore;
998
+ readonly mcpBindings: McpBindingStore;
999
+ readonly skillBindings: SkillBindingStore;
1000
+ readonly approvals: ApprovalStore;
1001
+ readonly deferredToolOperations: DeferredToolOperationStore;
1002
+ private readonly agentSessions;
1003
+ private readonly runs;
1004
+ private readonly messageList;
1005
+ private readonly inboxList;
1006
+ private readonly inboxEvents;
1007
+ private readonly eventList;
1008
+ private readonly eventSeqByRun;
1009
+ private readonly memoryItems;
1010
+ private readonly mcpBindingList;
1011
+ private readonly mcpBindingsById;
1012
+ private readonly skillBindingList;
1013
+ private readonly skillBindingsById;
1014
+ private readonly approvalRequests;
1015
+ private readonly deferredOperations;
1016
+ createAgentSession(input: CreateAgentSessionStoreInput): Promise<AgentSession>;
1017
+ getAgentSession(id: AgentSessionId): Promise<AgentSession | null>;
1018
+ updateAgentSession(id: AgentSessionId, patch: Partial<Omit<AgentSession, "id" | "createdAt">>): Promise<AgentSession>;
1019
+ createRun(input: CreateRunStoreInput): Promise<Run>;
1020
+ getRun(id: RunId): Promise<Run | null>;
1021
+ updateRun(id: RunId, patch: Partial<Omit<Run, "id" | "createdAt">>): Promise<Run>;
1022
+ listRunsByAgent(agentId: AgentSessionId): Promise<Run[]>;
1023
+ appendMessage(input: AppendMessageInput): Promise<Message>;
1024
+ listMessages(agentId: AgentSessionId, options?: {
1025
+ limit?: number;
1026
+ }): Promise<Message[]>;
1027
+ appendInboxEvent(input: AppendInboxEventInput): Promise<InboxEvent>;
1028
+ getInboxEvent(id: InboxEventId): Promise<InboxEvent | null>;
1029
+ listInboxEvents(agentId: AgentSessionId, options?: {
1030
+ status?: InboxEventStatus;
1031
+ types?: Array<InboxEvent["type"]>;
1032
+ limit?: number;
1033
+ }): Promise<InboxEvent[]>;
1034
+ claimPendingInboxEvents(agentId: AgentSessionId, options?: {
1035
+ types?: Array<InboxEvent["type"]>;
1036
+ limit?: number;
1037
+ }): Promise<InboxEvent[]>;
1038
+ markInboxEventsProcessed(ids: InboxEventId[], runId: RunId): Promise<InboxEvent[]>;
1039
+ markInboxEventsFailed(ids: InboxEventId[], error: RunError): Promise<InboxEvent[]>;
1040
+ appendRunEvent(input: AppendRunEventInput): Promise<RunEvent>;
1041
+ listRunEvents(runId: RunId, options?: {
1042
+ after?: number;
1043
+ limit?: number;
1044
+ }): Promise<RunEvent[]>;
1045
+ putMemory(input: PutMemoryInput): Promise<MemoryItem>;
1046
+ searchMemory(input: SearchMemoryInput): Promise<MemoryItem[]>;
1047
+ createMcpBinding(input: CreateMcpBindingStoreInput): Promise<McpBinding>;
1048
+ getMcpBinding(id: McpBindingId): Promise<McpBinding | null>;
1049
+ listMcpBindings(agentId: AgentSessionId, options?: {
1050
+ status?: McpBindingStatus | "all" | undefined;
1051
+ }): Promise<McpBinding[]>;
1052
+ removeMcpBinding(id: McpBindingId): Promise<McpBinding>;
1053
+ createSkillBinding(input: CreateSkillBindingStoreInput): Promise<SkillBinding>;
1054
+ getSkillBinding(id: SkillBindingId): Promise<SkillBinding | null>;
1055
+ listSkillBindings(agentId: AgentSessionId, options?: {
1056
+ status?: SkillBindingStatus | "all" | undefined;
1057
+ }): Promise<SkillBinding[]>;
1058
+ removeSkillBinding(id: SkillBindingId): Promise<SkillBinding>;
1059
+ createApprovalRequest(input: CreateApprovalRequestStoreInput): Promise<ApprovalRequest>;
1060
+ getApprovalRequest(id: ApprovalRequestId): Promise<ApprovalRequest | null>;
1061
+ listApprovalRequests(runId: RunId, options?: {
1062
+ status?: ApprovalRequestStatus | "all" | undefined;
1063
+ }): Promise<ApprovalRequest[]>;
1064
+ decideApprovalRequest(input: DecideApprovalRequestStoreInput): Promise<ApprovalRequest>;
1065
+ createDeferredToolOperation(input: CreateDeferredToolOperationStoreInput): Promise<DeferredToolOperation>;
1066
+ getDeferredToolOperation(id: DeferredToolOperationId): Promise<DeferredToolOperation | null>;
1067
+ completeDeferredToolOperation(input: CompleteDeferredToolOperationStoreInput): Promise<DeferredToolOperation>;
1068
+ private replaceInboxEvent;
1069
+ private getInboxEventOrThrow;
1070
+ private replaceMcpBinding;
1071
+ private replaceSkillBinding;
1072
+ }
1073
+ //#endregion
1074
+ export { HephErrorOptions as $, StateStore as $n, InboxEventStatus as $t, CallToolInput as A, ResolvedMcpBinding as An, ContextBlockType as At, HephRuntime as B, SkillAgentPolicy as Bn, CreateMcpBindingStoreInput as Bt, RunExecutor as C, MemoryStore as Cn, ApprovalRequestId as Ct, AgentSpecResolverContext as D, MessageStore as Dn, AuthContext as Dt, AgentSpecResolver as E, MessageRole as En, AuthAdapter as Et, CreateAgentSessionInput as F, RunEventType as Fn, ContextSlot as Ft, createHeph as G, SkillBindingStatus as Gn, DeferredToolOperationId as Gt, StreamableHttpMcpToolExecutor as H, SkillBinding as Hn, CreateSkillBindingStoreInput as Ht, CreateHephOptions as I, RunId as In, ContextTemplateMessage as It, InProcessQueue as J, SkillManifest as Jn, DeferredToolResumePolicy as Jt, EnqueueOptions as K, SkillBindingStore as Kn, DeferredToolOperationStatus as Kt, CreateRunInput as L, RunInput as Ln, CreateAgentSessionStoreInput as Lt, CompleteDeferredToolResultResult as M, RunError as Mn, ContextManifestBlock as Mt, CreateAgentAndRunInput as N, RunEvent as Nn, ContextProviderContext as Nt, AppendAgentMessageInput as O, PutMemoryInput as On, CompleteDeferredToolOperationStoreInput as Ot, CreateAgentAndRunResult as P, RunEventId as Pn, ContextProviderDefinition as Pt, HephErrorCode as Q, SourceRef as Qn, InboxEventId as Qt, DeferToolResultInput as R, RunStatus as Rn, CreateApprovalRequestStoreInput as Rt, RunExecutionContext as S, MemoryScope as Sn, ApprovalRequest as St, AgentSpecRegistration as T, MessageId as Tn, ApprovalStore as Tt, ToolCallAttemptResult as U, SkillBindingId as Un, DecideApprovalRequestStoreInput as Ut, RemoveMcpBindingInput as V, SkillAllowReferences as Vn, CreateRunStoreInput as Vt, ToolCallResult as W, SkillBindingSource as Wn, DeferredToolOperation as Wt, QueueAdapter as X, SkillPackage as Xn, HephStores as Xt, InProcessQueueOptions as Y, SkillManifestEntry as Yn, EventLog as Yt, HephError as Z, SkillResourceRef as Zn, InboxEvent as Zt, createMessageId as _, McpToolCallContext as _n, AgentSessionId as _t, block as a, LocalToolManifestTool as an, ToolManifestTool as ar, Tool as at, createSkillBindingId as b, MemoryId as bn, AppendMessageInput as bt, threadState as c, McpBinding as cn, defineContextTemplate as ct, createApprovalRequestId as d, McpBindingResolverContext as dn, ContextRendererOptions as dt, InboxStore as en, ToolConcurrencyKeyFn as er, isHephError as et, createDeferredToolOperationId as f, McpBindingStatus as fn, defaultContextTemplate as ft, createMemoryId as g, McpResolvedCredentials as gn, AgentSession as gt, createMcpBindingId as h, McpCredentialResolverContext as hn, AgentDefinition as ht, RecentMessagesOptions as i, JsonValue as in, ToolManifestSource as ir, ContextTemplate as it, CompleteDeferredToolResultInput as j, Run as jn, ContextManifest as jt, AppendAgentMessageResult as k, RenderedContext as kn, ContextBlock as kt, IdPrefix as l, McpBindingId as ln, defineTool as lt, createInboxEventId as m, McpCatalogTool as mn, messagesToText as mt, createInMemorySkillCatalog as n, JsonPrimitive as nn, ToolExecutionContext as nr, AgentSpec as nt, memorySearch as o, McpAgentPolicy as on, ToolManifestToolBase as or, defineAgent as ot, createId as p, McpBindingStore as pn, estimateTokens as pt, HephJob as q, SkillCatalog as qn, DeferredToolOperationStore as qt, MemorySearchOptions as r, JsonSchema as rn, ToolManifest as rr, ContextProvider as rt, recentMessages as s, McpAllowTools as sn, defineContextProvider as st, InMemoryHephStore as t, JsonObject as tn, ToolDefinition as tr, toErrorDetails as tt, createAgentSessionId as u, McpBindingResolver as un, ContextRenderer as ut, createRunEventId as v, McpToolExecutor as vn, AgentSpecId as vt, AddMcpBindingInput as w, Message as wn, ApprovalRequestStatus as wt, MinimalRunExecutor as x, MemoryItem as xn, AppendRunEventInput as xt, createRunId as y, McpToolManifestTool as yn, AppendInboxEventInput as yt, FailedToolCallResult as z, SearchMemoryInput as zn, CreateDeferredToolOperationStoreInput as zt };
1075
+ //# sourceMappingURL=index-CdsI9z7r.d.mts.map