@koda-sl/baker-bridge 0.194.0 → 0.195.0-dev.a2270c74d
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/README.md +43 -35
- package/dist/hono/bridge-job.d.ts +10 -0
- package/dist/hono/bridge-job.d.ts.map +1 -1
- package/dist/hono/bridge-job.js +55 -19
- package/dist/hono/bridge-job.js.map +1 -1
- package/dist/hono/bridge-job.test.js +27 -226
- package/dist/hono/bridge-job.test.js.map +1 -1
- package/dist/hono/chat-language.d.ts +34 -0
- package/dist/hono/chat-language.d.ts.map +1 -0
- package/dist/hono/chat-language.js +152 -0
- package/dist/hono/chat-language.js.map +1 -0
- package/dist/hono/chat-language.test.d.ts +2 -0
- package/dist/hono/chat-language.test.d.ts.map +1 -0
- package/dist/hono/chat-language.test.js +136 -0
- package/dist/hono/chat-language.test.js.map +1 -0
- package/dist/hono/jev.d.ts +16 -0
- package/dist/hono/jev.d.ts.map +1 -1
- package/dist/hono/jev.js +44 -21
- package/dist/hono/jev.js.map +1 -1
- package/dist/hono/model-capabilities.js +3 -3
- package/dist/hono/model-capabilities.js.map +1 -1
- package/dist/hono/progress-note.d.ts +0 -3
- package/dist/hono/progress-note.d.ts.map +1 -1
- package/dist/hono/progress-note.js +0 -8
- package/dist/hono/progress-note.js.map +1 -1
- package/dist/hono/publish-handoff.d.ts +6 -26
- package/dist/hono/publish-handoff.d.ts.map +1 -1
- package/dist/hono/publish-handoff.js +10 -118
- package/dist/hono/publish-handoff.js.map +1 -1
- package/dist/hono/publish-handoff.test.js +31 -172
- package/dist/hono/publish-handoff.test.js.map +1 -1
- package/dist/hono/skill-language.d.ts +16 -40
- package/dist/hono/skill-language.d.ts.map +1 -1
- package/dist/hono/skill-language.js +39 -172
- package/dist/hono/skill-language.js.map +1 -1
- package/dist/hono/skill-language.test.js +36 -89
- package/dist/hono/skill-language.test.js.map +1 -1
- package/dist/hono/subagent-route.test.js +29 -5
- package/dist/hono/subagent-route.test.js.map +1 -1
- package/dist/review/digest.d.ts +0 -5
- package/dist/review/digest.d.ts.map +1 -1
- package/dist/review/digest.js +33 -28
- package/dist/review/digest.js.map +1 -1
- package/dist/review/digest.test.js +11 -248
- package/dist/review/digest.test.js.map +1 -1
- package/dist/review/evidence-block.js +1 -1
- package/dist/review/evidence-block.js.map +1 -1
- package/dist/review/reply-language.d.ts +8 -33
- package/dist/review/reply-language.d.ts.map +1 -1
- package/dist/review/reply-language.js +23 -168
- package/dist/review/reply-language.js.map +1 -1
- package/dist/review/reply-language.test.js +10 -75
- package/dist/review/reply-language.test.js.map +1 -1
- package/package.json +1 -2
|
@@ -1,188 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { lastTypedMessages, runConfiguredLanguage } from "./publish-handoff.js";
|
|
1
|
+
import { marketerWords, runReportLanguage } from "../review/reply-language.js";
|
|
2
|
+
import { answerLanguage, languageConversation } from "./chat-language.js";
|
|
4
3
|
import { applyCurrentSenderAttribution } from "./session-continuity.js";
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
4
|
+
import { bridgeSlashCommandNames } from "./slash-commands.js";
|
|
5
|
+
const SKILL = "The skill you just loaded is written in English for you. The user never reads it, and it does not change the language you write to them in.";
|
|
7
6
|
/**
|
|
8
|
-
* The
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* The marketer's language, restated once a turn, the first time a skill loads. A skill's English
|
|
8
|
+
* body arrives in the user's seat, and the line after it went out in English to a Spanish chat
|
|
9
|
+
* (BAKER-3462). A skill loads two ways: the model calls `Skill` (PostToolUse), or the marketer
|
|
10
|
+
* types `/name …` and the CLI expands it with no tool call (UserPromptExpansion). The CLI sends
|
|
11
|
+
* either hook's context after the skill body, so this is the last thing the model reads before it
|
|
12
|
+
* writes again.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
export class RelayedLines {
|
|
18
|
-
lines = [];
|
|
19
|
-
calls = new Set();
|
|
20
|
-
agentCalls = new Set();
|
|
21
|
-
reported = false;
|
|
22
|
-
waiting = new Map();
|
|
23
|
-
streaming = false;
|
|
24
|
-
open() {
|
|
25
|
-
this.streaming = true;
|
|
26
|
-
}
|
|
27
|
-
close() {
|
|
28
|
-
this.streaming = false;
|
|
29
|
-
for (const release of this.waiting.values())
|
|
30
|
-
release();
|
|
31
|
-
this.waiting.clear();
|
|
32
|
-
}
|
|
33
|
-
observe(msg) {
|
|
34
|
-
// A background subagent's report reaches the model as a task notification, not as its tool result.
|
|
35
|
-
if (msg.type === "system" && msg.subtype === "task_notification") {
|
|
36
|
-
if (msg.tool_use_id !== undefined && this.agentCalls.has(msg.tool_use_id))
|
|
37
|
-
this.reported = true;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (msg.type !== "assistant" || msg.parent_tool_use_id)
|
|
41
|
-
return;
|
|
42
|
-
const content = msg.message?.content;
|
|
43
|
-
if (!Array.isArray(content))
|
|
44
|
-
return;
|
|
45
|
-
for (const block of content) {
|
|
46
|
-
const line = relayedLine(block, msg.message?.model);
|
|
47
|
-
if (line)
|
|
48
|
-
this.lines.push(line);
|
|
49
|
-
if (block?.type === "tool_use" && typeof block.id === "string")
|
|
50
|
-
this.called(block.id, block.name);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
called(toolUseId, toolName) {
|
|
54
|
-
this.calls.add(toolUseId);
|
|
55
|
-
if (typeof toolName === "string" && AGENT_TOOLS.has(toolName))
|
|
56
|
-
this.agentCalls.add(toolUseId);
|
|
57
|
-
this.waiting.get(toolUseId)?.();
|
|
58
|
-
this.waiting.delete(toolUseId);
|
|
59
|
-
}
|
|
60
|
-
async takeThrough(toolUseId) {
|
|
61
|
-
if (this.streaming && !this.calls.has(toolUseId)) {
|
|
62
|
-
await new Promise((resolve) => {
|
|
63
|
-
const timer = setTimeout(release, 2000);
|
|
64
|
-
function release() {
|
|
65
|
-
clearTimeout(timer);
|
|
66
|
-
resolve();
|
|
67
|
-
}
|
|
68
|
-
this.waiting.set(toolUseId, release);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const taken = { lines: this.lines, reported: this.reported };
|
|
72
|
-
this.lines = [];
|
|
73
|
-
this.reported = false;
|
|
74
|
-
return taken;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function startsInBackground(toolInput) {
|
|
78
|
-
return typeof toolInput === "object" && toolInput !== null && "run_in_background" in toolInput
|
|
79
|
-
? toolInput.run_in_background === true
|
|
80
|
-
: false;
|
|
81
|
-
}
|
|
82
|
-
/** What the marketer reads from one block of the agent's message: its text, or a progress note. */
|
|
83
|
-
function relayedLine(block, model) {
|
|
84
|
-
if (block?.type === "text")
|
|
85
|
-
return typeof block.text === "string" ? block.text : null;
|
|
86
|
-
return block?.type === "thinking" ? progressNoteText(block, model) : null;
|
|
87
|
-
}
|
|
88
|
-
/** Whether a line the marketer read is, for sure, in another language than theirs. Never throws. */
|
|
89
|
-
function drifted(lines, language) {
|
|
90
|
-
try {
|
|
91
|
-
return lines.some((line) => {
|
|
92
|
-
const written = identifiedLanguage(line);
|
|
93
|
-
return written !== undefined && written !== language;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* The marketer's language, restated the moment a skill loads. A skill's English
|
|
102
|
-
* body arrives in the user's seat, and the line after it went out in English to
|
|
103
|
-
* a Spanish chat (BAKER-3462). A skill loads two ways: the model calls `Skill`
|
|
104
|
-
* (PostToolUse), or the marketer types `/name …` and the CLI expands it with no
|
|
105
|
-
* tool call (UserPromptExpansion). The CLI sends either hook's context after the
|
|
106
|
-
* skill body, so this is the last thing the model reads before it writes again.
|
|
107
|
-
* Nothing is added to a chat the marketer writes in English, and a language is
|
|
108
|
-
* named only when it is read for sure: otherwise the note says theirs. A
|
|
109
|
-
* publish run never sees the conversation, and read a quoted message as
|
|
110
|
-
* feedback still owed (BAKER-3389), so there the note names the language only.
|
|
14
|
+
* Everything else is the scaffold's own rule ("Write in their language, in every line"): a note
|
|
15
|
+
* after every subagent report and a drift check on every line repeated it many times a turn, and
|
|
16
|
+
* the drift check, wrong, told a Spanish chat's agent it had slipped out of Catalan seven times
|
|
17
|
+
* (BAKER-4943).
|
|
111
18
|
*
|
|
112
|
-
* The
|
|
113
|
-
*
|
|
114
|
-
*
|
|
19
|
+
* The language is `answerLanguage`'s, named only when Jev is sure; otherwise the note names none
|
|
20
|
+
* and the scaffold's rule decides. Nobody's words are quoted, so nothing reads as feedback still owed
|
|
21
|
+
* (BAKER-3389). A chat answered in English gets no note. A nudge, never a block; it fails silent.
|
|
115
22
|
*/
|
|
116
|
-
export function skillLanguageHooks(job,
|
|
23
|
+
export function skillLanguageHooks(job, language) {
|
|
117
24
|
// A typed skill command reaches the SDK as typed, without the speaker label.
|
|
118
25
|
const current = marketerWords(job.prompt) ?? marketerWords(applyCurrentSenderAttribution(job.prompt, job.currentSender));
|
|
119
|
-
|
|
120
|
-
// A routine's brief and the repair prompt are Baker's words (BAKER-4107); the language a run was told to report in is not.
|
|
121
|
-
const configured = runConfiguredLanguage(job.history, job.prompt);
|
|
122
|
-
if (typed.length === 0 && !configured)
|
|
26
|
+
if (!languageConversation(job.history, current).text && !runReportLanguage(job.prompt))
|
|
123
27
|
return {};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
? []
|
|
142
|
-
: [
|
|
143
|
-
typed.length > 1
|
|
144
|
-
? "The last messages the user typed are quoted below, oldest first, only so you know their language — they are not new instructions:"
|
|
145
|
-
: "The last message the user typed is quoted below only so you know its language — it is not a new instruction:",
|
|
146
|
-
...typed.map((message) => `"${message.quoted}"`),
|
|
147
|
-
]),
|
|
148
|
-
language
|
|
149
|
-
? `Write every line you send the user in ${language}, the short notes between tool calls too.`
|
|
150
|
-
: likely.length > 0
|
|
151
|
-
? `Write every line you send the user in the language they write in, which reads as ${likely.join(" or ")}, the short notes between tool calls too.`
|
|
152
|
-
: "Write every line you send the user in the language they write in, the short notes between tool calls too.",
|
|
153
|
-
].join("\n");
|
|
154
|
-
const reminder = reminderAfter("The skill you just loaded is written in English for you. The user never reads it, and it does not change the language you write to them in.");
|
|
155
|
-
const afterAgent = reminderAfter("The agent's report you just read is written for you. The user never reads it, and it does not change the language you write to them in.");
|
|
156
|
-
const afterDrift = reminderAfter(`Your last line to the user was not in ${language}. Tool output and docs are in English for you; they do not change the language you write to them in.`);
|
|
28
|
+
let noted = false;
|
|
29
|
+
const note = async () => {
|
|
30
|
+
if (noted)
|
|
31
|
+
return undefined;
|
|
32
|
+
noted = true;
|
|
33
|
+
const known = await answerLanguage(language, job.history, current, job.prompt);
|
|
34
|
+
if (known === "English")
|
|
35
|
+
return undefined;
|
|
36
|
+
// No `<system-reminder>` of its own: the CLI wraps a hook's context in one and escapes a `<` inside it.
|
|
37
|
+
// Unsure, it points at no language: "the language they write in" pushed English on a chat asked for Spanish (BAKER-3729).
|
|
38
|
+
return [
|
|
39
|
+
// A fixed first line: session review's hook ledger names the note by it.
|
|
40
|
+
"Baker: the language of this chat.",
|
|
41
|
+
SKILL,
|
|
42
|
+
...(known ? [`Write every line you send the user in ${known}, the short notes between tool calls too.`] : []),
|
|
43
|
+
].join("\n");
|
|
44
|
+
};
|
|
157
45
|
// `/publish` carries its own note (`publishLanguageReminder`), and `/compact` loads no skill.
|
|
158
46
|
const bridgeCommands = bridgeSlashCommandNames();
|
|
47
|
+
const posted = (event, context) => context ? { hookSpecificOutput: { hookEventName: event, additionalContext: context } } : {};
|
|
159
48
|
return {
|
|
160
49
|
PostToolUse: [
|
|
161
50
|
{
|
|
162
51
|
matcher: "Skill",
|
|
163
|
-
hooks: [
|
|
164
|
-
async (input) => input.hook_event_name === "PostToolUse"
|
|
165
|
-
? { hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: reminder } }
|
|
166
|
-
: {},
|
|
167
|
-
],
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
hooks: [
|
|
171
|
-
async (input) => {
|
|
172
|
-
// A subagent's own tool calls: its lines never reach the marketer.
|
|
173
|
-
if (input.hook_event_name !== "PostToolUse" || input.agent_id !== undefined)
|
|
174
|
-
return {};
|
|
175
|
-
const { lines, reported: backgroundReport } = await relayed.takeThrough(input.tool_use_id);
|
|
176
|
-
// A background subagent's launch returns at once, with no report yet.
|
|
177
|
-
const foregroundReport = AGENT_TOOLS.has(input.tool_name) && !startsInBackground(input.tool_input);
|
|
178
|
-
const note = foregroundReport || backgroundReport
|
|
179
|
-
? afterAgent
|
|
180
|
-
: input.tool_name !== "Skill" && language !== undefined && drifted(lines, language)
|
|
181
|
-
? afterDrift
|
|
182
|
-
: undefined;
|
|
183
|
-
return note ? { hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: note } } : {};
|
|
184
|
-
},
|
|
185
|
-
],
|
|
52
|
+
hooks: [async (input) => (input.hook_event_name === "PostToolUse" ? posted("PostToolUse", await note()) : {})],
|
|
186
53
|
},
|
|
187
54
|
],
|
|
188
55
|
UserPromptExpansion: [
|
|
@@ -191,7 +58,7 @@ export function skillLanguageHooks(job, relayed) {
|
|
|
191
58
|
async (input) => input.hook_event_name === "UserPromptExpansion" &&
|
|
192
59
|
input.expansion_type === "slash_command" &&
|
|
193
60
|
!bridgeCommands.includes(input.command_name)
|
|
194
|
-
?
|
|
61
|
+
? posted("UserPromptExpansion", await note())
|
|
195
62
|
: {},
|
|
196
63
|
],
|
|
197
64
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-language.js","sourceRoot":"","sources":["../../src/hono/skill-language.ts"],"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C,CAAC,CAAC,CAAC,yCAAyC,KAAK,2CAA2C,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC;IACF,8FAA8F;IAC9F,MAAM,cAAc,GAAG,uBAAuB,EAAE,CAAC;IACjD,MAAM,MAAM,GAAG,CAAC,KAA4C,EAAE,OAA2B,EAAE,EAAE,CAC3F,OAAO,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9F,OAAO;QACL,WAAW,EAAE;YACX;gBACE,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,KAAK,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAC/G;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,KAAK,EAAE;oBACL,KAAK,EAAE,KAAK,EAAE,EAAE,CACd,KAAK,CAAC,eAAe,KAAK,qBAAqB;wBAC/C,KAAK,CAAC,cAAc,KAAK,eAAe;wBACxC,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;wBAC1C,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,IAAI,EAAE,CAAC;wBAC7C,CAAC,CAAC,EAAE;iBACT;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
2
|
+
import { skillLanguageHooks } from "./skill-language.js";
|
|
3
3
|
function history(entries) {
|
|
4
4
|
return {
|
|
5
5
|
entries: entries.map((entry, index) => ({ ...entry, createdAt: index })),
|
|
@@ -12,7 +12,8 @@ function history(entries) {
|
|
|
12
12
|
}
|
|
13
13
|
/** What the model reads beside the Skill call's result, as the SDK hands the hook's output on. */
|
|
14
14
|
async function contextAfter(toolName, hooks) {
|
|
15
|
-
const
|
|
15
|
+
const matchers = hooks.PostToolUse ?? [];
|
|
16
|
+
const hook = (matchers.find((matcher) => matcher.matcher === toolName) ?? matchers.find((matcher) => !matcher.matcher))?.hooks[0];
|
|
16
17
|
if (hook === undefined)
|
|
17
18
|
return undefined;
|
|
18
19
|
const output = await hook({
|
|
@@ -48,39 +49,32 @@ async function contextAfterTyped(command, hooks) {
|
|
|
48
49
|
? output.hookSpecificOutput.additionalContext
|
|
49
50
|
: undefined;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
const
|
|
52
|
+
/** Jev's decision, faked: the chat is answered in `answer`. */
|
|
53
|
+
const deciding = (answer) => () => Promise.resolve(answer);
|
|
54
|
+
const spanishRequest = "cuando entra la musica, la calidad del sonido empeora drasticamente. mejora eso";
|
|
53
55
|
describe("skillLanguageHooks", () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
expect(context).toContain("in Spanish");
|
|
58
|
-
expect(context).toContain(
|
|
56
|
+
// BAKER-3462: a Spanish request, an English skill loaded, and the next line the marketer read was English.
|
|
57
|
+
it("names the chat's language right after a skill loads, quoting nobody", async () => {
|
|
58
|
+
const context = await contextAfter("Skill", skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } }, deciding("Spanish")));
|
|
59
|
+
expect(context).toContain("Write every line you send the user in Spanish, the short notes between tool calls too.");
|
|
60
|
+
expect(context).not.toContain("cuando entra la musica");
|
|
59
61
|
});
|
|
60
62
|
// The CLI wraps a hook's context in its own reminder and escapes a `<` inside it.
|
|
61
63
|
it("opens with Baker's line rather than a reminder tag of its own", async () => {
|
|
62
|
-
const context = await contextAfter("Skill", skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } },
|
|
64
|
+
const context = await contextAfter("Skill", skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } }, deciding("Spanish")));
|
|
63
65
|
expect(context?.startsWith("Baker: the language of this chat.\n")).toBe(true);
|
|
64
66
|
expect(context).not.toContain("<");
|
|
65
67
|
});
|
|
66
|
-
it("
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
currentSender: { name: "Fernando" },
|
|
70
|
-
history: history([{ role: "user", text: "Prepara cuatro anuncios nuevos para la campaña de verano" }]),
|
|
71
|
-
}, new RelayedLines()));
|
|
72
|
-
expect(context).toContain("in Spanish");
|
|
73
|
-
expect(context).toContain('"Prepara cuatro anuncios nuevos para la campaña de verano"');
|
|
68
|
+
it("adds nothing to a chat answered in English", async () => {
|
|
69
|
+
const hooks = skillLanguageHooks({ prompt: "Make the webinar landing page hero brighter and shorter", currentSender: { name: "Ana" } }, deciding("English"));
|
|
70
|
+
expect(await contextAfter("Skill", hooks)).toBeUndefined();
|
|
74
71
|
});
|
|
75
|
-
// BAKER-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, new RelayedLines()));
|
|
82
|
-
expect(context).toContain("in Spanish");
|
|
83
|
-
expect(context).not.toContain("We published this");
|
|
72
|
+
// BAKER-4943: a guess named unaccented Spanish as Catalan; an unsure read names nothing.
|
|
73
|
+
// BAKER-3729: after "answer in Spanish" and then English messages, "the language they write in" pushed English.
|
|
74
|
+
it("names no language Jev is unsure of, and points at none", async () => {
|
|
75
|
+
const context = await contextAfter("Skill", skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } }, deciding(undefined)));
|
|
76
|
+
expect(context).toContain("it does not change the language you write to them in");
|
|
77
|
+
expect(context).not.toContain("Write every line");
|
|
84
78
|
});
|
|
85
79
|
it("names the language a routine reports in, past its English brief in the history", async () => {
|
|
86
80
|
const context = await contextAfter("Skill", skillLanguageHooks({
|
|
@@ -92,74 +86,27 @@ describe("skillLanguageHooks", () => {
|
|
|
92
86
|
bakerWritten: true,
|
|
93
87
|
},
|
|
94
88
|
]),
|
|
95
|
-
},
|
|
89
|
+
}, deciding("English")));
|
|
96
90
|
expect(context).toContain("Write every line you send the user in Spanish");
|
|
97
91
|
expect(context).not.toContain("Goal: send every lead");
|
|
98
92
|
});
|
|
99
|
-
it("adds nothing to a
|
|
100
|
-
|
|
101
|
-
prompt: "Make the webinar landing page hero brighter and shorter",
|
|
102
|
-
currentSender: { name: "Ana" },
|
|
103
|
-
}, new RelayedLines());
|
|
104
|
-
expect(hooks).toEqual({});
|
|
105
|
-
});
|
|
106
|
-
// eld reads only seven languages here: a Dutch request scored as German.
|
|
107
|
-
it("names no language it cannot tell apart from the ones it does not know", async () => {
|
|
108
|
-
const context = await contextAfter("Skill", skillLanguageHooks({
|
|
109
|
-
prompt: "Verander de titel op de pagina en voeg een nieuwe knop toe.",
|
|
110
|
-
currentSender: { name: "Sanne" },
|
|
111
|
-
}, new RelayedLines()));
|
|
112
|
-
expect(context).toContain("Write every line you send the user in the language they write in");
|
|
113
|
-
});
|
|
114
|
-
it("reads the language past an English page title the marketer mentioned", async () => {
|
|
115
|
-
const context = await contextAfter("Skill", skillLanguageHooks({
|
|
116
|
-
prompt: "@[Get a free quote today](landing:demo) cambia esto",
|
|
117
|
-
currentSender: { name: "Fernando" },
|
|
118
|
-
history: history([{ role: "user", text: "Crea una página nueva para anunciar la campaña de verano" }]),
|
|
119
|
-
}, new RelayedLines()));
|
|
120
|
-
expect(context).toContain("in Spanish");
|
|
121
|
-
expect(context).toContain('"@Get a free quote today cambia esto"');
|
|
122
|
-
});
|
|
123
|
-
// A publish run never sees the conversation: a quoted message read as feedback still owed (BAKER-3389).
|
|
124
|
-
it("names the language without quoting the marketer when a skill loads during Publish", async () => {
|
|
125
|
-
const context = await contextAfter("Skill", skillLanguageHooks({
|
|
126
|
-
prompt: "/publish",
|
|
127
|
-
history: history([{ role: "user", text: "Revisa que los videos esten ok en formato feed y vertical" }]),
|
|
128
|
-
}, new RelayedLines()));
|
|
129
|
-
expect(context).toContain("in Spanish");
|
|
130
|
-
expect(context).not.toContain("Revisa que los videos");
|
|
93
|
+
it("adds nothing to a turn with no words in any language", () => {
|
|
94
|
+
expect(skillLanguageHooks({ prompt: "/publish" }, deciding("Spanish"))).toEqual({});
|
|
131
95
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
prompt: "We published this, but some of the changes never reached the platform:\n\nLinkedIn Ads — 1 of 2 changes did not go through:\n- Ad set bid — LinkedIn refused a bid higher than the daily budget.\n\nWork out why each one failed, fix the cause, and stage the changes again so they can be published.",
|
|
136
|
-
currentSender: { name: "Lucía" },
|
|
137
|
-
history: history([
|
|
138
|
-
{ role: "user", text: "Prepara las campañas de LinkedIn para el lanzamiento de la marca, por favor" },
|
|
139
|
-
]),
|
|
140
|
-
}, new RelayedLines()));
|
|
141
|
-
expect(context).toContain("in Spanish");
|
|
142
|
-
expect(context).toContain('"Prepara las campañas de LinkedIn para el lanzamiento de la marca, por favor"');
|
|
143
|
-
expect(context).not.toContain("We published this");
|
|
96
|
+
it("names the chat's language after a skill command they typed is expanded", async () => {
|
|
97
|
+
const context = await contextAfterTyped("creative-canvas-ads", skillLanguageHooks({ prompt: "/creative-canvas-ads haz cuatro anuncios para la campaña de verano" }, deciding("Spanish")));
|
|
98
|
+
expect(context).toContain("Write every line you send the user in Spanish");
|
|
144
99
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"When this step needs branding, derive colors, fonts, logos, imagery, tone of voice and positioning from our website and public social profiles.",
|
|
151
|
-
"Our notes:\nTenemos una sola marca para todos los públicos y el tono es cercano y tranquilo.\nFiles: Brand guidelines for the new website.pdf",
|
|
152
|
-
].join("\n\n");
|
|
153
|
-
const context = await contextAfterTyped("brand-build", skillLanguageHooks({ prompt: `/brand-build ${kickoff}` }, new RelayedLines()));
|
|
154
|
-
expect(context).toContain("in Spanish");
|
|
155
|
-
expect(context).toContain("Tenemos una sola marca para todos los públicos");
|
|
156
|
-
expect(context).not.toContain("We are still setting up");
|
|
157
|
-
expect(context).not.toContain("Brand guidelines");
|
|
100
|
+
it("names the language once a turn, however many skills load", async () => {
|
|
101
|
+
const hooks = skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } }, deciding("Spanish"));
|
|
102
|
+
expect(await contextAfter("Skill", hooks)).toContain("in Spanish");
|
|
103
|
+
expect(await contextAfterTyped("creative-canvas-ads", hooks)).toBeUndefined();
|
|
104
|
+
expect(await contextAfter("Skill", hooks)).toBeUndefined();
|
|
158
105
|
});
|
|
159
|
-
it("
|
|
160
|
-
const
|
|
161
|
-
expect(
|
|
162
|
-
expect(
|
|
106
|
+
it("adds nothing after any other tool, a subagent's report included", async () => {
|
|
107
|
+
const hooks = skillLanguageHooks({ prompt: spanishRequest, currentSender: { name: "Fernando" } }, deciding("Spanish"));
|
|
108
|
+
expect(await contextAfter("Agent", hooks)).toBeUndefined();
|
|
109
|
+
expect(await contextAfter("Bash", hooks)).toBeUndefined();
|
|
163
110
|
});
|
|
164
111
|
});
|
|
165
112
|
//# sourceMappingURL=skill-language.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-language.test.js","sourceRoot":"","sources":["../../src/hono/skill-language.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-language.test.js","sourceRoot":"","sources":["../../src/hono/skill-language.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,SAAS,OAAO,CAAC,OAAuD;IACtE,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC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AAM,KAAK,GAAG,kBAAkB,CAC9B,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAC/D,QAAQ,CAAC,SAAS,CAAC,CACpB,CAAC;QAEF,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACnE,MAAM,CAAC,MAAM,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAC9E,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,KAAK,GAAG,kBAAkB,CAC9B,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAC/D,QAAQ,CAAC,SAAS,CAAC,CACpB,CAAC;QAEF,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAC3D,MAAM,CAAC,MAAM,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
1
3
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { askTaskSignals, parseAgentDefinition, routeSubagent, wantsInstructions, } from "./subagent-route.js";
|
|
4
|
+
import { askTaskSignals, parseAgentDefinition, readAgentDefinitions, routeSubagent, wantsInstructions, } from "./subagent-route.js";
|
|
3
5
|
const OPUS = "claude-opus-5-5";
|
|
4
6
|
const SONNET = "claude-sonnet-5-5";
|
|
5
7
|
const reading = { small: 0.2, complex: 0.8, readOnly: 0.85, deliverable: 0.1 };
|
|
@@ -74,7 +76,8 @@ describe("routeSubagent: an agent that names the models it may run on", () => {
|
|
|
74
76
|
const HAIKU = "claude-haiku-5-5";
|
|
75
77
|
const defined = new Map([
|
|
76
78
|
["research", { model: SONNET, effort: "low", models: [HAIKU, SONNET, OPUS], omitClaudeMd: false }],
|
|
77
|
-
["creative-producer", { model:
|
|
79
|
+
["creative-producer", { model: SONNET, effort: "medium", models: [SONNET, OPUS], omitClaudeMd: true }],
|
|
80
|
+
["opus-agent", { model: OPUS, effort: "medium", models: [SONNET, OPUS], omitClaudeMd: true }],
|
|
78
81
|
["client-agent", { model: SONNET, omitClaudeMd: false }],
|
|
79
82
|
]);
|
|
80
83
|
const research = { agentType: "research", parentModel: OPUS, definitions: defined, signals: null };
|
|
@@ -102,14 +105,13 @@ describe("routeSubagent: an agent that names the models it may run on", () => {
|
|
|
102
105
|
effort: "high",
|
|
103
106
|
reason: "judgment",
|
|
104
107
|
});
|
|
105
|
-
expect(routeSubagent({ ...research, agentType: "creative-producer", task: { hard: 0.9 } })).toBeNull();
|
|
106
108
|
});
|
|
107
109
|
it("leaves a task in between on the agent's own model", () => {
|
|
108
110
|
expect(routeSubagent({ ...research, task: { hard: 0.5 } })).toBeNull();
|
|
109
111
|
});
|
|
110
112
|
it("leaves an agent alone when the strongest is already its own model", () => {
|
|
111
|
-
expect(routeSubagent({ ...research, agentType: "
|
|
112
|
-
expect(routeSubagent({ ...research, agentType: "
|
|
113
|
+
expect(routeSubagent({ ...research, agentType: "opus-agent", task: { hard: 0.9 } })).toBeNull();
|
|
114
|
+
expect(routeSubagent({ ...research, agentType: "opus-agent", task: { hard: 0.1 } })).toBeNull();
|
|
113
115
|
});
|
|
114
116
|
it.each([
|
|
115
117
|
["an agent that names no models", { agentType: "client-agent", task: { hard: 0 } }],
|
|
@@ -128,6 +130,28 @@ describe("routeSubagent: an agent that names the models it may run on", () => {
|
|
|
128
130
|
});
|
|
129
131
|
});
|
|
130
132
|
});
|
|
133
|
+
describe("routeSubagent: the scaffold's creative producer", () => {
|
|
134
|
+
const SCAFFOLD = join(dirname(fileURLToPath(import.meta.url)), "../../../../apps/scaffold-template");
|
|
135
|
+
const spawn = async (hard) => {
|
|
136
|
+
const definitions = await readAgentDefinitions(SCAFFOLD);
|
|
137
|
+
const route = routeSubagent({
|
|
138
|
+
agentType: "creative-producer",
|
|
139
|
+
parentModel: OPUS,
|
|
140
|
+
definitions,
|
|
141
|
+
signals: null,
|
|
142
|
+
task: { hard },
|
|
143
|
+
});
|
|
144
|
+
// The route names a family; the frontmatter, a full id.
|
|
145
|
+
return route?.model ?? definitions.get("creative-producer")?.model?.replace(/^claude-(\w+)-.*$/, "$1");
|
|
146
|
+
};
|
|
147
|
+
// Measured on production producer briefs and blind pairwise on the creative evals (Nov 2026, BAKER-4966).
|
|
148
|
+
it("builds an ad from a mechanical brief on Sonnet", async () => {
|
|
149
|
+
expect(await spawn(0.2)).toBe("sonnet");
|
|
150
|
+
});
|
|
151
|
+
it("builds one whose brief needs deep judgment on Opus", async () => {
|
|
152
|
+
expect(await spawn(0.9)).toBe("opus");
|
|
153
|
+
});
|
|
154
|
+
});
|
|
131
155
|
describe("askTaskSignals", () => {
|
|
132
156
|
it("asks how hard the brief is", async () => {
|
|
133
157
|
const asked = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-route.test.js","sourceRoot":"","sources":["../../src/hono/subagent-route.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAEL,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC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G,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,wBAAwB,EAAE,CAAC,SAAS,EAAE,EAAE;YAC5E,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/review/digest.d.ts
CHANGED
|
@@ -294,11 +294,6 @@ export type UserFacingMessage = {
|
|
|
294
294
|
text: string;
|
|
295
295
|
/** What is plumbing by its shape (a file path), pre-flagged. The digest points; the model judges the words. */
|
|
296
296
|
plumbing: string[];
|
|
297
|
-
/** Set when the message is in another language than the last one the marketer typed. */
|
|
298
|
-
languageMismatch?: {
|
|
299
|
-
reply: string;
|
|
300
|
-
marketer: string;
|
|
301
|
-
};
|
|
302
297
|
};
|
|
303
298
|
export type RequestUsage = {
|
|
304
299
|
turn: number;
|