@koda-sl/baker-cli 0.158.2 → 0.159.0-dev.a0159ea6f

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/dist/cli.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  toModelSafeImage,
37
37
  ulid,
38
38
  validateCanvasDeep
39
- } from "./chunk-CG6OTNUU.js";
39
+ } from "./chunk-K424D3CY.js";
40
40
  import {
41
41
  csvOrJson,
42
42
  daysAgoIso,
@@ -3501,7 +3501,7 @@ registerSchema({
3501
3501
  name: { type: "string", description: "Action name (short, action-verb, \u22646 words)", required: true },
3502
3502
  description: {
3503
3503
  type: "string",
3504
- description: "Context-complete description: what / why / where / done-when",
3504
+ description: "Context-complete description in markdown: what / why / where / done-when. Use `##` headings for those sections, `-` bullets for lists of items, and `**bold**` for the figures that drive the decision. Anything longer than a couple of sentences needs headings \u2014 it is read in a narrow panel.",
3505
3505
  required: false
3506
3506
  },
3507
3507
  tags: {
@@ -4154,7 +4154,11 @@ registerSchema({
4154
4154
  args: {
4155
4155
  id: { type: "string", description: "Action ID or tempId (temp_*) of a task staged in this chat", required: true },
4156
4156
  name: { type: "string", description: "New name", required: false },
4157
- description: { type: "string", description: "New description", required: false },
4157
+ description: {
4158
+ type: "string",
4159
+ description: "New description, in markdown \u2014 `##` headings per section, `-` bullets, `**bold**` for the decisive figures. REPLACES the whole description, so carry over anything still true.",
4160
+ required: false
4161
+ },
4158
4162
  tags: {
4159
4163
  type: "string",
4160
4164
  description: "Comma-separated tag slugs \u2014 REPLACES existing tags ('' clears)",
@@ -4176,7 +4180,7 @@ var updateCommand = defineCommand17({
4176
4180
  id: { type: "positional", description: "Action ID or tempId (temp_*)", required: false },
4177
4181
  "action-id": { type: "string", description: "Action ID or tempId (temp_*)", required: false },
4178
4182
  name: { type: "string", description: "New name", required: false },
4179
- description: { type: "string", description: "New description", required: false },
4183
+ description: { type: "string", description: "New description (markdown)", required: false },
4180
4184
  tags: { type: "string", description: "Comma-separated tag slugs \u2014 REPLACES existing ('' clears)", required: false },
4181
4185
  priority: { type: "string", description: `Priority: ${ACTION_PRIORITIES.join("|")}|none`, required: false }
4182
4186
  },
@@ -29494,6 +29498,20 @@ function parseScope(raw) {
29494
29498
  function actingUserId() {
29495
29499
  return getEnv().BAKER_ACTING_USER_ID;
29496
29500
  }
29501
+ function customEntry(server) {
29502
+ const failed = server.health && !server.health.ok;
29503
+ const problem = server.health?.message ?? "This server's address is not serving tools.";
29504
+ return {
29505
+ name: server.name,
29506
+ scope: server.scope,
29507
+ enabled: server.enabled,
29508
+ ...failed && !server.health?.transient ? { usable: false, problem } : {},
29509
+ ...failed && server.health?.transient ? { lastCheck: "failed", problem } : {},
29510
+ ...failed && server.health?.suggestedUrl ? { suggestedAddress: server.health.suggestedUrl } : {}
29511
+ };
29512
+ }
29513
+ var BROKEN_SERVER_HINT = "A server marked usable=false will NOT answer: its tools are absent from this turn. Say plainly that the tool is not working and relay `problem`; never claim its tools are loading, coming next message, or temporarily unavailable. Fixing it needs a person: the user updates its address in the dashboard (Brain \u2192 Integrations \u2192 MCPs). If `suggestedAddress` is present, that is the address to use.";
29514
+ var LAST_CHECK_FAILED_HINT = "A server with lastCheck=failed was unreachable or erroring when it was last checked \u2014 that may already have passed, and its tools ARE loaded this turn. Try the tool; if it works, say nothing about the check. If it fails, report `problem` as what happened rather than guessing.";
29497
29515
  function parseHeaders(raw) {
29498
29516
  const list = raw === void 0 ? [] : Array.isArray(raw) ? raw : [raw];
29499
29517
  const headers = {};
@@ -29540,8 +29558,14 @@ A tool the user names that is NOT listed here is simply not connected yet.`
29540
29558
  ...c.accountLabel ? { account: c.accountLabel } : {},
29541
29559
  ...c.readOnly ? { readOnly: true } : {}
29542
29560
  }));
29543
- const custom = data.custom.map((s) => ({ name: s.name, scope: s.scope, enabled: s.enabled }));
29561
+ const custom = data.custom.map(customEntry);
29544
29562
  const hints = [];
29563
+ if (data.custom.some((s) => s.health && !s.health.ok && !s.health.transient)) {
29564
+ hints.push(BROKEN_SERVER_HINT);
29565
+ }
29566
+ if (data.custom.some((s) => s.health && !s.health.ok && s.health.transient)) {
29567
+ hints.push(LAST_CHECK_FAILED_HINT);
29568
+ }
29545
29569
  if (data.managedDisabled) {
29546
29570
  hints.push("Managed integrations are disabled for this company \u2014 only custom MCP servers load.");
29547
29571
  }
@@ -29577,7 +29601,15 @@ var listCommand13 = defineCommand139({
29577
29601
  "/api/mcp/custom",
29578
29602
  user ? { actingUserId: user } : void 0
29579
29603
  );
29580
- writeJson({ ok: true, data: data.servers });
29604
+ writeJson({
29605
+ ok: true,
29606
+ // Detail view: the full row (address included) plus the usability verdict.
29607
+ // `health` itself is folded into `usable`/`problem` by `customEntry`.
29608
+ data: data.servers.map((server) => ({ ...server, health: void 0, ...customEntry(server) })),
29609
+ ...data.servers.some((s) => s.health && !s.health.ok) ? {
29610
+ hints: data.servers.some((s) => s.health && !s.health.ok && !s.health.transient) ? [BROKEN_SERVER_HINT] : [LAST_CHECK_FAILED_HINT]
29611
+ } : {}
29612
+ });
29581
29613
  } catch (err) {
29582
29614
  fail6(err);
29583
29615
  }
@@ -29588,7 +29620,11 @@ registerSchema({
29588
29620
  description: "Register a custom MCP server. Tools appear as mcp__<name>__* on the next message. URL must be HTTPS. Scope: company (default, all chats) | org (org admin key) | user (only the current sender).",
29589
29621
  args: {
29590
29622
  name: { type: "string", description: "Server name \u2192 tools appear as mcp__<name>__*", required: true },
29591
- url: { type: "string", description: "HTTPS MCP endpoint", required: true },
29623
+ url: {
29624
+ type: "string",
29625
+ description: "Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)",
29626
+ required: true
29627
+ },
29592
29628
  scope: { type: "string", description: "user | user_org | company | org (default company)", required: false },
29593
29629
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
29594
29630
  }
@@ -29607,7 +29643,11 @@ Examples:
29607
29643
  },
29608
29644
  args: {
29609
29645
  name: { type: "string", description: "Server name (mcp__<name>__*)", required: true },
29610
- url: { type: "string", description: "HTTPS MCP endpoint", required: true },
29646
+ url: {
29647
+ type: "string",
29648
+ description: "Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)",
29649
+ required: true
29650
+ },
29611
29651
  scope: { type: "string", description: "user | user_org | company | org (default company)", required: false },
29612
29652
  header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
29613
29653
  },
@@ -29623,7 +29663,14 @@ Examples:
29623
29663
  ...user ? { actingUserId: user } : {},
29624
29664
  ...headers ? { headers } : {}
29625
29665
  });
29626
- writeJson({ ok: true, data });
29666
+ writeJson({
29667
+ ok: true,
29668
+ data,
29669
+ hints: [
29670
+ "The address must be the full MCP endpoint (commonly ending in /mcp), not just the domain \u2014 a domain on its own usually answers sign-in and then serves no tools.",
29671
+ "The address is checked in the background. Run `baker mcp connected` on the next message to confirm it serves tools before promising the user anything."
29672
+ ]
29673
+ });
29627
29674
  } catch (err) {
29628
29675
  fail6(err);
29629
29676
  }