botinabox 1.5.0 → 1.7.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 +12 -6
- package/dist/index.d.ts +771 -1
- package/dist/index.js +1529 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -848,14 +848,95 @@ declare class MessagePipeline {
|
|
|
848
848
|
/**
|
|
849
849
|
* Chat routing — maps channel/scope to agentId.
|
|
850
850
|
* Story 4.2
|
|
851
|
+
*
|
|
852
|
+
* @deprecated Use TriageRouter for content-aware routing with keyword/regex
|
|
853
|
+
* matching and LLM fallback. This static channel→agent binding is kept for
|
|
854
|
+
* backward compatibility only. See `./triage-router.ts`.
|
|
851
855
|
*/
|
|
852
856
|
|
|
853
857
|
/**
|
|
854
858
|
* Build a map from channel identifier to agentId.
|
|
855
859
|
* Each agent may have a config.channel or config.channels binding.
|
|
860
|
+
*
|
|
861
|
+
* @deprecated Use TriageRouter instead — it supports keyword, regex,
|
|
862
|
+
* and LLM-based routing with ownership chain logging.
|
|
856
863
|
*/
|
|
857
864
|
declare function buildAgentBindings(agents: AgentConfig[]): Map<string, string>;
|
|
858
865
|
|
|
866
|
+
/**
|
|
867
|
+
* TriageRouter — content-based routing with deterministic-first resolution.
|
|
868
|
+
* Story 6.3
|
|
869
|
+
*
|
|
870
|
+
* Replaces the simple channel→agent binding with intelligent routing:
|
|
871
|
+
* 1. Keyword/regex rules evaluated first (deterministic, ~4ms)
|
|
872
|
+
* 2. LLM classification only for ambiguous messages (async, ~2-4s)
|
|
873
|
+
* 3. Ownership chain logged for every routing decision
|
|
874
|
+
*
|
|
875
|
+
* Key constraint: specialists return to triage, never to another specialist.
|
|
876
|
+
*/
|
|
877
|
+
|
|
878
|
+
interface RoutingRule {
|
|
879
|
+
/** Target agent slug */
|
|
880
|
+
agentSlug: string;
|
|
881
|
+
/** Keywords that trigger this rule (case-insensitive) */
|
|
882
|
+
keywords?: string[];
|
|
883
|
+
/** Regex patterns that trigger this rule */
|
|
884
|
+
patterns?: string[];
|
|
885
|
+
/** Priority — lower number wins ties. Default: 50 */
|
|
886
|
+
priority?: number;
|
|
887
|
+
}
|
|
888
|
+
interface RoutingDecision {
|
|
889
|
+
timestamp: string;
|
|
890
|
+
source: string;
|
|
891
|
+
target: string;
|
|
892
|
+
reason: string;
|
|
893
|
+
method: 'deterministic' | 'llm';
|
|
894
|
+
messageId?: string;
|
|
895
|
+
channel?: string;
|
|
896
|
+
}
|
|
897
|
+
interface TriageRouterConfig {
|
|
898
|
+
/** Static routing rules evaluated deterministically */
|
|
899
|
+
rules: RoutingRule[];
|
|
900
|
+
/** Fallback agent if no rule matches and LLM is unavailable */
|
|
901
|
+
fallbackAgent?: string;
|
|
902
|
+
/** Whether to use LLM for ambiguous messages. Default: true */
|
|
903
|
+
llmFallback?: boolean;
|
|
904
|
+
/** Log decisions to the database. Default: true */
|
|
905
|
+
persist?: boolean;
|
|
906
|
+
}
|
|
907
|
+
declare class TriageRouter {
|
|
908
|
+
private db;
|
|
909
|
+
private hooks;
|
|
910
|
+
private readonly rules;
|
|
911
|
+
private readonly fallbackAgent?;
|
|
912
|
+
private readonly llmFallback;
|
|
913
|
+
private readonly persist;
|
|
914
|
+
private readonly compiledRules;
|
|
915
|
+
constructor(db: DataStore, hooks: HookBus, config: TriageRouterConfig);
|
|
916
|
+
/**
|
|
917
|
+
* Route an inbound message to the best agent.
|
|
918
|
+
* Returns the agent slug and the routing decision.
|
|
919
|
+
*/
|
|
920
|
+
route(msg: InboundMessage): Promise<{
|
|
921
|
+
agentSlug: string | undefined;
|
|
922
|
+
decision: RoutingDecision;
|
|
923
|
+
}>;
|
|
924
|
+
/**
|
|
925
|
+
* Query the ownership chain for a given message or channel.
|
|
926
|
+
*/
|
|
927
|
+
getDecisionHistory(filter?: {
|
|
928
|
+
channel?: string;
|
|
929
|
+
limit?: number;
|
|
930
|
+
}): Promise<RoutingDecision[]>;
|
|
931
|
+
/**
|
|
932
|
+
* LLM classification — emits a hook for external LLM integration.
|
|
933
|
+
* Returns agent slug + reason, or undefined if LLM is unavailable.
|
|
934
|
+
*/
|
|
935
|
+
private classifyWithLLM;
|
|
936
|
+
private buildDecision;
|
|
937
|
+
private logDecision;
|
|
938
|
+
}
|
|
939
|
+
|
|
859
940
|
/**
|
|
860
941
|
* Chat policy helpers — allowlist and mention gate checks.
|
|
861
942
|
* Story 4.2
|
|
@@ -954,6 +1035,244 @@ declare class NotificationQueue {
|
|
|
954
1035
|
private processNext;
|
|
955
1036
|
}
|
|
956
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* MessageStore — store-before-respond guarantee for all chat interactions.
|
|
1040
|
+
* Story 7.1
|
|
1041
|
+
*
|
|
1042
|
+
* Every inbound message (with attachments) is stored BEFORE the bot responds.
|
|
1043
|
+
* Every outbound message is stored BEFORE it is sent to the user.
|
|
1044
|
+
* Storage confirmation is required before any response flows.
|
|
1045
|
+
*/
|
|
1046
|
+
|
|
1047
|
+
interface StoredAttachment {
|
|
1048
|
+
fileType: string;
|
|
1049
|
+
filename?: string;
|
|
1050
|
+
mimeType?: string;
|
|
1051
|
+
sizeBytes?: number;
|
|
1052
|
+
contents?: string;
|
|
1053
|
+
summary?: string;
|
|
1054
|
+
url?: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface StoreResult {
|
|
1057
|
+
messageId: string;
|
|
1058
|
+
attachmentIds: string[];
|
|
1059
|
+
}
|
|
1060
|
+
declare class MessageStore {
|
|
1061
|
+
private db;
|
|
1062
|
+
private hooks;
|
|
1063
|
+
constructor(db: DataStore, hooks: HookBus);
|
|
1064
|
+
/**
|
|
1065
|
+
* Store an inbound message and its attachments.
|
|
1066
|
+
* Must complete successfully before any bot response is generated.
|
|
1067
|
+
*/
|
|
1068
|
+
storeInbound(msg: InboundMessage): Promise<StoreResult>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Store an outbound message BEFORE sending it.
|
|
1071
|
+
* Returns the message ID for confirmation tracking.
|
|
1072
|
+
*/
|
|
1073
|
+
storeOutbound(opts: {
|
|
1074
|
+
channel: string;
|
|
1075
|
+
text: string;
|
|
1076
|
+
threadId?: string;
|
|
1077
|
+
agentId?: string;
|
|
1078
|
+
agentSlug?: string;
|
|
1079
|
+
taskId?: string;
|
|
1080
|
+
}): Promise<string>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Store an attachment linked to a message.
|
|
1083
|
+
*/
|
|
1084
|
+
storeAttachment(messageId: string, att: StoredAttachment): Promise<string>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Get recent messages in a thread for context building.
|
|
1087
|
+
*/
|
|
1088
|
+
getThreadHistory(threadId: string, limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Get recent outbound messages in a thread for redundancy checking.
|
|
1091
|
+
*/
|
|
1092
|
+
getRecentOutbound(threadId: string, limit?: number): Promise<Array<Record<string, unknown>>>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Get attachments for a message.
|
|
1095
|
+
*/
|
|
1096
|
+
getAttachments(messageId: string): Promise<Array<Record<string, unknown>>>;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* ChatResponder — fast conversational layer with LLM-filtered responses.
|
|
1101
|
+
* Story 7.2
|
|
1102
|
+
*
|
|
1103
|
+
* Provides rapid (<2s) conversational responses using a cheap LLM (Haiku).
|
|
1104
|
+
* The responder has awareness of tools and capabilities but does NOT execute
|
|
1105
|
+
* anything — it keeps the conversation going while work happens async.
|
|
1106
|
+
*
|
|
1107
|
+
* All outbound messages (direct, post-interpretation, task execution) are
|
|
1108
|
+
* filtered through this layer for human readability and redundancy checking.
|
|
1109
|
+
*/
|
|
1110
|
+
|
|
1111
|
+
interface ChatResponderConfig {
|
|
1112
|
+
/** System prompt for the conversational responder */
|
|
1113
|
+
systemPrompt?: string;
|
|
1114
|
+
/** Max tokens for context window. Default: 4000 */
|
|
1115
|
+
contextWindowTokens?: number;
|
|
1116
|
+
/** Max recent outbound messages to check for redundancy. Default: 10 */
|
|
1117
|
+
redundancyWindow?: number;
|
|
1118
|
+
/** Model to use for responses. Default: 'fast' (resolved via ModelRouter) */
|
|
1119
|
+
model?: string;
|
|
1120
|
+
/** Caller-provided LLM call function */
|
|
1121
|
+
llmCall: (params: {
|
|
1122
|
+
model: string;
|
|
1123
|
+
messages: ChatMessage[];
|
|
1124
|
+
system?: string;
|
|
1125
|
+
maxTokens?: number;
|
|
1126
|
+
}) => Promise<{
|
|
1127
|
+
content: string;
|
|
1128
|
+
}>;
|
|
1129
|
+
}
|
|
1130
|
+
declare class ChatResponder {
|
|
1131
|
+
private db;
|
|
1132
|
+
private hooks;
|
|
1133
|
+
private messageStore;
|
|
1134
|
+
private readonly systemPrompt;
|
|
1135
|
+
private readonly contextWindowTokens;
|
|
1136
|
+
private readonly redundancyWindow;
|
|
1137
|
+
private readonly model;
|
|
1138
|
+
private readonly llmCall;
|
|
1139
|
+
constructor(db: DataStore, hooks: HookBus, messageStore: MessageStore, config: ChatResponderConfig);
|
|
1140
|
+
/**
|
|
1141
|
+
* Generate a fast conversational response to an inbound message.
|
|
1142
|
+
* Uses rolling context window from thread history.
|
|
1143
|
+
*/
|
|
1144
|
+
respond(opts: {
|
|
1145
|
+
messageBody: string;
|
|
1146
|
+
threadId: string;
|
|
1147
|
+
channel: string;
|
|
1148
|
+
userName?: string;
|
|
1149
|
+
capabilities?: string;
|
|
1150
|
+
}): Promise<string>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Filter any outbound message through the LLM for human readability.
|
|
1153
|
+
* This is the single funnel ALL responses pass through.
|
|
1154
|
+
*/
|
|
1155
|
+
filterResponse(text: string, context?: {
|
|
1156
|
+
channel?: string;
|
|
1157
|
+
threadId?: string;
|
|
1158
|
+
source?: string;
|
|
1159
|
+
}): Promise<string>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Check if a candidate outbound message is redundant with recent messages.
|
|
1162
|
+
* Returns true if the message should be suppressed.
|
|
1163
|
+
*/
|
|
1164
|
+
isRedundant(text: string, threadId: string): Promise<boolean>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Full send pipeline: check redundancy → filter → store → deliver.
|
|
1167
|
+
* Returns the message ID, or undefined if suppressed as redundant.
|
|
1168
|
+
*/
|
|
1169
|
+
sendResponse(opts: {
|
|
1170
|
+
text: string;
|
|
1171
|
+
channel: string;
|
|
1172
|
+
threadId: string;
|
|
1173
|
+
agentId?: string;
|
|
1174
|
+
agentSlug?: string;
|
|
1175
|
+
taskId?: string;
|
|
1176
|
+
source?: string;
|
|
1177
|
+
skipRedundancyCheck?: boolean;
|
|
1178
|
+
skipFilter?: boolean;
|
|
1179
|
+
}): Promise<string | undefined>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Build a context window from thread history, trimmed to token limit.
|
|
1182
|
+
*/
|
|
1183
|
+
private buildContextWindow;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* MessageInterpreter — async structured extraction from messages.
|
|
1188
|
+
* Story 7.3
|
|
1189
|
+
*
|
|
1190
|
+
* After every message is stored, the interpreter runs async to extract
|
|
1191
|
+
* structured data types: tasks, memories, files, user context, and custom types.
|
|
1192
|
+
*
|
|
1193
|
+
* Uses a cheap LLM (Haiku) for classification and extraction.
|
|
1194
|
+
* Pluggable extractors allow apps to add custom data types.
|
|
1195
|
+
*/
|
|
1196
|
+
|
|
1197
|
+
interface ExtractedTask {
|
|
1198
|
+
title: string;
|
|
1199
|
+
description?: string;
|
|
1200
|
+
dueDate?: string;
|
|
1201
|
+
scheduled?: boolean;
|
|
1202
|
+
priority?: number;
|
|
1203
|
+
}
|
|
1204
|
+
interface ExtractedMemory {
|
|
1205
|
+
summary: string;
|
|
1206
|
+
contents: string;
|
|
1207
|
+
tags?: string[];
|
|
1208
|
+
category?: string;
|
|
1209
|
+
}
|
|
1210
|
+
interface ExtractedFile {
|
|
1211
|
+
filename: string;
|
|
1212
|
+
fileType: string;
|
|
1213
|
+
contents: string;
|
|
1214
|
+
summary: string;
|
|
1215
|
+
}
|
|
1216
|
+
interface ExtractedUserContext {
|
|
1217
|
+
trait: string;
|
|
1218
|
+
value: string;
|
|
1219
|
+
}
|
|
1220
|
+
interface InterpretationResult {
|
|
1221
|
+
messageId: string;
|
|
1222
|
+
tasks: ExtractedTask[];
|
|
1223
|
+
memories: ExtractedMemory[];
|
|
1224
|
+
files: ExtractedFile[];
|
|
1225
|
+
userContext: ExtractedUserContext[];
|
|
1226
|
+
custom: Record<string, unknown[]>;
|
|
1227
|
+
isTaskRequest: boolean;
|
|
1228
|
+
}
|
|
1229
|
+
type LLMCallFn = (params: {
|
|
1230
|
+
model: string;
|
|
1231
|
+
messages: ChatMessage[];
|
|
1232
|
+
system?: string;
|
|
1233
|
+
maxTokens?: number;
|
|
1234
|
+
}) => Promise<{
|
|
1235
|
+
content: string;
|
|
1236
|
+
}>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Pluggable extractor interface for custom data types.
|
|
1239
|
+
*/
|
|
1240
|
+
interface Extractor {
|
|
1241
|
+
readonly type: string;
|
|
1242
|
+
extract(message: {
|
|
1243
|
+
body: string;
|
|
1244
|
+
attachments?: Array<Record<string, unknown>>;
|
|
1245
|
+
}, llmCall: LLMCallFn): Promise<unknown[]>;
|
|
1246
|
+
}
|
|
1247
|
+
interface MessageInterpreterConfig {
|
|
1248
|
+
/** Additional custom extractors beyond built-in ones */
|
|
1249
|
+
extractors?: Extractor[];
|
|
1250
|
+
/** Model for interpretation LLM calls. Default: 'fast' */
|
|
1251
|
+
model?: string;
|
|
1252
|
+
/** LLM call function */
|
|
1253
|
+
llmCall: LLMCallFn;
|
|
1254
|
+
/** Auto-create tasks from extracted tasks. Default: false */
|
|
1255
|
+
autoCreateTasks?: boolean;
|
|
1256
|
+
}
|
|
1257
|
+
declare class MessageInterpreter {
|
|
1258
|
+
private db;
|
|
1259
|
+
private hooks;
|
|
1260
|
+
private readonly extractors;
|
|
1261
|
+
private readonly model;
|
|
1262
|
+
private readonly llmCall;
|
|
1263
|
+
private readonly autoCreateTasks;
|
|
1264
|
+
constructor(db: DataStore, hooks: HookBus, config: MessageInterpreterConfig);
|
|
1265
|
+
/**
|
|
1266
|
+
* Interpret a stored message asynchronously.
|
|
1267
|
+
* Extracts tasks, memories, files, user context, and custom types.
|
|
1268
|
+
*/
|
|
1269
|
+
interpret(messageId: string): Promise<InterpretationResult>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Extract structured data from message text using LLM.
|
|
1272
|
+
*/
|
|
1273
|
+
private extractWithLLM;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
957
1276
|
/**
|
|
958
1277
|
* Text chunker — splits long text into chunks at natural boundaries.
|
|
959
1278
|
* Story 4.4
|
|
@@ -1233,6 +1552,71 @@ declare function autoUpdate(packages?: string[], opts?: {
|
|
|
1233
1552
|
quiet?: boolean;
|
|
1234
1553
|
}): Promise<UpdateResult>;
|
|
1235
1554
|
|
|
1555
|
+
/**
|
|
1556
|
+
* CircuitBreaker — prevents runaway agent failures with automatic escalation.
|
|
1557
|
+
* Story 6.2
|
|
1558
|
+
*
|
|
1559
|
+
* States:
|
|
1560
|
+
* CLOSED → normal operation, failures counted
|
|
1561
|
+
* OPEN → tripped, all executions blocked, escalated to human
|
|
1562
|
+
* HALF_OPEN → probe mode, one execution allowed to test recovery
|
|
1563
|
+
*
|
|
1564
|
+
* Integrates with LoopDetector and RunManager via HookBus events.
|
|
1565
|
+
*/
|
|
1566
|
+
|
|
1567
|
+
declare enum BreakerState {
|
|
1568
|
+
CLOSED = "closed",
|
|
1569
|
+
OPEN = "open",
|
|
1570
|
+
HALF_OPEN = "half_open"
|
|
1571
|
+
}
|
|
1572
|
+
interface CircuitBreakerConfig {
|
|
1573
|
+
/** Failures before tripping. Default: 3 */
|
|
1574
|
+
failureThreshold?: number;
|
|
1575
|
+
/** Milliseconds to wait before half-open probe. Default: 300_000 (5 min) */
|
|
1576
|
+
resetTimeoutMs?: number;
|
|
1577
|
+
/** Log events to the database. Default: true */
|
|
1578
|
+
persist?: boolean;
|
|
1579
|
+
}
|
|
1580
|
+
declare class CircuitBreaker {
|
|
1581
|
+
private db;
|
|
1582
|
+
private hooks;
|
|
1583
|
+
private readonly breakers;
|
|
1584
|
+
private readonly failureThreshold;
|
|
1585
|
+
private readonly resetTimeoutMs;
|
|
1586
|
+
private readonly persist;
|
|
1587
|
+
constructor(db: DataStore, hooks: HookBus, config?: CircuitBreakerConfig);
|
|
1588
|
+
/**
|
|
1589
|
+
* Check if an agent is allowed to execute.
|
|
1590
|
+
* Returns true if execution is allowed, false if circuit is open.
|
|
1591
|
+
*/
|
|
1592
|
+
canExecute(agentId: string): boolean;
|
|
1593
|
+
/**
|
|
1594
|
+
* Record a successful execution. Resets the breaker to CLOSED.
|
|
1595
|
+
*/
|
|
1596
|
+
recordSuccess(agentId: string): Promise<void>;
|
|
1597
|
+
/**
|
|
1598
|
+
* Record a failed execution. Increments failure count and may trip breaker.
|
|
1599
|
+
*/
|
|
1600
|
+
recordFailure(agentId: string, reason?: string): Promise<void>;
|
|
1601
|
+
/**
|
|
1602
|
+
* Trip the breaker to OPEN state and escalate to human.
|
|
1603
|
+
*/
|
|
1604
|
+
trip(agentId: string, reason: string): Promise<void>;
|
|
1605
|
+
/**
|
|
1606
|
+
* Manually reset a breaker (e.g. after human review).
|
|
1607
|
+
*/
|
|
1608
|
+
reset(agentId: string): Promise<void>;
|
|
1609
|
+
/**
|
|
1610
|
+
* Get the current state of a breaker.
|
|
1611
|
+
*/
|
|
1612
|
+
getState(agentId: string): BreakerState;
|
|
1613
|
+
/**
|
|
1614
|
+
* Get failure count for an agent.
|
|
1615
|
+
*/
|
|
1616
|
+
getFailureCount(agentId: string): number;
|
|
1617
|
+
private logEvent;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1236
1620
|
declare class RunManager {
|
|
1237
1621
|
private db;
|
|
1238
1622
|
private hooks;
|
|
@@ -1240,10 +1624,15 @@ declare class RunManager {
|
|
|
1240
1624
|
private locks;
|
|
1241
1625
|
private orphanTimer;
|
|
1242
1626
|
private readonly staleThresholdMs;
|
|
1627
|
+
private circuitBreaker?;
|
|
1243
1628
|
constructor(db: DataStore, hooks: HookBus, config?: {
|
|
1244
1629
|
staleThresholdMs?: number;
|
|
1245
1630
|
maxBackoffMs?: number;
|
|
1246
1631
|
} | undefined);
|
|
1632
|
+
/**
|
|
1633
|
+
* Attach a CircuitBreaker to prevent retries on broken agents.
|
|
1634
|
+
*/
|
|
1635
|
+
setCircuitBreaker(cb: CircuitBreaker): void;
|
|
1247
1636
|
isLocked(agentId: string): boolean;
|
|
1248
1637
|
startRun(agentId: string, taskId: string, adapter?: string): Promise<string>;
|
|
1249
1638
|
finishRun(runId: string, result: {
|
|
@@ -1508,6 +1897,387 @@ declare class CliExecutionAdapter {
|
|
|
1508
1897
|
}>;
|
|
1509
1898
|
}
|
|
1510
1899
|
|
|
1900
|
+
/**
|
|
1901
|
+
* DeterministicAdapter — executes scripts without LLM calls.
|
|
1902
|
+
* Story 6.1
|
|
1903
|
+
*
|
|
1904
|
+
* For tasks that don't require reasoning: routing, validation,
|
|
1905
|
+
* data fetching, file transforms. Runs a user-specified command
|
|
1906
|
+
* (Python, Node, bash) as a subprocess with task context on stdin.
|
|
1907
|
+
*/
|
|
1908
|
+
interface DeterministicConfig {
|
|
1909
|
+
command: string;
|
|
1910
|
+
args?: string[];
|
|
1911
|
+
env?: Record<string, string>;
|
|
1912
|
+
timeoutMs?: number;
|
|
1913
|
+
inputMode?: 'stdin' | 'arg';
|
|
1914
|
+
}
|
|
1915
|
+
declare class DeterministicAdapter {
|
|
1916
|
+
readonly type = "deterministic";
|
|
1917
|
+
execute(ctx: {
|
|
1918
|
+
agent: {
|
|
1919
|
+
id: string;
|
|
1920
|
+
cwd?: string;
|
|
1921
|
+
adapter_config?: string;
|
|
1922
|
+
};
|
|
1923
|
+
task: {
|
|
1924
|
+
title: string;
|
|
1925
|
+
description?: string;
|
|
1926
|
+
context?: string;
|
|
1927
|
+
};
|
|
1928
|
+
abortSignal?: AbortSignal;
|
|
1929
|
+
onLog?: (stream: string, chunk: string) => void;
|
|
1930
|
+
}): Promise<{
|
|
1931
|
+
output: string;
|
|
1932
|
+
exitCode: number;
|
|
1933
|
+
}>;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* LoopDetector — pattern-based loop detection for agent routing.
|
|
1938
|
+
* Story 6.2
|
|
1939
|
+
*
|
|
1940
|
+
* Complements chain-guard's depth limit with active pattern detection:
|
|
1941
|
+
* - Self-loop: agent routes a task back to itself
|
|
1942
|
+
* - Ping-pong: two agents bounce tasks between each other (A→B→A→B)
|
|
1943
|
+
* - Blocked re-entry: a task re-enters the system after being blocked
|
|
1944
|
+
*/
|
|
1945
|
+
|
|
1946
|
+
declare enum LoopType {
|
|
1947
|
+
SELF_LOOP = "self_loop",
|
|
1948
|
+
PING_PONG = "ping_pong",
|
|
1949
|
+
BLOCKED_REENTRY = "blocked_reentry"
|
|
1950
|
+
}
|
|
1951
|
+
interface LoopDetection {
|
|
1952
|
+
type: LoopType;
|
|
1953
|
+
agents: string[];
|
|
1954
|
+
taskId: string;
|
|
1955
|
+
chainOriginId?: string;
|
|
1956
|
+
message: string;
|
|
1957
|
+
}
|
|
1958
|
+
interface LoopDetectorConfig {
|
|
1959
|
+
/** Number of recent followup records to scan. Default: 10 */
|
|
1960
|
+
windowSize?: number;
|
|
1961
|
+
/** Minimum repetitions to confirm ping-pong. Default: 2 */
|
|
1962
|
+
pingPongThreshold?: number;
|
|
1963
|
+
}
|
|
1964
|
+
declare class LoopDetector {
|
|
1965
|
+
private db;
|
|
1966
|
+
private readonly windowSize;
|
|
1967
|
+
private readonly pingPongThreshold;
|
|
1968
|
+
constructor(db: DataStore, config?: LoopDetectorConfig);
|
|
1969
|
+
/**
|
|
1970
|
+
* Check for loops before creating a followup task.
|
|
1971
|
+
* Returns a LoopDetection if a loop pattern is found, undefined otherwise.
|
|
1972
|
+
*/
|
|
1973
|
+
check(sourceAgentId: string, targetAgentId: string, taskId: string, chainOriginId?: string): Promise<LoopDetection | undefined>;
|
|
1974
|
+
/**
|
|
1975
|
+
* Check if an agent is routing to itself.
|
|
1976
|
+
*/
|
|
1977
|
+
private checkSelfLoop;
|
|
1978
|
+
/**
|
|
1979
|
+
* Check if a previously blocked task is being re-entered.
|
|
1980
|
+
*/
|
|
1981
|
+
private checkBlockedReentry;
|
|
1982
|
+
/**
|
|
1983
|
+
* Check for A→B→A→B ping-pong by scanning recent tasks in the chain.
|
|
1984
|
+
*/
|
|
1985
|
+
private checkPingPong;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
/**
|
|
1989
|
+
* LearningPipeline — turns execution experience into durable knowledge.
|
|
1990
|
+
* Story 6.5
|
|
1991
|
+
*
|
|
1992
|
+
* Promotion ladder:
|
|
1993
|
+
* Execution → Feedback (structured capture)
|
|
1994
|
+
* → 3+ similar → Playbook (generalized rule)
|
|
1995
|
+
* → 3+ projects → Skill (executable behavior)
|
|
1996
|
+
* → Agent-Skill Matrix → Per-Agent Context
|
|
1997
|
+
*
|
|
1998
|
+
* Two-axis evaluation:
|
|
1999
|
+
* - Accuracy: was the output correct?
|
|
2000
|
+
* - Efficiency: how fast / how many tokens?
|
|
2001
|
+
*/
|
|
2002
|
+
|
|
2003
|
+
interface FeedbackEntry {
|
|
2004
|
+
agentId: string;
|
|
2005
|
+
taskId?: string;
|
|
2006
|
+
issue: string;
|
|
2007
|
+
rootCause?: string;
|
|
2008
|
+
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
2009
|
+
repeatable: boolean;
|
|
2010
|
+
accuracyScore?: number;
|
|
2011
|
+
efficiencyScore?: number;
|
|
2012
|
+
tags?: string[];
|
|
2013
|
+
}
|
|
2014
|
+
interface PlaybookEntry {
|
|
2015
|
+
pattern: string;
|
|
2016
|
+
rule: string;
|
|
2017
|
+
feedbackIds: string[];
|
|
2018
|
+
projectScoped: boolean;
|
|
2019
|
+
agentIds?: string[];
|
|
2020
|
+
}
|
|
2021
|
+
interface SkillEntry {
|
|
2022
|
+
name: string;
|
|
2023
|
+
slug: string;
|
|
2024
|
+
description?: string;
|
|
2025
|
+
behavior: string;
|
|
2026
|
+
sourcePlaybookIds: string[];
|
|
2027
|
+
category?: string;
|
|
2028
|
+
}
|
|
2029
|
+
interface LearningPipelineConfig {
|
|
2030
|
+
/** Feedback count threshold for playbook promotion. Default: 3 */
|
|
2031
|
+
playbookThreshold?: number;
|
|
2032
|
+
/** Project count threshold for skill promotion. Default: 3 */
|
|
2033
|
+
skillThreshold?: number;
|
|
2034
|
+
/** Auto-promote when thresholds are met. Default: false */
|
|
2035
|
+
autoPromote?: boolean;
|
|
2036
|
+
}
|
|
2037
|
+
declare class LearningPipeline {
|
|
2038
|
+
private db;
|
|
2039
|
+
private hooks;
|
|
2040
|
+
private readonly playbookThreshold;
|
|
2041
|
+
private readonly skillThreshold;
|
|
2042
|
+
private readonly autoPromote;
|
|
2043
|
+
constructor(db: DataStore, hooks: HookBus, config?: LearningPipelineConfig);
|
|
2044
|
+
/**
|
|
2045
|
+
* Capture a structured feedback record from an execution.
|
|
2046
|
+
*/
|
|
2047
|
+
captureFeedback(entry: FeedbackEntry): Promise<string>;
|
|
2048
|
+
/**
|
|
2049
|
+
* Get all feedback records, optionally filtered.
|
|
2050
|
+
*/
|
|
2051
|
+
listFeedback(filter?: {
|
|
2052
|
+
agentId?: string;
|
|
2053
|
+
severity?: string;
|
|
2054
|
+
repeatable?: boolean;
|
|
2055
|
+
}): Promise<Array<Record<string, unknown>>>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Check if feedback records with similar issues should be promoted to a playbook.
|
|
2058
|
+
* Groups by issue text similarity (exact match for now).
|
|
2059
|
+
*/
|
|
2060
|
+
checkPlaybookPromotion(issue: string): Promise<string | undefined>;
|
|
2061
|
+
/**
|
|
2062
|
+
* Manually create a playbook from a set of feedback records.
|
|
2063
|
+
*/
|
|
2064
|
+
promoteToPlaybook(entry: PlaybookEntry): Promise<string>;
|
|
2065
|
+
/**
|
|
2066
|
+
* List playbooks, optionally filtered.
|
|
2067
|
+
*/
|
|
2068
|
+
listPlaybooks(filter?: {
|
|
2069
|
+
projectScoped?: boolean;
|
|
2070
|
+
}): Promise<Array<Record<string, unknown>>>;
|
|
2071
|
+
/**
|
|
2072
|
+
* Check if a playbook should be promoted to a skill.
|
|
2073
|
+
* A playbook becomes a skill when it works across multiple projects
|
|
2074
|
+
* (indicated by being referenced by agents in different contexts).
|
|
2075
|
+
*/
|
|
2076
|
+
checkSkillPromotion(playbookId: string): Promise<string | undefined>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Manually promote a playbook to a reusable skill.
|
|
2079
|
+
*/
|
|
2080
|
+
promoteToSkill(entry: SkillEntry): Promise<string>;
|
|
2081
|
+
/**
|
|
2082
|
+
* Assign a skill to an agent.
|
|
2083
|
+
*/
|
|
2084
|
+
assignSkill(agentId: string, skillId: string): Promise<void>;
|
|
2085
|
+
/**
|
|
2086
|
+
* Get learning metrics for an agent.
|
|
2087
|
+
*/
|
|
2088
|
+
getMetrics(agentId: string): Promise<{
|
|
2089
|
+
feedbackCount: number;
|
|
2090
|
+
avgAccuracy: number | null;
|
|
2091
|
+
avgEfficiency: number | null;
|
|
2092
|
+
playbookCount: number;
|
|
2093
|
+
skillCount: number;
|
|
2094
|
+
}>;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* PermissionRelay — remote approval for unattended agent execution.
|
|
2099
|
+
* Story 6.6
|
|
2100
|
+
*
|
|
2101
|
+
* When an agent needs human approval but the operator is away:
|
|
2102
|
+
* 1. Post the approval prompt to a messaging platform (Slack, Discord, etc.)
|
|
2103
|
+
* 2. Poll for response (approve/deny)
|
|
2104
|
+
* 3. Relay the decision back to the agent
|
|
2105
|
+
*
|
|
2106
|
+
* Dual approval: local terminal + remote messaging. First response wins.
|
|
2107
|
+
* Race condition handled by atomic state transition.
|
|
2108
|
+
*/
|
|
2109
|
+
|
|
2110
|
+
type ApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired';
|
|
2111
|
+
interface PermissionPrompt {
|
|
2112
|
+
id: string;
|
|
2113
|
+
agentId: string;
|
|
2114
|
+
action: string;
|
|
2115
|
+
context?: string;
|
|
2116
|
+
requestedAt: string;
|
|
2117
|
+
expiresAt?: string;
|
|
2118
|
+
}
|
|
2119
|
+
interface ApprovalResponse {
|
|
2120
|
+
promptId: string;
|
|
2121
|
+
status: 'approved' | 'denied';
|
|
2122
|
+
respondedBy: string;
|
|
2123
|
+
respondedAt: string;
|
|
2124
|
+
comment?: string;
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* Provider interface — implement for each messaging platform.
|
|
2128
|
+
*/
|
|
2129
|
+
interface PermissionProvider {
|
|
2130
|
+
readonly id: string;
|
|
2131
|
+
/** Post an approval request, return a handle for polling. */
|
|
2132
|
+
sendPrompt(prompt: PermissionPrompt): Promise<string>;
|
|
2133
|
+
/** Check for a response. Returns undefined if still pending. */
|
|
2134
|
+
pollResponse(handle: string): Promise<ApprovalResponse | undefined>;
|
|
2135
|
+
/** Cancel a pending prompt (e.g. after local approval). */
|
|
2136
|
+
cancelPrompt(handle: string): Promise<void>;
|
|
2137
|
+
}
|
|
2138
|
+
interface PermissionRelayConfig {
|
|
2139
|
+
/** Registered providers (e.g. Slack, Discord adapters) */
|
|
2140
|
+
providers: PermissionProvider[];
|
|
2141
|
+
/** Poll interval in ms. Default: 5000 */
|
|
2142
|
+
pollIntervalMs?: number;
|
|
2143
|
+
/** Timeout for pending approvals in ms. Default: 300_000 (5 min) */
|
|
2144
|
+
timeoutMs?: number;
|
|
2145
|
+
}
|
|
2146
|
+
declare class PermissionRelay {
|
|
2147
|
+
private hooks;
|
|
2148
|
+
private readonly providers;
|
|
2149
|
+
private readonly pollIntervalMs;
|
|
2150
|
+
private readonly timeoutMs;
|
|
2151
|
+
private readonly pending;
|
|
2152
|
+
constructor(hooks: HookBus, config: PermissionRelayConfig);
|
|
2153
|
+
/**
|
|
2154
|
+
* Request approval from all configured providers.
|
|
2155
|
+
* Returns when the first provider responds (approve or deny).
|
|
2156
|
+
*/
|
|
2157
|
+
requestApproval(prompt: PermissionPrompt): Promise<ApprovalResponse>;
|
|
2158
|
+
/**
|
|
2159
|
+
* Provide a local approval (from terminal).
|
|
2160
|
+
* Resolves the pending request and cancels remote providers.
|
|
2161
|
+
*/
|
|
2162
|
+
approveLocally(promptId: string, approved: boolean): Promise<void>;
|
|
2163
|
+
/**
|
|
2164
|
+
* Get all pending approval requests.
|
|
2165
|
+
*/
|
|
2166
|
+
getPending(): PermissionPrompt[];
|
|
2167
|
+
private cancelOtherProviders;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
/**
|
|
2171
|
+
* GovernanceGate — independent validation gates for agent output.
|
|
2172
|
+
* Story 6.7
|
|
2173
|
+
*
|
|
2174
|
+
* Key principle: gates report to the HUMAN, not to each other
|
|
2175
|
+
* or to a project manager agent. Structural independence prevents capture.
|
|
2176
|
+
*
|
|
2177
|
+
* Gate dimensions:
|
|
2178
|
+
* QA — data correctness (schema, row counts, format)
|
|
2179
|
+
* Quality — code quality (lint, coverage, patterns)
|
|
2180
|
+
* Drift — architectural drift (unintended dependencies, scope creep)
|
|
2181
|
+
*/
|
|
2182
|
+
|
|
2183
|
+
type GateVerdict = 'pass' | 'fail' | 'warn';
|
|
2184
|
+
interface GateResult {
|
|
2185
|
+
gateId: string;
|
|
2186
|
+
verdict: GateVerdict;
|
|
2187
|
+
findings: GateFinding[];
|
|
2188
|
+
checkedAt: string;
|
|
2189
|
+
durationMs: number;
|
|
2190
|
+
}
|
|
2191
|
+
interface GateFinding {
|
|
2192
|
+
severity: 'info' | 'warning' | 'error' | 'critical';
|
|
2193
|
+
message: string;
|
|
2194
|
+
location?: string;
|
|
2195
|
+
suggestion?: string;
|
|
2196
|
+
}
|
|
2197
|
+
interface GateInput {
|
|
2198
|
+
agentId: string;
|
|
2199
|
+
taskId: string;
|
|
2200
|
+
output: string;
|
|
2201
|
+
metadata?: Record<string, unknown>;
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Base class for governance gates. Each gate checks a different dimension.
|
|
2205
|
+
* Gates are structurally independent — they report to the human operator,
|
|
2206
|
+
* not to each other or to any agent.
|
|
2207
|
+
*/
|
|
2208
|
+
declare abstract class GovernanceGate {
|
|
2209
|
+
abstract readonly id: string;
|
|
2210
|
+
abstract readonly name: string;
|
|
2211
|
+
abstract readonly dimension: string;
|
|
2212
|
+
/**
|
|
2213
|
+
* Run the gate check on agent output.
|
|
2214
|
+
* Must return a verdict and any findings.
|
|
2215
|
+
*/
|
|
2216
|
+
abstract check(input: GateInput): Promise<GateResult>;
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* QA Gate — validates data correctness.
|
|
2220
|
+
* Checks: schema conformance, row counts, format validation.
|
|
2221
|
+
*/
|
|
2222
|
+
declare class QAGate extends GovernanceGate {
|
|
2223
|
+
private validators;
|
|
2224
|
+
readonly id = "qa";
|
|
2225
|
+
readonly name = "Quality Assurance";
|
|
2226
|
+
readonly dimension = "data_correctness";
|
|
2227
|
+
constructor(validators?: Array<{
|
|
2228
|
+
name: string;
|
|
2229
|
+
validate: (output: string, metadata?: Record<string, unknown>) => GateFinding[];
|
|
2230
|
+
}>);
|
|
2231
|
+
check(input: GateInput): Promise<GateResult>;
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Quality Gate — validates code quality.
|
|
2235
|
+
* Checks: lint results, test coverage, review patterns.
|
|
2236
|
+
*/
|
|
2237
|
+
declare class QualityGate extends GovernanceGate {
|
|
2238
|
+
private checks;
|
|
2239
|
+
readonly id = "quality";
|
|
2240
|
+
readonly name = "Code Quality";
|
|
2241
|
+
readonly dimension = "code_quality";
|
|
2242
|
+
constructor(checks?: Array<{
|
|
2243
|
+
name: string;
|
|
2244
|
+
check: (output: string, metadata?: Record<string, unknown>) => Promise<GateFinding[]>;
|
|
2245
|
+
}>);
|
|
2246
|
+
check(input: GateInput): Promise<GateResult>;
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Drift Gate — detects architectural drift.
|
|
2250
|
+
* Checks: unintended dependencies, scope creep, pattern violations.
|
|
2251
|
+
*/
|
|
2252
|
+
declare class DriftGate extends GovernanceGate {
|
|
2253
|
+
private rules;
|
|
2254
|
+
readonly id = "drift";
|
|
2255
|
+
readonly name = "Architectural Drift";
|
|
2256
|
+
readonly dimension = "architecture";
|
|
2257
|
+
constructor(rules?: Array<{
|
|
2258
|
+
name: string;
|
|
2259
|
+
detect: (output: string, metadata?: Record<string, unknown>) => GateFinding[];
|
|
2260
|
+
}>);
|
|
2261
|
+
check(input: GateInput): Promise<GateResult>;
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* GateRunner — orchestrates multiple independent gates on agent output.
|
|
2265
|
+
* Each gate runs independently. Results are reported to the human, not to agents.
|
|
2266
|
+
*/
|
|
2267
|
+
declare class GateRunner {
|
|
2268
|
+
private gates;
|
|
2269
|
+
private hooks;
|
|
2270
|
+
constructor(gates: GovernanceGate[], hooks: HookBus);
|
|
2271
|
+
/**
|
|
2272
|
+
* Run all gates on the given input.
|
|
2273
|
+
* Gates run independently — one failure doesn't block others.
|
|
2274
|
+
*/
|
|
2275
|
+
runAll(input: GateInput): Promise<{
|
|
2276
|
+
passed: boolean;
|
|
2277
|
+
results: GateResult[];
|
|
2278
|
+
}>;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
1511
2281
|
interface SecretInput {
|
|
1512
2282
|
name: string;
|
|
1513
2283
|
type?: string;
|
|
@@ -1596,4 +2366,4 @@ declare function isLoginRequired(stdout: string): boolean;
|
|
|
1596
2366
|
/** Rewrite local image paths to prevent CLI auto-embedding as vision content. */
|
|
1597
2367
|
declare function deactivateLocalImagePaths(prompt: string): string;
|
|
1598
2368
|
|
|
1599
|
-
export { AGENT_STATUSES, type AgentConfig, type AgentDefinition, type AgentFilter, type AgentRecord, AgentRegistry, type AgentStatus, ApiExecutionAdapter, AuditEmitter, type AuditEvent, BackupManager, type BotConfig, type BudgetCheck, type BudgetConfig, BudgetController, CORE_MIGRATIONS, ChannelAdapter, ChannelRegistry, ChannelRegistryError, ChatMessage, ChatSessionManager, CliExecutionAdapter, type ColumnValidator, ColumnValidatorImpl, type ConfigLoadError, type ConfigLoadResult, ConnectorConfig, DEFAULTS, DEFAULT_CONFIG, type DataConfig, DataStore, DataStoreError, type DomainEntityContextOptions, type DomainSchemaOptions, EVENTS, type EntityColumnDef, type EntityConfig, type EntityContextDef, type EntityFileSpec, type EntitySource, type ExecutionAdapter, type Filter, HealthStatus, HookBus, type HookHandler, type HookOptions, type HookRegistration, InboundMessage, LLMProvider, MAX_CHAIN_DEPTH, MessagePipeline, type ModelConfig, ModelInfo, ModelRouter, NdjsonLogger, NotificationQueue, type PackageMigration, type PackageUpdate, type ParsedStream, type PkLookup, ProviderRegistry, type QueryOptions, RUN_STATUSES, type RelationDef, type RenderConfig, ResolvedModel, type RetryPolicy, type Row, type RunContext, RunManager, type RunResult, type RunStatus, type SanitizerOptions, type Schedule, type ScheduleDef, Scheduler, type SchemaError, type SecretInput, type SecretMeta, SecretStore, type SecurityConfig, type SeedItem, SessionKey, SessionManager, type SqliteAdapter, type StepRef, TASK_STATUSES, type TableDefinition, type TableInfoRow, type TaskDefinition, TaskQueue, type TaskRecord, type TaskStatus, TokenUsage, type Unsubscribe, UpdateChecker, type UpdateConfig, UpdateManager, type UpdateManifest, type UsageSummary, type User, type UserInput, UserRegistry, WakeupQueue, type WorkflowConfigEntry, type WorkflowDefinition$1 as WorkflowDefinition, WorkflowEngine, type WorkflowRunRecord, type WorkflowRunStatus, type WorkflowStep$1 as WorkflowStep, type WorkflowStepConfig, type WorkflowTrigger, _resetConfig, areDependenciesMet, autoUpdate, buildAgentBindings, buildChainOrigin, buildProcessEnv, checkAllowlist, checkChainDepth, checkMentionGate, chunkText, classifyUpdate, compareVersions, createConfigRevision, deactivateLocalImagePaths, defineCoreEntityContexts, defineCoreTables, defineDomainEntityContexts, defineDomainTables, detectCycle, discoverChannels, discoverProviders, formatText, getConfig, initConfig, interpolate, interpolateEnv, isLoginRequired, isMaxTurns, loadConfig, parseClaudeStream, parseVersion, runPackageMigrations, sanitize, topologicalSort, truncateAtWord, validateConfig };
|
|
2369
|
+
export { AGENT_STATUSES, type AgentConfig, type AgentDefinition, type AgentFilter, type AgentRecord, AgentRegistry, type AgentStatus, ApiExecutionAdapter, type ApprovalResponse, type ApprovalStatus, AuditEmitter, type AuditEvent, BackupManager, type BotConfig, BreakerState, type BudgetCheck, type BudgetConfig, BudgetController, CORE_MIGRATIONS, ChannelAdapter, ChannelRegistry, ChannelRegistryError, ChatMessage, ChatResponder, type ChatResponderConfig, ChatSessionManager, CircuitBreaker, type CircuitBreakerConfig, CliExecutionAdapter, type ColumnValidator, ColumnValidatorImpl, type ConfigLoadError, type ConfigLoadResult, ConnectorConfig, DEFAULTS, DEFAULT_CONFIG, type DataConfig, DataStore, DataStoreError, DeterministicAdapter, type DeterministicConfig, type DomainEntityContextOptions, type DomainSchemaOptions, DriftGate, EVENTS, type EntityColumnDef, type EntityConfig, type EntityContextDef, type EntityFileSpec, type EntitySource, type ExecutionAdapter, type ExtractedFile, type ExtractedMemory, type ExtractedTask, type ExtractedUserContext, type Extractor, type FeedbackEntry, type Filter, type GateFinding, type GateInput, type GateResult, GateRunner, type GateVerdict, GovernanceGate, HealthStatus, HookBus, type HookHandler, type HookOptions, type HookRegistration, InboundMessage, type InterpretationResult, type LLMCallFn, LLMProvider, LearningPipeline, type LearningPipelineConfig, type LoopDetection, LoopDetector, type LoopDetectorConfig, LoopType, MAX_CHAIN_DEPTH, MessageInterpreter, type MessageInterpreterConfig, MessagePipeline, MessageStore, type ModelConfig, ModelInfo, ModelRouter, NdjsonLogger, NotificationQueue, type PackageMigration, type PackageUpdate, type ParsedStream, type PermissionPrompt, type PermissionProvider, PermissionRelay, type PermissionRelayConfig, type PkLookup, type PlaybookEntry, ProviderRegistry, QAGate, QualityGate, type QueryOptions, RUN_STATUSES, type RelationDef, type RenderConfig, ResolvedModel, type RetryPolicy, type RoutingDecision, type RoutingRule, type Row, type RunContext, RunManager, type RunResult, type RunStatus, type SanitizerOptions, type Schedule, type ScheduleDef, Scheduler, type SchemaError, type SecretInput, type SecretMeta, SecretStore, type SecurityConfig, type SeedItem, SessionKey, SessionManager, type SkillEntry, type SqliteAdapter, type StepRef, type StoreResult, type StoredAttachment, TASK_STATUSES, type TableDefinition, type TableInfoRow, type TaskDefinition, TaskQueue, type TaskRecord, type TaskStatus, TokenUsage, TriageRouter, type TriageRouterConfig, type Unsubscribe, UpdateChecker, type UpdateConfig, UpdateManager, type UpdateManifest, type UsageSummary, type User, type UserInput, UserRegistry, WakeupQueue, type WorkflowConfigEntry, type WorkflowDefinition$1 as WorkflowDefinition, WorkflowEngine, type WorkflowRunRecord, type WorkflowRunStatus, type WorkflowStep$1 as WorkflowStep, type WorkflowStepConfig, type WorkflowTrigger, _resetConfig, areDependenciesMet, autoUpdate, buildAgentBindings, buildChainOrigin, buildProcessEnv, checkAllowlist, checkChainDepth, checkMentionGate, chunkText, classifyUpdate, compareVersions, createConfigRevision, deactivateLocalImagePaths, defineCoreEntityContexts, defineCoreTables, defineDomainEntityContexts, defineDomainTables, detectCycle, discoverChannels, discoverProviders, formatText, getConfig, initConfig, interpolate, interpolateEnv, isLoginRequired, isMaxTurns, loadConfig, parseClaudeStream, parseVersion, runPackageMigrations, sanitize, topologicalSort, truncateAtWord, validateConfig };
|