feat: add TormentNexus extension crate with full Pi extension parity#4086
feat: add TormentNexus extension crate with full Pi extension parity#4086robertpelloni wants to merge 3 commits into
Conversation
Introduces codewhale-extension — a generic runtime extension system for CodeWhale that mirrors the Pi Coding Agent's ExtensionAPI pattern. Extension trait with 12 lifecycle hooks: - SessionStart, BeforeAgentStart, ToolCall, ToolResult - TurnEnd, Input, UserBash, ModelSelect - SessionBeforeCompact, SessionCompact, SessionShutdown Extensions can also register: - MCP servers via mcp_servers() - Slash commands via slash_commands() - Keyboard shortcuts via shortcuts() - Custom tools via tools() Includes ExtensionManager for registration + dispatch, and generic McpServerDef, SlashCommandDef, ShortcutDef, ToolDef types. Also fixes Ctrl+Up/Down keybinding to scroll by 1 line.
…(hooks, tools, commands, shortcuts, L2 memory, RBAC)
|
Thanks @robertpelloni for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
|
wow cool - this is a great idea - let me work to get this in! |
|
Roadmap triage: this PR is now in the v0.9.3 milestone and is design input for #4399. Before merge, its native extension, input mutation, sidecar network, MCP registration, tools/commands/shortcuts, and memory hooks should be reviewed against the trust-vs-enablement and declared-capability contract there. Related startup/skills plumbing: #3916 and #3917. |
|
Thanks — the Where it stands: v0.9.3 milestone, and #4399's acceptance criteria require a capability/trust review of this PR before merge. Being upfront: a security-labeled new crate moves slower than provider or refactor work, deliberately. The full CI matrix has not run on this head yet. What review found, in landing order:
Suggested split: (a) the API crate shaped to #4399's capability contract; (b) an opt-in TN adapter. Authorship stays preserved either way. Generated by Claude Code |
Summary
Adds
crates/tn-extension— a native Rust extension implementing thecodewhale_extension::Extensiontrait with full parity to the TormentNexus Pi Coding Agent extension for persistent L2 memory, MCP tool discovery, skill registry, code search, RBAC, and context harvesting.Changes
7 files (+387/-1 lines):
New crate:
crates/tn-extension/Cargo.toml— depends oncodewhale-extension,serde_json,reqwest,chrono,async-traitsrc/lib.rs—TormentNexusExtensionimplementing all lifecycle hooksExtension Lifecycle Hooks
http://127.0.0.1:7778/api/memory/addrm -rf,sudo,DROP TABLE, etc.) againstPOST /api/enterprise/authorize@memory:keyinline with L2 content from TN sidecarRegistration via Extension Trait
tn_memory_store,tn_memory_search,tn_memory_vector_search,tn_tool_search,tn_session_search,tn_skill_manage,tn_code_search,tn_context_harvest,tn_scratchpad/tn-store,/tn-search,/tn-status,/tn-plan,/tn-summary,/tn-purgeCtrl+Shift+M(memory search),Ctrl+Shift+T(tool search),Ctrl+Shift+P(system status)tormentnexus.exe mcpwith envTORMENTNEXUS_WORKSPACE_ROOTWiring
crates/tui/Cargo.toml— addedcodewhale-tn-extensiondependencycrates/tui/src/core/engine.rs— registersTormentNexusExtensionintoExtensionManagerat startupCargo.toml(workspace root) — addedcrates/tn-extensionas workspace memberDependencies
reqwest(HTTP client for TN sidecar API)serde_json(JSON serialization for API payloads)chrono(RFC3339 timestamps)async-trait(async trait support for Extension)