@agent-smith/core 0.0.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/README.md +378 -0
- package/dist/actions/cmd.d.ts +5 -0
- package/dist/actions/cmd.js +135 -0
- package/dist/actions/read.d.ts +3 -0
- package/dist/actions/read.js +17 -0
- package/dist/adaptaters/cmd.d.ts +2 -0
- package/dist/adaptaters/cmd.js +39 -0
- package/dist/agents/cmd.d.ts +3 -0
- package/dist/agents/cmd.js +10 -0
- package/dist/agents/conf.d.ts +3 -0
- package/dist/agents/conf.js +9 -0
- package/dist/agents/files.d.ts +3 -0
- package/dist/agents/files.js +40 -0
- package/dist/agents/read.d.ts +11 -0
- package/dist/agents/read.js +241 -0
- package/dist/agents/useagent.d.ts +13 -0
- package/dist/agents/useagent.js +395 -0
- package/dist/conf.d.ts +14 -0
- package/dist/conf.js +160 -0
- package/dist/const.d.ts +3 -0
- package/dist/const.js +10 -0
- package/dist/db/db.d.ts +3 -0
- package/dist/db/db.js +24 -0
- package/dist/db/read.d.ts +45 -0
- package/dist/db/read.js +280 -0
- package/dist/db/schemas.d.ts +2 -0
- package/dist/db/schemas.js +141 -0
- package/dist/db/write.d.ts +23 -0
- package/dist/db/write.js +570 -0
- package/dist/features/actions/load-skill.d.ts +2 -0
- package/dist/features/actions/load-skill.js +37 -0
- package/dist/features/actions/notify-user.d.ts +2 -0
- package/dist/features/actions/notify-user.js +25 -0
- package/dist/features/actions/read-feature.d.ts +2 -0
- package/dist/features/actions/read-feature.js +25 -0
- package/dist/features/actions/run-agent.d.ts +2 -0
- package/dist/features/actions/run-agent.js +34 -0
- package/dist/features/actions/run-collaborator.d.ts +1 -0
- package/dist/features/actions/run-collaborator.js +42 -0
- package/dist/features/actions/run-worker.d.ts +2 -0
- package/dist/features/actions/run-worker.js +34 -0
- package/dist/features/adaptaters/agent-smith-db-getschema.d.ts +4 -0
- package/dist/features/adaptaters/agent-smith-db-getschema.js +62 -0
- package/dist/features/adaptaters/imgs2base64.d.ts +1 -0
- package/dist/features/adaptaters/imgs2base64.js +13 -0
- package/dist/features/adaptaters/prequery.d.ts +4 -0
- package/dist/features/adaptaters/prequery.js +5 -0
- package/dist/features/agents/agent-smith-colab.yml +37 -0
- package/dist/features/agents/agent-smith-doc.yml +50 -0
- package/dist/features/agents/agent-smith-help.yml +35 -0
- package/dist/features/agents/agent-smith-search.yml +41 -0
- package/dist/features/agents/agent-smith-sql.yml +31 -0
- package/dist/features/agents/agent-smith.yml +37 -0
- package/dist/features/agents/collaborator.yml +15 -0
- package/dist/features/agents/infer.yml +12 -0
- package/dist/features/fragments/ctx-helper-files.md +4 -0
- package/dist/features/fragments/workspace.txt +6 -0
- package/dist/features/skills/create-package-readme/SKILL.md +66 -0
- package/dist/features/skills/document-package/SKILL.md +83 -0
- package/dist/features/skills/t/SKILL.md +26 -0
- package/dist/features/skills/update-codebase-summary/SKILL.md +45 -0
- package/dist/features/skills/update-doc-map/SKILL.md +8 -0
- package/dist/features/skills/update-doc-map/scripts/generate-doc-map.mjs +196 -0
- package/dist/features/workflows/agent-smith-db.yml +9 -0
- package/dist/features/workflows/q.yml +3 -0
- package/dist/features/workflows/vision.yml +3 -0
- package/dist/main.d.ts +127 -0
- package/dist/main.js +80 -0
- package/dist/mcp.d.ts +16 -0
- package/dist/mcp.js +110 -0
- package/dist/state/backends.d.ts +7 -0
- package/dist/state/backends.js +96 -0
- package/dist/state/features.d.ts +10 -0
- package/dist/state/features.js +42 -0
- package/dist/state/plugins.d.ts +6 -0
- package/dist/state/plugins.js +27 -0
- package/dist/state/state.d.ts +18 -0
- package/dist/state/state.js +79 -0
- package/dist/state/tasks.d.ts +6 -0
- package/dist/state/tasks.js +33 -0
- package/dist/tools.d.ts +15 -0
- package/dist/tools.js +149 -0
- package/dist/updateconf.d.ts +5 -0
- package/dist/updateconf.js +124 -0
- package/dist/utils/io.d.ts +10 -0
- package/dist/utils/io.js +98 -0
- package/dist/utils/perf.d.ts +9 -0
- package/dist/utils/perf.js +63 -0
- package/dist/utils/sys/clipboard.d.ts +3 -0
- package/dist/utils/sys/clipboard.js +33 -0
- package/dist/utils/sys/delete_file.d.ts +2 -0
- package/dist/utils/sys/delete_file.js +10 -0
- package/dist/utils/sys/dirs.d.ts +2 -0
- package/dist/utils/sys/dirs.js +9 -0
- package/dist/utils/sys/execute.d.ts +13 -0
- package/dist/utils/sys/execute.js +48 -0
- package/dist/utils/sys/read.d.ts +3 -0
- package/dist/utils/sys/read.js +21 -0
- package/dist/utils/sys/read_agent.d.ts +6 -0
- package/dist/utils/sys/read_agent.js +23 -0
- package/dist/utils/sys/read_cmds.d.ts +7 -0
- package/dist/utils/sys/read_cmds.js +37 -0
- package/dist/utils/sys/read_conf.d.ts +6 -0
- package/dist/utils/sys/read_conf.js +12 -0
- package/dist/utils/sys/read_features.d.ts +3 -0
- package/dist/utils/sys/read_features.js +134 -0
- package/dist/utils/sys/read_yml_file.d.ts +5 -0
- package/dist/utils/sys/read_yml_file.js +11 -0
- package/dist/utils/sys/run_python.d.ts +6 -0
- package/dist/utils/sys/run_python.js +39 -0
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.js +28 -0
- package/dist/utils/user_msgs.d.ts +5 -0
- package/dist/utils/user_msgs.js +19 -0
- package/dist/workflows/cmd.d.ts +3 -0
- package/dist/workflows/cmd.js +189 -0
- package/dist/workflows/read.d.ts +6 -0
- package/dist/workflows/read.js +61 -0
- package/package.json +45 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
# tool
|
|
3
|
+
name: read-feature
|
|
4
|
+
description: read a feature and get it's content
|
|
5
|
+
arguments:
|
|
6
|
+
name:
|
|
7
|
+
description: the feature name
|
|
8
|
+
required: true
|
|
9
|
+
type:
|
|
10
|
+
description: 'the feature type: agent, workflow, action, adaptater or skill'
|
|
11
|
+
required: true
|
|
12
|
+
*/
|
|
13
|
+
import { getFeatureSpec } from "../../main.js";
|
|
14
|
+
import { readFile } from "../../utils/sys/read.js";
|
|
15
|
+
async function action(args, options) {
|
|
16
|
+
//console.log("NA", args);
|
|
17
|
+
//console.log("NO", options);
|
|
18
|
+
const { found, path } = getFeatureSpec(args.name, args.type);
|
|
19
|
+
if (!found) {
|
|
20
|
+
return `feature ${args.name} of type ${args.type} not found`;
|
|
21
|
+
}
|
|
22
|
+
const content = readFile(path);
|
|
23
|
+
return JSON.stringify(content);
|
|
24
|
+
}
|
|
25
|
+
export { action, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
# tool
|
|
3
|
+
name: run-agent
|
|
4
|
+
description: use an agent in an independant context to accomplish a task
|
|
5
|
+
arguments:
|
|
6
|
+
name:
|
|
7
|
+
description: the name of the agent to use
|
|
8
|
+
required: true
|
|
9
|
+
prompt:
|
|
10
|
+
description: the prompt for the agent
|
|
11
|
+
required: true
|
|
12
|
+
*/
|
|
13
|
+
import { useAgentExecutor } from "../../agents/useagent.js";
|
|
14
|
+
async function action(args, options) {
|
|
15
|
+
//console.log("RA ARGS", args);
|
|
16
|
+
console.log("RA OPTS", options);
|
|
17
|
+
const errb = new Array();
|
|
18
|
+
if (!args?.name) {
|
|
19
|
+
errb.push(`loading agent: provide an agent name`);
|
|
20
|
+
}
|
|
21
|
+
if (!args?.prompt) {
|
|
22
|
+
errb.push(`loading agent: provide an prompt for the agent`);
|
|
23
|
+
}
|
|
24
|
+
if (errb.length > 0) {
|
|
25
|
+
throw new Error(errb.join(" "));
|
|
26
|
+
}
|
|
27
|
+
const aOpts = { ...options };
|
|
28
|
+
aOpts.history = [];
|
|
29
|
+
const ax = await useAgentExecutor(args.name, { prompt: args.prompt }, aOpts);
|
|
30
|
+
const res = await ax.execute();
|
|
31
|
+
//console.log("AH", ax.agent.history);
|
|
32
|
+
return res.text;
|
|
33
|
+
}
|
|
34
|
+
export { action, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function action(args: any, options: any): Promise<string>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
# tool
|
|
3
|
+
name: run-collaborator
|
|
4
|
+
description: use an collaborator in context to accomplish a task
|
|
5
|
+
agentType: worker
|
|
6
|
+
parallelCalls: false
|
|
7
|
+
arguments:
|
|
8
|
+
role:
|
|
9
|
+
description: the role of the collaborator to use
|
|
10
|
+
required: true
|
|
11
|
+
prompt:
|
|
12
|
+
description: the prompt for the collaborator
|
|
13
|
+
required: true
|
|
14
|
+
*/
|
|
15
|
+
import { useAgentExecutor } from "../../agents/useagent.js";
|
|
16
|
+
async function action(args, options) {
|
|
17
|
+
//console.log("RC OPTS IN", options);
|
|
18
|
+
const errb = new Array();
|
|
19
|
+
if (!args?.prompt) {
|
|
20
|
+
errb.push(`loading collaborator: provide an collaborator prompt`);
|
|
21
|
+
}
|
|
22
|
+
if (!args?.role) {
|
|
23
|
+
errb.push(`loading collaborator: provide an role for the collaborator`);
|
|
24
|
+
}
|
|
25
|
+
if (errb.length > 0) {
|
|
26
|
+
throw new Error(errb.join(" "));
|
|
27
|
+
}
|
|
28
|
+
const aOpts = { ...options };
|
|
29
|
+
if (!aOpts?.system) {
|
|
30
|
+
console.warn(`loading collaborator ${args.name}: no system in opts`);
|
|
31
|
+
}
|
|
32
|
+
if (aOpts.caller == "collaborator") {
|
|
33
|
+
return "you can not run collaborators while beeing in collaborator mode already. Answer directly.";
|
|
34
|
+
}
|
|
35
|
+
//console.log("Run collab **********************", aOpts.caller, args.role);
|
|
36
|
+
//console.log("RC OPTS OUT", aOpts.caller, aOpts);
|
|
37
|
+
const ax = await useAgentExecutor("collaborator", args, aOpts);
|
|
38
|
+
const res = await ax.execute();
|
|
39
|
+
//console.log("AH", ax.agent.history);
|
|
40
|
+
return res.text;
|
|
41
|
+
}
|
|
42
|
+
export { action, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
# tool
|
|
3
|
+
name: run-worker
|
|
4
|
+
description: use an worker in context to accomplish a task
|
|
5
|
+
type: worker
|
|
6
|
+
arguments:
|
|
7
|
+
name:
|
|
8
|
+
description: the name of the worker to use
|
|
9
|
+
required: true
|
|
10
|
+
prompt:
|
|
11
|
+
description: the prompt for the worker
|
|
12
|
+
required: true
|
|
13
|
+
*/
|
|
14
|
+
import { useAgentExecutor } from "../../agents/useagent.js";
|
|
15
|
+
async function action(args, options) {
|
|
16
|
+
//console.log("RW ARGS", args);
|
|
17
|
+
console.log("RW OPTS", options);
|
|
18
|
+
const errb = new Array();
|
|
19
|
+
if (!args?.name) {
|
|
20
|
+
errb.push(`loading worker: provide an worker name`);
|
|
21
|
+
}
|
|
22
|
+
if (!args?.prompt) {
|
|
23
|
+
errb.push(`loading worker: provide an prompt for the worker`);
|
|
24
|
+
}
|
|
25
|
+
if (errb.length > 0) {
|
|
26
|
+
throw new Error(errb.join(" "));
|
|
27
|
+
}
|
|
28
|
+
const aOpts = { ...options };
|
|
29
|
+
const ax = await useAgentExecutor(args.name, { prompt: args.prompt }, aOpts);
|
|
30
|
+
const res = await ax.execute();
|
|
31
|
+
//console.log("AH", ax.agent.history);
|
|
32
|
+
return res.text;
|
|
33
|
+
}
|
|
34
|
+
export { action, };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { dbPath } from "../../conf.js";
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import DatabaseConstructor from "better-sqlite3";
|
|
4
|
+
async function action(args, options) {
|
|
5
|
+
//console.log("SCH ARGS", args);
|
|
6
|
+
//console.log("SCH OPTS", options);
|
|
7
|
+
if (args.length < 1) {
|
|
8
|
+
throw new Error("agent-smith-db-getschema: provide a prompt argument");
|
|
9
|
+
}
|
|
10
|
+
const db = new DatabaseConstructor(dbPath, { fileMustExist: true, readonly: true });
|
|
11
|
+
const prompt = args.prompt;
|
|
12
|
+
// Get the schema information as SQL CREATE TABLE statements
|
|
13
|
+
const schema = [];
|
|
14
|
+
// Get all table names
|
|
15
|
+
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table'").all();
|
|
16
|
+
for (const table of tables) {
|
|
17
|
+
const tableName = table.name;
|
|
18
|
+
const tableInfo = db.prepare(`PRAGMA table_info(${tableName})`).all();
|
|
19
|
+
const indexes = db.prepare(`SELECT name, sql FROM sqlite_master WHERE type='index' AND tbl_name='${tableName}'`).all();
|
|
20
|
+
// Generate CREATE TABLE statement
|
|
21
|
+
let createTableSQL = `CREATE TABLE ${tableName} (\n`;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
const columns = tableInfo.map(col => {
|
|
24
|
+
let columnDef = ` ${col.name} ${col.type}`;
|
|
25
|
+
if (col.notnull) {
|
|
26
|
+
columnDef += " NOT NULL";
|
|
27
|
+
}
|
|
28
|
+
if (col.dflt_value !== null) {
|
|
29
|
+
columnDef += ` DEFAULT ${col.dflt_value}`;
|
|
30
|
+
}
|
|
31
|
+
if (col.pk) {
|
|
32
|
+
columnDef += " PRIMARY KEY";
|
|
33
|
+
}
|
|
34
|
+
return columnDef;
|
|
35
|
+
});
|
|
36
|
+
createTableSQL += columns.join(",\n");
|
|
37
|
+
createTableSQL += "\n);";
|
|
38
|
+
// Add indexes
|
|
39
|
+
//@ts-ignore
|
|
40
|
+
const indexSQL = indexes.map(index => index.sql).join("\n");
|
|
41
|
+
if (tableName != "sqlite_sequence") {
|
|
42
|
+
schema.push({
|
|
43
|
+
tableName,
|
|
44
|
+
createTableSQL,
|
|
45
|
+
indexes: indexSQL
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
db.close();
|
|
50
|
+
// Return only the SQL schema string
|
|
51
|
+
let sqlSchema = "";
|
|
52
|
+
for (const table of schema) {
|
|
53
|
+
sqlSchema += table.createTableSQL + "\n\n";
|
|
54
|
+
if (table.indexes) {
|
|
55
|
+
sqlSchema += table.indexes + ";\n\n";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
options.variables.schema = sqlSchema.trim();
|
|
59
|
+
options.variables.dbpath = dbPath;
|
|
60
|
+
return { prompt: prompt };
|
|
61
|
+
}
|
|
62
|
+
export { action, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function action(args: any, options: any): Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { imgs2base64 } from "../utils.js";
|
|
2
|
+
async function action(args, options) {
|
|
3
|
+
const isVerbose = options?.debug || options?.verbose;
|
|
4
|
+
if (args.length < 2) {
|
|
5
|
+
throw new Error("Provide an image path and a prompt");
|
|
6
|
+
}
|
|
7
|
+
const pr = args.pop();
|
|
8
|
+
const { params, prompt } = await imgs2base64(args, pr, isVerbose);
|
|
9
|
+
options.params = { ...options.params, ...params };
|
|
10
|
+
const res = prompt;
|
|
11
|
+
return res;
|
|
12
|
+
}
|
|
13
|
+
export { action };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
description: An agent to manage Agent Smith's documentation
|
|
2
|
+
category: internal
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
template:
|
|
6
|
+
system: |-
|
|
7
|
+
You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You lead a team of specialized collaborators. Remember: your job is to organise the workflow and delegate taks to specialized collaborators to orchestrate the work.
|
|
8
|
+
|
|
9
|
+
A collaborator is like a fork of yourself that can work independently and have access to your memory and context history, just like you. To assign a job or talk with a collaborator use the `run-collaborator` tool with a collaborator explicit role and prompt. Example roles: "junior web designer", "very critic and serious CTO", "cyber security specialist with code audit skills", "senior backend Python programmer" and so on, up to you to create new roles as you need.
|
|
10
|
+
Important: you can only run collaborators when you are not already in collaborator mode. Run them one at the time.
|
|
11
|
+
|
|
12
|
+
{file:../fragments/workspace.txt}
|
|
13
|
+
|
|
14
|
+
{file:../fragments/ctx-helper-files.md}
|
|
15
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation
|
|
16
|
+
|
|
17
|
+
Evaluate the user request and organise the work of collaborators to get an answer.
|
|
18
|
+
model: qwen35b
|
|
19
|
+
backend: llamaccp
|
|
20
|
+
inferParams:
|
|
21
|
+
min_p: 0
|
|
22
|
+
top_k: 20
|
|
23
|
+
top_p: 0.85
|
|
24
|
+
temperature: 0.6
|
|
25
|
+
repetition_penalty: 1
|
|
26
|
+
presence_penalty: 1.5
|
|
27
|
+
chat_template_kwargs:
|
|
28
|
+
enable_thinking: true
|
|
29
|
+
preserve_thinking: true
|
|
30
|
+
variables:
|
|
31
|
+
required:
|
|
32
|
+
workspace:
|
|
33
|
+
description: The local directory path where to operate
|
|
34
|
+
toolsList:
|
|
35
|
+
- shell
|
|
36
|
+
- python
|
|
37
|
+
- run-collaborator
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
tool:
|
|
2
|
+
name: agent-smith-doc
|
|
3
|
+
description: An agent to manage Agent Smith project's documentation
|
|
4
|
+
arguments:
|
|
5
|
+
prompt:
|
|
6
|
+
description: The query about the documentation, the task to perform
|
|
7
|
+
required: true
|
|
8
|
+
description: An agent to manage Agent Smith's documentation
|
|
9
|
+
category: internal
|
|
10
|
+
prompt: |-
|
|
11
|
+
{prompt}
|
|
12
|
+
template:
|
|
13
|
+
system: |-
|
|
14
|
+
You are a documentation agent for the Agent Smith project, a toolkit to run AI agents.
|
|
15
|
+
|
|
16
|
+
In addition to your tools you are provided with some skills: these are instructions to accomplish specific tasks. Here are the available skills and instructions about when to use them:
|
|
17
|
+
|
|
18
|
+
{skills}
|
|
19
|
+
|
|
20
|
+
You can choose to use a skill using the `load-skill` tool when it matches the task. Loading the skill will provide you with instructions to follow about how to accomplish the specific task it was made for.
|
|
21
|
+
|
|
22
|
+
{file:../fragments/workspace.txt}
|
|
23
|
+
|
|
24
|
+
{file:../fragments/ctx-helper-files.md}
|
|
25
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation. Always start by reading this before searching.
|
|
26
|
+
model: qwen35b
|
|
27
|
+
backend: llamaccp
|
|
28
|
+
inferParams:
|
|
29
|
+
min_p: 0
|
|
30
|
+
top_k: 20
|
|
31
|
+
top_p: 0.85
|
|
32
|
+
temperature: 0.6
|
|
33
|
+
repetition_penalty: 1
|
|
34
|
+
presence_penalty: 1.5
|
|
35
|
+
chat_template_kwargs:
|
|
36
|
+
enable_thinking: true
|
|
37
|
+
preserve_thinking: true
|
|
38
|
+
variables:
|
|
39
|
+
required:
|
|
40
|
+
workspace:
|
|
41
|
+
description: The local directory path where to operate
|
|
42
|
+
toolsList:
|
|
43
|
+
- shell
|
|
44
|
+
- python
|
|
45
|
+
- notify-user
|
|
46
|
+
skills:
|
|
47
|
+
- update-doc-map
|
|
48
|
+
- update-codebase-summary
|
|
49
|
+
- document-package
|
|
50
|
+
- create-package-readme
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
description: An agent to manage Agent Smith's documentation
|
|
2
|
+
category: doc
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
template:
|
|
6
|
+
system: |-
|
|
7
|
+
You are Agent Smith help agent for the Agent Smith project, a toolkit to run AI agents. It uses different classes of internal features:
|
|
8
|
+
- `agent`: an ai agent defined in yaml
|
|
9
|
+
- `workflow`: a workflow defined in yaml
|
|
10
|
+
- `actions`: code actions defined in yaml or javascript or python
|
|
11
|
+
- `adaptaters`: adaptater code defined in javascript
|
|
12
|
+
- `skills`: process instructions defined in markdown
|
|
13
|
+
|
|
14
|
+
{file:../fragments/workspace.txt}
|
|
15
|
+
{file:../fragments/ctx-helper-files.md}
|
|
16
|
+
|
|
17
|
+
Information about the database: agent-smith/docsite/public/doc/architecture/3.database.md.
|
|
18
|
+
Important: to read any agents, actions and other builtin features always use the "read-feature" tool if you need to read one. For other files use the "shell" tool.
|
|
19
|
+
|
|
20
|
+
Read AGENTS.md, the project nav file and the database info file before all to get a good idea of the context
|
|
21
|
+
model: qwen35b
|
|
22
|
+
inferParams:
|
|
23
|
+
min_p: 0
|
|
24
|
+
top_k: 20
|
|
25
|
+
top_p: 0.85
|
|
26
|
+
temperature: 0.6
|
|
27
|
+
variables:
|
|
28
|
+
required:
|
|
29
|
+
workspace:
|
|
30
|
+
description: The local directory path where to operate
|
|
31
|
+
toolsList:
|
|
32
|
+
- shell
|
|
33
|
+
- python
|
|
34
|
+
- agent-smith-db
|
|
35
|
+
- read-feature
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
tool:
|
|
2
|
+
name: agent-smith-search
|
|
3
|
+
description: An agent to run web search
|
|
4
|
+
arguments:
|
|
5
|
+
prompt:
|
|
6
|
+
description: the web search to perform or question about a web page
|
|
7
|
+
required: true
|
|
8
|
+
description: An agent to run web search
|
|
9
|
+
category: internal
|
|
10
|
+
prompt: |-
|
|
11
|
+
{prompt}
|
|
12
|
+
template:
|
|
13
|
+
system: |-
|
|
14
|
+
You are a web search agent for the Agent Smith project, a toolkit to run AI agents.
|
|
15
|
+
|
|
16
|
+
{file:../fragments/workspace.txt}
|
|
17
|
+
|
|
18
|
+
Project's context helper files:
|
|
19
|
+
|
|
20
|
+
- `AGENTS.md`: general high level context map of the project to navigate
|
|
21
|
+
model: qwen35b
|
|
22
|
+
backend: llamaccp
|
|
23
|
+
inferParams:
|
|
24
|
+
min_p: 0
|
|
25
|
+
top_k: 20
|
|
26
|
+
top_p: 0.85
|
|
27
|
+
temperature: 0.6
|
|
28
|
+
repetition_penalty: 1
|
|
29
|
+
presence_penalty: 1.5
|
|
30
|
+
chat_template_kwargs:
|
|
31
|
+
enable_thinking: true
|
|
32
|
+
preserve_thinking: true
|
|
33
|
+
variables:
|
|
34
|
+
required:
|
|
35
|
+
workspace:
|
|
36
|
+
description: The local directory path where to operate
|
|
37
|
+
toolsList:
|
|
38
|
+
- shell
|
|
39
|
+
- python
|
|
40
|
+
- ddsearch
|
|
41
|
+
- open_page
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
tool:
|
|
2
|
+
description: Create a database query for Agent Smith database
|
|
3
|
+
arguments:
|
|
4
|
+
prompt:
|
|
5
|
+
description: The user question to create a query from
|
|
6
|
+
description: Create an sql query
|
|
7
|
+
category: internal
|
|
8
|
+
prompt: |-
|
|
9
|
+
Schema:
|
|
10
|
+
{schema}
|
|
11
|
+
|
|
12
|
+
Question: {prompt}
|
|
13
|
+
|
|
14
|
+
Important: output ONLY raw SQL code. Example: SELECT * FROM tablename
|
|
15
|
+
model: text2sql
|
|
16
|
+
template:
|
|
17
|
+
system: |-
|
|
18
|
+
You are given a database schema and a natural language question. Generate the SQL query that answers the question.
|
|
19
|
+
|
|
20
|
+
- Use only tables and columns from the provided schema
|
|
21
|
+
- Use uppercase SQL keywords (SELECT, FROM, WHERE, etc.)
|
|
22
|
+
- Use SQLite-compatible syntax
|
|
23
|
+
assistant: "```sql\n"
|
|
24
|
+
stop:
|
|
25
|
+
- "```"
|
|
26
|
+
inferParams:
|
|
27
|
+
temperature: 0
|
|
28
|
+
variables:
|
|
29
|
+
required:
|
|
30
|
+
schema:
|
|
31
|
+
description: the database sql schema
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
description: An agent to manage Agent Smith's documentation
|
|
2
|
+
category: internal
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
template:
|
|
6
|
+
system: |-
|
|
7
|
+
You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You lead a team of specialized agents. Available subagents:
|
|
8
|
+
|
|
9
|
+
- `agent-smith-doc`: a documentation manager agent. Use it for all documentation related tasks, like verify, create or update documentation. It has specific skills to create codebase summaries and manage documentation.
|
|
10
|
+
- `agent-smith-search`: a web search and web page reader agent. Use to search information or ask questions about some web pages.
|
|
11
|
+
|
|
12
|
+
Agents call mode info: you can call an agent in worker mode using `run-worker`, it will have all the context you have in the conversation history. Or you can call an agent in isolation mode using `run-agent`: the agent will be completly independant and have no context. Use the isolation mode for independant tasks that are heavy and do not require context, otherwise use the worker mode to share context and dialog with workers.
|
|
13
|
+
|
|
14
|
+
{file:../fragments/workspace.txt}
|
|
15
|
+
{file:../fragments/ctx-helper-files.md}
|
|
16
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: read this to find documentation
|
|
17
|
+
model: qwen35b
|
|
18
|
+
backend: llamaccp
|
|
19
|
+
inferParams:
|
|
20
|
+
min_p: 0
|
|
21
|
+
top_k: 20
|
|
22
|
+
top_p: 0.85
|
|
23
|
+
temperature: 0.6
|
|
24
|
+
repetition_penalty: 1
|
|
25
|
+
presence_penalty: 1.5
|
|
26
|
+
chat_template_kwargs:
|
|
27
|
+
enable_thinking: true
|
|
28
|
+
preserve_thinking: true
|
|
29
|
+
variables:
|
|
30
|
+
required:
|
|
31
|
+
workspace:
|
|
32
|
+
description: The local directory path where to operate
|
|
33
|
+
toolsList:
|
|
34
|
+
- shell
|
|
35
|
+
- python
|
|
36
|
+
- run-worker
|
|
37
|
+
- run-agent
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
description: A collaborator agent
|
|
2
|
+
type: builtin
|
|
3
|
+
prompt: |-
|
|
4
|
+
You are on collaborator mode. Your role is: {role}. Main agent request:
|
|
5
|
+
|
|
6
|
+
{prompt}
|
|
7
|
+
model: qwen35b
|
|
8
|
+
variables:
|
|
9
|
+
required:
|
|
10
|
+
workspace:
|
|
11
|
+
description: The local directory path where to operate
|
|
12
|
+
role:
|
|
13
|
+
description: The role of the collaborator
|
|
14
|
+
|
|
15
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
You are operating on a Linux filesystem in a workspace located at /workspace. The current directory is /. If a user refers to a path prepend /workspace to it for shell commands: example: ls /workspace/src if user refers to a `src` directory.
|
|
2
|
+
|
|
3
|
+
Directories for AI agents:
|
|
4
|
+
|
|
5
|
+
- `.agents/documentation`: where the documentation to navigate the codebase is
|
|
6
|
+
- `.agents/tasks`: where we store tasks for AI agents. If the user refers to a task check this directory
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-package-readme
|
|
3
|
+
description: use this to create comprehensive README file for a given package
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Workflow: Package README Creation
|
|
7
|
+
|
|
8
|
+
### Phase 1: Discovery
|
|
9
|
+
1. Read `/workspace/AGENTS.md` and `/workspace/.agents/documentation/project-nav.md` to understand project structure
|
|
10
|
+
2. Read `/workspace/agent-smith/.agents/documentation/codebase-summary.md` and `/workspace/agent-smith/.agents/documentation/dpcumentation-map.md`
|
|
11
|
+
3. Locate target package in the codebase summary (note its position, dependencies, and purpose)
|
|
12
|
+
|
|
13
|
+
### Phase 2: Deep Dive
|
|
14
|
+
3. Navigate to package directory: `/workspace/agent-smith/packages/{package-name}/`
|
|
15
|
+
4. Read `.agents/documentation/codebase-summary.md` for package-specific architecture, key files, and usage patterns
|
|
16
|
+
5. Read documentation from `/workspace/agent-smith/docsite/public/doc/libraries/{package-name}/*.md` (get_started, usage, api)
|
|
17
|
+
|
|
18
|
+
### Phase 3: Synthesis & Writing
|
|
19
|
+
6. Create `/workspace/agent-smith/packages/{package-name}/README.md` with this structure:
|
|
20
|
+
- **Npm badge**: example:
|
|
21
|
+
```
|
|
22
|
+
[](https://www.npmjs.com/package/this-package-name)
|
|
23
|
+
```
|
|
24
|
+
- **Title & Tagline**: Package name + one-sentence description. Mention that this package is part of the Agent Smith toolkit (repository: https://github.com/lynxai-team/agent-smith)
|
|
25
|
+
- **Features**: Bullet list of key capabilities (use emojis for visual hierarchy)
|
|
26
|
+
- **Documentation**: 2 sections: documentation for AI agents (must include a link to the codebase navigation map at .agents/documentation/codebase-summary.md and the relevant doc from documentation), and documentation for humans, with the relevant doc http links. Correct links formats:
|
|
27
|
+
- For humans use the site link: https://lynxai-team.github.io/agent-smith/: replace the `docsite/public/doc` paths by this link. Example:
|
|
28
|
+
```md
|
|
29
|
+
- [Complete doc](https://lynxai-team.github.io/agent-smith/libraries/agent/)
|
|
30
|
+
```
|
|
31
|
+
- For AI agents provide detailled links map and use the raw file paths links. Example:
|
|
32
|
+
```md
|
|
33
|
+
- [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the agent package
|
|
34
|
+
- [Get Started](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/1.get_started.md) — Installation and basic usage
|
|
35
|
+
- [Tools](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/2.tools.md) — Defining and configuring tools for agents
|
|
36
|
+
- [Templates](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/3.templates.md) — System prompts, YAML specs, and few-shot examples
|
|
37
|
+
- [Supervision](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/agent/4.supervision.md) — Human-in-the-loop tool authorization
|
|
38
|
+
```
|
|
39
|
+
- **Installation**: npm/yarn command in code block
|
|
40
|
+
- **Quick Start**: Minimal working example showing creation, init, and basic operations
|
|
41
|
+
- **Usage**: Detailed patterns with code examples (creation, initialization, verbose mode, reading/writing, error handling)
|
|
42
|
+
- **Complete Example**: Full working async function demonstrating all operations
|
|
43
|
+
- **API Reference**: Factory function signature + parameters table + interface + method summary table
|
|
44
|
+
- **Important Notes**: Browser-only warnings, limitations, related packages
|
|
45
|
+
- **Documentation Links**: References to full docsite
|
|
46
|
+
- **License**: MIT/appropriate license
|
|
47
|
+
|
|
48
|
+
### Key Principles
|
|
49
|
+
- **Information Density**: Every section must convey unique value; avoid repetition between Quick Start and Usage
|
|
50
|
+
- **Code Examples**: All examples must be complete, runnable TypeScript with proper async/await
|
|
51
|
+
- **Type Safety**: Show generic type parameters explicitly (e.g., `get<string>()`)
|
|
52
|
+
- **Error Handling**: Document error cases explicitly with try/catch examples
|
|
53
|
+
- **Browser vs Node**: Clearly state environment constraints early in the README
|
|
54
|
+
- **Visual Hierarchy**: Use emojis for feature bullets, clear section headers, and tables for API reference
|
|
55
|
+
|
|
56
|
+
### Output Validation
|
|
57
|
+
Before finalizing, verify:
|
|
58
|
+
- [ ] All code blocks are syntactically valid TypeScript
|
|
59
|
+
- [ ] API signatures match actual implementation (check source files if needed)
|
|
60
|
+
- [ ] Installation command uses correct package name (`@agent-smith/{package-name}`)
|
|
61
|
+
- [ ] Documentation links follow consistent pattern
|
|
62
|
+
- [ ] No internal paths or implementation details leak into public documentation
|
|
63
|
+
|
|
64
|
+
Documentation links base url: https://lynxai-team.github.io/agent-smith/
|
|
65
|
+
|
|
66
|
+
Notify the user when the task is completed
|