@koda-sl/baker-bridge 0.194.0-dev.8f5bcdb0e → 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 +66 -28
- package/dist/hono/agent.d.ts.map +1 -1
- package/dist/hono/agent.js +4 -1
- package/dist/hono/agent.js.map +1 -1
- package/dist/hono/bridge-job.d.ts +27 -0
- package/dist/hono/bridge-job.d.ts.map +1 -1
- package/dist/hono/bridge-job.js +93 -19
- package/dist/hono/bridge-job.js.map +1 -1
- package/dist/hono/bridge-job.test.js +99 -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 -17
- package/dist/hono/publish-handoff.d.ts.map +1 -1
- package/dist/hono/publish-handoff.js +17 -67
- package/dist/hono/publish-handoff.js.map +1 -1
- package/dist/hono/publish-handoff.test.js +34 -63
- package/dist/hono/publish-handoff.test.js.map +1 -1
- package/dist/hono/scripted-publish.d.ts +19 -0
- package/dist/hono/scripted-publish.d.ts.map +1 -0
- package/dist/hono/scripted-publish.js +219 -0
- package/dist/hono/scripted-publish.js.map +1 -0
- package/dist/hono/scripted-publish.test.d.ts +2 -0
- package/dist/hono/scripted-publish.test.d.ts.map +1 -0
- package/dist/hono/scripted-publish.test.js +212 -0
- package/dist/hono/scripted-publish.test.js.map +1 -0
- 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 -168
- package/dist/hono/skill-language.js.map +1 -1
- package/dist/hono/skill-language.test.js +48 -50
- 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/hono/types.d.ts +9 -0
- package/dist/hono/types.d.ts.map +1 -1
- package/dist/review/digest.d.ts +6 -5
- package/dist/review/digest.d.ts.map +1 -1
- package/dist/review/digest.js +34 -28
- package/dist/review/digest.js.map +1 -1
- package/dist/review/digest.test.js +42 -177
- package/dist/review/digest.test.js.map +1 -1
- package/dist/review/evidence-block.js +2 -2
- package/dist/review/evidence-block.js.map +1 -1
- package/dist/review/reply-language.d.ts +12 -30
- package/dist/review/reply-language.d.ts.map +1 -1
- package/dist/review/reply-language.js +97 -162
- package/dist/review/reply-language.js.map +1 -1
- package/dist/review/reply-language.test.js +67 -75
- package/dist/review/reply-language.test.js.map +1 -1
- package/package.json +1 -2
|
@@ -1,90 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { answerLanguage } from "./chat-language.js";
|
|
2
2
|
import { BridgeSlashCommands } from "./slash-commands.js";
|
|
3
3
|
// Publish runs in a session of its own (`prepareSessionAttempt`), so two things
|
|
4
4
|
// never cross between it and the chat's conversation on their own: the
|
|
5
5
|
// marketer's language into the publish run (its only user message is
|
|
6
6
|
// `/publish`), and what the publish run did back into the conversation (the
|
|
7
7
|
// chat resumes a session that never saw it). This module carries both, read
|
|
8
|
-
// from the chat's history, which every turn already arrives with.
|
|
9
|
-
// samples also feed the note after a skill loads (`skill-language.ts`).
|
|
10
|
-
const LANGUAGE_SAMPLE_CHARS = 280;
|
|
8
|
+
// from the chat's history, which every turn already arrives with.
|
|
11
9
|
const MAX_SAID = 6;
|
|
12
10
|
const MAX_SAID_CHARS = 1_200;
|
|
13
|
-
// A dashboard mention (`@[title](video:…?thumbnailUrl=…)`) is a few hundred characters of URL:
|
|
14
|
-
// quoted as `@title`, and left out of what the language is read from.
|
|
15
|
-
const MENTION = /@\[([^\]]*)\]\([^)\s]*\)/g;
|
|
16
11
|
/** Newlines collapsed and `<` stripped, so quoted text can neither add lines nor close the reminder. */
|
|
17
12
|
function quotable(value, max) {
|
|
18
13
|
return value.replace(/\s+/g, " ").replace(/</g, "").trim().slice(0, max);
|
|
19
14
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
* and so does one too short to read a language from ("Pon la web roja").
|
|
23
|
-
*/
|
|
24
|
-
const SUBSTANTIVE_WORDS = 4;
|
|
25
|
-
const MAX_LANGUAGE_SAMPLES = 4;
|
|
26
|
-
/**
|
|
27
|
-
* What the marketer last typed themselves, back to the first message long enough
|
|
28
|
-
* to carry a language and far enough for it to be read, oldest first. A slash command (`/publish`) and a message
|
|
29
|
-
* Baker wrote in their seat (a plan approval) carry none. `current` is what they
|
|
30
|
-
* typed to start the turn running now, which the history leaves out.
|
|
31
|
-
*/
|
|
32
|
-
export function lastTypedMessages(history, current) {
|
|
33
|
-
const entries = [
|
|
34
|
-
...(history?.entries ?? []),
|
|
35
|
-
...(current === undefined ? [] : [{ role: "user", text: current, createdAt: Number.POSITIVE_INFINITY }]),
|
|
36
|
-
];
|
|
37
|
-
const typed = [];
|
|
38
|
-
for (let index = entries.length - 1; index >= 0 && typed.length < MAX_LANGUAGE_SAMPLES; index--) {
|
|
39
|
-
const entry = entries[index];
|
|
40
|
-
if (entry?.role !== "user" || entry.bakerWritten)
|
|
41
|
-
continue;
|
|
42
|
-
const said = entry.typedText ?? entry.text;
|
|
43
|
-
const quoted = quotable(said.replace(MENTION, "@$1"), LANGUAGE_SAMPLE_CHARS);
|
|
44
|
-
if (!quoted || quoted.startsWith("/") || quoted === "[Attachment only message]")
|
|
45
|
-
continue;
|
|
46
|
-
// A mention's title is the page's or the video's words, not the marketer's: it carries no language.
|
|
47
|
-
const whole = said.replace(MENTION, " ");
|
|
48
|
-
typed.unshift({ quoted, whole });
|
|
49
|
-
const substantive = quotable(whole, LANGUAGE_SAMPLE_CHARS).split(" ").filter(Boolean).length >= SUBSTANTIVE_WORDS;
|
|
50
|
-
if (substantive && likelyLanguages(typed.map((message) => message.whole).join("\n")).length > 0)
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
return typed;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* The language a publish run reports in. CLAUDE.md says to write in the language
|
|
57
|
-
* of the last message the marketer typed, and a run whose only user message is
|
|
58
|
-
* `/publish` has none in view — so it guessed, often English to a Spanish chat.
|
|
59
|
-
* The language is named, never their words quoted: the run sees nothing else of
|
|
60
|
-
* the conversation, and read a quoted message as feedback still open or a
|
|
61
|
-
* question still owed, then answered it in the closing line (BAKER-3389).
|
|
62
|
-
*/
|
|
63
|
-
export function publishLanguageReminder(history) {
|
|
64
|
-
const typed = lastTypedMessages(history);
|
|
65
|
-
if (typed.length === 0)
|
|
66
|
-
return undefined;
|
|
67
|
-
// A scheduled run's English brief that ends "Report in Spanish": its opening says English (BAKER-3249).
|
|
68
|
-
const requested = typed
|
|
69
|
-
.map((message) => requestedLanguage(message.whole))
|
|
70
|
-
.filter(Boolean)
|
|
71
|
-
.pop();
|
|
72
|
-
const whole = typed.map((message) => message.whole).join("\n");
|
|
73
|
-
const language = requested ?? identifiedLanguage(whole);
|
|
74
|
-
const likely = language ? [] : likelyLanguages(whole);
|
|
15
|
+
/** The language note a publish run starts with, around the line that names the language. */
|
|
16
|
+
function languageReminder(line) {
|
|
75
17
|
return [
|
|
76
18
|
"<system-reminder>",
|
|
77
19
|
// A fixed first line: session review keys its hook ledger on it.
|
|
78
20
|
"Baker: the language of this chat.",
|
|
79
21
|
"The user started this run with the Publish button, which carries no language, and this run does not see their conversation: what the publish carried is what Baker prints once it takes it.",
|
|
80
|
-
|
|
81
|
-
? `Write every line you send the user in ${language}: ${requested ? "their message asks for it" : "it is the language they write in"}.`
|
|
82
|
-
: likely.length > 0
|
|
83
|
-
? `Write every line you send the user in the language they write in, which reads as ${likely.join(" or ")}.`
|
|
84
|
-
: "Write every line you send the user in the language they write in.",
|
|
22
|
+
line,
|
|
85
23
|
"</system-reminder>",
|
|
86
24
|
].join("\n");
|
|
87
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* The language a publish run reports in, decided once from the chat's conversation
|
|
28
|
+
* (`chat-language.ts`). The run sees only `/publish`, so without a note it guessed, often English
|
|
29
|
+
* to a Spanish chat. The language is named, never anybody's words quoted: the run read a quoted
|
|
30
|
+
* message as feedback still owed and answered it (BAKER-3389). Nothing is said when Jev is unsure.
|
|
31
|
+
*/
|
|
32
|
+
export async function publishLanguageReminder(history, language) {
|
|
33
|
+
const answering = await answerLanguage(language, history);
|
|
34
|
+
return answering
|
|
35
|
+
? languageReminder(`Write every line you send the user in ${answering}: it is the language this chat is in.`)
|
|
36
|
+
: undefined;
|
|
37
|
+
}
|
|
88
38
|
/**
|
|
89
39
|
* What Publish told the user, when the last thing the user sent before this turn
|
|
90
40
|
* was `/publish`. The chat resumes a session that never saw the run, so without
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-handoff.js","sourceRoot":"","sources":["../../src/hono/publish-handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"publish-handoff.js","sourceRoot":"","sources":["../../src/hono/publish-handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,gFAAgF;AAChF,uEAAuE;AACvE,qEAAqE;AACrE,4EAA4E;AAC5E,4EAA4E;AAC5E,kEAAkE;AAElE,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deredContext: "",
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
/** Jev's decision, faked: the language to answer in, and every conversation it was shown. */
|
|
14
|
+
function deciding(answer) {
|
|
15
|
+
const shown = [];
|
|
16
|
+
const decide = ({ text }) => {
|
|
17
|
+
shown.push(text);
|
|
18
|
+
return Promise.resolve(answer);
|
|
19
|
+
};
|
|
20
|
+
return Object.assign(decide, { shown });
|
|
21
|
+
}
|
|
13
22
|
describe("publishLanguageReminder", () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{ role: "
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
bakerWritten: true,
|
|
22
|
-
},
|
|
23
|
-
]));
|
|
24
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
25
|
-
expect(reminder).not.toContain("I approve the plan below");
|
|
26
|
-
});
|
|
27
|
-
it("reads the language from the feedback the marketer typed on a plan, not Baker's wording around it", () => {
|
|
28
|
-
const reminder = publishLanguageReminder(history([
|
|
29
|
-
{ role: "user", text: "Make the webinar landing page brighter" },
|
|
30
|
-
{
|
|
31
|
-
role: "user",
|
|
32
|
-
text: "I have feedback on the plan below before you proceed:\n\nQuita el banner de arriba y deja solo el formulario",
|
|
33
|
-
typedText: "Quita el banner de arriba y deja solo el formulario",
|
|
34
|
-
},
|
|
35
|
-
]));
|
|
36
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
37
|
-
expect(reminder).not.toContain("I have feedback");
|
|
38
|
-
});
|
|
39
|
-
it("keeps the conversation's language when the last thing typed was a short go-ahead", () => {
|
|
40
|
-
const reminder = publishLanguageReminder(history([
|
|
41
|
-
{ role: "user", text: "Cambia el titular de la landing de Supermatch" },
|
|
42
|
-
{ role: "assistant", text: "No he podido guardar el cambio." },
|
|
43
|
-
{ role: "user", text: "try again" },
|
|
44
|
-
]));
|
|
45
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
23
|
+
// BAKER-4943: the run is told the chat's language, decided from the conversation, never guessed.
|
|
24
|
+
it("names the language Baker answers the chat in", async () => {
|
|
25
|
+
const reminder = await publishLanguageReminder(history([
|
|
26
|
+
{ role: "user", text: "revisa de punta a punta. testea la landing tambien despues de publicar" },
|
|
27
|
+
{ role: "assistant", text: "He revisado todo de punta a punta y está listo para publicar." },
|
|
28
|
+
]), deciding("Spanish"));
|
|
29
|
+
expect(reminder).toContain("Write every line you send the user in Spanish: it is the language this chat is in.");
|
|
46
30
|
});
|
|
47
31
|
// The publish run has no other sight of the conversation: a quoted message was
|
|
48
32
|
// read as open feedback or a request still owed, and the closing line answered
|
|
49
33
|
// it ("your comments on the voice are not fixed in that version") (BAKER-3389).
|
|
50
|
-
it("
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
{ role: "user", text: typed },
|
|
34
|
+
it("quotes nobody's words", async () => {
|
|
35
|
+
const reminder = await publishLanguageReminder(history([
|
|
36
|
+
{ role: "user", text: "revisa que los videos esten ok en formato feed y vertical, los acabo de publicar" },
|
|
54
37
|
{ role: "assistant", text: "Los dos vídeos están bien en los dos formatos." },
|
|
55
|
-
]));
|
|
56
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
38
|
+
]), deciding("Spanish"));
|
|
57
39
|
expect(reminder).not.toContain("revisa que los videos");
|
|
40
|
+
expect(reminder).not.toContain("Los dos vídeos");
|
|
58
41
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{ role: "user", text: "Cambia el titular de la landing de Supermatch" },
|
|
63
|
-
{ role: "assistant", text: "Hecho." },
|
|
64
|
-
{ role: "user", text: "Pon la web roja" },
|
|
65
|
-
]));
|
|
66
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
67
|
-
});
|
|
68
|
-
it("names the languages a message reads as when it cannot say which, still without quoting it", () => {
|
|
69
|
-
const typed = "Kun je de koptekst van de landingspagina aanpassen voor de nieuwe campagne van volgende week";
|
|
70
|
-
const reminder = publishLanguageReminder(history([{ role: "user", text: typed }]));
|
|
71
|
-
expect(reminder).toContain("which reads as Dutch or German");
|
|
72
|
-
expect(reminder).not.toContain("koptekst");
|
|
42
|
+
it("says nothing when the chat's language cannot be told", async () => {
|
|
43
|
+
const reminder = await publishLanguageReminder(history([{ role: "user", text: "revisa a pagina toda e testa o formulario depois de publicar" }]), deciding(undefined));
|
|
44
|
+
expect(reminder).toBeUndefined();
|
|
73
45
|
});
|
|
74
|
-
// A
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
expect(reminder).toContain("Write every line you send the user in Spanish");
|
|
46
|
+
// A brief longer than the history's budget is kept whole and every reply is dropped.
|
|
47
|
+
it("names the language a routine reports in", async () => {
|
|
48
|
+
const reminder = await publishLanguageReminder(history([
|
|
49
|
+
{
|
|
50
|
+
role: "user",
|
|
51
|
+
text: `${"Research our competitors. ".repeat(600)}\n\n<run-guidance>\nWrite every message of this run — the lines while you work and the closing summary — in Dutch, as the brief asks; this note is in English only because Baker adds it.\n</run-guidance>`,
|
|
52
|
+
bakerWritten: true,
|
|
53
|
+
},
|
|
54
|
+
]), deciding("English"));
|
|
55
|
+
expect(reminder).toContain("Write every line you send the user in Dutch");
|
|
85
56
|
});
|
|
86
57
|
});
|
|
87
58
|
describe("publishRunReminder", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-handoff.test.js","sourceRoot":"","sources":["../../src/hono/publish-handoff.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"publish-handoff.test.js","sourceRoot":"","sources":["../../src/hono/publish-handoff.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE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AAE,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ScriptedPublishResult =
|
|
2
|
+
/** Baker was told how the publish ended: published, nothing to publish, or a failure the recovery reported. */
|
|
3
|
+
{
|
|
4
|
+
kind: "finished";
|
|
5
|
+
}
|
|
6
|
+
/** A step stopped before Baker was owed anything: the agent publishes, from step 1. */
|
|
7
|
+
| {
|
|
8
|
+
kind: "handOff";
|
|
9
|
+
step: string;
|
|
10
|
+
};
|
|
11
|
+
export type ScriptedPublishOptions = {
|
|
12
|
+
cwd: string;
|
|
13
|
+
/** The steps' whole environment, with the BAKER_THREAD_ID / BAKER_TURN_ID step 1 scopes the publish to. */
|
|
14
|
+
env: Record<string, string | undefined>;
|
|
15
|
+
/** The turn's: stopping it stops the step running, and no further step starts. */
|
|
16
|
+
signal: AbortSignal;
|
|
17
|
+
};
|
|
18
|
+
export declare function runScriptedPublish(options: ScriptedPublishOptions): Promise<ScriptedPublishResult>;
|
|
19
|
+
//# sourceMappingURL=scripted-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripted-publish.d.ts","sourceRoot":"","sources":["../../src/hono/scripted-publish.ts"],"names":[],"mappings":"AA8DA,MAAM,MAAM,qBAAqB;AAC/B,+GAA+G;AAC7G;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE;AACtB,uFAAuF;GACrF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAItC,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,2GAA2G;IAC3G,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,kFAAkF;IAClF,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AA8IF,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAsBxG"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { execFile, spawn } from "node:child_process";
|
|
2
|
+
import { existsSync, unlinkSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { killFirstWrapper } from "./oom-priority.js";
|
|
5
|
+
import { recoverStalledPublish } from "./publish-recovery.js";
|
|
6
|
+
/**
|
|
7
|
+
* The publish Auto publish asked for, run as the publish skill's own scripts
|
|
8
|
+
* with no agent in between.
|
|
9
|
+
*
|
|
10
|
+
* A Scheduled agent's run the user gave Auto publish ends in a `/publish` that
|
|
11
|
+
* nobody watches. Run by the agent, it started a session of its own: every
|
|
12
|
+
* SessionStart probe again, a cold model turn, and a line to the marketer that
|
|
13
|
+
* said nothing the Publish notice does not (BAKER-231). On the path where every
|
|
14
|
+
* step passes, the skill asks the agent for no judgement, so here the steps run
|
|
15
|
+
* in order, exactly as the skill lists them.
|
|
16
|
+
*
|
|
17
|
+
* The first step that stops hands the publish to the agent, which runs the
|
|
18
|
+
* whole skill from step 1 as it always has — after the workspace is put back so
|
|
19
|
+
* that step 1 can start again (`releaseForAgent`). A failure Baker never heard
|
|
20
|
+
* about is delivered by the recovery first, then handed over too. Only a publish
|
|
21
|
+
* whose push may have landed, or whose turn was stopped, is not handed over: the
|
|
22
|
+
* recovery delivers its last word, and the Publish notice tells the marketer how
|
|
23
|
+
* it ended.
|
|
24
|
+
*/
|
|
25
|
+
const SKILL_SCRIPTS = ".claude/skills/publish/scripts";
|
|
26
|
+
const PUBLISH_STATE_FILE = ".cache/publish-state.json";
|
|
27
|
+
/** The scaffold's reader of that file: what a state on disk means is its to say. */
|
|
28
|
+
const PUBLISH_STATE_MODULE = "__tooling__/checks/sdk/publish-state.mjs";
|
|
29
|
+
const NOTHING_TO_PUBLISH = "NOTHING_TO_PUBLISH";
|
|
30
|
+
const MIN = 60_000;
|
|
31
|
+
/** How long a stopped step's processes get to exit on SIGTERM before SIGKILL. */
|
|
32
|
+
const STOP_GRACE_MS = 5_000;
|
|
33
|
+
/** The skill's steps 2 to 5, after step 1 named the branch. */
|
|
34
|
+
const AFTER_PREPARE = [
|
|
35
|
+
{ name: "rebase", command: "git", args: () => ["rebase", "main"], timeoutMs: 5 * MIN },
|
|
36
|
+
{
|
|
37
|
+
name: "build-and-amend",
|
|
38
|
+
command: "node",
|
|
39
|
+
args: (branch) => [`${SKILL_SCRIPTS}/build-and-amend.mjs`, branch],
|
|
40
|
+
timeoutMs: 15 * MIN,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "verify",
|
|
44
|
+
command: "node",
|
|
45
|
+
args: () => [`${SKILL_SCRIPTS}/run-verify.mjs`, "--no-cache"],
|
|
46
|
+
timeoutMs: 30 * MIN,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "finalize",
|
|
50
|
+
command: "node",
|
|
51
|
+
args: (branch) => [`${SKILL_SCRIPTS}/finalize-publish.mjs`, branch],
|
|
52
|
+
timeoutMs: 15 * MIN,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
const REQUIRED_SCRIPTS = ["prepare-publish.mjs", "build-and-amend.mjs", "run-verify.mjs", "finalize-publish.mjs"];
|
|
56
|
+
/** Signals every process of the step's group; false once none is left. */
|
|
57
|
+
function signalGroup(pid, signal) {
|
|
58
|
+
try {
|
|
59
|
+
process.kill(-pid, signal);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Stops a step and everything it started. A step's real work runs in its own
|
|
68
|
+
* children — `pnpm verify`, shadowdog, `git push` — which a signal to the step
|
|
69
|
+
* alone leaves running, still writing while the recovery or the agent's publish
|
|
70
|
+
* goes on. So the step leads a process group of its own, and the whole group
|
|
71
|
+
* goes; resolves once none of it is left.
|
|
72
|
+
*/
|
|
73
|
+
async function stopGroup(pid) {
|
|
74
|
+
if (!signalGroup(pid, "SIGTERM"))
|
|
75
|
+
return;
|
|
76
|
+
const killAt = Date.now() + STOP_GRACE_MS;
|
|
77
|
+
const giveUpAt = killAt + STOP_GRACE_MS;
|
|
78
|
+
while (signalGroup(pid, 0) && Date.now() < giveUpAt) {
|
|
79
|
+
if (Date.now() >= killAt)
|
|
80
|
+
signalGroup(pid, "SIGKILL");
|
|
81
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const MAX_OUTPUT = 20 * 1024 * 1024;
|
|
85
|
+
function runStep(step, args, options) {
|
|
86
|
+
// A publish's build and verify are the biggest things a Runtime runs: the
|
|
87
|
+
// kernel's OOM killer takes them before the bridge, as it does the agent's commands.
|
|
88
|
+
const wrapper = killFirstWrapper();
|
|
89
|
+
const [file, argv] = wrapper ? [wrapper, [step.command, ...args]] : [step.command, args];
|
|
90
|
+
return new Promise((resolve) => {
|
|
91
|
+
if (options.signal.aborted) {
|
|
92
|
+
resolve({ ok: false, stdout: "", stderr: "" });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const child = spawn(file, argv, {
|
|
96
|
+
cwd: options.cwd,
|
|
97
|
+
env: options.env,
|
|
98
|
+
detached: true,
|
|
99
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
100
|
+
});
|
|
101
|
+
let stdout = "";
|
|
102
|
+
let stderr = "";
|
|
103
|
+
child.stdout.on("data", (chunk) => {
|
|
104
|
+
if (stdout.length < MAX_OUTPUT)
|
|
105
|
+
stdout += chunk.toString();
|
|
106
|
+
});
|
|
107
|
+
child.stderr.on("data", (chunk) => {
|
|
108
|
+
if (stderr.length < MAX_OUTPUT)
|
|
109
|
+
stderr += chunk.toString();
|
|
110
|
+
});
|
|
111
|
+
let settled = false;
|
|
112
|
+
let stopping = null;
|
|
113
|
+
const settle = (ok) => {
|
|
114
|
+
if (settled)
|
|
115
|
+
return;
|
|
116
|
+
settled = true;
|
|
117
|
+
clearTimeout(timer);
|
|
118
|
+
options.signal.removeEventListener("abort", stop);
|
|
119
|
+
// A stopped step is over only once its whole group is gone.
|
|
120
|
+
void Promise.resolve(stopping).then(() => resolve({ ok: ok && stopping === null, stdout, stderr }));
|
|
121
|
+
};
|
|
122
|
+
// Timed out or the turn stopped: the group goes, and the step failed even
|
|
123
|
+
// when something outside the group still holds its output open.
|
|
124
|
+
function stop() {
|
|
125
|
+
if (stopping !== null || child.pid === undefined)
|
|
126
|
+
return;
|
|
127
|
+
stopping = stopGroup(child.pid);
|
|
128
|
+
void stopping.then(() => settle(false));
|
|
129
|
+
}
|
|
130
|
+
const timer = setTimeout(stop, step.timeoutMs);
|
|
131
|
+
options.signal.addEventListener("abort", stop, { once: true });
|
|
132
|
+
child.on("error", () => settle(false));
|
|
133
|
+
child.on("close", (code) => settle(code === 0));
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* What the publish state on disk means, as the scaffold reads it: null when
|
|
138
|
+
* there is none, `publishing` while nothing is owed to Baker yet, `push_failed`
|
|
139
|
+
* for a failure Baker may not have heard, and `owed` for anything else — a push
|
|
140
|
+
* that may have landed, a completion an older scaffold recorded with no phase,
|
|
141
|
+
* or a state this workspace cannot read.
|
|
142
|
+
*/
|
|
143
|
+
async function publishStanding(options) {
|
|
144
|
+
if (!existsSync(join(options.cwd, PUBLISH_STATE_FILE)))
|
|
145
|
+
return null;
|
|
146
|
+
if (!existsSync(join(options.cwd, PUBLISH_STATE_MODULE)))
|
|
147
|
+
return "owed";
|
|
148
|
+
const read = [
|
|
149
|
+
`const { readPublishState } = await import(${JSON.stringify(`./${PUBLISH_STATE_MODULE}`)});`,
|
|
150
|
+
"const state = readPublishState();",
|
|
151
|
+
'process.stdout.write(state?.terminalStatus === "completed" ? "completed" : String(state?.phase));',
|
|
152
|
+
].join("\n");
|
|
153
|
+
const phase = await new Promise((resolve) => {
|
|
154
|
+
execFile("node", ["--input-type=module", "-e", read], { cwd: options.cwd, env: options.env, timeout: MIN }, (error, stdout) => resolve(error === null ? String(stdout).trim() : "unreadable"));
|
|
155
|
+
});
|
|
156
|
+
return phase === "publishing" || phase === "push_failed" ? phase : "owed";
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Puts the workspace back where step 1 can start again, or says it cannot.
|
|
160
|
+
*
|
|
161
|
+
* A step that stopped mid-rebase leaves the rebase open; step 1 refuses to start
|
|
162
|
+
* over one. And while Baker shows the chat publishing with nothing yet owed to
|
|
163
|
+
* it (`publishing`), step 1 refuses to start over the state file that records it;
|
|
164
|
+
* started again, step 1 writes it anew and tells Baker `publishing` once more,
|
|
165
|
+
* which changes nothing there. A failure Baker may not have heard (`push_failed`:
|
|
166
|
+
* nothing was pushed) is delivered by the recovery first, and released once it
|
|
167
|
+
* has been. Any other phase is a word still owed to Baker — a push that may have
|
|
168
|
+
* landed — and only the recovery delivers it correctly.
|
|
169
|
+
*/
|
|
170
|
+
async function releaseForAgent(options) {
|
|
171
|
+
const gitDir = join(options.cwd, ".git");
|
|
172
|
+
if (existsSync(join(gitDir, "rebase-merge")) || existsSync(join(gitDir, "rebase-apply"))) {
|
|
173
|
+
await runStep({ command: "git", timeoutMs: MIN }, ["rebase", "--abort"], options);
|
|
174
|
+
}
|
|
175
|
+
const standing = await publishStanding(options);
|
|
176
|
+
if (standing === null)
|
|
177
|
+
return true;
|
|
178
|
+
if (standing === "publishing") {
|
|
179
|
+
unlinkSync(join(options.cwd, PUBLISH_STATE_FILE));
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
if (standing === "push_failed") {
|
|
183
|
+
await recoverStalledPublish(options.cwd);
|
|
184
|
+
return !existsSync(join(options.cwd, PUBLISH_STATE_FILE));
|
|
185
|
+
}
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
async function stopped(step, options) {
|
|
189
|
+
// A stopped turn hands nothing on: the recovery tells Baker the publish failed, as it does for an agent's.
|
|
190
|
+
if (!options.signal.aborted && (await releaseForAgent(options)))
|
|
191
|
+
return { kind: "handOff", step };
|
|
192
|
+
await recoverStalledPublish(options.cwd);
|
|
193
|
+
return { kind: "finished" };
|
|
194
|
+
}
|
|
195
|
+
export async function runScriptedPublish(options) {
|
|
196
|
+
// A workspace whose scaffold predates these scripts publishes the way it always has.
|
|
197
|
+
if (!REQUIRED_SCRIPTS.every((script) => existsSync(join(options.cwd, SKILL_SCRIPTS, script)))) {
|
|
198
|
+
return { kind: "handOff", step: "prepare" };
|
|
199
|
+
}
|
|
200
|
+
const prepare = await runStep({ command: "node", timeoutMs: 10 * MIN }, [`${SKILL_SCRIPTS}/prepare-publish.mjs`], options);
|
|
201
|
+
// Printed only once Baker took it: the chat is completed, there was nothing to merge.
|
|
202
|
+
if (!prepare.ok && prepare.stderr.includes(NOTHING_TO_PUBLISH))
|
|
203
|
+
return { kind: "finished" };
|
|
204
|
+
const branch = prepare.stdout.trim();
|
|
205
|
+
if (!prepare.ok || !branch)
|
|
206
|
+
return await stopped("prepare", options);
|
|
207
|
+
for (const step of AFTER_PREPARE) {
|
|
208
|
+
if (options.signal.aborted)
|
|
209
|
+
return await stopped(step.name, options);
|
|
210
|
+
const result = await runStep(step, step.args(branch), options);
|
|
211
|
+
if (!result.ok)
|
|
212
|
+
return await stopped(step.name, options);
|
|
213
|
+
}
|
|
214
|
+
// Pushed, but Baker never heard: the recovery tells it, as it does after an agent's publish.
|
|
215
|
+
if (existsSync(join(options.cwd, PUBLISH_STATE_FILE)))
|
|
216
|
+
await recoverStalledPublish(options.cwd);
|
|
217
|
+
return { kind: "finished" };
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=scripted-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripted-publish.js","sourceRoot":"","sources":["../../src/hono/scripted-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,E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