@bike4mind/cli 3.0.0 → 3.2.0

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { A as BRIEFCASE_CATALOG_QUERIES, At as ttsBase64ResponseSchema, B as ImageModels, C as AGENT_QUEST_ID, L as DEFAULT_TTS_PROVIDER, M as BriefcasePromptIdSchema, Mt as ttsResponseTooLargeSchema, Ot as supportedVoiceGenerationVendor, St as replacePromptVariables, T as AGENT_QUEST_MCP_URI, V as ImagePromptResolutionSchema, Y as PROMPT_TEXT_MAX, _ as logger, g as parseApiUrl, h as NotAuthenticatedError, jt as ttsRequestSchema, k as ArtifactTypeSchema, nt as VisibilitySchema, ot as buildPromptContext, t as ConfigStore, u as requireApiUrl, ut as generatedAudioResponseSchema, w as AGENT_QUEST_MANIFEST, xt as questReplyText, yt as joinReplySlots, z as GENERATED_IMAGE_EXTENSION_RE } from "./ConfigStore-51UaP9pJ.mjs";
3
- import { a as ApiClient, i as parseRetryAfterSeconds, o as isProviderKeyFailure, r as createClient, t as B4mApiError } from "./dist-BsG2Hlp-.mjs";
2
+ import { B as DEFAULT_TTS_PROVIDER, D as AGENT_QUEST_MCP_URI, E as AGENT_QUEST_MANIFEST, Ft as ttsResponseTooLargeSchema, H as GENERATED_IMAGE_EXTENSION_RE, M as BRIEFCASE_CATALOG_QUERIES, Nt as ttsBase64ResponseSchema, P as BriefcasePromptIdSchema, Pt as ttsRequestSchema, Q as PROMPT_TEXT_MAX, St as joinReplySlots, T as AGENT_QUEST_ID, Tt as replacePromptVariables, U as ImageModels, W as ImagePromptResolutionSchema, _ as NotAuthenticatedError, at as VisibilitySchema, f as requireApiUrl, j as ArtifactTypeSchema, jt as supportedVoiceGenerationVendor, lt as buildPromptContext, pt as generatedAudioResponseSchema, t as ConfigStore, v as parseApiUrl, wt as questReplyText, y as logger, z as CreateArtifactRequestSchema } from "./ConfigStore-v0wgf0_j.mjs";
3
+ import { a as ApiClient, i as parseRetryAfterSeconds, o as isProviderKeyFailure, r as createClient, t as B4mApiError } from "./dist-5DDaX8tB.mjs";
4
4
  import { z as z$1 } from "zod";
5
5
  import { isAxiosError } from "axios";
6
6
  import { createHash, randomUUID } from "node:crypto";
