@koalaauto/agentchannel 3.44.0 → 3.45.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/client.d.ts +4 -2
- package/dist/src/client.js +1 -1
- package/dist/src/doctor.js +10 -3
- package/dist/src/runner/runner.d.ts +2 -2
- package/dist/src/runner/runner.js +2 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/client.d.ts
CHANGED
|
@@ -47,8 +47,10 @@ export interface Agent {
|
|
|
47
47
|
net_allow?: string[];
|
|
48
48
|
/** The repo names its runner can work in, as the runner reported them (empty: never reported). */
|
|
49
49
|
repos?: string[];
|
|
50
|
-
/** GitHub repositories ("owner/name", "owner/*")
|
|
50
|
+
/** GitHub repositories ("owner/name", "owner/*") an admin picked for the agent's runs; empty: none picked. */
|
|
51
51
|
github_repos?: string[];
|
|
52
|
+
/** What its runs may read on GitHub: github_repos, else the repositories its runner works in (one owner); empty: nothing. */
|
|
53
|
+
github_scope?: string[];
|
|
52
54
|
}
|
|
53
55
|
/** A read-only GitHub token the hub issued for one run, valid an hour. `repos`: the repository names it covers, or ["*"]. */
|
|
54
56
|
export interface GithubToken {
|
|
@@ -432,7 +434,7 @@ export declare class Client {
|
|
|
432
434
|
/** Download one attachment into `dir`; returns the local path. */
|
|
433
435
|
download(a: Attachment, dir: string): Promise<string>;
|
|
434
436
|
me(): Promise<Agent>;
|
|
435
|
-
/** A read-only GitHub token for one run (
|
|
437
|
+
/** A read-only GitHub token for one run (the agent's github_scope); `runId` names a live run (the runner's key needs it). */
|
|
436
438
|
githubToken(runId: string): Promise<GithubToken>;
|
|
437
439
|
/** A one-hour token that pushes to one repository, for delivering a task's branch (the runner's key, the task's run). */
|
|
438
440
|
pushToken(taskId: string, runId: string, github: string): Promise<GithubToken>;
|
package/dist/src/client.js
CHANGED
|
@@ -265,7 +265,7 @@ export class Client {
|
|
|
265
265
|
a.owner_name = r.owner_name;
|
|
266
266
|
return a;
|
|
267
267
|
}
|
|
268
|
-
/** A read-only GitHub token for one run (
|
|
268
|
+
/** A read-only GitHub token for one run (the agent's github_scope); `runId` names a live run (the runner's key needs it). */
|
|
269
269
|
async githubToken(runId) {
|
|
270
270
|
return this.ach('POST', '/github/token', { run_id: runId });
|
|
271
271
|
}
|
package/dist/src/doctor.js
CHANGED
|
@@ -108,6 +108,7 @@ export async function runDoctor(o) {
|
|
|
108
108
|
let runtime;
|
|
109
109
|
let agentName;
|
|
110
110
|
let githubRepos = [];
|
|
111
|
+
let githubScope = null;
|
|
111
112
|
if (cfg.hub) {
|
|
112
113
|
const fetchFn = o.fetch ?? ((u, i) => fetch(u, i));
|
|
113
114
|
let host = cfg.hub;
|
|
@@ -170,6 +171,7 @@ export async function runDoctor(o) {
|
|
|
170
171
|
runtime = typeof me.runtime === 'string' ? me.runtime : undefined;
|
|
171
172
|
agentName = me.name;
|
|
172
173
|
githubRepos = Array.isArray(me.github_repos) ? me.github_repos : [];
|
|
174
|
+
githubScope = Array.isArray(me.github_scope) ? me.github_scope : null;
|
|
173
175
|
add('hub login', 'ok', `agent ${me.name}${me.owner_name ? ` (owner ${me.owner_name})` : ''}, runtime ${me.runtime ?? '?'}`, 'key');
|
|
174
176
|
}
|
|
175
177
|
catch (e) {
|
|
@@ -189,10 +191,15 @@ export async function runDoctor(o) {
|
|
|
189
191
|
hubLatest = c.latest_client;
|
|
190
192
|
if (c && Number.isInteger(c.min_client_proto))
|
|
191
193
|
hubMinProto = c.min_client_proto;
|
|
192
|
-
// a run's GitHub token comes from the hub's GitHub App
|
|
194
|
+
// a run's GitHub token comes from the hub's GitHub App, for the agent's scope: the repositories an admin picked, else the
|
|
195
|
+
// ones this runner works in (an older hub without github_scope: the picked ones, else every repository the App sees)
|
|
193
196
|
if (c && typeof c.github_app === 'boolean') {
|
|
194
|
-
if (c.github_app)
|
|
195
|
-
add('github', '
|
|
197
|
+
if (c.github_app && githubScope && !githubScope.length)
|
|
198
|
+
add('github', 'warn', 'no GitHub repository: this runner works in no GitHub checkout and no admin picked any', 'key', 'start the runner in a checkout, or ask your admin to pick repositories for this agent');
|
|
199
|
+
else if (c.github_app) {
|
|
200
|
+
const s = githubScope ?? githubRepos;
|
|
201
|
+
add('github', 'ok', s.length ? `a read-only token for ${s.join(', ')}, issued for each run` : 'a read-only token for every repository the hub\'s GitHub App sees, issued for each run', 'key');
|
|
202
|
+
}
|
|
196
203
|
else if (githubRepos.length)
|
|
197
204
|
add('github', 'warn', `${githubRepos.join(', ')} are listed for this agent, but the hub has no GitHub App`, 'key', 'ask your admin to set ACH_GITHUB_APP_ID and ACH_GITHUB_APP_KEY on the hub');
|
|
198
205
|
}
|
|
@@ -328,8 +328,8 @@ export declare class Runner {
|
|
|
328
328
|
/** The task's attachments, downloaded into filesDir (best effort: a failed download is listed without a path). */
|
|
329
329
|
private fetchFiles;
|
|
330
330
|
/**
|
|
331
|
-
* The GitHub token of a run: read-only, issued by the hub from its GitHub App for this one run and valid an hour (
|
|
332
|
-
*
|
|
331
|
+
* The GitHub token of a run: read-only, issued by the hub from its GitHub App for this one run and valid an hour (the
|
|
332
|
+
* repositories an admin picked for this agent, else the ones this runner works in). A hub that cannot issue one does not fail the run: the
|
|
333
333
|
* agent finds `gh` without a login, and the runner's log for the task says why. After a failure the hub is not asked again
|
|
334
334
|
* for a minute (ten when it has no GitHub App).
|
|
335
335
|
*/
|
|
@@ -1527,8 +1527,8 @@ export class Runner {
|
|
|
1527
1527
|
return out;
|
|
1528
1528
|
}
|
|
1529
1529
|
/**
|
|
1530
|
-
* The GitHub token of a run: read-only, issued by the hub from its GitHub App for this one run and valid an hour (
|
|
1531
|
-
*
|
|
1530
|
+
* The GitHub token of a run: read-only, issued by the hub from its GitHub App for this one run and valid an hour (the
|
|
1531
|
+
* repositories an admin picked for this agent, else the ones this runner works in). A hub that cannot issue one does not fail the run: the
|
|
1532
1532
|
* agent finds `gh` without a login, and the runner's log for the task says why. After a failure the hub is not asked again
|
|
1533
1533
|
* for a minute (ten when it has no GitHub App).
|
|
1534
1534
|
*/
|
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.45.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",
|