openkbs 0.0.39 → 0.0.42
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/src/actions.js +8 -5
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -595,9 +595,9 @@ async function updateKnowledgeAction() {
|
|
|
595
595
|
await downloadKnowledgeFromS3(knowledgeDir);
|
|
596
596
|
|
|
597
597
|
// Download CLAUDE.md file from S3
|
|
598
|
-
await downloadClaudeMdFromS3(claudeMdPath
|
|
598
|
+
await downloadClaudeMdFromS3(claudeMdPath);
|
|
599
599
|
|
|
600
|
-
console.green('Knowledge base
|
|
600
|
+
console.green('Knowledge base updated successfully!');
|
|
601
601
|
|
|
602
602
|
} catch (error) {
|
|
603
603
|
console.red('Error updating knowledge base:', error.message);
|
|
@@ -655,7 +655,10 @@ async function downloadKnowledgeFromS3(targetDir) {
|
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
|
|
658
|
-
async function downloadClaudeMdFromS3(claudeMdPath
|
|
658
|
+
async function downloadClaudeMdFromS3(claudeMdPath) {
|
|
659
|
+
const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3");
|
|
660
|
+
const s3Client = new S3Client({ region: 'us-east-1' });
|
|
661
|
+
const bucket = 'openkbs-downloads';
|
|
659
662
|
const claudeMdKey = 'templates/CLAUDE.md';
|
|
660
663
|
|
|
661
664
|
try {
|
|
@@ -674,8 +677,8 @@ async function downloadClaudeMdFromS3(claudeMdPath, s3Client, bucket) {
|
|
|
674
677
|
if (error.name === 'NoSuchKey') {
|
|
675
678
|
console.yellow('CLAUDE.md not found in remote repository, skipping...');
|
|
676
679
|
} else {
|
|
677
|
-
console.red('Error downloading CLAUDE.md
|
|
678
|
-
|
|
680
|
+
console.red('Error downloading CLAUDE.md:', error.message);
|
|
681
|
+
throw error;
|
|
679
682
|
}
|
|
680
683
|
}
|
|
681
684
|
}
|