myshell-tools 1.0.0 → 2.0.0-alpha.0

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 (150) hide show
  1. package/CHANGELOG.md +44 -69
  2. package/LICENSE +21 -21
  3. package/README.md +178 -318
  4. package/dist/cli.d.ts +8 -0
  5. package/dist/cli.js +106 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/cost.d.ts +36 -0
  8. package/dist/commands/cost.js +103 -0
  9. package/dist/commands/cost.js.map +1 -0
  10. package/dist/commands/doctor.d.ts +36 -0
  11. package/dist/commands/doctor.js +115 -0
  12. package/dist/commands/doctor.js.map +1 -0
  13. package/dist/core/assess.d.ts +25 -0
  14. package/dist/core/assess.js +142 -0
  15. package/dist/core/assess.js.map +1 -0
  16. package/dist/core/classify.d.ts +19 -0
  17. package/dist/core/classify.js +80 -0
  18. package/dist/core/classify.js.map +1 -0
  19. package/dist/core/escalate.d.ts +32 -0
  20. package/dist/core/escalate.js +57 -0
  21. package/dist/core/escalate.js.map +1 -0
  22. package/dist/core/index.d.ts +13 -0
  23. package/dist/core/index.js +12 -0
  24. package/dist/core/index.js.map +1 -0
  25. package/dist/core/orchestrate.d.ts +42 -0
  26. package/dist/core/orchestrate.js +439 -0
  27. package/dist/core/orchestrate.js.map +1 -0
  28. package/dist/core/policy.d.ts +9 -0
  29. package/dist/core/policy.js +27 -0
  30. package/dist/core/policy.js.map +1 -0
  31. package/dist/core/prompt.d.ts +26 -0
  32. package/dist/core/prompt.js +125 -0
  33. package/dist/core/prompt.js.map +1 -0
  34. package/dist/core/review.d.ts +46 -0
  35. package/dist/core/review.js +148 -0
  36. package/dist/core/review.js.map +1 -0
  37. package/dist/core/route.d.ts +28 -0
  38. package/dist/core/route.js +52 -0
  39. package/dist/core/route.js.map +1 -0
  40. package/dist/core/types.d.ts +141 -0
  41. package/dist/core/types.js +14 -0
  42. package/dist/core/types.js.map +1 -0
  43. package/dist/infra/atomic.d.ts +53 -0
  44. package/dist/infra/atomic.js +171 -0
  45. package/dist/infra/atomic.js.map +1 -0
  46. package/dist/infra/clock.d.ts +9 -0
  47. package/dist/infra/clock.js +15 -0
  48. package/dist/infra/clock.js.map +1 -0
  49. package/dist/infra/index.d.ts +9 -0
  50. package/dist/infra/index.js +7 -0
  51. package/dist/infra/index.js.map +1 -0
  52. package/dist/infra/ledger.d.ts +49 -0
  53. package/dist/infra/ledger.js +90 -0
  54. package/dist/infra/ledger.js.map +1 -0
  55. package/dist/infra/paths.d.ts +28 -0
  56. package/dist/infra/paths.js +38 -0
  57. package/dist/infra/paths.js.map +1 -0
  58. package/dist/infra/pricing.d.ts +47 -0
  59. package/dist/infra/pricing.js +151 -0
  60. package/dist/infra/pricing.js.map +1 -0
  61. package/dist/infra/session.d.ts +28 -0
  62. package/dist/infra/session.js +61 -0
  63. package/dist/infra/session.js.map +1 -0
  64. package/dist/interface/render.d.ts +27 -0
  65. package/dist/interface/render.js +134 -0
  66. package/dist/interface/render.js.map +1 -0
  67. package/dist/interface/repl.d.ts +23 -0
  68. package/dist/interface/repl.js +90 -0
  69. package/dist/interface/repl.js.map +1 -0
  70. package/dist/interface/run.d.ts +20 -0
  71. package/dist/interface/run.js +31 -0
  72. package/dist/interface/run.js.map +1 -0
  73. package/dist/providers/claude-parse.d.ts +24 -0
  74. package/dist/providers/claude-parse.js +113 -0
  75. package/dist/providers/claude-parse.js.map +1 -0
  76. package/dist/providers/claude.d.ts +45 -0
  77. package/dist/providers/claude.js +122 -0
  78. package/dist/providers/claude.js.map +1 -0
  79. package/dist/providers/codex-parse.d.ts +32 -0
  80. package/dist/providers/codex-parse.js +145 -0
  81. package/dist/providers/codex-parse.js.map +1 -0
  82. package/dist/providers/codex.d.ts +44 -0
  83. package/dist/providers/codex.js +124 -0
  84. package/dist/providers/codex.js.map +1 -0
  85. package/dist/providers/detect.d.ts +49 -0
  86. package/dist/providers/detect.js +125 -0
  87. package/dist/providers/detect.js.map +1 -0
  88. package/dist/providers/errors.d.ts +49 -0
  89. package/dist/providers/errors.js +189 -0
  90. package/dist/providers/errors.js.map +1 -0
  91. package/dist/providers/index.d.ts +9 -0
  92. package/dist/providers/index.js +7 -0
  93. package/dist/providers/index.js.map +1 -0
  94. package/dist/providers/port.d.ts +74 -0
  95. package/dist/providers/port.js +16 -0
  96. package/dist/providers/port.js.map +1 -0
  97. package/dist/providers/registry.d.ts +21 -0
  98. package/dist/providers/registry.js +34 -0
  99. package/dist/providers/registry.js.map +1 -0
  100. package/dist/ui/banner.d.ts +19 -0
  101. package/dist/ui/banner.js +32 -0
  102. package/dist/ui/banner.js.map +1 -0
  103. package/dist/ui/spinner.d.ts +27 -0
  104. package/dist/ui/spinner.js +67 -0
  105. package/dist/ui/spinner.js.map +1 -0
  106. package/dist/ui/theme.d.ts +32 -0
  107. package/dist/ui/theme.js +56 -0
  108. package/dist/ui/theme.js.map +1 -0
  109. package/package.json +55 -49
  110. package/data/orchestrator.json +0 -113
  111. package/src/auth/recovery.mjs +0 -328
  112. package/src/auth/refresh.mjs +0 -373
  113. package/src/chef.mjs +0 -348
  114. package/src/cli/doctor.mjs +0 -568
  115. package/src/cli/reset.mjs +0 -447
  116. package/src/cli/status.mjs +0 -379
  117. package/src/cli.mjs +0 -429
  118. package/src/commands/doctor.mjs +0 -375
  119. package/src/commands/help.mjs +0 -324
  120. package/src/commands/status.mjs +0 -331
  121. package/src/monitor/health.mjs +0 -486
  122. package/src/monitor/performance.mjs +0 -442
  123. package/src/monitor/report.mjs +0 -535
  124. package/src/orchestrator/classify.mjs +0 -391
  125. package/src/orchestrator/confidence.mjs +0 -151
  126. package/src/orchestrator/handoffs.mjs +0 -231
  127. package/src/orchestrator/review.mjs +0 -222
  128. package/src/providers/balance.mjs +0 -201
  129. package/src/providers/claude.mjs +0 -236
  130. package/src/providers/codex.mjs +0 -255
  131. package/src/providers/detect.mjs +0 -185
  132. package/src/providers/errors.mjs +0 -373
  133. package/src/providers/select.mjs +0 -162
  134. package/src/repl-enhanced.mjs +0 -417
  135. package/src/repl.mjs +0 -321
  136. package/src/state/archive.mjs +0 -366
  137. package/src/state/atomic.mjs +0 -116
  138. package/src/state/cleanup.mjs +0 -440
  139. package/src/state/recovery.mjs +0 -461
  140. package/src/state/session.mjs +0 -147
  141. package/src/ui/errors.mjs +0 -456
  142. package/src/ui/formatter.mjs +0 -327
  143. package/src/ui/icons.mjs +0 -318
  144. package/src/ui/progress.mjs +0 -468
  145. package/templates/prompts/confidence-format.txt +0 -14
  146. package/templates/prompts/ic-with-feedback.txt +0 -41
  147. package/templates/prompts/ic.txt +0 -13
  148. package/templates/prompts/manager-review.txt +0 -40
  149. package/templates/prompts/manager.txt +0 -14
  150. package/templates/prompts/worker.txt +0 -12
