@phnx-labs/agents-cli 1.18.0 → 1.18.2
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/CHANGELOG.md +20 -1
- package/dist/commands/doctor.js +19 -5
- package/dist/commands/exec.js +9 -4
- package/dist/index.js +30 -0
- package/dist/lib/hooks.js +21 -3
- package/dist/lib/migrate.js +35 -12
- package/dist/lib/shims.d.ts +3 -1
- package/dist/lib/shims.js +81 -7
- package/dist/lib/staleness/checkers/commands.d.ts +7 -0
- package/dist/lib/staleness/checkers/commands.js +27 -0
- package/dist/lib/staleness/checkers/hooks.d.ts +13 -0
- package/dist/lib/staleness/checkers/hooks.js +63 -0
- package/dist/lib/staleness/checkers/mcp.d.ts +12 -0
- package/dist/lib/staleness/checkers/mcp.js +38 -0
- package/dist/lib/staleness/checkers/permissions.d.ts +17 -0
- package/dist/lib/staleness/checkers/permissions.js +73 -0
- package/dist/lib/staleness/checkers/plugins.d.ts +11 -0
- package/dist/lib/staleness/checkers/plugins.js +39 -0
- package/dist/lib/staleness/checkers/rules.d.ts +19 -0
- package/dist/lib/staleness/checkers/rules.js +86 -0
- package/dist/lib/staleness/checkers/skills.d.ts +7 -0
- package/dist/lib/staleness/checkers/skills.js +34 -0
- package/dist/lib/staleness/checkers/subagents.d.ts +12 -0
- package/dist/lib/staleness/checkers/subagents.js +39 -0
- package/dist/lib/staleness/checkers/types.d.ts +44 -0
- package/dist/lib/staleness/checkers/types.js +20 -0
- package/dist/lib/staleness/checkers/workflows.d.ts +10 -0
- package/dist/lib/staleness/checkers/workflows.js +37 -0
- package/dist/lib/staleness/fingerprint.d.ts +38 -0
- package/dist/lib/staleness/fingerprint.js +154 -0
- package/dist/lib/staleness/index.d.ts +26 -0
- package/dist/lib/staleness/index.js +122 -0
- package/dist/lib/staleness/layers.d.ts +37 -0
- package/dist/lib/staleness/layers.js +100 -0
- package/dist/lib/staleness/types.d.ts +56 -0
- package/dist/lib/staleness/types.js +6 -0
- package/dist/lib/state.d.ts +2 -0
- package/dist/lib/state.js +2 -0
- package/dist/lib/teams/agents.d.ts +11 -20
- package/dist/lib/teams/agents.js +55 -202
- package/dist/lib/teams/index.d.ts +3 -2
- package/dist/lib/teams/index.js +2 -2
- package/dist/lib/teams/persistence.d.ts +0 -38
- package/dist/lib/teams/persistence.js +7 -329
- package/dist/lib/teams/registry.js +7 -5
- package/dist/lib/versions.js +34 -12
- package/package.json +1 -1
- package/dist/lib/sync-manifest.d.ts +0 -81
- package/dist/lib/sync-manifest.js +0 -450
package/dist/lib/teams/agents.js
CHANGED
|
@@ -16,9 +16,9 @@ import { randomUUID } from 'crypto';
|
|
|
16
16
|
import { resolveAgentsDir } from './persistence.js';
|
|
17
17
|
import { normalizeEvents } from './parsers.js';
|
|
18
18
|
import { debug } from './debug.js';
|
|
19
|
-
import { buildReasoningFlags } from '../models.js';
|
|
20
19
|
import { setGeminiAutoUpdateDisabled, updateGeminiSettings } from '../gemini-settings.js';
|
|
21
20
|
import { getAgentsDir as getSystemAgentsDir } from '../state.js';
|
|
21
|
+
import { AGENTS } from '../agents.js';
|
|
22
22
|
let lastMemoryWarnAt = 0;
|
|
23
23
|
// On macOS, os.freemem() returns only the truly-free pool and ignores the
|
|
24
24
|
// large inactive+purgeable cache the kernel will reclaim under pressure, so
|
|
@@ -170,103 +170,8 @@ export function captureProcessStartTime(pid) {
|
|
|
170
170
|
return null;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// here so a plan-mode teammate truly cannot write — even if the teammate
|
|
176
|
-
// prompt tries to ignore the instruction. See agents.test.ts for the contract.
|
|
177
|
-
export const AGENT_COMMANDS = {
|
|
178
|
-
codex: ['codex', 'exec', '--sandbox', 'read-only', '{prompt}', '--json'],
|
|
179
|
-
cursor: ['cursor-agent', '-p', '--output-format', 'stream-json', '{prompt}'],
|
|
180
|
-
gemini: ['gemini', '{prompt}', '--output-format', 'stream-json', '--approval-mode', 'plan'],
|
|
181
|
-
claude: ['claude', '-p', '--verbose', '{prompt}', '--output-format', 'stream-json', '--permission-mode', 'plan'],
|
|
182
|
-
opencode: ['opencode', 'run', '--format', 'json', '{prompt}'],
|
|
183
|
-
};
|
|
184
|
-
/**
|
|
185
|
-
* Rewrite a plan-mode command into edit mode (writes inside cwd allowed,
|
|
186
|
-
* approval prompts may still appear). Pure function — exported for tests.
|
|
187
|
-
*/
|
|
188
|
-
export function applyEditMode(agentType, cmd) {
|
|
189
|
-
const editCmd = [...cmd];
|
|
190
|
-
switch (agentType) {
|
|
191
|
-
case 'codex': {
|
|
192
|
-
// Swap --sandbox read-only -> --sandbox workspace-write so the codex
|
|
193
|
-
// sandbox actually permits writes. --full-auto then disables approvals.
|
|
194
|
-
const sandboxIndex = editCmd.indexOf('--sandbox');
|
|
195
|
-
if (sandboxIndex !== -1 && sandboxIndex + 1 < editCmd.length) {
|
|
196
|
-
editCmd[sandboxIndex + 1] = 'workspace-write';
|
|
197
|
-
}
|
|
198
|
-
editCmd.push('--full-auto');
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
case 'cursor':
|
|
202
|
-
editCmd.push('-f');
|
|
203
|
-
break;
|
|
204
|
-
case 'gemini': {
|
|
205
|
-
const approvalIndex = editCmd.indexOf('--approval-mode');
|
|
206
|
-
if (approvalIndex !== -1) {
|
|
207
|
-
editCmd.splice(approvalIndex, 2);
|
|
208
|
-
}
|
|
209
|
-
editCmd.push('--yolo');
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
case 'claude': {
|
|
213
|
-
const permModeIndex = editCmd.indexOf('--permission-mode');
|
|
214
|
-
if (permModeIndex !== -1 && permModeIndex + 1 < editCmd.length) {
|
|
215
|
-
editCmd[permModeIndex + 1] = 'acceptEdits';
|
|
216
|
-
}
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return editCmd;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Rewrite a plan-mode command into full mode (writes + approval gates
|
|
224
|
-
* bypassed). Pure function — exported for tests.
|
|
225
|
-
*/
|
|
226
|
-
export function applyFullMode(agentType, cmd) {
|
|
227
|
-
const fullCmd = [...cmd];
|
|
228
|
-
switch (agentType) {
|
|
229
|
-
case 'codex': {
|
|
230
|
-
const sandboxIndex = fullCmd.indexOf('--sandbox');
|
|
231
|
-
if (sandboxIndex !== -1 && sandboxIndex + 1 < fullCmd.length) {
|
|
232
|
-
fullCmd[sandboxIndex + 1] = 'workspace-write';
|
|
233
|
-
}
|
|
234
|
-
fullCmd.push('--full-auto');
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
case 'cursor':
|
|
238
|
-
fullCmd.push('-f');
|
|
239
|
-
break;
|
|
240
|
-
case 'gemini': {
|
|
241
|
-
const approvalIndex = fullCmd.indexOf('--approval-mode');
|
|
242
|
-
if (approvalIndex !== -1) {
|
|
243
|
-
fullCmd.splice(approvalIndex, 2);
|
|
244
|
-
}
|
|
245
|
-
fullCmd.push('--yolo');
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
case 'claude': {
|
|
249
|
-
const permModeIndex = fullCmd.indexOf('--permission-mode');
|
|
250
|
-
if (permModeIndex !== -1) {
|
|
251
|
-
fullCmd.splice(permModeIndex, 2);
|
|
252
|
-
}
|
|
253
|
-
fullCmd.push('--dangerously-skip-permissions');
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return fullCmd;
|
|
258
|
-
}
|
|
259
|
-
// Minimal defaults — no per-effort model map. Configs on disk may still have
|
|
260
|
-
// a model pinned; launchProcess picks it up from agent.model when set.
|
|
261
|
-
function loadDefaultAgentConfigs() {
|
|
262
|
-
return {
|
|
263
|
-
claude: { command: 'claude -p \'{prompt}\' --output-format stream-json --json', enabled: true, model: null, provider: 'anthropic' },
|
|
264
|
-
codex: { command: 'codex exec --sandbox workspace-write \'{prompt}\' --json', enabled: true, model: null, provider: 'openai' },
|
|
265
|
-
gemini: { command: 'gemini \'{prompt}\' --output-format stream-json', enabled: true, model: null, provider: 'google' },
|
|
266
|
-
cursor: { command: 'cursor-agent -p --output-format stream-json \'{prompt}\'', enabled: true, model: null, provider: 'custom' },
|
|
267
|
-
opencode: { command: 'opencode run --format json \'{prompt}\'', enabled: true, model: null, provider: 'custom' },
|
|
268
|
-
};
|
|
269
|
-
}
|
|
173
|
+
/** Agent types the team runner supports. */
|
|
174
|
+
const TEAM_AGENT_TYPES = ['codex', 'cursor', 'gemini', 'claude', 'opencode'];
|
|
270
175
|
// Suffix appended to all prompts to ensure agents provide a summary
|
|
271
176
|
const PROMPT_SUFFIX = `
|
|
272
177
|
|
|
@@ -385,11 +290,10 @@ export async function ensureGeminiPlanMode() {
|
|
|
385
290
|
}
|
|
386
291
|
/** Check whether the CLI binary for a given agent type exists in PATH. Returns [available, pathOrError]. */
|
|
387
292
|
export function checkCliAvailable(agentType) {
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
293
|
+
const executable = AGENTS[agentType]?.cliCommand;
|
|
294
|
+
if (!executable) {
|
|
390
295
|
return [false, `Unknown agent type: ${agentType}`];
|
|
391
296
|
}
|
|
392
|
-
const executable = cmdTemplate[0];
|
|
393
297
|
try {
|
|
394
298
|
const whichPath = execSync(`which ${executable}`, { encoding: 'utf-8' }).trim();
|
|
395
299
|
return [true, whichPath];
|
|
@@ -401,7 +305,7 @@ export function checkCliAvailable(agentType) {
|
|
|
401
305
|
/** Check availability of all known agent CLIs. Returns a map of agent type to install status. */
|
|
402
306
|
export function checkAllClis() {
|
|
403
307
|
const results = {};
|
|
404
|
-
for (const agentType of
|
|
308
|
+
for (const agentType of TEAM_AGENT_TYPES) {
|
|
405
309
|
const [available, pathOrError] = checkCliAvailable(agentType);
|
|
406
310
|
if (available) {
|
|
407
311
|
results[agentType] = { installed: true, path: pathOrError, error: null };
|
|
@@ -845,12 +749,10 @@ export class AgentManager {
|
|
|
845
749
|
filterByCwd;
|
|
846
750
|
cleanupAgeDays;
|
|
847
751
|
defaultMode;
|
|
848
|
-
agentConfigs;
|
|
849
|
-
constructorAgentConfigs = null;
|
|
850
752
|
initPromise = null;
|
|
851
753
|
cloudDispatcher = null;
|
|
852
754
|
constructorAgentsDir = null;
|
|
853
|
-
constructor(maxAgents = 50, agentsDir = null, defaultMode = null, filterByCwd = null, cleanupAgeDays = 7
|
|
755
|
+
constructor(maxAgents = 50, agentsDir = null, defaultMode = null, filterByCwd = null, cleanupAgeDays = 7) {
|
|
854
756
|
this.maxAgents = maxAgents;
|
|
855
757
|
this.constructorAgentsDir = agentsDir;
|
|
856
758
|
this.filterByCwd = filterByCwd;
|
|
@@ -860,7 +762,6 @@ export class AgentManager {
|
|
|
860
762
|
throw new Error(`Invalid default_mode '${defaultMode}'. Use 'plan' or 'edit'.`);
|
|
861
763
|
}
|
|
862
764
|
this.defaultMode = resolvedDefaultMode;
|
|
863
|
-
this.constructorAgentConfigs = agentConfigs;
|
|
864
765
|
this.initPromise = this.doInitialize();
|
|
865
766
|
}
|
|
866
767
|
async initialize() {
|
|
@@ -872,15 +773,11 @@ export class AgentManager {
|
|
|
872
773
|
async doInitialize() {
|
|
873
774
|
this.agentsDir = this.constructorAgentsDir || await getAgentsDir();
|
|
874
775
|
await fs.mkdir(this.agentsDir, { recursive: true });
|
|
875
|
-
this.agentConfigs = this.constructorAgentConfigs ?? loadDefaultAgentConfigs();
|
|
876
776
|
await this.loadExistingAgents();
|
|
877
777
|
}
|
|
878
778
|
getDefaultMode() {
|
|
879
779
|
return this.defaultMode;
|
|
880
780
|
}
|
|
881
|
-
setModelOverrides(agentConfigs) {
|
|
882
|
-
this.agentConfigs = agentConfigs;
|
|
883
|
-
}
|
|
884
781
|
/**
|
|
885
782
|
* Register the callback used to dispatch cloud-backed teammates when their
|
|
886
783
|
* --after deps resolve. Called once at CLI startup by `agents teams`.
|
|
@@ -1070,14 +967,11 @@ export class AgentManager {
|
|
|
1070
967
|
const running = await this.listRunning();
|
|
1071
968
|
warnIfMemoryLow(running.length);
|
|
1072
969
|
const effort = agent.effort ?? 'medium';
|
|
1073
|
-
//
|
|
1074
|
-
//
|
|
1075
|
-
//
|
|
1076
|
-
const resolvedModel = agent.model ??
|
|
1077
|
-
const cmd = this.buildCommand(agent.agentType, agent.prompt, agent.mode, resolvedModel, agent.cwd, agent.agentId, effort);
|
|
1078
|
-
if (agent.version && cmd.length > 0) {
|
|
1079
|
-
cmd[0] = `${cmd[0]}@${agent.version}`;
|
|
1080
|
-
}
|
|
970
|
+
// null model means "let the CLI pick its own default" (no --model flag
|
|
971
|
+
// forwarded). Effort is a separate knob wired into buildReasoningFlags
|
|
972
|
+
// inside buildCommand.
|
|
973
|
+
const resolvedModel = agent.model ?? null;
|
|
974
|
+
const cmd = this.buildCommand(agent.agentType, agent.prompt, agent.mode, resolvedModel, agent.cwd, agent.agentId, effort, agent.version);
|
|
1081
975
|
debug(`Launching ${agent.agentType} agent ${agent.agentId} [${agent.mode}]: ${cmd.slice(0, 3).join(' ')}...`);
|
|
1082
976
|
try {
|
|
1083
977
|
const stdoutPath = await agent.getStdoutPath();
|
|
@@ -1154,98 +1048,57 @@ export class AgentManager {
|
|
|
1154
1048
|
}
|
|
1155
1049
|
return launched;
|
|
1156
1050
|
}
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1051
|
+
/**
|
|
1052
|
+
* Build the argv to spawn for a teammate. Delegates to `agents run` so the
|
|
1053
|
+
* agent's CLI flags, version routing, mode handling (plan/edit/full), model
|
|
1054
|
+
* injection, and reasoning-intensity flags are owned by a single canonical
|
|
1055
|
+
* exec path (src/lib/exec.ts). The team runner just supplies prompt + mode
|
|
1056
|
+
* and reads stream-json events off stdout.
|
|
1057
|
+
*/
|
|
1058
|
+
buildCommand(agentType, prompt, mode, model, cwd = null, sessionId = null, effort = 'medium', version = null) {
|
|
1059
|
+
// Compose the prompt: a plan-mode prefix for Claude (clarifying headless
|
|
1060
|
+
// plan-mode restrictions) and a universal summary suffix. These are
|
|
1061
|
+
// team-specific prompt scaffolding — `agents run` does not apply them.
|
|
1164
1062
|
let fullPrompt = prompt + PROMPT_SUFFIX;
|
|
1165
|
-
|
|
1166
|
-
if (agentType === 'claude' && !isEditMode) {
|
|
1063
|
+
if (agentType === 'claude' && mode !== 'edit') {
|
|
1167
1064
|
fullPrompt = CLAUDE_PLAN_MODE_PREFIX + fullPrompt;
|
|
1168
1065
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1066
|
+
const target = version ? `${agentType}@${version}` : agentType;
|
|
1067
|
+
const agentsCli = process.argv[1];
|
|
1068
|
+
const cmd = [
|
|
1069
|
+
process.execPath,
|
|
1070
|
+
agentsCli,
|
|
1071
|
+
'run',
|
|
1072
|
+
target,
|
|
1073
|
+
fullPrompt,
|
|
1074
|
+
'--mode', mode,
|
|
1075
|
+
'--effort', effort,
|
|
1076
|
+
'--json',
|
|
1077
|
+
'--headless',
|
|
1078
|
+
'--quiet',
|
|
1079
|
+
];
|
|
1080
|
+
if (model)
|
|
1081
|
+
cmd.push('--model', model);
|
|
1082
|
+
if (cwd)
|
|
1083
|
+
cmd.push('--cwd', cwd);
|
|
1084
|
+
// Pin Claude's session UUID to our agent_id so its session file lands at
|
|
1085
|
+
// ~/.claude/projects/.../<agent_id>.jsonl — unified identity for status polling.
|
|
1086
|
+
if (agentType === 'claude' && sessionId) {
|
|
1087
|
+
cmd.push('--session-id', sessionId);
|
|
1088
|
+
}
|
|
1089
|
+
// Claude: grant access to the teammate's working directory.
|
|
1090
|
+
if (agentType === 'claude' && cwd) {
|
|
1091
|
+
cmd.push('--add-dir', cwd);
|
|
1092
|
+
}
|
|
1093
|
+
// Codex's workspace-write sandbox blocks writes outside cwd. Factory
|
|
1094
|
+
// teammates need to run further `agents teams add` commands, which
|
|
1095
|
+
// write to ~/.agents/. Grant that root so subprocess-issued
|
|
1096
|
+
// `agents teams add` calls hit the real store.
|
|
1187
1097
|
if (agentType === 'codex') {
|
|
1188
|
-
// Codex's workspace-write sandbox blocks writes outside cwd. Factory
|
|
1189
|
-
// teammates need to run further `agents teams add` commands,
|
|
1190
|
-
// which write to ~/.agents/. Grant that root so subprocess-issued
|
|
1191
|
-
// `agents teams add` calls hit the real store instead of the tmp
|
|
1192
|
-
// fallback (which the supervisor does not watch).
|
|
1193
1098
|
cmd.push('--add-dir', getSystemAgentsDir());
|
|
1194
1099
|
}
|
|
1195
|
-
// Add model flag for each agent type only when the teammate has a pinned
|
|
1196
|
-
// model. When null, the agent's CLI picks its own default.
|
|
1197
|
-
if (model) {
|
|
1198
|
-
if (agentType === 'codex') {
|
|
1199
|
-
const execIndex = cmd.indexOf('exec');
|
|
1200
|
-
const sandboxIndex = cmd.indexOf('--sandbox');
|
|
1201
|
-
const insertIndex = sandboxIndex !== -1 ? sandboxIndex : execIndex + 1;
|
|
1202
|
-
cmd.splice(insertIndex, 0, '--model', model);
|
|
1203
|
-
}
|
|
1204
|
-
else if (agentType === 'cursor') {
|
|
1205
|
-
cmd.push('--model', model);
|
|
1206
|
-
}
|
|
1207
|
-
else if (agentType === 'gemini' || agentType === 'claude') {
|
|
1208
|
-
cmd.push('--model', model);
|
|
1209
|
-
}
|
|
1210
|
-
else if (agentType === 'opencode') {
|
|
1211
|
-
cmd.push('--model', model);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
if (agentType === 'opencode') {
|
|
1215
|
-
const opencodeAgent = mode === 'edit' || mode === 'full' ? 'build' : 'plan';
|
|
1216
|
-
const promptIndex = cmd.indexOf(fullPrompt);
|
|
1217
|
-
if (promptIndex !== -1) {
|
|
1218
|
-
cmd.splice(promptIndex + 1, 0, '--agent', opencodeAgent);
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
// Inject reasoning-intensity flags for agents that support them. Claude
|
|
1222
|
-
// gets --effort appended; Codex gets `-c model_reasoning_effort=...`
|
|
1223
|
-
// inserted before `exec` so it's parsed as a global config override.
|
|
1224
|
-
const reasoningFlags = buildReasoningFlags(agentType, effort);
|
|
1225
|
-
if (reasoningFlags.length > 0) {
|
|
1226
|
-
if (agentType === 'codex') {
|
|
1227
|
-
const execIndex = cmd.indexOf('exec');
|
|
1228
|
-
const insertIndex = execIndex !== -1 ? execIndex : 1;
|
|
1229
|
-
cmd.splice(insertIndex, 0, ...reasoningFlags);
|
|
1230
|
-
}
|
|
1231
|
-
else {
|
|
1232
|
-
cmd.push(...reasoningFlags);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
if (mode === 'full') {
|
|
1236
|
-
cmd = this.applyFullMode(agentType, cmd);
|
|
1237
|
-
}
|
|
1238
|
-
else if (isEditMode) {
|
|
1239
|
-
cmd = this.applyEditMode(agentType, cmd);
|
|
1240
|
-
}
|
|
1241
1100
|
return cmd;
|
|
1242
1101
|
}
|
|
1243
|
-
applyEditMode(agentType, cmd) {
|
|
1244
|
-
return applyEditMode(agentType, cmd);
|
|
1245
|
-
}
|
|
1246
|
-
applyFullMode(agentType, cmd) {
|
|
1247
|
-
return applyFullMode(agentType, cmd);
|
|
1248
|
-
}
|
|
1249
1102
|
async get(agentId) {
|
|
1250
1103
|
await this.initialize();
|
|
1251
1104
|
let agent = this.agents.get(agentId) || null;
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* to reuse the same agent lifecycle, parsing, summarization, and persistence
|
|
6
6
|
* layer that powers the `agents teams` CLI.
|
|
7
7
|
*/
|
|
8
|
-
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES,
|
|
8
|
+
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES, computePathLCA, checkAllClis, checkCliAvailable, ensureGeminiPlanMode, getAgentsDir, resolveMode, type TaskType, type CloudDispatchFn, } from './agents.js';
|
|
9
9
|
export { type AgentType } from './parsers.js';
|
|
10
10
|
export { normalizeEvents, normalizeEvent, parseEvent } from './parsers.js';
|
|
11
11
|
export { handleSpawn, handleStatus, handleStop, handleTasks, type SpawnResult, type AgentStatusDetail, type TaskStatusResult, type StopResult, type TaskInfo, type TasksResult, } from './api.js';
|
|
12
|
-
export {
|
|
12
|
+
export { resolveAgentsDir, resolveBaseDir, } from './persistence.js';
|
|
13
|
+
export { type EffortLevel } from './agents.js';
|
|
13
14
|
export { collapseEvents, getToolBreakdown, groupAndFlattenEvents, summarizeEvents, getDelta, filterEventsByPriority, getLastTool, getToolUses, getLastMessages, getQuickStatus, getStatusSummary, AgentSummary, PRIORITY, type QuickStatus, } from './summarizer.js';
|
|
14
15
|
export { extractFileOpsFromBash } from './file_ops.js';
|
|
15
16
|
export { debug } from './debug.js';
|
package/dist/lib/teams/index.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* to reuse the same agent lifecycle, parsing, summarization, and persistence
|
|
6
6
|
* layer that powers the `agents teams` CLI.
|
|
7
7
|
*/
|
|
8
|
-
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES,
|
|
8
|
+
export { AgentManager, AgentProcess, AgentStatus, VALID_TASK_TYPES, computePathLCA, checkAllClis, checkCliAvailable, ensureGeminiPlanMode, getAgentsDir, resolveMode, } from './agents.js';
|
|
9
9
|
export { normalizeEvents, normalizeEvent, parseEvent } from './parsers.js';
|
|
10
10
|
export { handleSpawn, handleStatus, handleStop, handleTasks, } from './api.js';
|
|
11
|
-
export {
|
|
11
|
+
export { resolveAgentsDir, resolveBaseDir, } from './persistence.js';
|
|
12
12
|
export { collapseEvents, getToolBreakdown, groupAndFlattenEvents, summarizeEvents, getDelta, filterEventsByPriority, getLastTool, getToolUses, getLastMessages, getQuickStatus, getStatusSummary, AgentSummary, PRIORITY, } from './summarizer.js';
|
|
13
13
|
export { extractFileOpsFromBash } from './file_ops.js';
|
|
14
14
|
export { debug } from './debug.js';
|
|
@@ -1,42 +1,4 @@
|
|
|
1
|
-
import { AgentType } from './parsers.js';
|
|
2
1
|
/** Resolve the base data directory for teams, preferring ~/.agents/teams/ with a temp fallback. */
|
|
3
2
|
export declare function resolveBaseDir(): Promise<string>;
|
|
4
|
-
/** Reasoning-intensity levels supported by the teams system. */
|
|
5
|
-
export type EffortLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto';
|
|
6
|
-
/**
|
|
7
|
-
* Legacy type retained for config-file back-compat. Older configs pinned a
|
|
8
|
-
* model per effort tier; we no longer act on these entries but accept them
|
|
9
|
-
* without error when loading from disk.
|
|
10
|
-
*/
|
|
11
|
-
export type ModelOverrides = Partial<Record<AgentType, Partial<Record<EffortLevel, string>>>>;
|
|
12
|
-
/** API endpoint configuration for a model provider. */
|
|
13
|
-
export interface ProviderConfig {
|
|
14
|
-
apiEndpoint: string | null;
|
|
15
|
-
}
|
|
16
|
-
/** Per-agent-type configuration: CLI command template, enabled state, optional pinned model, and provider. */
|
|
17
|
-
export interface AgentConfig {
|
|
18
|
-
command: string;
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
model: string | null;
|
|
21
|
-
provider: string;
|
|
22
|
-
}
|
|
23
|
-
/** Top-level teams configuration structure persisted to config.json. */
|
|
24
|
-
export interface SwarmConfig {
|
|
25
|
-
agents: Record<AgentType, AgentConfig>;
|
|
26
|
-
providers: Record<string, ProviderConfig>;
|
|
27
|
-
}
|
|
28
|
-
/** Result of reading the teams config, including resolved agent and provider configurations. */
|
|
29
|
-
export interface ReadConfigResult {
|
|
30
|
-
hasConfig: boolean;
|
|
31
|
-
enabledAgents: AgentType[];
|
|
32
|
-
agentConfigs: Record<AgentType, AgentConfig>;
|
|
33
|
-
providerConfigs: Record<string, ProviderConfig>;
|
|
34
|
-
}
|
|
35
3
|
/** Resolve and ensure the agents subdirectory exists under the teams base dir. */
|
|
36
4
|
export declare function resolveAgentsDir(): Promise<string>;
|
|
37
|
-
/** Read teams config from disk, migrating legacy formats if needed. Returns defaults when no config exists. */
|
|
38
|
-
export declare function readConfig(): Promise<ReadConfigResult>;
|
|
39
|
-
/** Write teams config to disk. */
|
|
40
|
-
export declare function writeConfig(config: SwarmConfig): Promise<void>;
|
|
41
|
-
/** Update the enabled/disabled status of a specific agent type in the config file. */
|
|
42
|
-
export declare function setAgentEnabled(agentType: AgentType, enabled: boolean): Promise<void>;
|