aegis-bridge 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +404 -0
  3. package/dashboard/dist/assets/index-BoZwGLAx.css +32 -0
  4. package/dashboard/dist/assets/index-C61BkKH-.js +312 -0
  5. package/dashboard/dist/assets/index-C61BkKH-.js.map +1 -0
  6. package/dashboard/dist/index.html +14 -0
  7. package/dist/api-contracts.d.ts +229 -0
  8. package/dist/api-contracts.js +7 -0
  9. package/dist/api-contracts.typecheck.d.ts +14 -0
  10. package/dist/api-contracts.typecheck.js +1 -0
  11. package/dist/api-error-envelope.d.ts +15 -0
  12. package/dist/api-error-envelope.js +80 -0
  13. package/dist/auth.d.ts +87 -0
  14. package/dist/auth.js +276 -0
  15. package/dist/channels/index.d.ts +8 -0
  16. package/dist/channels/index.js +8 -0
  17. package/dist/channels/manager.d.ts +47 -0
  18. package/dist/channels/manager.js +115 -0
  19. package/dist/channels/telegram-style.d.ts +118 -0
  20. package/dist/channels/telegram-style.js +202 -0
  21. package/dist/channels/telegram.d.ts +91 -0
  22. package/dist/channels/telegram.js +1518 -0
  23. package/dist/channels/types.d.ts +77 -0
  24. package/dist/channels/types.js +8 -0
  25. package/dist/channels/webhook.d.ts +60 -0
  26. package/dist/channels/webhook.js +216 -0
  27. package/dist/cli.d.ts +8 -0
  28. package/dist/cli.js +252 -0
  29. package/dist/config.d.ts +90 -0
  30. package/dist/config.js +214 -0
  31. package/dist/consensus.d.ts +16 -0
  32. package/dist/consensus.js +19 -0
  33. package/dist/continuation-pointer.d.ts +11 -0
  34. package/dist/continuation-pointer.js +65 -0
  35. package/dist/diagnostics.d.ts +27 -0
  36. package/dist/diagnostics.js +95 -0
  37. package/dist/error-categories.d.ts +39 -0
  38. package/dist/error-categories.js +73 -0
  39. package/dist/events.d.ts +133 -0
  40. package/dist/events.js +389 -0
  41. package/dist/fault-injection.d.ts +29 -0
  42. package/dist/fault-injection.js +115 -0
  43. package/dist/file-utils.d.ts +2 -0
  44. package/dist/file-utils.js +37 -0
  45. package/dist/handshake.d.ts +60 -0
  46. package/dist/handshake.js +124 -0
  47. package/dist/hook-settings.d.ts +80 -0
  48. package/dist/hook-settings.js +272 -0
  49. package/dist/hook.d.ts +19 -0
  50. package/dist/hook.js +231 -0
  51. package/dist/hooks.d.ts +32 -0
  52. package/dist/hooks.js +364 -0
  53. package/dist/jsonl-watcher.d.ts +59 -0
  54. package/dist/jsonl-watcher.js +166 -0
  55. package/dist/logger.d.ts +35 -0
  56. package/dist/logger.js +65 -0
  57. package/dist/mcp-server.d.ts +123 -0
  58. package/dist/mcp-server.js +869 -0
  59. package/dist/memory-bridge.d.ts +27 -0
  60. package/dist/memory-bridge.js +137 -0
  61. package/dist/memory-routes.d.ts +3 -0
  62. package/dist/memory-routes.js +100 -0
  63. package/dist/metrics.d.ts +126 -0
  64. package/dist/metrics.js +286 -0
  65. package/dist/model-router.d.ts +53 -0
  66. package/dist/model-router.js +150 -0
  67. package/dist/monitor.d.ts +103 -0
  68. package/dist/monitor.js +820 -0
  69. package/dist/path-utils.d.ts +11 -0
  70. package/dist/path-utils.js +21 -0
  71. package/dist/permission-evaluator.d.ts +10 -0
  72. package/dist/permission-evaluator.js +48 -0
  73. package/dist/permission-guard.d.ts +51 -0
  74. package/dist/permission-guard.js +196 -0
  75. package/dist/permission-request-manager.d.ts +12 -0
  76. package/dist/permission-request-manager.js +36 -0
  77. package/dist/permission-routes.d.ts +7 -0
  78. package/dist/permission-routes.js +28 -0
  79. package/dist/pipeline.d.ts +97 -0
  80. package/dist/pipeline.js +291 -0
  81. package/dist/process-utils.d.ts +4 -0
  82. package/dist/process-utils.js +73 -0
  83. package/dist/question-manager.d.ts +54 -0
  84. package/dist/question-manager.js +80 -0
  85. package/dist/retry.d.ts +11 -0
  86. package/dist/retry.js +34 -0
  87. package/dist/safe-json.d.ts +12 -0
  88. package/dist/safe-json.js +22 -0
  89. package/dist/screenshot.d.ts +28 -0
  90. package/dist/screenshot.js +60 -0
  91. package/dist/server.d.ts +10 -0
  92. package/dist/server.js +1973 -0
  93. package/dist/session-cleanup.d.ts +18 -0
  94. package/dist/session-cleanup.js +11 -0
  95. package/dist/session.d.ts +379 -0
  96. package/dist/session.js +1568 -0
  97. package/dist/shutdown-utils.d.ts +5 -0
  98. package/dist/shutdown-utils.js +24 -0
  99. package/dist/signal-cleanup-helper.d.ts +48 -0
  100. package/dist/signal-cleanup-helper.js +117 -0
  101. package/dist/sse-limiter.d.ts +47 -0
  102. package/dist/sse-limiter.js +61 -0
  103. package/dist/sse-writer.d.ts +31 -0
  104. package/dist/sse-writer.js +94 -0
  105. package/dist/ssrf.d.ts +102 -0
  106. package/dist/ssrf.js +267 -0
  107. package/dist/startup.d.ts +6 -0
  108. package/dist/startup.js +162 -0
  109. package/dist/suppress.d.ts +33 -0
  110. package/dist/suppress.js +79 -0
  111. package/dist/swarm-monitor.d.ts +117 -0
  112. package/dist/swarm-monitor.js +300 -0
  113. package/dist/template-store.d.ts +45 -0
  114. package/dist/template-store.js +142 -0
  115. package/dist/terminal-parser.d.ts +16 -0
  116. package/dist/terminal-parser.js +346 -0
  117. package/dist/tmux-capture-cache.d.ts +18 -0
  118. package/dist/tmux-capture-cache.js +34 -0
  119. package/dist/tmux.d.ts +183 -0
  120. package/dist/tmux.js +906 -0
  121. package/dist/tool-registry.d.ts +40 -0
  122. package/dist/tool-registry.js +83 -0
  123. package/dist/transcript.d.ts +63 -0
  124. package/dist/transcript.js +284 -0
  125. package/dist/utils/circular-buffer.d.ts +11 -0
  126. package/dist/utils/circular-buffer.js +37 -0
  127. package/dist/utils/redact-headers.d.ts +13 -0
  128. package/dist/utils/redact-headers.js +54 -0
  129. package/dist/validation.d.ts +406 -0
  130. package/dist/validation.js +415 -0
  131. package/dist/verification.d.ts +2 -0
  132. package/dist/verification.js +72 -0
  133. package/dist/worktree-lookup.d.ts +24 -0
  134. package/dist/worktree-lookup.js +71 -0
  135. package/dist/ws-terminal.d.ts +32 -0
  136. package/dist/ws-terminal.js +348 -0
  137. package/package.json +83 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * jsonl-watcher.ts — fs.watch()-based JSONL file watcher.
