@timetotest/cli 0.2.1 → 0.2.3

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.
Files changed (43) hide show
  1. package/README.md +36 -274
  2. package/dist/bin/ttt.js +1 -5
  3. package/dist/bin/ttt.js.map +1 -1
  4. package/dist/package.json +1 -1
  5. package/dist/src/commands/chat/ChatApp.js +97 -31
  6. package/dist/src/commands/chat/ChatApp.js.map +1 -1
  7. package/dist/src/commands/chat/components/AssistantResponse.js +8 -0
  8. package/dist/src/commands/chat/components/AssistantResponse.js.map +1 -0
  9. package/dist/src/commands/chat/components/Banner.js +23 -0
  10. package/dist/src/commands/chat/components/Banner.js.map +1 -0
  11. package/dist/src/commands/chat/components/ChatInput.js +73 -0
  12. package/dist/src/commands/chat/components/ChatInput.js.map +1 -0
  13. package/dist/src/commands/chat/components/Divider.js +7 -0
  14. package/dist/src/commands/chat/components/Divider.js.map +1 -0
  15. package/dist/src/commands/chat/components/MessageBubble.js +8 -0
  16. package/dist/src/commands/chat/components/MessageBubble.js.map +1 -0
  17. package/dist/src/commands/chat/components/SessionInfo.js +11 -0
  18. package/dist/src/commands/chat/components/SessionInfo.js.map +1 -0
  19. package/dist/src/commands/chat/components/StatusIndicator.js +11 -0
  20. package/dist/src/commands/chat/components/StatusIndicator.js.map +1 -0
  21. package/dist/src/commands/chat-ink.js +4 -10
  22. package/dist/src/commands/chat-ink.js.map +1 -1
  23. package/dist/src/commands/login.js +108 -168
  24. package/dist/src/commands/login.js.map +1 -1
  25. package/dist/src/commands/start-test.js +66 -34
  26. package/dist/src/commands/start-test.js.map +1 -1
  27. package/dist/src/commands/test.js +139 -25
  28. package/dist/src/commands/test.js.map +1 -1
  29. package/dist/src/lib/agent-orchestrator.js +4 -81
  30. package/dist/src/lib/agent-orchestrator.js.map +1 -1
  31. package/dist/src/lib/api-types.js +2 -0
  32. package/dist/src/lib/api-types.js.map +1 -0
  33. package/dist/src/lib/events.js +0 -3
  34. package/dist/src/lib/events.js.map +1 -1
  35. package/dist/src/lib/http.js +4 -5
  36. package/dist/src/lib/http.js.map +1 -1
  37. package/dist/src/lib/socket.js +1 -19
  38. package/dist/src/lib/socket.js.map +1 -1
  39. package/dist/src/lib/tool-descriptions.js +2 -2
  40. package/dist/src/lib/tool-descriptions.js.map +1 -1
  41. package/dist/src/lib/tool-executor.js +16 -5
  42. package/dist/src/lib/tool-executor.js.map +1 -1
  43. package/package.json +1 -1
package/README.md CHANGED
@@ -1,304 +1,66 @@
1
1
  # Time to Test CLI
2
2
 
3
- **Transform your testing workflow with an Agent that actually understands your application.**
4
-
5
- The Time to Test CLI is your intelligent testing companion that combines the power of AI reasoning with local execution capabilities. Instead of writing complex test scripts, simply chat with an AI agent that can see your application, interact with it, and generate comprehensive test reports.
3
+ Transform your testing workflow with an agent that understands your application.
6
4
 
7
5
  ## Why Time to Test CLI?
8
6
 
9
- ### **Test Without Writing Code**
10
-
11
- - Describe what you want to test in plain English
12
- - The AI agent understands your application and creates tests automatically
13
- - No more spending hours writing boilerplate test code
14
-
15
- ### **Local-First Testing**
16
-
17
- - Test your localhost applications directly (no tunneling required)
18
- - AI agent runs browser automation and API calls on your machine
19
- - Complete control over your testing environment
20
-
21
- ### **Intelligent Test Discovery**
22
-
23
- - Automatically discovers pages, endpoints, and user flows
24
- - Understands your application's structure and behavior
25
- - Generates comprehensive test coverage without manual exploration
7
+ - Test without writing code: describe scenarios in plain English.
8
+ - Local-first: runs on your machine for fast, private feedback.
9
+ - Intelligent discovery: finds pages, endpoints, and flows to expand coverage.
10
+ - Clear results: human-readable reports that explain what passed and why failures happened.
26
11
 