package/CHANGELOG.md CHANGED
@@ -1,69 +1,44 @@
1
- # Changelog
2
-
3
- All notable changes to Cortex AI will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.0.0] - 2024-05-29
9
-
10
- ### Added
11
- - 🎉 **Initial public release of Cortex AI**
12
- - **Hierarchical AI orchestration** with three-tier system (Worker/IC/Manager)
13
- - **Multi-provider support** for Claude (Opus/Sonnet/Haiku) and OpenAI (GPT-4o/GPT-4/GPT-4o-mini)
14
- - **Smart routing** based on task complexity and confidence scoring
15
- - **Automatic escalation** when models need help from higher tiers
16
- - **Load balancing** across AI providers (50/50 split when both available)
17
- - **Session persistence** with automatic conversation resumption
18
- - **Zero dependencies** - uses only Node.js built-in modules
19
- - **CLI detection** for existing Claude CLI and OpenAI CLI setups
20
- - **Interactive REPL** with command history and helpful commands
21
- - **System health checks** via `--doctor` flag
22
- - **Transparent logging** of all model decisions and escalations
23
-
24
- ### Features
25
- - **Worker Tier**: Handles simple tasks (file searches, formatting, info lookup)
26
- - **IC Tier**: Manages most development work (coding, refactoring, testing)
27
- - **Manager Tier**: Oversees complex decisions (architecture, security, debugging)
28
- - **Confidence-based escalation**: Models self-assess and escalate when uncertain
29
- - **Provider failover**: Automatically switches providers if one is unavailable
30
- - **Local privacy**: All processing uses your existing AI subscriptions
31
- - **Cross-platform support**: Works on macOS, Linux, and Windows (WSL)
32
-
33
- ### CLI Commands
34
- - `npx cortex-ai` - Start interactive AI organization
35
- - `npx cortex-ai --doctor` - Comprehensive system health check
36
- - `npx cortex-ai --help` - Show usage information
37
- - `npx cortex-ai --version` - Display version information
38
-
39
- ### REPL Commands
40
- - `/help` - Show available commands
41
- - `/status` - Current provider status and model availability
42
- - `/clear` - Clear conversation history
43
- - `/reset` - Reset session state
44
- - `/quit` - Exit Cortex
45
-
46
- ### Technical Details
47
- - **Node.js requirement**: 20.0.0 or higher
48
- - **Package size**: Lightweight (~100KB installed)
49
- - **Memory usage**: ~50MB RAM typical usage
50
- - **Session storage**: `.cortex/sessions/` directory for conversation history
51
- - **Configuration**: Environment variables for customization
52
-
53
- ### Documentation
54
- - Comprehensive README with installation and usage examples
55
- - Troubleshooting guide for common setup issues
56
- - Contributing guidelines for community development
57
- - MIT license for open source usage
58
-
59
- ---
60
-
61
- ## Development History
62
-
63
- This release represents the culmination of three development phases:
64
-
65
- **Phase 1**: Core orchestration engine and CLI detection
66
- **Phase 2**: Enhanced confidence scoring and manager review patterns
67
- **Phase 3**: UX polish, error handling, and production readiness
68
-
69
- The codebase is designed for reliability, maintainability, and extensibility as we grow the Cortex ecosystem.
1
+ # Changelog
2
+
3
+ All notable changes to **myshell-tools** are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Pending
10
+ - Live cross-vendor review demonstration (requires an authenticated Codex CLI).
11
+ - Cross-OS CI execution (requires a public remote).
12
+ - First npm publish.
13
+
14
+ ## [2.0.0-alpha.0]
15
+
16
+ A ground-up rebuild. The architecture is hexagonal (a pure, injected orchestration
17
+ core behind a `Provider` port), and the first principle is the **Honesty Contract**:
18
+ the tool never presents fabricated, mocked, or randomized data as if it were real —
19
+ enforced by architecture tests, not by convention.
20
+
21
+ ### Added
22
+ - **Orchestration core (pure, fully unit-tested):** task classification, cost-aware
23
+ tier routing (worker / ic / manager), output assessment, a bounded
24
+ escalation + **cross-vendor review** loop, and a typed policy of thresholds.
25
+ - **Provider port + adapters:** Claude (`claude -p --output-format stream-json`) and
26
+ Codex (`codex exec --json`), both via `execa` with the prompt delivered over
27
+ **stdin**, streaming events, `AbortSignal` cancellation (child terminated < 250 ms),
28
+ and Windows-safe process handling. Providers are **auto-detected** and routing uses
29
+ stable model aliases so newer models are picked up without code changes.
30
+ - **Honest cost:** prefers the provider CLI's own reported cost; an append-only cost
31
+ **ledger** and session log under `.myshell-tools/`; `myshell-tools cost` shows real spend plus an
32
+ apples-to-apples "always-flagship" counterfactual.
33
+ - **Commands & UX:** `run`, `repl`, `doctor`, `cost`; streaming renderer with an
34
+ honest working-indicator, theme, and banner. `NO_COLOR` / non-TTY aware.
35
+ - **Tooling:** TypeScript strict, ESLint, `node:test`, contract tests pinned to
36
+ recorded real transcripts, and **architecture/honesty guard tests** (no-mock,
37
+ core purity, single process-exit entry point, no fabricated metrics). CI matrix
38
+ across Windows / macOS / Linux on Node 22 & 24.
39
+
40
+ ### Notes
41
+ - Zero runtime dependencies other than `execa` (correct cross-platform process
42
+ execution), isolated behind the `Provider` port.
43
+ - Pricing is a small, dated seed used only for estimates/counterfactuals and carries
44
+ a staleness warning; real per-run cost comes from the provider CLIs.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 HeyVera
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HeyVera
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.