@townco/cli 0.1.51 → 0.1.53
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/commands/create.js +2 -20
- package/dist/commands/run.js +26 -2
- package/package.json +7 -6
package/dist/commands/create.js
CHANGED
|
@@ -6,21 +6,11 @@ import TextInput from "ink-text-input";
|
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { openInEditor } from "../lib/editor-utils";
|
|
8
8
|
const AVAILABLE_MODELS = [
|
|
9
|
-
{
|
|
10
|
-
label: "Claude Opus 4.5",
|
|
11
|
-
value: "claude-opus-4-5-20250514",
|
|
12
|
-
description: "Most capable model - best for complex tasks",
|
|
13
|
-
},
|
|
14
9
|
{
|
|
15
10
|
label: "Claude Sonnet 4.5",
|
|
16
11
|
value: "claude-sonnet-4-5-20250929",
|
|
17
12
|
description: "Latest Sonnet model - balanced performance and speed",
|
|
18
13
|
},
|
|
19
|
-
{
|
|
20
|
-
label: "Claude Haiku 4.5",
|
|
21
|
-
value: "claude-haiku-4-5-20250919",
|
|
22
|
-
description: "Fastest Claude 4 model - great for simple tasks",
|
|
23
|
-
},
|
|
24
14
|
{
|
|
25
15
|
label: "Claude Sonnet 4",
|
|
26
16
|
value: "claude-sonnet-4-20250514",
|
|
@@ -29,7 +19,7 @@ const AVAILABLE_MODELS = [
|
|
|
29
19
|
{
|
|
30
20
|
label: "Claude Opus 4",
|
|
31
21
|
value: "claude-opus-4-20250514",
|
|
32
|
-
description: "
|
|
22
|
+
description: "Most capable model - best for complex tasks",
|
|
33
23
|
},
|
|
34
24
|
{
|
|
35
25
|
label: "Claude 3.5 Sonnet",
|
|
@@ -39,7 +29,7 @@ const AVAILABLE_MODELS = [
|
|
|
39
29
|
{
|
|
40
30
|
label: "Claude 3.5 Haiku",
|
|
41
31
|
value: "claude-3-5-haiku-20241022",
|
|
42
|
-
description: "
|
|
32
|
+
description: "Fastest model - great for simple tasks",
|
|
43
33
|
},
|
|
44
34
|
];
|
|
45
35
|
const AVAILABLE_TOOLS = [
|
|
@@ -108,14 +98,6 @@ function CreateApp({ name: initialName, model: initialModel, tools: initialTools
|
|
|
108
98
|
systemPrompt: agentDef.systemPrompt || "You are a helpful assistant.",
|
|
109
99
|
tools: agentDef.tools || [],
|
|
110
100
|
hooks: [
|
|
111
|
-
{
|
|
112
|
-
type: "tool_response",
|
|
113
|
-
setting: {
|
|
114
|
-
maxContextThreshold: 80,
|
|
115
|
-
responseTruncationThreshold: 80,
|
|
116
|
-
},
|
|
117
|
-
callback: "tool_response_compactor",
|
|
118
|
-
},
|
|
119
101
|
{
|
|
120
102
|
type: "context_size",
|
|
121
103
|
setting: {
|
package/dist/commands/run.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
|
-
import { join } from "node:path";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
6
|
import { isInsideTownProject } from "@townco/agent/storage";
|
|
7
7
|
import { configureLogsDir, createLogger } from "@townco/core";
|
|
8
8
|
import { AcpClient } from "@townco/ui";
|
|
@@ -38,7 +38,10 @@ function TuiRunner({ agentPath, workingDir, noSession, onExit, }) {
|
|
|
38
38
|
options: {
|
|
39
39
|
agentPath,
|
|
40
40
|
workingDirectory: workingDir,
|
|
41
|
-
environment:
|
|
41
|
+
environment: {
|
|
42
|
+
ENABLE_TELEMETRY: "true",
|
|
43
|
+
...(noSession ? { TOWN_NO_SESSION: "true" } : {}),
|
|
44
|
+
},
|
|
42
45
|
},
|
|
43
46
|
});
|
|
44
47
|
setClient(newClient);
|
|
@@ -156,6 +159,25 @@ export async function runCommand(options) {
|
|
|
156
159
|
}
|
|
157
160
|
// Load environment variables from project .env
|
|
158
161
|
const configEnvVars = await loadEnvVars(projectRoot);
|
|
162
|
+
// Start the debugger server as subprocess (OTLP collector + UI)
|
|
163
|
+
const debuggerPkgPath = require.resolve("@townco/debugger/package.json");
|
|
164
|
+
const debuggerDir = dirname(debuggerPkgPath);
|
|
165
|
+
const debuggerProcess = spawn("bun", ["src/index.ts"], {
|
|
166
|
+
cwd: debuggerDir,
|
|
167
|
+
stdio: "inherit",
|
|
168
|
+
env: {
|
|
169
|
+
...process.env,
|
|
170
|
+
DB_PATH: join(projectRoot, ".traces.db"),
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
console.log(`Debugger UI: http://localhost:4000`);
|
|
174
|
+
// Cleanup debugger process on exit
|
|
175
|
+
const cleanupDebugger = () => {
|
|
176
|
+
debuggerProcess.kill();
|
|
177
|
+
};
|
|
178
|
+
process.on("exit", cleanupDebugger);
|
|
179
|
+
process.on("SIGINT", cleanupDebugger);
|
|
180
|
+
process.on("SIGTERM", cleanupDebugger);
|
|
159
181
|
// Resolve agent path within the project
|
|
160
182
|
const agentPath = join(projectRoot, "agents", name);
|
|
161
183
|
// Check if agent exists
|
|
@@ -220,6 +242,7 @@ export async function runCommand(options) {
|
|
|
220
242
|
...configEnvVars,
|
|
221
243
|
NODE_ENV: process.env.NODE_ENV || "production",
|
|
222
244
|
PORT: availablePort.toString(),
|
|
245
|
+
ENABLE_TELEMETRY: "true",
|
|
223
246
|
...(noSession ? { TOWN_NO_SESSION: "true" } : {}),
|
|
224
247
|
},
|
|
225
248
|
});
|
|
@@ -266,6 +289,7 @@ export async function runCommand(options) {
|
|
|
266
289
|
...configEnvVars,
|
|
267
290
|
NODE_ENV: process.env.NODE_ENV || "production",
|
|
268
291
|
PORT: availablePort.toString(),
|
|
292
|
+
ENABLE_TELEMETRY: "true",
|
|
269
293
|
...(noSession ? { TOWN_NO_SESSION: "true" } : {}),
|
|
270
294
|
},
|
|
271
295
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"town": "./dist/index.js"
|
|
@@ -15,17 +15,18 @@
|
|
|
15
15
|
"build": "tsc"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@townco/tsconfig": "0.1.
|
|
18
|
+
"@townco/tsconfig": "0.1.45",
|
|
19
19
|
"@types/bun": "^1.3.1",
|
|
20
20
|
"@types/react": "^19.2.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@optique/core": "^0.6.2",
|
|
24
24
|
"@optique/run": "^0.6.2",
|
|
25
|
-
"@townco/agent": "0.1.
|
|
26
|
-
"@townco/
|
|
27
|
-
"@townco/
|
|
28
|
-
"@townco/
|
|
25
|
+
"@townco/agent": "0.1.53",
|
|
26
|
+
"@townco/debugger": "0.1.3",
|
|
27
|
+
"@townco/core": "0.0.26",
|
|
28
|
+
"@townco/secret": "0.1.48",
|
|
29
|
+
"@townco/ui": "0.1.48",
|
|
29
30
|
"@types/inquirer": "^9.0.9",
|
|
30
31
|
"ink": "^6.4.0",
|
|
31
32
|
"ink-text-input": "^6.0.0",
|