@arcforge/axon 0.0.2 → 0.7.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.
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2025 ArcForge
2
+
3
+ All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are proprietary
6
+ and confidential to ArcForge.
7
+
8
+ The Software is licensed, not sold. This license grants you the following rights:
9
+
10
+ 1. You may install and use the Software solely for your internal business purposes.
11
+
12
+ 2. You may not:
13
+ - Modify, adapt, translate, or create derivative works of the Software
14
+ - Reverse engineer, decompile, or disassemble the Software
15
+ - Remove or alter any proprietary notices or labels on the Software
16
+ - Distribute, sublicense, lease, rent, loan, or transfer the Software to any third party
17
+ - Use the Software for any purpose other than as expressly permitted herein
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
+ ARCFORGE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+ For licensing inquiries, please contact: legal@arcforge.io
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # Axon
2
+
3
+ > **A new generation of agentic intelligence.**
4
+
5
+ Axon isn't another chatbot with tools. It's a **cognitive operating system** — a distributed network of specialized AI subsystems that coordinate like a real mind to understand, reason, and code alongside you.
6
+
7
+ ```bash
8
+ npm install -g @arcforge/axon
9
+ ```
10
+
11
+ **Built different. Think different.**
12
+
13
+ ---
14
+
15
+ ## What Makes Axon Different?
16
+
17
+ ### Designed Cognition, Not Prompted Behavior
18
+
19
+ Axon runs on a proprietary **cognitive operating system** that orchestrates dozens of AI models as a single, coherent intelligence. Modular in structure, composable in function, transparent in reasoning.
20
+
21
+ This isn't prompted behavior. It's **designed cognition**.
22
+
23
+ ### Persistent Memory Architecture
24
+
25
+ Most agents drown in their own context windows, rereading your project on every turn. Axon forms a **persistent semantic map** of your codebase — architecture, patterns, conventions, dependencies — and recalls only what's relevant in the moment.
26
+
27
+ - **No tokens wasted** on redundant context
28
+ - **No scanning or searching** — it simply remembers
29
+ - **Evolving understanding** that improves as you work together
30
+
31
+ ### Network Intelligence
32
+
33
+ A distributed network of specialized subsystems coordinate seamlessly:
34
+ - **Planners** design implementation strategies
35
+ - **Coders** write clean, contextual solutions
36
+ - **Critics** review for quality and correctness
37
+ - **Test Writers** ensure robustness
38
+
39
+ All working together as a single, cohesive intelligence runtime.
40
+
41
+ ### No Slop, Just Code
42
+
43
+ Axon understands your architecture, follows your patterns, and writes thoughtful solutions. No unnecessary abstractions, no premature optimizations, no junior-level mistakes.
44
+
45
+ It thinks like a senior engineer because it's **designed to think**, not just pattern-match.
46
+
47
+ ---
48
+
49
+ ## Quick Start
50
+
51
+ ```bash
52
+ # Install globally
53
+ npm install -g @arcforge/axon
54
+
55
+ # Launch the terminal UI
56
+ axon
57
+ ```
58
+
59
+ **Requirements:**
60
+ - [Bun](https://bun.sh) runtime installed
61
+ - Valid Axon API key (get yours at [axon.hexlabs.co.uk](https://axon.hexlabs.co.uk))
62
+
63
+ ---
64
+
65
+ ## Features
66
+
67
+ ### Beautiful Terminal UI
68
+ Built with Blessed for a responsive, full-featured text user interface. Navigate with keyboard shortcuts, manage multiple workspaces, and visualize agent reasoning in real-time.
69
+
70
+ ### Network Intelligence
71
+ Multiple specialized AI subsystems coordinating as a single mind — planners, critics, coders, test writers — all working in parallel across intelligent inference pipelines.
72
+
73
+ ### Process Management
74
+ Monitor and control running processes, track execution state, and visualize the cognitive control loop in action.
75
+
76
+ ### Kanban-Style Task Management
77
+ Built-in task board for organizing work, tracking agent decisions, and managing multi-step implementations.
78
+
79
+ ### Device Authentication
80
+ Secure device flow authentication connects your CLI to your Axon account seamlessly.
81
+
82
+ ### Real-Time Visualizations
83
+ Audio visualizer, system metrics, and cognitive state monitoring — see your agent think.
84
+
85
+ ---
86
+
87
+ ## Usage
88
+
89
+ Once launched, navigate with:
90
+
91
+ - **Arrow keys** → Navigate menus and panels
92
+ - **Enter** → Select / Execute
93
+ - **Esc** → Go back
94
+ - **Tab** → Switch between panels
95
+ - **/help** → View all commands
96
+
97
+ ### Example Session
98
+
99
+ ```bash
100
+ $ axon
101
+
102
+ # Initialize context for your project
103
+ > axon init
104
+
105
+ # Ask questions about your codebase
106
+ > "Why was this module created?"
107
+ > "What depends on this function?"
108
+
109
+ # Request implementations
110
+ > "Add user authentication with JWT"
111
+
112
+ # The agent plans, codes, tests, and explains its reasoning
113
+ ```
114
+
115
+ ---
116
+
117
+ ## How It Works
118
+
119
+ ### 1. **Initialize** — Build a Semantic Map
120
+
121
+ As Axon explores your codebase, it forms a persistent map of how everything fits together. Not files. Not tokens. But **meaning**: purpose, relationships, design intent.
122
+
123
+ ### 2. **Instruct** — Context Without Friction
124
+
125
+ Ask questions like a senior engineer would:
126
+ - "Why was this module created?"
127
+ - "What depends on this function?"
128
+ - "How did this system evolve over time?"
129
+
130
+ Axon answers immediately — without scanning, searching, or invoking tools. It simply **remembers**.
131
+
132
+ ### 3. **Execute** — Distributed Intelligence
133
+
134
+ Complex tasks are routed across parallel inference pipelines. Heavy reasoning goes deep with advanced models. Simple tasks stay lean and fast.
135
+
136
+ A purpose-built cognitive architecture that makes traditional LLM tools feel like they're standing still.
137
+
138
+ ---
139
+
140
+ ## Architecture
141
+
142
+ Axon is powered by:
143
+
144
+ - **Cognitive Operating System** — Proprietary runtime for orchestrating distributed AI subsystems
145
+ - **Persistent Memory Layer** — Semantic graph storage with contextual retrieval
146
+ - **Parallel Inference Pipelines** — Intelligent task routing across model tiers
147
+ - **Real-Time State Monitoring** — Observable cognitive control loop
148
+
149
+ Built on [Cognos](https://cognos.dev) — a first-class cognitive framework for agentic intelligence.
150
+
151
+ ---
152
+
153
+ ## Authentication
154
+
155
+ Axon uses **device flow authentication** to securely connect your CLI to your account:
156
+
157
+ 1. Run `axon` for the first time
158
+ 2. Visit the authentication URL shown in the terminal
159
+ 3. Approve the device from your browser
160
+ 4. Start coding
161
+
162
+ Your API key is stored securely and refreshed automatically.
163
+
164
+ ---
165
+
166
+ ## Credits & Billing
167
+
168
+ Axon operates on a **credit-based system**:
169
+
170
+ - **1,000 credits per £1**
171
+ - **Subscription plans** grant monthly credit allocations
172
+ - **Top-ups** available for one-time purchases
173
+ - Credits never expire
174
+
175
+ Manage your subscription at [axon.hexlabs.co.uk/billing](https://axon.hexlabs.co.uk/billing)
176
+
177
+ ---
178
+
179
+ ## Support
180
+
181
+ - **Website**: [axon.hexlabs.co.uk](https://axon.hexlabs.co.uk)
182
+ - **Documentation**: [axon.hexlabs.co.uk/docs](https://axon.hexlabs.co.uk/docs)
183
+ - **Billing**: [axon.hexlabs.co.uk/billing](https://axon.hexlabs.co.uk/billing)
184
+
185
+ ---
186
+
187
+ ## License
188
+
189
+ Copyright © 2025 ArcForge. All rights reserved.
190
+
191
+ This is proprietary software. See [LICENSE](./LICENSE) for details.
192
+
193
+ ---
194
+
195
+ **Built different. Think different.**
package/app/index.ts ADDED
@@ -0,0 +1,204 @@
1
+ import blessed from "blessed"
2
+
3
+ import {
4
+ useAudioVisualizer,
5
+ useScreen,
6
+ useCommands,
7
+ useCognos,
8
+ useStack,
9
+ useRouter,
10
+ useDeviceAuth,
11
+ } from "#composables"
12
+
13
+ import {
14
+ ChatPage,
15
+ KanbanPage,
16
+ LoginPage,
17
+ ProcessesPage,
18
+ ProcessDetailPage,
19
+ ProfilePage,
20
+ ThemePage,
21
+ } from "#pages"
22
+ import { builtinCommands, processCommands, kanbanCommands, parseArgs, printHelp, executePrompt, redirectConsoleToFile, restoreConsole, getLogFilePath } from "#lib"
23
+ import { Footer } from "#components"
24
+
25
+
26
+ /**
27
+ * Interactive mode: Full blessed TUI
28
+ *
29
+ * The screen consists of two regions:
30
+ *
31
+ * - The current page (chat, login, etc.), containing page-specific content.
32
+ * - The footer, containing chat input and menus.
33
+ *
34
+ */
35
+ async function mainInteractive(debug: boolean = false) {
36
+ // Redirect console output to prevent TUI corruption (unless debug mode)
37
+ if (!debug) {
38
+ redirectConsoleToFile()
39
+ }
40
+
41
+ const screen = useScreen()
42
+ const commands = useCommands()
43
+ const stackComposable = useStack()
44
+ const cognos = useCognos()
45
+ const router = useRouter()
46
+ const deviceAuth = useDeviceAuth()
47
+
48
+ // Register builtin commands
49
+ builtinCommands.forEach(cmd => commands.register(cmd))
50
+
51
+ // Register process management commands
52
+ processCommands.forEach(cmd => commands.register(cmd))
53
+
54
+ // Register kanban commands
55
+ kanbanCommands.forEach(cmd => commands.register(cmd))
56
+
57
+
58
+ // Navigate to chat immediately if at root
59
+ if (router.current().path === "/") {
60
+ router.navigate("/chat")
61
+ }
62
+
63
+ // Start auth check in background (non-blocking)
64
+ // The result will be awaited later when the user sends their first message
65
+ deviceAuth.checkAuth().then(isAuthenticated => {
66
+ if (isAuthenticated) {
67
+ // Only connect to websocket after successful auth
68
+ cognos.connect().catch(error => {
69
+ console.error("Failed to connect to websocket:", error)
70
+ })
71
+ } else if (router.current().path !== "/login") {
72
+ // Redirect to login if auth fails
73
+ router.navigate("/login")
74
+ }
75
+ })
76
+
77
+ const container = blessed.box({
78
+ width: "100%",
79
+ height: "100%",
80
+ layout: "vertical",
81
+ })
82
+
83
+ const footer = Footer()
84
+
85
+ // Create page mapping with route patterns
86
+ const routes = [
87
+ { pattern: "/login", component: () => LoginPage() },
88
+ { pattern: "/chat", component: () => ChatPage() },
89
+ { pattern: "/kanban", component: () => KanbanPage() },
90
+ { pattern: "/processes", component: () => ProcessesPage() },
91
+ { pattern: "/processes/:refId", component: () => ProcessDetailPage() },
92
+ { pattern: "/profile", component: () => ProfilePage() },
93
+ { pattern: "/theme", component: () => ThemePage() },
94
+ ]
95
+
96
+ // Helper to find matching route
97
+ function findMatchingRoute(path: string) {
98
+ for (const route of routes) {
99
+ const match = router.match(route.pattern)
100
+ if (match) {
101
+ return route
102
+ }
103
+ }
104
+ // Default to login if no match
105
+ return routes[0]
106
+ }
107
+
108
+ // Initialize with the current page
109
+ const initialRoute = findMatchingRoute(router.current().path)
110
+ let currentPageNode = initialRoute.component().node
111
+
112
+ container.append(footer.node)
113
+ container.append(currentPageNode)
114
+
115
+ screen.append(container)
116
+ screen.append(footer.paletteNode) // Append command palette to screen so it floats above footer
117
+ screen.append(footer.pagePaletteNode) // Append page palette to screen so it floats above footer
118
+ screen.render()
119
+
120
+ // Focus the input initially
121
+ footer.focus()
122
+
123
+ // Handle page navigation
124
+ router.onNavigate((route) => {
125
+ // Remove current page
126
+ container.remove(currentPageNode)
127
+
128
+ // Find matching route and create page
129
+ const matchedRoute = findMatchingRoute(route.path)
130
+ currentPageNode = matchedRoute.component().node
131
+ container.append(currentPageNode)
132
+
133
+ // Keep footer on top
134
+ container.remove(footer.node)
135
+ container.append(footer.node)
136
+
137
+ screen.render()
138
+ })
139
+
140
+ // Initialize audio visualizer (will activate in voice mode)
141
+ const audioVisualizer = useAudioVisualizer()
142
+ audioVisualizer.init()
143
+
144
+ // Show Axon logo and stats on boot
145
+ const axonCmd = builtinCommands.find(cmd => cmd.name === "axon")
146
+ if (axonCmd) {
147
+ axonCmd.execute()
148
+ }
149
+
150
+ stackComposable.onUpdate(() => {
151
+ // Put the footer back at the top (z-index).
152
+ container.remove(footer.node)
153
+ container.append(footer.node)
154
+ screen.render()
155
+ })
156
+
157
+ // Setup cleanup handlers for websocket and capsule
158
+ const cleanup = async () => {
159
+ cognos.disconnect()
160
+ if (!debug) {
161
+ restoreConsole()
162
+ }
163
+ }
164
+
165
+ process.on("SIGINT", async () => {
166
+ await cleanup()
167
+ process.exit(0)
168
+ })
169
+
170
+ process.on("exit", async () => {
171
+ await cleanup()
172
+ })
173
+
174
+ screen.key(["C-c"], async () => {
175
+ await cleanup()
176
+ process.exit(0)
177
+ })
178
+ }
179
+
180
+ /**
181
+ * Main entry point: Parse args and route to appropriate mode
182
+ */
183
+ async function main() {
184
+ const args = parseArgs(process.argv.slice(2))
185
+
186
+ if (args.help) {
187
+ printHelp()
188
+ process.exit(0)
189
+ }
190
+
191
+ if (args.mode === 'prompt') {
192
+ if (!args.prompt) {
193
+ console.error("Error: --prompt requires a value")
194
+ process.exit(1)
195
+ }
196
+ await executePrompt(args.prompt)
197
+ process.exit(0)
198
+ }
199
+
200
+ // Interactive mode (default)
201
+ await mainInteractive(args.debug || false)
202
+ }
203
+
204
+ await main()