nyxora 26.7.4 → 26.7.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +48 -9
  3. package/dist/launcher.js +29 -1
  4. package/dist/packages/core/src/agent/bridgeWatcher.js +1 -1
  5. package/dist/packages/core/src/agent/cronManager.js +1 -1
  6. package/dist/packages/core/src/agent/llmProvider.js +29 -3
  7. package/dist/packages/core/src/agent/nyxDaemon.js +1 -1
  8. package/dist/packages/core/src/agent/osAgent.js +109 -205
  9. package/dist/packages/core/src/agent/promptBuilder.js +452 -0
  10. package/dist/packages/core/src/agent/reasoning.js +66 -184
  11. package/dist/packages/core/src/agent/reasoningScratchpad.js +19 -2
  12. package/dist/packages/core/src/agent/threatPatterns.js +106 -0
  13. package/dist/packages/core/src/agent/web3Agent.js +26 -114
  14. package/dist/packages/core/src/agent/workspaceUtils.js +56 -0
  15. package/dist/packages/core/src/channels/ChannelManager.js +36 -0
  16. package/dist/packages/core/src/channels/discordAdapter.js +81 -0
  17. package/dist/packages/core/src/channels/googlechatAdapter.js +45 -0
  18. package/dist/packages/core/src/channels/imessageAdapter.js +34 -0
  19. package/dist/packages/core/src/channels/index.js +39 -0
  20. package/dist/packages/core/src/channels/ircAdapter.js +34 -0
  21. package/dist/packages/core/src/channels/lineAdapter.js +125 -0
  22. package/dist/packages/core/src/channels/matrixAdapter.js +34 -0
  23. package/dist/packages/core/src/channels/mattermostAdapter.js +45 -0
  24. package/dist/packages/core/src/channels/msteamsAdapter.js +45 -0
  25. package/dist/packages/core/src/channels/nextcloudtalkAdapter.js +45 -0
  26. package/dist/packages/core/src/channels/nostrAdapter.js +34 -0
  27. package/dist/packages/core/src/channels/qqbotAdapter.js +34 -0
  28. package/dist/packages/core/src/channels/slackAdapter.js +74 -0
  29. package/dist/packages/core/src/channels/smsAdapter.js +45 -0
  30. package/dist/packages/core/src/channels/synologychatAdapter.js +45 -0
  31. package/dist/packages/core/src/channels/telegram.js +362 -0
  32. package/dist/packages/core/src/channels/twitchAdapter.js +34 -0
  33. package/dist/packages/core/src/channels/voicecallAdapter.js +45 -0
  34. package/dist/packages/core/src/channels/whatsappAdapter.js +126 -0
  35. package/dist/packages/core/src/channels/zaloAdapter.js +45 -0
  36. package/dist/packages/core/src/config/parser.js +2 -1
  37. package/dist/packages/core/src/gateway/chat.js +10 -2
  38. package/dist/packages/core/src/gateway/cli.js +2 -0
  39. package/dist/packages/core/src/gateway/googleAuthModule.js +111 -13
  40. package/dist/packages/core/src/gateway/server.js +134 -3
  41. package/dist/packages/core/src/gateway/setup-ml.js +65 -2
  42. package/dist/packages/core/src/gateway/setup.js +61 -22
  43. package/dist/packages/core/src/gateway/telegram.js +21 -48
  44. package/dist/packages/core/src/memory/episodic.js +4 -0
  45. package/dist/packages/core/src/memory/logger.js +27 -9
  46. package/dist/packages/core/src/plugin/PluginManager.js +46 -16
  47. package/dist/packages/core/src/system/plugins/GoogleWorkspacePlugin.js +69 -30
  48. package/dist/packages/core/src/system/plugins/SystemNotesPlugin.js +148 -0
  49. package/dist/packages/core/src/system/plugins/SystemSocialPlugin.js +2 -14
  50. package/dist/packages/core/src/system/plugins/SystemWebPlugin.js +0 -5
  51. package/dist/packages/core/src/system/plugins/SystemWorkspacePlugin.js +25 -6
  52. package/dist/packages/core/src/system/skills/analyzeImage.js +82 -0
  53. package/dist/packages/core/src/system/skills/fileDownloader.js +45 -0
  54. package/dist/packages/core/src/system/skills/generateExcel.js +1 -1
  55. package/dist/packages/core/src/system/skills/googleWorkspace.js +278 -271
  56. package/dist/packages/core/src/system/skills/playbookManager.js +269 -0
  57. package/dist/packages/core/src/system/skills/telegramUpload.js +25 -0
  58. package/dist/packages/core/src/utils/fileLinker.js +57 -0
  59. package/dist/packages/core/src/utils/historySanitizer.js +5 -1
  60. package/dist/packages/core/src/utils/llmUtils.js +5 -4
  61. package/dist/packages/core/src/utils/skillManager.js +8 -4
  62. package/dist/packages/core/src/utils/streamSimulator.js +14 -8
  63. package/dist/packages/core/src/web3/skills/checkPortfolio.js +7 -1
  64. package/dist/packages/core/src/web3/skills/getTxHistory.js +44 -7
  65. package/launcher.ts +26 -1
  66. package/package.json +3 -7
  67. package/packages/core/package.json +27 -9
  68. package/packages/core/src/agent/bridgeWatcher.ts +1 -1
  69. package/packages/core/src/agent/cronManager.ts +1 -1
  70. package/packages/core/src/agent/llmProvider.ts +30 -3
  71. package/packages/core/src/agent/nyxDaemon.ts +2 -2
  72. package/packages/core/src/agent/osAgent.ts +116 -206
  73. package/packages/core/src/agent/promptBuilder.ts +476 -0
  74. package/packages/core/src/agent/reasoning.ts +60 -189
  75. package/packages/core/src/agent/reasoningScratchpad.ts +21 -2
  76. package/packages/core/src/agent/threatPatterns.ts +115 -0
  77. package/packages/core/src/agent/web3Agent.ts +23 -113
  78. package/packages/core/src/agent/workspaceUtils.ts +53 -0
  79. package/packages/core/src/channels/ChannelManager.ts +45 -0
  80. package/packages/core/src/channels/googlechatAdapter.ts +48 -0
  81. package/packages/core/src/channels/imessageAdapter.ts +37 -0
  82. package/packages/core/src/channels/index.ts +40 -0
  83. package/packages/core/src/channels/ircAdapter.ts +37 -0
  84. package/packages/core/src/channels/lineAdapter.ts +101 -0
  85. package/packages/core/src/channels/matrixAdapter.ts +37 -0
  86. package/packages/core/src/channels/mattermostAdapter.ts +48 -0
  87. package/packages/core/src/channels/msteamsAdapter.ts +48 -0
  88. package/packages/core/src/channels/nextcloudtalkAdapter.ts +48 -0
  89. package/packages/core/src/channels/nostrAdapter.ts +37 -0
  90. package/packages/core/src/channels/qqbotAdapter.ts +37 -0
  91. package/packages/core/src/channels/slackAdapter.ts +83 -0
  92. package/packages/core/src/channels/smsAdapter.ts +48 -0
  93. package/packages/core/src/channels/synologychatAdapter.ts +48 -0
  94. package/packages/core/src/{gateway → channels}/telegram.ts +108 -49
  95. package/packages/core/src/channels/twitchAdapter.ts +37 -0
  96. package/packages/core/src/channels/voicecallAdapter.ts +48 -0
  97. package/packages/core/src/channels/whatsappAdapter.ts +103 -0
  98. package/packages/core/src/channels/zaloAdapter.ts +48 -0
  99. package/packages/core/src/config/parser.ts +7 -1
  100. package/packages/core/src/gateway/chat.ts +10 -2
  101. package/packages/core/src/gateway/cli.ts +2 -0
  102. package/packages/core/src/gateway/googleAuthModule.ts +113 -11
  103. package/packages/core/src/gateway/server.ts +139 -3
  104. package/packages/core/src/gateway/setup-ml.ts +65 -4
  105. package/packages/core/src/gateway/setup.ts +60 -22
  106. package/packages/core/src/memory/episodic.ts +4 -0
  107. package/packages/core/src/memory/logger.ts +26 -9
  108. package/packages/core/src/plugin/PluginManager.ts +78 -16
  109. package/packages/core/src/system/plugins/GoogleWorkspacePlugin.ts +36 -45
  110. package/packages/core/src/system/plugins/SystemNotesPlugin.ts +141 -0
  111. package/packages/core/src/system/plugins/SystemSocialPlugin.ts +2 -14
  112. package/packages/core/src/system/plugins/SystemWebPlugin.ts +0 -5
  113. package/packages/core/src/system/plugins/SystemWorkspacePlugin.ts +25 -6
  114. package/packages/core/src/system/skills/analyzeImage.ts +79 -0
  115. package/packages/core/src/system/skills/fileDownloader.ts +43 -0
  116. package/packages/core/src/system/skills/generateExcel.ts +1 -1
  117. package/packages/core/src/system/skills/googleWorkspace.ts +262 -283
  118. package/packages/core/src/system/skills/playbookManager.ts +285 -0
  119. package/packages/core/src/system/skills/telegramUpload.ts +23 -0
  120. package/packages/core/src/utils/fileLinker.ts +48 -0
  121. package/packages/core/src/utils/historySanitizer.ts +7 -1
  122. package/packages/core/src/utils/llmUtils.ts +5 -4
  123. package/packages/core/src/utils/skillManager.ts +9 -4
  124. package/packages/core/src/utils/streamSimulator.ts +15 -8
  125. package/packages/core/src/web3/skills/checkPortfolio.ts +8 -1
  126. package/packages/core/src/web3/skills/getTxHistory.ts +42 -8
  127. package/packages/dashboard/dist/assets/index-BIXV2TNp.js +26 -0
  128. package/packages/dashboard/dist/assets/index-C2sWcvod.css +1 -0
  129. package/packages/dashboard/dist/index.html +2 -2
  130. package/packages/dashboard/package.json +1 -1
  131. package/packages/mcp-server/package.json +1 -1
  132. package/packages/ml-engine/__pycache__/main.cpython-313.pyc +0 -0
  133. package/packages/ml-engine/main.py +4 -1
  134. package/packages/ml-engine/routers/__pycache__/background_review.cpython-313.pyc +0 -0
  135. package/packages/ml-engine/routers/__pycache__/memory_writer.cpython-313.pyc +0 -0
  136. package/packages/ml-engine/routers/__pycache__/skill_manager.cpython-313.pyc +0 -0
  137. package/packages/ml-engine/routers/background_review.py +121 -0
  138. package/packages/ml-engine/routers/memory_writer.py +72 -0
  139. package/packages/ml-engine/routers/skill_manager.py +123 -0
  140. package/packages/policy/package.json +1 -1
  141. package/packages/signer/package.json +1 -1
  142. package/packages/core/src/system/skills/analyzeDocument.ts +0 -117
  143. package/packages/core/src/system/skills/gitManager.ts +0 -84
  144. package/packages/core/src/system/skills/notionWorkspace.ts +0 -78
  145. package/packages/core/src/system/skills/xManager.ts +0 -76
  146. package/packages/dashboard/dist/assets/index-Czxksiao.js +0 -18
  147. package/packages/dashboard/dist/assets/index-DK2sTU47.css +0 -1
  148. /package/packages/core/src/{gateway → channels}/discordAdapter.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepashangelog.com/en/1.0.0/),
