@townco/agent 0.1.117 → 0.1.118
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 +3 -3
- package/dist/acp-server/adapter.js +101 -79
- package/dist/acp-server/http.js +28 -1
- package/dist/acp-server/session-storage.d.ts +27 -1
- package/dist/acp-server/session-storage.js +19 -1
- package/dist/definition/index.d.ts +4 -1
- package/dist/definition/models.d.ts +6 -0
- package/dist/definition/models.js +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.js +83 -0
- package/dist/runner/hooks/predefined/compaction-tool.js +13 -1
- package/dist/runner/hooks/predefined/mid-turn-compaction.js +13 -1
- package/dist/runner/hooks/types.d.ts +6 -0
- package/dist/runner/index.d.ts +2 -66
- package/dist/runner/langchain/index.js +4 -4
- package/dist/runner/langchain/tools/subagent-connections.d.ts +2 -0
- package/dist/runner/langchain/tools/subagent.js +230 -3
- package/dist/templates/index.js +16 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -7
- package/templates/index.ts +19 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.118",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "index.ts",
|
|
6
6
|
"files": [
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"./logger": {
|
|
47
47
|
"import": "./dist/logger.js",
|
|
48
48
|
"types": "./dist/logger.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./mcp": {
|
|
51
|
+
"import": "./dist/mcp/index.js",
|
|
52
|
+
"types": "./dist/mcp/index.d.ts"
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
"scripts": {
|
|
@@ -79,12 +83,12 @@
|
|
|
79
83
|
"@opentelemetry/sdk-trace-base": "^1.28.0",
|
|
80
84
|
"@opentelemetry/sdk-trace-node": "^1.28.0",
|
|
81
85
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
82
|
-
"@townco/apiclient": "0.0.
|
|
83
|
-
"@townco/core": "0.0.
|
|
84
|
-
"@townco/gui-template": "0.1.
|
|
85
|
-
"@townco/tsconfig": "0.1.
|
|
86
|
-
"@townco/tui-template": "0.1.
|
|
87
|
-
"@townco/ui": "0.1.
|
|
86
|
+
"@townco/apiclient": "0.0.30",
|
|
87
|
+
"@townco/core": "0.0.88",
|
|
88
|
+
"@townco/gui-template": "0.1.107",
|
|
89
|
+
"@townco/tsconfig": "0.1.107",
|
|
90
|
+
"@townco/tui-template": "0.1.107",
|
|
91
|
+
"@townco/ui": "0.1.110",
|
|
88
92
|
"exa-js": "^2.0.0",
|
|
89
93
|
"hono": "^4.10.4",
|
|
90
94
|
"langchain": "^1.0.3",
|
package/templates/index.ts
CHANGED
|
@@ -139,16 +139,24 @@ export async function generateIndexTs(vars: TemplateVars): Promise<string> {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
return prettier.format(
|
|
142
|
-
`import {
|
|
143
|
-
import type { AgentDefinition } from "@townco/agent/definition";
|
|
144
|
-
import { createLogger } from "@townco/agent/logger";
|
|
145
|
-
import { basename } from "node:path";
|
|
146
|
-
|
|
147
|
-
const logger = createLogger("agent-index");
|
|
142
|
+
`import type { AgentDefinition } from "@townco/agent/definition";
|
|
148
143
|
|
|
149
|
-
// Load agent definition from JSON file
|
|
150
144
|
const agent: AgentDefinition = ${JSON.stringify(agentDef)};
|
|
151
145
|
|
|
146
|
+
export default agent;
|
|
147
|
+
`,
|
|
148
|
+
{ parser: "typescript" },
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function generateBinTs(): string {
|
|
153
|
+
return `#!/usr/bin/env bun
|
|
154
|
+
import { basename } from "node:path";
|
|
155
|
+
import { makeHttpTransport, makeStdioTransport } from "@townco/agent/acp-server";
|
|
156
|
+
import { createLogger } from "@townco/agent/logger";
|
|
157
|
+
import agent from "./index";
|
|
158
|
+
|
|
159
|
+
const logger = createLogger("agent-index");
|
|
152
160
|
const transport = process.argv[2] || "stdio";
|
|
153
161
|
|
|
154
162
|
// Get agent directory and name for session storage
|
|
@@ -158,21 +166,13 @@ const agentName = basename(agentDir);
|
|
|
158
166
|
logger.info("Configuration", { transport, agentDir, agentName });
|
|
159
167
|
|
|
160
168
|
if (transport === "http") {
|
|
161
|
-
|
|
169
|
+
makeHttpTransport(agent, agentDir, agentName);
|
|
162
170
|
} else if (transport === "stdio") {
|
|
163
|
-
|
|
171
|
+
makeStdioTransport(agent);
|
|
164
172
|
} else {
|
|
165
|
-
|
|
166
|
-
|
|
173
|
+
logger.error(\`Invalid transport: \${transport}\`);
|
|
174
|
+
process.exit(1);
|
|
167
175
|
}
|
|
168
|
-
`,
|
|
169
|
-
{ parser: "typescript" },
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function generateBinTs(): string {
|
|
174
|
-
return `#!/usr/bin/env bun
|
|
175
|
-
import "./index.ts";
|
|
176
176
|
`;
|
|
177
177
|
}
|
|
178
178
|
|