@koalaauto/agentchannel 3.53.2 → 3.53.3
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
|
@@ -190,6 +190,40 @@ export declare const ANSWER_SCHEMA: {
|
|
|
190
190
|
};
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Structured mention runs: an answer schema with the escalation's one-line ask and who it goes to. Strict output schemas need every
|
|
195
|
+
* property required, so an answer sends ask "" and to "asker".
|
|
196
|
+
*/
|
|
197
|
+
export declare const MENTION_SCHEMA: {
|
|
198
|
+
readonly type: "object";
|
|
199
|
+
readonly additionalProperties: false;
|
|
200
|
+
readonly required: readonly ["action", "text", "evidence", "ask", "to"];
|
|
201
|
+
readonly properties: {
|
|
202
|
+
readonly action: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly enum: readonly ["answer", "decide"];
|
|
205
|
+
};
|
|
206
|
+
readonly text: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
};
|
|
209
|
+
readonly evidence: {
|
|
210
|
+
readonly type: "string";
|
|
211
|
+
};
|
|
212
|
+
readonly ask: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
};
|
|
215
|
+
readonly to: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly enum: readonly ["asker", "owner"];
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* 2026-11-18: a post asked "Evan, please judge this yourself: which option do you prefer?" through @evan-reelworker-staging. The run
|
|
223
|
+
* dug up the facts and wrote "Evan makes the final call" in a plain reply, so it sat among the Inbox's replies, never a to-do, and
|
|
224
|
+
* Evan reads only to-dos. A question put to the owner in person is theirs even when the agent can find every fact.
|
|
225
|
+
*/
|
|
226
|
+
export declare function ownerAskedRule(owner: string | undefined, structured: boolean): string;
|
|
193
227
|
/**
|
|
194
228
|
* Live test (gpt-6-luna): without this, a Codex answer run replied "decide"
|
|
195
229
|
* after zero tool calls although the answer was in a file of its cwd.
|
package/dist/src/prompts.js
CHANGED
|
@@ -414,6 +414,32 @@ export const ANSWER_SCHEMA = {
|
|
|
414
414
|
evidence: { type: 'string' },
|
|
415
415
|
},
|
|
416
416
|
};
|
|
417
|
+
/**
|
|
418
|
+
* Structured mention runs: an answer schema with the escalation's one-line ask and who it goes to. Strict output schemas need every
|
|
419
|
+
* property required, so an answer sends ask "" and to "asker".
|
|
420
|
+
*/
|
|
421
|
+
export const MENTION_SCHEMA = {
|
|
422
|
+
type: 'object',
|
|
423
|
+
additionalProperties: false,
|
|
424
|
+
required: ['action', 'text', 'evidence', 'ask', 'to'],
|
|
425
|
+
properties: {
|
|
426
|
+
action: { type: 'string', enum: ['answer', 'decide'] },
|
|
427
|
+
text: { type: 'string' },
|
|
428
|
+
evidence: { type: 'string' },
|
|
429
|
+
ask: { type: 'string' },
|
|
430
|
+
to: { type: 'string', enum: ['asker', 'owner'] },
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* 2026-11-18: a post asked "Evan, please judge this yourself: which option do you prefer?" through @evan-reelworker-staging. The run
|
|
435
|
+
* dug up the facts and wrote "Evan makes the final call" in a plain reply, so it sat among the Inbox's replies, never a to-do, and
|
|
436
|
+
* Evan reads only to-dos. A question put to the owner in person is theirs even when the agent can find every fact.
|
|
437
|
+
*/
|
|
438
|
+
export function ownerAskedRule(owner, structured) {
|
|
439
|
+
const who = owner ? `your owner (${owner})` : 'your owner';
|
|
440
|
+
const how = structured ? 'answer with action "decide" and to "owner"' : 'reply with `--escalate --to owner`';
|
|
441
|
+
return `- If the post asks ${who} in person (names them, or wants their own judgment, choice or approval), the decision is theirs even when you can find every fact: put what you found in the reply and ${how}, with an ask naming the choice. Writing in a plain reply that they decide does not reach them; only an escalation lands in their Inbox to-dos.`;
|
|
442
|
+
}
|
|
417
443
|
/**
|
|
418
444
|
* Live test (gpt-6-luna): without this, a Codex answer run replied "decide"
|
|
419
445
|
* after zero tool calls although the answer was in a file of its cwd.
|
|
@@ -484,8 +510,9 @@ export function buildMentionPrompt(c) {
|
|
|
484
510
|
const how = c.structured
|
|
485
511
|
? [
|
|
486
512
|
'- Do not run `ach`; the runner posts your reply in the thread. End with a JSON object only:',
|
|
487
|
-
' {"action":"answer","text":"<reply>","evidence":"<files/commands you checked>"} if you can answer from evidence, or',
|
|
488
|
-
' {"action":"decide","ask":"<the one thing the person must decide, one line>","text":"<why a human must decide, with options and money impact>","evidence":"<what you checked; claims you relay without checking, and whose>"} if it needs a human.',
|
|
513
|
+
' {"action":"answer","text":"<reply>","evidence":"<files/commands you checked>","ask":"","to":"asker"} if you can answer from evidence, or',
|
|
514
|
+
' {"action":"decide","ask":"<the one thing the person must decide, one line>","text":"<why a human must decide, with options and money impact>","evidence":"<what you checked; claims you relay without checking, and whose>","to":"asker"} if it needs a human (money, product direction, anything irreversible, or you are not sure). It goes to whoever mentioned you; "to":"owner" sends it to your own owner instead.',
|
|
515
|
+
ownerAskedRule(c.ownerName, true),
|
|
489
516
|
]
|
|
490
517
|
: [
|
|
491
518
|
'- If you can answer from evidence, reply in the thread. Write the reply after `-` as a quoted heredoc, so backticks and quotes in it stay text (a reply in double quotes with a backtick in it is refused):',
|
|
@@ -493,6 +520,7 @@ export function buildMentionPrompt(c) {
|
|
|
493
520
|
' <reply, markdown>',
|
|
494
521
|
' EOF',
|
|
495
522
|
"- If it needs a human (money, product direction, anything irreversible, or you are not sure): `ach reply --escalate --evidence '<what you checked; claims you relay without checking, and whose>' --ask '<the one thing they must decide, one line>' - <<'EOF'`, the reply saying why, with options and money impact, then `EOF` (it goes to whoever mentioned you; add `--to owner` when the decision is your own owner's, e.g. your owner must approve something)",
|
|
523
|
+
ownerAskedRule(c.ownerName, false),
|
|
496
524
|
"- Flag values go in single quotes, with no backtick or `$` in them; the heredoc's last line is `EOF` alone.",
|
|
497
525
|
'- `ach thread` shows the whole thread; `ach channel` the channel. Reply once, then stop.',
|
|
498
526
|
'- Besides these three `ach` commands only `git log`, `git show`, `git diff`, `git blame` and `git status` run here, each as one plain command (no pipes, no `cd`); any other command is refused (that does not mean `ach reply` is). Read files with Read, Glob and Grep.',
|
|
@@ -15,7 +15,7 @@ import { taskFiles } from '../attachments.js';
|
|
|
15
15
|
import { buildAgentEnv, inheritedEnv } from '../env.js';
|
|
16
16
|
import { unlinkWindowsSandbox } from '../codexhome.js';
|
|
17
17
|
import { effectivePerm } from '../perm.js';
|
|
18
|
-
import { ANSWER_SCHEMA, buildAnswerPrompt, buildMentionPrompt, buildPreparePrompt, buildResumePrompt, buildTaskPrompt, postUrl, refOf, REMOTE_FAILED_PREFIX, taskUrl } from '../prompts.js';
|
|
18
|
+
import { ANSWER_SCHEMA, MENTION_SCHEMA, buildAnswerPrompt, buildMentionPrompt, buildPreparePrompt, buildResumePrompt, buildTaskPrompt, postUrl, refOf, REMOTE_FAILED_PREFIX, taskUrl } from '../prompts.js';
|
|
19
19
|
import { RunnerState } from './state.js';
|
|
20
20
|
import { isGitRepo } from './workspace.js';
|
|
21
21
|
import { accountProblem, effortRejected, looksLikeLoginError, modelRejected, summarizeRuntimeError } from '../envcheck.js';
|
|
@@ -1437,7 +1437,7 @@ export class Runner {
|
|
|
1437
1437
|
threadUrl: !this.o.publicUrl && typeof run.thread.url === 'string' && /^https?:\/\//.test(run.thread.url) ? run.thread.url : postUrl(this.base(), threadId),
|
|
1438
1438
|
structured,
|
|
1439
1439
|
});
|
|
1440
|
-
const result = await this.execute(rec, entry, prompt, undefined, 'mention', structured ?
|
|
1440
|
+
const result = await this.execute(rec, entry, prompt, undefined, 'mention', structured ? MENTION_SCHEMA : undefined, {
|
|
1441
1441
|
threadId,
|
|
1442
1442
|
usage: (cost, est, used) => client.mentionUsage(mid, runId, cost, est, used),
|
|
1443
1443
|
recorder: (r) => { recorded = r; },
|
|
@@ -1472,7 +1472,7 @@ export class Runner {
|
|
|
1472
1472
|
await c.reply(threadId, String(out.text), { evidence: String(out.evidence) });
|
|
1473
1473
|
}
|
|
1474
1474
|
else if (String(out.text ?? '').trim()) {
|
|
1475
|
-
await c.reply(threadId, String(out.text), { escalate: true, ...(String(out.evidence ?? '').trim() ? { evidence: String(out.evidence) } : {}), ...(String(out.ask ?? '').trim() ? { ask: String(out.ask).replace(/\s+/g, ' ').trim().slice(0, 200) } : {}) });
|
|
1475
|
+
await c.reply(threadId, String(out.text), { escalate: true, ...(out.to === 'owner' ? { escalateTo: 'owner' } : {}), ...(String(out.evidence ?? '').trim() ? { evidence: String(out.evidence) } : {}), ...(String(out.ask ?? '').trim() ? { ask: String(out.ask).replace(/\s+/g, ' ').trim().slice(0, 200) } : {}) });
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
catch (e) {
|
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.53.
|
|
3
|
+
"version": "3.53.3",
|
|
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",
|