@clawchatsai/connector 0.2.4 → 0.2.6
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/package.json +1 -1
- package/server/controllers/search.js +66 -0
- package/server/controllers/tags.js +80 -0
- package/server/controllers/title.js +13 -8
- package/server/gateway.js +1 -1
- package/server/index.js +65 -4
- package/server/search/indexer.js +383 -0
- package/server/search/indexer.test.js +267 -0
- package/server/search/store.js +367 -0
- package/server/search/store.test.js +141 -0
- package/server/search/text.js +111 -0
- package/server/search/text.test.js +57 -0
- package/server/store/legacy-threads.js +35 -8
- package/server/tags/model.js +132 -0
- package/server/tags/model.test.js +73 -0
- package/server/tags/store.js +143 -0
- package/server/tags/tagger.js +328 -0
- package/server/tags/tagger.test.js +309 -0
- package/server/team.js +11 -4
- package/server/team.test.js +12 -0
package/server/team.test.js
CHANGED
|
@@ -251,6 +251,18 @@ test('a team chat needs two agents; removing down to one is refused', async () =
|
|
|
251
251
|
assert.deepEqual((await h.team.removeAgent(roomKey, 'dev')).agents.map(a => a.agentId), ['atlas', 'main']);
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
+
test('an agent added on the gateway a moment ago can join right away (agents.list cache refreshed on a miss)', async () => {
|
|
255
|
+
const agents = [...AGENTS];
|
|
256
|
+
const h = harness(() => 'x', { agents });
|
|
257
|
+
const { roomKey } = await h.team.createRoom({ agentIds: ['dev', 'atlas'] }); // fills the cache
|
|
258
|
+
agents.push({ id: 'helper', identity: { name: 'Helper' } }, { id: 'ops', identity: {} });
|
|
259
|
+
assert.deepEqual((await h.team.createRoom({ agentIds: ['main', 'helper'] })).agents.map(a => a.agentId), ['main', 'helper']);
|
|
260
|
+
assert.deepEqual((await h.team.addAgent(roomKey, 'ops')).agents.map(a => a.agentId), ['dev', 'atlas', 'ops']);
|
|
261
|
+
const lists = h.calls.filter(c => c.method === 'agents.list').length;
|
|
262
|
+
await assert.rejects(h.team.createRoom({ agentIds: ['main', 'nobody'] }), /unknown agent: nobody/);
|
|
263
|
+
assert.equal(h.calls.filter(c => c.method === 'agents.list').length, lists + 1); // one re-read, then refused
|
|
264
|
+
});
|
|
265
|
+
|
|
254
266
|
test('stop: a partial reply is posted marked stopped; a reply that finished anyway is posted', async () => {
|
|
255
267
|
const pending = [];
|
|
256
268
|
const h = harness(agent => new Promise(resolve => pending.push({ agent, resolve })));
|