@myagentroam/node 0.10.4 → 0.10.5
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.
|
@@ -27,28 +27,16 @@ export class ConversationHostingMaintenanceService {
|
|
|
27
27
|
}
|
|
28
28
|
async storageCapacity() {
|
|
29
29
|
const measuredAt = this.now();
|
|
30
|
-
const filesystem = await this.
|
|
31
|
-
assertFilesystemCapacity(filesystem);
|
|
32
|
-
const usedBytes = filesystem.totalBytes - filesystem.availableBytes;
|
|
33
|
-
const filesystemUsageBasisPoints = Number((BigInt(usedBytes) * 10000n) / BigInt(filesystem.totalBytes));
|
|
34
|
-
const capacity = filesystemUsageBasisPoints >= 9_500
|
|
35
|
-
? 'FULL'
|
|
36
|
-
: filesystemUsageBasisPoints >= 8_500
|
|
37
|
-
? 'HIGH'
|
|
38
|
-
: 'AVAILABLE';
|
|
30
|
+
const filesystem = await this.filesystemStorageCapacity();
|
|
39
31
|
return conversationHostingStorageCapacitySchema.parse({
|
|
32
|
+
...filesystem,
|
|
40
33
|
hostedStorageUsedBytes: await this.options.store.hostedStorageUsedBytes(),
|
|
41
|
-
filesystemTotalBytes: filesystem.totalBytes,
|
|
42
|
-
filesystemAvailableBytes: filesystem.availableBytes,
|
|
43
|
-
filesystemUsageBasisPoints,
|
|
44
|
-
capacity,
|
|
45
|
-
acceptsNewConversations: capacity !== 'FULL',
|
|
46
34
|
automaticCleanupInactiveDays: this.options.inactiveRetentionDays,
|
|
47
35
|
measuredAt
|
|
48
36
|
});
|
|
49
37
|
}
|
|
50
38
|
async assertCanCreate() {
|
|
51
|
-
if ((await this.
|
|
39
|
+
if (!(await this.filesystemStorageCapacity()).acceptsNewConversations)
|
|
52
40
|
throw new Error('CONVERSATION_HOSTING_STORAGE_FULL');
|
|
53
41
|
}
|
|
54
42
|
async runAutomaticCleanup() {
|
|
@@ -73,6 +61,24 @@ export class ConversationHostingMaintenanceService {
|
|
|
73
61
|
this.automaticCleanupTimer = undefined;
|
|
74
62
|
return this.pendingCleanupCount === 0 ? undefined : this.cleanupTail;
|
|
75
63
|
}
|
|
64
|
+
async filesystemStorageCapacity() {
|
|
65
|
+
const filesystem = await this.filesystemCapacity();
|
|
66
|
+
assertFilesystemCapacity(filesystem);
|
|
67
|
+
const usedBytes = filesystem.totalBytes - filesystem.availableBytes;
|
|
68
|
+
const filesystemUsageBasisPoints = Number((BigInt(usedBytes) * 10000n) / BigInt(filesystem.totalBytes));
|
|
69
|
+
const capacity = filesystemUsageBasisPoints >= 9_500
|
|
70
|
+
? 'FULL'
|
|
71
|
+
: filesystemUsageBasisPoints >= 8_500
|
|
72
|
+
? 'HIGH'
|
|
73
|
+
: 'AVAILABLE';
|
|
74
|
+
return {
|
|
75
|
+
filesystemTotalBytes: filesystem.totalBytes,
|
|
76
|
+
filesystemAvailableBytes: filesystem.availableBytes,
|
|
77
|
+
filesystemUsageBasisPoints,
|
|
78
|
+
capacity,
|
|
79
|
+
acceptsNewConversations: capacity !== 'FULL'
|
|
80
|
+
};
|
|
81
|
+
}
|
|
76
82
|
triggerAutomaticCleanup() {
|
|
77
83
|
void this.runAutomaticCleanup().catch((error) => this.options.onAutomaticCleanupError?.(error));
|
|
78
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myagentroam/node",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "MyAgentRoam Node runtime CLI.",
|
|
5
5
|
"license": "Apache-2.0 AND GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"playwright": "1.62.1",
|
|
38
38
|
"ws": "^8.21.3",
|
|
39
39
|
"zod": "4.4.3",
|
|
40
|
-
"@myagentroam/agent": "0.10.
|
|
40
|
+
"@myagentroam/agent": "0.10.5",
|
|
41
|
+
"@myagentroam/protocol": "0.10.5",
|
|
41
42
|
"@myagentroam/code-navigation": "0.10.1",
|
|
42
|
-
"@myagentroam/marctl": "0.10.1"
|
|
43
|
-
"@myagentroam/protocol": "0.10.4"
|
|
43
|
+
"@myagentroam/marctl": "0.10.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/ws": "^8.18.1"
|