@botbotgo/agent-harness 0.0.95 → 0.0.97

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.
Files changed (114) hide show
  1. package/README.md +1 -114
  2. package/README.zh.md +1 -70
  3. package/dist/api.d.ts +5 -5
  4. package/dist/config/workflows/langgraph-workflows.yaml +363 -111
  5. package/dist/config/workflows/runtime-profiles.yaml +94 -0
  6. package/dist/contracts/core.d.ts +9 -0
  7. package/dist/contracts/core.js +1 -0
  8. package/dist/contracts/runtime.d.ts +421 -0
  9. package/dist/contracts/runtime.js +1 -0
  10. package/dist/contracts/types.d.ts +3 -571
  11. package/dist/contracts/types.js +3 -1
  12. package/dist/contracts/workspace.d.ts +229 -0
  13. package/dist/contracts/workspace.js +1 -0
  14. package/dist/package-version.d.ts +1 -1
  15. package/dist/package-version.js +1 -1
  16. package/dist/runtime/adapter/compat/deepagent-compat.d.ts +16 -0
  17. package/dist/runtime/adapter/compat/deepagent-compat.js +45 -0
  18. package/dist/runtime/adapter/compat/openai-compatible.d.ts +2 -0
  19. package/dist/runtime/adapter/compat/openai-compatible.js +43 -0
  20. package/dist/runtime/adapter/index.d.ts +15 -0
  21. package/dist/runtime/adapter/index.js +15 -0
  22. package/dist/runtime/adapter/langgraph/presets.js +165 -0
  23. package/dist/runtime/{langgraph-profiles.d.ts → adapter/langgraph/profiles.d.ts} +1 -1
  24. package/dist/runtime/adapter/langgraph/profiles.js +206 -0
  25. package/dist/runtime/adapter/model/invocation-request.d.ts +10 -0
  26. package/dist/runtime/adapter/model/invocation-request.js +46 -0
  27. package/dist/runtime/adapter/model/message-assembly.d.ts +6 -0
  28. package/dist/runtime/adapter/model/message-assembly.js +21 -0
  29. package/dist/runtime/adapter/model/model-providers.d.ts +2 -0
  30. package/dist/runtime/adapter/model/model-providers.js +27 -0
  31. package/dist/runtime/adapter/resilience.d.ts +12 -0
  32. package/dist/runtime/adapter/resilience.js +60 -0
  33. package/dist/runtime/{declared-middleware.d.ts → adapter/tool/declared-middleware.d.ts} +1 -1
  34. package/dist/runtime/adapter/tool/interrupt-policy.d.ts +8 -0
  35. package/dist/runtime/adapter/tool/interrupt-policy.js +34 -0
  36. package/dist/runtime/adapter/tool/provider-tool.d.ts +2 -0
  37. package/dist/runtime/adapter/tool/provider-tool.js +25 -0
  38. package/dist/runtime/adapter/tool/resolved-tool.d.ts +18 -0
  39. package/dist/runtime/adapter/tool/resolved-tool.js +62 -0
  40. package/dist/runtime/adapter/tool/tool-arguments.d.ts +7 -0
  41. package/dist/runtime/adapter/tool/tool-arguments.js +87 -0
  42. package/dist/runtime/{tool-hitl.d.ts → adapter/tool/tool-hitl.d.ts} +2 -2
  43. package/dist/runtime/adapter/tool/tool-name-mapping.d.ts +13 -0
  44. package/dist/runtime/adapter/tool/tool-name-mapping.js +101 -0
  45. package/dist/runtime/agent-runtime-adapter.d.ts +5 -20
  46. package/dist/runtime/agent-runtime-adapter.js +42 -544
  47. package/dist/runtime/checkpoint-maintenance.d.ts +1 -45
  48. package/dist/runtime/checkpoint-maintenance.js +1 -259
  49. package/dist/runtime/file-checkpoint-saver.d.ts +1 -20
  50. package/dist/runtime/file-checkpoint-saver.js +1 -106
  51. package/dist/runtime/{event-bus.d.ts → harness/events/event-bus.d.ts} +1 -1
  52. package/dist/runtime/{event-sink.d.ts → harness/events/event-sink.d.ts} +1 -1
  53. package/dist/runtime/{event-sink.js → harness/events/event-sink.js} +1 -1
  54. package/dist/runtime/harness/events/events.d.ts +23 -0
  55. package/dist/runtime/harness/events/events.js +61 -0
  56. package/dist/runtime/harness/events/streaming.d.ts +19 -0
  57. package/dist/runtime/harness/events/streaming.js +96 -0
  58. package/dist/runtime/harness/index.d.ts +16 -0
  59. package/dist/runtime/harness/index.js +16 -0
  60. package/dist/runtime/harness/run/helpers.d.ts +33 -0
  61. package/dist/runtime/harness/run/helpers.js +74 -0
  62. package/dist/runtime/harness/run/resources.d.ts +7 -0
  63. package/dist/runtime/harness/run/resources.js +58 -0
  64. package/dist/runtime/harness/run/resume.d.ts +6 -0
  65. package/dist/runtime/harness/run/resume.js +56 -0
  66. package/dist/runtime/harness/run/routing.d.ts +12 -0
  67. package/dist/runtime/harness/run/routing.js +47 -0
  68. package/dist/runtime/harness/run/run-lifecycle.d.ts +37 -0
  69. package/dist/runtime/harness/run/run-lifecycle.js +109 -0
  70. package/dist/runtime/harness/run/run-queue.d.ts +17 -0
  71. package/dist/runtime/harness/run/run-queue.js +43 -0
  72. package/dist/runtime/{health-monitor.d.ts → harness/system/health-monitor.d.ts} +3 -3
  73. package/dist/runtime/{health-monitor.js → harness/system/health-monitor.js} +2 -2
  74. package/dist/runtime/{inventory.d.ts → harness/system/inventory.d.ts} +2 -2
  75. package/dist/runtime/{inventory.js → harness/system/inventory.js} +4 -4
  76. package/dist/runtime/{policy-engine.d.ts → harness/system/policy-engine.d.ts} +1 -1
  77. package/dist/runtime/{policy-engine.js → harness/system/policy-engine.js} +1 -1
  78. package/dist/runtime/{skill-requirements.d.ts → harness/system/skill-requirements.d.ts} +1 -1
  79. package/dist/runtime/{skill-requirements.js → harness/system/skill-requirements.js} +1 -1
  80. package/dist/runtime/{thread-memory-sync.d.ts → harness/system/thread-memory-sync.d.ts} +2 -2
  81. package/dist/runtime/{thread-memory-sync.js → harness/system/thread-memory-sync.js} +1 -1
  82. package/dist/runtime/harness.d.ts +2 -7
  83. package/dist/runtime/harness.js +158 -477
  84. package/dist/runtime/index.d.ts +7 -7
  85. package/dist/runtime/index.js +7 -7
  86. package/dist/runtime/maintenance/checkpoint-maintenance.d.ts +45 -0
  87. package/dist/runtime/maintenance/checkpoint-maintenance.js +259 -0
  88. package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +20 -0
  89. package/dist/runtime/maintenance/file-checkpoint-saver.js +106 -0
  90. package/dist/runtime/maintenance/index.d.ts +4 -0
  91. package/dist/runtime/maintenance/index.js +4 -0
  92. package/dist/runtime/{runtime-record-maintenance.d.ts → maintenance/runtime-record-maintenance.d.ts} +1 -1
  93. package/dist/runtime/{runtime-record-maintenance.js → maintenance/runtime-record-maintenance.js} +2 -2
  94. package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.d.ts +9 -0
  95. package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.js +39 -0
  96. package/dist/runtime/parsing/stream-event-parsing.d.ts +6 -0
  97. package/dist/runtime/parsing/stream-event-parsing.js +231 -0
  98. package/dist/runtime/sqlite-maintained-checkpoint-saver.d.ts +1 -9
  99. package/dist/runtime/sqlite-maintained-checkpoint-saver.js +1 -39
  100. package/dist/runtime/support/harness-support.d.ts +4 -4
  101. package/dist/runtime/support/harness-support.js +14 -3
  102. package/dist/runtime/support/runtime-factories.d.ts +1 -1
  103. package/dist/runtime/support/runtime-factories.js +1 -1
  104. package/dist/workspace/agent-binding-compiler.js +39 -3
  105. package/dist/workspace/object-loader.js +5 -1
  106. package/package.json +4 -4
  107. package/dist/runtime/langgraph-presets.js +0 -165
  108. package/dist/runtime/langgraph-profiles.js +0 -206
  109. /package/dist/runtime/{langgraph-presets.d.ts → adapter/langgraph/presets.d.ts} +0 -0
  110. /package/dist/runtime/{declared-middleware.js → adapter/tool/declared-middleware.js} +0 -0
  111. /package/dist/runtime/{tool-hitl.js → adapter/tool/tool-hitl.js} +0 -0
  112. /package/dist/runtime/{event-bus.js → harness/events/event-bus.js} +0 -0
  113. /package/dist/runtime/{store.d.ts → harness/system/store.d.ts} +0 -0
  114. /package/dist/runtime/{store.js → harness/system/store.js} +0 -0
