@openagentsy/memory 0.0.0-stage → 0.2.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/LICENSE +674 -0
- package/README.md +33 -2
- package/dist/acceptance.test.d.ts +2 -0
- package/dist/acceptance.test.d.ts.map +1 -0
- package/dist/acceptance.test.js +138 -0
- package/dist/acceptance.test.js.map +1 -0
- package/dist/fixtures.d.ts +30 -0
- package/dist/fixtures.d.ts.map +1 -0
- package/dist/fixtures.js +49 -0
- package/dist/fixtures.js.map +1 -0
- package/dist/inbox.d.ts +131 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +161 -0
- package/dist/inbox.js.map +1 -0
- package/dist/inbox.test.d.ts +2 -0
- package/dist/inbox.test.d.ts.map +1 -0
- package/dist/inbox.test.js +144 -0
- package/dist/inbox.test.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/model.d.ts +85 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +71 -0
- package/dist/model.js.map +1 -0
- package/dist/permissions.test.d.ts +2 -0
- package/dist/permissions.test.d.ts.map +1 -0
- package/dist/permissions.test.js +53 -0
- package/dist/permissions.test.js.map +1 -0
- package/dist/store.d.ts +142 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +263 -0
- package/dist/store.js.map +1 -0
- package/dist/store.test.d.ts +2 -0
- package/dist/store.test.d.ts.map +1 -0
- package/dist/store.test.js +223 -0
- package/dist/store.test.js.map +1 -0
- package/dist/tools.d.ts +86 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +108 -0
- package/dist/tools.js.map +1 -0
- package/dist/tools.test.d.ts +2 -0
- package/dist/tools.test.d.ts.map +1 -0
- package/dist/tools.test.js +142 -0
- package/dist/tools.test.js.map +1 -0
- package/package.json +47 -4
package/dist/tools.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineTool, memoryToolNames } from '@openagentsy/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* The memory tools.
|
|
5
|
+
*
|
|
6
|
+
* Three tools: search, list, and the decision. The decision tool exists and
|
|
7
|
+
* works, and the permission map is what keeps an agent from calling it: the
|
|
8
|
+
* map denies `oa_memory_decide` to every role, so only a person, through
|
|
9
|
+
* the command that will call this same code, decides what is kept.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The tool names, for the base-tool vocabulary.
|
|
13
|
+
*
|
|
14
|
+
* The list lives in core, with the other tool names, so that the vocabulary
|
|
15
|
+
* which resolves a tool name back to its base name and the tools the
|
|
16
|
+
* server offers are one list.
|
|
17
|
+
*/
|
|
18
|
+
export { memoryToolNames };
|
|
19
|
+
/** The most results a search may return. */
|
|
20
|
+
export const MAX_SEARCH_LIMIT = 8;
|
|
21
|
+
/** The results a search returns when the caller names no limit. */
|
|
22
|
+
export const DEFAULT_SEARCH_LIMIT = 5;
|
|
23
|
+
/** The most entries a list may return. */
|
|
24
|
+
export const MAX_LIST_LIMIT = 20;
|
|
25
|
+
/** The entries a list returns when the caller names no limit. */
|
|
26
|
+
export const DEFAULT_LIST_LIMIT = 10;
|
|
27
|
+
const searchArgs = z.object({
|
|
28
|
+
q: z.string().min(1),
|
|
29
|
+
category: z.string().optional(),
|
|
30
|
+
limit: z.number().int().min(1).max(MAX_SEARCH_LIMIT).optional(),
|
|
31
|
+
ordering: z.enum(['relevance', 'recency', 'lost-in-the-middle']).optional(),
|
|
32
|
+
includeUnverified: z.boolean().optional(),
|
|
33
|
+
});
|
|
34
|
+
const listArgs = z.object({
|
|
35
|
+
limit: z.number().int().min(1).max(MAX_LIST_LIMIT).optional(),
|
|
36
|
+
});
|
|
37
|
+
const decideArgs = z.object({
|
|
38
|
+
recordId: z.number().int(),
|
|
39
|
+
decision: z.enum(['approve', 'reject']),
|
|
40
|
+
decidedBy: z.string().min(1),
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* The three tools, defined once.
|
|
44
|
+
*
|
|
45
|
+
* The definitions are handed to the two runtimes through the helper in
|
|
46
|
+
* core, so the shape is the same in both OpenCode versions.
|
|
47
|
+
*/
|
|
48
|
+
export function createMemoryTools(deps) {
|
|
49
|
+
return {
|
|
50
|
+
oa_memory_search: defineTool({
|
|
51
|
+
description: 'Search the memories a person decided to keep. Substring and keyword over the text and the category. Unverified memories are redacted unless includeUnverified is set.',
|
|
52
|
+
args: searchArgs,
|
|
53
|
+
async execute(args) {
|
|
54
|
+
const includeUnverified = args.includeUnverified ?? false;
|
|
55
|
+
const results = await deps.store.search({
|
|
56
|
+
q: args.q,
|
|
57
|
+
...(args.category === undefined ? {} : { category: args.category }),
|
|
58
|
+
limit: args.limit ?? DEFAULT_SEARCH_LIMIT,
|
|
59
|
+
ordering: args.ordering ?? 'lost-in-the-middle',
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
hits: results.map((result) => hit(result.entry, includeUnverified)),
|
|
63
|
+
total: results.length,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
oa_memory_list: defineTool({
|
|
68
|
+
description: 'The most recent memories, and how many candidates are waiting for a decision.',
|
|
69
|
+
args: listArgs,
|
|
70
|
+
async execute(args) {
|
|
71
|
+
const entries = await deps.store.entries();
|
|
72
|
+
const recent = [...entries]
|
|
73
|
+
.sort((a, b) => (a.created_at < b.created_at ? 1 : a.created_at > b.created_at ? -1 : 0))
|
|
74
|
+
.slice(0, args.limit ?? DEFAULT_LIST_LIMIT);
|
|
75
|
+
const pending = await deps.inbox.pending();
|
|
76
|
+
return {
|
|
77
|
+
entries: recent.map((entry) => hit(entry, false)),
|
|
78
|
+
pending: pending.length,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
oa_memory_decide: defineTool({
|
|
83
|
+
description: 'Decide on a candidate memory: approve it into the store, or reject it. A person decides, and the permission map keeps an agent from calling this.',
|
|
84
|
+
args: decideArgs,
|
|
85
|
+
async execute(args) {
|
|
86
|
+
return deps.inbox.decide(args.recordId, args.decision, args.decidedBy);
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The shape a memory takes in a result.
|
|
93
|
+
*
|
|
94
|
+
* The text of an unverified memory is replaced by a marker that names it,
|
|
95
|
+
* unless the caller asked for the unverified ones.
|
|
96
|
+
*/
|
|
97
|
+
function hit(entry, includeUnverified) {
|
|
98
|
+
return {
|
|
99
|
+
id: entry.id,
|
|
100
|
+
text: entry.verified || includeUnverified ? entry.text : `[unverified: ${entry.id}]`,
|
|
101
|
+
category: entry.category,
|
|
102
|
+
source: entry.source,
|
|
103
|
+
confidence: entry.confidence,
|
|
104
|
+
created_at: entry.created_at,
|
|
105
|
+
verified: entry.verified,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAgB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,iEAAiE;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AA0BrC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,C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gBAC3C,OAAO;oBACL,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;oBACjD,OAAO,EAAE,OAAO,CAAC,MAAM;iBACxB,CAAC;YACJ,CAAC;SACF,CAAC;QAEF,gBAAgB,EAAE,UAAU,CAAC;YAC3B,WAAW,EACT,mJAAmJ;YACrJ,IAAI,EAAE,UAAU;YAChB,KAAK,CAAC,OAAO,CAAC,IAAI;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YACzE,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,GAAG,CAAC,KAAkB,EAAE,iBAA0B;IACzD,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,KAAK,CAAC,EAAE,GAAG;QACpF,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.test.d.ts","sourceRoot":"","sources":["../src/tools.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { candidateRecord, fakeReader, temporaryRoot } from './fixtures.js';
|
|
3
|
+
import { MemoryInbox } from './inbox.js';
|
|
4
|
+
import { MemoryStore } from './store.js';
|
|
5
|
+
import { createMemoryTools } from './tools.js';
|
|
6
|
+
const ctx = { sessionID: 'test-session', agent: 'oa-builder' };
|
|
7
|
+
/** A store whose clock steps forward, so the order of two memories is fixed. */
|
|
8
|
+
function steppingStore(root) {
|
|
9
|
+
let tick = 0;
|
|
10
|
+
return new MemoryStore({
|
|
11
|
+
root,
|
|
12
|
+
now: () => {
|
|
13
|
+
tick += 1;
|
|
14
|
+
return new Date(Date.UTC(2026, 9, 26, 12, 0, tick));
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async function toolsIn(root, records) {
|
|
19
|
+
const store = steppingStore(root);
|
|
20
|
+
const inbox = new MemoryInbox({ root, read: fakeReader(records), store });
|
|
21
|
+
return { tools: createMemoryTools({ store, inbox }), store, inbox };
|
|
22
|
+
}
|
|
23
|
+
describe('the memory tools', () => {
|
|
24
|
+
it('redacts an unverified memory in a search, unless the caller asks for it', async () => {
|
|
25
|
+
const { root, remove } = await temporaryRoot();
|
|
26
|
+
try {
|
|
27
|
+
const { tools, store } = await toolsIn(root, []);
|
|
28
|
+
await store.append({
|
|
29
|
+
text: 'The lease guard refuses a write to a file no lease covers.',
|
|
30
|
+
category: 'build',
|
|
31
|
+
source: '7 · 2a-1',
|
|
32
|
+
confidence: 'inferred',
|
|
33
|
+
// A memory is trusted on write; this one is marked unverified, so
|
|
34
|
+
// the search redacts it until the caller asks for it.
|
|
35
|
+
verified: false,
|
|
36
|
+
});
|
|
37
|
+
const hidden = (await tools.oa_memory_search.execute({ q: 'lease' }, ctx));
|
|
38
|
+
expect(hidden.hits).toHaveLength(1);
|
|
39
|
+
expect(hidden.hits[0]?.text).toMatch(/^\[unverified: oa-mem-[A-Za-z0-9_-]{6}\]$/);
|
|
40
|
+
const shown = (await tools.oa_memory_search.execute({ q: 'lease', includeUnverified: true }, ctx));
|
|
41
|
+
expect(shown.hits[0]?.text).toContain('lease guard');
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
await remove();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
it('orders the results so the best ones are where a model looks first', async () => {
|
|
48
|
+
const { root, remove } = await temporaryRoot();
|
|
49
|
+
try {
|
|
50
|
+
const { tools, store } = await toolsIn(root, []);
|
|
51
|
+
await store.append({
|
|
52
|
+
text: 'alpha beta',
|
|
53
|
+
category: 'build',
|
|
54
|
+
source: '1 · a',
|
|
55
|
+
confidence: 'guess',
|
|
56
|
+
});
|
|
57
|
+
await store.append({
|
|
58
|
+
text: 'alpha',
|
|
59
|
+
category: 'build',
|
|
60
|
+
source: '2 · b',
|
|
61
|
+
confidence: 'guess',
|
|
62
|
+
});
|
|
63
|
+
await store.append({
|
|
64
|
+
text: 'beta',
|
|
65
|
+
category: 'build',
|
|
66
|
+
source: '3 · c',
|
|
67
|
+
confidence: 'guess',
|
|
68
|
+
});
|
|
69
|
+
const found = (await tools.oa_memory_search.execute({ q: 'alpha beta', includeUnverified: true }, ctx));
|
|
70
|
+
// The best match is first and the second best is last, so the two
|
|
71
|
+
// strongest results sit where a model looks first. The second best is
|
|
72
|
+
// 'beta': it scores the same as 'alpha' and is the newer of the two.
|
|
73
|
+
const texts = found.hits.map((hit) => hit.text);
|
|
74
|
+
expect(texts[0]).toBe('alpha beta');
|
|
75
|
+
expect(texts[texts.length - 1]).toBe('beta');
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
await remove();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
it('finds a memory by its category', async () => {
|
|
82
|
+
const { root, remove } = await temporaryRoot();
|
|
83
|
+
try {
|
|
84
|
+
const { tools, store } = await toolsIn(root, []);
|
|
85
|
+
await store.append({
|
|
86
|
+
text: 'The lease guard refuses a write to a file no lease covers.',
|
|
87
|
+
category: 'guard',
|
|
88
|
+
source: '7 · 2a-1',
|
|
89
|
+
confidence: 'guess',
|
|
90
|
+
});
|
|
91
|
+
await store.append({
|
|
92
|
+
text: 'The redaction runs before an entry is appended.',
|
|
93
|
+
category: 'privacy',
|
|
94
|
+
source: '8 · 2a-2',
|
|
95
|
+
confidence: 'guess',
|
|
96
|
+
});
|
|
97
|
+
const found = (await tools.oa_memory_search.execute({ q: 'lease', category: 'guard' }, ctx));
|
|
98
|
+
expect(found.hits).toHaveLength(1);
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
await remove();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
it('lists the recent memories and how many candidates wait', async () => {
|
|
105
|
+
const { root, remove } = await temporaryRoot();
|
|
106
|
+
try {
|
|
107
|
+
const { tools, store } = await toolsIn(root, [
|
|
108
|
+
candidateRecord({ id: 1 }),
|
|
109
|
+
candidateRecord({ id: 2 }),
|
|
110
|
+
]);
|
|
111
|
+
await store.append({
|
|
112
|
+
text: 'The lease guard refuses a write to a file no lease covers.',
|
|
113
|
+
category: 'build',
|
|
114
|
+
source: '7 · 2a-1',
|
|
115
|
+
confidence: 'guess',
|
|
116
|
+
// Marked unverified, so the listing redacts its text.
|
|
117
|
+
verified: false,
|
|
118
|
+
});
|
|
119
|
+
const listed = (await tools.oa_memory_list.execute({}, ctx));
|
|
120
|
+
expect(listed.entries).toHaveLength(1);
|
|
121
|
+
expect(listed.entries[0]?.text).toMatch(/^\[unverified: oa-mem-/);
|
|
122
|
+
expect(listed.pending).toBe(2);
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
await remove();
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
it('decides on a candidate', async () => {
|
|
129
|
+
const { root, remove } = await temporaryRoot();
|
|
130
|
+
try {
|
|
131
|
+
const { tools, store } = await toolsIn(root, [candidateRecord({ id: 7 })]);
|
|
132
|
+
const decided = (await tools.oa_memory_decide.execute({ recordId: 7, decision: 'approve', decidedBy: 'daniel' }, ctx));
|
|
133
|
+
expect(decided.ok).toBe(true);
|
|
134
|
+
expect(decided.state).toBe('promoted');
|
|
135
|
+
expect(await store.entries()).toHaveLength(1);
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
await remove();
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
//# sourceMappingURL=tools.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.test.js","sourceRoot":"","sources":["../src/tools.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,GAAG,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AAE/D,gFAAgF;AAChF,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,WAAW,CAAC;QACrB,IAAI;QACJ,GAAG,EAAE,GAAG,EAAE;YACR,IAAI,IAAI,CAAC,CAAC;YACV,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,OAA6C;IAChF,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,OAAO,EAAE,KAAK,EAAE,iBAAiB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EACzD,GAAG,CACJ,CAAmC,CAAC;YACrC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,EAAE,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openagentsy/memory",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"author": "Grand Slopulissimo <slopulissimo@voxslopuli.org>",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -b tsconfig.json",
|
|
13
|
+
"typecheck": "tsc -b tsconfig.json"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@openagentsy/core": "^0.2.0",
|
|
17
|
+
"nanoid": "6.0.2",
|
|
18
|
+
"zod": "4.6.7"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^24.3.0",
|
|
22
|
+
"typescript": "^5.9.2"
|
|
23
|
+
},
|
|
24
|
+
"license": "GPL-3.0-or-later",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/voxslopuli/openagentsy.git"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/voxslopuli/openagentsy#readme",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/voxslopuli/openagentsy/issues"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=22.5.0"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"description": "The OpenAgentsy memory store: the decision, the store, and the way back in.",
|
|
40
|
+
"keywords": [
|
|
41
|
+
"agents",
|
|
42
|
+
"memory",
|
|
43
|
+
"opencode",
|
|
44
|
+
"llm"
|
|
45
|
+
],
|
|
46
|
+
"files": [
|
|
47
|
+
"dist"
|
|
48
|
+
]
|
|
49
|
+
}
|