@@ -227,6 +227,27 @@ var B4mApiClient = class {
227
227
  async getArtifact(artifactId) {
228
228
  return this.client.get(`/api/artifacts/${encodeURIComponent(artifactId)}`, { params: { includeContent: "true" } });
229
229
  }
230
+ /** POST /api/v1/artifacts: creates a private artifact at version 1. */
231
+ async createArtifact(args) {
232
+ const artifact = await this.sdk.call("createArtifact", { body: {
233
+ type: args.type,
234
+ title: args.title,
235
+ content: args.content,
236
+ ...args.description !== void 0 ? { description: args.description } : {},
237
+ ...args.notebookId ? { session_id: args.notebookId } : {},
238
+ ...args.projectId ? { project_id: args.projectId } : {},
239
+ ...args.tags?.length ? { tags: args.tags } : {}
240
+ } });
241
+ return {
242
+ id: artifact.id,
243
+ type: artifact.type,
244
+ title: artifact.title,
245
+ version: artifact.version,
246
+ notebookId: artifact.session_id ?? void 0,
247
+ projectId: artifact.project_id ?? void 0,
248
+ createdAt: artifact.created_at
249
+ };
250
+ }
230
251
  /**
231
252
  * The caller's own most recent publication of an artifact, or null. The route is
232
253
  * owner-scoped for `sourceArtifactId`, so another user's page never matches.
@@ -461,6 +482,12 @@ const TOOL_META = [
461
482
  description: "Generate an image from a text prompt and wait for the render. Returns the quest and notebook ids plus each image's file name and download URL. Image names are not file ids and do not work with get_file.",
462
483
  scope: "ai:generate"
463
484
  },
485
+ {
486
+ name: "create_artifact",
487
+ title: "Create artifact",
488
+ description: "Create a private artifact (diagram, chart, code, page) and return its id. There is no markdown type: put a written document in type 'html'. Pass the returned id to publish_artifact to share it.",
489
+ scope: "notebooks:write"
490
+ },
464
491
  {
465
492
  name: "publish_artifact",
466
493
  title: "Publish artifact",
@@ -544,6 +571,15 @@ const publishArtifactShape = {
544
571
  visibility: publishVisibilitySchema.optional().describe("Who can open the link: 'public' (anyone) or 'private' (only you); omit to keep an existing page's visibility (a first publish is public)"),
545
572
  title: z$1.string().min(1).max(200).optional().describe("Page title; defaults to the artifact's title")
546
573
  };
574
+ const createArtifactShape = {
575
+ type: CreateArtifactRequestSchema.shape.type.describe("Artifact type: 'html' for a written document or web page, 'mermaid' for a diagram, 'recharts' for a chart, 'svg', 'react', 'python' or 'code' for source"),
576
+ title: CreateArtifactRequestSchema.shape.title.describe("Artifact title"),
577
+ content: CreateArtifactRequestSchema.shape.content.describe("The artifact's source: HTML, Mermaid, SVG, code and so on, matching type"),
578
+ description: CreateArtifactRequestSchema.shape.description.describe("Short description"),
579
+ notebookId: notebookId("A notebook (session) you can edit, to file the artifact under").optional(),
580
+ projectId: CreateArtifactRequestSchema.shape.project_id.describe("A project you can read, to file the artifact under"),
581
+ tags: CreateArtifactRequestSchema.shape.tags.describe("Up to 20 tags")
582
+ };
547
583
  const textToSpeechShape = {
548
584
  ...ttsRequestSchema.omit({ encoding: true }).shape,
549
585
  text: ttsRequestSchema.shape.text.describe("Text to speak"),
@@ -825,6 +861,9 @@ async function openPublishDraft(client, request) {
825
861
  });
826
862
  }
827
863
  }
864
+ async function createArtifact(client, args) {
865
+ return client.createArtifact(args);
866
+ }
828
867
  /**
829
868
  * Publish an artifact: upload its RAW content and let finalize render it
830
869
  * (source.artifactType), so the page matches an in-app publish byte for byte with
@@ -1118,6 +1157,11 @@ function registerTools(server, client) {
1118
1157
  baseURL,
1119
1158
  onProgress: progressReporter(extra, () => "rendering image")
1120
1159
  })));
1160
+ server.registerTool("create_artifact", {
1161
+ title: meta("create_artifact").title,
1162
+ description: meta("create_artifact").description,
1163
+ inputSchema: createArtifactShape
1164
+ }, (args) => run("notebooks:write", () => createArtifact(client, args)));
1121
1165
  server.registerTool("publish_artifact", {
1122
1166
  title: meta("publish_artifact").title,
1123
1167
  description: meta("publish_artifact").description,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "3.0.0",
4
- "mcpName": "io.github.bike4mind/bike4mind",
3
+ "version": "3.2.0",
4
+ "mcpName": "io.github.Bike4Mind/bike4mind",
5
5
  "type": "module",
6
6
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
7
7
  "license": "BUSL-1.1",
@@ -124,17 +124,17 @@
124
124
  "tsx": "^4.23.0",
125
125
  "typescript": "^5.9.3",
126
126
  "vitest": "^4.1.11",
127
- "@bike4mind/agents": "1.2.0",
127
+ "@bike4mind/agents": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
128
+ "@bike4mind/common": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
128
129
  "@bike4mind/client-auth": "0.2.0",
129
- "@bike4mind/common": "15.0.0",
130
- "@bike4mind/fab-pipeline": "2.1.0",
130
+ "@bike4mind/fab-pipeline": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
131
131
  "@bike4mind/hearth": "0.3.1",
132
- "@bike4mind/llm-adapters": "1.1.0",
133
- "@bike4mind/mcp": "2.1.0",
132
+ "@bike4mind/mcp": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
134
133
  "@bike4mind/observability": "0.2.3",
135
- "@bike4mind/sdk": "1.0.0",
136
- "@bike4mind/services": "17.0.0",
137
- "@bike4mind/utils": "7.1.0"
134
+ "@bike4mind/sdk": "1.1.0",
135
+ "@bike4mind/llm-adapters": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
136
+ "@bike4mind/utils": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015",
137
+ "@bike4mind/services": "0.0.0-snapshot-gh-readonly-queue-main-pr-5009-e421f9aab9-20261019120015"
138
138
  },
139
139
  "optionalDependencies": {
140
140
  "@vscode/ripgrep": "^1.18.0"