polydev-ai 1.9.33 → 1.9.35

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/mcp/manifest.json CHANGED
@@ -240,569 +240,6 @@
240
240
  }
241
241
  }
242
242
  ]
243
- },
244
- {
245
- "name": "force_cli_detection",
246
- "description": "Force detection and status update for CLI tools (Claude Code, Codex CLI, Gemini CLI). Updates local cache and reports status to MCP server via Supabase.",
247
- "inputSchema": {
248
- "type": "object",
249
- "properties": {
250
- "user_id": {
251
- "type": "string",
252
- "description": "User ID for database status updates (optional for stdio-wrapper)",
253
- "minLength": 1
254
- },
255
- "provider_id": {
256
- "type": "string",
257
- "description": "Specific CLI provider to detect (optional, detects all if not provided)",
258
- "enum": ["claude_code", "codex_cli", "gemini_cli"]
259
- }
260
- }
261
- },
262
- "outputSchema": {
263
- "type": "object",
264
- "properties": {
265
- "success": {
266
- "type": "boolean",
267
- "description": "Whether detection was successful"
268
- },
269
- "results": {
270
- "type": "object",
271
- "description": "Detection results for each provider",
272
- "additionalProperties": {
273
- "type": "object",
274
- "properties": {
275
- "available": {
276
- "type": "boolean",
277
- "description": "Whether CLI is available"
278
- },
279
- "authenticated": {
280
- "type": "boolean",
281
- "description": "Whether CLI is authenticated"
282
- },
283
- "version": {
284
- "type": "string",
285
- "description": "CLI version if available"
286
- },
287
- "path": {
288
- "type": "string",
289
- "description": "Path to CLI executable"
290
- },
291
- "error": {
292
- "type": "string",
293
- "description": "Error message if detection failed"
294
- }
295
- }
296
- }
297
- },
298
- "message": {
299
- "type": "string",
300
- "description": "Human-readable result message"
301
- },
302
- "timestamp": {
303
- "type": "string",
304
- "description": "Detection timestamp"
305
- }
306
- },
307
- "required": ["success", "results", "message", "timestamp"]
308
- },
309
- "examples": [
310
- {
311
- "description": "Detect all CLI providers",
312
- "input": {
313
- "user_id": "user_123"
314
- },
315
- "output": {
316
- "success": true,
317
- "results": {
318
- "claude_code": {
319
- "available": true,
320
- "authenticated": true,
321
- "version": "claude-code v1.2.3",
322
- "path": "/usr/local/bin/claude"
323
- },
324
- "codex_cli": {
325
- "available": false,
326
- "authenticated": false,
327
- "error": "Codex CLI not found in PATH. Install Codex CLI from OpenAI"
328
- }
329
- },
330
- "message": "CLI detection completed for all providers",
331
- "timestamp": "2024-01-15T10:30:00Z"
332
- }
333
- }
334
- ]
335
- },
336
- {
337
- "name": "get_cli_status",
338
- "description": "Get current CLI status with caching support. Returns cached results if available and fresh, otherwise performs new detection.",
339
- "inputSchema": {
340
- "type": "object",
341
- "properties": {
342
- "user_id": {
343
- "type": "string",
344
- "description": "User ID for database status retrieval (optional for stdio-wrapper)",
345
- "minLength": 1
346
- },
347
- "provider_id": {
348
- "type": "string",
349
- "description": "Specific CLI provider status to get (optional, gets all if not provided)",
350
- "enum": ["claude_code", "codex_cli", "gemini_cli"]
351
- }
352
- }
353
- },
354
- "outputSchema": {
355
- "type": "object",
356
- "properties": {
357
- "success": {
358
- "type": "boolean",
359
- "description": "Whether status retrieval was successful"
360
- },
361
- "results": {
362
- "type": "object",
363
- "description": "Status results for each provider",
364
- "additionalProperties": {
365
- "type": "object",
366
- "properties": {
367
- "available": {
368
- "type": "boolean"
369
- },
370
- "authenticated": {
371
- "type": "boolean"
372
- },
373
- "version": {
374
- "type": "string"
375
- },
376
- "lastChecked": {
377
- "type": "string",
378
- "description": "Last status check timestamp"
379
- }
380
- }
381
- }
382
- },
383
- "message": {
384
- "type": "string"
385
- },
386
- "timestamp": {
387
- "type": "string"
388
- }
389
- },
390
- "required": ["success", "results"]
391
- }
392
- },
393
- {
394
- "name": "send_cli_prompt",
395
- "description": "Send a prompt to a CLI provider and get response. Supports both stdin and argument modes for maximum compatibility.",
396
- "inputSchema": {
397
- "type": "object",
398
- "properties": {
399
- "provider_id": {
400
- "type": "string",
401
- "description": "CLI provider to send prompt to",
402
- "enum": ["claude_code", "codex_cli", "gemini_cli"]
403
- },
404
- "prompt": {
405
- "type": "string",
406
- "description": "Prompt to send to the CLI",
407
- "minLength": 1
408
- },
409
- "mode": {
410
- "type": "string",
411
- "description": "Prompt sending mode",
412
- "enum": ["stdin", "args"],
413
- "default": "args"
414
- },
415
- "timeout_ms": {
416
- "type": "integer",
417
- "description": "Timeout in milliseconds (90 seconds default for CLI-within-CLI scenarios)",
418
- "minimum": 1000,
419
- "maximum": 600000,
420
- "default": 90000
421
- },
422
- "user_id": {
423
- "type": "string",
424
- "description": "User ID for usage tracking (optional)",
425
- "minLength": 1
426
- }
427
- },
428
- "required": ["prompt"]
429
- },
430
- "outputSchema": {
431
- "type": "object",
432
- "properties": {
433
- "success": {
434
- "type": "boolean",
435
- "description": "Whether the prompt was sent successfully"
436
- },
437
- "content": {
438
- "type": "string",
439
- "description": "CLI response content"
440
- },
441
- "error": {
442
- "type": "string",
443
- "description": "Error message if prompt failed"
444
- },
445
- "tokens_used": {
446
- "type": "integer",
447
- "description": "Number of tokens used"
448
- },
449
- "latency_ms": {
450
- "type": "integer",
451
- "description": "Response latency in milliseconds"
452
- },
453
- "provider": {
454
- "type": "string",
455
- "description": "CLI provider used"
456
- },
457
- "mode": {
458
- "type": "string",
459
- "description": "Mode used for sending"
460
- },
461
- "timestamp": {
462
- "type": "string",
463
- "description": "Response timestamp"
464
- }
465
- },
466
- "required": ["success", "provider", "timestamp"]
467
- },
468
- "examples": [
469
- {
470
- "description": "Send prompt to Claude Code",
471
- "input": {
472
- "provider_id": "claude_code",
473
- "prompt": "Help me debug this TypeScript error: Property 'map' does not exist on type 'string'",
474
- "mode": "args",
475
- "user_id": "user_123"
476
- },
477
- "output": {
478
- "success": true,
479
- "content": "This error occurs when you're trying to use the .map() method on a string variable. The .map() method is an array method, not a string method...",
480
- "tokens_used": 150,
481
- "latency_ms": 1200,
482
- "provider": "claude_code",
483
- "mode": "args",
484
- "timestamp": "2024-01-15T10:35:00Z"
485
- }
486
- }
487
- ]
488
- },
489
- {
490
- "name": "enable_status_reporting",
491
- "description": "Enable automatic CLI status reporting to polydev.ai server. Reports are sent when CLI detection runs and via periodic heartbeat. Requires a Polydev user token.",
492
- "inputSchema": {
493
- "type": "object",
494
- "properties": {
495
- "user_token": {
496
- "type": "string",
497
- "description": "Polydev user token (pd_xxx or polydev_xxx). Can also be set via POLYDEV_USER_TOKEN env var.",
498
- "minLength": 1
499
- },
500
- "heartbeat_interval_minutes": {
501
- "type": "integer",
502
- "description": "How often to send status updates (in minutes)",
503
- "minimum": 5,
504
- "maximum": 1440,
505
- "default": 15
506
- },
507
- "start_heartbeat": {
508
- "type": "boolean",
509
- "description": "Whether to start automatic heartbeat immediately",
510
- "default": true
511
- }
512
- }
513
- },
514
- "outputSchema": {
515
- "type": "object",
516
- "properties": {
517
- "success": { "type": "boolean" },
518
- "message": { "type": "string" },
519
- "heartbeat_enabled": { "type": "boolean" },
520
- "heartbeat_interval_minutes": { "type": "integer" },
521
- "initial_status": { "type": "object" },
522
- "timestamp": { "type": "string" }
523
- }
524
- }
525
- },
526
- {
527
- "name": "disable_status_reporting",
528
- "description": "Disable automatic CLI status reporting to polydev.ai server. Stops heartbeat and disables reporting.",
529
- "inputSchema": {
530
- "type": "object",
531
- "properties": {}
532
- },
533
- "outputSchema": {
534
- "type": "object",
535
- "properties": {
536
- "success": { "type": "boolean" },
537
- "message": { "type": "string" },
538
- "timestamp": { "type": "string" }
539
- }
540
- }
541
- },
542
- {
543
- "name": "get_status_reporting_info",
544
- "description": "Get current status reporting configuration and history. Shows whether reporting is enabled, heartbeat status, and recent report history.",
545
- "inputSchema": {
546
- "type": "object",
547
- "properties": {}
548
- },
549
- "outputSchema": {
550
- "type": "object",
551
- "properties": {
552
- "success": { "type": "boolean" },
553
- "available": { "type": "boolean" },
554
- "config": {
555
- "type": "object",
556
- "properties": {
557
- "serverUrl": { "type": "string" },
558
- "reportingEnabled": { "type": "boolean" },
559
- "heartbeatRunning": { "type": "boolean" },
560
- "heartbeatIntervalMs": { "type": "integer" },
561
- "isOnline": { "type": "boolean" },
562
- "pendingReportsCount": { "type": "integer" }
563
- }
564
- },
565
- "history": {
566
- "type": "array",
567
- "items": {
568
- "type": "object",
569
- "properties": {
570
- "provider": { "type": "string" },
571
- "status": { "type": "string" },
572
- "success": { "type": "boolean" },
573
- "timestamp": { "type": "string" }
574
- }
575
- }
576
- },
577
- "timestamp": { "type": "string" }
578
- }
579
- }
580
- },
581
- {
582
- "name": "detect_memory_sources",
583
- "description": "Detect all available memory sources across CLI tools (Claude Code, Cline, Codex, Cursor, Continue, Aider). Returns file paths for global memory, project memory, and recent conversations.",
584
- "inputSchema": {
585
- "type": "object",
586
- "properties": {
587
- "project_path": {
588
- "type": "string",
589
- "description": "Project directory path to scan for memory sources",
590
- "default": "."
591
- },
592
- "cli_tools": {
593
- "type": "array",
594
- "items": {
595
- "type": "string",
596
- "enum": ["claude_code", "cline", "codex_cli", "cursor", "continue", "aider", "generic", "all"]
597
- },
598
- "description": "CLI tools to detect memory for",
599
- "default": ["all"]
600
- },
601
- "memory_types": {
602
- "type": "array",
603
- "items": {
604
- "type": "string",
605
- "enum": ["global", "project", "conversation", "config"]
606
- },
607
- "description": "Types of memory to detect",
608
- "default": ["global", "project", "conversation"]
609
- }
610
- }
611
- },
612
- "outputSchema": {
613
- "type": "object",
614
- "properties": {
615
- "success": { "type": "boolean" },
616
- "sources": {
617
- "type": "array",
618
- "items": {
619
- "type": "object",
620
- "properties": {
621
- "cli_tool": { "type": "string" },
622
- "memory_type": { "type": "string" },
623
- "file_path": { "type": "string" },
624
- "exists": { "type": "boolean" },
625
- "size_bytes": { "type": "number" },
626
- "last_modified": { "type": "string" }
627
- }
628
- }
629
- },
630
- "summary": {
631
- "type": "object",
632
- "properties": {
633
- "total_sources": { "type": "number" },
634
- "sources_by_tool": { "type": "object" },
635
- "sources_by_type": { "type": "object" }
636
- }
637
- }
638
- }
639
- }
640
- },
641
- {
642
- "name": "extract_memory",
643
- "description": "Extract and optionally encrypt memory content from detected CLI tool sources. Provides TF-IDF relevance scoring and content analysis.",
644
- "inputSchema": {
645
- "type": "object",
646
- "properties": {
647
- "user_token": {
648
- "type": "string",
649
- "description": "Polydev user authentication token for server storage",
650
- "minLength": 1
651
- },
652
- "project_path": {
653
- "type": "string",
654
- "description": "Project directory path",
655
- "default": "."
656
- },
657
- "cli_tools": {
658
- "type": "array",
659
- "items": { "type": "string" },
660
- "default": ["all"]
661
- },
662
- "memory_types": {
663
- "type": "array",
664
- "items": { "type": "string" },
665
- "default": ["global", "project", "conversation"]
666
- },
667
- "encryption_enabled": {
668
- "type": "boolean",
669
- "description": "Enable zero-knowledge encryption for extracted content",
670
- "default": true
671
- },
672
- "max_file_size_kb": {
673
- "type": "integer",
674
- "minimum": 1,
675
- "maximum": 1000,
676
- "default": 500
677
- },
678
- "relevance_threshold": {
679
- "type": "number",
680
- "minimum": 0,
681
- "maximum": 1,
682
- "default": 0.3
683
- }
684
- },
685
- "required": ["user_token"]
686
- }
687
- },
688
- {
689
- "name": "get_recent_conversations",
690
- "description": "Get recent conversations from CLI tools with TF-IDF relevance scoring against query context. Supports encrypted storage and retrieval.",
691
- "inputSchema": {
692
- "type": "object",
693
- "properties": {
694
- "user_token": {
695
- "type": "string",
696
- "description": "Polydev user authentication token",
697
- "minLength": 1
698
- },
699
- "query_context": {
700
- "type": "string",
701
- "description": "Current query for relevance scoring and context matching"
702
- },
703
- "limit": {
704
- "type": "integer",
705
- "minimum": 1,
706
- "maximum": 50,
707
- "default": 6
708
- },
709
- "cli_tools": {
710
- "type": "array",
711
- "items": { "type": "string" },
712
- "default": ["all"]
713
- },
714
- "time_range_hours": {
715
- "type": "integer",
716
- "minimum": 1,
717
- "maximum": 168,
718
- "default": 24
719
- },
720
- "project_path": {
721
- "type": "string",
722
- "default": "."
723
- }
724
- },
725
- "required": ["user_token"]
726
- }
727
- },
728
- {
729
- "name": "get_memory_context",
730
- "description": "Get formatted memory and conversation context for injection into prompts. Automatically handles decryption and relevance scoring.",
731
- "inputSchema": {
732
- "type": "object",
733
- "properties": {
734
- "user_token": {
735
- "type": "string",
736
- "description": "Polydev user authentication token",
737
- "minLength": 1
738
- },
739
- "query_context": {
740
- "type": "string",
741
- "description": "Query to find relevant memory and conversations for"
742
- },
743
- "max_memory_kb": {
744
- "type": "integer",
745
- "minimum": 1,
746
- "maximum": 200,
747
- "default": 50
748
- },
749
- "max_conversations": {
750
- "type": "integer",
751
- "minimum": 1,
752
- "maximum": 20,
753
- "default": 6
754
- },
755
- "cli_tools": {
756
- "type": "array",
757
- "items": { "type": "string" },
758
- "default": ["all"]
759
- },
760
- "memory_types": {
761
- "type": "array",
762
- "items": { "type": "string" },
763
- "default": ["project", "conversation"]
764
- }
765
- },
766
- "required": ["user_token"]
767
- }
768
- },
769
- {
770
- "name": "manage_memory_preferences",
771
- "description": "Configure memory extraction and privacy preferences. Control which CLI tools and memory types are enabled, encryption settings, and context injection behavior.",
772
- "inputSchema": {
773
- "type": "object",
774
- "properties": {
775
- "user_token": {
776
- "type": "string",
777
- "description": "Polydev user authentication token",
778
- "minLength": 1
779
- },
780
- "action": {
781
- "type": "string",
782
- "enum": ["get", "update"],
783
- "description": "Action to perform",
784
- "default": "get"
785
- },
786
- "preferences": {
787
- "type": "object",
788
- "description": "Memory preferences to update",
789
- "properties": {
790
- "memory_enabled": { "type": "boolean" },
791
- "privacy_mode": { "type": "boolean" },
792
- "auto_extraction": { "type": "boolean" },
793
- "cli_tools_enabled": { "type": "object" },
794
- "memory_types_enabled": { "type": "object" },
795
- "auto_inject_context": { "type": "boolean" },
796
- "context_relevance_threshold": { "type": "number", "minimum": 0, "maximum": 1 },
797
- "max_conversations_inject": { "type": "integer" },
798
- "max_memory_inject_kb": { "type": "integer" },
799
- "key_rotation_days": { "type": "integer" },
800
- "cache_ttl_minutes": { "type": "integer" }
801
- }
802
- }
803
- },
804
- "required": ["user_token"]
805
- }
806
243
  }