6
6
 
7
+ ## [26.7.5]
8
+ ### Reasoning & Agent Engine Architecture
9
+ - **Event-Driven Tool Execution**: Fully refactored the core agent loop (`osAgent.ts`) from a linear synchronous executor to a highly scalable, event-driven architecture using Lifecycle Hooks (`beforeToolCall`, `afterToolCall`). This completely decouples security guardrails and domain-specific logic from the core loop.
10
+ - **Parallel Execution Concurrency**: Supercharged the agent's data gathering capabilities by upgrading the execution engine to support parallel processing (`Promise.all`), allowing multiple safe tools to run concurrently for massive speed improvements.
11
+ - **Deferred Tool Resolution (MCP Ready)**: Built-in support for dynamic tool resolution, allowing the agent to request and execute external tools (e.g., via Model Context Protocol servers) on-the-fly even if they aren't loaded in the initial context.
12
+ - **Partial Streaming Feedback**: Long-running tools can now stream partial updates (`"⏳ Processing..."`) to the user interface (Telegram/Dashboard) before the execution is fully complete, significantly enhancing UX and transparency.
13
+ - **Advanced Guardrails**: The strict `Reasoning Gate` and `Web3 Fast Return` logic have been cleanly migrated into standalone middleware hooks, ensuring the main executor remains agnostic and maintainable.
14
+ - **Dynamic Reasoning Mapper**: Injected seamless support for `reasoning_effort` across the entire Unified Mapper API, making it universally compatible with both OpenAI and OpenRouter native reasoning models.
15
+ - **UX Sanitizer**: Implemented intelligent regex filtering to intercept and strip raw LLM `<think>` tags before they are broadcast to user-facing channels, keeping chat interfaces clean and elegant.
16
+
17
+ ### UI/UX & Design System Overhaul
18
+ - **Modern UI Aesthetic**: Executed a comprehensive overhaul of the dashboard interface. Introduced advanced glassmorphism (`backdrop-filter: blur(20px)`) to the sidebar, softened structural corners (`border-radius: 18px`), and applied modern micro-animations and subtle drop-shadows across chat bubbles and input forms.
19
+ - **Color Harmony & Contrast**: Refined the Dark Mode palette by shifting the primary accent color to a sleek Cyan (`#32ADE6`). Adjusted typography across UI pills (Network Selectors, Trending Tokens) from harsh contrast to a harmonious, translucent off-white (`rgba(255, 255, 255, 0.85)`) for optimal readability without eye strain.
20
+ - **Chat Experience**: Redesigned the chat bubbles to distinctly separate user and agent messages using vibrant colored backgrounds for the user and elegant dark-glass styling for the agent, significantly improving spatial distinction.
21
+
22
+ ### Native Channel Engine (Omni-Channel Integration)
23
+ - **Massive Architecture Overhaul**: Replaced the legacy hardcoded Telegram/Discord gateway with a highly scalable `ChannelManager`. Nyxora now natively and dynamically supports 19 distinct messaging platforms without requiring external sidecars.
24
+ - **Dynamic CLI Configuration**: Overhauled `setup.ts` to dynamically detect and register available channels, allowing users to select and configure credentials seamlessly via `nyxora start`.
25
+ - **19 Native SDK Implementations**: Successfully integrated and compiled native event listeners, Webhooks, and Socket Modes for WhatsApp (Baileys), Slack (Bolt Socket Mode), LINE, Microsoft Teams, Mattermost, Matrix, Google Chat, Synology, Nextcloud, Zalo, Twitch, iMessage, IRC, QQ Bot, Nostr, SMS, and Voice.
26
+
27
+ ### Playbook Ecosystem & Automation
28
+ - **Playbook Recorder (Auto-Learn)**: Introduced a powerful Auto-Learn capability (CRITICAL RULE 7) allowing the OS Agent to dynamically record terminal workflows, abstract them into markdown instructions, and autonomously generate new reusable SOPs (Playbooks) based on chat history.
29
+ - **Skill Store Dashboard (Split-Pane UI)**: Built a brand-new native Skill Store interface in the dashboard (`Playbooks.tsx`), enabling users to browse, edit, and manage their local AI playbooks seamlessly via a modern split-pane editor without touching the terminal.
30
+
31
+ ### Features & Architecture
32
+ - **Self-Learning & Continuous Improvement**: Transformed Nyxora into a continuously evolving AI. The OS Agent (`osAgent.ts`) now natively injects narrative profiles (`MEMORY.md` and `USER.md`) directly into the system prompt at the start of every session.
33
+ - **Asynchronous Background Review**: Engineered a non-blocking background auditor (`triggerBackgroundReview`) that executes silently after every interaction. The agent uses LangChain to evaluate recent conversations, autonomously identifying user preferences, extracting reusable workflows, and dynamically creating or patching its own skills (`skill_manager.py`) without user intervention.
34
+
35
+ ### Bug Fixes & Improvements
36
+ - **Streaming UI Text Duplication & Glitch Fix**: Resolved a critical issue in the multi-turn streaming architecture where LLM "thought process" text (generated before a tool call) would leak and concatenate with the final answer on Telegram. Implemented a robust `[CLEAR_STREAM]` control signal that gracefully resets the message draft and displays a universal `⏳ Processing...` placeholder, completely eradicating message bubble collapse and visual jitter during tool execution.
37
+
7
38
  ## [26.7.4]
