@ariacode/cli 0.2.2 → 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 (54) hide show
  1. package/README.md +60 -7
  2. package/dist/actions/db-ask.d.ts +2 -0
  3. package/dist/actions/db-ask.js +23 -6
  4. package/dist/actions/db-ask.js.map +1 -1
  5. package/dist/actions/db-explain.d.ts +2 -0
  6. package/dist/actions/db-explain.js +23 -5
  7. package/dist/actions/db-explain.js.map +1 -1
  8. package/dist/actions/db-schema.d.ts +2 -0
  9. package/dist/actions/db-schema.js +15 -2
  10. package/dist/actions/db-schema.js.map +1 -1
  11. package/dist/actions/upgrade-deps.d.ts +2 -0
  12. package/dist/actions/upgrade-deps.js +18 -0
  13. package/dist/actions/upgrade-deps.js.map +1 -1
  14. package/dist/actions.d.ts +86 -71
  15. package/dist/actions.js +382 -182
  16. package/dist/actions.js.map +1 -1
  17. package/dist/agent.d.ts +0 -1
  18. package/dist/agent.js +1 -2
  19. package/dist/agent.js.map +1 -1
  20. package/dist/app.d.ts +3 -3
  21. package/dist/app.js +3 -3
  22. package/dist/cli.d.ts +0 -1
  23. package/dist/cli.js +15 -3
  24. package/dist/cli.js.map +1 -1
  25. package/dist/config.d.ts +1 -1
  26. package/dist/config.js +1 -1
  27. package/dist/output/schemas.d.ts +92 -0
  28. package/dist/output/schemas.js +142 -0
  29. package/dist/output/schemas.js.map +1 -0
  30. package/dist/parser.d.ts +8 -3
  31. package/dist/parser.js +51 -5
  32. package/dist/parser.js.map +1 -1
  33. package/dist/repo.d.ts +0 -1
  34. package/dist/repo.js +6 -9
  35. package/dist/repo.js.map +1 -1
  36. package/dist/safety.d.ts +0 -4
  37. package/dist/safety.js +0 -4
  38. package/dist/safety.js.map +1 -1
  39. package/dist/storage/queries.d.ts +39 -0
  40. package/dist/storage/queries.js +211 -0
  41. package/dist/storage/queries.js.map +1 -0
  42. package/dist/tools.d.ts +6 -7
  43. package/dist/tools.js +20 -7
  44. package/dist/tools.js.map +1 -1
  45. package/dist/ui/diff-renderer.d.ts +28 -0
  46. package/dist/ui/diff-renderer.js +388 -0
  47. package/dist/ui/diff-renderer.js.map +1 -0
  48. package/dist/ui/highlight.d.ts +25 -0
  49. package/dist/ui/highlight.js +239 -0
  50. package/dist/ui/highlight.js.map +1 -0
  51. package/dist/ui.d.ts +3 -16
  52. package/dist/ui.js +7 -28
  53. package/dist/ui.js.map +1 -1
  54. package/package.json +1 -1
package/dist/actions.d.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  * - Agent loop execution
9
9
  * - Terminal output
10
10
  */
11
+ import type { SessionStatus } from "./storage.js";
11
12
  /**
12
13
  * Options parsed from CLI flags for the ask command.
13
14
  */
@@ -26,20 +27,21 @@ export interface AskOptions {
26
27
  provider?: string;
27
28
  /** Override model (v0.2.2) */
28
29
  model?: string;
30
+ /** Output format (v0.2.3) */
31
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
29
32
  }
