openclaw-storage-plugin 0.1.1 → 0.1.3
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/index.ts +8 -2
- package/openclaw.plugin.json +9 -0
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QAwDxC"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,16 @@ import os from "node:os";
|
|
|
5
5
|
* Enables UHRP hash-based storage for agent data.
|
|
6
6
|
*/
|
|
7
7
|
export default function register(api) {
|
|
8
|
-
const
|
|
8
|
+
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
9
|
+
const entry = entries['openclaw-storage']
|
|
10
|
+
|| entries['openclaw-storage-plugin']
|
|
11
|
+
|| entries['bsv-storage']
|
|
12
|
+
|| {};
|
|
9
13
|
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
10
14
|
const storageHost = pluginConfig.storageHost || 'https://storage.bsv.direct';
|
|
15
|
+
const network = pluginConfig.network || 'mainnet';
|
|
11
16
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
12
|
-
api.logger.info(`[storage] Initializing Storage Plugin (host: ${storageHost})`);
|
|
17
|
+
api.logger.info(`[storage] Initializing Storage Plugin (network: ${network}, host: ${storageHost})`);
|
|
13
18
|
// Register the storage tool
|
|
14
19
|
api.registerTool({
|
|
15
20
|
name: "storage",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAQ;IACvC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAQ;IACvC,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC;WACpC,OAAO,CAAC,yBAAyB,CAAC;WAClC,OAAO,CAAC,aAAa,CAAC;WACtB,EAAE,CAAC;IAER,MAAM,YAAY,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAClF,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,IAAI,4BAA4B,CAAC;IAC7E,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC;IAClD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAE/F,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,mDAAmD,OAAO,WAAW,WAAW,GAAG,CAAC,CAAC;IAErG,4BAA4B;IAC5B,GAAG,CAAC,YAAY,CAAC;QACf,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,+CAA+C;QAC5D,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC;oBAC9C,WAAW,EAAE,mBAAmB;iBACjC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mBAAmB;iBACjC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACrC;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;QACD,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,MAAW;YACpC,IAAI,CAAC;gBACH,qEAAqE;gBACrE,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,mBAAmB,MAAM,CAAC,MAAM,4CAA4C;yBACnF,CAAC;iBACH,CAAC;YACJ,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,UAAU,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;yBACjD,CAAC;iBACH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/index.ts
CHANGED
|
@@ -6,12 +6,18 @@ import os from "node:os";
|
|
|
6
6
|
* Enables UHRP hash-based storage for agent data.
|
|
7
7
|
*/
|
|
8
8
|
export default function register(api: any) {
|
|
9
|
-
const
|
|
9
|
+
const entries = api.getConfig?.()?.plugins?.entries || {};
|
|
10
|
+
const entry = entries['openclaw-storage']
|
|
11
|
+
|| entries['openclaw-storage-plugin']
|
|
12
|
+
|| entries['bsv-storage']
|
|
13
|
+
|| {};
|
|
14
|
+
|
|
10
15
|
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
11
16
|
const storageHost = pluginConfig.storageHost || 'https://storage.bsv.direct';
|
|
17
|
+
const network = pluginConfig.network || 'mainnet';
|
|
12
18
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
13
19
|
|
|
14
|
-
api.logger.info(`[storage] Initializing Storage Plugin (host: ${storageHost})`);
|
|
20
|
+
api.logger.info(`[storage] Initializing Storage Plugin (network: ${network}, host: ${storageHost})`);
|
|
15
21
|
|
|
16
22
|
// Register the storage tool
|
|
17
23
|
api.registerTool({
|
package/openclaw.plugin.json
CHANGED
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
"default": "https://storage.bsv.direct",
|
|
16
16
|
"description": "Preferred UHRP storage host URL"
|
|
17
17
|
},
|
|
18
|
+
"network": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["mainnet", "testnet"],
|
|
21
|
+
"default": "mainnet",
|
|
22
|
+
"description": "BSV network to use"
|
|
23
|
+
},
|
|
18
24
|
"walletDir": {
|
|
19
25
|
"type": "string",
|
|
20
26
|
"description": "Path to BSV wallet storage (defaults to ~/.openclaw/bsv-wallet)"
|
|
@@ -25,6 +31,9 @@
|
|
|
25
31
|
"storageHost": {
|
|
26
32
|
"label": "Storage Host",
|
|
27
33
|
"placeholder": "https://storage.bsv.direct"
|
|
34
|
+
},
|
|
35
|
+
"network": {
|
|
36
|
+
"label": "BSV Network"
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
39
|
}
|