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,132 @@
|
|
|
1
|
+
# RISE-019: Session Compaction
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification — Borrowed from OpenCode for mia-code
|
|
4
|
+
> Document: rispecs/borrowed_from_opencode/019-session-compaction.rispec.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code prevents context window overflow by automatically compacting long conversation histories into dense summaries. Developers work in extended sessions without hitting token limits — the system intelligently compresses older messages while preserving the decisions, file changes, and current state that the agent needs to remain effective. Compaction is invisible when it works and manual when you need control.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Reality:**
|
|
13
|
+
- Conversations grow unboundedly — every message is retained in full
|
|
14
|
+
- Long sessions eventually exceed the model's context window, causing truncation or failure
|
|
15
|
+
- No mechanism exists to summarize or prune old messages
|
|
16
|
+
- Developers must manually start new sessions to "reset" context, losing continuity
|
|
17
|
+
- Tool call outputs (file contents, search results) consume enormous token counts even when their information is superseded by later changes
|
|
18
|
+
- The agent progressively loses coherence as important early decisions scroll out of context
|
|
19
|
+
|
|
20
|
+
**Desired State:**
|
|
21
|
+
- When a session's message count crosses a configurable threshold, compaction triggers automatically
|
|
22
|
+
- Older messages are summarized into a compact representation that preserves essential context
|
|
23
|
+
- Recent messages remain verbatim, ensuring the agent has full detail for current work
|
|
24
|
+
- Compaction is transparent — the agent continues working as if nothing changed
|
|
25
|
+
- Manual compaction via `/compact` gives developers explicit control
|
|
26
|
+
- Compaction metadata tracks what was compressed and when, enabling audit and debugging
|
|
27
|
+
|
|
28
|
+
## Desired Outcome Definition
|
|
29
|
+
|
|
30
|
+
A session with 80 messages automatically compacts: the oldest 60 are replaced by a single summary message, the newest 20 remain intact. The summary captures file modifications, key decisions, resolved errors, and current project state. The agent's next response is informed by the summary as if it had read all 80 messages.
|
|
31
|
+
|
|
32
|
+
## Natural Language Functional Description
|
|
33
|
+
|
|
34
|
+
### Compaction Trigger
|
|
35
|
+
|
|
36
|
+
Compaction activates when:
|
|
37
|
+
1. **Automatic:** message count exceeds `compaction.threshold` (default: 50, configurable)
|
|
38
|
+
2. **Manual:** user types `/compact` command
|
|
39
|
+
3. **Token-based (future):** estimated token count exceeds model's context budget minus a reserve
|
|
40
|
+
|
|
41
|
+
When triggered, the session's status is set to `"compacting"` to prevent concurrent modifications.
|
|
42
|
+
|
|
43
|
+
### Compaction Process
|
|
44
|
+
|
|
45
|
+
1. **Select messages for compaction:** all messages from index 0 to `(total - retainCount)`, where `retainCount` defaults to 20. System messages and the initial user prompt are always included in the summary input.
|
|
46
|
+
|
|
47
|
+
2. **Build compaction prompt:** send selected messages to a compaction agent (see RISE-017) with instructions:
|
|
48
|
+
- Summarize the conversation preserving: files created/modified/deleted with their current known states, key architectural decisions and their rationale, errors encountered and how they were resolved, current task state and next steps, any user preferences or constraints expressed.
|
|
49
|
+
- Output structured summary in a defined format.
|
|
50
|
+
|
|
51
|
+
3. **Replace old messages:** within a single database transaction:
|
|
52
|
+
- Delete the selected old messages and their parts from the database
|
|
53
|
+
- Insert a new system message with role `"system"` and type `"compaction_summary"`
|
|
54
|
+
- The summary message contains: narrative summary text, structured file change list, decision log entries, compaction metadata
|
|
55
|
+
|
|
56
|
+
4. **Update session metadata:** record compaction event with timestamp.
|
|
57
|
+
|
|
58
|
+
5. **Clear compacting status:** session returns to normal operation.
|
|
59
|
+
|
|
60
|
+
### Summary Structure
|
|
61
|
+
|
|
62
|
+
The compaction summary message contains structured parts:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
{
|
|
66
|
+
"type": "compaction_summary",
|
|
67
|
+
"original_message_count": 60,
|
|
68
|
+
"compacted_at": 1706000000000,
|
|
69
|
+
"summary_token_count": 1200,
|
|
70
|
+
"narrative": "Session began with user requesting...",
|
|
71
|
+
"files_touched": [
|
|
72
|
+
{"path": "src/auth.ts", "status": "modified", "summary": "Added JWT validation middleware"},
|
|
73
|
+
{"path": "src/types.ts", "status": "created", "summary": "New type definitions for User and Session"}
|
|
74
|
+
],
|
|
75
|
+
"decisions": [
|
|
76
|
+
"Chose JWT over session cookies for stateless auth",
|
|
77
|
+
"Using Zod for runtime validation instead of io-ts"
|
|
78
|
+
],
|
|
79
|
+
"current_state": "Authentication middleware complete, starting route handlers"
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Retain Strategy
|
|
84
|
+
|
|
85
|
+
Messages retained verbatim after compaction:
|
|
86
|
+
- The most recent `retainCount` messages (default: 20)
|
|
87
|
+
- Any message flagged as `pinned` by the user (future feature)
|
|
88
|
+
- The compaction summary itself (always first message after compaction)
|
|
89
|
+
|
|
90
|
+
### Configuration
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"compaction": {
|
|
95
|
+
"enabled": true,
|
|
96
|
+
"threshold": 50,
|
|
97
|
+
"retainCount": 20,
|
|
98
|
+
"autoTrigger": true
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### The `/compact` Command
|
|
104
|
+
|
|
105
|
+
Manual trigger that runs compaction regardless of message count. Useful when:
|
|
106
|
+
- The developer knows context is stale and wants to clean up
|
|
107
|
+
- Switching focus within a session and wanting to reset context weight
|
|
108
|
+
- Debugging compaction behavior
|
|
109
|
+
|
|
110
|
+
Output: "Compacted {N} messages into summary. {M} recent messages retained."
|
|
111
|
+
|
|
112
|
+
## Supporting Structures
|
|
113
|
+
|
|
114
|
+
- **Compaction Agent (RISE-017)** defines the agent persona and prompt for summarization
|
|
115
|
+
- **Session Persistence (RISE-018)** provides transactional message replacement in SQLite
|
|
116
|
+
- **Message Parts Model (RISE-026)** defines the compaction_summary part type
|
|
117
|
+
- **Structured Logging (RISE-007)** logs compaction events with before/after metrics
|
|
118
|
+
- **Named Error System (RISE-006)** provides CompactionError for failures during the process
|
|
119
|
+
|
|
120
|
+
## Creative Advancement Scenarios
|
|
121
|
+
|
|
122
|
+
**Scenario 1 — Long Refactoring Session:**
|
|
123
|
+
A developer refactors 30 files across 4 hours, generating 120 messages. At message 50, compaction fires: messages 1–30 become a summary capturing all file changes and decisions. At message 100, it fires again: messages 31–80 (including the first summary) compact into a new summary. The agent never loses track of which files were modified.
|
|
124
|
+
|
|
125
|
+
**Scenario 2 — Manual Compaction for Focus Shift:**
|
|
126
|
+
Midway through a session, the developer shifts from "fix bugs" to "add new feature." They type `/compact` to compress the bug-fixing context, giving the agent maximum context budget for the new feature work.
|
|
127
|
+
|
|
128
|
+
**Scenario 3 — Compaction Preserves Critical Decisions:**
|
|
129
|
+
The user decided early in the session to use PostgreSQL instead of MySQL. 70 messages later, compaction fires. The summary explicitly records this decision. When the agent generates database code post-compaction, it correctly uses PostgreSQL — the decision survived compression.
|
|
130
|
+
|
|
131
|
+
**Scenario 4 — Audit Trail:**
|
|
132
|
+
A team lead reviews a compacted session. The compaction metadata shows 60 messages were compressed at timestamp T. The summary lists 8 files modified and 3 key decisions. The lead can assess the session's impact without reading 60 messages.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# RISE-020: Session Forking
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification — Borrowed from OpenCode for mia-code
|
|
4
|
+
> Document: rispecs/borrowed_from_opencode/020-session-forking.rispec.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code lets developers branch conversations the way they branch code. A session fork creates a new timeline from any message point — try an alternative approach without destroying the original path, explore "what if" scenarios with full context, and merge the best ideas back. Forking transforms linear conversations into a tree of possibilities, matching how creative problem-solving actually works.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Reality:**
|
|
13
|
+
- Sessions are strictly linear — each message follows the previous with no branching
|
|
14
|
+
- To try an alternative approach, developers must start a fresh session and re-explain context
|
|
15
|
+
- There is no mechanism to compare two different approaches to the same problem
|
|
16
|
+
- Failed experiments destroy the working state — there is no "undo the last 10 messages and try something else"
|
|
17
|
+
- Valuable context from the original session must be manually copied or re-described
|
|
18
|
+
- No relationship tracking between sessions that explore the same problem space
|
|
19
|
+
|
|
20
|
+
**Desired State:**
|
|
21
|
+
- Any message in a session can be a fork point — creating a new session that inherits all context up to that message
|
|
22
|
+
- The forked session has its own independent message history from the fork point forward
|
|
23
|
+
- Parent-child relationships are tracked via `parent_id` in the sessions table
|
|
24
|
+
- Developers can view the fork tree to understand how approaches diverged
|
|
25
|
+
- Forked sessions inherit configuration, permissions, and project context
|
|
26
|
+
- Multiple forks from the same point are allowed — enabling parallel exploration
|
|
27
|
+
|
|
28
|
+
## Desired Outcome Definition
|
|
29
|
+
|
|
30
|
+
A developer working in session A reaches message #15 and wants to try a different approach. They fork at message #15: a new session B is created with messages 1–15 copied from A. Session B's `parent_id` points to A. The developer continues in B with the alternative approach while A remains untouched. Later, `/forks` in session A shows session B as a child.
|
|
31
|
+
|
|
32
|
+
## Natural Language Functional Description
|
|
33
|
+
|
|
34
|
+
### Fork Creation
|
|
35
|
+
|
|
36
|
+
Forking is triggered by:
|
|
37
|
+
1. **Command:** `/fork [messageId]` — forks from the specified message, or the last message if omitted
|
|
38
|
+
2. **Programmatic:** `sessionDB.forkSession(sessionId, messageId)` — used by UI or API
|
|
39
|
+
|
|
40
|
+
The fork process:
|
|
41
|
+
1. Validate that the source session and message exist
|
|
42
|
+
2. Create a new session row with:
|
|
43
|
+
- New unique `id`
|
|
44
|
+
- `parent_id` set to source session's `id`
|
|
45
|
+
- `directory`, `project_id`, `version` copied from source
|
|
46
|
+
- `title` set to "{source title} (fork)" — can be renamed later
|
|
47
|
+
- `created_at` set to current timestamp
|
|
48
|
+
3. Copy all messages from the source session where `created_at <= fork_point_message.created_at`
|
|
49
|
+
4. Copy all parts belonging to those messages
|
|
50
|
+
5. Message and part IDs are regenerated (new UUIDs) to avoid conflicts
|
|
51
|
+
6. A system message is appended: "Forked from session {sourceId} at message {messageId}"
|
|
52
|
+
7. Return the new session ID — the client switches to it
|
|
53
|
+
|
|
54
|
+
### Fork Metadata
|
|
55
|
+
|
|
56
|
+
Each forked session carries metadata:
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"fork": {
|
|
60
|
+
"source_session_id": "abc-123",
|
|
61
|
+
"source_message_id": "msg-456",
|
|
62
|
+
"forked_at": 1706000000000,
|
|
63
|
+
"fork_depth": 1
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`fork_depth` increments for forks of forks, enabling tree visualization.
|
|
69
|
+
|
|
70
|
+
### Fork Tree Navigation
|
|
71
|
+
|
|
72
|
+
**`/forks`** — lists all sessions forked from the current session:
|
|
73
|
+
```
|
|
74
|
+
Session forks:
|
|
75
|
+
├─ fix-auth-bug (fork) — 2025-01-23 14:30 — 12 messages
|
|
76
|
+
├─ fix-auth-bug (fork 2) — 2025-01-23 15:00 — 8 messages
|
|
77
|
+
│ └─ fix-auth-bug (fork 2.1) — 2025-01-23 15:30 — 5 messages
|
|
78
|
+
└─ fix-auth-bug (fork 3) — 2025-01-23 16:00 — 3 messages
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**`/sessions --tree`** — shows full session hierarchy for the current project:
|
|
82
|
+
```
|
|
83
|
+
Sessions for /projects/myapp:
|
|
84
|
+
main-session — 2025-01-23 10:00 — 45 messages
|
|
85
|
+
├─ approach-a — 2025-01-23 14:30 — 12 messages
|
|
86
|
+
└─ approach-b — 2025-01-23 15:00 — 8 messages
|
|
87
|
+
another-session — 2025-01-24 09:00 — 20 messages
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Inherited Properties
|
|
91
|
+
|
|
92
|
+
When a session is forked, the child inherits:
|
|
93
|
+
- All messages and parts up to the fork point
|
|
94
|
+
- Session configuration (model, temperature, etc.)
|
|
95
|
+
- Active permission rulesets (RISE-011)
|
|
96
|
+
- Project context (directory, project_id)
|
|
97
|
+
- Snapshot state at the fork point (RISE-021)
|
|
98
|
+
|
|
99
|
+
The child diverges in:
|
|
100
|
+
- Message history after the fork point
|
|
101
|
+
- Session-specific configuration changes made post-fork
|
|
102
|
+
- File system state (each fork operates on the real filesystem independently)
|
|
103
|
+
|
|
104
|
+
### Promoting a Fork
|
|
105
|
+
|
|
106
|
+
`/promote` converts a forked session into an independent top-level session by setting `parent_id` to null. The fork metadata is preserved in session metadata for reference but the session no longer appears as a child in tree views.
|
|
107
|
+
|
|
108
|
+
### Constraints
|
|
109
|
+
|
|
110
|
+
- Fork depth is limited to 10 levels to prevent unbounded nesting
|
|
111
|
+
- Forking a compacted session forks the compacted state (summary + retained messages)
|
|
112
|
+
- Forks do not synchronize — changes in the parent do not propagate to children
|
|
113
|
+
|
|
114
|
+
## Supporting Structures
|
|
115
|
+
|
|
116
|
+
- **Session Persistence (RISE-018)** provides the `parent_id` column and transactional message copying
|
|
117
|
+
- **Message Parts Model (RISE-026)** ensures parts are correctly duplicated during fork
|
|
118
|
+
- **Session Compaction (RISE-019)** — compacted sessions fork with their summary intact
|
|
119
|
+
- **Session Revert/Snapshot (RISE-021)** — fork point can reference a snapshot for file state
|
|
120
|
+
- **Named Error System (RISE-006)** provides ForkDepthExceededError, InvalidForkPointError
|
|
121
|
+
|
|
122
|
+
## Creative Advancement Scenarios
|
|
123
|
+
|
|
124
|
+
**Scenario 1 — A/B Approach Testing:**
|
|
125
|
+
A developer asks the agent to redesign a database schema. At the proposed schema message, they fork twice: fork A explores a normalized approach, fork B explores a denormalized approach. After working through both, the developer compares results and continues in the fork that produced cleaner code.
|
|
126
|
+
|
|
127
|
+
**Scenario 2 — Safe Experimentation:**
|
|
128
|
+
The agent suggests a risky refactoring. The developer forks before agreeing, then lets the agent proceed in the fork. If the refactoring breaks tests, the developer switches back to the original session with no damage done.
|
|
129
|
+
|
|
130
|
+
**Scenario 3 — Delegated Subtask:**
|
|
131
|
+
Working on a feature, the developer forks to handle a discovered bug. The bug-fix fork has full context of the feature work (understanding which files are involved) but its own message history focused on the fix. Once the bug is resolved, the developer returns to the feature session.
|
|
132
|
+
|
|
133
|
+
**Scenario 4 — Teaching and Review:**
|
|
134
|
+
A senior developer forks a junior's session at a decision point to show an alternative approach. Both sessions share the same starting context, making the comparison meaningful and educational.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# RISE-021: Session Revert and Snapshots
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification — Borrowed from OpenCode for mia-code
|
|
4
|
+
> Document: rispecs/borrowed_from_opencode/021-session-revert-snapshot.rispec.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code captures file system snapshots before every destructive tool execution, giving developers a time-travel mechanism to undo agent changes at any granularity. Every tool call that touches files becomes reversible. Developers experiment fearlessly — if an agent's edit breaks the build, one command restores the working state. The safety net is always there, invisible until needed.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Reality:**
|
|
13
|
+
- Tool executions that modify files (write, edit, delete) are permanent and immediate
|
|
14
|
+
- There is no built-in undo — developers must use git to recover from bad agent edits
|
|
15
|
+
- If the project has uncommitted changes, a bad agent edit can destroy work-in-progress
|
|
16
|
+
- Multiple tool calls in a single agent turn cannot be selectively undone
|
|
17
|
+
- The agent cannot revert its own mistakes without the developer manually identifying changed files
|
|
18
|
+
- No snapshot mechanism exists independent of the project's own git repository
|
|
19
|
+
|
|
20
|
+
**Desired State:**
|
|
21
|
+
- Before each file-modifying tool execution, a snapshot captures the current state of affected files
|
|
22
|
+
- Snapshots are stored in a dedicated hidden git repository (`.mia-code/snapshots/`) separate from the project's git
|
|
23
|
+
- Developers can revert to any snapshot via `/undo` (last change) or `/revert <messageId>` (specific point)
|
|
24
|
+
- Reverts are non-destructive to session history — a revert adds a new message documenting what was restored
|
|
25
|
+
- Snapshot metadata tracks which files were affected, additions/deletions, and diff text
|
|
26
|
+
- The snapshot system works regardless of whether the project uses git
|
|
27
|
+
|
|
28
|
+
## Desired Outcome Definition
|
|
29
|
+
|
|
30
|
+
The agent edits 3 files in response to a prompt. Before each edit, a snapshot hash is recorded. The developer sees the changes break tests. They type `/undo` and all 3 files revert to their pre-edit state. A message appears in the session: "Reverted 3 files to snapshot abc123." The session history retains both the original edits and the revert.
|
|
31
|
+
|
|
32
|
+
## Natural Language Functional Description
|
|
33
|
+
|
|
34
|
+
### Snapshot Capture
|
|
35
|
+
|
|
36
|
+
Before any tool execution that modifies the filesystem, the snapshot system:
|
|
37
|
+
|
|
38
|
+
1. **Identify affected files:** parse the tool call to determine which files will be created, modified, or deleted
|
|
39
|
+
2. **Stage current state:** in the `.mia-code/snapshots/` git repository:
|
|
40
|
+
- Copy the current version of each affected file into the snapshot repo
|
|
41
|
+
- `git add` the files
|
|
42
|
+
- `git write-tree` to create a tree object
|
|
43
|
+
- Store the tree hash as the snapshot identifier
|
|
44
|
+
3. **Record snapshot metadata** in the session database:
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"snapshot_id": "abc123def",
|
|
48
|
+
"message_id": "msg-789",
|
|
49
|
+
"tool_call_id": "tc-456",
|
|
50
|
+
"timestamp": 1706000000000,
|
|
51
|
+
"files": [
|
|
52
|
+
{"path": "src/auth.ts", "action": "modify", "size_before": 2048},
|
|
53
|
+
{"path": "src/types.ts", "action": "create"},
|
|
54
|
+
{"path": "src/old.ts", "action": "delete", "size_before": 512}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
4. **Proceed with tool execution** — the tool runs normally after the snapshot is saved
|
|
59
|
+
|
|
60
|
+
### Snapshot Storage
|
|
61
|
+
|
|
62
|
+
The `.mia-code/snapshots/` directory contains a bare-like git repository used solely for snapshot storage:
|
|
63
|
+
- Initialized once per project on first tool execution
|
|
64
|
+
- Uses git's content-addressable storage for efficient deduplication
|
|
65
|
+
- Tree objects reference file blobs — no commits needed (lightweight)
|
|
66
|
+
- Periodic garbage collection removes orphaned snapshots older than 30 days
|
|
67
|
+
- The snapshot repo is excluded from the project's `.gitignore` automatically
|
|
68
|
+
|
|
69
|
+
### Revert Operations
|
|
70
|
+
|
|
71
|
+
**`/undo`** — reverts the most recent file-modifying tool execution:
|
|
72
|
+
1. Find the last snapshot in the current session
|
|
73
|
+
2. Restore all files from that snapshot's tree object to the working directory
|
|
74
|
+
3. For files that were created by the tool: delete them
|
|
75
|
+
4. For files that were deleted by the tool: restore them from the snapshot
|
|
76
|
+
5. Append a system message to the session documenting the revert
|
|
77
|
+
|
|
78
|
+
**`/revert <messageId>`** — reverts to the state before a specific message's tool calls:
|
|
79
|
+
1. Find the snapshot associated with the specified message
|
|
80
|
+
2. Restore files from the snapshot tree to the working directory
|
|
81
|
+
3. If multiple tool calls occurred between the snapshot and now, compute the cumulative diff
|
|
82
|
+
4. Append a system message documenting all files restored
|
|
83
|
+
|
|
84
|
+
### Revert Message
|
|
85
|
+
|
|
86
|
+
When a revert occurs, a system message is appended:
|
|
87
|
+
```
|
|
88
|
+
Reverted to snapshot abc123def (before message msg-789):
|
|
89
|
+
- src/auth.ts: restored (was modified)
|
|
90
|
+
- src/types.ts: removed (was created)
|
|
91
|
+
- src/old.ts: restored (was deleted)
|
|
92
|
+
|
|
93
|
+
3 files affected, 45 additions restored, 23 deletions undone.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Snapshot Browsing
|
|
97
|
+
|
|
98
|
+
**`/snapshots`** — lists all snapshots in the current session:
|
|
99
|
+
```
|
|
100
|
+
Snapshots:
|
|
101
|
+
#1 msg-001 2025-01-23 10:05 src/auth.ts (modify)
|
|
102
|
+
#2 msg-003 2025-01-23 10:12 src/types.ts (create), src/utils.ts (modify)
|
|
103
|
+
#3 msg-007 2025-01-23 10:30 src/old.ts (delete)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**`/diff <snapshotId>`** — shows the diff between a snapshot and the current file state
|
|
107
|
+
|
|
108
|
+
### Edge Cases
|
|
109
|
+
|
|
110
|
+
- **Binary files:** stored in snapshots but diffing is skipped; revert restores the binary blob
|
|
111
|
+
- **New files created by agent:** snapshot records their absence; revert deletes them
|
|
112
|
+
- **Files modified outside mia-code** between snapshot and revert: the revert overwrites with snapshot state; a warning is emitted
|
|
113
|
+
- **Concurrent sessions:** each session maintains its own snapshot chain; cross-session conflicts are the developer's responsibility
|
|
114
|
+
|
|
115
|
+
## Supporting Structures
|
|
116
|
+
|
|
117
|
+
- **Session Persistence (RISE-018)** stores snapshot metadata in the database alongside messages
|
|
118
|
+
- **Message Parts Model (RISE-026)** defines the `snapshot` and `revert` part types
|
|
119
|
+
- **Structured Logging (RISE-007)** logs all snapshot and revert operations
|
|
120
|
+
- **Named Error System (RISE-006)** provides SnapshotNotFoundError, RevertConflictError
|
|
121
|
+
- **Session Forking (RISE-020)** — forks can reference a specific snapshot as their starting file state
|
|
122
|
+
|
|
123
|
+
## Creative Advancement Scenarios
|
|
124
|
+
|
|
125
|
+
**Scenario 1 — Quick Undo:**
|
|
126
|
+
The agent edits `src/api.ts` and the TypeScript compiler reports errors. The developer types `/undo`. The file reverts instantly. The developer provides better instructions and the agent tries again on the clean file.
|
|
127
|
+
|
|
128
|
+
**Scenario 2 — Selective Time Travel:**
|
|
129
|
+
Over 20 messages, the agent made changes to 15 files. Message #8 introduced a subtle bug. The developer uses `/revert msg-008` to restore files to their state before message #8, while keeping the full conversation history. They then guide the agent to redo messages 8–20 with the bug avoided.
|
|
130
|
+
|
|
131
|
+
**Scenario 3 — Fearless Experimentation:**
|
|
132
|
+
The developer asks the agent to "try a completely different architecture for this module." Knowing that `/undo` exists, they let the agent make sweeping changes across 10 files. The experiment fails, and a single `/undo` restores everything. No git stashing, no manual file recovery.
|
|
133
|
+
|
|
134
|
+
**Scenario 4 — Snapshot as Documentation:**
|
|
135
|
+
Before a demo, the developer runs `/snapshots` to see every file change the agent made during the session. The snapshot list serves as a changelog — showing exactly which files were touched and when, useful for code review or knowledge transfer.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# RISE-022: Session Sharing
|
|
2
|
+
|
|
3
|
+
> RISE Framework Specification — Borrowed from OpenCode for mia-code
|
|
4
|
+
> Document: rispecs/borrowed_from_opencode/022-session-sharing.rispec.md
|
|
5
|
+
|
|
6
|
+
## Creative Intent
|
|
7
|
+
|
|
8
|
+
mia-code enables developers to share agent conversations via public URLs — making AI-assisted coding sessions as shareable as gists. A shared session becomes a living document: the conversation, tool calls, code changes, and reasoning are all visible. Teams share debugging sessions, educators share teaching interactions, and open-source contributors share how they built features. Sharing transforms private agent work into collective knowledge.
|
|
9
|
+
|
|
10
|
+
## Structural Tension Analysis
|
|
11
|
+
|
|
12
|
+
**Current Reality:**
|
|
13
|
+
- Session data lives exclusively on the local machine in `~/.mia-code-sessions.json`
|
|
14
|
+
- There is no mechanism to share a session with another person
|
|
15
|
+
- To show someone what the agent did, developers must copy-paste terminal output or screen-record
|
|
16
|
+
- Copy-pasted output loses structure: tool calls, file diffs, and timing are flattened to text
|
|
17
|
+
- No privacy controls exist because sharing does not exist
|
|
18
|
+
- Self-hosted teams cannot run their own sharing infrastructure
|
|
19
|
+
|
|
20
|
+
**Desired State:**
|
|
21
|
+
- Sessions can be shared via a single command, producing a public URL
|
|
22
|
+
- The shared view preserves full session structure: messages, tool calls with arguments and results, file diffs, timestamps
|
|
23
|
+
- Sharing is opt-in and configurable: disabled, ask-per-session, or automatic
|
|
24
|
+
- Shares can be revoked, removing the public URL
|
|
25
|
+
- The share endpoint is configurable, enabling self-hosted deployments
|
|
26
|
+
- Share metadata (URL, secret, timestamps) is stored locally for management
|
|
27
|
+
|
|
28
|
+
## Desired Outcome Definition
|
|
29
|
+
|
|
30
|
+
A developer finishes a productive session and types `/share`. The session data is uploaded to the configured share endpoint. A URL is returned: `https://share.mia-code.dev/s/abc123`. Anyone with the URL can view the conversation in a rich web interface. The developer can later type `/unshare` to revoke access.
|
|
31
|
+
|
|
32
|
+
## Natural Language Functional Description
|
|
33
|
+
|
|
34
|
+
### Share Configuration
|
|
35
|
+
|
|
36
|
+
Sharing behavior is controlled by configuration:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"share": {
|
|
41
|
+
"mode": "ask",
|
|
42
|
+
"endpoint": "https://share.mia-code.dev/api",
|
|
43
|
+
"includeToolResults": true,
|
|
44
|
+
"includeDiffs": true,
|
|
45
|
+
"redactPatterns": []
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `mode`: `"disabled"` (never share), `"ask"` (prompt before sharing), `"auto"` (share automatically on session end)
|
|
51
|
+
- `endpoint`: the API base URL for the sharing service
|
|
52
|
+
- `includeToolResults`: whether to include full tool output (may contain sensitive code)
|
|
53
|
+
- `includeDiffs`: whether to include file diffs showing changes
|
|
54
|
+
- `redactPatterns`: regex patterns for content to redact before sharing (e.g., API keys, passwords)
|
|
55
|
+
|
|
56
|
+
### Share Command
|
|
57
|
+
|
|
58
|
+
**`/share`** — shares the current session:
|
|
59
|
+
1. If mode is `"disabled"`, print error and exit
|
|
60
|
+
2. If mode is `"ask"`, prompt: "Share this session publicly? [y/N]"
|
|
61
|
+
3. Serialize the session: messages, parts, metadata, file diffs
|
|
62
|
+
4. Apply redaction patterns to all text content
|
|
63
|
+
5. POST to `{endpoint}/sessions` with the serialized payload
|
|
64
|
+
6. Receive response: `{ "url": "https://...", "secret": "del_xyz", "id": "share_abc" }`
|
|
65
|
+
7. Store share metadata in the local session record
|
|
66
|
+
8. Display: "Session shared: https://share.mia-code.dev/s/abc123"
|
|
67
|
+
|
|
68
|
+
**`/unshare`** — revokes a shared session:
|
|
69
|
+
1. Read the share secret from local session metadata
|
|
70
|
+
2. DELETE to `{endpoint}/sessions/{share_id}` with the secret as authorization
|
|
71
|
+
3. Remove share metadata from local session record
|
|
72
|
+
4. Display: "Share revoked. URL is no longer accessible."
|
|
73
|
+
|
|
74
|
+
**`/share --update`** — updates an existing share with new messages:
|
|
75
|
+
1. PUT to `{endpoint}/sessions/{share_id}` with updated payload
|
|
76
|
+
2. Display: "Share updated."
|
|
77
|
+
|
|
78
|
+
### Sync Events (Auto Mode)
|
|
79
|
+
|
|
80
|
+
When `mode` is `"auto"`, the following events trigger sync:
|
|
81
|
+
- `session.created` — creates the share immediately
|
|
82
|
+
- `message.added` — pushes the new message to the share
|
|
83
|
+
- `session.archived` — marks the share as complete
|
|
84
|
+
- Sync is best-effort: failures are logged but do not interrupt the session
|
|
85
|
+
|
|
86
|
+
### Share Payload Structure
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"version": "1.0",
|
|
91
|
+
"session": {
|
|
92
|
+
"id": "local-session-id",
|
|
93
|
+
"title": "Fix authentication bug",
|
|
94
|
+
"project": "myapp",
|
|
95
|
+
"created_at": 1706000000000,
|
|
96
|
+
"model": "claude-sonnet-4-20250514"
|
|
97
|
+
},
|
|
98
|
+
"messages": [
|
|
99
|
+
{
|
|
100
|
+
"role": "user",
|
|
101
|
+
"parts": [{"type": "text", "content": "Fix the auth middleware"}],
|
|
102
|
+
"created_at": 1706000001000
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"role": "assistant",
|
|
106
|
+
"parts": [
|
|
107
|
+
{"type": "text", "content": "I'll fix the auth middleware..."},
|
|
108
|
+
{"type": "tool_call", "name": "edit_file", "args": {"path": "src/auth.ts", "...": "..."}},
|
|
109
|
+
{"type": "tool_result", "output": "File edited successfully"}
|
|
110
|
+
],
|
|
111
|
+
"metadata": {"model": "claude-sonnet-4-20250514", "tokens": 450},
|
|
112
|
+
"created_at": 1706000010000
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"diffs": [
|
|
116
|
+
{
|
|
117
|
+
"file": "src/auth.ts",
|
|
118
|
+
"status": "modified",
|
|
119
|
+
"additions": 12,
|
|
120
|
+
"deletions": 3,
|
|
121
|
+
"patch": "@@ -10,3 +10,12 @@\n-old code\n+new code"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Privacy and Security
|
|
128
|
+
|
|
129
|
+
- **Opt-in:** sharing never happens without explicit user action or configuration
|
|
130
|
+
- **Redaction:** configurable regex patterns strip sensitive content before upload
|
|
131
|
+
- **Revocable:** shares can be deleted at any time using the stored secret
|
|
132
|
+
- **No source code by default:** `includeToolResults` can be disabled to share only the conversation, not code content
|
|
133
|
+
- **Self-hosted:** the endpoint is configurable — teams can run their own share server
|
|
134
|
+
- **Expiration:** shares include an optional TTL (default: 30 days, configurable)
|
|
135
|
+
|
|
136
|
+
### Share Viewer
|
|
137
|
+
|
|
138
|
+
The share URL resolves to a web interface that renders:
|
|
139
|
+
- Conversation messages with proper formatting
|
|
140
|
+
- Tool calls with collapsible arguments and results
|
|
141
|
+
- File diffs with syntax highlighting
|
|
142
|
+
- Timestamps and model information
|
|
143
|
+
- Session metadata (duration, message count, files changed)
|
|
144
|
+
|
|
145
|
+
## Supporting Structures
|
|
146
|
+
|
|
147
|
+
- **Session Persistence (RISE-018)** stores share metadata alongside session data
|
|
148
|
+
- **Message Parts Model (RISE-026)** provides the structured data that makes rich sharing possible
|
|
149
|
+
- **Session Summary Diffs (RISE-023)** generates the diff summary included in shares
|
|
150
|
+
- **Structured Logging (RISE-007)** logs share/unshare events
|
|
151
|
+
- **Named Error System (RISE-006)** provides ShareUploadError, ShareRevokeError, RedactionError
|
|
152
|
+
|
|
153
|
+
## Creative Advancement Scenarios
|
|
154
|
+
|
|
155
|
+
**Scenario 1 — Bug Report with Context:**
|
|
156
|
+
A developer discovers a bug in mia-code's agent behavior. They `/share` the session and paste the URL in a GitHub issue. The maintainer sees the exact conversation, tool calls, and agent reasoning — a complete reproduction case.
|
|
157
|
+
|
|
158
|
+
**Scenario 2 — Team Knowledge Sharing:**
|
|
159
|
+
A senior developer uses mia-code to implement a complex feature. They share the session in Slack. Junior developers read through the conversation to learn the architectural decisions and coding patterns.
|
|
160
|
+
|
|
161
|
+
**Scenario 3 — Self-Hosted Enterprise:**
|
|
162
|
+
A company configures `endpoint` to point to their internal share server. Sessions are shared within the company network. No data leaves the corporate infrastructure.
|
|
163
|
+
|
|
164
|
+
**Scenario 4 — Automatic Session Archive:**
|
|
165
|
+
With `mode: "auto"`, every session is automatically synced to the share endpoint. The team maintains a searchable library of all agent interactions — a collective memory of how the codebase evolved.
|