@townco/cli 0.1.62 → 0.1.70

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.
@@ -237,7 +237,7 @@ function CreateApp({ name: initialName, model: initialModel, tools: initialTools
237
237
  }
238
238
  if (scaffoldStatus === "done") {
239
239
  const modelLabel = agentDef.model?.replace("claude-", "") || "";
240
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Agent created successfully!" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { color: "green", children: "\u25CF" }), " ", _jsx(Text, { bold: true, children: agentDef.name })] }), _jsxs(Text, { dimColor: true, children: [" Model: ", modelLabel] }), agentDef.tools && agentDef.tools.length > 0 && (_jsxs(Text, { dimColor: true, children: [" Tools: ", agentDef.tools.join(", ")] })), _jsxs(Text, { dimColor: true, children: [" Path: ", agentPath] })] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { dimColor: true, children: ["Run agent: bun agents/", agentDef.name, "/index.ts stdio"] }), _jsxs(Text, { dimColor: true, children: ["GUI: cd agents/", agentDef.name, "/gui && bun run dev"] }), _jsxs(Text, { dimColor: true, children: ["TUI: cd agents/", agentDef.name, "/tui && bun start"] })] })] }));
240
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Agent created successfully!" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { color: "green", children: "\u25CF" }), " ", _jsx(Text, { bold: true, children: agentDef.name })] }), _jsxs(Text, { dimColor: true, children: [" Model: ", modelLabel] }), agentDef.tools && agentDef.tools.length > 0 && (_jsxs(Text, { dimColor: true, children: [" Tools: ", agentDef.tools.join(", ")] })), _jsxs(Text, { dimColor: true, children: [" Path: ", agentPath] })] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Text, { dimColor: true, children: ["Run agent: town run ", agentDef.name] }), _jsxs(Text, { dimColor: true, children: ["With GUI: town run ", agentDef.name, " --gui"] })] })] }));
241
241
  }
242
242
  }
243
243
  return null;
@@ -275,7 +275,7 @@ export async function runCommand(options) {
275
275
  },
276
276
  });
277
277
  // Start the GUI dev server (no package.json, run vite directly) with detached process group
278
- const guiProcess = spawn("bunx", ["vite"], {
278
+ const guiProcess = spawn("bunx", ["vite", ...(Bun.env.BIND_HOST ? ["--host", Bun.env.BIND_HOST] : [])], {
279
279
  cwd: guiPath,
280
280
  stdio: ["ignore", "pipe", "pipe"], // Pipe stdout/stderr for capture
281
281
  detached: true,
package/dist/index.js CHANGED
@@ -7,7 +7,8 @@ import { integer, string } from "@optique/core/valueparser";
7
7
  import { run } from "@optique/run";
8
8
  import { initForClaudeCode } from "@townco/agent/scaffold";
9
9
  import { isInsideTownProject } from "@townco/agent/storage";
10
- import { API_ROUTES, findRoot } from "@townco/core";
10
+ import { router } from "@townco/api";
11
+ import { findRoot } from "@townco/core";
11
12
  import { updateSchema as updateEnvSchema } from "@townco/env/update-schema";
12
13
  import { createSecret, deleteSecret, genenv, listSecrets, updateSecret, } from "@townco/secret";
13
14
  import { createTRPCClient, httpLink, httpSubscriptionLink, splitLink, } from "@trpc/client";
@@ -111,7 +112,7 @@ const main = async (parser, meta) => await match(run(parser, meta))
111
112
  EventSource,
112
113
  }),
113
114
  false: splitLink({
114
- condition: (op) => op.path === API_ROUTES.UPLOAD_ARCHIVE,
115
+ condition: (op) => op.path === router.uploadArchive.name,
115
116
  true: httpLink({
116
117
  url,
117
118
  transformer: { serialize: (o) => o, deserialize: (o) => o },
@@ -122,18 +123,24 @@ const main = async (parser, meta) => await match(run(parser, meta))
122
123
  ],
123
124
  });
124
125
  console.log("Creating archive...");
125
- const root = await findRoot();
126
+ const root = await findRoot({ rootMarker: "package.json" });
126
127
  const arc = archiver("tar", { gzip: true });
128
+ const chunks = [];
129
+ const done = new Promise((ok, err) => {
130
+ arc.on("data", (chunk) => chunks.push(chunk));
131
+ arc.on("end", () => ok(Buffer.concat(chunks)));
132
+ arc.on("error", err);
133
+ });
127
134
  (await walk({ path: root, ignoreFiles: [".gitignore"] }))
128
135
  .filter((path) => path.split("/")[0] !== ".git")
129
136
  .forEach((path) => {
130
137
  if (!fs.statSync(path).isFile())
131
138
  return;
132
- arc.append(path, { name: path });
139
+ arc.append(fs.createReadStream(path), { name: path });
133
140
  });
134
141
  arc.finalize();
135
142
  console.log("Uploading archive...");
136
- const { sha256, cached } = await client.uploadArchive.mutate(Buffer.from(await Array.fromAsync(arc)));
143
+ const { sha256, cached } = await client.uploadArchive.mutate(await done);
137
144
  console.log(`Archive uploaded: ${sha256} (${cached ? "cached" : "new"})`);
138
145
  console.log("Deploying...");
139
146
  client.deploy.subscribe({ sha256 }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/cli",
3
- "version": "0.1.62",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "town": "./dist/index.js"
@@ -15,7 +15,7 @@
15
15
  "build": "tsc"
16
16
  },
17
17
  "devDependencies": {
18
- "@townco/tsconfig": "0.1.54",
18
+ "@townco/tsconfig": "0.1.62",
19
19
  "@types/archiver": "^7.0.0",
20
20
  "@types/bun": "^1.3.1",
21
21
  "@types/ignore-walk": "^4.0.3",
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@optique/core": "^0.6.2",
27
27
  "@optique/run": "^0.6.2",
28
- "@townco/agent": "0.1.62",
29
- "@townco/core": "0.0.35",
30
- "@townco/debugger": "0.1.12",
31
- "@townco/env": "0.1.7",
32
- "@townco/secret": "0.1.57",
33
- "@townco/ui": "0.1.57",
28
+ "@townco/agent": "0.1.70",
29
+ "@townco/core": "0.0.43",
30
+ "@townco/debugger": "0.1.20",
31
+ "@townco/env": "0.1.15",
32
+ "@townco/secret": "0.1.65",
33
+ "@townco/ui": "0.1.65",
34
34
  "@trpc/client": "^11.7.2",
35
35
  "@types/inquirer": "^9.0.9",
36
36
  "@types/ws": "^8.5.13",