27
- ### **Rich Reporting**
12
+ ## How it works
28
13
 
29
- - Beautiful PDF reports with screenshots and test results
30
- - Shareable links for team collaboration
31
- - Detailed analysis of what was tested and what failed
14
+ The CLI launches an AI testing agent that plans and executes tests based on your prompts and your app’s behavior.
32
15
 
33
- ## Quick Start
16
+ - Local mode (default): runs browser automation and API checks on your machine; ideal for localhost and PR previews.
17
+ - Cloud mode: optional remote execution without localhost access; better for prod/staging where local access isn’t possible.
18
+ - Post-run: you get an actionable summary and a report capturing steps, assertions, and failures.
34
19
 
35
- ### 1. Install the CLI
20
+ ## Quick start
36
21
 
37
22
  ```bash
38
23
  npm install -g @timetotest/cli
39
- ```
40
-
41
- ### 2. Start Testing (Local Mode - Default)
42
24
 
43
- ```bash
44
- # Launch interactive chat with AI agent
25
+ # Start an interactive local session (default)
45
26
  ttt
46
27
 
47
- # Or test a specific URL with a prompt
48
- ttt test --url http://localhost:3000 --prompt "Test the user login flow"
49
- ```
50
-
51
- ### 3. Cloud Mode (Optional)
52
-
53
- ```bash
54
- # Use remote AI agent (no localhost access)
55
- ttt --cloud
56
- ```
57
-
58
- ## How It Works
59
-
60
- ### Local Mode (Default)
61
-
62
- When you run `ttt`, you get an AI agent that:
63
-
64
- - **Runs locally** on your machine using Playwright and HTTP clients
65
- - **Sees your application** through browser automation
66
- - **Understands your APIs** through intelligent discovery
67
- - **Learns from interactions** to improve test coverage
68
- - **Generates reports** with screenshots and detailed analysis
69
-
70
- ### Cloud Mode
71
-
72
- When you run `ttt --cloud`, you get:
73
-
74
- - **Remote AI agent** with no access to your localhost
75
- - **Same conversation interface** but with cloud-based execution
76
- - **Secure testing** for production environments
77
-
78
- ## Key Features
79
-
80
- ### **UI Testing**
81
-
82
- - **Smart Navigation**: AI understands your app's structure and navigates intelligently
83
- - **Element Interaction**: Click, type, hover with natural language descriptions
84
- - **Visual Validation**: Automatic screenshot capture and comparison
85
- - **User Flow Testing**: Complete user journeys from login to checkout
86
-
87
- ### **API Testing**
88
-
89
- - **Automatic Discovery**: Finds and catalogs all your API endpoints
90
- - **Request Building**: Generates proper requests with headers and payloads
91
- - **Response Validation**: Checks status codes, schemas, and data integrity
92
- - **Authentication Handling**: Manages tokens and session state
93
-
94
- ### **Advanced Capabilities**
95
-
96
- - **Session Management**: Resume conversations and test sessions
97
- - **Artifact Storage**: Screenshots, logs, and reports saved locally
98
- - **Mode Switching**: Seamlessly switch between UI and API testing
99
- - **Legacy Command Support**: Existing commands still work with chat integration
100
-
101
- ## Usage Examples
102
-
103
- ### Interactive Chat Mode
104
-
105
- ```bash
106
- # Start a conversation with the AI agent
107
- ttt
108
-
109
- # The agent will help you:
110
- # - Discover your application
111
- # - Plan test scenarios
112
- # - Execute tests locally
113
- # - Generate reports
114
- ```
115
-
116
- ### Direct Testing
117
-
118
- ```bash
119
- # Test a web application
120
- ttt test --url http://localhost:3000 --prompt "Test the shopping cart functionality"
121
-
122
- # Test an API
123
- ttt test --url https://api.myapp.com --type api --prompt "Validate all user endpoints"
124
-
125
- # Generate a comprehensive report
126
- ttt test --url http://localhost:3000 --prompt "Full regression test" --report ./test-report.pdf
127
- ```
128
-
129
- ### Session Management
130
-
131
- ```bash
132
- # List your test sessions
133
- ttt list-sessions
134
-
135
- # Resume a previous session
136
- ttt resume session-123
137
-
138
- # Clear old sessions
139
- ttt clear-session session-123
140
- ```
141
-
142
- ## Configuration
143
-
144
- ### Environment Variables
145
-
146
- ```bash
147
- # Default to local mode (no need to set)
148
- export TTT_MODE=local
149
-
150
- # Force cloud mode
151
- export TTT_MODE=remote
152
-
153
- # Backend API configuration
154
- export TTT_API_URL=https://api.timetotest.tech
155
- export TTT_TOKEN=your-firebase-token
156
-
157
- # Allow network access in local mode (optional)
158
- export TTT_ALLOW_NET=true
28
+ # Run a cloud test with a prompt (automatically handles tunnels & project context)
29
+ ttt test "Smoke test the login flow" --url http://localhost:3000
159
30
  ```
