@bike4mind/cli 0.2.4 → 0.2.5-citables-display-web-search.17093

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-WR6YZRQV.js";
4
+ } from "./chunk-MVGLS65O.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-LYNNVNEC.js";
5
+ } from "./chunk-MV6KQD6A.js";
6
6
  import {
7
7
  GenericCreditDeductTransaction,
8
8
  ImageEditUsageTransaction,
@@ -10,7 +10,7 @@ import {
10
10
  RealtimeVoiceUsageTransaction,
11
11
  TextGenerationUsageTransaction,
12
12
  TransferCreditTransaction
13
- } from "./chunk-WR6YZRQV.js";
13
+ } from "./chunk-MVGLS65O.js";
14
14
 
15
15
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
16
16
  import { z } from "zod";
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-LYNNVNEC.js";
9
+ } from "./chunk-MV6KQD6A.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-WR6YZRQV.js";
14
+ } from "./chunk-MVGLS65O.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
File without changes
File without changes
File without changes
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-LYNNVNEC.js";
10
+ } from "./chunk-MV6KQD6A.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-WR6YZRQV.js";
14
+ } from "./chunk-MVGLS65O.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -16,7 +16,7 @@ import {
16
16
  dayjsConfig_default,
17
17
  extractSnippetMeta,
18
18
  settingsMap
19
- } from "./chunk-WR6YZRQV.js";
19
+ } from "./chunk-MVGLS65O.js";
20
20
 
21
21
  // ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
22
22
  import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
@@ -3745,6 +3745,35 @@ var ToolHealthSchema = z21.object({
3745
3745
  lastExecutionTime: z21.number().optional(),
3746
3746
  successRate: z21.number().optional()
3747
3747
  });
3748
+ var CitableSourceSchema = z21.object({
3749
+ /** Unique identifier - can be URL, UUID, or composite key */
3750
+ id: z21.string(),
3751
+ /** Source classification for UI rendering */
3752
+ type: z21.enum(["web_url", "document", "dataset", "mcp"]),
3753
+ /** Human-readable title/name */
3754
+ title: z21.string(),
3755
+ /** Navigation target (external URL, deep link, or hash route) */
3756
+ url: z21.string().optional(),
3757
+ /** Brief description or excerpt (1-2 sentences) */
3758
+ description: z21.string().optional(),
3759
+ /** ISO 8601 timestamp for freshness indication */
3760
+ timestamp: z21.string().optional(),
3761
+ /** Attribution for non-report sources */
3762
+ author: z21.string().optional(),
3763
+ /** Processing status for real-time updates */
3764
+ status: z21.enum(["pending", "processing", "complete", "error"]).optional(),
3765
+ /** Extensibility metadata */
3766
+ metadata: z21.object({
3767
+ sourceSystem: z21.string().optional(),
3768
+ icon: z21.string().optional(),
3769
+ tags: z21.array(z21.string()).optional(),
3770
+ confidence: z21.number().optional(),
3771
+ practiceAreas: z21.array(z21.string()).optional(),
3772
+ chunkId: z21.string().optional(),
3773
+ relevanceScore: z21.number().optional(),
3774
+ fullContext: z21.string().optional()
3775
+ }).passthrough().optional()
3776
+ });
3748
3777
  var PromptMetaZodSchema = z21.object({
3749
3778
  model: PromptMetaModelSchema.optional(),
3750
3779
  tokenUsage: PromptMetaTokenUsageSchema.optional(),
@@ -3787,7 +3816,9 @@ var PromptMetaZodSchema = z21.object({
3787
3816
  failedSteps: z21.array(z21.string()).optional()
3788
3817
  }).optional(),
3789
3818
  // Phase 2: Tool health tracking
3790
- toolHealth: z21.array(ToolHealthSchema).optional()
3819
+ toolHealth: z21.array(ToolHealthSchema).optional(),
3820
+ // Citable sources referenced in AI responses (from web_search, deep_research, RAG, MCP)
3821
+ citables: z21.array(CitableSourceSchema).optional()
3791
3822
  });
3792
3823
 
3793
3824
  // ../../b4m-core/packages/common/dist/src/schemas/analytics/events/ai.js