807
244
  ],
808
245
  "configuration": {
@@ -2820,18 +2820,18 @@ To re-login: /polydev:login`
2820
2820
 
2821
2821
  /**
2822
2822
  * Get adaptive timeout for a CLI based on historical response times
2823
- * Returns timeout in ms (2.5x the average, with min 30s and max 400s)
2823
+ * Always uses 400s to ensure local CLIs get full time budget before falling back to credits
2824
2824
  */
2825
2825
  getAdaptiveTimeout(cliId, defaultTimeout = 400000) {
2826
2826
  const times = this.cliResponseTimes[cliId];
2827
2827
  if (!times || times.length === 0) {
2828
- return defaultTimeout; // No history, use default
2828
+ return defaultTimeout; // No history, use default (400s)
2829
2829
  }
2830
2830
  const avg = times.reduce((a, b) => a + b, 0) / times.length;
2831
- // 2.5x average, clamped between 30s and 400s
2832
- const adaptive = Math.min(400000, Math.max(30000, Math.round(avg * 2.5)));
2833
- console.error(`[Stdio Wrapper] Adaptive timeout for ${cliId}: ${adaptive}ms (avg: ${Math.round(avg)}ms from ${times.length} samples)`);
2834
- return adaptive;
2831
+ // Always use 400s local CLIs should get full time budget
2832
+ // Complex prompts need the full timeout; premature timeouts waste credits
2833
+ console.error(`[Stdio Wrapper] CLI timeout for ${cliId}: 400s (avg response: ${Math.round(avg)}ms from ${times.length} samples)`);
2834
+ return 400000;
2835
2835
  }
2836
2836
 
2837
2837
  /**
@@ -3407,34 +3407,29 @@ function createSandboxServer() {
3407
3407
  }
3408
3408
  },
3409
3409
  {
3410
- name: 'get_cli_status',
3411
- description: 'Check status of local CLI tools (Claude Code, Codex CLI, Gemini CLI)',
3410
+ name: 'get_auth_status',
3411
+ description: 'Check Polydev authentication status and setup instructions.',
3412
3412
  inputSchema: {
3413
3413
  type: 'object',
3414
3414
  properties: {
3415
- provider_id: {
3415
+ user_token: {
3416
3416
  type: 'string',
3417
- description: 'Optional specific provider to check'
3417
+ description: 'Polydev user authentication token (optional)'
3418
3418
  }
3419
3419
  }
3420
3420
  }
3421
3421
  },
3422
3422
  {
3423
- name: 'force_cli_detection',
3424
- description: 'Force re-detection of installed local CLI tools',
3425
- inputSchema: { type: 'object', properties: {} }
3426
- },
3427
- {
3428
- name: 'send_cli_prompt',
3429
- description: 'Send prompt to local CLI with perspectives fallback',
3423
+ name: 'login',
3424
+ description: 'Authenticate with Polydev by opening your browser.',
3430
3425
  inputSchema: {
3431
3426
  type: 'object',
3432
3427
  properties: {
3433
- provider_id: { type: 'string', description: 'CLI provider ID' },
3434
- prompt: { type: 'string', description: 'Prompt to send' },
3435
- mode: { type: 'string', enum: ['args', 'stdin'], default: 'args' }
3436
- },
3437
- required: ['provider_id', 'prompt']
3428
+ user_token: {
3429
+ type: 'string',
3430
+ description: 'Polydev user token for sandboxed environments'
3431
+ }
3432
+ }
3438
3433
  }
3439
3434
  }
3440
3435
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.9.33",
3
+ "version": "1.9.35",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },