@agent-smith/core 0.0.2 → 0.0.4
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 +10 -2
- package/dist/agents/useagent.js +4 -4
- package/dist/features/agents/agent-smith-assistant.yml +1 -1
- package/dist/features/agents/agent-smith-code.yml +3 -1
- package/dist/features/agents/agent-smith-colab.yml +1 -1
- package/dist/features/agents/agent-smith-doc-colab.yml +1 -1
- package/dist/features/agents/agent-smith-doc.yml +7 -4
- package/dist/features/agents/agent-smith-help.yml +8 -3
- package/dist/features/agents/agent-smith-light.yml +19 -0
- package/dist/features/agents/agent-smith-search.yml +1 -1
- package/dist/features/agents/agent-smith-sql.yml +1 -1
- package/dist/features/agents/agent-smith.yml +3 -1
- package/dist/features/agents/collaborator.yml +1 -1
- package/dist/features/agents/infer.yml +2 -2
- package/dist/features/fragments/ctx-helper-files.md +3 -1
- package/dist/features/fragments/project-overview.md +1 -0
- package/dist/features/skills/t/SKILL.md +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/agents/read.js
CHANGED
|
@@ -208,10 +208,18 @@ async function readAgent(name, payload, options) {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
if (!autoRunTool) {
|
|
211
|
-
if (!options?.
|
|
211
|
+
if (!options?.onConfirmToolUsage) {
|
|
212
212
|
throw new Error("provide a tool usage confirm function");
|
|
213
213
|
}
|
|
214
|
-
|
|
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;
|
|
215
223
|
}
|
|
216
224
|
agentSpec.tools.push(lmTool);
|
|
217
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
description: An agent to manage Agent Smith's documentation
|
|
2
|
-
category: internal
|
|
2
|
+
category: internal/code
|
|
3
3
|
prompt: |-
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
@@ -26,6 +26,8 @@ variables:
|
|
|
26
26
|
workspace:
|
|
27
27
|
description: The local directory path where to operate
|
|
28
28
|
toolsList:
|
|
29
|
+
- readfile
|
|
30
|
+
- edit-search-replace
|
|
29
31
|
- shell
|
|
30
32
|
- python
|
|
31
33
|
- agent-smith-doc
|
|
@@ -6,20 +6,21 @@ tool:
|
|
|
6
6
|
description: The query about the documentation, the task to perform
|
|
7
7
|
required: true
|
|
8
8
|
description: An agent to manage Agent Smith's documentation
|
|
9
|
-
category: internal
|
|
9
|
+
category: internal/doc
|
|
10
10
|
prompt: |-
|
|
11
11
|
{prompt}
|
|
12
12
|
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
|
+
- `agent-smith/.agents/documentation/project-overview.md`: a high level project overview
|
|
23
24
|
{file:../fragments/ctx-helper-files.md}
|
|
24
25
|
- `agent-smith/.agents/documentation/documentation-map.md`: an entrypoint to navigate in the documentation.
|
|
25
26
|
Always start by reading these files before searching, starting with `AGENTS.md`.
|
|
@@ -39,8 +40,10 @@ variables:
|
|
|
39
40
|
workspace:
|
|
40
41
|
description: The local directory path where to operate
|
|
41
42
|
toolsList:
|
|
43
|
+
- readfile
|
|
44
|
+
- edit-search-replace
|
|
42
45
|
- shell
|
|
43
|
-
- python
|
|
46
|
+
- python
|
|
44
47
|
- notify-user
|
|
45
48
|
skills:
|
|
46
49
|
- update-doc-map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
description: An agent to manage Agent Smith's documentation
|
|
2
|
-
category:
|
|
2
|
+
category: "agent-smith"
|
|
3
3
|
prompt: |-
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
@@ -13,11 +13,16 @@ 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
18
|
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
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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
description: A basic agent
|
|
2
|
+
category: "agent-smith"
|
|
3
|
+
prompt: |-
|
|
4
|
+
{prompt}
|
|
5
|
+
model: qwen4b
|
|
6
|
+
inferParams:
|
|
7
|
+
min_p: 0
|
|
8
|
+
top_k: 20
|
|
9
|
+
top_p: 0.95
|
|
10
|
+
temperature: 0.6
|
|
11
|
+
repetition_penalty: 1
|
|
12
|
+
chat_template_kwargs:
|
|
13
|
+
enable_thinking: true
|
|
14
|
+
preserve_thinking: true
|
|
15
|
+
toolsList:
|
|
16
|
+
- readfile
|
|
17
|
+
- writetofile?
|
|
18
|
+
- edit-search-replace?
|
|
19
|
+
- load-skill
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
description: An agent to manage Agent Smith's documentation
|
|
2
|
-
category:
|
|
2
|
+
category: "agent-smith"
|
|
3
3
|
prompt: |-
|
|
4
4
|
{prompt}
|
|
5
5
|
template:
|
|
@@ -34,6 +34,8 @@ variables:
|
|
|
34
34
|
workspace:
|
|
35
35
|
description: The local directory path where to operate
|
|
36
36
|
toolsList:
|
|
37
|
+
- readfile
|
|
38
|
+
- edit-search-replace
|
|
37
39
|
- shell
|
|
38
40
|
- python
|
|
39
41
|
- run-agent
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
Project's context helper files:
|
|
2
2
|
|
|
3
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
|
|
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`
|
|
@@ -23,6 +23,6 @@ Check what is remaining to do. Avoid verifying previous phases and execute the n
|
|
|
23
23
|
|
|
24
24
|
## After a task is executed or created: manage the state
|
|
25
25
|
|
|
26
|
-
|
|
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.
|
|
27
27
|
|
|
28
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.
|
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.4",
|
|
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"
|