@j-o-r/hello-dave 0.0.5 → 0.0.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/CHANGELOG.md +8 -1
- package/bin/dave.js +114 -94
- package/examples/memory_agent.js +134 -23
- package/examples/test_agent.js +0 -2
- package/lib/genericToolset.js +4 -88
- package/lib/wsIO.js +1 -11
- package/package.json +2 -2
- package/README.md +0 -601
- package/README.md.backup +0 -269
- package/README.md.bak +0 -523
- package/README.md.bak.1774780058 +0 -338
- package/README.md.bak2 +0 -531
- package/docs.bak.1774780058/agent-manager.md +0 -167
- package/docs.bak.1774780058/agent-manager.md.bak +0 -137
- package/docs.bak.1774780058/agent-manager.md.bak2 +0 -157
- package/docs.bak.1774780058/codeserver-pattern.md +0 -191
- package/docs.bak.1774780058/path-resolution-best-practices.md +0 -104
- package/docs.bak.1774780058/project-overview.md +0 -67
- package/docs.bak.1774780058/project-overview.md.bak +0 -67
- package/docs.bak.1774780058/prompt-class.md +0 -141
- package/docs.bak.1774780058/prompt-class.md.bak +0 -142
- package/docs.bak.1774780058/tools-syntax-validation.md +0 -121
- package/docs.bak.1774780058/tools-syntax-validation.md.bak2 +0 -125
- package/docs.bak.1774780058/tools-syntax-validation.md.bak3 +0 -125
- package/docs.bak.1774780058/tools-syntax-validation.md.bak4 +0 -106
- package/docs.bak.1774780058/tools-syntax-validation.md.bak_path +0 -106
- package/docs.bak.1774780058/toolset.md +0 -164
- package/docs.bak.1774780058/toolset.md.bak +0 -94
- package/docs.bak.1774780058/toolset.md.bak3 +0 -161
- package/docs.bak.1774780058/toolset.md.bak4 +0 -161
- package/docs.bak.1774780058/toolset.md.bak5 +0 -161
- package/docs.bak.1774780058/toolset.md.bak6 +0 -163
- package/docs.bak.1774780058/toolset.md.bak_path +0 -163
- package/docs.bak.1774780058/toolset.md.bak_syntax +0 -161
- package/docs.bak.1774780058/xai-responses.md +0 -111
- package/docs.bak.1774780058/xai-responses.md.bak +0 -107
- package/docs.bak.1774780058/xai-responses.md.bak2 +0 -107
- package/docs.bak.1774780058/xai_collections.md +0 -106
- package/examples.bak.1774780058/ask_agent.js +0 -114
- package/examples.bak.1774780058/code_agent.js +0 -149
- package/examples.bak.1774780058/coderev_agent.js +0 -72
- package/examples.bak.1774780058/codeserver.sh +0 -47
- package/examples.bak.1774780058/daisy_agent.js +0 -177
- package/examples.bak.1774780058/docs_agent.js +0 -119
- package/examples.bak.1774780058/gpt_agent.js +0 -109
- package/examples.bak.1774780058/grok_agent.js +0 -98
- package/examples.bak.1774780058/memory_agent.js +0 -112
- package/examples.bak.1774780058/npm_agent.js +0 -175
- package/examples.bak.1774780058/prompt_agent.js +0 -112
- package/examples.bak.1774780058/readme_agent.js +0 -144
- package/examples.bak.1774780058/spawn_agent.js +0 -263
- package/examples.bak.1774780058/test_agent.js +0 -162
- package/examples.bak.1774780058/todo_agent.js +0 -138
- package/scenarios.bak.1774780058/data/eval_node_message.json +0 -9
- package/scenarios.bak.1774780058/data/hist_oa.json +0 -66
- package/scenarios.bak.1774780058/data/o3_response1.json +0 -96
- package/scenarios.bak.1774780058/data/oa_reasoning_parse.json +0 -112
- package/scenarios.bak.1774780058/data/tool_oa.json +0 -96
- package/scenarios.bak.1774780058/data/tool_xai.json +0 -59
- package/scenarios.bak.1774780058/data/tool_xai2.json +0 -40
- package/scenarios.bak.1774780058/data/xai-response-1.json +0 -59
- package/scenarios.bak.1774780058/data/xai-response-2.json +0 -10
- package/scenarios.bak.1774780058/data/xai_reasoning_tools_resp.json +0 -59
- package/scenarios.bak.1774780058/data/xai_search_response.json +0 -58
- package/scenarios.bak.1774780058/environment.js +0 -10
- package/scenarios.bak.1774780058/example.js +0 -17
- package/scenarios.bak.1774780058/genericToolset.test.js +0 -182
- package/scenarios.bak.1774780058/grok.js +0 -113
- package/scenarios.bak.1774780058/memory-tools.js +0 -51
- package/scenarios.bak.1774780058/openai-o3.js +0 -137
- package/scenarios.bak.1774780058/openai-prompt.js +0 -155
- package/scenarios.bak.1774780058/openai-session.js +0 -148
- package/scenarios.bak.1774780058/openai.js +0 -102
- package/scenarios.bak.1774780058/prompt.js +0 -118
- package/scenarios.bak.1774780058/promptFishbowl.js +0 -76
- package/scenarios.bak.1774780058/search.brave.com.js +0 -25
- package/scenarios.bak.1774780058/sh.js +0 -15
- package/scenarios.bak.1774780058/test-wsio.js +0 -26
- package/scenarios.bak.1774780058/testToolset.js +0 -42
- package/scenarios.bak.1774780058/toolset.js +0 -16
- package/scenarios.bak.1774780058/toolset.test.js +0 -141
- package/scenarios.bak.1774780058/write_file_syntax.test.js +0 -145
- package/scenarios.bak.1774780058/write_file_validation/README.md +0 -30
- package/scenarios.bak.1774780058/write_file_validation/bad.js +0 -3
- package/scenarios.bak.1774780058/write_file_validation/good.js +0 -4
- package/scenarios.bak.1774780058/write_file_validation/test.sh +0 -43
- package/scenarios.bak.1774780058/wsClient.js +0 -69
- package/scenarios.bak.1774780058/xai_responses.integration.test.js +0 -57
- package/scenarios.bak.1774780058/xai_responses.test.js +0 -154
- package/scenarios.bak.1774780058/xaicoll.js +0 -50
- package/scenarios.bak.1774780058/xaifiles.js +0 -48
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Test, assert, SH } from '@j-o-r/sh'
|
|
3
|
-
import collections from '../lib/API/x.ai/collections.js';
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import Prompt from '../lib/Prompt.js';
|
|
8
|
-
import tools from './testToolset.js';
|
|
9
|
-
|
|
10
|
-
function LOG(me) {
|
|
11
|
-
console.log(JSON.stringify(me, null, ' '));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const test = new Test();
|
|
15
|
-
|
|
16
|
-
test.add('List collections, start in a clean state', async () => {
|
|
17
|
-
const list = await collections.list();
|
|
18
|
-
let i = 0;
|
|
19
|
-
const len = list.length;
|
|
20
|
-
for (; i < len; i++) {
|
|
21
|
-
const col = list[i];
|
|
22
|
-
if (col.collection_name === 'test_col' || col.collection_name === 'test_col2') {
|
|
23
|
-
const check = await collections.get(col.collection_id);
|
|
24
|
-
assert.equal(check.collection_id, col.collection_id);
|
|
25
|
-
// Delete all test collections
|
|
26
|
-
await collections.del(check.collection_id);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test.add('Add, update, delete a collection', async () => {
|
|
32
|
-
const coll_id = await collections.create('test_col');
|
|
33
|
-
let coll = await collections.get(coll_id);
|
|
34
|
-
assert.strictEqual(coll_id, coll.collection_id);
|
|
35
|
-
await collections.update(coll_id, 'test_col2');
|
|
36
|
-
coll = await collections.get(coll_id);
|
|
37
|
-
assert.strictEqual(coll.collection_name, 'test_col2');
|
|
38
|
-
await collections.del(coll_id);
|
|
39
|
-
// DELETED
|
|
40
|
-
await assert.rejects(
|
|
41
|
-
async () => await collections.get(coll_id),
|
|
42
|
-
(err) => {
|
|
43
|
-
return err.toString().includes('doesn\'t exist or your team');
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
await test.run();
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Test, assert, SH } from '@j-o-r/sh'
|
|
3
|
-
import { files } from '../lib/API/x.ai/files.js';
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
|
|
6
|
-
import Prompt from '../lib/Prompt.js';
|
|
7
|
-
import tools from './testToolset.js';
|
|
8
|
-
|
|
9
|
-
function LOG(me) {
|
|
10
|
-
console.log(JSON.stringify(me, null, ' '));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const test = new Test();
|
|
14
|
-
|
|
15
|
-
test.add('List files', async () => {
|
|
16
|
-
const fp = path.resolve('docs', 'toolset.md');
|
|
17
|
-
const list = (await files.list()).data;
|
|
18
|
-
let i = 0;
|
|
19
|
-
const len = list.length;
|
|
20
|
-
for(;i < len; i++) {
|
|
21
|
-
const f = list[i];
|
|
22
|
-
if (f.filename === 'test.md' || f.filename === fp) {
|
|
23
|
-
await files.rm(f.id);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test.add('create, add and remove files', async () => {
|
|
29
|
-
const fp = path.resolve('docs', 'toolset.md');
|
|
30
|
-
const res = await files.upload(fp);
|
|
31
|
-
const content = await files.get(res.id);
|
|
32
|
-
assert.equal(content.length, res.bytes);
|
|
33
|
-
const meta = await files.getMeta(res.id);
|
|
34
|
-
assert.equal(content.length, meta.bytes);
|
|
35
|
-
await files.rm(res.id);
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
test.add('create, add and remove files with custom content', async () => {
|
|
39
|
-
const fp = 'test.md';
|
|
40
|
-
// Add custom content to a file instead of reading the file itself
|
|
41
|
-
const res = await files.upload(fp, 'Hello World');
|
|
42
|
-
const content = await files.get(res.id);
|
|
43
|
-
assert.equal(content, 'Hello World');
|
|
44
|
-
const meta = await files.getMeta(res.id);
|
|
45
|
-
assert.equal(content.length, meta.bytes);
|
|
46
|
-
await files.rm(res.id);
|
|
47
|
-
})
|
|
48
|
-
await test.run();
|