@koalaauto/agentchannel 3.59.0 → 3.59.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/dist/src/cli-memory.js +6 -6
- package/dist/src/client.d.ts +5 -0
- package/dist/src/client.js +10 -0
- package/dist/src/mcp.js +5 -2
- package/dist/src/prompts.js +1 -0
- package/dist/src/runner/runner.js +4 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/cli-memory.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// `ach remember`, `ach recall`, `ach decide-draft` and `ach memory ...`: the team Memory from the command line.
|
|
2
2
|
import { isAbsolute, resolve } from 'node:path';
|
|
3
3
|
import { UsageError } from './args.js';
|
|
4
|
-
import {
|
|
4
|
+
import { lintProblemLines } from './client.js';
|
|
5
5
|
import { loadConfig } from './config.js';
|
|
6
6
|
import { untrustedBlock as wrapUntrusted } from './prompts.js';
|
|
7
7
|
import { MEMORY_NOTE, absUrl, channelFile, noAgentHint, str, text } from './cli-shared.js';
|
|
@@ -108,11 +108,11 @@ export async function memoryCommand(ctx) {
|
|
|
108
108
|
}
|
|
109
109
|
catch (e) {
|
|
110
110
|
// lint: list every problem line with its reason, then fail
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
io.err(`not pushed: ${
|
|
114
|
-
for (const
|
|
115
|
-
io.err(
|
|
111
|
+
const lines = lintProblemLines(e, '.md');
|
|
112
|
+
if (lines) {
|
|
113
|
+
io.err(`not pushed: ${lines.length} problem(s). Fix each line and push again:`);
|
|
114
|
+
for (const l of lines)
|
|
115
|
+
io.err(l);
|
|
116
116
|
return 1;
|
|
117
117
|
}
|
|
118
118
|
throw e;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -408,6 +408,11 @@ export declare class HubError extends Error {
|
|
|
408
408
|
body?: unknown | undefined;
|
|
409
409
|
constructor(status: number, message: string, code?: string | undefined, body?: unknown | undefined);
|
|
410
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* A Memory push the hub refused (`lint`): one line per problem, `<page><ext> line N: <why>` and the offending text under it. The
|
|
413
|
+
* hub's message only counts them. `ext` is '.md' where the pages are files (`ach memory push`). Undefined for any other error.
|
|
414
|
+
*/
|
|
415
|
+
export declare function lintProblemLines(e: unknown, ext?: string): string[] | undefined;
|
|
411
416
|
/** A one-time login link: open `<hub><path>` (the token is in the URL fragment). */
|
|
412
417
|
export interface LoginLink {
|
|
413
418
|
token: string;
|
package/dist/src/client.js
CHANGED
|
@@ -74,6 +74,16 @@ export class HubError extends Error {
|
|
|
74
74
|
this.name = 'HubError';
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* A Memory push the hub refused (`lint`): one line per problem, `<page><ext> line N: <why>` and the offending text under it. The
|
|
79
|
+
* hub's message only counts them. `ext` is '.md' where the pages are files (`ach memory push`). Undefined for any other error.
|
|
80
|
+
*/
|
|
81
|
+
export function lintProblemLines(e, ext = '') {
|
|
82
|
+
const problems = e instanceof HubError && e.code === 'lint' ? e.body?.problems : undefined;
|
|
83
|
+
if (!Array.isArray(problems))
|
|
84
|
+
return undefined;
|
|
85
|
+
return problems.map((x) => ` ${x.slug}${ext}${x.line ? ` line ${x.line}` : ''}: ${x.problem}${x.text ? `\n ${x.text}` : ''}`);
|
|
86
|
+
}
|
|
77
87
|
/** Round 2: human-facing CLI text in Chinese when LANG/LC_ALL starts with zh. */
|
|
78
88
|
export function isZh(env) {
|
|
79
89
|
return /^zh/i.test(env.LC_ALL || env.LC_MESSAGES || env.LANG || '');
|
package/dist/src/mcp.js
CHANGED
|
@@ -11,7 +11,7 @@ import { AttentionNotifier, ChangeFeed, codexQueue, defaultExec, fetchAttention,
|
|
|
11
11
|
import { isZh } from './client.js';
|
|
12
12
|
import { startStaleNotice } from './selfupdate.js';
|
|
13
13
|
import { decisionTo, explainToUser, mentionNames, unknownMentions } from './names.js';
|
|
14
|
-
import { HubError } from './client.js';
|
|
14
|
+
import { HubError, lintProblemLines } from './client.js';
|
|
15
15
|
export const HANDOFF_TEMPLATE = `## Goal
|
|
16
16
|
<one or two sentences: what done looks like>
|
|
17
17
|
|
|
@@ -36,7 +36,10 @@ async function wrap(fn) {
|
|
|
36
36
|
return { content: [{ type: 'text', text: typeof r === 'string' ? r : JSON.stringify(r, null, 2) }] };
|
|
37
37
|
}
|
|
38
38
|
catch (e) {
|
|
39
|
-
|
|
39
|
+
// a refused Memory push: which lines and why (the hub's message only counts them)
|
|
40
|
+
const lines = lintProblemLines(e);
|
|
41
|
+
const more = lines ? `\nnot written; fix each line and write again:\n${lines.join('\n')}` : '';
|
|
42
|
+
return { content: [{ type: 'text', text: `error: ${e?.message ?? e}${more}` }], isError: true };
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
/**
|
package/dist/src/prompts.js
CHANGED
|
@@ -303,6 +303,7 @@ function rules(review) {
|
|
|
303
303
|
' - `ach progress "<text>"` for short status updates.',
|
|
304
304
|
' - `ach ask "<question>"` asks the sender a factual question. Then stop and end your turn; you will be resumed with the answer.',
|
|
305
305
|
' - `ach ask-human "<one question>" --option "A|<detail>|<money>" --option "B|<detail>|<money>" [--recommend 0]` for anything about money, product direction or irreversible actions (your owner decides; add `--to both` when the choice also affects the sender\'s side (never for a fact only your owner knows, such as whether a rerun finished: they answer it, the sender\'s owner cannot), or `--to <name|email>` when the call belongs to a specific person in the task\'s channel, e.g. an ops decision to the ops owner; your owner is cc\'d). One question per request; 2–3 options, recommended first; state the money/impact of each option. Never ask what you can verify yourself (files, commands, Memory) or what resolves itself. The person replies by picking an option or typing; that reply is the decision. Then stop. Never claim a person decided anything they did not reply.',
|
|
306
|
+
' - A person\'s decision on this task (to your request or to the sender\'s) is their answer: when it settles what you were waiting for, never ask it again or wait for a second answer. When it says the work is not to be done (declined, not now), stop there and `ach complete` with a result that quotes the decision and says nothing was built.',
|
|
306
307
|
' - `ach complete --result-file .ach/<file>` (or `ach complete "<text>"`) when done: summary, how it was verified. It becomes the pull request\'s description; the runner links the pull request on the task.',
|
|
307
308
|
' - `ach fail "<reason>" --cause <secret|network|permission|workspace|quota|task|other> [--needs "<what is missing>"]` if it cannot be done. The cause tells your owner what to fix: secret, network, permission, workspace and quota only they can (say exactly what is missing in --needs: a variable name, a host, a repo); task when the task itself is wrong (name the agent or repository that should do it).',
|
|
308
309
|
completeRule(review),
|
|
@@ -156,7 +156,10 @@ export function unseenReplies(messages, myId, seen) {
|
|
|
156
156
|
mine.add(m.id);
|
|
157
157
|
const seenSet = new Set(seen);
|
|
158
158
|
return messages.filter((m) => !seenSet.has(m.id) &&
|
|
159
|
-
(((m.kind === 'answer' || m.kind === 'decision') && ((m.reply_to && mine.has(m.reply_to)) || m.to_agent === myId)) ||
|
|
159
|
+
(((m.kind === 'answer' || m.kind === 'decision') && ((m.reply_to && mine.has(m.reply_to)) || m.to_agent === myId)) ||
|
|
160
|
+
// a person's decision on the task I work is for me, whoever's request it answered (the sender's "approve?" decides my work)
|
|
161
|
+
(m.kind === 'decision' && m.author_type === 'human') ||
|
|
162
|
+
isHumanNoteTo(m, myId)));
|
|
160
163
|
}
|
|
161
164
|
/** A task handed back this many times for an account's usage or rate limit then fails normally. */
|
|
162
165
|
const ACCOUNT_RELEASES = 3;
|
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.59.
|
|
3
|
+
"version": "3.59.2",
|
|
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",
|