@townco/agent 0.1.19 → 0.1.21
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/acp-server/adapter.js +77 -73
- package/dist/acp-server/http.js +412 -173
- package/dist/definition/index.d.ts +3 -0
- package/dist/definition/index.js +11 -1
- package/dist/dev-agent/index.d.ts +2 -0
- package/dist/dev-agent/index.js +18 -0
- package/dist/index.js +14 -14
- package/dist/runner/agent-runner.d.ts +20 -3
- package/dist/runner/agent-runner.js +4 -4
- package/dist/runner/langchain/index.d.ts +6 -5
- package/dist/runner/langchain/index.js +58 -17
- package/dist/runner/langchain/tools/filesystem.d.ts +66 -0
- package/dist/runner/langchain/tools/filesystem.js +261 -0
- package/dist/runner/tools.d.ts +5 -2
- package/dist/runner/tools.js +11 -1
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/index.js +11 -2
- package/dist/test-script.js +12 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.js +175 -0
- package/index.ts +7 -6
- package/package.json +10 -5
- package/templates/index.ts +14 -3
package/dist/templates/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function getTemplateVars(name, definition) {
|
|
2
|
-
const tools = definition.tools
|
|
2
|
+
const tools = definition.tools ?? [];
|
|
3
3
|
return {
|
|
4
4
|
name,
|
|
5
5
|
model: definition.model,
|
|
@@ -13,6 +13,7 @@ export function generatePackageJson(vars) {
|
|
|
13
13
|
const dependencies = {
|
|
14
14
|
"@townco/agent": "^0.1.14",
|
|
15
15
|
"@agentclientprotocol/sdk": "^0.5.1",
|
|
16
|
+
"@anthropic-ai/sandbox-runtime": "^0.0.2",
|
|
16
17
|
"@langchain/anthropic": "^1.0.0",
|
|
17
18
|
"@langchain/core": "^1.0.3",
|
|
18
19
|
"@langchain/exa": "^0.1.0",
|
|
@@ -105,7 +106,15 @@ export function generateTsConfig() {
|
|
|
105
106
|
export function generateReadme(vars) {
|
|
106
107
|
const toolsList = vars.tools.length > 0
|
|
107
108
|
? vars.tools
|
|
108
|
-
.map((tool) =>
|
|
109
|
+
.map((tool) => {
|
|
110
|
+
if (typeof tool === "string")
|
|
111
|
+
return tool;
|
|
112
|
+
if (tool.type === "custom")
|
|
113
|
+
return tool.modulePath;
|
|
114
|
+
if (tool.type === "filesystem")
|
|
115
|
+
return `filesystem${tool.working_directory ? ` (${tool.working_directory})` : ""}`;
|
|
116
|
+
return "";
|
|
117
|
+
})
|
|
109
118
|
.join(", ")
|
|
110
119
|
: "None";
|
|
111
120
|
const envVars = vars.hasWebSearch
|
package/dist/test-script.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { LangchainAgent } from "./runner/langchain";
|
|
2
|
-
|
|
3
2
|
const agent = new LangchainAgent({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
model: "claude-sonnet-4-5-20250929",
|
|
4
|
+
systemPrompt: "You are a helpful assistant.",
|
|
5
|
+
tools: ["todo_write"],
|
|
7
6
|
});
|
|
8
7
|
for await (const event of agent.invoke({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
prompt: [
|
|
9
|
+
{
|
|
10
|
+
type: "text",
|
|
11
|
+
text: "Whats the weather in Tokyo?",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
sessionId: "test-session",
|
|
15
|
+
messageId: "test-message-1",
|
|
16
16
|
})) {
|
|
17
|
-
|
|
17
|
+
console.log(event);
|
|
18
18
|
}
|