@@ -6059,6 +6090,7 @@ export {
6059
6090
  API_SERVICE_GROUPS,
6060
6091
  settingsMap,
6061
6092
  StringBooleanSchema,
6093
+ CitableSourceSchema,
6062
6094
  PromptMetaZodSchema,
6063
6095
  AiEvents,
6064
6096
  ApiKeyEvents,
File without changes
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-6AJODFPC.js";
6
- import "./chunk-LYNNVNEC.js";
5
+ } from "./chunk-KXHWFSYD.js";
6
+ import "./chunk-MV6KQD6A.js";
7
7
  import "./chunk-AMDXHL6S.js";
8
- import "./chunk-WR6YZRQV.js";
8
+ import "./chunk-MVGLS65O.js";
9
9
  import "./chunk-PDX44BCA.js";
10
10
  export {
11
11
  createFabFile,
File without changes
package/dist/index.js CHANGED
@@ -4,9 +4,9 @@ import {
4
4
  getEffectiveApiKey,
5
5
  getOpenWeatherKey,
6
6
  getSerperKey
7
- } from "./chunk-WNBKV4FX.js";
8
- import "./chunk-LEG2UM5Q.js";
9
- import "./chunk-6AJODFPC.js";
7
+ } from "./chunk-4PHLXSN3.js";
8
+ import "./chunk-2R6BM6L6.js";
9
+ import "./chunk-KXHWFSYD.js";
10
10
  import {
11
11
  BFLImageService,
12
12
  BaseStorage,
@@ -15,7 +15,7 @@ import {
15
15
  OpenAIBackend,
16
16
  OpenAIImageService,
17
17
  XAIImageService
18
- } from "./chunk-LYNNVNEC.js";
18
+ } from "./chunk-MV6KQD6A.js";
19
19
  import {
20
20
  Logger
21
21
  } from "./chunk-AMDXHL6S.js";
@@ -73,7 +73,7 @@ import {
73
73
  XAI_IMAGE_MODELS,
74
74
  b4mLLMTools,
75
75
  getMcpProviderMetadata
76
- } from "./chunk-WR6YZRQV.js";
76
+ } from "./chunk-MVGLS65O.js";
77
77
  import {
78
78
  __require
79
79
  } from "./chunk-PDX44BCA.js";
@@ -4471,13 +4471,30 @@ async function performWebSearch(adapters, params) {
4471
4471
  link: result.link,
4472
4472
  snippet: result.snippet
4473
4473
  })) || [];
4474
+ const citables = results.map((result, index) => ({
4475
+ id: result.link,
4476
+ // Use URL as unique identifier
4477
+ type: "web_url",
4478
+ title: result.title,
4479
+ url: result.link,
4480
+ description: result.snippet,
4481
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
4482
+ status: "complete",
4483
+ metadata: {
4484
+ sourceSystem: "web_search",
4485
+ relevanceScore: 1 - index * 0.1,
4486
+ // Higher relevance for earlier results
4487
+ fullContext: result.snippet
4488
+ }
4489
+ }));
4474
4490
  const formattedResults = results.map((result, index) => `${index + 1}. **${result.title}**
4475
4491
  ${result.snippet}
4476
4492
  Source: [${new URL(result.link).hostname}](${result.link})
4477
4493
  `).join("\n");
4478
- return formattedResults ? `Here's what I found from searching the web:
4494
+ const formattedOutput = formattedResults ? `Here's what I found from searching the web:
4479
4495
 
