@probelabs/probe 0.6.0-rc124 → 0.6.0-rc126
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/build/agent/ProbeAgent.js +105 -8
- package/build/agent/hooks/HookManager.js +146 -0
- package/build/agent/hooks/index.js +1 -0
- package/build/agent/index.js +334 -18
- package/build/agent/probeTool.js +20 -4
- package/build/agent/storage/InMemoryStorageAdapter.js +49 -0
- package/build/agent/storage/StorageAdapter.js +51 -0
- package/build/agent/storage/index.js +2 -0
- package/build/index.js +8 -0
- package/cjs/agent/ProbeAgent.cjs +4132 -4285
- package/cjs/index.cjs +4142 -4287
- package/index.d.ts +95 -0
- package/package.json +1 -1
- package/src/agent/ProbeAgent.js +105 -8
- package/src/agent/hooks/HookManager.js +146 -0
- package/src/agent/hooks/index.js +1 -0
- package/src/agent/probeTool.js +20 -4
- package/src/agent/storage/InMemoryStorageAdapter.js +49 -0
- package/src/agent/storage/StorageAdapter.js +51 -0
- package/src/agent/storage/index.js +2 -0
- package/src/index.js +8 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for storage adapters
|
|
3
|
+
* Implement this interface to provide custom storage backends for ProbeAgent history
|
|
4
|
+
*/
|
|
5
|
+
export class StorageAdapter {
|
|
6
|
+
/**
|
|
7
|
+
* Load conversation history for a session
|
|
8
|
+
* @param {string} sessionId - Session identifier
|
|
9
|
+
* @returns {Promise<Array<Object>>} Array of message objects with {role, content, ...}
|
|
10
|
+
*/
|
|
11
|
+
async loadHistory(sessionId) {
|
|
12
|
+
throw new Error('StorageAdapter.loadHistory() must be implemented by subclass');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Save a message to storage
|
|
17
|
+
* @param {string} sessionId - Session identifier
|
|
18
|
+
* @param {Object} message - Message object { role, content, ... }
|
|
19
|
+
* @returns {Promise<void>}
|
|
20
|
+
*/
|
|
21
|
+
async saveMessage(sessionId, message) {
|
|
22
|
+
throw new Error('StorageAdapter.saveMessage() must be implemented by subclass');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Clear history for a session
|
|
27
|
+
* @param {string} sessionId - Session identifier
|
|
28
|
+
* @returns {Promise<void>}
|
|
29
|
+
*/
|
|
30
|
+
async clearHistory(sessionId) {
|
|
31
|
+
throw new Error('StorageAdapter.clearHistory() must be implemented by subclass');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get session metadata (optional)
|
|
36
|
+
* @param {string} sessionId - Session identifier
|
|
37
|
+
* @returns {Promise<Object|null>} Session metadata or null
|
|
38
|
+
*/
|
|
39
|
+
async getSessionMetadata(sessionId) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update session activity timestamp (optional)
|
|
45
|
+
* @param {string} sessionId - Session identifier
|
|
46
|
+
* @returns {Promise<void>}
|
|
47
|
+
*/
|
|
48
|
+
async updateSessionActivity(sessionId) {
|
|
49
|
+
// Optional - implement if you want to track session activity
|
|
50
|
+
}
|
|
51
|
+
}
|
package/build/index.js
CHANGED
|
@@ -36,6 +36,8 @@ import { bashTool } from './tools/bash.js';
|
|
|
36
36
|
import { ProbeAgent } from './agent/ProbeAgent.js';
|
|
37
37
|
import { SimpleTelemetry, SimpleAppTracer, initializeSimpleTelemetryFromOptions } from './agent/simpleTelemetry.js';
|
|
38
38
|
import { listFilesToolInstance, searchFilesToolInstance } from './agent/probeTool.js';
|
|
39
|
+
import { StorageAdapter, InMemoryStorageAdapter } from './agent/storage/index.js';
|
|
40
|
+
import { HookManager, HOOK_TYPES } from './agent/hooks/index.js';
|
|
39
41
|
|
|
40
42
|
export {
|
|
41
43
|
search,
|
|
@@ -50,6 +52,12 @@ export {
|
|
|
50
52
|
DEFAULT_SYSTEM_MESSAGE,
|
|
51
53
|
// Export AI Agent (NEW!)
|
|
52
54
|
ProbeAgent,
|
|
55
|
+
// Export storage adapters
|
|
56
|
+
StorageAdapter,
|
|
57
|
+
InMemoryStorageAdapter,
|
|
58
|
+
// Export hooks
|
|
59
|
+
HookManager,
|
|
60
|
+
HOOK_TYPES,
|
|
53
61
|
// Export telemetry classes
|
|
54
62
|
SimpleTelemetry,
|
|
55
63
|
SimpleAppTracer,
|