@bike4mind/cli 0.1.4 → 0.1.5-feat-automate-cli-publishing.16903

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
@@ -9,6 +9,7 @@ Interactive command-line interface for Bike4Mind with ReAct agents.
9
9
  - 💾 Session persistence
10
10
  - 🛠️ B4M tools + MCP integration
11
11
  - 🎨 Rich terminal UI with Ink
12
+ - 🐛 Debug logging with `--verbose` flag
12
13
 
13
14
  ## Installation
14
15
 
@@ -44,6 +45,29 @@ b4m
44
45
 
45
46
  The CLI will prompt you to authenticate with your Bike4Mind account on first run.
46
47
 
48
+ ### CLI Flags
49
+
50
+ ```bash
51
+ b4m [options]
52
+ ```
53
+
54
+ **Available flags:**
55
+ - `--verbose`, `-v` - Show debug logs in console (useful for troubleshooting)
56
+ - `--help`, `-h` - Show help information
57
+ - `--version`, `-V` - Show CLI version
58
+
59
+ **Examples:**
60
+ ```bash
61
+ # Run with debug logs visible
62
+ b4m --verbose
63
+
64
+ # Check version
65
+ b4m --version
66
+
67
+ # Show help
68
+ b4m --help
69
+ ```
70
+
47
71
  ## Commands
48
72
 
49
73
  While in interactive mode:
@@ -181,6 +205,38 @@ Each session includes:
181
205
  - Agent reasoning steps
182
206
  - Metadata
183
207
 
208
+ ## Debug Logs
209
+
210
+ Debug logs are automatically written to `~/.bike4mind/debug/[session-id].txt` for every session, regardless of the `--verbose` flag.
211
+
212
+ **What's logged:**
213
+ - Session configuration (API endpoint, environment, model)
214
+ - HTTP requests and responses (with size and preview)
215
+ - SSE streaming events from LLM
216
+ - Tool execution details with parameters
217
+ - Error details including CloudFront/WAF errors
218
+ - Authentication flow events
219
+
220
+ **Accessing logs:**
221
+ ```bash
222
+ # List all debug logs
223
+ ls -lh ~/.bike4mind/debug/
224
+
225
+ # View latest session log
226
+ cat ~/.bike4mind/debug/[session-id].txt
227
+
228
+ # View logs in real-time (during session)
229
+ tail -f ~/.bike4mind/debug/[session-id].txt
230
+ ```
231
+
232
+ **Log retention:**
233
+ - Debug logs older than 30 days are automatically cleaned up on CLI startup
234
+ - Each log file is named by session ID for easy correlation
235
+
236
+ **Verbose mode:**
237
+ - Without `--verbose`: Debug logs only written to file (clean console output)
238
+ - With `--verbose`: Debug logs shown in console AND written to file
239
+
184
240
  ## Development
185
241
 
