@koda-sl/baker-bridge 0.171.0 → 0.172.0-dev.f1dc1ec56

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 CHANGED
@@ -280,7 +280,7 @@ the account setting is then the only off-switch.
280
280
  | `GET` | `/landings/:slug/definition` | None | Return landing `_definition.md` as `{ content, title }`; `?baseline=1` also includes `baselineContent` from the git merge-base when available |
281
281
  | `GET` | `/flows/:slug` | None | Read flow `_data.json` (decrypted). `?baseline=1` returns `{ flow, baselineFlow, baselineStatus }` — used by the dashboard's structural changes view. `baselineStatus` is `found` (baseline decoded, `baselineFlow` set), `new` (flow absent at the merge-base, i.e. not yet published), `unavailable` (no base ref / merge-base to compare against, or an unexpected git failure), or `undecodable` (baseline present at the merge-base but not readable — invalid JSON or not decryptable with the current key); the last two keep the UI from rendering a misleading full "added" diff |
282
282
  | `PUT` | `/flows/:slug` | None | Write flow `_data.json` (encrypts at rest) |
283
- | `POST` | `/message/async` | Bearer token | Dispatch a chat turn — fire-and-forget, 202 immediately. **Idempotent on `turnId`:** a redelivery of the turn already in flight (Convex retries when a busy sandbox is slow to ack) is adopted onto the running run instead of aborting and restarting it. Convex must include `turnId`, may include rendered `history` for deterministic rehydration, `currentReference` (`{ type, slug, title }`) for the output the user is viewing in the preview pane (sent to the agent as a `<system-reminder>` block beside the message, never inside it), `kickoffBrief` (string) on the first turn of a chat a dashboard button opened — what the button asked for, in Baker's words, sent the same way so the marketer's message stays in their own language, and `currentSender` (`{ name, role?, userId? }`) identifying the human who sent this turn (`userId` scopes their user-owned MCP tools), `publishStanding` saying whether the chat's work is live — see [Chat flow](#chat-flow) — and `planMode` (bool) to run the turn read-only under the SDK `plan` permission mode until the user approves, and `unattended` (bool) when a schedule started the turn and nobody can answer a prompt — every blocking prompt tool is then denied up front with an instruction to decide and state the assumption, because waiting one out parks the thread on a card that will never be answered — except `request_connection`, whose platform tabs are left in the chat as a live Reconnect card (`leftInChat: true`) that never parks the thread, and `continuedAttachments` (`[{ url, contentType, filename }]`) on a turn started by a late answer to a blocking prompt — the files of the request that answer continues, handed to the agent only when the bridge rebuilds the Session from `history` rather than resuming the one that already received them, and `builder` (`{ runId, title, outputSchema }`) on a task a conversation in Baker or Slack started — the prompt is its one brief, it runs under a system prompt of its own with the question tools removed, and it ends by returning `{ summary, previews?, needsInput? }` as structured output, sent back to the tool when it answers in text |
283
+ | `POST` | `/message/async` | Bearer token | Dispatch a chat turn — fire-and-forget, 202 immediately. **Idempotent on `turnId`:** a redelivery of the turn already in flight (Convex retries when a busy sandbox is slow to ack) is adopted onto the running run instead of aborting and restarting it. Convex must include `turnId`, may include rendered `history` for deterministic rehydration, `currentReference` (`{ type, slug, title }`) for the output the user is viewing in the preview pane (sent to the agent as a `<system-reminder>` block beside the message, never inside it), `kickoffBrief` (string) on the first turn of a chat a dashboard button opened — what the button asked for, in Baker's words, sent the same way so the marketer's message stays in their own language, and `currentSender` (`{ name, role?, userId? }`) identifying the human who sent this turn (`userId` scopes their user-owned MCP tools), `publishStanding` saying whether the chat's work is live — see [Chat flow](#chat-flow) — and `planMode` (bool) to run the turn read-only under the SDK `plan` permission mode until the user approves, and `unattended` (bool) when a schedule started the turn and nobody can answer a prompt — every blocking prompt tool is then denied up front with an instruction to decide and state the assumption, because waiting one out parks the thread on a card that will never be answered — except `request_connection`, whose platform tabs are left in the chat as a live Reconnect card (`leftInChat: true`) that never parks the thread, and `continuedAttachments` (`[{ url, contentType, filename }]`) on a turn started by a late answer to a blocking prompt — the files of the request that answer continues, handed to the agent only when the bridge rebuilds the Session from `history` rather than resuming the one that already received them, and `builder` (`{ runId, title, outputSchema }`) on a task a conversation in Baker or Slack started — the prompt is its one brief, it runs under a system prompt of its own with the question tools removed (a detail the brief leaves out, such as a privacy policy link, is looked for in the workspace before the task asks for it), and it ends by returning `{ summary, previews?, needsInput? }` as structured output, sent back to the tool when it answers in text |
284
284
  | `POST` | `/message/abort` | Bearer token | Abort a running query — kills the SDK iterator |