30
33
  /**
31
34
  * Execute the ask command.
32
35
  *
33
36
  * Flow:
34
- * 1. Load configuration and detect project type (Req 9.1)
35
- * 2. Create or resume session with mode: "plan" (Req 9.2, 9.9)
36
- * 3. Build system prompt from ask.md template (Req 9.3)
37
- * 4. Expose only read-only tools (Req 9.4)
38
- * 5. Execute agent loop (Req 9.5, 9.6)
39
- * 6. Render response to terminal (Req 9.7)
40
- * 7. Persist session to database (Req 9.8)
37
+ * 1. Load configuration and detect project type
38
+ * 2. Create or resume session with mode: "plan"
39
+ * 3. Build system prompt from ask.md template
40
+ * 4. Expose only read-only tools
41
+ * 5. Execute agent loop
42
+ * 6. Render response to terminal
43
+ * 7. Persist session to database
41
44
  *
42
- * Requirements: 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9
43
45
  */
44
46
  export declare function runAsk(options: AskOptions): Promise<void>;
45
47
  /**
@@ -60,21 +62,22 @@ export interface PlanOptions {
60
62
  provider?: string;
61
63
  /** Override model (v0.2.2) */
62
64
  model?: string;
65
+ /** Output format (v0.2.3) */
66
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
63
67
  }
64
68
  /**
65
69
  * Execute the plan command.
66
70
  *
67
71
  * Flow:
68
- * 1. Load configuration and detect project type (Req 10.1)
69
- * 2. Create or resume session with mode: "plan" (Req 10.2, 10.8)
70
- * 3. Build system prompt from plan.md template (Req 10.3)
71
- * 4. Expose only read-only tools (Req 10.4)
72
- * 5. Execute agent loop (Req 10.5)
73
- * 6. Render structured plan to terminal (Req 10.6)
74
- * 7. Save to file if --output flag provided (Req 10.7)
75
- * 8. Persist session to database (Req 10.8)
72
+ * 1. Load configuration and detect project type
73
+ * 2. Create or resume session with mode: "plan"
74
+ * 3. Build system prompt from plan.md template
75
+ * 4. Expose only read-only tools
76
+ * 5. Execute agent loop
77
+ * 6. Render structured plan to terminal
78
+ * 7. Save to file if --output flag provided
79
+ * 8. Persist session to database
76
80
  *
77
- * Requirements: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
78
81
  */
79
82
  export declare function runPlan(options: PlanOptions): Promise<void>;
80
83
  /**
@@ -97,26 +100,29 @@ export interface PatchOptions {
97
100
  provider?: string;
98
101
  /** Override model (v0.2.2) */
99
102
  model?: string;
103
+ /** Render diff in side-by-side layout when terminal is wide enough */
104
+ split?: boolean;
105
+ /** Output format */
106
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
100
107
  }
101
108
  /**
102
109
  * Execute the patch command.
103
110
  *
104
111
  * Flow:
105
- * 1. Load configuration and detect project type (Req 11.1)
106
- * 2. Create session with mode: "build" (Req 11.2)
107
- * 3. Build system prompt from patch.md template (Req 11.3)
108
- * 4. Expose read-only + mutation tools (Req 11.4)
109
- * 5. Execute agent loop — agent calls propose_diff (Req 11.4, 11.5)
110
- * 6. Render diff preview with syntax highlighting (Req 11.6)
111
- * 7. Render mutation summary (Req 11.7)
112
- * 8. If --dry-run, exit with code 0 (Req 11.8, 17.3, 17.4)
113
- * 9. If not --yes, prompt for confirmation (Req 11.9, 17.5)
114
- * 10. Agent calls apply_diff atomically (Req 11.10, 11.11, 11.12)
115
- * 11. Log mutation to database (Req 11.11)
116
- * 12. Display rollback hints (Req 11.12, 17.9)
117
- * 13. Persist session to database (Req 11.13)
112
+ * 1. Load configuration and detect project type
113
+ * 2. Create session with mode: "build"
114
+ * 3. Build system prompt from patch.md template
115
+ * 4. Expose read-only + mutation tools
116
+ * 5. Execute agent loop — agent calls propose_diff
117
+ * 6. Render diff preview with syntax highlighting
118
+ * 7. Render mutation summary
119
+ * 8. If --dry-run, exit with code 0
120
+ * 9. If not --yes, prompt for confirmation
121
+ * 10. Agent calls apply_diff atomically
122
+ * 11. Log mutation to database
123
+ * 12. Display rollback hints
124
+ * 13. Persist session to database
118
125
  *
119
- * Requirements: 11.1–11.13, 17.1–17.9
120
126
  */
