muonroi-cli 1.8.0 → 1.8.1
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/LICENSE +21 -21
- package/README.md +122 -122
- package/dist/src/agent-harness/mock-model.js +112 -4
- package/dist/src/cli/cost-forensics.js +17 -14
- package/dist/src/council/prompts.js +20 -20
- package/dist/src/flow/compaction/index.d.ts +1 -0
- package/dist/src/flow/compaction/index.js +4 -0
- package/dist/src/generated/version.d.ts +1 -1
- package/dist/src/generated/version.js +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/lsp/manager.js +11 -3
- package/dist/src/lsp/manager.test.js +39 -0
- package/dist/src/mcp/auto-setup.js +0 -8
- package/dist/src/mcp/oauth-callback.js +2 -2
- package/dist/src/mcp/parse-headers.test.js +14 -14
- package/dist/src/mcp/self-verify-jobs.d.ts +1 -0
- package/dist/src/mcp/self-verify-runner.js +1 -1
- package/dist/src/mcp/setup-guide-text.js +74 -74
- package/dist/src/mcp/smoke.test.js +43 -43
- package/dist/src/ops/doctor.js +7 -7
- package/dist/src/orchestrator/__tests__/batch-turn-runner.test.js +1 -0
- package/dist/src/orchestrator/__tests__/message-processor.test.js +1 -0
- package/dist/src/orchestrator/__tests__/prompts.test.d.ts +1 -0
- package/dist/src/orchestrator/__tests__/prompts.test.js +88 -0
- package/dist/src/orchestrator/__tests__/sub-session-delegation.test.d.ts +1 -0
- package/dist/src/orchestrator/__tests__/sub-session-delegation.test.js +507 -0
- package/dist/src/orchestrator/auto-commit.js +9 -7
- package/dist/src/orchestrator/message-processor.d.ts +2 -0
- package/dist/src/orchestrator/message-processor.js +7 -0
- package/dist/src/orchestrator/orchestrator.d.ts +3 -0
- package/dist/src/orchestrator/orchestrator.js +362 -28
- package/dist/src/orchestrator/pending-calls.js +2 -1
- package/dist/src/orchestrator/preprocessor.js +3 -2
- package/dist/src/orchestrator/prompts.d.ts +8 -0
- package/dist/src/orchestrator/prompts.js +65 -18
- package/dist/src/orchestrator/sub-agent-cap.d.ts +2 -0
- package/dist/src/orchestrator/sub-agent-cap.js +12 -4
- package/dist/src/orchestrator/subagent-compactor.d.ts +7 -0
- package/dist/src/orchestrator/subagent-compactor.js +65 -14
- package/dist/src/orchestrator/subagent-compactor.spec.js +125 -9
- package/dist/src/orchestrator/tool-engine.d.ts +2 -0
- package/dist/src/orchestrator/tool-engine.js +80 -21
- package/dist/src/orchestrator/turn-runner-deps.d.ts +2 -0
- package/dist/src/pil/__tests__/llm-classify.test.js +79 -1
- package/dist/src/pil/layer1-intent.js +37 -37
- package/dist/src/pil/layer2_5-ponytail.js +8 -8
- package/dist/src/pil/llm-classify.d.ts +11 -0
- package/dist/src/pil/llm-classify.js +193 -0
- package/dist/src/product-loop/done-gate.js +3 -3
- package/dist/src/product-loop/loop-driver.js +18 -18
- package/dist/src/product-loop/progress-snapshot.js +4 -4
- package/dist/src/providers/mcp-vision-bridge.js +48 -48
- package/dist/src/reporter/index.js +1 -1
- package/dist/src/scaffold/bb-ecosystem-apply.js +47 -47
- package/dist/src/scaffold/bb-quality-gate.js +5 -5
- package/dist/src/scaffold/continuation-prompt.js +60 -60
- package/dist/src/scaffold/init-new.js +453 -453
- package/dist/src/self-qa/__tests__/scenario-planner.test.js +3 -3
- package/dist/src/self-qa/agentic-loop.js +11 -2
- package/dist/src/storage/__tests__/hierarchical-session.test.d.ts +1 -0
- package/dist/src/storage/__tests__/hierarchical-session.test.js +161 -0
- package/dist/src/storage/__tests__/migrations.test.js +2 -2
- package/dist/src/storage/__tests__/sweep-stale-pending.test.js +2 -2
- package/dist/src/storage/index.d.ts +1 -1
- package/dist/src/storage/index.js +1 -1
- package/dist/src/storage/interaction-log.js +5 -5
- package/dist/src/storage/migrations.js +135 -123
- package/dist/src/storage/session-experience-store.js +4 -4
- package/dist/src/storage/sessions.js +43 -43
- package/dist/src/storage/transcript-response-entry.test.js +18 -5
- package/dist/src/storage/transcript.d.ts +2 -0
- package/dist/src/storage/transcript.js +223 -97
- package/dist/src/storage/usage.js +34 -17
- package/dist/src/storage/workspaces.js +12 -12
- package/dist/src/tools/native-tools.js +10 -1
- package/dist/src/tools/registry.d.ts +1 -0
- package/dist/src/tools/registry.js +30 -2
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/ui/app.js +0 -0
- package/dist/src/ui/slash/council-inspect.js +4 -4
- package/dist/src/ui/slash/expand.js +14 -1
- package/dist/src/ui/use-app-logic.js +0 -0
- package/dist/src/utils/__tests__/compaction-caps.test.js +9 -9
- package/dist/src/utils/__tests__/llm-deadline.test.js +16 -4
- package/dist/src/utils/__tests__/logger.test.d.ts +1 -0
- package/dist/src/utils/__tests__/logger.test.js +115 -0
- package/dist/src/utils/__tests__/settings-agent-first.test.d.ts +1 -0
- package/dist/src/utils/__tests__/settings-agent-first.test.js +48 -0
- package/dist/src/utils/clipboard-image.js +23 -23
- package/dist/src/utils/install-manager.d.ts +1 -0
- package/dist/src/utils/install-manager.js +76 -7
- package/dist/src/utils/install-manager.test.js +43 -1
- package/dist/src/utils/logger.d.ts +28 -0
- package/dist/src/utils/logger.js +171 -0
- package/dist/src/utils/settings.d.ts +9 -1
- package/dist/src/utils/settings.js +59 -22
- package/dist/src/utils/side-question.js +2 -2
- package/dist/src/utils/skills.js +3 -3
- package/dist/src/utils/update-checker.test.js +5 -1
- package/dist/src/verify/__tests__/coverage-parsers.test.js +30 -30
- package/package.json +1 -1
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
export function buildIdealContinuationPrompt(input) {
|
|
2
2
|
const { originalPrompt, projectDir, templateName, installedPackages } = input;
|
|
3
3
|
const packagesSuffix = installedPackages && installedPackages.length > 0 ? ` with packages: ${installedPackages.join(", ")}` : "";
|
|
4
|
-
return `You are continuing a /ideal product loop. The project has been scaffolded at ${projectDir} using the BB template ${templateName}${packagesSuffix}.
|
|
5
|
-
|
|
6
|
-
User's original request:
|
|
7
|
-
"${originalPrompt}"
|
|
8
|
-
|
|
9
|
-
You MUST implement this feature now. Do NOT ask the user for clarification unless a hard blocker is reached (missing API key, ambiguous schema requirement, etc.).
|
|
10
|
-
|
|
11
|
-
Execute these steps in order:
|
|
12
|
-
|
|
13
|
-
1. Discover structure (1-2 tool calls max)
|
|
14
|
-
- PREFERRED: if a \`muonroi-docs\` MCP tool is in your tool list (look for any \`mcp_*docs*_docs_search\` tool), call it with query \`"${templateName} structure overview"\`. This is faster than reading files.
|
|
15
|
-
- FALLBACK: list the project directory, then read whichever of \`README.md\`, \`AGENTS.md\`, \`Agent.md\`, \`EE-INTENT.md\` actually exist (do NOT assume — missing files are fine, just skip them).
|
|
16
|
-
- Identify: project name, main entry point (Program.cs / Gateway), modular boundaries, where to add new domain code.
|
|
17
|
-
|
|
18
|
-
IMPORTANT — Template sample files are REFERENCE ONLY:
|
|
19
|
-
- The BB template ships example code (e.g. \`todo-app.Catalog\`, sample \`TodoRepository\`, \`Catalog\` controller, \`DocTemplateDbContext\`, \`BaseTemplateDbContext\`) named after the template/demo, NOT after the user's project.
|
|
20
|
-
- Read AT MOST ONE such sample file to learn the convention, then DELETE all template sample directories before generating your real domain code. They are reference, not the user's feature.
|
|
21
|
-
- Do not re-read the same sample file repeatedly. If you need its pattern again, recall from memory or rely on \`docs.search\`.
|
|
22
|
-
- RENAME every file/class/namespace that still contains the literal token \`BaseTemplate\`, \`DocTemplate\`, or \`TemplateSample\` to a project-appropriate name BEFORE writing domain code. After cleanup, \`git grep -i basetemplate\` MUST return zero hits — the post-scaffold quality gate fails if any survive.
|
|
23
|
-
- DELETE any stub \`<projectName>.Catalog/\` directory that lives at server root next to \`server/src/Services/\` — \`dotnet new\` may emit a duplicate empty stub.
|
|
24
|
-
|
|
25
|
-
.NET / C# conventions to follow:
|
|
26
|
-
- Async methods MUST accept and forward \`CancellationToken\` to every downstream await; suffix names with \`Async\`.
|
|
27
|
-
- Prefer singular folder names that already exist in the template; if you add new folders, use \`Infrastructure\` (singular), \`Enums\` (plural), \`Authorization\` instead of "Permissioning".
|
|
28
|
-
- Namespace MUST mirror the folder path under the project, in PascalCase.
|
|
29
|
-
- DTO ≠ Entity. Don't return EF entities from controllers — always project to a DTO.
|
|
30
|
-
- DI registration uses \`AddX*\` extension methods in a static class under \`Extensions/\` or \`DependencyInjection/\`; wire them from \`Program.cs\`. Do not register services inline in \`Program.cs\`.
|
|
31
|
-
|
|
32
|
-
Frontend / client/ conventions (apply ONLY if a \`client/\` directory exists in the scaffold):
|
|
33
|
-
- NEVER delete or overwrite \`SemanticProvider\`, \`createSemanticRegistry\`, or any \`<Semantic ...>\` wrapper that the scaffold wrote into \`main.tsx\` / \`app.component.ts\`. The agent harness depends on them — removing them silently breaks all E2E specs. If you rewrite \`main.tsx\`, re-include the existing SemanticProvider block verbatim.
|
|
34
|
-
- Wrap every NEW user-visible region with \`<Semantic id="..." role="..." name="...">\` (composer, list, listitem, modal, statusbar). Pick \`role\` from the union in \`@muonroi/agent-harness-core/protocol\`.
|
|
35
|
-
- NEVER hardcode API URLs in components. Read from \`import.meta.env.VITE_API_BASE\` (React/Vite) or \`environment.apiBase\` (Angular). If \`.env.example\` does not exist yet, create it with a sensible default; never inline \`http://localhost:5000\` or similar in source.
|
|
36
|
-
- Put HTTP + DTO code under \`client/src/api/\`. Define request/response types in \`api/types.ts\` (mirror the C# DTO names). Components import a typed client; never call \`fetch\` directly.
|
|
37
|
-
- Every async view needs THREE states: loading, empty, error. Surface errors via a toast/notification component, not \`console.error\`. Provide an \`ErrorBoundary\` at the app shell.
|
|
38
|
-
- No inline \`style={{...}}\` literals — use CSS modules (\`*.module.css\`) or utility classes (Tailwind if scaffolded). If neither is present, write tokens + reset into \`src/styles/app.css\` and import it ONCE in main; reference variables via \`var(--color-...)\`.
|
|
39
|
-
- TypeScript MUST be strict. If \`tsconfig.json\` does not have \`"strict": true\`, add it. Run \`bunx tsc --noEmit\` before declaring done — it must exit 0.
|
|
40
|
-
- Run \`bun run build\` from \`client/\` before declaring done — it must exit 0 with zero browser-side console errors.
|
|
41
|
-
|
|
42
|
-
2. Design the feature
|
|
43
|
-
- List the domain entity(ies), DTOs, endpoints, persistence model.
|
|
44
|
-
- Match BB conventions (controller-per-resource, MediatR/CQRS if used, validation patterns observed in step 1).
|
|
45
|
-
- State your design in 5-10 lines before generating code.
|
|
46
|
-
|
|
47
|
-
3. Generate code
|
|
48
|
-
- Create files in the locations identified in step 1.
|
|
49
|
-
- Wire DI in Program.cs (use BB extension methods if present).
|
|
50
|
-
- Mirror existing patterns — same namespaces, attributes, error-handling style.
|
|
51
|
-
|
|
52
|
-
4. Verify
|
|
53
|
-
- Run \`dotnet build\` from the server root — must exit 0.
|
|
54
|
-
- If a \`client/\` directory exists, also run \`bun install\` and \`bun run build\` from \`client/\`.
|
|
55
|
-
- Report concrete evidence: build output excerpt + file list created.
|
|
56
|
-
|
|
57
|
-
5. Summarize
|
|
58
|
-
- 3-5 bullets: what was added, where, how to test manually.
|
|
59
|
-
|
|
60
|
-
Constraints:
|
|
61
|
-
- Don't re-scaffold. Don't run \`dotnet new\` again.
|
|
62
|
-
- Don't \`cd\` into ${projectDir} — your working directory is already there.
|
|
63
|
-
- Don't ask "do you want me to continue?" — proceed end-to-end.
|
|
4
|
+
return `You are continuing a /ideal product loop. The project has been scaffolded at ${projectDir} using the BB template ${templateName}${packagesSuffix}.
|
|
5
|
+
|
|
6
|
+
User's original request:
|
|
7
|
+
"${originalPrompt}"
|
|
8
|
+
|
|
9
|
+
You MUST implement this feature now. Do NOT ask the user for clarification unless a hard blocker is reached (missing API key, ambiguous schema requirement, etc.).
|
|
10
|
+
|
|
11
|
+
Execute these steps in order:
|
|
12
|
+
|
|
13
|
+
1. Discover structure (1-2 tool calls max)
|
|
14
|
+
- PREFERRED: if a \`muonroi-docs\` MCP tool is in your tool list (look for any \`mcp_*docs*_docs_search\` tool), call it with query \`"${templateName} structure overview"\`. This is faster than reading files.
|
|
15
|
+
- FALLBACK: list the project directory, then read whichever of \`README.md\`, \`AGENTS.md\`, \`Agent.md\`, \`EE-INTENT.md\` actually exist (do NOT assume — missing files are fine, just skip them).
|
|
16
|
+
- Identify: project name, main entry point (Program.cs / Gateway), modular boundaries, where to add new domain code.
|
|
17
|
+
|
|
18
|
+
IMPORTANT — Template sample files are REFERENCE ONLY:
|
|
19
|
+
- The BB template ships example code (e.g. \`todo-app.Catalog\`, sample \`TodoRepository\`, \`Catalog\` controller, \`DocTemplateDbContext\`, \`BaseTemplateDbContext\`) named after the template/demo, NOT after the user's project.
|
|
20
|
+
- Read AT MOST ONE such sample file to learn the convention, then DELETE all template sample directories before generating your real domain code. They are reference, not the user's feature.
|
|
21
|
+
- Do not re-read the same sample file repeatedly. If you need its pattern again, recall from memory or rely on \`docs.search\`.
|
|
22
|
+
- RENAME every file/class/namespace that still contains the literal token \`BaseTemplate\`, \`DocTemplate\`, or \`TemplateSample\` to a project-appropriate name BEFORE writing domain code. After cleanup, \`git grep -i basetemplate\` MUST return zero hits — the post-scaffold quality gate fails if any survive.
|
|
23
|
+
- DELETE any stub \`<projectName>.Catalog/\` directory that lives at server root next to \`server/src/Services/\` — \`dotnet new\` may emit a duplicate empty stub.
|
|
24
|
+
|
|
25
|
+
.NET / C# conventions to follow:
|
|
26
|
+
- Async methods MUST accept and forward \`CancellationToken\` to every downstream await; suffix names with \`Async\`.
|
|
27
|
+
- Prefer singular folder names that already exist in the template; if you add new folders, use \`Infrastructure\` (singular), \`Enums\` (plural), \`Authorization\` instead of "Permissioning".
|
|
28
|
+
- Namespace MUST mirror the folder path under the project, in PascalCase.
|
|
29
|
+
- DTO ≠ Entity. Don't return EF entities from controllers — always project to a DTO.
|
|
30
|
+
- DI registration uses \`AddX*\` extension methods in a static class under \`Extensions/\` or \`DependencyInjection/\`; wire them from \`Program.cs\`. Do not register services inline in \`Program.cs\`.
|
|
31
|
+
|
|
32
|
+
Frontend / client/ conventions (apply ONLY if a \`client/\` directory exists in the scaffold):
|
|
33
|
+
- NEVER delete or overwrite \`SemanticProvider\`, \`createSemanticRegistry\`, or any \`<Semantic ...>\` wrapper that the scaffold wrote into \`main.tsx\` / \`app.component.ts\`. The agent harness depends on them — removing them silently breaks all E2E specs. If you rewrite \`main.tsx\`, re-include the existing SemanticProvider block verbatim.
|
|
34
|
+
- Wrap every NEW user-visible region with \`<Semantic id="..." role="..." name="...">\` (composer, list, listitem, modal, statusbar). Pick \`role\` from the union in \`@muonroi/agent-harness-core/protocol\`.
|
|
35
|
+
- NEVER hardcode API URLs in components. Read from \`import.meta.env.VITE_API_BASE\` (React/Vite) or \`environment.apiBase\` (Angular). If \`.env.example\` does not exist yet, create it with a sensible default; never inline \`http://localhost:5000\` or similar in source.
|
|
36
|
+
- Put HTTP + DTO code under \`client/src/api/\`. Define request/response types in \`api/types.ts\` (mirror the C# DTO names). Components import a typed client; never call \`fetch\` directly.
|
|
37
|
+
- Every async view needs THREE states: loading, empty, error. Surface errors via a toast/notification component, not \`console.error\`. Provide an \`ErrorBoundary\` at the app shell.
|
|
38
|
+
- No inline \`style={{...}}\` literals — use CSS modules (\`*.module.css\`) or utility classes (Tailwind if scaffolded). If neither is present, write tokens + reset into \`src/styles/app.css\` and import it ONCE in main; reference variables via \`var(--color-...)\`.
|
|
39
|
+
- TypeScript MUST be strict. If \`tsconfig.json\` does not have \`"strict": true\`, add it. Run \`bunx tsc --noEmit\` before declaring done — it must exit 0.
|
|
40
|
+
- Run \`bun run build\` from \`client/\` before declaring done — it must exit 0 with zero browser-side console errors.
|
|
41
|
+
|
|
42
|
+
2. Design the feature
|
|
43
|
+
- List the domain entity(ies), DTOs, endpoints, persistence model.
|
|
44
|
+
- Match BB conventions (controller-per-resource, MediatR/CQRS if used, validation patterns observed in step 1).
|
|
45
|
+
- State your design in 5-10 lines before generating code.
|
|
46
|
+
|
|
47
|
+
3. Generate code
|
|
48
|
+
- Create files in the locations identified in step 1.
|
|
49
|
+
- Wire DI in Program.cs (use BB extension methods if present).
|
|
50
|
+
- Mirror existing patterns — same namespaces, attributes, error-handling style.
|
|
51
|
+
|
|
52
|
+
4. Verify
|
|
53
|
+
- Run \`dotnet build\` from the server root — must exit 0.
|
|
54
|
+
- If a \`client/\` directory exists, also run \`bun install\` and \`bun run build\` from \`client/\`.
|
|
55
|
+
- Report concrete evidence: build output excerpt + file list created.
|
|
56
|
+
|
|
57
|
+
5. Summarize
|
|
58
|
+
- 3-5 bullets: what was added, where, how to test manually.
|
|
59
|
+
|
|
60
|
+
Constraints:
|
|
61
|
+
- Don't re-scaffold. Don't run \`dotnet new\` again.
|
|
62
|
+
- Don't \`cd\` into ${projectDir} — your working directory is already there.
|
|
63
|
+
- Don't ask "do you want me to continue?" — proceed end-to-end.
|
|
64
64
|
- If you hit a blocker that genuinely needs the user, state EXACTLY which decision is blocking and stop.`;
|
|
65
65
|
}
|
|
66
66
|
//# sourceMappingURL=continuation-prompt.js.map
|