@botbotgo/agent-harness 0.0.96 → 0.0.98
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/dist/api.d.ts +5 -5
- package/dist/contracts/core.d.ts +9 -0
- package/dist/contracts/core.js +1 -0
- package/dist/contracts/runtime.d.ts +421 -0
- package/dist/contracts/runtime.js +1 -0
- package/dist/contracts/types.d.ts +3 -653
- package/dist/contracts/types.js +3 -1
- package/dist/contracts/workspace.d.ts +229 -0
- package/dist/contracts/workspace.js +1 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/adapter/compat/deepagent-compat.d.ts +16 -0
- package/dist/runtime/adapter/compat/deepagent-compat.js +45 -0
- package/dist/runtime/adapter/compat/openai-compatible.d.ts +2 -0
- package/dist/runtime/adapter/compat/openai-compatible.js +43 -0
- package/dist/runtime/adapter/index.d.ts +15 -0
- package/dist/runtime/adapter/index.js +15 -0
- package/dist/runtime/{langgraph-profiles.d.ts → adapter/langgraph/profiles.d.ts} +1 -1
- package/dist/runtime/adapter/model/invocation-request.d.ts +10 -0
- package/dist/runtime/adapter/model/invocation-request.js +46 -0
- package/dist/runtime/adapter/model/message-assembly.d.ts +6 -0
- package/dist/runtime/adapter/model/message-assembly.js +21 -0
- package/dist/runtime/adapter/model/model-providers.d.ts +2 -0
- package/dist/runtime/adapter/model/model-providers.js +27 -0
- package/dist/runtime/adapter/resilience.d.ts +12 -0
- package/dist/runtime/adapter/resilience.js +60 -0
- package/dist/runtime/{declared-middleware.d.ts → adapter/tool/declared-middleware.d.ts} +1 -1
- package/dist/runtime/adapter/tool/interrupt-policy.d.ts +8 -0
- package/dist/runtime/adapter/tool/interrupt-policy.js +34 -0
- package/dist/runtime/adapter/tool/provider-tool.d.ts +2 -0
- package/dist/runtime/adapter/tool/provider-tool.js +25 -0
- package/dist/runtime/adapter/tool/resolved-tool.d.ts +18 -0
- package/dist/runtime/adapter/tool/resolved-tool.js +62 -0
- package/dist/runtime/adapter/tool/tool-arguments.d.ts +7 -0
- package/dist/runtime/adapter/tool/tool-arguments.js +87 -0
- package/dist/runtime/{tool-hitl.d.ts → adapter/tool/tool-hitl.d.ts} +2 -2
- package/dist/runtime/adapter/tool/tool-name-mapping.d.ts +13 -0
- package/dist/runtime/adapter/tool/tool-name-mapping.js +101 -0
- package/dist/runtime/agent-runtime-adapter.d.ts +5 -20
- package/dist/runtime/agent-runtime-adapter.js +33 -536
- package/dist/runtime/checkpoint-maintenance.d.ts +1 -45
- package/dist/runtime/checkpoint-maintenance.js +1 -259
- package/dist/runtime/file-checkpoint-saver.d.ts +1 -20
- package/dist/runtime/file-checkpoint-saver.js +1 -106
- package/dist/runtime/{event-bus.d.ts → harness/events/event-bus.d.ts} +1 -1
- package/dist/runtime/{event-sink.d.ts → harness/events/event-sink.d.ts} +1 -1
- package/dist/runtime/{event-sink.js → harness/events/event-sink.js} +1 -1
- package/dist/runtime/harness/events/events.d.ts +23 -0
- package/dist/runtime/harness/events/events.js +61 -0
- package/dist/runtime/harness/events/streaming.d.ts +19 -0
- package/dist/runtime/harness/events/streaming.js +96 -0
- package/dist/runtime/harness/index.d.ts +16 -0
- package/dist/runtime/harness/index.js +16 -0
- package/dist/runtime/harness/run/helpers.d.ts +33 -0
- package/dist/runtime/harness/run/helpers.js +74 -0
- package/dist/runtime/harness/run/resources.d.ts +7 -0
- package/dist/runtime/harness/run/resources.js +58 -0
- package/dist/runtime/harness/run/resume.d.ts +6 -0
- package/dist/runtime/harness/run/resume.js +56 -0
- package/dist/runtime/harness/run/routing.d.ts +12 -0
- package/dist/runtime/harness/run/routing.js +47 -0
- package/dist/runtime/harness/run/run-lifecycle.d.ts +37 -0
- package/dist/runtime/harness/run/run-lifecycle.js +109 -0
- package/dist/runtime/harness/run/run-queue.d.ts +17 -0
- package/dist/runtime/harness/run/run-queue.js +43 -0
- package/dist/runtime/{health-monitor.d.ts → harness/system/health-monitor.d.ts} +3 -3
- package/dist/runtime/{health-monitor.js → harness/system/health-monitor.js} +2 -2
- package/dist/runtime/{inventory.d.ts → harness/system/inventory.d.ts} +2 -2
- package/dist/runtime/{inventory.js → harness/system/inventory.js} +4 -4
- package/dist/runtime/{policy-engine.d.ts → harness/system/policy-engine.d.ts} +1 -1
- package/dist/runtime/{policy-engine.js → harness/system/policy-engine.js} +1 -1
- package/dist/runtime/{skill-requirements.d.ts → harness/system/skill-requirements.d.ts} +1 -1
- package/dist/runtime/{skill-requirements.js → harness/system/skill-requirements.js} +1 -1
- package/dist/runtime/{thread-memory-sync.d.ts → harness/system/thread-memory-sync.d.ts} +2 -2
- package/dist/runtime/{thread-memory-sync.js → harness/system/thread-memory-sync.js} +1 -1
- package/dist/runtime/harness.d.ts +2 -8
- package/dist/runtime/harness.js +143 -493
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +7 -7
- package/dist/runtime/maintenance/checkpoint-maintenance.d.ts +45 -0
- package/dist/runtime/maintenance/checkpoint-maintenance.js +259 -0
- package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +20 -0
- package/dist/runtime/maintenance/file-checkpoint-saver.js +106 -0
- package/dist/runtime/maintenance/index.d.ts +4 -0
- package/dist/runtime/maintenance/index.js +4 -0
- package/dist/runtime/{runtime-record-maintenance.d.ts → maintenance/runtime-record-maintenance.d.ts} +1 -1
- package/dist/runtime/{runtime-record-maintenance.js → maintenance/runtime-record-maintenance.js} +2 -2
- package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.d.ts +9 -0
- package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.js +39 -0
- package/dist/runtime/sqlite-maintained-checkpoint-saver.d.ts +1 -9
- package/dist/runtime/sqlite-maintained-checkpoint-saver.js +1 -39
- package/dist/runtime/support/harness-support.d.ts +4 -4
- package/dist/runtime/support/runtime-factories.d.ts +1 -1
- package/dist/runtime/support/runtime-factories.js +1 -1
- package/package.json +4 -4
- /package/dist/runtime/{langgraph-presets.d.ts → adapter/langgraph/presets.d.ts} +0 -0
- /package/dist/runtime/{langgraph-presets.js → adapter/langgraph/presets.js} +0 -0
- /package/dist/runtime/{langgraph-profiles.js → adapter/langgraph/profiles.js} +0 -0
- /package/dist/runtime/{declared-middleware.js → adapter/tool/declared-middleware.js} +0 -0
- /package/dist/runtime/{tool-hitl.js → adapter/tool/tool-hitl.js} +0 -0
- /package/dist/runtime/{event-bus.js → harness/events/event-bus.js} +0 -0
- /package/dist/runtime/{store.d.ts → harness/system/store.d.ts} +0 -0
- /package/dist/runtime/{store.js → harness/system/store.js} +0 -0
|
@@ -1,653 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export type RuntimeModelRefMap = Partial<Record<RuntimeModelSlot, string>>;
|
|
5
|
-
export type RuntimeModelMap = Partial<Record<RuntimeModelSlot, CompiledModel>>;
|
|
6
|
-
export type RuntimeCapabilities = {
|
|
7
|
-
delegation?: boolean;
|
|
8
|
-
memory?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type RunState = "queued" | "claimed" | "running" | "waiting_for_approval" | "resuming" | "cancelling" | "cancelled" | "completed" | "failed";
|
|
11
|
-
export type ParsedAgentObject = {
|
|
12
|
-
id: string;
|
|
13
|
-
executionMode: ExecutionMode;
|
|
14
|
-
runtimeModelRefs?: RuntimeModelRefMap;
|
|
15
|
-
capabilities?: RuntimeCapabilities;
|
|
16
|
-
description: string;
|
|
17
|
-
modelRef: string;
|
|
18
|
-
runRoot?: string;
|
|
19
|
-
toolRefs: string[];
|
|
20
|
-
mcpServers?: Array<Record<string, unknown>>;
|
|
21
|
-
skillPathRefs: string[];
|
|
22
|
-
memorySources: string[];
|
|
23
|
-
subagentRefs: string[];
|
|
24
|
-
subagentPathRefs: string[];
|
|
25
|
-
langchainAgentConfig?: Record<string, unknown>;
|
|
26
|
-
deepAgentConfig?: Record<string, unknown>;
|
|
27
|
-
sourcePath: string;
|
|
28
|
-
};
|
|
29
|
-
export type WorkspaceObject = {
|
|
30
|
-
id: string;
|
|
31
|
-
kind: string;
|
|
32
|
-
sourcePath: string;
|
|
33
|
-
value: Record<string, unknown>;
|
|
34
|
-
};
|
|
35
|
-
export type ParsedModelObject = {
|
|
36
|
-
id: string;
|
|
37
|
-
provider: string;
|
|
38
|
-
model: string;
|
|
39
|
-
init: Record<string, unknown>;
|
|
40
|
-
clientRef?: string;
|
|
41
|
-
fallbacks: string[];
|
|
42
|
-
metadata?: Record<string, unknown>;
|
|
43
|
-
sourcePath: string;
|
|
44
|
-
};
|
|
45
|
-
export type ParsedEmbeddingModelObject = {
|
|
46
|
-
id: string;
|
|
47
|
-
provider: string;
|
|
48
|
-
model: string;
|
|
49
|
-
init: Record<string, unknown>;
|
|
50
|
-
clientRef?: string;
|
|
51
|
-
metadata?: Record<string, unknown>;
|
|
52
|
-
sourcePath: string;
|
|
53
|
-
};
|
|
54
|
-
export type ParsedVectorStoreObject = {
|
|
55
|
-
id: string;
|
|
56
|
-
kind: string;
|
|
57
|
-
url?: string;
|
|
58
|
-
authToken?: string;
|
|
59
|
-
table?: string;
|
|
60
|
-
column?: string;
|
|
61
|
-
embeddingModelRef?: string;
|
|
62
|
-
metadata?: Record<string, unknown>;
|
|
63
|
-
sourcePath: string;
|
|
64
|
-
};
|
|
65
|
-
export type ParsedMcpServerObject = {
|
|
66
|
-
id: string;
|
|
67
|
-
transport: "stdio" | "http" | "sse" | "websocket";
|
|
68
|
-
url?: string;
|
|
69
|
-
command?: string;
|
|
70
|
-
args?: string[];
|
|
71
|
-
env?: Record<string, string>;
|
|
72
|
-
cwd?: string;
|
|
73
|
-
token?: string;
|
|
74
|
-
headers?: Record<string, string>;
|
|
75
|
-
sourcePath: string;
|
|
76
|
-
};
|
|
77
|
-
export type ParsedToolObject = {
|
|
78
|
-
id: string;
|
|
79
|
-
type: string;
|
|
80
|
-
name: string;
|
|
81
|
-
description: string;
|
|
82
|
-
implementationName?: string;
|
|
83
|
-
config?: Record<string, unknown>;
|
|
84
|
-
inputSchemaRef?: string;
|
|
85
|
-
backendOperation?: string;
|
|
86
|
-
mcpRef?: string;
|
|
87
|
-
bundleRefs: string[];
|
|
88
|
-
hitl?: {
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
allow?: Array<"approve" | "edit" | "reject">;
|
|
91
|
-
};
|
|
92
|
-
retryable?: boolean;
|
|
93
|
-
sourcePath: string;
|
|
94
|
-
};
|
|
95
|
-
export type LangChainAgentParams = {
|
|
96
|
-
model: CompiledModel;
|
|
97
|
-
tools: CompiledTool[];
|
|
98
|
-
systemPrompt?: string;
|
|
99
|
-
stateSchema?: unknown;
|
|
100
|
-
responseFormat?: unknown;
|
|
101
|
-
contextSchema?: unknown;
|
|
102
|
-
filesystem?: Record<string, unknown>;
|
|
103
|
-
middleware?: Array<Record<string, unknown>>;
|
|
104
|
-
passthrough?: Record<string, unknown>;
|
|
105
|
-
subagents?: CompiledSubAgent[];
|
|
106
|
-
memory?: string[];
|
|
107
|
-
skills?: string[];
|
|
108
|
-
generalPurposeAgent?: boolean;
|
|
109
|
-
taskDescription?: string;
|
|
110
|
-
includeAgentName?: "inline";
|
|
111
|
-
version?: "v1" | "v2";
|
|
112
|
-
name?: string;
|
|
113
|
-
description: string;
|
|
114
|
-
};
|
|
115
|
-
export type CompiledSubAgent = {
|
|
116
|
-
name: string;
|
|
117
|
-
description: string;
|
|
118
|
-
systemPrompt: string;
|
|
119
|
-
tools?: CompiledTool[];
|
|
120
|
-
model?: CompiledModel;
|
|
121
|
-
interruptOn?: Record<string, boolean | object>;
|
|
122
|
-
skills?: string[];
|
|
123
|
-
memory?: string[];
|
|
124
|
-
responseFormat?: unknown;
|
|
125
|
-
contextSchema?: unknown;
|
|
126
|
-
middleware?: Array<Record<string, unknown>>;
|
|
127
|
-
passthrough?: Record<string, unknown>;
|
|
128
|
-
};
|
|
129
|
-
export type DeepAgentParams = {
|
|
130
|
-
model: CompiledModel;
|
|
131
|
-
tools: CompiledTool[];
|
|
132
|
-
systemPrompt?: string;
|
|
133
|
-
responseFormat?: unknown;
|
|
134
|
-
contextSchema?: unknown;
|
|
135
|
-
middleware?: Array<Record<string, unknown>>;
|
|
136
|
-
passthrough?: Record<string, unknown>;
|
|
137
|
-
description: string;
|
|
138
|
-
subagents: CompiledSubAgent[];
|
|
139
|
-
interruptOn?: Record<string, boolean | object>;
|
|
140
|
-
backend?: Record<string, unknown>;
|
|
141
|
-
store?: Record<string, unknown>;
|
|
142
|
-
name: string;
|
|
143
|
-
memory: string[];
|
|
144
|
-
skills: string[];
|
|
145
|
-
generalPurposeAgent?: boolean;
|
|
146
|
-
taskDescription?: string;
|
|
147
|
-
};
|
|
148
|
-
export type CompiledModel = {
|
|
149
|
-
id: string;
|
|
150
|
-
provider: string;
|
|
151
|
-
model: string;
|
|
152
|
-
init: Record<string, unknown>;
|
|
153
|
-
clientRef?: string;
|
|
154
|
-
fallbacks: string[];
|
|
155
|
-
runtimeValue: string;
|
|
156
|
-
};
|
|
157
|
-
export type CompiledEmbeddingModel = {
|
|
158
|
-
id: string;
|
|
159
|
-
provider: string;
|
|
160
|
-
model: string;
|
|
161
|
-
init: Record<string, unknown>;
|
|
162
|
-
clientRef?: string;
|
|
163
|
-
runtimeValue: string;
|
|
164
|
-
};
|
|
165
|
-
export type CompiledVectorStore = {
|
|
166
|
-
id: string;
|
|
167
|
-
kind: string;
|
|
168
|
-
url?: string;
|
|
169
|
-
authToken?: string;
|
|
170
|
-
table?: string;
|
|
171
|
-
column?: string;
|
|
172
|
-
embeddingModelRef?: string;
|
|
173
|
-
runtimeValue: string;
|
|
174
|
-
};
|
|
175
|
-
export type CompiledTool = {
|
|
176
|
-
id: string;
|
|
177
|
-
type: string;
|
|
178
|
-
name: string;
|
|
179
|
-
description: string;
|
|
180
|
-
config?: Record<string, unknown>;
|
|
181
|
-
inputSchemaRef?: string;
|
|
182
|
-
backendOperation?: string;
|
|
183
|
-
mcpRef?: string;
|
|
184
|
-
bundleRefs: string[];
|
|
185
|
-
hitl?: {
|
|
186
|
-
enabled: boolean;
|
|
187
|
-
allow: Array<"approve" | "edit" | "reject">;
|
|
188
|
-
};
|
|
189
|
-
retryable?: boolean;
|
|
190
|
-
runtimeValue: {
|
|
191
|
-
name: string;
|
|
192
|
-
description: string;
|
|
193
|
-
type: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
export type CompiledAgentBinding = {
|
|
197
|
-
agent: ParsedAgentObject;
|
|
198
|
-
adapter?: {
|
|
199
|
-
kind: string;
|
|
200
|
-
config: Record<string, unknown>;
|
|
201
|
-
};
|
|
202
|
-
langchainAgentParams?: LangChainAgentParams;
|
|
203
|
-
deepAgentParams?: DeepAgentParams;
|
|
204
|
-
harnessRuntime: {
|
|
205
|
-
runRoot: string;
|
|
206
|
-
workspaceRoot?: string;
|
|
207
|
-
modelRefs?: RuntimeModelRefMap;
|
|
208
|
-
models?: RuntimeModelMap;
|
|
209
|
-
capabilities?: RuntimeCapabilities;
|
|
210
|
-
resilience?: Record<string, unknown>;
|
|
211
|
-
checkpointer?: Record<string, unknown> | boolean;
|
|
212
|
-
store?: Record<string, unknown>;
|
|
213
|
-
runtimeMemory?: Record<string, unknown>;
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
export type WorkspaceBundle = {
|
|
217
|
-
workspaceRoot: string;
|
|
218
|
-
resourceSources: string[];
|
|
219
|
-
refs: Map<string, WorkspaceObject | ParsedAgentObject>;
|
|
220
|
-
models: Map<string, ParsedModelObject>;
|
|
221
|
-
embeddings: Map<string, ParsedEmbeddingModelObject>;
|
|
222
|
-
vectorStores: Map<string, ParsedVectorStoreObject>;
|
|
223
|
-
mcpServers: Map<string, ParsedMcpServerObject>;
|
|
224
|
-
tools: Map<string, ParsedToolObject>;
|
|
225
|
-
agents: Map<string, ParsedAgentObject>;
|
|
226
|
-
bindings: Map<string, CompiledAgentBinding>;
|
|
227
|
-
};
|
|
228
|
-
export type WorkspaceLoadOptions = {
|
|
229
|
-
/**
|
|
230
|
-
* Additional workspace roots to load before the runtime workspace root.
|
|
231
|
-
* Merge order is deterministic:
|
|
232
|
-
* framework defaults -> each overlayRoot (in order) -> workspaceRoot.
|
|
233
|
-
* Later values always override earlier values.
|
|
234
|
-
*/
|
|
235
|
-
overlayRoots?: string[];
|
|
236
|
-
resourceSources?: string[];
|
|
237
|
-
};
|
|
238
|
-
export type ThreadSummary = {
|
|
239
|
-
agentId: string;
|
|
240
|
-
threadId: string;
|
|
241
|
-
latestRunId: string;
|
|
242
|
-
createdAt: string;
|
|
243
|
-
updatedAt: string;
|
|
244
|
-
status: RunState;
|
|
245
|
-
};
|
|
246
|
-
export type SessionRecord = ThreadSummary;
|
|
247
|
-
export type KnownHarnessEventType = "run.created" | "run.queued" | "run.dequeued" | "run.state.changed" | "run.reviewed" | "run.resumed" | "approval.requested" | "approval.resolved" | "artifact.created" | "output.delta" | "reasoning.delta" | "runtime.health.changed" | "runtime.synthetic_fallback";
|
|
248
|
-
export type HarnessEventType = KnownHarnessEventType | (string & {});
|
|
249
|
-
export type HarnessEvent = {
|
|
250
|
-
eventId: string;
|
|
251
|
-
eventType: HarnessEventType;
|
|
252
|
-
timestamp: string;
|
|
253
|
-
threadId: string;
|
|
254
|
-
runId: string;
|
|
255
|
-
sequence: number;
|
|
256
|
-
source: "runtime" | "policy" | "surface" | "worker";
|
|
257
|
-
payload: Record<string, unknown>;
|
|
258
|
-
};
|
|
259
|
-
export type HarnessEventListener = (event: HarnessEvent) => void | Promise<void>;
|
|
260
|
-
export type HarnessEventProjection = {
|
|
261
|
-
name?: string;
|
|
262
|
-
shouldHandle?: (event: HarnessEvent) => boolean;
|
|
263
|
-
handleEvent: HarnessEventListener;
|
|
264
|
-
};
|
|
265
|
-
export type RuntimeEventSink = {
|
|
266
|
-
publish: (event: HarnessEvent) => void;
|
|
267
|
-
subscribe: (listener: HarnessEventListener) => () => void;
|
|
268
|
-
registerProjection: (projection: HarnessEventProjection) => () => void;
|
|
269
|
-
};
|
|
270
|
-
export type HealthStatus = "healthy" | "degraded" | "unhealthy";
|
|
271
|
-
export type RuntimeHealthCheck = {
|
|
272
|
-
status: HealthStatus;
|
|
273
|
-
updatedAt: string;
|
|
274
|
-
reason?: string;
|
|
275
|
-
};
|
|
276
|
-
export type RuntimeHealthSymptom = {
|
|
277
|
-
code: string;
|
|
278
|
-
severity: "info" | "warn" | "error";
|
|
279
|
-
message: string;
|
|
280
|
-
firstSeenAt: string;
|
|
281
|
-
lastSeenAt: string;
|
|
282
|
-
};
|
|
283
|
-
export type RuntimeHealthSnapshot = {
|
|
284
|
-
status: HealthStatus;
|
|
285
|
-
updatedAt: string;
|
|
286
|
-
checks: {
|
|
287
|
-
runtime: RuntimeHealthCheck;
|
|
288
|
-
llm: RuntimeHealthCheck;
|
|
289
|
-
persistence: RuntimeHealthCheck;
|
|
290
|
-
capacity: RuntimeHealthCheck;
|
|
291
|
-
workload: RuntimeHealthCheck;
|
|
292
|
-
};
|
|
293
|
-
symptoms: RuntimeHealthSymptom[];
|
|
294
|
-
stats: {
|
|
295
|
-
activeRunSlots: number;
|
|
296
|
-
pendingRunSlots: number;
|
|
297
|
-
pendingApprovals: number;
|
|
298
|
-
stuckRuns: number;
|
|
299
|
-
checkpointBytes?: number;
|
|
300
|
-
runtimeDbBytes?: number;
|
|
301
|
-
artifactBytes?: number;
|
|
302
|
-
llmSuccessRate1m?: number;
|
|
303
|
-
llmP95LatencyMs1m?: number;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
export type RunResult = {
|
|
307
|
-
threadId: string;
|
|
308
|
-
runId: string;
|
|
309
|
-
state: RunState;
|
|
310
|
-
output: string;
|
|
311
|
-
finalMessageText?: string;
|
|
312
|
-
outputContent?: unknown;
|
|
313
|
-
contentBlocks?: unknown[];
|
|
314
|
-
structuredResponse?: unknown;
|
|
315
|
-
interruptContent?: string;
|
|
316
|
-
agentId?: string;
|
|
317
|
-
approvalId?: string;
|
|
318
|
-
pendingActionId?: string;
|
|
319
|
-
delegationId?: string;
|
|
320
|
-
artifacts?: ArtifactRecord[];
|
|
321
|
-
metadata?: Record<string, unknown>;
|
|
322
|
-
};
|
|
323
|
-
export type NormalizedUpstreamEvent = {
|
|
324
|
-
kind: "text-delta";
|
|
325
|
-
source: "model" | "state";
|
|
326
|
-
text: string;
|
|
327
|
-
ns?: string[];
|
|
328
|
-
nodeName?: string;
|
|
329
|
-
} | {
|
|
330
|
-
kind: "reasoning-delta";
|
|
331
|
-
text: string;
|
|
332
|
-
ns?: string[];
|
|
333
|
-
nodeName?: string;
|
|
334
|
-
} | {
|
|
335
|
-
kind: "tool-start";
|
|
336
|
-
toolName: string;
|
|
337
|
-
input?: unknown;
|
|
338
|
-
ns?: string[];
|
|
339
|
-
nodeName?: string;
|
|
340
|
-
} | {
|
|
341
|
-
kind: "tool-end";
|
|
342
|
-
toolName: string;
|
|
343
|
-
output?: unknown;
|
|
344
|
-
isError?: boolean;
|
|
345
|
-
ns?: string[];
|
|
346
|
-
nodeName?: string;
|
|
347
|
-
} | {
|
|
348
|
-
kind: "agent-step";
|
|
349
|
-
label: string;
|
|
350
|
-
ns?: string[];
|
|
351
|
-
nodeName?: string;
|
|
352
|
-
} | {
|
|
353
|
-
kind: "interrupt";
|
|
354
|
-
interrupt: unknown;
|
|
355
|
-
ns?: string[];
|
|
356
|
-
nodeName?: string;
|
|
357
|
-
} | {
|
|
358
|
-
kind: "run-event";
|
|
359
|
-
eventName: string;
|
|
360
|
-
data?: Record<string, unknown>;
|
|
361
|
-
ns?: string[];
|
|
362
|
-
nodeName?: string;
|
|
363
|
-
};
|
|
364
|
-
export type CompatibleStreamPart = {
|
|
365
|
-
type: "messages";
|
|
366
|
-
ns: string[];
|
|
367
|
-
data: [unknown, Record<string, unknown>];
|
|
368
|
-
} | {
|
|
369
|
-
type: "updates";
|
|
370
|
-
ns: string[];
|
|
371
|
-
data: Record<string, unknown>;
|
|
372
|
-
} | {
|
|
373
|
-
type: "custom";
|
|
374
|
-
ns: string[];
|
|
375
|
-
data: unknown;
|
|
376
|
-
};
|
|
377
|
-
export type UpstreamRuntimeEvent = {
|
|
378
|
-
format: "langgraph-v2";
|
|
379
|
-
/** @deprecated Prefer streamPart plus raw/event/name/data/ns for upstream-aligned consumption. */
|
|
380
|
-
normalized: NormalizedUpstreamEvent;
|
|
381
|
-
streamPart: CompatibleStreamPart;
|
|
382
|
-
raw: unknown;
|
|
383
|
-
event?: string;
|
|
384
|
-
name?: string;
|
|
385
|
-
runType?: string;
|
|
386
|
-
data?: Record<string, unknown>;
|
|
387
|
-
metadata?: Record<string, unknown>;
|
|
388
|
-
tags?: string[];
|
|
389
|
-
ns?: string[];
|
|
390
|
-
};
|
|
391
|
-
export type RuntimeListeners = {
|
|
392
|
-
onEvent?: (event: HarnessEvent) => void | Promise<void>;
|
|
393
|
-
};
|
|
394
|
-
export type FrontendStreamListeners = {
|
|
395
|
-
onChunk?: (chunk: string) => void | Promise<void>;
|
|
396
|
-
onContentBlocks?: (blocks: unknown[]) => void | Promise<void>;
|
|
397
|
-
onUpstreamEvent?: (event: UpstreamRuntimeEvent) => void | Promise<void>;
|
|
398
|
-
onReasoning?: (chunk: string) => void | Promise<void>;
|
|
399
|
-
onStep?: (step: string) => void | Promise<void>;
|
|
400
|
-
onToolResult?: (item: {
|
|
401
|
-
toolName: string;
|
|
402
|
-
output: unknown;
|
|
403
|
-
isError?: boolean;
|
|
404
|
-
}) => void | Promise<void>;
|
|
405
|
-
};
|
|
406
|
-
export type RunListeners = RuntimeListeners & FrontendStreamListeners;
|
|
407
|
-
export type MessageContentPart = {
|
|
408
|
-
type: "text";
|
|
409
|
-
text: string;
|
|
410
|
-
} | {
|
|
411
|
-
type: "image_url";
|
|
412
|
-
image_url: string;
|
|
413
|
-
};
|
|
414
|
-
export type MessageContent = string | MessageContentPart[];
|
|
415
|
-
export type InvocationEnvelope = {
|
|
416
|
-
context?: Record<string, unknown>;
|
|
417
|
-
inputs?: Record<string, unknown>;
|
|
418
|
-
attachments?: Record<string, unknown>;
|
|
419
|
-
capabilities?: Record<string, unknown>;
|
|
420
|
-
};
|
|
421
|
-
export type RunStartOptions = {
|
|
422
|
-
agentId?: string;
|
|
423
|
-
input: MessageContent;
|
|
424
|
-
threadId?: string;
|
|
425
|
-
priority?: number;
|
|
426
|
-
invocation?: InvocationEnvelope;
|
|
427
|
-
listeners?: RunListeners;
|
|
428
|
-
runtimeListeners?: RuntimeListeners;
|
|
429
|
-
frontendListeners?: FrontendStreamListeners;
|
|
430
|
-
};
|
|
431
|
-
export type RunDecisionOptions = {
|
|
432
|
-
threadId: string;
|
|
433
|
-
runId?: string;
|
|
434
|
-
approvalId?: string;
|
|
435
|
-
decision: "approve" | "edit" | "reject";
|
|
436
|
-
editedInput?: Record<string, unknown>;
|
|
437
|
-
listeners?: RunListeners;
|
|
438
|
-
runtimeListeners?: RuntimeListeners;
|
|
439
|
-
frontendListeners?: FrontendStreamListeners;
|
|
440
|
-
};
|
|
441
|
-
export type RunOptions = RunStartOptions | RunDecisionOptions;
|
|
442
|
-
export type HarnessStreamItem = {
|
|
443
|
-
type: "event";
|
|
444
|
-
event: HarnessEvent;
|
|
445
|
-
} | {
|
|
446
|
-
type: "upstream-event";
|
|
447
|
-
threadId: string;
|
|
448
|
-
runId: string;
|
|
449
|
-
agentId: string;
|
|
450
|
-
event: UpstreamRuntimeEvent;
|
|
451
|
-
} | {
|
|
452
|
-
type: "result";
|
|
453
|
-
result: RunResult;
|
|
454
|
-
} | {
|
|
455
|
-
type: "content";
|
|
456
|
-
threadId: string;
|
|
457
|
-
runId: string;
|
|
458
|
-
agentId: string;
|
|
459
|
-
content: string;
|
|
460
|
-
} | {
|
|
461
|
-
type: "content-blocks";
|
|
462
|
-
threadId: string;
|
|
463
|
-
runId: string;
|
|
464
|
-
agentId: string;
|
|
465
|
-
contentBlocks: unknown[];
|
|
466
|
-
} | {
|
|
467
|
-
type: "reasoning";
|
|
468
|
-
threadId: string;
|
|
469
|
-
runId: string;
|
|
470
|
-
agentId: string;
|
|
471
|
-
content: string;
|
|
472
|
-
} | {
|
|
473
|
-
type: "step";
|
|
474
|
-
threadId: string;
|
|
475
|
-
runId: string;
|
|
476
|
-
agentId: string;
|
|
477
|
-
content: string;
|
|
478
|
-
} | {
|
|
479
|
-
type: "tool-result";
|
|
480
|
-
threadId: string;
|
|
481
|
-
runId: string;
|
|
482
|
-
agentId: string;
|
|
483
|
-
toolName: string;
|
|
484
|
-
output: unknown;
|
|
485
|
-
isError?: boolean;
|
|
486
|
-
};
|
|
487
|
-
export type TranscriptMessage = {
|
|
488
|
-
role: "user" | "assistant";
|
|
489
|
-
content: MessageContent;
|
|
490
|
-
runId: string;
|
|
491
|
-
createdAt: string;
|
|
492
|
-
};
|
|
493
|
-
export type ThreadRunRecord = {
|
|
494
|
-
runId: string;
|
|
495
|
-
threadId: string;
|
|
496
|
-
agentId: string;
|
|
497
|
-
executionMode: string;
|
|
498
|
-
adapterKind?: string;
|
|
499
|
-
createdAt: string;
|
|
500
|
-
updatedAt: string;
|
|
501
|
-
state: RunState;
|
|
502
|
-
checkpointRef: string | null;
|
|
503
|
-
resumable: boolean;
|
|
504
|
-
};
|
|
505
|
-
export type RunSummary = ThreadRunRecord;
|
|
506
|
-
export type RunRecord = RunSummary;
|
|
507
|
-
export type ThreadRecord = {
|
|
508
|
-
threadId: string;
|
|
509
|
-
entryAgentId: string;
|
|
510
|
-
currentState: RunState;
|
|
511
|
-
latestRunId: string;
|
|
512
|
-
createdAt: string;
|
|
513
|
-
updatedAt: string;
|
|
514
|
-
messages: TranscriptMessage[];
|
|
515
|
-
runs: ThreadRunRecord[];
|
|
516
|
-
pendingDecision?: {
|
|
517
|
-
approvalId: string;
|
|
518
|
-
pendingActionId: string;
|
|
519
|
-
toolName: string;
|
|
520
|
-
allowedDecisions: Array<"approve" | "edit" | "reject">;
|
|
521
|
-
requestedAt: string;
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
export type ResumeOptions = {
|
|
525
|
-
threadId?: string;
|
|
526
|
-
runId?: string;
|
|
527
|
-
approvalId?: string;
|
|
528
|
-
decision?: "approve" | "edit" | "reject";
|
|
529
|
-
editedInput?: Record<string, unknown>;
|
|
530
|
-
};
|
|
531
|
-
export type CancelOptions = {
|
|
532
|
-
runId: string;
|
|
533
|
-
reason?: string;
|
|
534
|
-
};
|
|
535
|
-
export type RestartConversationOptions = {
|
|
536
|
-
threadId: string;
|
|
537
|
-
mode: "restart-in-thread" | "restart-new-thread";
|
|
538
|
-
input: string;
|
|
539
|
-
};
|
|
540
|
-
export type ApprovalRecord = {
|
|
541
|
-
approvalId: string;
|
|
542
|
-
pendingActionId: string;
|
|
543
|
-
threadId: string;
|
|
544
|
-
runId: string;
|
|
545
|
-
toolName: string;
|
|
546
|
-
status: "pending" | "approved" | "edited" | "rejected" | "expired";
|
|
547
|
-
requestedAt: string;
|
|
548
|
-
resolvedAt: string | null;
|
|
549
|
-
allowedDecisions: Array<"approve" | "edit" | "reject">;
|
|
550
|
-
inputPreview: Record<string, unknown>;
|
|
551
|
-
};
|
|
552
|
-
export type InternalApprovalRecord = ApprovalRecord & {
|
|
553
|
-
toolCallId: string;
|
|
554
|
-
checkpointRef: string;
|
|
555
|
-
eventRefs: string[];
|
|
556
|
-
};
|
|
557
|
-
export type DelegationRecord = {
|
|
558
|
-
delegationId: string;
|
|
559
|
-
threadId: string;
|
|
560
|
-
runId: string;
|
|
561
|
-
parentRunId: string;
|
|
562
|
-
specialistAgentId: string;
|
|
563
|
-
specialistName: string;
|
|
564
|
-
specialistDescription: string;
|
|
565
|
-
status: "requested" | "running" | "completed" | "failed" | "cancelled" | "resumable";
|
|
566
|
-
requestedAt: string;
|
|
567
|
-
startedAt: string | null;
|
|
568
|
-
completedAt: string | null;
|
|
569
|
-
checkpointRef: string | null;
|
|
570
|
-
inputArtifactRef: string | null;
|
|
571
|
-
outputArtifactRef: string | null;
|
|
572
|
-
eventRefs: string[];
|
|
573
|
-
};
|
|
574
|
-
export type ArtifactRecord = {
|
|
575
|
-
artifactId: string;
|
|
576
|
-
kind: string;
|
|
577
|
-
path: string;
|
|
578
|
-
createdAt: string;
|
|
579
|
-
};
|
|
580
|
-
export type ArtifactListing = {
|
|
581
|
-
threadId: string;
|
|
582
|
-
runId: string;
|
|
583
|
-
items: ArtifactRecord[];
|
|
584
|
-
};
|
|
585
|
-
export type RuntimeToolResolver = (toolIds: string[], binding?: CompiledAgentBinding) => unknown[];
|
|
586
|
-
export type RuntimeModelResolver = (modelId: string) => unknown;
|
|
587
|
-
export type RuntimeEmbeddingModelResolver = (embeddingModelId: string) => unknown;
|
|
588
|
-
export type RuntimeVectorStoreResolver = (vectorStoreId: string) => unknown;
|
|
589
|
-
export type RuntimeMiddlewareResolver = (binding: CompiledAgentBinding) => unknown[];
|
|
590
|
-
export type RuntimeDeclaredMiddlewareResolver = (input: {
|
|
591
|
-
kind: string;
|
|
592
|
-
config: Record<string, unknown>;
|
|
593
|
-
binding?: CompiledAgentBinding;
|
|
594
|
-
resolveModel: (model: CompiledModel) => Promise<unknown>;
|
|
595
|
-
}) => unknown | unknown[] | null | undefined | Promise<unknown | unknown[] | null | undefined>;
|
|
596
|
-
export type RuntimeCheckpointerResolver = (binding: CompiledAgentBinding) => unknown;
|
|
597
|
-
export type RuntimeStoreResolver = (binding: CompiledAgentBinding) => unknown;
|
|
598
|
-
export type RuntimeBackendResolver = (binding: CompiledAgentBinding) => unknown;
|
|
599
|
-
export type RuntimeAdapterOptions = {
|
|
600
|
-
toolResolver?: RuntimeToolResolver;
|
|
601
|
-
modelResolver?: RuntimeModelResolver;
|
|
602
|
-
embeddingModelResolver?: RuntimeEmbeddingModelResolver;
|
|
603
|
-
vectorStoreResolver?: RuntimeVectorStoreResolver;
|
|
604
|
-
middlewareResolver?: RuntimeMiddlewareResolver;
|
|
605
|
-
declaredMiddlewareResolver?: RuntimeDeclaredMiddlewareResolver;
|
|
606
|
-
checkpointerResolver?: RuntimeCheckpointerResolver;
|
|
607
|
-
storeResolver?: RuntimeStoreResolver;
|
|
608
|
-
backendResolver?: RuntimeBackendResolver;
|
|
609
|
-
};
|
|
610
|
-
export type ToolKindAdapter = {
|
|
611
|
-
type: string;
|
|
612
|
-
validate: (tool: ParsedToolObject, tools: Map<string, ParsedToolObject>) => void;
|
|
613
|
-
compile: (tool: ParsedToolObject, tools: Map<string, ParsedToolObject>) => CompiledTool[];
|
|
614
|
-
};
|
|
615
|
-
export type SkillSourceResolver = {
|
|
616
|
-
kind: string;
|
|
617
|
-
resolve: (input: {
|
|
618
|
-
workspaceRoot: string;
|
|
619
|
-
skill: {
|
|
620
|
-
sourcePathRef: string;
|
|
621
|
-
};
|
|
622
|
-
packagingRoots: string[];
|
|
623
|
-
}) => string[];
|
|
624
|
-
};
|
|
625
|
-
export type SkillInheritancePolicy = {
|
|
626
|
-
kind: string;
|
|
627
|
-
apply: (input: {
|
|
628
|
-
agent: ParsedAgentObject;
|
|
629
|
-
ownSkills: string[];
|
|
630
|
-
parentSkills: string[];
|
|
631
|
-
}) => string[];
|
|
632
|
-
};
|
|
633
|
-
export type SkillPackagingConvention = {
|
|
634
|
-
kind: string;
|
|
635
|
-
resolve: (input: {
|
|
636
|
-
workspaceRoot: string;
|
|
637
|
-
skill: {
|
|
638
|
-
sourcePathRef: string;
|
|
639
|
-
};
|
|
640
|
-
}) => string[];
|
|
641
|
-
};
|
|
642
|
-
export type PolicyDecision = {
|
|
643
|
-
allowed: boolean;
|
|
644
|
-
reasons: string[];
|
|
645
|
-
};
|
|
646
|
-
export type PolicyEvaluator = {
|
|
647
|
-
kind: string;
|
|
648
|
-
evaluate: (binding: CompiledAgentBinding) => PolicyDecision | null;
|
|
649
|
-
};
|
|
650
|
-
export type EventSubscriber = {
|
|
651
|
-
kind: string;
|
|
652
|
-
onEvent: HarnessEventListener;
|
|
653
|
-
};
|
|
1
|
+
export * from "./core.js";
|
|
2
|
+
export * from "./runtime.js";
|
|
3
|
+
export * from "./workspace.js";
|
package/dist/contracts/types.js
CHANGED