@treasuredata/tdx 0.1.3 → 0.1.5
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/README.md +330 -45
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.d.ts +2 -1
- package/dist/client/http-client.d.ts.map +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/http-client.js.map +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.d.ts +26 -0
- package/dist/commands/api-command.d.ts.map +1 -0
- package/dist/commands/api-command.js +1 -0
- package/dist/commands/api-command.js.map +1 -0
- package/dist/commands/chat-command.d.ts +2 -2
- package/dist/commands/chat-command.d.ts.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/chat-command.js.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.d.ts +14 -0
- package/dist/commands/context-command.d.ts.map +1 -0
- package/dist/commands/context-command.js +1 -0
- package/dist/commands/context-command.js.map +1 -0
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/profiles-command.d.ts +16 -0
- package/dist/commands/profiles-command.d.ts.map +1 -0
- package/dist/commands/profiles-command.js +1 -0
- package/dist/commands/profiles-command.js.map +1 -0
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.d.ts +18 -0
- package/dist/commands/use-command.d.ts.map +1 -0
- package/dist/commands/use-command.js +1 -0
- package/dist/commands/use-command.js.map +1 -0
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.d.ts +15 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/global-context.d.ts +48 -0
- package/dist/core/global-context.d.ts.map +1 -0
- package/dist/core/global-context.js +1 -0
- package/dist/core/global-context.js.map +1 -0
- package/dist/core/profile.d.ts +117 -0
- package/dist/core/profile.d.ts.map +1 -0
- package/dist/core/profile.js +1 -0
- package/dist/core/profile.js.map +1 -0
- package/dist/core/project-config.d.ts +54 -0
- package/dist/core/project-config.d.ts.map +1 -0
- package/dist/core/project-config.js +1 -0
- package/dist/core/project-config.js.map +1 -0
- package/dist/core/session.d.ts +73 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +1 -0
- package/dist/core/session.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/sdk/api.d.ts +110 -0
- package/dist/sdk/api.d.ts.map +1 -0
- package/dist/sdk/api.js +1 -0
- package/dist/sdk/api.js.map +1 -0
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/file-permissions.d.ts +41 -0
- package/dist/utils/file-permissions.d.ts.map +1 -0
- package/dist/utils/file-permissions.js +1 -0
- package/dist/utils/file-permissions.js.map +1 -0
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +18 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +1 -0
- package/dist/utils/process.js.map +1 -0
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,42 +11,6 @@ A modern, AI-native command-line interface for Treasure Data, optimized for both
|
|
|
11
11
|
- 🚀 **Modern Distribution**: Install via `npx` or `npm` without prior setup
|
|
12
12
|
- ⚡ **Fast & Efficient**: Built with TypeScript on Node.js 24+
|
|
13
13
|
|
|
14
|
-
## Architecture
|
|
15
|
-
|
|
16
|
-
The `tdx` project is designed with a layered architecture that separates the CLI interface from the core SDK, allowing the TypeScript SDK to be used in multiple environments:
|
|
17
|
-
|
|
18
|
-
```mermaid
|
|
19
|
-
graph TD
|
|
20
|
-
subgraph "Client Environments"
|
|
21
|
-
NodeJS[Node.JS/CLI<br/>tdx commands]
|
|
22
|
-
Browser[Web Browser<br/>Client-side]
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
subgraph "TDX SDK - TypeScript"
|
|
26
|
-
SDK[TDX SDK<br/>TypeScript/JavaScript API]
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
subgraph "Treasure Data APIs"
|
|
30
|
-
TD[TD REST API<br/>Databases, Tables, Jobs]
|
|
31
|
-
Trino[Trino Streaming API<br/>Query Execution]
|
|
32
|
-
CDP[CDP API<br/>Segments, Activations]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
NodeJS --> SDK
|
|
36
|
-
Browser --> SDK
|
|
37
|
-
|
|
38
|
-
SDK -->|HTTPS| TD
|
|
39
|
-
SDK -->|HTTPS| Trino
|
|
40
|
-
SDK -->|HTTPS| CDP
|
|
41
|
-
|
|
42
|
-
style NodeJS fill:#d4f1d4
|
|
43
|
-
style Browser fill:#ffd4d4
|
|
44
|
-
style SDK fill:#fff5cc
|
|
45
|
-
style TD fill:#e8e8f0
|
|
46
|
-
style CDP fill:#e8e8f0
|
|
47
|
-
style Trino fill:#e8e8f0
|
|
48
|
-
```
|
|
49
|
-
|
|
50
14
|
## Installation
|
|
51
15
|
|
|
52
16
|
```bash
|
|
@@ -115,8 +79,154 @@ tdx databases --format table
|
|
|
115
79
|
# Chat with AI (simplified - uses default agent)
|
|
116
80
|
tdx chat "Show me customer revenue trends"
|
|
117
81
|
|
|
118
|
-
# Continue previous chat
|
|
119
|
-
tdx chat
|
|
82
|
+
# Continue previous chat (default behavior)
|
|
83
|
+
tdx chat "What about last month?"
|
|
84
|
+
|
|
85
|
+
# Start a new chat session
|
|
86
|
+
tdx chat --new "Tell me about data pipelines"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Context Management
|
|
90
|
+
|
|
91
|
+
`tdx` provides a unified context system to reduce repetitive flags across commands. Context is resolved from multiple sources with the following priority:
|
|
92
|
+
|
|
93
|
+
1. **CLI flags** (highest priority) - `--database`, `--site`, etc.
|
|
94
|
+
2. **Session context** - Shell-scoped overrides set with `tdx use`
|
|
95
|
+
3. **Project config** - Per-project defaults in `tdx.json`
|
|
96
|
+
4. **Profile config** - Account-specific settings in `~/.config/tdx/profiles/<name>/tdx.json`
|
|
97
|
+
5. **Global config** - Fallback defaults in `~/.config/tdx/tdx.json`
|
|
98
|
+
|
|
99
|
+
### Profiles
|
|
100
|
+
|
|
101
|
+
Profiles store long-lived account configurations for easy switching between environments:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# List all profiles with details
|
|
105
|
+
tdx profiles
|
|
106
|
+
|
|
107
|
+
# Switch active profile
|
|
108
|
+
tdx use profile production
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Profile Structure:**
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
~/.config/tdx/profiles/
|
|
115
|
+
├── production/
|
|
116
|
+
│ ├── tdx.json # Configuration (site, database, llm_project, etc.)
|
|
117
|
+
│ └── .env # Credentials (TD_API_KEY)
|
|
118
|
+
└── dev/
|
|
119
|
+
├── tdx.json # Development environment config
|
|
120
|
+
└── .env # Development credentials
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Example Production Profile** (`~/.config/tdx/profiles/production/tdx.json`):
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"description": "Production environment for US region",
|
|
127
|
+
"site": "us01",
|
|
128
|
+
"database": "analytics",
|
|
129
|
+
"llm_project": "DataAnalytics"
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Example Development Profile** (`~/.config/tdx/profiles/dev/tdx.json`):
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"description": "Development and testing environment",
|
|
137
|
+
"site": "jp01",
|
|
138
|
+
"database": "dev_db"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Note:** The `description` field is optional but recommended for documenting what each profile is for.
|
|
143
|
+
|
|
144
|
+
### Session Context
|
|
145
|
+
|
|
146
|
+
Set temporary overrides for the current shell session:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Set session database
|
|
150
|
+
tdx use database mydb
|
|
151
|
+
|
|
152
|
+
# Set session LLM project
|
|
153
|
+
tdx use llm_project Analytics
|
|
154
|
+
|
|
155
|
+
# Clear session context
|
|
156
|
+
tdx use --clear
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**How Session Scope Works:**
|
|
160
|
+
|
|
161
|
+
Sessions are automatically scoped to your current shell window. Each terminal window/tab has a unique process ID (PID), and `tdx` uses the parent process ID (PPID) to identify and isolate sessions. This means:
|
|
162
|
+
|
|
163
|
+
- **Automatic isolation**: Each terminal window maintains its own independent session context
|
|
164
|
+
- **No manual setup**: Sessions are created automatically when you run `tdx use` commands
|
|
165
|
+
- **Persistent within shell**: Context persists across multiple commands in the same terminal
|
|
166
|
+
- **Automatic cleanup**: Sessions expire after 24 hours or when the shell is closed
|
|
167
|
+
|
|
168
|
+
**Example:**
|
|
169
|
+
```bash
|
|
170
|
+
# Terminal Window 1
|
|
171
|
+
tdx use database analytics
|
|
172
|
+
tdx tables # Uses database: analytics
|
|
173
|
+
|
|
174
|
+
# Terminal Window 2 (different PID)
|
|
175
|
+
tdx tables # Uses default database (separate session)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Session context persists until the shell is closed or explicitly cleared with `tdx use --clear`.
|
|
179
|
+
|
|
180
|
+
**Note:** For advanced session sharing across multiple processes or shells, see [Session ID Option](#session-id-option) in the Advanced Options section.
|
|
181
|
+
|
|
182
|
+
### Project Config
|
|
183
|
+
|
|
184
|
+
Store per-project defaults in `tdx.json` at your project root:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"database": "customer_analytics",
|
|
189
|
+
"parent_segment": "active_users",
|
|
190
|
+
"llm_project": "CustomerInsights"
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Available Configuration Parameters:**
|
|
195
|
+
|
|
196
|
+
| Parameter | Type | Description | Example |
|
|
197
|
+
|-----------|------|-------------|---------|
|
|
198
|
+
| `description` | string | Optional description of the configuration | `"Production environment"` |
|
|
199
|
+
| `site` | string | TD site/region (us01, jp01, eu01, ap02) | `"us01"` |
|
|
200
|
+
| `database` | string | Default database for queries and table commands | `"analytics"` |
|
|
201
|
+
| `parent_segment` | string | Default parent segment for CDP commands | `"active_users"` |
|
|
202
|
+
| `llm_project` | string | Default LLM project for agent commands | `"DataAnalytics"` |
|
|
203
|
+
|
|
204
|
+
**Security Note:** Project configs should never contain API keys since they may be committed to version control. Use profiles or global `.env` files for credentials.
|
|
205
|
+
|
|
206
|
+
### View Context
|
|
207
|
+
|
|
208
|
+
See the currently resolved context and where each value comes from:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Show current context
|
|
212
|
+
tdx context
|
|
213
|
+
|
|
214
|
+
# Show context with sources (debugging)
|
|
215
|
+
tdx context --debug
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Example output:
|
|
219
|
+
```
|
|
220
|
+
[context]
|
|
221
|
+
site: us01 (global: ~/.config/tdx/tdx.json)
|
|
222
|
+
database: analytics (session)
|
|
223
|
+
llm_project: DataAnalytics (profile: production)
|
|
224
|
+
profile: production (active)
|
|
225
|
+
|
|
226
|
+
Configuration Files:
|
|
227
|
+
Session: /Users/user/.config/tdx/sessions/12345.json ✓
|
|
228
|
+
Profile: /Users/user/.config/tdx/profiles/production/tdx.json ✓
|
|
229
|
+
Global: /Users/user/.config/tdx/tdx.json ✓
|
|
120
230
|
```
|
|
121
231
|
|
|
122
232
|
## Available Commands
|
|
@@ -181,20 +291,23 @@ Simplified top-level command for chatting with LLM agents.
|
|
|
181
291
|
|
|
182
292
|
| Command | Description | Example |
|
|
183
293
|
|---------|-------------|---------|
|
|
184
|
-
| `chat <message>` | Chat
|
|
294
|
+
| `chat <message>` | Chat (continues last session by default) | `tdx chat "Analyze my data"` |
|
|
185
295
|
| `chat <message> --agent <ref>` | Chat with specific agent | `tdx chat "Hello" --agent "Project/Agent"` |
|
|
186
296
|
| `chat <message> --model <name>` | Chat using specific model | `tdx chat "Help" --model "gpt-5"` |
|
|
187
297
|
| `chat <message> --temperature <n>` | Set temperature (0.0-2.0, default: 0.7) | `tdx chat "Be creative" --temperature 1.2` |
|
|
188
|
-
| `chat <message> --
|
|
298
|
+
| `chat <message> --new` | Start a new chat session | `tdx chat --new "Fresh conversation"` |
|
|
189
299
|
|
|
190
300
|
**Examples**:
|
|
191
301
|
```bash
|
|
192
302
|
# Simple chat (uses default agent with claude-4.5-sonnet)
|
|
193
303
|
tdx chat "Show me the top customers by revenue"
|
|
194
304
|
|
|
195
|
-
# Continue previous conversation
|
|
196
|
-
tdx chat
|
|
197
|
-
tdx chat
|
|
305
|
+
# Continue previous conversation (default behavior)
|
|
306
|
+
tdx chat "What about last quarter?"
|
|
307
|
+
tdx chat "And the quarter before that?"
|
|
308
|
+
|
|
309
|
+
# Start a new conversation
|
|
310
|
+
tdx chat --new "Tell me about data modeling best practices"
|
|
198
311
|
|
|
199
312
|
# Use specific agent
|
|
200
313
|
tdx chat "Analyze churn" --agent "MyProject/Data Analyst"
|
|
@@ -213,9 +326,9 @@ tdx chat "Hello" --verbose
|
|
|
213
326
|
```
|
|
214
327
|
|
|
215
328
|
**How it works**:
|
|
216
|
-
- **Default behavior**:
|
|
329
|
+
- **Default behavior**: Continues last chat session automatically (or creates new if none exists)
|
|
217
330
|
- **Session persistence**: Last chat ID saved to `.cache/tdx/last_chat_id`
|
|
218
|
-
- **--
|
|
331
|
+
- **--new flag**: Starts a fresh chat session
|
|
219
332
|
- **--agent**: Use specific agent (requires `"project/agent"` format)
|
|
220
333
|
- **--model**: Reuses or creates agent per model (e.g., `tdx_gpt-5`)
|
|
221
334
|
- **--temperature**: Controls randomness (0.7 default, lower=focused, higher=creative)
|
|
@@ -810,6 +923,178 @@ NO_COLOR=1 tdx databases
|
|
|
810
923
|
3. `NO_COLOR` environment variable
|
|
811
924
|
4. TTY detection (automatic)
|
|
812
925
|
|
|
926
|
+
## Advanced Commands
|
|
927
|
+
|
|
928
|
+
### API Command (Raw HTTP Access)
|
|
929
|
+
|
|
930
|
+
Make authenticated HTTP requests to any Treasure Data API endpoint (similar to `gh api` from GitHub CLI).
|
|
931
|
+
|
|
932
|
+
**Usage:** `tdx api <endpoint> [options]`
|
|
933
|
+
|
|
934
|
+
| Option | Description | Example |
|
|
935
|
+
|--------|-------------|---------|
|
|
936
|
+
| `<endpoint>` | API endpoint path (must start with /) | `/v3/database/list` |
|
|
937
|
+
| `-X, --method <method>` | HTTP method (GET, POST, PUT, DELETE, PATCH) | `-X POST` |
|
|
938
|
+
| `--data <json>` | Request body as JSON string | `--data '{"name":"mydb"}'` |
|
|
939
|
+
| `-f, --file <path>` | Read request body from file | `-f body.json` |
|
|
940
|
+
| `-H, --header <header>` | Custom header (repeatable) | `-H "X-Custom: value"` |
|
|
941
|
+
| `--type <api_type>` | API type (td, cdp, workflow, trino, llm) | `--type cdp` |
|
|
942
|
+
|
|
943
|
+
**Examples:**
|
|
944
|
+
|
|
945
|
+
```bash
|
|
946
|
+
# GET request to TD API (default)
|
|
947
|
+
tdx api /v3/database/list
|
|
948
|
+
|
|
949
|
+
# GET with path parameters
|
|
950
|
+
tdx api /v3/database/show/mydb
|
|
951
|
+
tdx api /v3/table/list/mydb
|
|
952
|
+
tdx api /v3/table/show/mydb/users
|
|
953
|
+
|
|
954
|
+
# POST with inline JSON body (submit query)
|
|
955
|
+
tdx api -X POST --data '{"query":"SELECT 1"}' /v3/job/issue/hive/mydb
|
|
956
|
+
|
|
957
|
+
# POST with data from file
|
|
958
|
+
tdx api -X POST -f query.json /v3/job/issue/hive/mydb
|
|
959
|
+
|
|
960
|
+
# Custom headers
|
|
961
|
+
tdx api -H "X-Custom: value" -H "X-Another: test" /v3/database/list
|
|
962
|
+
|
|
963
|
+
# CDP API endpoints (read-only)
|
|
964
|
+
tdx api /entities/parent_segments --type cdp
|
|
965
|
+
tdx api /audiences/12345/segments --type cdp
|
|
966
|
+
tdx api -X POST --data '{"format":"sql"}' /audiences/12345/segments/query --type cdp
|
|
967
|
+
|
|
968
|
+
# Workflow API endpoints (read-only)
|
|
969
|
+
tdx api /api/workflows --type workflow
|
|
970
|
+
tdx api /api/projects --type workflow
|
|
971
|
+
tdx api /api/attempts --type workflow
|
|
972
|
+
|
|
973
|
+
# Trino API endpoints (query submission - plain SQL, not JSON)
|
|
974
|
+
tdx api -X POST --data 'SELECT 1' /v1/statement --type trino
|
|
975
|
+
|
|
976
|
+
# LLM API endpoints (read-only)
|
|
977
|
+
tdx api /v1/agents --type llm
|
|
978
|
+
tdx api /v1/models --type llm
|
|
979
|
+
|
|
980
|
+
# Show HTTP response headers (with --verbose)
|
|
981
|
+
tdx api /v3/database/list --verbose
|
|
982
|
+
|
|
983
|
+
# Save output to file
|
|
984
|
+
tdx api /v3/database/list --output databases.json
|
|
985
|
+
|
|
986
|
+
# Combine --verbose with --output to see headers while saving
|
|
987
|
+
tdx api /v3/database/list --verbose --output databases.json
|
|
988
|
+
```
|
|
989
|
+
|
|
990
|
+
**API Types:**
|
|
991
|
+
|
|
992
|
+
| Type | Base URL Pattern | Description |
|
|
993
|
+
|------|-----------------|-------------|
|
|
994
|
+
| `td` | `api.treasuredata.com` | TD REST API (databases, tables, jobs) |
|
|
995
|
+
| `cdp` | `api-cdp.treasuredata.com` | CDP API (audiences, segments, activations) |
|
|
996
|
+
| `workflow` | `api-workflow.treasuredata.com` | Workflow API (digdag) |
|
|
997
|
+
| `trino` | `api-presto.treasuredata.com` | Trino Query Engine API |
|
|
998
|
+
| `llm` | `llm-api.treasuredata.com` | LLM API (agents, chat) |
|
|
999
|
+
|
|
1000
|
+
**Notes:**
|
|
1001
|
+
- All requests are automatically authenticated using your configured API key
|
|
1002
|
+
- Request body from `--data` must be valid JSON
|
|
1003
|
+
- `--data` and `--file` are mutually exclusive
|
|
1004
|
+
- Custom headers override default authentication headers
|
|
1005
|
+
- Response is output to stdout as JSON
|
|
1006
|
+
- Use `--verbose` to show HTTP request/response details in stderr:
|
|
1007
|
+
- Full target URL (shows site and API type)
|
|
1008
|
+
- Request headers (non-sensitive: User-Agent, X-TD-Client, Content-Type, etc.)
|
|
1009
|
+
- Response status and headers
|
|
1010
|
+
- Sensitive headers (Authorization, Cookie, etc.) are hidden for security
|
|
1011
|
+
|
|
1012
|
+
**Verbose Output Example:**
|
|
1013
|
+
```
|
|
1014
|
+
> POST https://api.treasuredata.com/v3/job/issue/hive/mydb
|
|
1015
|
+
> User-Agent: tdx/1.0.0 (darwin; node/24.0.0)
|
|
1016
|
+
> X-TD-Client: tdx
|
|
1017
|
+
> X-TD-Client-Version: 1.0.0
|
|
1018
|
+
> Content-Type: application/json
|
|
1019
|
+
>
|
|
1020
|
+
|
|
1021
|
+
< HTTP/1.1 200
|
|
1022
|
+
< content-type: application/json
|
|
1023
|
+
< x-td-request-id: abc123
|
|
1024
|
+
|
|
1025
|
+
{"job_id": "12345"}
|
|
1026
|
+
```
|
|
1027
|
+
|
|
1028
|
+
## Advanced Options
|
|
1029
|
+
|
|
1030
|
+
### Session ID Option
|
|
1031
|
+
|
|
1032
|
+
By default, sessions are tied to the shell's process ID (PPID). You can explicitly specify a session ID using `--session` to share context across multiple processes or shells:
|
|
1033
|
+
|
|
1034
|
+
**Usage:** `tdx --session <session-id> [command]`
|
|
1035
|
+
|
|
1036
|
+
**Examples:**
|
|
1037
|
+
|
|
1038
|
+
```bash
|
|
1039
|
+
# Process 1: Set session with explicit ID
|
|
1040
|
+
tdx --session my-workflow use database analytics
|
|
1041
|
+
tdx --session my-workflow use llm_project DataPipeline
|
|
1042
|
+
|
|
1043
|
+
# Process 2: Reuse the same session
|
|
1044
|
+
tdx --session my-workflow context
|
|
1045
|
+
# Shows: Database: analytics, LLM Project: DataPipeline
|
|
1046
|
+
|
|
1047
|
+
# Process 2: Run commands with shared context
|
|
1048
|
+
tdx --session my-workflow tables
|
|
1049
|
+
# Uses database: analytics
|
|
1050
|
+
|
|
1051
|
+
# Clean up when done
|
|
1052
|
+
tdx --session my-workflow use --clear
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
**Use Cases:**
|
|
1056
|
+
- Sharing context between multiple terminal windows
|
|
1057
|
+
- Maintaining consistent context in CI/CD pipelines
|
|
1058
|
+
- Scripting scenarios where session persistence is needed
|
|
1059
|
+
|
|
1060
|
+
**Note:** The `--session` option must be specified before the command name (e.g., `tdx --session id tables`, not `tdx tables --session id`).
|
|
1061
|
+
|
|
1062
|
+
## Architecture
|
|
1063
|
+
|
|
1064
|
+
The `tdx` project is designed with a layered architecture that separates the CLI interface from the core SDK, allowing the TypeScript SDK to be used in multiple environments:
|
|
1065
|
+
|
|
1066
|
+
```mermaid
|
|
1067
|
+
graph TD
|
|
1068
|
+
subgraph "Client Environments"
|
|
1069
|
+
NodeJS[Node.JS/CLI<br/>tdx commands]
|
|
1070
|
+
Browser[Web Browser<br/>Client-side]
|
|
1071
|
+
end
|
|
1072
|
+
|
|
1073
|
+
subgraph "TDX SDK - TypeScript"
|
|
1074
|
+
SDK[TDX SDK<br/>TypeScript/JavaScript API]
|
|
1075
|
+
end
|
|
1076
|
+
|
|
1077
|
+
subgraph "Treasure Data APIs"
|
|
1078
|
+
TD[TD REST API<br/>Databases, Tables, Jobs]
|
|
1079
|
+
Trino[Trino Streaming API<br/>Query Execution]
|
|
1080
|
+
CDP[CDP API<br/>Segments, Activations]
|
|
1081
|
+
end
|
|
1082
|
+
|
|
1083
|
+
NodeJS --> SDK
|
|
1084
|
+
Browser --> SDK
|
|
1085
|
+
|
|
1086
|
+
SDK -->|HTTPS| TD
|
|
1087
|
+
SDK -->|HTTPS| Trino
|
|
1088
|
+
SDK -->|HTTPS| CDP
|
|
1089
|
+
|
|
1090
|
+
style NodeJS fill:#d4f1d4
|
|
1091
|
+
style Browser fill:#ffd4d4
|
|
1092
|
+
style SDK fill:#fff5cc
|
|
1093
|
+
style TD fill:#e8e8f0
|
|
1094
|
+
style CDP fill:#e8e8f0
|
|
1095
|
+
style Trino fill:#e8e8f0
|
|
1096
|
+
```
|
|
1097
|
+
|
|
813
1098
|
## TDX SDK
|
|
814
1099
|
|
|
815
1100
|
**Usage Examples:**
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a0_0x3be17b=a0_0x2aac;(function(_0x4f8733,_0x50281a){const _0x39ce0f=a0_0x2aac,_0x4abd11=_0x4f8733();while(!![]){try{const _0x32ee09=parseInt(_0x39ce0f(0x1f5))/0x1+parseInt(_0x39ce0f(0x191))/0x2*(parseInt(_0x39ce0f(0x21f))/0x3)+-parseInt(_0x39ce0f(0x22a))/0x4*(parseInt(_0x39ce0f(0x203))/0x5)+parseInt(_0x39ce0f(0x1ae))/0x6*(-parseInt(_0x39ce0f(0x1ed))/0x7)+-parseInt(_0x39ce0f(0x1e5))/0x8+-parseInt(_0x39ce0f(0x194))/0x9*(parseInt(_0x39ce0f(0x1ad))/0xa)+-parseInt(_0x39ce0f(0x1bb))/0xb*(-parseInt(_0x39ce0f(0x1de))/0xc);if(_0x32ee09===_0x50281a)break;else _0x4abd11['push'](_0x4abd11['shift']());}catch(_0x1ebb2e){_0x4abd11['push'](_0x4abd11['shift']());}}}(a0_0x4a67,0x521e7));import{Command}from'commander';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{TDX,loadLocalSDKConfig}from'./sdk/index.js';function a0_0x4a67(){const _0x4274d5=['--temperature\x20<n>','Model\x20type\x20(default:\x20claude-4.5-sonnet)','20745890BkTXrx','System\x20prompt/instructions\x20(default:\x20empty)','Disable\x20ANSI\x20color\x20output\x20(also\x20respects\x20NO_COLOR\x20env\x20var)','AI-native\x20CLI\x20for\x20Treasure\x20Data','Model\x20name\x20(default:\x20claude-4.5-sonnet)','TD\x20site/region\x20(us01,\x20jp01,\x20eu01,\x20ap02)','--reason\x20<text>','Alias\x20for\x20--database\x20(natural\x20language\x20style)','command','Preview\x20operation\x20without\x20executing','description','describe\x20<segment_name>','log','Retry\x20a\x20session\x20or\x20attempt\x20(prefix\x20with\x20session:\x20or\x20attempt:)','describe\x20<table>','Show\x20segment\x20details\x20(use\x20parent_name\x20or\x20parent_name.child_name)','workflows\x20[project]','action','Delete\x20an\x20agent\x20(use\x20\x22project-name/agent-name\x22)','get\x20<agent-ref>','--verbose','--to\x20<timestamp>','List\x20all\x20workflow\x20projects\x20(optionally\x20filtered\x20by\x20glob\x20pattern)','Job\x20commands\x20-\x20coming\x20soon','Starting\x20offset\x20for\x20logs\x20(default:\x200)','-y,\x20--yes','Temperature\x20(0.0-2.0,\x20default:\x200.7)','List\x20activations\x20for\x20a\x20segment\x20(use\x20parent_name.child_name)','Maximum\x20rows\x20to\x20display\x20in\x20table\x20format\x20(default:\x2040)','Kill\x20a\x20running\x20attempt','Start\x20time\x20filter\x20(ISO\x208601\x20format)','List\x20available\x20LLM\x20models','option','--include-retried','jsonl','12rnREwS','database','--resume-from\x20<task>','--system-prompt\x20<text>','Save\x20output\x20to\x20file','attempt\x20<attempt-id>','Get\x20agent\x20details\x20(use\x20\x22project-name/agent-name\x22)','4072064OkLLea','--include-subtasks','--site\x20<site>','utf-8','us01','kill\x20<attempt-id>','List\x20parent\x20segments\x20or\x20child\x20segments\x20under\x20a\x20parent','Segment\x20folder\x20management','7RGvVFK','../package.json','Run\x20Trino\x20query\x20with\x20streaming\x20results','Job\x20management\x20commands','Trino\x20catalog\x20(default:\x20td)','show\x20<table>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','show\x20<segment_name>','208771coGRbS','--no-color','create\x20<name>','Update\x20an\x20existing\x20agent\x20(use\x20\x22project-name/agent-name\x22)','sessions\x20[project]','Output\x20format\x20(table,\x20json,\x20jsonl,\x20tsv)','--project-id\x20<id>','Reason\x20for\x20killing\x20the\x20attempt','Resume\x20from\x20specific\x20task\x20(session\x20retry\x20only)','name','chat\x20[message...]','folder','version','update\x20<agent-ref>','1234265MEVfzc','--limit\x20<rows>','Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20table\x20pattern)','folders\x20<parent_name>','argv','exit','List\x20all\x20LLM\x20agents\x20(optionally\x20filtered\x20by\x20project\x20name)','logs\x20<attempt-id>\x20<task-name>','opts','--status\x20<status>','tsv','run','desc','--in\x20<database>','Include\x20retried\x20attempts','tables\x20[pattern]','alias','slice','Agent\x20reference\x20(project-name/agent-name)','Maximum\x20tool\x20iterations\x20(default:\x204)','json','List\x20workflow\x20execution\x20sessions\x20(filter\x20by\x20project\x20or\x20project.workflow)','0.7','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results\x20(use\x20parent_name\x20or\x20parent_name.child_name)','Skip\x20confirmation\x20prompts','--offset\x20<number>','projects\x20[pattern]','--agent\x20<ref>','3705sKFLDc','Show\x20folder\x20details\x20(use\x20parent_name.folder_name)','--prompt\x20<text>','claude-4.5-sonnet','--color','Read\x20SQL\x20query\x20from\x20file','-c,\x20--continue','Workflow\x20(Digdag)\x20management\x20commands','Output\x20in\x20TSV\x20format\x20(shorthand\x20for\x20--format\x20tsv)','Show\x20logs\x20for\x20a\x20specific\x20task','databases\x20[pattern]','8BxtEpD','length','--from\x20<timestamp>','parse','agent','--output\x20<file>','--params\x20<json>','--timeout\x20<seconds>','-f,\x20--file\x20<path>','Show\x20table\x20contents\x20(SELECT\x20*\x20with\x20limit)','Create\x20a\x20new\x20agent','format','228ppuQQD','history\x20[chat-id]','segment','4131972sjLvEk','activations\x20<segment_name>','tasks\x20<attempt-id>','delete','--format\x20<format>','site','verbose','LLM\x20agent\x20management\x20commands','Output\x20in\x20JSON\x20format\x20(shorthand\x20for\x20--format\x20json)','--json','Filter\x20by\x20status\x20(running,\x20success,\x20error,\x20blocked,\x20all)','outputHelp','agents\x20[project-name]','List\x20workflows\x20(optionally\x20filtered\x20by\x20project)','Set\x20operation\x20timeout\x20in\x20seconds','List\x20tables\x20(e.g.,\x20mydb,\x20mydb.*,\x20*.user*,\x20mydb.user*)','Agent\x20description','--dry-run','End\x20time\x20filter\x20(ISO\x208601\x20format)','tdx','-d,\x20--database\x20<database>','models','List\x20workflow\x20attempts\x20(filter\x20by\x20project\x20or\x20project.workflow)','Starter\x20message','--from-task\x20<task>','10rppCEr','2624220YnRWjJ','Force\x20ANSI\x20color\x20output\x20(overrides\x20TTY\x20detection)','Resume\x20from\x20specific\x20task\x20(attempt\x20retry\x20only)','--tsv','--model\x20<name>','CDP\x20segment\x20management\x20commands','retry\x20<session-id|attempt-id>','segments\x20[parent_name]','show\x20<folder_ref>','Describe\x20table\x20schema','Show\x20specific\x20attempt\x20details'];a0_0x4a67=function(){return _0x4274d5;};return a0_0x4a67();}import{resolveSite}from'./core/config.js';import{QueryCommand}from'./commands/query-command.js';import{ChatCommand}from'./commands/chat-command.js';import{DatabasesCommand}from'./commands/databases.js';function a0_0x2aac(_0xe0c709,_0x3634cf){const _0x4a67b8=a0_0x4a67();return a0_0x2aac=function(_0x2aac94,_0x97a5e9){_0x2aac94=_0x2aac94-0x190;let _0x3356b9=_0x4a67b8[_0x2aac94];return _0x3356b9;},a0_0x2aac(_0xe0c709,_0x3634cf);}import{TablesCommand}from'./commands/tables.js';import{SegmentsCommand}from'./commands/segments.js';import{ActivationsCommand}from'./commands/activations.js';import{ShowCommand}from'./commands/show.js';import{DescribeCommand}from'./commands/describe.js';import{SegmentDescribeCommand,SegmentShowCommand,SegmentFolderListCommand,SegmentFolderShowCommand,SegmentSQLCommand}from'./commands/segment-command.js';import{WorkflowProjectsCommand,WorkflowWorkflowsCommand,WorkflowSessionsCommand,WorkflowAttemptsCommand,WorkflowAttemptCommand,WorkflowTasksCommand,WorkflowLogsCommand,WorkflowKillCommand,WorkflowRetryCommand}from'./commands/workflow-command.js';import{AgentModelsCommand,AgentProjectsCommand,AgentsListCommand,AgentGetCommand,AgentCreateCommand,AgentUpdateCommand,AgentRemoveCommand,AgentHistoryCommand}from'./commands/llm-command.js';const __filename=fileURLToPath(import.meta['url']),__dirname=dirname(__filename),packageJson=JSON['parse'](readFileSync(join(__dirname,a0_0x3be17b(0x1ee)),a0_0x3be17b(0x1e8))),program=new Command();program[a0_0x3be17b(0x1fe)](a0_0x3be17b(0x1a7))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1be))['version'](packageJson[a0_0x3be17b(0x201)]),program['option'](a0_0x3be17b(0x1e7),a0_0x3be17b(0x1c0),a0_0x3be17b(0x1e9))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x198),a0_0x3be17b(0x1fa))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x19d),a0_0x3be17b(0x19c))[a0_0x3be17b(0x1db)]('--jsonl','Output\x20in\x20JSON\x20Lines\x20format\x20(shorthand\x20for\x20--format\x20jsonl)')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1b1),a0_0x3be17b(0x227))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x22f),a0_0x3be17b(0x1e2))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x204),a0_0x3be17b(0x1d7),'40')['option'](a0_0x3be17b(0x223),a0_0x3be17b(0x1af),![])[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1f6),a0_0x3be17b(0x1bd),![])['option'](a0_0x3be17b(0x1cf),'Enable\x20verbose\x20logging',![])[a0_0x3be17b(0x1db)](a0_0x3be17b(0x231),a0_0x3be17b(0x1a2),'30')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1a5),a0_0x3be17b(0x1c4),![])[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1d4),a0_0x3be17b(0x21b),![])['hook']('preAction',_0x1d5f72=>{const _0xca9261=a0_0x3be17b,_0x399309=_0x1d5f72[_0xca9261(0x20b)]();if(!_0x399309['format']){if(_0x399309[_0xca9261(0x217)])_0x399309[_0xca9261(0x190)]=_0xca9261(0x217);else{if(_0x399309[_0xca9261(0x1dd)])_0x399309[_0xca9261(0x190)]=_0xca9261(0x1dd);else _0x399309[_0xca9261(0x20d)]&&(_0x399309[_0xca9261(0x190)]=_0xca9261(0x20d));}}});function createTDXInstance(_0x425ee8){const _0x38dd17=a0_0x3be17b,_0x208ab6=resolveSite(_0x425ee8[_0x38dd17(0x199)]),_0x45a8a2=_0x425ee8[_0x38dd17(0x19a)]||![],_0x41d4d6=loadLocalSDKConfig({'site':_0x208ab6,'verbose':_0x45a8a2});return new TDX(_0x41d4d6);}program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x229))['description']('List\x20all\x20databases\x20(optionally\x20filtered\x20by\x20glob\x20pattern)')['action'](async(_0x1306ac,_0x3d6297)=>{const _0x241646=a0_0x3be17b,_0x59a997=new DatabasesCommand(),_0x37911a=program['opts'](),_0x2fc493=createTDXInstance(_0x37911a),_0x181cd0=await _0x59a997[_0x241646(0x20e)]({'options':{..._0x37911a,..._0x3d6297},'args':_0x1306ac?[_0x1306ac]:[],'tdx':_0x2fc493});process[_0x241646(0x208)](_0x181cd0);}),program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1ff))[a0_0x3be17b(0x1c5)]('Chat\x20with\x20an\x20LLM\x20agent\x20(simplified\x20interface)')['option'](a0_0x3be17b(0x21e),a0_0x3be17b(0x215))[a0_0x3be17b(0x1db)]('--model\x20<name>',a0_0x3be17b(0x1bf))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1b9),a0_0x3be17b(0x1d5))['option'](a0_0x3be17b(0x225),'Continue\x20last\x20chat\x20session')[a0_0x3be17b(0x1cc)](async(_0x191505,_0x36636b)=>{const _0x7e1675=a0_0x3be17b,_0x3df3a9=new ChatCommand(),_0x19f159=program['opts'](),_0x2ccc82=createTDXInstance(_0x19f159),_0x2a56dd=await _0x3df3a9[_0x7e1675(0x20e)]({'options':{..._0x19f159,..._0x36636b},'args':_0x191505,'tdx':_0x2ccc82});process[_0x7e1675(0x208)](_0x2a56dd);}),program['command'](a0_0x3be17b(0x212))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1a3))[a0_0x3be17b(0x1db)]('-d,\x20--database\x20<database>','Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20pattern)')['option'](a0_0x3be17b(0x210),a0_0x3be17b(0x1c2))['action'](async(_0x5d7cb8,_0x55cff6)=>{const _0x48381f=a0_0x3be17b,_0x13db5d=new TablesCommand(),_0x45879d=program[_0x48381f(0x20b)](),_0x293dea=createTDXInstance(_0x45879d);_0x55cff6['in']&&(_0x55cff6['database']=_0x55cff6['in']);const _0x23c40f=await _0x13db5d[_0x48381f(0x20e)]({'options':{..._0x45879d,..._0x55cff6},'args':_0x5d7cb8?[_0x5d7cb8]:[],'tdx':_0x293dea});process[_0x48381f(0x208)](_0x23c40f);}),program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1f2))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x233))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1a8),'Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20table\x20pattern)')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x210),'Alias\x20for\x20--database\x20(natural\x20language\x20style)')['action'](async(_0x550d56,_0x148c6e)=>{const _0x907340=a0_0x3be17b,_0x2a2005=new ShowCommand(),_0x5f03c5=program[_0x907340(0x20b)](),_0x257d48=createTDXInstance(_0x5f03c5);_0x148c6e['in']&&(_0x148c6e[_0x907340(0x1df)]=_0x148c6e['in']);const _0x479b28=await _0x2a2005[_0x907340(0x20e)]({'options':{..._0x5f03c5,..._0x148c6e},'args':[_0x550d56],'tdx':_0x257d48});process['exit'](_0x479b28);}),program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1c9))[a0_0x3be17b(0x213)](a0_0x3be17b(0x20f))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1b7))['option'](a0_0x3be17b(0x1a8),a0_0x3be17b(0x205))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x210),'Alias\x20for\x20--database\x20(natural\x20language\x20style)')[a0_0x3be17b(0x1cc)](async(_0x3142ae,_0xe6361d)=>{const _0x37fec9=a0_0x3be17b,_0x50fb25=new DescribeCommand(),_0x1b5a0c=program[_0x37fec9(0x20b)](),_0x1b3805=createTDXInstance(_0x1b5a0c);_0xe6361d['in']&&(_0xe6361d[_0x37fec9(0x1df)]=_0xe6361d['in']);const _0x131cc8=await _0x50fb25['run']({'options':{..._0x1b5a0c,..._0xe6361d},'args':[_0x3142ae],'tdx':_0x1b3805});process[_0x37fec9(0x208)](_0x131cc8);}),program[a0_0x3be17b(0x1c3)]('query\x20[sql]')[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1ef))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1a8),'Database\x20to\x20query\x20(default:\x20information_schema)')[a0_0x3be17b(0x1db)]('--in\x20<database>','Alias\x20for\x20--database\x20(natural\x20language\x20style)')[a0_0x3be17b(0x1db)]('--catalog\x20<catalog>',a0_0x3be17b(0x1f1))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x232),a0_0x3be17b(0x224))[a0_0x3be17b(0x1db)]('--limit\x20<rows>',a0_0x3be17b(0x1d7),'40')['action'](async(_0x12abc4,_0x8b18ac)=>{const _0x4760ea=a0_0x3be17b,_0x5901b8=new QueryCommand(),_0x4aace1=program['opts'](),_0x339a95=createTDXInstance(_0x4aace1);_0x8b18ac['in']&&(_0x8b18ac[_0x4760ea(0x1df)]=_0x8b18ac['in']);const _0x2add32=await _0x5901b8[_0x4760ea(0x20e)]({'options':{..._0x4aace1,..._0x8b18ac},'args':_0x12abc4?[_0x12abc4]:[],'tdx':_0x339a95});process[_0x4760ea(0x208)](_0x2add32);}),program[a0_0x3be17b(0x1c3)]('job')[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1f0))[a0_0x3be17b(0x1cc)](()=>{const _0x585eab=a0_0x3be17b;console[_0x585eab(0x1c7)](_0x585eab(0x1d2));}),program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1b5))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1eb))[a0_0x3be17b(0x1cc)](async(_0x65d899,_0xaa355a)=>{const _0x3adc14=a0_0x3be17b,_0x3aa1d6=new SegmentsCommand(),_0x4c9e00=program['opts'](),_0x2d7fdc=createTDXInstance(_0x4c9e00),_0x502b43=await _0x3aa1d6['run']({'options':{..._0x4c9e00,..._0xaa355a},'args':_0x65d899?[_0x65d899]:[],'tdx':_0x2d7fdc});process[_0x3adc14(0x208)](_0x502b43);});const segmentCmd=program[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x193))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1b3));segmentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1c6))[a0_0x3be17b(0x213)](a0_0x3be17b(0x20f))['description'](a0_0x3be17b(0x1ca))['action'](async(_0x325bfe,_0x183e8d)=>{const _0x2454e9=a0_0x3be17b,_0x47ec1d=new SegmentDescribeCommand(),_0x3cc76a=program[_0x2454e9(0x20b)](),_0x3e4486=createTDXInstance(_0x3cc76a),_0x51c34b=await _0x47ec1d['run']({'options':{..._0x3cc76a,..._0x183e8d},'args':[_0x325bfe],'tdx':_0x3e4486});process[_0x2454e9(0x208)](_0x51c34b);}),segmentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1f4))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x21a))[a0_0x3be17b(0x1cc)](async(_0x30157b,_0x1df015)=>{const _0x347565=a0_0x3be17b,_0x256c6a=new SegmentShowCommand(),_0x21ff86=program[_0x347565(0x20b)](),_0xecbd32=createTDXInstance(_0x21ff86),_0x4987c4=await _0x256c6a[_0x347565(0x20e)]({'options':{..._0x21ff86,..._0x1df015},'args':[_0x30157b],'tdx':_0xecbd32});process[_0x347565(0x208)](_0x4987c4);}),segmentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x206))['description'](a0_0x3be17b(0x1f3))[a0_0x3be17b(0x1cc)](async(_0x486fbb,_0x3f3530)=>{const _0x36abe2=a0_0x3be17b,_0x6b9e96=new SegmentFolderListCommand(),_0x998d99=program['opts'](),_0x4516f0=createTDXInstance(_0x998d99),_0x428bab=await _0x6b9e96['run']({'options':{..._0x998d99,..._0x3f3530},'args':[_0x486fbb],'tdx':_0x4516f0});process[_0x36abe2(0x208)](_0x428bab);});const folderCmd=segmentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x200))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1ec));folderCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1b6))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x220))[a0_0x3be17b(0x1cc)](async(_0x3409d5,_0x536a49)=>{const _0x3f096b=a0_0x3be17b,_0x579fd1=new SegmentFolderShowCommand(),_0x35cd29=program[_0x3f096b(0x20b)](),_0x5d1307=createTDXInstance(_0x35cd29),_0x5261cd=await _0x579fd1['run']({'options':{..._0x35cd29,..._0x536a49},'args':[_0x3409d5],'tdx':_0x5d1307});process['exit'](_0x5261cd);}),segmentCmd[a0_0x3be17b(0x1c3)]('sql\x20<segment_name>')['description']('Get\x20SQL\x20query\x20for\x20segment\x20(use\x20parent_name\x20or\x20parent_name.child_name)')[a0_0x3be17b(0x1cc)](async(_0x4a706b,_0x4b41e4)=>{const _0x13b741=a0_0x3be17b,_0x4557cc=new SegmentSQLCommand(),_0x52014c=program['opts'](),_0x3004f0=createTDXInstance(_0x52014c),_0x14f807=await _0x4557cc[_0x13b741(0x20e)]({'options':{..._0x52014c,..._0x4b41e4},'args':[_0x4a706b],'tdx':_0x3004f0});process[_0x13b741(0x208)](_0x14f807);}),program['command'](a0_0x3be17b(0x195))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1d6))[a0_0x3be17b(0x1cc)](async(_0x54737e,_0x1ab47a)=>{const _0x3a084a=a0_0x3be17b,_0x12a9ab=new ActivationsCommand(),_0x2b0ddf=program[_0x3a084a(0x20b)](),_0x28d91f=createTDXInstance(_0x2b0ddf),_0x2fedfb=await _0x12a9ab[_0x3a084a(0x20e)]({'options':{..._0x2b0ddf,..._0x1ab47a},'args':[_0x54737e],'tdx':_0x28d91f});process[_0x3a084a(0x208)](_0x2fedfb);});const workflowCmd=program['command']('workflow')[a0_0x3be17b(0x213)]('wf')[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x226));workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x21d))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1d1))[a0_0x3be17b(0x1cc)](async(_0x537321,_0x2fde59)=>{const _0x2083c4=new WorkflowProjectsCommand(),_0x18408f=program['opts'](),_0x23184f=createTDXInstance(_0x18408f),_0xb3efa9=await _0x2083c4['run']({'options':{..._0x18408f,..._0x2fde59},'args':_0x537321?[_0x537321]:[],'tdx':_0x23184f});process['exit'](_0xb3efa9);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1cb))[a0_0x3be17b(0x213)]('ls')[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1a1))[a0_0x3be17b(0x1cc)](async(_0x24a9d1,_0x501ee8)=>{const _0x1fef95=a0_0x3be17b,_0x5066ee=new WorkflowWorkflowsCommand(),_0x4d3b8a=program['opts'](),_0x41be7b=createTDXInstance(_0x4d3b8a),_0x35e204=await _0x5066ee[_0x1fef95(0x20e)]({'options':{..._0x4d3b8a,..._0x501ee8},'args':_0x24a9d1?[_0x24a9d1]:[],'tdx':_0x41be7b});process[_0x1fef95(0x208)](_0x35e204);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1f9))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x218))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x20c),a0_0x3be17b(0x19e))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x22c),a0_0x3be17b(0x1d9))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1d0),a0_0x3be17b(0x1a6))[a0_0x3be17b(0x1cc)](async(_0x15ebc5,_0x316843)=>{const _0x4fd650=a0_0x3be17b,_0x2bad81=new WorkflowSessionsCommand(),_0x5712c8=program[_0x4fd650(0x20b)](),_0x52b7a3=createTDXInstance(_0x5712c8),_0x12f29c=await _0x2bad81[_0x4fd650(0x20e)]({'options':{..._0x5712c8,..._0x316843},'args':_0x15ebc5?[_0x15ebc5]:[],'tdx':_0x52b7a3});process[_0x4fd650(0x208)](_0x12f29c);}),workflowCmd[a0_0x3be17b(0x1c3)]('attempts\x20[project]')[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1aa))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1dc),a0_0x3be17b(0x211))[a0_0x3be17b(0x1cc)](async(_0x815f55,_0x2b199f)=>{const _0x387f2b=a0_0x3be17b,_0x4b9654=new WorkflowAttemptsCommand(),_0x288647=program[_0x387f2b(0x20b)](),_0x362c2f=createTDXInstance(_0x288647),_0x16b006=await _0x4b9654['run']({'options':{..._0x288647,..._0x2b199f},'args':_0x815f55?[_0x815f55]:[],'tdx':_0x362c2f});process[_0x387f2b(0x208)](_0x16b006);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1e3))['description'](a0_0x3be17b(0x1b8))[a0_0x3be17b(0x1cc)](async(_0x517b95,_0x152523)=>{const _0x4c7b88=a0_0x3be17b,_0x28ad8e=new WorkflowAttemptCommand(),_0x32b493=program[_0x4c7b88(0x20b)](),_0x1f94f0=createTDXInstance(_0x32b493),_0x820be5=await _0x28ad8e[_0x4c7b88(0x20e)]({'options':{..._0x32b493,..._0x152523},'args':[_0x517b95],'tdx':_0x1f94f0});process[_0x4c7b88(0x208)](_0x820be5);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x196))['description']('Show\x20tasks\x20for\x20an\x20attempt')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1e6),'Include\x20subtasks\x20in\x20the\x20output')[a0_0x3be17b(0x1cc)](async(_0x58b200,_0x38aebc)=>{const _0x36ba37=a0_0x3be17b,_0x1e3b35=new WorkflowTasksCommand(),_0x158394=program[_0x36ba37(0x20b)](),_0x50161e=createTDXInstance(_0x158394),_0x369cdf=await _0x1e3b35[_0x36ba37(0x20e)]({'options':{..._0x158394,..._0x38aebc},'args':[_0x58b200],'tdx':_0x50161e});process['exit'](_0x369cdf);}),workflowCmd['command'](a0_0x3be17b(0x20a))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x228))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x21c),a0_0x3be17b(0x1d3),_0x418239=>parseInt(_0x418239,0xa),0x0)[a0_0x3be17b(0x1cc)](async(_0x1cf8d8,_0x23614a,_0x41fcaa)=>{const _0x3dcc53=a0_0x3be17b,_0x16bda1=new WorkflowLogsCommand(),_0x2ba1d1=program[_0x3dcc53(0x20b)](),_0x2c34fc=createTDXInstance(_0x2ba1d1),_0x3dc846=await _0x16bda1[_0x3dcc53(0x20e)]({'options':{..._0x2ba1d1,..._0x41fcaa},'args':[_0x1cf8d8,_0x23614a],'tdx':_0x2c34fc});process[_0x3dcc53(0x208)](_0x3dc846);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1ea))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1d8))['option'](a0_0x3be17b(0x1c1),a0_0x3be17b(0x1fc))[a0_0x3be17b(0x1cc)](async(_0x336865,_0x5abfd8)=>{const _0x301d3b=a0_0x3be17b,_0x6eb3f9=new WorkflowKillCommand(),_0x9b3fcc=program['opts'](),_0x14ea71=createTDXInstance(_0x9b3fcc),_0x245b77=await _0x6eb3f9[_0x301d3b(0x20e)]({'options':{..._0x9b3fcc,..._0x5abfd8},'args':[_0x336865],'tdx':_0x14ea71});process[_0x301d3b(0x208)](_0x245b77);}),workflowCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1b4))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1c8))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1ac),a0_0x3be17b(0x1fd))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1e0),a0_0x3be17b(0x1b0))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x230),'Override\x20parameters\x20(JSON\x20string\x20or\x20@file.json)')[a0_0x3be17b(0x1db)]('--force','Force\x20retry\x20even\x20if\x20not\x20failed\x20(attempt\x20retry\x20only)')[a0_0x3be17b(0x1cc)](async(_0x2e9324,_0x5331c6)=>{const _0x52924f=new WorkflowRetryCommand(),_0x52be24=program['opts'](),_0x9b805a=createTDXInstance(_0x52be24),_0x3e776f=await _0x52924f['run']({'options':{..._0x52be24,..._0x5331c6},'args':[_0x2e9324],'tdx':_0x9b805a});process['exit'](_0x3e776f);}),program['command'](a0_0x3be17b(0x1a0))['description'](a0_0x3be17b(0x209))['action'](async(_0x3eecfe,_0x39c322)=>{const _0x1cc661=a0_0x3be17b,_0x43d237=new AgentsListCommand(),_0x21d556=program[_0x1cc661(0x20b)](),_0x24cf01=createTDXInstance(_0x21d556),_0x427562=await _0x43d237[_0x1cc661(0x20e)]({'options':{..._0x21d556,..._0x39c322},'args':_0x3eecfe?[_0x3eecfe]:[],'tdx':_0x24cf01});process[_0x1cc661(0x208)](_0x427562);});const agentCmd=program['command'](a0_0x3be17b(0x22e))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x19b));agentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1a9))['description'](a0_0x3be17b(0x1da))[a0_0x3be17b(0x1cc)](async _0xb47978=>{const _0xb1b384=a0_0x3be17b,_0x3c113a=new AgentModelsCommand(),_0x3ba4dc=program[_0xb1b384(0x20b)](),_0x39a590=createTDXInstance(_0x3ba4dc),_0xd9c8aa=await _0x3c113a[_0xb1b384(0x20e)]({'options':{..._0x3ba4dc,..._0xb47978},'args':[],'tdx':_0x39a590});process[_0xb1b384(0x208)](_0xd9c8aa);}),agentCmd[a0_0x3be17b(0x1c3)]('projects')[a0_0x3be17b(0x1c5)]('List\x20all\x20LLM\x20projects')['action'](async _0x5a24dd=>{const _0xddd058=a0_0x3be17b,_0x51ef97=new AgentProjectsCommand(),_0x3e1be9=program[_0xddd058(0x20b)](),_0x3472b2=createTDXInstance(_0x3e1be9),_0x4cebcf=await _0x51ef97['run']({'options':{..._0x3e1be9,..._0x5a24dd},'args':[],'tdx':_0x3472b2});process['exit'](_0x4cebcf);}),agentCmd['command'](a0_0x3be17b(0x1ce))['description'](a0_0x3be17b(0x1e4))[a0_0x3be17b(0x1cc)](async(_0x281b57,_0x3864af)=>{const _0x491370=a0_0x3be17b,_0x34a2f3=new AgentGetCommand(),_0x58d858=program[_0x491370(0x20b)](),_0x39b8f4=createTDXInstance(_0x58d858),_0x86cbd=await _0x34a2f3[_0x491370(0x20e)]({'options':{..._0x58d858,..._0x3864af},'args':[_0x281b57],'tdx':_0x39b8f4});process[_0x491370(0x208)](_0x86cbd);}),agentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x1f7))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x234))['requiredOption'](a0_0x3be17b(0x1fb),'Project\x20ID')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1e1),a0_0x3be17b(0x1bc))[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1b2),a0_0x3be17b(0x1ba),a0_0x3be17b(0x222))[a0_0x3be17b(0x1db)]('--starter-message\x20<text>',a0_0x3be17b(0x1ab))[a0_0x3be17b(0x1db)]('--max-tool-iterations\x20<n>',a0_0x3be17b(0x216),'4')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x1b9),a0_0x3be17b(0x1d5),a0_0x3be17b(0x219))[a0_0x3be17b(0x1cc)](async(_0x2ed362,_0x59dd80)=>{const _0x7edc7c=a0_0x3be17b,_0x25fedc=new AgentCreateCommand(),_0x2685be=program[_0x7edc7c(0x20b)](),_0x407c5f=createTDXInstance(_0x2685be),_0x4c8194=await _0x25fedc['run']({'options':{..._0x2685be,..._0x59dd80},'args':[_0x2ed362],'tdx':_0x407c5f});process[_0x7edc7c(0x208)](_0x4c8194);}),agentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x202))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1f8))['option']('--name\x20<text>','Agent\x20name')[a0_0x3be17b(0x1db)](a0_0x3be17b(0x221),'Agent\x20prompt/instructions')[a0_0x3be17b(0x1db)]('--description\x20<text>',a0_0x3be17b(0x1a4))[a0_0x3be17b(0x1db)]('--starter-message\x20<text>','Starter\x20message')[a0_0x3be17b(0x1cc)](async(_0x5a7e12,_0x5e502e)=>{const _0x4e1bd0=a0_0x3be17b,_0x1ecbac=new AgentUpdateCommand(),_0x39a6cb=program[_0x4e1bd0(0x20b)](),_0x41abb2=createTDXInstance(_0x39a6cb),_0x535c58=await _0x1ecbac['run']({'options':{..._0x39a6cb,..._0x5e502e},'args':[_0x5a7e12],'tdx':_0x41abb2});process[_0x4e1bd0(0x208)](_0x535c58);}),agentCmd['command']('remove\x20<agent-ref>')[a0_0x3be17b(0x213)](a0_0x3be17b(0x197))[a0_0x3be17b(0x1c5)](a0_0x3be17b(0x1cd))[a0_0x3be17b(0x1cc)](async(_0x5b5376,_0x265a6a)=>{const _0x5b56c6=a0_0x3be17b,_0x863dd5=new AgentRemoveCommand(),_0x152616=program['opts'](),_0x51d7a6=createTDXInstance(_0x152616),_0x13bdd8=await _0x863dd5[_0x5b56c6(0x20e)]({'options':{..._0x152616,..._0x265a6a},'args':[_0x5b5376],'tdx':_0x51d7a6});process[_0x5b56c6(0x208)](_0x13bdd8);}),agentCmd[a0_0x3be17b(0x1c3)](a0_0x3be17b(0x192))['description']('Show\x20chat\x20history\x20(or\x20list\x20all\x20sessions\x20if\x20no\x20ID\x20provided)')[a0_0x3be17b(0x1cc)](async(_0x1e26e8,_0xcc7ad6)=>{const _0x494a24=a0_0x3be17b,_0x55188b=new AgentHistoryCommand(),_0x1d3378=program[_0x494a24(0x20b)](),_0x521fca=createTDXInstance(_0x1d3378),_0x3d1949=await _0x55188b[_0x494a24(0x20e)]({'options':{..._0x1d3378,..._0xcc7ad6},'args':_0x1e26e8?[_0x1e26e8]:[],'tdx':_0x521fca});process['exit'](_0x3d1949);}),program[a0_0x3be17b(0x22d)](process[a0_0x3be17b(0x207)]);!process['argv'][a0_0x3be17b(0x214)](0x2)[a0_0x3be17b(0x22b)]&&program[a0_0x3be17b(0x19f)]();
|
|
2
|
+
const a0_0x22f7a9=a0_0x408f;(function(_0x6db27b,_0x4d094d){const _0x509bbb=a0_0x408f,_0x4b173a=_0x6db27b();while(!![]){try{const _0x3a503=parseInt(_0x509bbb(0x135))/0x1*(-parseInt(_0x509bbb(0x12c))/0x2)+parseInt(_0x509bbb(0x180))/0x3+parseInt(_0x509bbb(0x110))/0x4*(-parseInt(_0x509bbb(0x17d))/0x5)+-parseInt(_0x509bbb(0x18e))/0x6+-parseInt(_0x509bbb(0x1b2))/0x7+-parseInt(_0x509bbb(0x1bc))/0x8*(parseInt(_0x509bbb(0x150))/0x9)+parseInt(_0x509bbb(0x13f))/0xa;if(_0x3a503===_0x4d094d)break;else _0x4b173a['push'](_0x4b173a['shift']());}catch(_0x2c0abc){_0x4b173a['push'](_0x4b173a['shift']());}}}(a0_0x208e,0x4c290));import{Command}from'commander';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{TDX}from'./sdk/index.js';import{GlobalContext}from'./core/global-context.js';import{QueryCommand}from'./commands/query-command.js';import{ChatCommand}from'./commands/chat-command.js';function a0_0x408f(_0x3c4d45,_0xecc693){const _0x208ec9=a0_0x208e();return a0_0x408f=function(_0x408f88,_0x282767){_0x408f88=_0x408f88-0x105;let _0x40d38f=_0x208ec9[_0x408f88];return _0x40d38f;},a0_0x408f(_0x3c4d45,_0xecc693);}import{ApiCommand}from'./commands/api-command.js';import{DatabasesCommand}from'./commands/databases.js';import{TablesCommand}from'./commands/tables.js';import{SegmentsCommand}from'./commands/segments.js';import{ActivationsCommand}from'./commands/activations.js';import{ShowCommand}from'./commands/show.js';import{DescribeCommand}from'./commands/describe.js';import{SegmentDescribeCommand,SegmentShowCommand,SegmentFolderListCommand,SegmentFolderShowCommand,SegmentSQLCommand}from'./commands/segment-command.js';import{WorkflowProjectsCommand,WorkflowWorkflowsCommand,WorkflowSessionsCommand,WorkflowAttemptsCommand,WorkflowAttemptCommand,WorkflowTasksCommand,WorkflowLogsCommand,WorkflowKillCommand,WorkflowRetryCommand}from'./commands/workflow-command.js';import{AgentModelsCommand,AgentProjectsCommand,AgentsListCommand,AgentGetCommand,AgentCreateCommand,AgentUpdateCommand,AgentRemoveCommand,AgentHistoryCommand}from'./commands/llm-command.js';import{ContextCommand}from'./commands/context-command.js';import{UseCommand}from'./commands/use-command.js';import{ProfilesCommand}from'./commands/profiles-command.js';const __filename=fileURLToPath(import.meta[a0_0x22f7a9(0x19c)]),__dirname=dirname(__filename),packageJson=JSON[a0_0x22f7a9(0x1b3)](readFileSync(join(__dirname,a0_0x22f7a9(0x178)),a0_0x22f7a9(0x17b))),program=new Command();program[a0_0x22f7a9(0x10d)](a0_0x22f7a9(0x161))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x144))[a0_0x22f7a9(0x120)](packageJson[a0_0x22f7a9(0x120)],a0_0x22f7a9(0x198),a0_0x22f7a9(0x174)),program[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x107),a0_0x22f7a9(0x17c),a0_0x22f7a9(0x196))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x14a),a0_0x22f7a9(0x157))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x141),a0_0x22f7a9(0x10f))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x181),'Output\x20in\x20JSON\x20Lines\x20format\x20(shorthand\x20for\x20--format\x20jsonl)')['option'](a0_0x22f7a9(0x17e),a0_0x22f7a9(0x191))['option'](a0_0x22f7a9(0x10c),a0_0x22f7a9(0x1a5))['option'](a0_0x22f7a9(0x16c),a0_0x22f7a9(0x1a4),'40')['option'](a0_0x22f7a9(0x19a),'Force\x20ANSI\x20color\x20output\x20(overrides\x20TTY\x20detection)',![])['option'](a0_0x22f7a9(0x1b8),a0_0x22f7a9(0x15c),![])[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x16e),'Enable\x20verbose\x20logging',![])[a0_0x22f7a9(0x112)]('--timeout\x20<seconds>',a0_0x22f7a9(0x18b),'30')['option'](a0_0x22f7a9(0x190),a0_0x22f7a9(0x10e),![])['option'](a0_0x22f7a9(0x17f),a0_0x22f7a9(0x19d),![])[a0_0x22f7a9(0x112)]('--session\x20<id>','Session\x20ID\x20to\x20use\x20(defaults\x20to\x20parent\x20PID,\x20allows\x20sharing\x20sessions\x20across\x20processes)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x146),a0_0x22f7a9(0x185))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x127),a0_0x22f7a9(0x18c))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1bf),a0_0x22f7a9(0x12f))[a0_0x22f7a9(0x112)]('--parent-segment\x20<name>',a0_0x22f7a9(0x145))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x11e),a0_0x22f7a9(0x14d))[a0_0x22f7a9(0x112)]('--llm-agent\x20<name>',a0_0x22f7a9(0x1a2))[a0_0x22f7a9(0x137)](a0_0x22f7a9(0x1a0),_0x2948d7=>{const _0x595862=a0_0x22f7a9,_0x547f95=_0x2948d7[_0x595862(0x10b)]();if(!_0x547f95[_0x595862(0x1be)]){if(_0x547f95[_0x595862(0x151)])_0x547f95[_0x595862(0x1be)]=_0x595862(0x151);else{if(_0x547f95['jsonl'])_0x547f95[_0x595862(0x1be)]=_0x595862(0x14f);else _0x547f95['tsv']&&(_0x547f95[_0x595862(0x1be)]='tsv');}}_0x547f95['in']&&!_0x547f95[_0x595862(0x193)]&&(_0x547f95[_0x595862(0x193)]=_0x547f95['in']);});function createTDXInstance(_0x4a167f){const _0x2a731c=a0_0x22f7a9,_0xcf26fd=new GlobalContext(_0x4a167f);_0xcf26fd[_0x2a731c(0x155)](_0x4a167f);if(!_0xcf26fd[_0x2a731c(0x131)])throw new Error(_0x2a731c(0x148)+_0xcf26fd[_0x2a731c(0x165)]+'.\x20'+_0x2a731c(0x147));const _0x5eb1bc={'site':_0xcf26fd[_0x2a731c(0x165)],'apiKey':_0xcf26fd[_0x2a731c(0x131)],'verbose':_0xcf26fd[_0x2a731c(0x1ad)]};return new TDX(_0x5eb1bc);}program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x1c0))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x173))[a0_0x22f7a9(0x1c1)](async(_0x2d3f10,_0x3ec860)=>{const _0x2cbd62=a0_0x22f7a9,_0x366462=new DatabasesCommand(),_0x71d8fd=program[_0x2cbd62(0x10b)](),_0x4d014b=createTDXInstance(_0x71d8fd),_0x44508f=await _0x366462[_0x2cbd62(0x195)]({'options':{..._0x71d8fd,..._0x3ec860},'args':_0x2d3f10?[_0x2d3f10]:[],'tdx':_0x4d014b});process[_0x2cbd62(0x11c)](_0x44508f);}),program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x106))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x125))['option']('--agent\x20<ref>',a0_0x22f7a9(0x13d))['option'](a0_0x22f7a9(0x15b),a0_0x22f7a9(0x1ba))[a0_0x22f7a9(0x112)]('--temperature\x20<n>',a0_0x22f7a9(0x108))[a0_0x22f7a9(0x112)]('--new',a0_0x22f7a9(0x11d))[a0_0x22f7a9(0x1c1)](async(_0x51becd,_0x25359e)=>{const _0x4c7e19=a0_0x22f7a9,_0xf5b10=new ChatCommand(),_0x42f199=program['opts'](),_0x4bbacb=createTDXInstance(_0x42f199),_0x5b48f3=await _0xf5b10['run']({'options':{..._0x42f199,..._0x25359e},'args':_0x51becd,'tdx':_0x4bbacb});process[_0x4c7e19(0x11c)](_0x5b48f3);});const apiCmd=program['command'](a0_0x22f7a9(0x1aa))[a0_0x22f7a9(0x17a)](a0_0x22f7a9(0x139))['addHelpText'](a0_0x22f7a9(0x179),a0_0x22f7a9(0x169))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x152),'HTTP\x20method\x20(GET,\x20POST,\x20PUT,\x20DELETE,\x20PATCH)','GET')[a0_0x22f7a9(0x112)]('--data\x20<data>','Request\x20body\x20as\x20JSON\x20string')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x12b),'Read\x20request\x20body\x20from\x20file')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x117),a0_0x22f7a9(0x1b5),(_0x4fe090,_0x2f262c)=>{return _0x2f262c?[..._0x2f262c,_0x4fe090]:[_0x4fe090];})[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x166),'API\x20type\x20(td,\x20cdp,\x20workflow,\x20trino,\x20llm)','td')[a0_0x22f7a9(0x1c1)](async(_0x439ea7,_0x45ff9c)=>{const _0x3d99db=a0_0x22f7a9;if(!_0x439ea7){apiCmd[_0x3d99db(0x1ac)]();return;}const _0xb45bd1=new ApiCommand(),_0x2c52a2=program['opts'](),_0x4e3d49=createTDXInstance(_0x2c52a2),_0x1cd308=await _0xb45bd1[_0x3d99db(0x195)]({'options':{..._0x2c52a2,..._0x45ff9c},'args':[_0x439ea7],'tdx':_0x4e3d49});process[_0x3d99db(0x11c)](_0x1cd308);});program['command'](a0_0x22f7a9(0x19f))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x113))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x132),'Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20pattern)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1bb),a0_0x22f7a9(0x12f))[a0_0x22f7a9(0x1c1)](async(_0x3c3153,_0x45eca9)=>{const _0x1b01d5=a0_0x22f7a9,_0x2f53c7=new TablesCommand(),_0x548376=program['opts'](),_0x21c064=createTDXInstance(_0x548376);_0x45eca9['in']&&(_0x45eca9[_0x1b01d5(0x193)]=_0x45eca9['in']);const _0x5ac666=await _0x2f53c7[_0x1b01d5(0x195)]({'options':{..._0x548376,..._0x45eca9},'args':_0x3c3153?[_0x3c3153]:[],'tdx':_0x21c064});process[_0x1b01d5(0x11c)](_0x5ac666);}),program[a0_0x22f7a9(0x1b0)]('show\x20<table>')[a0_0x22f7a9(0x199)]('Show\x20table\x20contents\x20(SELECT\x20*\x20with\x20limit)')['option'](a0_0x22f7a9(0x132),'Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20table\x20pattern)')['option']('--in\x20<database>','Alias\x20for\x20--database\x20(natural\x20language\x20style)')[a0_0x22f7a9(0x1c1)](async(_0x47d65d,_0x4f5513)=>{const _0x58a27b=a0_0x22f7a9,_0x2ffa2c=new ShowCommand(),_0x148c7c=program[_0x58a27b(0x10b)](),_0x52cd88=createTDXInstance(_0x148c7c);_0x4f5513['in']&&(_0x4f5513[_0x58a27b(0x193)]=_0x4f5513['in']);const _0x2804b2=await _0x2ffa2c['run']({'options':{..._0x148c7c,..._0x4f5513},'args':[_0x47d65d],'tdx':_0x52cd88});process['exit'](_0x2804b2);}),program['command'](a0_0x22f7a9(0x138))[a0_0x22f7a9(0x175)](a0_0x22f7a9(0x115))['description'](a0_0x22f7a9(0x12e))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x132),'Database\x20name\x20(used\x20when\x20not\x20specified\x20in\x20table\x20pattern)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1bb),'Alias\x20for\x20--database\x20(natural\x20language\x20style)')[a0_0x22f7a9(0x1c1)](async(_0x2d12e3,_0x15af73)=>{const _0x430c37=a0_0x22f7a9,_0x2761c7=new DescribeCommand(),_0x188f16=program[_0x430c37(0x10b)](),_0xe4a5d4=createTDXInstance(_0x188f16);_0x15af73['in']&&(_0x15af73['database']=_0x15af73['in']);const _0x288bfc=await _0x2761c7[_0x430c37(0x195)]({'options':{..._0x188f16,..._0x15af73},'args':[_0x2d12e3],'tdx':_0xe4a5d4});process[_0x430c37(0x11c)](_0x288bfc);}),program['command']('query\x20[sql]')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x140))['option'](a0_0x22f7a9(0x132),a0_0x22f7a9(0x11f))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1bb),a0_0x22f7a9(0x12f))[a0_0x22f7a9(0x112)]('--catalog\x20<catalog>',a0_0x22f7a9(0x164))['option'](a0_0x22f7a9(0x12b),a0_0x22f7a9(0x111))[a0_0x22f7a9(0x112)]('--limit\x20<rows>','Maximum\x20rows\x20to\x20display\x20in\x20table\x20format\x20(default:\x2040)','40')['action'](async(_0x164f23,_0x3b60e6)=>{const _0x2cf6b1=a0_0x22f7a9,_0x18f036=new QueryCommand(),_0x4c1016=program['opts'](),_0x156052=createTDXInstance(_0x4c1016);_0x3b60e6['in']&&(_0x3b60e6[_0x2cf6b1(0x193)]=_0x3b60e6['in']);const _0x2d9a7f=await _0x18f036['run']({'options':{..._0x4c1016,..._0x3b60e6},'args':_0x164f23?[_0x164f23]:[],'tdx':_0x156052});process['exit'](_0x2d9a7f);}),program['command']('job')[a0_0x22f7a9(0x199)]('Job\x20management\x20commands')[a0_0x22f7a9(0x1c1)](()=>{const _0x3229c3=a0_0x22f7a9;console[_0x3229c3(0x197)](_0x3229c3(0x149));}),program['command'](a0_0x22f7a9(0x1a6))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x19b))[a0_0x22f7a9(0x1c1)](async(_0x436311,_0x2fb0e2)=>{const _0x2f1c19=a0_0x22f7a9,_0x1a7766=new SegmentsCommand(),_0x3423fd=program[_0x2f1c19(0x10b)](),_0x365800=createTDXInstance(_0x3423fd),_0x4b6cd1=await _0x1a7766[_0x2f1c19(0x195)]({'options':{..._0x3423fd,..._0x2fb0e2},'args':_0x436311?[_0x436311]:[],'tdx':_0x365800});process['exit'](_0x4b6cd1);});const segmentCmd=program['command'](a0_0x22f7a9(0x12a))['description'](a0_0x22f7a9(0x1a9));segmentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x15e))[a0_0x22f7a9(0x175)](a0_0x22f7a9(0x115))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x13b))[a0_0x22f7a9(0x1c1)](async(_0x2c9ca1,_0x3a3904)=>{const _0x36dca7=a0_0x22f7a9,_0x56a090=new SegmentDescribeCommand(),_0x3192c4=program[_0x36dca7(0x10b)](),_0x57ba78=createTDXInstance(_0x3192c4),_0x4d2cb4=await _0x56a090['run']({'options':{..._0x3192c4,..._0x3a3904},'args':[_0x2c9ca1],'tdx':_0x57ba78});process[_0x36dca7(0x11c)](_0x4d2cb4);}),segmentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x118))['description'](a0_0x22f7a9(0x162))['action'](async(_0x1735af,_0x428281)=>{const _0x5a3cf2=a0_0x22f7a9,_0x24ba81=new SegmentShowCommand(),_0x46e091=program[_0x5a3cf2(0x10b)](),_0x4b872f=createTDXInstance(_0x46e091),_0x5a0dfc=await _0x24ba81['run']({'options':{..._0x46e091,..._0x428281},'args':[_0x1735af],'tdx':_0x4b872f});process[_0x5a3cf2(0x11c)](_0x5a0dfc);}),segmentCmd['command'](a0_0x22f7a9(0x189))['description'](a0_0x22f7a9(0x128))[a0_0x22f7a9(0x1c1)](async(_0x8e4362,_0x2c5491)=>{const _0x207c18=a0_0x22f7a9,_0x31a639=new SegmentFolderListCommand(),_0x8f5ee0=program[_0x207c18(0x10b)](),_0x1fc62d=createTDXInstance(_0x8f5ee0),_0x543c10=await _0x31a639['run']({'options':{..._0x8f5ee0,..._0x2c5491},'args':[_0x8e4362],'tdx':_0x1fc62d});process['exit'](_0x543c10);});const folderCmd=segmentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x194))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x143));function a0_0x208e(){const _0x333c21=['-H,\x20--header\x20<header>','show\x20<segment_name>','Agent\x20name','Kill\x20a\x20running\x20attempt','tasks\x20<attempt-id>','exit','Start\x20a\x20new\x20chat\x20session','--llm-project\x20<name>','Database\x20to\x20query\x20(default:\x20information_schema)','version','slice','Project\x20ID','--include-retried','Set\x20session-level\x20context\x20(resources:\x20database,\x20parent_segment,\x20llm_project,\x20llm_agent,\x20profile)','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified\x20interface)','remove\x20<agent-ref>','-d,\x20--database\x20<name>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Model\x20type\x20(default:\x20claude-4.5-sonnet)','segment','-f,\x20--file\x20<path>','1720rZiGbV','sessions\x20[project]','Describe\x20table\x20schema','Alias\x20for\x20--database\x20(natural\x20language\x20style)','List\x20workflow\x20attempts\x20(filter\x20by\x20project\x20or\x20project.workflow)','apiKey','-d,\x20--database\x20<database>','use\x20[resource]\x20[value]','update\x20<agent-ref>','191LahRyI','Maximum\x20tool\x20iterations\x20(default:\x204)','hook','describe\x20<table>','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','outputHelp','Show\x20segment\x20details\x20(use\x20parent_name\x20or\x20parent_name.child_name)','agent','Agent\x20reference\x20(project-name/agent-name)','models','10479610obphcB','Run\x20Trino\x20query\x20with\x20streaming\x20results','--json','Starting\x20offset\x20for\x20logs\x20(default:\x200)','Segment\x20folder\x20management','AI-native\x20CLI\x20for\x20Treasure\x20Data','Parent\x20segment\x20to\x20use\x20(overrides\x20context)','--profile\x20<name>','Set\x20TD_API_KEY\x20environment\x20variable\x20or\x20configure\x20credentials\x20in\x20~/.config/tdx/.env','No\x20API\x20key\x20found\x20for\x20site\x20','Job\x20commands\x20-\x20coming\x20soon','--format\x20<format>','retry\x20<session-id|attempt-id>','Start\x20time\x20filter\x20(ISO\x208601\x20format)','LLM\x20project\x20to\x20use\x20(overrides\x20context)','workflow','jsonl','7623gcKQvK','json','-X,\x20--method\x20<method>','Update\x20an\x20existing\x20agent\x20(use\x20\x22project-name/agent-name\x22)','--temperature\x20<n>','injectIntoOptions','get\x20<agent-ref>','Output\x20format\x20(table,\x20json,\x20jsonl,\x20tsv)','List\x20all\x20LLM\x20agents\x20(optionally\x20filtered\x20by\x20project\x20name)','--description\x20<text>','0.7','--model\x20<name>','Disable\x20ANSI\x20color\x20output\x20(also\x20respects\x20NO_COLOR\x20env\x20var)','--params\x20<json>','describe\x20<segment_name>','--offset\x20<number>','logs\x20<attempt-id>\x20<task-name>','tdx','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results\x20(use\x20parent_name\x20or\x20parent_name.child_name)','agents\x20[project-name]','Trino\x20catalog\x20(default:\x20td)','site','--type\x20<api_type>','Force\x20retry\x20even\x20if\x20not\x20failed\x20(attempt\x20retry\x20only)','create\x20<name>','\x0aExamples:\x0a\x20\x20$\x20tdx\x20api\x20/v3/database/list\x0a\x20\x20$\x20tdx\x20api\x20/v3/database/show/mydb\x0a\x20\x20$\x20tdx\x20api\x20-X\x20POST\x20--data\x20\x27{\x22query\x22:\x22SELECT\x201\x22}\x27\x20/v3/job/issue/hive/mydb\x0a\x20\x20$\x20tdx\x20api\x20/entities/parent_segments\x20--type\x20cdp\x0a\x20\x20$\x20tdx\x20api\x20/api/workflows\x20--type\x20workflow\x0a','--debug','--from-task\x20<task>','--limit\x20<rows>','Show\x20folder\x20details\x20(use\x20parent_name.folder_name)','--verbose','Resume\x20from\x20specific\x20task\x20(attempt\x20retry\x20only)','argv','Clear\x20session\x20context','context','List\x20all\x20databases\x20(optionally\x20filtered\x20by\x20glob\x20pattern)','output\x20the\x20version\x20number','alias','length','List\x20available\x20LLM\x20models','../package.json','after','summary','utf-8','TD\x20site/region\x20(us01,\x20jp01,\x20eu01,\x20ap02)','533765FYTMNj','--tsv','-y,\x20--yes','1613919lUQMVD','--jsonl','attempts\x20[project]','Workflow\x20(Digdag)\x20management\x20commands','List\x20all\x20workflow\x20projects\x20(optionally\x20filtered\x20by\x20glob\x20pattern)','Profile\x20to\x20use\x20(overrides\x20active\x20profile)','Show\x20specific\x20attempt\x20details','claude-4.5-sonnet','List\x20activations\x20for\x20a\x20segment\x20(use\x20parent_name.child_name)','folders\x20<parent_name>','--max-tool-iterations\x20<n>','Set\x20operation\x20timeout\x20in\x20seconds','Database\x20to\x20use\x20(overrides\x20context)','push','1777446HKEVWB','Show\x20chat\x20history\x20(or\x20list\x20all\x20sessions\x20if\x20no\x20ID\x20provided)','--dry-run','Output\x20in\x20TSV\x20format\x20(shorthand\x20for\x20--format\x20tsv)','--system-prompt\x20<text>','database','folder','run','us01','log','-v,\x20--version','description','--color','List\x20parent\x20segments\x20or\x20child\x20segments\x20under\x20a\x20parent','url','Skip\x20confirmation\x20prompts','Override\x20parameters\x20(JSON\x20string\x20or\x20@file.json)','tables\x20[pattern]','preAction','List\x20workflow\x20execution\x20sessions\x20(filter\x20by\x20project\x20or\x20project.workflow)','LLM\x20agent\x20to\x20use\x20(overrides\x20context)','--starter-message\x20<text>','Maximum\x20rows\x20to\x20display\x20in\x20table\x20format\x20(default:\x2040)','Save\x20output\x20to\x20file','segments\x20[parent_name]','--include-subtasks','--resume-from\x20<task>','CDP\x20segment\x20management\x20commands','api\x20[endpoint]','Show\x20current\x20resolved\x20context','help','verbose','Agent\x20description','activations\x20<segment_name>','command','kill\x20<attempt-id>','2682218ledeXk','parse','--force','Custom\x20header\x20(format:\x20\x22Key:\x20Value\x22,\x20repeatable)','End\x20time\x20filter\x20(ISO\x208601\x20format)','projects\x20[pattern]','--no-color','Delete\x20an\x20agent\x20(use\x20\x22project-name/agent-name\x22)','Model\x20name\x20(default:\x20claude-4.5-sonnet)','--in\x20<database>','3056AniRsZ','Show\x20tasks\x20for\x20an\x20attempt','format','--in\x20<name>','databases\x20[pattern]','action','--project-id\x20<id>','LLM\x20agent\x20management\x20commands','List\x20all\x20available\x20profiles','chat\x20[message...]','--site\x20<site>','Temperature\x20(0.0-2.0,\x20default:\x200.7)','Starter\x20message','--from\x20<timestamp>','opts','--output\x20<file>','name','Preview\x20operation\x20without\x20executing','Output\x20in\x20JSON\x20format\x20(shorthand\x20for\x20--format\x20json)','4PDMBHK','Read\x20SQL\x20query\x20from\x20file','option','List\x20tables\x20(e.g.,\x20mydb,\x20mydb.*,\x20*.user*,\x20mydb.user*)','--name\x20<text>','desc','show\x20<folder_ref>'];a0_0x208e=function(){return _0x333c21;};return a0_0x208e();}folderCmd['command'](a0_0x22f7a9(0x116))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x16d))['action'](async(_0x233d9f,_0x5f1664)=>{const _0x53307e=a0_0x22f7a9,_0x3c9fa2=new SegmentFolderShowCommand(),_0x44f135=program[_0x53307e(0x10b)](),_0x30733d=createTDXInstance(_0x44f135),_0x3a79a4=await _0x3c9fa2['run']({'options':{..._0x44f135,..._0x5f1664},'args':[_0x233d9f],'tdx':_0x30733d});process[_0x53307e(0x11c)](_0x3a79a4);}),segmentCmd[a0_0x22f7a9(0x1b0)]('sql\x20<segment_name>')['description']('Get\x20SQL\x20query\x20for\x20segment\x20(use\x20parent_name\x20or\x20parent_name.child_name)')[a0_0x22f7a9(0x1c1)](async(_0x3b3787,_0x468c90)=>{const _0x3e85a4=a0_0x22f7a9,_0x547131=new SegmentSQLCommand(),_0x54e4bd=program[_0x3e85a4(0x10b)](),_0x48792d=createTDXInstance(_0x54e4bd),_0xbeceb6=await _0x547131[_0x3e85a4(0x195)]({'options':{..._0x54e4bd,..._0x468c90},'args':[_0x3b3787],'tdx':_0x48792d});process[_0x3e85a4(0x11c)](_0xbeceb6);}),program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x1af))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x188))['action'](async(_0x2285f0,_0xe669ed)=>{const _0x3deced=a0_0x22f7a9,_0x3e57b3=new ActivationsCommand(),_0x11512b=program[_0x3deced(0x10b)](),_0xe0c628=createTDXInstance(_0x11512b),_0x395d14=await _0x3e57b3[_0x3deced(0x195)]({'options':{..._0x11512b,..._0xe669ed},'args':[_0x2285f0],'tdx':_0xe0c628});process[_0x3deced(0x11c)](_0x395d14);});const workflowCmd=program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x14e))['alias']('wf')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x183));workflowCmd['command'](a0_0x22f7a9(0x1b7))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x184))[a0_0x22f7a9(0x1c1)](async(_0x3ee5cd,_0x373ea3)=>{const _0x2ef401=a0_0x22f7a9,_0x54983d=new WorkflowProjectsCommand(),_0x537a9d=program[_0x2ef401(0x10b)](),_0x2dd954=createTDXInstance(_0x537a9d),_0x49c4c6=await _0x54983d[_0x2ef401(0x195)]({'options':{..._0x537a9d,..._0x373ea3},'args':_0x3ee5cd?[_0x3ee5cd]:[],'tdx':_0x2dd954});process[_0x2ef401(0x11c)](_0x49c4c6);}),workflowCmd[a0_0x22f7a9(0x1b0)]('workflows\x20[project]')['alias']('ls')[a0_0x22f7a9(0x199)]('List\x20workflows\x20(optionally\x20filtered\x20by\x20project)')[a0_0x22f7a9(0x1c1)](async(_0x2dcc33,_0x275bca)=>{const _0x4445b1=a0_0x22f7a9,_0x45bf7b=new WorkflowWorkflowsCommand(),_0x144184=program[_0x4445b1(0x10b)](),_0xabc895=createTDXInstance(_0x144184),_0x2d383e=await _0x45bf7b['run']({'options':{..._0x144184,..._0x275bca},'args':_0x2dcc33?[_0x2dcc33]:[],'tdx':_0xabc895});process[_0x4445b1(0x11c)](_0x2d383e);}),workflowCmd['command'](a0_0x22f7a9(0x12d))['description'](a0_0x22f7a9(0x1a1))['option']('--status\x20<status>','Filter\x20by\x20status\x20(running,\x20success,\x20error,\x20blocked,\x20all)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x10a),a0_0x22f7a9(0x14c))[a0_0x22f7a9(0x112)]('--to\x20<timestamp>',a0_0x22f7a9(0x1b6))[a0_0x22f7a9(0x1c1)](async(_0x37d9a0,_0x1c1da9)=>{const _0x37d482=a0_0x22f7a9,_0x4c4fd4=new WorkflowSessionsCommand(),_0x194936=program[_0x37d482(0x10b)](),_0x2dd607=createTDXInstance(_0x194936),_0x27c8f9=await _0x4c4fd4[_0x37d482(0x195)]({'options':{..._0x194936,..._0x1c1da9},'args':_0x37d9a0?[_0x37d9a0]:[],'tdx':_0x2dd607});process[_0x37d482(0x11c)](_0x27c8f9);}),workflowCmd['command'](a0_0x22f7a9(0x182))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x130))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x123),'Include\x20retried\x20attempts')[a0_0x22f7a9(0x1c1)](async(_0x5874dc,_0x115391)=>{const _0x5be2dc=a0_0x22f7a9,_0x3e0ee9=new WorkflowAttemptsCommand(),_0x229656=program[_0x5be2dc(0x10b)](),_0x7c89ad=createTDXInstance(_0x229656),_0x1ab5ec=await _0x3e0ee9['run']({'options':{..._0x229656,..._0x115391},'args':_0x5874dc?[_0x5874dc]:[],'tdx':_0x7c89ad});process['exit'](_0x1ab5ec);}),workflowCmd[a0_0x22f7a9(0x1b0)]('attempt\x20<attempt-id>')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x186))['action'](async(_0x4c58ed,_0x4ccfec)=>{const _0x2fd9a0=a0_0x22f7a9,_0xd0b2c3=new WorkflowAttemptCommand(),_0x3016f9=program[_0x2fd9a0(0x10b)](),_0x373e73=createTDXInstance(_0x3016f9),_0x38487c=await _0xd0b2c3['run']({'options':{..._0x3016f9,..._0x4ccfec},'args':[_0x4c58ed],'tdx':_0x373e73});process[_0x2fd9a0(0x11c)](_0x38487c);}),workflowCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x11b))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x1bd))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1a7),'Include\x20subtasks\x20in\x20the\x20output')[a0_0x22f7a9(0x1c1)](async(_0x41afcf,_0x4f6bae)=>{const _0x3b9ce5=a0_0x22f7a9,_0x18ad54=new WorkflowTasksCommand(),_0x4cd37f=program[_0x3b9ce5(0x10b)](),_0x1145a3=createTDXInstance(_0x4cd37f),_0x5242c3=await _0x18ad54[_0x3b9ce5(0x195)]({'options':{..._0x4cd37f,..._0x4f6bae},'args':[_0x41afcf],'tdx':_0x1145a3});process[_0x3b9ce5(0x11c)](_0x5242c3);}),workflowCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x160))['description']('Show\x20logs\x20for\x20a\x20specific\x20task')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x15f),a0_0x22f7a9(0x142),_0x5f0af8=>parseInt(_0x5f0af8,0xa),0x0)[a0_0x22f7a9(0x1c1)](async(_0x43dff5,_0x191bc1,_0x3d1917)=>{const _0x19c8ab=a0_0x22f7a9,_0x24cc69=new WorkflowLogsCommand(),_0x172a99=program['opts'](),_0x4b867c=createTDXInstance(_0x172a99),_0x32b065=await _0x24cc69[_0x19c8ab(0x195)]({'options':{..._0x172a99,..._0x3d1917},'args':[_0x43dff5,_0x191bc1],'tdx':_0x4b867c});process['exit'](_0x32b065);}),workflowCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x1b1))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x11a))[a0_0x22f7a9(0x112)]('--reason\x20<text>','Reason\x20for\x20killing\x20the\x20attempt')[a0_0x22f7a9(0x1c1)](async(_0x3d062c,_0x118932)=>{const _0x2dd708=a0_0x22f7a9,_0x41324c=new WorkflowKillCommand(),_0x5e412f=program[_0x2dd708(0x10b)](),_0x39f0b7=createTDXInstance(_0x5e412f),_0x448e41=await _0x41324c[_0x2dd708(0x195)]({'options':{..._0x5e412f,..._0x118932},'args':[_0x3d062c],'tdx':_0x39f0b7});process[_0x2dd708(0x11c)](_0x448e41);}),workflowCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x14b))[a0_0x22f7a9(0x199)]('Retry\x20a\x20session\x20or\x20attempt\x20(prefix\x20with\x20session:\x20or\x20attempt:)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x16b),'Resume\x20from\x20specific\x20task\x20(session\x20retry\x20only)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x1a8),a0_0x22f7a9(0x16f))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x15d),a0_0x22f7a9(0x19e))['option'](a0_0x22f7a9(0x1b4),a0_0x22f7a9(0x167))[a0_0x22f7a9(0x1c1)](async(_0x5040a2,_0x3773c5)=>{const _0x30a7da=a0_0x22f7a9,_0x2d457f=new WorkflowRetryCommand(),_0x7b91ef=program[_0x30a7da(0x10b)](),_0x29ee2f=createTDXInstance(_0x7b91ef),_0x7b1449=await _0x2d457f['run']({'options':{..._0x7b91ef,..._0x3773c5},'args':[_0x5040a2],'tdx':_0x29ee2f});process['exit'](_0x7b1449);}),program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x163))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x158))[a0_0x22f7a9(0x1c1)](async(_0x7fe2d8,_0x37a4be)=>{const _0x5b4982=a0_0x22f7a9,_0x4c4bdc=new AgentsListCommand(),_0x3ec191=program[_0x5b4982(0x10b)](),_0x4d6e09=createTDXInstance(_0x3ec191),_0x4dbd9f=await _0x4c4bdc[_0x5b4982(0x195)]({'options':{..._0x3ec191,..._0x37a4be},'args':_0x7fe2d8?[_0x7fe2d8]:[],'tdx':_0x4d6e09});process[_0x5b4982(0x11c)](_0x4dbd9f);});const agentCmd=program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x13c))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x1c3));agentCmd['command'](a0_0x22f7a9(0x13e))['description'](a0_0x22f7a9(0x177))['action'](async _0xf1878e=>{const _0x575fcd=a0_0x22f7a9,_0x1df7f5=new AgentModelsCommand(),_0x5372e6=program['opts'](),_0x22b2bf=createTDXInstance(_0x5372e6),_0x1f94ae=await _0x1df7f5['run']({'options':{..._0x5372e6,..._0xf1878e},'args':[],'tdx':_0x22b2bf});process[_0x575fcd(0x11c)](_0x1f94ae);}),agentCmd[a0_0x22f7a9(0x1b0)]('projects')[a0_0x22f7a9(0x199)]('List\x20all\x20LLM\x20projects')[a0_0x22f7a9(0x1c1)](async _0x34f5b2=>{const _0xe42175=a0_0x22f7a9,_0x1d7f1a=new AgentProjectsCommand(),_0x3c77a0=program[_0xe42175(0x10b)](),_0x37b522=createTDXInstance(_0x3c77a0),_0x2fa464=await _0x1d7f1a[_0xe42175(0x195)]({'options':{..._0x3c77a0,..._0x34f5b2},'args':[],'tdx':_0x37b522});process['exit'](_0x2fa464);}),agentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x156))[a0_0x22f7a9(0x199)]('Get\x20agent\x20details\x20(use\x20\x22project-name/agent-name\x22)')[a0_0x22f7a9(0x1c1)](async(_0x30d747,_0x18617f)=>{const _0x1b018b=a0_0x22f7a9,_0x1a1e68=new AgentGetCommand(),_0x2126ba=program['opts'](),_0x1891e5=createTDXInstance(_0x2126ba),_0x1ff931=await _0x1a1e68[_0x1b018b(0x195)]({'options':{..._0x2126ba,..._0x18617f},'args':[_0x30d747],'tdx':_0x1891e5});process[_0x1b018b(0x11c)](_0x1ff931);}),agentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x168))[a0_0x22f7a9(0x199)]('Create\x20a\x20new\x20agent')['requiredOption'](a0_0x22f7a9(0x1c2),a0_0x22f7a9(0x122))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x192),'System\x20prompt/instructions\x20(default:\x20empty)')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x15b),a0_0x22f7a9(0x129),a0_0x22f7a9(0x187))['option'](a0_0x22f7a9(0x1a3),a0_0x22f7a9(0x109))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x18a),a0_0x22f7a9(0x136),'4')['option'](a0_0x22f7a9(0x154),'Temperature\x20(0.0-2.0,\x20default:\x200.7)',a0_0x22f7a9(0x15a))[a0_0x22f7a9(0x1c1)](async(_0x2f245e,_0x14d1f9)=>{const _0x19fe69=a0_0x22f7a9,_0x272fdf=new AgentCreateCommand(),_0x1e700c=program[_0x19fe69(0x10b)](),_0x2460f0=createTDXInstance(_0x1e700c),_0x403564=await _0x272fdf[_0x19fe69(0x195)]({'options':{..._0x1e700c,..._0x14d1f9},'args':[_0x2f245e],'tdx':_0x2460f0});process[_0x19fe69(0x11c)](_0x403564);}),agentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x134))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x153))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x114),a0_0x22f7a9(0x119))[a0_0x22f7a9(0x112)]('--prompt\x20<text>','Agent\x20prompt/instructions')[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x159),a0_0x22f7a9(0x1ae))['option']('--starter-message\x20<text>','Starter\x20message')[a0_0x22f7a9(0x1c1)](async(_0x4db906,_0x52fef9)=>{const _0x1c9343=new AgentUpdateCommand(),_0x384efa=program['opts'](),_0x4e0621=createTDXInstance(_0x384efa),_0x216540=await _0x1c9343['run']({'options':{..._0x384efa,..._0x52fef9},'args':[_0x4db906],'tdx':_0x4e0621});process['exit'](_0x216540);}),agentCmd[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x126))[a0_0x22f7a9(0x175)]('delete')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x1b9))[a0_0x22f7a9(0x1c1)](async(_0x650545,_0x6ab30c)=>{const _0x3356ad=a0_0x22f7a9,_0x527849=new AgentRemoveCommand(),_0x2383a8=program[_0x3356ad(0x10b)](),_0x43d62a=createTDXInstance(_0x2383a8),_0xa88682=await _0x527849[_0x3356ad(0x195)]({'options':{..._0x2383a8,..._0x6ab30c},'args':[_0x650545],'tdx':_0x43d62a});process[_0x3356ad(0x11c)](_0xa88682);}),agentCmd[a0_0x22f7a9(0x1b0)]('history\x20[chat-id]')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x18f))['action'](async(_0xd800d4,_0x22d855)=>{const _0x140687=a0_0x22f7a9,_0x451c97=new AgentHistoryCommand(),_0x13aa9d=program[_0x140687(0x10b)](),_0x258f2d=createTDXInstance(_0x13aa9d),_0x289c24=await _0x451c97[_0x140687(0x195)]({'options':{..._0x13aa9d,..._0x22d855},'args':_0xd800d4?[_0xd800d4]:[],'tdx':_0x258f2d});process[_0x140687(0x11c)](_0x289c24);}),program['command'](a0_0x22f7a9(0x172))[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x1ab))[a0_0x22f7a9(0x112)](a0_0x22f7a9(0x16a),'Show\x20context\x20with\x20sources\x20(for\x20debugging)')['action'](async _0x52a2a4=>{const _0x2920c0=a0_0x22f7a9,_0x334016=new ContextCommand(),_0x3181ab=program['opts'](),_0x1cc02b=await _0x334016[_0x2920c0(0x195)]({'options':{..._0x3181ab,..._0x52a2a4},'args':[],'tdx':null});process['exit'](_0x1cc02b);}),program[a0_0x22f7a9(0x1b0)](a0_0x22f7a9(0x133))['description'](a0_0x22f7a9(0x124))[a0_0x22f7a9(0x112)]('--clear',a0_0x22f7a9(0x171))[a0_0x22f7a9(0x1c1)](async(_0x2686ce,_0x41dd5d,_0x48066f)=>{const _0x3482c1=a0_0x22f7a9,_0x42a4cd=new UseCommand(),_0x20ad10=program['opts'](),_0x5531de=[];if(_0x2686ce)_0x5531de[_0x3482c1(0x18d)](_0x2686ce);if(_0x41dd5d)_0x5531de['push'](_0x41dd5d);const _0x40c664=await _0x42a4cd[_0x3482c1(0x195)]({'options':{..._0x20ad10,..._0x48066f},'args':_0x5531de,'tdx':null});process[_0x3482c1(0x11c)](_0x40c664);}),program['command']('profiles')[a0_0x22f7a9(0x199)](a0_0x22f7a9(0x105))[a0_0x22f7a9(0x1c1)](async _0x1a3dc=>{const _0x17f43c=a0_0x22f7a9,_0x40c818=new ProfilesCommand(),_0x530d75=program['opts'](),_0x3062f8=await _0x40c818[_0x17f43c(0x195)]({'options':{..._0x530d75,..._0x1a3dc},'args':[],'tdx':null});process[_0x17f43c(0x11c)](_0x3062f8);}),program['parse'](process[a0_0x22f7a9(0x170)]);!process[a0_0x22f7a9(0x170)][a0_0x22f7a9(0x121)](0x2)[a0_0x22f7a9(0x176)]&&program[a0_0x22f7a9(0x13a)]();
|