mia-code 0.2.0 → 0.3.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.
- package/.miette/260321.md +1 -0
- package/.miette/260323.md +9 -0
- package/.miette/260331.md +2 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/2604020008--d3417f2c-df12-4f0f-8a1b-d88e7968f822/d3417f2c-df12-4f0f-8a1b-d88e7968f822.md +63 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/2604020008--e6c3fc5d-4a70-4523-ba7d-a3250da4c235/e6c3fc5d-4a70-4523-ba7d-a3250da4c235.md +72 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/2604020008--efeb00a2-b17a-4d32-b1f0-b90c37a8d24e/efeb00a2-b17a-4d32-b1f0-b90c37a8d24e.md +62 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/83a2d7f9-24a5-4cf4-98d5-036c82f872e8.json +302 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/83a2d7f9-24a5-4cf4-98d5-036c82f872e8.md +149 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/AGENTS.md +31 -0
- package/.pde/2604011511--83a2d7f9-24a5-4cf4-98d5-036c82f872e8/meta-decomposition-3-children.md +67 -0
- package/.pde/2604040129--61f9dd4d-7aa6-45e6-a58b-e480b1aa6737/61f9dd4d-7aa6-45e6-a58b-e480b1aa6737--from-mia-openclaw-workspace.md +125 -0
- package/.pde/2604040129--61f9dd4d-7aa6-45e6-a58b-e480b1aa6737/STATUS.md +1 -0
- package/.pde/4f02ba94-9f52-422e-9389-b16f9b37f358.json +177 -0
- package/.pde/4f02ba94-9f52-422e-9389-b16f9b37f358.md +77 -0
- package/.pde/6ad9244d-5340-490f-b76c-c86728b9de52.json +222 -0
- package/.pde/6ad9244d-5340-490f-b76c-c86728b9de52.md +99 -0
- package/.pde/8b566792-ed15-4606-96f9-2b6f593d7e6b.json +111 -0
- package/.pde/8b566792-ed15-4606-96f9-2b6f593d7e6b.md +67 -0
- package/.pde/c7f1e74b-05a5-40e2-9f01-4cc48d2528f7.json +349 -0
- package/.pde/c7f1e74b-05a5-40e2-9f01-4cc48d2528f7.md +147 -0
- package/.pde/dfc00a78-1da0-4c09-8a16-c6982644051b.json +118 -0
- package/.pde/dfc00a78-1da0-4c09-8a16-c6982644051b.md +64 -0
- package/GUILLAUME.md +8 -0
- package/KINSHIP.md +9 -0
- package/MIA_CODE_ARCHITECTURE_REPORT.md +718 -0
- package/contextual_research/260119-MIA-CODE--98090899-8aff-4e11-9dc3-8b99466d1.md +1101 -0
- package/contextual_research/MIA.md +38 -0
- package/contextual_research/MIAWAPASCONE.md +59 -0
- package/contextual_research/MIETTE.md +38 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/2504.00218v2.pdf +7483 -12
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/2505.00212v3.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/CONTENT.md +1014 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/DESIGN.gemini.md +242 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/INDEX.md +45 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/2504.00218v2.md +2025 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/2504.00218v2.pdf +7483 -12
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/2505.00212v3.md +1755 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/2505.00212v3.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_12_decomposed_prompting.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_19_hugginggpt_planning.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_1_coordination_challenges.md +766 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_1_coordination_challenges.pdf +3431 -4
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_28_guardrails_multi_agent.md +260 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_28_guardrails_multi_agent.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_2_navigating_complexity.md +558 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_2_navigating_complexity.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_34_hierarchical_multi_agent.pdf +0 -0
- package/contextual_research/PDE-generalization--caefee82-efb1-4dbb-8733-691b01581464--260130/sources/footnote_1_5_open_intent_extraction.pdf +0 -0
- package/contextual_research/PODCAST.md +109 -0
- package/contextual_research/langchain-principles-roadmap.md +157 -0
- package/contextual_research/persona-to-narrative-character-inquiry_260201.md +50 -0
- package/dist/cli.js +35 -11
- package/dist/geminiHeadless.js +8 -2
- package/dist/index.js +2 -1
- package/dist/mcp/miaco-server.js +10 -1
- package/dist/mcp/miatel-server.js +10 -1
- package/dist/mcp/miawa-server.js +10 -1
- package/dist/mcp/utils.d.ts +6 -1
- package/dist/mcp/utils.js +24 -3
- package/dist/sessionStore.d.ts +8 -2
- package/dist/sessionStore.js +39 -3
- package/dist/types.d.ts +1 -0
- package/miaco/README.md +124 -0
- package/miaco/dist/commands/chart.d.ts +6 -0
- package/miaco/dist/commands/chart.d.ts.map +1 -0
- package/miaco/dist/commands/chart.js +222 -0
- package/miaco/dist/commands/chart.js.map +1 -0
- package/miaco/dist/commands/decompose.d.ts +6 -0
- package/miaco/dist/commands/decompose.d.ts.map +1 -0
- package/miaco/dist/commands/decompose.js +98 -0
- package/miaco/dist/commands/decompose.js.map +1 -0
- package/miaco/dist/commands/schema.d.ts +6 -0
- package/miaco/dist/commands/schema.d.ts.map +1 -0
- package/miaco/dist/commands/schema.js +66 -0
- package/miaco/dist/commands/schema.js.map +1 -0
- package/miaco/dist/commands/stc.d.ts +11 -0
- package/miaco/dist/commands/stc.d.ts.map +1 -0
- package/miaco/dist/commands/stc.js +590 -0
- package/miaco/dist/commands/stc.js.map +1 -0
- package/miaco/dist/commands/trace.d.ts +6 -0
- package/miaco/dist/commands/trace.d.ts.map +1 -0
- package/miaco/dist/commands/trace.js +83 -0
- package/miaco/dist/commands/trace.js.map +1 -0
- package/miaco/dist/commands/validate.d.ts +6 -0
- package/miaco/dist/commands/validate.d.ts.map +1 -0
- package/miaco/dist/commands/validate.js +58 -0
- package/miaco/dist/commands/validate.js.map +1 -0
- package/miaco/dist/decompose.d.ts +93 -0
- package/miaco/dist/decompose.d.ts.map +1 -0
- package/miaco/dist/decompose.js +562 -0
- package/miaco/dist/decompose.js.map +1 -0
- package/miaco/dist/index.d.ts +18 -0
- package/miaco/dist/index.d.ts.map +1 -0
- package/miaco/dist/index.js +83 -0
- package/miaco/dist/index.js.map +1 -0
- package/miaco/dist/storage.d.ts +60 -0
- package/miaco/dist/storage.d.ts.map +1 -0
- package/miaco/dist/storage.js +100 -0
- package/miaco/dist/storage.js.map +1 -0
- package/miaco/package-lock.json +4103 -0
- package/miaco/package.json +40 -0
- package/miaco/tsconfig.json +18 -0
- package/miaco/version-patch-commit-and-publish.sh +1 -0
- package/miatel/MISSION_251231.md +3 -0
- package/miatel/README.md +107 -0
- package/miatel/dist/commands/analyze.d.ts +6 -0
- package/miatel/dist/commands/analyze.d.ts.map +1 -0
- package/miatel/dist/commands/analyze.js +100 -0
- package/miatel/dist/commands/analyze.js.map +1 -0
- package/miatel/dist/commands/arc.d.ts +6 -0
- package/miatel/dist/commands/arc.d.ts.map +1 -0
- package/miatel/dist/commands/arc.js +71 -0
- package/miatel/dist/commands/arc.js.map +1 -0
- package/miatel/dist/commands/beat.d.ts +6 -0
- package/miatel/dist/commands/beat.d.ts.map +1 -0
- package/miatel/dist/commands/beat.js +165 -0
- package/miatel/dist/commands/beat.js.map +1 -0
- package/miatel/dist/commands/theme.d.ts +6 -0
- package/miatel/dist/commands/theme.d.ts.map +1 -0
- package/miatel/dist/commands/theme.js +54 -0
- package/miatel/dist/commands/theme.js.map +1 -0
- package/miatel/dist/index.d.ts +18 -0
- package/miatel/dist/index.d.ts.map +1 -0
- package/miatel/dist/index.js +80 -0
- package/miatel/dist/index.js.map +1 -0
- package/miatel/dist/storage.d.ts +55 -0
- package/miatel/dist/storage.d.ts.map +1 -0
- package/miatel/dist/storage.js +100 -0
- package/miatel/dist/storage.js.map +1 -0
- package/miatel/package-lock.json +4103 -0
- package/miatel/package.json +35 -0
- package/miatel/src/commands/analyze.ts +109 -0
- package/miatel/src/commands/arc.ts +78 -0
- package/miatel/src/commands/beat.ts +176 -0
- package/miatel/src/commands/theme.ts +60 -0
- package/miatel/src/index.ts +94 -0
- package/miatel/src/storage.ts +156 -0
- package/miatel/tsconfig.json +18 -0
- package/miawa/MISSION_251231.md +144 -0
- package/miawa/README.md +133 -0
- package/miawa/dist/commands/beat.d.ts +6 -0
- package/miawa/dist/commands/beat.d.ts.map +1 -0
- package/miawa/dist/commands/beat.js +69 -0
- package/miawa/dist/commands/beat.js.map +1 -0
- package/miawa/dist/commands/ceremony.d.ts +6 -0
- package/miawa/dist/commands/ceremony.d.ts.map +1 -0
- package/miawa/dist/commands/ceremony.js +239 -0
- package/miawa/dist/commands/ceremony.js.map +1 -0
- package/miawa/dist/commands/circle.d.ts +6 -0
- package/miawa/dist/commands/circle.d.ts.map +1 -0
- package/miawa/dist/commands/circle.js +75 -0
- package/miawa/dist/commands/circle.js.map +1 -0
- package/miawa/dist/commands/eva.d.ts +6 -0
- package/miawa/dist/commands/eva.d.ts.map +1 -0
- package/miawa/dist/commands/eva.js +73 -0
- package/miawa/dist/commands/eva.js.map +1 -0
- package/miawa/dist/commands/wound.d.ts +6 -0
- package/miawa/dist/commands/wound.d.ts.map +1 -0
- package/miawa/dist/commands/wound.js +74 -0
- package/miawa/dist/commands/wound.js.map +1 -0
- package/miawa/dist/index.d.ts +19 -0
- package/miawa/dist/index.d.ts.map +1 -0
- package/miawa/dist/index.js +91 -0
- package/miawa/dist/index.js.map +1 -0
- package/miawa/dist/storage.d.ts +73 -0
- package/miawa/dist/storage.d.ts.map +1 -0
- package/miawa/dist/storage.js +100 -0
- package/miawa/dist/storage.js.map +1 -0
- package/miawa/package-lock.json +4103 -0
- package/miawa/package.json +36 -0
- package/miawa/src/commands/beat.ts +74 -0
- package/miawa/src/commands/ceremony.ts +256 -0
- package/miawa/src/commands/circle.ts +83 -0
- package/miawa/src/commands/eva.ts +84 -0
- package/miawa/src/commands/wound.ts +79 -0
- package/miawa/src/index.ts +108 -0
- package/miawa/src/storage.ts +179 -0
- package/miawa/tsconfig.json +18 -0
- package/package.json +7 -5
- package/references/acp/CLAUDE.md +7 -0
- package/references/acp/agent-plan.md +84 -0
- package/references/acp/clients.md +31 -0
- package/references/acp/extensibility.md +137 -0
- package/references/acp/initialization.md +225 -0
- package/references/acp/prompt-turn.md +321 -0
- package/references/acp/proxy-chains.md +562 -0
- package/references/acp/schema.md +3171 -0
- package/references/acp/session-list.md +334 -0
- package/references/acp/session-modes.md +170 -0
- package/references/acp/slash-commands.md +99 -0
- package/references/acp/terminals.md +281 -0
- package/references/acp/tool-calls.md +311 -0
- package/references/acp/typescript.md +29 -0
- package/references/claude/agent-teams.md +399 -0
- package/references/claude/chrome.md +231 -0
- package/references/claude/headless.md +158 -0
- package/references/claude/hooks-guide.md +708 -0
- package/references/claude/output-styles.md +112 -0
- package/references/claude/plugins.md +432 -0
- package/references/claude/skills.md +693 -0
- package/references/claude/sub-agents.md +816 -0
- package/references/copilot/acp/agents.md +32 -0
- package/references/copilot/acp/architecture.md +37 -0
- package/references/copilot/acp/clients.md +31 -0
- package/references/copilot/acp/introduction.md +42 -0
- package/references/copilot/acp/registry.md +339 -0
- package/references/copilot/acp-server.md +117 -0
- package/references/copilot/create-copilot-instructions.md +840 -0
- package/references/langchain/llms.txt +833 -0
- package/references/langchain/python/agents.md +677 -0
- package/references/langchain/python/context-engineering.md +1195 -0
- package/references/langchain/python/human-in-the-loop.md +326 -0
- package/references/langchain/python/long-term-memory.md +168 -0
- package/references/langchain/python/mcp.md +949 -0
- package/references/langchain/python/multi-agents/custom-workflow.md +187 -0
- package/references/langchain/python/multi-agents/handoffs.md +436 -0
- package/references/langchain/python/multi-agents/overview.md +295 -0
- package/references/langchain/python/multi-agents/router.md +150 -0
- package/references/langchain/python/multi-agents/skills.md +92 -0
- package/references/langchain/python/multi-agents/subagents.md +486 -0
- package/references/langchain/python/retrieval.md +320 -0
- package/references/langchain/python/runtime.md +141 -0
- package/references/langchain/python/short-term-memory.md +658 -0
- package/references/langchain/python/structured-output.md +712 -0
- package/references/langfuse/llms.txt +148 -0
- package/references/langgraph/javascript/llms.txt +275 -0
- package/references/skills/home.md +259 -0
- package/references/skills/integrate-skills.md +103 -0
- package/references/skills/specification.md +254 -0
- package/references/skills/what-are-skills.md +74 -0
- package/rispecs/README.md +164 -0
- package/rispecs/_sync_/miadi-code/SPEC.md +313 -0
- package/rispecs/_sync_/miadi-code/STATUS.md +177 -0
- package/rispecs/_sync_/miadi-code/dashboard/SPEC.md +465 -0
- package/rispecs/_sync_/miadi-code/dashboard/STATUS.md +212 -0
- package/rispecs/_sync_/miadi-code/multiline-input/SPEC.md +232 -0
- package/rispecs/_sync_/miadi-code/multiline-input/STATUS.md +108 -0
- package/rispecs/_sync_/miadi-code/pde/SPEC.md +253 -0
- package/rispecs/_sync_/miadi-code/pde/STATUS.md +56 -0
- package/rispecs/_sync_/miadi-code/stc/SPEC.md +397 -0
- package/rispecs/_sync_/miadi-code/stc/STATUS.md +70 -0
- package/rispecs/ava-langstack/inquiry-routing-upgrade.spec.md +119 -0
- package/rispecs/borrowed_from_opencode/001-client-server-architecture.rispec.md +98 -0
- package/rispecs/borrowed_from_opencode/002-event-bus-system.rispec.md +125 -0
- package/rispecs/borrowed_from_opencode/003-instance-state-pattern.rispec.md +136 -0
- package/rispecs/borrowed_from_opencode/004-namespace-module-pattern.rispec.md +151 -0
- package/rispecs/borrowed_from_opencode/005-zod-schema-validation.rispec.md +139 -0
- package/rispecs/borrowed_from_opencode/006-named-error-system.rispec.md +155 -0
- package/rispecs/borrowed_from_opencode/007-structured-logging.rispec.md +138 -0
- package/rispecs/borrowed_from_opencode/008-lazy-initialization.rispec.md +127 -0
- package/rispecs/borrowed_from_opencode/009-multi-agent-system.rispec.md +97 -0
- package/rispecs/borrowed_from_opencode/010-agent-definition-config.rispec.md +135 -0
- package/rispecs/borrowed_from_opencode/011-agent-permission-rulesets.rispec.md +151 -0
- package/rispecs/borrowed_from_opencode/012-agent-prompt-templates.rispec.md +141 -0
- package/rispecs/borrowed_from_opencode/013-agent-generation.rispec.md +142 -0
- package/rispecs/borrowed_from_opencode/014-plan-build-mode-toggle.rispec.md +155 -0
- package/rispecs/borrowed_from_opencode/015-subagent-task-delegation.rispec.md +146 -0
- package/rispecs/borrowed_from_opencode/016-agent-model-selection.rispec.md +151 -0
- package/rispecs/borrowed_from_opencode/017-compaction-agent.rispec.md +150 -0
- package/rispecs/borrowed_from_opencode/018-session-persistence.rispec.md +125 -0
- package/rispecs/borrowed_from_opencode/019-session-compaction.rispec.md +132 -0
- package/rispecs/borrowed_from_opencode/020-session-forking.rispec.md +134 -0
- package/rispecs/borrowed_from_opencode/021-session-revert-snapshot.rispec.md +135 -0
- package/rispecs/borrowed_from_opencode/022-session-sharing.rispec.md +165 -0
- package/rispecs/borrowed_from_opencode/023-session-summary-diffs.rispec.md +165 -0
- package/rispecs/borrowed_from_opencode/024-child-sessions.rispec.md +164 -0
- package/rispecs/borrowed_from_opencode/025-session-title-generation.rispec.md +162 -0
- package/rispecs/borrowed_from_opencode/026-message-parts-model.rispec.md +201 -0
- package/rispecs/borrowed_from_opencode/027-streaming-message-deltas.rispec.md +212 -0
- package/rispecs/borrowed_from_opencode/028-multi-provider-architecture.rispec.md +184 -0
- package/rispecs/borrowed_from_opencode/029-provider-authentication.rispec.md +225 -0
- package/rispecs/borrowed_from_opencode/030-model-registry.rispec.md +222 -0
- package/rispecs/borrowed_from_opencode/031-cost-tracking.rispec.md +243 -0
- package/rispecs/borrowed_from_opencode/032-provider-transform-pipeline.rispec.md +282 -0
- package/rispecs/borrowed_from_opencode/033-provider-sdk-abstraction.rispec.md +338 -0
- package/rispecs/borrowed_from_opencode/034-tool-registry.rispec.md +110 -0
- package/rispecs/borrowed_from_opencode/035-tool-context-injection.rispec.md +155 -0
- package/rispecs/borrowed_from_opencode/036-tool-output-truncation.rispec.md +138 -0
- package/rispecs/borrowed_from_opencode/037-batch-tool.rispec.md +129 -0
- package/rispecs/borrowed_from_opencode/038-multi-edit-tool.rispec.md +167 -0
- package/rispecs/borrowed_from_opencode/039-apply-patch-tool.rispec.md +161 -0
- package/rispecs/borrowed_from_opencode/040-code-search-tool.rispec.md +143 -0
- package/rispecs/borrowed_from_opencode/041-web-fetch-tool.rispec.md +131 -0
- package/rispecs/borrowed_from_opencode/042-web-search-tool.rispec.md +159 -0
- package/rispecs/borrowed_from_opencode/043-todo-tool.rispec.md +156 -0
- package/rispecs/borrowed_from_opencode/044-plan-mode-tool.rispec.md +139 -0
- package/rispecs/borrowed_from_opencode/045-task-tool.rispec.md +146 -0
- package/rispecs/borrowed_from_opencode/046-question-tool.rispec.md +170 -0
- package/rispecs/borrowed_from_opencode/047-external-directory-tool.rispec.md +166 -0
- package/rispecs/borrowed_from_opencode/048-file-read-write-tools.rispec.md +205 -0
- package/rispecs/borrowed_from_opencode/049-lsp-server-management.rispec.md +104 -0
- package/rispecs/borrowed_from_opencode/050-lsp-hover-completion.rispec.md +102 -0
- package/rispecs/borrowed_from_opencode/051-lsp-diagnostics.rispec.md +86 -0
- package/rispecs/borrowed_from_opencode/052-lsp-root-detection.rispec.md +109 -0
- package/rispecs/borrowed_from_opencode/053-remote-mcp-servers.rispec.md +119 -0
- package/rispecs/borrowed_from_opencode/054-mcp-oauth-flow.rispec.md +107 -0
- package/rispecs/borrowed_from_opencode/055-mcp-tool-conversion.rispec.md +118 -0
- package/rispecs/borrowed_from_opencode/056-mcp-connection-monitoring.rispec.md +106 -0
- package/rispecs/borrowed_from_opencode/057-local-mcp-servers.rispec.md +116 -0
- package/rispecs/borrowed_from_opencode/058-rich-tui.rispec.md +108 -0
- package/rispecs/borrowed_from_opencode/059-streaming-display.rispec.md +116 -0
- package/rispecs/borrowed_from_opencode/060-permission-prompts.rispec.md +130 -0
- package/rispecs/borrowed_from_opencode/061-session-navigation.rispec.md +155 -0
- package/rispecs/borrowed_from_opencode/062-syntax-highlighting.rispec.md +151 -0
- package/rispecs/borrowed_from_opencode/063-keybinding-system.rispec.md +181 -0
- package/rispecs/borrowed_from_opencode/064-multi-level-config.rispec.md +155 -0
- package/rispecs/borrowed_from_opencode/065-jsonc-config.rispec.md +190 -0
- package/rispecs/borrowed_from_opencode/066-config-env-variables.rispec.md +153 -0
- package/rispecs/borrowed_from_opencode/067-config-deep-merging.rispec.md +178 -0
- package/rispecs/borrowed_from_opencode/068-remote-org-config.rispec.md +183 -0
- package/rispecs/borrowed_from_opencode/069-config-markdown-frontmatter.rispec.md +206 -0
- package/rispecs/borrowed_from_opencode/070-managed-config-directory.rispec.md +232 -0
- package/rispecs/borrowed_from_opencode/071-plugin-architecture.rispec.md +104 -0
- package/rispecs/borrowed_from_opencode/072-plugin-hooks.rispec.md +123 -0
- package/rispecs/borrowed_from_opencode/073-plugin-auto-install.rispec.md +115 -0
- package/rispecs/borrowed_from_opencode/074-permission-system.rispec.md +133 -0
- package/rispecs/borrowed_from_opencode/075-git-worktree-management.rispec.md +126 -0
- package/rispecs/borrowed_from_opencode/076-snapshot-system.rispec.md +124 -0
- package/rispecs/borrowed_from_opencode/077-snapshot-diff.rispec.md +117 -0
- package/rispecs/borrowed_from_opencode/078-snapshot-restore.rispec.md +128 -0
- package/rispecs/borrowed_from_opencode/079-worktree-branch-naming.rispec.md +122 -0
- package/rispecs/borrowed_from_opencode/080-sqlite-storage.rispec.md +134 -0
- package/rispecs/borrowed_from_opencode/081-database-migrations.rispec.md +148 -0
- package/rispecs/borrowed_from_opencode/082-database-transactions.rispec.md +138 -0
- package/rispecs/borrowed_from_opencode/083-deferred-effects.rispec.md +148 -0
- package/rispecs/borrowed_from_opencode/084-permission-rules.rispec.md +123 -0
- package/rispecs/borrowed_from_opencode/085-permission-glob-patterns.rispec.md +113 -0
- package/rispecs/borrowed_from_opencode/086-permission-merging.rispec.md +134 -0
- package/rispecs/borrowed_from_opencode/087-permission-modes.rispec.md +145 -0
- package/rispecs/borrowed_from_opencode/088-http-api-server.rispec.md +165 -0
- package/rispecs/borrowed_from_opencode/089-openapi-spec-generation.rispec.md +164 -0
- package/rispecs/borrowed_from_opencode/090-websocket-support.rispec.md +136 -0
- package/rispecs/borrowed_from_opencode/091-sse-streaming.rispec.md +168 -0
- package/rispecs/borrowed_from_opencode/092-mdns-discovery.rispec.md +145 -0
- package/rispecs/borrowed_from_opencode/093-javascript-sdk.rispec.md +200 -0
- package/rispecs/borrowed_from_opencode/094-skill-system.rispec.md +187 -0
- package/rispecs/borrowed_from_opencode/095-skill-discovery.rispec.md +182 -0
- package/rispecs/borrowed_from_opencode/096-desktop-remote-driving.rispec.md +175 -0
- package/rispecs/borrowed_from_opencode/INDEX.md +255 -0
- package/rispecs/core.rispecs.md +261 -0
- package/rispecs/engines.rispecs.md +241 -0
- package/rispecs/formatting.rispecs.md +252 -0
- package/rispecs/living-specifications.rispecs.md +361 -0
- package/rispecs/mcp.rispecs.md +197 -0
- package/rispecs/pde.rispecs.md +399 -0
- package/rispecs/pi-mono-envisionning/ENVISIONING.md +366 -0
- package/rispecs/pi-mono-envisionning/storytelling-horizon.rispecs.md +76 -0
- package/rispecs/pi-mono-envisionning/widget.rispecs.md +2 -0
- package/rispecs/relation-to-mcp-structural-thinking.kin.md +72 -0
- package/rispecs/research-for-better-framework/CLAUDE.md +7 -0
- package/rispecs/research-for-better-framework/survey-pi-openclaw-opencode-openhands.md +210 -0
- package/rispecs/session.rispecs.md +277 -0
- package/rispecs/stc.rispecs.md +138 -0
- package/rispecs/unifier.rispecs.md +317 -0
- package/scripts/LAUNCH--mcp-mia-code--testing--2603141315--ac705a66-2c15-4a1c-a26d-9491018c5ba8.sh +2 -0
- package/scripts/RESUME--mia-code--mcps--260313--ac705a66-2c15-4a1c-a26d-9491018c5ba8.sh +1 -0
- package/scripts/install-widget-in-home-pi-agent-extensions.sh +4 -0
- package/scripts/sample-decompose--2604011535-prompt.sh +1 -0
- package/skills/deep-search/AGENTS.md +17 -0
- package/skills/deep-search/SKILL.md +281 -0
- package/skills/deep-search/agent-templates.md +224 -0
- package/skills/deep-search/orchestration-patterns.md +95 -0
- package/skills/miaco-pde-inquiry-routing-deep-search/AGENTS.md +13 -0
- package/skills/miaco-pde-inquiry-routing-deep-search/SKILL.md +136 -0
- package/skills/miaco-pde-inquiry-routing-internal-external-relationship/AGENTS.md +4 -0
- package/skills/miaco-pde-inquiry-routing-internal-external-relationship/SKILL.md +157 -0
- package/skills/miaco-pde-inquiry-routing-local-qmd/AGENTS.md +42 -0
- package/skills/miaco-pde-inquiry-routing-local-qmd/SKILL.md +135 -0
- package/skills/qmd/AGENTS.md +3 -0
- package/skills/qmd/SKILL.md +144 -0
- package/skills/qmd/references/mcp-setup.md +102 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/SKILL.md +234 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/agent-templates.md +436 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/orchestration-patterns.md +197 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/references/ceremonial-technology.md +102 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/references/creative-orientation.md +99 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/references/prompt-decomposition.md +73 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/references/rise-framework.md +74 -0
- package/skills/rise-pde-inquiry-session-multi-agents-v3/references/structural-tension.md +82 -0
- package/src/cli.ts +35 -11
- package/src/geminiHeadless.ts +7 -2
- package/src/index.ts +2 -1
- package/src/mcp/miaco-server.ts +13 -1
- package/src/mcp/miatel-server.ts +13 -1
- package/src/mcp/miawa-server.ts +13 -1
- package/src/mcp/utils.ts +41 -8
- package/src/sessionStore.ts +44 -4
- package/src/types.ts +2 -1
- package/widget/mia-ceremony/README.md +36 -0
- package/widget/mia-ceremony/index.ts +143 -0
- package/widget/mia-interceptor/README.md +39 -0
- package/widget/mia-interceptor/index.ts +221 -0
- package/widget/mia-tools/README.md +37 -0
- package/widget/mia-tools/index.ts +569 -0
- package/widget/miette-echo/README.md +44 -0
- package/widget/miette-echo/index.ts +164 -0
- package/.claude/settings.local.json +0 -9
- package/.hch/issue_.env +0 -4
- package/.hch/issue_add__2601211715.json +0 -77
- package/.hch/issue_add__2601211715.md +0 -4
- package/.hch/issue_add__2602242020.json +0 -78
- package/.hch/issue_add__2602242020.md +0 -7
- package/.hch/issues.json +0 -2312
- package/.hch/issues.md +0 -30
- package/WS__mia-code__260214__IAIP_PDE.code-workspace +0 -29
- package/WS__mia-code__src332__260122.code-workspace +0 -23
- package/samples/copilot/session-state/be76abaa-a27f-4725-b2a9-22fb45f7e0f7/checkpoints/index.md +0 -6
- package/samples/copilot/session-state/be76abaa-a27f-4725-b2a9-22fb45f7e0f7/events.jsonl +0 -213
- package/samples/copilot/session-state/be76abaa-a27f-4725-b2a9-22fb45f7e0f7/plan.md +0 -243
- package/samples/copilot/session-state/be76abaa-a27f-4725-b2a9-22fb45f7e0f7/workspace.yaml +0 -5
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# mia-code Engines Specification
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification v1.0
|
|
4
|
+
> Document: mia-code/rispecs/engines.rispecs.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code enables developers to create seamless multi-engine agent workflows where the choice of underlying AI engine (Gemini or Claude) becomes a configuration concern rather than an interface barrier. Users achieve optimal tool selection for their task context while maintaining consistent ceremonial output format.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Structural Reality:**
|
|
13
|
+
- Gemini CLI and Claude CLI have different argument syntaxes and output formats
|
|
14
|
+
- YOLO/auto-approval flags differ between engines (`--yolo` vs `--dangerously-skip-permissions`)
|
|
15
|
+
- Output format handling requires engine-specific parsing
|
|
16
|
+
- System prompt support varies (Claude supports `--system-prompt`, Gemini does not)
|
|
17
|
+
|
|
18
|
+
**Desired Structural State:**
|
|
19
|
+
- Single unified interface abstracts engine differences
|
|
20
|
+
- Users specify engine preference; system handles translation
|
|
21
|
+
- Output normalization produces consistent `GeminiJsonEvent` stream
|
|
22
|
+
- Unifier layer always functions regardless of primary engine choice
|
|
23
|
+
|
|
24
|
+
## Engine Architecture
|
|
25
|
+
|
|
26
|
+
### Engine Selection Flow
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
User specifies engine preference
|
|
30
|
+
↓ (--claude, --gemini, config, or env var)
|
|
31
|
+
Config resolves engine: "gemini" | "claude"
|
|
32
|
+
↓
|
|
33
|
+
Binary selection: config.geminiBinary or config.claudeBinary
|
|
34
|
+
↓
|
|
35
|
+
Argument translation layer applies engine-specific flags
|
|
36
|
+
↓
|
|
37
|
+
Child process spawned with translated arguments
|
|
38
|
+
↓
|
|
39
|
+
Output parser normalizes events to GeminiJsonEvent format
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
### Engine Configuration
|
|
45
|
+
|
|
46
|
+
**Description:** Multi-source engine preference resolution.
|
|
47
|
+
|
|
48
|
+
**Behavior:**
|
|
49
|
+
- CLI flag highest priority: `--claude` or `--gemini`
|
|
50
|
+
- Environment variable: `MIA_CODE_ENGINE=claude`
|
|
51
|
+
- Config file: `~/.mia-code.json` → `engine` field
|
|
52
|
+
- Default fallback: `gemini`
|
|
53
|
+
|
|
54
|
+
**Resolution Order:**
|
|
55
|
+
1. CLI flag (`opts.claude` → "claude", `opts.gemini` → "gemini")
|
|
56
|
+
2. Environment variable (`process.env.MIA_CODE_ENGINE`)
|
|
57
|
+
3. Config file (`loadConfig().engine`)
|
|
58
|
+
4. Default: `"gemini"`
|
|
59
|
+
|
|
60
|
+
### Argument Translation
|
|
61
|
+
|
|
62
|
+
**Description:** Engine-specific flag transformation.
|
|
63
|
+
|
|
64
|
+
**Gemini CLI Arguments:**
|
|
65
|
+
```bash
|
|
66
|
+
gemini <prompt> \
|
|
67
|
+
--output-format stream-json \
|
|
68
|
+
--model gemini-2.5-pro \
|
|
69
|
+
--yolo \ # Auto-approval
|
|
70
|
+
--resume <sessionId>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Claude CLI Arguments:**
|
|
74
|
+
```bash
|
|
75
|
+
claude <prompt> \
|
|
76
|
+
--print \ # Non-interactive mode
|
|
77
|
+
--output-format json \ # Note: stream-json requires --verbose
|
|
78
|
+
--model sonnet \
|
|
79
|
+
--dangerously-skip-permissions \ # Auto-approval equivalent
|
|
80
|
+
--resume <sessionId>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Translation Logic:**
|
|
84
|
+
```typescript
|
|
85
|
+
const args: string[] = [prompt];
|
|
86
|
+
|
|
87
|
+
if (config.engine === "claude") {
|
|
88
|
+
args.push("--print");
|
|
89
|
+
// Claude --print with stream-json requires --verbose; use json instead
|
|
90
|
+
const outputFormat = config.headlessOutputFormat === "stream-json"
|
|
91
|
+
? "json"
|
|
92
|
+
: config.headlessOutputFormat;
|
|
93
|
+
args.push("--output-format", outputFormat);
|
|
94
|
+
} else {
|
|
95
|
+
args.push("--output-format", config.headlessOutputFormat);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (config.yoloMode) {
|
|
99
|
+
if (config.engine === "claude") {
|
|
100
|
+
args.push("--dangerously-skip-permissions");
|
|
101
|
+
} else {
|
|
102
|
+
args.push("--yolo");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Stdio Configuration
|
|
108
|
+
|
|
109
|
+
**Description:** Engine-specific stdin handling.
|
|
110
|
+
|
|
111
|
+
**Behavior:**
|
|
112
|
+
- Claude `--print` mode needs stdin closed: `stdio: ["ignore", "pipe", "pipe"]`
|
|
113
|
+
- Gemini interactive mode needs stdin open: `stdio: ["pipe", "pipe", "pipe"]`
|
|
114
|
+
|
|
115
|
+
### Output Parsing
|
|
116
|
+
|
|
117
|
+
**Description:** Normalize engine-specific output formats to unified event stream.
|
|
118
|
+
|
|
119
|
+
**Gemini stream-json:**
|
|
120
|
+
- Line-delimited JSON (JSONL)
|
|
121
|
+
- Each line is a complete `GeminiJsonEvent`
|
|
122
|
+
- Session ID in `session_id` field
|
|
123
|
+
|
|
124
|
+
**Claude json:**
|
|
125
|
+
- Single JSON object (not line-delimited)
|
|
126
|
+
- Structure: `{ type: "result", result: "text", session_id: "..." }`
|
|
127
|
+
- Requires buffering until process closes
|
|
128
|
+
|
|
129
|
+
**Normalization Logic:**
|
|
130
|
+
```typescript
|
|
131
|
+
if (isClaudeJsonMode) {
|
|
132
|
+
// Buffer entire response, parse on close
|
|
133
|
+
child.on("close", () => {
|
|
134
|
+
const obj = JSON.parse(stdoutBuf);
|
|
135
|
+
if (obj.type === "result" && obj.result) {
|
|
136
|
+
events.push({
|
|
137
|
+
type: "message",
|
|
138
|
+
role: "assistant",
|
|
139
|
+
text: obj.result,
|
|
140
|
+
session_id: obj.session_id
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
} else {
|
|
145
|
+
// Parse JSONL line-by-line
|
|
146
|
+
const lines = stdoutBuf.split("\n");
|
|
147
|
+
for (const line of lines) {
|
|
148
|
+
const evt = JSON.parse(line.trim());
|
|
149
|
+
events.push(evt);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Data
|
|
155
|
+
|
|
156
|
+
### Engine-Specific Defaults
|
|
157
|
+
|
|
158
|
+
| Setting | Gemini | Claude |
|
|
159
|
+
|---------|--------|--------|
|
|
160
|
+
| Default Model | `gemini-2.5-pro` | `sonnet` |
|
|
161
|
+
| Output Format | `stream-json` | `json` (for --print) |
|
|
162
|
+
| Auto-Approval | `--yolo` | `--dangerously-skip-permissions` |
|
|
163
|
+
| Non-Interactive | (default) | `--print` |
|
|
164
|
+
| System Prompt | Not supported | `--system-prompt` |
|
|
165
|
+
|
|
166
|
+
### Environment Variables
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
MIA_CODE_ENGINE=gemini|claude # Default engine
|
|
170
|
+
MIA_CODE_GEMINI_BIN=/path/to/gemini # Custom gemini binary
|
|
171
|
+
MIA_CODE_CLAUDE_BIN=/path/to/claude # Custom claude binary
|
|
172
|
+
MIA_CODE_MODEL=model-name # Override model
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Creative Advancement Scenarios
|
|
176
|
+
|
|
177
|
+
### Creative Advancement Scenario: Engine-Optimized Workflow
|
|
178
|
+
|
|
179
|
+
**Desired Outcome:** Developer uses Claude's reasoning for complex analysis, Gemini for fast iteration
|
|
180
|
+
|
|
181
|
+
**Current Structural Reality:** Different CLIs with different invocation patterns
|
|
182
|
+
|
|
183
|
+
**Natural Progression:**
|
|
184
|
+
1. User configures default engine via `mia-code config --set-engine gemini`
|
|
185
|
+
2. For specific tasks requiring Claude, user adds `--claude` flag
|
|
186
|
+
3. Engine translation layer handles argument differences transparently
|
|
187
|
+
4. Output normalization ensures consistent event structure
|
|
188
|
+
5. Unifier always uses Claude (system-prompt requirement)
|
|
189
|
+
|
|
190
|
+
**Achieved Outcome:** Developer optimizes engine selection per-task while maintaining consistent experience
|
|
191
|
+
|
|
192
|
+
### Creative Advancement Scenario: Auto-Approval Mode
|
|
193
|
+
|
|
194
|
+
**Desired Outcome:** Developer enables automated action approval for trusted workflows
|
|
195
|
+
|
|
196
|
+
**Current Structural Reality:** YOLO flags differ between engines
|
|
197
|
+
|
|
198
|
+
**Natural Progression:**
|
|
199
|
+
1. User specifies `--yolo` or configures `yoloMode: true`
|
|
200
|
+
2. Engine translation applies correct flag per engine
|
|
201
|
+
3. Agent executes without approval prompts
|
|
202
|
+
4. Actions complete faster with reduced interaction friction
|
|
203
|
+
|
|
204
|
+
**Achieved Outcome:** Trusted workflows execute without interruption regardless of engine choice
|
|
205
|
+
|
|
206
|
+
## Supporting Structures
|
|
207
|
+
|
|
208
|
+
### Unifier Engine Constraint
|
|
209
|
+
|
|
210
|
+
**Why Claude for Unifier?**
|
|
211
|
+
The unifier session always uses Claude because:
|
|
212
|
+
- Gemini CLI lacks `--system-prompt` flag
|
|
213
|
+
- Without it, system instructions leak into output
|
|
214
|
+
- Claude's `--system-prompt` keeps ceremonial instructions separate from response
|
|
215
|
+
|
|
216
|
+
**Implementation:**
|
|
217
|
+
```typescript
|
|
218
|
+
// Unifier always uses Claude
|
|
219
|
+
const binary = config.claudeBinary;
|
|
220
|
+
const args = [
|
|
221
|
+
sessionSummary,
|
|
222
|
+
"--print",
|
|
223
|
+
"--dangerously-skip-permissions",
|
|
224
|
+
"--output-format", "json",
|
|
225
|
+
"--system-prompt", UNIFIER_SYSTEM_PROMPT,
|
|
226
|
+
"--model", config.model.includes("gemini") ? "sonnet" : config.model
|
|
227
|
+
];
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Advancing Patterns
|
|
231
|
+
|
|
232
|
+
1. **Engine Abstraction:** Single interface hides implementation differences
|
|
233
|
+
2. **Model Auto-Mapping:** Engine change auto-selects appropriate default model
|
|
234
|
+
3. **Output Normalization:** Consistent event structure regardless of source
|
|
235
|
+
4. **Unifier Independence:** Ceremonial layer functions with any primary engine
|
|
236
|
+
|
|
237
|
+
## Implementation Reference
|
|
238
|
+
|
|
239
|
+
- **Engine Wrapper:** `src/geminiHeadless.ts` - `runGeminiHeadless()`, `streamGemini()`
|
|
240
|
+
- **Config Resolution:** `src/config.ts` - Engine and binary path defaults
|
|
241
|
+
- **CLI Options:** `src/index.ts` - `--claude`, `--gemini` flags
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# mia-code Formatting Specification
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification v1.0
|
|
4
|
+
> Document: mia-code/rispecs/formatting.rispecs.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code enables developers to create readable, aesthetically consistent terminal output that reduces cognitive load. Users achieve immediate understanding of session state, errors, and results through carefully designed visual hierarchy using chalk-based styling.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Structural Reality:**
|
|
13
|
+
- Terminal output is plain text without visual hierarchy
|
|
14
|
+
- Errors, success, and information blend together
|
|
15
|
+
- Session metadata competes with primary content for attention
|
|
16
|
+
- Agent response boundaries are unclear
|
|
17
|
+
|
|
18
|
+
**Desired Structural State:**
|
|
19
|
+
- Clear visual hierarchy separates metadata from content
|
|
20
|
+
- Errors immediately visible through color and symbols
|
|
21
|
+
- Success confirmations provide positive feedback
|
|
22
|
+
- Ceremonial output (🧠/🌸) stands out as primary content
|
|
23
|
+
|
|
24
|
+
## Formatting Architecture
|
|
25
|
+
|
|
26
|
+
### Color Semantics
|
|
27
|
+
|
|
28
|
+
| Element | Color | Chalk Function | Symbol |
|
|
29
|
+
|---------|-------|----------------|--------|
|
|
30
|
+
| User prompt | Yellow | `chalk.yellow()` | `you>` |
|
|
31
|
+
| Session metadata | Dim | `chalk.dim()` | - |
|
|
32
|
+
| Agent header | Green bold | `chalk.green.bold()` | 🧠🌸 |
|
|
33
|
+
| Error | Red | `chalk.red()` | ❌ |
|
|
34
|
+
| Success | Green | `chalk.green()` | ✓ |
|
|
35
|
+
| Warning | Yellow | `chalk.yellow()` | ⚠ |
|
|
36
|
+
| Tool events | Magenta | `chalk.magenta()` | 🔧/✓ |
|
|
37
|
+
| Processing | Dim | `chalk.dim()` | ⏳ |
|
|
38
|
+
|
|
39
|
+
## Components
|
|
40
|
+
|
|
41
|
+
### Event Renderer
|
|
42
|
+
|
|
43
|
+
**Description:** Transforms `GeminiJsonEvent[]` into formatted terminal output.
|
|
44
|
+
|
|
45
|
+
**Behavior:**
|
|
46
|
+
- Consolidates consecutive assistant messages
|
|
47
|
+
- Applies event-type-specific formatting
|
|
48
|
+
- Supports compact mode for minimal output
|
|
49
|
+
- Optional tool event and timestamp display
|
|
50
|
+
|
|
51
|
+
**Implementation:**
|
|
52
|
+
```typescript
|
|
53
|
+
function renderEventsToText(
|
|
54
|
+
events: GeminiJsonEvent[],
|
|
55
|
+
opts: RenderOptions = {}
|
|
56
|
+
): string {
|
|
57
|
+
const { showRawToolEvents = false, showTimestamps = false, compact = false } = opts;
|
|
58
|
+
const out: string[] = [];
|
|
59
|
+
let assistantTextBuffer: string[] = [];
|
|
60
|
+
|
|
61
|
+
const flushAssistantBuffer = () => {
|
|
62
|
+
if (assistantTextBuffer.length > 0) {
|
|
63
|
+
const fullText = assistantTextBuffer.join("").trim();
|
|
64
|
+
if (fullText) {
|
|
65
|
+
out.push(formatAssistantText(fullText, compact));
|
|
66
|
+
}
|
|
67
|
+
assistantTextBuffer = [];
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
for (const evt of events) {
|
|
72
|
+
switch (evt.type) {
|
|
73
|
+
case "init":
|
|
74
|
+
flushAssistantBuffer();
|
|
75
|
+
out.push(chalk.dim(`🧠🌸 session init${sid}${ts}`));
|
|
76
|
+
break;
|
|
77
|
+
case "message":
|
|
78
|
+
if (evt.role === "assistant") {
|
|
79
|
+
assistantTextBuffer.push(content);
|
|
80
|
+
} else if (evt.role === "user") {
|
|
81
|
+
flushAssistantBuffer();
|
|
82
|
+
out.push(chalk.cyan.bold(`you:`));
|
|
83
|
+
out.push(chalk.cyan(evt.text || evt.content || ""));
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case "tool_use":
|
|
87
|
+
flushAssistantBuffer();
|
|
88
|
+
if (showRawToolEvents) {
|
|
89
|
+
out.push(chalk.magenta(`🔧 tool_use: ${toolName}`));
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
// ... other event types
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
flushAssistantBuffer();
|
|
97
|
+
return out.join("\n");
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Assistant Text Formatter
|
|
102
|
+
|
|
103
|
+
**Description:** Formats assistant response text with ceremonial header.
|
|
104
|
+
|
|
105
|
+
**Behavior:**
|
|
106
|
+
- Detects if agent self-formatted with `🧠🌸 miawa:` prefix
|
|
107
|
+
- Adds prefix if not present
|
|
108
|
+
- Respects compact mode
|
|
109
|
+
|
|
110
|
+
**Implementation:**
|
|
111
|
+
```typescript
|
|
112
|
+
function formatAssistantText(text: string, compact: boolean): string {
|
|
113
|
+
const trimmed = text.trim();
|
|
114
|
+
if (!trimmed) return "";
|
|
115
|
+
|
|
116
|
+
const hasPrefix = trimmed.startsWith("🧠🌸 miawa:");
|
|
117
|
+
|
|
118
|
+
if (compact || hasPrefix) {
|
|
119
|
+
return trimmed;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return [chalk.green.bold("🧠🌸 miawa:"), "", trimmed].join("\n");
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Header Formatter
|
|
127
|
+
|
|
128
|
+
**Description:** Generates session header with project and engine info.
|
|
129
|
+
|
|
130
|
+
**Output Format:**
|
|
131
|
+
```
|
|
132
|
+
🧠🌸 mia-code — Gemini-backed terminal agent
|
|
133
|
+
project: /path/to/project
|
|
134
|
+
session: abc123def456...
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Implementation:**
|
|
138
|
+
```typescript
|
|
139
|
+
function formatHeader(projectRoot: string, sessionId?: string, engine?: string): string {
|
|
140
|
+
const lines: string[] = [];
|
|
141
|
+
const engineName = engine === "claude" ? "Claude" : "Gemini";
|
|
142
|
+
lines.push(chalk.bold(`🧠🌸 mia-code — ${engineName}-backed terminal agent`));
|
|
143
|
+
lines.push(chalk.dim(`project: ${projectRoot}`));
|
|
144
|
+
if (sessionId) {
|
|
145
|
+
lines.push(chalk.dim(`session: ${sessionId.slice(0, 12)}...`));
|
|
146
|
+
}
|
|
147
|
+
return lines.join("\n");
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Status Formatters
|
|
152
|
+
|
|
153
|
+
**Description:** Consistent formatting for status messages.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
function formatSpinner(message: string): string {
|
|
157
|
+
return chalk.dim(`⏳ ${message}`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function formatError(message: string): string {
|
|
161
|
+
return chalk.red(`❌ ${message}`);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function formatSuccess(message: string): string {
|
|
165
|
+
return chalk.green(`✓ ${message}`);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Help Text Formatter
|
|
170
|
+
|
|
171
|
+
**Description:** Formatted slash command reference.
|
|
172
|
+
|
|
173
|
+
**Output:**
|
|
174
|
+
```
|
|
175
|
+
Commands:
|
|
176
|
+
/exit, /quit Exit the CLI
|
|
177
|
+
/session Show current session info
|
|
178
|
+
/sessions List all sessions
|
|
179
|
+
/clear Clear session for current project
|
|
180
|
+
/config Show configuration
|
|
181
|
+
/help Show this help
|
|
182
|
+
|
|
183
|
+
Note: By default, output is interpreted through the Miawa Unifier.
|
|
184
|
+
Use --raw flag to see uninterpreted agent output.
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Data
|
|
188
|
+
|
|
189
|
+
### RenderOptions
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
interface RenderOptions {
|
|
193
|
+
showRawToolEvents?: boolean; // Display tool use/result events
|
|
194
|
+
showTimestamps?: boolean; // Include event timestamps
|
|
195
|
+
compact?: boolean; // Minimal output mode
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Creative Advancement Scenarios
|
|
200
|
+
|
|
201
|
+
### Creative Advancement Scenario: Clear Error Communication
|
|
202
|
+
|
|
203
|
+
**Desired Outcome:** Developer immediately understands error context
|
|
204
|
+
|
|
205
|
+
**Current Structural Reality:** Error occurred during agent execution
|
|
206
|
+
|
|
207
|
+
**Natural Progression:**
|
|
208
|
+
1. Error event parsed from agent stream
|
|
209
|
+
2. Error code and message extracted
|
|
210
|
+
3. Red color and ❌ symbol applied
|
|
211
|
+
4. Error displayed prominently
|
|
212
|
+
|
|
213
|
+
**Achieved Outcome:**
|
|
214
|
+
```
|
|
215
|
+
❌ gemini exited with code 1
|
|
216
|
+
TypeScript compilation failed: Cannot find module 'missing-dep'
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Creative Advancement Scenario: Session Context Visibility
|
|
220
|
+
|
|
221
|
+
**Desired Outcome:** Developer knows current project and session state
|
|
222
|
+
|
|
223
|
+
**Current Structural Reality:** Starting interactive session
|
|
224
|
+
|
|
225
|
+
**Natural Progression:**
|
|
226
|
+
1. Header formatter receives project root and session ID
|
|
227
|
+
2. Engine name resolved from config
|
|
228
|
+
3. Styled header with metadata displayed
|
|
229
|
+
|
|
230
|
+
**Achieved Outcome:**
|
|
231
|
+
```
|
|
232
|
+
🧠🌸 mia-code — Gemini-backed terminal agent
|
|
233
|
+
project: /home/user/my-project
|
|
234
|
+
session: abc123def456...
|
|
235
|
+
new session will be created on first prompt
|
|
236
|
+
type /help for commands, ctrl+c to exit
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Advancing Patterns
|
|
240
|
+
|
|
241
|
+
1. **Visual Hierarchy:** Color and symbols create immediate recognition
|
|
242
|
+
2. **Metadata Dimming:** Session info visible but not distracting
|
|
243
|
+
3. **Ceremonial Prominence:** 🧠🌸 content is visually primary
|
|
244
|
+
4. **Consistent Symbolism:** Same symbols always mean same things
|
|
245
|
+
|
|
246
|
+
## Implementation Reference
|
|
247
|
+
|
|
248
|
+
- **Formatting Module:** `src/formatting.ts`
|
|
249
|
+
- **Event Rendering:** `renderEventsToText()`
|
|
250
|
+
- **Header:** `formatHeader()`
|
|
251
|
+
- **Status:** `formatError()`, `formatSuccess()`, `formatSpinner()`
|
|
252
|
+
- **Help:** `formatHelpText()`
|