@agent-smith/core 0.0.1 → 0.0.3
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/dist/agents/read.js +13 -6
- package/dist/agents/useagent.js +4 -4
- package/dist/features/agents/agent-smith-assistant.yml +32 -0
- package/dist/features/agents/agent-smith-code.yml +33 -0
- package/dist/features/agents/agent-smith-colab.yml +3 -4
- package/dist/features/agents/agent-smith-doc-colab.yml +54 -0
- package/dist/features/agents/agent-smith-doc.yml +9 -7
- package/dist/features/agents/agent-smith-help.yml +13 -4
- package/dist/features/agents/agent-smith-light.yml +15 -0
- package/dist/features/agents/agent-smith-search.yml +3 -4
- package/dist/features/agents/agent-smith-sql.yml +2 -2
- package/dist/features/agents/agent-smith.yml +13 -9
- package/dist/features/agents/collaborator.yml +2 -1
- package/dist/features/agents/infer.yml +1 -1
- package/dist/features/fragments/call-mode.md +3 -0
- package/dist/features/fragments/ctx-helper-files.md +4 -2
- package/dist/features/fragments/project-overview.md +1 -0
- package/dist/features/skills/create-readme/SKILL.md +103 -0
- package/dist/features/skills/t/SKILL.md +4 -2
- package/dist/features/workflows/agent-smith-db.yml +1 -1
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +2 -2
- package/dist/workflows/cmd.js +1 -0
- package/package.json +5 -5
- package/dist/features/skills/create-package-readme/SKILL.md +0 -66
package/dist/agents/read.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import path from "path";
|
|
2
1
|
import { compile, serializeGrammar } from "@intrinsicai/gbnfgen";
|
|
3
|
-
import
|
|
2
|
+
import path from "path";
|
|
4
3
|
import { executeAction } from "../actions/cmd.js";
|
|
4
|
+
import { readSkillsFromList, readTool } from "../db/read.js";
|
|
5
5
|
import { McpClient } from "../mcp.js";
|
|
6
|
+
import { openAgentSpec } from "../utils/io.js";
|
|
6
7
|
import { executeWorkflow } from "../workflows/cmd.js";
|
|
7
8
|
import { executeAgent } from "./cmd.js";
|
|
8
|
-
import { openAgentSpec } from "../utils/io.js";
|
|
9
9
|
import { applyFilePlaceholders } from "./files.js";
|
|
10
|
-
//import { confirmToolUsage } from "../tools.js";
|
|
11
10
|
async function readAgent(name, payload, options) {
|
|
12
11
|
/*console.log("Read Agent", name);
|
|
13
12
|
console.log("Payload:", payload);
|
|
@@ -209,10 +208,18 @@ async function readAgent(name, payload, options) {
|
|
|
209
208
|
}
|
|
210
209
|
};
|
|
211
210
|
if (!autoRunTool) {
|
|
212
|
-
if (!options?.
|
|
211
|
+
if (!options?.onConfirmToolUsage) {
|
|
213
212
|
throw new Error("provide a tool usage confirm function");
|
|
214
213
|
}
|
|
215
|
-
|
|
214
|
+
/*const tcr = async (tool: ToolCallSpec) => {
|
|
215
|
+
console.log("CORE: RUN TOOL CALL CONFIRM", tool)
|
|
216
|
+
// @ts-ignore
|
|
217
|
+
const res = await options.onConfirmToolUsage(tool)
|
|
218
|
+
console.log("TCR", res);
|
|
219
|
+
return res
|
|
220
|
+
}
|
|
221
|
+
lmTool.canRun = tcr;*/
|
|
222
|
+
lmTool.canRun = options.onConfirmToolUsage;
|
|
216
223
|
}
|
|
217
224
|
agentSpec.tools.push(lmTool);
|
|
218
225
|
}
|
package/dist/agents/useagent.js
CHANGED
|
@@ -241,7 +241,7 @@ const useAgentExecutor = async (name, payload, options) => {
|
|
|
241
241
|
localOptions.tools = agentSpec.tools;
|
|
242
242
|
}
|
|
243
243
|
let out;
|
|
244
|
-
//console.log("
|
|
244
|
+
//console.log("CORE EXEC AGENT", payload.prompt, "\nOPTS H", localOptions.history)
|
|
245
245
|
try {
|
|
246
246
|
out = await agent.run(payload.prompt, localOptions);
|
|
247
247
|
}
|
|
@@ -330,11 +330,11 @@ const useAgentExecutor = async (name, payload, options) => {
|
|
|
330
330
|
}
|
|
331
331
|
clearInterval(abortTicker);
|
|
332
332
|
//console.log("END TASK", out);
|
|
333
|
-
if (!localOptions?.isToolCall) {
|
|
333
|
+
/*if (!localOptions?.isToolCall) {
|
|
334
334
|
if (!out.text.endsWith("\n")) {
|
|
335
|
-
console.log()
|
|
335
|
+
console.log()
|
|
336
336
|
}
|
|
337
|
-
}
|
|
337
|
+
}*/
|
|
338
338
|
//console.log("END", name, "ISCM", isChatMode.value, "isTC", localOptions?.isToolCall)
|
|
339
339
|
/*if (!isChatMode.value || localOptions?.isToolCall) {
|
|
340
340
|
// close mcp connections
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
description: An agent to manage Agent Smith's documentation
|
|
2
|
+
category: subagent
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
template:
|
|
6
|
+
system: |-
|
|
7
|
+
You are Agent Smith assistant, an AI agent. You can run other agents to do jobs using the `run-agent` tool with the agent `agent-smith-assistant`, a fork of yourself.
|
|
8
|
+
|
|
9
|
+
{file:../fragments/workspace.txt}
|
|
10
|
+
{file:../fragments/ctx-helper-files.md}
|
|
11
|
+
model: qwen35b
|
|
12
|
+
backend: llamaccp
|
|
13
|
+
inferParams:
|
|
14
|
+
min_p: 0
|
|
15
|
+
top_k: 20
|
|
16
|
+
top_p: 0.85
|
|
17
|
+
temperature: 0.6
|
|
18
|
+
repetition_penalty: 1
|
|
19
|
+
presence_penalty: 1.5
|
|
20
|
+
chat_template_kwargs:
|
|
21
|
+
enable_thinking: true
|
|
22
|
+
preserve_thinking: true
|
|
23
|
+
variables:
|
|
24
|
+
required:
|
|
25
|
+
workspace:
|
|
26
|
+
description: The local directory path where to operate
|
|
27
|
+
toolsList:
|
|
28
|
+
- shell
|
|
29
|
+
- python
|
|
30
|
+
- load-skill
|
|
31
|
+
- read-webpage
|
|
32
|
+
- run-agent
|
|
@@ -0,0 +1,33 @@
|
|
|
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. Your job is to organise the workflow and delegate taks to specialized agents to orchestrate the work.
|
|
8
|
+
|
|
9
|
+
{file:../fragments/workspace.txt}
|
|
10
|
+
{file:../fragments/ctx-helper-files.md}
|
|
11
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: read this to find documentation
|
|
12
|
+
model: qwen35b
|
|
13
|
+
backend: llamaccp
|
|
14
|
+
inferParams:
|
|
15
|
+
min_p: 0
|
|
16
|
+
top_k: 20
|
|
17
|
+
top_p: 0.85
|
|
18
|
+
temperature: 0.6
|
|
19
|
+
repetition_penalty: 1
|
|
20
|
+
presence_penalty: 1.5
|
|
21
|
+
chat_template_kwargs:
|
|
22
|
+
enable_thinking: true
|
|
23
|
+
preserve_thinking: true
|
|
24
|
+
variables:
|
|
25
|
+
required:
|
|
26
|
+
workspace:
|
|
27
|
+
description: The local directory path where to operate
|
|
28
|
+
toolsList:
|
|
29
|
+
- readfile
|
|
30
|
+
- edit-search-replace
|
|
31
|
+
- shell
|
|
32
|
+
- python
|
|
33
|
+
- agent-smith-doc
|
|
@@ -4,17 +4,16 @@ prompt: |-
|
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
6
6
|
system: |-
|
|
7
|
-
You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You
|
|
7
|
+
You are Agent Smith, the AI agent for the Agent Smith project, a toolkit to run AI agents. You can run in main agent mode or collaborator mode. Your job is to organise the workflow when in main agent mode and delegate taks to specialized collaborators to orchestrate the work.
|
|
8
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.
|
|
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. You can only run collaborators when you are in main agent mode. Run them one at the time.
|
|
11
10
|
|
|
12
11
|
{file:../fragments/workspace.txt}
|
|
13
12
|
|
|
14
13
|
{file:../fragments/ctx-helper-files.md}
|
|
15
14
|
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation
|
|
16
15
|
|
|
17
|
-
Evaluate the
|
|
16
|
+
Evaluate the request. Execute it if you are in collaborator mode, or and organise the work of collaborators if you are in main agent mode.
|
|
18
17
|
model: qwen35b
|
|
19
18
|
backend: llamaccp
|
|
20
19
|
inferParams:
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
tool:
|
|
2
|
+
name: agent-smith-doc-colab
|
|
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. 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.
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
Important: you can only run collaborators when you are not already in collaborator mode. Run them one at the time.
|
|
18
|
+
|
|
19
|
+
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:
|
|
20
|
+
|
|
21
|
+
{skills}
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
{file:../fragments/workspace.txt}
|
|
26
|
+
{file:../fragments/ctx-helper-files.md}
|
|
27
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
|
|
28
|
+
Always start by reading these files before searching, starting with `AGENTS.md`.
|
|
29
|
+
model: qwen35b
|
|
30
|
+
backend: llamaccp
|
|
31
|
+
inferParams:
|
|
32
|
+
min_p: 0
|
|
33
|
+
top_k: 20
|
|
34
|
+
top_p: 0.85
|
|
35
|
+
temperature: 0.6
|
|
36
|
+
repetition_penalty: 1
|
|
37
|
+
presence_penalty: 1.5
|
|
38
|
+
chat_template_kwargs:
|
|
39
|
+
enable_thinking: true
|
|
40
|
+
preserve_thinking: true
|
|
41
|
+
variables:
|
|
42
|
+
required:
|
|
43
|
+
workspace:
|
|
44
|
+
description: The local directory path where to operate
|
|
45
|
+
toolsList:
|
|
46
|
+
- shell
|
|
47
|
+
- python
|
|
48
|
+
#- notify-user
|
|
49
|
+
- run-collaborator
|
|
50
|
+
skills:
|
|
51
|
+
- update-doc-map
|
|
52
|
+
- update-codebase-summary
|
|
53
|
+
- document-package
|
|
54
|
+
- create-readme
|
|
@@ -13,16 +13,17 @@ template:
|
|
|
13
13
|
system: |-
|
|
14
14
|
You are a documentation agent for the Agent Smith project, a toolkit to run AI agents.
|
|
15
15
|
|
|
16
|
-
In addition to your tools you are provided with some skills: these are instructions to accomplish specific tasks. Here are
|
|
16
|
+
In addition to your tools you are provided with some skills: these are instructions to accomplish specific tasks. Here are some available skills and instructions about when to use them:
|
|
17
17
|
|
|
18
18
|
{skills}
|
|
19
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.
|
|
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. If a user asks you to load a skill use the `load-skill` tool directly
|
|
21
21
|
|
|
22
22
|
{file:../fragments/workspace.txt}
|
|
23
|
-
|
|
23
|
+
- `agent-smith/.agents/documentation/project-overview.md`: a high level project overview
|
|
24
24
|
{file:../fragments/ctx-helper-files.md}
|
|
25
|
-
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
|
|
25
|
+
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
|
|
26
|
+
Always start by reading these files before searching, starting with `AGENTS.md`.
|
|
26
27
|
model: qwen35b
|
|
27
28
|
backend: llamaccp
|
|
28
29
|
inferParams:
|
|
@@ -31,7 +32,6 @@ inferParams:
|
|
|
31
32
|
top_p: 0.85
|
|
32
33
|
temperature: 0.6
|
|
33
34
|
repetition_penalty: 1
|
|
34
|
-
presence_penalty: 1.5
|
|
35
35
|
chat_template_kwargs:
|
|
36
36
|
enable_thinking: true
|
|
37
37
|
preserve_thinking: true
|
|
@@ -40,11 +40,13 @@ variables:
|
|
|
40
40
|
workspace:
|
|
41
41
|
description: The local directory path where to operate
|
|
42
42
|
toolsList:
|
|
43
|
+
- readfile
|
|
44
|
+
- edit-search-replace
|
|
43
45
|
- shell
|
|
44
|
-
- python
|
|
46
|
+
- python
|
|
45
47
|
- notify-user
|
|
46
48
|
skills:
|
|
47
49
|
- update-doc-map
|
|
48
50
|
- update-codebase-summary
|
|
49
51
|
- document-package
|
|
50
|
-
- create-
|
|
52
|
+
- create-readme
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
description: An agent to manage Agent Smith's documentation
|
|
2
|
-
category:
|
|
2
|
+
category: builtin
|
|
3
3
|
prompt: |-
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
@@ -13,17 +13,26 @@ template:
|
|
|
13
13
|
|
|
14
14
|
{file:../fragments/workspace.txt}
|
|
15
15
|
{file:../fragments/ctx-helper-files.md}
|
|
16
|
+
{file:../fragments/project-overview.md}
|
|
16
17
|
|
|
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.
|
|
18
|
+
Information about the database: `agent-smith/docsite/public/doc/architecture/3.database.md`.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
To read files use the "shell" tool. To read a feature from the database: agent, action,command and other builtin features always use the "read-feature" tool if you need to read one.
|
|
21
|
+
|
|
22
|
+
Start by getting the context using your shell tool:
|
|
23
|
+
- Read `.agents/project-overview.md`
|
|
24
|
+
- Read `AGENTS.md`
|
|
25
|
+
- Read nav files, as well as the database info file
|
|
21
26
|
model: qwen35b
|
|
22
27
|
inferParams:
|
|
23
28
|
min_p: 0
|
|
24
29
|
top_k: 20
|
|
25
30
|
top_p: 0.85
|
|
26
31
|
temperature: 0.6
|
|
32
|
+
repetition_penalty: 1
|
|
33
|
+
chat_template_kwargs:
|
|
34
|
+
enable_thinking: true
|
|
35
|
+
preserve_thinking: true
|
|
27
36
|
variables:
|
|
28
37
|
required:
|
|
29
38
|
workspace:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
description: A basic agent with no tools
|
|
2
|
+
category: builtin
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
model: qwen4b
|
|
6
|
+
backend: llamaccp
|
|
7
|
+
inferParams:
|
|
8
|
+
min_p: 0
|
|
9
|
+
top_k: 20
|
|
10
|
+
top_p: 0.95
|
|
11
|
+
temperature: 0.6
|
|
12
|
+
repetition_penalty: 1
|
|
13
|
+
chat_template_kwargs:
|
|
14
|
+
enable_thinking: true
|
|
15
|
+
preserve_thinking: true
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
tool:
|
|
2
2
|
name: agent-smith-search
|
|
3
|
-
description:
|
|
3
|
+
description: run web search or open web pages
|
|
4
4
|
arguments:
|
|
5
5
|
prompt:
|
|
6
6
|
description: the web search to perform or question about a web page
|
|
7
7
|
required: true
|
|
8
|
-
description: An agent to run web search
|
|
8
|
+
description: An agent to run web search or open web pages
|
|
9
9
|
category: internal
|
|
10
10
|
prompt: |-
|
|
11
11
|
{prompt}
|
|
@@ -26,7 +26,6 @@ inferParams:
|
|
|
26
26
|
top_p: 0.85
|
|
27
27
|
temperature: 0.6
|
|
28
28
|
repetition_penalty: 1
|
|
29
|
-
presence_penalty: 1.5
|
|
30
29
|
chat_template_kwargs:
|
|
31
30
|
enable_thinking: true
|
|
32
31
|
preserve_thinking: true
|
|
@@ -38,4 +37,4 @@ toolsList:
|
|
|
38
37
|
- shell
|
|
39
38
|
- python
|
|
40
39
|
- ddsearch
|
|
41
|
-
-
|
|
40
|
+
- read-webpage
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
tool:
|
|
2
|
-
description:
|
|
2
|
+
description: retrieve data from the Agent Smith config database that references agents, actions, workflows and other features
|
|
3
3
|
arguments:
|
|
4
4
|
prompt:
|
|
5
|
-
description:
|
|
5
|
+
description: the question about the config or data to retrieve
|
|
6
6
|
description: Create an sql query
|
|
7
7
|
category: internal
|
|
8
8
|
prompt: |-
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
description: An agent to manage Agent Smith's documentation
|
|
2
|
-
category:
|
|
2
|
+
category: builtin
|
|
3
3
|
prompt: |-
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
6
6
|
system: |-
|
|
7
|
-
You are Agent Smith,
|
|
7
|
+
You are Agent Smith, an AI coordinator agent. Your job is to organise the workflow of other agents. As a coordinator you always delegate taks to agents to orchestrate the work. Your job is to coordinate the team of agents. Available agents:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
9
|
+
- `agent-smith-assistant`: a fork of yourself, the default agent. Run it by default to accomplish any task.
|
|
10
|
+
- `agent-smith-search`: a web search and web page reader agent. Use to search information or for questions about some web pages.
|
|
13
11
|
|
|
14
12
|
{file:../fragments/workspace.txt}
|
|
15
13
|
{file:../fragments/ctx-helper-files.md}
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
Your workflow to answer a user request:
|
|
16
|
+
|
|
17
|
+
- Analyze the user request
|
|
18
|
+
- Decompose the task to subtasks if necessary and plan the work to do
|
|
19
|
+
- Call agent(s) one after the other to accomplish the subtasks, use `agent-smith-assistant` by default if no specialized agent matches. Only call one agent at the time.
|
|
17
20
|
model: qwen35b
|
|
18
21
|
backend: llamaccp
|
|
19
22
|
inferParams:
|
|
@@ -33,5 +36,6 @@ variables:
|
|
|
33
36
|
toolsList:
|
|
34
37
|
- shell
|
|
35
38
|
- python
|
|
36
|
-
- run-
|
|
37
|
-
-
|
|
39
|
+
- run-agent
|
|
40
|
+
- load-skill
|
|
41
|
+
- notify-user
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
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.
|
|
2
|
+
|
|
3
|
+
Evaluate if you run in worker mode. If yes answer directly. Otherwise if in main agent mode coordinate the work.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
Project's context helper files:
|
|
2
2
|
|
|
3
|
-
- `AGENTS.md`: general high level context map of the project
|
|
4
|
-
- `.agents/documentation/project-nav.md`: a map of the project repositories and overview of the project
|
|
3
|
+
- `AGENTS.md`: general high level context map of the project. Read this first.
|
|
4
|
+
- `.agents/documentation/project-nav.md`: a map of the project repositories and overview of the project
|
|
5
|
+
|
|
6
|
+
To navigate the code always read local directories `.agents/documentation/codebase-summary.md` files
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Project overview: `.agents/documentation/project-overview.md`
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-readme
|
|
3
|
+
description: use this to create comprehensive README file for a given package or plugin or repository
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Workflow: 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 in the codebase summary (note its position, dependencies, and purpose)
|
|
12
|
+
|
|
13
|
+
### Phase 2: Deep Dive
|
|
14
|
+
3. Navigate to directory: `/workspace/agent-smith/packages/{package-name}/` for a package, adapt the path
|
|
15
|
+
4. Read `.agents/documentation/codebase-summary.md` for 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 `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**: REQUIRED section with specific structure (see below)
|
|
27
|
+
- **Installation**: npm/yarn command in code block
|
|
28
|
+
- **Quick Start**: Minimal working example showing creation, init, and basic operations
|
|
29
|
+
- **Usage**: Detailed patterns with code examples (creation, initialization, verbose mode, reading/writing, error handling)
|
|
30
|
+
- **Complete Example**: Full working async function demonstrating all operations
|
|
31
|
+
- **API Reference**: Factory function signature + parameters table + interface + method summary table
|
|
32
|
+
- **Important Notes**: Browser-only warnings, limitations, related packages
|
|
33
|
+
- **Documentation Links**: References to full docsite
|
|
34
|
+
- **License**: MIT/appropriate license
|
|
35
|
+
|
|
36
|
+
### Documentation Section Structure (REQUIRED)
|
|
37
|
+
|
|
38
|
+
Every README must include a **Documentation** section with this exact structure: two subsections — "For AI Agents" and "For Humans" — providing appropriate links for each audience.
|
|
39
|
+
|
|
40
|
+
#### Required Format
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
### For AI Agents
|
|
46
|
+
- [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the {package-name} package
|
|
47
|
+
- [Doc1](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/1.get_started.md) — Description
|
|
48
|
+
- [Doc2](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/2.topic.md) — Description
|
|
49
|
+
|
|
50
|
+
### For Humans
|
|
51
|
+
- [Doc1](https://lynxai-team.github.io/agent-smith/libraries/{package-name}/) — Description
|
|
52
|
+
- [Doc2](https://lynxai-team.github.io/agent-smith/libraries/{package-name}/topic) — Description
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Rules
|
|
56
|
+
|
|
57
|
+
1. **For AI Agents subsection**:
|
|
58
|
+
- Always start with a link to `.agents/documentation/codebase-summary.md` (relative path)
|
|
59
|
+
- List all relevant documentation files from `/workspace/agent-smith/docsite/public/doc/libraries/{package-name}/`
|
|
60
|
+
- Use raw GitHub URLs: `https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/{package-name}/{filename}.md`
|
|
61
|
+
- Include a brief description after each link (after `—`)
|
|
62
|
+
|
|
63
|
+
2. **For Humans subsection**:
|
|
64
|
+
- Use the docsite URL: `https://lynxai-team.github.io/agent-smith/libraries/{package-name}/`
|
|
65
|
+
- Convert paths: replace `docsite/public/doc/libraries/{package-name}/` with `libraries/{package-name}/`
|
|
66
|
+
- Remove file numbering prefixes (e.g., `1.get_started.md` → `/`)
|
|
67
|
+
- Include a brief description after each link (after `—`)
|
|
68
|
+
|
|
69
|
+
#### Example from the types package README
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
### For AI Agents
|
|
75
|
+
- [Codebase Summary](.agents/documentation/codebase-summary.md) — Architecture, key files, and patterns for the Agent Smith libraries
|
|
76
|
+
- [Get Started](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/types/1.get_started.md) — Overview and installation
|
|
77
|
+
- [Interfaces](https://raw.githubusercontent.com/lynxai-team/agent-smith/refs/heads/main/docsite/public/doc/libraries/types/2.interfaces.md) — Complete API reference of all exported types
|
|
78
|
+
|
|
79
|
+
### For Humans
|
|
80
|
+
- [Get Started](https://lynxai-team.github.io/agent-smith/libraries/types/) — Overview and usage guide
|
|
81
|
+
- [Interfaces](https://lynxai-team.github.io/agent-smith/libraries/types/interfaces) — Full interface reference with tables
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Key Principles
|
|
85
|
+
- **Information Density**: Every section must convey unique value; avoid repetition between Quick Start and Usage
|
|
86
|
+
- **Code Examples**: All examples must be complete, runnable TypeScript with proper async/await
|
|
87
|
+
- **Type Safety**: Show generic type parameters explicitly (e.g., `get<string>()`)
|
|
88
|
+
- **Error Handling**: Document error cases explicitly with try/catch examples
|
|
89
|
+
- **Browser vs Node**: Clearly state environment constraints early in the README
|
|
90
|
+
- **Visual Hierarchy**: Use emojis for feature bullets, clear section headers, and tables for API reference
|
|
91
|
+
|
|
92
|
+
### Output Validation
|
|
93
|
+
Before finalizing, verify:
|
|
94
|
+
- [ ] All code blocks are syntactically valid TypeScript
|
|
95
|
+
- [ ] API signatures match actual implementation (check source files if needed)
|
|
96
|
+
- [ ] Installation command uses correct package name (`@agent-smith/{package-name}`)
|
|
97
|
+
- [ ] Documentation section follows the required structure with "For AI Agents" and "For Humans" subsections
|
|
98
|
+
- [ ] Documentation links follow consistent pattern (raw GitHub URLs for AI agents, docsite URLs for humans)
|
|
99
|
+
- [ ] No internal paths or implementation details leak into public documentation
|
|
100
|
+
|
|
101
|
+
Documentation links base url: https://lynxai-team.github.io/agent-smith/
|
|
102
|
+
|
|
103
|
+
Notify the user when the task is completed
|
|
@@ -11,16 +11,18 @@ The tasks are located in an `.agents/tasks` directory, or `[project-name].agents
|
|
|
11
11
|
|
|
12
12
|
Read `.agents/tasks/[task-name]` to list the task files. If a `state.md` file is there read it: it details the task progression.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Create or update a task
|
|
15
15
|
|
|
16
16
|
Check if an `.agents/tasks/[task-name]` directory exists, if not create it. You can write markdown files in it.
|
|
17
17
|
|
|
18
|
+
When asked to create a task do it and then report to the user before executing the task
|
|
19
|
+
|
|
18
20
|
## Execute or continue a task
|
|
19
21
|
|
|
20
22
|
Check what is remaining to do. Avoid verifying previous phases and execute the next phase directly. Always execute the phases one by one. Update the sate after each phase to mark it done.
|
|
21
23
|
|
|
22
24
|
## After a task is executed or created: manage the state
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
When the task is completed it is important to ask the user if everything is all right. If he confirms you can then delete the task directory.
|
|
25
27
|
|
|
26
28
|
If the task is not completed create or update`.agents/tasks/[task-name]/state.md` to indicate briefly what was done and what remains to do to complete the quickstart task. This file should contains step by step instructions and their state.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
tool:
|
|
2
|
-
description: and
|
|
2
|
+
description: and agent to retrieve data in the Agent Smith config database that references agents, actions, workflows and other features. Ask a question in natural language and get the data back.
|
|
3
3
|
arguments:
|
|
4
4
|
prompt:
|
|
5
5
|
description: the question to ask about the data
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { FeatureExtension } from '@agent-smith/types';
|
|
1
|
+
import type { FeatureExtension, AgentVariableDef, AgentOptionalVariableDef } from '@agent-smith/types';
|
|
2
2
|
declare function extractAgentToolDocAndVariables(name: string, ext: FeatureExtension, dirPath: string): {
|
|
3
3
|
toolDoc: string;
|
|
4
4
|
variables: {
|
|
5
|
-
required:
|
|
6
|
-
optional:
|
|
5
|
+
required: Record<string, AgentVariableDef>;
|
|
6
|
+
optional: Record<string, AgentOptionalVariableDef>;
|
|
7
7
|
};
|
|
8
8
|
type: string | null;
|
|
9
9
|
category: string | null;
|
package/dist/tools.js
CHANGED
|
@@ -66,7 +66,7 @@ function _parseToolDoc(rawTxt, name) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
function _parseAgentVariables(data) {
|
|
69
|
-
const res = { required:
|
|
69
|
+
const res = { required: {}, optional: {} };
|
|
70
70
|
if (data?.variables) {
|
|
71
71
|
if (data.variables?.required) {
|
|
72
72
|
res.required = data.variables.required;
|
|
@@ -80,7 +80,7 @@ function _parseAgentVariables(data) {
|
|
|
80
80
|
function extractAgentToolDocAndVariables(name, ext, dirPath) {
|
|
81
81
|
const fp = dirPath + "/" + name + "." + ext;
|
|
82
82
|
const { data, found } = readYmlFile(fp);
|
|
83
|
-
const res = { variables: { required:
|
|
83
|
+
const res = { variables: { required: {}, optional: {} }, toolDoc: "", type: null, category: null };
|
|
84
84
|
// tools
|
|
85
85
|
let tspec;
|
|
86
86
|
if (!found) {
|
package/dist/workflows/cmd.js
CHANGED
|
@@ -73,6 +73,7 @@ async function executeWorkflow(wname, args, options) {
|
|
|
73
73
|
else {
|
|
74
74
|
actArgs = taskRes;
|
|
75
75
|
}
|
|
76
|
+
//console.log("WF EXEC ACTION OPTS", options);
|
|
76
77
|
const ares = await executeAction(step.name, actArgs, options, true);
|
|
77
78
|
//console.log("WF ACTION RES", typeof ares, ares);
|
|
78
79
|
//console.log("LAST ACT", i, finalTaskIndex);
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-smith/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Agent Smith core",
|
|
5
5
|
"repository": "https://github.com/synw/agent-smith",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rm -rf dist/* && tsc && cp -r src/features/agents dist/features && cp -r src/features/workflows dist/features && cp -r src/features/fragments dist/features && cp -r src/features/skills dist/features"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@agent-smith/agent": "^0.5.
|
|
10
|
+
"@agent-smith/agent": "^0.5.2",
|
|
11
11
|
"@intrinsicai/gbnfgen": "^0.12.0",
|
|
12
12
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
13
|
-
"@vue/reactivity": "^3.5.
|
|
13
|
+
"@vue/reactivity": "^3.5.38",
|
|
14
14
|
"better-sqlite3": "^12.10.0",
|
|
15
15
|
"clipboardy": "^5.3.1",
|
|
16
16
|
"front-matter": "^4.0.2",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"yaml": "^2.9.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@agent-smith/types": "^0.0.
|
|
22
|
+
"@agent-smith/types": "^0.0.6",
|
|
23
23
|
"@types/better-sqlite3": "^7.6.13",
|
|
24
|
-
"@types/node": "^25.9.
|
|
24
|
+
"@types/node": "^25.9.3",
|
|
25
25
|
"@types/node-notifier": "^8.0.5",
|
|
26
26
|
"tslib": "^2.8.1",
|
|
27
27
|
"typescript": "^6.0.3"
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|