copilot-flow 0.3.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.
- package/README.md +300 -0
- package/bin/copilot-flow.js +13 -0
- package/dist/agents/executor.d.ts +24 -0
- package/dist/agents/executor.d.ts.map +1 -0
- package/dist/agents/executor.js +85 -0
- package/dist/agents/executor.js.map +1 -0
- package/dist/agents/pool.d.ts +22 -0
- package/dist/agents/pool.d.ts.map +1 -0
- package/dist/agents/pool.js +84 -0
- package/dist/agents/pool.js.map +1 -0
- package/dist/agents/registry.d.ts +16 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +140 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +105 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +119 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/hooks.d.ts +3 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/hooks.js +75 -0
- package/dist/commands/hooks.js.map +1 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +31 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +37 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/memory.d.ts +3 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +109 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/route.d.ts +3 -0
- package/dist/commands/route.d.ts.map +1 -0
- package/dist/commands/route.js +36 -0
- package/dist/commands/route.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +58 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/swarm.d.ts +3 -0
- package/dist/commands/swarm.d.ts.map +1 -0
- package/dist/commands/swarm.js +106 -0
- package/dist/commands/swarm.js.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +95 -0
- package/dist/config.js.map +1 -0
- package/dist/core/client-manager.d.ts +19 -0
- package/dist/core/client-manager.d.ts.map +1 -0
- package/dist/core/client-manager.js +69 -0
- package/dist/core/client-manager.js.map +1 -0
- package/dist/core/error-handler.d.ts +25 -0
- package/dist/core/error-handler.d.ts.map +1 -0
- package/dist/core/error-handler.js +135 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/retry.d.ts +56 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +107 -0
- package/dist/core/retry.js.map +1 -0
- package/dist/hooks/executor.d.ts +25 -0
- package/dist/hooks/executor.d.ts.map +1 -0
- package/dist/hooks/executor.js +57 -0
- package/dist/hooks/executor.js.map +1 -0
- package/dist/hooks/registry.d.ts +22 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/registry.js +36 -0
- package/dist/hooks/registry.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/store.d.ts +32 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +149 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/output.d.ts +26 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +157 -0
- package/dist/output.js.map +1 -0
- package/dist/swarm/coordinator.d.ts +20 -0
- package/dist/swarm/coordinator.d.ts.map +1 -0
- package/dist/swarm/coordinator.js +129 -0
- package/dist/swarm/coordinator.js.map +1 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SQLite-backed namespaced key-value memory store.
|
|
4
|
+
* Used by agents to share state and by the CLI to persist data between runs.
|
|
5
|
+
*
|
|
6
|
+
* Uses Node.js built-in `node:sqlite` (available since Node 22.5) to avoid
|
|
7
|
+
* native addon compilation requirements.
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.MemoryStore = void 0;
|
|
14
|
+
exports.getMemoryStore = getMemoryStore;
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const node_sqlite_1 = require("node:sqlite");
|
|
17
|
+
const SCHEMA = `
|
|
18
|
+
CREATE TABLE IF NOT EXISTS entries (
|
|
19
|
+
id TEXT PRIMARY KEY,
|
|
20
|
+
namespace TEXT NOT NULL,
|
|
21
|
+
key TEXT NOT NULL,
|
|
22
|
+
value TEXT NOT NULL,
|
|
23
|
+
tags TEXT NOT NULL DEFAULT '[]',
|
|
24
|
+
created_at INTEGER NOT NULL,
|
|
25
|
+
expires_at INTEGER
|
|
26
|
+
);
|
|
27
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_ns_key ON entries (namespace, key);
|
|
28
|
+
CREATE INDEX IF NOT EXISTS idx_namespace ON entries (namespace);
|
|
29
|
+
CREATE INDEX IF NOT EXISTS idx_tags ON entries (tags);
|
|
30
|
+
`;
|
|
31
|
+
class MemoryStore {
|
|
32
|
+
db;
|
|
33
|
+
constructor(dbPath = path_1.default.join('.copilot-flow', 'memory.db')) {
|
|
34
|
+
const absPath = path_1.default.resolve(dbPath);
|
|
35
|
+
// Ensure parent directory exists
|
|
36
|
+
const dir = path_1.default.dirname(absPath);
|
|
37
|
+
const { mkdirSync, existsSync } = require('fs');
|
|
38
|
+
if (!existsSync(dir))
|
|
39
|
+
mkdirSync(dir, { recursive: true });
|
|
40
|
+
this.db = new node_sqlite_1.DatabaseSync(absPath);
|
|
41
|
+
this.db.exec(SCHEMA);
|
|
42
|
+
// Enable WAL for better concurrent read performance
|
|
43
|
+
this.db.exec('PRAGMA journal_mode = WAL');
|
|
44
|
+
}
|
|
45
|
+
/** Store a value under namespace/key. Upserts if key already exists. */
|
|
46
|
+
store(namespace, key, value, opts = {}) {
|
|
47
|
+
this._pruneExpired();
|
|
48
|
+
const id = `${namespace}:${key}`;
|
|
49
|
+
const now = Date.now();
|
|
50
|
+
const expiresAt = opts.ttlMs != null ? now + opts.ttlMs : null;
|
|
51
|
+
const tags = JSON.stringify(opts.tags ?? []);
|
|
52
|
+
this.db
|
|
53
|
+
.prepare(`INSERT INTO entries (id, namespace, key, value, tags, created_at, expires_at)
|
|
54
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
55
|
+
ON CONFLICT(namespace, key) DO UPDATE SET
|
|
56
|
+
value = excluded.value,
|
|
57
|
+
tags = excluded.tags,
|
|
58
|
+
created_at = excluded.created_at,
|
|
59
|
+
expires_at = excluded.expires_at`)
|
|
60
|
+
.run(id, namespace, key, value, tags, now, expiresAt);
|
|
61
|
+
}
|
|
62
|
+
/** Retrieve a value by namespace and key. Returns null if not found or expired. */
|
|
63
|
+
retrieve(namespace, key) {
|
|
64
|
+
this._pruneExpired();
|
|
65
|
+
const row = this.db
|
|
66
|
+
.prepare(`SELECT value FROM entries WHERE namespace = ? AND key = ?
|
|
67
|
+
AND (expires_at IS NULL OR expires_at > ?)`)
|
|
68
|
+
.get(namespace, key, Date.now());
|
|
69
|
+
return row?.value ?? null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Search entries in a namespace by substring match on key or value.
|
|
73
|
+
* Returns up to `limit` results (default 20).
|
|
74
|
+
*/
|
|
75
|
+
search(namespace, query, limit = 20) {
|
|
76
|
+
this._pruneExpired();
|
|
77
|
+
const like = `%${query}%`;
|
|
78
|
+
const rows = this.db
|
|
79
|
+
.prepare(`SELECT id, namespace, key, value, tags, created_at, expires_at
|
|
80
|
+
FROM entries
|
|
81
|
+
WHERE namespace = ?
|
|
82
|
+
AND (key LIKE ? OR value LIKE ?)
|
|
83
|
+
AND (expires_at IS NULL OR expires_at > ?)
|
|
84
|
+
ORDER BY created_at DESC
|
|
85
|
+
LIMIT ?`)
|
|
86
|
+
.all(namespace, like, like, Date.now(), limit);
|
|
87
|
+
return rows.map(r => ({
|
|
88
|
+
id: r.id,
|
|
89
|
+
namespace: r.namespace,
|
|
90
|
+
key: r.key,
|
|
91
|
+
value: r.value,
|
|
92
|
+
tags: JSON.parse(r.tags),
|
|
93
|
+
createdAt: r.created_at,
|
|
94
|
+
expiresAt: r.expires_at ?? undefined,
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
/** List all non-expired entries in a namespace. */
|
|
98
|
+
list(namespace) {
|
|
99
|
+
this._pruneExpired();
|
|
100
|
+
const rows = this.db
|
|
101
|
+
.prepare(`SELECT id, namespace, key, value, tags, created_at, expires_at
|
|
102
|
+
FROM entries
|
|
103
|
+
WHERE namespace = ? AND (expires_at IS NULL OR expires_at > ?)
|
|
104
|
+
ORDER BY created_at DESC`)
|
|
105
|
+
.all(namespace, Date.now());
|
|
106
|
+
return rows.map(r => ({
|
|
107
|
+
id: r.id,
|
|
108
|
+
namespace: r.namespace,
|
|
109
|
+
key: r.key,
|
|
110
|
+
value: r.value,
|
|
111
|
+
tags: JSON.parse(r.tags),
|
|
112
|
+
createdAt: r.created_at,
|
|
113
|
+
expiresAt: r.expires_at ?? undefined,
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/** Delete a specific key from a namespace. */
|
|
117
|
+
delete(namespace, key) {
|
|
118
|
+
const result = this.db
|
|
119
|
+
.prepare(`DELETE FROM entries WHERE namespace = ? AND key = ?`)
|
|
120
|
+
.run(namespace, key);
|
|
121
|
+
return result.changes > 0;
|
|
122
|
+
}
|
|
123
|
+
/** Delete all entries in a namespace. Returns the number of deleted entries. */
|
|
124
|
+
clear(namespace) {
|
|
125
|
+
const result = this.db
|
|
126
|
+
.prepare(`DELETE FROM entries WHERE namespace = ?`)
|
|
127
|
+
.run(namespace);
|
|
128
|
+
return result.changes;
|
|
129
|
+
}
|
|
130
|
+
/** Close the database connection. */
|
|
131
|
+
close() {
|
|
132
|
+
this.db.close();
|
|
133
|
+
}
|
|
134
|
+
_pruneExpired() {
|
|
135
|
+
this.db
|
|
136
|
+
.prepare(`DELETE FROM entries WHERE expires_at IS NOT NULL AND expires_at <= ?`)
|
|
137
|
+
.run(Date.now());
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.MemoryStore = MemoryStore;
|
|
141
|
+
/** Process-wide default memory store. Lazily initialised. */
|
|
142
|
+
let _defaultStore = null;
|
|
143
|
+
function getMemoryStore(dbPath) {
|
|
144
|
+
if (!_defaultStore) {
|
|
145
|
+
_defaultStore = new MemoryStore(dbPath);
|
|
146
|
+
}
|
|
147
|
+
return _defaultStore;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/memory/store.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AA2KH,wCAKC;AA9KD,gDAAwB;AACxB,6CAA2C;AAG3C,MAAM,MAAM,GAAG;;;;;;;;;;;;;CAad,CAAC;AAEF,MAAa,WAAW;IACd,EAAE,CAAe;IAEzB,YAAY,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC;QAC1D,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrC,iCAAiC;QACjC,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,EAAE,SAAS,EAAE,UA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
4
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
5
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
6
|
+
export declare const output: {
|
|
7
|
+
debug: (msg: string) => void;
|
|
8
|
+
info: (msg: string) => void;
|
|
9
|
+
success: (msg: string) => void;
|
|
10
|
+
warn: (msg: string) => void;
|
|
11
|
+
error: (msg: string) => void;
|
|
12
|
+
/** Print a line without any prefix — for raw output. */
|
|
13
|
+
print: (msg: string) => void;
|
|
14
|
+
/** Print a dimmed/secondary line. */
|
|
15
|
+
dim: (msg: string) => void;
|
|
16
|
+
/** Print a section header. */
|
|
17
|
+
header: (title: string) => void;
|
|
18
|
+
/** Print a blank line. */
|
|
19
|
+
blank: () => void;
|
|
20
|
+
};
|
|
21
|
+
/** Default onRetry callback for CLI commands — logs retry attempt to stderr. */
|
|
22
|
+
export declare function logRetry(error: Error, attempt: number, nextDelayMs: number): void;
|
|
23
|
+
export declare function printTable(rows: Array<[string, string]>): void;
|
|
24
|
+
export declare function withSpinner<T>(text: string, fn: () => Promise<T>): Promise<T>;
|
|
25
|
+
export declare function agentBadge(type: string): string;
|
|
26
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAatE,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAEjD;AAQD,eAAO,MAAM,MAAM;iBACJ,MAAM;gBAGP,MAAM;mBAGH,MAAM;gBAGT,MAAM;iBAGL,MAAM;IAGnB,wDAAwD;iBAC3C,MAAM;IAGnB,qCAAqC;eAC1B,MAAM;IAGjB,8BAA8B;oBACd,MAAM;IAOtB,0BAA0B;;CAI3B,CAAC;AAIF,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAIjF;AAID,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAQ9D;AAID,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAYZ;AAID,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiB/C"}
|
package/dist/output.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Terminal output utilities: colour, spinners, tables, and structured logging.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.output = void 0;
|
|
43
|
+
exports.setLogLevel = setLogLevel;
|
|
44
|
+
exports.logRetry = logRetry;
|
|
45
|
+
exports.printTable = printTable;
|
|
46
|
+
exports.withSpinner = withSpinner;
|
|
47
|
+
exports.agentBadge = agentBadge;
|
|
48
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
49
|
+
const LEVEL_RANK = {
|
|
50
|
+
debug: 0,
|
|
51
|
+
info: 1,
|
|
52
|
+
warn: 2,
|
|
53
|
+
error: 3,
|
|
54
|
+
silent: 4,
|
|
55
|
+
};
|
|
56
|
+
let currentLevel = process.env.COPILOT_FLOW_LOG_LEVEL ?? 'info';
|
|
57
|
+
function setLogLevel(level) {
|
|
58
|
+
currentLevel = level;
|
|
59
|
+
}
|
|
60
|
+
function shouldLog(level) {
|
|
61
|
+
return LEVEL_RANK[level] >= LEVEL_RANK[currentLevel];
|
|
62
|
+
}
|
|
63
|
+
// ─── Core log functions ───────────────────────────────────────────────────────
|
|
64
|
+
exports.output = {
|
|
65
|
+
debug: (msg) => {
|
|
66
|
+
if (shouldLog('debug'))
|
|
67
|
+
console.log(chalk_1.default.gray(`[debug] ${msg}`));
|
|
68
|
+
},
|
|
69
|
+
info: (msg) => {
|
|
70
|
+
if (shouldLog('info'))
|
|
71
|
+
console.log(chalk_1.default.blue('ℹ') + ' ' + msg);
|
|
72
|
+
},
|
|
73
|
+
success: (msg) => {
|
|
74
|
+
if (shouldLog('info'))
|
|
75
|
+
console.log(chalk_1.default.green('✓') + ' ' + msg);
|
|
76
|
+
},
|
|
77
|
+
warn: (msg) => {
|
|
78
|
+
if (shouldLog('warn'))
|
|
79
|
+
console.warn(chalk_1.default.yellow('⚠') + ' ' + chalk_1.default.yellow(msg));
|
|
80
|
+
},
|
|
81
|
+
error: (msg) => {
|
|
82
|
+
if (shouldLog('error'))
|
|
83
|
+
console.error(chalk_1.default.red('✗') + ' ' + chalk_1.default.red(msg));
|
|
84
|
+
},
|
|
85
|
+
/** Print a line without any prefix — for raw output. */
|
|
86
|
+
print: (msg) => {
|
|
87
|
+
if (shouldLog('info'))
|
|
88
|
+
console.log(msg);
|
|
89
|
+
},
|
|
90
|
+
/** Print a dimmed/secondary line. */
|
|
91
|
+
dim: (msg) => {
|
|
92
|
+
if (shouldLog('info'))
|
|
93
|
+
console.log(chalk_1.default.dim(msg));
|
|
94
|
+
},
|
|
95
|
+
/** Print a section header. */
|
|
96
|
+
header: (title) => {
|
|
97
|
+
if (shouldLog('info')) {
|
|
98
|
+
console.log('');
|
|
99
|
+
console.log(chalk_1.default.bold(chalk_1.default.cyan(title)));
|
|
100
|
+
console.log(chalk_1.default.cyan('─'.repeat(Math.min(title.length + 4, 60))));
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
/** Print a blank line. */
|
|
104
|
+
blank: () => {
|
|
105
|
+
if (shouldLog('info'))
|
|
106
|
+
console.log('');
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
// ─── Retry progress reporter ──────────────────────────────────────────────────
|
|
110
|
+
/** Default onRetry callback for CLI commands — logs retry attempt to stderr. */
|
|
111
|
+
function logRetry(error, attempt, nextDelayMs) {
|
|
112
|
+
exports.output.warn(`Retry ${attempt} after ${nextDelayMs}ms — ${error.message.slice(0, 80)}`);
|
|
113
|
+
}
|
|
114
|
+
// ─── Simple key-value table ───────────────────────────────────────────────────
|
|
115
|
+
function printTable(rows) {
|
|
116
|
+
if (!shouldLog('info'))
|
|
117
|
+
return;
|
|
118
|
+
const maxKey = Math.max(...rows.map(([k]) => k.length));
|
|
119
|
+
for (const [key, value] of rows) {
|
|
120
|
+
console.log(chalk_1.default.dim(key.padEnd(maxKey + 2)) + value);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ─── Spinner wrapper (async) ──────────────────────────────────────────────────
|
|
124
|
+
async function withSpinner(text, fn) {
|
|
125
|
+
// Use dynamic import for ESM-only ora
|
|
126
|
+
const { default: ora } = await Promise.resolve().then(() => __importStar(require('ora')));
|
|
127
|
+
const spinner = ora(text).start();
|
|
128
|
+
try {
|
|
129
|
+
const result = await fn();
|
|
130
|
+
spinner.succeed();
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
spinner.fail();
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// ─── Agent status badge ───────────────────────────────────────────────────────
|
|
139
|
+
function agentBadge(type) {
|
|
140
|
+
const colours = {
|
|
141
|
+
coder: chalk_1.default.blue,
|
|
142
|
+
researcher: chalk_1.default.cyan,
|
|
143
|
+
tester: chalk_1.default.green,
|
|
144
|
+
reviewer: chalk_1.default.yellow,
|
|
145
|
+
architect: chalk_1.default.magenta,
|
|
146
|
+
coordinator: chalk_1.default.white,
|
|
147
|
+
analyst: chalk_1.default.cyan,
|
|
148
|
+
debugger: chalk_1.default.red,
|
|
149
|
+
documenter: chalk_1.default.gray,
|
|
150
|
+
optimizer: chalk_1.default.yellow,
|
|
151
|
+
'security-auditor': chalk_1.default.red,
|
|
152
|
+
'performance-engineer': chalk_1.default.magenta,
|
|
153
|
+
};
|
|
154
|
+
const colour = colours[type] ?? chalk_1.default.white;
|
|
155
|
+
return colour(`[${type}]`);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBH,kCAEC;AAiDD,4BAIC;AAID,gCAQC;AAID,kCAeC;AAID,gCAiBC;AA1HD,kDAA0B;AAI1B,MAAM,UAAU,GAA6B;IAC3C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,IAAI,YAAY,GACb,OAAO,CAAC,GAAG,CAAC,sBAA+C,IAAI,MAAM,CAAC;AAEzE,SAAgB,WAAW,CAAC,KAAe;IACzC,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC;AAED,SAAS,SAAS,CAAC,KAAe;IAChC,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;AACvD,CAAC;AAED,iFAAiF;AAEpE,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,GAAW,EAAE,EAAE;QACrB,IAAI,SAAS,CAAC,OAAO,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;QACpB,IAAI,SAAS,CAAC,MAAM,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE;QACvB,IAA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KAAK,EAAE,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,iFAAiF;AAEjF,SAAgB,UAAU,CAAC,IAAY;IACrC,MAAM,OAAO,GAAsC;QACjD,KAAK,EAAE,eAAK,CAAC,IAAI;QACjB,UAAU,EAAE,eAAK,CAAC,IAAI;QACtB,MAAM,EAAE,eAAK,CAAC,KAAK;QACnB,QAAQ,EAAE,eAAK,CAAC,MAAM;QACtB,SAAS,EAAE,eAAK,CAAC,OAAO;QACxB,WAAW,EAAE,eAAK,CAAC,KAAK;QACxB,OAAO,EAAE,eAAK,CAAC,IAAI;QACnB,QAAQ,EAAE,eAAK,CAAC,GAAG;QACnB,UAAU,EAAE,eAAK,CAAC,IAAI;QACtB,SAAS,EAAE,eAAK,CAAC,MAAM;QACvB,kBAAkB,EAAE,eAAK,CAAC,GAAG;QAC7B,sBAAsB,EAAE,eAAK,CAAC,OAAO;KACtC,CAAC;IACF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,eAAK,CAAC,KAAK,CAAC;IAC5C,OAAO,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm coordinator — orchestrates multiple Copilot sessions as a swarm.
|
|
3
|
+
* Supports hierarchical, mesh, and sequential topologies.
|
|
4
|
+
*/
|
|
5
|
+
import type { SwarmTask, SwarmTopology, AgentResult } from '../types.js';
|
|
6
|
+
export interface SwarmOptions {
|
|
7
|
+
/** Called whenever an agent produces a text chunk. */
|
|
8
|
+
onProgress?: (taskId: string, agentType: string, chunk: string) => void;
|
|
9
|
+
/** Namespace used for inter-agent memory sharing. Default: 'swarm' */
|
|
10
|
+
memoryNamespace?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Run a set of tasks as a coordinated swarm.
|
|
14
|
+
*
|
|
15
|
+
* - **sequential**: Tasks run one by one in order.
|
|
16
|
+
* - **hierarchical**: Independent tasks run in parallel; dependent tasks wait.
|
|
17
|
+
* - **mesh**: All tasks run in parallel with shared memory.
|
|
18
|
+
*/
|
|
19
|
+
export declare function runSwarm(tasks: SwarmTask[], topology?: SwarmTopology, options?: SwarmOptions): Promise<Map<string, AgentResult>>;
|
|
20
|
+
//# sourceMappingURL=coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/swarm/coordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzE,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,QAAQ,GAAE,aAA8B,EACxC,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAwBnC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Swarm coordinator — orchestrates multiple Copilot sessions as a swarm.
|
|
4
|
+
* Supports hierarchical, mesh, and sequential topologies.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.runSwarm = runSwarm;
|
|
8
|
+
const executor_js_1 = require("../agents/executor.js");
|
|
9
|
+
const executor_js_2 = require("../hooks/executor.js");
|
|
10
|
+
const store_js_1 = require("../memory/store.js");
|
|
11
|
+
const output_js_1 = require("../output.js");
|
|
12
|
+
/**
|
|
13
|
+
* Run a set of tasks as a coordinated swarm.
|
|
14
|
+
*
|
|
15
|
+
* - **sequential**: Tasks run one by one in order.
|
|
16
|
+
* - **hierarchical**: Independent tasks run in parallel; dependent tasks wait.
|
|
17
|
+
* - **mesh**: All tasks run in parallel with shared memory.
|
|
18
|
+
*/
|
|
19
|
+
async function runSwarm(tasks, topology = 'hierarchical', options = {}) {
|
|
20
|
+
const results = new Map();
|
|
21
|
+
const ns = options.memoryNamespace ?? 'swarm';
|
|
22
|
+
await executor_js_2.hooks.swarmStart({ topology, taskCount: tasks.length });
|
|
23
|
+
output_js_1.output.info(`Starting ${topology} swarm with ${tasks.length} task(s)`);
|
|
24
|
+
switch (topology) {
|
|
25
|
+
case 'sequential':
|
|
26
|
+
await runSequential(tasks, results, ns, options);
|
|
27
|
+
break;
|
|
28
|
+
case 'hierarchical':
|
|
29
|
+
await runHierarchical(tasks, results, ns, options);
|
|
30
|
+
break;
|
|
31
|
+
case 'mesh':
|
|
32
|
+
await runMesh(tasks, results, ns, options);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
await executor_js_2.hooks.swarmEnd({ topology, results: Object.fromEntries(results) });
|
|
36
|
+
const succeeded = [...results.values()].filter(r => r.success).length;
|
|
37
|
+
output_js_1.output.success(`Swarm complete: ${succeeded}/${tasks.length} tasks succeeded`);
|
|
38
|
+
return results;
|
|
39
|
+
}
|
|
40
|
+
/** Run tasks one after another. Results of earlier tasks are stored in memory. */
|
|
41
|
+
async function runSequential(tasks, results, ns, options) {
|
|
42
|
+
const mem = (0, store_js_1.getMemoryStore)();
|
|
43
|
+
for (const task of tasks) {
|
|
44
|
+
output_js_1.output.info(`${(0, output_js_1.agentBadge)(task.agentType)} Running task: ${task.id}`);
|
|
45
|
+
const result = await (0, executor_js_1.runAgentTask)(task.agentType, buildPrompt(task, results, mem, ns), {
|
|
46
|
+
retryConfig: task.retryConfig,
|
|
47
|
+
onChunk: options.onProgress
|
|
48
|
+
? chunk => options.onProgress(task.id, task.agentType, chunk)
|
|
49
|
+
: undefined,
|
|
50
|
+
});
|
|
51
|
+
results.set(task.id, result);
|
|
52
|
+
if (result.success) {
|
|
53
|
+
mem.store(ns, `task:${task.id}:result`, result.output, { ttlMs: 60 * 60 * 1000 });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Run independent tasks in parallel; tasks with dependencies wait.
|
|
59
|
+
* Uses a simple wave/level-based execution model.
|
|
60
|
+
*/
|
|
61
|
+
async function runHierarchical(tasks, results, ns, options) {
|
|
62
|
+
const mem = (0, store_js_1.getMemoryStore)();
|
|
63
|
+
const remaining = [...tasks];
|
|
64
|
+
while (remaining.length > 0) {
|
|
65
|
+
// Find tasks whose dependencies are all satisfied
|
|
66
|
+
const ready = remaining.filter(t => (t.dependsOn ?? []).every(dep => results.has(dep)));
|
|
67
|
+
if (ready.length === 0) {
|
|
68
|
+
throw new Error(`Swarm deadlock — no tasks are runnable. Remaining: ${remaining.map(t => t.id).join(', ')}`);
|
|
69
|
+
}
|
|
70
|
+
output_js_1.output.info(`Running ${ready.length} task(s) in parallel`);
|
|
71
|
+
const waveResults = await Promise.all(ready.map(task => (0, executor_js_1.runAgentTask)(task.agentType, buildPrompt(task, results, mem, ns), {
|
|
72
|
+
retryConfig: task.retryConfig,
|
|
73
|
+
onChunk: options.onProgress
|
|
74
|
+
? chunk => options.onProgress(task.id, task.agentType, chunk)
|
|
75
|
+
: undefined,
|
|
76
|
+
}).then(r => ({ task, result: r }))));
|
|
77
|
+
for (const { task, result } of waveResults) {
|
|
78
|
+
results.set(task.id, result);
|
|
79
|
+
remaining.splice(remaining.indexOf(task), 1);
|
|
80
|
+
if (result.success) {
|
|
81
|
+
mem.store(ns, `task:${task.id}:result`, result.output, { ttlMs: 60 * 60 * 1000 });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** All tasks run concurrently with shared memory. */
|
|
87
|
+
async function runMesh(tasks, results, ns, options) {
|
|
88
|
+
const mem = (0, store_js_1.getMemoryStore)();
|
|
89
|
+
const settled = await Promise.allSettled(tasks.map(task => (0, executor_js_1.runAgentTask)(task.agentType, buildPrompt(task, results, mem, ns), {
|
|
90
|
+
retryConfig: task.retryConfig,
|
|
91
|
+
onChunk: options.onProgress
|
|
92
|
+
? chunk => options.onProgress(task.id, task.agentType, chunk)
|
|
93
|
+
: undefined,
|
|
94
|
+
}).then(r => ({ task, result: r }))));
|
|
95
|
+
for (const s of settled) {
|
|
96
|
+
if (s.status === 'fulfilled') {
|
|
97
|
+
const { task, result } = s.value;
|
|
98
|
+
results.set(task.id, result);
|
|
99
|
+
if (result.success) {
|
|
100
|
+
mem.store(ns, `task:${task.id}:result`, result.output, { ttlMs: 60 * 60 * 1000 });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Enrich a task's prompt with available context from already-completed tasks.
|
|
107
|
+
* Injects results from dependencies into the prompt so agents can build on each other.
|
|
108
|
+
*/
|
|
109
|
+
function buildPrompt(task, results, mem, ns) {
|
|
110
|
+
let prompt = task.prompt;
|
|
111
|
+
const depContext = [];
|
|
112
|
+
for (const dep of task.dependsOn ?? []) {
|
|
113
|
+
const cached = mem.retrieve(ns, `task:${dep}:result`);
|
|
114
|
+
if (cached) {
|
|
115
|
+
depContext.push(`--- Output from task "${dep}" ---\n${cached}`);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const result = results.get(dep);
|
|
119
|
+
if (result?.success) {
|
|
120
|
+
depContext.push(`--- Output from task "${dep}" ---\n${result.output}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (depContext.length > 0) {
|
|
125
|
+
prompt = `Context from previous tasks:\n\n${depContext.join('\n\n')}\n\n---\n\n${prompt}`;
|
|
126
|
+
}
|
|
127
|
+
return prompt;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=coordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator.js","sourceRoot":"","sources":["../../src/swarm/coordinator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAsBH,4BA4BC;AAhDD,uDAAqD;AACrD,sDAA6C;AAC7C,iDAAoD;AACpD,4CAAkD;AAUlD;;;;;;GAMG;AACI,KAAK,UAAU,QAAQ,CAC5B,KAAkB,EAClB,WAA0B,cAAc,EACxC,UAAwB,EAAE;IAE1B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC/C,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC;IAE9C,MAAM,mBAAK,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9D,kBAAM,CAAC,IAAI,CAAC,YAAY,QAAQ,eAAe,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC;IAEvE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,YAAY;YACf,MAAM,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACjD,MAAM;QACR,KAAK,cAAc;YACjB,MAAM,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM;QACR,KAAK,MAAM;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YAC3C,MAAM;IACV,CAAC;IAED,MAAM,mBAAK,C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O,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;gBACpB,UAAU,CAAC,IAAI,CAAC,yBAAyB,GAAG,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,GAAG,mCAAmC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,MAAM,EAAE,CAAC;IAC5F,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TypeScript types and interfaces for copilot-flow.
|
|
3
|
+
*/
|
|
4
|
+
import type { RetryConfig } from './core/retry.js';
|
|
5
|
+
export declare const AGENT_TYPE_LIST: readonly ["coder", "researcher", "tester", "reviewer", "architect", "coordinator", "analyst", "debugger", "documenter", "optimizer", "security-auditor", "performance-engineer"];
|
|
6
|
+
export type AgentType = (typeof AGENT_TYPE_LIST)[number];
|
|
7
|
+
export interface AgentDefinition {
|
|
8
|
+
model: string;
|
|
9
|
+
systemMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
capabilities: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface AgentState {
|
|
14
|
+
id: string;
|
|
15
|
+
type: AgentType;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
status: 'idle' | 'busy' | 'error' | 'terminated';
|
|
18
|
+
task?: string;
|
|
19
|
+
startedAt: number;
|
|
20
|
+
completedAt?: number;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AgentResult {
|
|
24
|
+
agentType: AgentType;
|
|
25
|
+
agentId: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
output: string;
|
|
28
|
+
durationMs: number;
|
|
29
|
+
attempts: number;
|
|
30
|
+
success: boolean;
|
|
31
|
+
error?: string;
|
|
32
|
+
}
|
|
33
|
+
export type SwarmTopology = 'hierarchical' | 'mesh' | 'sequential';
|
|
34
|
+
export interface SwarmTask {
|
|
35
|
+
id: string;
|
|
36
|
+
agentType: AgentType;
|
|
37
|
+
prompt: string;
|
|
38
|
+
/** IDs of tasks that must complete before this one. */
|
|
39
|
+
dependsOn?: string[];
|
|
40
|
+
retryConfig?: Partial<RetryConfig>;
|
|
41
|
+
}
|
|
42
|
+
export interface SwarmState {
|
|
43
|
+
id: string;
|
|
44
|
+
topology: SwarmTopology;
|
|
45
|
+
tasks: SwarmTask[];
|
|
46
|
+
status: 'idle' | 'running' | 'completed' | 'failed';
|
|
47
|
+
startedAt?: number;
|
|
48
|
+
completedAt?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface MemoryEntry {
|
|
51
|
+
id: string;
|
|
52
|
+
namespace: string;
|
|
53
|
+
key: string;
|
|
54
|
+
value: string;
|
|
55
|
+
tags: string[];
|
|
56
|
+
createdAt: number;
|
|
57
|
+
expiresAt?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface StoreOptions {
|
|
60
|
+
/** TTL in milliseconds. Entry is deleted after this duration. */
|
|
61
|
+
ttlMs?: number;
|
|
62
|
+
tags?: string[];
|
|
63
|
+
}
|
|
64
|
+
export type HookEvent = 'pre-task' | 'post-task' | 'session-start' | 'session-end' | 'agent-spawn' | 'agent-terminate' | 'swarm-start' | 'swarm-end';
|
|
65
|
+
export interface HookContext<T = unknown> {
|
|
66
|
+
event: HookEvent;
|
|
67
|
+
timestamp: number;
|
|
68
|
+
data?: T;
|
|
69
|
+
metadata?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
export type HookHandler<T = unknown> = (ctx: HookContext<T>) => Promise<void>;
|
|
72
|
+
export interface CopilotFlowConfig {
|
|
73
|
+
version: string;
|
|
74
|
+
/** Default model passed to createSession(). Default: 'gpt-4o' */
|
|
75
|
+
defaultModel: string;
|
|
76
|
+
swarm: {
|
|
77
|
+
topology: SwarmTopology;
|
|
78
|
+
/** Maximum concurrent sessions. Default: 8 */
|
|
79
|
+
maxAgents: number;
|
|
80
|
+
};
|
|
81
|
+
memory: {
|
|
82
|
+
backend: 'sqlite' | 'memory';
|
|
83
|
+
/** Path to SQLite file. Default: .copilot-flow/memory.db */
|
|
84
|
+
path: string;
|
|
85
|
+
};
|
|
86
|
+
retry: RetryConfig;
|
|
87
|
+
hooks: {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
/** Per-hook execution timeout in ms. Default: 5000 */
|
|
90
|
+
timeoutMs: number;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface CommandContext {
|
|
94
|
+
args: string[];
|
|
95
|
+
flags: Record<string, unknown>;
|
|
96
|
+
config: CopilotFlowConfig;
|
|
97
|
+
cwd: string;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,eAAO,MAAM,eAAe,kLAalB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,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|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared TypeScript types and interfaces for copilot-flow.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AGENT_TYPE_LIST = void 0;
|
|
7
|
+
// ─── Agent Types ─────────────────────────────────────────────────────────────
|
|
8
|
+
exports.AGENT_TYPE_LIST = [
|
|
9
|
+
'coder',
|
|
10
|
+
'researcher',
|
|
11
|
+
'tester',
|
|
12
|
+
'reviewer',
|
|
13
|
+
'architect',
|
|
14
|
+
'coordinator',
|
|
15
|
+
'analyst',
|
|
16
|
+
'debugger',
|
|
17
|
+
'documenter',
|
|
18
|
+
'optimizer',
|
|
19
|
+
'security-auditor',
|
|
20
|
+
'performance-engineer',
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,gFAAgF;AAEnE,QAAA,eAAe,GAAG;IAC7B,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,WAAW;IACX,aAAa;IACb,SAAS;IACT,UAAU;IACV,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB,sBAAsB;CACd,CAAC"}
|