@koda-sl/baker-bridge 0.71.0-dev.46d2675ee → 0.71.0-dev.b1beafb2c.bacce491
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 +1 -1
- package/dist/hono/connection-input.d.ts +52 -4
- package/dist/hono/connection-input.d.ts.map +1 -1
- package/dist/hono/connection-input.js +22 -4
- package/dist/hono/connection-input.js.map +1 -1
- package/dist/hono/connection-input.test.js +20 -1
- package/dist/hono/connection-input.test.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ Every turn also carries an in-process SDK MCP server named `baker_ui` hosting in
|
|
|
176
176
|
|
|
177
177
|
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 the redacted `{ status, nodeId, sideEffectId?, secretFieldsSet, note }`. 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.
|
|
178
178
|
|
|
179
|
-
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, Google Analytics 4, Google Search Console,
|
|
179
|
+
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, Google Analytics 4, Google Search Console, Google Tag Manager, HubSpot, Pipedrive, GoHighLevel, Calendly, SavvyCal or Google Drive — 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[] }`. Meta and X Ads are deliberately not offered — they are still coming soon. Live wait matches `AskUserQuestion` (15 min).
|
|
180
180
|
|
|
181
181
|
## MCP servers (Composio)
|
|
182
182
|
|
|
@@ -1,41 +1,71 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const CONNECTION_INPUT_TOOL_NAME = "mcp__baker_ui__request_connection";
|
|
3
3
|
/**
|
|
4
|
-
* Connectable data platforms
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Connectable data platforms — every provider with a working OAuth flow.
|
|
5
|
+
*
|
|
6
|
+
* Meta and X Ads are deliberately absent: they are still `comingSoon`, so asking
|
|
7
|
+
* the user to connect them would promise a capability that isn't there.
|
|
8
|
+
*
|
|
9
|
+
* This list is the schema the agent actually sees, and `normalizeConnectionInputToolInput`
|
|
10
|
+
* drops anything outside it **silently** — so a provider missing here is not a
|
|
11
|
+
* degraded tab, it is no tab at all. It drifted once: the backend, the setup
|
|
12
|
+
* link and the tool docs all offered HubSpot while this tuple still held five
|
|
13
|
+
* platforms, so the CRM — the one system a lead funnel is reconstructed from —
|
|
14
|
+
* could not be asked for in the conversation that needed it, and clients were
|
|
15
|
+
* sent to Settings for a platform we integrate. `connection-input.test.ts` reads
|
|
16
|
+
* the backend's `CONNECTION_PLATFORMS` off disk and fails if the two diverge
|
|
17
|
+
* again; the tuple is spelled out rather than imported because the bridge ships
|
|
18
|
+
* as a standalone package with no workspace dependencies.
|
|
7
19
|
*/
|
|
8
|
-
export declare const CONNECTION_PLATFORMS: readonly ["google-ads", "linkedin", "google-analytics", "google-search-console", "google-tag-manager"];
|
|
20
|
+
export declare const CONNECTION_PLATFORMS: readonly ["google-ads", "linkedin", "google-analytics", "google-search-console", "google-tag-manager", "hubspot", "pipedrive", "highlevel", "calendly", "savvycal", "google-drive"];
|
|
9
21
|
export type ConnectionPlatform = (typeof CONNECTION_PLATFORMS)[number];
|
|
10
22
|
declare const connectionRequestShape: z.ZodObject<{
|
|
11
23
|
platform: z.ZodEnum<{
|
|
24
|
+
calendly: "calendly";
|
|
12
25
|
"google-ads": "google-ads";
|
|
13
26
|
"google-analytics": "google-analytics";
|
|
27
|
+
"google-drive": "google-drive";
|
|
14
28
|
"google-search-console": "google-search-console";
|
|
15
29
|
"google-tag-manager": "google-tag-manager";
|
|
30
|
+
highlevel: "highlevel";
|
|
31
|
+
hubspot: "hubspot";
|
|
16
32
|
linkedin: "linkedin";
|
|
33
|
+
pipedrive: "pipedrive";
|
|
34
|
+
savvycal: "savvycal";
|
|
17
35
|
}>;
|
|
18
36
|
reason: z.ZodString;
|
|
19
37
|
}, z.core.$strip>;
|
|
20
38
|
export declare const connectionInputResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
39
|
status: z.ZodLiteral<"connected">;
|
|
22
40
|
platform: z.ZodEnum<{
|
|
41
|
+
calendly: "calendly";
|
|
23
42
|
"google-ads": "google-ads";
|
|
24
43
|
"google-analytics": "google-analytics";
|
|
44
|
+
"google-drive": "google-drive";
|
|
25
45
|
"google-search-console": "google-search-console";
|
|
26
46
|
"google-tag-manager": "google-tag-manager";
|
|
47
|
+
highlevel: "highlevel";
|
|
48
|
+
hubspot: "hubspot";
|
|
27
49
|
linkedin: "linkedin";
|
|
50
|
+
pipedrive: "pipedrive";
|
|
51
|
+
savvycal: "savvycal";
|
|
28
52
|
}>;
|
|
29
53
|
accountLabel: z.ZodOptional<z.ZodString>;
|
|
30
54
|
selected: z.ZodArray<z.ZodString>;
|
|
31
55
|
}, z.core.$strip>, z.ZodObject<{
|
|
32
56
|
status: z.ZodLiteral<"declined">;
|
|
33
57
|
platform: z.ZodEnum<{
|
|
58
|
+
calendly: "calendly";
|
|
34
59
|
"google-ads": "google-ads";
|
|
35
60
|
"google-analytics": "google-analytics";
|
|
61
|
+
"google-drive": "google-drive";
|
|
36
62
|
"google-search-console": "google-search-console";
|
|
37
63
|
"google-tag-manager": "google-tag-manager";
|
|
64
|
+
highlevel: "highlevel";
|
|
65
|
+
hubspot: "hubspot";
|
|
38
66
|
linkedin: "linkedin";
|
|
67
|
+
pipedrive: "pipedrive";
|
|
68
|
+
savvycal: "savvycal";
|
|
39
69
|
}>;
|
|
40
70
|
reason: z.ZodOptional<z.ZodString>;
|
|
41
71
|
}, z.core.$strip>], "status">;
|
|
@@ -44,22 +74,34 @@ export declare const connectionInputResolutionSchema: z.ZodObject<{
|
|
|
44
74
|
results: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
75
|
status: z.ZodLiteral<"connected">;
|
|
46
76
|
platform: z.ZodEnum<{
|
|
77
|
+
calendly: "calendly";
|
|
47
78
|
"google-ads": "google-ads";
|
|
48
79
|
"google-analytics": "google-analytics";
|
|
80
|
+
"google-drive": "google-drive";
|
|
49
81
|
"google-search-console": "google-search-console";
|
|
50
82
|
"google-tag-manager": "google-tag-manager";
|
|
83
|
+
highlevel: "highlevel";
|
|
84
|
+
hubspot: "hubspot";
|
|
51
85
|
linkedin: "linkedin";
|
|
86
|
+
pipedrive: "pipedrive";
|
|
87
|
+
savvycal: "savvycal";
|
|
52
88
|
}>;
|
|
53
89
|
accountLabel: z.ZodOptional<z.ZodString>;
|
|
54
90
|
selected: z.ZodArray<z.ZodString>;
|
|
55
91
|
}, z.core.$strip>, z.ZodObject<{
|
|
56
92
|
status: z.ZodLiteral<"declined">;
|
|
57
93
|
platform: z.ZodEnum<{
|
|
94
|
+
calendly: "calendly";
|
|
58
95
|
"google-ads": "google-ads";
|
|
59
96
|
"google-analytics": "google-analytics";
|
|
97
|
+
"google-drive": "google-drive";
|
|
60
98
|
"google-search-console": "google-search-console";
|
|
61
99
|
"google-tag-manager": "google-tag-manager";
|
|
100
|
+
highlevel: "highlevel";
|
|
101
|
+
hubspot: "hubspot";
|
|
62
102
|
linkedin: "linkedin";
|
|
103
|
+
pipedrive: "pipedrive";
|
|
104
|
+
savvycal: "savvycal";
|
|
63
105
|
}>;
|
|
64
106
|
reason: z.ZodOptional<z.ZodString>;
|
|
65
107
|
}, z.core.$strip>], "status">>;
|
|
@@ -78,11 +120,17 @@ export declare function normalizeConnectionInputToolInput(input: unknown): Conne
|
|
|
78
120
|
export declare function createConnectionInputTool(): import("@anthropic-ai/claude-agent-sdk").SdkMcpToolDefinition<{
|
|
79
121
|
connections: z.ZodArray<z.ZodObject<{
|
|
80
122
|
platform: z.ZodEnum<{
|
|
123
|
+
calendly: "calendly";
|
|
81
124
|
"google-ads": "google-ads";
|
|
82
125
|
"google-analytics": "google-analytics";
|
|
126
|
+
"google-drive": "google-drive";
|
|
83
127
|
"google-search-console": "google-search-console";
|
|
84
128
|
"google-tag-manager": "google-tag-manager";
|
|
129
|
+
highlevel: "highlevel";
|
|
130
|
+
hubspot: "hubspot";
|
|
85
131
|
linkedin: "linkedin";
|
|
132
|
+
pipedrive: "pipedrive";
|
|
133
|
+
savvycal: "savvycal";
|
|
86
134
|
}>;
|
|
87
135
|
reason: z.ZodString;
|
|
88
136
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-input.d.ts","sourceRoot":"","sources":["../../src/hono/connection-input.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"connection-input.d.ts","sourceRoot":"","sources":["../../src/hono/connection-input.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,YAC/B,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,CACN,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;iBAK1B,CAAC;AAgBH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BActC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8D,CAAC;AAC3G,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,wFAAwF;AACxF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,GAAG,IAAI,CAG/F;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,EAAE,CAgB1F;AASD,wBAAgB,yBAAyB;;;;;;;;;;;;;;;;;;GAUxC"}
|
|
@@ -19,9 +19,21 @@ import { z } from "zod";
|
|
|
19
19
|
import { toToolInputArray } from "./tool-input.js";
|
|
20
20
|
export const CONNECTION_INPUT_TOOL_NAME = "mcp__baker_ui__request_connection";
|
|
21
21
|
/**
|
|
22
|
-
* Connectable data platforms
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Connectable data platforms — every provider with a working OAuth flow.
|
|
23
|
+
*
|
|
24
|
+
* Meta and X Ads are deliberately absent: they are still `comingSoon`, so asking
|
|
25
|
+
* the user to connect them would promise a capability that isn't there.
|
|
26
|
+
*
|
|
27
|
+
* This list is the schema the agent actually sees, and `normalizeConnectionInputToolInput`
|
|
28
|
+
* drops anything outside it **silently** — so a provider missing here is not a
|
|
29
|
+
* degraded tab, it is no tab at all. It drifted once: the backend, the setup
|
|
30
|
+
* link and the tool docs all offered HubSpot while this tuple still held five
|
|
31
|
+
* platforms, so the CRM — the one system a lead funnel is reconstructed from —
|
|
32
|
+
* could not be asked for in the conversation that needed it, and clients were
|
|
33
|
+
* sent to Settings for a platform we integrate. `connection-input.test.ts` reads
|
|
34
|
+
* the backend's `CONNECTION_PLATFORMS` off disk and fails if the two diverge
|
|
35
|
+
* again; the tuple is spelled out rather than imported because the bridge ships
|
|
36
|
+
* as a standalone package with no workspace dependencies.
|
|
25
37
|
*/
|
|
26
38
|
export const CONNECTION_PLATFORMS = [
|
|
27
39
|
"google-ads",
|
|
@@ -29,6 +41,12 @@ export const CONNECTION_PLATFORMS = [
|
|
|
29
41
|
"google-analytics",
|
|
30
42
|
"google-search-console",
|
|
31
43
|
"google-tag-manager",
|
|
44
|
+
"hubspot",
|
|
45
|
+
"pipedrive",
|
|
46
|
+
"highlevel",
|
|
47
|
+
"calendly",
|
|
48
|
+
"savvycal",
|
|
49
|
+
"google-drive",
|
|
32
50
|
];
|
|
33
51
|
const connectionRequestShape = z.object({
|
|
34
52
|
platform: z.enum(CONNECTION_PLATFORMS).describe("Which platform the user needs to connect"),
|
|
@@ -93,7 +111,7 @@ export function normalizeConnectionInputToolInput(input) {
|
|
|
93
111
|
return requests;
|
|
94
112
|
}
|
|
95
113
|
const CONNECTION_INPUT_TOOL_DESCRIPTION = [
|
|
96
|
-
"Ask the user to connect a data platform — Google Ads, LinkedIn Ads, Google Analytics 4, Google Search Console,
|
|
114
|
+
"Ask the user to connect a data platform — Google Ads, LinkedIn Ads, Google Analytics 4, Google Search Console, Google Tag Manager, HubSpot, Pipedrive, GoHighLevel, Calendly, SavvyCal, or Google Drive — and pick which accounts Baker may read. BLOCKS until they resolve it in the dashboard.",
|
|
97
115
|
"Use it the moment a command tells you the platform isn't connected, instead of telling the user to go to Settings. Each entry in `connections` becomes a tab, so ask for everything the task needs in ONE call.",
|
|
98
116
|
"`reason` is shown to the user: say what connecting unlocks in their terms ('so I can see which campaigns are actually converting'), never in technical terms.",
|
|
99
117
|
"A declined tab is not an error — carry on with what you can do without it and say what stays unavailable. Results name only the account and what was selected; no credentials ever reach you.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-input.js","sourceRoot":"","sources":["../../src/hono/connection-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"connection-input.js","sourceRoot":"","sources":["../../src/hono/connection-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,uBAAuB;IACvB,oBAAoB;IACpB,SAAS;IACT,WAAW;IACX,WAAW;IACX,UAAU;IACV,UAAU;IACV,cA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AC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,UAAU,yBAAyB;IACvC,OAAO,IAAI,CACT,oBAAoB,EACpB,iCAAiC,EACjC,wBAAwB,EACxB,CAAC,IAAI,EAA+D,EAAE;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAK,EAAE,OAAO,EAAE,EAAE,EAAuC,CAAC;QAC5F,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
1
4
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { normalizeConnectionInputToolInput, parseConnectionInputResolution } from "./connection-input.js";
|
|
5
|
+
import { CONNECTION_PLATFORMS, normalizeConnectionInputToolInput, parseConnectionInputResolution, } from "./connection-input.js";
|
|
6
|
+
describe("CONNECTION_PLATFORMS", () => {
|
|
7
|
+
// This tuple is the schema the agent sees, and unknown platforms are dropped in
|
|
8
|
+
// silence — so when it fell behind the backend, HubSpot was offered by the docs,
|
|
9
|
+
// accepted by Convex, and simply had no tab. A client's CRM stayed unconnected
|
|
10
|
+
// through an entire setup because of it. The bridge ships standalone and cannot
|
|
11
|
+
// import the backend, so parity is read off disk instead of assumed.
|
|
12
|
+
it("matches the backend's list of what a client can be asked to connect", () => {
|
|
13
|
+
const validators = join(dirname(fileURLToPath(import.meta.url)), "../../../backend/convex/lib/validators.ts");
|
|
14
|
+
const source = readFileSync(validators, "utf8");
|
|
15
|
+
const tuple = /export const CONNECTION_PLATFORMS = \[([^\]]*)\] as const;/.exec(source);
|
|
16
|
+
expect(tuple, "backend no longer declares CONNECTION_PLATFORMS as a literal tuple").not.toBeNull();
|
|
17
|
+
const backend = [...(tuple?.[1] ?? "").matchAll(/"([^"]+)"/g)].map((match) => match[1]);
|
|
18
|
+
expect(backend.length).toBeGreaterThan(0);
|
|
19
|
+
expect([...CONNECTION_PLATFORMS].sort()).toEqual([...backend].sort());
|
|
20
|
+
});
|
|
21
|
+
});
|
|
3
22
|
describe("normalizeConnectionInputToolInput", () => {
|
|
4
23
|
it("keeps well-formed requests in the order the agent asked for them", () => {
|
|
5
24
|
expect(normalizeConnectionInputToolInput({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-input.test.js","sourceRoot":"","sources":["../../src/hono/connection-input.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"connection-input.test.js","sourceRoot":"","sources":["../../src/hono/connection-input.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC;AAE/B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,gFAAgF;IAChF,iFAAiF;IACjF,+EAA+E;IAC/E,gFAAgF;IAChF,qEAAqE;IACrE,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,2CAA2C,CAAC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QAAQ,EAAE,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koda-sl/baker-bridge",
|
|
3
|
-
"version": "0.71.0-dev.
|
|
3
|
+
"version": "0.71.0-dev.b1beafb2c.bacce491",
|
|
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",
|