@townco/agent 0.1.53 → 0.1.54
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 +16 -0
- package/dist/acp-server/adapter.js +230 -16
- package/dist/acp-server/cli.d.ts +1 -3
- package/dist/acp-server/http.js +39 -1
- package/dist/acp-server/session-storage.d.ts +16 -1
- package/dist/acp-server/session-storage.js +23 -0
- package/dist/bin.js +0 -0
- package/dist/definition/index.d.ts +2 -2
- package/dist/definition/index.js +1 -0
- package/dist/runner/agent-runner.d.ts +7 -2
- package/dist/runner/index.d.ts +1 -3
- package/dist/runner/langchain/index.js +178 -38
- package/dist/runner/langchain/tools/generate_image.d.ts +28 -0
- package/dist/runner/langchain/tools/generate_image.js +135 -0
- package/dist/runner/langchain/tools/subagent.d.ts +6 -1
- package/dist/runner/langchain/tools/subagent.js +12 -2
- package/dist/runner/tools.d.ts +19 -2
- package/dist/runner/tools.js +9 -0
- package/dist/telemetry/index.js +7 -1
- package/dist/templates/index.d.ts +3 -0
- package/dist/templates/index.js +26 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/templates/index.ts +36 -5
- package/dist/definition/mcp.d.ts +0 -0
- package/dist/definition/mcp.js +0 -0
- package/dist/definition/tools/todo.d.ts +0 -49
- package/dist/definition/tools/todo.js +0 -80
- package/dist/definition/tools/web_search.d.ts +0 -4
- package/dist/definition/tools/web_search.js +0 -26
- package/dist/dev-agent/index.d.ts +0 -2
- package/dist/dev-agent/index.js +0 -18
- package/dist/example.d.ts +0 -2
- package/dist/example.js +0 -19
- package/dist/scaffold/link-local.d.ts +0 -1
- package/dist/scaffold/link-local.js +0 -54
- package/dist/utils/__tests__/tool-overhead-calculator.test.d.ts +0 -1
- package/dist/utils/__tests__/tool-overhead-calculator.test.js +0 -153
- package/dist/utils/logger.d.ts +0 -39
- package/dist/utils/logger.js +0 -175
package/dist/templates/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as prettier from "prettier";
|
|
2
2
|
export function getTemplateVars(name, definition) {
|
|
3
3
|
const tools = definition.tools ?? [];
|
|
4
|
-
|
|
4
|
+
const result = {
|
|
5
5
|
name,
|
|
6
6
|
model: definition.model,
|
|
7
7
|
tools,
|
|
@@ -9,6 +9,16 @@ export function getTemplateVars(name, definition) {
|
|
|
9
9
|
hasWebSearch: tools.some((tool) => typeof tool === "string" && tool === "web_search"),
|
|
10
10
|
hooks: definition.hooks,
|
|
11
11
|
};
|
|
12
|
+
if (definition.displayName) {
|
|
13
|
+
result.displayName = definition.displayName;
|
|
14
|
+
}
|
|
15
|
+
if (definition.description) {
|
|
16
|
+
result.description = definition.description;
|
|
17
|
+
}
|
|
18
|
+
if (definition.suggestedPrompts) {
|
|
19
|
+
result.suggestedPrompts = definition.suggestedPrompts;
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
12
22
|
}
|
|
13
23
|
export function generatePackageJson(vars) {
|
|
14
24
|
// Include @townco/agent as a dependency instead of bundling
|
|
@@ -44,12 +54,24 @@ export function generatePackageJson(vars) {
|
|
|
44
54
|
return JSON.stringify(pkg, null, 2);
|
|
45
55
|
}
|
|
46
56
|
export async function generateIndexTs(vars) {
|
|
57
|
+
// Build agent definition with fields in a logical order
|
|
47
58
|
const agentDef = {
|
|
48
59
|
model: vars.model,
|
|
49
|
-
systemPrompt: vars.systemPrompt,
|
|
50
|
-
tools: vars.tools,
|
|
51
|
-
hooks: vars.hooks,
|
|
52
60
|
};
|
|
61
|
+
if (vars.displayName) {
|
|
62
|
+
agentDef.displayName = vars.displayName;
|
|
63
|
+
}
|
|
64
|
+
if (vars.description) {
|
|
65
|
+
agentDef.description = vars.description;
|
|
66
|
+
}
|
|
67
|
+
if (vars.suggestedPrompts) {
|
|
68
|
+
agentDef.suggestedPrompts = vars.suggestedPrompts;
|
|
69
|
+
}
|
|
70
|
+
agentDef.systemPrompt = vars.systemPrompt;
|
|
71
|
+
agentDef.tools = vars.tools;
|
|
72
|
+
if (vars.hooks) {
|
|
73
|
+
agentDef.hooks = vars.hooks;
|
|
74
|
+
}
|
|
53
75
|
return prettier.format(`import { makeHttpTransport, makeStdioTransport } from "@townco/agent/acp-server";
|
|
54
76
|
import type { AgentDefinition } from "@townco/agent/definition";
|
|
55
77
|
import { basename } from "node:path";
|