openkbs 0.0.84 → 0.0.87
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
package/src/actions.js
CHANGED
|
@@ -616,7 +616,7 @@ async function registerKBAndPush(options) {
|
|
|
616
616
|
|
|
617
617
|
await saveLocalKBData({ ...localKBData, kbId });
|
|
618
618
|
console.log(`KB ${kbId} created!`);
|
|
619
|
-
await pushAction(fs.existsSync(path.join(process.cwd(), 'cache')) ? 'cache' :
|
|
619
|
+
await pushAction(fs.existsSync(path.join(process.cwd(), 'cache')) ? 'cache' : 'origin');
|
|
620
620
|
} catch (error) {
|
|
621
621
|
console.error(`Error during create operation:`, error.message);
|
|
622
622
|
}
|
package/src/utils.js
CHANGED
|
@@ -742,7 +742,7 @@ async function downloadFiles(namespaces, kbId, kbToken, location = 'origin', tar
|
|
|
742
742
|
|
|
743
743
|
await Promise.all(filesToDownload.map(async ({ namespace, file, fileName }) => {
|
|
744
744
|
let fileContent;
|
|
745
|
-
if (location === 'origin') {
|
|
745
|
+
if (location === 'origin' || location === 'cache') {
|
|
746
746
|
const presignedURL = await getPresignedURL(namespace, kbId, fileName, 'getObject', kbToken);
|
|
747
747
|
fileContent = await downloadFile(presignedURL);
|
|
748
748
|
} else {
|
|
@@ -1006,7 +1006,7 @@ async function uploadFiles(namespaces, kbId, kbToken, location = 'origin', targe
|
|
|
1006
1006
|
const uploadPromises = filesToUpload.map(async ({ namespace, filePath, fileName }) => {
|
|
1007
1007
|
const fileContent = await fs.readFile(filePath);
|
|
1008
1008
|
console.log(`Uploading: ${fileName}`);
|
|
1009
|
-
if (location === 'origin') {
|
|
1009
|
+
if (location === 'origin' || location === 'cache') {
|
|
1010
1010
|
const presignedURL = await getPresignedURL(namespace, kbId, fileName, 'putObject', kbToken);
|
|
1011
1011
|
await fetch(presignedURL, { method: 'PUT', body: fileContent });
|
|
1012
1012
|
} else {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
``# OpenKBS Platform Project
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## MANDATORY FIRST STEP (DO NOT SKIP)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**CRITICAL: You MUST load the openkbs skill AT THE VERY START of every session, before doing anything else. No exceptions. Do not skip, defer, or ignore this step.**
|
|
6
|
+
|
|
7
|
+
**Run this first:** `/openkbs`
|
|
8
|
+
|
|
9
|
+
This step is required before any other work begins. If you skip it, your actions may fail or produce incorrect results.
|
|
6
10
|
|
|
7
11
|
## Setup Flow
|
|
8
12
|
|
package/version.json
CHANGED