@koalaauto/agentchannel 3.66.1 → 3.68.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/dist/src/adapters/kiro.js +8 -5
- package/dist/src/args.js +3 -0
- package/dist/src/cli.js +36 -0
- package/dist/src/client.d.ts +10 -2
- package/dist/src/client.js +9 -0
- package/dist/src/doctor.js +2 -2
- package/dist/src/mcp.js +1 -1
- package/dist/src/pool.d.ts +64 -0
- package/dist/src/pool.js +122 -0
- package/dist/src/prompts.d.ts +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -54,7 +54,8 @@ export function kiroArgs(o) {
|
|
|
54
54
|
'chat',
|
|
55
55
|
'--v3',
|
|
56
56
|
'--no-interactive',
|
|
57
|
-
|
|
57
|
+
// no repository (ACH_KIRO_REPO=none): the sandbox starts empty
|
|
58
|
+
...(o.resume ? ['--resume-id', o.resume] : o.repo ? ['--cloud', '--repo', o.repo] : ['--cloud']),
|
|
58
59
|
...(o.format === 'stream-json' ? ['--output-format', 'stream-json'] : []),
|
|
59
60
|
...(o.model ? ['--model', o.model] : []),
|
|
60
61
|
...(o.effort && /^[a-z]{2,12}$/.test(o.effort) ? ['--effort', o.effort] : []),
|
|
@@ -273,16 +274,18 @@ export class KiroAdapter {
|
|
|
273
274
|
}
|
|
274
275
|
async run(opts) {
|
|
275
276
|
const env = this.o.env ?? process.env;
|
|
276
|
-
|
|
277
|
-
|
|
277
|
+
// ACH_KIRO_REPO=none: a cloud workspace that was given no repository runs in an empty sandbox (a pool sets it)
|
|
278
|
+
const none = (env.ACH_KIRO_REPO ?? '').trim().toLowerCase() === 'none';
|
|
279
|
+
const repo = none ? '' : kiroRepoFor(opts.cwd, { ...env, ...opts.env, ACH_KIRO_REPO: env.ACH_KIRO_REPO }, this.o.git);
|
|
280
|
+
if (repo === undefined) {
|
|
278
281
|
const error = `kiro: no GitHub repo for ${opts.cwd} (set ACH_KIRO_REPO=owner/name, or give the directory a github.com origin remote)`;
|
|
279
282
|
opts.onEvent({ type: 'error', data: error });
|
|
280
283
|
return { finalText: '', ok: false, error };
|
|
281
284
|
}
|
|
282
|
-
const first = await this.runOnce(opts, repo, 'stream-json');
|
|
285
|
+
const first = await this.runOnce(opts, repo ?? '', 'stream-json');
|
|
283
286
|
if (!first.result.ok && !first.progressed && !opts.signal.aborted && FORMAT_REFUSED.test(first.result.error ?? '')) {
|
|
284
287
|
opts.onEvent({ type: 'error', data: 'kiro-cli refused --output-format stream-json; running in text mode' });
|
|
285
|
-
return (await this.runOnce(opts, repo, 'text')).result;
|
|
288
|
+
return (await this.runOnce(opts, repo ?? '', 'text')).result;
|
|
286
289
|
}
|
|
287
290
|
return first.result;
|
|
288
291
|
}
|
package/dist/src/args.js
CHANGED
|
@@ -48,6 +48,7 @@ export const COMMANDS = {
|
|
|
48
48
|
dir: s, runtime: s, interval: s, max: s, perm: s, model: s, gc: b, days: s, 'pass-env': sm,
|
|
49
49
|
repo: sm, 'claim-delay': s, 'interactive-first': b, 'install-service': b, notify: b, 'no-notify': b, 'no-trace': b, ...json,
|
|
50
50
|
},
|
|
51
|
+
pool: { dir: s, interval: s, ...json },
|
|
51
52
|
mcp: { ...json },
|
|
52
53
|
caps: { ...json },
|
|
53
54
|
open: { print: b, ...json },
|
|
@@ -232,6 +233,8 @@ Runner: ach run --dir <path> [--repo name=path ...] [--runtime ${RUNTIME_NAM
|
|
|
232
233
|
notifications; off by default; macOS needs terminal-notifier)
|
|
233
234
|
ach run --install-service [same flags] (installs and starts a launchd/systemd user unit; runs at login)
|
|
234
235
|
ach run --gc [--dir <path>] [--days 7]
|
|
236
|
+
Pool: ach pool <name> --dir <base> [--interval 60] (keeps a runner going for every cloud workspace of a pool, e.g. kiro;
|
|
237
|
+
ACH_POOL_KEY is the pool's key, from an admin; docs/runner.md "A pool of cloud workspaces")
|
|
235
238
|
MCP: ach mcp (stdio server; your interactive agent can also claim and work tasks)
|
|
236
239
|
Panel: ach open [--print] (opens the panel in your browser, logged in as this agent's owner; 60 s single-use link)
|
|
237
240
|
Admin: ach admin login --link <login link>
|
package/dist/src/cli.js
CHANGED
|
@@ -919,6 +919,42 @@ async function dispatch(p, io) {
|
|
|
919
919
|
}
|
|
920
920
|
case 'run':
|
|
921
921
|
return runCommand(p, io);
|
|
922
|
+
case 'pool': {
|
|
923
|
+
// the supervisor of a pool of cloud workspaces (pool.ts): `ach pool kiro --dir /srv/ach-pool`, with ACH_POOL_KEY
|
|
924
|
+
const name = p.positionals[0];
|
|
925
|
+
if (!name)
|
|
926
|
+
throw new UsageError('ach pool <name> --dir <base> (the pool, e.g. kiro; ACH_POOL_KEY is its key)');
|
|
927
|
+
const key = (env.ACH_POOL_KEY || '').trim();
|
|
928
|
+
if (!key)
|
|
929
|
+
throw new UsageError('ACH_POOL_KEY is not set: an admin makes the key (POST /api/ach/admin/pools/<name>/key)');
|
|
930
|
+
const cfg = loadConfig(env);
|
|
931
|
+
if (!cfg.hub)
|
|
932
|
+
throw new UsageError('No hub configured: set ACH_HUB, or run this where an agent was joined');
|
|
933
|
+
const base = resolve(io.cwd ?? process.cwd(), String(p.values.dir || `ach-pool-${name}`));
|
|
934
|
+
const { Pool } = await import('./pool.js');
|
|
935
|
+
const client = new Client({ hub: cfg.hub, token: key, cfId: cfg.cfId, cfSecret: cfg.cfSecret, fetch: io.fetch });
|
|
936
|
+
// the pool's key is not the runners': each runs with its own agent's key, from its own home
|
|
937
|
+
const childEnv = { ...env };
|
|
938
|
+
delete childEnv.ACH_POOL_KEY;
|
|
939
|
+
delete childEnv.ACH_KEY;
|
|
940
|
+
const pool = new Pool({ name, base, hub: cfg.hub, cfId: cfg.cfId, cfSecret: cfg.cfSecret, env: childEnv, log: io.err }, { agents: () => client.poolAgents(name), key: (id) => client.poolAgentKey(name, id) });
|
|
941
|
+
const everyMs = Math.max(5, Number(p.values.interval) || 60) * 1000;
|
|
942
|
+
io.err(`ach pool ${name}: homes and work under ${base}; asking the hub every ${everyMs / 1000}s`);
|
|
943
|
+
const stop = () => { pool.stop(); process.exit(0); };
|
|
944
|
+
process.once('SIGTERM', stop);
|
|
945
|
+
process.once('SIGINT', stop);
|
|
946
|
+
for (;;) {
|
|
947
|
+
try {
|
|
948
|
+
const r = await pool.tick();
|
|
949
|
+
if (r.started.length || r.stopped.length)
|
|
950
|
+
io.err(`pool ${name}: started ${r.started.join(', ') || 'none'}; stopped ${r.stopped.join(', ') || 'none'}; running ${pool.running.size}`);
|
|
951
|
+
}
|
|
952
|
+
catch (e) {
|
|
953
|
+
io.err(`pool ${name}: the hub did not answer (${e?.message ?? e}); the runners keep going`);
|
|
954
|
+
}
|
|
955
|
+
await new Promise((r) => setTimeout(r, everyMs));
|
|
956
|
+
}
|
|
957
|
+
}
|
|
922
958
|
case 'mcp': {
|
|
923
959
|
const { startMcp } = await import('./mcp.js');
|
|
924
960
|
// a project with an agent of its own speaks as that agent, even from the user-wide MCP entry
|
package/dist/src/client.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ export interface Agent {
|
|
|
32
32
|
owner_name?: string;
|
|
33
33
|
/** The hub's default language: what the agent writes for people (ACH_DEFAULT_LANG). Only on an agent's own /me. */
|
|
34
34
|
lang?: 'en' | 'zh';
|
|
35
|
-
/** Who it belongs to (docs/mechanisms.md): a person (
|
|
36
|
-
kind?: '
|
|
35
|
+
/** Who it belongs to (docs/mechanisms.md): the agent of one of a person's environments (environment) or the team (team: no one person, the admins look after it). */
|
|
36
|
+
kind?: 'environment' | 'team';
|
|
37
37
|
/** system: the team's one system agent (a team agent that does the hub's own work). */
|
|
38
38
|
role?: '' | 'system';
|
|
39
39
|
runtime?: string;
|
|
@@ -540,6 +540,14 @@ export declare class Client {
|
|
|
540
540
|
projects: Project[];
|
|
541
541
|
refreshed_at: string;
|
|
542
542
|
}>;
|
|
543
|
+
/** `ach pool`: the agents of a pool (this client's token is the pool's key). */
|
|
544
|
+
poolAgents(name: string): Promise<{
|
|
545
|
+
id: string;
|
|
546
|
+
name: string;
|
|
547
|
+
repos: string[];
|
|
548
|
+
}[]>;
|
|
549
|
+
/** A fresh key for one of the pool's agents (its old one stops working). */
|
|
550
|
+
poolAgentKey(name: string, agentId: string): Promise<string>;
|
|
543
551
|
agents(): Promise<Agent[]>;
|
|
544
552
|
sendTask(input: SendTaskInput, files?: string[]): Promise<Task>;
|
|
545
553
|
/** The sender's side accepts a task that waits for acceptance: it is completed. */
|
package/dist/src/client.js
CHANGED
|
@@ -338,6 +338,15 @@ export class Client {
|
|
|
338
338
|
async projects() {
|
|
339
339
|
return this.ach('GET', '/projects');
|
|
340
340
|
}
|
|
341
|
+
/** `ach pool`: the agents of a pool (this client's token is the pool's key). */
|
|
342
|
+
async poolAgents(name) {
|
|
343
|
+
const r = await this.ach('GET', `/pool/${encodeURIComponent(name)}/agents`);
|
|
344
|
+
return arr(r?.agents).map((a) => ({ id: String(a.id), name: String(a.name), repos: arr(a.repos).map(String) }));
|
|
345
|
+
}
|
|
346
|
+
/** A fresh key for one of the pool's agents (its old one stops working). */
|
|
347
|
+
async poolAgentKey(name, agentId) {
|
|
348
|
+
return String((await this.ach('POST', `/pool/${encodeURIComponent(name)}/agents/${encodeURIComponent(agentId)}/key`))?.key ?? '');
|
|
349
|
+
}
|
|
341
350
|
async agents() {
|
|
342
351
|
const r = await this.ach('GET', '/agents');
|
|
343
352
|
return Array.isArray(r) ? r : arr(r?.agents ?? r?.items);
|
package/dist/src/doctor.js
CHANGED
|
@@ -212,7 +212,7 @@ export async function runDoctor(o) {
|
|
|
212
212
|
}
|
|
213
213
|
// the hub says what it needs: a floor this CLI is below, or a newer release than this one (hubs before 3.5 say nothing)
|
|
214
214
|
const line = VERSION.includes('-') ? 'next' : 'latest';
|
|
215
|
-
const upgrade = `run the join line from the panel again (
|
|
215
|
+
const upgrade = `run the join line from the panel again (the agent's page > Settings > Rotate key), or: npm install -g ${PKG_NAME}@${line}`;
|
|
216
216
|
let hubSaid = false;
|
|
217
217
|
if (hubMinProto > CLIENT_PROTO) {
|
|
218
218
|
hubSaid = true;
|
|
@@ -221,7 +221,7 @@ export async function runDoctor(o) {
|
|
|
221
221
|
else if (hubLatest && /^\d+\.\d+\.\d+/.test(hubLatest) && newerVersion(hubLatest, VERSION)) {
|
|
222
222
|
hubSaid = true;
|
|
223
223
|
// the exact release the hub names: always installable, whatever line (latest, next) this CLI is on
|
|
224
|
-
add('update', 'warn', `${PKG_NAME} ${hubLatest} is out (this is ${VERSION}; your hub announces it)`, 'machine', `run the join line from the panel again (
|
|
224
|
+
add('update', 'warn', `${PKG_NAME} ${hubLatest} is out (this is ${VERSION}; your hub announces it)`, 'machine', `run the join line from the panel again (the agent's page > Settings > Rotate key), or: npm install -g ${PKG_NAME}@${hubLatest}`);
|
|
225
225
|
}
|
|
226
226
|
// a newer CLI on npm (the release line this CLI is on: `latest` for a release, `next` for a prerelease)
|
|
227
227
|
if (!hubSaid) {
|
package/dist/src/mcp.js
CHANGED
|
@@ -199,7 +199,7 @@ export function buildMcpServer(client, o = {}) {
|
|
|
199
199
|
server.registerTool('send_task', {
|
|
200
200
|
description: `Hand a piece of work to another agent as a task. The receiving agent is woken on its machine (or its owner picks it up interactively) and works in a fresh git worktree. ${TASK_FIELDS_HELP} ${HANDOFF_HELP}`,
|
|
201
201
|
inputSchema: {
|
|
202
|
-
to: z.string().describe('Agent name or id (see list_agents)'),
|
|
202
|
+
to: z.string().describe('Agent name or id (see list_agents); or a person (their handle, e.g. @evan, or email) who has a Dot: their Dot gives it to the right one of their environments, and the answer says which (routed)'),
|
|
203
203
|
title: z.string(),
|
|
204
204
|
priority: z.enum(['P0', 'P1', 'P2', 'P3']).default('P2'),
|
|
205
205
|
purpose: z.string().describe('Why this task exists'),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface PoolAgent {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
/** owner/name GitHub repositories its cloud session opens */
|
|
5
|
+
repos: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface PoolHub {
|
|
8
|
+
agents(): Promise<PoolAgent[]>;
|
|
9
|
+
/** a fresh key for one agent (its old key stops working): asked once, when its home is made */
|
|
10
|
+
key(agentId: string): Promise<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface PoolOptions {
|
|
13
|
+
name: string;
|
|
14
|
+
/** where the homes and directories of the pool's agents live */
|
|
15
|
+
base: string;
|
|
16
|
+
hub: string;
|
|
17
|
+
cfId?: string;
|
|
18
|
+
cfSecret?: string;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
log: (s: string) => void;
|
|
21
|
+
/** tests: start a runner (default: this CLI's `run`) */
|
|
22
|
+
start?: (a: PoolAgent, home: string, dir: string, env: NodeJS.ProcessEnv) => PoolChild;
|
|
23
|
+
now?: () => number;
|
|
24
|
+
}
|
|
25
|
+
export interface PoolChild {
|
|
26
|
+
/** set once it has exited */
|
|
27
|
+
exited?: {
|
|
28
|
+
code: number | null;
|
|
29
|
+
};
|
|
30
|
+
stop(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const agentHomeIn: (base: string, a: PoolAgent) => string;
|
|
33
|
+
export declare const agentDirIn: (base: string, a: PoolAgent) => string;
|
|
34
|
+
/** What the Kiro runtime opens: the agent's repositories, or `none` for an empty sandbox. */
|
|
35
|
+
export declare const reposEnv: (a: PoolAgent) => string;
|
|
36
|
+
/** The agent's home, made the first time with a key taken for it; later starts find it there. */
|
|
37
|
+
export declare function ensureHome(o: Pick<PoolOptions, 'base' | 'hub' | 'cfId' | 'cfSecret'>, a: PoolAgent, hub: PoolHub): Promise<{
|
|
38
|
+
home: string;
|
|
39
|
+
dir: string;
|
|
40
|
+
made: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
interface Running {
|
|
43
|
+
agent: PoolAgent;
|
|
44
|
+
child: PoolChild;
|
|
45
|
+
repos: string;
|
|
46
|
+
}
|
|
47
|
+
export declare class Pool {
|
|
48
|
+
private o;
|
|
49
|
+
private hub;
|
|
50
|
+
readonly running: Map<string, Running>;
|
|
51
|
+
/** when a runner that exited may be started again, and how often it has in a row */
|
|
52
|
+
private retry;
|
|
53
|
+
private start;
|
|
54
|
+
private now;
|
|
55
|
+
constructor(o: PoolOptions, hub: PoolHub);
|
|
56
|
+
/** One round: what the hub says is in the pool is what runs. Returns what changed (for the log, and the tests). */
|
|
57
|
+
tick(): Promise<{
|
|
58
|
+
started: string[];
|
|
59
|
+
stopped: string[];
|
|
60
|
+
failed: string[];
|
|
61
|
+
}>;
|
|
62
|
+
stop(): void;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
package/dist/src/pool.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// `ach pool <name>`: the supervisor of a pool of cloud workspaces (docs/specs/primary-agent-design.md §8.2). A cloud
|
|
2
|
+
// workspace is an agent whose work happens in the vendor's cloud (Kiro), so nobody's own machine has to be on for it; but each
|
|
3
|
+
// still needs a runner that takes its tasks and starts the cloud session. This process is that: with the pool's key it asks the
|
|
4
|
+
// hub which agents are in the pool, gives each a home and a directory of its own, takes that agent's key once, and keeps an
|
|
5
|
+
// ordinary `ach run` going for it (the same runner a person starts by hand: nothing about a run is different here). An agent
|
|
6
|
+
// that leaves the pool has its runner stopped; one whose repositories changed has it restarted.
|
|
7
|
+
import { spawn } from 'node:child_process';
|
|
8
|
+
import { chmodSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { cfSecretPath, keyFilePath } from './keystore.js';
|
|
12
|
+
/** The CLI's entry (dist/src/cli.js, next to this file). */
|
|
13
|
+
const CLI_JS = join(dirname(fileURLToPath(import.meta.url)), 'cli.js');
|
|
14
|
+
const safe = (name) => name.replace(/[^A-Za-z0-9-]/g, '-');
|
|
15
|
+
export const agentHomeIn = (base, a) => join(base, 'homes', safe(a.name));
|
|
16
|
+
export const agentDirIn = (base, a) => join(base, 'work', safe(a.name));
|
|
17
|
+
/** What the Kiro runtime opens: the agent's repositories, or `none` for an empty sandbox. */
|
|
18
|
+
export const reposEnv = (a) => (a.repos.length ? a.repos.join(',') : 'none');
|
|
19
|
+
/** The agent's home, made the first time with a key taken for it; later starts find it there. */
|
|
20
|
+
export async function ensureHome(o, a, hub) {
|
|
21
|
+
const home = agentHomeIn(o.base, a);
|
|
22
|
+
const dir = agentDirIn(o.base, a);
|
|
23
|
+
mkdirSync(dir, { recursive: true });
|
|
24
|
+
if (existsSync(keyFilePath(home)))
|
|
25
|
+
return { home, dir, made: false };
|
|
26
|
+
mkdirSync(home, { recursive: true, mode: 0o700 });
|
|
27
|
+
const key = await hub.key(a.id);
|
|
28
|
+
const secret = (path, value) => {
|
|
29
|
+
writeFileSync(path, value + '\n', { mode: 0o600 });
|
|
30
|
+
chmodSync(path, 0o600);
|
|
31
|
+
};
|
|
32
|
+
writeFileSync(join(home, 'config.json'), JSON.stringify({ hub: o.hub, ...(o.cfId ? { cf_id: o.cfId } : {}), dir }, null, 2) + '\n', { mode: 0o600 });
|
|
33
|
+
if (o.cfSecret)
|
|
34
|
+
secret(cfSecretPath(home), o.cfSecret);
|
|
35
|
+
// the key last: a home without it is made again next time
|
|
36
|
+
secret(keyFilePath(home), key);
|
|
37
|
+
return { home, dir, made: true };
|
|
38
|
+
}
|
|
39
|
+
function startRunner(name, log) {
|
|
40
|
+
return (a, home, dir, env) => {
|
|
41
|
+
const proc = spawn(process.execPath, [CLI_JS, 'run', '--dir', dir, '--runtime', name, '--max', '1'], { env, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
42
|
+
const child = { stop: () => { try {
|
|
43
|
+
proc.kill('SIGTERM');
|
|
44
|
+
}
|
|
45
|
+
catch { /* gone */ } } };
|
|
46
|
+
const say = (d) => { for (const line of String(d).split('\n'))
|
|
47
|
+
if (line.trim())
|
|
48
|
+
log(`[${a.name}] ${line}`); };
|
|
49
|
+
proc.stdout?.on('data', say);
|
|
50
|
+
proc.stderr?.on('data', say);
|
|
51
|
+
proc.on('error', (e) => { log(`[${a.name}] could not start: ${e.message}`); child.exited = { code: null }; });
|
|
52
|
+
proc.on('exit', (code) => { child.exited = { code }; });
|
|
53
|
+
return child;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const BACKOFF_MS = [10_000, 30_000, 60_000, 300_000];
|
|
57
|
+
export class Pool {
|
|
58
|
+
o;
|
|
59
|
+
hub;
|
|
60
|
+
running = new Map();
|
|
61
|
+
/** when a runner that exited may be started again, and how often it has in a row */
|
|
62
|
+
retry = new Map();
|
|
63
|
+
start;
|
|
64
|
+
now;
|
|
65
|
+
constructor(o, hub) {
|
|
66
|
+
this.o = o;
|
|
67
|
+
this.hub = hub;
|
|
68
|
+
this.start = o.start ?? startRunner(o.name, o.log);
|
|
69
|
+
this.now = o.now ?? Date.now;
|
|
70
|
+
}
|
|
71
|
+
/** One round: what the hub says is in the pool is what runs. Returns what changed (for the log, and the tests). */
|
|
72
|
+
async tick() {
|
|
73
|
+
const out = { started: [], stopped: [], failed: [] };
|
|
74
|
+
const agents = await this.hub.agents();
|
|
75
|
+
const want = new Map(agents.map((a) => [a.id, a]));
|
|
76
|
+
for (const [id, r] of this.running) {
|
|
77
|
+
const a = want.get(id);
|
|
78
|
+
// gone from the pool, or its repositories changed (the runner reads them when it starts)
|
|
79
|
+
if (!a || reposEnv(a) !== r.repos) {
|
|
80
|
+
r.child.stop();
|
|
81
|
+
this.running.delete(id);
|
|
82
|
+
this.retry.delete(id);
|
|
83
|
+
out.stopped.push(r.agent.name);
|
|
84
|
+
}
|
|
85
|
+
else if (r.child.exited) {
|
|
86
|
+
this.running.delete(id);
|
|
87
|
+
const n = (this.retry.get(id)?.n ?? 0) + 1;
|
|
88
|
+
this.retry.set(id, { at: this.now() + BACKOFF_MS[Math.min(n - 1, BACKOFF_MS.length - 1)], n });
|
|
89
|
+
this.o.log(`[${r.agent.name}] its runner exited (${r.child.exited.code ?? 'no code'}); starting it again`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const a of agents) {
|
|
93
|
+
if (this.running.has(a.id))
|
|
94
|
+
continue;
|
|
95
|
+
const wait = this.retry.get(a.id);
|
|
96
|
+
if (wait && wait.at > this.now())
|
|
97
|
+
continue;
|
|
98
|
+
try {
|
|
99
|
+
const { home, dir, made } = await ensureHome(this.o, a, this.hub);
|
|
100
|
+
if (made)
|
|
101
|
+
this.o.log(`[${a.name}] home made at ${home}`);
|
|
102
|
+
const child = this.start(a, home, dir, { ...this.o.env, AGENTCHANNEL_HOME: home, ACH_KIRO_REPO: reposEnv(a) });
|
|
103
|
+
this.running.set(a.id, { agent: a, child, repos: reposEnv(a) });
|
|
104
|
+
out.started.push(a.name);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
out.failed.push(a.name);
|
|
108
|
+
this.o.log(`[${a.name}] not started: ${e?.message ?? e}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// a runner that has stayed up is no longer "failing in a row"
|
|
112
|
+
for (const [id, r] of this.running)
|
|
113
|
+
if (!r.child.exited && this.retry.has(id) && this.retry.get(id).at + 600_000 < this.now())
|
|
114
|
+
this.retry.delete(id);
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
stop() {
|
|
118
|
+
for (const r of this.running.values())
|
|
119
|
+
r.child.stop();
|
|
120
|
+
this.running.clear();
|
|
121
|
+
}
|
|
122
|
+
}
|
package/dist/src/prompts.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface PromptCtx {
|
|
|
3
3
|
agentName: string;
|
|
4
4
|
ownerName?: string;
|
|
5
5
|
/** Who it belongs to: a team agent has no owner and no one's personal memory; the admins look after it. */
|
|
6
|
-
kind?: '
|
|
6
|
+
kind?: 'environment' | 'team';
|
|
7
7
|
/** system: the team's one system agent. */
|
|
8
8
|
role?: '' | 'system';
|
|
9
9
|
senderName?: string;
|
package/dist/src/version.d.ts
CHANGED
package/dist/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koalaauto/agentchannel",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.68.0",
|
|
4
4
|
"description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentchannel",
|