160
31
 
161
- ### Authentication
32
+ ## What makes this different
162
33
 
163
- ```bash
164
- # Interactive login
165
- ttt login
166
-
167
- # Headless login (for CI/CD)
168
- ttt login --email user@example.com --password password --api-key firebase-key
34
+ - Natural language over boilerplate tests.
35
+ - The agent explores and adapts to your app instead of running only predefined scripts.
36
+ - Zero config to test localhost; minimal friction to get useful feedback.
169
37
 
170
- # Direct token
171
- ttt login --token your-firebase-token
172
- ```
173
-
174
- ## Integration Examples
175
-
176
- ### GitHub Actions
177
-
178
- ```yaml
179
- name: AI-Powered Testing
180
- on: [push, pull_request]
181
-
182
- jobs:
183
- test:
184
- runs-on: ubuntu-latest
185
- steps:
186
- - uses: actions/checkout@v4
187
-
188
- - name: Setup Node.js
189
- uses: actions/setup-node@v4
190
- with:
191
- node-version: "20"
192
-
193
- - name: Install CLI
194
- run: npm install -g @timetotest/cli
195
-
196
- - name: Start Application
197
- run: |
198
- npm ci
199
- npm run build
200
- npm start &
201
- sleep 10
202
-
203
- - name: Login to Time to Test
204
- env:
205
- TTT_EMAIL: ${{ secrets.TTT_EMAIL }}
206
- TTT_PASSWORD: ${{ secrets.TTT_PASSWORD }}
207
- TTT_FIREBASE_API_KEY: ${{ secrets.TTT_FIREBASE_API_KEY }}
208
- run: ttt login --email "$TTT_EMAIL" --password "$TTT_PASSWORD" --api-key "$TTT_FIREBASE_API_KEY"
209
-
210
- - name: Run AI Tests
211
- run: |
212
- ttt test \
213
- --url http://localhost:3000 \
214
- --prompt "Comprehensive regression test for main user flows" \
215
- --report ./test-report.pdf \
216
- --wait
217
-
218
- - name: Upload Test Report
219
- uses: actions/upload-artifact@v4
220
- with:
221
- name: test-report
222
- path: ./test-report.pdf
223
- ```
38
+ ## Privacy & security
224
39
 
225
- ### Local Development Workflow
40
+ - Local mode keeps execution and data on your machine.
41
+ - Authentication uses secure tokens; you control what the agent can access.
226
42
 
227
- ```bash
228
- # Start your app
229
- npm start
230
-
231
- # In another terminal, test it
232
- ttt test --url http://localhost:3000 --prompt "Test the new feature I just built"
233
-
234
- # Get a detailed report
235
- ttt test --url http://localhost:3000 --prompt "Full test suite" --report ./reports/latest.pdf
236
- ```
237
-
238
- ## Commands Reference
239
-
240
- ### Core Commands
241
-
242
- - `ttt` - Start interactive chat (local mode)
243
- - `ttt --cloud` - Start interactive chat (cloud mode)
244
- - `ttt test` - Run a specific test with options
245
- - `ttt login` - Authenticate with Time to Test
246
-
247
- ### Session Management
248
-
249
- - `ttt list-sessions` - Show all test sessions
250
- - `ttt resume <session-id>` - Continue a previous session
251
- - `ttt clear-session <session-id>` - Delete a session
252
-
253
- ### Legacy Commands (Still Supported)
254
-
255
- - `ttt start-test <prompt>` - Start test from prompt
256
- - `ttt stream <test-id>` - Monitor test progress
257
- - `ttt status <test-id>` - Check test status
258
- - `ttt report <test-id>` - Generate report
259
- - `ttt share <test-id>` - Create shareable link
260
-
261
- ## What Makes This Different?
262
-
263
- ### Traditional Testing Tools
264
-
265
- - Require writing test code
266
- - Need manual test case creation
267
- - Limited to predefined scenarios
268
- - Complex setup and maintenance
269
-
270
- ### Time to Test CLI
43
+ ## Requirements
271
44
 
