@claude-flow/cli 3.5.44 → 3.5.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/autopilot-state.d.ts +77 -0
- package/dist/src/autopilot-state.d.ts.map +1 -0
- package/dist/src/autopilot-state.js +279 -0
- package/dist/src/autopilot-state.js.map +1 -0
- package/dist/src/commands/autopilot.d.ts +15 -0
- package/dist/src/commands/autopilot.d.ts.map +1 -0
- package/dist/src/commands/autopilot.js +362 -0
- package/dist/src/commands/autopilot.js.map +1 -0
- package/dist/src/commands/index.d.ts +2 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +7 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +3 -14
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +3 -0
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-tools/autopilot-tools.d.ts +12 -0
- package/dist/src/mcp-tools/autopilot-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/autopilot-tools.js +227 -0
- package/dist/src/mcp-tools/autopilot-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.js +2 -2
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +1 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +1 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Shared State Module
|
|
3
|
+
*
|
|
4
|
+
* Centralizes state management, validation, and task discovery
|
|
5
|
+
* for both CLI command and MCP tools. Eliminates code duplication.
|
|
6
|
+
*
|
|
7
|
+
* ADR-072: Autopilot Integration
|
|
8
|
+
* Security: Addresses prototype pollution, NaN bypass, input validation
|
|
9
|
+
*/
|
|
10
|
+
export declare const STATE_DIR = ".claude-flow/data";
|
|
11
|
+
export declare const STATE_FILE = ".claude-flow/data/autopilot-state.json";
|
|
12
|
+
export declare const LOG_FILE = ".claude-flow/data/autopilot-log.json";
|
|
13
|
+
/** Allowlist for valid task sources */
|
|
14
|
+
export declare const VALID_TASK_SOURCES: Set<string>;
|
|
15
|
+
/** Terminal task statuses */
|
|
16
|
+
export declare const TERMINAL_STATUSES: Set<string>;
|
|
17
|
+
export interface AutopilotState {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
startTime: number;
|
|
21
|
+
iterations: number;
|
|
22
|
+
maxIterations: number;
|
|
23
|
+
timeoutMinutes: number;
|
|
24
|
+
taskSources: string[];
|
|
25
|
+
lastCheck: number | null;
|
|
26
|
+
history: Array<{
|
|
27
|
+
ts: number;
|
|
28
|
+
iteration: number;
|
|
29
|
+
completed: number;
|
|
30
|
+
total: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
export interface AutopilotLogEntry {
|
|
34
|
+
ts: number;
|
|
35
|
+
event: string;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface TaskInfo {
|
|
39
|
+
id: string;
|
|
40
|
+
subject: string;
|
|
41
|
+
status: string;
|
|
42
|
+
source: string;
|
|
43
|
+
}
|
|
44
|
+
export interface TaskProgress {
|
|
45
|
+
completed: number;
|
|
46
|
+
total: number;
|
|
47
|
+
percent: number;
|
|
48
|
+
incomplete: TaskInfo[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Safe JSON.parse that prevents prototype pollution.
|
|
52
|
+
*/
|
|
53
|
+
export declare function safeJsonParse<T>(raw: string): T;
|
|
54
|
+
/**
|
|
55
|
+
* Validate and coerce a numeric parameter. Returns the default if
|
|
56
|
+
* the input is NaN, undefined, or outside the allowed range.
|
|
57
|
+
*/
|
|
58
|
+
export declare function validateNumber(value: unknown, min: number, max: number, defaultValue: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Validate task sources against the allowlist.
|
|
61
|
+
* Returns only valid sources; falls back to defaults if none are valid.
|
|
62
|
+
*/
|
|
63
|
+
export declare function validateTaskSources(sources: unknown): string[];
|
|
64
|
+
export declare function getDefaultState(): AutopilotState;
|
|
65
|
+
export declare function loadState(): AutopilotState;
|
|
66
|
+
export declare function saveState(state: AutopilotState): void;
|
|
67
|
+
export declare function appendLog(entry: AutopilotLogEntry): void;
|
|
68
|
+
export declare function loadLog(): AutopilotLogEntry[];
|
|
69
|
+
export declare function discoverTasks(sources: string[]): TaskInfo[];
|
|
70
|
+
export declare function isTerminal(status: string): boolean;
|
|
71
|
+
export declare function getProgress(tasks: TaskInfo[]): TaskProgress;
|
|
72
|
+
export declare function calculateReward(iterations: number, durationMs: number): number;
|
|
73
|
+
export declare function tryLoadLearning(): Promise<{
|
|
74
|
+
initialize: () => Promise<boolean>;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
} | null>;
|
|
77
|
+
//# sourceMappingURL=autopilot-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autopilot-state.d.ts","sourceRoot":"","sources":["../../src/autopilot-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,eAAO,MAAM,SAAS,sBAAsB,CAAC;AAC7C,eAAO,MAAM,UAAU,2CAAsC,CAAC;AAC9D,eAAO,MAAM,QAAQ,yCAAoC,CAAC;AAQ1D,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,aAA2D,CAAC;AAE3F,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,aAAmE,CAAC;AAIlG,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CA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,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAoBxD;AAED,wBAAgB,OAAO,IAAI,iBAAiB,EAAE,CAa7C;AAID,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CA+E3D;AAID,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,YAAY,CAM3D;AAID,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAI9E;AAID,wBAAsB,eAAe,IAAI,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAUtH"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Shared State Module
|
|
3
|
+
*
|
|
4
|
+
* Centralizes state management, validation, and task discovery
|
|
5
|
+
* for both CLI command and MCP tools. Eliminates code duplication.
|
|
6
|
+
*
|
|
7
|
+
* ADR-072: Autopilot Integration
|
|
8
|
+
* Security: Addresses prototype pollution, NaN bypass, input validation
|
|
9
|
+
*/
|
|
10
|
+
// ── Constants ─────────────────────────────────────────────────
|
|
11
|
+
export const STATE_DIR = '.claude-flow/data';
|
|
12
|
+
export const STATE_FILE = `${STATE_DIR}/autopilot-state.json`;
|
|
13
|
+
export const LOG_FILE = `${STATE_DIR}/autopilot-log.json`;
|
|
14
|
+
/** Maximum entries kept in state.history (prevents unbounded growth) */
|
|
15
|
+
const MAX_HISTORY_ENTRIES = 50;
|
|
16
|
+
/** Maximum entries kept in the event log */
|
|
17
|
+
const MAX_LOG_ENTRIES = 1000;
|
|
18
|
+
/** Allowlist for valid task sources */
|
|
19
|
+
export const VALID_TASK_SOURCES = new Set(['team-tasks', 'swarm-tasks', 'file-checklist']);
|
|
20
|
+
/** Terminal task statuses */
|
|
21
|
+
export const TERMINAL_STATUSES = new Set(['completed', 'done', 'cancelled', 'skipped', 'failed']);
|
|
22
|
+
// ── Validation Helpers ────────────────────────────────────────
|
|
23
|
+
/**
|
|
24
|
+
* Sanitize a parsed JSON object to prevent prototype pollution.
|
|
25
|
+
* Removes __proto__, constructor, and prototype keys recursively.
|
|
26
|
+
*/
|
|
27
|
+
function sanitizeObject(obj) {
|
|
28
|
+
if (obj === null || typeof obj !== 'object')
|
|
29
|
+
return obj;
|
|
30
|
+
if (Array.isArray(obj))
|
|
31
|
+
return obj.map(sanitizeObject);
|
|
32
|
+
const clean = {};
|
|
33
|
+
for (const key of Object.keys(obj)) {
|
|
34
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype')
|
|
35
|
+
continue;
|
|
36
|
+
clean[key] = sanitizeObject(obj[key]);
|
|
37
|
+
}
|
|
38
|
+
return clean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Safe JSON.parse that prevents prototype pollution.
|
|
42
|
+
*/
|
|
43
|
+
export function safeJsonParse(raw) {
|
|
44
|
+
return sanitizeObject(JSON.parse(raw));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validate and coerce a numeric parameter. Returns the default if
|
|
48
|
+
* the input is NaN, undefined, or outside the allowed range.
|
|
49
|
+
*/
|
|
50
|
+
export function validateNumber(value, min, max, defaultValue) {
|
|
51
|
+
if (value === undefined || value === null)
|
|
52
|
+
return defaultValue;
|
|
53
|
+
const num = Number(value);
|
|
54
|
+
if (!Number.isFinite(num))
|
|
55
|
+
return defaultValue;
|
|
56
|
+
return Math.min(Math.max(min, Math.round(num)), max);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Validate task sources against the allowlist.
|
|
60
|
+
* Returns only valid sources; falls back to defaults if none are valid.
|
|
61
|
+
*/
|
|
62
|
+
export function validateTaskSources(sources) {
|
|
63
|
+
const defaults = ['team-tasks', 'swarm-tasks', 'file-checklist'];
|
|
64
|
+
if (!Array.isArray(sources))
|
|
65
|
+
return defaults;
|
|
66
|
+
const valid = sources
|
|
67
|
+
.filter((s) => typeof s === 'string')
|
|
68
|
+
.map(s => s.trim())
|
|
69
|
+
.filter(s => VALID_TASK_SOURCES.has(s));
|
|
70
|
+
return valid.length > 0 ? valid : defaults;
|
|
71
|
+
}
|
|
72
|
+
// ── State Management ──────────────────────────────────────────
|
|
73
|
+
export function getDefaultState() {
|
|
74
|
+
const crypto = require('crypto');
|
|
75
|
+
return {
|
|
76
|
+
sessionId: crypto.randomUUID(),
|
|
77
|
+
enabled: false,
|
|
78
|
+
startTime: Date.now(),
|
|
79
|
+
iterations: 0,
|
|
80
|
+
maxIterations: 50,
|
|
81
|
+
timeoutMinutes: 240,
|
|
82
|
+
taskSources: ['team-tasks', 'swarm-tasks', 'file-checklist'],
|
|
83
|
+
lastCheck: null,
|
|
84
|
+
history: [],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export function loadState() {
|
|
88
|
+
const fs = require('fs');
|
|
89
|
+
const path = require('path');
|
|
90
|
+
const filePath = path.resolve(STATE_FILE);
|
|
91
|
+
const defaults = getDefaultState();
|
|
92
|
+
try {
|
|
93
|
+
if (fs.existsSync(filePath)) {
|
|
94
|
+
const raw = safeJsonParse(fs.readFileSync(filePath, 'utf-8'));
|
|
95
|
+
const merged = { ...defaults, ...raw };
|
|
96
|
+
// Re-validate fields that could be tampered with
|
|
97
|
+
merged.maxIterations = validateNumber(merged.maxIterations, 1, 1000, 50);
|
|
98
|
+
merged.timeoutMinutes = validateNumber(merged.timeoutMinutes, 1, 1440, 240);
|
|
99
|
+
merged.iterations = validateNumber(merged.iterations, 0, 1000, 0);
|
|
100
|
+
merged.taskSources = validateTaskSources(merged.taskSources);
|
|
101
|
+
// Cap history to prevent unbounded growth
|
|
102
|
+
if (Array.isArray(merged.history) && merged.history.length > MAX_HISTORY_ENTRIES) {
|
|
103
|
+
merged.history = merged.history.slice(-MAX_HISTORY_ENTRIES);
|
|
104
|
+
}
|
|
105
|
+
return merged;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Corrupted state file — return defaults
|
|
110
|
+
}
|
|
111
|
+
return defaults;
|
|
112
|
+
}
|
|
113
|
+
export function saveState(state) {
|
|
114
|
+
const fs = require('fs');
|
|
115
|
+
const path = require('path');
|
|
116
|
+
const dir = path.resolve(STATE_DIR);
|
|
117
|
+
if (!fs.existsSync(dir))
|
|
118
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
119
|
+
// Cap history before saving
|
|
120
|
+
if (state.history.length > MAX_HISTORY_ENTRIES) {
|
|
121
|
+
state.history = state.history.slice(-MAX_HISTORY_ENTRIES);
|
|
122
|
+
}
|
|
123
|
+
const tmpFile = path.resolve(STATE_FILE) + '.tmp';
|
|
124
|
+
fs.writeFileSync(tmpFile, JSON.stringify(state, null, 2));
|
|
125
|
+
fs.renameSync(tmpFile, path.resolve(STATE_FILE));
|
|
126
|
+
}
|
|
127
|
+
export function appendLog(entry) {
|
|
128
|
+
const fs = require('fs');
|
|
129
|
+
const path = require('path');
|
|
130
|
+
const filePath = path.resolve(LOG_FILE);
|
|
131
|
+
const dir = path.resolve(STATE_DIR);
|
|
132
|
+
if (!fs.existsSync(dir))
|
|
133
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
134
|
+
let log = [];
|
|
135
|
+
try {
|
|
136
|
+
if (fs.existsSync(filePath)) {
|
|
137
|
+
log = safeJsonParse(fs.readFileSync(filePath, 'utf-8'));
|
|
138
|
+
if (!Array.isArray(log))
|
|
139
|
+
log = [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
log = [];
|
|
144
|
+
}
|
|
145
|
+
log.push(entry);
|
|
146
|
+
if (log.length > MAX_LOG_ENTRIES)
|
|
147
|
+
log = log.slice(-MAX_LOG_ENTRIES);
|
|
148
|
+
const tmpFile = filePath + '.tmp';
|
|
149
|
+
fs.writeFileSync(tmpFile, JSON.stringify(log, null, 2));
|
|
150
|
+
fs.renameSync(tmpFile, filePath);
|
|
151
|
+
}
|
|
152
|
+
export function loadLog() {
|
|
153
|
+
const fs = require('fs');
|
|
154
|
+
const path = require('path');
|
|
155
|
+
const filePath = path.resolve(LOG_FILE);
|
|
156
|
+
try {
|
|
157
|
+
if (fs.existsSync(filePath)) {
|
|
158
|
+
const result = safeJsonParse(fs.readFileSync(filePath, 'utf-8'));
|
|
159
|
+
return Array.isArray(result) ? result : [];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
// Corrupted log — return empty
|
|
164
|
+
}
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
// ── Task Discovery ────────────────────────────────────────────
|
|
168
|
+
export function discoverTasks(sources) {
|
|
169
|
+
const fs = require('fs');
|
|
170
|
+
const path = require('path');
|
|
171
|
+
const os = require('os');
|
|
172
|
+
const tasks = [];
|
|
173
|
+
// Only process valid sources
|
|
174
|
+
const validSources = sources.filter(s => VALID_TASK_SOURCES.has(s));
|
|
175
|
+
for (const source of validSources) {
|
|
176
|
+
if (source === 'team-tasks') {
|
|
177
|
+
const tasksDir = path.join(os.homedir(), '.claude', 'tasks');
|
|
178
|
+
try {
|
|
179
|
+
if (fs.existsSync(tasksDir)) {
|
|
180
|
+
const teams = fs.readdirSync(tasksDir, { withFileTypes: true });
|
|
181
|
+
for (const team of teams) {
|
|
182
|
+
if (!team.isDirectory())
|
|
183
|
+
continue;
|
|
184
|
+
const teamDir = path.join(tasksDir, team.name);
|
|
185
|
+
const files = fs.readdirSync(teamDir).filter((f) => f.endsWith('.json'));
|
|
186
|
+
for (const file of files) {
|
|
187
|
+
try {
|
|
188
|
+
const data = safeJsonParse(fs.readFileSync(path.join(teamDir, file), 'utf-8'));
|
|
189
|
+
tasks.push({
|
|
190
|
+
id: String(data.id || file.replace('.json', '')),
|
|
191
|
+
subject: String(data.subject || data.title || file),
|
|
192
|
+
status: String(data.status || 'unknown'),
|
|
193
|
+
source: 'team-tasks',
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
catch { /* skip individual file */ }
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch { /* skip source */ }
|
|
202
|
+
}
|
|
203
|
+
if (source === 'swarm-tasks') {
|
|
204
|
+
const swarmFile = path.resolve('.claude-flow/swarm-tasks.json');
|
|
205
|
+
try {
|
|
206
|
+
if (fs.existsSync(swarmFile)) {
|
|
207
|
+
const data = safeJsonParse(fs.readFileSync(swarmFile, 'utf-8'));
|
|
208
|
+
const swarmTasks = Array.isArray(data) ? data : (data.tasks || []);
|
|
209
|
+
for (const t of swarmTasks) {
|
|
210
|
+
if (t && typeof t === 'object') {
|
|
211
|
+
const task = t;
|
|
212
|
+
tasks.push({
|
|
213
|
+
id: String(task.id || task.taskId || `swarm-${tasks.length}`),
|
|
214
|
+
subject: String(task.subject || task.description || task.name || 'Unnamed task'),
|
|
215
|
+
status: String(task.status || 'unknown'),
|
|
216
|
+
source: 'swarm-tasks',
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
catch { /* skip source */ }
|
|
223
|
+
}
|
|
224
|
+
if (source === 'file-checklist') {
|
|
225
|
+
const checklistFile = path.resolve('.claude-flow/data/checklist.json');
|
|
226
|
+
try {
|
|
227
|
+
if (fs.existsSync(checklistFile)) {
|
|
228
|
+
const data = safeJsonParse(fs.readFileSync(checklistFile, 'utf-8'));
|
|
229
|
+
const items = Array.isArray(data) ? data : (data.items || []);
|
|
230
|
+
for (const item of items) {
|
|
231
|
+
if (item && typeof item === 'object') {
|
|
232
|
+
const i = item;
|
|
233
|
+
tasks.push({
|
|
234
|
+
id: String(i.id || `check-${tasks.length}`),
|
|
235
|
+
subject: String(i.subject || i.text || i.description || 'Unnamed item'),
|
|
236
|
+
status: String(i.status || (i.done ? 'completed' : 'pending')),
|
|
237
|
+
source: 'file-checklist',
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
catch { /* skip source */ }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return tasks;
|
|
247
|
+
}
|
|
248
|
+
// ── Progress Helpers ──────────────────────────────────────────
|
|
249
|
+
export function isTerminal(status) {
|
|
250
|
+
return TERMINAL_STATUSES.has(status.toLowerCase());
|
|
251
|
+
}
|
|
252
|
+
export function getProgress(tasks) {
|
|
253
|
+
const completed = tasks.filter(t => isTerminal(t.status)).length;
|
|
254
|
+
const total = tasks.length;
|
|
255
|
+
const percent = total === 0 ? 100 : Math.round((completed / total) * 100);
|
|
256
|
+
const incomplete = tasks.filter(t => !isTerminal(t.status));
|
|
257
|
+
return { completed, total, percent, incomplete };
|
|
258
|
+
}
|
|
259
|
+
// ── Reward Calculation ────────────────────────────────────────
|
|
260
|
+
export function calculateReward(iterations, durationMs) {
|
|
261
|
+
const iterFactor = (1 - iterations / (iterations + 10)) * 0.6;
|
|
262
|
+
const timeFactor = (1 - Math.min(durationMs / 3600000, 1)) * 0.4;
|
|
263
|
+
return Math.round((iterFactor + timeFactor) * 100) / 100;
|
|
264
|
+
}
|
|
265
|
+
// ── Learning Integration ──────────────────────────────────────
|
|
266
|
+
export async function tryLoadLearning() {
|
|
267
|
+
try {
|
|
268
|
+
const modPath = 'agentic-flow/dist/coordination/autopilot-learning.js';
|
|
269
|
+
const mod = await import(/* webpackIgnore: true */ modPath).catch(() => null);
|
|
270
|
+
if (mod?.AutopilotLearning) {
|
|
271
|
+
const instance = new mod.AutopilotLearning();
|
|
272
|
+
if (await instance.initialize())
|
|
273
|
+
return instance;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
catch { /* not available */ }
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL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AAiB,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,CAAC;YAC7C,IAAI,MAAM,QAAQ,CAAC,UAAU,EAAE;gBAAE,OAAO,QAAQ,CAAC;QACnD,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI Autopilot Command
|
|
3
|
+
* Persistent swarm completion — keeps agents working until ALL tasks are done.
|
|
4
|
+
*
|
|
5
|
+
* ADR-072: Autopilot Integration
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from '../types.js';
|
|
8
|
+
export declare function autopilotCheck(): Promise<{
|
|
9
|
+
allowStop: boolean;
|
|
10
|
+
reason: string;
|
|
11
|
+
continueWith?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const autopilotCommand: Command;
|
|
14
|
+
export default autopilotCommand;
|
|
15
|
+
//# sourceMappingURL=autopilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../../../src/commands/autopilot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAU1E,wBAAsB,cAAc,IAAI,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA2E7G;AAwRD,eAAO,MAAM,gBAAgB,EAAE,OA6B9B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|