@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.
@@ -5,6 +5,9 @@ export interface TemplateVars {
5
5
  tools: Array<string | {
6
6
  type: "custom";
7
7
  modulePath: string;
8
+ } | {
9
+ type: "filesystem";
10
+ working_directory?: string | undefined;
8
11
  }>;
9
12
  systemPrompt: string | null;
10
13
  hasWebSearch: boolean;
@@ -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) => (typeof tool === "string" ? tool : tool.modulePath))
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
@@ -1,18 +1,18 @@
1
1
  import { LangchainAgent } from "./runner/langchain";
2
-
3
2
  const agent = new LangchainAgent({
4
- model: "claude-sonnet-4-5-20250929",
5
- systemPrompt: "You are a helpful assistant.",
6
- tools: ["todo_write"],
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
- prompt: [
10
- {
11
- type: "text",
12
- text: "Whats the weather in Tokyo?",
13
- },
14
- ],
15
- sessionId: "test-session",
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
- console.log(event);
17
+ console.log(event);
18
18
  }