@usewhisper/sdk 3.7.0 → 3.9.0
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/index.d.mts +188 -65
- package/index.d.ts +188 -65
- package/index.js +186 -75
- package/index.mjs +186 -75
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -1,3 +1,163 @@
|
|
|
1
|
+
type MemoryKind$1 = "factual" | "preference" | "event" | "relationship" | "opinion" | "goal" | "instruction" | "episodic" | "semantic" | "procedural";
|
|
2
|
+
interface MemoryLatencyBreakdown$1 {
|
|
3
|
+
cache_ms: number;
|
|
4
|
+
embed_ms: number;
|
|
5
|
+
vector_ms: number;
|
|
6
|
+
lexical_ms: number;
|
|
7
|
+
merge_ms: number;
|
|
8
|
+
total_ms: number;
|
|
9
|
+
}
|
|
10
|
+
interface MemorySearchResult {
|
|
11
|
+
memory: {
|
|
12
|
+
id: string;
|
|
13
|
+
content: string;
|
|
14
|
+
type: string;
|
|
15
|
+
entities?: string[];
|
|
16
|
+
confidence?: number;
|
|
17
|
+
version?: number;
|
|
18
|
+
temporal?: {
|
|
19
|
+
document_date?: string | null;
|
|
20
|
+
event_date?: string | null;
|
|
21
|
+
valid_from?: string | null;
|
|
22
|
+
valid_until?: string | null;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
similarity: number;
|
|
26
|
+
relations?: Array<Record<string, unknown>>;
|
|
27
|
+
chunk?: {
|
|
28
|
+
id: string;
|
|
29
|
+
content: string;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface MemorySearchResponse$1 {
|
|
34
|
+
results: MemorySearchResult[];
|
|
35
|
+
count: number;
|
|
36
|
+
query: string;
|
|
37
|
+
trace_id?: string;
|
|
38
|
+
latency_ms?: number;
|
|
39
|
+
latency_breakdown?: MemoryLatencyBreakdown$1;
|
|
40
|
+
fallback?: "vector" | "lexical";
|
|
41
|
+
mode?: "fast" | "balanced" | "quality";
|
|
42
|
+
profile?: "fast" | "balanced" | "quality";
|
|
43
|
+
include_pending?: boolean;
|
|
44
|
+
pending_overlay_count?: number;
|
|
45
|
+
cache_hit?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface MemoryWriteAck$1 {
|
|
48
|
+
success: boolean;
|
|
49
|
+
mode?: "async" | "sync";
|
|
50
|
+
trace_id?: string;
|
|
51
|
+
memory_id?: string;
|
|
52
|
+
job_id?: string;
|
|
53
|
+
status_url?: string;
|
|
54
|
+
accepted_at?: string;
|
|
55
|
+
visibility_sla_ms?: number;
|
|
56
|
+
pending_visibility?: boolean;
|
|
57
|
+
semantic_status?: "pending" | "ready";
|
|
58
|
+
queued?: boolean;
|
|
59
|
+
event_id?: string;
|
|
60
|
+
created?: number;
|
|
61
|
+
errors?: string[];
|
|
62
|
+
}
|
|
63
|
+
type LearnIngestionProfile = "auto" | "repo" | "web_docs" | "pdf_layout" | "video_transcript" | "plain_text";
|
|
64
|
+
type LearnStrategyOverride = "fixed" | "recursive" | "semantic" | "hierarchical" | "adaptive";
|
|
65
|
+
type LearnSourceType = "github" | "web" | "playwright" | "pdf" | "local" | "slack" | "video";
|
|
66
|
+
interface LearnConversationInput {
|
|
67
|
+
mode: "conversation";
|
|
68
|
+
project?: string;
|
|
69
|
+
user_id?: string;
|
|
70
|
+
session_id: string;
|
|
71
|
+
messages: Array<{
|
|
72
|
+
role: string;
|
|
73
|
+
content: string;
|
|
74
|
+
timestamp?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
interface LearnTextInput {
|
|
78
|
+
mode: "text";
|
|
79
|
+
project?: string;
|
|
80
|
+
title: string;
|
|
81
|
+
content: string;
|
|
82
|
+
metadata?: Record<string, unknown>;
|
|
83
|
+
tags?: string[];
|
|
84
|
+
namespace?: string;
|
|
85
|
+
options?: {
|
|
86
|
+
async?: boolean;
|
|
87
|
+
ingestion_profile?: LearnIngestionProfile;
|
|
88
|
+
strategy_override?: LearnStrategyOverride;
|
|
89
|
+
profile_config?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
interface LearnSourceInput {
|
|
93
|
+
mode: "source";
|
|
94
|
+
project?: string;
|
|
95
|
+
type: LearnSourceType;
|
|
96
|
+
name?: string;
|
|
97
|
+
metadata?: Record<string, string>;
|
|
98
|
+
owner?: string;
|
|
99
|
+
repo?: string;
|
|
100
|
+
branch?: string;
|
|
101
|
+
paths?: string[];
|
|
102
|
+
url?: string;
|
|
103
|
+
file_path?: string;
|
|
104
|
+
path?: string;
|
|
105
|
+
channel_ids?: string[];
|
|
106
|
+
since?: string;
|
|
107
|
+
token?: string;
|
|
108
|
+
auth_ref?: string;
|
|
109
|
+
platform?: "youtube" | "loom" | "generic";
|
|
110
|
+
language?: string;
|
|
111
|
+
options?: {
|
|
112
|
+
async?: boolean;
|
|
113
|
+
auto_index?: boolean;
|
|
114
|
+
ingestion_profile?: LearnIngestionProfile;
|
|
115
|
+
strategy_override?: LearnStrategyOverride;
|
|
116
|
+
profile_config?: Record<string, unknown>;
|
|
117
|
+
crawl_depth?: number;
|
|
118
|
+
include_paths?: string[];
|
|
119
|
+
exclude_paths?: string[];
|
|
120
|
+
glob?: string;
|
|
121
|
+
max_files?: number;
|
|
122
|
+
max_pages?: number;
|
|
123
|
+
extract_mode?: "text" | "structured" | "markdown";
|
|
124
|
+
workspace_id?: string;
|
|
125
|
+
allow_stt_fallback?: boolean;
|
|
126
|
+
max_duration_minutes?: number;
|
|
127
|
+
max_chunks?: number;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
type LearnInput = LearnConversationInput | LearnTextInput | LearnSourceInput;
|
|
131
|
+
interface LearnConversationResult {
|
|
132
|
+
success: true;
|
|
133
|
+
mode: "conversation";
|
|
134
|
+
project: string;
|
|
135
|
+
scope_mode: "user_session" | "session_only";
|
|
136
|
+
memories_created: number;
|
|
137
|
+
relations_created: number;
|
|
138
|
+
memories_invalidated: number;
|
|
139
|
+
errors?: string[];
|
|
140
|
+
}
|
|
141
|
+
interface LearnTextResult {
|
|
142
|
+
success: true;
|
|
143
|
+
mode: "text";
|
|
144
|
+
project: string;
|
|
145
|
+
status: "processing" | "completed";
|
|
146
|
+
job_id?: string | null;
|
|
147
|
+
chunks_indexed?: number;
|
|
148
|
+
source_id?: string | null;
|
|
149
|
+
}
|
|
150
|
+
interface LearnSourceResult {
|
|
151
|
+
success: true;
|
|
152
|
+
mode: "source";
|
|
153
|
+
project: string;
|
|
154
|
+
source_id: string;
|
|
155
|
+
status: string;
|
|
156
|
+
job_id?: string | null;
|
|
157
|
+
index_started: boolean;
|
|
158
|
+
}
|
|
159
|
+
type LearnResult = LearnConversationResult | LearnTextResult | LearnSourceResult;
|
|
160
|
+
|
|
1
161
|
/**
|
|
2
162
|
* Whisper - Simple Memory Layer for AI Agents
|
|
3
163
|
*
|
|
@@ -155,6 +315,7 @@ declare class Whisper {
|
|
|
155
315
|
userId?: string;
|
|
156
316
|
sessionId?: string;
|
|
157
317
|
project?: string;
|
|
318
|
+
auto_learn?: boolean;
|
|
158
319
|
}): Promise<{
|
|
159
320
|
success: boolean;
|
|
160
321
|
extracted: number;
|
|
@@ -169,12 +330,14 @@ declare class Whisper {
|
|
|
169
330
|
sessionId?: string;
|
|
170
331
|
project?: string;
|
|
171
332
|
limit?: number;
|
|
333
|
+
auto_learn?: boolean;
|
|
172
334
|
}): Promise<{
|
|
173
335
|
response: string;
|
|
174
336
|
context: string;
|
|
175
337
|
count: number;
|
|
176
338
|
extracted: number;
|
|
177
339
|
}>;
|
|
340
|
+
learn(input: LearnInput): Promise<LearnResult>;
|
|
178
341
|
/**
|
|
179
342
|
* Direct access to WhisperContext for advanced usage
|
|
180
343
|
*/
|
|
@@ -367,69 +530,6 @@ declare class SearchResponseCache<T = unknown> {
|
|
|
367
530
|
private deleteByKey;
|
|
368
531
|
}
|
|
369
532
|
|
|
370
|
-
type MemoryKind$1 = "factual" | "preference" | "event" | "relationship" | "opinion" | "goal" | "instruction" | "episodic" | "semantic" | "procedural";
|
|
371
|
-
interface MemoryLatencyBreakdown$1 {
|
|
372
|
-
cache_ms: number;
|
|
373
|
-
embed_ms: number;
|
|
374
|
-
vector_ms: number;
|
|
375
|
-
lexical_ms: number;
|
|
376
|
-
merge_ms: number;
|
|
377
|
-
total_ms: number;
|
|
378
|
-
}
|
|
379
|
-
interface MemorySearchResult {
|
|
380
|
-
memory: {
|
|
381
|
-
id: string;
|
|
382
|
-
content: string;
|
|
383
|
-
type: string;
|
|
384
|
-
entities?: string[];
|
|
385
|
-
confidence?: number;
|
|
386
|
-
version?: number;
|
|
387
|
-
temporal?: {
|
|
388
|
-
document_date?: string | null;
|
|
389
|
-
event_date?: string | null;
|
|
390
|
-
valid_from?: string | null;
|
|
391
|
-
valid_until?: string | null;
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
|
-
similarity: number;
|
|
395
|
-
relations?: Array<Record<string, unknown>>;
|
|
396
|
-
chunk?: {
|
|
397
|
-
id: string;
|
|
398
|
-
content: string;
|
|
399
|
-
metadata?: Record<string, unknown>;
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
interface MemorySearchResponse$1 {
|
|
403
|
-
results: MemorySearchResult[];
|
|
404
|
-
count: number;
|
|
405
|
-
query: string;
|
|
406
|
-
trace_id?: string;
|
|
407
|
-
latency_ms?: number;
|
|
408
|
-
latency_breakdown?: MemoryLatencyBreakdown$1;
|
|
409
|
-
fallback?: "vector" | "lexical";
|
|
410
|
-
mode?: "fast" | "balanced" | "quality";
|
|
411
|
-
profile?: "fast" | "balanced" | "quality";
|
|
412
|
-
include_pending?: boolean;
|
|
413
|
-
pending_overlay_count?: number;
|
|
414
|
-
cache_hit?: boolean;
|
|
415
|
-
}
|
|
416
|
-
interface MemoryWriteAck$1 {
|
|
417
|
-
success: boolean;
|
|
418
|
-
mode?: "async" | "sync";
|
|
419
|
-
trace_id?: string;
|
|
420
|
-
memory_id?: string;
|
|
421
|
-
job_id?: string;
|
|
422
|
-
status_url?: string;
|
|
423
|
-
accepted_at?: string;
|
|
424
|
-
visibility_sla_ms?: number;
|
|
425
|
-
pending_visibility?: boolean;
|
|
426
|
-
semantic_status?: "pending" | "ready";
|
|
427
|
-
queued?: boolean;
|
|
428
|
-
event_id?: string;
|
|
429
|
-
created?: number;
|
|
430
|
-
errors?: string[];
|
|
431
|
-
}
|
|
432
|
-
|
|
433
533
|
interface MemoryModuleOptions {
|
|
434
534
|
defaultProject?: string;
|
|
435
535
|
cacheEnabled?: boolean;
|
|
@@ -896,8 +996,10 @@ declare class WhisperAgentRuntime {
|
|
|
896
996
|
success: true;
|
|
897
997
|
buffered: true;
|
|
898
998
|
}>;
|
|
999
|
+
private resolveLearningScope;
|
|
899
1000
|
afterTurn(input: TurnInput & {
|
|
900
1001
|
assistantMessage: string;
|
|
1002
|
+
auto_learn?: boolean;
|
|
901
1003
|
}, context?: Partial<AgentRunContext>): Promise<TurnCaptureResult>;
|
|
902
1004
|
flush(reason?: string, context?: Partial<AgentRunContext>): Promise<AgentRuntimeStatus>;
|
|
903
1005
|
status(): AgentRuntimeStatus;
|
|
@@ -1027,6 +1129,7 @@ declare class WhisperClient {
|
|
|
1027
1129
|
memories_invalidated: number;
|
|
1028
1130
|
errors?: string[];
|
|
1029
1131
|
} & MemoryWriteAck$1>;
|
|
1132
|
+
learn(params: LearnInput): Promise<LearnResult>;
|
|
1030
1133
|
createAgentRuntime(options?: AgentRuntimeOptions): WhisperAgentRuntime;
|
|
1031
1134
|
withRunContext(context: RunContext): {
|
|
1032
1135
|
memory: {
|
|
@@ -1051,6 +1154,7 @@ declare class WhisperClient {
|
|
|
1051
1154
|
sequence: number;
|
|
1052
1155
|
}>;
|
|
1053
1156
|
};
|
|
1157
|
+
learn: (params: LearnInput) => Promise<LearnResult>;
|
|
1054
1158
|
queue: {
|
|
1055
1159
|
flush: () => Promise<void>;
|
|
1056
1160
|
status: () => ReturnType<WriteQueue["status"]>;
|
|
@@ -1079,6 +1183,7 @@ interface AgentTurnParams {
|
|
|
1079
1183
|
sessionId?: string;
|
|
1080
1184
|
project?: string;
|
|
1081
1185
|
contextLimit?: number;
|
|
1186
|
+
auto_learn?: boolean;
|
|
1082
1187
|
}
|
|
1083
1188
|
interface AgentTurnResult {
|
|
1084
1189
|
prompt: string;
|
|
@@ -1111,6 +1216,7 @@ declare class WhisperAgentMiddleware {
|
|
|
1111
1216
|
userId?: string;
|
|
1112
1217
|
sessionId?: string;
|
|
1113
1218
|
project?: string;
|
|
1219
|
+
auto_learn?: boolean;
|
|
1114
1220
|
}): Promise<{
|
|
1115
1221
|
success: boolean;
|
|
1116
1222
|
extracted: number;
|
|
@@ -1357,7 +1463,7 @@ interface VideoIngestionStatus {
|
|
|
1357
1463
|
last_error?: string | null;
|
|
1358
1464
|
updated_at?: string;
|
|
1359
1465
|
}
|
|
1360
|
-
type CanonicalSourceType = "github" | "web" | "pdf" | "local" | "slack";
|
|
1466
|
+
type CanonicalSourceType = "github" | "web" | "playwright" | "pdf" | "local" | "slack" | "video";
|
|
1361
1467
|
interface CanonicalSourceCreateParams {
|
|
1362
1468
|
type: CanonicalSourceType;
|
|
1363
1469
|
name?: string;
|
|
@@ -1378,11 +1484,18 @@ interface CanonicalSourceCreateParams {
|
|
|
1378
1484
|
path?: string;
|
|
1379
1485
|
glob?: string;
|
|
1380
1486
|
max_files?: number;
|
|
1487
|
+
max_pages?: number;
|
|
1488
|
+
extract_mode?: "text" | "structured" | "markdown";
|
|
1381
1489
|
workspace_id?: string;
|
|
1382
1490
|
channel_ids?: string[];
|
|
1383
1491
|
since?: string;
|
|
1384
1492
|
token?: string;
|
|
1385
1493
|
auth_ref?: string;
|
|
1494
|
+
platform?: "youtube" | "loom" | "generic";
|
|
1495
|
+
language?: string;
|
|
1496
|
+
allow_stt_fallback?: boolean;
|
|
1497
|
+
max_duration_minutes?: number;
|
|
1498
|
+
max_chunks?: number;
|
|
1386
1499
|
}
|
|
1387
1500
|
interface CanonicalSourceCreateResult {
|
|
1388
1501
|
source_id: string;
|
|
@@ -1600,6 +1713,16 @@ declare class WhisperContext {
|
|
|
1600
1713
|
}): Promise<{
|
|
1601
1714
|
ingested: number;
|
|
1602
1715
|
}>;
|
|
1716
|
+
learn(params: LearnInput): Promise<LearnResult>;
|
|
1717
|
+
listMemories(params: {
|
|
1718
|
+
project?: string;
|
|
1719
|
+
user_id?: string;
|
|
1720
|
+
session_id?: string;
|
|
1721
|
+
agent_id?: string;
|
|
1722
|
+
limit?: number;
|
|
1723
|
+
}): Promise<{
|
|
1724
|
+
memories: any[];
|
|
1725
|
+
}>;
|
|
1603
1726
|
addMemory(params: {
|
|
1604
1727
|
project?: string;
|
|
1605
1728
|
content: string;
|
|
@@ -2136,4 +2259,4 @@ declare class WhisperContext {
|
|
|
2136
2259
|
};
|
|
2137
2260
|
}
|
|
2138
2261
|
|
|
2139
|
-
export { type AgentRunContext, type AgentRuntimeOptions, type AgentRuntimeRankWeights, type AgentRuntimeRetrievalOptions, type AgentRuntimeSourceActivityOptions, type AgentRuntimeStatus, type CanonicalSourceCreateParams, type CanonicalSourceCreateResult, type CanonicalSourceType, type ExtractedMemory, LangChainMemoryAdapter, LangGraphCheckpointAdapter, type Memory, type MemoryExtractionResult, type MemoryKind, type MemoryLatencyBreakdown, type MemorySearchResponse, type MemoryWriteAck, type MemoryWriteResult, type PreparedTurn, type Project, type QueryParams, type QueryResult, type Source, type TurnCaptureResult, type TurnInput, type VideoIngestionStatus, type VideoSourceMetadata, Whisper, WhisperAgentMiddleware, WhisperClient, type WhisperConfig, WhisperContext, Whisper as WhisperDefault, WhisperError, type WhisperErrorCode, WhisperClient as WhisperRuntimeClient, type WorkEvent, type WorkEventKind, type WorkEventSalience, createAgentMiddleware, createLangChainMemoryAdapter, createLangGraphCheckpointAdapter, WhisperContext as default, memoryGraphToMermaid };
|
|
2262
|
+
export { type AgentRunContext, type AgentRuntimeOptions, type AgentRuntimeRankWeights, type AgentRuntimeRetrievalOptions, type AgentRuntimeSourceActivityOptions, type AgentRuntimeStatus, type CanonicalSourceCreateParams, type CanonicalSourceCreateResult, type CanonicalSourceType, type ExtractedMemory, LangChainMemoryAdapter, LangGraphCheckpointAdapter, type LearnConversationInput, type LearnConversationResult, type LearnInput, type LearnResult, type LearnSourceInput, type LearnSourceResult, type LearnSourceType, type LearnTextInput, type LearnTextResult, type Memory, type MemoryExtractionResult, type MemoryKind, type MemoryLatencyBreakdown, type MemorySearchResponse, type MemoryWriteAck, type MemoryWriteResult, type PreparedTurn, type Project, type QueryParams, type QueryResult, type Source, type TurnCaptureResult, type TurnInput, type VideoIngestionStatus, type VideoSourceMetadata, Whisper, WhisperAgentMiddleware, WhisperClient, type WhisperConfig, WhisperContext, Whisper as WhisperDefault, WhisperError, type WhisperErrorCode, WhisperClient as WhisperRuntimeClient, type WorkEvent, type WorkEventKind, type WorkEventSalience, createAgentMiddleware, createLangChainMemoryAdapter, createLangGraphCheckpointAdapter, WhisperContext as default, memoryGraphToMermaid };
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,163 @@
|
|
|
1
|
+
type MemoryKind$1 = "factual" | "preference" | "event" | "relationship" | "opinion" | "goal" | "instruction" | "episodic" | "semantic" | "procedural";
|
|
2
|
+
interface MemoryLatencyBreakdown$1 {
|
|
3
|
+
cache_ms: number;
|
|
4
|
+
embed_ms: number;
|
|
5
|
+
vector_ms: number;
|
|
6
|
+
lexical_ms: number;
|
|
7
|
+
merge_ms: number;
|
|
8
|
+
total_ms: number;
|
|
9
|
+
}
|
|
10
|
+
interface MemorySearchResult {
|
|
11
|
+
memory: {
|
|
12
|
+
id: string;
|
|
13
|
+
content: string;
|
|
14
|
+
type: string;
|
|
15
|
+
entities?: string[];
|
|
16
|
+
confidence?: number;
|
|
17
|
+
version?: number;
|
|
18
|
+
temporal?: {
|
|
19
|
+
document_date?: string | null;
|
|
20
|
+
event_date?: string | null;
|
|
21
|
+
valid_from?: string | null;
|
|
22
|
+
valid_until?: string | null;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
similarity: number;
|
|
26
|
+
relations?: Array<Record<string, unknown>>;
|
|
27
|
+
chunk?: {
|
|
28
|
+
id: string;
|
|
29
|
+
content: string;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
interface MemorySearchResponse$1 {
|
|
34
|
+
results: MemorySearchResult[];
|
|
35
|
+
count: number;
|
|
36
|
+
query: string;
|
|
37
|
+
trace_id?: string;
|
|
38
|
+
latency_ms?: number;
|
|
39
|
+
latency_breakdown?: MemoryLatencyBreakdown$1;
|
|
40
|
+
fallback?: "vector" | "lexical";
|
|
41
|
+
mode?: "fast" | "balanced" | "quality";
|
|
42
|
+
profile?: "fast" | "balanced" | "quality";
|
|
43
|
+
include_pending?: boolean;
|
|
44
|
+
pending_overlay_count?: number;
|
|
45
|
+
cache_hit?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface MemoryWriteAck$1 {
|
|
48
|
+
success: boolean;
|
|
49
|
+
mode?: "async" | "sync";
|
|
50
|
+
trace_id?: string;
|
|
51
|
+
memory_id?: string;
|
|
52
|
+
job_id?: string;
|
|
53
|
+
status_url?: string;
|
|
54
|
+
accepted_at?: string;
|
|
55
|
+
visibility_sla_ms?: number;
|
|
56
|
+
pending_visibility?: boolean;
|
|
57
|
+
semantic_status?: "pending" | "ready";
|
|
58
|
+
queued?: boolean;
|
|
59
|
+
event_id?: string;
|
|
60
|
+
created?: number;
|
|
61
|
+
errors?: string[];
|
|
62
|
+
}
|
|
63
|
+
type LearnIngestionProfile = "auto" | "repo" | "web_docs" | "pdf_layout" | "video_transcript" | "plain_text";
|
|
64
|
+
type LearnStrategyOverride = "fixed" | "recursive" | "semantic" | "hierarchical" | "adaptive";
|
|
65
|
+
type LearnSourceType = "github" | "web" | "playwright" | "pdf" | "local" | "slack" | "video";
|
|
66
|
+
interface LearnConversationInput {
|
|
67
|
+
mode: "conversation";
|
|
68
|
+
project?: string;
|
|
69
|
+
user_id?: string;
|
|
70
|
+
session_id: string;
|
|
71
|
+
messages: Array<{
|
|
72
|
+
role: string;
|
|
73
|
+
content: string;
|
|
74
|
+
timestamp?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
interface LearnTextInput {
|
|
78
|
+
mode: "text";
|
|
79
|
+
project?: string;
|
|
80
|
+
title: string;
|
|
81
|
+
content: string;
|
|
82
|
+
metadata?: Record<string, unknown>;
|
|
83
|
+
tags?: string[];
|
|
84
|
+
namespace?: string;
|
|
85
|
+
options?: {
|
|
86
|
+
async?: boolean;
|
|
87
|
+
ingestion_profile?: LearnIngestionProfile;
|
|
88
|
+
strategy_override?: LearnStrategyOverride;
|
|
89
|
+
profile_config?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
interface LearnSourceInput {
|
|
93
|
+
mode: "source";
|
|
94
|
+
project?: string;
|
|
95
|
+
type: LearnSourceType;
|
|
96
|
+
name?: string;
|
|
97
|
+
metadata?: Record<string, string>;
|
|
98
|
+
owner?: string;
|
|
99
|
+
repo?: string;
|
|
100
|
+
branch?: string;
|
|
101
|
+
paths?: string[];
|
|
102
|
+
url?: string;
|
|
103
|
+
file_path?: string;
|
|
104
|
+
path?: string;
|
|
105
|
+
channel_ids?: string[];
|
|
106
|
+
since?: string;
|
|
107
|
+
token?: string;
|
|
108
|
+
auth_ref?: string;
|
|
109
|
+
platform?: "youtube" | "loom" | "generic";
|
|
110
|
+
language?: string;
|
|
111
|
+
options?: {
|
|
112
|
+
async?: boolean;
|
|
113
|
+
auto_index?: boolean;
|
|
114
|
+
ingestion_profile?: LearnIngestionProfile;
|
|
115
|
+
strategy_override?: LearnStrategyOverride;
|
|
116
|
+
profile_config?: Record<string, unknown>;
|
|
117
|
+
crawl_depth?: number;
|
|
118
|
+
include_paths?: string[];
|
|
119
|
+
exclude_paths?: string[];
|
|
120
|
+
glob?: string;
|
|
121
|
+
max_files?: number;
|
|
122
|
+
max_pages?: number;
|
|
123
|
+
extract_mode?: "text" | "structured" | "markdown";
|
|
124
|
+
workspace_id?: string;
|
|
125
|
+
allow_stt_fallback?: boolean;
|
|
126
|
+
max_duration_minutes?: number;
|
|
127
|
+
max_chunks?: number;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
type LearnInput = LearnConversationInput | LearnTextInput | LearnSourceInput;
|
|
131
|
+
interface LearnConversationResult {
|
|
132
|
+
success: true;
|
|
133
|
+
mode: "conversation";
|
|
134
|
+
project: string;
|
|
135
|
+
scope_mode: "user_session" | "session_only";
|
|
136
|
+
memories_created: number;
|
|
137
|
+
relations_created: number;
|
|
138
|
+
memories_invalidated: number;
|
|
139
|
+
errors?: string[];
|
|
140
|
+
}
|
|
141
|
+
interface LearnTextResult {
|
|
142
|
+
success: true;
|
|
143
|
+
mode: "text";
|
|
144
|
+
project: string;
|
|
145
|
+
status: "processing" | "completed";
|
|
146
|
+
job_id?: string | null;
|
|
147
|
+
chunks_indexed?: number;
|
|
148
|
+
source_id?: string | null;
|
|
149
|
+
}
|
|
150
|
+
interface LearnSourceResult {
|
|
151
|
+
success: true;
|
|
152
|
+
mode: "source";
|
|
153
|
+
project: string;
|
|
154
|
+
source_id: string;
|
|
155
|
+
status: string;
|
|
156
|
+
job_id?: string | null;
|
|
157
|
+
index_started: boolean;
|
|
158
|
+
}
|
|
159
|
+
type LearnResult = LearnConversationResult | LearnTextResult | LearnSourceResult;
|
|
160
|
+
|
|
1
161
|
/**
|
|
2
162
|
* Whisper - Simple Memory Layer for AI Agents
|
|
3
163
|
*
|
|
@@ -155,6 +315,7 @@ declare class Whisper {
|
|
|
155
315
|
userId?: string;
|
|
156
316
|
sessionId?: string;
|
|
157
317
|
project?: string;
|
|
318
|
+
auto_learn?: boolean;
|
|
158
319
|
}): Promise<{
|
|
159
320
|
success: boolean;
|
|
160
321
|
extracted: number;
|
|
@@ -169,12 +330,14 @@ declare class Whisper {
|
|
|
169
330
|
sessionId?: string;
|
|
170
331
|
project?: string;
|
|
171
332
|
limit?: number;
|
|
333
|
+
auto_learn?: boolean;
|
|
172
334
|
}): Promise<{
|
|
173
335
|
response: string;
|
|
174
336
|
context: string;
|
|
175
337
|
count: number;
|
|
176
338
|
extracted: number;
|
|
177
339
|
}>;
|
|
340
|
+
learn(input: LearnInput): Promise<LearnResult>;
|
|
178
341
|
/**
|
|
179
342
|
* Direct access to WhisperContext for advanced usage
|
|
180
343
|
*/
|
|
@@ -367,69 +530,6 @@ declare class SearchResponseCache<T = unknown> {
|
|
|
367
530
|
private deleteByKey;
|
|
368
531
|
}
|
|
369
532
|
|
|
370
|
-
type MemoryKind$1 = "factual" | "preference" | "event" | "relationship" | "opinion" | "goal" | "instruction" | "episodic" | "semantic" | "procedural";
|
|
371
|
-
interface MemoryLatencyBreakdown$1 {
|
|
372
|
-
cache_ms: number;
|
|
373
|
-
embed_ms: number;
|
|
374
|
-
vector_ms: number;
|
|
375
|
-
lexical_ms: number;
|
|
376
|
-
merge_ms: number;
|
|
377
|
-
total_ms: number;
|
|
378
|
-
}
|
|
379
|
-
interface MemorySearchResult {
|
|
380
|
-
memory: {
|
|
381
|
-
id: string;
|
|
382
|
-
content: string;
|
|
383
|
-
type: string;
|
|
384
|
-
entities?: string[];
|
|
385
|
-
confidence?: number;
|
|
386
|
-
version?: number;
|
|
387
|
-
temporal?: {
|
|
388
|
-
document_date?: string | null;
|
|
389
|
-
event_date?: string | null;
|
|
390
|
-
valid_from?: string | null;
|
|
391
|
-
valid_until?: string | null;
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
|
-
similarity: number;
|
|
395
|
-
relations?: Array<Record<string, unknown>>;
|
|
396
|
-
chunk?: {
|
|
397
|
-
id: string;
|
|
398
|
-
content: string;
|
|
399
|
-
metadata?: Record<string, unknown>;
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
interface MemorySearchResponse$1 {
|
|
403
|
-
results: MemorySearchResult[];
|
|
404
|
-
count: number;
|
|
405
|
-
query: string;
|
|
406
|
-
trace_id?: string;
|
|
407
|
-
latency_ms?: number;
|
|
408
|
-
latency_breakdown?: MemoryLatencyBreakdown$1;
|
|
409
|
-
fallback?: "vector" | "lexical";
|
|
410
|
-
mode?: "fast" | "balanced" | "quality";
|
|
411
|
-
profile?: "fast" | "balanced" | "quality";
|
|
412
|
-
include_pending?: boolean;
|
|
413
|
-
pending_overlay_count?: number;
|
|
414
|
-
cache_hit?: boolean;
|
|
415
|
-
}
|
|
416
|
-
interface MemoryWriteAck$1 {
|
|
417
|
-
success: boolean;
|
|
418
|
-
mode?: "async" | "sync";
|
|
419
|
-
trace_id?: string;
|
|
420
|
-
memory_id?: string;
|
|
421
|
-
job_id?: string;
|
|
422
|
-
status_url?: string;
|
|
423
|
-
accepted_at?: string;
|
|
424
|
-
visibility_sla_ms?: number;
|
|
425
|
-
pending_visibility?: boolean;
|
|
426
|
-
semantic_status?: "pending" | "ready";
|
|
427
|
-
queued?: boolean;
|
|
428
|
-
event_id?: string;
|
|
429
|
-
created?: number;
|
|
430
|
-
errors?: string[];
|
|
431
|
-
}
|
|
432
|
-
|
|
433
533
|
interface MemoryModuleOptions {
|
|
434
534
|
defaultProject?: string;
|
|
435
535
|
cacheEnabled?: boolean;
|
|
@@ -896,8 +996,10 @@ declare class WhisperAgentRuntime {
|
|
|
896
996
|
success: true;
|
|
897
997
|
buffered: true;
|
|
898
998
|
}>;
|
|
999
|
+
private resolveLearningScope;
|
|
899
1000
|
afterTurn(input: TurnInput & {
|
|
900
1001
|
assistantMessage: string;
|
|
1002
|
+
auto_learn?: boolean;
|
|
901
1003
|
}, context?: Partial<AgentRunContext>): Promise<TurnCaptureResult>;
|
|
902
1004
|
flush(reason?: string, context?: Partial<AgentRunContext>): Promise<AgentRuntimeStatus>;
|
|
903
1005
|
status(): AgentRuntimeStatus;
|
|
@@ -1027,6 +1129,7 @@ declare class WhisperClient {
|
|
|
1027
1129
|
memories_invalidated: number;
|
|
1028
1130
|
errors?: string[];
|
|
1029
1131
|
} & MemoryWriteAck$1>;
|
|
1132
|
+
learn(params: LearnInput): Promise<LearnResult>;
|
|
1030
1133
|
createAgentRuntime(options?: AgentRuntimeOptions): WhisperAgentRuntime;
|
|
1031
1134
|
withRunContext(context: RunContext): {
|
|
1032
1135
|
memory: {
|
|
@@ -1051,6 +1154,7 @@ declare class WhisperClient {
|
|
|
1051
1154
|
sequence: number;
|
|
1052
1155
|
}>;
|
|
1053
1156
|
};
|
|
1157
|
+
learn: (params: LearnInput) => Promise<LearnResult>;
|
|
1054
1158
|
queue: {
|
|
1055
1159
|
flush: () => Promise<void>;
|
|
1056
1160
|
status: () => ReturnType<WriteQueue["status"]>;
|
|
@@ -1079,6 +1183,7 @@ interface AgentTurnParams {
|
|
|
1079
1183
|
sessionId?: string;
|
|
1080
1184
|
project?: string;
|
|
1081
1185
|
contextLimit?: number;
|
|
1186
|
+
auto_learn?: boolean;
|
|
1082
1187
|
}
|
|
1083
1188
|
interface AgentTurnResult {
|
|
1084
1189
|
prompt: string;
|
|
@@ -1111,6 +1216,7 @@ declare class WhisperAgentMiddleware {
|
|
|
1111
1216
|
userId?: string;
|
|
1112
1217
|
sessionId?: string;
|
|
1113
1218
|
project?: string;
|
|
1219
|
+
auto_learn?: boolean;
|
|
1114
1220
|
}): Promise<{
|
|
1115
1221
|
success: boolean;
|
|
1116
1222
|
extracted: number;
|
|
@@ -1357,7 +1463,7 @@ interface VideoIngestionStatus {
|
|
|
1357
1463
|
last_error?: string | null;
|
|
1358
1464
|
updated_at?: string;
|
|
1359
1465
|
}
|
|
1360
|
-
type CanonicalSourceType = "github" | "web" | "pdf" | "local" | "slack";
|
|
1466
|
+
type CanonicalSourceType = "github" | "web" | "playwright" | "pdf" | "local" | "slack" | "video";
|
|
1361
1467
|
interface CanonicalSourceCreateParams {
|
|
1362
1468
|
type: CanonicalSourceType;
|
|
1363
1469
|
name?: string;
|
|
@@ -1378,11 +1484,18 @@ interface CanonicalSourceCreateParams {
|
|
|
1378
1484
|
path?: string;
|
|
1379
1485
|
glob?: string;
|
|
1380
1486
|
max_files?: number;
|
|
1487
|
+
max_pages?: number;
|
|
1488
|
+
extract_mode?: "text" | "structured" | "markdown";
|
|
1381
1489
|
workspace_id?: string;
|
|
1382
1490
|
channel_ids?: string[];
|
|
1383
1491
|
since?: string;
|
|
1384
1492
|
token?: string;
|
|
1385
1493
|
auth_ref?: string;
|
|
1494
|
+
platform?: "youtube" | "loom" | "generic";
|
|
1495
|
+
language?: string;
|
|
1496
|
+
allow_stt_fallback?: boolean;
|
|
1497
|
+
max_duration_minutes?: number;
|
|
1498
|
+
max_chunks?: number;
|
|
1386
1499
|
}
|
|
1387
1500
|
interface CanonicalSourceCreateResult {
|
|
1388
1501
|
source_id: string;
|
|
@@ -1600,6 +1713,16 @@ declare class WhisperContext {
|
|
|
1600
1713
|
}): Promise<{
|
|
1601
1714
|
ingested: number;
|
|
1602
1715
|
}>;
|
|
1716
|
+
learn(params: LearnInput): Promise<LearnResult>;
|
|
1717
|
+
listMemories(params: {
|
|
1718
|
+
project?: string;
|
|
1719
|
+
user_id?: string;
|
|
1720
|
+
session_id?: string;
|
|
1721
|
+
agent_id?: string;
|
|
1722
|
+
limit?: number;
|
|
1723
|
+
}): Promise<{
|
|
1724
|
+
memories: any[];
|
|
1725
|
+
}>;
|
|
1603
1726
|
addMemory(params: {
|
|
1604
1727
|
project?: string;
|
|
1605
1728
|
content: string;
|
|
@@ -2136,4 +2259,4 @@ declare class WhisperContext {
|
|
|
2136
2259
|
};
|
|
2137
2260
|
}
|
|
2138
2261
|
|
|
2139
|
-
export { type AgentRunContext, type AgentRuntimeOptions, type AgentRuntimeRankWeights, type AgentRuntimeRetrievalOptions, type AgentRuntimeSourceActivityOptions, type AgentRuntimeStatus, type CanonicalSourceCreateParams, type CanonicalSourceCreateResult, type CanonicalSourceType, type ExtractedMemory, LangChainMemoryAdapter, LangGraphCheckpointAdapter, type Memory, type MemoryExtractionResult, type MemoryKind, type MemoryLatencyBreakdown, type MemorySearchResponse, type MemoryWriteAck, type MemoryWriteResult, type PreparedTurn, type Project, type QueryParams, type QueryResult, type Source, type TurnCaptureResult, type TurnInput, type VideoIngestionStatus, type VideoSourceMetadata, Whisper, WhisperAgentMiddleware, WhisperClient, type WhisperConfig, WhisperContext, Whisper as WhisperDefault, WhisperError, type WhisperErrorCode, WhisperClient as WhisperRuntimeClient, type WorkEvent, type WorkEventKind, type WorkEventSalience, createAgentMiddleware, createLangChainMemoryAdapter, createLangGraphCheckpointAdapter, WhisperContext as default, memoryGraphToMermaid };
|
|
2262
|
+
export { type AgentRunContext, type AgentRuntimeOptions, type AgentRuntimeRankWeights, type AgentRuntimeRetrievalOptions, type AgentRuntimeSourceActivityOptions, type AgentRuntimeStatus, type CanonicalSourceCreateParams, type CanonicalSourceCreateResult, type CanonicalSourceType, type ExtractedMemory, LangChainMemoryAdapter, LangGraphCheckpointAdapter, type LearnConversationInput, type LearnConversationResult, type LearnInput, type LearnResult, type LearnSourceInput, type LearnSourceResult, type LearnSourceType, type LearnTextInput, type LearnTextResult, type Memory, type MemoryExtractionResult, type MemoryKind, type MemoryLatencyBreakdown, type MemorySearchResponse, type MemoryWriteAck, type MemoryWriteResult, type PreparedTurn, type Project, type QueryParams, type QueryResult, type Source, type TurnCaptureResult, type TurnInput, type VideoIngestionStatus, type VideoSourceMetadata, Whisper, WhisperAgentMiddleware, WhisperClient, type WhisperConfig, WhisperContext, Whisper as WhisperDefault, WhisperError, type WhisperErrorCode, WhisperClient as WhisperRuntimeClient, type WorkEvent, type WorkEventKind, type WorkEventSalience, createAgentMiddleware, createLangChainMemoryAdapter, createLangGraphCheckpointAdapter, WhisperContext as default, memoryGraphToMermaid };
|