fifony 0.1.19 → 0.1.20-next.675ea21
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/FIFONY.md +4 -4
- package/README.md +10 -10
- package/app/dist/assets/{KeyboardShortcutsHelp-Z75R2hRw.js → KeyboardShortcutsHelp-DY-LvE5e.js} +1 -1
- package/app/dist/assets/OnboardingWizard-CUJljANw.js +1 -0
- package/app/dist/assets/{analytics.lazy-CXA9LrMl.js → analytics.lazy-B6YosS6d.js} +1 -1
- package/app/dist/assets/index-8bqCCQE2.js +42 -0
- package/app/dist/index.html +3 -3
- package/app/dist/manifest.webmanifest +3 -3
- package/app/dist/offline.html +2 -2
- package/app/dist/service-worker.js +1 -1
- package/app/public/manifest.webmanifest +3 -3
- package/app/public/offline.html +2 -2
- package/dist/agent/run-local.js +2 -6
- package/dist/agent/run-local.js.map +1 -1
- package/dist/{chunk-JUSVR3DW.js → chunk-737QCF4B.js} +6 -6
- package/dist/{chunk-JUSVR3DW.js.map → chunk-737QCF4B.js.map} +1 -1
- package/dist/mcp/server.js +1 -1
- package/package.json +2 -2
- package/app/dist/assets/OnboardingWizard-CYEoKVK-.js +0 -1
- package/app/dist/assets/index-DMURYaTH.js +0 -42
|
@@ -303,7 +303,7 @@ var PROMPT_TEMPLATES = {
|
|
|
303
303
|
// src/prompts/compile-review.stub.md
|
|
304
304
|
"integrations-agency-agents": '---\nagent:\n providers:\n - provider: claude\n role: planner\n profile: agency-senior-project-manager\n - provider: codex\n role: executor\n profile: agency-senior-developer\n - provider: claude\n role: reviewer\n profile: agency-code-reviewer\ncodex:\n command: "codex"\nclaude:\n command: "claude"\n---\n\nUse local agency agent profiles discovered from workspace or home directories.\nWorkspace: {{workspaceRoot}}\n',
|
|
305
305
|
// src/prompts/integrations-agency-agents.stub.md
|
|
306
|
-
"integrations-impeccable": '# Impeccable integration idea\n\nUse impeccable-oriented skills as a frontend review layer around
|
|
306
|
+
"integrations-impeccable": '# Impeccable integration idea\n\nUse impeccable-oriented skills as a frontend review layer around fifo issues.\n\nSuggested pattern:\n\n1. Use `agency-senior-developer` or `codex` as executor.\n2. Route UI-heavy issues to a reviewer prompt that explicitly asks for impeccable-style critique.\n3. Expose the resulting review through the fifo MCP prompts or as a follow-up review issue.\n\nSuggested labels:\n- frontend\n- ui\n- design-system\n\nSuggested reviewer prompt seed:\n"Review this implementation using impeccable standards for frontend quality, polish, hierarchy, spacing, responsiveness, and interaction clarity."\n',
|
|
307
307
|
// src/prompts/integrations-impeccable.stub.md
|
|
308
308
|
"issue-enhancer-description": 'You are helping improve issue metadata for a software execution queue.\nRewrite the description to be clearer, complete, and directly actionable.\nReturn strict JSON only with this schema:\n{ "field": "description", "value": "..." }\n\nCurrent title: {{title}}\nCurrent description: {{description}}\n\nRules:\n- Keep it concise but include meaningful acceptance criteria.\n- Use plain text only, with short paragraphs or bullet style.\n- Avoid markdown wrappers, quotes, and extra explanation.\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\n',
|
|
309
309
|
// src/prompts/issue-enhancer-description.stub.md
|
|
@@ -313,13 +313,13 @@ var PROMPT_TEMPLATES = {
|
|
|
313
313
|
// src/prompts/issue-planner.stub.md
|
|
314
314
|
"issue-planner-refine": "You are a senior technical execution planner refining an existing plan based on user feedback.\n\n## Original Issue\nTitle: {{title}}\nDescription: {{description}}\n\n## Current Plan (JSON)\n```json\n{{currentPlan}}\n```\n\n## User Feedback\n{{feedback}}\n\n## Instructions\n\nRevise the plan above to address the user's feedback precisely.\n\nRules:\n- Keep all parts of the plan that are NOT affected by the feedback unchanged.\n- Only modify, add, or remove elements that the feedback specifically requests.\n- Preserve the same JSON schema structure as the current plan.\n- Maintain step numbering consistency after changes.\n- If feedback asks to add steps, insert them in the logical position and renumber.\n- If feedback asks to remove steps, renumber remaining steps sequentially.\n- Update the summary if the overall direction changed.\n- Re-evaluate estimatedComplexity if the scope changed significantly.\n- Update suggestedPaths and suggestedLabels if affected by the changes.\n\nReturn strict JSON. No text outside JSON.\n",
|
|
315
315
|
// src/prompts/issue-planner-refine.stub.md
|
|
316
|
-
"mcp-integrate-client": "Integrate {{client}} with the local
|
|
316
|
+
"mcp-integrate-client": "Integrate {{client}} with the local fifo MCP server.\n\nGoal: {{goal}}\n\n{{integrationGuide}}\n\nUse the available fifo resources and tools instead of inventing your own persistence model.\n",
|
|
317
317
|
// src/prompts/mcp-integrate-client.stub.md
|
|
318
|
-
"mcp-integration-guide": '#
|
|
318
|
+
"mcp-integration-guide": '# fifo MCP integration\n\nWorkspace root: `{{workspaceRoot}}`\nPersistence root: `{{persistenceRoot}}`\nState root: `{{stateRoot}}`\n\nRecommended MCP client command:\n\n```json\n{\n "mcpServers": {\n "fifony": {\n "command": "npx",\n "args": ["fifony", "mcp", "--workspace", "{{workspaceRoot}}", "--persistence", "{{persistenceRoot}}"]\n }\n }\n}\n```\n\nExpected workflow:\n\n1. Read `fifony://guide/overview` and `fifony://state/summary`.\n2. Use `fifony.list_issues` or read `fifony://issues`.\n3. Create work with `fifony.create_issue`.\n4. Update workflow state with `fifony.update_issue_state`.\n5. Use the prompts exposed by this MCP server to structure planning or execution.\n\nThe MCP server is read-write against the same `s3db` filesystem store used by the fifo runtime.\n',
|
|
319
319
|
// src/prompts/mcp-integration-guide.stub.md
|
|
320
|
-
"mcp-issue": 'You are integrating with
|
|
320
|
+
"mcp-issue": 'You are integrating with fifo as the {{role}} using {{provider}}.\n\nIssue ID: {{id}}\nTitle: {{title}}\nState: {{state}}\nCapability category: {{capabilityCategory}}\n{{#if overlays.length}}\nOverlays: {{overlays | join ", "}}\n{{/if}}\n{{#if paths.length}}\nPaths: {{paths | join ", "}}\n{{/if}}\nDescription:\n{{description}}\n\nUse fifo as the source of truth:\n- Read the workflow contract from WORKFLOW.md if available.\n- Persist transitions through the fifo tools instead of inventing local state.\n- Keep outputs actionable and aligned with the tracked issue lifecycle.\n',
|
|
321
321
|
// src/prompts/mcp-issue.stub.md
|
|
322
|
-
"mcp-review-workflow": "Review the WORKFLOW.md for this
|
|
322
|
+
"mcp-review-workflow": "Review the WORKFLOW.md for this fifo workspace as {{provider}}.\n\nWorkspace: {{workspaceRoot}}\nWorkflow present: {{workflowPresent}}\n\nFocus on:\n- provider orchestration quality\n- hooks safety\n- prompt clarity\n- issue lifecycle correctness\n- what an MCP client needs in order to integrate cleanly\n",
|
|
323
323
|
// src/prompts/mcp-review-workflow.stub.md
|
|
324
324
|
"mcp-route-task": "Use this routing decision as the execution plan for the task.\n\n{{resolutionJson}}\n",
|
|
325
325
|
// src/prompts/mcp-route-task.stub.md
|
|
@@ -380,4 +380,4 @@ export {
|
|
|
380
380
|
renderPrompt,
|
|
381
381
|
renderPromptString
|
|
382
382
|
};
|
|
383
|
-
//# sourceMappingURL=chunk-
|
|
383
|
+
//# sourceMappingURL=chunk-737QCF4B.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/routing/capability-resolver.ts","../src/prompting.ts","../src/generated/prompts.ts"],"sourcesContent":["export type CapabilityResolverRole = \"planner\" | \"executor\" | \"reviewer\";\n\nexport type CapabilityResolverIssue = {\n id?: string;\n identifier?: string;\n title: string;\n description?: string;\n labels?: string[];\n paths?: string[];\n};\n\nexport type CapabilityResolverBaseProvider = {\n provider: string;\n role: CapabilityResolverRole;\n command: string;\n profile?: string;\n profilePath?: string;\n profileInstructions?: string;\n};\n\nexport type CapabilityResolverSuggestion = {\n provider: string;\n role: CapabilityResolverRole;\n profile: string;\n reason: string;\n};\n\nexport type CapabilityResolution = {\n category: string;\n rationale: string[];\n overlays: string[];\n providers: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOverride = {\n match?: {\n labels?: string[];\n terms?: string[];\n category?: string;\n paths?: string[];\n };\n category?: string;\n rationale?: string[];\n overlays?: string[];\n providers?: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOptions = {\n enabled?: boolean;\n overrides?: CapabilityResolverOverride[];\n};\n\nfunction tokenize(issue: CapabilityResolverIssue): string {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n return [\n issue.identifier ?? \"\",\n issue.title,\n issue.description ?? \"\",\n ...labels,\n ...(issue.paths ?? []),\n ].join(\" \").toLowerCase();\n}\n\nfunction normalizePath(value: string): string {\n return value.trim().replaceAll(\"\\\\\", \"/\").toLowerCase();\n}\n\nexport function inferCapabilityPaths(issue: CapabilityResolverIssue): string[] {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n const sources = [issue.title, issue.description ?? \"\", ...labels];\n const matches = new Set<string>();\n const pattern = /(?:[A-Za-z0-9._-]+\\/)+(?:[A-Za-z0-9._-]+)|(?:[A-Za-z0-9._-]+\\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|sass|less|html|md|mdx|json|yml|yaml|sql|sh))+/g;\n\n for (const source of sources) {\n for (const match of source.match(pattern) ?? []) {\n matches.add(normalizePath(match));\n }\n }\n\n return [...matches];\n}\n\nfunction getIssuePaths(issue: CapabilityResolverIssue): string[] {\n return [...new Set([\n ...(issue.paths ?? [])\n .filter((value): value is string => typeof value === \"string\" && value.trim().length > 0)\n .map(normalizePath),\n ...inferCapabilityPaths(issue),\n ])];\n}\n\nfunction hasAny(text: string, terms: string[]): boolean {\n return terms.some((term) => text.includes(term));\n}\n\nfunction hasPathMatch(paths: string[], fragments: string[] = [], extensions: string[] = []): boolean {\n return paths.some((path) => {\n if (fragments.some((fragment) => path.includes(fragment))) {\n return true;\n }\n\n return extensions.some((extension) => path.endsWith(extension));\n });\n}\n\nfunction buildResolution(\n category: string,\n rationale: string[],\n overlays: string[],\n providers: CapabilityResolverSuggestion[],\n): CapabilityResolution {\n return {\n category,\n rationale,\n overlays,\n providers,\n };\n}\n\nfunction uniq(values: string[]): string[] {\n return [...new Set(values.filter(Boolean))];\n}\n\nfunction matchesOverride(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n override: CapabilityResolverOverride,\n): boolean {\n const match = override.match ?? {};\n const issueLabels = new Set((issue.labels ?? []).map((label) => label.toLowerCase()));\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n\n if (match.category && match.category !== resolution.category) {\n return false;\n }\n\n if (match.labels?.length) {\n const requiredLabels = match.labels.map((label) => label.toLowerCase());\n if (!requiredLabels.every((label) => issueLabels.has(label))) {\n return false;\n }\n }\n\n if (match.terms?.length) {\n if (!match.terms.some((term) => text.includes(term.toLowerCase()))) {\n return false;\n }\n }\n\n if (match.paths?.length) {\n const expectedPaths = match.paths.map((path) => normalizePath(path));\n if (!expectedPaths.some((expectedPath) => paths.some((path) => path.includes(expectedPath)))) {\n return false;\n }\n }\n\n return Boolean(match.category || match.labels?.length || match.terms?.length || match.paths?.length);\n}\n\nfunction applyOverrides(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n if (options?.enabled === false) {\n return buildResolution(\n \"workflow-disabled\",\n [\"Automatic capability routing was disabled by workflow configuration.\"],\n [],\n [\n { provider: \"codex\", role: \"executor\", profile: \"\", reason: \"Fallback executor because routing is disabled.\" },\n ],\n );\n }\n\n const override = options?.overrides?.find((entry) => matchesOverride(issue, resolution, entry));\n if (!override) {\n return resolution;\n }\n\n return {\n category: override.category ?? resolution.category,\n rationale: uniq([...(resolution.rationale ?? []), ...(override.rationale ?? []), \"Workflow routing override applied.\"]),\n overlays: uniq([...(resolution.overlays ?? []), ...(override.overlays ?? [])]),\n providers: override.providers?.length ? override.providers : resolution.providers,\n };\n}\n\nexport function resolveTaskCapabilities(\n issue: CapabilityResolverIssue,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n const frontendPathMatch = hasPathMatch(\n paths,\n [\"src/web\", \"web\", \"frontend\", \"ui\", \"component\", \"dashboard\", \"style\", \"apps/web\"],\n [\".css\", \".scss\", \".sass\", \".less\", \".html\", \".tsx\", \".jsx\", \".vue\", \".svelte\"],\n );\n const securityPathMatch = hasPathMatch(\n paths,\n [\"security\", \"auth\", \"crypto\", \"secret\", \"permission\", \"token\"],\n [\".pem\", \".key\", \".crt\"],\n );\n const architecturePathMatch = hasPathMatch(\n paths,\n [\"workflow.md\", \"architecture.md\", \"spec.md\", \"claude.md\", \"openspec/\"],\n [],\n );\n const devopsPathMatch = hasPathMatch(\n paths,\n [\".github/workflows\", \"docker\", \"k8s\", \"helm\", \"terraform\", \"infra\", \"deploy\", \"release\"],\n [\".yml\", \".yaml\", \".tf\"],\n );\n const backendPathMatch = hasPathMatch(\n paths,\n [\"src/api\", \"api\", \"src/protocol\", \"protocol\", \"server\", \"persistence\", \"scanner\", \"ws\", \"websocket\", \"db\", \"apps/api\"],\n [\".sql\"],\n );\n const docsPathMatch = hasPathMatch(\n paths,\n [\"docs\", \"readme\", \"guide\", \"tutorial\"],\n [\".md\", \".mdx\"],\n );\n let resolution: CapabilityResolution;\n\n if (frontendPathMatch || hasAny(text, [\"frontend\", \"ui\", \"ux\", \"design\", \"css\", \"html\", \"layout\", \"component\", \"react\", \"vue\"])) {\n resolution = buildResolution(\n \"frontend-ui\",\n [\n ...(frontendPathMatch ? [\"Detected frontend-oriented target paths or file extensions.\"] : []),\n \"Detected frontend or design-oriented keywords in the task.\",\n \"Use Claude to plan and review, Codex to implement.\",\n \"Apply impeccable-style polish as a review overlay when available.\",\n ],\n [\"impeccable\", \"frontend-design\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-ui-designer\", reason: \"UI planning and structure.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-frontend-developer\", reason: \"Frontend implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-accessibility-auditor\", reason: \"Critical UX and accessibility review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (securityPathMatch || hasAny(text, [\"security\", \"auth\", \"oauth\", \"token\", \"secret\", \"permission\", \"compliance\", \"vulnerability\"])) {\n resolution = buildResolution(\n \"security\",\n [\n ...(securityPathMatch ? [\"Detected security-sensitive target paths or file extensions.\"] : []),\n \"Detected security-sensitive keywords.\",\n \"Use a security profile to scope the work and keep a strict review pass.\",\n ],\n [\"security-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-security-engineer\", reason: \"Threat and risk framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-security-engineer\", reason: \"Implementation with security context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Independent correctness review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (architecturePathMatch || hasAny(text, [\"architecture\", \"design doc\", \"spec\", \"workflow\", \"orchestr\", \"roadmap\", \"plan\"])) {\n resolution = buildResolution(\n \"architecture\",\n [\n ...(architecturePathMatch ? [\"Detected workflow, architecture, or specification files in the targeted paths.\"] : []),\n \"Detected architecture or planning-oriented keywords.\",\n \"Favor stronger planning and review roles around the executor.\",\n ],\n [\"spec-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-software-architect\", reason: \"Architecture and system framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Translate architecture into implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Challenge assumptions and regressions.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (devopsPathMatch || hasAny(text, [\"deploy\", \"release\", \"ci\", \"cicd\", \"github actions\", \"docker\", \"terraform\", \"kubernetes\"])) {\n resolution = buildResolution(\n \"devops\",\n [\n ...(devopsPathMatch ? [\"Detected deployment, infrastructure, or CI/CD paths in the task scope.\"] : []),\n \"Detected release, deployment, or infrastructure keywords.\",\n \"Use a delivery-focused planner and a stricter reliability review pass.\",\n ],\n [\"delivery-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-devops-automator\", reason: \"CI/CD and deployment framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-devops-automator\", reason: \"Implement workflow and release changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-sre-site-reliability-engineer\", reason: \"Reliability and rollback review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (hasAny(text, [\"bug\", \"fix\", \"regression\", \"debug\", \"crash\", \"broken\", \"error\", \"fail\"])) {\n resolution = buildResolution(\n \"bugfix\",\n [\n \"Detected bug-fix or debugging keywords.\",\n \"Use Codex to execute the fix and Claude to frame and verify the change.\",\n ],\n [\"debug\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-code-reviewer\", reason: \"Clarify failure mode and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement and iterate quickly.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Catch regressions and weak reasoning.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (backendPathMatch || hasAny(text, [\"api\", \"backend\", \"database\", \"protocol\", \"server\", \"ws\", \"websocket\", \"persistence\"])) {\n resolution = buildResolution(\n \"backend\",\n [\n ...(backendPathMatch ? [\"Detected backend, protocol, or persistence paths in the task scope.\"] : []),\n \"Detected backend, API, protocol, or persistence keywords.\",\n \"Use backend-oriented planning and critical review around the executor.\",\n ],\n [\"backend-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-backend-architect\", reason: \"API and data-model framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the backend changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical regression review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (docsPathMatch || hasAny(text, [\"docs\", \"readme\", \"guide\", \"documentation\", \"tutorial\"])) {\n resolution = buildResolution(\n \"documentation\",\n [\n ...(docsPathMatch ? [\"Detected documentation-oriented paths or file extensions.\"] : []),\n \"Detected documentation keywords.\",\n \"Use writing-oriented planning with an implementation pass that can still edit code and docs together.\",\n ],\n [\"documentation\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-technical-writer\", reason: \"Structure and narrative.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-technical-writer\", reason: \"Apply documentation edits in repo context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Check coherence with the implementation.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n resolution = buildResolution(\n \"default\",\n [\n \"No specialized pattern matched strongly.\",\n \"Default to a balanced planner/executor/reviewer pipeline using both Claude and Codex.\",\n ],\n [],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-senior-project-manager\", reason: \"Clarify scope and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the requested change.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical review before closure.\" },\n ],\n );\n\n return applyOverrides(issue, resolution, options);\n}\n\nexport function mergeCapabilityProviders(\n baseProviders: CapabilityResolverBaseProvider[],\n resolution: CapabilityResolution,\n): CapabilityResolverBaseProvider[] {\n return resolution.providers.map((suggestion) => {\n const exact = baseProviders.find((provider) => provider.provider === suggestion.provider && provider.role === suggestion.role);\n const sameRole = baseProviders.find((provider) => provider.role === suggestion.role);\n const sameProvider = baseProviders.find((provider) => provider.provider === suggestion.provider);\n const base = exact ?? sameRole ?? sameProvider;\n\n return {\n provider: suggestion.provider,\n role: suggestion.role,\n command: base?.command ?? \"\",\n profile: suggestion.profile || base?.profile || \"\",\n profilePath: base?.profilePath ?? \"\",\n profileInstructions: base?.profileInstructions ?? \"\",\n };\n });\n}\n","import { TemplateEngine } from \"recker\";\nimport { PROMPT_TEMPLATES, type PromptTemplateName } from \"./generated/prompts.ts\";\n\nconst engine = new TemplateEngine({\n cache: true,\n format: \"raw\",\n strict: false,\n});\n\nfunction normalizePrompt(text: string): string {\n return text\n .replace(/\\r\\n/g, \"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .trim();\n}\n\nexport async function renderPrompt(\n name: PromptTemplateName,\n context: Record<string, unknown> = {},\n): Promise<string> {\n return renderPromptString(PROMPT_TEMPLATES[name], context);\n}\n\nexport async function renderPromptString(\n template: string,\n context: Record<string, unknown> = {},\n): Promise<string> {\n const rendered = await engine.render(template, context);\n return normalizePrompt(rendered);\n}\n","// Generated by scripts/generate-prompts.ts. Do not edit directly.\n\nexport const PROMPT_TEMPLATES = {\n \"agent-provider-base\": \"{{#if isPlanner}}\\nRole: planner.\\nAnalyze the issue and prepare an execution plan for the implementation agents.\\nDo not claim the issue is complete unless the plan itself is the deliverable.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer.\\nInspect the workspace and review the current implementation critically.\\nIf rework is required, emit `FIFONY_STATUS=continue` and provide actionable `nextPrompt` feedback.\\nEmit `FIFONY_STATUS=done` only when the work is acceptable.\\n{{else}}\\nRole: executor.\\nImplement the required changes in the workspace.\\nUse any planner guidance or prior reviewer feedback already persisted in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasImpeccableOverlay}}\\nImpeccable overlay is active.\\nRaise the bar on UI polish, clarity, responsiveness, visual hierarchy, and interaction quality.\\n{{#if isReviewer}}\\nReview with a stricter frontend and product-quality standard than a normal correctness-only pass.\\n{{else}}\\nWhen touching frontend work, do not settle for baseline implementation quality.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasFrontendDesignOverlay}}\\nFrontend-design overlay is active.\\nPrefer stronger hierarchy, spacing, and readability decisions over generic implementation choices.\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{#if capabilityCategory}}\\nCapability routing: {{capabilityCategory}}.\\nSelection reason: {{selectionReason}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}.\\n{{/if}}\\n{{/if}}\\n\\n{{#if targetPaths.length}}\\nTarget paths: {{targetPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\n{{basePrompt}}\\n\", // src/prompts/agent-provider-base.stub.md\n \"agent-turn\": \"Continue working on {{issueIdentifier}}.\\nTurn {{turnIndex}} of {{maxTurns}}.\\n\\nBase objective:\\n{{basePrompt}}\\n\\nContinuation guidance:\\n{{continuation}}\\n\\nPrevious command output tail:\\n```text\\n{{outputTail}}\\n```\\n\\nBefore exiting successfully, emit one of the following control markers:\\n- `FIFONY_STATUS=continue` if more turns are required.\\n- `FIFONY_STATUS=done` if the issue is complete.\\n- `FIFONY_STATUS=blocked` if manual intervention is required.\\nYou may also write `fifony-result.json` with `{ \\\"status\\\": \\\"...\\\", \\\"summary\\\": \\\"...\\\", \\\"nextPrompt\\\": \\\"...\\\" }`.\\n\", // src/prompts/agent-turn.stub.md\n \"compile-execution-claude\": \"{{#if isPlanner}}\\nRole: planner. Analyze the issue and prepare an execution plan.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\nRole: executor. Implement the required changes.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{planPrompt}}\\n\\n{{#if subagentsToUse.length}}\\n## Subagent Strategy (Claude-specific)\\nYou have access to the Agent tool for spawning subagents. Use them for:\\n{{#each subagentsToUse}}\\n- **{{name}}** ({{role}}): {{why}}\\n{{/each}}\\n\\nLaunch subagents for independent subtasks to maximize parallelism.\\nUse the main thread for coordination and integration.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Skills to Activate\\n{{#each skillsToUse}}\\n- Invoke **/{{name}}** - {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n{{#if validationItems.length}}\\n## Pre-completion enforcement\\nBefore reporting done, verify:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\", // src/prompts/compile-execution-claude.stub.md\n \"compile-execution-codex\": \"{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\n{{#if isPlanner}}\\nRole: planner. Analyze and prepare an execution plan.\\n{{else}}\\nRole: executor. Implement the required changes in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{planPrompt}}\\n\\n{{#if phases.length}}\\n## Checkpoint Execution (Codex mode)\\nExecute in strict phases. After each phase, verify outputs before proceeding.\\n{{#each phases}}\\n- **{{phaseName}}**: {{goal}}\\n{{#if outputs.length}} Checkpoint: verify {{outputs | join \\\", \\\"}} before next phase.{{/if}}\\n{{/each}}\\n{{else}}\\n## Execution Order\\nExecute steps in order. Verify each step's `doneWhen` criterion before proceeding.\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\nFocus changes on these paths. Do not make unnecessary changes elsewhere.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Specialized Procedures\\n{{#each skillsToUse}}\\n- Apply **{{name}}** procedure: {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if validationItems.length}}\\n## Pre-completion checks\\nBefore reporting done, run:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n## Output Format\\n\\n{{outputContract}}\\n\", // src/prompts/compile-execution-codex.stub.md\n \"compile-review\": \"Review the work done for {{issueIdentifier}}.\\n\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{#if planPrompt}}\\n# Original Execution Plan\\n\\n{{planPrompt}}\\n{{/if}}\\n\\n{{#if successCriteria.length}}\\n# Success Criteria (evaluate against these)\\n{{#each successCriteria}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if deliverables.length}}\\n# Expected Deliverables\\n{{#each deliverables}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if diffSummary}}\\n# Changes Made (diff summary)\\n```\\n{{diffSummary}}\\n```\\n{{/if}}\\n\\n# Structured Context\\nIf `fifony-execution-payload.json` exists in the workspace, read it for the canonical structured task data.\\nUse the `successCriteria`, `constraints`, and `deliverables` fields as your evaluation checklist.\\n\\n# Review Instructions\\n\\n1. Verify each success criterion from the plan is met.\\n2. Check that all expected deliverables are present.\\n3. Review the diff for correctness, security issues, and code quality.\\n4. Verify validation checks pass (run commands if specified in the plan).\\n5. Check for unintended side effects or regressions.\\n\\nIf the work is acceptable, emit FIFONY_STATUS=done.\\nIf rework is needed, emit FIFONY_STATUS=continue and provide actionable feedback in nextPrompt.\\nIf the work is fundamentally broken, emit FIFONY_STATUS=blocked.\\n\", // src/prompts/compile-review.stub.md\n \"integrations-agency-agents\": \"---\\nagent:\\n providers:\\n - provider: claude\\n role: planner\\n profile: agency-senior-project-manager\\n - provider: codex\\n role: executor\\n profile: agency-senior-developer\\n - provider: claude\\n role: reviewer\\n profile: agency-code-reviewer\\ncodex:\\n command: \\\"codex\\\"\\nclaude:\\n command: \\\"claude\\\"\\n---\\n\\nUse local agency agent profiles discovered from workspace or home directories.\\nWorkspace: {{workspaceRoot}}\\n\", // src/prompts/integrations-agency-agents.stub.md\n \"integrations-impeccable\": \"# Impeccable integration idea\\n\\nUse impeccable-oriented skills as a frontend review layer around Fifony issues.\\n\\nSuggested pattern:\\n\\n1. Use `agency-senior-developer` or `codex` as executor.\\n2. Route UI-heavy issues to a reviewer prompt that explicitly asks for impeccable-style critique.\\n3. Expose the resulting review through the Fifony MCP prompts or as a follow-up review issue.\\n\\nSuggested labels:\\n- frontend\\n- ui\\n- design-system\\n\\nSuggested reviewer prompt seed:\\n\\\"Review this implementation using impeccable standards for frontend quality, polish, hierarchy, spacing, responsiveness, and interaction clarity.\\\"\\n\", // src/prompts/integrations-impeccable.stub.md\n \"issue-enhancer-description\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the description to be clearer, complete, and directly actionable.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"description\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nCurrent description: {{description}}\\n\\nRules:\\n- Keep it concise but include meaningful acceptance criteria.\\n- Use plain text only, with short paragraphs or bullet style.\\n- Avoid markdown wrappers, quotes, and extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-description.stub.md\n \"issue-enhancer-title\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the title for clarity, actionability, and specificity.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"title\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nDescription context: {{description}}\\n\\nRules:\\n- Keep it concise and suitable as a task title.\\n- Use imperative language when possible.\\n- Do not include markdown, quotes, or extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-title.stub.md\n \"issue-planner\": \"You are a senior technical execution planner.\\nProduce the best possible plan for the issue below, filling the JSON schema precisely.\\n{{#if fast}}\\n\\nFAST MODE: Be brief and direct. Minimize reasoning depth.\\n- 2-4 steps maximum. Skip optional fields (unknowns, risks, alternatives).\\n- No tooling reflection needed — set shouldUseSkills: false, shouldUseSubagents: false.\\n- Focus only on: summary, steps, estimatedComplexity, suggestedPaths, suggestedLabels.\\n{{/if}}\\n\\nIssue title: {{title}}\\nIssue description: {{description}}\\n{{#unless fast}}\\n\\nQuality rules:\\n- Be concrete, not generic. No vague phrases like 'implement' or 'improve' without detail.\\n- Break work into actionable steps (2-8 steps). Each step describes WHAT, not HOW.\\n- Each step must have a clear 'doneWhen' acceptance criterion.\\n- Identify assumptions, constraints, unknowns, and risks.\\n- For unknowns, specify what question needs answering and how to resolve it.\\n- Suggest file paths that are likely relevant to the changes.\\n- Suggest labels: bug, feature, frontend, backend, docs, refactor, security, performance, etc.\\n\\nComplexity estimation:\\n- trivial: < 5 min, single-file cosmetic change\\n- low: 5-15 min, small focused change\\n- medium: 15-60 min, multi-file change with testing\\n- high: > 1 hour, architectural change or new feature\\n\\nTooling reflection (REQUIRED):\\n- Evaluate whether the task benefits from using skills (specialized instructions for quality/consistency).\\n- Evaluate whether subtasks should use subagents (parallel work, isolated context, specialization).\\n- Only recommend skills/agents when there is a concrete justification.\\n- For each step, set ownerType: 'agent' for automated work, 'human' for manual review, 'skill' for specialized skills, 'subagent' for delegated work.\\n\\nEffort suggestion:\\n- low: simple fixes, no deep reasoning needed\\n- medium: standard development work\\n- high: complex architecture, security, or cross-cutting changes\\n- Set per-role if different: planner, executor, reviewer\\n{{/unless}}\\n\\nReturn strict JSON. No text outside JSON.\\n\", // src/prompts/issue-planner.stub.md\n \"issue-planner-refine\": \"You are a senior technical execution planner refining an existing plan based on user feedback.\\n\\n## Original Issue\\nTitle: {{title}}\\nDescription: {{description}}\\n\\n## Current Plan (JSON)\\n```json\\n{{currentPlan}}\\n```\\n\\n## User Feedback\\n{{feedback}}\\n\\n## Instructions\\n\\nRevise the plan above to address the user's feedback precisely.\\n\\nRules:\\n- Keep all parts of the plan that are NOT affected by the feedback unchanged.\\n- Only modify, add, or remove elements that the feedback specifically requests.\\n- Preserve the same JSON schema structure as the current plan.\\n- Maintain step numbering consistency after changes.\\n- If feedback asks to add steps, insert them in the logical position and renumber.\\n- If feedback asks to remove steps, renumber remaining steps sequentially.\\n- Update the summary if the overall direction changed.\\n- Re-evaluate estimatedComplexity if the scope changed significantly.\\n- Update suggestedPaths and suggestedLabels if affected by the changes.\\n\\nReturn strict JSON. No text outside JSON.\\n\", // src/prompts/issue-planner-refine.stub.md\n \"mcp-integrate-client\": \"Integrate {{client}} with the local Fifony MCP server.\\n\\nGoal: {{goal}}\\n\\n{{integrationGuide}}\\n\\nUse the available Fifony resources and tools instead of inventing your own persistence model.\\n\", // src/prompts/mcp-integrate-client.stub.md\n \"mcp-integration-guide\": \"# Fifony MCP integration\\n\\nWorkspace root: `{{workspaceRoot}}`\\nPersistence root: `{{persistenceRoot}}`\\nState root: `{{stateRoot}}`\\n\\nRecommended MCP client command:\\n\\n```json\\n{\\n \\\"mcpServers\\\": {\\n \\\"fifony\\\": {\\n \\\"command\\\": \\\"npx\\\",\\n \\\"args\\\": [\\\"fifony\\\", \\\"mcp\\\", \\\"--workspace\\\", \\\"{{workspaceRoot}}\\\", \\\"--persistence\\\", \\\"{{persistenceRoot}}\\\"]\\n }\\n }\\n}\\n```\\n\\nExpected workflow:\\n\\n1. Read `fifony://guide/overview` and `fifony://state/summary`.\\n2. Use `fifony.list_issues` or read `fifony://issues`.\\n3. Create work with `fifony.create_issue`.\\n4. Update workflow state with `fifony.update_issue_state`.\\n5. Use the prompts exposed by this MCP server to structure planning or execution.\\n\\nThe MCP server is read-write against the same `s3db` filesystem store used by the Fifony runtime.\\n\", // src/prompts/mcp-integration-guide.stub.md\n \"mcp-issue\": \"You are integrating with Fifony as the {{role}} using {{provider}}.\\n\\nIssue ID: {{id}}\\nTitle: {{title}}\\nState: {{state}}\\nCapability category: {{capabilityCategory}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}\\n{{/if}}\\n{{#if paths.length}}\\nPaths: {{paths | join \\\", \\\"}}\\n{{/if}}\\nDescription:\\n{{description}}\\n\\nUse Fifony as the source of truth:\\n- Read the workflow contract from WORKFLOW.md if available.\\n- Persist transitions through the Fifony tools instead of inventing local state.\\n- Keep outputs actionable and aligned with the tracked issue lifecycle.\\n\", // src/prompts/mcp-issue.stub.md\n \"mcp-review-workflow\": \"Review the WORKFLOW.md for this Fifony workspace as {{provider}}.\\n\\nWorkspace: {{workspaceRoot}}\\nWorkflow present: {{workflowPresent}}\\n\\nFocus on:\\n- provider orchestration quality\\n- hooks safety\\n- prompt clarity\\n- issue lifecycle correctness\\n- what an MCP client needs in order to integrate cleanly\\n\", // src/prompts/mcp-review-workflow.stub.md\n \"mcp-route-task\": \"Use this routing decision as the execution plan for the task.\\n\\n{{resolutionJson}}\\n\", // src/prompts/mcp-route-task.stub.md\n \"project-analysis\": \"You are analyzing a software project to help configure an AI-powered development assistant.\\n\\nLook at the project structure, source code, configuration files, and any documentation you can find. Pay special attention to:\\n- README, CLAUDE.md, AGENTS.md, or any project documentation\\n- Build files: package.json, Cargo.toml, pyproject.toml, build.gradle, Gemfile, go.mod, Makefile, CMakeLists.txt, pom.xml, etc.\\n- Source code directories and their contents\\n- Configuration files (.env, docker-compose, terraform, etc.)\\n- CI/CD pipelines (.github/workflows, .gitlab-ci, Jenkinsfile, etc.)\\n\\nReturn a JSON object with exactly these fields:\\n\\n{\\n \\\"description\\\": \\\"A concise 2-3 sentence description of what this project does, its purpose, and who it's for.\\\",\\n \\\"language\\\": \\\"The primary programming language (e.g. typescript, python, rust, java, kotlin, ruby, go, swift, c++)\\\",\\n \\\"domains\\\": [\\\"Array of relevant domain tags that apply to this project\\\"],\\n \\\"stack\\\": [\\\"Array of key technologies, frameworks, and tools used\\\"],\\n \\\"suggestedAgents\\\": [\\\"Array of specialist agent names that would help develop this project\\\"]\\n}\\n\\nFor \\\"domains\\\", choose from: frontend, backend, mobile, devops, database, ai-ml, security, testing, games, ecommerce, fintech, healthcare, education, saas, design, product, marketing, embedded, blockchain, spatial-computing, data-engineering.\\n\\nFor \\\"suggestedAgents\\\", choose from: frontend-developer, backend-architect, database-optimizer, security-engineer, devops-automator, mobile-app-builder, ai-engineer, ui-designer, ux-architect, code-reviewer, technical-writer, sre, data-engineer, software-architect, game-designer.\\n\\nReturn ONLY the JSON object. No markdown fences, no explanation, no extra text.\\n\", // src/prompts/project-analysis.stub.md\n \"workflow-default\": \"You are working on {{issue.identifier}}.\\n\\nTitle: {{issue.title}}\\nDescription:\\n{{issue.description}}\\n\", // src/prompts/workflow-default.stub.md\n \"workflow-plan-section\": \"## Execution Plan\\n\\nComplexity: {{estimatedComplexity}}\\nSummary: {{summary}}\\n\\nSteps:\\n{{#each steps}}\\n{{step}}. {{action}}{{#if files.length}} (files: {{files | join \\\", \\\"}}){{/if}}{{#if details}} - {{details}}{{/if}}\\n{{/each}}\\n\\nFollow this plan. Complete each step in order.\\n\", // src/prompts/workflow-plan-section.stub.md\n} as const;\n\nexport type PromptTemplateName = keyof typeof PROMPT_TEMPLATES;\n"],"mappings":";AAoDA,SAAS,SAAS,OAAwC;AACxD,QAAM,UAAU,MAAM,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,WAAW,aAAa,KAAK,CAAC,MAAM,WAAW,UAAU,CAAC;AACvH,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM;AAAA,IACN,MAAM,eAAe;AAAA,IACrB,GAAG;AAAA,IACH,GAAI,MAAM,SAAS,CAAC;AAAA,EACtB,EAAE,KAAK,GAAG,EAAE,YAAY;AAC1B;AAEA,SAAS,cAAc,OAAuB;AAC5C,SAAO,MAAM,KAAK,EAAE,WAAW,MAAM,GAAG,EAAE,YAAY;AACxD;AAEO,SAAS,qBAAqB,OAA0C;A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BAAmB;AAAA,EAC9B,uBAAuB;AAAA;AAAA,EACvB,cAAc;AAAA;AAAA,EACd,4BAA4B;AAAA;AAAA,EAC5B,2BAA2B;AAAA;AAAA,EAC3B,kBAAkB;AAAA;AAAA,EAClB,8BAA8B;AAAA;AAAA,EAC9B,2BAA2B;AAAA;AAAA,EAC3B,8BAA8B;AAAA;AAAA,EAC9B,wBAAwB;AAAA;AAAA,EACxB,iBAAiB;AAAA;AAAA,EACjB,wBAAwB;AAAA;AAAA,EACxB,wBAAwB;AAAA;AAAA,EACxB,yBAAyB;AAAA;AAAA,EACzB,aAAa;AAAA;AAAA,EACb,uBAAuB;AAAA;AAAA,EACvB,kBAAkB;AAAA;AAAA,EAClB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EACpB,oBAAoB;AAAA;AAAA,EACpB,yBAAyB;AAAA;AAC3B;;;ADnBA,IAAM,SAAS,IAAI,eAAe;AAAA,EAChC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV,CAAC;AAED,SAAS,gBAAgB,MAAsB;AAC7C,SAAO,KACJ,QAAQ,SAAS,IAAI,EACrB,QAAQ,WAAW,MAAM,EACzB,KAAK;AACV;AAEA,eAAsB,aACpB,MACA,UAAmC,CAAC,GACnB;AACjB,SAAO,mBAAmB,iBAAiB,IAAI,GAAG,OAAO;AAC3D;AAEA,eAAsB,mBACpB,UACA,UAAmC,CAAC,GACnB;AACjB,QAAM,WAAW,MAAM,OAAO,OAAO,UAAU,OAAO;AACtD,SAAO,gBAAgB,QAAQ;AACjC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/routing/capability-resolver.ts","../src/prompting.ts","../src/generated/prompts.ts"],"sourcesContent":["export type CapabilityResolverRole = \"planner\" | \"executor\" | \"reviewer\";\n\nexport type CapabilityResolverIssue = {\n id?: string;\n identifier?: string;\n title: string;\n description?: string;\n labels?: string[];\n paths?: string[];\n};\n\nexport type CapabilityResolverBaseProvider = {\n provider: string;\n role: CapabilityResolverRole;\n command: string;\n profile?: string;\n profilePath?: string;\n profileInstructions?: string;\n};\n\nexport type CapabilityResolverSuggestion = {\n provider: string;\n role: CapabilityResolverRole;\n profile: string;\n reason: string;\n};\n\nexport type CapabilityResolution = {\n category: string;\n rationale: string[];\n overlays: string[];\n providers: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOverride = {\n match?: {\n labels?: string[];\n terms?: string[];\n category?: string;\n paths?: string[];\n };\n category?: string;\n rationale?: string[];\n overlays?: string[];\n providers?: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOptions = {\n enabled?: boolean;\n overrides?: CapabilityResolverOverride[];\n};\n\nfunction tokenize(issue: CapabilityResolverIssue): string {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n return [\n issue.identifier ?? \"\",\n issue.title,\n issue.description ?? \"\",\n ...labels,\n ...(issue.paths ?? []),\n ].join(\" \").toLowerCase();\n}\n\nfunction normalizePath(value: string): string {\n return value.trim().replaceAll(\"\\\\\", \"/\").toLowerCase();\n}\n\nexport function inferCapabilityPaths(issue: CapabilityResolverIssue): string[] {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n const sources = [issue.title, issue.description ?? \"\", ...labels];\n const matches = new Set<string>();\n const pattern = /(?:[A-Za-z0-9._-]+\\/)+(?:[A-Za-z0-9._-]+)|(?:[A-Za-z0-9._-]+\\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|sass|less|html|md|mdx|json|yml|yaml|sql|sh))+/g;\n\n for (const source of sources) {\n for (const match of source.match(pattern) ?? []) {\n matches.add(normalizePath(match));\n }\n }\n\n return [...matches];\n}\n\nfunction getIssuePaths(issue: CapabilityResolverIssue): string[] {\n return [...new Set([\n ...(issue.paths ?? [])\n .filter((value): value is string => typeof value === \"string\" && value.trim().length > 0)\n .map(normalizePath),\n ...inferCapabilityPaths(issue),\n ])];\n}\n\nfunction hasAny(text: string, terms: string[]): boolean {\n return terms.some((term) => text.includes(term));\n}\n\nfunction hasPathMatch(paths: string[], fragments: string[] = [], extensions: string[] = []): boolean {\n return paths.some((path) => {\n if (fragments.some((fragment) => path.includes(fragment))) {\n return true;\n }\n\n return extensions.some((extension) => path.endsWith(extension));\n });\n}\n\nfunction buildResolution(\n category: string,\n rationale: string[],\n overlays: string[],\n providers: CapabilityResolverSuggestion[],\n): CapabilityResolution {\n return {\n category,\n rationale,\n overlays,\n providers,\n };\n}\n\nfunction uniq(values: string[]): string[] {\n return [...new Set(values.filter(Boolean))];\n}\n\nfunction matchesOverride(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n override: CapabilityResolverOverride,\n): boolean {\n const match = override.match ?? {};\n const issueLabels = new Set((issue.labels ?? []).map((label) => label.toLowerCase()));\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n\n if (match.category && match.category !== resolution.category) {\n return false;\n }\n\n if (match.labels?.length) {\n const requiredLabels = match.labels.map((label) => label.toLowerCase());\n if (!requiredLabels.every((label) => issueLabels.has(label))) {\n return false;\n }\n }\n\n if (match.terms?.length) {\n if (!match.terms.some((term) => text.includes(term.toLowerCase()))) {\n return false;\n }\n }\n\n if (match.paths?.length) {\n const expectedPaths = match.paths.map((path) => normalizePath(path));\n if (!expectedPaths.some((expectedPath) => paths.some((path) => path.includes(expectedPath)))) {\n return false;\n }\n }\n\n return Boolean(match.category || match.labels?.length || match.terms?.length || match.paths?.length);\n}\n\nfunction applyOverrides(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n if (options?.enabled === false) {\n return buildResolution(\n \"workflow-disabled\",\n [\"Automatic capability routing was disabled by workflow configuration.\"],\n [],\n [\n { provider: \"codex\", role: \"executor\", profile: \"\", reason: \"Fallback executor because routing is disabled.\" },\n ],\n );\n }\n\n const override = options?.overrides?.find((entry) => matchesOverride(issue, resolution, entry));\n if (!override) {\n return resolution;\n }\n\n return {\n category: override.category ?? resolution.category,\n rationale: uniq([...(resolution.rationale ?? []), ...(override.rationale ?? []), \"Workflow routing override applied.\"]),\n overlays: uniq([...(resolution.overlays ?? []), ...(override.overlays ?? [])]),\n providers: override.providers?.length ? override.providers : resolution.providers,\n };\n}\n\nexport function resolveTaskCapabilities(\n issue: CapabilityResolverIssue,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n const frontendPathMatch = hasPathMatch(\n paths,\n [\"src/web\", \"web\", \"frontend\", \"ui\", \"component\", \"dashboard\", \"style\", \"apps/web\"],\n [\".css\", \".scss\", \".sass\", \".less\", \".html\", \".tsx\", \".jsx\", \".vue\", \".svelte\"],\n );\n const securityPathMatch = hasPathMatch(\n paths,\n [\"security\", \"auth\", \"crypto\", \"secret\", \"permission\", \"token\"],\n [\".pem\", \".key\", \".crt\"],\n );\n const architecturePathMatch = hasPathMatch(\n paths,\n [\"workflow.md\", \"architecture.md\", \"spec.md\", \"claude.md\", \"openspec/\"],\n [],\n );\n const devopsPathMatch = hasPathMatch(\n paths,\n [\".github/workflows\", \"docker\", \"k8s\", \"helm\", \"terraform\", \"infra\", \"deploy\", \"release\"],\n [\".yml\", \".yaml\", \".tf\"],\n );\n const backendPathMatch = hasPathMatch(\n paths,\n [\"src/api\", \"api\", \"src/protocol\", \"protocol\", \"server\", \"persistence\", \"scanner\", \"ws\", \"websocket\", \"db\", \"apps/api\"],\n [\".sql\"],\n );\n const docsPathMatch = hasPathMatch(\n paths,\n [\"docs\", \"readme\", \"guide\", \"tutorial\"],\n [\".md\", \".mdx\"],\n );\n let resolution: CapabilityResolution;\n\n if (frontendPathMatch || hasAny(text, [\"frontend\", \"ui\", \"ux\", \"design\", \"css\", \"html\", \"layout\", \"component\", \"react\", \"vue\"])) {\n resolution = buildResolution(\n \"frontend-ui\",\n [\n ...(frontendPathMatch ? [\"Detected frontend-oriented target paths or file extensions.\"] : []),\n \"Detected frontend or design-oriented keywords in the task.\",\n \"Use Claude to plan and review, Codex to implement.\",\n \"Apply impeccable-style polish as a review overlay when available.\",\n ],\n [\"impeccable\", \"frontend-design\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-ui-designer\", reason: \"UI planning and structure.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-frontend-developer\", reason: \"Frontend implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-accessibility-auditor\", reason: \"Critical UX and accessibility review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (securityPathMatch || hasAny(text, [\"security\", \"auth\", \"oauth\", \"token\", \"secret\", \"permission\", \"compliance\", \"vulnerability\"])) {\n resolution = buildResolution(\n \"security\",\n [\n ...(securityPathMatch ? [\"Detected security-sensitive target paths or file extensions.\"] : []),\n \"Detected security-sensitive keywords.\",\n \"Use a security profile to scope the work and keep a strict review pass.\",\n ],\n [\"security-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-security-engineer\", reason: \"Threat and risk framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-security-engineer\", reason: \"Implementation with security context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Independent correctness review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (architecturePathMatch || hasAny(text, [\"architecture\", \"design doc\", \"spec\", \"workflow\", \"orchestr\", \"roadmap\", \"plan\"])) {\n resolution = buildResolution(\n \"architecture\",\n [\n ...(architecturePathMatch ? [\"Detected workflow, architecture, or specification files in the targeted paths.\"] : []),\n \"Detected architecture or planning-oriented keywords.\",\n \"Favor stronger planning and review roles around the executor.\",\n ],\n [\"spec-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-software-architect\", reason: \"Architecture and system framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Translate architecture into implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Challenge assumptions and regressions.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (devopsPathMatch || hasAny(text, [\"deploy\", \"release\", \"ci\", \"cicd\", \"github actions\", \"docker\", \"terraform\", \"kubernetes\"])) {\n resolution = buildResolution(\n \"devops\",\n [\n ...(devopsPathMatch ? [\"Detected deployment, infrastructure, or CI/CD paths in the task scope.\"] : []),\n \"Detected release, deployment, or infrastructure keywords.\",\n \"Use a delivery-focused planner and a stricter reliability review pass.\",\n ],\n [\"delivery-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-devops-automator\", reason: \"CI/CD and deployment framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-devops-automator\", reason: \"Implement workflow and release changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-sre-site-reliability-engineer\", reason: \"Reliability and rollback review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (hasAny(text, [\"bug\", \"fix\", \"regression\", \"debug\", \"crash\", \"broken\", \"error\", \"fail\"])) {\n resolution = buildResolution(\n \"bugfix\",\n [\n \"Detected bug-fix or debugging keywords.\",\n \"Use Codex to execute the fix and Claude to frame and verify the change.\",\n ],\n [\"debug\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-code-reviewer\", reason: \"Clarify failure mode and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement and iterate quickly.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Catch regressions and weak reasoning.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (backendPathMatch || hasAny(text, [\"api\", \"backend\", \"database\", \"protocol\", \"server\", \"ws\", \"websocket\", \"persistence\"])) {\n resolution = buildResolution(\n \"backend\",\n [\n ...(backendPathMatch ? [\"Detected backend, protocol, or persistence paths in the task scope.\"] : []),\n \"Detected backend, API, protocol, or persistence keywords.\",\n \"Use backend-oriented planning and critical review around the executor.\",\n ],\n [\"backend-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-backend-architect\", reason: \"API and data-model framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the backend changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical regression review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (docsPathMatch || hasAny(text, [\"docs\", \"readme\", \"guide\", \"documentation\", \"tutorial\"])) {\n resolution = buildResolution(\n \"documentation\",\n [\n ...(docsPathMatch ? [\"Detected documentation-oriented paths or file extensions.\"] : []),\n \"Detected documentation keywords.\",\n \"Use writing-oriented planning with an implementation pass that can still edit code and docs together.\",\n ],\n [\"documentation\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-technical-writer\", reason: \"Structure and narrative.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-technical-writer\", reason: \"Apply documentation edits in repo context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Check coherence with the implementation.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n resolution = buildResolution(\n \"default\",\n [\n \"No specialized pattern matched strongly.\",\n \"Default to a balanced planner/executor/reviewer pipeline using both Claude and Codex.\",\n ],\n [],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-senior-project-manager\", reason: \"Clarify scope and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the requested change.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical review before closure.\" },\n ],\n );\n\n return applyOverrides(issue, resolution, options);\n}\n\nexport function mergeCapabilityProviders(\n baseProviders: CapabilityResolverBaseProvider[],\n resolution: CapabilityResolution,\n): CapabilityResolverBaseProvider[] {\n return resolution.providers.map((suggestion) => {\n const exact = baseProviders.find((provider) => provider.provider === suggestion.provider && provider.role === suggestion.role);\n const sameRole = baseProviders.find((provider) => provider.role === suggestion.role);\n const sameProvider = baseProviders.find((provider) => provider.provider === suggestion.provider);\n const base = exact ?? sameRole ?? sameProvider;\n\n return {\n provider: suggestion.provider,\n role: suggestion.role,\n command: base?.command ?? \"\",\n profile: suggestion.profile || base?.profile || \"\",\n profilePath: base?.profilePath ?? \"\",\n profileInstructions: base?.profileInstructions ?? \"\",\n };\n });\n}\n","import { TemplateEngine } from \"recker\";\nimport { PROMPT_TEMPLATES, type PromptTemplateName } from \"./generated/prompts.ts\";\n\nconst engine = new TemplateEngine({\n cache: true,\n format: \"raw\",\n strict: false,\n});\n\nfunction normalizePrompt(text: string): string {\n return text\n .replace(/\\r\\n/g, \"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .trim();\n}\n\nexport async function renderPrompt(\n name: PromptTemplateName,\n context: Record<string, unknown> = {},\n): Promise<string> {\n return renderPromptString(PROMPT_TEMPLATES[name], context);\n}\n\nexport async function renderPromptString(\n template: string,\n context: Record<string, unknown> = {},\n): Promise<string> {\n const rendered = await engine.render(template, context);\n return normalizePrompt(rendered);\n}\n","// Generated by scripts/generate-prompts.ts. Do not edit directly.\n\nexport const PROMPT_TEMPLATES = {\n \"agent-provider-base\": \"{{#if isPlanner}}\\nRole: planner.\\nAnalyze the issue and prepare an execution plan for the implementation agents.\\nDo not claim the issue is complete unless the plan itself is the deliverable.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer.\\nInspect the workspace and review the current implementation critically.\\nIf rework is required, emit `FIFONY_STATUS=continue` and provide actionable `nextPrompt` feedback.\\nEmit `FIFONY_STATUS=done` only when the work is acceptable.\\n{{else}}\\nRole: executor.\\nImplement the required changes in the workspace.\\nUse any planner guidance or prior reviewer feedback already persisted in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasImpeccableOverlay}}\\nImpeccable overlay is active.\\nRaise the bar on UI polish, clarity, responsiveness, visual hierarchy, and interaction quality.\\n{{#if isReviewer}}\\nReview with a stricter frontend and product-quality standard than a normal correctness-only pass.\\n{{else}}\\nWhen touching frontend work, do not settle for baseline implementation quality.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasFrontendDesignOverlay}}\\nFrontend-design overlay is active.\\nPrefer stronger hierarchy, spacing, and readability decisions over generic implementation choices.\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{#if capabilityCategory}}\\nCapability routing: {{capabilityCategory}}.\\nSelection reason: {{selectionReason}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}.\\n{{/if}}\\n{{/if}}\\n\\n{{#if targetPaths.length}}\\nTarget paths: {{targetPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\n{{basePrompt}}\\n\", // src/prompts/agent-provider-base.stub.md\n \"agent-turn\": \"Continue working on {{issueIdentifier}}.\\nTurn {{turnIndex}} of {{maxTurns}}.\\n\\nBase objective:\\n{{basePrompt}}\\n\\nContinuation guidance:\\n{{continuation}}\\n\\nPrevious command output tail:\\n```text\\n{{outputTail}}\\n```\\n\\nBefore exiting successfully, emit one of the following control markers:\\n- `FIFONY_STATUS=continue` if more turns are required.\\n- `FIFONY_STATUS=done` if the issue is complete.\\n- `FIFONY_STATUS=blocked` if manual intervention is required.\\nYou may also write `fifony-result.json` with `{ \\\"status\\\": \\\"...\\\", \\\"summary\\\": \\\"...\\\", \\\"nextPrompt\\\": \\\"...\\\" }`.\\n\", // src/prompts/agent-turn.stub.md\n \"compile-execution-claude\": \"{{#if isPlanner}}\\nRole: planner. Analyze the issue and prepare an execution plan.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\nRole: executor. Implement the required changes.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{planPrompt}}\\n\\n{{#if subagentsToUse.length}}\\n## Subagent Strategy (Claude-specific)\\nYou have access to the Agent tool for spawning subagents. Use them for:\\n{{#each subagentsToUse}}\\n- **{{name}}** ({{role}}): {{why}}\\n{{/each}}\\n\\nLaunch subagents for independent subtasks to maximize parallelism.\\nUse the main thread for coordination and integration.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Skills to Activate\\n{{#each skillsToUse}}\\n- Invoke **/{{name}}** - {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n{{#if validationItems.length}}\\n## Pre-completion enforcement\\nBefore reporting done, verify:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\", // src/prompts/compile-execution-claude.stub.md\n \"compile-execution-codex\": \"{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\n{{#if isPlanner}}\\nRole: planner. Analyze and prepare an execution plan.\\n{{else}}\\nRole: executor. Implement the required changes in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{planPrompt}}\\n\\n{{#if phases.length}}\\n## Checkpoint Execution (Codex mode)\\nExecute in strict phases. After each phase, verify outputs before proceeding.\\n{{#each phases}}\\n- **{{phaseName}}**: {{goal}}\\n{{#if outputs.length}} Checkpoint: verify {{outputs | join \\\", \\\"}} before next phase.{{/if}}\\n{{/each}}\\n{{else}}\\n## Execution Order\\nExecute steps in order. Verify each step's `doneWhen` criterion before proceeding.\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\nFocus changes on these paths. Do not make unnecessary changes elsewhere.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Specialized Procedures\\n{{#each skillsToUse}}\\n- Apply **{{name}}** procedure: {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if validationItems.length}}\\n## Pre-completion checks\\nBefore reporting done, run:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n## Output Format\\n\\n{{outputContract}}\\n\", // src/prompts/compile-execution-codex.stub.md\n \"compile-review\": \"Review the work done for {{issueIdentifier}}.\\n\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{#if planPrompt}}\\n# Original Execution Plan\\n\\n{{planPrompt}}\\n{{/if}}\\n\\n{{#if successCriteria.length}}\\n# Success Criteria (evaluate against these)\\n{{#each successCriteria}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if deliverables.length}}\\n# Expected Deliverables\\n{{#each deliverables}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if diffSummary}}\\n# Changes Made (diff summary)\\n```\\n{{diffSummary}}\\n```\\n{{/if}}\\n\\n# Structured Context\\nIf `fifony-execution-payload.json` exists in the workspace, read it for the canonical structured task data.\\nUse the `successCriteria`, `constraints`, and `deliverables` fields as your evaluation checklist.\\n\\n# Review Instructions\\n\\n1. Verify each success criterion from the plan is met.\\n2. Check that all expected deliverables are present.\\n3. Review the diff for correctness, security issues, and code quality.\\n4. Verify validation checks pass (run commands if specified in the plan).\\n5. Check for unintended side effects or regressions.\\n\\nIf the work is acceptable, emit FIFONY_STATUS=done.\\nIf rework is needed, emit FIFONY_STATUS=continue and provide actionable feedback in nextPrompt.\\nIf the work is fundamentally broken, emit FIFONY_STATUS=blocked.\\n\", // src/prompts/compile-review.stub.md\n \"integrations-agency-agents\": \"---\\nagent:\\n providers:\\n - provider: claude\\n role: planner\\n profile: agency-senior-project-manager\\n - provider: codex\\n role: executor\\n profile: agency-senior-developer\\n - provider: claude\\n role: reviewer\\n profile: agency-code-reviewer\\ncodex:\\n command: \\\"codex\\\"\\nclaude:\\n command: \\\"claude\\\"\\n---\\n\\nUse local agency agent profiles discovered from workspace or home directories.\\nWorkspace: {{workspaceRoot}}\\n\", // src/prompts/integrations-agency-agents.stub.md\n \"integrations-impeccable\": \"# Impeccable integration idea\\n\\nUse impeccable-oriented skills as a frontend review layer around fifo issues.\\n\\nSuggested pattern:\\n\\n1. Use `agency-senior-developer` or `codex` as executor.\\n2. Route UI-heavy issues to a reviewer prompt that explicitly asks for impeccable-style critique.\\n3. Expose the resulting review through the fifo MCP prompts or as a follow-up review issue.\\n\\nSuggested labels:\\n- frontend\\n- ui\\n- design-system\\n\\nSuggested reviewer prompt seed:\\n\\\"Review this implementation using impeccable standards for frontend quality, polish, hierarchy, spacing, responsiveness, and interaction clarity.\\\"\\n\", // src/prompts/integrations-impeccable.stub.md\n \"issue-enhancer-description\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the description to be clearer, complete, and directly actionable.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"description\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nCurrent description: {{description}}\\n\\nRules:\\n- Keep it concise but include meaningful acceptance criteria.\\n- Use plain text only, with short paragraphs or bullet style.\\n- Avoid markdown wrappers, quotes, and extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-description.stub.md\n \"issue-enhancer-title\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the title for clarity, actionability, and specificity.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"title\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nDescription context: {{description}}\\n\\nRules:\\n- Keep it concise and suitable as a task title.\\n- Use imperative language when possible.\\n- Do not include markdown, quotes, or extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-title.stub.md\n \"issue-planner\": \"You are a senior technical execution planner.\\nProduce the best possible plan for the issue below, filling the JSON schema precisely.\\n{{#if fast}}\\n\\nFAST MODE: Be brief and direct. Minimize reasoning depth.\\n- 2-4 steps maximum. Skip optional fields (unknowns, risks, alternatives).\\n- No tooling reflection needed — set shouldUseSkills: false, shouldUseSubagents: false.\\n- Focus only on: summary, steps, estimatedComplexity, suggestedPaths, suggestedLabels.\\n{{/if}}\\n\\nIssue title: {{title}}\\nIssue description: {{description}}\\n{{#unless fast}}\\n\\nQuality rules:\\n- Be concrete, not generic. No vague phrases like 'implement' or 'improve' without detail.\\n- Break work into actionable steps (2-8 steps). Each step describes WHAT, not HOW.\\n- Each step must have a clear 'doneWhen' acceptance criterion.\\n- Identify assumptions, constraints, unknowns, and risks.\\n- For unknowns, specify what question needs answering and how to resolve it.\\n- Suggest file paths that are likely relevant to the changes.\\n- Suggest labels: bug, feature, frontend, backend, docs, refactor, security, performance, etc.\\n\\nComplexity estimation:\\n- trivial: < 5 min, single-file cosmetic change\\n- low: 5-15 min, small focused change\\n- medium: 15-60 min, multi-file change with testing\\n- high: > 1 hour, architectural change or new feature\\n\\nTooling reflection (REQUIRED):\\n- Evaluate whether the task benefits from using skills (specialized instructions for quality/consistency).\\n- Evaluate whether subtasks should use subagents (parallel work, isolated context, specialization).\\n- Only recommend skills/agents when there is a concrete justification.\\n- For each step, set ownerType: 'agent' for automated work, 'human' for manual review, 'skill' for specialized skills, 'subagent' for delegated work.\\n\\nEffort suggestion:\\n- low: simple fixes, no deep reasoning needed\\n- medium: standard development work\\n- high: complex architecture, security, or cross-cutting changes\\n- Set per-role if different: planner, executor, reviewer\\n{{/unless}}\\n\\nReturn strict JSON. No text outside JSON.\\n\", // src/prompts/issue-planner.stub.md\n \"issue-planner-refine\": \"You are a senior technical execution planner refining an existing plan based on user feedback.\\n\\n## Original Issue\\nTitle: {{title}}\\nDescription: {{description}}\\n\\n## Current Plan (JSON)\\n```json\\n{{currentPlan}}\\n```\\n\\n## User Feedback\\n{{feedback}}\\n\\n## Instructions\\n\\nRevise the plan above to address the user's feedback precisely.\\n\\nRules:\\n- Keep all parts of the plan that are NOT affected by the feedback unchanged.\\n- Only modify, add, or remove elements that the feedback specifically requests.\\n- Preserve the same JSON schema structure as the current plan.\\n- Maintain step numbering consistency after changes.\\n- If feedback asks to add steps, insert them in the logical position and renumber.\\n- If feedback asks to remove steps, renumber remaining steps sequentially.\\n- Update the summary if the overall direction changed.\\n- Re-evaluate estimatedComplexity if the scope changed significantly.\\n- Update suggestedPaths and suggestedLabels if affected by the changes.\\n\\nReturn strict JSON. No text outside JSON.\\n\", // src/prompts/issue-planner-refine.stub.md\n \"mcp-integrate-client\": \"Integrate {{client}} with the local fifo MCP server.\\n\\nGoal: {{goal}}\\n\\n{{integrationGuide}}\\n\\nUse the available fifo resources and tools instead of inventing your own persistence model.\\n\", // src/prompts/mcp-integrate-client.stub.md\n \"mcp-integration-guide\": \"# fifo MCP integration\\n\\nWorkspace root: `{{workspaceRoot}}`\\nPersistence root: `{{persistenceRoot}}`\\nState root: `{{stateRoot}}`\\n\\nRecommended MCP client command:\\n\\n```json\\n{\\n \\\"mcpServers\\\": {\\n \\\"fifony\\\": {\\n \\\"command\\\": \\\"npx\\\",\\n \\\"args\\\": [\\\"fifony\\\", \\\"mcp\\\", \\\"--workspace\\\", \\\"{{workspaceRoot}}\\\", \\\"--persistence\\\", \\\"{{persistenceRoot}}\\\"]\\n }\\n }\\n}\\n```\\n\\nExpected workflow:\\n\\n1. Read `fifony://guide/overview` and `fifony://state/summary`.\\n2. Use `fifony.list_issues` or read `fifony://issues`.\\n3. Create work with `fifony.create_issue`.\\n4. Update workflow state with `fifony.update_issue_state`.\\n5. Use the prompts exposed by this MCP server to structure planning or execution.\\n\\nThe MCP server is read-write against the same `s3db` filesystem store used by the fifo runtime.\\n\", // src/prompts/mcp-integration-guide.stub.md\n \"mcp-issue\": \"You are integrating with fifo as the {{role}} using {{provider}}.\\n\\nIssue ID: {{id}}\\nTitle: {{title}}\\nState: {{state}}\\nCapability category: {{capabilityCategory}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}\\n{{/if}}\\n{{#if paths.length}}\\nPaths: {{paths | join \\\", \\\"}}\\n{{/if}}\\nDescription:\\n{{description}}\\n\\nUse fifo as the source of truth:\\n- Read the workflow contract from WORKFLOW.md if available.\\n- Persist transitions through the fifo tools instead of inventing local state.\\n- Keep outputs actionable and aligned with the tracked issue lifecycle.\\n\", // src/prompts/mcp-issue.stub.md\n \"mcp-review-workflow\": \"Review the WORKFLOW.md for this fifo workspace as {{provider}}.\\n\\nWorkspace: {{workspaceRoot}}\\nWorkflow present: {{workflowPresent}}\\n\\nFocus on:\\n- provider orchestration quality\\n- hooks safety\\n- prompt clarity\\n- issue lifecycle correctness\\n- what an MCP client needs in order to integrate cleanly\\n\", // src/prompts/mcp-review-workflow.stub.md\n \"mcp-route-task\": \"Use this routing decision as the execution plan for the task.\\n\\n{{resolutionJson}}\\n\", // src/prompts/mcp-route-task.stub.md\n \"project-analysis\": \"You are analyzing a software project to help configure an AI-powered development assistant.\\n\\nLook at the project structure, source code, configuration files, and any documentation you can find. Pay special attention to:\\n- README, CLAUDE.md, AGENTS.md, or any project documentation\\n- Build files: package.json, Cargo.toml, pyproject.toml, build.gradle, Gemfile, go.mod, Makefile, CMakeLists.txt, pom.xml, etc.\\n- Source code directories and their contents\\n- Configuration files (.env, docker-compose, terraform, etc.)\\n- CI/CD pipelines (.github/workflows, .gitlab-ci, Jenkinsfile, etc.)\\n\\nReturn a JSON object with exactly these fields:\\n\\n{\\n \\\"description\\\": \\\"A concise 2-3 sentence description of what this project does, its purpose, and who it's for.\\\",\\n \\\"language\\\": \\\"The primary programming language (e.g. typescript, python, rust, java, kotlin, ruby, go, swift, c++)\\\",\\n \\\"domains\\\": [\\\"Array of relevant domain tags that apply to this project\\\"],\\n \\\"stack\\\": [\\\"Array of key technologies, frameworks, and tools used\\\"],\\n \\\"suggestedAgents\\\": [\\\"Array of specialist agent names that would help develop this project\\\"]\\n}\\n\\nFor \\\"domains\\\", choose from: frontend, backend, mobile, devops, database, ai-ml, security, testing, games, ecommerce, fintech, healthcare, education, saas, design, product, marketing, embedded, blockchain, spatial-computing, data-engineering.\\n\\nFor \\\"suggestedAgents\\\", choose from: frontend-developer, backend-architect, database-optimizer, security-engineer, devops-automator, mobile-app-builder, ai-engineer, ui-designer, ux-architect, code-reviewer, technical-writer, sre, data-engineer, software-architect, game-designer.\\n\\nReturn ONLY the JSON object. No markdown fences, no explanation, no extra text.\\n\", // src/prompts/project-analysis.stub.md\n \"workflow-default\": \"You are working on {{issue.identifier}}.\\n\\nTitle: {{issue.title}}\\nDescription:\\n{{issue.description}}\\n\", // src/prompts/workflow-default.stub.md\n \"workflow-plan-section\": \"## Execution Plan\\n\\nComplexity: {{estimatedComplexity}}\\nSummary: {{summary}}\\n\\nSteps:\\n{{#each steps}}\\n{{step}}. {{action}}{{#if files.length}} (files: {{files | join \\\", \\\"}}){{/if}}{{#if details}} - {{details}}{{/if}}\\n{{/each}}\\n\\nFollow this plan. Complete each step in order.\\n\", // src/prompts/workflow-plan-section.stub.md\n} as const;\n\nexport type PromptTemplateName = keyof typeof PROMPT_TEMPLATES;\n"],"mappings":";AAoDA,SAAS,SAAS,OAAwC;AACxD,QAAM,UAAU,MAAM,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,WAAW,aAAa,KAAK,CAAC,MAAM,WAAW,UAAU,CAAC;AACvH,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM;AAAA,IACN,MAAM,eAAe;AAAA,IACrB,GAAG;AAAA,IACH,GAAI,MAAM,SAAS,CAAC;AAAA,EACtB,EAAE,KAAK,GAAG,EAAE,YAAY;AAC1B;AAEA,SAAS,cAAc,OAAuB;AAC5C,SAAO,MAAM,KAAK,EAAE,WAAW,MAAM,GAAG,EAAE,YAAY;AACxD;AAEO,SAAS,qBAAqB,OAA0C;AAC7E,QAAM,UAAU,MAAM,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,WAAW,aAAa,KAAK,CAAC,MAAM,WAAW,UAAU,CAAC;AACvH,QAAM,UAAU,CAAC,MAAM,OAAO,MAAM,eAAe,IAAI,GAAG,MAAM;AAChE,QAAM,UAAU,oBAAI,IAAY;AAChC,QAAM,UAAU;AAEhB,aAAW,UAAU,SAAS;AAC5B,eAAW,SAAS,OAAO,MAAM,OAAO,KAAK,CAAC,GAAG;AAC/C,cAAQ,IAAI,cAAc,KAAK,CAAC;AAAA,IAClC;AAAA,EACF;AAEA,SAAO,CAAC,GAAG,OAAO;AACpB;AAEA,SAAS,cAAc,OAA0C;AAC/D,SAAO,CAAC,GAAG,oBAAI,IAAI;AAAA,IACjB,IAAI,MAAM,SAAS,CAAC,GACjB,OAAO,CAAC,UAA2B,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,SAAS,CAAC,EACvF,IAAI,aAAa;AAAA,IACpB,GAAG,qBAAqB,KAAK;AAAA,EAC/B,CAAC,CAAC;AACJ;AAEA,SAAS,OAAO,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I,eAAe;AAAA,EAChC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV,CAAC;AAED,SAAS,gBAAgB,MAAsB;AAC7C,SAAO,KACJ,QAAQ,SAAS,IAAI,EACrB,QAAQ,WAAW,MAAM,EACzB,KAAK;AACV;AAEA,eAAsB,aACpB,MACA,UAAmC,CAAC,GACnB;AACjB,SAAO,mBAAmB,iBAAiB,IAAI,GAAG,OAAO;AAC3D;AAEA,eAAsB,mBACpB,UACA,UAAmC,CAAC,GACnB;AACjB,QAAM,WAAW,MAAM,OAAO,OAAO,UAAU,OAAO;AACtD,SAAO,gBAAgB,QAAQ;AACjC;","names":[]}
|
package/dist/mcp/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fifony",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20-next.675ea21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "Filesystem-backed local
|
|
6
|
+
"description": "Filesystem-backed local fifo orchestrator with a TypeScript CLI, MCP mode, and multi-agent Codex or Claude workflows.",
|
|
7
7
|
"bin": {
|
|
8
8
|
"fifony": "./bin/fifony.js"
|
|
9
9
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n,m as r}from"./vendor-BoGBoEwT.js";import{c as i,l as a,n as o,t as s,u as c,w as l,y as u}from"./zap-DpjdVd1i.js";import{t as d}from"./createLucideIcon-DtZs0TX0.js";import{S as f,a as p,b as m,c as h,d as g,g as _,h as v,l as y,m as b,n as x,p as S,r as C,s as w,t as ee,u as T,x as E,y as D}from"./index-DMURYaTH.js";var O=d(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),k=d(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),te=d(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),A=d(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),j=d(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),M=d(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),N=d(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),P=d(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),F=d(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),I=e(t(),1),L=n(),R=[`Welcome`,`Providers`,`Scan Project`,`Domains`,`Agents & Skills`,`Effort`,`Workers & Theme`,`Launch`];function ne(e){return e?[...R.slice(0,3),`Discover Issues`,...R.slice(3)]:R}function re(e){return e?9:8}var z=[{value:`low`,label:`Low`,icon:s,description:`Quick and light -- fast responses, less thorough`,color:`text-info`},{value:`medium`,label:`Medium`,icon:b,description:`Balanced -- good mix of speed and quality`,color:`text-success`},{value:`high`,label:`High`,icon:k,description:`Thorough -- deeper analysis, takes more time`,color:`text-warning`},{value:`extra-high`,label:`Extra High`,icon:j,description:`Maximum depth -- most thorough, slowest`,color:`text-error`}],B={codex:z,claude:z.filter(e=>e.value!==`extra-high`)};function V(e,t){return B[t?.[e]||`claude`]||z}var H=[{label:`Technical`,domains:[{value:`frontend`,label:`Frontend`,emoji:`🎨`},{value:`backend`,label:`Backend`,emoji:`⚙️`},{value:`mobile`,label:`Mobile`,emoji:`📱`},{value:`devops`,label:`DevOps / Infra`,emoji:`🚀`},{value:`database`,label:`Database`,emoji:`🗄️`},{value:`ai-ml`,label:`AI / ML`,emoji:`🤖`},{value:`security`,label:`Security`,emoji:`🔒`},{value:`testing`,label:`Testing / QA`,emoji:`🧪`},{value:`embedded`,label:`Embedded / IoT`,emoji:`🔌`}]},{label:`Industry`,domains:[{value:`games`,label:`Games`,emoji:`🎮`},{value:`ecommerce`,label:`E-commerce`,emoji:`🛒`},{value:`saas`,label:`SaaS`,emoji:`☁️`},{value:`fintech`,label:`Fintech`,emoji:`💰`},{value:`healthcare`,label:`Healthcare`,emoji:`🏥`},{value:`education`,label:`Education`,emoji:`📚`},{value:`blockchain`,label:`Blockchain`,emoji:`⛓️`},{value:`spatial-computing`,label:`Spatial / XR`,emoji:`🥽`}]},{label:`Role`,domains:[{value:`design`,label:`Design / UX`,emoji:`✏️`},{value:`product`,label:`Product`,emoji:`📋`},{value:`marketing`,label:`Marketing`,emoji:`📢`},{value:`data-engineering`,label:`Data Engineering`,emoji:`📊`}]}],ie=[{value:`auto`,label:`Auto`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`black`,label:`Black`},{value:`cupcake`,label:`Cupcake`},{value:`night`,label:`Night`},{value:`sunset`,label:`Sunset`}];async function U(e,t,n=`ui`){return l.post(`/settings/${encodeURIComponent(e)}`,{value:t,scope:n,source:`user`})}function W(e,t=`medium`){return z.some(t=>t.value===e)?e:t}function ae(e){return!e||typeof e!=`object`||Array.isArray(e)?{planner:`medium`,executor:`medium`,reviewer:`medium`}:{planner:W(e.planner??e.default,`medium`),executor:W(e.executor??e.default,`medium`),reviewer:W(e.reviewer??e.default,`medium`)}}function G(e,t,n={}){return{plan:{provider:e.planner||`claude`,model:n.plan||e.planner||`claude`,effort:t.planner||`medium`},execute:{provider:e.executor||`codex`,model:n.execute||e.executor||`codex`,effort:t.executor||`medium`},review:{provider:e.reviewer||`claude`,model:n.review||e.reviewer||`claude`,effort:t.reviewer||`medium`}}}var K=[`Pipeline`,`Scan`,`Domains`,`Agents`,`Effort`,`Workers & Theme`,`Launch`];function q(e){return e?[...K.slice(0,2),`Discover`,...K.slice(2)]:K}function oe({current:e,wantsDiscovery:t}){let n=q(t),r=e-1;return(0,L.jsx)(`ul`,{className:`steps steps-horizontal w-full max-w-2xl text-xs`,children:n.map((e,t)=>{let n=t<r,i=t===r;return(0,L.jsx)(`li`,{"data-content":n?`✓`:t+1,className:`step ${n||i?`step-primary`:``}`,style:{transition:`color 0.3s ease`},children:e},e)})})}function se({direction:e,stepKey:t,center:n,children:r}){return(0,L.jsx)(`div`,{className:`${e===`forward`?`animate-slide-in-right`:`animate-slide-in-left`} w-full max-w-2xl mx-auto ${n?`my-auto`:``}`,children:r},t)}function ce(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{l.get(`/gitignore/status`).then(t).catch(()=>t({exists:!1,hasFifony:!1}))},[]),e===null||e.hasFifony||i?i?(0,L.jsxs)(`div`,{className:`alert alert-success text-sm max-w-md animate-fade-in`,children:[(0,L.jsx)(F,{className:`size-4 shrink-0`}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`code`,{children:`.fifony/`}),` added to `,(0,L.jsx)(`code`,{children:`.gitignore`})]})]}):null:(0,L.jsxs)(`div`,{className:`alert alert-warning text-sm max-w-md`,children:[(0,L.jsx)(S,{className:`size-4 shrink-0`}),(0,L.jsxs)(`div`,{className:`flex-1`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`code`,{children:`.fifony/`}),` is not in your `,(0,L.jsx)(`code`,{children:`.gitignore`}),`.`]}),(0,L.jsx)(`span`,{className:`text-base-content/50 block text-xs mt-0.5`,children:`Fifony stores local state there — it shouldn't be committed.`})]}),(0,L.jsx)(`button`,{className:`btn btn-xs btn-warning`,onClick:async()=>{r(!0);try{await l.post(`/gitignore/add`),a(!0)}catch{}finally{r(!1)}},disabled:n,children:n?(0,L.jsx)(g,{className:`size-3 animate-spin`}):`Add it`})]})}function le({workspacePath:e,onGetStarted:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,L.jsx)(`div`,{className:`text-6xl sm:text-7xl animate-bounce-in`,children:(0,L.jsx)(T,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,L.jsxs)(`h1`,{className:`text-3xl sm:text-4xl font-bold tracking-tight`,children:[`Welcome to `,(0,L.jsx)(`span`,{className:`text-primary`,children:`Fifony`})]}),(0,L.jsx)(`p`,{className:`text-base-content/60 text-lg max-w-md`,children:`Let's set up your AI orchestration workspace in just a few steps.`}),e&&(0,L.jsxs)(`div`,{className:`badge badge-lg badge-soft badge-primary gap-2`,children:[(0,L.jsx)(w,{className:`size-3.5`}),e]}),(0,L.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mt-2`,onClick:t,children:[`Get Started `,(0,L.jsx)(A,{className:`size-5`})]})]})}var ue=[{role:`planner`,label:`Planner`,description:`Scopes the issue, breaks it into steps, and decides the approach`,icon:k,color:`text-info`},{role:`executor`,label:`Executor`,description:`Implements the plan — writes code, edits files, runs commands`,icon:s,color:`text-primary`},{role:`reviewer`,label:`Reviewer`,description:`Validates the result — checks correctness, scope, and quality`,icon:h,color:`text-secondary`}];function de({providers:e,providersLoading:t,pipeline:n,setPipeline:r}){let i=Array.isArray(e)?e:[],a=i.filter(e=>e.available!==!1);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(P,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agent Pipeline`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which CLI runs each stage of the pipeline`})]}),t?(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-8`,children:[(0,L.jsx)(g,{className:`size-8 text-primary animate-spin`}),(0,L.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Detecting available CLIs...`})]}):a.length===0?(0,L.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`No providers detected. Make sure claude or codex CLI is installed.`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:i.map(e=>{let t=e.id||e.name||e,n=e.available!==!1;return(0,L.jsxs)(`span`,{className:`badge badge-lg gap-2 ${n?`badge-success`:`badge-ghost opacity-50`}`,children:[n?(0,L.jsx)(m,{className:`size-3.5`}):(0,L.jsx)(D,{className:`size-3.5`}),t,e.path&&(0,L.jsx)(`span`,{className:`font-mono text-[10px] opacity-60 hidden sm:inline`,children:e.path})]},t)})}),(0,L.jsx)(`div`,{className:`flex flex-col items-center gap-2`,children:ue.map((e,t)=>{let i=e.icon,o=n[e.role]||a[0]?.name||``;return(0,L.jsxs)(`div`,{className:`w-full`,children:[t>0&&(0,L.jsx)(`div`,{className:`flex justify-center py-1`,children:(0,L.jsx)(A,{className:`size-5 rotate-90 opacity-30`})}),(0,L.jsx)(`div`,{className:`card bg-base-200`,children:(0,L.jsxs)(`div`,{className:`card-body p-4 flex-row items-center gap-4`,children:[(0,L.jsx)(`div`,{className:`size-10 rounded-full flex items-center justify-center bg-base-300 ${e.color}`,children:(0,L.jsx)(i,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-semibold`,children:e.label}),(0,L.jsx)(`p`,{className:`text-xs text-base-content/50`,children:e.description})]}),(0,L.jsx)(`select`,{className:`select select-bordered select-sm w-32`,value:o,onChange:t=>r(n=>({...n,[e.role]:t.target.value})),children:a.map(e=>{let t=e.id||e.name||e;return(0,L.jsx)(`option`,{value:t,children:t},t)})})]})})]},e.role)})}),(0,L.jsx)(`p`,{className:`text-xs text-base-content/40 text-center max-w-md mx-auto`,children:`Each stage can use a different CLI. The pipeline flows top to bottom: plan, then execute, then review.`})]})]})}function fe({scanResult:e,setScanResult:t,projectDescription:n,setProjectDescription:r,analysisResult:i,setAnalysisResult:a,selectedProvider:o,analyzing:s,setAnalyzing:c}){let[u,d]=(0,I.useState)(!1),[p,h]=(0,I.useState)(null),[_,y]=(0,I.useState)(null),b=(0,I.useRef)(!1);(0,I.useEffect)(()=>{b.current||e||(b.current=!0,d(!0),h(null),l.get(`/scan/project`).then(e=>{if(t(e),!n){let t=e?.packageDescription||e?.packageInfo?.description||e?.readmeExcerpt||``;t&&r(t)}o&&!i&&(c(!0),l.post(`/scan/analyze`,{provider:o}).then(e=>{a(e),e.description&&r(e.description)}).catch(()=>{}).finally(()=>c(!1)))}).catch(e=>h(e.message||`Failed to scan project`)).finally(()=>d(!1)))},[]);let x=(0,I.useCallback)(async()=>{c(!0),y(null);try{let e=await l.post(`/scan/analyze`,{provider:o||`claude`});a(e),e.description&&r(e.description)}catch(e){y(e.message||`Analysis failed`)}finally{c(!1)}},[o,c,a,r]),S={claudeMd:`CLAUDE.md`,claudeDir:`.claude/`,codexDir:`.codex/`,readmeMd:`README.md`,packageJson:`package.json`,cargoToml:`Cargo.toml`,pyprojectToml:`pyproject.toml`,goMod:`go.mod`,buildGradle:`build.gradle`,gemfile:`Gemfile`,dockerfile:`Dockerfile`,workflowMd:`WORKFLOW.md`,agentsMd:`AGENTS.md`,claudeAgentsDir:`.claude/agents/`,claudeSkillsDir:`.claude/skills/`,codexAgentsDir:`.codex/agents/`,codexSkillsDir:`.codex/skills/`},C=e?.files||{},ee=Object.entries(C).map(([e,t])=>({path:S[e]||e,exists:!!t})),T=(e?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),E=(e?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),k=i?.stack||[];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(M,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Scan Project`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`We'll analyze your workspace to suggest the best setup`})]}),u&&(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6`,children:[(0,L.jsx)(g,{className:`size-8 text-primary animate-spin`}),(0,L.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Scanning project files...`})]}),p&&(0,L.jsx)(`div`,{className:`alert alert-warning text-sm`,children:p}),e&&!u&&(0,L.jsx)(`div`,{className:`card bg-base-200`,children:(0,L.jsxs)(`div`,{className:`card-body p-4 gap-3`,children:[(0,L.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,L.jsx)(v,{className:`size-4 opacity-50`}),`Project Files`]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5`,children:ee.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[e.exists?(0,L.jsx)(m,{className:`size-4 text-success shrink-0`}):(0,L.jsx)(D,{className:`size-4 text-base-content/30 shrink-0`}),(0,L.jsx)(`span`,{className:`font-mono text-xs truncate ${e.exists?``:`text-base-content/40`}`,children:e.path})]},e.path))}),(T.length>0||E.length>0)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[T.length>0&&(0,L.jsxs)(`span`,{className:`badge badge-sm badge-info gap-1`,children:[(0,L.jsx)(f,{className:`size-3`}),T.length,` agent`,T.length===1?``:`s`,` found`]}),E.length>0&&(0,L.jsxs)(`span`,{className:`badge badge-sm badge-secondary gap-1`,children:[(0,L.jsx)(O,{className:`size-3`}),E.length,` skill`,E.length===1?``:`s`,` found`]})]})]})]})}),!s&&!i&&(0,L.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mx-auto`,onClick:x,disabled:u,children:[(0,L.jsx)(w,{className:`size-5`}),`Analyze with AI`]}),s&&(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-4`,children:[(0,L.jsx)(g,{className:`size-8 text-primary animate-spin`}),(0,L.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`AI is analyzing your project...`})]}),_&&(0,L.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`Analysis failed. You can describe your project manually below.`}),k.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:k.map(e=>(0,L.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary`,children:e},e))}),(e||i||_)&&!u&&!s&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`label`,{className:`label text-sm font-medium`,children:`Project Description`}),(0,L.jsx)(`textarea`,{className:`textarea textarea-bordered w-full h-24 text-sm`,placeholder:`Describe your project so we can suggest the right agents and domains...`,value:n,onChange:e=>r(e.target.value)})]})]})}function pe({selectedDomains:e,setSelectedDomains:t,analysisResult:n}){let r=(0,I.useRef)(!1);(0,I.useEffect)(()=>{r.current||!n?.domains?.length||e.length>0||(r.current=!0,t(n.domains))},[n]);let i=(0,I.useCallback)(e=>{t(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[t]);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(N,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Domains`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Select the domains relevant to your project`})]}),H.map(t=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-base-content/40 mb-2`,children:t.label}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.domains.map(t=>(0,L.jsxs)(`button`,{className:`btn btn-sm gap-1.5 ${e.includes(t.value)?`btn-primary`:`btn-soft`}`,onClick:()=>i(t.value),children:[(0,L.jsx)(`span`,{children:t.emoji}),t.label]},t.value))})]},t.label))]})}function me({selectedDomains:e,selectedAgents:t,setSelectedAgents:n,selectedSkills:r,setSelectedSkills:i,existingAgents:a,existingSkills:o}){let[s,c]=(0,I.useState)([]),[u,d]=(0,I.useState)([]),[p,m]=(0,I.useState)(!1),h=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(h.current)return;h.current=!0,m(!0);let s=e.length>0?`?domains=${e.join(`,`)}`:``;Promise.all([l.get(`/catalog/agents${s}`).catch(()=>({agents:[]})),l.get(`/catalog/skills`).catch(()=>({skills:[]}))]).then(([e,s])=>{let l=e?.agents||[],u=s?.skills||[];c(l),d(u);let f=new Set((a||[]).map(e=>e.name)),p=l.filter(e=>!f.has(e.name)).map(e=>e.name);p.length>0&&t.length===0&&n(p);let m=new Set((o||[]).map(e=>e.name)),h=u.filter(e=>!m.has(e.name)).map(e=>e.name);h.length>0&&r.length===0&&i(h)}).finally(()=>m(!1))},[]);let _=new Set((a||[]).map(e=>e.name)),v=new Set((o||[]).map(e=>e.name)),y=(0,I.useCallback)(e=>{n(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[n]),b=(0,I.useCallback)(e=>{i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[i]),x=(0,I.useCallback)(()=>{n(s.filter(e=>!_.has(e.name)).map(e=>e.name))},[s,_,n]),S=(0,I.useCallback)(()=>n([]),[n]),C=(0,I.useCallback)(()=>{i(u.filter(e=>!v.has(e.name)).map(e=>e.name))},[u,v,i]),w=(0,I.useCallback)(()=>i([]),[i]);return p?(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12`,children:[(0,L.jsx)(g,{className:`size-8 text-primary animate-spin`}),(0,L.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Loading catalog...`})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(f,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agents & Skills`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which agents and skills to install`})]}),s.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,L.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,L.jsx)(f,{className:`size-4 opacity-50`}),`Agents (`,s.length,`)`]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:x,children:`Select All`}),(0,L.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:S,children:`None`})]})]}),(0,L.jsx)(`div`,{className:`grid gap-2`,children:s.map(e=>{let n=_.has(e.name),r=n||t.includes(e.name);return(0,L.jsx)(`button`,{className:`card bg-base-200 cursor-pointer transition-all text-left ${r?`ring-2 ring-primary ring-offset-1 ring-offset-base-100`:``} ${n?`opacity-60`:``}`,onClick:()=>!n&&y(e.name),disabled:n,children:(0,L.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🤖`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,L.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),n?(0,L.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,L.jsx)(E,{className:`size-3`}),` Installed`]}):(0,L.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:r,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),u.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,L.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,L.jsx)(O,{className:`size-4 opacity-50`}),`Skills (`,u.length,`)`]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:C,children:`Select All`}),(0,L.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:w,children:`None`})]})]}),(0,L.jsx)(`div`,{className:`grid gap-2`,children:u.map(e=>{let t=v.has(e.name),n=t||r.includes(e.name);return(0,L.jsx)(`button`,{className:`card bg-base-200 cursor-pointer transition-all text-left ${n?`ring-2 ring-primary ring-offset-1 ring-offset-base-100`:``} ${t?`opacity-60`:``}`,onClick:()=>!t&&b(e.name),disabled:t,children:(0,L.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🧩`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,L.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),t?(0,L.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,L.jsx)(E,{className:`size-3`}),` Installed`]}):(0,L.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:n,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),s.length===0&&u.length===0&&(0,L.jsx)(`div`,{className:`alert alert-info text-sm`,children:`No agents or skills found in the catalog. You can add them later from the settings page.`})]})}function J({role:e,title:t,description:n,providerName:r,value:i,onChange:a,options:o,model:s,onModelChange:c,availableModels:l}){let u=Math.max(0,o.findIndex(e=>e.value===i)),d=o[u]||o[0],f=d.icon;return(0,L.jsx)(`div`,{className:`card bg-base-200`,children:(0,L.jsxs)(`div`,{className:`card-body p-5 gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`font-semibold`,children:t}),(0,L.jsx)(`p`,{className:`text-xs text-base-content/60 mt-0.5`,children:n})]}),r&&(0,L.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary capitalize`,children:r})]}),l&&l.length>0&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`label`,{className:`text-xs text-base-content/50`,children:`Model`}),(0,L.jsx)(`select`,{className:`select select-sm select-bordered w-full`,value:s||``,onChange:e=>c?.(e.target.value),children:l.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label||e.id},e.id))})]}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-bold ${d.color}`,children:[(0,L.jsx)(f,{className:`size-6`}),d.label]}),(0,L.jsx)(`p`,{className:`text-xs text-base-content/50 text-center max-w-xs`,children:d.description})]}),(0,L.jsxs)(`div`,{className:`px-1`,children:[(0,L.jsx)(`input`,{type:`range`,min:0,max:o.length-1,value:u,onChange:e=>a(o[Number(e.target.value)].value),className:`range range-primary range-sm w-full`,step:1}),(0,L.jsx)(`div`,{className:`flex justify-between mt-1 px-0.5`,children:o.map(t=>(0,L.jsx)(`span`,{className:`text-[10px] ${t.value===d.value?d.color+` font-semibold`:`text-base-content/30`}`,children:t.label},`${e}-tick-${t.value}`))})]})]})})}function he({efforts:e,setEfforts:t,pipeline:n,models:r,setModels:i,modelsByProvider:a}){(0,I.useEffect)(()=>{for(let r of[`planner`,`executor`,`reviewer`]){let i=V(r,n),a=e[r];a&&!i.some(e=>e.value===a)&&t(e=>({...e,[r]:`high`}))}},[n,e,t]);let o=a?.[n?.planner]||[],s=a?.[n?.executor]||[],c=a?.[n?.reviewer]||[];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(b,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Models & Reasoning Effort`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose the model and reasoning depth for each pipeline stage.`})]}),(0,L.jsx)(J,{role:`planner`,title:`Planning`,description:`Scopes the issue and decides the overall approach.`,providerName:n?.planner,value:e.planner,onChange:e=>t(t=>({...t,planner:e})),options:V(`planner`,n),model:r?.plan,onModelChange:e=>i(t=>({...t,plan:e})),availableModels:o}),(0,L.jsx)(J,{role:`executor`,title:`Execution`,description:`Implements the plan — writes code, edits files.`,providerName:n?.executor,value:e.executor,onChange:e=>t(t=>({...t,executor:e})),options:V(`executor`,n),model:r?.execute,onModelChange:e=>i(t=>({...t,execute:e})),availableModels:s}),(0,L.jsx)(J,{role:`reviewer`,title:`Review`,description:`Validates the result before approving.`,providerName:n?.reviewer,value:e.reviewer,onChange:e=>t(t=>({...t,reviewer:e})),options:V(`reviewer`,n),model:r?.review,onModelChange:e=>i(t=>({...t,review:e})),availableModels:c})]})}function ge({concurrency:e,setConcurrency:t,selectedTheme:n,setSelectedTheme:r}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`text-center mb-4`,children:[(0,L.jsx)(p,{className:`size-10 text-primary mx-auto mb-3`}),(0,L.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Workers & Theme`}),(0,L.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Configure parallel workers and visual theme`})]}),(0,L.jsx)(`div`,{className:`card bg-base-200`,children:(0,L.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,L.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,L.jsx)(p,{className:`size-4 opacity-50`}),`Worker Concurrency`]}),(0,L.jsxs)(`p`,{className:`text-xs text-base-content/60`,children:[`How many agents can work in parallel (`,e,` worker`,e===1?``:`s`,`)`]}),(0,L.jsx)(`input`,{type:`range`,min:1,max:16,value:e,onChange:e=>t(Number(e.target.value)),className:`range range-primary range-sm`}),(0,L.jsxs)(`div`,{className:`flex justify-between text-xs text-base-content/40 px-1`,children:[(0,L.jsx)(`span`,{children:`1`}),(0,L.jsx)(`span`,{children:`4`}),(0,L.jsx)(`span`,{children:`8`}),(0,L.jsx)(`span`,{children:`12`}),(0,L.jsx)(`span`,{children:`16`})]})]})})]}),(0,L.jsx)(`div`,{className:`card bg-base-200`,children:(0,L.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,L.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,L.jsx)(y,{className:`size-4 opacity-50`}),`Theme`]}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ie.map(e=>(0,L.jsx)(`button`,{className:`btn btn-sm ${n===e.value?`btn-primary`:`btn-soft`}`,onClick:()=>r(e.value),children:e.label},e.value))})]})})]})}function _e({config:e,launching:t}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,L.jsx)(`div`,{className:`animate-bounce-in`,children:(0,L.jsx)(P,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,L.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-bold`,children:`You're All Set!`}),(0,L.jsx)(`p`,{className:`text-base-content/60 max-w-md`,children:`Here's a summary of your configuration. Hit launch when you're ready.`}),(0,L.jsx)(`div`,{className:`card bg-base-200 w-full max-w-sm`,children:(0,L.jsxs)(`div`,{className:`card-body p-4 gap-2 text-sm text-left`,children:[(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Pipeline`}),(0,L.jsxs)(`span`,{className:`font-semibold capitalize text-xs font-mono`,children:[e.pipeline?.planner||`?`,` → `,e.pipeline?.executor||`?`,` → `,e.pipeline?.reviewer||`?`]})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Domains`}),(0,L.jsx)(`span`,{className:`font-semibold`,children:e.domains?.length>0?e.domains.length+` selected`:`none`})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Agents`}),(0,L.jsxs)(`span`,{className:`font-semibold`,children:[e.agents?.length||0,` to install`]})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Skills`}),(0,L.jsxs)(`span`,{className:`font-semibold`,children:[e.skills?.length||0,` to install`]})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Plan`}),(0,L.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.planner})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Execute`}),(0,L.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.executor})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Review`}),(0,L.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.reviewer})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Workers`}),(0,L.jsx)(`span`,{className:`font-semibold`,children:e.concurrency})]}),(0,L.jsx)(`div`,{className:`divider my-0`}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(`span`,{className:`text-base-content/60`,children:`Theme`}),(0,L.jsx)(`span`,{className:`font-semibold capitalize`,children:e.theme})]})]})}),t&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-base-content/50`,children:[(0,L.jsx)(g,{className:`size-4 animate-spin`}),`Saving configuration & installing agents...`]})]})}function ve({onComplete:e}){let t=r(),n=u(),s=a(n.data),[d,f]=(0,I.useState)(0),[p,m]=(0,I.useState)(`forward`),[h,v]=(0,I.useState)(!1),[y,b]=(0,I.useState)(null),S=(0,I.useRef)(!1),[w,T]=(0,I.useState)(``),[E,D]=(0,I.useState)({planner:``,executor:``,reviewer:``}),[O,k]=(0,I.useState)(()=>ae(null)),[j,M]=(0,I.useState)(2),[N,F]=(0,I.useState)(`auto`),[R,z]=(0,I.useState)(null),[B,V]=(0,I.useState)(null),[H,ie]=(0,I.useState)(``),[W,K]=(0,I.useState)([]),[q,ue]=(0,I.useState)([]),[J,ve]=(0,I.useState)([]),[ye,be]=(0,I.useState)(!1),[Y,xe]=(0,I.useState)(!1),X=re(Y),Z=ne(Y)[d]||``,[Se,Ce]=(0,I.useState)(null),[we,Te]=(0,I.useState)(!1),[Ee,De]=(0,I.useState)({}),[Q,Oe]=(0,I.useState)({plan:``,execute:``,review:``}),[ke,Ae]=(0,I.useState)(``);(0,I.useEffect)(()=>{l.get(`/state`).then(e=>{Ae(e?.sourceRepoUrl||e?.config?.sourceRepo||``)}).catch(()=>{})},[]),(0,I.useEffect)(()=>{if(S.current||n.isLoading)return;S.current=!0;let e=i(s,`runtime.agentProvider`,``),t=i(s,`runtime.defaultEffort`,null),r=i(s,`ui.theme`,`auto`),a=i(s,`runtime.workerConcurrency`,2);typeof e==`string`&&e.trim()&&T(e),k(ae(t)),typeof r==`string`&&r.trim()&&F(r);let o=Number.parseInt(String(a??2),10);Number.isFinite(o)&&M(Math.min(16,Math.max(1,o)))},[s,n.isLoading]),(0,I.useEffect)(()=>{d===1&&Se===null&&(Te(!0),Promise.all([l.get(`/providers`),l.get(`/config/workflow?details=1`).catch(()=>null)]).then(([e,t])=>{let n=Array.isArray(e)?e:e?.providers||[];Ce(n);let r=t?.models||{};De(r);let i=n.filter(e=>e.available!==!1),a=i[0]?.id||i[0]?.name||``;a&&!w&&T(a);let o=i.find(e=>(e.id||e.name)===`claude`),s=a,c=o?`claude`:s,l={planner:c,executor:s,reviewer:c};D(e=>({planner:e.planner||l.planner,executor:e.executor||l.executor,reviewer:e.reviewer||l.reviewer})),Oe(e=>({plan:e.plan||r[c]?.[0]?.id||``,execute:e.execute||r[s]?.[0]?.id||``,review:e.review||r[c]?.[0]?.id||``}))}).catch(()=>{Ce([])}).finally(()=>{Te(!1)}))},[d]),(0,I.useEffect)(()=>{let e=N===`auto`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:N;document.documentElement.setAttribute(`data-theme`,e)},[N]),(0,I.useEffect)(()=>{E.executor&&E.executor!==w&&T(E.executor)},[E.executor]);let je=(0,I.useCallback)(e=>{if(e===`Providers`){let e=[{provider:E.planner,role:`planner`},{provider:E.executor,role:`executor`},{provider:E.reviewer,role:`reviewer`}];U(`runtime.agentProvider`,E.executor,`runtime`).catch(()=>{}),U(`runtime.pipeline`,e,`runtime`).catch(()=>{}),U(`runtime.workflowConfig`,G(E,O,Q),`runtime`).catch(()=>{})}else e===`Effort`?(U(`runtime.defaultEffort`,O,`runtime`).catch(()=>{}),U(`runtime.workflowConfig`,G(E,O,Q),`runtime`).catch(()=>{})):e===`Workers & Theme`&&(U(`ui.theme`,N,`ui`).catch(()=>{}),l.post(`/config/concurrency`,{concurrency:j}).catch(()=>{}))},[E,O,Q,j,N]),$=(0,I.useCallback)(()=>{d<X-1&&(je(Z),m(`forward`),f(e=>e+1))},[d,X,Z,je]),Me=(0,I.useCallback)(()=>{d>0&&(m(`backward`),f(e=>e-1))},[d]),Ne=(0,I.useCallback)(async()=>{v(!0);try{let n=[U(`ui.theme`,N,`ui`),U(`ui.onboarding.completed`,!0,`ui`)],r=[{provider:E.planner,role:`planner`},{provider:E.executor,role:`executor`},{provider:E.reviewer,role:`reviewer`}];n.push(U(`runtime.agentProvider`,E.executor,`runtime`)),n.push(U(`runtime.pipeline`,r,`runtime`)),n.push(U(`runtime.workflowConfig`,G(E,O),`runtime`)),n.push(U(`runtime.defaultEffort`,O,`runtime`)),n.push(U(`runtime.workflowConfig`,G(E,O,Q),`runtime`)),n.push(l.post(`/config/concurrency`,{concurrency:j})),q.length>0&&n.push(l.post(`/install/agents`,{agents:q})),J.length>0&&n.push(l.post(`/install/skills`,{skills:J})),await Promise.allSettled(n),t.setQueryData(o,e=>c(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),b({x:window.innerWidth/2,y:window.innerHeight/3}),setTimeout(()=>{t.invalidateQueries({queryKey:o}),e?.()},1200)}catch{t.setQueryData(o,e=>c(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),await U(`ui.onboarding.completed`,!0,`ui`).catch(()=>{}),t.invalidateQueries({queryKey:o}),e?.()}},[E,w,O,Q,j,N,q,J,t,e]),Pe=Z===`Welcome`||Z===`Providers`&&(E.executor||we)||Z===`Scan Project`||Z===`Discover Issues`||Z===`Domains`||Z===`Agents & Skills`||Z===`Effort`||Z===`Workers & Theme`||Z===`Launch`,Fe=(R?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),Ie=(R?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),Le={pipeline:E,efforts:O,concurrency:j,theme:N,domains:W,agents:q,skills:J};return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-base-100 flex flex-col overflow-hidden`,children:[(0,L.jsx)(x,{}),y&&(0,L.jsx)(C,{x:y.x,y:y.y,active:!0,onDone:()=>b(null)}),d>0&&(0,L.jsx)(`div`,{className:`relative z-10 pt-6 pb-2 px-4 flex justify-center`,children:(0,L.jsx)(oe,{current:d,wantsDiscovery:Y})}),(0,L.jsx)(`div`,{className:`relative z-10 flex-1 flex flex-col items-center justify-start px-4 py-6 overflow-y-auto`,children:(0,L.jsxs)(se,{direction:p,stepKey:d,center:Z===`Welcome`||Z===`Providers`||Z===`Launch`,children:[Z===`Welcome`&&(0,L.jsx)(le,{workspacePath:ke,onGetStarted:$}),Z===`Providers`&&(0,L.jsx)(de,{providers:Se||[],providersLoading:we,pipeline:E,setPipeline:D}),Z===`Scan Project`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(fe,{scanResult:R,setScanResult:z,projectDescription:H,setProjectDescription:ie,analysisResult:B,setAnalysisResult:V,selectedProvider:w,analyzing:ye,setAnalyzing:be}),(0,L.jsx)(`div`,{className:`mt-4 w-full max-w-lg`,children:(0,L.jsxs)(`label`,{className:`flex items-center gap-3 cursor-pointer p-3 rounded-lg bg-base-200/50 border border-base-300/50 hover:border-primary/30 transition-colors`,children:[(0,L.jsx)(`input`,{type:`checkbox`,className:`toggle toggle-primary toggle-sm`,checked:Y,onChange:e=>xe(e.target.checked)}),(0,L.jsxs)(`div`,{className:`flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(_,{className:`size-4 text-primary`}),(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:`Discover existing issues`})]}),(0,L.jsx)(`p`,{className:`text-xs text-base-content/50 mt-0.5`,children:`Scan for TODOs, FIXMEs, and GitHub issues to import`})]})]})}),(0,L.jsx)(`div`,{className:`mt-3 w-full max-w-lg`,children:(0,L.jsx)(ce,{})})]}),Z===`Discover Issues`&&(0,L.jsx)(ee,{}),Z===`Domains`&&(0,L.jsx)(pe,{selectedDomains:W,setSelectedDomains:K,analysisResult:B}),Z===`Agents & Skills`&&(0,L.jsx)(me,{selectedDomains:W,selectedAgents:q,setSelectedAgents:ue,selectedSkills:J,setSelectedSkills:ve,existingAgents:Fe,existingSkills:Ie}),Z===`Effort`&&(0,L.jsx)(he,{efforts:O,setEfforts:k,pipeline:E,models:Q,setModels:Oe,modelsByProvider:Ee}),Z===`Workers & Theme`&&(0,L.jsx)(ge,{concurrency:j,setConcurrency:M,selectedTheme:N,setSelectedTheme:F}),Z===`Launch`&&(0,L.jsx)(_e,{config:Le,launching:h})]})}),d>0&&(0,L.jsxs)(`div`,{className:`relative z-10 p-4 pb-6 flex items-center max-w-2xl mx-auto w-full justify-between`,children:[d>0&&(0,L.jsxs)(`button`,{className:`btn btn-ghost gap-1`,onClick:Me,disabled:h,children:[(0,L.jsx)(te,{className:`size-4`}),` Back`]}),d<X-1?(0,L.jsxs)(`button`,{className:`btn btn-primary gap-1`,onClick:$,disabled:!Pe,children:[Z===`Discover Issues`?`Continue`:`Next`,` `,(0,L.jsx)(A,{className:`size-4`})]}):(0,L.jsx)(`button`,{className:`btn btn-primary btn-lg gap-2 animate-pulse-soft`,onClick:Ne,disabled:h,children:h?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(g,{className:`size-5 animate-spin`}),` Launching...`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(P,{className:`size-5`}),` Launch Fifony`]})})]})]})}export{ve as default};
|