121
127
  export declare function runPatch(options: PatchOptions): Promise<void>;
122
128
  /**
@@ -127,8 +133,8 @@ export interface ReviewOptions {
127
133
  unstaged?: boolean;
128
134
  /** Compare current branch to specified base branch */
129
135
  branch?: string;
130
- /** Output format: "text" (default) or "json" */
131
- format?: "text" | "json";
136
+ /** Output format */
137
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
132
138
  /** Suppress non-essential output */
133
139
  quiet?: boolean;
134
140
  /** Project root (defaults to process.cwd()) */
@@ -153,18 +159,17 @@ export interface ReviewResult {
153
159
  * Execute the review command.
154
160
  *
155
161
  * Flow:
156
- * 1. Parse flags and load configuration (Req 12.1)
157
- * 2. Detect project type (Req 12.1)
158
- * 3. Create session with mode: "plan" (Req 12.2)
159
- * 4. Read git diff (staged / unstaged / branch) (Req 12.3, 12.4, 12.5)
160
- * 5. Build system prompt from review.md template (Req 12.6)
161
- * 6. Send diff + project context to provider (Req 12.6)
162
- * 7. Parse structured review (summary, issues, suggestions) (Req 12.7)
163
- * 8. Render review to terminal (Req 12.8)
164
- * 9. Output JSON if --format json (Req 12.9)
165
- * 10. Persist session to database (Req 12.10)
162
+ * 1. Parse flags and load configuration
163
+ * 2. Detect project type
164
+ * 3. Create session with mode: "plan"
165
+ * 4. Read git diff (staged / unstaged / branch)
166
+ * 5. Build system prompt from review.md template
167
+ * 6. Send diff + project context to provider
168
+ * 7. Parse structured review (summary, issues, suggestions)
169
+ * 8. Render review to terminal
170
+ * 9. Output JSON if --format json
171
+ * 10. Persist session to database
166
172
  *
167
- * Requirements: 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 12.10
168
173
  */
169
174
  export declare function runReview(options: ReviewOptions): Promise<void>;
170
175
  /**
@@ -183,24 +188,25 @@ export interface ExploreOptions {
183
188
  provider?: string;
184
189
  /** Override model (v0.2.2) */
185
190
  model?: string;
191
+ /** Output format (v0.2.3) */
192
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
186
193
  }
187
194
  /**
188
195
  * Execute the explore command.
189
196
  *
190
197
  * Flow:
191
- * 1. Parse flags and load configuration (Req 13.1)
192
- * 2. Detect project type (Req 13.1)
193
- * 3. Create session with mode: "plan" (Req 13.2)
194
- * 4. Scan repository structure respecting .gitignore (Req 13.3)
195
- * 5. Detect frameworks and key configuration files (Req 13.4)
196
- * 6. Identify entry points based on project type (Req 13.5)
197
- * 7. Build system prompt from explore.md template (Req 13.3–13.6)
198
- * 8. Execute agent loop to summarize structure/patterns (Req 13.6)
199
- * 9. Render exploration summary to terminal (Req 13.7)
200
- * 10. Save to ./.aria/explore.md if --save flag (Req 13.8)
201
- * 11. Persist session to database (Req 13.10)
198
+ * 1. Parse flags and load configuration
199
+ * 2. Detect project type
200
+ * 3. Create session with mode: "plan"
201
+ * 4. Scan repository structure respecting .gitignore
202
+ * 5. Detect frameworks and key configuration files
203
+ * 6. Identify entry points based on project type
204
+ * 7. Build system prompt from explore.md template
205
+ * 8. Execute agent loop to summarize structure/patterns
206
+ * 9. Render exploration summary to terminal
207
+ * 10. Save to ./.aria/explore.md if --save flag
208
+ * 11. Persist session to database
202
209
  *
203
- * Requirements: 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 13.10
204
210
  */
