@townco/tui-template 0.1.19 → 0.1.20
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/App.js +5 -2
- package/dist/index.js +21 -18
- package/dist/init-logging.d.ts +1 -0
- package/dist/init-logging.js +8 -0
- package/package.json +3 -3
- package/src/App.tsx +6 -2
- package/src/index.tsx +6 -1
package/dist/App.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AcpClient } from "@townco/ui";
|
|
2
|
+
import { AcpClient, createLogger } from "@townco/ui";
|
|
3
3
|
import { ChatView } from "@townco/ui/tui";
|
|
4
4
|
import { Box, Text } from "ink";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
|
+
const logger = createLogger("tui-app", "debug");
|
|
6
7
|
export function App({ config }) {
|
|
7
8
|
// Create ACP client
|
|
8
9
|
const client = useMemo(() => {
|
|
@@ -17,7 +18,9 @@ export function App({ config }) {
|
|
|
17
18
|
return newClient;
|
|
18
19
|
}
|
|
19
20
|
catch (error) {
|
|
20
|
-
|
|
21
|
+
logger.error("Failed to create client", {
|
|
22
|
+
error: error instanceof Error ? error.message : String(error),
|
|
23
|
+
});
|
|
21
24
|
return null;
|
|
22
25
|
}
|
|
23
26
|
}, [config.agentPath, config.workingDir]);
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { run } from "@optique/run";
|
|
4
|
+
import { createLogger } from "@townco/agent/utils";
|
|
3
5
|
import { render } from "ink";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
import { App } from "./App.js";
|
|
6
7
|
import { cliParser } from "./cli.js";
|
|
7
|
-
|
|
8
|
+
const logger = createLogger("tui-main", "debug");
|
|
8
9
|
/**
|
|
9
10
|
* Agent Hub TUI
|
|
10
11
|
* Terminal chat interface for ACP agents
|
|
11
12
|
*/
|
|
12
13
|
async function main() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
// Parse CLI arguments
|
|
15
|
+
const config = run(cliParser, {
|
|
16
|
+
help: "both", // Show help for both commands and the program
|
|
17
|
+
programName: "agent-tui",
|
|
18
|
+
description: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: "Terminal chat interface for Agent Client Protocol (ACP) agents",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
version: "0.0.1",
|
|
25
|
+
});
|
|
26
|
+
// Render the app
|
|
27
|
+
render(_jsx(App, { config: config }));
|
|
27
28
|
}
|
|
28
29
|
main().catch((error) => {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
logger.fatal("Fatal error", {
|
|
31
|
+
error: error instanceof Error ? error.message : String(error),
|
|
32
|
+
});
|
|
33
|
+
process.exit(1);
|
|
31
34
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize logging configuration for TUI
|
|
3
|
+
* This MUST be imported before any other modules that use the logger
|
|
4
|
+
*/
|
|
5
|
+
import { setSuppressConsoleOutput } from "@townco/ui";
|
|
6
|
+
// Suppress console output from logger in TUI mode
|
|
7
|
+
// Logs are still captured and visible in the Logs tab
|
|
8
|
+
setSuppressConsoleOutput(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/tui-template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-tui": "./dist/index.js"
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@optique/core": "^0.6.2",
|
|
26
26
|
"@optique/run": "^0.6.2",
|
|
27
|
-
"@townco/ui": "0.1.
|
|
27
|
+
"@townco/ui": "0.1.23",
|
|
28
28
|
"ink": "^6.4.0",
|
|
29
29
|
"ink-text-input": "^6.0.0",
|
|
30
30
|
"react": "^19.2.0",
|
|
31
31
|
"zod": "^4.1.12"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@townco/tsconfig": "0.1.
|
|
34
|
+
"@townco/tsconfig": "0.1.20",
|
|
35
35
|
"@types/node": "^24.10.0",
|
|
36
36
|
"@types/react": "^19.2.2",
|
|
37
37
|
"tsx": "^4.20.6",
|
package/src/App.tsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { AcpClient } from "@townco/ui";
|
|
1
|
+
import { AcpClient, createLogger } from "@townco/ui";
|
|
2
2
|
import { ChatView } from "@townco/ui/tui";
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import type { CliConfig } from "./cli.js";
|
|
6
6
|
|
|
7
|
+
const logger = createLogger("tui-app", "debug");
|
|
8
|
+
|
|
7
9
|
export interface AppProps {
|
|
8
10
|
config: CliConfig;
|
|
9
11
|
}
|
|
@@ -21,7 +23,9 @@ export function App({ config }: AppProps) {
|
|
|
21
23
|
});
|
|
22
24
|
return newClient;
|
|
23
25
|
} catch (error) {
|
|
24
|
-
|
|
26
|
+
logger.error("Failed to create client", {
|
|
27
|
+
error: error instanceof Error ? error.message : String(error),
|
|
28
|
+
});
|
|
25
29
|
return null;
|
|
26
30
|
}
|
|
27
31
|
}, [config.agentPath, config.workingDir]);
|
package/src/index.tsx
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { run } from "@optique/run";
|
|
3
|
+
import { createLogger } from "@townco/agent/utils";
|
|
3
4
|
import { render } from "ink";
|
|
4
5
|
import { App } from "./App.js";
|
|
5
6
|
import { cliParser } from "./cli.js";
|
|
6
7
|
|
|
8
|
+
const logger = createLogger("tui-main", "debug");
|
|
9
|
+
|
|
7
10
|
/**
|
|
8
11
|
* Agent Hub TUI
|
|
9
12
|
* Terminal chat interface for ACP agents
|
|
@@ -28,6 +31,8 @@ async function main() {
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
main().catch((error) => {
|
|
31
|
-
|
|
34
|
+
logger.fatal("Fatal error", {
|
|
35
|
+
error: error instanceof Error ? error.message : String(error),
|
|
36
|
+
});
|
|
32
37
|
process.exit(1);
|
|
33
38
|
});
|