openkbs 0.0.40 → 0.0.43
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 -7
- package/src/utils.js +4 -1
- package/templates/CLAUDE.md +1 -1
- package/templates/scripts/utils/agent_client.js +11 -1
package/package.json
CHANGED
package/src/actions.js
CHANGED
|
@@ -594,10 +594,8 @@ async function updateKnowledgeAction() {
|
|
|
594
594
|
// Download updated knowledge files from S3
|
|
595
595
|
await downloadKnowledgeFromS3(knowledgeDir);
|
|
596
596
|
|
|
597
|
-
// Download CLAUDE.md file from S3
|
|
598
|
-
downloadClaudeMdFromS3(claudeMdPath
|
|
599
|
-
// Silently ignore any errors with CLAUDE.md download
|
|
600
|
-
});
|
|
597
|
+
// Download CLAUDE.md file from S3
|
|
598
|
+
await downloadClaudeMdFromS3(claudeMdPath);
|
|
601
599
|
|
|
602
600
|
console.green('Knowledge base updated successfully!');
|
|
603
601
|
|
|
@@ -657,7 +655,10 @@ async function downloadKnowledgeFromS3(targetDir) {
|
|
|
657
655
|
}
|
|
658
656
|
}
|
|
659
657
|
|
|
660
|
-
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';
|
|
661
662
|
const claudeMdKey = 'templates/CLAUDE.md';
|
|
662
663
|
|
|
663
664
|
try {
|
|
@@ -676,8 +677,8 @@ async function downloadClaudeMdFromS3(claudeMdPath, s3Client, bucket) {
|
|
|
676
677
|
if (error.name === 'NoSuchKey') {
|
|
677
678
|
console.yellow('CLAUDE.md not found in remote repository, skipping...');
|
|
678
679
|
} else {
|
|
679
|
-
console.red('Error downloading CLAUDE.md
|
|
680
|
-
|
|
680
|
+
console.red('Error downloading CLAUDE.md:', error.message);
|
|
681
|
+
throw error;
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
684
|
}
|
package/src/utils.js
CHANGED
|
@@ -1047,7 +1047,10 @@ async function downloadTemplates() {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
1049
|
async function downloadTemplatesFromS3(targetDir) {
|
|
1050
|
-
const s3Client = new S3Client({
|
|
1050
|
+
const s3Client = new S3Client({
|
|
1051
|
+
region: 'us-east-1',
|
|
1052
|
+
credentials: false
|
|
1053
|
+
});
|
|
1051
1054
|
const { ListObjectsV2Command, GetObjectCommand } = require('@aws-sdk/client-s3');
|
|
1052
1055
|
|
|
1053
1056
|
const bucket = 'openkbs-downloads';
|
package/templates/CLAUDE.md
CHANGED
|
@@ -95,7 +95,7 @@ The `contentRender.js` file is central to frontend customization, exporting key
|
|
|
95
95
|
- **`onRenderChatMessage(params)`:** function called every time a chat message is rendered.
|
|
96
96
|
|
|
97
97
|
#### OpenKBS commands
|
|
98
|
-
`openkbs push` -
|
|
98
|
+
`openkbs push` - after completing changes to your agent, use this command to deploy it to the OpenKBS cloud.
|
|
99
99
|
`openkbs create my-agent` - creates a directory structure for a new agent
|
|
100
100
|
|
|
101
101
|
### Creating Related Agents
|
|
@@ -67,7 +67,17 @@ class OpenKBSAgentClient {
|
|
|
67
67
|
resolve(key);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
rl._writeToOutput = (str) =>
|
|
70
|
+
rl._writeToOutput = (str) => {
|
|
71
|
+
if (str === '\n' || str === '\r\n') {
|
|
72
|
+
rl.output.write(str);
|
|
73
|
+
} else if (str.match(/[\x08\x7f]/)) {
|
|
74
|
+
rl.output.write(str);
|
|
75
|
+
} else if (rl.line && str.length === 1) {
|
|
76
|
+
rl.output.write('*');
|
|
77
|
+
} else {
|
|
78
|
+
rl.output.write(str);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
71
81
|
});
|
|
72
82
|
}
|
|
73
83
|
|