@olane/o-storage 0.7.12-alpha.6 → 0.7.12-alpha.61

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.
@@ -1,7 +1,7 @@
1
1
  import { StorageProviderTool } from './storage-provider.tool.js';
2
2
  import { DEFAULT_CONFIG_PATH, oAddress } from '@olane/o-core';
3
- import fs from 'fs/promises';
4
- import path from 'path';
3
+ import * as fs from 'fs/promises';
4
+ import * as path from 'path';
5
5
  import { STORAGE_PARAMS } from '../methods/storage.methods.js';
6
6
  export class DiskStorageProvider extends StorageProviderTool {
7
7
  constructor(config) {
@@ -1,5 +1,5 @@
1
1
  import { oAddress } from '@olane/o-core';
2
- import fs from 'fs/promises';
2
+ import * as fs from 'fs/promises';
3
3
  import { STORAGE_PARAMS } from '../methods/storage.methods.js';
4
4
  import { DiskStorageProvider } from './disk-storage-provider.tool.js';
5
5
  export class SecureStorageProvider extends DiskStorageProvider {
@@ -1 +1 @@
1
- {"version":3,"file":"storage.tool.d.ts","sourceRoot":"","sources":["../../src/storage.tool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,eAAe;IAS7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAoDlC"}
1
+ {"version":3,"file":"storage.tool.d.ts","sourceRoot":"","sources":["../../src/storage.tool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,eAAe;IAS7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CA0ClC"}
@@ -15,49 +15,42 @@ export class StorageTool extends oLaneTool {
15
15
  }
16
16
  async initialize() {
17
17
  await super.initialize();
18
- let node = new DiskStorageProvider({
19
- name: 'disk',
20
- parent: this.address,
21
- leader: this.leader,
22
- address: new oAddress('o://disk'),
23
- });
24
- await node.start();
25
- this.addChildNode(node);
26
- node = new MemoryStorageProvider({
27
- name: 'memory',
28
- parent: this.address,
29
- leader: this.leader,
30
- address: new oAddress('o://memory'),
31
- });
32
- await node.start();
33
- this.addChildNode(node);
34
- node = new SecureStorageProvider({
35
- name: 'secure',
36
- parent: this.address,
37
- leader: this.leader,
38
- address: new oAddress('o://secure'),
39
- });
40
- await node.start();
41
- this.addChildNode(node);
42
- node = new PlaceholderTool({
43
- name: 'placeholder storage',
44
- parent: this.address,
45
- leader: this.leader,
46
- });
47
- await node.start();
48
- this.addChildNode(node);
49
- // Add OS Config Storage Tool for managing OS instance configurations
50
- // Note: This tool provides a unified interface that delegates to storage providers.
51
- // For Lambda/cloud deployments, use 'supabase' backend (configured in o-network-lambda).
52
- // For local deployments, use 'disk' or 'memory' backend.
53
- node = new OSConfigStorageTool({
54
- name: 'os-config',
55
- parent: this.address,
56
- leader: this.leader,
57
- storageBackend: process.env.OS_CONFIG_STORAGE ||
58
- 'disk',
59
- });
60
- await node.start();
61
- this.addChildNode(node);
18
+ const tools = [
19
+ new DiskStorageProvider({
20
+ name: 'disk',
21
+ parent: this.address,
22
+ leader: this.leader,
23
+ address: new oAddress('o://disk'),
24
+ }),
25
+ new MemoryStorageProvider({
26
+ name: 'memory',
27
+ parent: this.address,
28
+ leader: this.leader,
29
+ address: new oAddress('o://memory'),
30
+ }),
31
+ new SecureStorageProvider({
32
+ name: 'secure',
33
+ parent: this.address,
34
+ leader: this.leader,
35
+ address: new oAddress('o://secure'),
36
+ }),
37
+ new PlaceholderTool({
38
+ name: 'placeholder storage',
39
+ parent: this.address,
40
+ leader: this.leader,
41
+ }),
42
+ new OSConfigStorageTool({
43
+ name: 'os-config',
44
+ parent: this.address,
45
+ leader: this.leader,
46
+ storageBackend: process.env.OS_CONFIG_STORAGE || 'disk',
47
+ }),
48
+ ];
49
+ for (const tool of tools) {
50
+ tool.hookInitializeFinished = () => {
51
+ this.addChildNode(tool);
52
+ };
53
+ await tool.start();
54
+ }
62
55
  }
63
56
  }
@@ -4,7 +4,7 @@ import { oLeaderNode } from '@olane/o-leader';
4
4
  import { IntelligenceTool } from '@olane/o-intelligence';
5
5
  import { StorageTool } from '../src/index.js';
6
6
  import { bigfile } from './data/bigfile.js';
7
- import dotenv from 'dotenv';
7
+ import * as dotenv from 'dotenv';
8
8
  import { oLaneTool } from '@olane/o-lane';
9
9
  dotenv.config();
10
10
  const leader = new oLeaderNode({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-storage",
3
- "version": "0.7.12-alpha.6",
3
+ "version": "0.7.12-alpha.61",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -54,14 +54,14 @@
54
54
  "typescript": "5.4.5"
55
55
  },
56
56
  "dependencies": {
57
- "@olane/o-config": "0.7.12-alpha.5",
58
- "@olane/o-core": "0.7.12-alpha.6",
59
- "@olane/o-lane": "0.7.12-alpha.6",
60
- "@olane/o-node": "0.7.12-alpha.6",
61
- "@olane/o-protocol": "0.7.12-alpha.6",
62
- "@olane/o-tool": "0.7.12-alpha.6",
57
+ "@olane/o-config": "0.7.12-alpha.61",
58
+ "@olane/o-core": "0.7.12-alpha.61",
59
+ "@olane/o-lane": "0.7.12-alpha.61",
60
+ "@olane/o-node": "0.7.12-alpha.61",
61
+ "@olane/o-protocol": "0.7.12-alpha.61",
62
+ "@olane/o-tool": "0.7.12-alpha.61",
63
63
  "debug": "^4.4.1",
64
64
  "dotenv": "^16.5.0"
65
65
  },
66
- "gitHead": "fad0400ec59d38b163bd996d967cd46c6a5a9e0a"
66
+ "gitHead": "358c478df44b742fe83ce096d3e16bf2351815ea"
67
67
  }