3
+ *
4
+ * Replaces polling-based JSONL reading in the monitor with near-instant
5
+ * file change detection. Uses fs.watch() with debouncing to avoid
6
+ * duplicate events from rapid writes.
7
+ *
8
+ * Issue #84: Replace JSONL polling with fs.watch.
9
+ */
10
+ import { type ParsedEntry, type TokenUsageDelta } from './transcript.js';
11
+ export interface JsonlWatcherEvent {
12
+ sessionId: string;
13
+ messages: ParsedEntry[];
14
+ newOffset: number;
15
+ /** True if the file was truncated (e.g. after /clear). */
16
+ truncated: boolean;
17
+ /** Issue #488: Aggregated token usage delta from this batch of entries. */
18
+ tokenUsageDelta: TokenUsageDelta;
19
+ }
20
+ export interface JsonlWatcherConfig {
21
+ /** Debounce interval in ms to coalesce rapid writes (default: 100). */
22
+ debounceMs: number;
23
+ }
24
+ /**
25
+ * Watches JSONL files for changes and emits parsed entries.
26
+ *
27
+ * Usage:
28
+ * const watcher = new JsonlWatcher();
29
+ * watcher.onEntries((event) => { ... });
30
+ * watcher.watch('session-123', '/path/to/session.jsonl', 0);
31
+ * watcher.unwatch('session-123');
32
+ * watcher.destroy();
33
+ */
34
+ export declare class JsonlWatcher {
35
+ private entries;
36
+ private listeners;
37
+ private config;
38
+ constructor(config?: Partial<JsonlWatcherConfig>);
39
+ /** Register a callback for new entries. */
40
+ onEntries(listener: (event: JsonlWatcherEvent) => void): () => void;
41
+ /** Start watching a JSONL file for a session.
42
+ * @param initialOffset - byte offset to start reading from (usually 0 or current session.monitorOffset).
43
+ */
44
+ watch(sessionId: string, jsonlPath: string, initialOffset: number): void;
45
+ /** Stop watching a session's JSONL file. */
46
+ unwatch(sessionId: string): void;
47
+ /** Update the offset for a session (e.g. after manual read during discovery). */
48
+ setOffset(sessionId: string, offset: number): void;
49
+ /** Check if a session is being watched. */
50
+ isWatching(sessionId: string): boolean;
51
+ /** Get the current offset for a watched session. */
52
+ getOffset(sessionId: string): number | undefined;
53
+ /** Stop all watchers and clean up. */
54
+ destroy(): void;
55
+ /** Schedule a debounced read for a session. */
56
+ private scheduleRead;
57
+ /** Read new bytes from the JSONL file and emit entries. */
58
+ private readAndEmit;
59
+ }
@@ -0,0 +1,166 @@
1
+ /**
2
+ * jsonl-watcher.ts — fs.watch()-based JSONL file watcher.
3
+ *
4
+ * Replaces polling-based JSONL reading in the monitor with near-instant
5
+ * file change detection. Uses fs.watch() with debouncing to avoid
6
+ * duplicate events from rapid writes.
7
+ *
8
+ * Issue #84: Replace JSONL polling with fs.watch.
9
+ */
10
+ import { watch } from 'node:fs';
11
+ import { existsSync } from 'node:fs';
12
+ import { readNewEntries, extractTokenDelta } from './transcript.js';
13
+ const DEFAULT_CONFIG = {
14
+ debounceMs: 100,
15
+ };
16
+ /**
17
+ * Watches JSONL files for changes and emits parsed entries.
18
+ *
19
+ * Usage:
20
+ * const watcher = new JsonlWatcher();
21
+ * watcher.onEntries((event) => { ... });
22
+ * watcher.watch('session-123', '/path/to/session.jsonl', 0);
23
+ * watcher.unwatch('session-123');
24
+ * watcher.destroy();
25
+ */
26
+ export class JsonlWatcher {
27
+ entries = new Map();
28
+ listeners = new Array();
29
+ config;
30
+ constructor(config) {
31
+ this.config = { ...DEFAULT_CONFIG, ...config };
32
+ }
33
+ /** Register a callback for new entries. */
34
+ onEntries(listener) {
35
+ this.listeners.push(listener);
36
+ return () => {
37
+ const idx = this.listeners.indexOf(listener);
38
+ if (idx >= 0)
39
+ this.listeners.splice(idx, 1);
40
+ };
41
+ }
42
+ /** Start watching a JSONL file for a session.
43
+ * @param initialOffset - byte offset to start reading from (usually 0 or current session.monitorOffset).
44
+ */
45
+ watch(sessionId, jsonlPath, initialOffset) {
46
+ // Issue #846: Clear stale timer before re-watching to prevent
47
+ // old timer closures from operating on stale entry data.
48
+ if (this.entries.has(sessionId)) {
49
+ const oldEntry = this.entries.get(sessionId);
50
+ if (oldEntry.debounceTimer) {
51
+ clearTimeout(oldEntry.debounceTimer);
52
+ oldEntry.debounceTimer = null;
53
+ }
54
+ oldEntry.fsWatcher.close();
55
+ this.entries.delete(sessionId);
56
+ }
57
+ if (!existsSync(jsonlPath))
58
+ return;
59
+ const fsWatcher = watch(jsonlPath, (eventType) => {
60
+ // 'rename' can mean file was deleted or replaced — check if it still exists
61
+ if (eventType === 'rename') {
62
+ if (!existsSync(jsonlPath)) {
63
+ // File deleted — session likely ended, stop watching
64
+ this.unwatch(sessionId);
65
+ return;
66
+ }
67
+ // File was replaced (e.g. rotated) — re-read from current offset
68
+ this.scheduleRead(sessionId);
69
+ return;
70
+ }
71
+ // 'change' — new data written
72
+ this.scheduleRead(sessionId);
73
+ });
74
+ fsWatcher.on('error', (err) => {
75
+ console.error(`JsonlWatcher: error watching ${jsonlPath}:`, err.message);
76
+ // Stop watching on persistent errors
77
+ this.unwatch(sessionId);
78
+ });
79
+ this.entries.set(sessionId, {
80
+ sessionId,
81
+ jsonlPath,
82
+ fsWatcher,
83
+ debounceTimer: null,
84
+ offset: initialOffset,
85
+ });
86
+ }
87
+ /** Stop watching a session's JSONL file. */
88
+ unwatch(sessionId) {
89
+ const entry = this.entries.get(sessionId);
90
+ if (!entry)
91
+ return;
92
+ if (entry.debounceTimer) {
93
+ clearTimeout(entry.debounceTimer);
94
+ }
95
+ entry.fsWatcher.close();
96
+ this.entries.delete(sessionId);
97
+ }
98
+ /** Update the offset for a session (e.g. after manual read during discovery). */
99
+ setOffset(sessionId, offset) {
100
+ const entry = this.entries.get(sessionId);
101
+ if (entry) {
102
+ entry.offset = offset;
103
+ }
104
+ }
105
+ /** Check if a session is being watched. */
106
+ isWatching(sessionId) {
107
+ return this.entries.has(sessionId);
108
+ }
109
+ /** Get the current offset for a watched session. */
110
+ getOffset(sessionId) {
111
+ return this.entries.get(sessionId)?.offset;
112
+ }
113
+ /** Stop all watchers and clean up. */
114
+ destroy() {
115
+ for (const sessionId of this.entries.keys()) {
116
+ this.unwatch(sessionId);
117
+ }
118
+ this.listeners.length = 0;
119
+ }
120
+ /** Schedule a debounced read for a session. */
121
+ scheduleRead(sessionId) {
122
+ const entry = this.entries.get(sessionId);
123
+ if (!entry)
124
+ return;
125
+ if (entry.debounceTimer) {
126
+ clearTimeout(entry.debounceTimer);
127
+ }
128
+ entry.debounceTimer = setTimeout(() => {
129
+ entry.debounceTimer = null;
130
+ void this.readAndEmit(entry);
131
+ }, this.config.debounceMs);
132
+ }
133
+ /** Read new bytes from the JSONL file and emit entries. */
134
+ async readAndEmit(entry) {
135
+ // Session may have been removed during debounce
136
+ if (!this.entries.has(entry.sessionId))
137
+ return;
138
+ if (!existsSync(entry.jsonlPath)) {
139
+ this.unwatch(entry.sessionId);
140
+ return;
141
+ }
142
+ try {
143
+ const previousOffset = entry.offset;
144
+ const result = await readNewEntries(entry.jsonlPath, previousOffset);
145
+ entry.offset = result.newOffset;
146
+ if (result.entries.length > 0 || result.newOffset < previousOffset) {
147
+ // Detect truncation: newOffset went backwards
148
+ const truncated = result.newOffset < previousOffset;
149
+ // Emit to all listeners
150
+ const event = {
151
+ sessionId: entry.sessionId,
152
+ messages: result.entries,
153
+ newOffset: result.newOffset,
154
+ truncated,
155
+ tokenUsageDelta: extractTokenDelta(result.raw),
156
+ };
157
+ for (const listener of this.listeners) {
158
+ listener(event);
159
+ }
160
+ }
161
+ }
162
+ catch {
163
+ // File may be temporarily unavailable — ignore
164
+ }
165
+ }
166
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * logger.ts - structured logger that also emits sanitized diagnostics events.
3
+ */
4
+ import { type DiagnosticsBus, type DiagnosticsLevel } from './diagnostics.js';
5
+ export interface LogContext {
6
+ component: string;
7
+ operation: string;
8
+ sessionId?: string;
9
+ errorCode?: string;
10
+ attributes?: Record<string, unknown>;
11
+ }
12
+ export interface StructuredLogRecord {
13
+ timestamp: string;
14
+ level: DiagnosticsLevel;
15
+ component: string;
16
+ operation: string;
17
+ sessionId?: string;
18
+ errorCode?: string;
19
+ attributes: Record<string, unknown>;
20
+ }
21
+ export interface StructuredLogSink {
22
+ info?: (record: StructuredLogRecord) => void;
23
+ warn?: (record: StructuredLogRecord) => void;
24
+ error?: (record: StructuredLogRecord) => void;
25
+ }
26
+ export declare function setStructuredLogSink(nextSink: StructuredLogSink): void;
27
+ export declare class StructuredLogger {
28
+ private readonly bus;
29
+ constructor(bus?: DiagnosticsBus);
30
+ info(ctx: LogContext): void;
31
+ warn(ctx: LogContext): void;
32
+ error(ctx: LogContext): void;
33
+ private log;
34
+ }
35
+ export declare const logger: StructuredLogger;
package/dist/logger.js ADDED
@@ -0,0 +1,65 @@
1
+ /**
2
+ * logger.ts - structured logger that also emits sanitized diagnostics events.
3
+ */
4
+ import { diagnosticsBus, sanitizeDiagnosticsAttributes, } from './diagnostics.js';
5
+ const defaultSink = {
6
+ info: (record) => console.log(JSON.stringify(record)),
7
+ warn: (record) => console.warn(JSON.stringify(record)),
8
+ error: (record) => console.error(JSON.stringify(record)),
9
+ };
10
+ let sink = defaultSink;
11
+ export function setStructuredLogSink(nextSink) {
12
+ sink = {
13
+ info: nextSink.info ?? defaultSink.info,
14
+ warn: nextSink.warn ?? defaultSink.warn,
15
+ error: nextSink.error ?? defaultSink.error,
16
+ };
17
+ }
18
+ export class StructuredLogger {
19
+ bus;
20
+ constructor(bus = diagnosticsBus) {
21
+ this.bus = bus;
22
+ }
23
+ info(ctx) {
24
+ this.log('info', ctx);
25
+ }
26
+ warn(ctx) {
27
+ this.log('warn', ctx);
28
+ }
29
+ error(ctx) {
30
+ this.log('error', ctx);
31
+ }
32
+ log(level, ctx) {
33
+ const timestamp = new Date().toISOString();
34
+ const attributes = sanitizeDiagnosticsAttributes(ctx.attributes);
35
+ const record = {
36
+ timestamp,
37
+ level,
38
+ component: ctx.component,
39
+ operation: ctx.operation,
40
+ sessionId: ctx.sessionId,
41
+ errorCode: ctx.errorCode,
42
+ attributes,
43
+ };
44
+ if (level === 'error') {
45
+ sink.error?.(record);
46
+ }
47
+ else if (level === 'warn') {
48
+ sink.warn?.(record);
49
+ }
50
+ else {
51
+ sink.info?.(record);
52
+ }
53
+ this.bus.emit({
54
+ event: `${ctx.component}.${ctx.operation}`,
55
+ level,
56
+ component: ctx.component,
57
+ operation: ctx.operation,
58
+ sessionId: ctx.sessionId,
59
+ errorCode: ctx.errorCode,
60
+ timestamp,
61
+ attributes,
62
+ });
63
+ }
64
+ }
65
+ export const logger = new StructuredLogger();
@@ -0,0 +1,123 @@
1
+ /**
2
+ * mcp-server.ts — MCP server mode for Aegis.
3
+ *
4
+ * Exposes Aegis session orchestration as MCP tools via stdio transport.
5
+ * CC sessions can natively discover and communicate with sibling sessions.
6
+ *
7
+ * Usage:
8
+ * aegis-bridge mcp # default port 9100
9
+ * aegis-bridge mcp --port 3000 # custom port
10
+ * claude mcp add --scope user aegis -- npx aegis-bridge mcp
11
+ *
12
+ * Issue #48: https://github.com/OneStepAt4time/aegis/issues/48
13
+ */
14
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
15
+ import { type SessionInfo } from './session.js';
16
+ import { type SessionMetrics, type SessionLatency, type SessionLatencySummary } from './metrics.js';
17
+ import { type PipelineState, type BatchResult } from './pipeline.js';
18
+ interface ServerHealthResponse {
19
+ status: string;
20
+ version: string;
21
+ platform: NodeJS.Platform;
22
+ uptime: number;
23
+ sessions: {
24
+ active: number;
25
+ total: number;
26
+ };
27
+ tmux: {
28
+ healthy: boolean;
29
+ [key: string]: unknown;
30
+ };
31
+ timestamp: string;
32
+ }
33
+ interface CreateSessionResponse {
34
+ id: string;
35
+ windowName: string;
36
+ workDir: string;
37
+ status: string;
38
+ promptDelivery?: {
39
+ delivered: boolean;
40
+ attempts: number;
41
+ };
42
+ reused?: boolean;
43
+ [key: string]: unknown;
44
+ }
45
+ interface SendMessageResponse {
46
+ ok: boolean;
47
+ delivered: boolean;
48
+ attempts: number;
49
+ }
50
+ interface OkResponse {
51
+ ok: boolean;
52
+ }
53
+ interface CapturePaneResponse {
54
+ pane: string;
55
+ }
56
+ interface SessionLatencyResponse {
57
+ sessionId: string;
58
+ realtime: SessionLatency | null;
59
+ aggregated: SessionLatencySummary | null;
60
+ }
61
+ interface MemoryEntryResponse {
62
+ entry: {
63
+ key: string;
64
+ value: string;
65
+ namespace: string;
66
+ created_at: number;
67
+ updated_at: number;
68
+ expires_at?: number;
69
+ };
70
+ }
71
+ export declare class AegisClient {
72
+ private baseUrl;
73
+ private authToken?;
74
+ constructor(baseUrl: string, authToken?: string | undefined);
75
+ private validateSessionId;
76
+ private request;
77
+ listSessions(filter?: {
78
+ status?: string;
79
+ workDir?: string;
80
+ }): Promise<SessionInfo[]>;
81
+ getSession(id: string): Promise<Record<string, unknown>>;
82
+ getHealth(id: string): Promise<Record<string, unknown>>;
83
+ getTranscript(id: string): Promise<Record<string, unknown>>;
84
+ sendMessage(id: string, text: string): Promise<SendMessageResponse>;
85
+ createSession(opts: {
86
+ workDir: string;
87
+ name?: string;
88
+ prompt?: string;
89
+ }): Promise<CreateSessionResponse>;
90
+ killSession(id: string): Promise<OkResponse>;
91
+ approvePermission(id: string): Promise<OkResponse>;
92
+ rejectPermission(id: string): Promise<OkResponse>;
93
+ getServerHealth(): Promise<ServerHealthResponse>;
94
+ escapeSession(id: string): Promise<OkResponse>;
95
+ interruptSession(id: string): Promise<OkResponse>;
96
+ capturePane(id: string): Promise<CapturePaneResponse>;
97
+ getSessionMetrics(id: string): Promise<SessionMetrics>;
98
+ getSessionSummary(id: string): Promise<Record<string, unknown>>;
99
+ sendBash(id: string, command: string): Promise<OkResponse>;
100
+ sendCommand(id: string, command: string): Promise<OkResponse>;
101
+ getSessionLatency(id: string): Promise<SessionLatencyResponse>;
102
+ batchCreateSessions(sessions: Array<{
103
+ workDir: string;
104
+ name?: string;
105
+ prompt?: string;
106
+ }>): Promise<BatchResult>;
107
+ listPipelines(): Promise<PipelineState[]>;
108
+ createPipeline(config: {
109
+ name: string;
110
+ workDir: string;
111
+ steps: Array<{
112
+ name?: string;
113
+ prompt: string;
114
+ }>;
115
+ }): Promise<PipelineState>;
116
+ getSwarm(): Promise<Record<string, unknown>>;
117
+ setMemory(key: string, value: string, ttlSeconds?: number): Promise<MemoryEntryResponse>;
118
+ getMemory(key: string): Promise<MemoryEntryResponse>;
119
+ deleteMemory(key: string): Promise<OkResponse>;
120
+ }
121
+ export declare function createMcpServer(aegisPort: number, authToken?: string): McpServer;
122
+ export declare function startMcpServer(port: number, authToken?: string): Promise<void>;
123
+ export {};