navada-edge-cli 4.0.0 → 4.2.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.
@@ -1,164 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const ui = require('../ui');
6
-
7
- module.exports = function(reg) {
8
-
9
- // ── /read <path> ── Read a file
10
- reg('read', 'Read a file from your machine', (args) => {
11
- if (!args[0]) { console.log(ui.dim('Usage: /read <file-path>')); return; }
12
- const filePath = path.resolve(args.join(' '));
13
- try {
14
- const content = fs.readFileSync(filePath, 'utf-8');
15
- const lines = content.split('\n');
16
- console.log(ui.header(`FILE: ${filePath}`));
17
- console.log(ui.dim(`${lines.length} lines, ${Buffer.byteLength(content)} bytes`));
18
- console.log('');
19
- // Show with line numbers, cap at 200 lines
20
- const show = lines.slice(0, 200);
21
- show.forEach((line, i) => console.log(` ${String(i + 1).padStart(4)} ${line}`));
22
- if (lines.length > 200) console.log(ui.dim(` ... ${lines.length - 200} more lines`));
23
- } catch (e) {
24
- console.log(ui.error(e.code === 'ENOENT' ? `File not found: ${filePath}` : e.message));
25
- }
26
- }, { category: 'FILES', aliases: ['cat'] });
27
-
28
- // ── /write <path> <content> ── Write/create a file
29
- reg('write', 'Write content to a file (creates dirs if needed)', (args) => {
30
- if (args.length < 2) {
31
- console.log(ui.dim('Usage: /write <file-path> <content>'));
32
- console.log(ui.dim(' /write hello.txt Hello World'));
33
- console.log(ui.dim(' /write src/config.json {"key":"value"}'));
34
- return;
35
- }
36
- const filePath = path.resolve(args[0]);
37
- const content = args.slice(1).join(' ');
38
- try {
39
- const dir = path.dirname(filePath);
40
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
41
- fs.writeFileSync(filePath, content);
42
- console.log(ui.success(`Written: ${filePath} (${Buffer.byteLength(content)} bytes)`));
43
- } catch (e) {
44
- console.log(ui.error(e.message));
45
- }
46
- }, { category: 'FILES' });
47
-
48
- // ── /edit <path> <search> -> <replace> ── Find and replace in a file
49
- reg('edit', 'Edit a file (find and replace)', (args) => {
50
- const raw = args.join(' ');
51
- const sepIdx = raw.indexOf(' -> ');
52
- if (!args[0] || sepIdx === -1) {
53
- console.log(ui.dim('Usage: /edit <file-path> <search-text> -> <replace-text>'));
54
- console.log(ui.dim(' /edit config.json "port": 3000 -> "port": 8080'));
55
- return;
56
- }
57
- // First arg is the file path, rest is search -> replace
58
- const filePath = path.resolve(args[0]);
59
- const afterPath = raw.slice(raw.indexOf(args[0]) + args[0].length + 1);
60
- const arrowIdx = afterPath.indexOf(' -> ');
61
- if (arrowIdx === -1) {
62
- console.log(ui.dim('Use " -> " to separate search and replace text'));
63
- return;
64
- }
65
- const search = afterPath.slice(0, arrowIdx);
66
- const replace = afterPath.slice(arrowIdx + 4);
67
-
68
- try {
69
- const content = fs.readFileSync(filePath, 'utf-8');
70
- if (!content.includes(search)) {
71
- console.log(ui.error('Search text not found in file'));
72
- return;
73
- }
74
- const updated = content.replace(search, replace);
75
- fs.writeFileSync(filePath, updated);
76
- console.log(ui.success(`Edited: ${filePath}`));
77
- console.log(ui.dim(` "${search.slice(0, 40)}${search.length > 40 ? '...' : ''}" → "${replace.slice(0, 40)}${replace.length > 40 ? '...' : ''}"`));
78
- } catch (e) {
79
- console.log(ui.error(e.code === 'ENOENT' ? `File not found: ${filePath}` : e.message));
80
- }
81
- }, { category: 'FILES' });
82
-
83
- // ── /delete <path> ── Delete a file
84
- reg('delete', 'Delete a file or empty directory', (args) => {
85
- if (!args[0]) { console.log(ui.dim('Usage: /delete <file-path>')); return; }
86
- const filePath = path.resolve(args.join(' '));
87
- try {
88
- const stat = fs.statSync(filePath);
89
- if (stat.isDirectory()) {
90
- fs.rmdirSync(filePath);
91
- console.log(ui.success(`Deleted directory: ${filePath}`));
92
- } else {
93
- fs.unlinkSync(filePath);
94
- console.log(ui.success(`Deleted: ${filePath} (${stat.size} bytes)`));
95
- }
96
- } catch (e) {
97
- if (e.code === 'ENOENT') console.log(ui.error(`Not found: ${filePath}`));
98
- else if (e.code === 'ENOTEMPTY') console.log(ui.error('Directory not empty. Use /run rm -rf <path> for recursive delete.'));
99
- else console.log(ui.error(e.message));
100
- }
101
- }, { category: 'FILES', aliases: ['rm'] });
102
-
103
- // ── /ls [path] ── List files
104
- reg('ls', 'List files and directories', (args) => {
105
- const dir = path.resolve(args.join(' ') || '.');
106
- try {
107
- const items = fs.readdirSync(dir, { withFileTypes: true });
108
- console.log(ui.header(`DIR: ${dir}`));
109
- if (items.length === 0) { console.log(ui.dim(' (empty)')); return; }
110
-
111
- const dirs = items.filter(i => i.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
112
- const files = items.filter(i => !i.isDirectory()).sort((a, b) => a.name.localeCompare(b.name));
113
-
114
- for (const d of dirs) console.log(` \x1b[34md\x1b[0m ${d.name}/`);
115
- for (const f of files) {
116
- try {
117
- const stat = fs.statSync(path.join(dir, f.name));
118
- const size = stat.size < 1024 ? `${stat.size}B` : stat.size < 1048576 ? `${(stat.size / 1024).toFixed(1)}K` : `${(stat.size / 1048576).toFixed(1)}M`;
119
- console.log(` f ${f.name.padEnd(40)} ${size}`);
120
- } catch {
121
- console.log(` f ${f.name}`);
122
- }
123
- }
124
- console.log('');
125
- console.log(ui.dim(` ${dirs.length} dirs, ${files.length} files`));
126
- } catch (e) {
127
- console.log(ui.error(e.code === 'ENOENT' ? `Not found: ${dir}` : e.message));
128
- }
129
- }, { category: 'FILES', aliases: ['dir'] });
130
-
131
- // ── /mkdir <path> ── Create directory
132
- reg('mkdir', 'Create a directory (including parents)', (args) => {
133
- if (!args[0]) { console.log(ui.dim('Usage: /mkdir <dir-path>')); return; }
134
- const dirPath = path.resolve(args.join(' '));
135
- try {
136
- fs.mkdirSync(dirPath, { recursive: true });
137
- console.log(ui.success(`Created: ${dirPath}`));
138
- } catch (e) {
139
- console.log(ui.error(e.message));
140
- }
141
- }, { category: 'FILES' });
142
-
143
- // ── /touch <path> ── Create empty file
144
- reg('touch', 'Create an empty file', (args) => {
145
- if (!args[0]) { console.log(ui.dim('Usage: /touch <file-path>')); return; }
146
- const filePath = path.resolve(args.join(' '));
147
- try {
148
- const dir = path.dirname(filePath);
149
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
150
- if (fs.existsSync(filePath)) {
151
- // Update mtime like Unix touch
152
- const now = new Date();
153
- fs.utimesSync(filePath, now, now);
154
- console.log(ui.success(`Touched: ${filePath}`));
155
- } else {
156
- fs.writeFileSync(filePath, '');
157
- console.log(ui.success(`Created: ${filePath}`));
158
- }
159
- } catch (e) {
160
- console.log(ui.error(e.message));
161
- }
162
- }, { category: 'FILES' });
163
-
164
- };
package/lib/knowledge.py DELETED
@@ -1,197 +0,0 @@
1
- """
2
- NAVADA Edge Knowledge Skill — answers questions about Lee Akpareva accurately.
3
- Called by the CLI agent as a Python subprocess. Uses OpenAI for natural responses
4
- grounded in factual CV data. No hallucination.
5
- """
6
-
7
- import sys
8
- import json
9
- import os
10
-
11
- KNOWLEDGE = """
12
- LESLIE (LEE) AKPAREVA
13
- Principal AI Consultant | Program Director | ML Engineer
14
- Phone: 07935237704 | Email: leeakpareva@hotmail.com | Web: www.navada-lab.space
15
-
16
- Senior technology leader and practising ML engineer with 17+ years delivering large-scale digital transformation across insurance, finance, healthcare, aviation, logistics, and e-commerce. Combines MBA-level commercial acumen with hands-on AI engineering, training custom models on GPU infrastructure, designing multi-agent architectures, and deploying production-grade systems that drive measurable P&L impact.
17
-
18
- Equally comfortable presenting ROI cases to C-suite stakeholders and debugging CUDA memory allocation in a GPU terminal. Track record of owning programme budgets up to 5M GBP, leading cross-functional teams of 30+, and translating AI capability into benefits realisation across underwriting, claims, operations, and commercial functions.
19
-
20
- Engineering workflow runs on Paperspace (paperspace.com) for GPU-accelerated model training and inference, with Railway (railway.com) providing persistent compute for production APIs, scheduled automation, and cron-based orchestration.
21
-
22
- CORE COMPETENCIES
23
- Leadership: Programme Governance, Portfolio Management, C-Suite Engagement, Vendor Management, Risk & Compliance
24
- AI/ML: PyTorch, Hugging Face, LangChain, QLoRA Fine-Tuning, RAG Pipelines, Computer Vision (YOLO), Azure AI Foundry, OpenAI, FastAPI, Docker, CI/CD
25
- Commercial: P&L Ownership, Benefits Realisation, ROI & NPV Modelling, Cost Optimisation, Investment Prioritisation
26
-
27
- PROFESSIONAL EXPERIENCE (chronological, most recent first)
28
-
29
- 1. Principal Azure AI Solution Consultant | Generali UK | November 2024 to Present
30
- Hired directly by the COO to define and lead AI strategy across the UK business. Sole technical architect and lead developer for enterprise AI, responsible for the full ML lifecycle from model selection through fine-tuning to production deployment.
31
- - Established the AI Centre of Excellence, defining operating model, governance frameworks, and technical standards for AI delivery on Azure AI Foundry
32
- - Designed and implemented multi-agent architectures integrating LangChain, Azure OpenAI, and vector databases (PostgreSQL/Pinecone) for production RAG pipelines
33
- - Led model evaluation and fine-tuning initiatives, executing QLoRA adapter training on Qwen and Llama models using Hugging Face transformers and PEFT on cloud GPU infrastructure
34
- - Built end-to-end ML training pipelines including dataset curation, hyperparameter optimisation, loss curve analysis, and inference endpoint deployment via FastAPI
35
- - Trained custom LoRA adapters for domain-specific image generation using Stable Diffusion, supporting brand and marketing use cases
36
- - Deployed computer vision prototypes using YOLOv8 for document classification and visual inspection workflows
37
- - Created reusable AI reference architecture now adopted as the blueprint for all new AI initiatives, reducing concept-to-POC time by 60%
38
- - Delivered AI prototypes for legal, claims, and operations teams, demonstrating measurable reduction in manual review time and improved knowledge retrieval
39
- - Authored and delivered internal AI enablement programme including workshops, notebooks, and technical guides to upskill 50+ staff on RAG, LLM orchestration, and ML operations
40
- - Built secure API layers with JWT/OAuth, rate limiting, and Azure Key Vault integration maintaining enterprise compliance and data protection standards
41
-
42
- 2. Program Director | Informa Markets | October 2023 to September 2024
43
- Accountable for strategy, P&L, and delivery of two new digital products within the global food portfolio. Led a cross-functional European team of 27 across engineering, data science, product, UX, and operations.
44
- - Took two digital propositions from concept to launch-ready state
45
- - Managed programme financials including resource allocation, cost forecasting, and investment trade-off analysis
46
- - Defined and executed go-to-market strategies for digital product launches across multiple European regions
47
- - Introduced data-driven decision-making into portfolio management
48
- - Oversaw regulatory compliance, risk management, and governance across multi-jurisdiction delivery
49
-
50
- 3. Commercial Program Manager | Farfetch | December 2022 to August 2023
51
- - Led commercial technology programmes for the luxury fashion marketplace
52
- - Owned programme financials and benefits tracking, reporting directly to senior leadership
53
- - Coordinated platform initiatives supporting 2.3B GBP GMV marketplace operations
54
-
55
- 4. Blockchain Program Manager | DHL Express | May 2022 to December 2022
56
- - Managed blockchain and emerging technology programmes for the global logistics leader
57
- - Led cross-functional teams evaluating distributed ledger solutions for supply chain transparency and shipment verification
58
- - Developed business cases and ROI models for blockchain integration across European operations
59
-
60
- 5. Product / Project Lead | Shutterstock | November 2021 to May 2022
61
- 6. DeFi & Blockchain Program Lead | Bumper (DeFi Protocol) | September 2021 to November 2021
62
- 7. Project Manager | Millbrook Healthcare | March 2021 to May 2021
63
- 8. Agile Project Consultant | NHSX (NHS Digital) | October 2020 to December 2020
64
- 9. Project Manager | Springer Nature | March 2020 to October 2020
65
- 10. Platform Manager | Opus Energy | June 2019 to December 2019
66
- 11. Digital Project Manager | Centrica (British Gas) | April 2018 to June 2019
67
- 12. Project Manager | Wesleyan Bank | October 2017 to April 2018
68
- 13. Manager | Avis Budget Group | October 2016 to October 2017
69
- 14. Business Program Manager | Wonga | May 2016 to October 2016
70
- 15. Project Manager | British Airways | November 2015 to April 2016
71
- 16. Agile PM / Scrum Master | Flybe | May 2015 to November 2015
72
- 17. Technical Project Manager | Expedia Inc | October 2014 to May 2015
73
- 18. Project Manager | Powa Technology | April 2014 to October 2014
74
- 19. Implementation Manager | Polarisoft | August 2013 to April 2014
75
-
76
- PERSONAL PROJECTS & TECHNICAL RESEARCH
77
- - Custom LLM Fine-Tuning: Trained domain-specific language models using QLoRA on cloud GPU (NVIDIA A4000). Built 85-example curated datasets, iterated across 3 model versions, resolved base model hallucination through progressive LoRA rank scaling
78
- - Stable Diffusion LoRA Training: Created custom image generation adapters for brand-consistent AI imagery
79
- - Computer Vision: Deployed YOLOv8 object detection models with real-time inference. Live: computervisionbylee.streamlit.app
80
- - RAVEN Terminal: AI-powered code learning platform. Live: raventerminal.xyz
81
- - Medical AI: Evaluated OpenBioLLM-8B for healthcare automation, clinical triage and drug discovery
82
- - ALEX: Multi-modal autonomous agent combining cloud GPU inference with Raspberry Pi edge deployment. Live: alexnavada.xyz
83
- - RAG & Vector Search: Built retrieval-augmented generation pipelines using ChromaDB, LangChain, and sentence-transformers
84
- - Robotics & IoT: Raspberry Pi-powered robots including PiCrawler spider robot with computer vision, servo calibration, and MediaPipe gesture control
85
- - Full-Stack AI Applications: End-to-end Next.js, FastAPI, Vercel, and Railway deployments. Portfolio: navada.space
86
- - GPU ML Lab: Full ML engineering workstation on Paperspace A4000. Publicly shareable: navada-lab.space
87
- - Hugging Face Contributor: Publishing models and datasets on huggingface.co/Navada25
88
- - NAVADA Edge Network: Distributed AI home server (4 nodes, 25+ Docker containers, Tailscale VPN mesh)
89
- - NAVADA Edge SDK + CLI: npm packages for network access (navada-edge-sdk, navada-edge-cli)
90
- - WorldMonitor: OSINT intelligence dashboard
91
- - Lucas CTO: Autonomous infrastructure agent on EC2
92
-
93
- EDUCATION
94
- - MBA (Master of Business Administration) | Northumbria University | 2016 to 2017
95
- - MSc Project Management | Northumbria University | 2013 to 2015
96
- - Fashion Design & Art Direction | Central Saint Martins, UAL | 2020
97
- - LLB Law (Hons) | Brunel University | 2007 to 2010
98
-
99
- CERTIFICATIONS
100
- AI & Cloud: Azure AI Engineer, Azure Data Scientist, AWS Solutions Architect, Google Cloud Associate, Python Expert (Meta), IBM Full Stack Developer
101
- Blockchain: Certified Blockchain Architect, Smart Contract Developer, DeFi Expert, Cryptocurrency Expert (Blockchain Council)
102
- Project Management: PRINCE2 Practitioner, Certified Scrum Master, SAFe, ITIL, Project Risk Management (Oxford), Strategic Planning & Foresight (Oxford)
103
- Security: CISM (Certified Information Security Manager), ISEB Business Analysis, Foundation in Software Testing
104
-
105
- TECHNICAL STACK
106
- ML & AI: PyTorch, Hugging Face Transformers, Diffusers, PEFT, TRL, BitsAndBytes, LangChain, CrewAI, OpenAI, Anthropic, YOLO, Whisper, Gradio, Streamlit
107
- Languages: Python, TypeScript, JavaScript, SQL
108
- Cloud & DevOps: Azure AI Foundry, AWS, GCP, Docker, Vercel, Railway, Paperspace GPU, GitHub Actions
109
- Web & API: Next.js, React, FastAPI, Flask, Node.js, Tailwind CSS
110
- Data: PostgreSQL, ChromaDB, Pinecone, Redis, Oracle, pandas, NumPy, scikit-learn
111
- Hardware: Raspberry Pi, Arduino, PiCrawler, servo control, MediaPipe, edge deployment
112
-
113
- REFERENCES
114
- Nisha Chopra (Mastercard UK), Natasha Berrow (Informa Markets), Abs Oshinowo (Google UK)
115
- """
116
-
117
- SYSTEM_PROMPT = """You are an accurate knowledge assistant for NAVADA Edge. You answer questions about Lee Akpareva using ONLY the factual data provided below.
118
-
119
- Rules:
120
- - Only state facts from the provided knowledge. Never invent or guess.
121
- - If the answer is not in the knowledge, say "I don't have that specific detail."
122
- - Be concise and natural. No markdown formatting, no bold, no headers, no dashes.
123
- - Speak in third person about Lee unless the question is directed at Lee himself.
124
-
125
- KNOWLEDGE:
126
- """ + KNOWLEDGE
127
-
128
-
129
- def ask(question, api_key=None):
130
- """Answer a question using OpenAI grounded in Lee's CV data."""
131
- key = api_key or os.environ.get("OPENAI_API_KEY", "")
132
- if not key:
133
- # Fall back to simple keyword search
134
- return search_local(question)
135
-
136
- try:
137
- import urllib.request
138
- import ssl
139
-
140
- body = json.dumps({
141
- "model": "gpt-4o-mini",
142
- "messages": [
143
- {"role": "system", "content": SYSTEM_PROMPT},
144
- {"role": "user", "content": question}
145
- ],
146
- "temperature": 0.2,
147
- "max_tokens": 500
148
- }).encode()
149
-
150
- req = urllib.request.Request(
151
- "https://api.openai.com/v1/chat/completions",
152
- data=body,
153
- headers={
154
- "Content-Type": "application/json",
155
- "Authorization": f"Bearer {key}"
156
- }
157
- )
158
-
159
- ctx = ssl.create_default_context()
160
- with urllib.request.urlopen(req, timeout=30, context=ctx) as resp:
161
- data = json.loads(resp.read())
162
- return data["choices"][0]["message"]["content"]
163
- except Exception as e:
164
- # Fall back to local search on API failure
165
- return search_local(question)
166
-
167
-
168
- def search_local(question):
169
- """Simple keyword search fallback when no API key available."""
170
- q = question.lower()
171
- lines = KNOWLEDGE.strip().split("\n")
172
- matches = []
173
- for line in lines:
174
- line = line.strip()
175
- if not line:
176
- continue
177
- words = q.split()
178
- score = sum(1 for w in words if len(w) > 2 and w in line.lower())
179
- if score >= 1:
180
- matches.append((score, line))
181
-
182
- matches.sort(key=lambda x: -x[0])
183
- if matches:
184
- top = [m[1] for m in matches[:8]]
185
- return "\n".join(top)
186
- return "I don't have that specific detail about Lee."
187
-
188
-
189
- if __name__ == "__main__":
190
- question = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else sys.stdin.read().strip()
191
- if not question:
192
- print("Usage: python knowledge.py <question>")
193
- sys.exit(1)
194
-
195
- key = os.environ.get("OPENAI_API_KEY", "")
196
- answer = ask(question, key)
197
- print(answer)