Expand description
Independent, object-safe capability shapes for staged command migration.
FEAT-014 publishes these interfaces without implementing them for the TUI
or changing an existing command. Later work adopts them inside
codewhale-tui one command group at a time. Only after every group uses
these shapes will groups move physically into a commands crate.
Re-exports§
pub use crate::config_policy::CommandConfigStatusContext;pub use crate::config_policy::CommandPermissionsContext;pub use debug_receipts::*;
Modules§
- debug_
receipts - Receipt output data, moved from the shared receipt builder without schema changes. The builder stays host-owned; CLI, API and slash commands share these shapes.
Structs§
- Command
Approval State - Host approval posture for the
/restoretrust gate (D4: no MODE_POLICY). - Conversation
Export Projection - Full conversation projection (D3/D8/D9).
- Debug
Balance Projection - Only the provider identity and support decision consumed by
/balance. The adapter derives support from the authoritative provider policy; the portable handler decides whether to emitFetchBalanceor the original text. - Debug
Bounded List - Debug
Bounded String - Debug
Cache Control - Debug
Cache Inspection Observation - One coherent observation, including previous inspection before any write. Inspect errors occur before this value exists and never update session state.
- Debug
Cache Rates - Prompt-cache hit rates, each labelled by whose requests it covers (#6565).
- Debug
Cache Telemetry - Shared source for
/cache [count|stats|zones]branches. One host read preserves ring order, optional telemetry and prefix stability evidence. - Debug
Cache Turn - A bounded turn row. Pricing class partition and amount come from the authoritative host, not a second implementation of provider billing. Missing telemetry, missing audit and a measured zero remain distinct.
- Debug
Change Projection - Debug
Conversation Undo - Prepared conversation-only undo: display cells to remove after Engine acknowledgement, and the conversation to install as its history.
- Debug
Cost Projection - Already-authoritative monetary values and bounded route attribution. Calculation and price/source selection stay with the TUI host; formatting, ordering and coverage wording belong to the portable handlers.
- Debug
Count Only - Debug
Prompt Context - The prompt-json shape retains known/unknown state and full ordered tool fields, not an opaque pre-rendered JSON string from the host.
- Debug
Prompt Context Section - Debug
Prompt Inspection - Debug
Prompt Layer - A cache inspection’s semantic layer, retaining the same public JSON field order as the baseline without borrowing the client request type.
- Debug
Prompt Source Map - Debug
Prompt Tool - Only the schema field is arbitrary structured JSON, as on the live tool catalog. Optional transport fields retain the core Tool’s omission rules.
- Debug
Restored File - Debug
Route Cost - Debug
Source Entry - Debug
System Projection - Only the data read by the
/systemrenderer, with the host’s mode label. - Debug
Token Projection - Published usage telemetry remains optional: absence is not zero.
- Debug
Tool Projection - Debug
Tool Result Inspection - Debug
Tool Snapshot - One frozen prepared-request snapshot; no registry or client reference.
- Debug
Turn Meta Inspection - Debug
Turn Stop Diagnostics - Precise, terminal facts: every optional counter retains unknown vs zero.
- Debug
Undo Restored - Debug
Warmup Key - Full key fields are needed for the existing comparison and JSON report; the short hash is computed by the authoritative host hashing function.
- Export
Message - One projected authoritative message (D3).
- Export
Metadata - Portable conversation metadata for the export header (D3).
- Hosted
Work Target /remote-env openhosted-work target. The URL is fully encoded host-side (the portable handler must not depend onurlencoding); repo/branch echo the raw values used by the baseline message replacements.- Media
Attachment Receipt - Portable receipt for a successful atomic media attachment (FEAT-018 D4). Carries only the information needed for the existing confirmation text.
- Memory
Delete - Zero-field success value for delete operations (D2): the handler already owns the selected scope and needs no additional success data.
- Memory
Export - Portable export payload — the exported memory document itself, never a preformatted command response.
- Memory
Hit - Portable semantic hit for a native-memory search or get result.
- Memory
Reindex - Portable reindex entry count.
- Memory
Remembered - Portable result of a successful remember operation.
- Memory
Status - Portable native-memory location summary (status operation).
- Plan
Sections - Semantic plan snapshot fields consumed by
/relay. Values are the raw snapshot values; the handler applies the baseline trim/empty filtering and label composition so ordering and spacing stay byte-identical. - Plan
Step - One semantic plan checklist item.
- Plugin
Detail - Portable full bundle detail for show/review/validate rendering (FEAT-020 D2).
- Plugin
Diagnostic - Portable plugin diagnostic entry.
- Plugin
DshPreview - Portable review of a DeepSeek Harness bundle package before import: what converts, what is skipped, the authority it will request, and the content hash an exact install of the same package stages.
- Plugin
Export Receipt - Portable bundle export receipt (FEAT-020 D2).
- Plugin
Legacy Scan - Portable legacy-tool scan result: directory, discovered tools, and load diagnostics for scripts that asked for something the loader ignored.
- Plugin
Legacy Tool - Portable legacy executable-tool detail (FEAT-020 D2).
- Plugin
Managed Candidate - Portable Kimi managed-plugin candidate (FEAT-020 D2).
- Plugin
Managed Scan - Portable Kimi managed-scan result (FEAT-020 D2).
- Plugin
Marketplace AddReceipt - Portable marketplace add receipt (FEAT-020 D2).
- Plugin
Marketplace Candidate - Portable marketplace candidate (FEAT-020 D2).
- Plugin
Marketplace Catalog - Portable marketplace catalog (FEAT-020 D2).
- Plugin
Marketplace State - Portable marketplace state: stored catalogs plus an optional host-provided
built-in
officialcatalog. - Plugin
McpServer Detail - Portable MCP server detail for the capability review body (FEAT-020 D2).
- Plugin
Mutation Receipt - Portable mutation receipt returned synchronously by the facet (FEAT-020 D11).
- Plugin
Suggestion - Portable suggestion for the
/plugin suggestrecommendation output. - Plugin
Suggestion Dismissals - Plugins hidden from proactive suggestions (plugin policy rule 9). Names are lowercase; each list is sorted.
- Plugin
Summary - Portable summary of one loaded plugin bundle (list output, FEAT-020 D2).
- Project
Goal State - Portable goal projection (FEAT-021 D1).
- Relay
Projection /relaysemantic snapshot (D4). The handler composes the byte-identical instruction from these deterministic fields;crate::prompts,crate::todo_snapshot, goal/todo/plan machinery, Work-state objects, and locks stay host-side.- Remote
Link /rc linkstructured link data.- Remote
Skill Entry - One curated remote registry entry (
/skills --remote). - Remote
Start Info /rc startwording input: the active-turn copy is used while a turn is loading or a dispatch is in flight.- Restore
Snapshot - One snapshot projected to semantic fields (D8).
- Resume
Import Receipt - Portable
/resumeimport receipt. The handler rendersImported foreign session as {truncated_id} ({entry_count} entries, leaf {leaf_display}), and carriessyncso the engine adopts the imported conversation instead of staying on the previous one. - Session
Archive Receipt /sessions archive|unarchive|restoresuccess projection. The handler rendersArchived session {id} ({title})orRestored session ...from the verb it dispatched.- Session
Branch Outcome /branchsuccess projection (session/branch.rs). The handler composes the exact success line from these deterministic fields.- Session
Fork From Receipt /fork <session_id|prefix>success projection. Explicit-source forks always report their spawn depth, so the contract makes that field required rather than permitting an invalid missing-depth state.- Session
Fork Receipt /forksuccess projection for an active-conversation fork. The handler composesForked session {parent} -> {fork}from these required fields.- Session
NewReceipt /newsuccess projection. The handler rendersStarted new session {truncated_id} (New Session). Previous sessions remain available via /resume.- Session
Save Receipt /savesuccess projection. The host performs the full baseline sequence (snapshot, serialization, atomic write, metadata application, work-state publication); the handler rendersSession saved to {display_path} (ID: {truncated_id}).- Session
Sync Payload - Portable synchronization fields carried by shared session and debug actions. Conversation and prompt types are protocol-owned shapes; concrete runtime state and host action conversion remain outside the command contract.
- Session
Title Receipt /renamesuccess receipt; the title is the sanitized persisted value so the handler echoes exactly what was written.- Skill
Activation Outcome - Successful skill activation data (host performs the side effects).
- Skill
Entry - One discovered skill entry (portable).
- Skill
Mutation Receipt - Synchronous portable receipt for a skill mutation (FEAT-020 D11 mirror): the host owns the async network bridge; the handler renders the receipt byte-identically from these values.
- Skill
Recommendation - Remote recommendation for
/skills suggest <task>. - Skill
Registry Projection - Portable projection of the host skill registry (discovery, D1).
- Snapshot
Entry - One snapshot entry for
/restorelistings. - Structcopy
Gate - Structcopy
Path Roots - Host observations only. Root eligibility, sorting and labels are command policy, and remain portable. Canonicalization failure is ordinary absence.
- Structcopy
Plan - Structcopy
Plan Item - Structcopy
Tool Pair - Structcopy
Tool Result - Structcopy
Transcript - Structcopy
Usage - Structcopy
Workflow - Typed form of the existing bounded workflow summary projection. It carries no raw journal events, owner IDs, paths, or executable runtime state.
- Title
Report - Bare
/titlestatus projection (Window title: [{effective}]{source}). - Tool
Caller Projection - One tool-call caller projection (D3). Only the fields the baseline export renders cross the boundary.
- Turn
Handoff Projection - Turn-handoff projection (D2).
Enums§
- Command
Mode Selection - Outcome of a
/modeselection (mirrors the hostSettingSelection). - Debug
Activation Reason - Debug
Cache Inspection Unavailable - Debug
Counting Confidence - Debug
Diff Observation - Debug
Evidence - Debug
Prompt Layer Stability - Debug
Provider Availability - Debug
Receipt Error - Debug
Restore Action - Debug
Source Kind - Debug
System Prompt - Source text consumed by
/system; retain Text/Blocks/None separately so the portable handler alone owns the separators and empty-state text. - Debug
Tool Provenance - Debug
Tool Visibility - Debug
Turn Outcome Status - Debug
Turn Stop Reason - Debug
Undo Outcome - Export
Block - One projected content block (D3/D9).
- History
Entry - One projected visible-history fallback entry (D3).
- Memory
Delete Scope - Typed delete scope for the non-workspace delete method (D8/D9).
- Memory
GetOutcome - Portable get outcome: found hit or explicit not-found.
- Memory
Import Outcome - Portable import outcome: imported (with destination) or skipped.
- Memory
Remember Target - Typed remember target (D9): the handler resolves workspace identity through the workspace facet and passes the resulting typed ID here.
- Plan
Projection - Plan-state distinction for the relay snapshot.
Busyreproduces the baselinetry_lockfailure branch;Absentreproduces an empty snapshot. - Plan
Step Status - Portable plan-step status. The adapter maps the TUI plan status onto this
semantic enum; the command handler remains the sole owner of the exact
pending/in_progress/completedlabels. - Plugin
Diagnostic Level - Portable plugin diagnostic level (FEAT-020 D2).
- Plugin
Marketplace Install Plan - Portable marketplace candidate install plan (FEAT-020 D2).
- Plugin
McpTransport - Portable MCP transport classification for the capability review body.
- Plugin
Mutation Outcome - Portable outcome of a plugin mutation (FEAT-020 D2/D11).
- Project
Goal Status - Portable goal status for the project facet (FEAT-021 D1).
- Remote
Open Outcome /rc openoutcome. Browser launch stays synchronous and single-attempt; no deferred external-URL action is produced (D6).- Remote
Registry Outcome - Remote registry fetch outcome (
/skills --remote, suggest source). - Restore
Point Projection - Restore-point projection with distinct baseline states (D3/D8).
- Resume
Source /resumeroute resolution (D6). The host resolves argument shape and performs container imports atomically; the handler selects the exact baseline message/action per variant.- Review
Outcome /reviewoutcome data (host performs the side effects).- Skill
Activation Error - Activation failures with the exact data the handler renders.
- Skill
Bundled Tier - Curated product tier for bundled (shipped) skills.
- Skill
Mutation Outcome - Portable mutation outcome mirroring the host receipt variants.
- Skill
Source Kind - Source provenance of a discovered skill (native file vs reviewed plugin snapshot).
- Skill
Sync Entry - Per-skill outcome of
/skills sync. - Skill
Sync Outcome - Aggregate
/skills syncoutcome. - Skill
Target Scope - Target scope for skill mutations (
/skill install|update|uninstall|trust). - Structcopy
Block - Structcopy
Content - Structcopy
Error - Structcopy
Execution Status - Structcopy
Plan Status - Structcopy
Transport - Structcopy
Workflow Status - Title
Source - Todo
Projection - To-do state distinction for the relay snapshot. The rendered body (if any) is produced host-side from the authoritative graph-backed snapshot seam.
- Transcript
Projection - Transcript source precedence (D3): authoritative API messages when present, otherwise the sanitized visible-history fallback.
- Tree
Body Projection /treebody projection. The body rendering source (journal tree and linear transcript) stays TUI-owned; the handler appends the exact guidance lines (D5).
Traits§
- Command
Cost Context - Cost display and accounting operations.
- Command
Debug Change Context - Command
Debug Diagnostics Context - Narrow, synchronous data boundary for the debug diagnostics slice.
- Command
Debug Diff Context - Command
Debug History Context - Command
Debug Receipts Context - Command
Debug Undo Context - Command
Media Context - Atomic composer/media capability (FEAT-018 D4).
- Command
Memory Context - Host memory data for the memory command group (FEAT-019 D1).
- Command
Mode Policy Context - Operating mode, approval posture, shell access, and policy lock.
- Command
Model Context - Model selection, provider identity, and fallback chain.
- Command
Plugin Context - Host plugin data for the plugin command group (FEAT-020 D1).
- Command
Presentation Context - Stable-key translation with named replacements (FEAT-018 D3).
- Command
Project Context - Host project data for the project command group (FEAT-021 D1).
- Command
Session Context - Session identity, messages, queue operations, and token totals.
- Command
Session Control Context - Control authority for the session command slice (FEAT-024 D2/D5).
- Command
Session Export Context - Session-export authority for the
/exportslice (FEAT-025 D1-D9). - Command
Session Lifecycle Context - Lifecycle authority for the session command slice (FEAT-023 D2).
- Command
Session Structcopy Context - Exact authority for
/structcopy, independent of session export/recovery. Observations do not mutate the session. Clipboard is the sole side effect; the caller chooses it only after successful rendering and never for stdout. - Command
Skill Group Context - Host skill data for the skills command group (FEAT-022 D1).
- Command
Skills Context - Active skill identity and skill-cache refresh.
- Command
System Prompt Context - Read access to the effective system prompt.
- Command
Workspace Context - Workspace path, bounded work-state observations and confined anchor storage.