205
211
  export declare function runExplore(options: ExploreOptions): Promise<void>;
206
212
  /**
@@ -217,18 +223,29 @@ export interface HistoryOptions {
217
223
  quiet?: boolean;
218
224
  /** Project root (defaults to process.cwd()) */
219
225
  projectRoot?: string;
226
+ /** Full-text search query across session content */
227
+ search?: string;
228
+ /** Filter by command name */
229
+ command?: string;
230
+ /** Filter by date expression, e.g. "3 days ago" */
231
+ since?: string;
232
+ /** Filter by session status */
233
+ status?: SessionStatus;
234
+ /** Export session transcript to markdown file at this path */
235
+ export?: string;
236
+ /** Output format */
237
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
220
238
  }
221
239
  /**
222
240
  * Execute the history command.
223
241
  *
224
242
  * Flow:
225
- * 1. If no --session flag: list recent sessions in a table (Req 14.2, 14.3, 14.4)
226
- * 2. If --session flag: display full session log (Req 14.5)
227
- * 3. If --tree flag: render tool execution tree (Req 14.6)
228
- * 4. Format timestamps in human-readable format (Req 14.7)
229
- * 5. Support pagination for large result sets (Req 14.8)
243
+ * 1. If no --session flag: list recent sessions in a table
244
+ * 2. If --session flag: display full session log
245
+ * 3. If --tree flag: render tool execution tree
246
+ * 4. Format timestamps in human-readable format
247
+ * 5. Support pagination for large result sets
230
248
  *
231
- * Requirements: 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8
232
249
  */
233
250
  export declare function runHistory(options: HistoryOptions): Promise<void>;
234
251
  /**
@@ -254,21 +271,20 @@ export interface ConfigOptions {
254
271
  * Execute the config command.
255
272
  *
256
273
  * Subcommands:
257
- * - (none): Display effective configuration with precedence sources (Req 15.2)
258
- * - get <key>: Display value for specified key (Req 15.3)
259
- * - set <key> <value>: Write key-value to ~/.aria/config.toml (Req 15.4–15.6, 15.10)
260
- * - path: Display configuration file resolution paths (Req 15.7)
261
- * - init: Create ./.aria.toml with default values (Req 15.8, 15.9)
274
+ * - (none): Display effective configuration with precedence sources
275
+ * - get <key>: Display value for specified key
276
+ * - set <key> <value>: Write key-value to ~/.aria/config.toml
277
+ * - path: Display configuration file resolution paths
278
+ * - init: Create ./.aria.toml with default values
262
279
  *
263
- * Requirements: 15.1–15.10
264
280
  */
265
281
  export declare function runConfig(options: ConfigOptions): Promise<void>;
266
282
  /**
267
283
  * Options parsed from CLI flags for the doctor command.
268
284
  */
269
285
  export interface DoctorOptions {
270
- /** Output format: "text" (default) or "json" */
271
- format?: "text" | "json";
286
+ /** Output format */
287
+ format?: 'text' | 'json' | 'ndjson' | 'plain';
272
288
  /** Project root (defaults to process.cwd()) */
273
289
  projectRoot?: string;
274
290
  }
@@ -286,6 +302,5 @@ export interface DiagnosticCheck {
286
302
  * Runs a series of environment diagnostic checks and reports results.
287
303
  * Exits with code 1 if any critical check fails.
288
304
  *
289
- * Requirements: 16.1–16.13
290
305
  */
291
306
  export declare function runDoctor(options?: DoctorOptions): Promise<void>;