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,569 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔧 Mia Tools — PDE + STC as Pi Extension Tools
|
|
3
|
+
*
|
|
4
|
+
* Registers miaco's Prompt Decomposition Engine and Structural Tension Charts
|
|
5
|
+
* as LLM-callable tools + slash commands within Pi.
|
|
6
|
+
*
|
|
7
|
+
* Tools (LLM can call these):
|
|
8
|
+
* - pde_decompose: Decompose a complex prompt into structured intents
|
|
9
|
+
* - stc_create: Create a structural tension chart
|
|
10
|
+
* - stc_add_step: Add an action step to a chart
|
|
11
|
+
* - stc_complete_step: Mark a step complete
|
|
12
|
+
* - stc_review: Review chart progress (Creator Moment of Truth)
|
|
13
|
+
* - stc_list: List active charts
|
|
14
|
+
*
|
|
15
|
+
* Commands (user slash commands):
|
|
16
|
+
* /pde <prompt> — Decompose a prompt
|
|
17
|
+
* /stc — List charts
|
|
18
|
+
* /stc create — Create a chart interactively
|
|
19
|
+
*
|
|
20
|
+
* Install: ln -s /a/src/mia-code/widget/mia-tools/index.ts ~/.pi/agent/extensions/mia-tools.ts
|
|
21
|
+
* Or test: pi -e /a/src/mia-code/widget/mia-tools/index.ts
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { Type } from "@mariozechner/pi-ai";
|
|
25
|
+
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
26
|
+
import { Box, Text } from "@mariozechner/pi-tui";
|
|
27
|
+
import { spawn } from "child_process";
|
|
28
|
+
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
29
|
+
import { join } from "path";
|
|
30
|
+
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Helpers — run miaco CLI and parse output
|
|
33
|
+
// ============================================================================
|
|
34
|
+
|
|
35
|
+
const MIACO_BIN = join("/a/src/mia-code/miaco/dist/index.js");
|
|
36
|
+
|
|
37
|
+
/** Derive a stable session ID from cwd so all calls in the same project share storage */
|
|
38
|
+
function sessionIdFromCwd(cwd: string): string {
|
|
39
|
+
// Simple hash: take last 2 path segments + a short hash
|
|
40
|
+
const parts = cwd.replace(/\/+$/, "").split("/");
|
|
41
|
+
const slug = parts.slice(-2).join("_").replace(/[^a-zA-Z0-9_-]/g, "");
|
|
42
|
+
let hash = 0;
|
|
43
|
+
for (let i = 0; i < cwd.length; i++) {
|
|
44
|
+
hash = ((hash << 5) - hash + cwd.charCodeAt(i)) | 0;
|
|
45
|
+
}
|
|
46
|
+
return `pi_${slug}_${Math.abs(hash).toString(36)}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function runMiaco(args: string[], cwd: string): Promise<{ stdout: string; stderr: string; code: number }> {
|
|
50
|
+
const sessionId = sessionIdFromCwd(cwd);
|
|
51
|
+
// Only chart commands accept --session; decompose uses --workdir for .pde/ storage
|
|
52
|
+
const isChart = args[0] === "chart";
|
|
53
|
+
const fullArgs = isChart ? [...args, "--session", sessionId] : [...args];
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
const child = spawn("node", [MIACO_BIN, ...fullArgs], {
|
|
56
|
+
cwd,
|
|
57
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
58
|
+
env: process.env,
|
|
59
|
+
});
|
|
60
|
+
let stdout = "";
|
|
61
|
+
let stderr = "";
|
|
62
|
+
child.stdout.on("data", (d: Buffer) => (stdout += d.toString()));
|
|
63
|
+
child.stderr.on("data", (d: Buffer) => (stderr += d.toString()));
|
|
64
|
+
child.on("close", (code) => resolve({ stdout, stderr, code: code ?? 1 }));
|
|
65
|
+
child.on("error", (err) => resolve({ stdout: "", stderr: err.message, code: 1 }));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function parseJson(stdout: string): any {
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(stdout.trim());
|
|
72
|
+
} catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// PDE — read stored decompositions from .pde/ directory
|
|
79
|
+
// ============================================================================
|
|
80
|
+
|
|
81
|
+
function listPdeFiles(cwd: string): any[] {
|
|
82
|
+
const dir = join(cwd, ".pde");
|
|
83
|
+
if (!existsSync(dir)) return [];
|
|
84
|
+
return readdirSync(dir)
|
|
85
|
+
.filter((f) => f.endsWith(".json"))
|
|
86
|
+
.sort()
|
|
87
|
+
.reverse()
|
|
88
|
+
.slice(0, 10)
|
|
89
|
+
.map((f) => {
|
|
90
|
+
try {
|
|
91
|
+
return JSON.parse(readFileSync(join(dir, f), "utf-8"));
|
|
92
|
+
} catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
.filter(Boolean);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Extension
|
|
101
|
+
// ============================================================================
|
|
102
|
+
|
|
103
|
+
export default function miaTools(pi: ExtensionAPI) {
|
|
104
|
+
// ===========================================================================
|
|
105
|
+
// Tool: pde_decompose
|
|
106
|
+
// ===========================================================================
|
|
107
|
+
pi.registerTool({
|
|
108
|
+
name: "pde_decompose",
|
|
109
|
+
label: "PDE Decompose",
|
|
110
|
+
description:
|
|
111
|
+
"Decompose a complex prompt into structured intents using the Prompt Decomposition Engine. " +
|
|
112
|
+
"Returns primary/secondary intents, Four Directions mapping, action stack, and ambiguity flags. " +
|
|
113
|
+
"Use this when a user's request contains multiple implicit goals or complex multi-step work.",
|
|
114
|
+
promptSnippet: "Decompose complex prompts into structured intents with Four Directions mapping",
|
|
115
|
+
parameters: Type.Object({
|
|
116
|
+
prompt: Type.String({ description: "The complex prompt to decompose" }),
|
|
117
|
+
engine: Type.Optional(
|
|
118
|
+
Type.Union([Type.Literal("claude"), Type.Literal("gemini"), Type.Literal("copilot")], {
|
|
119
|
+
description: "LLM engine for decomposition (default: claude)",
|
|
120
|
+
}),
|
|
121
|
+
),
|
|
122
|
+
parent: Type.Optional(
|
|
123
|
+
Type.String({ description: "Parent PDE UUID for nesting child decompositions under a parent" }),
|
|
124
|
+
),
|
|
125
|
+
}),
|
|
126
|
+
|
|
127
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
128
|
+
const engine = params.engine || "claude";
|
|
129
|
+
const args = ["decompose", "run", "-e", engine, "-p", params.prompt, "--json"];
|
|
130
|
+
if (params.parent) args.push("--parent", params.parent);
|
|
131
|
+
const result = await runMiaco(args, ctx.cwd);
|
|
132
|
+
|
|
133
|
+
if (result.code !== 0) {
|
|
134
|
+
return {
|
|
135
|
+
content: [{ type: "text", text: `PDE decomposition failed: ${result.stderr || result.stdout}` }],
|
|
136
|
+
isError: true,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const parsed = parseJson(result.stdout);
|
|
141
|
+
if (!parsed) {
|
|
142
|
+
return {
|
|
143
|
+
content: [{ type: "text", text: `PDE produced unparseable output:\n${result.stdout}` }],
|
|
144
|
+
isError: true,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Also return the markdown if it was saved
|
|
149
|
+
const mdPath = parsed.markdownPath;
|
|
150
|
+
let markdown = "";
|
|
151
|
+
if (mdPath && existsSync(mdPath)) {
|
|
152
|
+
markdown = readFileSync(mdPath, "utf-8");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
content: [
|
|
157
|
+
{
|
|
158
|
+
type: "text",
|
|
159
|
+
text: markdown || JSON.stringify(parsed.result || parsed, null, 2),
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
details: parsed,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
renderResult(result, { expanded }, theme) {
|
|
167
|
+
const details = result.details as any;
|
|
168
|
+
const r = details?.result;
|
|
169
|
+
|
|
170
|
+
if (!r) {
|
|
171
|
+
// Always return a valid Component — never undefined
|
|
172
|
+
return new Text(theme.fg("accent", "📋 PDE result (no structured data)"), 0, 0);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const lines: string[] = [];
|
|
176
|
+
|
|
177
|
+
lines.push(theme.fg("accent", "📋 PDE Decomposition"));
|
|
178
|
+
lines.push(
|
|
179
|
+
` Primary: ${theme.fg("success", r.primary?.action || "?")} → ${r.primary?.target || "?"} [${Math.round((r.primary?.confidence || 0) * 100)}%]`,
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
if (r.secondary?.length) {
|
|
183
|
+
lines.push(` Secondary: ${r.secondary.length} intent(s)`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Four Directions summary
|
|
187
|
+
const dirs = r.directions || {};
|
|
188
|
+
const dirLine = ["east", "south", "west", "north"]
|
|
189
|
+
.map((d) => {
|
|
190
|
+
const emoji = { east: "🌅", south: "🔥", west: "🌊", north: "❄️" }[d];
|
|
191
|
+
const count = (dirs[d] || []).length;
|
|
192
|
+
return count > 0 ? `${emoji}${count}` : null;
|
|
193
|
+
})
|
|
194
|
+
.filter(Boolean)
|
|
195
|
+
.join(" ");
|
|
196
|
+
if (dirLine) lines.push(` Directions: ${dirLine}`);
|
|
197
|
+
|
|
198
|
+
if (r.actionStack?.length) {
|
|
199
|
+
lines.push(` Actions: ${r.actionStack.length} steps`);
|
|
200
|
+
if (expanded) {
|
|
201
|
+
for (const a of r.actionStack) {
|
|
202
|
+
const check = a.completed ? "✓" : "○";
|
|
203
|
+
lines.push(theme.fg("dim", ` ${check} ${a.text}`));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (r.ambiguities?.length) {
|
|
209
|
+
lines.push(theme.fg("warning", ` ⚠ ${r.ambiguities.length} ambiguity flag(s)`));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
213
|
+
lines.forEach((line, i) => box.addChild(new Text(line, 0, i)));
|
|
214
|
+
return box;
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// ===========================================================================
|
|
219
|
+
// Tool: stc_create
|
|
220
|
+
// ===========================================================================
|
|
221
|
+
pi.registerTool({
|
|
222
|
+
name: "stc_create",
|
|
223
|
+
label: "STC Create",
|
|
224
|
+
description:
|
|
225
|
+
"Create a Structural Tension Chart — define a desired outcome and current reality. " +
|
|
226
|
+
"The tension between them drives creative advancement toward the outcome.",
|
|
227
|
+
promptSnippet: "Create structural tension charts (desired outcome vs current reality)",
|
|
228
|
+
parameters: Type.Object({
|
|
229
|
+
outcome: Type.String({ description: "Desired outcome — what you want to CREATE (not fix)" }),
|
|
230
|
+
reality: Type.String({ description: "Current reality — honest factual assessment" }),
|
|
231
|
+
due: Type.Optional(Type.String({ description: "Due date (ISO format)" })),
|
|
232
|
+
}),
|
|
233
|
+
|
|
234
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
235
|
+
const args = ["chart", "create", "--outcome", params.outcome, "--reality", params.reality, "--json"];
|
|
236
|
+
if (params.due) args.push("--due", params.due);
|
|
237
|
+
|
|
238
|
+
const result = await runMiaco(args, ctx.cwd);
|
|
239
|
+
const parsed = parseJson(result.stdout);
|
|
240
|
+
|
|
241
|
+
if (result.code !== 0 || !parsed?.success) {
|
|
242
|
+
return {
|
|
243
|
+
content: [{ type: "text", text: `Chart creation failed: ${result.stderr || result.stdout}` }],
|
|
244
|
+
isError: true,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: `Chart created: ${parsed.chart.id}\nOutcome: ${params.outcome}\nReality: ${params.reality}`,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
details: parsed,
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
renderResult(result, _opts, theme) {
|
|
260
|
+
const details = result.details as any;
|
|
261
|
+
if (!details?.chart) {
|
|
262
|
+
return new Text(theme.fg("accent", "🔧 STC chart (no structured data)"), 0, 0);
|
|
263
|
+
}
|
|
264
|
+
const c = details.chart;
|
|
265
|
+
|
|
266
|
+
const lines = [
|
|
267
|
+
theme.fg("accent", "🔧 Structural Tension Chart"),
|
|
268
|
+
` ${theme.fg("dim", "OUTCOME:")} ${c.outcome}`,
|
|
269
|
+
` ${theme.fg("dim", " ↑ TENSION ↑")}`,
|
|
270
|
+
` ${theme.fg("dim", "REALITY:")} ${c.reality}`,
|
|
271
|
+
theme.fg("dim", ` ID: ${c.id}`),
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
const box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
275
|
+
lines.forEach((line, i) => box.addChild(new Text(line, 0, i)));
|
|
276
|
+
return box;
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// ===========================================================================
|
|
281
|
+
// Tool: stc_add_step
|
|
282
|
+
// ===========================================================================
|
|
283
|
+
pi.registerTool({
|
|
284
|
+
name: "stc_add_step",
|
|
285
|
+
label: "STC Add Step",
|
|
286
|
+
description: "Add an action step to a structural tension chart",
|
|
287
|
+
parameters: Type.Object({
|
|
288
|
+
chart: Type.String({ description: "Chart ID" }),
|
|
289
|
+
title: Type.String({ description: "Action step title" }),
|
|
290
|
+
reality: Type.String({ description: "Current reality for this step" }),
|
|
291
|
+
}),
|
|
292
|
+
|
|
293
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
294
|
+
const result = await runMiaco(
|
|
295
|
+
["chart", "add-step", "--chart", params.chart, "--title", params.title, "--reality", params.reality, "--json"],
|
|
296
|
+
ctx.cwd,
|
|
297
|
+
);
|
|
298
|
+
const parsed = parseJson(result.stdout);
|
|
299
|
+
|
|
300
|
+
if (result.code !== 0 || !parsed?.success) {
|
|
301
|
+
return {
|
|
302
|
+
content: [{ type: "text", text: `Add step failed: ${result.stderr || result.stdout}` }],
|
|
303
|
+
isError: true,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
content: [{ type: "text", text: `Step added: ${parsed.step.id} — ${params.title}` }],
|
|
309
|
+
details: parsed,
|
|
310
|
+
};
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// ===========================================================================
|
|
315
|
+
// Tool: stc_complete_step
|
|
316
|
+
// ===========================================================================
|
|
317
|
+
pi.registerTool({
|
|
318
|
+
name: "stc_complete_step",
|
|
319
|
+
label: "STC Complete Step",
|
|
320
|
+
description: "Mark an action step as complete in a structural tension chart",
|
|
321
|
+
parameters: Type.Object({
|
|
322
|
+
step: Type.String({ description: "Step name or ID to mark complete" }),
|
|
323
|
+
}),
|
|
324
|
+
|
|
325
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
326
|
+
const result = await runMiaco(["chart", "complete", "--step", params.step, "--json"], ctx.cwd);
|
|
327
|
+
const parsed = parseJson(result.stdout);
|
|
328
|
+
|
|
329
|
+
if (result.code !== 0 || !parsed?.success) {
|
|
330
|
+
return {
|
|
331
|
+
content: [{ type: "text", text: `Complete step failed: ${result.stderr || result.stdout}` }],
|
|
332
|
+
isError: true,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return {
|
|
337
|
+
content: [{ type: "text", text: `✓ Step completed: ${params.step}` }],
|
|
338
|
+
details: parsed,
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// ===========================================================================
|
|
344
|
+
// Tool: stc_review
|
|
345
|
+
// ===========================================================================
|
|
346
|
+
pi.registerTool({
|
|
347
|
+
name: "stc_review",
|
|
348
|
+
label: "STC Review",
|
|
349
|
+
description:
|
|
350
|
+
"Creator Moment of Truth — review structural tension chart progress. " +
|
|
351
|
+
"Provides the four-step review: Acknowledge, Analyze, Plan, Feedback.",
|
|
352
|
+
parameters: Type.Object({
|
|
353
|
+
chart: Type.String({ description: "Chart ID to review" }),
|
|
354
|
+
}),
|
|
355
|
+
|
|
356
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
357
|
+
const result = await runMiaco(["chart", "review", "--chart", params.chart, "--json"], ctx.cwd);
|
|
358
|
+
const parsed = parseJson(result.stdout);
|
|
359
|
+
|
|
360
|
+
if (result.code !== 0 || !parsed) {
|
|
361
|
+
return {
|
|
362
|
+
content: [{ type: "text", text: `Review failed: ${result.stderr || result.stdout}` }],
|
|
363
|
+
isError: true,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const c = parsed.chart;
|
|
368
|
+
const text = [
|
|
369
|
+
`Chart: ${c.id}`,
|
|
370
|
+
`Outcome: ${c.outcome}`,
|
|
371
|
+
`Reality: ${c.reality}`,
|
|
372
|
+
`Progress: ${parsed.completedSteps}/${parsed.completedSteps + parsed.pendingSteps} steps (${parsed.progress}%)`,
|
|
373
|
+
"",
|
|
374
|
+
"Steps:",
|
|
375
|
+
...c.steps.map((s: any) => ` ${s.completed ? "✓" : "○"} ${s.title}`),
|
|
376
|
+
].join("\n");
|
|
377
|
+
|
|
378
|
+
return {
|
|
379
|
+
content: [{ type: "text", text }],
|
|
380
|
+
details: parsed,
|
|
381
|
+
};
|
|
382
|
+
},
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
// ===========================================================================
|
|
386
|
+
// Tool: stc_list
|
|
387
|
+
// ===========================================================================
|
|
388
|
+
pi.registerTool({
|
|
389
|
+
name: "stc_list",
|
|
390
|
+
label: "STC List",
|
|
391
|
+
description: "List all active structural tension charts",
|
|
392
|
+
parameters: Type.Object({}),
|
|
393
|
+
|
|
394
|
+
async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
|
|
395
|
+
const result = await runMiaco(["chart", "list", "--json"], ctx.cwd);
|
|
396
|
+
const parsed = parseJson(result.stdout);
|
|
397
|
+
|
|
398
|
+
if (result.code !== 0 || !parsed) {
|
|
399
|
+
return {
|
|
400
|
+
content: [{ type: "text", text: `List failed: ${result.stderr || result.stdout}` }],
|
|
401
|
+
isError: true,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const charts = parsed.charts || [];
|
|
406
|
+
if (charts.length === 0) {
|
|
407
|
+
return { content: [{ type: "text", text: "No active charts." }] };
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const text = charts
|
|
411
|
+
.map((c: any) => {
|
|
412
|
+
const done = c.steps.filter((s: any) => s.completed).length;
|
|
413
|
+
return `${c.id}: ${c.outcome} (${done}/${c.steps.length} steps)`;
|
|
414
|
+
})
|
|
415
|
+
.join("\n");
|
|
416
|
+
|
|
417
|
+
return {
|
|
418
|
+
content: [{ type: "text", text }],
|
|
419
|
+
details: parsed,
|
|
420
|
+
};
|
|
421
|
+
},
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
// ===========================================================================
|
|
425
|
+
// Slash command: /pde
|
|
426
|
+
// ===========================================================================
|
|
427
|
+
pi.registerCommand("pde", {
|
|
428
|
+
description: "Prompt Decomposition Engine — /pde <prompt> to decompose",
|
|
429
|
+
handler: async (args, ctx) => {
|
|
430
|
+
const prompt = args.trim();
|
|
431
|
+
if (!prompt) {
|
|
432
|
+
// List recent decompositions
|
|
433
|
+
const decomps = listPdeFiles(ctx.cwd);
|
|
434
|
+
if (decomps.length === 0) {
|
|
435
|
+
ctx.ui.notify("No decompositions found. Use /pde <prompt> to decompose.", "info");
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const items = decomps.map(
|
|
439
|
+
(d: any) => `${d.id.substring(0, 8)}… ${d.prompt?.substring(0, 60) || "?"}`,
|
|
440
|
+
);
|
|
441
|
+
ctx.ui.notify(`${decomps.length} decomposition(s):\n${items.join("\n")}`, "info");
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
ctx.ui.setStatus("pde", "🌅 decomposing...");
|
|
446
|
+
ctx.ui.notify("🌅 PDE decomposing prompt...", "info");
|
|
447
|
+
|
|
448
|
+
// Parse optional --parent flag: /pde --parent <uuid> <prompt>
|
|
449
|
+
let parentUuid: string | undefined;
|
|
450
|
+
let pdePrompt = prompt;
|
|
451
|
+
const parentMatch = prompt.match(/^--parent\s+(\S+)\s+(.+)$/s);
|
|
452
|
+
if (parentMatch) {
|
|
453
|
+
parentUuid = parentMatch[1];
|
|
454
|
+
pdePrompt = parentMatch[2];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const pdeArgs = ["decompose", "run", "-e", "claude", "-p", pdePrompt, "--json"];
|
|
458
|
+
if (parentUuid) pdeArgs.push("--parent", parentUuid);
|
|
459
|
+
const result = await runMiaco(pdeArgs, ctx.cwd);
|
|
460
|
+
ctx.ui.setStatus("pde", undefined);
|
|
461
|
+
|
|
462
|
+
if (result.code !== 0) {
|
|
463
|
+
ctx.ui.notify(`PDE failed: ${result.stderr || "unknown error"}`, "error");
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const parsed = parseJson(result.stdout);
|
|
468
|
+
if (parsed?.markdownPath && existsSync(parsed.markdownPath)) {
|
|
469
|
+
const md = readFileSync(parsed.markdownPath, "utf-8");
|
|
470
|
+
// Send as a message so it appears in chat
|
|
471
|
+
pi.sendMessage({
|
|
472
|
+
customType: "pde-result",
|
|
473
|
+
content: md,
|
|
474
|
+
display: true,
|
|
475
|
+
details: parsed,
|
|
476
|
+
});
|
|
477
|
+
} else {
|
|
478
|
+
ctx.ui.notify("PDE completed but could not read output.", "warning");
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// ===========================================================================
|
|
484
|
+
// Slash command: /stc
|
|
485
|
+
// ===========================================================================
|
|
486
|
+
pi.registerCommand("stc", {
|
|
487
|
+
description: "Structural Tension Charts — /stc [create|list]",
|
|
488
|
+
handler: async (args, ctx) => {
|
|
489
|
+
const parts = args.trim().split(/\s+/);
|
|
490
|
+
const sub = parts[0] || "list";
|
|
491
|
+
|
|
492
|
+
if (sub === "list" || sub === "") {
|
|
493
|
+
const result = await runMiaco(["chart", "list", "--json"], ctx.cwd);
|
|
494
|
+
const parsed = parseJson(result.stdout);
|
|
495
|
+
const charts = parsed?.charts || [];
|
|
496
|
+
|
|
497
|
+
if (charts.length === 0) {
|
|
498
|
+
ctx.ui.notify("No active charts. Use /stc create to begin.", "info");
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const lines = charts.map((c: any) => {
|
|
503
|
+
const done = c.steps.filter((s: any) => s.completed).length;
|
|
504
|
+
return `${c.id}: ${c.outcome} [${done}/${c.steps.length}]`;
|
|
505
|
+
});
|
|
506
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
507
|
+
} else if (sub === "create") {
|
|
508
|
+
const outcome = await ctx.ui.input("Desired Outcome", "What do you want to CREATE?");
|
|
509
|
+
if (!outcome) return;
|
|
510
|
+
const reality = await ctx.ui.input("Current Reality", "Honest factual assessment");
|
|
511
|
+
if (!reality) return;
|
|
512
|
+
|
|
513
|
+
const result = await runMiaco(
|
|
514
|
+
["chart", "create", "--outcome", outcome, "--reality", reality, "--json"],
|
|
515
|
+
ctx.cwd,
|
|
516
|
+
);
|
|
517
|
+
const parsed = parseJson(result.stdout);
|
|
518
|
+
if (parsed?.success) {
|
|
519
|
+
ctx.ui.notify(`✓ Chart created: ${parsed.chart.id}`, "info");
|
|
520
|
+
} else {
|
|
521
|
+
ctx.ui.notify(`Failed: ${result.stderr || result.stdout}`, "error");
|
|
522
|
+
}
|
|
523
|
+
} else {
|
|
524
|
+
ctx.ui.notify("Usage: /stc [list|create]", "info");
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
// ===========================================================================
|
|
530
|
+
// Custom message renderer for PDE results
|
|
531
|
+
// ===========================================================================
|
|
532
|
+
pi.registerMessageRenderer("pde-result", (message, { expanded }, theme) => {
|
|
533
|
+
const details = message.details as any;
|
|
534
|
+
const r = details?.result;
|
|
535
|
+
|
|
536
|
+
if (!r) {
|
|
537
|
+
const box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
538
|
+
box.addChild(new Text(theme.fg("accent", "📋 PDE result saved"), 0, 0));
|
|
539
|
+
return box;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const lines: string[] = [];
|
|
543
|
+
lines.push(theme.fg("accent", "📋 PDE Decomposition"));
|
|
544
|
+
lines.push(
|
|
545
|
+
` ${r.primary?.action || "?"} → ${r.primary?.target || "?"} [${Math.round((r.primary?.confidence || 0) * 100)}%]`,
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
const dirs = r.directions || {};
|
|
549
|
+
const emojiMap: Record<string, string> = { east: "🌅", south: "🔥", west: "🌊", north: "❄️" };
|
|
550
|
+
for (const dir of ["east", "south", "west", "north"]) {
|
|
551
|
+
const items = dirs[dir] || [];
|
|
552
|
+
if (items.length > 0) {
|
|
553
|
+
lines.push(` ${emojiMap[dir]} ${dir.toUpperCase()}: ${items.map((i: any) => i.text).join(", ")}`);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
if (expanded && r.actionStack?.length) {
|
|
558
|
+
lines.push("");
|
|
559
|
+
lines.push(" Action Stack:");
|
|
560
|
+
for (const a of r.actionStack) {
|
|
561
|
+
lines.push(theme.fg("dim", ` ○ ${a.text} [${emojiMap[a.direction] || ""}]`));
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const box = new Box(1, 1, (t) => theme.bg("customMessageBg", t));
|
|
566
|
+
lines.forEach((line, i) => box.addChild(new Text(line, 0, i)));
|
|
567
|
+
return box;
|
|
568
|
+
});
|
|
569
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 🌸 Miette Echo — Pi Extension Widget
|
|
2
|
+
|
|
3
|
+
**Two-Eye-Seen**: Look up → 🧠 Mia's work (the agent). Look down → 🌸 Miette's echo (this widget).
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
After every agent response, Miette quietly reflects on what just happened — not *what* occurred (you already see that), but *what it means*. Her echo appears as a persistent widget below your input editor.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
**Quick test:**
|
|
12
|
+
```bash
|
|
13
|
+
pi -e /a/src/mia-code/widget/miette-echo/index.ts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Permanent (global):**
|
|
17
|
+
```bash
|
|
18
|
+
ln -s /a/src/mia-code/widget/miette-echo/index.ts ~/.pi/agent/extensions/miette-echo.ts
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Permanent (project-local):**
|
|
22
|
+
```bash
|
|
23
|
+
mkdir -p .pi/extensions
|
|
24
|
+
ln -s /a/src/mia-code/widget/miette-echo/index.ts .pi/extensions/miette-echo.ts
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
- `/miette` — Show last echo as notification
|
|
30
|
+
- `/miette off` — Hide the widget
|
|
31
|
+
- `/miette on` — Show the widget
|
|
32
|
+
|
|
33
|
+
## How It Works
|
|
34
|
+
|
|
35
|
+
1. Agent responds (this IS Mia — the system prompt makes her the voice)
|
|
36
|
+
2. `on("agent_end")` fires → extracts assistant text
|
|
37
|
+
3. Lightweight LLM call with Miette's system prompt generates a 2-3 sentence reflection
|
|
38
|
+
4. `setWidget("miette-echo", ..., { placement: "belowEditor" })` renders it below your input
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- Miette never interrupts. She reflects after the fact.
|
|
43
|
+
- If the LLM call fails, she rests in silence. Never breaks the session.
|
|
44
|
+
- Uses the current model — no separate process spawn needed.
|