@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 +1 -1
- package/scripts/arcten-cli.cjs +11 -6
- package/scripts/cli-init-wizard.ts +62 -16
package/package.json
CHANGED
package/scripts/arcten-cli.cjs
CHANGED
|
@@ -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
|
|
61
|
-
arcten
|
|
62
|
-
arcten tools
|
|
63
|
-
arcten
|
|
64
|
-
arcten
|
|
65
|
-
arcten
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|
-
|
|
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
|
|
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 (
|
|
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 (
|
|
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
|
|