@koda-sl/baker-bridge 0.109.0 → 0.110.0-dev.4699b7308

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
@@ -269,6 +269,8 @@ variables nothing is registered. Content is sent in full; mask attributes with
269
269
 
270
270
  Every turn also carries an in-process SDK MCP server named `baker_ui` hosting interactive dashboard tools. Its first tool, `request_tag_input`, is the **blocking secure tag form**: the agent invokes it when a marketing tag needs secret values (API keys, access tokens, OAuth connections). The bridge intercepts the call in `canUseTool` (same pattern as `AskUserQuestion`), POSTs `/api/chat/tag-input-request` to Convex so the dashboard renders the form, and suspends the turn until Convex delivers the resolution via `POST /tag-input-decision`. Secret values flow dashboard → Convex tag draft directly; the bridge and the model only ever see the redacted result (`{ status, ref, type, identifier, secretFieldsSet }`). Secret values a model puts into `prefilledConfig` are stripped bridge-side (and again backend-side) — their names become requested fields instead. `prefilledConfig` keys must be real config fields of the tag type (the tool description lists them per type); a call that invents field names is denied with the valid ones, because such a key renders nowhere in the form and would otherwise fail at stage time, after the user already approved. Live wait matches `AskUserQuestion` (15 min); like all blocking prompts, the form itself never expires — the thread parks and a later submission recovers the turn. It is **not** a connection route: a `googleTagManager` tag is the container snippet on the site, while the Tag Manager connection that unlocks the container's contents also has to name a container — which this form cannot do — so `oauthProviderId` is not requestable there and the backend rejects it, pointing the agent at `request_connection`.
271
271
 
272
+ A ChatGPT Ads tag pre-fills its Pixel ID and requests the optional Conversions API key in this secure form. The bridge classifies `apiKey` as a secret, so the agent never sees it and the published page receives only the Pixel ID and a signed server-event reference.
273
+
272
274
  Its second tool, `request_flow_input`, is the **blocking form-configuration form**: the agent invokes it to configure the confidential parts of a flow ("Form") it cannot author itself — side-effect credentials/connections (`encryptedConfig`, `oauthProviderId`) and widget third-party field definitions (`nodeData.form.external` for HubSpot/Calendly/HighLevel/SavvyCal). The agent authors the surrounding structure in `_data.json` and references it by `nodeId`/`sideEffectId`. Same `canUseTool` park pattern: the bridge POSTs `/api/chat/flow-input-request`, the dashboard renders a tabbed form (secret inputs / OAuth connect+account picker / live resource picker), and on submit Convex delivers the resolved values to `POST /flow-input-decision`. Unlike tags, the resolved values are written **into the branch flow file** through the encrypting `writeFlow` (read → patch node/side-effect → write); the model only ever sees a redacted result: `{ status, nodeId, sideEffectId?, secretFieldsSet, destination?, connected?, fields?, note? }`. `destination` is the non-secret half of what the user chose — the spreadsheet, the sheet, the portal, the Calendly event — so an agent that has just configured an integration does not have to spend a turn on `baker flows show --full` to learn what it configured, and does not map columns against a guess. For a widget node, `fields` carries the autofill keys the picked resource accepts — literally the left-hand side of an `autofilledFields` entry, adapter prefix included, so a SavvyCal custom field arrives as `questions.<id>` because that is what its adapter reads. They come from each provider's own field container (`fieldGroups[].fields[]`, `customQuestions[]`, `customParams.formFields[]`, `customFormFields[]`, `fields[]`, `customFields[]`) rather than from a search for name-shaped strings, so a select's option labels and the resource's own title are not among them (a HubSpot form's `name` is "Contact us"; it is reported under `destination`). A widget with no field list of its own returns none rather than a guess. Both targets go through the same filter: only plain strings and numbers are echoed, and anything in that type's secret list is redacted to a name in `secretFieldsSet`. A few non-secret keys are withheld from `destination` on top of that, because they are not an answer either — an `httpWebhook`'s basic-auth `username` is not a typed credential, so it is not in the secret list, but echoing it hands the model half a credential and nothing on the side effect is addressed by it. Leaked secret values in `prefilledConfig` are stripped bridge-side (and again backend-side). Live wait matches `AskUserQuestion` (15 min); like all blocking prompts, the form itself never expires — the thread parks and a later submission recovers the turn.
273
275
 
274
276
  Its third tool, `request_connection`, is the **blocking connection request**: the agent invokes it when a data platform the task needs — Google Ads, LinkedIn Ads, Meta Ads, X Ads, Google Analytics 4, Google Search Console, or Google Tag Manager — is not connected yet, instead of telling the user to go to Settings. Same `canUseTool` park pattern: the bridge POSTs `/api/chat/connection-input-request`, the dashboard renders one tab per platform with the OAuth connect button and the account/property/site/container picker, and on submit Convex delivers the outcome to `POST /connection-input-decision`. Nothing confidential passes through the bridge or the model: the dashboard writes the selection onto the company's connection, and the resolution carries only `{ status, platform, accountLabel?, selected[] }`. Live wait matches `AskUserQuestion` (15 min).
@@ -1 +1 @@
1
- {"version":3,"file":"tag-fields.d.ts","sourceRoot":"","sources":["../../src/hono/tag-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAmBnE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CA+BnE,CAAC"}
1
+ {"version":3,"file":"tag-fields.d.ts","sourceRoot":"","sources":["../../src/hono/tag-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAoBnE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAgCnE,CAAC"}
@@ -17,6 +17,7 @@
17
17
  /** Config fields that never cross the trust boundary to the agent or public HTML. */
18
18
  export const SECRET_FIELDS_BY_TYPE = {
19
19
  meta: ["accessToken"],
20
+ chatgptAds: ["apiKey"],
20
21
  amplitude: [],
21
22
  googleAds: ["oauthProviderId", "customerAccountId", "customerId", "loginCustomerId"],
22
23
  tiktok: ["accessToken"],
@@ -42,6 +43,7 @@ export const SECRET_FIELDS_BY_TYPE = {
42
43
  */
43
44
  export const CONFIG_FIELDS_BY_TYPE = {
44
45
  meta: ["pixelId", "accessToken", "testEventCode"],
46
+ chatgptAds: ["pixelId", "apiKey"],
45
47
  amplitude: ["apiKey", "residencyServer"],
46
48
  googleAds: ["conversionID", "oauthProviderId", "customerAccountId"],
47
49
  tiktok: ["pixelCode", "accessToken"],
@@ -1 +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AAa,CAAC;IAC9E,OAAO,EAAE;QACP,cAAc;QACd,MAAM;QACN,WAAW;QACX,cAAc;QACd,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,oBAAoB;QACpB,kBAAkB;QAClB,gBAAgB;KACjB;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;IACnC,UAAU,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC;CAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-bridge",
3
- "version": "0.109.0",
3
+ "version": "0.110.0-dev.4699b7308",
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",