@revealui/harnesses 0.1.7 → 0.1.9
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/LICENSE +104 -17
- package/README.md +6 -6
- package/dist/{chunk-DGUM43GV.js → chunk-3RG5ZIWI.js} +0 -1
- package/dist/chunk-ANX4L2PF.js +651 -0
- package/dist/{chunk-JG6CAG4A.js → chunk-Y4FFO3TO.js} +29 -8
- package/dist/chunk-YYAYTCRM.js +3016 -0
- package/dist/{chunk-XXEKWC6F.js → chunk-ZNIQELKZ.js} +189 -345
- package/dist/cli.js +44 -9
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +2 -3
- package/dist/index-w5ashbfb.d.ts +266 -0
- package/dist/index.d.ts +770 -85
- package/dist/index.js +39 -10
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +9 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +0 -1
- package/dist/workboard/index.d.ts +26 -14
- package/dist/workboard/index.js +2 -3
- package/package.json +30 -7
- package/LICENSE.commercial +0 -111
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-JG6CAG4A.js.map +0 -1
- package/dist/chunk-XLIKSLM3.js +0 -1105
- package/dist/chunk-XLIKSLM3.js.map +0 -1
- package/dist/chunk-XXEKWC6F.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/content/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/workboard/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,61 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfigDiffEntry, ConfigSyncDirection, ConfigSyncResult, HarnessAdapter, HealthCheckResult, HarnessProcessInfo, HarnessEvent } from './types/index.js';
|
|
2
|
+
export { HarnessCapabilities, HarnessCommand, HarnessCommandResult, HarnessInfo } from './types/index.js';
|
|
2
3
|
export { Agent, Command, ContentGenerator, ContentSummary, DiffEntry, GeneratedFile, Manifest, PreambleTier, ResolverContext, Rule, Skill, ValidationResult, buildManifest, diffContent, generateContent, listContent, validateManifest } from './content/index.js';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import 'zod';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
* Claude Code communicates via its CLI. Config lives at
|
|
11
|
-
* ~/.claude/settings.json and project-level .claude/settings.json.
|
|
12
|
-
* MCP integration is handled separately by @revealui/mcp.
|
|
13
|
-
*
|
|
14
|
-
* Workboard read/write requires REVEALUI_WORKBOARD_PATH to be set to the
|
|
15
|
-
* absolute path of the workboard.md file.
|
|
16
|
-
*/
|
|
17
|
-
declare class ClaudeCodeAdapter implements HarnessAdapter {
|
|
18
|
-
readonly id = "claude-code";
|
|
19
|
-
readonly name = "Claude Code";
|
|
20
|
-
private readonly eventHandlers;
|
|
21
|
-
private readonly workboardPath;
|
|
22
|
-
constructor(workboardPath?: string);
|
|
23
|
-
getCapabilities(): HarnessCapabilities;
|
|
24
|
-
getInfo(): Promise<HarnessInfo>;
|
|
25
|
-
isAvailable(): Promise<boolean>;
|
|
26
|
-
notifyRegistered(): void;
|
|
27
|
-
notifyUnregistering(): void;
|
|
28
|
-
execute(command: HarnessCommand): Promise<HarnessCommandResult>;
|
|
29
|
-
private executeInner;
|
|
30
|
-
onEvent(handler: (event: HarnessEvent) => void): () => void;
|
|
31
|
-
dispose(): Promise<void>;
|
|
32
|
-
private emit;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Adapter for Cursor IDE.
|
|
37
|
-
*
|
|
38
|
-
* Cursor is a VS Code fork with built-in AI capabilities.
|
|
39
|
-
* This adapter detects Cursor via `cursor --version` and provides
|
|
40
|
-
* workboard read/write when REVEALUI_WORKBOARD_PATH is set.
|
|
41
|
-
*/
|
|
42
|
-
declare class CursorAdapter implements HarnessAdapter {
|
|
43
|
-
readonly id = "cursor";
|
|
44
|
-
readonly name = "Cursor";
|
|
45
|
-
private readonly eventHandlers;
|
|
46
|
-
private readonly workboardPath;
|
|
47
|
-
constructor(workboardPath?: string);
|
|
48
|
-
getCapabilities(): HarnessCapabilities;
|
|
49
|
-
getInfo(): Promise<HarnessInfo>;
|
|
50
|
-
isAvailable(): Promise<boolean>;
|
|
51
|
-
notifyRegistered(): void;
|
|
52
|
-
notifyUnregistering(): void;
|
|
53
|
-
execute(command: HarnessCommand): Promise<HarnessCommandResult>;
|
|
54
|
-
private executeInner;
|
|
55
|
-
onEvent(handler: (event: HarnessEvent) => void): () => void;
|
|
56
|
-
dispose(): Promise<void>;
|
|
57
|
-
private emit;
|
|
58
|
-
}
|
|
4
|
+
import { D as DaemonStore, M as MergeRequest } from './index-w5ashbfb.js';
|
|
5
|
+
export { A as AgentMessage, a as AgentSession, b as AgentTask, c as DaemonEvent, d as DaemonStoreConfig, F as FileReservation, S as SCHEMA_SQL } from './index-w5ashbfb.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { EventEmitter } from 'node:events';
|
|
8
|
+
import { WorkboardManager, WorkboardState } from './workboard/index.js';
|
|
9
|
+
export { ConflictResult, SessionType, WorkboardEntry, WorkboardSession, acquireLock, atomicWriteSync, deriveSessionId, detectSessionType, lockPathFor, releaseLock, withLock, withLockAsync } from './workboard/index.js';
|
|
59
10
|
|
|
60
11
|
/**
|
|
61
12
|
* Syncs harness config between local filesystem and root backup.
|
|
@@ -107,6 +58,519 @@ declare class HarnessRegistry {
|
|
|
107
58
|
disposeAll(): Promise<void>;
|
|
108
59
|
}
|
|
109
60
|
|
|
61
|
+
/**
|
|
62
|
+
* CIFeedback - Layer 4 of the Autonomous Agent Architecture.
|
|
63
|
+
*
|
|
64
|
+
* Receives CI results (posted by GitHub Actions via the daemon's HTTP gateway),
|
|
65
|
+
* and routes them back to agents:
|
|
66
|
+
* - Green: mark merge request as merged, complete the linked task
|
|
67
|
+
* - Red: parse the failure category, create a fix task, assign back
|
|
68
|
+
* to the originating agent (up to MAX_RETRIES), then escalate
|
|
69
|
+
*
|
|
70
|
+
* The CI workflow posts to `POST /rpc` with method `ci.report`.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
interface CIReportParams {
|
|
74
|
+
/** PR number the CI ran on. */
|
|
75
|
+
prNumber?: number;
|
|
76
|
+
/** Branch name the CI ran on (fallback lookup if prNumber missing). */
|
|
77
|
+
branch?: string;
|
|
78
|
+
/** Whether CI passed. */
|
|
79
|
+
success: boolean;
|
|
80
|
+
/** Raw CI output (truncated to 10KB by the caller). */
|
|
81
|
+
output?: string;
|
|
82
|
+
/** GitHub Actions run URL for reference. */
|
|
83
|
+
runUrl?: string;
|
|
84
|
+
/** Which CI job failed (e.g., 'quality', 'typecheck', 'test-unit', 'build'). */
|
|
85
|
+
failedJob?: string;
|
|
86
|
+
}
|
|
87
|
+
interface CIFeedbackResult {
|
|
88
|
+
action: 'merged' | 'fix_task_created' | 'escalated' | 'no_merge_request' | 'error';
|
|
89
|
+
mergeRequestId?: string;
|
|
90
|
+
taskId?: string;
|
|
91
|
+
retryCount?: number;
|
|
92
|
+
error?: string;
|
|
93
|
+
}
|
|
94
|
+
declare class CIFeedback {
|
|
95
|
+
private readonly store;
|
|
96
|
+
constructor(store: DaemonStore);
|
|
97
|
+
/**
|
|
98
|
+
* Handle a CI report. Called when GitHub Actions posts results
|
|
99
|
+
* to the daemon HTTP gateway.
|
|
100
|
+
*/
|
|
101
|
+
report(params: CIReportParams): Promise<CIFeedbackResult>;
|
|
102
|
+
private handleSuccess;
|
|
103
|
+
private handleFailure;
|
|
104
|
+
/** Escalate to human after max retries. */
|
|
105
|
+
private escalate;
|
|
106
|
+
/** Find the merge request associated with this CI run. */
|
|
107
|
+
private findMergeRequest;
|
|
108
|
+
/** Categorize the CI failure from the job name or output. */
|
|
109
|
+
private categorizeFailure;
|
|
110
|
+
/** Build a descriptive fix task for the agent. */
|
|
111
|
+
private buildFixTaskDescription;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* MergePipeline - Layer 3 of the Autonomous Agent Architecture.
|
|
116
|
+
*
|
|
117
|
+
* Watches task completions, diffs agent worktree branches, attempts
|
|
118
|
+
* fast-forward merges into a staging branch, and creates PRs to `test`.
|
|
119
|
+
*
|
|
120
|
+
* Conflict detection notifies conflicting agents via the messaging system.
|
|
121
|
+
* Merges are ordered by the workspace dependency graph (topological sort).
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
interface MergePipelineConfig {
|
|
125
|
+
/** Absolute path to the repo root. */
|
|
126
|
+
repoRoot: string;
|
|
127
|
+
/** Default base branch for PRs (default: 'test'). */
|
|
128
|
+
baseBranch?: string;
|
|
129
|
+
/** GitHub remote name (default: 'origin'). */
|
|
130
|
+
remote?: string;
|
|
131
|
+
}
|
|
132
|
+
interface MergeResult {
|
|
133
|
+
mergeRequestId: string;
|
|
134
|
+
status: MergeRequest['status'];
|
|
135
|
+
prUrl?: string;
|
|
136
|
+
prNumber?: number;
|
|
137
|
+
error?: string;
|
|
138
|
+
conflictingFiles?: string[];
|
|
139
|
+
}
|
|
140
|
+
declare class MergePipeline {
|
|
141
|
+
private readonly store;
|
|
142
|
+
private readonly repoRoot;
|
|
143
|
+
private readonly baseBranch;
|
|
144
|
+
private readonly remote;
|
|
145
|
+
constructor(store: DaemonStore, config: MergePipelineConfig);
|
|
146
|
+
/**
|
|
147
|
+
* Request a merge for an agent's branch into the base branch.
|
|
148
|
+
* Creates a merge_request record and attempts the merge.
|
|
149
|
+
*/
|
|
150
|
+
requestMerge(params: {
|
|
151
|
+
agentId: string;
|
|
152
|
+
sourceBranch: string;
|
|
153
|
+
taskId?: string;
|
|
154
|
+
baseBranch?: string;
|
|
155
|
+
}): Promise<MergeResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Process a pending merge request: fetch, check for conflicts,
|
|
158
|
+
* fast-forward merge, and create a PR.
|
|
159
|
+
*/
|
|
160
|
+
processMerge(mergeId: string): Promise<MergeResult>;
|
|
161
|
+
/** Get the current status of a merge request. */
|
|
162
|
+
getStatus(mergeId: string): Promise<MergeResult>;
|
|
163
|
+
/** Retry a failed or conflicted merge request. */
|
|
164
|
+
resolve(mergeId: string): Promise<MergeResult>;
|
|
165
|
+
/** List all active (non-terminal) merge requests. */
|
|
166
|
+
listActive(): Promise<MergeRequest[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Get the workspace dependency order for merge sequencing.
|
|
169
|
+
* Packages that are dependencies of others should merge first.
|
|
170
|
+
*/
|
|
171
|
+
getDependencyOrder(): Promise<string[]>;
|
|
172
|
+
/** Run a git command in the repo root. */
|
|
173
|
+
private git;
|
|
174
|
+
/**
|
|
175
|
+
* Check whether source branch merges cleanly into base branch.
|
|
176
|
+
* Uses `git merge-tree` (available in Git 2.38+) for a tree-only check
|
|
177
|
+
* that doesn't touch the working directory.
|
|
178
|
+
*/
|
|
179
|
+
private checkConflicts;
|
|
180
|
+
/** Notify conflicting agents via the messaging system. */
|
|
181
|
+
private handleConflict;
|
|
182
|
+
/** Create a GitHub PR using the `gh` CLI. */
|
|
183
|
+
private createPR;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* VAUGHN Capability Model (Section 4 of VAUGHN.md)
|
|
188
|
+
*
|
|
189
|
+
* Defines the full superset of capabilities an adapter can declare.
|
|
190
|
+
* Adapters degrade gracefully when a tool lacks a feature.
|
|
191
|
+
*/
|
|
192
|
+
/** Available sandbox isolation modes. */
|
|
193
|
+
type SandboxMode = 'read-only' | 'workspace-write' | 'full-access';
|
|
194
|
+
/** Hook granularity levels. */
|
|
195
|
+
type HookGranularity = 'none' | 'bash-only' | 'all-tools';
|
|
196
|
+
/** Memory backend types. */
|
|
197
|
+
type MemoryBackend = 'none' | 'sqlite' | 'crdt' | 'file';
|
|
198
|
+
/**
|
|
199
|
+
* Full capability declaration for a VAUGHN adapter.
|
|
200
|
+
* Each adapter declares this statically at registration time.
|
|
201
|
+
*/
|
|
202
|
+
interface VaughnCapabilities {
|
|
203
|
+
/** Dispatch operations: can the adapter programmatically invoke these? */
|
|
204
|
+
dispatch: {
|
|
205
|
+
/** Adapter can send a prompt and get code back */
|
|
206
|
+
generateCode: boolean;
|
|
207
|
+
/** Adapter can request code analysis */
|
|
208
|
+
analyzeCode: boolean;
|
|
209
|
+
/** Adapter can send a diff to apply */
|
|
210
|
+
applyEdit: boolean;
|
|
211
|
+
/** Adapter can invoke shell commands */
|
|
212
|
+
executeCommand: boolean;
|
|
213
|
+
};
|
|
214
|
+
/** Coordination capabilities */
|
|
215
|
+
readWorkboard: boolean;
|
|
216
|
+
writeWorkboard: boolean;
|
|
217
|
+
claimTasks: boolean;
|
|
218
|
+
reportConflicts: boolean;
|
|
219
|
+
/** Lifecycle capabilities */
|
|
220
|
+
headless: boolean;
|
|
221
|
+
resumable: boolean;
|
|
222
|
+
forkable: boolean;
|
|
223
|
+
backgroundable: boolean;
|
|
224
|
+
/** Safety: hook system */
|
|
225
|
+
hooks: {
|
|
226
|
+
supported: boolean;
|
|
227
|
+
granularity: HookGranularity;
|
|
228
|
+
canBlock: boolean;
|
|
229
|
+
};
|
|
230
|
+
/** Safety: OS-level sandboxing */
|
|
231
|
+
sandbox: {
|
|
232
|
+
supported: boolean;
|
|
233
|
+
modes: SandboxMode[];
|
|
234
|
+
writablePaths?: string[];
|
|
235
|
+
};
|
|
236
|
+
supportsWorktrees: boolean;
|
|
237
|
+
/** Context capabilities */
|
|
238
|
+
supportsSkills: boolean;
|
|
239
|
+
supportsMcp: boolean;
|
|
240
|
+
memory: {
|
|
241
|
+
supported: boolean;
|
|
242
|
+
backend: MemoryBackend;
|
|
243
|
+
};
|
|
244
|
+
maxContextTokens: number;
|
|
245
|
+
/** Which lifecycle events the tool emits natively */
|
|
246
|
+
lifecycleEvents: string[];
|
|
247
|
+
}
|
|
248
|
+
/** Creates a default capabilities object with all features disabled. */
|
|
249
|
+
declare function createDefaultCapabilities(): VaughnCapabilities;
|
|
250
|
+
/**
|
|
251
|
+
* Known capability profiles for supported tools (Section 4.2).
|
|
252
|
+
* These are reference profiles; actual adapters may override.
|
|
253
|
+
*/
|
|
254
|
+
declare const TOOL_PROFILES: Record<string, VaughnCapabilities>;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* VAUGHN Lifecycle Events (Section 5 of VAUGHN.md)
|
|
258
|
+
*
|
|
259
|
+
* Defines the 10 canonical lifecycle events, the event envelope,
|
|
260
|
+
* Zod schemas for runtime validation, and a factory function.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
/** Protocol version. */
|
|
264
|
+
declare const VAUGHN_VERSION: "0.1.0";
|
|
265
|
+
/** The 10 canonical VAUGHN lifecycle events. */
|
|
266
|
+
type VaughnEvent = 'session.start' | 'session.stop' | 'session.crash' | 'prompt.submit' | 'tool.before' | 'tool.after' | 'tool.blocked' | 'task.claimed' | 'task.completed' | 'agent.heartbeat';
|
|
267
|
+
/** All valid event names as a readonly array. */
|
|
268
|
+
declare const VAUGHN_EVENTS: readonly VaughnEvent[];
|
|
269
|
+
/** Standard envelope wrapping every VAUGHN event (Section 5.4). */
|
|
270
|
+
interface VaughnEventEnvelope {
|
|
271
|
+
version: typeof VAUGHN_VERSION;
|
|
272
|
+
event: VaughnEvent;
|
|
273
|
+
timestamp: string;
|
|
274
|
+
agentId: string;
|
|
275
|
+
toolName: string;
|
|
276
|
+
sessionId: string;
|
|
277
|
+
payload: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
/** Zod schema for runtime validation of event envelopes. */
|
|
280
|
+
declare const vaughnEventSchema: z.ZodEnum<{
|
|
281
|
+
"session.start": "session.start";
|
|
282
|
+
"session.stop": "session.stop";
|
|
283
|
+
"prompt.submit": "prompt.submit";
|
|
284
|
+
"tool.before": "tool.before";
|
|
285
|
+
"tool.after": "tool.after";
|
|
286
|
+
"tool.blocked": "tool.blocked";
|
|
287
|
+
"session.crash": "session.crash";
|
|
288
|
+
"task.claimed": "task.claimed";
|
|
289
|
+
"task.completed": "task.completed";
|
|
290
|
+
"agent.heartbeat": "agent.heartbeat";
|
|
291
|
+
}>;
|
|
292
|
+
declare const vaughnEventEnvelopeSchema: z.ZodObject<{
|
|
293
|
+
version: z.ZodLiteral<"0.1.0">;
|
|
294
|
+
event: z.ZodEnum<{
|
|
295
|
+
"session.start": "session.start";
|
|
296
|
+
"session.stop": "session.stop";
|
|
297
|
+
"prompt.submit": "prompt.submit";
|
|
298
|
+
"tool.before": "tool.before";
|
|
299
|
+
"tool.after": "tool.after";
|
|
300
|
+
"tool.blocked": "tool.blocked";
|
|
301
|
+
"session.crash": "session.crash";
|
|
302
|
+
"task.claimed": "task.claimed";
|
|
303
|
+
"task.completed": "task.completed";
|
|
304
|
+
"agent.heartbeat": "agent.heartbeat";
|
|
305
|
+
}>;
|
|
306
|
+
timestamp: z.ZodString;
|
|
307
|
+
agentId: z.ZodString;
|
|
308
|
+
toolName: z.ZodString;
|
|
309
|
+
sessionId: z.ZodString;
|
|
310
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
/** Creates a VaughnEventEnvelope with the current timestamp. */
|
|
313
|
+
declare function createEventEnvelope(event: VaughnEvent, agentId: string, toolName: string, sessionId: string, payload?: Record<string, unknown>): VaughnEventEnvelope;
|
|
314
|
+
|
|
315
|
+
interface OllamaStatus {
|
|
316
|
+
installed: boolean;
|
|
317
|
+
running: boolean;
|
|
318
|
+
version: string | null;
|
|
319
|
+
}
|
|
320
|
+
interface OllamaModel {
|
|
321
|
+
name: string;
|
|
322
|
+
size: string;
|
|
323
|
+
modified: string;
|
|
324
|
+
}
|
|
325
|
+
interface ModelPullResult {
|
|
326
|
+
success: boolean;
|
|
327
|
+
message: string;
|
|
328
|
+
}
|
|
329
|
+
interface SnapStatus {
|
|
330
|
+
installed: boolean;
|
|
331
|
+
running: boolean;
|
|
332
|
+
snapName: string;
|
|
333
|
+
endpoint: string | null;
|
|
334
|
+
version: string | null;
|
|
335
|
+
}
|
|
336
|
+
interface SnapModel {
|
|
337
|
+
name: string;
|
|
338
|
+
description: string;
|
|
339
|
+
installed: boolean;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Manages local inference engines (Ollama, Snaps) on the daemon host.
|
|
343
|
+
* Each method mirrors the equivalent Tauri command from `inference.rs`.
|
|
344
|
+
*/
|
|
345
|
+
declare class InferenceService {
|
|
346
|
+
ollamaStatus(): Promise<OllamaStatus>;
|
|
347
|
+
ollamaModels(): Promise<OllamaModel[]>;
|
|
348
|
+
ollamaPull(modelName: string): Promise<ModelPullResult>;
|
|
349
|
+
ollamaDelete(modelName: string): Promise<void>;
|
|
350
|
+
ollamaStart(): Promise<void>;
|
|
351
|
+
ollamaStop(): Promise<void>;
|
|
352
|
+
snapList(): Promise<SnapModel[]>;
|
|
353
|
+
snapStatus(snapName: string): Promise<SnapStatus>;
|
|
354
|
+
snapInstall(snapName: string): Promise<ModelPullResult>;
|
|
355
|
+
snapRemove(snapName: string): Promise<void>;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
type AgentBackend = 'Snap' | 'Ollama';
|
|
359
|
+
interface AgentSessionInfo {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
model: string;
|
|
363
|
+
backend: AgentBackend;
|
|
364
|
+
prompt: string;
|
|
365
|
+
status: 'running' | 'stopped' | 'errored';
|
|
366
|
+
pid: number | null;
|
|
367
|
+
}
|
|
368
|
+
interface SpawnerConfig {
|
|
369
|
+
/** Inference snap OpenAI-compatible endpoint (default: http://localhost:9090) */
|
|
370
|
+
snapEndpoint: string;
|
|
371
|
+
/** Max concurrent agent sessions (default: 8) */
|
|
372
|
+
maxSessions: number;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Manages agent process lifecycle on the daemon host.
|
|
376
|
+
*
|
|
377
|
+
* Emits:
|
|
378
|
+
* 'output' → AgentOutputEvent (each stdout/stderr line)
|
|
379
|
+
* 'exit' → AgentExitEvent (process termination)
|
|
380
|
+
*/
|
|
381
|
+
declare class SpawnerService extends EventEmitter {
|
|
382
|
+
private readonly sessions;
|
|
383
|
+
private readonly config;
|
|
384
|
+
constructor(overrides?: Partial<SpawnerConfig>);
|
|
385
|
+
/** Spawn a new agent process. Returns the session ID. */
|
|
386
|
+
spawn(name: string, backend: AgentBackend, model: string, prompt: string): string;
|
|
387
|
+
/** Stop a running agent by killing its process. */
|
|
388
|
+
stop(sessionId: string): void;
|
|
389
|
+
/** List all agent sessions. */
|
|
390
|
+
list(): AgentSessionInfo[];
|
|
391
|
+
/** Remove a stopped/errored session. */
|
|
392
|
+
remove(sessionId: string): void;
|
|
393
|
+
/** Kill all running agents (called on daemon shutdown). */
|
|
394
|
+
stopAll(): void;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
interface JsonRpcResponse {
|
|
398
|
+
jsonrpc: '2.0';
|
|
399
|
+
id: number | string | null;
|
|
400
|
+
result?: unknown;
|
|
401
|
+
error?: {
|
|
402
|
+
code: number;
|
|
403
|
+
message: string;
|
|
404
|
+
data?: unknown;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* JSON-RPC 2.0 server over a Unix domain socket.
|
|
409
|
+
* Mirrors RpcServer from packages/editors.
|
|
410
|
+
*
|
|
411
|
+
* Methods:
|
|
412
|
+
* ping → { status: 'ok', pid }
|
|
413
|
+
* harness.list → HarnessInfo[]
|
|
414
|
+
* harness.execute → HarnessCommandResult
|
|
415
|
+
* harness.info → HarnessInfo
|
|
416
|
+
* harness.listRunning → HarnessProcessInfo[]
|
|
417
|
+
* harness.syncConfig → ConfigSyncResult
|
|
418
|
+
* harness.diffConfig → ConfigDiffEntry
|
|
419
|
+
* harness.health → HealthCheckResult
|
|
420
|
+
* session.register → AgentSession
|
|
421
|
+
* session.update → AgentSession
|
|
422
|
+
* session.end → { ok: true }
|
|
423
|
+
* session.list → AgentSession[]
|
|
424
|
+
* session.history → AgentSession[]
|
|
425
|
+
* mail.send → AgentMessage
|
|
426
|
+
* mail.broadcast → { sent: number }
|
|
427
|
+
* mail.inbox → AgentMessage[]
|
|
428
|
+
* mail.markRead → { ok: true }
|
|
429
|
+
* files.reserve → { success, holder? }
|
|
430
|
+
* files.check → FileReservation | null
|
|
431
|
+
* files.release → { released: number }
|
|
432
|
+
* files.list → FileReservation[]
|
|
433
|
+
* tasks.create → AgentTask
|
|
434
|
+
* tasks.claim → { success, owner? }
|
|
435
|
+
* tasks.complete → { ok: boolean }
|
|
436
|
+
* tasks.release → { ok: boolean }
|
|
437
|
+
* tasks.list → AgentTask[]
|
|
438
|
+
* events.log → DaemonEvent
|
|
439
|
+
* events.recent → DaemonEvent[]
|
|
440
|
+
* agent.spawn → { sessionId: string }
|
|
441
|
+
* agent.stop → { ok: true }
|
|
442
|
+
* agent.list → AgentSessionInfo[]
|
|
443
|
+
* agent.remove → { ok: true }
|
|
444
|
+
* agent.input → { ok: true }
|
|
445
|
+
* agent.resize → { ok: true }
|
|
446
|
+
* inference.ollama.status → OllamaStatus
|
|
447
|
+
* inference.ollama.models → OllamaModel[]
|
|
448
|
+
* inference.ollama.pull → ModelPullResult
|
|
449
|
+
* inference.ollama.delete → { ok: true }
|
|
450
|
+
* inference.ollama.start → { ok: true }
|
|
451
|
+
* inference.ollama.stop → { ok: true }
|
|
452
|
+
* inference.snap.list → SnapModel[]
|
|
453
|
+
* inference.snap.status → SnapStatus
|
|
454
|
+
* inference.snap.install → ModelPullResult
|
|
455
|
+
* inference.snap.remove → { ok: true }
|
|
456
|
+
* merge.request → MergeResult
|
|
457
|
+
* merge.status → MergeResult
|
|
458
|
+
* merge.resolve → MergeResult
|
|
459
|
+
* merge.list → MergeRequest[]
|
|
460
|
+
* ci.report → CIFeedbackResult
|
|
461
|
+
* vaughn.capabilities → VaughnAdapterCapability[]
|
|
462
|
+
* vaughn.dispatch → { adapterId: string | null }
|
|
463
|
+
* vaughn.events → VaughnEventEnvelope[]
|
|
464
|
+
* vaughn.config.sync → { files: Record<string, string> }
|
|
465
|
+
*/
|
|
466
|
+
declare class RpcServer {
|
|
467
|
+
private readonly registry;
|
|
468
|
+
private readonly socketPath;
|
|
469
|
+
private readonly store?;
|
|
470
|
+
private server;
|
|
471
|
+
private healthCheckFn;
|
|
472
|
+
private spawner;
|
|
473
|
+
private inference;
|
|
474
|
+
private mergePipeline;
|
|
475
|
+
private ciFeedback;
|
|
476
|
+
private vaughnDispatchFn;
|
|
477
|
+
private readonly vaughnEventQueue;
|
|
478
|
+
private static readonly MAX_VAUGHN_EVENTS;
|
|
479
|
+
constructor(registry: HarnessRegistry, socketPath: string, store?: DaemonStore | undefined);
|
|
480
|
+
private handleLine;
|
|
481
|
+
private dispatch;
|
|
482
|
+
/** Helper: store not configured error. */
|
|
483
|
+
private noStore;
|
|
484
|
+
/** Helper: missing parameter error. */
|
|
485
|
+
private missingParam;
|
|
486
|
+
/** Helper: service not configured error. */
|
|
487
|
+
private noService;
|
|
488
|
+
/**
|
|
489
|
+
* Dispatch an HTTP request body (JSON-RPC) and call the reply callback.
|
|
490
|
+
* Used by HttpGateway to proxy requests without going through a socket.
|
|
491
|
+
*/
|
|
492
|
+
dispatchHttp(body: string, reply: (response: JsonRpcResponse) => void): void;
|
|
493
|
+
/** Set the health check function (called by coordinator after construction). */
|
|
494
|
+
setHealthCheck(fn: () => Promise<unknown>): void;
|
|
495
|
+
/** Attach the spawner service (called by coordinator after construction). */
|
|
496
|
+
setSpawner(spawner: SpawnerService): void;
|
|
497
|
+
/** Attach the inference service (called by coordinator after construction). */
|
|
498
|
+
setInference(inference: InferenceService): void;
|
|
499
|
+
/** Attach the merge pipeline (called by coordinator after construction). */
|
|
500
|
+
setMergePipeline(pipeline: MergePipeline): void;
|
|
501
|
+
/** Attach the CI feedback handler (called by coordinator after construction). */
|
|
502
|
+
setCIFeedback(feedback: CIFeedback): void;
|
|
503
|
+
/** Attach the VAUGHN dispatch function (called by coordinator after construction). */
|
|
504
|
+
setVaughnDispatch(fn: (requirements: Partial<VaughnCapabilities>, description: string) => string | null): void;
|
|
505
|
+
/** Push a VAUGHN event into the recent event queue (capped at 100). */
|
|
506
|
+
pushVaughnEvent(event: VaughnEventEnvelope): void;
|
|
507
|
+
/** Get the spawner service (used by HTTP gateway for SSE). */
|
|
508
|
+
getSpawner(): SpawnerService | null;
|
|
509
|
+
start(): Promise<void>;
|
|
510
|
+
stop(): Promise<void>;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* HTTP gateway that exposes the harness daemon over TCP.
|
|
515
|
+
*
|
|
516
|
+
* Routes:
|
|
517
|
+
* POST /rpc - JSON-RPC 2.0 proxy (same protocol as Unix socket)
|
|
518
|
+
* GET /api/pair - Returns pairing status (requires valid token or no token set)
|
|
519
|
+
* POST /api/pair - Submit pairing code to get a session token
|
|
520
|
+
* GET /api/stream/:id - SSE stream of agent output (real-time)
|
|
521
|
+
* GET / - Serves Studio static frontend (index.html)
|
|
522
|
+
* GET /assets/* - Serves static assets
|
|
523
|
+
*
|
|
524
|
+
* Auth:
|
|
525
|
+
* All /rpc and /api/* requests (except POST /api/pair) require:
|
|
526
|
+
* Authorization: Bearer <session-token>
|
|
527
|
+
* The session token is obtained via the pairing flow.
|
|
528
|
+
*/
|
|
529
|
+
interface HttpGatewayConfig {
|
|
530
|
+
/** TCP port to listen on (default: 7890) */
|
|
531
|
+
port: number;
|
|
532
|
+
/** Bind address (default: '0.0.0.0' for Tailscale access) */
|
|
533
|
+
host: string;
|
|
534
|
+
/** Path to Studio static build directory (optional - disables static serving if absent) */
|
|
535
|
+
staticDir?: string;
|
|
536
|
+
/** Reference to the Unix-socket RPC server for dispatching */
|
|
537
|
+
rpcDispatch: RpcServer;
|
|
538
|
+
/** Reference to the spawner service (enables SSE streaming) */
|
|
539
|
+
spawner?: SpawnerService;
|
|
540
|
+
}
|
|
541
|
+
declare class HttpGateway {
|
|
542
|
+
private server;
|
|
543
|
+
private readonly config;
|
|
544
|
+
/** 6-digit pairing code (regenerated on each start) */
|
|
545
|
+
private pairingCode;
|
|
546
|
+
/** Active session tokens (bearer tokens granted after pairing) */
|
|
547
|
+
private sessionTokens;
|
|
548
|
+
/** Whether pairing has been completed at least once */
|
|
549
|
+
private paired;
|
|
550
|
+
constructor(config: HttpGatewayConfig);
|
|
551
|
+
/** The current pairing code (display this in Studio/terminal) */
|
|
552
|
+
getPairingCode(): string;
|
|
553
|
+
/** Regenerate the pairing code (invalidates previous code) */
|
|
554
|
+
regeneratePairingCode(): string;
|
|
555
|
+
start(): Promise<void>;
|
|
556
|
+
stop(): Promise<void>;
|
|
557
|
+
private handleRequest;
|
|
558
|
+
/** Verify the Authorization: Bearer <token> header */
|
|
559
|
+
private checkAuth;
|
|
560
|
+
/** POST /api/pair - submit pairing code, receive session token */
|
|
561
|
+
private handlePair;
|
|
562
|
+
/** GET /api/pair - check pairing status */
|
|
563
|
+
private handlePairStatus;
|
|
564
|
+
/** GET /api/status - daemon status summary */
|
|
565
|
+
private handleStatus;
|
|
566
|
+
/** POST /rpc - proxy JSON-RPC to the daemon's dispatch */
|
|
567
|
+
private handleRpc;
|
|
568
|
+
/** GET /api/stream[/:sessionId] - SSE for agent output and exit events */
|
|
569
|
+
private handleStream;
|
|
570
|
+
/** Serve static files from the Studio build directory */
|
|
571
|
+
private handleStatic;
|
|
572
|
+
}
|
|
573
|
+
|
|
110
574
|
interface CoordinatorOptions {
|
|
111
575
|
/** Absolute path to the project root (where .claude/workboard.md lives) */
|
|
112
576
|
projectRoot: string;
|
|
@@ -114,9 +578,15 @@ interface CoordinatorOptions {
|
|
|
114
578
|
socketPath?: string;
|
|
115
579
|
/** Session task description shown in the workboard */
|
|
116
580
|
task?: string;
|
|
581
|
+
/** Enable HTTP gateway for remote access (default: disabled) */
|
|
582
|
+
httpPort?: number;
|
|
583
|
+
/** HTTP gateway bind address (default: '0.0.0.0') */
|
|
584
|
+
httpHost?: string;
|
|
585
|
+
/** Path to Studio static build for serving via HTTP gateway */
|
|
586
|
+
httpStaticDir?: string;
|
|
117
587
|
}
|
|
118
588
|
/**
|
|
119
|
-
* HarnessCoordinator
|
|
589
|
+
* HarnessCoordinator - single entry point for harness-to-harness coordination.
|
|
120
590
|
*
|
|
121
591
|
* On start:
|
|
122
592
|
* 1. Auto-detects installed AI harnesses and registers them
|
|
@@ -131,7 +601,14 @@ interface CoordinatorOptions {
|
|
|
131
601
|
declare class HarnessCoordinator {
|
|
132
602
|
private readonly options;
|
|
133
603
|
private readonly registry;
|
|
604
|
+
private readonly vaughnCapabilities;
|
|
134
605
|
private rpcServer;
|
|
606
|
+
private httpGateway;
|
|
607
|
+
private store;
|
|
608
|
+
private spawner;
|
|
609
|
+
private inference;
|
|
610
|
+
private mergePipeline;
|
|
611
|
+
private ciFeedback;
|
|
135
612
|
private sessionId;
|
|
136
613
|
private readonly workboard;
|
|
137
614
|
constructor(options: CoordinatorOptions);
|
|
@@ -141,15 +618,29 @@ declare class HarnessCoordinator {
|
|
|
141
618
|
getRegistry(): HarnessRegistry;
|
|
142
619
|
/** The workboard manager. */
|
|
143
620
|
getWorkboard(): WorkboardManager;
|
|
621
|
+
/** The daemon persistent store (available after start()). */
|
|
622
|
+
getStore(): DaemonStore | null;
|
|
144
623
|
/** Register a custom adapter (must be called before start()). */
|
|
145
624
|
registerAdapter(adapter: HarnessAdapter): void;
|
|
625
|
+
/** Register explicit VAUGHN capabilities for an adapter. */
|
|
626
|
+
registerVaughnCapabilities(adapterId: string, capabilities: VaughnCapabilities): void;
|
|
627
|
+
/**
|
|
628
|
+
* Dispatch a task to the best-matching adapter based on VAUGHN capability requirements.
|
|
629
|
+
*
|
|
630
|
+
* Returns the selected adapter ID, or null if no adapter matches.
|
|
631
|
+
* Prefers adapters with hooks.canBlock for safety-critical dispatch.
|
|
632
|
+
*/
|
|
633
|
+
dispatchTask(requirements: Partial<VaughnCapabilities>, _description: string): string | null;
|
|
634
|
+
/** Check whether capabilities satisfy requirements. */
|
|
635
|
+
private matchesRequirements;
|
|
636
|
+
/** The HTTP gateway (available after start() if httpPort was set). */
|
|
637
|
+
getHttpGateway(): HttpGateway | null;
|
|
146
638
|
/** Run a health check across all registered harnesses and the workboard. */
|
|
147
639
|
healthCheck(): Promise<HealthCheckResult>;
|
|
148
640
|
}
|
|
149
641
|
|
|
150
642
|
/**
|
|
151
643
|
* Detects available AI harnesses and registers them in the registry.
|
|
152
|
-
* Mirrors autoDetectEditors from packages/editors.
|
|
153
644
|
*
|
|
154
645
|
* Creates an adapter for each known harness, checks isAvailable(),
|
|
155
646
|
* and registers those that respond. Unavailable adapters are disposed.
|
|
@@ -169,38 +660,232 @@ declare function findAllHarnessProcesses(): Promise<HarnessProcessInfo[]>;
|
|
|
169
660
|
declare function findClaudeCodeSockets(): Promise<string[]>;
|
|
170
661
|
|
|
171
662
|
/**
|
|
172
|
-
*
|
|
173
|
-
* Mirrors RpcServer from packages/editors.
|
|
663
|
+
* VAUGHN Adapter Interface (Section 7 of VAUGHN.md)
|
|
174
664
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* harness.info → HarnessInfo
|
|
179
|
-
* harness.listRunning → HarnessProcessInfo[]
|
|
180
|
-
* harness.syncConfig → ConfigSyncResult
|
|
181
|
-
* harness.diffConfig → ConfigDiffEntry
|
|
182
|
-
* harness.health → HealthCheckResult
|
|
665
|
+
* The adapter is the boundary between a tool's native interface and the
|
|
666
|
+
* VAUGHN protocol. This extends the existing HarnessAdapter with full
|
|
667
|
+
* VAUGHN capabilities.
|
|
183
668
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
669
|
+
|
|
670
|
+
/** MCP server configuration entry. */
|
|
671
|
+
interface McpServerConfig {
|
|
672
|
+
name: string;
|
|
673
|
+
command: string;
|
|
674
|
+
args?: string[];
|
|
675
|
+
env?: Record<string, string>;
|
|
676
|
+
}
|
|
677
|
+
/** Canonical configuration schema (Section 6.1). */
|
|
678
|
+
interface VaughnConfig {
|
|
679
|
+
identity: {
|
|
680
|
+
name: string;
|
|
681
|
+
email: string;
|
|
682
|
+
role?: string;
|
|
683
|
+
};
|
|
684
|
+
permissions: {
|
|
685
|
+
autoApprove: string[];
|
|
686
|
+
deny: string[];
|
|
687
|
+
sandboxMode?: 'read-only' | 'workspace-write' | 'full-access';
|
|
688
|
+
};
|
|
689
|
+
environment: {
|
|
690
|
+
variables: Record<string, string>;
|
|
691
|
+
mcpServers: McpServerConfig[];
|
|
692
|
+
};
|
|
693
|
+
rules: VaughnRule[];
|
|
694
|
+
skills: VaughnSkill[];
|
|
695
|
+
commands: VaughnCommand[];
|
|
696
|
+
}
|
|
697
|
+
/** Tool-agnostic rule definition (Section 6.3). */
|
|
698
|
+
interface VaughnRule {
|
|
699
|
+
id: string;
|
|
700
|
+
description: string;
|
|
701
|
+
content: string;
|
|
702
|
+
appliesTo: string[];
|
|
703
|
+
variables: Record<string, string>;
|
|
704
|
+
}
|
|
705
|
+
/** Tool-agnostic skill definition. */
|
|
706
|
+
interface VaughnSkill {
|
|
707
|
+
id: string;
|
|
708
|
+
name: string;
|
|
709
|
+
description: string;
|
|
710
|
+
instructions: string;
|
|
711
|
+
}
|
|
712
|
+
/** Tool-agnostic command definition. */
|
|
713
|
+
interface VaughnCommand {
|
|
714
|
+
id: string;
|
|
715
|
+
name: string;
|
|
716
|
+
description: string;
|
|
717
|
+
steps: string[];
|
|
718
|
+
}
|
|
719
|
+
/** Result of config generation: a map of file paths to contents. */
|
|
720
|
+
interface GeneratedFiles {
|
|
721
|
+
files: Map<string, string>;
|
|
722
|
+
}
|
|
723
|
+
/** Result of executing a VAUGHN command. */
|
|
724
|
+
interface VaughnCommandResult {
|
|
725
|
+
success: boolean;
|
|
726
|
+
message?: string;
|
|
727
|
+
data?: unknown;
|
|
728
|
+
}
|
|
729
|
+
/** VAUGHN error codes (Section 11.1). */
|
|
730
|
+
type VaughnErrorCode = 'ADAPTER_UNAVAILABLE' | 'CAPABILITY_MISSING' | 'TASK_ALREADY_CLAIMED' | 'TASK_NOT_FOUND' | 'CONFLICT_DETECTED' | 'HOOK_BLOCKED' | 'SANDBOX_DENIED' | 'SESSION_EXPIRED' | 'CONFIG_INVALID' | 'TOOL_RESERVED' | 'WORKBOARD_LOCKED' | 'IDENTITY_CONFLICT';
|
|
731
|
+
/** Structured error envelope (Section 11.2). */
|
|
732
|
+
interface VaughnError {
|
|
733
|
+
code: VaughnErrorCode;
|
|
734
|
+
message: string;
|
|
735
|
+
agentId?: string;
|
|
736
|
+
details?: Record<string, unknown>;
|
|
737
|
+
}
|
|
738
|
+
/** Summary information about a registered adapter. */
|
|
739
|
+
interface VaughnAdapterInfo {
|
|
740
|
+
id: string;
|
|
741
|
+
available: boolean;
|
|
742
|
+
version: string | null;
|
|
743
|
+
capabilities: VaughnCapabilities;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Contract for a VAUGHN adapter.
|
|
747
|
+
*
|
|
748
|
+
* This is the full VAUGHN interface. Existing HarnessAdapters can be
|
|
749
|
+
* wrapped to implement this interface incrementally.
|
|
750
|
+
*/
|
|
751
|
+
interface VaughnAdapter {
|
|
752
|
+
/** Unique stable identifier, e.g. 'claude-code', 'codex', 'revealui-agent' */
|
|
753
|
+
readonly id: string;
|
|
754
|
+
/** Full capability declaration */
|
|
755
|
+
readonly capabilities: VaughnCapabilities;
|
|
756
|
+
/** Initialize the adapter (connect to tool, set up event listeners) */
|
|
757
|
+
initialize(): Promise<void>;
|
|
758
|
+
/** Release all resources held by this adapter */
|
|
759
|
+
dispose(): Promise<void>;
|
|
760
|
+
/** True if the tool is installed and accessible */
|
|
761
|
+
isAvailable(): Promise<boolean>;
|
|
762
|
+
/** Tool version string, or null if unavailable */
|
|
763
|
+
getVersion(): Promise<string | null>;
|
|
764
|
+
/** Subscribe to VAUGHN-normalized events (adapter -> coordinator) */
|
|
765
|
+
onEvent(handler: (event: VaughnEventEnvelope) => void): void;
|
|
766
|
+
/** Execute a typed command against this tool (coordinator -> adapter) */
|
|
767
|
+
execute?(command: VaughnCommand): Promise<VaughnCommandResult>;
|
|
768
|
+
/** Generate tool-native config files from canonical VAUGHN config */
|
|
769
|
+
generateConfig(config: VaughnConfig): Promise<GeneratedFiles>;
|
|
770
|
+
/** Read tool-native config and parse into canonical form (optional) */
|
|
771
|
+
readConfig?(): Promise<Partial<VaughnConfig>>;
|
|
772
|
+
/** Read workboard state through the tool's native interface (if capable) */
|
|
773
|
+
readWorkboard?(): Promise<WorkboardState>;
|
|
774
|
+
/** Write workboard state through the tool's native interface (if capable) */
|
|
775
|
+
writeWorkboard?(state: WorkboardState): Promise<void>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* VAUGHN Config Normalization (Section 6 of VAUGHN.md)
|
|
780
|
+
*
|
|
781
|
+
* Bidirectional: VaughnConfig <-> Claude Code settings.json
|
|
782
|
+
* Write-only: VaughnConfig -> .cursorrules markdown
|
|
783
|
+
* Write-only: VaughnConfig -> AGENTS.md markdown
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
/** Result of config generation: map of relative file paths to contents. */
|
|
787
|
+
interface ConfigGenerationResult {
|
|
788
|
+
files: Map<string, string>;
|
|
789
|
+
}
|
|
790
|
+
/** Subset of Claude Code settings.json we read/write. */
|
|
791
|
+
interface ClaudeCodeSettings {
|
|
792
|
+
permissions?: {
|
|
793
|
+
allow?: string[];
|
|
794
|
+
deny?: string[];
|
|
795
|
+
};
|
|
796
|
+
env?: Record<string, string>;
|
|
797
|
+
mcpServers?: Record<string, {
|
|
798
|
+
command: string;
|
|
799
|
+
args?: string[];
|
|
800
|
+
env?: Record<string, string>;
|
|
801
|
+
}>;
|
|
802
|
+
}
|
|
803
|
+
/** Convert a VaughnConfig to Claude Code settings.json format. */
|
|
804
|
+
declare function vaughnConfigToClaudeSettings(config: VaughnConfig): ClaudeCodeSettings;
|
|
805
|
+
/** Parse Claude Code settings.json into a partial VaughnConfig. */
|
|
806
|
+
declare function claudeSettingsToVaughnConfig(settings: ClaudeCodeSettings): Partial<VaughnConfig>;
|
|
807
|
+
/** Generate .cursorrules markdown from VaughnConfig. */
|
|
808
|
+
declare function vaughnConfigToCursorrules(config: VaughnConfig): string;
|
|
809
|
+
/** Generate AGENTS.md markdown from VaughnConfig. */
|
|
810
|
+
declare function vaughnConfigToAgentsMd(config: VaughnConfig): string;
|
|
811
|
+
/**
|
|
812
|
+
* Generate all config files from a VaughnConfig.
|
|
813
|
+
* Returns a map of relative file paths to contents.
|
|
814
|
+
*/
|
|
815
|
+
declare function generateAllConfigs(config: VaughnConfig): ConfigGenerationResult;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* VAUGHN Degradation Model (Section 5.3 of VAUGHN.md)
|
|
819
|
+
*
|
|
820
|
+
* When a tool does not emit a native event for a VAUGHN event,
|
|
821
|
+
* the adapter applies one of three strategies.
|
|
822
|
+
*/
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Degradation strategy applied when a tool lacks native support for an event.
|
|
826
|
+
*
|
|
827
|
+
* - polyfill: Adapter synthesizes the event from other signals (same semantics, higher latency)
|
|
828
|
+
* - degrade: Partial functionality, weaker guarantee, explicitly documented
|
|
829
|
+
* - absent: No meaningful approximation; capability is reported as missing
|
|
830
|
+
*/
|
|
831
|
+
type DegradationStrategy = 'polyfill' | 'degrade' | 'absent';
|
|
832
|
+
/**
|
|
833
|
+
* Returns the degradation strategy for a given tool and event.
|
|
834
|
+
*
|
|
835
|
+
* - Returns `undefined` if the tool natively supports the event (no degradation).
|
|
836
|
+
* - Returns the strategy if the tool lacks native support.
|
|
837
|
+
* - Returns `'absent'` for unknown tools (conservative default).
|
|
838
|
+
*/
|
|
839
|
+
declare function getDegradationStrategy(toolName: string, event: VaughnEvent): DegradationStrategy | undefined;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* VAUGHN Event Normalization Layer
|
|
843
|
+
*
|
|
844
|
+
* Translates HarnessEvent -> VaughnEventEnvelope, applying
|
|
845
|
+
* degradation strategies for events the tool cannot emit natively.
|
|
846
|
+
*/
|
|
847
|
+
|
|
848
|
+
/** Result of normalizing a HarnessEvent. */
|
|
849
|
+
interface NormalizedEvent {
|
|
850
|
+
envelope: VaughnEventEnvelope;
|
|
851
|
+
/** Undefined when the tool natively supports the event. */
|
|
852
|
+
degradation: DegradationStrategy | undefined;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Translates tool-native HarnessEvents into VAUGHN canonical event envelopes.
|
|
856
|
+
*
|
|
857
|
+
* Each instance is bound to a specific tool/agent/session identity.
|
|
858
|
+
* Call `normalize()` with each HarnessEvent to get a VaughnEventEnvelope.
|
|
859
|
+
*/
|
|
860
|
+
declare class VaughnEventNormalizer {
|
|
861
|
+
private readonly toolName;
|
|
862
|
+
private readonly agentId;
|
|
863
|
+
private readonly sessionId;
|
|
864
|
+
constructor(toolName: string, agentId: string, sessionId: string);
|
|
865
|
+
/**
|
|
866
|
+
* Map a HarnessEvent type to its canonical VAUGHN event.
|
|
867
|
+
* Returns null if the event has no VAUGHN mapping.
|
|
868
|
+
*/
|
|
869
|
+
private mapEventType;
|
|
870
|
+
/** Extract event-specific payload fields. */
|
|
871
|
+
private extractPayload;
|
|
872
|
+
/**
|
|
873
|
+
* Normalize a HarnessEvent into a VaughnEventEnvelope.
|
|
874
|
+
*
|
|
875
|
+
* Returns null if:
|
|
876
|
+
* - The event has no VAUGHN mapping
|
|
877
|
+
* - The degradation strategy for this tool/event is 'absent'
|
|
878
|
+
*/
|
|
879
|
+
normalize(event: HarnessEvent): NormalizedEvent | null;
|
|
880
|
+
/** Convenience: normalize and return just the envelope (or null). */
|
|
881
|
+
normalizeToEnvelope(event: HarnessEvent): VaughnEventEnvelope | null;
|
|
196
882
|
}
|
|
197
883
|
|
|
198
884
|
/**
|
|
199
|
-
* @revealui/harnesses
|
|
885
|
+
* @revealui/harnesses - AI Harness Integration System (Server-side)
|
|
200
886
|
*
|
|
201
887
|
* Adapters, registry, workboard coordination, and JSON-RPC server for
|
|
202
|
-
* integrating AI
|
|
203
|
-
* RevealUI development workflow.
|
|
888
|
+
* integrating native AI agents into the RevealUI development workflow.
|
|
204
889
|
*
|
|
205
890
|
* Pro tier feature: gated behind isFeatureEnabled("ai").
|
|
206
891
|
*
|
|
@@ -209,4 +894,4 @@ declare class RpcServer {
|
|
|
209
894
|
/** Check whether the harnesses feature is licensed for this installation. */
|
|
210
895
|
declare function checkHarnessesLicense(): Promise<boolean>;
|
|
211
896
|
|
|
212
|
-
export {
|
|
897
|
+
export { type ClaudeCodeSettings, ConfigDiffEntry, type ConfigGenerationResult, ConfigSyncDirection, ConfigSyncResult, type CoordinatorOptions, DaemonStore, type DegradationStrategy, type GeneratedFiles, HarnessAdapter, HarnessCoordinator, HarnessEvent, HarnessProcessInfo, HarnessRegistry, HealthCheckResult, type HookGranularity, type McpServerConfig, type MemoryBackend, type NormalizedEvent, RpcServer, type SandboxMode, TOOL_PROFILES, VAUGHN_EVENTS, VAUGHN_VERSION, type VaughnAdapter, type VaughnAdapterInfo, type VaughnCapabilities, type VaughnCommand, type VaughnCommandResult, type VaughnConfig, type VaughnError, type VaughnErrorCode, type VaughnEvent, type VaughnEventEnvelope, VaughnEventNormalizer, type VaughnRule, type VaughnSkill, WorkboardManager, WorkboardState, autoDetectHarnesses, checkHarnessesLicense, claudeSettingsToVaughnConfig, createDefaultCapabilities, createEventEnvelope, diffAllConfigs, diffConfig, findAllHarnessProcesses, findClaudeCodeSockets, findHarnessProcesses, findProcesses, generateAllConfigs, getConfigurableHarnesses, getDegradationStrategy, getLocalConfigPath, getRootConfigPath, syncAllConfigs, syncConfig, validateConfigJson, vaughnConfigToAgentsMd, vaughnConfigToClaudeSettings, vaughnConfigToCursorrules, vaughnEventEnvelopeSchema, vaughnEventSchema };
|