8
39
  ### Features & Architecture
9
40
  - **Cognitive Critic Engine Enhancements (Staleness Detection)**: Added a multilingual time-sensitive detection rule to the Critic Engine (`critic.py`). By injecting the current UTC datetime, the Critic now explicitly flags answers containing time-sensitive keywords (e.g., "today", "kemarin", "now") if they rely on stale training memory rather than fresh tool execution.
package/README.md CHANGED
@@ -72,7 +72,7 @@ It operates under a **Zero-Trust, Defense-in-Depth Cryptographically Bound Human
72
72
 
73
73
  ### Advanced Security Architecture
74
74
  * **🛡️ On-Chain AI Kill-Switch**: Nyxora is governed by a Base Smart Contract (`NyxoraAgentRegistry`). Users have absolute cryptographic power to instantly paralyze the AI's on-chain execution if compromised, solving the Web3 AI safety dilemma. [Read more about our Base Architecture](https://nyxoraai.github.io/Nyxora/smart-contract)
75
- * **4-Tier IPC Architecture**: Nyxora is split into isolated processes: **Core** (Node.js LLM Runtime), **ML Engine** (Python Cognitive Sidecar on port 8000), **Policy Engine** (Guardrails on port 3001), and **Signer Vault** (Isolated Key Manager on Unix Sockets).
75
+ * **6-Tier Hybrid Architecture**: Nyxora is split into isolated microservices: **Dashboard** (Port 5173), **MCP Server** (Port 3001), **Core LLM** (Port 3000), **ML Engine** (Python Sidecar on Port 8000), **Policy Engine** (Unix Socket), and **Signer Vault** (Unix Socket).
76
76
  * **DeFi & Market Configuration BYOK & UI Masking**: All aggregator, provider, and oracle API keys are strictly isolated via a Bring Your Own Keys (BYOK) architecture into heavily guarded `~/.nyxora/defi_keys.yaml` and `~/.nyxora/market_keys.yaml` files. The local web Dashboard masks these injected secrets using `***********` and `IS_SET` censorship, completely neutralizing malicious browser extensions from exfiltrating your keys.