4480
4496
  ${formattedResults}` : "No results found from web search.";
4497
+ return { formattedResults: formattedOutput, citables };
4481
4498
  } catch (error) {
4482
4499
  console.error("\u274C WebSearch Tool: Error during search:", error);
4483
4500
  throw error;
@@ -4488,7 +4505,18 @@ var webSearchTool = {
4488
4505
  implementation: (context) => ({
4489
4506
  toolFn: async (value) => {
4490
4507
  const params = value;
4491
- return performWebSearch({ db: context.db }, params);
4508
+ const { formattedResults, citables } = await performWebSearch({ db: context.db }, params);
4509
+ if (citables.length > 0) {
4510
+ await context.statusUpdate({
4511
+ // Store citables in promptMeta - statusUpdate will Object.assign this
4512
+ // The receiving code needs to handle merging promptMeta.citables
4513
+ promptMeta: {
4514
+ citables
4515
+ }
4516
+ }, "Web search complete");
4517
+ console.log(`\u{1F4DA} WebSearch Tool: Stored ${citables.length} citables`);
4518
+ }
4519
+ return formattedResults;
4492
4520
  },
4493
4521
  toolSchema: {
4494
4522
  name: "web_search",
@@ -9402,7 +9430,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
9402
9430
  // package.json
9403
9431
  var package_default = {
9404
9432
  name: "@bike4mind/cli",
9405
- version: "0.2.4",
9433
+ version: "0.2.5-citables-display-web-search.17093+01315691b",
9406
9434
  type: "module",
9407
9435
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9408
9436
  license: "UNLICENSED",
@@ -9503,11 +9531,11 @@ var package_default = {
9503
9531
  zustand: "^4.5.4"
9504
9532
  },
9505
9533
  devDependencies: {
9506
- "@bike4mind/agents": "workspace:*",
9507
- "@bike4mind/common": "workspace:*",
9508
- "@bike4mind/mcp": "workspace:*",
9509
- "@bike4mind/services": "workspace:*",
9510
- "@bike4mind/utils": "workspace:*",
9534
+ "@bike4mind/agents": "0.1.0",
9535
+ "@bike4mind/common": "2.37.1-citables-display-web-search.17093+01315691b",
9536
+ "@bike4mind/mcp": "1.19.6-citables-display-web-search.17093+01315691b",
9537
+ "@bike4mind/services": "2.32.2-citables-display-web-search.17093+01315691b",
9538
+ "@bike4mind/utils": "2.1.1-citables-display-web-search.17093+01315691b",
9511
9539
  "@types/diff": "^5.0.9",
9512
9540
  "@types/jsonwebtoken": "^9.0.4",
9513
9541
  "@types/node": "^22.9.0",
@@ -9518,7 +9546,8 @@ var package_default = {
9518
9546
  tsx: "^4.21.0",
9519
9547
  typescript: "^5.9.3",
9520
9548
  vitest: "^3.2.4"
9521
- }
9549
+ },
9550
+ gitHead: "01315691bda21256368539f634c17c96cafe413b"
9522
9551
  };
9523
9552
 
9524
9553
  // src/config/constants.ts
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-WR6YZRQV.js";
4
+ } from "./chunk-MVGLS65O.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/llmMarkdownGenerator.js
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-WR6YZRQV.js";
4
+ } from "./chunk-MVGLS65O.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/markdownGenerator.js
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  findMostSimilarMemento,
4
4
  getRelevantMementos
5
- } from "./chunk-WNBKV4FX.js";
6
- import "./chunk-LYNNVNEC.js";
5
+ } from "./chunk-4PHLXSN3.js";
6
+ import "./chunk-MV6KQD6A.js";
7
7
  import "./chunk-AMDXHL6S.js";
8
- import "./chunk-WR6YZRQV.js";
8
+ import "./chunk-MVGLS65O.js";
9
9
  import "./chunk-PDX44BCA.js";
10
10
  export {
11
11
  findMostSimilarMemento,
File without changes
@@ -37,6 +37,7 @@ import {
37
37
  ChatCompletionInvokeParamsSchema,
38
38
  ChatHistoryItemWithArtifactsSchema,
39
39
  ChatModels,
40
+ CitableSourceSchema,
40
41
  ClaudeArtifactMimeTypes,
41
42
  CollectionType,
42
43
  CompletionRequestSchema,
@@ -291,7 +292,7 @@ import {
291
292
  validateQuestMasterArtifactV2,
292
293
  validateReactArtifactV2,
293
294
  validateSvgArtifactV2
294
- } from "./chunk-WR6YZRQV.js";
295
+ } from "./chunk-MVGLS65O.js";
295
296
  import "./chunk-PDX44BCA.js";
296
297
  export {
297
298
  ALL_IMAGE_MODELS,
@@ -331,6 +332,7 @@ export {
331
332
  ChatCompletionInvokeParamsSchema,
332
333
  ChatHistoryItemWithArtifactsSchema,
333
334
  ChatModels,
335
+ CitableSourceSchema,
334
336
  ClaudeArtifactMimeTypes,
335
337
  CollectionType,
336
338
  CompletionRequestSchema,
@@ -120,7 +120,7 @@ import {
120
120
  validateMermaidSyntax,
121
121
  warmUpSettingsCache,
122
122
  withRetry
123
- } from "./chunk-LYNNVNEC.js";
123
+ } from "./chunk-MV6KQD6A.js";
124
124
  import {
125
125
  Logger,
126
126
  NotificationDeduplicator,
@@ -129,7 +129,7 @@ import {
129
129
  postLowCreditsNotificationToSlack,
130
130
  postMessageToSlack
131
131
  } from "./chunk-AMDXHL6S.js";
132
- import "./chunk-WR6YZRQV.js";
132
+ import "./chunk-MVGLS65O.js";
133
133
  import "./chunk-PDX44BCA.js";
134
134
  export {
135
135
  AWSBackend,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  SubtractCreditsSchema,
4
4
  subtractCredits
5
- } from "./chunk-LEG2UM5Q.js";
6
- import "./chunk-LYNNVNEC.js";
5
+ } from "./chunk-2R6BM6L6.js";
6
+ import "./chunk-MV6KQD6A.js";
7
7
  import "./chunk-AMDXHL6S.js";
8
- import "./chunk-WR6YZRQV.js";
8
+ import "./chunk-MVGLS65O.js";
9
9
  import "./chunk-PDX44BCA.js";
10
10
  export {
11
11
  SubtractCreditsSchema,
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5-citables-display-web-search.17093+01315691b",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -30,6 +30,15 @@
30
30
  "dist",
31
31
  "bin"
32
32
  ],
33
+ "scripts": {
34
+ "dev": "tsx src/index.tsx",
35
+ "build": "tsup",
36
+ "typecheck": "tsc --noEmit",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest",
39
+ "start": "node dist/index.js",
40
+ "prepublishOnly": "pnpm build"
41
+ },
33
42
  "dependencies": {
34
43
  "@anthropic-ai/sdk": "^0.22.0",
35
44
  "@aws-sdk/client-apigatewaymanagementapi": "3.654.0",
@@ -92,6 +101,11 @@
92
101
  "zustand": "^4.5.4"
93
102
  },
94
103
  "devDependencies": {
104
+ "@bike4mind/agents": "0.1.0",
105
+ "@bike4mind/common": "2.37.1-citables-display-web-search.17093+01315691b",
106
+ "@bike4mind/mcp": "1.19.6-citables-display-web-search.17093+01315691b",
107
+ "@bike4mind/services": "2.32.2-citables-display-web-search.17093+01315691b",
108
+ "@bike4mind/utils": "2.1.1-citables-display-web-search.17093+01315691b",
95
109
  "@types/diff": "^5.0.9",
96
110
  "@types/jsonwebtoken": "^9.0.4",
97
111
  "@types/node": "^22.9.0",
@@ -101,19 +115,7 @@
101
115
  "tsup": "^8.5.1",
102
116
  "tsx": "^4.21.0",
103
117
  "typescript": "^5.9.3",
104
- "vitest": "^3.2.4",
105
- "@bike4mind/agents": "0.1.0",
106
- "@bike4mind/mcp": "1.19.5",
107
- "@bike4mind/services": "2.32.1",
108
- "@bike4mind/utils": "2.1.0",
109
- "@bike4mind/common": "2.37.0"
118
+ "vitest": "^3.2.4"
110
119
  },
111
- "scripts": {
112
- "dev": "tsx src/index.tsx",
113
- "build": "tsup",
114
- "typecheck": "tsc --noEmit",
115
- "test": "vitest run",
116
- "test:watch": "vitest",
117
- "start": "node dist/index.js"
118
- }
119
- }
120
+ "gitHead": "01315691bda21256368539f634c17c96cafe413b"
121
+ }