@koalaauto/agentchannel 3.37.0 → 3.38.1

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.
@@ -462,8 +462,9 @@ export class Runner {
462
462
  async reportRepos() {
463
463
  if (this.reposReported)
464
464
  return;
465
- const names = this.o.workspace.repoNames?.();
466
- if (!names?.length || !this.o.client.reportRepos) {
465
+ // an empty list is reported too: the hub then refuses a task that names a repo, and forgets names an earlier start gave
466
+ const names = await this.o.workspace.repoNames?.();
467
+ if (!names || !this.o.client.reportRepos) {
467
468
  this.reposReported = true;
468
469
  return;
469
470
  }
@@ -15,8 +15,9 @@ export interface Workspace {
15
15
  * task's links.base adds or changes relative to the runner's HEAD.
16
16
  */
17
17
  sensitiveChanges?(task: Task): Promise<string[]>;
18
- /** The repo names a task may name (links.repo, links.repos): the runner tells the hub, which refuses others when sent. */
19
- repoNames?(): string[];
18
+ /** The repo names a task may name (links.repo, links.repos): the runner tells the hub, which refuses others when sent.
19
+ * Only git checkouts: a task that names a plain directory would get an empty work dir. */
20
+ repoNames?(): string[] | Promise<string[]>;
20
21
  /** Where each of those comes from: {name: "owner/name"} of its origin (never a local path). The hub tells a sender whose handoff names another repository. */
21
22
  repoRemotes?(): Promise<Record<string, string>>;
22
23
  /**
@@ -47,7 +48,7 @@ export declare class GitWorkspace implements Workspace {
47
48
  constructor(dir: string, home: string, log?: (s: string) => void, repos?: Record<string, string>);
48
49
  /** The local repo a task works in (P3). */
49
50
  repoDir(task: Task): string;
50
- repoNames(): string[];
51
+ repoNames(): Promise<string[]>;
51
52
  repoRemotes(): Promise<Record<string, string>>;
52
53
  /** Map a repo name to its local path, or fail with the names this runner knows. */
53
54
  lookup(r: unknown, what: string): string;
@@ -71,12 +71,17 @@ export class GitWorkspace {
71
71
  return this.dir;
72
72
  return this.lookup(r, 'links.repo');
73
73
  }
74
- repoNames() {
75
- return [...new Set([...Object.keys(this.repos), basename(this.dir)])].filter((n) => REPO_NAME_RE.test(n)).sort();
74
+ async repoNames() {
75
+ const out = [];
76
+ for (const n of [...new Set([...Object.keys(this.repos), basename(this.dir)])].filter((n) => REPO_NAME_RE.test(n)).sort()) {
77
+ if (await isGitRepo(this.lookup(n, 'repo')))
78
+ out.push(n);
79
+ }
80
+ return out;
76
81
  }
77
82
  async repoRemotes() {
78
83
  const out = {};
79
- for (const n of this.repoNames()) {
84
+ for (const n of await this.repoNames()) {
80
85
  try {
81
86
  const slug = remoteSlug(await git(this.lookup(n, 'repo'), ['config', '--get', 'remote.origin.url']));
82
87
  if (slug)
@@ -158,6 +163,10 @@ export class GitWorkspace {
158
163
  return p;
159
164
  mkdirSync(this.root, { recursive: true, mode: 0o700 });
160
165
  if (!(await isGitRepo(dir))) {
166
+ // a task that names a repo expects its code: an empty dir would only let the agent find out for itself
167
+ const named = task.links?.repo;
168
+ if (typeof named === 'string' && named !== '')
169
+ throw new Error(`repo "${named}" is not a git repository on this runner's machine. Start the runner in a checkout, or with --repo ${named}=<path of a checkout>.`);
161
170
  mkdirSync(p, { recursive: true, mode: 0o700 });
162
171
  return p;
163
172
  }
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.37.0";
1
+ export declare const VERSION = "3.38.1";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.37.0';
1
+ export const VERSION = '3.38.1';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.37.0",
3
+ "version": "3.38.1",
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",