77
77
  * **Approval Replay Protection (Nonce Guard)**: Transactions requested by the AI are drafted as hashes and signed with a randomized 16-byte Nonce. The `/api/transactions/:id/approve` endpoint strictly enforces Nonce matching to completely eliminate double-spending and Replay Attacks.
78
78
  * **Native Asset Parameter Tampering Protection**: The internal cryptographic HMAC signature rigorously binds `toAddress`, `txData`, and `valueWei`, rendering the system mathematically immune to Native Token (ETH/BNB) destination or amount hijacking via Indirect Prompt Injections.
@@ -121,15 +121,54 @@ It operates under a **Zero-Trust, Defense-in-Depth Cryptographically Bound Human
121
121
 
122
122
  ## 📐 Architecture Workflow
123
123
 
124
- The following diagram illustrates Nyxora's **4-Tier Hybrid Architecture**, showing the isolated communication channels (REST API and Unix Socket).
125
-
126
- ![Architecture Workflow](https://raw.githubusercontent.com/perasyudha/Nyxora/main/assets/architecture.svg)
124
+ The following diagram illustrates Nyxora's **6-Tier Hybrid Architecture**, showing the isolated communication channels across the ecosystem.
125
+
126
+ ```text
127
+ +-------------------------------------------------------------+
128
+ | Nyxora 6-Tier Architecture |
129
+ +-------------------------------------------------------------+
130
+
131
+ [ User / External Client ]
132
+ |
133
+ v
134
+ +-----------------------------+ +-------------------------+
135
+ | Dashboard (UI) | | MCP Server |
136
+ | Port 5173 | | Port 3001 |
137
+ +-----------------------------+ +-------------------------+
138
+ | |
139
+ +---------------+------------------+
140
+ |
141
+ v
142
+ +--------------------+
143
+ | Core LLM Runtime | <--- (NLP Parsing, Routing,
144
+ | Port 3000 | Agent Logic)
145
+ +--------------------+
146
+ ^ |
147
+ (RAG & Math) | | (Draft Transaction)
148
+ v v
149
+ +-------------------------+ +-------------------------------+
150
+ | ML Engine | | Policy Engine (Guard) |
151
+ | Port 8000 | | Unix Socket (IPC) / Loopback |
152
+ +-------------------------+ +-------------------------------+
153
+ |
154
+ | (Approved Payload)
155
+ v
156
+ +-------------------------------+
157
+ | Signer Vault (Safe) |
158
+ | Unix Socket (IPC) |
159
+ +-------------------------------+
160
+ |
161
+ v
162
+ [ Blockchain RPC ]
163
+ ```
127
164
 
128
- *Nyxora separates its duties into 4 independent layers for absolute security and cognitive depth:*
129
- 1. **🧠 Core (The AI Brain)**: The Node.js intelligent assistant that strategizes and plans transactions, but **never** holds your funds.
130
- 2. **🧬 ML Engine (Cognitive Sidecar)**: A local Python/FastAPI sidecar running LangChain and HuggingFace models for hyper-fast Semantic RAG memory and Pandas-based technical market analysis.
131
- 3. **🛡️ Policy Engine (The Guard)**: The security guard that verifies the Brain's plans. If the AI attempts to send funds exceeding your set limits, this engine automatically blocks it.
132
- 4. **🔒 Signer Vault (The Safe)**: The offline vault where your Private Keys **and highly sensitive 3rd-party tokens (e.g., Google Workspace OAuth)** are securely locked natively in your OS Keyring. It only signs transactions after they pass all rigorous security checks.
165
+ *Nyxora separates its duties into 6 independent layers for absolute security and cognitive depth:*
166
+ 1. **🖥️ Dashboard (UI)**: A premium local React interface for real-time monitoring and conversational execution.
167
+ 2. **🔌 MCP Server (Context Provider)**: An open standard interface to connect Nyxora with external AI environments like Claude Desktop natively.
168
+ 3. **🧠 Core (The AI Brain)**: The Node.js intelligent assistant that strategizes and plans transactions, but **never** holds your funds.
169
+ 4. **🧬 ML Engine (Cognitive Sidecar)**: A local Python/FastAPI sidecar running LangChain and HuggingFace models for hyper-fast Semantic RAG memory and Pandas-based technical market analysis.
170
+ 5. **🛡️ Policy Engine (The Guard)**: The security guard that verifies the Brain's plans. If the AI attempts to send funds exceeding your set limits, this engine automatically blocks it.
171
+ 6. **🔒 Signer Vault (The Safe)**: The offline vault where your Private Keys **and highly sensitive 3rd-party tokens (e.g., Google Workspace OAuth)** are securely locked natively in your OS Keyring. It only signs transactions after they pass all rigorous security checks.
133
172
 
134
173
  ### Web3 Separation of Concerns (Zero-Trust Routing)
135
174
  Within the AI Brain, the Web3 codebase is strictly divided to prevent the LLM from hallucinating or maliciously manipulating low-level routing paths:
package/dist/launcher.js CHANGED
@@ -141,7 +141,9 @@ setTimeout(() => {
141
141
  // Spawn ML Engine (Python Sidecar)
142
142
  const pythonPath = path_1.default.join(process.env.HOME || process.env.USERPROFILE || '', '.nyxora', 'ml-engine', 'venv', 'bin', 'python');
143
143
  if (fs_1.default.existsSync(pythonPath)) {
144
- const mlDir = path_1.default.join(__dirnameResolved, 'packages', 'ml-engine');
144
+ let mlDir = path_1.default.join(__dirnameResolved, 'packages', 'ml-engine');
145
+ if (!fs_1.default.existsSync(mlDir))
146
+ mlDir = path_1.default.join(__dirnameResolved, '..', 'packages', 'ml-engine');
145
147
  const mlArgs = ['-m', 'uvicorn', 'main:app', '--host', '127.0.0.1', '--port', '8000'];
146
148
  const mlEngine = spawnService('ML Engine', pythonPath, mlArgs, env, false, mlDir);
147
149
  children.push(mlEngine);
@@ -154,6 +156,32 @@ setTimeout(() => {
154
156
  const args = process.argv.slice(2);
155
157
  const core = spawnService('Core', cmd, [...baseArgs, corePath, ...args], env, true);
156
158
  children.push(core);
159
+ // --- AUTO-TUNNEL (Cloudflare) ---
160
+ setTimeout(() => {
161
+ console.log('[Launcher] Starting Auto-Tunnel (Cloudflare) on port 3000...');
162
+ const cf = (0, child_process_1.spawn)('npx', ['cloudflared', 'tunnel', '--url', 'http://localhost:3000'], { env, shell: true });
163
+ children.push({
164
+ kill: () => { try {
165
+ process.kill(cf.pid, 'SIGTERM');
166
+ }
167
+ catch (e) { } },
168
+ forceKill: () => { try {
169
+ process.kill(cf.pid, 'SIGKILL');
170
+ }
171
+ catch (e) { } }
172
+ });
173
+ cf.stderr.on('data', (data) => {
174
+ const msg = data.toString();
175
+ // Extract the Cloudflare URL (e.g., https://xyz.trycloudflare.com)
176
+ const match = msg.match(/https:\/\/[a-zA-Z0-9-]+\.trycloudflare\.com/);
177
+ if (match) {
178
+ const url = match[0];
179
+ console.log(`\n[Auto-Tunnel] Secure Public URL generated: ${url}\n`);
180
+ fs_1.default.writeFileSync(path_1.default.join(nyxoraDir, 'public_url.txt'), url, 'utf8');
181
+ }
182
+ // Optionally print errors if they are real errors, but cloudflared logs everything to stderr
183
+ });
184
+ }, 3000);
157
185
  }, 1000);
158
186
  }, 1000);
159
187
  }, 1000);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.startBridgeWatcher = startBridgeWatcher;
