@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/agent",
3
- "version": "0.1.55",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -61,6 +61,7 @@
61
61
  "@anthropic-ai/sdk": "^0.70.0",
62
62
  "@google/genai": "^0.14.1",
63
63
  "@anthropic-ai/tokenizer": "^0.0.4",
64
+ "@onkernel/sdk": "^0.16.0",
64
65
  "@electric-sql/pglite": "^0.2.15",
65
66
  "@langchain/anthropic": "1.0.1",
66
67
  "@langchain/core": "^1.0.3",
@@ -78,11 +79,11 @@
78
79
  "@opentelemetry/sdk-trace-base": "^1.28.0",
79
80
  "@opentelemetry/sdk-trace-node": "^1.28.0",
80
81
  "@opentelemetry/semantic-conventions": "^1.28.0",
81
- "@townco/core": "0.0.28",
82
- "@townco/gui-template": "0.1.47",
83
- "@townco/tsconfig": "0.1.47",
84
- "@townco/tui-template": "0.1.47",
85
- "@townco/ui": "0.1.50",
82
+ "@townco/core": "0.0.30",
83
+ "@townco/gui-template": "0.1.49",
84
+ "@townco/tsconfig": "0.1.49",
85
+ "@townco/tui-template": "0.1.49",
86
+ "@townco/ui": "0.1.52",
86
87
  "exa-js": "^2.0.0",
87
88
  "hono": "^4.10.4",
88
89
  "langchain": "^1.0.3",
@@ -22,6 +22,8 @@ export interface TemplateVars {
22
22
  >;
23
23
  systemPrompt: string | null;
24
24
  hasWebSearch: boolean;
25
+ hasGenerateImage: boolean;
26
+ hasBrowser: boolean;
25
27
  hooks?:
26
28
  | Array<
27
29
  | {
@@ -56,6 +58,12 @@ export function getTemplateVars(
56
58
  hasWebSearch: tools.some(
57
59
  (tool) => typeof tool === "string" && tool === "web_search",
58
60
  ),
61
+ hasGenerateImage: tools.some(
62
+ (tool) => typeof tool === "string" && tool === "generate_image",
63
+ ),
64
+ hasBrowser: tools.some(
65
+ (tool) => typeof tool === "string" && tool === "browser",
66
+ ),
59
67
  hooks: definition.hooks as TemplateVars["hooks"],
60
68
  };
61
69
 
@@ -213,9 +221,15 @@ export function generateReadme(vars: TemplateVars): string {
213
221
  })
214
222
  .join(", ")
215
223
  : "None";
216
- const envVars = vars.hasWebSearch
217
- ? "\n- `EXA_API_KEY`: Required for web_search tool"
218
- : "";
224
+ const envVars = [
225
+ vars.hasWebSearch ? "- `EXA_API_KEY`: Required for web_search tool" : "",
226
+ vars.hasGenerateImage
227
+ ? "- `GEMINI_API_KEY` (or `GOOGLE_API_KEY`): Required for generate_image tool"
228
+ : "",
229
+ vars.hasBrowser ? "- `KERNEL_API_KEY`: Required for browser tool" : "",
230
+ ]
231
+ .filter(Boolean)
232
+ .join("\n");
219
233
 
220
234
  return `# ${vars.name}
221
235
 
@@ -278,11 +292,29 @@ bun run build
278
292
  }
279
293
 
280
294
  export function generateEnvExample(vars: TemplateVars): string | null {
281
- if (!vars.hasWebSearch) {
295
+ const envs: string[] = [];
296
+
297
+ if (vars.hasWebSearch) {
298
+ envs.push("# Required for web_search tool");
299
+ envs.push("EXA_API_KEY=your_exa_api_key_here");
300
+ envs.push("");
301
+ }
302
+
303
+ if (vars.hasGenerateImage) {
304
+ envs.push("# Required for generate_image tool");
305
+ envs.push("GEMINI_API_KEY=your_gemini_api_key_here");
306
+ envs.push("");
307
+ }
308
+
309
+ if (vars.hasBrowser) {
310
+ envs.push("# Required for browser tool");
311
+ envs.push("KERNEL_API_KEY=your_kernel_api_key_here");
312
+ envs.push("");
313
+ }
314
+
315
+ if (envs.length === 0) {
282
316
  return null;
283
317
  }
284
318
 
285
- return `# Required for web_search tool
286
- EXA_API_KEY=your_exa_api_key_here
287
- `;
319
+ return envs.join("\n");
288
320
  }