285
285
  | `POST` | `/answer-question` | Bearer token | Resolve a pending `AskUserQuestion` (`chosenBy: "auto"` when Baker picked the recommended option) |
286
286
  | `POST` | `/plan-decision` | Bearer token | Resolve a pending plan-mode `ExitPlanMode` review with `{ decision: approve \| edit \| reject }` |
@@ -1 +1 @@
1
- {"version":3,"file":"builder-turn.d.ts","sourceRoot":"","sources":["../../src/builder/builder-turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGrF;;;;;;;;;;;;;GAaG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,UAAsC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,QAMpB,CAAC;AAQf,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAEtF"}
1
+ {"version":3,"file":"builder-turn.d.ts","sourceRoot":"","sources":["../../src/builder/builder-turn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGrF;;;;;;;;;;;;;GAaG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,UAAsC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,QAOpB,CAAC;AAQf,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAEtF"}
@@ -5,7 +5,8 @@ export const BUILDER_SYSTEM_PROMPT = [
5
5
  "You are Baker, doing one task for a marketing team: the user message is its one brief, written by Baker in a conversation with the team.",
6
6
  "Nobody is watching and nobody can answer you. Do the whole task in this workspace, following the workspace's own instructions and skills as for any request: build, check and save the work so it is ready to publish.",
7
7
  "Never publish: a person publishes what you prepare, in Baker.",
8
- "When something essential is missing, decide what a careful marketer would and say so in your summary. Only when you truly can't go on without an answer, do what you can and return one short question as needsInput.",
8
+ "Before you count a detail the brief doesn't give as missing (a privacy policy link, the company's address or phone, a Form to use), look where Baker keeps it: the company's Knowledge and COMPANY.md, the consent banner's privacy link (src/components/ConsentBanner.astro), and the footers of the pages already there. Use what you find.",
9
+ "When something essential is still missing, decide what a careful marketer would and say so in your summary. Only when you truly can't go on without an answer, do what you can and return one short question as needsInput.",
9
10
  'When you are done, return your result with the StructuredOutput tool: summary, in the language of the brief, two or three plain sentences for the marketer on what you made or changed (product words, never files, code or tools); previews, the paths of the pages you made or changed ("/summer-sale"); needsInput only when you need an answer, as one short question in the same language as the summary.',
10
11
  ].join("\n\n");
11
12
  const NUDGE = "Your task's result has not been returned. Text you write is not read: call the StructuredOutput tool now with summary (and previews, needsInput when they apply), matching its schema.";
@@ -1 +1 @@
1
- {"version":3,"file":"builder-turn.js","sourceRoot":"","sources":["../../src/builder/builder-turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AA0B5E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,0IAA0I;IAC1I,wNAAwN;IACxN,+DAA+D;IAC/D,uNAAuN;IACvN,gZAAgZ;CACjZ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEf,MAAM,KAAK,GACT,wLAAwL,CAAC;AAE3L,MAAM,eAAe,GACnB,kIAAkI,CAAC;AAErI,MAAM,UAAU,kBAAkB;IAChC,OAAO,qBAAqB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC,CAAC;AACjF,CAAC"}
1
+ {"version":3,"file":"builder-turn.js","sourceRoot":"","sources":["../../src/builder/builder-turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AA0B5E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,0IAA0I;IAC1I,wNAAwN;IACxN,+DAA+D;IAC/D,+UAA+U;IAC/U,6NAA6N;IAC7N,gZAAgZ;CACjZ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEf,MAAM,KAAK,GACT,wLAAwL,CAAC;AAE3L,MAAM,eAAe,GACnB,kIAAkI,CAAC;AAErI,MAAM,UAAU,kBAAkB;IAChC,OAAO,qBAAqB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC,CAAC;AACjF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-bridge",
3
- "version": "0.171.0",
3
+ "version": "0.172.0-dev.f1dc1ec56",
4
4
  "description": "HTTP server wrapping the Claude Agent SDK. Persists chat events to Convex; the dashboard subscribes via Convex realtime",
5
5
  "license": "MIT",
6
6
  "type": "module",