gauss-ai 4.0.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/CHANGELOG.md +489 -0
- package/LICENSE +21 -0
- package/README.md +269 -0
- package/dist/a2a/index.cjs +7 -0
- package/dist/a2a/index.cjs.map +1 -0
- package/dist/a2a/index.d.cts +30 -0
- package/dist/a2a/index.d.ts +30 -0
- package/dist/a2a/index.js +7 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/agent-UIQDSYCE.js +16 -0
- package/dist/agent-UIQDSYCE.js.map +1 -0
- package/dist/agent-builder-8W3mBR-N.d.ts +1075 -0
- package/dist/agent-builder-GEMYdb1p.d.cts +1075 -0
- package/dist/agent-graph-AMQYAWNF.js +1422 -0
- package/dist/agent-graph-AMQYAWNF.js.map +1 -0
- package/dist/ai-sdk-mcp.adapter-SEN6KHNU.js +124 -0
- package/dist/ai-sdk-mcp.adapter-SEN6KHNU.js.map +1 -0
- package/dist/browser/index.js +10 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/bun-runtime.adapter-MQDAJLQM.js +8 -0
- package/dist/bun-runtime.adapter-MQDAJLQM.js.map +1 -0
- package/dist/bun-runtime.adapter-XKOUXVAK.cjs +8 -0
- package/dist/bun-runtime.adapter-XKOUXVAK.cjs.map +1 -0
- package/dist/chat-A3XMRPJL.js +129 -0
- package/dist/chat-A3XMRPJL.js.map +1 -0
- package/dist/chunk-2ZRU47NC.js +91 -0
- package/dist/chunk-2ZRU47NC.js.map +1 -0
- package/dist/chunk-3LD3JTH4.cjs +18 -0
- package/dist/chunk-3LD3JTH4.cjs.map +1 -0
- package/dist/chunk-5FE5TG2W.cjs +16 -0
- package/dist/chunk-5FE5TG2W.cjs.map +1 -0
- package/dist/chunk-6XF673YC.cjs +436 -0
- package/dist/chunk-6XF673YC.cjs.map +1 -0
- package/dist/chunk-7CKWZJNS.js +230 -0
- package/dist/chunk-7CKWZJNS.js.map +1 -0
- package/dist/chunk-BI2G665F.js +4588 -0
- package/dist/chunk-BI2G665F.js.map +1 -0
- package/dist/chunk-C5NLWJS2.js +139 -0
- package/dist/chunk-C5NLWJS2.js.map +1 -0
- package/dist/chunk-CJZ66SU3.cjs +4321 -0
- package/dist/chunk-CJZ66SU3.cjs.map +1 -0
- package/dist/chunk-DAMT2CXW.cjs +91 -0
- package/dist/chunk-DAMT2CXW.cjs.map +1 -0
- package/dist/chunk-E7WG3MO5.js +18 -0
- package/dist/chunk-E7WG3MO5.js.map +1 -0
- package/dist/chunk-EFDM6R4J.js +99 -0
- package/dist/chunk-EFDM6R4J.js.map +1 -0
- package/dist/chunk-F7WIPPEO.js +256 -0
- package/dist/chunk-F7WIPPEO.js.map +1 -0
- package/dist/chunk-FAYDE67N.js +6927 -0
- package/dist/chunk-FAYDE67N.js.map +1 -0
- package/dist/chunk-GAE2KKCM.js +21 -0
- package/dist/chunk-GAE2KKCM.js.map +1 -0
- package/dist/chunk-INLNGRXM.cjs +130 -0
- package/dist/chunk-INLNGRXM.cjs.map +1 -0
- package/dist/chunk-JKXKXB5O.js +130 -0
- package/dist/chunk-JKXKXB5O.js.map +1 -0
- package/dist/chunk-K6SAETGP.js +375 -0
- package/dist/chunk-K6SAETGP.js.map +1 -0
- package/dist/chunk-KEASLAYR.js +157 -0
- package/dist/chunk-KEASLAYR.js.map +1 -0
- package/dist/chunk-KKJVNM6O.js +436 -0
- package/dist/chunk-KKJVNM6O.js.map +1 -0
- package/dist/chunk-KYIMVRIM.js +16 -0
- package/dist/chunk-KYIMVRIM.js.map +1 -0
- package/dist/chunk-MB7NXIZD.js +4321 -0
- package/dist/chunk-MB7NXIZD.js.map +1 -0
- package/dist/chunk-MHHDXPGE.js +209 -0
- package/dist/chunk-MHHDXPGE.js.map +1 -0
- package/dist/chunk-NE6JJA5W.js +401 -0
- package/dist/chunk-NE6JJA5W.js.map +1 -0
- package/dist/chunk-PF46XZBF.cjs +6927 -0
- package/dist/chunk-PF46XZBF.cjs.map +1 -0
- package/dist/chunk-PSJIAGDE.cjs +375 -0
- package/dist/chunk-PSJIAGDE.cjs.map +1 -0
- package/dist/chunk-PWOQDXNQ.js +16 -0
- package/dist/chunk-PWOQDXNQ.js.map +1 -0
- package/dist/chunk-QYOMQBBZ.cjs +230 -0
- package/dist/chunk-QYOMQBBZ.cjs.map +1 -0
- package/dist/chunk-UDFXLC4J.cjs +16 -0
- package/dist/chunk-UDFXLC4J.cjs.map +1 -0
- package/dist/chunk-UO4NGXRT.cjs +259 -0
- package/dist/chunk-UO4NGXRT.cjs.map +1 -0
- package/dist/chunk-UPFDFLEW.js +40 -0
- package/dist/chunk-UPFDFLEW.js.map +1 -0
- package/dist/chunk-V55JSQS7.cjs +16 -0
- package/dist/chunk-V55JSQS7.cjs.map +1 -0
- package/dist/chunk-VJADHXZL.cjs +16 -0
- package/dist/chunk-VJADHXZL.cjs.map +1 -0
- package/dist/chunk-VRWD7LCI.js +59 -0
- package/dist/chunk-VRWD7LCI.js.map +1 -0
- package/dist/chunk-WKKQ443C.js +487 -0
- package/dist/chunk-WKKQ443C.js.map +1 -0
- package/dist/chunk-X2GHUHAF.js +436 -0
- package/dist/chunk-X2GHUHAF.js.map +1 -0
- package/dist/chunk-XLGW3XNI.cjs +256 -0
- package/dist/chunk-XLGW3XNI.cjs.map +1 -0
- package/dist/chunk-ZFJKX4DP.js +16 -0
- package/dist/chunk-ZFJKX4DP.js.map +1 -0
- package/dist/chunk-ZM2OEWM2.js +259 -0
- package/dist/chunk-ZM2OEWM2.js.map +1 -0
- package/dist/chunk-ZNAIP2XV.js +16 -0
- package/dist/chunk-ZNAIP2XV.js.map +1 -0
- package/dist/chunk-ZYFAZYSL.js +42 -0
- package/dist/chunk-ZYFAZYSL.js.map +1 -0
- package/dist/cli/index.js +421 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config-4MHT6TQW.js +153 -0
- package/dist/config-4MHT6TQW.js.map +1 -0
- package/dist/config-REERQFK4.cjs +153 -0
- package/dist/config-REERQFK4.cjs.map +1 -0
- package/dist/cost-tracker-JLOU7IZJ.js +7 -0
- package/dist/cost-tracker-JLOU7IZJ.js.map +1 -0
- package/dist/demo-C52GMSYH.js +188 -0
- package/dist/demo-C52GMSYH.js.map +1 -0
- package/dist/deno/index.js +306 -0
- package/dist/deno/index.js.map +1 -0
- package/dist/deno-runtime.adapter-F744HY7K.js +8 -0
- package/dist/deno-runtime.adapter-F744HY7K.js.map +1 -0
- package/dist/deno-runtime.adapter-RFEVNSCV.cjs +8 -0
- package/dist/deno-runtime.adapter-RFEVNSCV.cjs.map +1 -0
- package/dist/dev-D7DDVDA4.js +218 -0
- package/dist/dev-D7DDVDA4.js.map +1 -0
- package/dist/edge/index.js +10 -0
- package/dist/edge/index.js.map +1 -0
- package/dist/edge-runtime.adapter-UQCW2F7X.js +8 -0
- package/dist/edge-runtime.adapter-UQCW2F7X.js.map +1 -0
- package/dist/edge-runtime.adapter-YED6F3AY.cjs +8 -0
- package/dist/edge-runtime.adapter-YED6F3AY.cjs.map +1 -0
- package/dist/graph-MGFAQZ5W.js +50 -0
- package/dist/graph-MGFAQZ5W.js.map +1 -0
- package/dist/graph-visualization-HBSVQXJK.js +9 -0
- package/dist/graph-visualization-HBSVQXJK.js.map +1 -0
- package/dist/index-BRgqNnh3.d.cts +982 -0
- package/dist/index-CZxpYUxZ.d.ts +982 -0
- package/dist/index.cjs +14789 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10275 -0
- package/dist/index.d.ts +10275 -0
- package/dist/index.js +14789 -0
- package/dist/index.js.map +1 -0
- package/dist/init-CFWXTQ35.js +133 -0
- package/dist/init-CFWXTQ35.js.map +1 -0
- package/dist/llm-VWO4MC7J.cjs +17 -0
- package/dist/llm-VWO4MC7J.cjs.map +1 -0
- package/dist/llm-XLXVSPBI.js +17 -0
- package/dist/llm-XLXVSPBI.js.map +1 -0
- package/dist/logging-WRAK5ZXT.js +33 -0
- package/dist/logging-WRAK5ZXT.js.map +1 -0
- package/dist/metrics-FAHZVVD4.js +47 -0
- package/dist/metrics-FAHZVVD4.js.map +1 -0
- package/dist/node/index.cjs +280 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +51 -0
- package/dist/node/index.d.ts +51 -0
- package/dist/node/index.js +280 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node-runtime.adapter-5L7PJ6W2.js +8 -0
- package/dist/node-runtime.adapter-5L7PJ6W2.js.map +1 -0
- package/dist/node-runtime.adapter-CCRZVGHB.cjs +8 -0
- package/dist/node-runtime.adapter-CCRZVGHB.cjs.map +1 -0
- package/dist/persist-usage-WTBTCWEF.js +7 -0
- package/dist/persist-usage-WTBTCWEF.js.map +1 -0
- package/dist/plugin-RCPBWUUA.js +207 -0
- package/dist/plugin-RCPBWUUA.js.map +1 -0
- package/dist/plugins/index.cjs +75 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.cts +8 -0
- package/dist/plugins/index.d.ts +8 -0
- package/dist/plugins/index.js +75 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins-L4ING3CX.js +4625 -0
- package/dist/plugins-L4ING3CX.js.map +1 -0
- package/dist/providers/index.cjs +189 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +168 -0
- package/dist/providers/index.d.ts +168 -0
- package/dist/providers/index.js +189 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers-3RNQ5CKZ.js +59 -0
- package/dist/providers-3RNQ5CKZ.js.map +1 -0
- package/dist/providers-66GPXUGQ.cjs +59 -0
- package/dist/providers-66GPXUGQ.cjs.map +1 -0
- package/dist/repl-K6QN4I2S.js +678 -0
- package/dist/repl-K6QN4I2S.js.map +1 -0
- package/dist/rest/index.cjs +17 -0
- package/dist/rest/index.cjs.map +1 -0
- package/dist/rest/index.d.cts +102 -0
- package/dist/rest/index.d.ts +102 -0
- package/dist/rest/index.js +17 -0
- package/dist/rest/index.js.map +1 -0
- package/dist/runtime-deno.js +15 -0
- package/dist/runtime-deno.js.map +1 -0
- package/dist/runtime-edge.js +15 -0
- package/dist/runtime-edge.js.map +1 -0
- package/dist/runtime-node.js +15 -0
- package/dist/runtime-node.js.map +1 -0
- package/dist/scraping/index.cjs +11 -0
- package/dist/scraping/index.cjs.map +1 -0
- package/dist/scraping/index.d.cts +17 -0
- package/dist/scraping/index.d.ts +17 -0
- package/dist/scraping/index.js +11 -0
- package/dist/scraping/index.js.map +1 -0
- package/dist/semantic-scraping.port-CZWUea88.d.cts +54 -0
- package/dist/semantic-scraping.port-CZWUea88.d.ts +54 -0
- package/dist/server/index.js +166 -0
- package/dist/server/index.js.map +1 -0
- package/dist/testing/index.cjs +25 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +63 -0
- package/dist/testing/index.d.ts +63 -0
- package/dist/testing/index.js +25 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/token-counter.port-CRgxZZGe.d.ts +334 -0
- package/dist/token-counter.port-D7BHMCRR.d.cts +334 -0
- package/dist/tools-BZM33OBZ.js +10 -0
- package/dist/tools-BZM33OBZ.js.map +1 -0
- package/dist/tracing-XA3TEWP4.js +48 -0
- package/dist/tracing-XA3TEWP4.js.map +1 -0
- package/dist/types-CVsP7gFI.d.cts +235 -0
- package/dist/types-CVsP7gFI.d.ts +235 -0
- package/dist/virtual-fs.adapter-BBLS-3AY.d.ts +26 -0
- package/dist/virtual-fs.adapter-nb0CTYOj.d.cts +26 -0
- package/dist/workflow/index.cjs +9 -0
- package/dist/workflow/index.cjs.map +1 -0
- package/dist/workflow/index.d.cts +62 -0
- package/dist/workflow/index.d.ts +62 -0
- package/dist/workflow/index.js +9 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow.port-BaCttxrw.d.cts +153 -0
- package/dist/workflow.port-BaCttxrw.d.ts +153 -0
- package/package.json +230 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { L as LanguageModel } from './types-CVsP7gFI.js';
|
|
2
|
+
|
|
3
|
+
type PolicyEffect = "allow" | "deny";
|
|
4
|
+
interface PolicyContext {
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
tenantId?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
interface PolicyRequest {
|
|
11
|
+
action: "invoke";
|
|
12
|
+
resource: string;
|
|
13
|
+
serverName?: string;
|
|
14
|
+
toolName?: string;
|
|
15
|
+
}
|
|
16
|
+
interface PolicyRule {
|
|
17
|
+
id: string;
|
|
18
|
+
effect: PolicyEffect;
|
|
19
|
+
/** Wildcard pattern, e.g. "docs:*" or "calc:add" */
|
|
20
|
+
resourcePattern: string;
|
|
21
|
+
/** Optional wildcard server matcher */
|
|
22
|
+
serverPattern?: string;
|
|
23
|
+
/** Optional wildcard tool matcher */
|
|
24
|
+
toolPattern?: string;
|
|
25
|
+
/** Rule priority, higher wins. Default: 0 */
|
|
26
|
+
priority?: number;
|
|
27
|
+
/** Optional contextual constraints */
|
|
28
|
+
context?: {
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
userId?: string;
|
|
31
|
+
tenantId?: string;
|
|
32
|
+
};
|
|
33
|
+
reason?: string;
|
|
34
|
+
}
|
|
35
|
+
interface PolicyDecision {
|
|
36
|
+
allowed: boolean;
|
|
37
|
+
effect: PolicyEffect;
|
|
38
|
+
reason?: string;
|
|
39
|
+
matchedRuleId?: string;
|
|
40
|
+
auditId: string;
|
|
41
|
+
}
|
|
42
|
+
interface PolicyAuditRecord {
|
|
43
|
+
id: string;
|
|
44
|
+
timestamp: string;
|
|
45
|
+
request: PolicyRequest;
|
|
46
|
+
context: PolicyContext;
|
|
47
|
+
decision: PolicyDecision;
|
|
48
|
+
}
|
|
49
|
+
interface PolicyEnginePort {
|
|
50
|
+
evaluate(request: PolicyRequest, context: PolicyContext): Promise<PolicyDecision>;
|
|
51
|
+
addRule(rule: PolicyRule): Promise<void>;
|
|
52
|
+
removeRule(id: string): Promise<boolean>;
|
|
53
|
+
setRules(rules: PolicyRule[]): Promise<void>;
|
|
54
|
+
listRules(): Promise<PolicyRule[]>;
|
|
55
|
+
getAuditLog(limit?: number): Promise<PolicyAuditRecord[]>;
|
|
56
|
+
clearAuditLog(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface AgentConfig {
|
|
60
|
+
/** Agent identifier */
|
|
61
|
+
id?: string;
|
|
62
|
+
/** Display name */
|
|
63
|
+
name?: string;
|
|
64
|
+
/** System instructions for the agent */
|
|
65
|
+
instructions: string;
|
|
66
|
+
/** AI model to use */
|
|
67
|
+
model: LanguageModel;
|
|
68
|
+
/** Maximum steps before stopping */
|
|
69
|
+
maxSteps?: number;
|
|
70
|
+
/** Context window configuration */
|
|
71
|
+
context?: ContextConfig;
|
|
72
|
+
/** Human-in-the-loop configuration */
|
|
73
|
+
approval?: ApprovalConfig;
|
|
74
|
+
/** Subagent configuration */
|
|
75
|
+
subagent?: SubagentConfig;
|
|
76
|
+
/** Checkpoint configuration */
|
|
77
|
+
checkpoint?: CheckpointConfig;
|
|
78
|
+
/** Optional MCP policy engine */
|
|
79
|
+
policyEngine?: PolicyEnginePort;
|
|
80
|
+
}
|
|
81
|
+
interface ContextConfig {
|
|
82
|
+
/** Threshold (0-1) to trigger rolling summarization. Default: 0.70 */
|
|
83
|
+
summarizationThreshold?: number;
|
|
84
|
+
/** Threshold (0-1) to trigger truncation. Default: 0.85 */
|
|
85
|
+
truncationThreshold?: number;
|
|
86
|
+
/** Token count above which tool results are offloaded to VFS. Default: 20000 */
|
|
87
|
+
offloadTokenThreshold?: number;
|
|
88
|
+
/** Model to use for summarization (cheap model). Default: same as agent model */
|
|
89
|
+
summarizationModel?: LanguageModel | null;
|
|
90
|
+
/** Number of recent messages to preserve during summarization */
|
|
91
|
+
preserveRecentMessages?: number;
|
|
92
|
+
}
|
|
93
|
+
interface ApprovalConfig {
|
|
94
|
+
/** Default approval mode. Default: "approve-all" */
|
|
95
|
+
defaultMode?: "approve-all" | "deny-all";
|
|
96
|
+
/** Tools that require approval (deny-list when defaultMode is "approve-all") */
|
|
97
|
+
requireApproval?: string[];
|
|
98
|
+
/** Tools that are auto-approved (allow-list when defaultMode is "deny-all") */
|
|
99
|
+
autoApprove?: string[];
|
|
100
|
+
/** Callback invoked when approval is required */
|
|
101
|
+
onApprovalRequired?: (request: ApprovalRequest) => Promise<boolean>;
|
|
102
|
+
}
|
|
103
|
+
interface DelegationStartContext {
|
|
104
|
+
parentId: string;
|
|
105
|
+
currentDepth: number;
|
|
106
|
+
prompt: string;
|
|
107
|
+
instructions?: string;
|
|
108
|
+
priority: number;
|
|
109
|
+
timeoutMs?: number;
|
|
110
|
+
metadata?: Record<string, unknown>;
|
|
111
|
+
}
|
|
112
|
+
interface DelegationStartResult {
|
|
113
|
+
allow?: boolean;
|
|
114
|
+
reason?: string;
|
|
115
|
+
prompt?: string;
|
|
116
|
+
instructions?: string;
|
|
117
|
+
priority?: number;
|
|
118
|
+
timeoutMs?: number;
|
|
119
|
+
metadata?: Record<string, unknown>;
|
|
120
|
+
}
|
|
121
|
+
interface DelegationIterationContext {
|
|
122
|
+
taskId: string;
|
|
123
|
+
parentId: string;
|
|
124
|
+
previousStatus: string;
|
|
125
|
+
status: string;
|
|
126
|
+
partialOutput: string;
|
|
127
|
+
finalOutput: string | null;
|
|
128
|
+
error: string | null;
|
|
129
|
+
durationMs: number;
|
|
130
|
+
tokenUsage: {
|
|
131
|
+
input: number;
|
|
132
|
+
output: number;
|
|
133
|
+
};
|
|
134
|
+
metadata: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
interface DelegationIterationResult {
|
|
137
|
+
score?: number;
|
|
138
|
+
shouldEscalate?: boolean;
|
|
139
|
+
reason?: string;
|
|
140
|
+
}
|
|
141
|
+
interface DelegationCompleteContext {
|
|
142
|
+
taskId: string;
|
|
143
|
+
parentId: string;
|
|
144
|
+
status: string;
|
|
145
|
+
finalOutput: string | null;
|
|
146
|
+
error: string | null;
|
|
147
|
+
durationMs: number;
|
|
148
|
+
tokenUsage: {
|
|
149
|
+
input: number;
|
|
150
|
+
output: number;
|
|
151
|
+
};
|
|
152
|
+
metadata: Record<string, unknown>;
|
|
153
|
+
}
|
|
154
|
+
interface DelegationCompletionCheckContext {
|
|
155
|
+
taskId: string;
|
|
156
|
+
parentId: string;
|
|
157
|
+
status: string;
|
|
158
|
+
partialOutput: string;
|
|
159
|
+
finalOutput: string | null;
|
|
160
|
+
error: string | null;
|
|
161
|
+
elapsedMs: number;
|
|
162
|
+
iterations: number;
|
|
163
|
+
tokenUsage: {
|
|
164
|
+
input: number;
|
|
165
|
+
output: number;
|
|
166
|
+
};
|
|
167
|
+
metadata: Record<string, unknown>;
|
|
168
|
+
}
|
|
169
|
+
type DelegationCompletionCheckResult = boolean | {
|
|
170
|
+
isComplete: boolean;
|
|
171
|
+
reason?: string;
|
|
172
|
+
};
|
|
173
|
+
interface DelegationMessageFilterContext {
|
|
174
|
+
direction: "tool:call" | "tool:result";
|
|
175
|
+
toolName: string;
|
|
176
|
+
stepIndex: number;
|
|
177
|
+
payload: unknown;
|
|
178
|
+
}
|
|
179
|
+
type DelegationMessageFilterResult = boolean | {
|
|
180
|
+
allow?: boolean;
|
|
181
|
+
payload?: unknown;
|
|
182
|
+
reason?: string;
|
|
183
|
+
};
|
|
184
|
+
interface DelegationHooks {
|
|
185
|
+
onDelegationStart?: (context: DelegationStartContext) => Promise<DelegationStartResult | void> | DelegationStartResult | void;
|
|
186
|
+
onIterationComplete?: (context: DelegationIterationContext) => Promise<DelegationIterationResult | void> | DelegationIterationResult | void;
|
|
187
|
+
onDelegationComplete?: (context: DelegationCompleteContext) => Promise<void> | void;
|
|
188
|
+
isTaskComplete?: (context: DelegationCompletionCheckContext) => Promise<DelegationCompletionCheckResult | void> | DelegationCompletionCheckResult | void;
|
|
189
|
+
messageFilter?: (context: DelegationMessageFilterContext) => Promise<DelegationMessageFilterResult | void> | DelegationMessageFilterResult | void;
|
|
190
|
+
}
|
|
191
|
+
interface SubagentConfig {
|
|
192
|
+
/** Maximum depth of nested subagents. Default: 3 */
|
|
193
|
+
maxDepth?: number;
|
|
194
|
+
/** Timeout for subagent execution in ms. Default: 300000 (5 min) */
|
|
195
|
+
timeoutMs?: number;
|
|
196
|
+
/** Whether subagents can spawn their own subagents. Default: true */
|
|
197
|
+
allowNesting?: boolean;
|
|
198
|
+
/** Optional supervisor-style delegation hooks */
|
|
199
|
+
hooks?: DelegationHooks | undefined;
|
|
200
|
+
}
|
|
201
|
+
interface McpToolsetSelection {
|
|
202
|
+
/** Include only tools from these MCP servers */
|
|
203
|
+
includeServers?: string[];
|
|
204
|
+
/** Exclude tools from these MCP servers */
|
|
205
|
+
excludeServers?: string[];
|
|
206
|
+
/** Include only these tool names (short name or namespaced name) */
|
|
207
|
+
includeTools?: string[];
|
|
208
|
+
/** Exclude these tool names (short name or namespaced name) */
|
|
209
|
+
excludeTools?: string[];
|
|
210
|
+
}
|
|
211
|
+
interface CheckpointConfig {
|
|
212
|
+
/** Enable checkpointing. Default: true */
|
|
213
|
+
enabled?: boolean;
|
|
214
|
+
/** Base step interval between checkpoints. Default: 5 */
|
|
215
|
+
baseStepInterval?: number;
|
|
216
|
+
/** Maximum checkpoints to retain. Default: 10 */
|
|
217
|
+
maxCheckpoints?: number;
|
|
218
|
+
}
|
|
219
|
+
interface ApprovalRequest {
|
|
220
|
+
toolName: string;
|
|
221
|
+
toolCallId: string;
|
|
222
|
+
args: unknown;
|
|
223
|
+
sessionId: string;
|
|
224
|
+
stepIndex: number;
|
|
225
|
+
}
|
|
226
|
+
type AgentEventType = "agent:start" | "agent:stop" | "step:start" | "step:end" | "tool:call" | "tool:result" | "tool:approval-required" | "tool:approved" | "tool:denied" | "checkpoint:save" | "checkpoint:load" | "context:summarize" | "context:offload" | "context:truncate" | "subagent:spawn" | "subagent:complete" | "planning:update" | "plan:created" | "plan:started" | "plan:completed" | "plan:failed" | "plan:updated" | "plan:phase:started" | "plan:phase:completed" | "plan:step:started" | "plan:step:completed" | "plan:step:failed" | "error" | "graph:start" | "graph:complete" | "node:start" | "node:complete" | "consensus:start" | "consensus:result" | "fork:start" | "fork:complete" | "supervisor:start" | "supervisor:stop" | "supervisor:task:assigned" | "supervisor:task:completed" | "subagent:start" | "subagent:stop" | "subagent:message" | "graph:node:retry" | "graph:edge:traverse" | "graph:mutation" | "subagent:dispatch" | "subagent:dequeue" | "subagent:status-change" | "subagent:output-chunk" | "subagent:cancelled" | "subagent:timeout" | "subagent:gc" | "subagent:backpressure" | "subagent:circuit-open" | "subagent:pool-resize" | "delegation:start" | "delegation:blocked" | "delegation:iteration" | "delegation:complete" | "delegation:message-filtered";
|
|
227
|
+
interface AgentEvent<T = unknown> {
|
|
228
|
+
type: AgentEventType;
|
|
229
|
+
timestamp: number;
|
|
230
|
+
sessionId: string;
|
|
231
|
+
data: T;
|
|
232
|
+
}
|
|
233
|
+
type AgentEventHandler = (event: AgentEvent) => void;
|
|
234
|
+
type FilesystemZone = "transient" | "persistent";
|
|
235
|
+
interface FileEntry {
|
|
236
|
+
name: string;
|
|
237
|
+
path: string;
|
|
238
|
+
isDirectory: boolean;
|
|
239
|
+
size: number;
|
|
240
|
+
modifiedAt: number;
|
|
241
|
+
}
|
|
242
|
+
interface FileStat {
|
|
243
|
+
size: number;
|
|
244
|
+
isDirectory: boolean;
|
|
245
|
+
isFile: boolean;
|
|
246
|
+
createdAt: number;
|
|
247
|
+
modifiedAt: number;
|
|
248
|
+
}
|
|
249
|
+
interface ListOptions {
|
|
250
|
+
recursive?: boolean;
|
|
251
|
+
includeHidden?: boolean;
|
|
252
|
+
maxDepth?: number;
|
|
253
|
+
}
|
|
254
|
+
interface SearchOptions {
|
|
255
|
+
caseSensitive?: boolean;
|
|
256
|
+
maxResults?: number;
|
|
257
|
+
includeLineNumbers?: boolean;
|
|
258
|
+
filePattern?: string;
|
|
259
|
+
}
|
|
260
|
+
interface SearchResult {
|
|
261
|
+
filePath: string;
|
|
262
|
+
lineNumber: number;
|
|
263
|
+
lineContent: string;
|
|
264
|
+
matchStart: number;
|
|
265
|
+
matchEnd: number;
|
|
266
|
+
}
|
|
267
|
+
interface Message {
|
|
268
|
+
role: "user" | "assistant" | "system";
|
|
269
|
+
content: string;
|
|
270
|
+
timestamp?: number;
|
|
271
|
+
}
|
|
272
|
+
interface CompressedContext {
|
|
273
|
+
summary: string;
|
|
274
|
+
originalMessageCount: number;
|
|
275
|
+
compressedAt: number;
|
|
276
|
+
}
|
|
277
|
+
interface SessionState {
|
|
278
|
+
sessionId: string;
|
|
279
|
+
startedAt: number;
|
|
280
|
+
lastActivityAt: number;
|
|
281
|
+
stepCount: number;
|
|
282
|
+
totalTokensUsed: number;
|
|
283
|
+
status: "active" | "paused" | "completed" | "failed";
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface FilesystemPort {
|
|
287
|
+
/** Read file content as string */
|
|
288
|
+
read(path: string, zone?: FilesystemZone): Promise<string>;
|
|
289
|
+
/** Write content to file, creating directories as needed */
|
|
290
|
+
write(path: string, content: string, zone?: FilesystemZone): Promise<void>;
|
|
291
|
+
/** Check if file or directory exists */
|
|
292
|
+
exists(path: string, zone?: FilesystemZone): Promise<boolean>;
|
|
293
|
+
/** Delete file or directory */
|
|
294
|
+
delete(path: string, zone?: FilesystemZone): Promise<void>;
|
|
295
|
+
/** List directory entries */
|
|
296
|
+
list(path: string, options?: ListOptions, zone?: FilesystemZone): Promise<FileEntry[]>;
|
|
297
|
+
/** Search file contents by regex/string pattern */
|
|
298
|
+
search(pattern: string, options?: SearchOptions, zone?: FilesystemZone): Promise<SearchResult[]>;
|
|
299
|
+
/** Find files matching glob pattern */
|
|
300
|
+
glob(pattern: string, zone?: FilesystemZone): Promise<string[]>;
|
|
301
|
+
/** Get file/directory metadata */
|
|
302
|
+
stat(path: string, zone?: FilesystemZone): Promise<FileStat>;
|
|
303
|
+
/** Sync transient data to persistent storage */
|
|
304
|
+
syncToPersistent?(): Promise<void>;
|
|
305
|
+
/** Clear all transient files */
|
|
306
|
+
clearTransient?(): Promise<void>;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface TokenBudget {
|
|
310
|
+
maxInputTokens: number;
|
|
311
|
+
maxOutputTokens: number;
|
|
312
|
+
maxTotalTokens: number;
|
|
313
|
+
warningThreshold: number;
|
|
314
|
+
}
|
|
315
|
+
interface TokenUsage {
|
|
316
|
+
inputTokens: number;
|
|
317
|
+
outputTokens: number;
|
|
318
|
+
totalTokens: number;
|
|
319
|
+
estimatedCost: number;
|
|
320
|
+
}
|
|
321
|
+
interface TokenCounterPort {
|
|
322
|
+
/** Count tokens in a text string */
|
|
323
|
+
count(text: string, model?: string): number;
|
|
324
|
+
/** Count tokens across an array of messages */
|
|
325
|
+
countMessages(messages: Message[], model?: string): number;
|
|
326
|
+
/** Get the context window size for a model */
|
|
327
|
+
getContextWindowSize(model: string): number;
|
|
328
|
+
/** Estimate cost for given token usage */
|
|
329
|
+
estimateCost(inputTokens: number, outputTokens: number, model: string): number;
|
|
330
|
+
/** Truncate text to fit within a token budget */
|
|
331
|
+
truncate(text: string, maxTokens: number, model?: string): string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export type { AgentEventType as A, DelegationMessageFilterResult as B, CheckpointConfig as C, DelegationHooks as D, DelegationStartContext as E, FilesystemPort as F, DelegationStartResult as G, SessionState as H, TokenUsage as I, ListOptions as L, Message as M, PolicyContext as P, SearchOptions as S, TokenCounterPort as T, FilesystemZone as a, FileEntry as b, FileStat as c, SearchResult as d, AgentEventHandler as e, McpToolsetSelection as f, PolicyEnginePort as g, SubagentConfig as h, ApprovalConfig as i, AgentConfig as j, ContextConfig as k, TokenBudget as l, ApprovalRequest as m, CompressedContext as n, AgentEvent as o, PolicyEffect as p, PolicyRule as q, PolicyRequest as r, PolicyDecision as s, PolicyAuditRecord as t, DelegationCompleteContext as u, DelegationCompletionCheckContext as v, DelegationCompletionCheckResult as w, DelegationIterationContext as x, DelegationIterationResult as y, DelegationMessageFilterContext as z };
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { L as LanguageModel } from './types-CVsP7gFI.cjs';
|
|
2
|
+
|
|
3
|
+
type PolicyEffect = "allow" | "deny";
|
|
4
|
+
interface PolicyContext {
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
tenantId?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
interface PolicyRequest {
|
|
11
|
+
action: "invoke";
|
|
12
|
+
resource: string;
|
|
13
|
+
serverName?: string;
|
|
14
|
+
toolName?: string;
|
|
15
|
+
}
|
|
16
|
+
interface PolicyRule {
|
|
17
|
+
id: string;
|
|
18
|
+
effect: PolicyEffect;
|
|
19
|
+
/** Wildcard pattern, e.g. "docs:*" or "calc:add" */
|
|
20
|
+
resourcePattern: string;
|
|
21
|
+
/** Optional wildcard server matcher */
|
|
22
|
+
serverPattern?: string;
|
|
23
|
+
/** Optional wildcard tool matcher */
|
|
24
|
+
toolPattern?: string;
|
|
25
|
+
/** Rule priority, higher wins. Default: 0 */
|
|
26
|
+
priority?: number;
|
|
27
|
+
/** Optional contextual constraints */
|
|
28
|
+
context?: {
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
userId?: string;
|
|
31
|
+
tenantId?: string;
|
|
32
|
+
};
|
|
33
|
+
reason?: string;
|
|
34
|
+
}
|
|
35
|
+
interface PolicyDecision {
|
|
36
|
+
allowed: boolean;
|
|
37
|
+
effect: PolicyEffect;
|
|
38
|
+
reason?: string;
|
|
39
|
+
matchedRuleId?: string;
|
|
40
|
+
auditId: string;
|
|
41
|
+
}
|
|
42
|
+
interface PolicyAuditRecord {
|
|
43
|
+
id: string;
|
|
44
|
+
timestamp: string;
|
|
45
|
+
request: PolicyRequest;
|
|
46
|
+
context: PolicyContext;
|
|
47
|
+
decision: PolicyDecision;
|
|
48
|
+
}
|
|
49
|
+
interface PolicyEnginePort {
|
|
50
|
+
evaluate(request: PolicyRequest, context: PolicyContext): Promise<PolicyDecision>;
|
|
51
|
+
addRule(rule: PolicyRule): Promise<void>;
|
|
52
|
+
removeRule(id: string): Promise<boolean>;
|
|
53
|
+
setRules(rules: PolicyRule[]): Promise<void>;
|
|
54
|
+
listRules(): Promise<PolicyRule[]>;
|
|
55
|
+
getAuditLog(limit?: number): Promise<PolicyAuditRecord[]>;
|
|
56
|
+
clearAuditLog(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface AgentConfig {
|
|
60
|
+
/** Agent identifier */
|
|
61
|
+
id?: string;
|
|
62
|
+
/** Display name */
|
|
63
|
+
name?: string;
|
|
64
|
+
/** System instructions for the agent */
|
|
65
|
+
instructions: string;
|
|
66
|
+
/** AI model to use */
|
|
67
|
+
model: LanguageModel;
|
|
68
|
+
/** Maximum steps before stopping */
|
|
69
|
+
maxSteps?: number;
|
|
70
|
+
/** Context window configuration */
|
|
71
|
+
context?: ContextConfig;
|
|
72
|
+
/** Human-in-the-loop configuration */
|
|
73
|
+
approval?: ApprovalConfig;
|
|
74
|
+
/** Subagent configuration */
|
|
75
|
+
subagent?: SubagentConfig;
|
|
76
|
+
/** Checkpoint configuration */
|
|
77
|
+
checkpoint?: CheckpointConfig;
|
|
78
|
+
/** Optional MCP policy engine */
|
|
79
|
+
policyEngine?: PolicyEnginePort;
|
|
80
|
+
}
|
|
81
|
+
interface ContextConfig {
|
|
82
|
+
/** Threshold (0-1) to trigger rolling summarization. Default: 0.70 */
|
|
83
|
+
summarizationThreshold?: number;
|
|
84
|
+
/** Threshold (0-1) to trigger truncation. Default: 0.85 */
|
|
85
|
+
truncationThreshold?: number;
|
|
86
|
+
/** Token count above which tool results are offloaded to VFS. Default: 20000 */
|
|
87
|
+
offloadTokenThreshold?: number;
|
|
88
|
+
/** Model to use for summarization (cheap model). Default: same as agent model */
|
|
89
|
+
summarizationModel?: LanguageModel | null;
|
|
90
|
+
/** Number of recent messages to preserve during summarization */
|
|
91
|
+
preserveRecentMessages?: number;
|
|
92
|
+
}
|
|
93
|
+
interface ApprovalConfig {
|
|
94
|
+
/** Default approval mode. Default: "approve-all" */
|
|
95
|
+
defaultMode?: "approve-all" | "deny-all";
|
|
96
|
+
/** Tools that require approval (deny-list when defaultMode is "approve-all") */
|
|
97
|
+
requireApproval?: string[];
|
|
98
|
+
/** Tools that are auto-approved (allow-list when defaultMode is "deny-all") */
|
|
99
|
+
autoApprove?: string[];
|
|
100
|
+
/** Callback invoked when approval is required */
|
|
101
|
+
onApprovalRequired?: (request: ApprovalRequest) => Promise<boolean>;
|
|
102
|
+
}
|
|
103
|
+
interface DelegationStartContext {
|
|
104
|
+
parentId: string;
|
|
105
|
+
currentDepth: number;
|
|
106
|
+
prompt: string;
|
|
107
|
+
instructions?: string;
|
|
108
|
+
priority: number;
|
|
109
|
+
timeoutMs?: number;
|
|
110
|
+
metadata?: Record<string, unknown>;
|
|
111
|
+
}
|
|
112
|
+
interface DelegationStartResult {
|
|
113
|
+
allow?: boolean;
|
|
114
|
+
reason?: string;
|
|
115
|
+
prompt?: string;
|
|
116
|
+
instructions?: string;
|
|
117
|
+
priority?: number;
|
|
118
|
+
timeoutMs?: number;
|
|
119
|
+
metadata?: Record<string, unknown>;
|
|
120
|
+
}
|
|
121
|
+
interface DelegationIterationContext {
|
|
122
|
+
taskId: string;
|
|
123
|
+
parentId: string;
|
|
124
|
+
previousStatus: string;
|
|
125
|
+
status: string;
|
|
126
|
+
partialOutput: string;
|
|
127
|
+
finalOutput: string | null;
|
|
128
|
+
error: string | null;
|
|
129
|
+
durationMs: number;
|
|
130
|
+
tokenUsage: {
|
|
131
|
+
input: number;
|
|
132
|
+
output: number;
|
|
133
|
+
};
|
|
134
|
+
metadata: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
interface DelegationIterationResult {
|
|
137
|
+
score?: number;
|
|
138
|
+
shouldEscalate?: boolean;
|
|
139
|
+
reason?: string;
|
|
140
|
+
}
|
|
141
|
+
interface DelegationCompleteContext {
|
|
142
|
+
taskId: string;
|
|
143
|
+
parentId: string;
|
|
144
|
+
status: string;
|
|
145
|
+
finalOutput: string | null;
|
|
146
|
+
error: string | null;
|
|
147
|
+
durationMs: number;
|
|
148
|
+
tokenUsage: {
|
|
149
|
+
input: number;
|
|
150
|
+
output: number;
|
|
151
|
+
};
|
|
152
|
+
metadata: Record<string, unknown>;
|
|
153
|
+
}
|
|
154
|
+
interface DelegationCompletionCheckContext {
|
|
155
|
+
taskId: string;
|
|
156
|
+
parentId: string;
|
|
157
|
+
status: string;
|
|
158
|
+
partialOutput: string;
|
|
159
|
+
finalOutput: string | null;
|
|
160
|
+
error: string | null;
|
|
161
|
+
elapsedMs: number;
|
|
162
|
+
iterations: number;
|
|
163
|
+
tokenUsage: {
|
|
164
|
+
input: number;
|
|
165
|
+
output: number;
|
|
166
|
+
};
|
|
167
|
+
metadata: Record<string, unknown>;
|
|
168
|
+
}
|
|
169
|
+
type DelegationCompletionCheckResult = boolean | {
|
|
170
|
+
isComplete: boolean;
|
|
171
|
+
reason?: string;
|
|
172
|
+
};
|
|
173
|
+
interface DelegationMessageFilterContext {
|
|
174
|
+
direction: "tool:call" | "tool:result";
|
|
175
|
+
toolName: string;
|
|
176
|
+
stepIndex: number;
|
|
177
|
+
payload: unknown;
|
|
178
|
+
}
|
|
179
|
+
type DelegationMessageFilterResult = boolean | {
|
|
180
|
+
allow?: boolean;
|
|
181
|
+
payload?: unknown;
|
|
182
|
+
reason?: string;
|
|
183
|
+
};
|
|
184
|
+
interface DelegationHooks {
|
|
185
|
+
onDelegationStart?: (context: DelegationStartContext) => Promise<DelegationStartResult | void> | DelegationStartResult | void;
|
|
186
|
+
onIterationComplete?: (context: DelegationIterationContext) => Promise<DelegationIterationResult | void> | DelegationIterationResult | void;
|
|
187
|
+
onDelegationComplete?: (context: DelegationCompleteContext) => Promise<void> | void;
|
|
188
|
+
isTaskComplete?: (context: DelegationCompletionCheckContext) => Promise<DelegationCompletionCheckResult | void> | DelegationCompletionCheckResult | void;
|
|
189
|
+
messageFilter?: (context: DelegationMessageFilterContext) => Promise<DelegationMessageFilterResult | void> | DelegationMessageFilterResult | void;
|
|
190
|
+
}
|
|
191
|
+
interface SubagentConfig {
|
|
192
|
+
/** Maximum depth of nested subagents. Default: 3 */
|
|
193
|
+
maxDepth?: number;
|
|
194
|
+
/** Timeout for subagent execution in ms. Default: 300000 (5 min) */
|
|
195
|
+
timeoutMs?: number;
|
|
196
|
+
/** Whether subagents can spawn their own subagents. Default: true */
|
|
197
|
+
allowNesting?: boolean;
|
|
198
|
+
/** Optional supervisor-style delegation hooks */
|
|
199
|
+
hooks?: DelegationHooks | undefined;
|
|
200
|
+
}
|
|
201
|
+
interface McpToolsetSelection {
|
|
202
|
+
/** Include only tools from these MCP servers */
|
|
203
|
+
includeServers?: string[];
|
|
204
|
+
/** Exclude tools from these MCP servers */
|
|
205
|
+
excludeServers?: string[];
|
|
206
|
+
/** Include only these tool names (short name or namespaced name) */
|
|
207
|
+
includeTools?: string[];
|
|
208
|
+
/** Exclude these tool names (short name or namespaced name) */
|
|
209
|
+
excludeTools?: string[];
|
|
210
|
+
}
|
|
211
|
+
interface CheckpointConfig {
|
|
212
|
+
/** Enable checkpointing. Default: true */
|
|
213
|
+
enabled?: boolean;
|
|
214
|
+
/** Base step interval between checkpoints. Default: 5 */
|
|
215
|
+
baseStepInterval?: number;
|
|
216
|
+
/** Maximum checkpoints to retain. Default: 10 */
|
|
217
|
+
maxCheckpoints?: number;
|
|
218
|
+
}
|
|
219
|
+
interface ApprovalRequest {
|
|
220
|
+
toolName: string;
|
|
221
|
+
toolCallId: string;
|
|
222
|
+
args: unknown;
|
|
223
|
+
sessionId: string;
|
|
224
|
+
stepIndex: number;
|
|
225
|
+
}
|
|
226
|
+
type AgentEventType = "agent:start" | "agent:stop" | "step:start" | "step:end" | "tool:call" | "tool:result" | "tool:approval-required" | "tool:approved" | "tool:denied" | "checkpoint:save" | "checkpoint:load" | "context:summarize" | "context:offload" | "context:truncate" | "subagent:spawn" | "subagent:complete" | "planning:update" | "plan:created" | "plan:started" | "plan:completed" | "plan:failed" | "plan:updated" | "plan:phase:started" | "plan:phase:completed" | "plan:step:started" | "plan:step:completed" | "plan:step:failed" | "error" | "graph:start" | "graph:complete" | "node:start" | "node:complete" | "consensus:start" | "consensus:result" | "fork:start" | "fork:complete" | "supervisor:start" | "supervisor:stop" | "supervisor:task:assigned" | "supervisor:task:completed" | "subagent:start" | "subagent:stop" | "subagent:message" | "graph:node:retry" | "graph:edge:traverse" | "graph:mutation" | "subagent:dispatch" | "subagent:dequeue" | "subagent:status-change" | "subagent:output-chunk" | "subagent:cancelled" | "subagent:timeout" | "subagent:gc" | "subagent:backpressure" | "subagent:circuit-open" | "subagent:pool-resize" | "delegation:start" | "delegation:blocked" | "delegation:iteration" | "delegation:complete" | "delegation:message-filtered";
|
|
227
|
+
interface AgentEvent<T = unknown> {
|
|
228
|
+
type: AgentEventType;
|
|
229
|
+
timestamp: number;
|
|
230
|
+
sessionId: string;
|
|
231
|
+
data: T;
|
|
232
|
+
}
|
|
233
|
+
type AgentEventHandler = (event: AgentEvent) => void;
|
|
234
|
+
type FilesystemZone = "transient" | "persistent";
|
|
235
|
+
interface FileEntry {
|
|
236
|
+
name: string;
|
|
237
|
+
path: string;
|
|
238
|
+
isDirectory: boolean;
|
|
239
|
+
size: number;
|
|
240
|
+
modifiedAt: number;
|
|
241
|
+
}
|
|
242
|
+
interface FileStat {
|
|
243
|
+
size: number;
|
|
244
|
+
isDirectory: boolean;
|
|
245
|
+
isFile: boolean;
|
|
246
|
+
createdAt: number;
|
|
247
|
+
modifiedAt: number;
|
|
248
|
+
}
|
|
249
|
+
interface ListOptions {
|
|
250
|
+
recursive?: boolean;
|
|
251
|
+
includeHidden?: boolean;
|
|
252
|
+
maxDepth?: number;
|
|
253
|
+
}
|
|
254
|
+
interface SearchOptions {
|
|
255
|
+
caseSensitive?: boolean;
|
|
256
|
+
maxResults?: number;
|
|
257
|
+
includeLineNumbers?: boolean;
|
|
258
|
+
filePattern?: string;
|
|
259
|
+
}
|
|
260
|
+
interface SearchResult {
|
|
261
|
+
filePath: string;
|
|
262
|
+
lineNumber: number;
|
|
263
|
+
lineContent: string;
|
|
264
|
+
matchStart: number;
|
|
265
|
+
matchEnd: number;
|
|
266
|
+
}
|
|
267
|
+
interface Message {
|
|
268
|
+
role: "user" | "assistant" | "system";
|
|
269
|
+
content: string;
|
|
270
|
+
timestamp?: number;
|
|
271
|
+
}
|
|
272
|
+
interface CompressedContext {
|
|
273
|
+
summary: string;
|
|
274
|
+
originalMessageCount: number;
|
|
275
|
+
compressedAt: number;
|
|
276
|
+
}
|
|
277
|
+
interface SessionState {
|
|
278
|
+
sessionId: string;
|
|
279
|
+
startedAt: number;
|
|
280
|
+
lastActivityAt: number;
|
|
281
|
+
stepCount: number;
|
|
282
|
+
totalTokensUsed: number;
|
|
283
|
+
status: "active" | "paused" | "completed" | "failed";
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface FilesystemPort {
|
|
287
|
+
/** Read file content as string */
|
|
288
|
+
read(path: string, zone?: FilesystemZone): Promise<string>;
|
|
289
|
+
/** Write content to file, creating directories as needed */
|
|
290
|
+
write(path: string, content: string, zone?: FilesystemZone): Promise<void>;
|
|
291
|
+
/** Check if file or directory exists */
|
|
292
|
+
exists(path: string, zone?: FilesystemZone): Promise<boolean>;
|
|
293
|
+
/** Delete file or directory */
|
|
294
|
+
delete(path: string, zone?: FilesystemZone): Promise<void>;
|
|
295
|
+
/** List directory entries */
|
|
296
|
+
list(path: string, options?: ListOptions, zone?: FilesystemZone): Promise<FileEntry[]>;
|
|
297
|
+
/** Search file contents by regex/string pattern */
|
|
298
|
+
search(pattern: string, options?: SearchOptions, zone?: FilesystemZone): Promise<SearchResult[]>;
|
|
299
|
+
/** Find files matching glob pattern */
|
|
300
|
+
glob(pattern: string, zone?: FilesystemZone): Promise<string[]>;
|
|
301
|
+
/** Get file/directory metadata */
|
|
302
|
+
stat(path: string, zone?: FilesystemZone): Promise<FileStat>;
|
|
303
|
+
/** Sync transient data to persistent storage */
|
|
304
|
+
syncToPersistent?(): Promise<void>;
|
|
305
|
+
/** Clear all transient files */
|
|
306
|
+
clearTransient?(): Promise<void>;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface TokenBudget {
|
|
310
|
+
maxInputTokens: number;
|
|
311
|
+
maxOutputTokens: number;
|
|
312
|
+
maxTotalTokens: number;
|
|
313
|
+
warningThreshold: number;
|
|
314
|
+
}
|
|
315
|
+
interface TokenUsage {
|
|
316
|
+
inputTokens: number;
|
|
317
|
+
outputTokens: number;
|
|
318
|
+
totalTokens: number;
|
|
319
|
+
estimatedCost: number;
|
|
320
|
+
}
|
|
321
|
+
interface TokenCounterPort {
|
|
322
|
+
/** Count tokens in a text string */
|
|
323
|
+
count(text: string, model?: string): number;
|
|
324
|
+
/** Count tokens across an array of messages */
|
|
325
|
+
countMessages(messages: Message[], model?: string): number;
|
|
326
|
+
/** Get the context window size for a model */
|
|
327
|
+
getContextWindowSize(model: string): number;
|
|
328
|
+
/** Estimate cost for given token usage */
|
|
329
|
+
estimateCost(inputTokens: number, outputTokens: number, model: string): number;
|
|
330
|
+
/** Truncate text to fit within a token budget */
|
|
331
|
+
truncate(text: string, maxTokens: number, model?: string): string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export type { AgentEventType as A, DelegationMessageFilterResult as B, CheckpointConfig as C, DelegationHooks as D, DelegationStartContext as E, FilesystemPort as F, DelegationStartResult as G, SessionState as H, TokenUsage as I, ListOptions as L, Message as M, PolicyContext as P, SearchOptions as S, TokenCounterPort as T, FilesystemZone as a, FileEntry as b, FileStat as c, SearchResult as d, AgentEventHandler as e, McpToolsetSelection as f, PolicyEnginePort as g, SubagentConfig as h, ApprovalConfig as i, AgentConfig as j, ContextConfig as k, TokenBudget as l, ApprovalRequest as m, CompressedContext as n, AgentEvent as o, PolicyEffect as p, PolicyRule as q, PolicyRequest as r, PolicyDecision as s, PolicyAuditRecord as t, DelegationCompleteContext as u, DelegationCompletionCheckContext as v, DelegationCompletionCheckResult as w, DelegationIterationContext as x, DelegationIterationResult as y, DelegationMessageFilterContext as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|