272
- - Natural language test descriptions
273
- - AI discovers test scenarios automatically
274
- - Adapts to your application's behavior
275
- - Zero configuration for local testing
45
+ - Node.js 18+
46
+ - macOS, Linux, or Windows
47
+ - Chrome/Chromium available for UI testing
276
48
 
277
- ## Privacy & Security
49
+ ## Getting help
278
50
 
279
- - **Local Mode**: All testing happens on your machine
280
- - **No Data Collection**: Your application data stays private
281
- - **Secure Authentication**: Firebase-based auth with token management
282
- - **Configurable Access**: Control what the agent can access
51
+ - Docs and updates: https://timetotest.tech
52
+ - Issues and support: use the support links on the website
283
53
 
284
- ## Getting Help
54
+ ## Social callouts
285
55
 
286
- - **Documentation**: [timetotest.tech](https://timetotest.tech)
287
- - **Support**: Visit our website for help and updates
288
- - **Issues**: Report bugs and feature requests through our support channels
56
+ If this helps you ship faster, please ⭐ star the repo and share it.
289
57
 
290
- ## Requirements
58
+ Tweet about it: https://twitter.com/intent/tweet?text=I%20just%20tried%20Time%20to%20Test%20CLI%20%E2%80%94%20AI-powered%20tests%20from%20natural%20language.%20Zero%20config%20for%20localhost!&url=https://timetotest.tech
291
59
 
292
- - **Node.js**: 18 or higher
293
- - **Operating System**: macOS, Linux, or Windows
294
- - **Browser**: Chrome/Chromium (for UI testing)
295
- - **Network**: Internet connection for AI reasoning (local execution)
60
+ ## Who it’s for
296
61
 
297
- ---
62
+ Built for:
298
63
 
299
- **Ready to revolutionize your testing workflow?** Install the CLI and start chatting with your AI testing agent today!
300
-
301
- ```bash
302
- npm install -g @timetotest/cli
303
- ttt
304
- ```
64
+ - Developers who want smoke tests without writing test code
65
+ - Startup teams needing fast feedback on PRs
66
+ - QA engineers exploring flows rapidly in staging
package/dist/bin/ttt.js CHANGED
@@ -8,8 +8,6 @@ import { restart } from "../src/commands/restart.js";
8
8
  import { stream } from "../src/commands/stream.js";
9
9
  import { report } from "../src/commands/report.js";
10
10
  import { share } from "../src/commands/share.js";
11
- import { askInk as ask } from "../src/commands/ask-ink.js";
12
- import { startTest } from "../src/commands/start-test.js";
13
11
  import { applyStyledHelpRecursively } from "../src/lib/help.js";
14
12
  import { promptForUpdateIfAvailable } from "../src/lib/update.js";
15
13
  import { chatInk as chat } from "../src/commands/chat-ink.js";
@@ -23,12 +21,10 @@ program.addCommand(restart);
23
21
  program.addCommand(stream);
24
22
  program.addCommand(report);
25
23
  program.addCommand(share);
26
- program.addCommand(ask);
27
- program.addCommand(startTest);
28
24
  program.addCommand(chat);
29
25
  applyStyledHelpRecursively(program, "ttt");
30
26
  await promptForUpdateIfAvailable();
31
- // Default to `ask` when no subcommand is provided
27
+ // Default to `chat` (local mode) when no subcommand is provided
32
28
  if (process.argv.length <= 2) {
33
29
  process.argv.push("chat");
34
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ttt.js","sourceRoot":"","sources":["../../bin/ttt.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC;AACn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,CAAC,CAAC;AAC1B,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC5B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAE1B,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAEzB,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,0BAA0B,EAAE,CAAC;AACnC,gEAAgE;AAChE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AACD,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timetotest/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Time to Test CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,16 +1,58 @@
1
1
  import React, { useState, useEffect } from "react";
2
- import { Box, Text, useApp } from "ink";
2
+ import { Box, Text, useApp, Static } from "ink";
3
3
  import os from "node:os";
4
- import { Banner } from "../ask/components/Banner.js";
5
- import { ChatInput } from "../ask/components/ChatInput.js";
6
- import { MessageBubble } from "../ask/components/MessageBubble.js";
7
- import { AssistantResponse } from "../ask/components/AssistantResponse.js";
8
- import { StatusIndicator } from "../ask/components/StatusIndicator.js";
4
+ import { Banner } from "./components/Banner.js";
5
+ import { ChatInput } from "./components/ChatInput.js";
6
+ import { MessageBubble } from "./components/MessageBubble.js";
7
+ import { AssistantResponse } from "./components/AssistantResponse.js";
8
+ import { StatusIndicator } from "./components/StatusIndicator.js";
9
+ const DEFAULT_COMMANDS = [
10
+ {
11
+ name: "help",
12
+ description: "Show available commands",
13
+ value: "/help",
14
+ label: "/help",
15
+ },
16
+ {
17
+ name: "clear",
18
+ description: "Clear chat history",
19
+ value: "/clear",
20
+ label: "/clear",
21
+ },
22
+ {
23
+ name: "reset",
24
+ description: "Restart the session",
25
+ value: "/reset",
26
+ label: "/reset",
27
+ },
28
+ {
29
+ name: "config",
30
+ description: "Show current configuration",
31
+ value: "/config",
32
+ label: "/config",
33
+ },
34
+ {
35
+ name: "mode",
36
+ description: "Switch between local/cloud mode",
37
+ value: "/mode",
38
+ label: "/mode",
39
+ },
40
+ ];
9
41
  export const ChatApp = ({ user, context, slashCommands, onUserMessage, onSlashCommand, onExit, onCancel, initialMessages = [], }) => {
42
+ // Merge default commands with passed commands
43
+ const allSlashCommands = [...DEFAULT_COMMANDS, ...slashCommands];
10
44
  const { exit } = useApp();
11
- const [messages, setMessages] = useState(initialMessages);
45
+ // Initialize messages with banner if empty
46
+ const [messages, setMessages] = useState(() => {
47
+ if (initialMessages.length > 0)
48
+ return initialMessages;
49
+ return [{
50
+ id: "banner",
51
+ type: "banner",
52
+ content: "banner"
53
+ }];
54
+ });
12
55
  const [status, setStatus] = useState(null);
13
- const [showIntro, setShowIntro] = useState(true);
14
56
  const [inputDisabled, setInputDisabled] = useState(false);
15
57
  const [chatContext, setChatContext] = useState(context);
16
58
  // Public methods to update UI from parent
@@ -43,9 +85,9 @@ export const ChatApp = ({ user, context, slashCommands, onUserMessage, onSlashCo
43
85
  const trimmed = value.trim();
44
86
  const normalized = trimmed.toLowerCase();
45
87
  // Hide intro after first message
46
- if (showIntro) {
47
- setShowIntro(false);
48
- }
88
+ // if (showIntro) {
89
+ // setShowIntro(false);
90
+ // }
49
91
  // Check for exit commands
50
92
  if (normalized === "exit" || normalized === "quit") {
51
93
  exit();
@@ -55,6 +97,19 @@ export const ChatApp = ({ user, context, slashCommands, onUserMessage, onSlashCo
55
97
  // Check for slash commands
56
98
  if (trimmed.startsWith("/")) {
57
99
  const [cmd, ...args] = trimmed.slice(1).split(/\s+/);
100
+ // Handle client-side commands
101
+ if (cmd === "clear") {
102
+ setMessages([]);
103
+ return;
104
+ }
105
+ if (cmd === "config") {
106
+ setMessages(prev => [...prev, {
107
+ id: Date.now().toString(),
108
+ type: "system",
109
+ content: `Current Configuration:\nUser: ${user}\nMode: ${chatContext.mode}\nSession ID: ${chatContext.sessionId}`
110
+ }]);
111
+ return;
112
+ }
58
113
  const result = await onSlashCommand(cmd, args);
59
114
  if (result === "exit") {
60
115
  exit();
@@ -77,9 +132,11 @@ export const ChatApp = ({ user, context, slashCommands, onUserMessage, onSlashCo
77
132
  onCancel?.();
78
133
  };
79
134
  const getSuggestions = (input) => {
80
- const query = (input || "").replace(/^\//, "").toLowerCase();
81
- return slashCommands
82
- .filter((cmd) => cmd.value.includes(query))
135
+ if (!input.startsWith("/"))
136
+ return [];
137
+ const query = input.toLowerCase();
138
+ return allSlashCommands
139
+ .filter((cmd) => cmd.value.toLowerCase().startsWith(query))
83
140
  .map((cmd) => ({
84
141
  label: cmd.label,
85
142
  value: cmd.value,
@@ -93,33 +150,42 @@ export const ChatApp = ({ user, context, slashCommands, onUserMessage, onSlashCo
93
150
  : workspacePath;
94
151
  const statusLine = `path: ${displayPath} · mode: ${chatContext.mode}`;
95
152
  const footerLines = ["Press ESC to stop"];
96
- return (React.createElement(Box, { flexDirection: "column", padding: 1 },
97
- showIntro && (React.createElement(React.Fragment, null,
98
- React.createElement(Banner, null),
99
- React.createElement(Box, { marginBottom: 1 },
100
- React.createElement(Text, null,
101
- React.createElement(Text, { dimColor: true }, "\u2022"),
102
- React.createElement(Text, null, " "),
103
- React.createElement(Text, { color: "gray" }, "Signed in as"),
104
- React.createElement(Text, null, " "),
105
- React.createElement(Text, { color: "white" }, user))))),
106
- messages.map((message, index) => {
153
+ return (React.createElement(Box, { flexDirection: "column" },
154
+ React.createElement(Static, { items: messages }, (message, index) => {
107
155
  if (message.type === "user") {
108
156
  return (React.createElement(Box, { key: message.id },
109
157
  React.createElement(MessageBubble, { message: message.content })));
110
158
  }
111
159
  else if (message.type === "assistant") {
112
- return (React.createElement(Box, { key: message.id },
160
+ return (React.createElement(Box, { key: message.id, paddingX: 1 },
113
161
  React.createElement(AssistantResponse, { content: message.content, isError: message.isError })));
114
162
  }
115
163
  else if (message.type === "system") {
116
- return (React.createElement(Box, { key: message.id, marginTop: index === 0 ? 0 : 1 },
164
+ return (React.createElement(Box, { key: message.id, marginTop: index === 0 ? 0 : 1, paddingX: 1 },
117
165
  React.createElement(Text, { color: "gray" }, message.content)));
118
166
  }
119
- return null;
167
+ else if (message.type === "banner") {
168
+ return (React.createElement(Box, { key: message.id, paddingX: 0, marginBottom: 1 },
169
+ React.createElement(Box, { flexDirection: "column" },
170
+ React.createElement(Banner, { user: user, mode: chatContext.mode, path: displayPath }),
171
+ React.createElement(Box, { marginTop: 1, flexDirection: "column" },
172
+ React.createElement(Text, { color: "gray" }, "To get started, describe a task or try one of these commands:"),
173
+ React.createElement(Box, { marginTop: 1, flexDirection: "column" }, allSlashCommands
174
+ .filter(cmd => ["/help", "/mode", "/clear", "/reset"].includes(cmd.value))
175
+ .map(cmd => (React.createElement(Text, { key: cmd.value },
176
+ React.createElement(Text, { color: "white", bold: true }, cmd.label),
177
+ React.createElement(Text, { color: "gray" },
178
+ " \u2013 ",
179
+ cmd.description)))))))));
180
+ }
181
+ return React.createElement(Box, { key: message.id });
120
182
  }),
121
- status && (React.createElement(Box, { marginTop: 1, marginBottom: 1 },
122
- React.createElement(StatusIndicator, { message: status.text, type: status.type }))),
123
- React.createElement(ChatInput, { placeholder: "Ask anything or use /help for commands", onSubmit: handleSubmit, onCancel: handleCancel, statusLine: statusLine, footerLines: footerLines, getSuggestions: getSuggestions, disabled: inputDisabled })));
183
+ React.createElement(Box, { flexDirection: "column" },
184
+ React.createElement(Box, { height: 1 }, status ? (React.createElement(StatusIndicator, { message: status.text, type: status.type })) : (React.createElement(Text, null, " "))),
185
+ React.createElement(Box, { height: 1, paddingX: 1 },
186
+ React.createElement(Text, { color: "gray", dimColor: true }, "100% context left")),
187
+ React.createElement(Box, null,
188
+ React.createElement(ChatInput, { placeholder: "Ask anything or use /help for commands", onSubmit: handleSubmit, onCancel: handleCancel, getSuggestions: getSuggestions, disabled: inputDisabled })),
189
+ React.createElement(Box, { height: 1, paddingX: 1 }, footerLines && footerLines.length > 0 ? (React.createElement(Text, { color: "gray", dimColor: true }, footerLines[0])) : (React.createElement(Text, null, " "))))));
124
190
  };
125
191
  //# sourceMappingURL=ChatApp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatApp.js","sourceRoot":"","sources":["../../../../src/commands/chat/ChatApp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAEnD,OAAO,EAAC,SAAS,EAAC,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAC,eAAe,EAAC,MAAM,sCAAsC,CAAC;AA4CrE,MAAM,CAAC,MAAM,OAAO,GAA2B,CAAC,EAC9C,IAAI,EACJ,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,MAAM,EACN,QAAQ,EACR,eAAe,GAAG,EAAE,GACrB,EAAE,EAAE;IACH,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAY,eAAe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,CACF,oBAAC,IAAI,YAAS,CACf,CACG,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { Box, Text } from "ink";
3
+ export const AssistantResponse = ({ content, isError }) => {
4
+ return (React.createElement(Box, { marginBottom: 1, flexDirection: "column" },
5
+ React.createElement(Text, { color: isError ? "red" : "green", bold: true }, "Agent:"),
6
+ React.createElement(Text, null, content)));
7
+ };
8
+ //# sourceMappingURL=AssistantResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantResponse.js","sourceRoot":"","sources":["../../../../../src/commands/chat/components/AssistantResponse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAGzB,CAAC,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,EAAE;IAC1B,OAAO,CACL,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ;QAC1C,oBAAC,IAAI,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,mBAErC;QACP,oBAAC,IAAI,QAAE,OAAO,CAAQ,CAClB,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { Text, Box } from "ink";
3
+ export const Banner = ({ user, mode, path, version = "v0.63.0" }) => {
4
+ return (React.createElement(Box, { borderStyle: "round", borderColor: "gray", paddingX: 1, flexDirection: "column", marginBottom: 1 },
5
+ React.createElement(Box, { marginBottom: 1 },
6
+ React.createElement(Text, { color: "gray" },
7
+ ">_ ",
8
+ React.createElement(Text, { color: "white", bold: true }, "TimeToTest CLI"),
9
+ " ",
10
+ React.createElement(Text, { color: "gray" },
11
+ "(",
12
+ version,
13
+ ")"))),
14
+ React.createElement(Box, null,
15
+ React.createElement(Text, { color: "gray" }, "directory: "),
16
+ React.createElement(Text, { color: "white" }, path)),
17
+ React.createElement(Box, null,
18
+ React.createElement(Text, { color: "gray" }, "user: "),
19
+ React.createElement(Text, { color: "white" }, user),
20
+ React.createElement(Text, { color: "gray" }, " \u00B7 mode: "),
21
+ React.createElement(Text, { color: "white" }, mode))));
22
+ };
23
+ //# sourceMappingURL=Banner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../../../src/commands/chat/components/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAE,GAAG,EAAC,MAAM,KAAK,CAAC;AAS9B,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,GAAG,SAAS,EAAC,EAAE,EAAE;IACvF,OAAO,CACL,oBAAC,GAAG,IACF,WAAW,EAAC,OAAO,EACnB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,aAAa,EAAC,QAAQ,EACtB,YAAY,EAAE,CAAC;QAEf,oBAAC,GAAG,IAAC,YAAY,EAAE,CAAC;YAClB,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM;gBACf,KAAK;gBACN,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,2BAEjB;gBAAC,GAAG;gBACX,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM;;oBAAG,OAAO;wBAAS,CAChC,CACH;QAIN,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAAmB;YACrC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,IAAE,IAAI,CAAQ,CAC7B;QAEN,oBAAC,GAAG;YACF,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,aAAc;YAChC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,IAAE,IAAI,CAAQ;YACjC,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,qBAAiB;YACnC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,IAAE,IAAI,CAAQ,CAC7B,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}