@falai/agent 0.1.0
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/README.md +516 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/core/Agent.d.ts +98 -0
- package/dist/core/Agent.d.ts.map +1 -0
- package/dist/core/Agent.js +248 -0
- package/dist/core/Agent.js.map +1 -0
- package/dist/core/DomainRegistry.d.ts +26 -0
- package/dist/core/DomainRegistry.d.ts.map +1 -0
- package/dist/core/DomainRegistry.js +41 -0
- package/dist/core/DomainRegistry.js.map +1 -0
- package/dist/core/Events.d.ts +19 -0
- package/dist/core/Events.d.ts.map +1 -0
- package/dist/core/Events.js +79 -0
- package/dist/core/Events.js.map +1 -0
- package/dist/core/Observation.d.ts +24 -0
- package/dist/core/Observation.d.ts.map +1 -0
- package/dist/core/Observation.js +35 -0
- package/dist/core/Observation.js.map +1 -0
- package/dist/core/PromptBuilder.d.ts +121 -0
- package/dist/core/PromptBuilder.d.ts.map +1 -0
- package/dist/core/PromptBuilder.js +339 -0
- package/dist/core/PromptBuilder.js.map +1 -0
- package/dist/core/Route.d.ts +46 -0
- package/dist/core/Route.d.ts.map +1 -0
- package/dist/core/Route.js +113 -0
- package/dist/core/Route.js.map +1 -0
- package/dist/core/State.d.ts +50 -0
- package/dist/core/State.d.ts.map +1 -0
- package/dist/core/State.js +110 -0
- package/dist/core/State.js.map +1 -0
- package/dist/core/Tool.d.ts +31 -0
- package/dist/core/Tool.d.ts.map +1 -0
- package/dist/core/Tool.js +33 -0
- package/dist/core/Tool.js.map +1 -0
- package/dist/core/Transition.d.ts +32 -0
- package/dist/core/Transition.d.ts.map +1 -0
- package/dist/core/Transition.js +59 -0
- package/dist/core/Transition.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/GeminiProvider.d.ts +40 -0
- package/dist/providers/GeminiProvider.d.ts.map +1 -0
- package/dist/providers/GeminiProvider.js +126 -0
- package/dist/providers/GeminiProvider.js.map +1 -0
- package/dist/providers/OpenAIProvider.d.ts +42 -0
- package/dist/providers/OpenAIProvider.d.ts.map +1 -0
- package/dist/providers/OpenAIProvider.js +164 -0
- package/dist/providers/OpenAIProvider.js.map +1 -0
- package/dist/providers/OpenRouterProvider.d.ts +46 -0
- package/dist/providers/OpenRouterProvider.d.ts.map +1 -0
- package/dist/providers/OpenRouterProvider.js +171 -0
- package/dist/providers/OpenRouterProvider.js.map +1 -0
- package/dist/types/agent.d.ts +105 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +18 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/ai.d.ts +78 -0
- package/dist/types/ai.d.ts.map +1 -0
- package/dist/types/ai.js +5 -0
- package/dist/types/ai.js.map +1 -0
- package/dist/types/history.d.ts +112 -0
- package/dist/types/history.d.ts.map +1 -0
- package/dist/types/history.js +34 -0
- package/dist/types/history.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/observation.d.ts +25 -0
- package/dist/types/observation.d.ts.map +1 -0
- package/dist/types/observation.js +5 -0
- package/dist/types/observation.js.map +1 -0
- package/dist/types/prompt.d.ts +46 -0
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/types/prompt.js +16 -0
- package/dist/types/prompt.js.map +1 -0
- package/dist/types/route.d.ts +59 -0
- package/dist/types/route.d.ts.map +1 -0
- package/dist/types/route.js +5 -0
- package/dist/types/route.js.map +1 -0
- package/dist/types/tool.d.ts +46 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/tool.js +5 -0
- package/dist/types/tool.js.map +1 -0
- package/dist/utils/retry.d.ts +13 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +70 -0
- package/dist/utils/retry.js.map +1 -0
- package/docs/API_REFERENCE.md +517 -0
- package/docs/CONSTRUCTOR_OPTIONS.md +256 -0
- package/docs/CONTRIBUTING.md +481 -0
- package/docs/GETTING_STARTED.md +328 -0
- package/docs/PROVIDERS.md +472 -0
- package/docs/PUBLISHING.md +174 -0
- package/docs/README.md +68 -0
- package/docs/STRUCTURE.md +32 -0
- package/examples/declarative-agent.ts +217 -0
- package/examples/healthcare-agent.ts +283 -0
- package/examples/openai-agent.ts +167 -0
- package/examples/travel-agent.ts +342 -0
- package/package.json +73 -0
- package/src/constants/index.ts +5 -0
- package/src/core/Agent.ts +307 -0
- package/src/core/DomainRegistry.ts +50 -0
- package/src/core/Events.ts +101 -0
- package/src/core/Observation.ts +46 -0
- package/src/core/PromptBuilder.ts +511 -0
- package/src/core/Route.ts +136 -0
- package/src/core/State.ts +153 -0
- package/src/core/Tool.ts +54 -0
- package/src/core/Transition.ts +66 -0
- package/src/index.ts +83 -0
- package/src/providers/GeminiProvider.ts +220 -0
- package/src/providers/OpenAIProvider.ts +272 -0
- package/src/providers/OpenRouterProvider.ts +282 -0
- package/src/types/agent.ts +112 -0
- package/src/types/ai.ts +85 -0
- package/src/types/history.ts +125 -0
- package/src/types/index.ts +56 -0
- package/src/types/observation.ts +27 -0
- package/src/types/prompt.ts +49 -0
- package/src/types/route.ts +68 -0
- package/src/types/tool.ts +53 -0
- package/src/utils/retry.ts +96 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event history and interaction types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Types of events in the interaction history
|
|
6
|
+
*/
|
|
7
|
+
export declare enum EventKind {
|
|
8
|
+
/** A text message event */
|
|
9
|
+
MESSAGE = "message",
|
|
10
|
+
/** A tool execution event */
|
|
11
|
+
TOOL = "tool",
|
|
12
|
+
/** A status update event */
|
|
13
|
+
STATUS = "status"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Source of an event
|
|
17
|
+
*/
|
|
18
|
+
export declare enum EventSource {
|
|
19
|
+
/** Event originated from the customer/user */
|
|
20
|
+
CUSTOMER = "customer",
|
|
21
|
+
/** Event from customer UI application */
|
|
22
|
+
CUSTOMER_UI = "customer_ui",
|
|
23
|
+
/** Event from human service agent */
|
|
24
|
+
HUMAN_AGENT = "human_agent",
|
|
25
|
+
/** Human agent acting on behalf of AI agent */
|
|
26
|
+
HUMAN_AGENT_ON_BEHALF_OF_AI_AGENT = "human_agent_on_behalf_of_ai_agent",
|
|
27
|
+
/** Event generated by AI agent */
|
|
28
|
+
AI_AGENT = "ai_agent",
|
|
29
|
+
/** System-generated event */
|
|
30
|
+
SYSTEM = "system"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Participant in a conversation
|
|
34
|
+
*/
|
|
35
|
+
export interface Participant {
|
|
36
|
+
/** Display name */
|
|
37
|
+
display_name: string;
|
|
38
|
+
/** Unique identifier */
|
|
39
|
+
id?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Data for a message event
|
|
43
|
+
*/
|
|
44
|
+
export interface MessageEventData {
|
|
45
|
+
/** The participant who sent the message */
|
|
46
|
+
participant: Participant;
|
|
47
|
+
/** The message content */
|
|
48
|
+
message: string;
|
|
49
|
+
/** Whether the message was flagged/censored */
|
|
50
|
+
flagged?: boolean;
|
|
51
|
+
/** Tags/reasons if flagged */
|
|
52
|
+
tags?: string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Result of a tool execution
|
|
56
|
+
*/
|
|
57
|
+
export interface ToolResult<TData = unknown> {
|
|
58
|
+
/** The result data */
|
|
59
|
+
data: TData;
|
|
60
|
+
/** Optional metadata */
|
|
61
|
+
meta?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A single tool call within a tool event
|
|
65
|
+
*/
|
|
66
|
+
export interface ToolCall<TArgs = unknown, TResult = unknown> {
|
|
67
|
+
/** Tool identifier */
|
|
68
|
+
tool_id: string;
|
|
69
|
+
/** Arguments passed to the tool */
|
|
70
|
+
arguments: TArgs;
|
|
71
|
+
/** Result returned by the tool */
|
|
72
|
+
result: ToolResult<TResult>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Data for a tool event
|
|
76
|
+
*/
|
|
77
|
+
export interface ToolEventData {
|
|
78
|
+
/** Array of tool calls executed */
|
|
79
|
+
tool_calls: ToolCall[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Data for a status event
|
|
83
|
+
*/
|
|
84
|
+
export interface StatusEventData {
|
|
85
|
+
/** Status message */
|
|
86
|
+
status: string;
|
|
87
|
+
/** Additional details */
|
|
88
|
+
details?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Base event structure
|
|
92
|
+
*/
|
|
93
|
+
export interface Event<TData = MessageEventData | ToolEventData | StatusEventData> {
|
|
94
|
+
/** Type of event */
|
|
95
|
+
kind: EventKind;
|
|
96
|
+
/** Source of the event */
|
|
97
|
+
source: EventSource;
|
|
98
|
+
/** Event-specific data */
|
|
99
|
+
data: TData;
|
|
100
|
+
/** Timestamp (ISO string) */
|
|
101
|
+
timestamp?: string;
|
|
102
|
+
/** Unique event identifier */
|
|
103
|
+
id?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* An emitted event (staged for inclusion)
|
|
107
|
+
*/
|
|
108
|
+
export interface EmittedEvent<TData = MessageEventData | ToolEventData | StatusEventData> extends Event<TData> {
|
|
109
|
+
/** Whether this event has been committed */
|
|
110
|
+
committed?: boolean;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/types/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,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C;IACnC,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,KAAK,CACpB,KAAK,GAAG,gBAAgB,GAAG,aAAa,GAAG,eAAe;IAE1D,oBAAoB;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,0BAA0B;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,0BAA0B;IAC1B,IAAI,EAAE,KAAK,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAC3B,KAAK,GAAG,gBAAgB,GAAG,aAAa,GAAG,eAAe,CAC1D,SAAQ,KAAK,CAAC,KAAK,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event history and interaction types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Types of events in the interaction history
|
|
6
|
+
*/
|
|
7
|
+
export var EventKind;
|
|
8
|
+
(function (EventKind) {
|
|
9
|
+
/** A text message event */
|
|
10
|
+
EventKind["MESSAGE"] = "message";
|
|
11
|
+
/** A tool execution event */
|
|
12
|
+
EventKind["TOOL"] = "tool";
|
|
13
|
+
/** A status update event */
|
|
14
|
+
EventKind["STATUS"] = "status";
|
|
15
|
+
})(EventKind || (EventKind = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Source of an event
|
|
18
|
+
*/
|
|
19
|
+
export var EventSource;
|
|
20
|
+
(function (EventSource) {
|
|
21
|
+
/** Event originated from the customer/user */
|
|
22
|
+
EventSource["CUSTOMER"] = "customer";
|
|
23
|
+
/** Event from customer UI application */
|
|
24
|
+
EventSource["CUSTOMER_UI"] = "customer_ui";
|
|
25
|
+
/** Event from human service agent */
|
|
26
|
+
EventSource["HUMAN_AGENT"] = "human_agent";
|
|
27
|
+
/** Human agent acting on behalf of AI agent */
|
|
28
|
+
EventSource["HUMAN_AGENT_ON_BEHALF_OF_AI_AGENT"] = "human_agent_on_behalf_of_ai_agent";
|
|
29
|
+
/** Event generated by AI agent */
|
|
30
|
+
EventSource["AI_AGENT"] = "ai_agent";
|
|
31
|
+
/** System-generated event */
|
|
32
|
+
EventSource["SYSTEM"] = "system";
|
|
33
|
+
})(EventSource || (EventSource = {}));
|
|
34
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/types/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,2BAA2B;IAC3B,gCAAmB,CAAA;IACnB,6BAA6B;IAC7B,0BAAa,CAAA;IACb,4BAA4B;IAC5B,8BAAiB,CAAA;AACnB,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,8CAA8C;IAC9C,oCAAqB,CAAA;IACrB,yCAAyC;IACzC,0CAA2B,CAAA;IAC3B,qCAAqC;IACrC,0CAA2B,CAAA;IAC3B,+CAA+C;IAC/C,sFAAuE,CAAA;IACvE,kCAAkC;IAClC,oCAAqB,CAAA;IACrB,6BAA6B;IAC7B,gCAAiB,CAAA;AACnB,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central type definitions export
|
|
3
|
+
*/
|
|
4
|
+
export type { AgentOptions, Term, Guideline, Capability, GuidelineMatch, } from "./agent";
|
|
5
|
+
export { CompositionMode } from "./agent";
|
|
6
|
+
export type { Event, EmittedEvent, MessageEventData, ToolEventData, StatusEventData, Participant, ToolResult as EventToolResult, ToolCall, } from "./history";
|
|
7
|
+
export { EventKind, EventSource } from "./history";
|
|
8
|
+
export type { RouteRef, StateRef, RouteOptions, TransitionSpec, TransitionResult, } from "./route";
|
|
9
|
+
export type { ToolContext, ToolResult, ToolHandler, ToolRef } from "./tool";
|
|
10
|
+
export type { AiProvider, GenerateMessageInput, GenerateMessageOutput, } from "./ai";
|
|
11
|
+
export type { PromptSection, ContextVariable, ContextVariableValue, } from "./prompt";
|
|
12
|
+
export { SectionStatus } from "./prompt";
|
|
13
|
+
export type { Observation, ObservationOptions } from "./observation";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,UAAU,EACV,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,YAAY,EACV,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,IAAI,eAAe,EAC7B,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGnD,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAG5E,YAAY,EACV,UAAU,EACV,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,MAAM,CAAC;AAGd,YAAY,EACV,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAa1C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AA2BnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observation types for disambiguation
|
|
3
|
+
*/
|
|
4
|
+
import type { RouteRef } from "./route";
|
|
5
|
+
/**
|
|
6
|
+
* An observation that can disambiguate between multiple routes
|
|
7
|
+
*/
|
|
8
|
+
export interface Observation {
|
|
9
|
+
/** Unique identifier */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The observation description */
|
|
12
|
+
description: string;
|
|
13
|
+
/** Routes this observation can disambiguate between */
|
|
14
|
+
routes?: RouteRef[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Options for creating an observation
|
|
18
|
+
*/
|
|
19
|
+
export interface ObservationOptions {
|
|
20
|
+
/** The observation description */
|
|
21
|
+
description: string;
|
|
22
|
+
/** Route IDs or titles to disambiguate between (can be set later with disambiguate()) */
|
|
23
|
+
routeRefs?: string[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../src/types/observation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.js","sourceRoot":"","sources":["../../src/types/observation.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt building types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Status of a prompt section
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SectionStatus {
|
|
8
|
+
/** Section has active information */
|
|
9
|
+
ACTIVE = "active",
|
|
10
|
+
/** Section is inactive but may have empty-state text */
|
|
11
|
+
PASSIVE = "passive",
|
|
12
|
+
/** Section is not included */
|
|
13
|
+
NONE = "none"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A section within a prompt
|
|
17
|
+
*/
|
|
18
|
+
export interface PromptSection {
|
|
19
|
+
/** Template string (may contain placeholders) */
|
|
20
|
+
template: string;
|
|
21
|
+
/** Properties to fill template placeholders */
|
|
22
|
+
props: Record<string, unknown>;
|
|
23
|
+
/** Status of this section */
|
|
24
|
+
status?: SectionStatus;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Context variable with value
|
|
28
|
+
*/
|
|
29
|
+
export interface ContextVariable {
|
|
30
|
+
/** Variable name */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Variable description */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Variable type */
|
|
35
|
+
type?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Value for a context variable
|
|
39
|
+
*/
|
|
40
|
+
export interface ContextVariableValue {
|
|
41
|
+
/** The variable definition */
|
|
42
|
+
variable: ContextVariable;
|
|
43
|
+
/** The current value */
|
|
44
|
+
value: unknown;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,oBAAY,aAAa;IACvB,qCAAqC;IACrC,MAAM,WAAW;IACjB,wDAAwD;IACxD,OAAO,YAAY;IACnB,8BAA8B;IAC9B,IAAI,SAAS;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,wBAAwB;IACxB,KAAK,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt building types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Status of a prompt section
|
|
6
|
+
*/
|
|
7
|
+
export var SectionStatus;
|
|
8
|
+
(function (SectionStatus) {
|
|
9
|
+
/** Section has active information */
|
|
10
|
+
SectionStatus["ACTIVE"] = "active";
|
|
11
|
+
/** Section is inactive but may have empty-state text */
|
|
12
|
+
SectionStatus["PASSIVE"] = "passive";
|
|
13
|
+
/** Section is not included */
|
|
14
|
+
SectionStatus["NONE"] = "none";
|
|
15
|
+
})(SectionStatus || (SectionStatus = {}));
|
|
16
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,qCAAqC;IACrC,kCAAiB,CAAA;IACjB,wDAAwD;IACxD,oCAAmB,CAAA;IACnB,8BAA8B;IAC9B,8BAAa,CAAA;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route/Journey DSL type definitions
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolRef } from "./tool";
|
|
5
|
+
/**
|
|
6
|
+
* Reference to a route
|
|
7
|
+
*/
|
|
8
|
+
export interface RouteRef {
|
|
9
|
+
/** Route identifier */
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reference to a state within a route
|
|
14
|
+
*/
|
|
15
|
+
export interface StateRef {
|
|
16
|
+
/** State identifier */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Route this state belongs to */
|
|
19
|
+
routeId: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Forward declare Guideline for circular dependency
|
|
23
|
+
*/
|
|
24
|
+
import type { Guideline } from "./agent";
|
|
25
|
+
/**
|
|
26
|
+
* Options for creating a route
|
|
27
|
+
*/
|
|
28
|
+
export interface RouteOptions {
|
|
29
|
+
/** Title of the route */
|
|
30
|
+
title: string;
|
|
31
|
+
/** Description of what this route accomplishes */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Conditions that activate this route */
|
|
34
|
+
conditions?: string[];
|
|
35
|
+
/** Initial guidelines for this route */
|
|
36
|
+
guidelines?: Guideline[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Specification for a state transition
|
|
40
|
+
*/
|
|
41
|
+
export interface TransitionSpec {
|
|
42
|
+
/** Transition to a chat state with this description */
|
|
43
|
+
chatState?: string;
|
|
44
|
+
/** Transition to execute a tool */
|
|
45
|
+
toolState?: ToolRef<unknown, unknown[], unknown>;
|
|
46
|
+
/** Transition to a specific state or end marker */
|
|
47
|
+
state?: StateRef | symbol;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Result of a transition operation
|
|
51
|
+
*/
|
|
52
|
+
export interface TransitionResult {
|
|
53
|
+
/** The target state after transition */
|
|
54
|
+
target: StateRef & {
|
|
55
|
+
/** Allow chaining transitions */
|
|
56
|
+
transitionTo: (spec: TransitionSpec, condition?: string) => TransitionResult;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/types/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,wCAAwC;IACxC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,mDAAmD;IACnD,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,EAAE,QAAQ,GAAG;QACjB,iCAAiC;QACjC,YAAY,EAAE,CACZ,IAAI,EAAE,cAAc,EACpB,SAAS,CAAC,EAAE,MAAM,KACf,gBAAgB,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/types/route.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool system type definitions
|
|
3
|
+
*/
|
|
4
|
+
import type { Event, StateRef } from "./index";
|
|
5
|
+
/**
|
|
6
|
+
* Context provided to tool handlers
|
|
7
|
+
*/
|
|
8
|
+
export interface ToolContext<TContext = unknown> {
|
|
9
|
+
/** The agent's context data */
|
|
10
|
+
context: TContext;
|
|
11
|
+
/** Current state reference (if in a route) */
|
|
12
|
+
state?: StateRef;
|
|
13
|
+
/** Interaction history */
|
|
14
|
+
history: Event[];
|
|
15
|
+
/** Additional metadata */
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result returned by a tool
|
|
20
|
+
*/
|
|
21
|
+
export interface ToolResult<TData = unknown> {
|
|
22
|
+
/** The result data */
|
|
23
|
+
data: TData;
|
|
24
|
+
/** Optional metadata about the execution */
|
|
25
|
+
meta?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Handler function for a tool
|
|
29
|
+
*/
|
|
30
|
+
export type ToolHandler<TContext, TArgs extends unknown[], TResult> = (context: ToolContext<TContext>, ...args: TArgs) => Promise<ToolResult<TResult>> | ToolResult<TResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Reference to a defined tool
|
|
33
|
+
*/
|
|
34
|
+
export interface ToolRef<TContext, TArgs extends unknown[], TResult> {
|
|
35
|
+
/** Tool identifier */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Tool name */
|
|
38
|
+
name: string;
|
|
39
|
+
/** Tool handler function */
|
|
40
|
+
handler: ToolHandler<TContext, TArgs, TResult>;
|
|
41
|
+
/** Description of what the tool does */
|
|
42
|
+
description?: string;
|
|
43
|
+
/** Parameter schema or description */
|
|
44
|
+
parameters?: unknown;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/types/tool.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,QAAQ,GAAG,OAAO;IAC7C,+BAA+B;IAC/B,OAAO,EAAE,QAAQ,CAAC;IAClB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,0BAA0B;IAC1B,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,GAAG,OAAO;IACzC,sBAAsB;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,QAAQ,EAAE,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,IAAI,CACpE,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,EAC9B,GAAG,IAAI,EAAE,KAAK,KACX,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,QAAQ,EAAE,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO;IACjE,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/types/tool.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry utility with exponential backoff
|
|
3
|
+
*/
|
|
4
|
+
export interface RetryOptions<T> {
|
|
5
|
+
operation: () => Promise<T>;
|
|
6
|
+
maxRetries: number;
|
|
7
|
+
delay: (attempt: number) => number;
|
|
8
|
+
onRetry?: (attempt: number, error: unknown) => void;
|
|
9
|
+
onFailure?: (error: unknown) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function retry<T>(options: RetryOptions<T>): Promise<T>;
|
|
12
|
+
export declare const withTimeoutAndRetry: <T>(operation: () => Promise<T>, timeoutMs?: number, maxRetries?: number, operationName?: string) => Promise<T>;
|
|
13
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACzC;AAED,wBAAsB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CA8BnE;AAED,eAAO,MAAM,mBAAmB,GAAU,CAAC,EACzC,WAAW,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,YAAW,MAAc,EACzB,aAAY,MAAU,EACtB,gBAAe,MAAuB,KACrC,OAAO,CAAC,CAAC,CA8CX,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry utility with exponential backoff
|
|
3
|
+
*/
|
|
4
|
+
export async function retry(options) {
|
|
5
|
+
const { operation, maxRetries, delay, onRetry, onFailure } = options;
|
|
6
|
+
let lastError;
|
|
7
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
8
|
+
try {
|
|
9
|
+
return await operation();
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
lastError = error;
|
|
13
|
+
if (attempt === maxRetries) {
|
|
14
|
+
const shouldRethrow = onFailure ? onFailure(lastError) : true;
|
|
15
|
+
if (shouldRethrow) {
|
|
16
|
+
throw lastError;
|
|
17
|
+
}
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
if (onRetry) {
|
|
21
|
+
onRetry(attempt, lastError);
|
|
22
|
+
}
|
|
23
|
+
const delayMs = delay(attempt);
|
|
24
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/only-throw-error
|
|
28
|
+
throw lastError ?? new Error("Operation failed");
|
|
29
|
+
}
|
|
30
|
+
export const withTimeoutAndRetry = async (operation, timeoutMs = 60000, maxRetries = 3, operationName = "AI operation") => {
|
|
31
|
+
const createTimeoutOperation = () => async () => {
|
|
32
|
+
const controller = new AbortController();
|
|
33
|
+
const timeoutId = setTimeout(() => {
|
|
34
|
+
controller.abort();
|
|
35
|
+
}, timeoutMs);
|
|
36
|
+
try {
|
|
37
|
+
const result = await Promise.race([
|
|
38
|
+
operation(),
|
|
39
|
+
new Promise((_, reject) => {
|
|
40
|
+
controller.signal.addEventListener("abort", () => {
|
|
41
|
+
reject(new Error(`Operation timed out after ${timeoutMs}ms`));
|
|
42
|
+
});
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
clearTimeout(timeoutId);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
clearTimeout(timeoutId);
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return retry({
|
|
54
|
+
operation: createTimeoutOperation(),
|
|
55
|
+
maxRetries,
|
|
56
|
+
delay: (attempt) => Math.min(1000 * Math.pow(2, attempt), 5000),
|
|
57
|
+
onRetry: (attempt, error) => {
|
|
58
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
59
|
+
console.error(`[${operationName}] Failed attempt ${attempt + 1}:`, message);
|
|
60
|
+
const delay = Math.min(1000 * Math.pow(2, attempt), 5000);
|
|
61
|
+
console.log(`[${operationName}] Retrying in ${delay}ms...`);
|
|
62
|
+
console.log(`[${operationName}] Attempt ${attempt + 2}/${maxRetries + 1}`);
|
|
63
|
+
},
|
|
64
|
+
onFailure: (_error) => {
|
|
65
|
+
console.error(`[${operationName}] All ${maxRetries + 1} attempts failed`);
|
|
66
|
+
return true;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI,OAAwB;IACrD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAErE,IAAI,SAAkB,CAAC;IAEvB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,SAAS,GAAG,KAAK,CAAC;YAElB,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;gBAC3B,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC9D,IAAI,aAAa,EAAE,CAAC;oBAClB,MAAM,SAAS,CAAC;gBAClB,CAAC;gBACD,MAAM;YACR,CAAC;YAED,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAC9B,CAAC;YAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;YAC/B,MAAM,IAAI,OAAO,CA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