@arcteninc/core 0.0.130 → 0.0.131

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcteninc/core",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -38,6 +38,10 @@ Commands:
38
38
  - Optional AI analysis (billable)
39
39
  - Syncs configuration to dashboard
40
40
 
41
+ Options:
42
+ --allow-all Enable all functions without analysis
43
+ (useful for testing or when API is unreachable)
44
+
41
45
  sync Re-sync tools to dashboard without analysis
42
46
  - Scans for functions
43
47
  - Updates tool definitions
@@ -57,12 +61,13 @@ Commands:
57
61
  help Show this help message
58
62
 
59
63
  Examples:
60
- arcten init Run the setup wizard (recommended for new projects)
61
- arcten sync Re-sync tools after code changes
62
- arcten tools Extract tool types (same as arcten extract-types)
63
- arcten update Update @arcteninc/core to latest version
64
- arcten uninstall Remove Arcten configuration files
65
- arcten help Show help
64
+ arcten init Run the setup wizard (recommended for new projects)
65
+ arcten init --allow-all Setup and enable all functions (no AI analysis)
66
+ arcten sync Re-sync tools after code changes
67
+ arcten tools Extract tool types (same as arcten extract-types)
68
+ arcten update Update @arcteninc/core to latest version
69
+ arcten uninstall Remove Arcten configuration files
70
+ arcten help Show help
66
71
 
67
72
  For more information, visit https://arcten.com/docs
68
73
  `);
@@ -354,20 +354,34 @@ async function getUserIntent(rl: readline.Interface): Promise<string> {
354
354
  async function estimateCost(apiKey: string, serverUrl: string, context: CodebaseContext): Promise<AnalysisEstimate> {
355
355
  console.log('\nšŸ’° Estimating analysis cost...\n');
356
356
 
357
- const response = await fetch(`${serverUrl}/tools/analyze/estimate`, {
358
- method: 'POST',
359
- headers: {
360
- 'Content-Type': 'application/json',
361
- },
362
- body: JSON.stringify({ context }),
363
- });
357
+ try {
358
+ const url = `${serverUrl}/tools/analyze/estimate`;
359
+ const response = await fetch(url, {
360
+ method: 'POST',
361
+ headers: {
362
+ 'Content-Type': 'application/json',
363
+ },
364
+ body: JSON.stringify({ context }),
365
+ });
364
366
 
365
- if (!response.ok) {
366
- const error = await response.json();
367
- throw new Error(error.error || 'Failed to estimate cost');
368
- }
367
+ if (!response.ok) {
368
+ const error = await response.json();
369
+ throw new Error(error.error || 'Failed to estimate cost');
370
+ }
369
371
 
370
- return await response.json();
372
+ return await response.json();
373
+ } catch (error: any) {
374
+ if (error.cause?.code === 'ENOTFOUND' || error.cause?.code === 'ECONNREFUSED' || error.message.includes('fetch')) {
375
+ console.error(`\nāŒ Unable to connect to: ${serverUrl}`);
376
+ console.error('\nPossible issues:');
377
+ console.error(' • No internet connection');
378
+ console.error(' • API server is down');
379
+ console.error(' • Firewall blocking the request');
380
+ console.error('\nšŸ’” Tip: Use --allow-all flag to skip analysis and enable all tools');
381
+ throw new Error('Connection failed');
382
+ }
383
+ throw error;
384
+ }
371
385
  }
372
386
 
373
387
  // Step 5: Confirm analysis
@@ -618,11 +632,20 @@ For more information, visit https://arcten.com/docs
618
632
 
619
633
  // Main wizard
620
634
  async function main() {
621
- // Check for --skip-analysis flag
635
+ // Check for flags
622
636
  const args = process.argv.slice(2);
623
637
  const skipAnalysis = args.includes('--skip-analysis');
638
+ const allowAll = args.includes('--allow-all');
624
639
 
625
- if (skipAnalysis) {
640
+ if (allowAll) {
641
+ console.log('');
642
+ console.log('╔═══════════════════════════════════════════════╗');
643
+ console.log('ā•‘ ā•‘');
644
+ console.log('ā•‘ šŸ”“ Arcten Setup (Allow All) šŸ”“ ā•‘');
645
+ console.log('ā•‘ ā•‘');
646
+ console.log('ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•');
647
+ console.log('');
648
+ } else if (skipAnalysis) {
626
649
  console.log('');
627
650
  console.log('╔═══════════════════════════════════════════════╗');
628
651
  console.log('ā•‘ ā•‘');
@@ -649,7 +672,7 @@ async function main() {
649
672
  const arctenDir = path.join(process.cwd(), '.arcten');
650
673
  const hasExistingSetup = fs.existsSync(arctenDir);
651
674
 
652
- if (hasExistingSetup && !skipAnalysis) {
675
+ if (hasExistingSetup && !skipAnalysis && !allowAll) {
653
676
  console.log('āš ļø Arcten is already configured in this project!\n');
654
677
  console.log('šŸ“ Found existing .arcten/ directory\n');
655
678
  console.log('Running init again will:');
@@ -676,7 +699,30 @@ async function main() {
676
699
 
677
700
  let analysis: AnalysisResult | null = null;
678
701
 
679
- if (skipAnalysis) {
702
+ if (allowAll) {
703
+ // Allow-all mode - enable all tools without analysis
704
+ console.log('\nšŸ”“ Enabling all discovered functions...\n');
705
+ console.log('āš ļø WARNING: All functions will be enabled without analysis.');
706
+ console.log(' The agent will be able to call any discovered function.\n');
707
+
708
+ // Create tool recommendations with all tools enabled
709
+ const allTools: ToolRecommendation[] = context.functions.map(fn => ({
710
+ name: fn.name,
711
+ category: 'query' as const,
712
+ description: fn.jsDoc || `Function: ${fn.name}`,
713
+ shouldEnable: true, // Enable all tools in allow-all mode
714
+ requiresApproval: false,
715
+ sensitiveParams: [],
716
+ }));
717
+
718
+ await syncToDashboard(apiKey, convexUrl, projectId, allTools);
719
+ await generateLocalConfig(projectId, 'default');
720
+
721
+ console.log('\nāœ… Setup complete!\n');
722
+ console.log(`šŸ“ Dashboard: https://arcten.com/dashboard/projects/${projectId}`);
723
+ console.log(` All ${context.functions.length} functions are now enabled.`);
724
+ console.log('\nāš ļø Remember: You can always disable specific tools in the dashboard.');
725
+ } else if (skipAnalysis) {
680
726
  // Sync mode - just sync tools without analysis
681
727
  console.log('\nā˜ļø Syncing tools to dashboard...\n');
682
728