186
242
  ```bash
@@ -221,7 +277,7 @@ apps/cli/
221
277
  - `@bike4mind/mcp` - MCP integration
222
278
  - `@bike4mind/utils` - LLM backends
223
279
  - `ink` - React for CLIs
224
- - `commander` - CLI argument parsing
280
+ - `yargs` - CLI argument parsing
225
281
  - `lowdb` - Local storage
226
282
 
227
283
  ## Development Status
@@ -235,6 +291,7 @@ Current implementation includes:
235
291
  ✅ Interactive UI with Ink
236
292
  ✅ B4M tools integration
237
293
  ✅ MCP tools support
294
+ ✅ Debug logging with --verbose flag
238
295
 
239
296
  Coming soon:
240
297
 
@@ -21,11 +21,32 @@ import { createRequire } from 'module';
21
21
  import { fileURLToPath } from 'url';
22
22
  import { dirname, join } from 'path';
23
23
  import { existsSync } from 'fs';
24
+ import yargs from 'yargs';
25
+ import { hideBin } from 'yargs/helpers';
24
26
 
25
27
  const __filename = fileURLToPath(import.meta.url);
26
28
  const __dirname = dirname(__filename);
27
29
  const require = createRequire(import.meta.url);
28
30
 
31
+ // Parse CLI arguments
32
+ const argv = yargs(hideBin(process.argv))
33
+ .option('verbose', {
34
+ alias: 'v',
35
+ type: 'boolean',
36
+ description: 'Show debug logs in console',
37
+ default: false,
38
+ })
39
+ .help()
40
+ .alias('help', 'h')
41
+ .version()
42
+ .alias('version', 'V')
43
+ .parse();
44
+
45
+ // Set environment variable for verbose mode
46
+ if (argv.verbose) {
47
+ process.env.B4M_VERBOSE = '1';
48
+ }
49
+
29
50
  // Auto-detect environment: prefer production mode when dist exists
30
51
  const distPath = join(__dirname, '../dist/index.js');
31
52
  const srcPath = join(__dirname, '../src/index.tsx');
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-VVV7WLJ6.js";
4
+ } from "./chunk-PG4BD2XZ.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
@@ -16,7 +16,7 @@ import {
16
16
  dayjsConfig_default,
17
17
  extractSnippetMeta,
18
18
  settingsMap
19
- } from "./chunk-VVV7WLJ6.js";
19
+ } from "./chunk-PG4BD2XZ.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";
@@ -219,6 +219,12 @@ var b4mLLMTools = z3.enum([
219
219
  "blog_publish",
220
220
  "blog_edit",
221
221
  "blog_draft",
222
+ // Time Machine & Night Sky tools
223
+ "wikipedia_on_this_day",
224
+ "moon_phase",
225
+ "sunrise_sunset",
226
+ "iss_tracker",
227
+ "planet_visibility",
222
228
  // File operation tools
223
229
  "file_read",
224
230
  "create_file",
@@ -2091,7 +2097,11 @@ var SettingKeySchema = z19.enum([
2091
2097
  "whatsNewAutomationEnabled",
2092
2098
  "whatsNewConfig",
2093
2099
  // AGENT PROACTIVE MESSAGING SETTINGS
2094
- "enableAgentProactiveMessages"
2100
+ "enableAgentProactiveMessages",
2101
+ // TIME MACHINE & NIGHT SKY SETTINGS
2102
+ "EnableEnhancedDateTime",
2103
+ "EnableHistoricalFeatures",
2104
+ "EnableAstronomyFeatures"
2095
2105
  ]);
2096
2106
  var CategoryOrder = [
2097
2107
  "AI",
@@ -2555,6 +2565,17 @@ var API_SERVICE_GROUPS = {
2555
2565
  description: "PDF.js Express Viewer settings",
2556
2566
  icon: "PictureAsPdf",
2557
2567
  settings: [{ key: "pdfjsExpressViewerKey", order: 1 }]
2568
+ },
2569
+ DATETIME_ASTRONOMY: {
2570
+ id: "datetimeAstronomyService",
2571
+ name: "Time Machine & Night Sky",
2572
+ description: "Enhanced datetime, historical events, and astronomical tools",
2573
+ icon: "NightsStay",
2574
+ settings: [
2575
+ { key: "EnableEnhancedDateTime", order: 1 },
2576
+ { key: "EnableHistoricalFeatures", order: 2 },
2577
+ { key: "EnableAstronomyFeatures", order: 3 }
2578
+ ]
2558
2579
  }
2559
2580
  };
2560
2581
  var settingsMap = {
@@ -3494,6 +3515,34 @@ var settingsMap = {
3494
3515
  category: "Experimental",
3495
3516
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
3496
3517
  order: 6
3518
+ }),
3519
+ // Time Machine & Night Sky Settings
3520
+ EnableEnhancedDateTime: makeBooleanSetting({
3521
+ key: "EnableEnhancedDateTime",
3522
+ name: "Enable Enhanced DateTime",
3523
+ defaultValue: true,
3524
+ description: "Enable advanced datetime features: Unix timestamps, Julian days, date calculations, historical day lookups.",
3525
+ category: "Tools",
3526
+ group: API_SERVICE_GROUPS.DATETIME_ASTRONOMY.id,
3527
+ order: 1
3528
+ }),
3529
+ EnableHistoricalFeatures: makeBooleanSetting({
3530
+ key: "EnableHistoricalFeatures",
3531
+ name: "Enable Historical Features",
3532
+ defaultValue: true,
3533
+ description: 'Enable Wikipedia "On This Day" tool for historical events, births, deaths, and holidays.',
3534
+ category: "Tools",
3535
+ group: API_SERVICE_GROUPS.DATETIME_ASTRONOMY.id,
3536
+ order: 2
3537
+ }),
3538
+ EnableAstronomyFeatures: makeBooleanSetting({
3539
+ key: "EnableAstronomyFeatures",
3540
+ name: "Enable Astronomy Features",
3541
+ defaultValue: true,
3542
+ description: "Enable astronomy tools: moon phases, sunrise/sunset calculations, and ISS tracking.",
3543
+ category: "Tools",
3544
+ group: API_SERVICE_GROUPS.DATETIME_ASTRONOMY.id,
3545
+ order: 3
3497
3546
  })
3498
3547
  // Add more settings as needed
3499
3548
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-EVPT4ARN.js";
5
+ } from "./chunk-G2XBD676.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-VVV7WLJ6.js";
13
+ } from "./chunk-PG4BD2XZ.js";
14
14
 
15
15
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
16
16
  import { z } from "zod";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-EVPT4ARN.js";
10
+ } from "./chunk-G2XBD676.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-VVV7WLJ6.js";
14
+ } from "./chunk-PG4BD2XZ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-EVPT4ARN.js";
9
+ } from "./chunk-G2XBD676.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-VVV7WLJ6.js";
14
+ } from "./chunk-PG4BD2XZ.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-ZT7Z4QVD.js";
6
- import "./chunk-EVPT4ARN.js";
5
+ } from "./chunk-PYV7BIVP.js";
6
+ import "./chunk-G2XBD676.js";
7
7
  import "./chunk-CC67R4RB.js";
8
- import "./chunk-VVV7WLJ6.js";
8
+ import "./chunk-PG4BD2XZ.js";
9
9
  import "./chunk-PDX44BCA.js";
10
10
  export {
11
11
  createFabFile,