@koalaauto/agentchannel 3.52.0 → 3.53.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/prompts.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export declare function postUrl(base: string, postId: string): string;
|
|
|
86
86
|
/** The task's ref ("TASK-128") when the hub sent one, else its id. */
|
|
87
87
|
export declare function refOf(t: Pick<Task, 'id' | 'ref'>): string;
|
|
88
88
|
/** §19: agents speak in links. Trusted rule text. */
|
|
89
|
-
export declare const LINK_RULE = "- Refer to tasks, posts and commits by link
|
|
89
|
+
export declare const LINK_RULE = "- Refer to tasks, posts and commits by link (TASK-128, the post's full link, a commit URL), never \"the one above\", \"that task\" or a bare post id. Put file paths, commands, identifiers and config keys in `backticks`.";
|
|
90
90
|
/** Agent-written posts as data for the untrusted block. */
|
|
91
91
|
export declare function postData(posts: Post[]): Record<string, unknown>[];
|
|
92
92
|
/** Channel posts in a task prompt are background: at most this many characters in all (one line per post). */
|
package/dist/src/prompts.js
CHANGED
|
@@ -65,7 +65,7 @@ export function refOf(t) {
|
|
|
65
65
|
return typeof t.ref === 'string' && /^(?:TASK|T)-\d+$/.test(t.ref) ? t.ref : t.id;
|
|
66
66
|
}
|
|
67
67
|
/** §19: agents speak in links. Trusted rule text. */
|
|
68
|
-
export const LINK_RULE = '- Refer to tasks, posts and commits by link
|
|
68
|
+
export const LINK_RULE = '- Refer to tasks, posts and commits by link (TASK-128, the post\'s full link, a commit URL), never "the one above", "that task" or a bare post id. Put file paths, commands, identifiers and config keys in `backticks`.';
|
|
69
69
|
function postAuthor(p) {
|
|
70
70
|
if (p.author_type === 'human')
|
|
71
71
|
return 'human';
|
|
@@ -19,6 +19,8 @@ export interface RunnerOptions {
|
|
|
19
19
|
max?: number;
|
|
20
20
|
perm?: Perm;
|
|
21
21
|
intervalMs?: number;
|
|
22
|
+
/** How long to wait before trying to describe the agent again after a failure (default 5 minutes; 3 tries per start). */
|
|
23
|
+
describeRetryMs?: number;
|
|
22
24
|
/** The hub answered 426 client_too_old: this release is below its floor (the updater checks at once). */
|
|
23
25
|
onClientTooOld?: () => void;
|
|
24
26
|
heartbeatMs?: number;
|
|
@@ -206,6 +208,8 @@ export declare class Runner {
|
|
|
206
208
|
* the owner edits it like any other. Tried again at the next start when it could not be had. */
|
|
207
209
|
private describeDone;
|
|
208
210
|
private describeBusy;
|
|
211
|
+
private describeTries;
|
|
212
|
+
private describeNextAt;
|
|
209
213
|
private describeAgent;
|
|
210
214
|
/** Tell the hub how this runner runs tasks (its --perm, the tool, the names it passes with --pass-env), once, so the agent's
|
|
211
215
|
* owner sees on its page what a task sent to it can reach. Tried on every poll until the hub has it; an older hub (404) is left alone. */
|
|
@@ -402,9 +402,11 @@ export class Runner {
|
|
|
402
402
|
* the owner edits it like any other. Tried again at the next start when it could not be had. */
|
|
403
403
|
describeDone = false;
|
|
404
404
|
describeBusy = false;
|
|
405
|
+
describeTries = 0;
|
|
406
|
+
describeNextAt = 0;
|
|
405
407
|
async describeAgent() {
|
|
406
408
|
const { adapter, client, workspace } = this.o;
|
|
407
|
-
if (this.describeDone || this.describeBusy || adapter.remote || !client.reportDescription || !workspace.repoDirs)
|
|
409
|
+
if (this.describeDone || this.describeBusy || Date.now() < this.describeNextAt || adapter.remote || !client.reportDescription || !workspace.repoDirs)
|
|
408
410
|
return;
|
|
409
411
|
this.describeBusy = true;
|
|
410
412
|
try {
|
|
@@ -459,10 +461,18 @@ export class Runner {
|
|
|
459
461
|
this.log(`description: ${text.slice(0, 120)}`);
|
|
460
462
|
}
|
|
461
463
|
catch (e) {
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
464
|
+
// an older hub without /me/description (404) says nothing and is left alone; any other failure (a hub or network that was not
|
|
465
|
+
// reachable while many runners restarted at once, a model that said nothing) is tried again, three times in all per start
|
|
466
|
+
if (e instanceof HubError && e.status === 404)
|
|
467
|
+
this.describeDone = true;
|
|
468
|
+
else if (++this.describeTries >= 3) {
|
|
469
|
+
this.describeDone = true;
|
|
470
|
+
this.log(`description: ${String(e?.message ?? e).slice(0, 200)} (gave up until the next start)`);
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
this.describeNextAt = Date.now() + (this.o.describeRetryMs ?? 5 * 60_000);
|
|
474
|
+
this.log(`description: ${String(e?.message ?? e).slice(0, 200)} (trying again in ${Math.round((this.o.describeRetryMs ?? 5 * 60_000) / 60_000)} min)`);
|
|
475
|
+
}
|
|
466
476
|
}
|
|
467
477
|
finally {
|
|
468
478
|
this.describeBusy = false;
|
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.53.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",
|