Repository navigation
index.html
Ambient Intelligence OS
A terminal-first AI assistant that sees, remembers, and acts — with full ambient peripheral intelligence.
SystemContextManager with atomic persistence, TF-IDF relevance, selective injection. Default cognitive fragment: 262 BPE (byte-identical invariant).
PeripheralMonitor → event → alert → notification → task pipeline. Fairness-weighted rebalancing with step-back-one-rung de-escalation.
| Feature | Headless (liku chat) |
Visual (liku start) |
|---|---|---|
| AI Chat | ✅ | ✅ |
| All 20 CLI Commands | ✅ | ✅ |
| Cognitive Layer | ✅ | ✅ |
| PAL + Peripherals | ✅ | ✅ |
| Multi-Agent Pipeline | ✅ | ✅ |
| Transparent Overlay | ✗ | ✅ |
| Dot Grid Targeting | ✗ | ✅ |
| Inspect Mode | ✗ | ✅ |
| Electron Slash Cmds | ✗ | ✅ |
| Metric | Target | Notes |
|---|---|---|
| Memory | < 300 MB | Electron + overlay + native host |
| CPU (idle) | < 0.5% | No polling loops when passive |
| CPU (selection) | < 2% | Overlay in selection mode |
| Startup | < 3 s | Cold start to interactive |
| Tarball Size | ~196 KB | npm pack output |
Crash-safe state writes with rollback
Origin metadata for every context note
Token-budgeted prompt augmentation
Combined keyword + cosine scoring ×5
Real-time safety boundary enforcement
Deferred operations with retry
RLVR self-improvement loop (MAX=2)
Stale context pruning + validation
- CRUD for structured notes with Zettelkasten-style linking
- Token-budgeted context injection (BPE counting via js-tiktoken ^1.0.21, cl100k_base)
- LRU pruning at MAX_NOTES = 500
- AWM: successful 3+ step sequences auto-extracted as skills
- Combined keyword + TF-IDF scoring (cosine similarity scaled ×5)
- Budget: 1500 tokens/skill, max 3 skills/call
- Word-boundary regex (not substring match)
- Staleness pruning via
fs.existsSyncat index load
Sandbox: child_process.fork(), 5.5s SIGKILL, 16 banned patterns, stripped env (NODE_ENV: 'sandbox' + PATH only)
JSONL telemetry log with 10MB rotation. MAX_REFLECTION_ITERATIONS = 2. Session failure decay -1 per success. Cross-model reflection via /rmodel.
Establishes the ~/.liku/ home directory structure with automatic migration from legacy paths.
CRUD + Zettelkasten-style linking + token-budgeted context injection into prompts.
Structured telemetry writer + reflection trigger + phase-aware temperature adjustment.
Tools proposed by AI → quarantined → user approved → executed in sandbox.
TF-IDF combined scoring to select relevant skills dynamically.
Full integration of memory, skills, and tools into the chat system prompt.
Caps reflection loops, adds memory pruning, and telemetry log rotation.
Auto-extracted workflow memories and post-execution audit hooks.
Quality fixes from telemetry audit findings.
Accurate BPE counting via js-tiktoken and isolated fork sandbox for tools.
Full end-to-end verification of the dynamic tool lifecycle.
Advanced skill scoring combining keyword matches with TF-IDF cosine similarity.
Automatically saves session context as a memory note on exit.
Allows using a different model for reflection analysis.
CLI analytics dashboard with configurable time range and output formats.
| Tier | Severity | Description | Action |
|---|---|---|---|
| 0 | Info | Normal operating state | Log only |
| 1 | Warning | Deviation detected | Alert generated |
| 2 | High | Anomaly confirmed | Notification sent |
| 3 | Critical | Action required | Task queued |
| 4 | Emergency | Immediate intervention | Step-back triggered |
When a recovery action overshoots, the system steps back exactly one severity level (not to zero), applies a cooldown period, then re-evaluates. This prevents oscillation between aggressive intervention and passive monitoring.
Current queue depth per agent role
Historical success rates + hysteresis
Adjusted assignment distribution
| Script | Size | Trigger | Purpose |
|---|---|---|---|
| security-check.ps1 | 4731B | PreToolUse | Validate before any dynamic tool executes |
| subagent-quality-gate.ps1 | 6593B | SubagentStop | Enforce required report sections |
| audit-log.ps1 | 944B | PostToolUse | Audit logging (file + stdin input) |
| session-start.ps1 | 1053B | SessionStart | Initialize session state |
| session-end.ps1 | 498B | SessionEnd | Cleanup + AWM extraction |
Long-context skill: .github/skills/recursive-long-context.skill.md (5054B) — manages context window when output exceeds limits.
| Protocol | Status | Phase | Transport | Notes |
|---|---|---|---|---|
| Mock | ✅ Full | 15 | In-process | Testing and simulation |
| MQTT | ✅ Full | 16 | TCP/TLS | IoT standard, broker-based |
| Serial (UART) | ✅ Full | 17 | RS-232/USB | Legacy + industrial devices |
| BLE | ✅ Full | 18 | Bluetooth LE | Low-energy sensors |
| Zigbee | ✅ Full | 20 | 802.15.4 | Mesh sensor networks |
| ROS2 | ✅ Full | 22 | DDS | Robotics integration |
| Matter | ✅ Full | 35 | IPv6 + Thread | Smart home standard |
| Thread | ✅ Full | 37 | 802.15.4 | Matter transport mesh |
| Z-Wave | ✅ Full | 38 | Sub-GHz RF | Home automation protocol |
| KNX | ✅ Full | 39 | IP/TP | Building automation |
| USB-HID | ✅ Full | 39 | USB | Human interface devices |
| Shared Mesh Driver | ✅ Full | 37 | All above | Unified driver abstraction |
Single-machine safety: When LIKU_CLUSTER_DIR is unset, all cluster coordination paths are bypassed. Single-machine behavior is byte-compatible and unchanged.
Matter commissioning depth + Thread/Z-Wave/KNX/USB-HID via shared mesh-driver-factory + lease-aware health
1. All high-risk paths: proposal → explicit human confirmation
2. No new autonomous actuation paths
3. Everything feature-flagged (default OFF)
4. HIL (Human-in-the-Loop) fully isolated
5. Single-machine behavior byte-compatible when LIKU_CLUSTER_DIR unset
6. Default cognitive fragment must stay 262 BPE
7. Prefer simplest correct design reusing existing primitives
| Level | Examples | Verification |
|---|---|---|
| Standard | Read file, search, list | Automatic |
| High-Risk | Write file, execute command | Focus verification + confirmation |
| Critical | Delete, system config, financial action | Double confirmation + audit log |
After any window/focus change: verify active process before sending keys. Prevents keystroke injection into wrong windows.
| Action | Status |
|---|---|
| DOM order-entry | BLOCKED |
| Position management | BLOCKED |
| Chart observation | ALLOWED |
| Pine Editor workflows | ALLOWED |
| Constraint | Value |
|---|---|
| Execution | child_process.fork() |
| Timeout | 5.5s SIGKILL |
| Patterns | 16 banned patterns |
| Environment | Stripped (NODE_ENV: 'sandbox' + PATH only) |
| Approval | User must explicitly approve before execution |
-
contextIsolation: true— renderer cannot access Node APIs -
nodeIntegration: false— disabled in all renderers -
CSP: default-src 'self'— strict Content Security Policy - No remote content — all UI served from local files
- No bundled secrets — API keys via env vars or runtime input only
| Parameter | Default | Location |
|---|---|---|
| MAX_NOTES | 500 | memory-store.js |
| MAX_REFLECTION_ITERATIONS | 2 | ai-service.js |
| Token budget/skill | 1500 | skill-router.js |
| Max skills/call | 3 | skill-router.js |
| Telemetry rotation | 10 MB | telemetry-writer.js |
| Sandbox timeout | 5500ms | sandbox-worker.js |
| 262 BPE fragment | INVARIANT | system-prompt.js |
| LIKU_CLUSTER_DIR | unset | env |
| Phase | Name | Test Script | Key Capability |
|---|---|---|---|
| CLI Phase 01 | Feature Flags | test-cli-github-command.js | Feature flag system, command seam, project guard |
| GitHub Phase 2 | Read-Only + PR Feedback | test-github-readonly.js | Read issues, PRs, feedback commands |
| GitHub Phase 3 | Capability Policy | test-capability-policy.js | Capability gates before write operations |
| Phase 4 Bridge | Plan Builder | test-github-plan-builder.js | Plan builder for multi-step workflows |
| Phase 4 Executor | Plan Executor | test-github-plan-executor.js | Execute planned GitHub actions |
| Phase 5 Bundles | Context Bundles | test-github-context-bundle.js | Context bundle aggregation |
| Phase 7 Writes | PR Writes | test-github-write-preview-apply.js | Create PR, comment, review, codeowners |
| Phase 8 | Workflow Integration | test-github-workflow-*.js | GitHub Actions interaction |
| Phase 9 | Extended Readonly | (multiple) | Read-only hardening |
| Phase 9b | CODEOWNERS | test-github-codeowners-preview-apply.js | CODEOWNERS preview/apply |
| Phase 10a | Webhooks | test-github-webhook-preview-apply.js | Webhook preview/apply |
| Phase 10b | Event Runtime | test-github-event-runtime.js | Runtime event handling |
| Phase 10c | Run Ledger | test-github-plan-ledger.js | Plan ledger tracking |
All GitHub write operations use the preview/apply pattern. The agent always shows a diff preview before applying any change. No write executes without explicit human approval.
| Command | Description |
|---|---|
| /github | GitHub integration status |
| /gh-status | Repository status |
| /gh-issues | List/search issues |
| /gh-pr | List/search pull requests |
| /gh-create-pr | Create PR (preview/apply) |
| /gh-comment | Add comment (preview/apply) |
| /gh-review | Submit review (preview/apply) |
| /gh-codeowners | CODEOWNERS preview/apply |
| /gh-webhook | Webhook management |
| /gh-workflow | Workflow interaction |
Electron-based transparent overlay with grid modes, inspection, and tray integration.
Coarse 100px
25px cells
Bounding boxes
Passive mode is click-through transparent. Escape returns to passive.
| Shortcut | Action |
|---|---|
| Ctrl+Shift+Space | Toggle overlay (Passive ↔ Selection) |
| Ctrl+Shift+G | Toggle fine grid |
| Ctrl+Shift+I | Toggle inspect mode |
| Ctrl+Shift+C | Open chat window |
| Escape | Return to passive mode |
Starts in POLLING, promotes to EVENT_MODE on native host availability, degrades on errors.
| Channel | Direction | Payload |
|---|---|---|
| overlay:mode | Main → Renderer | { mode: 'passive' | 'selection' | 'fine' | 'inspect' } |
| overlay:click | Renderer → Main | { x: number, y: number, cell: string } |
| chat:message | Bidirectional | { role: string, content: string } |
| uia:result | Main → Renderer | { elements: UIAElement[], timestamp: number } |
| tray:action | Main → Main | { action: string } |
| Feature | Windows | macOS | Linux |
|---|---|---|---|
| Click-through | Native | Native | X11 only |
| Tray icon | ✅ | ✅ | ✅ |
| UIA inspect | Full | ✗ | ✗ |
| Global shortcuts | ✅ | ✅ | Partial |
| Command | Description | Key Flags |
|---|---|---|
| liku start | Launch Electron visual overlay | --no-overlay |
| liku doctor | System diagnostics & health check | --json |
| liku chat | Headless AI chat session | --model, --provider |
| liku click | Click at screen coordinates | --x, --y, --double |
| liku find | Find UI element via UIA | --name, --type, --json |
| liku type | Type text via keyboard simulation | --text, --delay |
| liku keys | Send keyboard shortcuts | --combo |
| liku screenshot | Capture screen region | --region, --output |
| liku verify-hash | Verify file integrity hash | --file, --expected |
| liku verify-stable | Verify UI stability | --retries, --interval |
| liku window | Window management operations | --title, --action |
| liku mouse | Mouse movement control | --x, --y |
| liku drag | Drag from point A to B | --from, --to |
| liku scroll | Scroll mouse wheel | --direction, --amount |
| liku wait | Wait for condition or timeout | --ms, --for |
| liku repl | Interactive REPL session | — |
| liku agent | Multi-agent orchestration | --plan-only, --autonomous |
| liku memory | Memory store operations | --list, --search, --clear |
| liku skills | Skill router management | --list, --add, --remove |
| liku tools | Dynamic tool management | --list, --approve, --quarantine |
| liku analytics | Telemetry & analytics dashboard | --days, --raw, --json |
| Command | Description |
|---|---|
| /login | Authenticate with GitHub |
| /logout | Clear authentication |
| /model | Switch AI model |
| /provider | Switch AI provider |
| /setkey | Set API key for provider |
| /status | Show session status |
| /state | Inspect cognitive state |
| /vision | Toggle vision mode |
| /capture | Capture screen for vision |
| /memory | Memory store operations |
| /skills | List/manage skills |
| /tools | List/manage dynamic tools |
| /rmodel | Set reasoning model |
| /clear | Clear chat history |
| /help | Show slash command help |
Electron + CLI
Transparent BrowserWindow
Chat BrowserWindow
.NET 9 / PowerShell
Path: src/native/windows-uia/
- Program.cs + build.ps1
- Still ships for compatibility
| Layer | Measure |
|---|---|
| contextIsolation | Enabled — renderer cannot access Node APIs |
| Preload bridge | Whitelisted IPC channels only |
| CSP | Strict Content Security Policy |
| nodeIntegration | Disabled in all renderers |
| No bundled secrets | API keys via env vars only |
| Metric | Target | Measured |
|---|---|---|
| Cold startup | < 3s | ~2.1s |
| Memory (idle) | < 300MB | ~180MB |
| CPU (idle) | < 0.5% | ~0.1% |
| npm tarball | ~196KB | 196KB |
| Variable | Description | Default |
|---|---|---|
| GH_TOKEN | GitHub personal access token | — |
| GITHUB_TOKEN | Alternative GitHub token | — |
| OPENAI_API_KEY | OpenAI provider API key | — |
| ANTHROPIC_API_KEY | Anthropic provider API key | — |
| LIKU_MODEL | Default AI model | Provider default |
| LIKU_PROVIDER | Default AI provider | openai |
| LIKU_LOG_LEVEL | Logging verbosity | info |
| LIKU_CLUSTER_DIR | Cross-host coordination dir | unset |
All feature flags default to OFF. Enable via environment variable or preferences.json. This is a non-negotiable safety constraint.
| Script | Description |
|---|---|
| npm run smoke | Command system smoke test |
| npm run smoke:shortcuts | Keyboard shortcut validation |
| npm run smoke:chat-direct | Direct chat flow test |
| npm run smoke:live-peripherals | Live peripheral device smoke |
| npm run smoke:tradingview-live | Live TradingView smoke (~95KB) |
| Script | Description |
|---|---|
| npm test | Main test grid |
| npm run test:ui | UI automation baseline |
| npm run test:ai-focused | AI-focused test suite (7 scripts) |
| npm run test:persistence-controls | Persistence + memory + proof trace (7 scripts) |
| Script | Phase |
|---|---|
| npm run test:cli-phase01 | CLI Feature Flags |
| npm run test:github-phase2 | Read-Only + PR Feedback |
| npm run test:github-phase3 | Capability Policy |
| npm run test:github-phase4-bridge | Plan Builder |
| npm run test:github-phase4-executor | Plan Executor |
| npm run test:github-phase5-bundles | Context Bundles |
| npm run test:github-phase7-writes | PR Writes |
| npm run test:github-phase8-workflows | Workflow Integration |
| npm run test:github-phase9-readonly | Extended Readonly |
| npm run test:github-phase9b-codeowners | CODEOWNERS |
| npm run test:github-phase10a-webhooks | Webhooks |
| npm run test:github-phase10b-event-runtime | Event Runtime |
| npm run test:github-phase10c-run-ledger | Run Ledger |
12+ CI/CD workflow files for testing, validation, release, and issue management.
| File | Trigger | Purpose | Size |
|---|---|---|---|
| release.yml | tag push | Build and publish npm package | 5215B |
| package.yml | push | Package validation | 1286B |
| test.yml | push / PR | Run test suite | 853B |
| validate.yml | push / PR | Validate package structure | 837B |
| policy.yml | push / PR | Workflow policy enforcement | 1503B |
| triage-issues.yml | issue opened | Auto-triage new issues | 928B |
| close-invalid.yml | issue / PR | Close invalid submissions | 911B |
| close-single-word-issues.yml | issue opened | Close single-word titles | 1338B |
| feature-request-comment.yml | issue labeled | Comment on feature requests | 1028B |
| no-response.yml | scheduled | Close stale issues | 1305B |
| stale-issues.yml | scheduled | Mark stale | 848B |
| on-issue-close.yml | issue closed | Post-close actions | 423B |
- src/cli/, src/main/, src/shared/, src/renderer/, src/assets/
- src/native/windows-uia/ + windows-uia-dotnet/
- scripts/start.js, scripts/postinstall.js
- README.md, LICENSE.md, QUICKSTART.md, INSTALLATION.md
Follows semver. Currently at v0.0.16 (public preview). Pre-1.0 — breaking changes may occur.
| Branch | Purpose | Merges To |
|---|---|---|
| main | Production releases | — |
| develop | Integration branch | main |
| feature/* | New features | develop |
| fix/* | Bug fixes | develop |
Priority order: Accuracy > Clarity > Consistency. Never sacrifice accuracy for readability.
-
Tests pass:
npm test -
Smoke tests pass:
npm run smoke:shortcuts -
Package validates:
npm run verify:package - No secrets committed
- 262 BPE invariant verified (if system prompt changed)
- CHANGELOG updated
2026 · Ambient Intelligence OS
- Phase 40: Full pairing parity across all protocols + cross-host coordination GA
- Phase 37–39: Matter commissioning, Thread/Z-Wave/KNX/USB-HID, fleet snapshots, degradation alerts
- Phase 35: Matter protocol support via shared mesh-driver-factory
- Phase 22: ROS2 robotics integration
- Phase 20: Zigbee mesh sensor networks
- Phase 15–19: PAL foundation — Mock, MQTT, Serial, BLE drivers
- GitHub Integration Phases 1–10c complete
- Multi-agent hook enforcement system (7 agents)
- Chat Continuity + Proof Trace systems
- Dual UIA host support (.NET 9)
- 40+ npm scripts across 8 categories
- 262 BPE cognitive fragment invariant
Cognitive Layer Expansion
- Phases 10–14 cognitive layer additions
- Analytics CLI command
- TradingView modernization backlog
Multi-Agent Foundation
- 7-agent pipeline architecture
- Agent definition files (.agent.md)
- Hook enforcement scripts
Liku — Ambient Intelligence OS · v0.0.16 · Phase 40 · MIT License
Made by Copilot
- v0.0.14 → v0.0.16 (version correction)
- Single UIA host → Dual hosts documented
- Phase 15–40 Three Pillars (now documented)
- GitHub Integration (Phases 1–10c)
- Chat Continuity + Proof-Trace systems
- TradingView Launch Pipeline
- 40+ npm scripts documentation
- GitHub Actions Workflows page
- Release Process page
- agent_state.json, 7 agent .md files, 5 hook scripts
- Phase 15–40 detail: Grok handoff as source-of-truth; repo Markdown may lag code
- 262 BPE count: Preserved from handoff; not independently verified against live system-prompt.js
- Protocol phase numbers: Approximate from Grok handoff; exact commits not verified
- self-heal-status.json schema: Illustrative; exact fields not verified in source
- DCP token lifecycle: Described from handoff; exact API not verified
- Cluster coordination: LIKU_CLUSTER_DIR confirmed from handoff; implementation not independently verified