@@ -0,0 +1,94 @@
1
+ # agent-harness feature: schema version for this declarative config object.
2
+ apiVersion: agent-harness/v1alpha1
3
+ # agent-harness feature: catalog of reusable runtime entry profiles layered on workflow resources.
4
+ kind: RuntimeProfiles
5
+ spec:
6
+ - id: coding-runtime
7
+ workflowRef: langgraph-workflow/coding-loop
8
+ defaults:
9
+ approvalPolicy: safe-default
10
+ memoryPolicy: project-facts-only
11
+ directAnswerFirst: false
12
+ watchGithubActionsAfterPush: true
13
+ allowPushToMaster: false
14
+ closeGithubIssueOnSuccess: false
15
+ requiredAgents:
16
+ - coderAgent
17
+ optionalAgents:
18
+ - verifierAgent
19
+ - id: personal-assistant
20
+ workflowRef: langgraph-workflow/assistant-loop
21
+ defaults:
22
+ approvalPolicy: human-before-side-effects
23
+ memoryPolicy: user-preferences-and-routines
24
+ directAnswerFirst: true
25
+ persistDurableMemory: true
26
+ optionalAgents:
27
+ - defaultResearchAgent
28
+ - defaultWritingAgent
29
+ - defaultSchedulingAgent
30
+ - defaultWorkerAgent
31
+ - id: research-runtime
32
+ workflowRef: langgraph-workflow/research-loop
33
+ defaults:
34
+ approvalPolicy: minimal
35
+ memoryPolicy: report-summary-only
36
+ requireSourceGrounding: true
37
+ requireCoverageReview: true
38
+ requiredAgents:
39
+ - gathererAgent
40
+ - analystAgent
41
+ optionalAgents:
42
+ - synthesizerAgent
43
+ - id: approval-review-runtime
44
+ workflowRef: langgraph-workflow/approval-review-loop
45
+ defaults:
46
+ approvalPolicy: always-required
47
+ memoryPolicy: none
48
+ executeAfterApproval: true
49
+ auditTrail: full
50
+ requiredAgents:
51
+ - preparerAgent
52
+ optionalAgents:
53
+ - reviewerAgent
54
+ - id: claw-style-assistant
55
+ workflowRef: langgraph-workflow/assistant-loop
56
+ defaults:
57
+ approvalPolicy: human-before-side-effects
58
+ memoryPolicy: user-preferences-and-stable-context
59
+ channelFirst: true
60
+ attachmentAware: true
61
+ sessionMemory: thread-scoped
62
+ optionalAgents:
63
+ - defaultWorkerAgent
64
+ - id: chat-operator
65
+ workflowRef: langgraph-workflow/chat-router-loop
66
+ defaults:
67
+ approvalPolicy: route-dependent
68
+ memoryPolicy: thread-only
69
+ directAnswerFirst: true
70
+ optionalAgents:
71
+ - codingAgent
72
+ - researchAgent
73
+ - assistantAgent
74
+ - approvalAgent
75
+ - id: copilot-sidecar
76
+ workflowRef: langgraph-workflow/coding-lite-loop
77
+ defaults:
78
+ approvalPolicy: no-push
79
+ memoryPolicy: repo-context-only
80
+ directAnswerFirst: false
81
+ allowRepositoryEdits: true
82
+ allowPushToMaster: false
83
+ runIntegrationVerification: false
84
+ requiredAgents:
85
+ - coderAgent
86
+ - id: task-delegation-hub
87
+ workflowRef: langgraph-workflow/delegation-loop
88
+ defaults:
89
+ approvalPolicy: worker-dependent
90
+ memoryPolicy: task-summary-only
91
+ routingStrategy: planner-first
92
+ reviewerEnabled: true
93
+ optionalAgents:
94
+ - defaultWorkerFallback
@@ -0,0 +1,9 @@
1
+ export type ExecutionMode = "deepagent" | "langchain-v1" | "langgraph";
2
+ export declare const AUTO_AGENT_ID = "auto";
3
+ export type RuntimeModelSlot = "routing" | "planning" | "execution" | "review" | "final";
4
+ export type RuntimeModelRefMap = Partial<Record<RuntimeModelSlot, string>>;
5
+ export type RuntimeCapabilities = {
6
+ delegation?: boolean;
7
+ memory?: boolean;
8
+ };
9
+ export type RunState = "queued" | "claimed" | "running" | "waiting_for_approval" | "resuming" | "cancelling" | "cancelled" | "completed" | "failed";
@@ -0,0 +1 @@
1
+ export const AUTO_AGENT_ID = "auto";
@@ -0,0 +1,421 @@
1
+ import type { RunState } from "./core.js";
2
+ import type { CompiledAgentBinding, CompiledModel, CompiledTool, ParsedAgentObject, ParsedToolObject, WorkspaceBundle } from "./workspace.js";
3
+ export type ThreadSummary = {
4
+ agentId: string;
5
+ threadId: string;
6
+ latestRunId: string;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ status: RunState;
10
+ };
11
+ export type SessionRecord = ThreadSummary;
12
+ 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";
13
+ export type HarnessEventType = KnownHarnessEventType | (string & {});
14
+ export type HarnessEvent = {
15
+ eventId: string;
16
+ eventType: HarnessEventType;
17
+ timestamp: string;
18
+ threadId: string;
19
+ runId: string;
20
+ sequence: number;
21
+ source: "runtime" | "policy" | "surface" | "worker";
22
+ payload: Record<string, unknown>;
23
+ };
24
+ export type HarnessEventListener = (event: HarnessEvent) => void | Promise<void>;
25
+ export type HarnessEventProjection = {
26
+ name?: string;
27
+ shouldHandle?: (event: HarnessEvent) => boolean;
28
+ handleEvent: HarnessEventListener;
29
+ };
30
+ export type RuntimeEventSink = {
31
+ publish: (event: HarnessEvent) => void;
32
+ subscribe: (listener: HarnessEventListener) => () => void;
33
+ registerProjection: (projection: HarnessEventProjection) => () => void;
34
+ };
35
+ export type HealthStatus = "healthy" | "degraded" | "unhealthy";
36
+ export type RuntimeHealthCheck = {
37
+ status: HealthStatus;
38
+ updatedAt: string;
39
+ reason?: string;
40
+ };
41
+ export type RuntimeHealthSymptom = {
42
+ code: string;
43
+ severity: "info" | "warn" | "error";
44
+ message: string;
45
+ firstSeenAt: string;
46
+ lastSeenAt: string;
47
+ };
48
+ export type RuntimeHealthSnapshot = {
49
+ status: HealthStatus;
50
+ updatedAt: string;
51
+ checks: {
52
+ runtime: RuntimeHealthCheck;
53
+ llm: RuntimeHealthCheck;
54
+ persistence: RuntimeHealthCheck;
55
+ capacity: RuntimeHealthCheck;
56
+ workload: RuntimeHealthCheck;
57
+ };
58
+ symptoms: RuntimeHealthSymptom[];
59
+ stats: {
60
+ activeRunSlots: number;
61
+ pendingRunSlots: number;
62
+ pendingApprovals: number;
63
+ stuckRuns: number;
64
+ checkpointBytes?: number;
65
+ runtimeDbBytes?: number;
66
+ artifactBytes?: number;
67
+ llmSuccessRate1m?: number;
68
+ llmP95LatencyMs1m?: number;
69
+ };
70
+ };
71
+ export type RunResult = {
72
+ threadId: string;
73
+ runId: string;
74
+ state: RunState;
75
+ output: string;
76
+ finalMessageText?: string;
77
+ outputContent?: unknown;
78
+ contentBlocks?: unknown[];
79
+ structuredResponse?: unknown;
80
+ interruptContent?: string;
81
+ agentId?: string;
82
+ approvalId?: string;
83
+ pendingActionId?: string;
84
+ delegationId?: string;
85
+ artifacts?: ArtifactRecord[];
86
+ metadata?: Record<string, unknown>;
87
+ };
88
+ export type NormalizedUpstreamEvent = {
89
+ kind: "text-delta";
90
+ source: "model" | "state";
91
+ text: string;
92
+ ns?: string[];
93
+ nodeName?: string;
94
+ } | {
95
+ kind: "reasoning-delta";
96
+ text: string;
97
+ ns?: string[];
98
+ nodeName?: string;
99
+ } | {
100
+ kind: "tool-start";
101
+ toolName: string;
102
+ input?: unknown;
103
+ ns?: string[];
104
+ nodeName?: string;
105
+ } | {
106
+ kind: "tool-end";
107
+ toolName: string;
108
+ output?: unknown;
109
+ isError?: boolean;
110
+ ns?: string[];
111
+ nodeName?: string;
112
+ } | {
113
+ kind: "agent-step";
114
+ label: string;
115
+ ns?: string[];
116
+ nodeName?: string;
117
+ } | {
118
+ kind: "interrupt";
119
+ interrupt: unknown;
120
+ ns?: string[];
121
+ nodeName?: string;
122
+ } | {
123
+ kind: "run-event";
124
+ eventName: string;
125
+ data?: Record<string, unknown>;
126
+ ns?: string[];
127
+ nodeName?: string;
128
+ };
129
+ export type CompatibleStreamPart = {
130
+ type: "messages";
131
+ ns: string[];
132
+ data: [unknown, Record<string, unknown>];
133
+ } | {
134
+ type: "updates";
135
+ ns: string[];
136
+ data: Record<string, unknown>;
137
+ } | {
138
+ type: "custom";
139
+ ns: string[];
140
+ data: unknown;
141
+ };
142
+ export type UpstreamRuntimeEvent = {
143
+ format: "langgraph-v2";
144
+ /** @deprecated Prefer streamPart plus raw/event/name/data/ns for upstream-aligned consumption. */
145
+ normalized: NormalizedUpstreamEvent;
146
+ streamPart: CompatibleStreamPart;
147
+ raw: unknown;
148
+ event?: string;
149
+ name?: string;
150
+ runType?: string;
151
+ data?: Record<string, unknown>;
152
+ metadata?: Record<string, unknown>;
153
+ tags?: string[];
154
+ ns?: string[];
155
+ };
156
+ export type RuntimeListeners = {
157
+ onEvent?: (event: HarnessEvent) => void | Promise<void>;
158
+ };
159
+ export type FrontendStreamListeners = {
160
+ onChunk?: (chunk: string) => void | Promise<void>;
161
+ onContentBlocks?: (blocks: unknown[]) => void | Promise<void>;
162
+ onUpstreamEvent?: (event: UpstreamRuntimeEvent) => void | Promise<void>;
163
+ onReasoning?: (chunk: string) => void | Promise<void>;
164
+ onStep?: (step: string) => void | Promise<void>;
165
+ onToolResult?: (item: {
166
+ toolName: string;
167
+ output: unknown;
168
+ isError?: boolean;
169
+ }) => void | Promise<void>;
170
+ };
171
+ export type RunListeners = RuntimeListeners & FrontendStreamListeners;
172
+ export type MessageContentPart = {
173
+ type: "text";
174
+ text: string;
175
+ } | {
176
+ type: "image_url";
177
+ image_url: string;
178
+ };
179
+ export type MessageContent = string | MessageContentPart[];
180
+ export type InvocationEnvelope = {
181
+ context?: Record<string, unknown>;
182
+ inputs?: Record<string, unknown>;
183
+ attachments?: Record<string, unknown>;
184
+ capabilities?: Record<string, unknown>;
185
+ };
186
+ export type RunStartOptions = {
187
+ agentId?: string;
188
+ input: MessageContent;
189
+ threadId?: string;
190
+ priority?: number;
191
+ invocation?: InvocationEnvelope;
192
+ listeners?: RunListeners;
193
+ runtimeListeners?: RuntimeListeners;
194
+ frontendListeners?: FrontendStreamListeners;
195
+ };
196
+ export type RunDecisionOptions = {
197
+ threadId: string;
198
+ runId?: string;
199
+ approvalId?: string;
200
+ decision: "approve" | "edit" | "reject";
201
+ editedInput?: Record<string, unknown>;
202
+ listeners?: RunListeners;
203
+ runtimeListeners?: RuntimeListeners;
204
+ frontendListeners?: FrontendStreamListeners;
205
+ };
206
+ export type RunOptions = RunStartOptions | RunDecisionOptions;
207
+ export type HarnessStreamItem = {
208
+ type: "event";
209
+ event: HarnessEvent;
210
+ } | {
211
+ type: "upstream-event";
212
+ threadId: string;
213
+ runId: string;
214
+ agentId: string;
215
+ event: UpstreamRuntimeEvent;
216
+ } | {
217
+ type: "result";
218
+ result: RunResult;
219
+ } | {
220
+ type: "content";
221
+ threadId: string;
222
+ runId: string;
223
+ agentId: string;
224
+ content: string;
225
+ } | {
226
+ type: "content-blocks";
227
+ threadId: string;
228
+ runId: string;
229
+ agentId: string;
230
+ contentBlocks: unknown[];
231
+ } | {
232
+ type: "reasoning";
233
+ threadId: string;
234
+ runId: string;
235
+ agentId: string;
236
+ content: string;
237
+ } | {
238
+ type: "step";
239
+ threadId: string;
240
+ runId: string;
241
+ agentId: string;
242
+ content: string;
243
+ } | {
244
+ type: "tool-result";
245
+ threadId: string;
246
+ runId: string;
247
+ agentId: string;
248
+ toolName: string;
249
+ output: unknown;
250
+ isError?: boolean;
251
+ };
252
+ export type TranscriptMessage = {
253
+ role: "user" | "assistant";
254
+ content: MessageContent;
255
+ runId: string;
256
+ createdAt: string;
257
+ };
258
+ export type ThreadRunRecord = {
259
+ runId: string;
260
+ threadId: string;
261
+ agentId: string;
262
+ executionMode: string;
263
+ adapterKind?: string;
264
+ createdAt: string;
265
+ updatedAt: string;
266
+ state: RunState;
267
+ checkpointRef: string | null;
268
+ resumable: boolean;
269
+ };
270
+ export type RunSummary = ThreadRunRecord;
271
+ export type RunRecord = RunSummary;
272
+ export type ThreadRecord = {
273
+ threadId: string;
274
+ entryAgentId: string;
275
+ currentState: RunState;
276
+ latestRunId: string;
277
+ createdAt: string;
278
+ updatedAt: string;
279
+ messages: TranscriptMessage[];
280
+ runs: ThreadRunRecord[];
281
+ pendingDecision?: {
282
+ approvalId: string;
283
+ pendingActionId: string;
284
+ toolName: string;
285
+ allowedDecisions: Array<"approve" | "edit" | "reject">;
286
+ requestedAt: string;
287
+ };
288
+ };
289
+ export type ResumeOptions = {
290
+ threadId?: string;
291
+ runId?: string;
292
+ approvalId?: string;
293
+ decision?: "approve" | "edit" | "reject";
294
+ editedInput?: Record<string, unknown>;
295
+ };
296
+ export type CancelOptions = {
297
+ runId: string;
298
+ reason?: string;
299
+ };
300
+ export type RestartConversationOptions = {
301
+ threadId: string;
302
+ mode: "restart-in-thread" | "restart-new-thread";
303
+ input: string;
304
+ };
305
+ export type ApprovalRecord = {
306
+ approvalId: string;
307
+ pendingActionId: string;
308
+ threadId: string;
309
+ runId: string;
310
+ toolName: string;
311
+ status: "pending" | "approved" | "edited" | "rejected" | "expired";
312
+ requestedAt: string;
313
+ resolvedAt: string | null;
314
+ allowedDecisions: Array<"approve" | "edit" | "reject">;
315
+ inputPreview: Record<string, unknown>;
316
+ };
317
+ export type InternalApprovalRecord = ApprovalRecord & {
318
+ toolCallId: string;
319
+ checkpointRef: string;
320
+ eventRefs: string[];
321
+ };
322
+ export type DelegationRecord = {
323
+ delegationId: string;
324
+ threadId: string;
325
+ runId: string;
326
+ parentRunId: string;
327
+ specialistAgentId: string;
328
+ specialistName: string;
329
+ specialistDescription: string;
330
+ status: "requested" | "running" | "completed" | "failed" | "cancelled" | "resumable";
331
+ requestedAt: string;
332
+ startedAt: string | null;
333
+ completedAt: string | null;
334
+ checkpointRef: string | null;
335
+ inputArtifactRef: string | null;
336
+ outputArtifactRef: string | null;
337
+ eventRefs: string[];
338
+ };
339
+ export type ArtifactRecord = {
340
+ artifactId: string;
341
+ kind: string;
342
+ path: string;
343
+ createdAt: string;
344
+ };
345
+ export type ArtifactListing = {
346
+ threadId: string;
347
+ runId: string;
348
+ items: ArtifactRecord[];
349
+ };
350
+ export type RuntimeToolResolver = (toolIds: string[], binding?: CompiledAgentBinding) => unknown[];
351
+ export type RuntimeModelResolver = (modelId: string) => unknown;
352
+ export type RuntimeEmbeddingModelResolver = (embeddingModelId: string) => unknown;
353
+ export type RuntimeVectorStoreResolver = (vectorStoreId: string) => unknown;
354
+ export type RuntimeMiddlewareResolver = (binding: CompiledAgentBinding) => unknown[];
355
+ export type RuntimeDeclaredMiddlewareResolver = (input: {
356
+ kind: string;
357
+ config: Record<string, unknown>;
358
+ binding?: CompiledAgentBinding;
359
+ resolveModel: (model: CompiledModel) => Promise<unknown>;
360
+ }) => unknown | unknown[] | null | undefined | Promise<unknown | unknown[] | null | undefined>;
361
+ export type RuntimeCheckpointerResolver = (binding: CompiledAgentBinding) => unknown;
362
+ export type RuntimeStoreResolver = (binding: CompiledAgentBinding) => unknown;
363
+ export type RuntimeBackendResolver = (binding: CompiledAgentBinding) => unknown;
364
+ export type RuntimeAdapterOptions = {
365
+ toolResolver?: RuntimeToolResolver;
366
+ modelResolver?: RuntimeModelResolver;
367
+ embeddingModelResolver?: RuntimeEmbeddingModelResolver;
368
+ vectorStoreResolver?: RuntimeVectorStoreResolver;
369
+ middlewareResolver?: RuntimeMiddlewareResolver;
370
+ declaredMiddlewareResolver?: RuntimeDeclaredMiddlewareResolver;
371
+ checkpointerResolver?: RuntimeCheckpointerResolver;
372
+ storeResolver?: RuntimeStoreResolver;
373
+ backendResolver?: RuntimeBackendResolver;
374
+ };
375
+ export type ToolKindAdapter = {
376
+ type: string;
377
+ validate: (tool: ParsedToolObject, tools: Map<string, ParsedToolObject>) => void;
378
+ compile: (tool: ParsedToolObject, tools: Map<string, ParsedToolObject>) => CompiledTool[];
379
+ };
380
+ export type SkillSourceResolver = {
381
+ kind: string;
382
+ resolve: (input: {
383
+ workspaceRoot: string;
384
+ skill: {
385
+ sourcePathRef: string;
386
+ };
387
+ packagingRoots: string[];
388
+ }) => string[];
389
+ };
390
+ export type SkillInheritancePolicy = {
391
+ kind: string;
392
+ apply: (input: {
393
+ agent: ParsedAgentObject;
394
+ ownSkills: string[];
395
+ parentSkills: string[];
396
+ }) => string[];
397
+ };
398
+ export type SkillPackagingConvention = {
399
+ kind: string;
400
+ resolve: (input: {
401
+ workspaceRoot: string;
402
+ skill: {
403
+ sourcePathRef: string;
404
+ };
405
+ }) => string[];
406
+ };
407
+ export type PolicyDecision = {
408
+ allowed: boolean;
409
+ reasons: string[];
410
+ };
411
+ export type PolicyEvaluator = {
412
+ kind: string;
413
+ evaluate: (binding: CompiledAgentBinding) => PolicyDecision | null;
414
+ };
415
+ export type EventSubscriber = {
416
+ kind: string;
417
+ onEvent: HarnessEventListener;
418
+ };
419
+ export type RuntimeInventoryContext = {
420
+ workspace: WorkspaceBundle;
421
+ };
@@ -0,0 +1 @@
1
+ export {};