4
4
  const transactionManager_1 = require("./transactionManager");
5
- const telegram_1 = require("../gateway/telegram");
5
+ const telegram_1 = require("../channels/telegram");
6
6
  const parser_1 = require("../config/parser");
7
7
  // In a real production environment, this would use the @eth-optimism/sdk
8
8
  // to fetch the Merkle Proof and call proveWithdrawalTransaction on L1.
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.cronManager = void 0;
40
40
  const croner_1 = require("croner");
41
41
  const parser_1 = require("../config/parser");
42
- const telegram_1 = require("../gateway/telegram");
42
+ const telegram_1 = require("../channels/telegram");
43
43
  const crypto_1 = require("crypto");
44
44
  const picocolors_1 = __importDefault(require("picocolors"));
45
45
  class CronManager {
@@ -11,6 +11,7 @@ class OpenAIAdapter {
11
11
  return {
12
12
  message: {
13
13
  content: response.choices[0].message.content,
14
+ reasoning_content: response.choices[0].message.reasoning_content || null,
14
15
  tool_calls: response.choices[0].message.tool_calls
15
16
  },
16
17
  usage: response.usage ? { total_tokens: response.usage.total_tokens } : undefined
@@ -20,6 +21,7 @@ class OpenAIAdapter {
20
21
  try {
21
22
  const streamRes = await this.client.chat.completions.create({ ...request, stream: true });
22
23
  let fullContent = '';
24
+ let reasoningContent = '';
23
25
  const toolCallsMap = {};
24
26
  for await (const chunk of streamRes) {
25
27
  const delta = chunk.choices[0]?.delta;
@@ -27,6 +29,9 @@ class OpenAIAdapter {
27
29
  fullContent += delta.content;
28
30
  onChunk(delta.content);
29
31
  }
32
+ if (delta?.reasoning_content) {
33
+ reasoningContent += delta.reasoning_content;
34
+ }
30
35
  if (delta?.tool_calls) {
31
36
  for (const tc of delta.tool_calls) {
32
37
  if (!toolCallsMap[tc.index]) {
@@ -47,6 +52,7 @@ class OpenAIAdapter {
47
52
  return {
48
53
  message: {
49
54
  content: fullContent || null,
55
+ reasoning_content: reasoningContent || null,
50
56
  tool_calls: toolCalls.length > 0 ? toolCalls : undefined
51
57
  }
52
58
  };
@@ -55,6 +61,7 @@ class OpenAIAdapter {
55
61
  // Fallback to non-streaming if streaming fails
56
62
  const chatRes = await this.chat(request);
57
63
  if (chatRes.message.content) {
64
+ onChunk('[CLEAR_STREAM]');
58
65
  onChunk(chatRes.message.content);
59
66
  }
60
67
  return chatRes;
@@ -149,11 +156,15 @@ class AnthropicAdapter {
149
156
  max_tokens: request.max_tokens || 4096
150
157
  });
151
158
  let contentStr = null;
159
+ let reasoningStr = null;
152
160
  let toolCalls = [];
153
161
  for (const block of response.content) {
154
162
  if (block.type === 'text') {
155
163
  contentStr = (contentStr || '') + block.text;
156
164
  }
165
+ else if (block.type === 'thinking') {
166
+ reasoningStr = (reasoningStr || '') + block.thinking;
167
+ }
157
168
  else if (block.type === 'tool_use') {
158
169
  toolCalls.push({
159
170
  id: block.id,
@@ -168,6 +179,7 @@ class AnthropicAdapter {
168
179
  return {
169
180
  message: {
170
181
  content: contentStr,
182
+ reasoning_content: reasoningStr,
171
183
  tool_calls: toolCalls.length > 0 ? toolCalls : undefined
172
184
  },
173
185
  usage: response.usage ? { total_tokens: response.usage.input_tokens + response.usage.output_tokens } : undefined
@@ -233,12 +245,16 @@ class AnthropicAdapter {
233
245
  max_tokens: request.max_tokens || 4096
234
246
  });
235
247
  let fullContent = '';
248
+ let reasoningContent = '';
236
249
  const toolCalls = [];
237
250
  for await (const event of stream) {
238
251
  if (event.type === 'content_block_delta' && event.delta.type === 'text_delta') {
239
252
  fullContent += event.delta.text;
240
253
  onChunk(event.delta.text);
241
254
  }
255
+ if (event.type === 'content_block_delta' && event.delta.type === 'thinking_delta') {
256
+ reasoningContent += event.delta.thinking;
257
+ }
242
258
  if (event.type === 'content_block_start' && event.content_block.type === 'tool_use') {
243
259
  toolCalls.push({ id: event.content_block.id, type: 'function', function: { name: event.content_block.name, arguments: '' } });
244
260
  }
@@ -248,10 +264,15 @@ class AnthropicAdapter {
248
264
  last.function.arguments += event.delta.partial_json;
249
265
  }
250
266
  }
251
- return { message: { content: fullContent || null, tool_calls: toolCalls.length > 0 ? toolCalls : undefined } };
267
+ return { message: { content: fullContent || null, reasoning_content: reasoningContent || null, tool_calls: toolCalls.length > 0 ? toolCalls : undefined } };
252
268
  }
253
269
  catch {
254
- return this.chat(request);
270
+ const chatRes = await this.chat(request);
271
+ if (chatRes.message.content) {
272
+ onChunk('[CLEAR_STREAM]');
273
+ onChunk(chatRes.message.content);
274
+ }
275
+ return chatRes;
255
276
  }
256
277
  }
257
278
  }
@@ -510,7 +531,12 @@ class GeminiAdapter {
510
531
  };
511
532
  }
512
533
  catch {
513
- return this.chat(request);
534
+ const chatRes = await this.chat(request);
535
+ if (chatRes.message.content) {
536
+ onChunk('[CLEAR_STREAM]');
537
+ onChunk(chatRes.message.content);
538
+ }
539
+ return chatRes;
514
540
  }
515
541
  }
516
542
  }
@@ -82,7 +82,7 @@ class NyxDaemon {
82
82
  }
83
83
  }
84
84
  catch (e) {
85
- console.error(picocolors_1.default.red('[Nyx] Failed to process traits from Python'), traits);
85
+ console.error(picocolors_1.default.red('[Nyx] Failed to process traits from Python: ' + e.message), traits);
86
86
  }
87
87
  }
88
88
  catch (e) {