@townco/agent 0.1.55 → 0.1.57
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.d.ts +7 -0
- package/dist/acp-server/adapter.js +96 -18
- package/dist/acp-server/http.js +74 -1
- package/dist/acp-server/session-storage.d.ts +14 -0
- package/dist/acp-server/session-storage.js +47 -0
- package/dist/definition/index.d.ts +16 -0
- package/dist/definition/index.js +16 -0
- package/dist/runner/agent-runner.d.ts +8 -1
- package/dist/runner/agent-runner.js +3 -1
- package/dist/runner/langchain/index.js +139 -7
- package/dist/runner/langchain/model-factory.d.ts +2 -0
- package/dist/runner/langchain/model-factory.js +19 -0
- package/dist/runner/langchain/tools/browser.d.ts +100 -0
- package/dist/runner/langchain/tools/browser.js +412 -0
- package/dist/runner/langchain/tools/subagent-connections.d.ts +28 -0
- package/dist/runner/langchain/tools/subagent-connections.js +58 -0
- package/dist/runner/langchain/tools/subagent.js +5 -1
- package/dist/runner/tools.d.ts +2 -2
- package/dist/runner/tools.js +1 -0
- package/dist/scaffold/index.js +7 -1
- package/dist/scaffold/templates/dot-claude/CLAUDE-append.md +2 -0
- package/dist/telemetry/index.d.ts +5 -0
- package/dist/telemetry/index.js +10 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.js +29 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/templates/index.ts +39 -7
package/dist/templates/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export function getTemplateVars(name, definition) {
|
|
|
7
7
|
tools,
|
|
8
8
|
systemPrompt: definition.systemPrompt,
|
|
9
9
|
hasWebSearch: tools.some((tool) => typeof tool === "string" && tool === "web_search"),
|
|
10
|
+
hasGenerateImage: tools.some((tool) => typeof tool === "string" && tool === "generate_image"),
|
|
11
|
+
hasBrowser: tools.some((tool) => typeof tool === "string" && tool === "browser"),
|
|
10
12
|
hooks: definition.hooks,
|
|
11
13
|
};
|
|
12
14
|
if (definition.displayName) {
|
|
@@ -148,9 +150,15 @@ export function generateReadme(vars) {
|
|
|
148
150
|
})
|
|
149
151
|
.join(", ")
|
|
150
152
|
: "None";
|
|
151
|
-
const envVars =
|
|
152
|
-
? "
|
|
153
|
-
|
|
153
|
+
const envVars = [
|
|
154
|
+
vars.hasWebSearch ? "- `EXA_API_KEY`: Required for web_search tool" : "",
|
|
155
|
+
vars.hasGenerateImage
|
|
156
|
+
? "- `GEMINI_API_KEY` (or `GOOGLE_API_KEY`): Required for generate_image tool"
|
|
157
|
+
: "",
|
|
158
|
+
vars.hasBrowser ? "- `KERNEL_API_KEY`: Required for browser tool" : "",
|
|
159
|
+
]
|
|
160
|
+
.filter(Boolean)
|
|
161
|
+
.join("\n");
|
|
154
162
|
return `# ${vars.name}
|
|
155
163
|
|
|
156
164
|
Agent created with \`town create\`.
|
|
@@ -211,10 +219,24 @@ bun run build
|
|
|
211
219
|
`;
|
|
212
220
|
}
|
|
213
221
|
export function generateEnvExample(vars) {
|
|
214
|
-
|
|
222
|
+
const envs = [];
|
|
223
|
+
if (vars.hasWebSearch) {
|
|
224
|
+
envs.push("# Required for web_search tool");
|
|
225
|
+
envs.push("EXA_API_KEY=your_exa_api_key_here");
|
|
226
|
+
envs.push("");
|
|
227
|
+
}
|
|
228
|
+
if (vars.hasGenerateImage) {
|
|
229
|
+
envs.push("# Required for generate_image tool");
|
|
230
|
+
envs.push("GEMINI_API_KEY=your_gemini_api_key_here");
|
|
231
|
+
envs.push("");
|
|
232
|
+
}
|
|
233
|
+
if (vars.hasBrowser) {
|
|
234
|
+
envs.push("# Required for browser tool");
|
|
235
|
+
envs.push("KERNEL_API_KEY=your_kernel_api_key_here");
|
|
236
|
+
envs.push("");
|
|
237
|
+
}
|
|
238
|
+
if (envs.length === 0) {
|
|
215
239
|
return null;
|
|
216
240
|
}
|
|
217
|
-
return
|
|
218
|
-
EXA_API_KEY=your_exa_api_key_here
|
|
219
|
-
`;
|
|
241
|
+
return envs.join("\n");
|
|
220
242
|
}
|