indusagi-coding-agent 0.1.22 → 0.1.24
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/CHANGELOG.md +72 -11
- package/README.md +2 -36
- package/dist/cli/args.d.ts +117 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +231 -64
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +58 -2
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +130 -12
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +70 -2
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +240 -15
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/list-models.d.ts +63 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +202 -27
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/login-handler.d.ts +82 -8
- package/dist/cli/login-handler.d.ts.map +1 -1
- package/dist/cli/login-handler.js +410 -77
- package/dist/cli/login-handler.js.map +1 -1
- package/dist/cli/session-picker.d.ts +74 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +236 -12
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session.d.ts +214 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +214 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +302 -12
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +302 -12
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/diagnostics.d.ts +191 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js +142 -0
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/event-bus.d.ts +146 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +93 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +4 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +4 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +128 -0
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +128 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +4 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +4 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/keybindings.d.ts +142 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +142 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +98 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +98 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +99 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +99 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +0 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +127 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +125 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/subagents.js.map +1 -1
- package/dist/core/tools/bash.d.ts +391 -11
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +269 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +284 -6
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +238 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +169 -5
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +136 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +285 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +247 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +0 -18
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -23
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +6 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +6 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +308 -7
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +231 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/webfetch.d.ts +118 -3
- package/dist/core/tools/webfetch.d.ts.map +1 -1
- package/dist/core/tools/webfetch.js +118 -3
- package/dist/core/tools/webfetch.js.map +1 -1
- package/dist/core/tools/websearch.d.ts +130 -3
- package/dist/core/tools/websearch.d.ts.map +1 -1
- package/dist/core/tools/websearch.js +130 -3
- package/dist/core/tools/websearch.js.map +1 -1
- package/dist/core/tools/write.d.ts +251 -5
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +210 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +164 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +164 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +297 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +297 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +251 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +186 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +186 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1567 -13
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1567 -13
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +422 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +422 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +538 -5
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +538 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +921 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +921 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +802 -9
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +802 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +356 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +356 -3
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/shared.d.ts +386 -0
- package/dist/modes/shared.d.ts.map +1 -0
- package/dist/modes/shared.js +543 -0
- package/dist/modes/shared.js.map +1 -0
- package/dist/utils/array.d.ts +389 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +585 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/color-formatter.d.ts +318 -0
- package/dist/utils/color-formatter.d.ts.map +1 -0
- package/dist/utils/color-formatter.js +442 -0
- package/dist/utils/color-formatter.js.map +1 -0
- package/dist/utils/data-transformer.d.ts +326 -0
- package/dist/utils/data-transformer.d.ts.map +1 -0
- package/dist/utils/data-transformer.js +512 -0
- package/dist/utils/data-transformer.js.map +1 -0
- package/dist/utils/date-formatter.d.ts +281 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/date-formatter.js +503 -0
- package/dist/utils/date-formatter.js.map +1 -0
- package/dist/utils/error-handler.d.ts +541 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +726 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/file-operations.d.ts +297 -0
- package/dist/utils/file-operations.d.ts.map +1 -0
- package/dist/utils/file-operations.js +505 -0
- package/dist/utils/file-operations.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +268 -6
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +500 -21
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/json-formatter.d.ts +259 -0
- package/dist/utils/json-formatter.d.ts.map +1 -0
- package/dist/utils/json-formatter.js +517 -0
- package/dist/utils/json-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +176 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +346 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-formatter.d.ts +211 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -0
- package/dist/utils/markdown-formatter.js +482 -0
- package/dist/utils/markdown-formatter.js.map +1 -0
- package/dist/utils/path-validator.d.ts +603 -0
- package/dist/utils/path-validator.d.ts.map +1 -0
- package/dist/utils/path-validator.js +870 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/string-formatter.d.ts +609 -0
- package/dist/utils/string-formatter.d.ts.map +1 -0
- package/dist/utils/string-formatter.js +806 -0
- package/dist/utils/string-formatter.js.map +1 -0
- package/dist/utils/type-guards.d.ts +629 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +662 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/docs/COMPLETE-GUIDE.md +300 -0
- package/docs/MODES-ARCHITECTURE.md +565 -0
- package/docs/PRINT-MODE-GUIDE.md +456 -0
- package/docs/README.md +1 -2
- package/docs/RPC-GUIDE.md +705 -0
- package/docs/UTILS-IMPLEMENTATION-SUMMARY.md +647 -0
- package/docs/UTILS-MODULE-OVERVIEW.md +1480 -0
- package/docs/UTILS-QA-CHECKLIST.md +1061 -0
- package/docs/UTILS-USAGE-GUIDE.md +1419 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.1.
|
|
3
|
+
## [0.1.24] - CLI Module Rebranding
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
|
-
- **
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
6
|
+
- **CLI Module Documentation**: Comprehensive documentation added to all CLI files
|
|
7
|
+
- File headers with purpose documentation and vendor attribution
|
|
8
|
+
- Section comments for logical code blocks
|
|
9
|
+
- JSDoc for all public interfaces and types
|
|
10
|
+
- Inline comments for complex decision points
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **CLI Argument Parser (args.ts)**:
|
|
14
|
+
- Added constants for default values (VALID_THINKING_LEVELS, DEFAULT_TOOLS, AVAILABLE_TOOLS)
|
|
15
|
+
- Created type guards (isValidThinkingLevel, isValidMode, isValidToolName)
|
|
16
|
+
- Added validation functions (validateToolNames, validateThinkingLevel)
|
|
17
|
+
- Organized imports with clear separation
|
|
18
|
+
- Enhanced Args interface with comprehensive JSDoc
|
|
19
|
+
|
|
20
|
+
- **Configuration Selector (config-selector.ts)**:
|
|
21
|
+
- Added ConfigSelectorOptions interface with full documentation
|
|
22
|
+
- Documented TUI setup and cleanup workflow
|
|
23
|
+
- Enhanced callback documentation (onResolve, onExit, onRequestRender)
|
|
24
|
+
|
|
25
|
+
- **File Processor (file-processor.ts)**:
|
|
26
|
+
- Added file validation (isSupportedTextFile, isSupportedImageMimeType)
|
|
27
|
+
- Added file size limits (MAX_TEXT_FILE_SIZE: 10MB, MAX_IMAGE_FILE_SIZE: 20MB)
|
|
28
|
+
- Created FileProcessError custom error class with helpful suggestions
|
|
29
|
+
- Added validateFileSize function with limit checking
|
|
30
|
+
|
|
31
|
+
- **Login Handler (login-handler.ts)**:
|
|
32
|
+
- Added SECURITY CONSIDERATIONS section documenting credential storage safety
|
|
33
|
+
- Created LoginError and CredentialValidationError custom error classes
|
|
34
|
+
- Added validation functions (validateApiKey, validateAccountName, isValidProvider)
|
|
35
|
+
- Enhanced multi-account support documentation
|
|
36
|
+
- Improved error messages for auth failures
|
|
37
|
+
|
|
38
|
+
- **Model List (list-models.ts)**:
|
|
39
|
+
- Added ModelFilterOptions interface for flexible model filtering
|
|
40
|
+
- Added ModelRow interface for formatted table output
|
|
41
|
+
- Added utility functions (filterModels, sortModels, calculateColumnWidths)
|
|
42
|
+
- Enhanced model display with proper column widths
|
|
43
|
+
- Added model capability indicators (thinking, images)
|
|
44
|
+
|
|
45
|
+
- **Session Picker (session-picker.ts)**:
|
|
46
|
+
- Created SessionPickerError custom error class
|
|
47
|
+
- Added session utility functions (calculateSessionStats, formatAge, formatSize)
|
|
48
|
+
- Added session metadata display capabilities
|
|
49
|
+
- Enhanced session sorting and filtering options
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
- **Error Handling**: Consistent error message format across all CLI files
|
|
53
|
+
- **Type Safety**: Type guards for runtime type checking and validation
|
|
54
|
+
- **Security**: API key format validation prevents placeholder values
|
|
55
|
+
- **File Access**: Improved error messages with actionable suggestions
|
|
56
|
+
|
|
57
|
+
### Tests
|
|
58
|
+
- **CLI Argument Tests**: 40+ test cases for argument parsing
|
|
59
|
+
- **File Processor Tests**: 20+ test cases for file processing
|
|
60
|
+
- **Login Handler Tests**: 25+ test cases for authentication flow
|
|
61
|
+
|
|
62
|
+
### Documentation
|
|
63
|
+
- **CLI-REFACTORING-SUMMARY.md**: Complete summary of all changes
|
|
64
|
+
- 6 files updated with ~2000 lines of documentation
|
|
65
|
+
- 85+ test cases covering all major functionality
|
|
66
|
+
- All high and medium priority tasks complete
|
|
67
|
+
|
|
68
|
+
## [0.1.23]
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
- Bumped version to 0.1.23
|
|
72
|
+
|
|
73
|
+
## [0.1.22]
|
|
74
|
+
|
|
75
|
+
### Changed
|
|
76
|
+
- Updated `indusagi` dependency to use published npm package `^0.12.8` (was `file:../indusagi-copy`)
|
|
16
77
|
|
|
17
78
|
## [0.1.21]
|
|
18
79
|
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A terminal-first coding agent with a small core and strong extensibility. Use it interactively, in scripts (print/JSON), over RPC, or as an SDK in your own apps.
|
|
4
4
|
|
|
5
|
+
> **Inspired by Pi**: *"Code with clarity, collaborate with purpose, and build with intelligence. Every line you write is a conversation between you and your assistant."*
|
|
6
|
+
|
|
5
7
|
- CLI commands: `indusagi` and `indus`
|
|
6
8
|
- Node.js >= 20
|
|
7
9
|
- Extensible via extensions, skills, prompt templates, and themes
|
|
@@ -30,42 +32,6 @@ Example (file-aware prompt):
|
|
|
30
32
|
indusagi @src/index.ts "Summarize this file"
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
## Web Search & Web Fetch
|
|
34
|
-
|
|
35
|
-
The agent includes built-in tools for web operations:
|
|
36
|
-
|
|
37
|
-
### Web Search Tool
|
|
38
|
-
Search the web for real-time information using Exa AI:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
indusagi "Search for latest AI developments 2026"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Features:
|
|
45
|
-
- Real-time web search beyond knowledge cutoff
|
|
46
|
-
- Configurable result counts (1-10)
|
|
47
|
-
- Live crawling modes (fallback/preferred)
|
|
48
|
-
- Search types: auto, fast, deep
|
|
49
|
-
|
|
50
|
-
### Web Fetch Tool
|
|
51
|
-
Fetch content from URLs with format conversion:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
indusagi "Fetch https://example.com and show me the content"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Features:
|
|
58
|
-
- Fetch webpages and convert to markdown, text, or HTML
|
|
59
|
-
- Image support (returns as base64 attachment)
|
|
60
|
-
- Configurable timeout (up to 120 seconds)
|
|
61
|
-
- 5MB response size limit
|
|
62
|
-
|
|
63
|
-
Both tools are included in the default tool set and work automatically without any additional flags.
|
|
64
|
-
|
|
65
|
-
## Documentation
|
|
66
|
-
|
|
67
|
-
For complete documentation, visit: https://www.indusagi.com
|
|
68
|
-
|
|
69
35
|
## Modes
|
|
70
36
|
|
|
71
37
|
- Interactive mode (default)
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -1,9 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI argument
|
|
2
|
+
* CLI Argument Parser - Command-line argument handling and validation
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Parse command-line arguments into structured format
|
|
6
|
+
* - Validate argument combinations
|
|
7
|
+
* - Provide helpful error messages for invalid args
|
|
8
|
+
* - Generate help documentation
|
|
9
|
+
* - Support extension flags registration
|
|
10
|
+
*
|
|
11
|
+
* Based on argument parsing patterns from indusagi CLI
|
|
12
|
+
* Original: https://github.com/varunisrani/indusagi-ts/vendor/indusagi-agent
|
|
13
|
+
*
|
|
14
|
+
* Adapted to:
|
|
15
|
+
* - Improve error messages
|
|
16
|
+
* - Add comprehensive documentation
|
|
17
|
+
* - Enhance validation
|
|
18
|
+
* - Improve UX with better prompts
|
|
3
19
|
*/
|
|
4
20
|
import type { ThinkingLevel } from "indusagi/agent";
|
|
5
21
|
import { type ToolName } from "../core/tools/index.js";
|
|
22
|
+
/**
|
|
23
|
+
* Output mode for CLI responses
|
|
24
|
+
*
|
|
25
|
+
* @type {Mode}
|
|
26
|
+
* @property {"text"} - Standard interactive text output
|
|
27
|
+
* @property {"json"} - JSON formatted output for automation
|
|
28
|
+
* @property {"rpc"} - RPC format for external tool integration
|
|
29
|
+
*/
|
|
6
30
|
export type Mode = "text" | "json" | "rpc";
|
|
31
|
+
/**
|
|
32
|
+
* Parsed command-line arguments
|
|
33
|
+
*
|
|
34
|
+
* @interface Args
|
|
35
|
+
* @property {string} [provider] - Provider name (e.g., google, openai, anthropic)
|
|
36
|
+
* @property {string} [account] - Account name for multi-account providers
|
|
37
|
+
* @property {string} [model] - Model ID override
|
|
38
|
+
* @property {string} [apiKey] - API key (defaults to env vars)
|
|
39
|
+
* @property {string} [systemPrompt] - System prompt override
|
|
40
|
+
* @property {string} [appendSystemPrompt] - Append text or file contents to system prompt
|
|
41
|
+
* @property {ThinkingLevel} [thinking] - Extended thinking level
|
|
42
|
+
* @property {boolean} [continue] - Continue previous session flag
|
|
43
|
+
* @property {boolean} [resume] - Select a session to resume
|
|
44
|
+
* @property {boolean} [help] - Show help message
|
|
45
|
+
* @property {boolean} [version] - Show version number
|
|
46
|
+
* @property {Mode} [mode] - Output mode (text, json, rpc)
|
|
47
|
+
* @property {boolean} [noSession] - Don't save session (ephemeral)
|
|
48
|
+
* @property {string} [session] - Use specific session file
|
|
49
|
+
* @property {string} [sessionDir] - Directory for session storage
|
|
50
|
+
* @property {string[]} [models] - Model patterns for Ctrl+P cycling
|
|
51
|
+
* @property {ToolName[]} [tools] - Tools to enable
|
|
52
|
+
* @property {boolean} [noTools] - Disable all tools
|
|
53
|
+
* @property {string[]} [extensions] - Extension file paths to load
|
|
54
|
+
* @property {string[]} [hooks] - Hook file paths to load
|
|
55
|
+
* @property {boolean} [noExtensions] - Disable extension discovery
|
|
56
|
+
* @property {boolean} [noHooks] - Disable hook discovery
|
|
57
|
+
* @property {boolean} [noSkills] - Disable skills discovery
|
|
58
|
+
* @property {string[]} [skills] - Skill file paths to load
|
|
59
|
+
* @property {string[]} [promptTemplates] - Prompt template paths to load
|
|
60
|
+
* @property {boolean} [noPromptTemplates] - Disable prompt template discovery
|
|
61
|
+
* @property {string[]} [themes] - Theme file paths to load
|
|
62
|
+
* @property {boolean} [noThemes] - Disable theme discovery
|
|
63
|
+
* @property {string | true} [listModels] - List available models with optional search
|
|
64
|
+
* @property {boolean} [verbose] - Force verbose startup
|
|
65
|
+
* @property {string[]} messages - Non-flag positional arguments (user messages)
|
|
66
|
+
* @property {string[]} fileArgs - File arguments (from @file syntax)
|
|
67
|
+
* @property {Map<string, boolean | string>} unknownFlags - Extension registered flags
|
|
68
|
+
*/
|
|
7
69
|
export interface Args {
|
|
8
70
|
provider?: string;
|
|
9
71
|
account?: string;
|
|
@@ -42,9 +104,63 @@ export interface Args {
|
|
|
42
104
|
/** Unknown flags (potentially extension flags) - map of flag name to value */
|
|
43
105
|
unknownFlags: Map<string, boolean | string>;
|
|
44
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Type guard to check if a string is a valid ThinkingLevel
|
|
109
|
+
*
|
|
110
|
+
* @param level - The string to check
|
|
111
|
+
* @returns True if the string is a valid ThinkingLevel
|
|
112
|
+
*/
|
|
45
113
|
export declare function isValidThinkingLevel(level: string): level is ThinkingLevel;
|
|
114
|
+
/**
|
|
115
|
+
* Type guard to check if a string is a valid Mode
|
|
116
|
+
*
|
|
117
|
+
* @param mode - The string to check
|
|
118
|
+
* @returns True if the string is a valid Mode
|
|
119
|
+
*/
|
|
120
|
+
export declare function isValidMode(mode: string): mode is Mode;
|
|
121
|
+
/**
|
|
122
|
+
* Type guard to check if a tool name is valid
|
|
123
|
+
*
|
|
124
|
+
* @param toolName - The tool name to check
|
|
125
|
+
* @returns True if the tool name is in the available tools list
|
|
126
|
+
*/
|
|
127
|
+
export declare function isValidToolName(toolName: string): toolName is ToolName;
|
|
128
|
+
/**
|
|
129
|
+
* Parse command-line arguments into structured Args object
|
|
130
|
+
*
|
|
131
|
+
* This function processes raw command-line arguments and converts them into
|
|
132
|
+
* a structured Args object. It handles:
|
|
133
|
+
* - Short and long flag formats (--flag, -f)
|
|
134
|
+
* - Flag values that follow (--flag value)
|
|
135
|
+
* - Boolean flags (--no-flag)
|
|
136
|
+
* - File arguments prefixed with @
|
|
137
|
+
* - Extension-registered flags (if extensionFlags provided)
|
|
138
|
+
* - Positional arguments (messages)
|
|
139
|
+
*
|
|
140
|
+
* @param args - Array of command-line argument strings (typically process.argv.slice(2))
|
|
141
|
+
* @param extensionFlags - Optional map of extension-registered flags with their types
|
|
142
|
+
* @returns Parsed Args object
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const args = parseArgs(["--model", "gpt-4", "--verbose", "hello", "@file.txt"]);
|
|
147
|
+
* // Returns: { model: "gpt-4", verbose: true, messages: ["hello"], fileArgs: ["file.txt"] }
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
46
150
|
export declare function parseArgs(args: string[], extensionFlags?: Map<string, {
|
|
47
151
|
type: "boolean" | "string";
|
|
48
152
|
}>): Args;
|
|
153
|
+
/**
|
|
154
|
+
* Print comprehensive help documentation to stdout
|
|
155
|
+
*
|
|
156
|
+
* Displays:
|
|
157
|
+
* - Application name and brief description
|
|
158
|
+
* - Usage syntax
|
|
159
|
+
* - Available commands
|
|
160
|
+
* - All options with descriptions
|
|
161
|
+
* - Environment variables
|
|
162
|
+
* - Available tools
|
|
163
|
+
* - Example usage
|
|
164
|
+
*/
|
|
49
165
|
export declare function printHelp(): void;
|
|
50
166
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8EAA8E;IAC9E,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;CAC5C;AA8BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,IAAI,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,QAAQ,CAEtE;AAgDD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAC,GAAG,IAAI,CA4L5G;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,IAAI,IAAI,CA8IhC"}
|