@botbotgo/agent-harness 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -10
- package/dist/config/agents/direct.yaml +14 -13
- package/dist/config/agents/orchestra.yaml +20 -19
- package/dist/config/mcp.yaml +20 -0
- package/dist/config/stores.yaml +19 -0
- package/dist/config/tools.yaml +13 -0
- package/dist/config/workspace.yaml +5 -4
- package/dist/contracts/types.d.ts +27 -1
- package/dist/extensions.js +2 -3
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/persistence/file-store.d.ts +8 -6
- package/dist/persistence/file-store.js +2 -0
- package/dist/presentation.d.ts +14 -0
- package/dist/presentation.js +146 -0
- package/dist/runtime/agent-runtime-adapter.d.ts +1 -0
- package/dist/runtime/agent-runtime-adapter.js +62 -42
- package/dist/runtime/harness.d.ts +2 -0
- package/dist/runtime/harness.js +98 -12
- package/dist/runtime/inventory.js +2 -1
- package/dist/runtime/support/compiled-binding.d.ts +15 -0
- package/dist/runtime/support/compiled-binding.js +56 -0
- package/dist/runtime/support/harness-support.d.ts +2 -2
- package/dist/runtime/support/harness-support.js +14 -12
- package/dist/workspace/agent-binding-compiler.js +103 -32
- package/dist/workspace/object-loader.js +56 -5
- package/dist/workspace/support/agent-capabilities.d.ts +9 -0
- package/dist/workspace/support/agent-capabilities.js +41 -0
- package/dist/workspace/validate.js +11 -13
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ What it provides:
|
|
|
15
15
|
|
|
16
16
|
- a small runtime API centered on `createAgentHarness(...)`, `run(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
|
|
17
17
|
- YAML-defined runtime assembly for hosts, models, routing, recovery, concurrency, MCP, and maintenance policy
|
|
18
|
-
-
|
|
18
|
+
- backend-adapted execution with a generic runtime contract and current LangChain v1 / DeepAgents adapters
|
|
19
19
|
- local `resources/tools/` and `resources/skills/` loading
|
|
20
20
|
- persisted runs, threads, approvals, events, and resumable checkpoints
|
|
21
21
|
|
|
@@ -35,6 +35,9 @@ your-workspace/
|
|
|
35
35
|
agent-context.md
|
|
36
36
|
workspace.yaml
|
|
37
37
|
models.yaml
|
|
38
|
+
stores.yaml
|
|
39
|
+
tools.yaml
|
|
40
|
+
mcp.yaml
|
|
38
41
|
agents/
|
|
39
42
|
direct.yaml
|
|
40
43
|
orchestra.yaml
|
|
@@ -66,7 +69,7 @@ try {
|
|
|
66
69
|
## Feature List
|
|
67
70
|
|
|
68
71
|
- Workspace runtime for multi-agent applications
|
|
69
|
-
-
|
|
72
|
+
- Generic runtime contract with backend-adapted execution
|
|
70
73
|
- YAML-defined host routing
|
|
71
74
|
- Auto-discovered local tools and SKILL packages
|
|
72
75
|
- MCP bridge support for agent-declared MCP servers
|
|
@@ -107,13 +110,15 @@ const result = await run(runtime, {
|
|
|
107
110
|
});
|
|
108
111
|
```
|
|
109
112
|
|
|
110
|
-
Each run creates or continues a persisted thread and returns `threadId`, `runId`, `state`, and
|
|
113
|
+
Each run creates or continues a persisted thread and returns `threadId`, `runId`, `state`, and the final user-facing output text.
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
The preferred runtime-facing way to pass execution metadata is `invocation`:
|
|
113
116
|
|
|
114
|
-
- `context`
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
+
- `invocation.context` for request-scoped context
|
|
118
|
+
- `invocation.inputs` for additional structured runtime inputs
|
|
119
|
+
- `invocation.attachments` for attachment-like payloads that the active backend can interpret
|
|
120
|
+
|
|
121
|
+
For compatibility, `context`, `state`, and `files` are still accepted as existing aliases and are normalized into the same runtime invocation envelope.
|
|
117
122
|
|
|
118
123
|
### Let The Runtime Route
|
|
119
124
|
|
|
@@ -161,7 +166,7 @@ const approvals = await listApprovals(runtime, { status: "pending" });
|
|
|
161
166
|
const approval = approvals[0] ? await getApproval(runtime, approvals[0].approvalId) : null;
|
|
162
167
|
```
|
|
163
168
|
|
|
164
|
-
These methods return runtime-facing records, not raw persistence or backend objects.
|
|
169
|
+
These methods return runtime-facing records, not raw persistence or backend checkpoint objects.
|
|
165
170
|
|
|
166
171
|
### Bridge MCP Servers Into Agents
|
|
167
172
|
|
|
@@ -202,6 +207,9 @@ Core workspace files:
|
|
|
202
207
|
- `config/workspace.yaml`
|
|
203
208
|
- `config/agent-context.md`
|
|
204
209
|
- `config/models.yaml`
|
|
210
|
+
- `config/stores.yaml`
|
|
211
|
+
- `config/tools.yaml`
|
|
212
|
+
- `config/mcp.yaml`
|
|
205
213
|
- `config/agents/direct.yaml`
|
|
206
214
|
- `config/agents/orchestra.yaml`
|
|
207
215
|
- `resources/package.json`
|
|
@@ -233,9 +241,26 @@ Put stable project context here. Do not use it as mutable long-term memory.
|
|
|
233
241
|
|
|
234
242
|
### `config/agents/*.yaml`
|
|
235
243
|
|
|
236
|
-
|
|
244
|
+
Prefer the generic agent form and declare the current execution backend explicitly:
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
apiVersion: agent-harness/v1alpha1
|
|
248
|
+
kind: Agent
|
|
249
|
+
metadata:
|
|
250
|
+
name: orchestra
|
|
251
|
+
spec:
|
|
252
|
+
modelRef: model/default
|
|
253
|
+
execution:
|
|
254
|
+
backend: deepagent
|
|
255
|
+
systemPrompt: Coordinate the request.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`kind: DeepAgent` and `kind: LangChainAgent` remain supported as compatibility forms, but `kind: Agent` is the recommended product-facing entry point.
|
|
259
|
+
|
|
260
|
+
Common fields include:
|
|
237
261
|
|
|
238
262
|
- `modelRef`
|
|
263
|
+
- `execution.backend`
|
|
239
264
|
- `systemPrompt`
|
|
240
265
|
- `tools`
|
|
241
266
|
- `skills`
|
|
@@ -262,7 +287,7 @@ Keep runtime extension source under `resources/`. Keep tests outside the publish
|
|
|
262
287
|
|
|
263
288
|
## Design Notes
|
|
264
289
|
|
|
265
|
-
- `agent-harness` should
|
|
290
|
+
- `agent-harness` should keep the public runtime contract generic while mapping cleanly onto current backend capabilities
|
|
266
291
|
- agent-level execution behavior stays upstream
|
|
267
292
|
- application-level orchestration and lifecycle management stays in the harness
|
|
268
293
|
- checkpoint resume is treated as a system-managed runtime behavior, not a primary public abstraction
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
# agent-harness feature: schema version for this declarative config object.
|
|
2
2
|
apiVersion: agent-harness/v1alpha1
|
|
3
3
|
# agent-harness feature: object type discriminator.
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
# rather than the upstream `createDeepAgent(...)` runtime.
|
|
7
|
-
kind: LangChainAgent
|
|
4
|
+
# Prefer the generic `Agent` form and select the concrete execution backend under `spec.execution`.
|
|
5
|
+
kind: Agent
|
|
8
6
|
metadata:
|
|
9
7
|
# agent-harness feature: stable object id used for refs and host-agent selection.
|
|
10
8
|
name: direct
|
|
11
9
|
# agent-harness feature: human-readable summary for inventory and UI.
|
|
12
10
|
description: Manual low-latency host for direct answers and lightweight inventory lookup. Do not use it as the default executor for tool-heavy or specialist-shaped tasks.
|
|
13
11
|
spec:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
12
|
+
execution:
|
|
13
|
+
# Current backend adapter for this host profile.
|
|
14
|
+
backend: langchain-v1
|
|
15
|
+
# =====================
|
|
16
|
+
# Runtime Agent Features
|
|
17
|
+
# =====================
|
|
18
|
+
# Upstream execution feature: model ref for the underlying LLM used by the direct-response agent.
|
|
19
|
+
# This should point at a cheap, fast, general-purpose chat model, because `direct` is intended
|
|
20
|
+
# to be the low-latency path for simple requests.
|
|
20
21
|
modelRef: model/default
|
|
21
|
-
#
|
|
22
|
+
# Runtime execution feature: checkpointer config passed into the selected backend adapter.
|
|
22
23
|
# Even the lightweight direct path can benefit from resumable state during interactive use.
|
|
23
24
|
# Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
|
|
24
25
|
# `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
|
|
25
26
|
checkpointer:
|
|
26
|
-
|
|
27
|
-
#
|
|
27
|
+
ref: checkpointer/default
|
|
28
|
+
# Upstream execution feature: system prompt for the lightweight direct-response host.
|
|
28
29
|
# This prompt should keep the agent focused on:
|
|
29
30
|
# - answering simple requests in one turn
|
|
30
31
|
# - staying lightweight instead of planning or orchestrating
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
# agent-harness feature: schema version for this declarative config object.
|
|
2
2
|
apiVersion: agent-harness/v1alpha1
|
|
3
3
|
# agent-harness feature: object type discriminator.
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
kind: DeepAgent
|
|
4
|
+
# Prefer the generic `Agent` form and select the concrete execution backend under `spec.execution`.
|
|
5
|
+
kind: Agent
|
|
7
6
|
metadata:
|
|
8
|
-
# agent-harness feature: stable object id used for refs and
|
|
7
|
+
# agent-harness feature: stable object id used for refs and runtime naming.
|
|
9
8
|
name: orchestra
|
|
10
9
|
# agent-harness feature: human-readable summary for inventory and UI.
|
|
11
10
|
description: Default execution host. Answer directly when possible, use local tools and skills first, and delegate only when a specialist is a better fit. Not a reflex delegation-only planner.
|
|
12
11
|
spec:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
#
|
|
12
|
+
execution:
|
|
13
|
+
# Current backend adapter for this host profile.
|
|
14
|
+
backend: deepagent
|
|
15
|
+
# =====================
|
|
16
|
+
# Runtime Agent Features
|
|
17
|
+
# =====================
|
|
18
|
+
# Upstream execution feature: model ref for the underlying LLM used by this execution host.
|
|
17
19
|
modelRef: model/default
|
|
18
|
-
#
|
|
20
|
+
# Runtime execution feature: checkpointer config passed into the selected backend adapter.
|
|
19
21
|
# This persists resumable graph state for this agent.
|
|
20
22
|
# Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
|
|
21
23
|
# `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
|
|
22
24
|
checkpointer:
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
+
# ref: checkpointer/sqlite
|
|
26
|
+
ref: checkpointer/default
|
|
25
27
|
memory:
|
|
26
|
-
#
|
|
28
|
+
# Upstream execution feature: bootstrap memory sources supplied to the selected backend at construction time.
|
|
27
29
|
# These paths resolve relative to the workspace root unless they are already absolute.
|
|
28
30
|
# Treat this as agent-owned startup context, not as a dynamic long-term memory sink:
|
|
29
31
|
# - keep `systemPrompt` for stable role, boundaries, and hard behavioral rules
|
|
@@ -33,13 +35,12 @@ spec:
|
|
|
33
35
|
# Updating these files changes future agent constructions, but they are still bootstrap inputs rather than
|
|
34
36
|
# self-updating runtime memory.
|
|
35
37
|
- path: config/agent-context.md
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
+
# Upstream execution feature: store config passed into the selected backend adapter.
|
|
39
|
+
# In the default deepagent adapter this is the LangGraph store used by `StoreBackend` routes.
|
|
38
40
|
# Available `kind` options in this harness: `FileStore`, `InMemoryStore`, `RedisStore`, `PostgresStore`.
|
|
39
41
|
store:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# DeepAgents aligned feature: backend config passed into `createDeepAgent({ backend })`.
|
|
42
|
+
ref: store/default
|
|
43
|
+
# Upstream execution feature: backend config passed into the selected backend adapter.
|
|
43
44
|
# This directly defines the backend topology for this agent:
|
|
44
45
|
# - workspace execution uses a lightweight VFS sandbox
|
|
45
46
|
# - long-term memory under `/memories/*` uses `StoreBackend`
|
|
@@ -57,8 +58,8 @@ spec:
|
|
|
57
58
|
/memories/:
|
|
58
59
|
# Available route backend `kind` options today: `StoreBackend`.
|
|
59
60
|
kind: StoreBackend
|
|
60
|
-
#
|
|
61
|
-
# This becomes the top-level instruction block for the
|
|
61
|
+
# Upstream execution feature: system prompt for the orchestration host.
|
|
62
|
+
# This becomes the top-level instruction block for the selected execution backend and should hold the
|
|
62
63
|
# agent's durable role, priorities, and behavioral guardrails rather than bulky project facts.
|
|
63
64
|
systemPrompt: |-
|
|
64
65
|
You are the orchestra agent.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# agent-harness feature: schema version for reusable MCP server objects.
|
|
2
|
+
apiVersion: agent-harness/v1alpha1
|
|
3
|
+
# This first-layer catalog is the default place to register reusable McpServer objects and MCP-backed Tool objects.
|
|
4
|
+
# Examples:
|
|
5
|
+
# items:
|
|
6
|
+
# - kind: McpServer
|
|
7
|
+
# metadata:
|
|
8
|
+
# name: browser
|
|
9
|
+
# spec:
|
|
10
|
+
# command: node
|
|
11
|
+
# args: ["./mcp-browser-server.mjs"]
|
|
12
|
+
#
|
|
13
|
+
# - kind: Tool
|
|
14
|
+
# metadata:
|
|
15
|
+
# name: browser_navigate
|
|
16
|
+
# spec:
|
|
17
|
+
# mcp:
|
|
18
|
+
# serverRef: mcp/browser
|
|
19
|
+
# tool: navigate
|
|
20
|
+
items: []
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# agent-harness feature: schema version for reusable persistence presets.
|
|
2
|
+
apiVersion: agent-harness/v1alpha1
|
|
3
|
+
items:
|
|
4
|
+
# agent-harness feature: reusable store preset for agent backends that need a durable key-value store.
|
|
5
|
+
- kind: Store
|
|
6
|
+
metadata:
|
|
7
|
+
name: default
|
|
8
|
+
description: Default file-backed store preset for runtime-managed agent state.
|
|
9
|
+
spec:
|
|
10
|
+
storeKind: FileStore
|
|
11
|
+
path: store.json
|
|
12
|
+
|
|
13
|
+
# agent-harness feature: reusable checkpointer preset for resumable execution state.
|
|
14
|
+
- kind: Checkpointer
|
|
15
|
+
metadata:
|
|
16
|
+
name: default
|
|
17
|
+
description: Default in-memory checkpointer preset for lightweight local development.
|
|
18
|
+
spec:
|
|
19
|
+
checkpointerKind: MemorySaver
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# agent-harness feature: schema version for reusable tool objects.
|
|
2
|
+
apiVersion: agent-harness/v1alpha1
|
|
3
|
+
# This first-layer catalog is the default place to register reusable Tool objects that agents can reference.
|
|
4
|
+
# Examples:
|
|
5
|
+
# items:
|
|
6
|
+
# - kind: Tool
|
|
7
|
+
# metadata:
|
|
8
|
+
# name: repo_search
|
|
9
|
+
# description: Workspace-local repo search tool.
|
|
10
|
+
# spec:
|
|
11
|
+
# backend:
|
|
12
|
+
# operation: repo_search
|
|
13
|
+
items: []
|
|
@@ -23,21 +23,22 @@ spec:
|
|
|
23
23
|
runRoot: ./.agent
|
|
24
24
|
|
|
25
25
|
# agent-harness feature: optional host-router prompt override used when the runtime chooses between
|
|
26
|
-
# top-level host agents such as a main
|
|
26
|
+
# top-level host agents such as a main execution host and an optional low-latency side host.
|
|
27
27
|
# Use placeholders so the same prompt can survive host renames:
|
|
28
28
|
# - {{primaryAgentId}}
|
|
29
29
|
# - {{primaryDescription}}
|
|
30
30
|
# - {{secondaryAgentId}}
|
|
31
31
|
# - {{secondaryDescription}}
|
|
32
32
|
routing:
|
|
33
|
-
# agent-harness feature:
|
|
34
|
-
# Best practice is to point this at the main
|
|
33
|
+
# agent-harness feature: default host selected when no explicit routing rule matches.
|
|
34
|
+
# Best practice is to point this at the main execution host and treat lighter agents as explicit opt-in.
|
|
35
35
|
defaultAgentId: orchestra
|
|
36
36
|
# agent-harness feature: optional model-driven host classification fallback.
|
|
37
37
|
# Keep this disabled unless you specifically need host-level model selection.
|
|
38
38
|
modelRouting: false
|
|
39
39
|
# agent-harness feature: ordered host-routing rules evaluated before model-driven classification.
|
|
40
|
-
# These rules only choose which host profile starts the run;
|
|
40
|
+
# These rules only choose which host profile starts the run; the selected backend still owns
|
|
41
|
+
# planning, tools, and long-running execution behavior after routing picks a host.
|
|
41
42
|
# The first matching rule wins. Use this when you want stable routing behavior in YAML instead of code.
|
|
42
43
|
#
|
|
43
44
|
# Supported match fields on each rule:
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export type ExecutionMode = "deepagent" | "langchain-v1";
|
|
2
2
|
export declare const AUTO_AGENT_ID = "auto";
|
|
3
|
+
export type RuntimeCapabilities = {
|
|
4
|
+
delegation?: boolean;
|
|
5
|
+
memory?: boolean;
|
|
6
|
+
};
|
|
3
7
|
export type RunState = "running" | "waiting_for_approval" | "resuming" | "completed" | "failed";
|
|
4
8
|
export type ParsedAgentObject = {
|
|
5
9
|
id: string;
|
|
6
10
|
executionMode: ExecutionMode;
|
|
11
|
+
capabilities?: RuntimeCapabilities;
|
|
7
12
|
description: string;
|
|
8
13
|
modelRef: string;
|
|
9
14
|
runRoot?: string;
|
|
@@ -175,6 +180,10 @@ export type CompiledTool = {
|
|
|
175
180
|
};
|
|
176
181
|
export type CompiledAgentBinding = {
|
|
177
182
|
agent: ParsedAgentObject;
|
|
183
|
+
adapter?: {
|
|
184
|
+
kind: string;
|
|
185
|
+
config: Record<string, unknown>;
|
|
186
|
+
};
|
|
178
187
|
langchainAgentParams?: LangChainAgentParams;
|
|
179
188
|
directAgentParams?: LangChainAgentParams;
|
|
180
189
|
deepAgentParams?: DeepAgentParams;
|
|
@@ -182,6 +191,7 @@ export type CompiledAgentBinding = {
|
|
|
182
191
|
runRoot: string;
|
|
183
192
|
workspaceRoot?: string;
|
|
184
193
|
hostFacing: boolean;
|
|
194
|
+
capabilities?: RuntimeCapabilities;
|
|
185
195
|
checkpointer?: Record<string, unknown> | boolean;
|
|
186
196
|
store?: Record<string, unknown>;
|
|
187
197
|
};
|
|
@@ -239,11 +249,14 @@ export type RunResult = {
|
|
|
239
249
|
runId: string;
|
|
240
250
|
state: RunState;
|
|
241
251
|
output: string;
|
|
252
|
+
finalMessageText?: string;
|
|
242
253
|
interruptContent?: string;
|
|
243
254
|
agentId?: string;
|
|
244
255
|
approvalId?: string;
|
|
245
256
|
pendingActionId?: string;
|
|
246
257
|
delegationId?: string;
|
|
258
|
+
artifacts?: ArtifactRecord[];
|
|
259
|
+
metadata?: Record<string, unknown>;
|
|
247
260
|
};
|
|
248
261
|
export type RunListeners = {
|
|
249
262
|
onChunk?: (chunk: string) => void | Promise<void>;
|
|
@@ -264,10 +277,17 @@ export type MessageContentPart = {
|
|
|
264
277
|
image_url: string;
|
|
265
278
|
};
|
|
266
279
|
export type MessageContent = string | MessageContentPart[];
|
|
280
|
+
export type InvocationEnvelope = {
|
|
281
|
+
context?: Record<string, unknown>;
|
|
282
|
+
inputs?: Record<string, unknown>;
|
|
283
|
+
attachments?: Record<string, unknown>;
|
|
284
|
+
capabilities?: Record<string, unknown>;
|
|
285
|
+
};
|
|
267
286
|
export type RunStartOptions = {
|
|
268
287
|
agentId?: string;
|
|
269
288
|
input: MessageContent;
|
|
270
289
|
threadId?: string;
|
|
290
|
+
invocation?: InvocationEnvelope;
|
|
271
291
|
context?: Record<string, unknown>;
|
|
272
292
|
state?: Record<string, unknown>;
|
|
273
293
|
files?: Record<string, unknown>;
|
|
@@ -285,6 +305,9 @@ export type RunOptions = RunStartOptions | RunDecisionOptions;
|
|
|
285
305
|
export type HarnessStreamItem = {
|
|
286
306
|
type: "event";
|
|
287
307
|
event: HarnessEvent;
|
|
308
|
+
} | {
|
|
309
|
+
type: "result";
|
|
310
|
+
result: RunResult;
|
|
288
311
|
} | {
|
|
289
312
|
type: "content";
|
|
290
313
|
threadId: string;
|
|
@@ -322,6 +345,7 @@ export type ThreadRunRecord = {
|
|
|
322
345
|
runId: string;
|
|
323
346
|
agentId: string;
|
|
324
347
|
executionMode: string;
|
|
348
|
+
adapterKind?: string;
|
|
325
349
|
createdAt: string;
|
|
326
350
|
updatedAt: string;
|
|
327
351
|
state: RunState;
|
|
@@ -362,13 +386,15 @@ export type ApprovalRecord = {
|
|
|
362
386
|
pendingActionId: string;
|
|
363
387
|
threadId: string;
|
|
364
388
|
runId: string;
|
|
365
|
-
toolCallId: string;
|
|
366
389
|
toolName: string;
|
|
367
390
|
status: "pending" | "approved" | "edited" | "rejected" | "expired";
|
|
368
391
|
requestedAt: string;
|
|
369
392
|
resolvedAt: string | null;
|
|
370
393
|
allowedDecisions: Array<"approve" | "edit" | "reject">;
|
|
371
394
|
inputPreview: Record<string, unknown>;
|
|
395
|
+
};
|
|
396
|
+
export type InternalApprovalRecord = ApprovalRecord & {
|
|
397
|
+
toolCallId: string;
|
|
372
398
|
checkpointRef: string;
|
|
373
399
|
eventRefs: string[];
|
|
374
400
|
};
|
package/dist/extensions.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { defaultResourceSkillsRoot } from "./resource/resource.js";
|
|
3
3
|
import { isExternalSourceLocator, resolveExternalResourcePath } from "./resource/sources.js";
|
|
4
|
+
import { hasAgentSystemPrompt } from "./workspace/support/agent-capabilities.js";
|
|
4
5
|
const toolKindAdapters = new Map();
|
|
5
6
|
const skillSourceResolvers = new Map();
|
|
6
7
|
const skillInheritancePolicies = new Map();
|
|
@@ -231,9 +232,7 @@ registerSkillSourceResolver({
|
|
|
231
232
|
registerSkillInheritancePolicy({
|
|
232
233
|
kind: "default",
|
|
233
234
|
apply({ agent, ownSkills, parentSkills }) {
|
|
234
|
-
|
|
235
|
-
const hasSystemPrompt = typeof systemPrompt === "string" && systemPrompt.trim().length > 0;
|
|
236
|
-
if (hasSystemPrompt && agent.id.includes(".")) {
|
|
235
|
+
if (hasAgentSystemPrompt(agent) && agent.id.includes(".")) {
|
|
237
236
|
return ownSkills;
|
|
238
237
|
}
|
|
239
238
|
return Array.from(new Set([...parentSkills, ...ownSkills]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.43";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.43";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ArtifactListing, ArtifactRecord, DelegationRecord, HarnessEvent, InternalApprovalRecord, RunState, ThreadSummary, ThreadRunRecord, TranscriptMessage } from "../contracts/types.js";
|
|
2
2
|
type ThreadMeta = {
|
|
3
3
|
threadId: string;
|
|
4
4
|
workspaceId: string;
|
|
@@ -13,6 +13,7 @@ type RunMeta = {
|
|
|
13
13
|
threadId: string;
|
|
14
14
|
agentId: string;
|
|
15
15
|
executionMode: string;
|
|
16
|
+
adapterKind?: string;
|
|
16
17
|
createdAt: string;
|
|
17
18
|
updatedAt: string;
|
|
18
19
|
};
|
|
@@ -56,6 +57,7 @@ export declare class FilePersistence {
|
|
|
56
57
|
runId: string;
|
|
57
58
|
agentId: string;
|
|
58
59
|
executionMode: string;
|
|
60
|
+
adapterKind?: string;
|
|
59
61
|
createdAt: string;
|
|
60
62
|
}): Promise<void>;
|
|
61
63
|
setRunState(threadId: string, runId: string, state: RunState, checkpointRef?: string | null): Promise<void>;
|
|
@@ -66,14 +68,14 @@ export declare class FilePersistence {
|
|
|
66
68
|
getThreadMeta(threadId: string): Promise<ThreadMeta | null>;
|
|
67
69
|
listThreadRuns(threadId: string): Promise<ThreadRunRecord[]>;
|
|
68
70
|
listRunEvents(threadId: string, runId: string): Promise<HarnessEvent[]>;
|
|
69
|
-
listApprovals(): Promise<
|
|
70
|
-
getApproval(approvalId: string): Promise<
|
|
71
|
-
getRunApprovals(threadId: string, runId: string): Promise<
|
|
71
|
+
listApprovals(): Promise<InternalApprovalRecord[]>;
|
|
72
|
+
getApproval(approvalId: string): Promise<InternalApprovalRecord | null>;
|
|
73
|
+
getRunApprovals(threadId: string, runId: string): Promise<InternalApprovalRecord[]>;
|
|
72
74
|
getRunMeta(threadId: string, runId: string): Promise<RunMeta>;
|
|
73
75
|
getRunLifecycle(threadId: string, runId: string): Promise<Lifecycle>;
|
|
74
76
|
listDelegations(): Promise<DelegationRecord[]>;
|
|
75
|
-
createApproval(record:
|
|
76
|
-
resolveApproval(threadId: string, runId: string, approvalId: string, status:
|
|
77
|
+
createApproval(record: InternalApprovalRecord): Promise<void>;
|
|
78
|
+
resolveApproval(threadId: string, runId: string, approvalId: string, status: InternalApprovalRecord["status"]): Promise<InternalApprovalRecord>;
|
|
77
79
|
createDelegation(record: DelegationRecord): Promise<void>;
|
|
78
80
|
updateDelegation(threadId: string, runId: string, delegationId: string, patch: Partial<DelegationRecord>): Promise<DelegationRecord>;
|
|
79
81
|
createArtifact(threadId: string, runId: string, artifact: ArtifactRecord, content: unknown): Promise<ArtifactRecord>;
|
|
@@ -54,6 +54,7 @@ export class FilePersistence {
|
|
|
54
54
|
threadId: input.threadId,
|
|
55
55
|
agentId: input.agentId,
|
|
56
56
|
executionMode: input.executionMode,
|
|
57
|
+
adapterKind: input.adapterKind ?? input.executionMode,
|
|
57
58
|
createdAt: input.createdAt,
|
|
58
59
|
updatedAt: input.createdAt,
|
|
59
60
|
};
|
|
@@ -218,6 +219,7 @@ export class FilePersistence {
|
|
|
218
219
|
runId: meta.runId,
|
|
219
220
|
agentId: meta.agentId,
|
|
220
221
|
executionMode: meta.executionMode,
|
|
222
|
+
adapterKind: meta.adapterKind ?? meta.executionMode,
|
|
221
223
|
createdAt: meta.createdAt,
|
|
222
224
|
updatedAt: meta.updatedAt,
|
|
223
225
|
state: lifecycle.state,
|
package/dist/presentation.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export declare function escapeHtml(value: string): string;
|
|
2
|
+
/** CSS class for anchors that should open in the host app embedded browser (Wallee). */
|
|
3
|
+
export declare const WALLEE_OUTPUT_LINK_CLASS = "wallee-output-link";
|
|
4
|
+
/** `data-wallee-url` — target URL for the embedded browser (http/https only). */
|
|
5
|
+
export declare const WALLEE_BROWSER_URL_ATTR = "data-wallee-url";
|
|
6
|
+
export declare function isAllowedWalleeBrowserUrl(url: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Escape plain text and wrap http(s) URLs in Wallee output anchors (open in host embedded browser).
|
|
9
|
+
*/
|
|
10
|
+
export declare function linkifyPlainTextForWalleeBrowser(text: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Like {@link markdownToHtml} but inline http(s) URLs and markdown links `[label](https://…)` render as
|
|
13
|
+
* Wallee embedded-browser anchors (`wallee-output-link` + `data-wallee-url`).
|
|
14
|
+
*/
|
|
15
|
+
export declare function markdownToWalleeOutputHtml(markdown: string): string;
|
|
2
16
|
export declare function markdownToHtml(markdown: string): string;
|
|
3
17
|
export declare function markdownToConsole(markdown: string): string;
|
|
4
18
|
export declare function renderTemplate(data: Record<string, unknown>, template: string): string;
|