@handsforbots/memory 0.0.0-stage → 2.0.0-alpha.1
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/LICENSE.md +9 -0
- package/README.md +20 -2
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +227 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2024 Alex Lana and Hands for Bots contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @handsforbots/memory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Plugin. Hands for Bots memory policy: how many turns are sent and kept, and compaction of older turns. Mounted by default by @handsforbots/core.
|
|
4
|
+
|
|
5
|
+
Part of [Hands for Bots](https://github.com/handsforbots/handsforbots), a headless multimodal and action layer between users, GUIs and agents.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @handsforbots/memory@alpha @handsforbots/core@alpha
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Documentation
|
|
14
|
+
|
|
15
|
+
- [This package](https://github.com/handsforbots/handsforbots/blob/main/docs/en-us/plugins.md#memory)
|
|
16
|
+
- [Getting started](https://github.com/handsforbots/handsforbots/blob/main/docs/en-us/getting-started.md)
|
|
17
|
+
- [Documentação em português](https://github.com/handsforbots/handsforbots/blob/main/docs/pt-br/README.md)
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Message, Plugin, TurnRequest } from '@handsforbots/core';
|
|
2
|
+
/**
|
|
3
|
+
* Summarizes turns that left the window. Receives the previous summary and
|
|
4
|
+
* the turns to fold in (oldest first); returns the new summary.
|
|
5
|
+
*/
|
|
6
|
+
export type Summarizer = (input: {
|
|
7
|
+
previous?: string;
|
|
8
|
+
turns: Message[][];
|
|
9
|
+
}) => string | Promise<string>;
|
|
10
|
+
export type MemoryOptions = {
|
|
11
|
+
/** Turns sent to the assistant with each request: a number, 'all', or 'none' (only the current turn; the backend remembers). Default 20. */
|
|
12
|
+
send?: number | 'all' | 'none';
|
|
13
|
+
/** Turns kept in the history (and so in storage). Never fewer than `send`. Default 100; 'all' keeps everything. */
|
|
14
|
+
keep?: number | 'all';
|
|
15
|
+
/**
|
|
16
|
+
* Turns that leave the `send` window are folded into a summary sent as the
|
|
17
|
+
* context signal `memory.summary`. 'local' (default) builds it without an
|
|
18
|
+
* LLM; pass a `Summarizer` (e.g. `httpSummarizer`) to use one; false drops them.
|
|
19
|
+
*/
|
|
20
|
+
compact?: 'local' | false | Summarizer;
|
|
21
|
+
/** Maximum summary length in characters (oldest lines go first). Default 4000. */
|
|
22
|
+
maxSummaryChars?: number;
|
|
23
|
+
};
|
|
24
|
+
/** Stored in `SessionSnapshot.memory`. */
|
|
25
|
+
export type MemoryState = {
|
|
26
|
+
summary?: string;
|
|
27
|
+
/** Id of the last message folded into the summary. */
|
|
28
|
+
through?: string;
|
|
29
|
+
};
|
|
30
|
+
/** The `memory` service. */
|
|
31
|
+
export type MemoryControl = {
|
|
32
|
+
readonly options: Readonly<Required<Omit<MemoryOptions, 'compact'>>> & {
|
|
33
|
+
compact: MemoryOptions['compact'];
|
|
34
|
+
};
|
|
35
|
+
/** Summary of the turns that left the window, if any. */
|
|
36
|
+
readonly summary: string | undefined;
|
|
37
|
+
/** The messages and context that would be sent for a request. */
|
|
38
|
+
view(request: TurnRequest): TurnRequest;
|
|
39
|
+
/** Compacts and trims now (it also runs after every job). */
|
|
40
|
+
maintain(): Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
declare module '@handsforbots/core' {
|
|
43
|
+
interface Services {
|
|
44
|
+
memory: MemoryControl;
|
|
45
|
+
}
|
|
46
|
+
interface Events {
|
|
47
|
+
/** The memory summary changed or old turns were removed. */
|
|
48
|
+
'memory.changed': {
|
|
49
|
+
summary?: string;
|
|
50
|
+
removed: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** The memory plugin. `@handsforbots/core` mounts `memory()` unless you pass your own or `createH4B({ memory: false })`. */
|
|
55
|
+
export declare function memory(options?: MemoryOptions): Plugin<MemoryOptions | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Turns, oldest first: messages grouped by `turnId` (the job that added them).
|
|
58
|
+
* Messages saved before `turnId` existed start a turn at each user message.
|
|
59
|
+
*/
|
|
60
|
+
export declare function groupTurns(messages: Message[]): Message[][];
|
|
61
|
+
/** A summary without an LLM: one line per message, actions with their outcome. */
|
|
62
|
+
export declare function localSummary(previous: string | undefined, turns: Message[][]): string;
|
|
63
|
+
export type HttpSummarizerOptions = {
|
|
64
|
+
/** Your endpoint: receives `{ previous, messages }` and answers `{ summary }`. */
|
|
65
|
+
url: string;
|
|
66
|
+
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
67
|
+
credentials?: RequestCredentials;
|
|
68
|
+
fetch?: typeof fetch;
|
|
69
|
+
};
|
|
70
|
+
/** A `Summarizer` that asks your backend (which calls an LLM with its own keys). */
|
|
71
|
+
export declare function httpSummarizer(options: HttpSummarizerOptions): Summarizer;
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAA4B,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhG;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAA;CAAE,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEvG,MAAM,MAAM,aAAa,GAAG;IAC1B,4IAA4I;IAC5I,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;IAC9B,mHAAmH;IACnH,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,CAAA;IACtC,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,4BAA4B;AAC5B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,OA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AA;IAChC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB,CAAA;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,UAAU,CAezE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
const SUMMARY_KEY = 'memory.summary';
|
|
2
|
+
const definition = {
|
|
3
|
+
name: 'memory',
|
|
4
|
+
provides: ['memory'],
|
|
5
|
+
apply(ctx, options = {}) {
|
|
6
|
+
const send = typeof options.send === 'number' ? Math.max(1, Math.floor(options.send)) : (options.send ?? 20);
|
|
7
|
+
const keepOption = options.keep ?? 100;
|
|
8
|
+
const keep = keepOption === 'all' || typeof send !== 'number' ? keepOption : Math.max(keepOption, send);
|
|
9
|
+
const compact = options.compact ?? 'local';
|
|
10
|
+
const maxChars = options.maxSummaryChars ?? 4000;
|
|
11
|
+
const conversation = ctx.app.conversation;
|
|
12
|
+
const state = () => conversation.memory ?? {};
|
|
13
|
+
const view = (request) => {
|
|
14
|
+
const { summary, through } = state();
|
|
15
|
+
let messages = request.messages;
|
|
16
|
+
if (send === 'none')
|
|
17
|
+
messages = messages.filter((m) => m.turnId === request.turnId);
|
|
18
|
+
else if (send !== 'all') {
|
|
19
|
+
const turns = groupTurns(messages);
|
|
20
|
+
// Turns not in the summary yet are never left out (maintain() runs before each request, so normally there are none).
|
|
21
|
+
const pending = compact ? turnsAfter(turns, through) : [];
|
|
22
|
+
messages = (pending.length > send ? pending : turns.slice(-send)).flat();
|
|
23
|
+
}
|
|
24
|
+
const context = summary
|
|
25
|
+
? [
|
|
26
|
+
...request.context.filter((s) => s.key !== SUMMARY_KEY),
|
|
27
|
+
{
|
|
28
|
+
id: 'memory-summary',
|
|
29
|
+
kind: 'context',
|
|
30
|
+
key: SUMMARY_KEY,
|
|
31
|
+
modality: 'text',
|
|
32
|
+
source: 'memory',
|
|
33
|
+
parts: [{ type: 'text', text: `Summary of earlier turns in this conversation:\n${summary}` }],
|
|
34
|
+
timestamp: Date.now(),
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
: request.context;
|
|
38
|
+
return { ...request, messages, context };
|
|
39
|
+
};
|
|
40
|
+
let running;
|
|
41
|
+
let again = false;
|
|
42
|
+
const maintain = async () => {
|
|
43
|
+
if (running) {
|
|
44
|
+
again = true;
|
|
45
|
+
return running;
|
|
46
|
+
}
|
|
47
|
+
running = (async () => {
|
|
48
|
+
do {
|
|
49
|
+
again = false;
|
|
50
|
+
await step();
|
|
51
|
+
} while (again && !ctx.isDisposed);
|
|
52
|
+
})().finally(() => (running = undefined));
|
|
53
|
+
return running;
|
|
54
|
+
};
|
|
55
|
+
const step = async () => {
|
|
56
|
+
const threadId = conversation.threadId;
|
|
57
|
+
let { summary, through } = state();
|
|
58
|
+
let changed = false;
|
|
59
|
+
if (compact && typeof send === 'number') {
|
|
60
|
+
const pending = turnsAfter(groupTurns(conversation.messages), through);
|
|
61
|
+
const leaving = pending.slice(0, Math.max(0, pending.length - send));
|
|
62
|
+
if (leaving.length > 0) {
|
|
63
|
+
let next;
|
|
64
|
+
try {
|
|
65
|
+
next = compact === 'local' ? localSummary(summary, leaving) : await compact({ previous: summary, turns: leaving });
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
ctx.emit('error', { error, source: 'memory' });
|
|
69
|
+
next = localSummary(summary, leaving);
|
|
70
|
+
}
|
|
71
|
+
if (ctx.isDisposed || conversation.threadId !== threadId)
|
|
72
|
+
return; // reset meanwhile
|
|
73
|
+
summary = truncate(next, maxChars);
|
|
74
|
+
through = leaving.at(-1).at(-1).id;
|
|
75
|
+
changed = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let removed = 0;
|
|
79
|
+
if (typeof keep === 'number') {
|
|
80
|
+
const turns = groupTurns(conversation.messages);
|
|
81
|
+
// With compaction, only turns already in the summary may go.
|
|
82
|
+
const removable = compact && typeof send === 'number' ? turns.length - turnsAfter(turns, through).length : turns.length;
|
|
83
|
+
const drop = turns.slice(0, Math.min(Math.max(0, turns.length - keep), removable));
|
|
84
|
+
const ids = new Set(drop.flat().map((m) => m.id));
|
|
85
|
+
removed = ids.size;
|
|
86
|
+
if (removed > 0)
|
|
87
|
+
changed = true;
|
|
88
|
+
if (changed) {
|
|
89
|
+
conversation.restore({
|
|
90
|
+
...conversation.snapshot(),
|
|
91
|
+
messages: conversation.messages.filter((m) => !ids.has(m.id)),
|
|
92
|
+
memory: { summary, through },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else if (changed) {
|
|
97
|
+
conversation.memory = { summary, through };
|
|
98
|
+
}
|
|
99
|
+
if (!changed)
|
|
100
|
+
return;
|
|
101
|
+
ctx.emit('memory.changed', { summary, removed });
|
|
102
|
+
// The kernel already saved at the end of the job; save the result of this pass too.
|
|
103
|
+
if (!ctx.app.busy) {
|
|
104
|
+
try {
|
|
105
|
+
await ctx.app.get('storage')?.save(conversation.snapshot());
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
ctx.emit('error', { error, source: 'storage' });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
// Bring the summary up to date first, so turns leaving the window are never just dropped.
|
|
113
|
+
ctx.intercept('request.before', async (request) => {
|
|
114
|
+
await maintain();
|
|
115
|
+
return view(request);
|
|
116
|
+
}, -100);
|
|
117
|
+
ctx.on('turn.status', ({ phase }) => {
|
|
118
|
+
if (phase !== 'done' && phase !== 'error' && phase !== 'aborted')
|
|
119
|
+
return;
|
|
120
|
+
// Let the kernel finish the job (and save) first.
|
|
121
|
+
setTimeout(() => !ctx.isDisposed && void maintain(), 0);
|
|
122
|
+
});
|
|
123
|
+
ctx.provide('memory', {
|
|
124
|
+
options: { send, keep, compact, maxSummaryChars: maxChars },
|
|
125
|
+
get summary() {
|
|
126
|
+
return state().summary;
|
|
127
|
+
},
|
|
128
|
+
view,
|
|
129
|
+
maintain,
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
/** The memory plugin. `@handsforbots/core` mounts `memory()` unless you pass your own or `createH4B({ memory: false })`. */
|
|
134
|
+
export function memory(options) {
|
|
135
|
+
return { definition, config: options };
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Turns, oldest first: messages grouped by `turnId` (the job that added them).
|
|
139
|
+
* Messages saved before `turnId` existed start a turn at each user message.
|
|
140
|
+
*/
|
|
141
|
+
export function groupTurns(messages) {
|
|
142
|
+
const turns = [];
|
|
143
|
+
let last;
|
|
144
|
+
for (const message of messages) {
|
|
145
|
+
const sameTurn = last && (message.turnId || last.turnId ? message.turnId === last.turnId : message.role !== 'user');
|
|
146
|
+
if (sameTurn)
|
|
147
|
+
turns.at(-1).push(message);
|
|
148
|
+
else
|
|
149
|
+
turns.push([message]);
|
|
150
|
+
last = message;
|
|
151
|
+
}
|
|
152
|
+
return turns;
|
|
153
|
+
}
|
|
154
|
+
/** Turns after the one that holds `through` (all of them if it is gone or unset). */
|
|
155
|
+
function turnsAfter(turns, through) {
|
|
156
|
+
if (!through)
|
|
157
|
+
return turns;
|
|
158
|
+
const index = turns.findIndex((turn) => turn.some((m) => m.id === through));
|
|
159
|
+
return index < 0 ? turns : turns.slice(index + 1);
|
|
160
|
+
}
|
|
161
|
+
/** A summary without an LLM: one line per message, actions with their outcome. */
|
|
162
|
+
export function localSummary(previous, turns) {
|
|
163
|
+
const lines = previous ? [previous] : [];
|
|
164
|
+
for (const message of turns.flat()) {
|
|
165
|
+
if (message.role === 'tool') {
|
|
166
|
+
lines.push(` → ${message.name}: ${message.error ? `error: ${clip(message.error, 120)}` : `ok${brief(message.result)}`}`);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
const text = message.parts
|
|
170
|
+
.map((p) => (p.type === 'text' ? p.text : p.type === 'data' ? (p.name === 'ui' ? '' : `[${p.name}]`) : `[${p.type}]`))
|
|
171
|
+
.filter(Boolean)
|
|
172
|
+
.join(' ')
|
|
173
|
+
.trim();
|
|
174
|
+
const who = message.role === 'user' ? 'User' : 'Assistant';
|
|
175
|
+
if (text)
|
|
176
|
+
lines.push(`${who}: ${clip(text, 300)}`);
|
|
177
|
+
if (message.role === 'assistant') {
|
|
178
|
+
for (const call of message.toolCalls ?? [])
|
|
179
|
+
lines.push(`Action ${call.name}(${clip(json(call.args), 120)})`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return lines.join('\n');
|
|
183
|
+
}
|
|
184
|
+
/** A `Summarizer` that asks your backend (which calls an LLM with its own keys). */
|
|
185
|
+
export function httpSummarizer(options) {
|
|
186
|
+
return async ({ previous, turns }) => {
|
|
187
|
+
const doFetch = options.fetch ?? globalThis.fetch;
|
|
188
|
+
const headers = typeof options.headers === 'function' ? await options.headers() : options.headers;
|
|
189
|
+
const response = await doFetch(options.url, {
|
|
190
|
+
method: 'POST',
|
|
191
|
+
headers: { 'content-type': 'application/json', accept: 'application/json', ...headers },
|
|
192
|
+
credentials: options.credentials ?? 'same-origin',
|
|
193
|
+
body: JSON.stringify({ previous, messages: turns.flat() }),
|
|
194
|
+
});
|
|
195
|
+
if (!response.ok)
|
|
196
|
+
throw new Error(`[h4b] httpSummarizer: ${response.status} from ${options.url}`);
|
|
197
|
+
const { summary } = (await response.json());
|
|
198
|
+
if (typeof summary !== 'string')
|
|
199
|
+
throw new Error('[h4b] httpSummarizer: the response has no "summary" string');
|
|
200
|
+
return summary;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function truncate(summary, max) {
|
|
204
|
+
if (summary.length <= max)
|
|
205
|
+
return summary;
|
|
206
|
+
const tail = summary.slice(summary.length - max + 2);
|
|
207
|
+
const cut = tail.indexOf('\n');
|
|
208
|
+
return `…\n${cut >= 0 ? tail.slice(cut + 1) : tail}`;
|
|
209
|
+
}
|
|
210
|
+
function clip(text, max) {
|
|
211
|
+
return text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
212
|
+
}
|
|
213
|
+
function json(value) {
|
|
214
|
+
try {
|
|
215
|
+
return JSON.stringify(value ?? {}) ?? '';
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return '?';
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function brief(result) {
|
|
222
|
+
if (result === undefined || result === null)
|
|
223
|
+
return '';
|
|
224
|
+
const text = typeof result === 'string' ? result : json(result);
|
|
225
|
+
return text.length <= 80 ? ` (${text})` : '';
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqDA,MAAM,WAAW,GAAG,gBAAgB,CAAA;AAEpC,MAAM,UAAU,GAAgD;IAC9D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE;QACrB,MAAM,IAAI,GAAG,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC5G,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAA;QACtC,MAAM,IAAI,GAAG,UAAU,KAAK,KAAK,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QACvG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAA;QAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,IAAI,IAAI,CAAA;QAChD,MAAM,YAAY,GAAG,GAAG,CA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.1",
|
|
4
|
+
"description": "Plugin. Hands for Bots memory policy: how many turns are sent and kept, and compaction of older turns. Mounted by default by @handsforbots/core.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"handsforbots",
|
|
7
|
+
"h4b",
|
|
8
|
+
"h4b-plugin"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://github.com/handsforbots/handsforbots/blob/main/docs/en-us/plugins.md#memory",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/handsforbots/handsforbots.git",
|
|
15
|
+
"directory": "packages/memory"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/handsforbots/handsforbots/issues"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@handsforbots/core": "^2.0.0-alpha.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@handsforbots/core": "^2.0.0-alpha.1"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc -p tsconfig.build.json",
|
|
42
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
43
|
+
}
|
|
6
44
|
}
|