Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
0a70ced
Strip mayros- prefix from plugin entry hints to match manifest IDs
ApiliumDevTeam Mar 2, 2026
4fe6887
Fix CI: skip Android playstore without keystore, increase Discord tes…
ApiliumDevTeam Mar 2, 2026
9577dff
Merge remote-tracking branch 'origin/main'
ApiliumDevTeam Mar 2, 2026
8584422
Merge remote-tracking branch 'origin/main'
ApiliumDevTeam Mar 2, 2026
3cb9588
Exclude .claude/RULES.md from version control
ApiliumDevTeam Mar 3, 2026
edd1511
Fix extension import paths and dependency declarations
ApiliumDevTeam Mar 3, 2026
e5d2008
Replace process.exit with defaultRuntime.exit in CLI modules
ApiliumDevTeam Mar 3, 2026
1c3e6ec
Fix CLI command registration: pass argv explicitly, use allSettled
ApiliumDevTeam Mar 3, 2026
6586dcb
Extract lightweight-commands constants and add primary subcommand guard
ApiliumDevTeam Mar 3, 2026
193d6f3
Fix hardcoded gateway port in SSH tunnel hint
ApiliumDevTeam Mar 3, 2026
0f2e25a
Add resetBannerEmittedForTest helper
ApiliumDevTeam Mar 3, 2026
cbfe9a9
Fix agent-events state cleanup and add missing test reset
ApiliumDevTeam Mar 3, 2026
2809ef7
Replace as any with proper type cast in skill-loader
ApiliumDevTeam Mar 3, 2026
a41fb59
Add injection detection patterns and variant test coverage
ApiliumDevTeam Mar 3, 2026
2886cee
Batch delegation context queries and pre-fetch parent text for dedup
ApiliumDevTeam Mar 3, 2026
32898b1
Fix conflict resolution with companion triples in knowledge fusion
ApiliumDevTeam Mar 3, 2026
75ac488
Fix ACL grant to use system grantor in shared namespace creation
ApiliumDevTeam Mar 3, 2026
44d2bbd
Fix agent-mesh: typed hooks, hardened tools, bounded message log
ApiliumDevTeam Mar 3, 2026
14e9b98
Rewrite semantic-observability hooks to use typed event fields
ApiliumDevTeam Mar 3, 2026
55c0414
Remove unnecessary as Record casts in extension hook handlers
ApiliumDevTeam Mar 3, 2026
d57660c
Add missing bash state reset in commands gating test
ApiliumDevTeam Mar 3, 2026
4fb8587
Fix residual gaps: typed hooks, security hardening, CLI testability (#8)
ApiliumDevTeam Mar 3, 2026
df10186
Add skills field to PluginHookBeforeAgentStartEvent and wire call site
ApiliumDevTeam Mar 3, 2026
efc4124
Use typed event.skills in semantic-skills and skill-hub hooks
ApiliumDevTeam Mar 3, 2026
a923152
Add missing return after defaultRuntime.exit in gateway-cli/run.ts
ApiliumDevTeam Mar 3, 2026
ad48ee1
Replace hardcoded 18789 with DEFAULT_GATEWAY_PORT constant
ApiliumDevTeam Mar 3, 2026
594cc7a
Use defaultRuntime.error and drop unused argv param in register.subclis
ApiliumDevTeam Mar 3, 2026
b9b33ef
Thread normalized argv through build-program, preaction, and help
ApiliumDevTeam Mar 3, 2026
3f9d454
Remove as Record mutation casts in register.invoke.ts
ApiliumDevTeam Mar 3, 2026
c2dd86b
Exclude docs/evolution/ from version control
ApiliumDevTeam Mar 3, 2026
0d928cc
Fix residual gaps: typed hooks, CLI hardening, extension safety (Rond…
ApiliumDevTeam Mar 3, 2026
017a86d
Add markdown slash commands with TUI integration
ApiliumDevTeam Mar 3, 2026
a4264dc
Add markdown agent definitions with agent-scope integration
ApiliumDevTeam Mar 3, 2026
f715c38
Add session-scoped audit trail to semantic-observability
ApiliumDevTeam Mar 3, 2026
0d9aa9a
Add mayros trace and mayros plan built-in CLI subcommands
ApiliumDevTeam Mar 3, 2026
5b369e2
Add code-indexer extension with regex scanner
ApiliumDevTeam Mar 3, 2026
81cc5f8
Add incremental indexing and code_index_query tool
ApiliumDevTeam Mar 3, 2026
bf82ea0
Add code-indexer tests
ApiliumDevTeam Mar 3, 2026
635d645
Add project memory types and tools
ApiliumDevTeam Mar 3, 2026
325fc7a
Add smart compaction with structured knowledge extraction
ApiliumDevTeam Mar 3, 2026
ca33e91
Add mayros kg built-in CLI
ApiliumDevTeam Mar 3, 2026
cef3529
Bump memory-semantic to v0.3.0
ApiliumDevTeam Mar 3, 2026
3c7f0a4
Add git worktree manager
ApiliumDevTeam Mar 3, 2026
c7890d3
Add team manager with Cortex-backed state tracking
ApiliumDevTeam Mar 3, 2026
60a4411
Add workflow orchestrator with built-in workflow definitions
ApiliumDevTeam Mar 3, 2026
e623d8d
Add mesh tools and team CLI enhancements
ApiliumDevTeam Mar 3, 2026
b1d1d66
Add mayros workflow built-in CLI
ApiliumDevTeam Mar 3, 2026
6e62b92
Bump agent-mesh to v0.4.0
ApiliumDevTeam Mar 3, 2026
655c491
Add missing edge-case tests for team manager and workflow orchestrator
ApiliumDevTeam Mar 3, 2026
7b837e6
Add bash sandbox extension
ApiliumDevTeam Mar 3, 2026
b5ac262
Add interactive permissions extension
ApiliumDevTeam Mar 3, 2026
9662a46
Add LLM hooks extension
ApiliumDevTeam Mar 3, 2026
344e77d
Add MCP client extension
ApiliumDevTeam Mar 3, 2026
7b14a7c
Add skill marketplace enhancements
ApiliumDevTeam Mar 3, 2026
af038ba
Add VSCode extension package
ApiliumDevTeam Mar 3, 2026
e5757c0
Add tools workspace to pnpm configuration
ApiliumDevTeam Mar 3, 2026
4d491ec
Bump Phase 4 extensions to v0.5.0
ApiliumDevTeam Mar 3, 2026
d7eb5bf
Fix Phase 4 gaps: assets, CSS, esbuild config, MCP CLI
ApiliumDevTeam Mar 3, 2026
2c6e2f9
Add Cortex persistence to dependency audit and update checker
ApiliumDevTeam Mar 3, 2026
71f3f46
Add rules engine with Cortex-backed hierarchical scoping
ApiliumDevTeam Mar 3, 2026
5e4a2c1
Add agent persistent memory via Cortex triples
ApiliumDevTeam Mar 3, 2026
fe8298a
Add contextual awareness notifications and plugin integration
ApiliumDevTeam Mar 3, 2026
57d232b
Fix Phase 5 gaps: before_tool_call hook and per-agent memory check
ApiliumDevTeam Mar 3, 2026
c797290
Add headless CLI flag parsing for -p/--prompt
ApiliumDevTeam Mar 3, 2026
4cea256
Implement headless CLI runner with streaming output
ApiliumDevTeam Mar 3, 2026
bd16db2
Add agent mailbox with Cortex persistence
ApiliumDevTeam Mar 3, 2026
8a3f57a
Add mailbox CLI with list/read/send/archive/stats subcommands
ApiliumDevTeam Mar 3, 2026
bd9f624
Add team dashboard aggregation layer
ApiliumDevTeam Mar 3, 2026
25e827e
Add dashboard CLI with team/summary/agent subcommands
ApiliumDevTeam Mar 3, 2026
e8b9f11
Add session fork/rewind with Cortex persistence
ApiliumDevTeam Mar 3, 2026
6a8db8b
Add session fork/rewind CLI
ApiliumDevTeam Mar 3, 2026
247f912
Add background agent tracker with Cortex persistence
ApiliumDevTeam Mar 3, 2026
031b9f8
Add tasks CLI for background agent management
ApiliumDevTeam Mar 3, 2026
046e275
Add mayros doctor diagnostic CLI
ApiliumDevTeam Mar 3, 2026
75a720b
Add CI/CD plugin config and provider types
ApiliumDevTeam Mar 3, 2026
1b6206a
Add GitHub CI/CD provider
ApiliumDevTeam Mar 3, 2026
958f111
Add GitLab CI/CD provider
ApiliumDevTeam Mar 3, 2026
b540469
Add CI/CD plugin with Cortex registry and CLI
ApiliumDevTeam Mar 3, 2026
aaed696
Add MCP image content bridge
ApiliumDevTeam Mar 3, 2026
da8b60d
Add LSP bridge protocol and server manager
ApiliumDevTeam Mar 3, 2026
afb5000
Add LSP bridge plugin with Cortex backend and CLI
ApiliumDevTeam Mar 3, 2026
83f42c2
Fix test mocking patterns for CI providers and LSP server manager
ApiliumDevTeam Mar 3, 2026
a1894cb
Add configurable theme system with dark/light/high-contrast presets
ApiliumDevTeam Mar 4, 2026
3c4b44a
Add keybinding customization via ui.keybindings config
ApiliumDevTeam Mar 4, 2026
ed134e5
Add @ file mentions with Code Indexer symbol enrichment
ApiliumDevTeam Mar 4, 2026
d72965b
Add interactive diff viewer with /diff command
ApiliumDevTeam Mar 4, 2026
532d942
Add context window visualization with /context command
ApiliumDevTeam Mar 4, 2026
7d293d4
Add output styles with /style command for explanatory and learning modes
ApiliumDevTeam Mar 4, 2026
c944641
Add vim editing mode for TUI editor with normal/insert modes
ApiliumDevTeam Mar 4, 2026
1367d84
Add HTTP hook dispatcher with webhook delivery and HMAC signatures
ApiliumDevTeam Mar 4, 2026
570876c
Add async hook queue with concurrency, retry, and dead-letter support
ApiliumDevTeam Mar 4, 2026
53a3ba5
Add permission_request, notification, teammate_idle, task_completed, …
ApiliumDevTeam Mar 4, 2026
2822de2
Wire new hook events into agent-mesh, config write, and internal hooks
ApiliumDevTeam Mar 4, 2026
e5ed35e
Add permission mode, fast mode, copy, and export TUI commands
ApiliumDevTeam Mar 4, 2026
abb7477
Fix pre-existing TypeScript errors and failing config validation tests
ApiliumDevTeam Mar 4, 2026
0e6d294
Add MCP server setup to onboarding wizard
ApiliumDevTeam Mar 4, 2026
db37152
Add mayros code command as primary interactive entry point
ApiliumDevTeam Mar 4, 2026
6c3fe3a
Add first-run onboarding gate and ecosystem slash commands
ApiliumDevTeam Mar 4, 2026
94450ec
Add batch prompt processing CLI with parallel execution
ApiliumDevTeam Mar 4, 2026
691c315
Add session teleport for cross-device session transfer
ApiliumDevTeam Mar 4, 2026
b12c389
Add cortex-sync extension for cross-device knowledge replication
ApiliumDevTeam Mar 4, 2026
2b05024
Add MAYROS.md ingestion, listTriplesSince, and onboarding sync step
ApiliumDevTeam Mar 4, 2026
45f8ed9
Add JetBrains IDE plugin scaffold with WebSocket client and chat panel
ApiliumDevTeam Mar 4, 2026
a444cf5
Add JetBrains plugin tree views, editor actions, and gutter provider
ApiliumDevTeam Mar 4, 2026
dbee911
Fix cortex-sync plugin to match registerTool and hook API signatures
ApiliumDevTeam Mar 4, 2026
01d7e93
Fix critical bugs found in audit across all new features
ApiliumDevTeam Mar 4, 2026
18a700d
Fix event listener leak in JetBrains panels and slugify collision risk
ApiliumDevTeam Mar 4, 2026
41b49e9
Fix ingestion fallthrough, thread safety, transcript size, and test i…
ApiliumDevTeam Mar 4, 2026
17d751d
Harden design and optimization issues across batch, teleport, sync, a…
ApiliumDevTeam Mar 4, 2026
b6bb2d0
Fix timer leak in sync timeout, stats filter, panel disposal, and tri…
ApiliumDevTeam Mar 4, 2026
91c6a78
Bump version to 0.1.4 and sync all extensions
ApiliumDevTeam Mar 4, 2026
369ebaa
Add missing plugin manifest for cortex-sync extension
ApiliumDevTeam Mar 4, 2026
1ed4bac
Set IDE plugins to v0.1.0 for initial release
ApiliumDevTeam Mar 4, 2026
6420647
Add Gradle wrapper and fix Java target compatibility for JetBrains pl…
ApiliumDevTeam Mar 4, 2026
1fe96f7
Add context menu actions, gutter markers, and protocol v3 to VSCode e…
ApiliumDevTeam Mar 5, 2026
8abd3f5
Add unified tabbed panel, Skills/Plan/KG views, and protocol v3 to Je…
ApiliumDevTeam Mar 5, 2026
914ac87
Rename dashboard and doctor CLIs, update build config
ApiliumDevTeam Mar 5, 2026
c9619df
Add heartbeat filtering, interactive selectors, and command cleanup
ApiliumDevTeam Mar 5, 2026
e08ab0e
Add welcome screen, image paste, and onboarding UX
ApiliumDevTeam Mar 5, 2026
995b78b
Remove unused imports flagged by linter
ApiliumDevTeam Mar 5, 2026
b51c8d5
Bump hono, @hono/node-server, and dompurify for security fixes
ApiliumDevTeam Mar 5, 2026
b01d2ce
Add .vscode/ to gitignore to prevent token leakage
ApiliumDevTeam Mar 5, 2026
50c8c6d
Update README with CLI Evolution features, add .vscodeignore
ApiliumDevTeam Mar 5, 2026
39e90d3
CLI Evolution Phase 1: TUI, IDE plugins, KG, mesh, plan, extensions (…
ApiliumDevTeam Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,22 @@ USER.md
# Claude Code project instructions (local only)
CLAUDE.md
**/CLAUDE.md

.claude/RULES.md

docs/evolution/

# JetBrains plugin build artifacts
tools/jetbrains-plugin/.gradle/
tools/jetbrains-plugin/build/

# VSCode extension build artifacts
tools/vscode-extension/dist/
tools/vscode-extension/*.vsix
tools/vscode-extension/.claude/

tools/PUBLISHING.md
docs/internal/

# IDE workspace settings (may contain tokens)
.vscode/
169 changes: 169 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# MAYROS v0.1.0 — Project Instructions

## Project Info

- **Product**: [apilium.com/us/products/mayros](https://apilium.com/us/products/mayros)
- **Download**: [mayros.apilium.com](https://mayros.apilium.com)
- **Documentation**: [apilium.com/us/doc/mayros](https://apilium.com/us/doc/mayros)
- **Repo (public)**: [github.com/ApiliumCode/mayros](https://github.com/ApiliumCode/mayros)
- **Repo (dev)**: `/Users/carlostovar/repositorios/apilium/maryosCode`
- **AIngle**: [github.com/ApiliumCode/aingle](https://github.com/ApiliumCode/aingle)
- **Skills Hub**: [github.com/ApiliumCode/skills-hub](https://github.com/ApiliumCode/skills-hub)

## Repository Structure

```
src/ # Core: CLI, commands, infra, media, agents
extensions/ # Plugin extensions (38 packages)
semantic-skills/ # Semantic skill SDK, 6 tools, sandbox
sandbox/ # QuickJS WASM sandbox (quickjs-sandbox, marshal, transpiler)
agent-mesh/ # Multi-agent coordination, delegation, fusion
skill-hub/ # Apilium Hub marketplace, Ed25519 signing
memory-semantic/ # AIngle Cortex integration
semantic-observability/ # Trace emitter, decision graph
token-economy/ # Budget tracking, prompt cache
shared/ # CortexClient, cortex-config, cortex-resilience
iot-bridge/ # IoT node fleet management
skills/examples/ # 5 example skills (verify-kyc, code-review, etc.)
docs/ # Product page, architecture docs
```

## Build & Test

- Runtime: **Node >= 22**, pnpm 10.23.0
- Install: `pnpm install`
- Build: `pnpm build`
- Tests: `pnpm test` (vitest) — 9205 tests, 1035 files
- Type check: `pnpm tsgo` or `npx tsc --noEmit`
- Sync extension versions: `pnpm plugins:sync` (reads root package.json)

## Coding Conventions

- TypeScript ESM, strict typing, no `any`
- Plugin SDK: `@sinclair/typebox` for params, manual config validation (not Zod)
- Tests: colocated `*.test.ts`, vitest
- Product name: **Mayros** (headings), `mayros` (CLI, paths, config)
- Extensions: keep plugin deps in extension `package.json`, not root

## Security Architecture (18 layers)

### Sandbox (Phase 7)

Skills run in **QuickJS WASM** (`quickjs-emscripten@0.31.0`). The sandbox exposes only 7 host functions:

- `graphClient`: createTriple, listTriples, patternQuery, deleteTriple
- `logger`: info, warn, error

**No access to**: fs, net, process, require, import, fetch, setTimeout, Worker, eval (harmless in WASM).

Config: `extensions/semantic-skills/config.ts` — `SkillSandboxConfig`

- `sandboxEnabled` (default: true) — false requires `MAYROS_UNSAFE_DIRECT_LOAD=1`
- `memoryLimitBytes` (1MB–256MB, default 8MB)
- `maxStackSizeBytes` (64KB–8MB, default 512KB)
- `executionTimeoutMs` (100–60000, default 10s)
- `maxCallsPerMinute` (1–1000, default 60)

### Static Scanner (`src/security/skill-scanner.ts`)

16 rules (12 line + 4 source):

- dangerous-exec, dynamic-code-execution, crypto-mining, suspicious-network
- semantic-unbounded-query, semantic-unproven-assertion
- bracket-property-exec, dynamic-require, global-this-access, process-env-bracket, dynamic-import
- potential-exfiltration, obfuscated-code (hex + base64), env-harvesting

**Anti-evasion preprocessing** (H5):

- `stripComments()` — preserves string literals, strips // and /\* \*/
- `joinSplitStatements()` — tracks parens balance across lines (catches `eval\n(...)`)
- `countNetParens()` — skips parens inside string literals

### Enrichment Sanitizer (`extensions/semantic-skills/enrichment-sanitizer.ts`)

- **Unicode normalization** (C3): NFC + homoglyph map (Cyrillic/Greek→ASCII) + zero-width strip + fullwidth collapse
- **8 injection patterns**: ignore/disregard previous, you are/act as, system:override, execute the following, new instructions, important: you must, curl/wget/bash, rm -rf
- **Depth limits**: MAX_DEPTH=4, MAX_ARRAY_LENGTH=50, MAX_STRING_LENGTH=512, MAX_ENRICHMENT_CHARS=4096
- **Output**: wrapped in `<skill-enrichment type="data">` tags

### Namespace Isolation

- `enforceNsPrefix()` in index.ts — ALL queries forced to `${ns}:` prefix
- scope:"global" is capped to own namespace (no cross-namespace)
- scope:"agent" → `${ns}:agent:${agentId}`
- Sandbox graphClient enforces ns prefix on createTriple/deleteTriple/listTriples/patternQuery
- `skill_memory_context` scopes subject to `${ns}:` + defense-in-depth filter

### Tool Allowlist

- **Intersection model**: ALL active skills must allow a tool (not just any one)
- Default: `DEFAULT_ALLOWED_TOOLS` (9 safe tools) applied when manifest omits allowedTools
- `["*"]` escape hatch for unrestricted access
- 6 core semantic tools always allowed

### Rate Limiter

- `SkillRateLimiter` class — sliding window (1-minute) per skill
- Applied to: `skill_graph_query`, `skill_assert`, `skill_memory_context`
- Default: 60 calls/min, configurable via `maxCallsPerMinute`

### Query & Write Limits

- Per-skill query counter (`queryCountPerSkill` Map)
- `maxQueries` per manifest + global cap = maxGraphQueries x activeSkillCount
- Write limits per sandbox (createTriple/deleteTriple)
- `checkWriteLimit()` in QuickJS sandbox

### Enrichment Timeout

- `invokeQuery()` wrapped in `Promise.race()` with 2s timeout (C5)
- Prevents DoS via slow enrichment

### Hot-Reload Security

- **Atomic swap** (H6): build temp maps → clear → swap
- **Manifest validation** (H7): `validateManifest()` on reload
- **Downgrade block**: rejects if `allowedTools` removed from original
- **Diff logging**: `diffManifests()` logs changes to allowedTools, permissions, assertions, maxQueries

### Other Controls

- Path traversal: reject `..` + `isPathInside()` double-check
- Verify-then-promote: temp extract → verify hashes → atomic promote
- Circuit breaker: 3-state (closed/open/half-open) + exponential backoff
- Audit logging: skill name + operation tagged on all sandbox writes
- No default AssertionEngine: `skill_assert` / `skill_verify_assertion` fail without declared engine
- Per-request skill tracking: `resolveCurrentSkill()` round-robin for multi-skill

## Versioning

- Mayros: **v0.1.0** (package.json + 38 extensions synced)
- Cortex: aingle_cortex **0.2.6** (`REQUIRED_CORTEX_VERSION`)
- Crates: aingle 0.0.101, zome_types 0.0.4
- Sync versions: update root `package.json` → `pnpm plugins:sync`
- Release: `git tag v0.1.0 && git push origin v0.1.0`

## Key Files

| File | Purpose |
| ------------------------------------------------------- | ------------------------------------------------------------------------ |
| `extensions/semantic-skills/index.ts` | Plugin entry: 6 tools, 3 hooks, CLI, rate limiter, namespace enforcement |
| `extensions/semantic-skills/config.ts` | SkillSandboxConfig, VerificationConfig, clampInt |
| `extensions/semantic-skills/sandbox/quickjs-sandbox.ts` | QuickJS WASM sandbox core |
| `extensions/semantic-skills/enrichment-sanitizer.ts` | Injection detection + Unicode normalization |
| `extensions/semantic-skills/skill-loader.ts` | Sandbox/direct loading, scan gate, enrichment sanitization |
| `extensions/semantic-skills/skill-manifest.ts` | Manifest parsing, DEFAULT_ALLOWED_TOOLS, validation |
| `extensions/semantic-skills/permission-resolver.ts` | Tool allowlist, permission checking |
| `src/security/skill-scanner.ts` | 16-rule scanner + preprocessing |
| `extensions/shared/cortex-client.ts` | Unified CortexClient, DTOs |
| `extensions/shared/cortex-resilience.ts` | CircuitBreaker + resilientFetch |

## Translations (i18n)

| Language | Dir | Status |
| --------------- | ------------- | --------------------------------- |
| Chinese (zh-CN) | `docs/zh-CN/` | **Complete** |
| Spanish (es) | `docs/es/` | Pending — full translation needed |
| Japanese (ja) | `docs/ja/` | Pending — full translation needed |
| Korean (ko) | `docs/ko/` | Pending — full translation needed |
| Hindi (hi) | `docs/hi/` | Pending — full translation needed |
160 changes: 160 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,77 @@ Run `mayros doctor` to surface risky/misconfigured DM policies.
- **[First-class tools](https://apilium.com/en/doc/mayros/tools)** — browser, canvas, nodes, cron, sessions, and Discord/Slack actions.
- **[Companion apps](https://apilium.com/en/doc/mayros/platforms/macos)** — macOS menu bar app + iOS/Android [nodes](https://apilium.com/en/doc/mayros/nodes).
- **[Onboarding](https://apilium.com/en/doc/mayros/start/wizard) + [skills](https://apilium.com/en/doc/mayros/tools/skills)** — wizard-driven setup with bundled/managed/workspace skills.
- **Terminal UI** — interactive TUI with themes, vim mode, image paste, slash commands.
- **IDE plugins** — VSCode + JetBrains extensions connected via Gateway WebSocket.
- **Knowledge Graph** — project memory, code indexer, cross-session recall via Cortex.
- **Multi-agent mesh** — teams, workflows, agent mailbox, background tasks.
- **Semantic plan mode** — explore, assert, approve, execute with Cortex backing.
- **50+ extensions** — security sandbox, permissions, MCP client, observability, 17 channels.

## Terminal UI

Mayros includes an interactive terminal interface for direct coding and conversation.

**Entry points:**

- `mayros code` — main interactive TUI session
- `mayros tui` — alias for `mayros code`
- `mayros -p "query"` — headless mode (non-interactive, streams response to stdout)

**Features:**

- Welcome screen with shield mascot and two-column info panel
- 3 themes (dark, light, high-contrast) — switch with `/theme`
- 3 output styles (standard, explanatory, learning) — switch with `/style`
- Vim mode with motions, operators, and undo — toggle with `/vim`
- `Ctrl+V` image paste from clipboard
- `/copy` pipes last response to system clipboard; `/export [file]` writes to file
- `/diff` inline diff viewer with stats
- `/context` token usage bar chart
- `/plan` semantic plan mode (Cortex-backed)

**Key slash commands:**

| Command | Description |
| ---------------- | --------------------------- |
| `/help` | List all available commands |
| `/new`, `/reset` | Reset session |
| `/compact` | Compact session context |
| `/think <level>` | Set thinking level |
| `/model <name>` | Switch model |
| `/plan` | Enter semantic plan mode |
| `/diff` | Show pending changes |
| `/context` | Visualize token usage |
| `/theme` | Cycle themes |
| `/style` | Cycle output styles |
| `/vim` | Toggle vim mode |
| `/copy` | Copy last response |
| `/export [file]` | Export session |
| `/permission` | Set permission mode |
| `/fast` | Toggle fast mode |

**Markdown-driven extensibility:**

- Custom agents: `~/.mayros/agents/*.md` — define persona, tools, and behavior in markdown
- Custom commands: `~/.mayros/commands/*.md` — define slash commands as markdown templates
- Interactive selectors when commands run without required arguments

## IDE Plugins

Mayros provides IDE extensions that connect to the running Gateway via WebSocket.

**VSCode** (`tools/vscode-extension/`):

- Sidebar tree views: sessions, agents, skills
- Webview panels: chat, plan mode, trace viewer, knowledge graph
- Context menu actions and gutter markers

**JetBrains** (`tools/jetbrains-plugin/`):

- Unified tabbed panel with the same feature set
- Protocol v3 compatibility

Both plugins connect via WebSocket to `ws://127.0.0.1:18789` (the Gateway).

## Semantic Memory (AIngle Cortex)

Expand All @@ -132,6 +203,74 @@ Key design points:

Cortex version: **aingle_cortex 0.2.6** · AIngle crate: **0.0.101** · Zome types: **0.0.4**

## Knowledge Graph & Code Indexer

The code indexer scans your codebase and maps it to RDF triples stored in Cortex. Combined with project memory, this gives the assistant deep, persistent understanding of your project.

- **Code indexer** — scans source files → RDF triples in Cortex (incremental, only re-indexes changed files)
- **Project memory** — persists conventions, findings, and architecture decisions across sessions
- **Smart compaction** — extracts key information before context pruning so nothing important is lost
- **Cross-session recall** — injects relevant knowledge from previous sessions into new prompts

CLI: `mayros kg search|explore|query|stats|triples|namespaces|export|import`

## Multi-Agent Mesh

Mayros supports coordinated multi-agent workflows where agents can form teams, delegate work, and communicate asynchronously.

- **Team manager** — Cortex-backed lifecycle: create, assign roles, disband
- **Workflow orchestrator** — built-in workflow definitions (code-review, research, refactor) + custom definitions via registry
- **Agent mailbox** — persistent inter-agent messaging (send/inbox/outbox/archive)
- **Background task tracker** — track long-running agent tasks with status and cancellation
- **Git worktree isolation** — each agent can work in its own worktree to avoid conflicts

CLI: `mayros workflow run|list`, `mayros dashboard team|summary|agent`, `mayros tasks list|status|cancel|summary`, `mayros mailbox list|read|send|archive|stats`

## Plan Mode

Cortex-backed semantic planning for complex multi-step tasks.

- **Explore** — gather context from the codebase and Cortex graph
- **Assert** — declare facts and constraints the plan must satisfy
- **Approve** — review the plan before execution
- **Execute** — run the approved plan with progress tracking

CLI: `mayros plan start|explore|assert|show|approve|execute|done|list|status`
TUI: `/plan` slash command

## Extensions Ecosystem

Mayros ships with 50+ extensions organized by category:

| Category | Extension | Purpose |
| ------------- | ------------------------- | ------------------------------------------------------------------------- |
| Skills | `semantic-skills` | QuickJS WASM sandbox, 6 semantic tools, skill marketplace |
| Agents | `agent-mesh` | Teams, workflows, delegation, mailbox, background tasks |
| Memory | `memory-semantic` | Cortex integration, rules engine, agent memory, contextual awareness |
| Observability | `semantic-observability` | Traces, decision graph, session fork/rewind |
| Indexer | `code-indexer` | Codebase scanning + RDF mapping (incremental) |
| Security | `bash-sandbox` | Command parsing, domain checker, blocklist, audit log |
| Permissions | `interactive-permissions` | Runtime permission dialogs, intent classification, policy store |
| Hooks | `llm-hooks` | Markdown-defined hook evaluation with safe condition parser |
| MCP | `mcp-client` | Model Context Protocol client (stdio, SSE, WebSocket, HTTP transports) |
| Economy | `token-economy` | Budget tracking, prompt cache optimization |
| Hub | `skill-hub` | Apilium Hub marketplace, Ed25519 signing, dependency audit |
| IoT | `iot-bridge` | IoT node fleet management |
| Channels | 17 channel plugins | Discord, Telegram, WhatsApp, Slack, Signal, iMessage, Teams, Matrix, etc. |

Extensions live in `extensions/` and are loaded as plugins at startup.

## Hooks System

Mayros exposes 29 hook types across the assistant lifecycle:

- **Lifecycle hooks** — `before_prompt_build`, `after_response`, `before_compaction`, `agent_end`, etc.
- **Security hooks** — `permission_request` (modifying: allow/deny/ask), `config_change`
- **Coordination hooks** — `teammate_idle`, `task_completed`, `notification` (info/warn/error)
- **HTTP webhook dispatcher** — POST delivery with HMAC-SHA256 signatures, retry + exponential backoff
- **Async hook queue** — background execution with concurrency limits and dead-letter queue
- **Markdown-defined hooks** — place `.md` files in `~/.mayros/hooks/` for custom hook logic

## Everything we built so far

### Core platform
Expand Down Expand Up @@ -176,6 +315,23 @@ Cortex version: **aingle_cortex 0.2.6** · AIngle crate: **0.0.101** · Zome typ
- [Docker](https://apilium.com/en/doc/mayros/install/docker)-based installs.
- [Doctor](https://apilium.com/en/doc/mayros/gateway/doctor) migrations, [logging](https://apilium.com/en/doc/mayros/logging).

### Developer tools

- Terminal UI (`mayros code`) with themes, vim mode, slash commands, image paste, and headless mode (`mayros -p`).
- VSCode and JetBrains IDE plugins connected via Gateway WebSocket.
- Trace CLI (`mayros trace`), plan CLI (`mayros plan`), knowledge graph CLI (`mayros kg`).

### Agent coordination

- Teams, workflows, agent mailbox, background task tracker.
- Session fork/rewind for checkpoint-based exploration.
- Rules engine with hierarchical Cortex-backed rules.
- Agent persistent memory and contextual awareness notifications.

### Security layers

- 18-layer security architecture: QuickJS WASM sandbox, static scanner (16 rules), enrichment sanitizer, bash sandbox, interactive permissions, namespace isolation, tool allowlist (intersection model), rate limiter, query/write limits, enrichment timeout, hot-reload validation, path traversal protection, verify-then-promote, circuit breaker, audit logging, and more.

## How it works (short)

```
Expand All @@ -188,6 +344,8 @@ WhatsApp / Telegram / Slack / Discord / Google Chat / Signal / iMessage / BlueBu
│ ws://127.0.0.1:18789 │
└──────────────┬────────────────┘
├─ TUI (mayros code)
├─ VSCode / JetBrains
├─ Pi agent (RPC)
├─ CLI (mayros …)
├─ WebChat UI
Expand Down Expand Up @@ -263,6 +421,8 @@ Skills Hub is a minimal skill registry. With Skills Hub enabled, the agent can s

## Chat commands

The Terminal UI (`mayros code`) supports 30+ slash commands — run `/help` for the full list.

Send these in WhatsApp/Telegram/Slack/Google Chat/Microsoft Teams/WebChat (group commands are owner-only):

- `/status` — compact session status (model + tokens, cost when available)
Expand Down
Loading
Loading