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
package/dist/sessionStore.js
CHANGED
|
@@ -3,6 +3,10 @@ import path from "path";
|
|
|
3
3
|
import os from "os";
|
|
4
4
|
const SESSIONS_FILE = path.join(os.homedir(), ".mia-code-sessions.json");
|
|
5
5
|
const HISTORY_DIR = path.join(os.homedir(), ".mia-code-history");
|
|
6
|
+
/** Build the engine-qualified key for byProjectRoot lookup. */
|
|
7
|
+
function projectKey(projectRoot, engine) {
|
|
8
|
+
return engine ? `${engine}:${projectRoot}` : projectRoot;
|
|
9
|
+
}
|
|
6
10
|
function loadIndex() {
|
|
7
11
|
if (!fs.existsSync(SESSIONS_FILE)) {
|
|
8
12
|
return { byProjectRoot: {}, byId: {} };
|
|
@@ -25,7 +29,15 @@ function saveIndex(index) {
|
|
|
25
29
|
export function rememberSession(meta) {
|
|
26
30
|
const idx = loadIndex();
|
|
27
31
|
if (meta.projectRoot) {
|
|
28
|
-
|
|
32
|
+
// Store under engine-qualified key so each engine has its own "last session"
|
|
33
|
+
idx.byProjectRoot[projectKey(meta.projectRoot, meta.engine)] = meta;
|
|
34
|
+
// Clean up stale legacy (unqualified) entry if it points to this same session,
|
|
35
|
+
// preventing a different engine from claiming it via fallback.
|
|
36
|
+
const legacyKey = meta.projectRoot; // bare, no engine prefix
|
|
37
|
+
const legacy = idx.byProjectRoot[legacyKey];
|
|
38
|
+
if (legacy && legacy.id === meta.id && meta.engine) {
|
|
39
|
+
delete idx.byProjectRoot[legacyKey];
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
42
|
idx.byId[meta.id] = meta;
|
|
31
43
|
saveIndex(idx);
|
|
@@ -36,7 +48,7 @@ export function markSessionInitialized(id) {
|
|
|
36
48
|
if (session) {
|
|
37
49
|
session.initialized = true;
|
|
38
50
|
if (session.projectRoot) {
|
|
39
|
-
idx.byProjectRoot[session.projectRoot] = session;
|
|
51
|
+
idx.byProjectRoot[projectKey(session.projectRoot, session.engine)] = session;
|
|
40
52
|
}
|
|
41
53
|
saveIndex(idx);
|
|
42
54
|
}
|
|
@@ -45,8 +57,32 @@ export function isSessionInitialized(id) {
|
|
|
45
57
|
const idx = loadIndex();
|
|
46
58
|
return idx.byId[id]?.initialized ?? false;
|
|
47
59
|
}
|
|
48
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Get the last session for a project, optionally filtered by engine.
|
|
62
|
+
* When engine is provided, only returns a session owned by that engine.
|
|
63
|
+
* Falls back to legacy unqualified key if no engine-specific entry exists
|
|
64
|
+
* (for backward compatibility with pre-engine sessions).
|
|
65
|
+
*/
|
|
66
|
+
export function getLastSessionForProject(projectRoot, engine) {
|
|
49
67
|
const idx = loadIndex();
|
|
68
|
+
// Try engine-qualified key first
|
|
69
|
+
if (engine) {
|
|
70
|
+
const qualified = idx.byProjectRoot[projectKey(projectRoot, engine)];
|
|
71
|
+
if (qualified)
|
|
72
|
+
return qualified;
|
|
73
|
+
// Fallback: check unqualified key for legacy sessions that match engine
|
|
74
|
+
const legacy = idx.byProjectRoot[projectRoot];
|
|
75
|
+
if (legacy && (legacy.engine === engine || !legacy.engine)) {
|
|
76
|
+
// Migrate: promote to engine-qualified key and remove stale legacy entry
|
|
77
|
+
// so no other engine can claim it via the same fallback path.
|
|
78
|
+
idx.byProjectRoot[projectKey(projectRoot, engine)] = { ...legacy, engine };
|
|
79
|
+
delete idx.byProjectRoot[projectRoot];
|
|
80
|
+
saveIndex(idx);
|
|
81
|
+
return { ...legacy, engine };
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
// No engine filter — return whatever is there (unqualified key)
|
|
50
86
|
return idx.byProjectRoot[projectRoot] ?? null;
|
|
51
87
|
}
|
|
52
88
|
export function getSessionById(id) {
|
package/dist/types.d.ts
CHANGED
package/miaco/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# 🔧 miaco - Engineering World Terminal Agent
|
|
2
|
+
|
|
3
|
+
**miaco** (pronounced mee-AH-koh) is the **Engineering World CLI Agent** within the mia-code ecosystem. While `miatel` handles story world and `miawa` handles ceremony, miaco is the terminal interface for **schema design, validation, and system architecture**.
|
|
4
|
+
|
|
5
|
+
## 🗺️ Kinship Map
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/src/mia-code/ ← Parent Package
|
|
9
|
+
├── miaco/ ← Engineering World CLI (this one)
|
|
10
|
+
├── miatel/ ← Story World CLI
|
|
11
|
+
└── miawa/ ← Ceremony World CLI
|
|
12
|
+
|
|
13
|
+
CONNECTS TO:
|
|
14
|
+
├── /workspace/langchain/.../narrative-tracing/ ← Tracing adapters
|
|
15
|
+
├── /workspace/langgraph/.../narrative-intelligence/ ← Analysis toolkit
|
|
16
|
+
└── /src/coaia-planning/ ← Structural tension
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What miaco Does
|
|
20
|
+
|
|
21
|
+
### Schema Operations
|
|
22
|
+
```bash
|
|
23
|
+
miaco schema design --name 'HeroJourney' --type story
|
|
24
|
+
miaco schema list --type character
|
|
25
|
+
miaco schema export --name hero_journey --output ./schema.json
|
|
26
|
+
miaco schema migrate --from v1 --to v2
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Validation Operations
|
|
30
|
+
```bash
|
|
31
|
+
miaco validate ncp --file ./story.ncp.json --strict
|
|
32
|
+
miaco validate beat --file ./beat.json
|
|
33
|
+
miaco validate coherence --session session_123
|
|
34
|
+
miaco validate types --project ./tsconfig.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Tracing Operations
|
|
38
|
+
```bash
|
|
39
|
+
miaco trace start --session my-session --story hero-journey --langfuse
|
|
40
|
+
miaco trace log --event BEAT_GENERATED --data '{"beat_id": "beat_001"}'
|
|
41
|
+
miaco trace end --export ./trace.json
|
|
42
|
+
miaco trace list --limit 10
|
|
43
|
+
miaco trace view trace_abc123 --format timeline
|
|
44
|
+
miaco trace correlation --session my-session --story hero-journey
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Structural Tension Chart Operations
|
|
48
|
+
```bash
|
|
49
|
+
miaco chart create --outcome 'Working CLI' --reality 'Scaffolding exists'
|
|
50
|
+
miaco chart list
|
|
51
|
+
miaco chart add-step --chart chart_123 --title 'Build commands' --reality 'Started'
|
|
52
|
+
miaco chart complete --step 'Build commands'
|
|
53
|
+
miaco chart review --chart chart_123
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd /src/mia-code/miaco
|
|
60
|
+
npm install
|
|
61
|
+
npm run build
|
|
62
|
+
npm link # optional, for global install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## The Three Universes Lens
|
|
66
|
+
|
|
67
|
+
miaco primarily represents **Engineering World (Mia)**:
|
|
68
|
+
|
|
69
|
+
| Universe | Lens | Key Question |
|
|
70
|
+
|----------|------|--------------|
|
|
71
|
+
| 🔧 ENGINEER | Mia (this one) | Is the schema valid? Are types correct? |
|
|
72
|
+
| 🙏 CEREMONY | Ava8 | Is K'é honored? Is there sacred pause? |
|
|
73
|
+
| 📖 STORY_ENGINE | Miette | Is the arc coherent? Do themes thread? |
|
|
74
|
+
|
|
75
|
+
## Structural Tension Charts
|
|
76
|
+
|
|
77
|
+
Based on Robert Fritz's creative process:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
┌─────────────────────────────────────────┐
|
|
81
|
+
│ DESIRED OUTCOME │
|
|
82
|
+
│ What you want to CREATE (not fix) │
|
|
83
|
+
│ │
|
|
84
|
+
│ ↑ STRUCTURAL TENSION ↑ │
|
|
85
|
+
│ │
|
|
86
|
+
│ CURRENT REALITY │
|
|
87
|
+
│ Honest factual assessment │
|
|
88
|
+
└─────────────────────────────────────────┘
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The tension between outcome and reality drives creative advancement.
|
|
92
|
+
|
|
93
|
+
## Cross-System Tracing
|
|
94
|
+
|
|
95
|
+
miaco provides correlation headers for unified traces across:
|
|
96
|
+
- LangChain narrative-tracing
|
|
97
|
+
- LangGraph narrative-intelligence
|
|
98
|
+
- Miadi webhooks
|
|
99
|
+
- Storytelling package
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
miaco trace correlation --session my-session --story hero-journey
|
|
103
|
+
# Outputs:
|
|
104
|
+
# X-Narrative-Trace-Id: trace_abc123
|
|
105
|
+
# X-Session-Id: my-session
|
|
106
|
+
# X-Story-Id: hero-journey
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Run in development mode
|
|
113
|
+
npm run dev
|
|
114
|
+
|
|
115
|
+
# Build TypeScript
|
|
116
|
+
npm run build
|
|
117
|
+
|
|
118
|
+
# Run built version
|
|
119
|
+
npm start
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
*miaco: Where architecture becomes observable.*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/commands/chart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,YAAY,SACoC,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart command - Structural tension chart operations
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { SessionStorage } from "../storage.js";
|
|
7
|
+
const CHARTS_FILE = "charts.jsonl";
|
|
8
|
+
export const chartCommand = new Command("chart")
|
|
9
|
+
.description("Structural tension chart operations (COAIA)");
|
|
10
|
+
chartCommand
|
|
11
|
+
.command("create")
|
|
12
|
+
.description("Create a new structural tension chart")
|
|
13
|
+
.requiredOption("--outcome <text>", "Desired outcome (what you want to CREATE)")
|
|
14
|
+
.requiredOption("--reality <text>", "Current reality (factual assessment)")
|
|
15
|
+
.option("--due <date>", "Due date (ISO format)")
|
|
16
|
+
.option("--session <id>", "Session ID")
|
|
17
|
+
.option("--json", "Output JSON for programmatic parsing")
|
|
18
|
+
.action(async (opts) => {
|
|
19
|
+
const storage = new SessionStorage({ sessionId: opts.session });
|
|
20
|
+
const chartId = `chart_${Date.now().toString(36)}`;
|
|
21
|
+
const chart = {
|
|
22
|
+
id: chartId,
|
|
23
|
+
outcome: opts.outcome,
|
|
24
|
+
reality: opts.reality,
|
|
25
|
+
dueDate: opts.due,
|
|
26
|
+
steps: [],
|
|
27
|
+
createdAt: Date.now(),
|
|
28
|
+
updatedAt: Date.now()
|
|
29
|
+
};
|
|
30
|
+
storage.append(CHARTS_FILE, chart);
|
|
31
|
+
if (opts.json) {
|
|
32
|
+
console.log(JSON.stringify({ success: true, chart }));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
console.log(chalk.bold("🔧 Creating Structural Tension Chart"));
|
|
36
|
+
console.log();
|
|
37
|
+
console.log(chalk.dim(" ┌─────────────────────────────────────────┐"));
|
|
38
|
+
console.log(chalk.dim(" │ DESIRED OUTCOME │"));
|
|
39
|
+
console.log(chalk.dim(` │ ${opts.outcome.substring(0, 39).padEnd(39)} │`));
|
|
40
|
+
console.log(chalk.dim(" │ │"));
|
|
41
|
+
console.log(chalk.dim(" │ ↑ STRUCTURAL TENSION ↑ │"));
|
|
42
|
+
console.log(chalk.dim(" │ │"));
|
|
43
|
+
console.log(chalk.dim(" │ CURRENT REALITY │"));
|
|
44
|
+
console.log(chalk.dim(` │ ${opts.reality.substring(0, 39).padEnd(39)} │`));
|
|
45
|
+
console.log(chalk.dim(" └─────────────────────────────────────────┘"));
|
|
46
|
+
console.log();
|
|
47
|
+
console.log(chalk.green(` ✓ Chart created: ${chartId}`));
|
|
48
|
+
console.log(chalk.dim(` Session: ${storage.getSessionId()}`));
|
|
49
|
+
console.log(chalk.dim(" Add action steps with: miaco chart add-step --chart " + chartId));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
chartCommand
|
|
53
|
+
.command("list")
|
|
54
|
+
.description("List active structural tension charts")
|
|
55
|
+
.option("--session <id>", "Session ID")
|
|
56
|
+
.option("--json", "Output JSON for programmatic parsing")
|
|
57
|
+
.action(async (opts) => {
|
|
58
|
+
const storage = new SessionStorage({ sessionId: opts.session });
|
|
59
|
+
const charts = storage.readAll(CHARTS_FILE);
|
|
60
|
+
if (opts.json) {
|
|
61
|
+
console.log(JSON.stringify({ charts }));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(chalk.bold("🔧 Active Charts"));
|
|
65
|
+
console.log(chalk.dim(` Session: ${storage.getSessionId()}`));
|
|
66
|
+
console.log();
|
|
67
|
+
if (charts.length === 0) {
|
|
68
|
+
console.log(chalk.dim(" No charts created yet. Use `miaco chart create` to begin."));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
charts.forEach((chart, i) => {
|
|
72
|
+
const completedSteps = chart.steps.filter(s => s.completed).length;
|
|
73
|
+
const totalSteps = chart.steps.length;
|
|
74
|
+
const progress = totalSteps > 0 ? `${completedSteps}/${totalSteps} steps` : "no steps";
|
|
75
|
+
console.log(chalk.bold(` ${i + 1}. ${chart.id}`));
|
|
76
|
+
console.log(chalk.dim(` Outcome: ${chart.outcome.substring(0, 50)}...`));
|
|
77
|
+
console.log(chalk.dim(` Reality: ${chart.reality.substring(0, 50)}...`));
|
|
78
|
+
console.log(chalk.dim(` Progress: ${progress}`));
|
|
79
|
+
if (chart.dueDate) {
|
|
80
|
+
console.log(chalk.dim(` Due: ${chart.dueDate}`));
|
|
81
|
+
}
|
|
82
|
+
console.log();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
chartCommand
|
|
88
|
+
.command("add-step")
|
|
89
|
+
.description("Add an action step to a chart")
|
|
90
|
+
.requiredOption("--chart <id>", "Chart ID")
|
|
91
|
+
.requiredOption("--title <text>", "Action step title")
|
|
92
|
+
.requiredOption("--reality <text>", "Current reality for this step")
|
|
93
|
+
.option("--session <id>", "Session ID")
|
|
94
|
+
.option("--json", "Output JSON for programmatic parsing")
|
|
95
|
+
.action(async (opts) => {
|
|
96
|
+
const storage = new SessionStorage({ sessionId: opts.session });
|
|
97
|
+
const chart = storage.findById(CHARTS_FILE, opts.chart);
|
|
98
|
+
if (!chart) {
|
|
99
|
+
if (opts.json) {
|
|
100
|
+
console.log(JSON.stringify({ success: false, error: "Chart not found" }));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.log(chalk.yellow(` ⚠ Chart not found: ${opts.chart}`));
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const stepId = `step_${Date.now().toString(36)}`;
|
|
108
|
+
const step = {
|
|
109
|
+
id: stepId,
|
|
110
|
+
title: opts.title,
|
|
111
|
+
reality: opts.reality,
|
|
112
|
+
completed: false
|
|
113
|
+
};
|
|
114
|
+
const updated = storage.update(CHARTS_FILE, opts.chart, (c) => ({
|
|
115
|
+
...c,
|
|
116
|
+
steps: [...c.steps, step],
|
|
117
|
+
updatedAt: Date.now()
|
|
118
|
+
}));
|
|
119
|
+
if (opts.json) {
|
|
120
|
+
console.log(JSON.stringify({ success: updated, step }));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
console.log(chalk.bold("🔧 Adding Action Step"));
|
|
124
|
+
console.log(chalk.dim(` Chart: ${opts.chart}`));
|
|
125
|
+
console.log(chalk.dim(` Step: ${opts.title}`));
|
|
126
|
+
console.log(chalk.dim(` Reality: ${opts.reality}`));
|
|
127
|
+
console.log();
|
|
128
|
+
console.log(chalk.green(` ✓ Step added: ${stepId}`));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
chartCommand
|
|
132
|
+
.command("complete")
|
|
133
|
+
.description("Mark an action step as complete")
|
|
134
|
+
.requiredOption("--step <name>", "Action step name or ID")
|
|
135
|
+
.option("--session <id>", "Session ID")
|
|
136
|
+
.option("--json", "Output JSON for programmatic parsing")
|
|
137
|
+
.action(async (opts) => {
|
|
138
|
+
const storage = new SessionStorage({ sessionId: opts.session });
|
|
139
|
+
const charts = storage.readAll(CHARTS_FILE);
|
|
140
|
+
let found = false;
|
|
141
|
+
for (const chart of charts) {
|
|
142
|
+
const stepIndex = chart.steps.findIndex(s => s.id === opts.step || s.title.toLowerCase() === opts.step.toLowerCase());
|
|
143
|
+
if (stepIndex !== -1) {
|
|
144
|
+
storage.update(CHARTS_FILE, chart.id, (c) => {
|
|
145
|
+
c.steps[stepIndex].completed = true;
|
|
146
|
+
c.steps[stepIndex].completedAt = Date.now();
|
|
147
|
+
c.updatedAt = Date.now();
|
|
148
|
+
return c;
|
|
149
|
+
});
|
|
150
|
+
found = true;
|
|
151
|
+
if (opts.json) {
|
|
152
|
+
console.log(JSON.stringify({ success: true, chartId: chart.id, step: chart.steps[stepIndex] }));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
console.log(chalk.bold("🔧 Completing Action Step"));
|
|
156
|
+
console.log(chalk.dim(` Step: ${opts.step}`));
|
|
157
|
+
console.log(chalk.green(` ✓ Step marked complete`));
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (!found) {
|
|
163
|
+
if (opts.json) {
|
|
164
|
+
console.log(JSON.stringify({ success: false, error: "Step not found" }));
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(chalk.yellow(` ⚠ Step not found: ${opts.step}`));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
chartCommand
|
|
172
|
+
.command("review")
|
|
173
|
+
.description("Creator Moment of Truth - review chart progress")
|
|
174
|
+
.requiredOption("--chart <id>", "Chart ID to review")
|
|
175
|
+
.option("--session <id>", "Session ID")
|
|
176
|
+
.option("--json", "Output JSON for programmatic parsing")
|
|
177
|
+
.action(async (opts) => {
|
|
178
|
+
const storage = new SessionStorage({ sessionId: opts.session });
|
|
179
|
+
const chart = storage.findById(CHARTS_FILE, opts.chart);
|
|
180
|
+
if (!chart) {
|
|
181
|
+
if (opts.json) {
|
|
182
|
+
console.log(JSON.stringify({ success: false, error: "Chart not found" }));
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
console.log(chalk.yellow(` ⚠ Chart not found: ${opts.chart}`));
|
|
186
|
+
}
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const completedSteps = chart.steps.filter(s => s.completed);
|
|
190
|
+
const pendingSteps = chart.steps.filter(s => !s.completed);
|
|
191
|
+
if (opts.json) {
|
|
192
|
+
console.log(JSON.stringify({
|
|
193
|
+
chart,
|
|
194
|
+
completedSteps: completedSteps.length,
|
|
195
|
+
pendingSteps: pendingSteps.length,
|
|
196
|
+
progress: chart.steps.length > 0
|
|
197
|
+
? Math.round((completedSteps.length / chart.steps.length) * 100)
|
|
198
|
+
: 0
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
console.log(chalk.bold("🔧 Creator Moment of Truth"));
|
|
203
|
+
console.log(chalk.dim(` Chart: ${opts.chart}`));
|
|
204
|
+
console.log();
|
|
205
|
+
console.log(chalk.bold(" OUTCOME:"));
|
|
206
|
+
console.log(chalk.dim(` ${chart.outcome}`));
|
|
207
|
+
console.log();
|
|
208
|
+
console.log(chalk.bold(" CURRENT REALITY:"));
|
|
209
|
+
console.log(chalk.dim(` ${chart.reality}`));
|
|
210
|
+
console.log();
|
|
211
|
+
console.log(chalk.bold(" PROGRESS:"));
|
|
212
|
+
console.log(chalk.dim(` Completed: ${completedSteps.length} steps`));
|
|
213
|
+
console.log(chalk.dim(` Pending: ${pendingSteps.length} steps`));
|
|
214
|
+
console.log();
|
|
215
|
+
console.log(chalk.dim(" Four-step review process:"));
|
|
216
|
+
console.log(chalk.dim(" 1. Acknowledge - What did we expect vs deliver?"));
|
|
217
|
+
console.log(chalk.dim(" 2. Analyze - What caused the discrepancy?"));
|
|
218
|
+
console.log(chalk.dim(" 3. Plan - What adjustments are needed?"));
|
|
219
|
+
console.log(chalk.dim(" 4. Feedback - What did we learn?"));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../src/commands/chart.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAC;AAElE,MAAM,WAAW,GAAG,cAAc,CAAC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,6CAA6C,CAAC,CAAC;AAE9D,YAAY;KACT,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,uCAAuC,CAAC;KACpD,cAAc,CAAC,kBAAkB,EAAE,2CAA2C,CAAC;KAC/E,cAAc,CAAC,kBAAkB,EAAE,sCAAsC,CAAC;KAC1E,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC;KAC/C,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAAC;KACtC,MAAM,CAAC,QAAQ,EAAE,sCAAsC,CAAC;KACxD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;IAEnD,MAAM,KAAK,GAAU;QACnB,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,IAAI,CA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AAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompose.d.ts","sourceRoot":"","sources":["../../src/commands/decompose.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,eAAO,MAAM,gBAAgB,SAkG1B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* miaco decompose — CLI command for multi-engine prompt decomposition
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { decomposeAndStore, listDecompositions, loadDecomposition, } from "../decompose.js";
|
|
7
|
+
export const decomposeCommand = new Command("decompose")
|
|
8
|
+
.description("🔧 Prompt decomposition via Four Directions (multi-engine)")
|
|
9
|
+
.addCommand(new Command("run")
|
|
10
|
+
.description("Decompose a prompt using the specified engine")
|
|
11
|
+
.requiredOption("-p, --prompt <text>", "Prompt to decompose")
|
|
12
|
+
.option("-e, --engine <engine>", "Engine: copilot | claude | gemini", "copilot")
|
|
13
|
+
.option("-m, --model <model>", "Model override")
|
|
14
|
+
.option("--parent <uuid>", "Parent PDE UUID for nesting")
|
|
15
|
+
.option("-w, --workdir <path>", "Working directory for .pde/ storage")
|
|
16
|
+
.option("--json", "Output raw JSON")
|
|
17
|
+
.action(async (opts) => {
|
|
18
|
+
// 🧠 MIAC-18: Prevent premium model usage for decompose with copilot engine
|
|
19
|
+
if (opts.engine === "copilot" && opts.model) {
|
|
20
|
+
const modelLower = opts.model.toLowerCase();
|
|
21
|
+
if (modelLower.includes("opus") || modelLower.includes("sonnet")) {
|
|
22
|
+
console.error(chalk.red("🧠: Error: Using 'opus' or 'sonnet' models with the 'copilot' engine for 'decompose' is not permitted as it consumes premium tokens unnecessarily. Please use a cost-effective alternative. Optimal choices are `copilot -m haiku` or `copilot -m gpt-5-mini`."));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const stored = await decomposeAndStore({
|
|
28
|
+
prompt: opts.prompt,
|
|
29
|
+
engine: opts.engine,
|
|
30
|
+
model: opts.model,
|
|
31
|
+
workdir: opts.workdir,
|
|
32
|
+
parentPdeId: opts.parent,
|
|
33
|
+
});
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
console.log(JSON.stringify(stored, null, 2));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log(chalk.bold(`🔧 Decomposition complete`));
|
|
39
|
+
console.log(chalk.dim(` Engine: ${stored.engine}${stored.model ? ` (${stored.model})` : ""}`));
|
|
40
|
+
console.log(chalk.dim(` ID: ${stored.id}`));
|
|
41
|
+
console.log(chalk.dim(` Stored: .pde/${stored.folder_name || stored.id}/`));
|
|
42
|
+
if (stored.parent_pde_id) {
|
|
43
|
+
console.log(chalk.dim(` Parent: ${stored.parent_pde_id}`));
|
|
44
|
+
}
|
|
45
|
+
console.log();
|
|
46
|
+
console.log(chalk.bold(" Primary:"), `${stored.result.primary.action} → ${stored.result.primary.target}`);
|
|
47
|
+
console.log(chalk.bold(" Secondary:"), `${stored.result.secondary.length} intents`);
|
|
48
|
+
console.log(chalk.bold(" Actions:"), `${stored.result.actionStack.length} items`);
|
|
49
|
+
console.log(chalk.bold(" Ambiguities:"), `${stored.result.ambiguities.length} flags`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
console.error(chalk.red(`Error: ${err.message}`));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}))
|
|
57
|
+
.addCommand(new Command("list")
|
|
58
|
+
.description("List stored decompositions")
|
|
59
|
+
.option("-w, --workdir <path>", "Working directory")
|
|
60
|
+
.option("-l, --limit <n>", "Limit results", "10")
|
|
61
|
+
.option("--json", "Output raw JSON")
|
|
62
|
+
.action((opts) => {
|
|
63
|
+
const items = listDecompositions(opts.workdir || process.cwd(), parseInt(opts.limit));
|
|
64
|
+
if (opts.json) {
|
|
65
|
+
console.log(JSON.stringify(items.map(i => ({
|
|
66
|
+
id: i.id, timestamp: i.timestamp, engine: i.engine,
|
|
67
|
+
primary: `${i.result.primary.action} → ${i.result.primary.target}`,
|
|
68
|
+
})), null, 2));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
if (items.length === 0) {
|
|
72
|
+
console.log(chalk.dim(" No decompositions stored in .pde/"));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const item of items) {
|
|
76
|
+
console.log(` ${chalk.dim(item.timestamp)} ${chalk.bold(item.id.substring(0, 8))} [${item.engine}] ${item.result.primary.action} → ${item.result.primary.target}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}))
|
|
80
|
+
.addCommand(new Command("get")
|
|
81
|
+
.description("Get a stored decomposition by ID")
|
|
82
|
+
.argument("<id>", "Decomposition ID")
|
|
83
|
+
.option("-w, --workdir <path>", "Working directory")
|
|
84
|
+
.option("--json", "Output raw JSON")
|
|
85
|
+
.action((id, opts) => {
|
|
86
|
+
const item = loadDecomposition(opts.workdir || process.cwd(), id);
|
|
87
|
+
if (!item) {
|
|
88
|
+
console.error(chalk.red(`Not found: ${id}`));
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
if (opts.json) {
|
|
92
|
+
console.log(JSON.stringify(item, null, 2));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.log(JSON.stringify(item, null, 2));
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
//# sourceMappingURL=decompose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decompose.js","sourceRoot":"","sources":["../../src/commands/decompose.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAC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CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,aAAa,SACwB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema command - NCP schema design and management
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
export const schemaCommand = new Command("schema")
|
|
7
|
+
.description("NCP schema design and management");
|
|
8
|
+
schemaCommand
|
|
9
|
+
.command("design")
|
|
10
|
+
.description("Design a new NCP schema")
|
|
11
|
+
.requiredOption("-n, --name <name>", "Schema name")
|
|
12
|
+
.option("--type <type>", "Schema type: story, character, beat, theme")
|
|
13
|
+
.option("--extends <base>", "Base schema to extend")
|
|
14
|
+
.action(async (opts) => {
|
|
15
|
+
console.log(chalk.bold("🔧 Designing NCP Schema"));
|
|
16
|
+
console.log(chalk.dim(` Name: ${opts.name}`));
|
|
17
|
+
console.log(chalk.dim(` Type: ${opts.type || "custom"}`));
|
|
18
|
+
if (opts.extends)
|
|
19
|
+
console.log(chalk.dim(` Extends: ${opts.extends}`));
|
|
20
|
+
console.log();
|
|
21
|
+
const schemaId = opts.name.toLowerCase().replace(/\s+/g, '_');
|
|
22
|
+
console.log(chalk.green(` ✓ Schema designed: ${schemaId}`));
|
|
23
|
+
console.log(chalk.dim(" Export with: miaco schema export --name " + schemaId));
|
|
24
|
+
});
|
|
25
|
+
schemaCommand
|
|
26
|
+
.command("list")
|
|
27
|
+
.description("List available schemas")
|
|
28
|
+
.option("--type <type>", "Filter by type")
|
|
29
|
+
.action(async (opts) => {
|
|
30
|
+
console.log(chalk.bold("🔧 Available Schemas"));
|
|
31
|
+
console.log(chalk.dim(` Type: ${opts.type || "all"}`));
|
|
32
|
+
console.log();
|
|
33
|
+
console.log(chalk.dim(" Built-in NCP schemas:"));
|
|
34
|
+
console.log(chalk.dim(" - StoryBeat (beat)"));
|
|
35
|
+
console.log(chalk.dim(" - CharacterArcState (character)"));
|
|
36
|
+
console.log(chalk.dim(" - NCPState (story)"));
|
|
37
|
+
console.log(chalk.dim(" - ThematicThread (theme)"));
|
|
38
|
+
console.log();
|
|
39
|
+
console.log(chalk.dim(" Custom schemas: 0"));
|
|
40
|
+
});
|
|
41
|
+
schemaCommand
|
|
42
|
+
.command("export")
|
|
43
|
+
.description("Export schema to JSON Schema format")
|
|
44
|
+
.requiredOption("-n, --name <name>", "Schema name")
|
|
45
|
+
.option("-o, --output <path>", "Output file path")
|
|
46
|
+
.action(async (opts) => {
|
|
47
|
+
console.log(chalk.bold("🔧 Exporting Schema"));
|
|
48
|
+
console.log(chalk.dim(` Schema: ${opts.name}`));
|
|
49
|
+
console.log(chalk.dim(` Output: ${opts.output || "stdout"}`));
|
|
50
|
+
console.log();
|
|
51
|
+
console.log(chalk.yellow(" ⚠ Schema not found. Use `miaco schema list` to see available."));
|
|
52
|
+
});
|
|
53
|
+
schemaCommand
|
|
54
|
+
.command("migrate")
|
|
55
|
+
.description("Generate migration between schema versions")
|
|
56
|
+
.requiredOption("--from <version>", "Source version")
|
|
57
|
+
.requiredOption("--to <version>", "Target version")
|
|
58
|
+
.option("-n, --name <name>", "Schema name")
|
|
59
|
+
.action(async (opts) => {
|
|
60
|
+
console.log(chalk.bold("🔧 Schema Migration"));
|
|
61
|
+
console.log(chalk.dim(` Schema: ${opts.name || "all"}`));
|
|
62
|
+
console.log(chalk.dim(` From: ${opts.from} → To: ${opts.to}`));
|
|
63
|
+
console.log();
|
|
64
|
+
console.log(chalk.dim(" No migrations needed (or no schemas to migrate)."));
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=schema.js.map
|