fifony 0.1.11
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 +173 -0
- package/LICENSE +201 -0
- package/NOTICE +23 -0
- package/README.md +175 -0
- package/app/dist/assets/index-BE3a-eEo.js +13 -0
- package/app/dist/icon-maskable.svg +8 -0
- package/app/dist/icon.svg +7 -0
- package/app/dist/index.html +24 -0
- package/app/dist/manifest.webmanifest +49 -0
- package/app/dist/offline.html +86 -0
- package/app/dist/service-worker.js +100 -0
- package/app/public/icon-maskable.svg +8 -0
- package/app/public/icon.svg +7 -0
- package/app/public/manifest.webmanifest +49 -0
- package/app/public/offline.html +86 -0
- package/app/public/service-worker.js +100 -0
- package/bin/fifony.js +54 -0
- package/dist/chunk-LH5V2WV2.js +389 -0
- package/dist/chunk-LH5V2WV2.js.map +1 -0
- package/dist/cli.js +204 -0
- package/dist/cli.js.map +1 -0
- package/dist/mcp/server.js +747 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/runtime/run-local.js +6569 -0
- package/dist/runtime/run-local.js.map +1 -0
- package/package.json +69 -0
- package/src/fixtures/agent-catalog.json +208 -0
- package/src/fixtures/skill-catalog.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/mcp/server.ts","../../src/integrations/catalog.ts","../../src/mcp/database.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { env, stdin, stdout } from \"node:process\";\nimport { fileURLToPath } from \"node:url\";\nimport { renderPrompt } from \"../prompting.ts\";\nimport { buildIntegrationSnippet, discoverIntegrations } from \"../integrations/catalog.ts\";\nimport { inferCapabilityPaths, resolveTaskCapabilities } from \"../routing/capability-resolver.ts\";\nimport {\n type IssueRecord,\n initDatabase,\n getDatabase,\n getResources,\n getIssues,\n getIssue,\n listIssues,\n listEvents,\n listRecords,\n getRuntimeSnapshot,\n appendEvent,\n nowIso,\n safeRead,\n WORKSPACE_ROOT,\n PERSISTENCE_ROOT,\n STATE_ROOT,\n} from \"./database.ts\";\n\ntype JsonRpcId = string | number | null;\n\ntype JsonRpcRequest = {\n jsonrpc: \"2.0\";\n id?: JsonRpcId;\n method: string;\n params?: Record<string, unknown>;\n};\n\ntype JsonRpcResponse = {\n jsonrpc: \"2.0\";\n id: JsonRpcId;\n result?: unknown;\n error?: {\n code: number;\n message: string;\n data?: unknown;\n };\n};\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst PACKAGE_ROOT = resolve(__dirname, \"../..\");\nconst WORKFLOW_PATH = join(WORKSPACE_ROOT, \"WORKFLOW.md\");\nconst README_PATH = join(PACKAGE_ROOT, \"README.md\");\nconst FIFONY_GUIDE_PATH = join(PACKAGE_ROOT, \"FIFONY.md\");\nconst DEBUG_BOOT = env.FIFONY_DEBUG_BOOT === \"1\";\n\nlet incomingBuffer = Buffer.alloc(0);\n\nfunction debugBoot(message: string): void {\n if (!DEBUG_BOOT) return;\n process.stderr.write(`[FIFONY_DEBUG_BOOT] ${message}\\n`);\n}\n\nfunction hashInput(value: string): string {\n return createHash(\"sha1\").update(value).digest(\"hex\").slice(0, 10);\n}\n\nasync function buildIntegrationGuide(): Promise<string> {\n return renderPrompt(\"mcp-integration-guide\", {\n workspaceRoot: WORKSPACE_ROOT,\n persistenceRoot: PERSISTENCE_ROOT,\n stateRoot: STATE_ROOT,\n });\n}\n\nfunction computeCapabilityCounts(issues: IssueRecord[]): Record<string, number> {\n return issues.reduce<Record<string, number>>((accumulator, issue) => {\n const key = typeof issue.capabilityCategory === \"string\" && issue.capabilityCategory.trim()\n ? issue.capabilityCategory.trim()\n : \"default\";\n accumulator[key] = (accumulator[key] ?? 0) + 1;\n return accumulator;\n }, {});\n}\n\nasync function buildStateSummary(): Promise<string> {\n const runtime = await getRuntimeSnapshot();\n const issues = await getIssues();\n const { sessionResource, pipelineResource } = getResources();\n const sessions = await listRecords(sessionResource, 500);\n const pipelines = await listRecords(pipelineResource, 500);\n const events = await listEvents({ limit: 100 });\n\n const byState = issues.reduce<Record<string, number>>((accumulator, issue) => {\n const key = issue.state ?? \"Unknown\";\n accumulator[key] = (accumulator[key] ?? 0) + 1;\n return accumulator;\n }, {});\n const byCapability = computeCapabilityCounts(issues);\n\n return JSON.stringify({\n workspaceRoot: WORKSPACE_ROOT,\n persistenceRoot: PERSISTENCE_ROOT,\n stateRoot: STATE_ROOT,\n workflowPresent: existsSync(WORKFLOW_PATH),\n runtimeUpdatedAt: runtime.updatedAt ?? null,\n issueCount: issues.length,\n issuesByState: byState,\n issuesByCapability: byCapability,\n sessionCount: sessions.length,\n pipelineCount: pipelines.length,\n recentEventCount: events.length,\n }, null, 2);\n}\n\nasync function buildIssuePrompt(issue: IssueRecord, provider: string, role: string): Promise<string> {\n const resolution = resolveTaskCapabilities({\n id: issue.id,\n identifier: issue.identifier,\n title: issue.title,\n description: typeof issue.description === \"string\" ? issue.description : \"\",\n labels: Array.isArray(issue.labels) ? issue.labels.filter((value): value is string => typeof value === \"string\") : [],\n paths: Array.isArray(issue.paths) ? issue.paths.filter((value): value is string => typeof value === \"string\") : [],\n });\n return renderPrompt(\"mcp-issue\", {\n role,\n provider,\n id: issue.id,\n title: issue.title,\n state: issue.state ?? \"Todo\",\n capabilityCategory: resolution.category,\n overlays: resolution.overlays,\n paths: Array.isArray(issue.paths) ? issue.paths.filter((value): value is string => typeof value === \"string\") : [],\n description: issue.description || \"No description provided.\",\n });\n}\n\nasync function listResourcesMcp(): Promise<Array<Record<string, unknown>>> {\n const issues = await getIssues();\n const resources: Array<Record<string, unknown>> = [\n { uri: \"fifony://guide/overview\", name: \"Fifony overview\", description: \"High-level overview and local integration guide.\", mimeType: \"text/markdown\" },\n { uri: \"fifony://guide/runtime\", name: \"Fifony runtime guide\", description: \"Detailed local runtime reference for the package.\", mimeType: \"text/markdown\" },\n { uri: \"fifony://guide/integration\", name: \"Fifony MCP integration guide\", description: \"How to wire an MCP client to this Fifony workspace.\", mimeType: \"text/markdown\" },\n { uri: \"fifony://state/summary\", name: \"Fifony state summary\", description: \"Compact summary of the current runtime, issue, and pipeline state.\", mimeType: \"application/json\" },\n { uri: \"fifony://issues\", name: \"Fifony issues\", description: \"Full issue list from the durable Fifony store.\", mimeType: \"application/json\" },\n { uri: \"fifony://integrations\", name: \"Fifony integrations\", description: \"Discovered local integrations such as agency-agents and impeccable skills.\", mimeType: \"application/json\" },\n { uri: \"fifony://capabilities\", name: \"Fifony capability routing\", description: \"How Fifony would route current issues to providers, profiles, and overlays.\", mimeType: \"application/json\" },\n ];\n\n if (existsSync(WORKFLOW_PATH)) {\n resources.push({ uri: \"fifony://workspace/workflow\", name: \"Workspace workflow\", description: \"The active WORKFLOW.md from the target workspace.\", mimeType: \"text/markdown\" });\n }\n\n for (const issue of issues.slice(0, 100)) {\n resources.push({ uri: `fifony://issue/${encodeURIComponent(issue.id)}`, name: `Issue ${issue.id}`, description: issue.title, mimeType: \"application/json\" });\n }\n\n return resources;\n}\n\nasync function readResource(uri: string): Promise<Array<Record<string, unknown>>> {\n if (uri === \"fifony://guide/overview\") return [{ uri, mimeType: \"text/markdown\", text: safeRead(README_PATH) }];\n if (uri === \"fifony://guide/runtime\") return [{ uri, mimeType: \"text/markdown\", text: safeRead(FIFONY_GUIDE_PATH) }];\n if (uri === \"fifony://guide/integration\") return [{ uri, mimeType: \"text/markdown\", text: await buildIntegrationGuide() }];\n if (uri === \"fifony://state/summary\") return [{ uri, mimeType: \"application/json\", text: await buildStateSummary() }];\n if (uri === \"fifony://issues\") return [{ uri, mimeType: \"application/json\", text: JSON.stringify(await getIssues(), null, 2) }];\n\n if (uri === \"fifony://integrations\") {\n return [{ uri, mimeType: \"application/json\", text: JSON.stringify(discoverIntegrations(WORKSPACE_ROOT), null, 2) }];\n }\n\n if (uri === \"fifony://capabilities\") {\n const issues = await getIssues();\n return [{\n uri,\n mimeType: \"application/json\",\n text: JSON.stringify(\n issues.map((issue) => ({\n issueId: issue.id,\n title: issue.title,\n paths: Array.isArray(issue.paths) ? issue.paths.filter((value): value is string => typeof value === \"string\") : [],\n inferredPaths: inferCapabilityPaths({\n id: issue.id, identifier: issue.identifier, title: issue.title, description: issue.description,\n labels: Array.isArray(issue.labels) ? issue.labels.filter((value): value is string => typeof value === \"string\") : [],\n paths: Array.isArray(issue.paths) ? issue.paths.filter((value): value is string => typeof value === \"string\") : [],\n }),\n resolution: resolveTaskCapabilities({\n id: issue.id, identifier: issue.identifier, title: issue.title, description: issue.description,\n labels: Array.isArray(issue.labels) ? issue.labels.filter((value): value is string => typeof value === \"string\") : [],\n paths: Array.isArray(issue.paths) ? issue.paths.filter((value): value is string => typeof value === \"string\") : [],\n }),\n })),\n null, 2,\n ),\n }];\n }\n\n if (uri === \"fifony://workspace/workflow\") return [{ uri, mimeType: \"text/markdown\", text: safeRead(WORKFLOW_PATH) }];\n\n if (uri.startsWith(\"fifony://issue/\")) {\n const issueId = decodeURIComponent(uri.substring(\"fifony://issue/\".length));\n const issue = await getIssue(issueId);\n if (!issue) throw new Error(`Issue not found: ${issueId}`);\n return [{ uri, mimeType: \"application/json\", text: JSON.stringify(issue, null, 2) }];\n }\n\n throw new Error(`Unknown resource: ${uri}`);\n}\n\nfunction listPrompts(): Array<Record<string, unknown>> {\n return [\n { name: \"fifony-integrate-client\", description: \"Generate setup instructions for connecting an MCP-capable client to Fifony.\", arguments: [{ name: \"client\", description: \"Client name, e.g. codex or claude.\", required: true }, { name: \"goal\", description: \"What the client should do with Fifony.\", required: false }] },\n { name: \"fifony-plan-issue\", description: \"Generate a planning prompt for a specific issue in the Fifony store.\", arguments: [{ name: \"issueId\", description: \"Issue identifier.\", required: true }, { name: \"provider\", description: \"Agent provider name.\", required: false }] },\n { name: \"fifony-review-workflow\", description: \"Review the current WORKFLOW.md and propose improvements for orchestration quality.\", arguments: [{ name: \"provider\", description: \"Reviewing model or client.\", required: false }] },\n { name: \"fifony-use-integration\", description: \"Generate a concrete integration prompt for agency-agents or impeccable.\", arguments: [{ name: \"integration\", description: \"Integration id: agency-agents or impeccable.\", required: true }] },\n { name: \"fifony-route-task\", description: \"Explain which providers, profiles, and overlays Fifony would choose for a task.\", arguments: [{ name: \"title\", description: \"Task title.\", required: true }, { name: \"description\", description: \"Task description.\", required: false }, { name: \"labels\", description: \"Comma-separated labels.\", required: false }, { name: \"paths\", description: \"Comma-separated target paths or files.\", required: false }] },\n ];\n}\n\nasync function getPrompt(name: string, args: Record<string, unknown> = {}): Promise<Record<string, unknown>> {\n if (name === \"fifony-integrate-client\") {\n const client = typeof args.client === \"string\" && args.client.trim() ? args.client.trim() : \"mcp-client\";\n const goal = typeof args.goal === \"string\" && args.goal.trim() ? args.goal.trim() : \"integrate with the local Fifony workspace\";\n const integrationGuide = await buildIntegrationGuide();\n return {\n description: \"Client integration prompt for Fifony.\",\n messages: [{\n role: \"user\",\n content: {\n type: \"text\",\n text: await renderPrompt(\"mcp-integrate-client\", { client, goal, integrationGuide }),\n },\n }],\n };\n }\n\n if (name === \"fifony-plan-issue\") {\n const issueId = typeof args.issueId === \"string\" ? args.issueId : \"\";\n const provider = typeof args.provider === \"string\" && args.provider.trim() ? args.provider.trim() : \"codex\";\n const issue = issueId ? await getIssue(issueId) : null;\n if (!issue) throw new Error(`Issue not found: ${issueId}`);\n return {\n description: \"Issue planning prompt grounded in the Fifony issue store.\",\n messages: [{\n role: \"user\",\n content: { type: \"text\", text: await buildIssuePrompt(issue, provider, \"planner\") },\n }],\n };\n }\n\n if (name === \"fifony-review-workflow\") {\n const provider = typeof args.provider === \"string\" && args.provider.trim() ? args.provider.trim() : \"claude\";\n return {\n description: \"Workflow review prompt for Fifony orchestration.\",\n messages: [{\n role: \"user\",\n content: {\n type: \"text\",\n text: await renderPrompt(\"mcp-review-workflow\", {\n provider,\n workspaceRoot: WORKSPACE_ROOT,\n workflowPresent: existsSync(WORKFLOW_PATH) ? \"yes\" : \"no\",\n }),\n },\n }],\n };\n }\n\n if (name === \"fifony-use-integration\") {\n const integration = typeof args.integration === \"string\" ? args.integration : \"\";\n return {\n description: \"Integration guidance for a discovered Fifony extension.\",\n messages: [{\n role: \"user\",\n content: { type: \"text\", text: await buildIntegrationSnippet(integration, WORKSPACE_ROOT) },\n }],\n };\n }\n\n if (name === \"fifony-route-task\") {\n const title = typeof args.title === \"string\" ? args.title : \"\";\n const description = typeof args.description === \"string\" ? args.description : \"\";\n const labels = typeof args.labels === \"string\" ? args.labels.split(\",\").map((label) => label.trim()).filter(Boolean) : [];\n const paths = typeof args.paths === \"string\" ? args.paths.split(\",\").map((value) => value.trim()).filter(Boolean) : [];\n const resolution = resolveTaskCapabilities({ title, description, labels, paths });\n return {\n description: \"Task routing prompt produced by the Fifony capability resolver.\",\n messages: [{\n role: \"user\",\n content: {\n type: \"text\",\n text: await renderPrompt(\"mcp-route-task\", {\n resolutionJson: JSON.stringify(resolution, null, 2),\n }),\n },\n }],\n };\n }\n\n throw new Error(`Unknown prompt: ${name}`);\n}\n\nfunction listTools(): Array<Record<string, unknown>> {\n return [\n { name: \"fifony.status\", description: \"Return a compact status summary for the current Fifony workspace.\", inputSchema: { type: \"object\", properties: {}, additionalProperties: false } },\n { name: \"fifony.list_issues\", description: \"List issues from the Fifony durable store.\", inputSchema: { type: \"object\", properties: { state: { type: \"string\" }, capabilityCategory: { type: \"string\" }, category: { type: \"string\" } }, additionalProperties: false } },\n { name: \"fifony.create_issue\", description: \"Create a new issue directly in the Fifony durable store.\", inputSchema: { type: \"object\", properties: { id: { type: \"string\" }, title: { type: \"string\" }, description: { type: \"string\" }, priority: { type: \"number\" }, state: { type: \"string\" }, labels: { type: \"array\", items: { type: \"string\" } }, paths: { type: \"array\", items: { type: \"string\" } } }, required: [\"title\"], additionalProperties: false } },\n { name: \"fifony.update_issue_state\", description: \"Update an issue state in the Fifony store and append an event.\", inputSchema: { type: \"object\", properties: { issueId: { type: \"string\" }, state: { type: \"string\" }, note: { type: \"string\" } }, required: [\"issueId\", \"state\"], additionalProperties: false } },\n { name: \"fifony.integration_config\", description: \"Generate a ready-to-paste MCP client configuration snippet for this Fifony workspace.\", inputSchema: { type: \"object\", properties: { client: { type: \"string\" } }, additionalProperties: false } },\n { name: \"fifony.list_integrations\", description: \"List discovered local integrations such as agency-agents profiles and impeccable skills.\", inputSchema: { type: \"object\", properties: {}, additionalProperties: false } },\n { name: \"fifony.integration_snippet\", description: \"Generate a workflow or prompt snippet for a discovered integration.\", inputSchema: { type: \"object\", properties: { integration: { type: \"string\" } }, required: [\"integration\"], additionalProperties: false } },\n { name: \"fifony.resolve_capabilities\", description: \"Resolve which providers, roles, profiles, and overlays Fifony should use for a task.\", inputSchema: { type: \"object\", properties: { title: { type: \"string\" }, description: { type: \"string\" }, labels: { type: \"array\", items: { type: \"string\" } }, paths: { type: \"array\", items: { type: \"string\" } } }, required: [\"title\"], additionalProperties: false } },\n ];\n}\n\nfunction toolText(text: string): Record<string, unknown> {\n return { content: [{ type: \"text\", text }] };\n}\n\nasync function callTool(name: string, args: Record<string, unknown> = {}): Promise<Record<string, unknown>> {\n if (name === \"fifony.status\") return toolText(await buildStateSummary());\n\n if (name === \"fifony.list_issues\") {\n const stateFilter = typeof args.state === \"string\" && args.state.trim() ? args.state.trim() : \"\";\n const capabilityCategory = typeof args.capabilityCategory === \"string\" && args.capabilityCategory.trim()\n ? args.capabilityCategory.trim()\n : typeof args.category === \"string\" && args.category.trim() ? args.category.trim() : \"\";\n return toolText(JSON.stringify(await listIssues({ state: stateFilter || undefined, capabilityCategory: capabilityCategory || undefined }), null, 2));\n }\n\n if (name === \"fifony.create_issue\") {\n await initDatabase();\n const { issueResource } = getResources();\n const title = typeof args.title === \"string\" ? args.title.trim() : \"\";\n if (!title) throw new Error(\"title is required\");\n\n const explicitId = typeof args.id === \"string\" && args.id.trim() ? args.id.trim() : \"\";\n const issueId = explicitId || `LOCAL-${hashInput(`${title}:${nowIso()}`)}`.toUpperCase();\n const description = typeof args.description === \"string\" ? args.description : \"\";\n const priority = typeof args.priority === \"number\" ? args.priority : 2;\n const state = typeof args.state === \"string\" && args.state.trim() ? args.state.trim() : \"Todo\";\n const baseLabels = Array.isArray(args.labels) ? args.labels.filter((value): value is string => typeof value === \"string\") : [\"fifony\", \"mcp\"];\n const paths = Array.isArray(args.paths) ? args.paths.filter((value): value is string => typeof value === \"string\") : [];\n const inferredPaths = inferCapabilityPaths({ id: issueId, identifier: issueId, title, description, labels: baseLabels, paths });\n const resolution = resolveTaskCapabilities({ id: issueId, identifier: issueId, title, description, labels: baseLabels, paths });\n const labels = [...new Set([...baseLabels, resolution.category ? `capability:${resolution.category}` : \"\", ...resolution.overlays.map((overlay) => `overlay:${overlay}`)].filter(Boolean))];\n\n const record = await issueResource?.insert({\n id: issueId, identifier: issueId, title, description, priority, state, labels, paths, inferredPaths,\n capabilityCategory: resolution.category, capabilityOverlays: resolution.overlays, capabilityRationale: resolution.rationale,\n blockedBy: [], assignedToWorker: false, createdAt: nowIso(), url: `fifony://local/${issueId}`,\n updatedAt: nowIso(), history: [`[${nowIso()}] Issue created via MCP.`], attempts: 0, maxAttempts: 3,\n });\n\n await appendEvent(\"info\", `Issue ${issueId} created through MCP.`, { title, state, labels, paths, inferredPaths, capabilityCategory: resolution.category }, issueId);\n return toolText(JSON.stringify(record ?? { id: issueId }, null, 2));\n }\n\n if (name === \"fifony.update_issue_state\") {\n await initDatabase();\n const { issueResource } = getResources();\n const issueId = typeof args.issueId === \"string\" ? args.issueId.trim() : \"\";\n const state = typeof args.state === \"string\" ? args.state.trim() : \"\";\n const note = typeof args.note === \"string\" ? args.note : \"\";\n if (!issueId || !state) throw new Error(\"issueId and state are required\");\n\n const current = await issueResource?.get(issueId);\n if (!current) throw new Error(`Issue not found: ${issueId}`);\n\n const updated = await issueResource?.update(issueId, { state, updatedAt: nowIso() });\n await appendEvent(\"info\", note || `Issue ${issueId} moved to ${state} through MCP.`, { state }, issueId);\n return toolText(JSON.stringify(updated ?? { id: issueId, state }, null, 2));\n }\n\n if (name === \"fifony.integration_config\") {\n const client = typeof args.client === \"string\" && args.client.trim() ? args.client.trim() : \"client\";\n return toolText(JSON.stringify({ client, mcpServers: { fifony: { command: \"npx\", args: [\"fifony\", \"mcp\", \"--workspace\", WORKSPACE_ROOT, \"--persistence\", PERSISTENCE_ROOT] } } }, null, 2));\n }\n\n if (name === \"fifony.list_integrations\") return toolText(JSON.stringify(discoverIntegrations(WORKSPACE_ROOT), null, 2));\n\n if (name === \"fifony.integration_snippet\") {\n const integration = typeof args.integration === \"string\" ? args.integration : \"\";\n return toolText(await buildIntegrationSnippet(integration, WORKSPACE_ROOT));\n }\n\n if (name === \"fifony.resolve_capabilities\") {\n const title = typeof args.title === \"string\" ? args.title : \"\";\n const description = typeof args.description === \"string\" ? args.description : \"\";\n const labels = Array.isArray(args.labels) ? args.labels.filter((value): value is string => typeof value === \"string\") : [];\n const paths = Array.isArray(args.paths) ? args.paths.filter((value): value is string => typeof value === \"string\") : [];\n return toolText(JSON.stringify({ inferredPaths: inferCapabilityPaths({ title, description, labels, paths }), resolution: resolveTaskCapabilities({ title, description, labels, paths }) }, null, 2));\n }\n\n throw new Error(`Unknown tool: ${name}`);\n}\n\n// ── JSON-RPC transport ───────────────────────────────────────────────────────\n\nfunction sendMessage(message: JsonRpcResponse): void {\n const payload = Buffer.from(JSON.stringify(message), \"utf8\");\n stdout.write(`Content-Length: ${payload.length}\\r\\n\\r\\n`);\n stdout.write(payload);\n}\n\nfunction sendResult(id: JsonRpcId, result: unknown): void {\n sendMessage({ jsonrpc: \"2.0\", id, result });\n}\n\nfunction sendError(id: JsonRpcId, code: number, message: string, data?: unknown): void {\n sendMessage({ jsonrpc: \"2.0\", id, error: { code, message, data } });\n}\n\nasync function handleRequest(request: JsonRpcRequest): Promise<void> {\n const id = request.id ?? null;\n try {\n switch (request.method) {\n case \"initialize\":\n sendResult(id, { protocolVersion: \"2024-11-05\", capabilities: { resources: {}, tools: {}, prompts: {} }, serverInfo: { name: \"fifony\", version: \"0.1.0\" } });\n return;\n case \"notifications/initialized\": return;\n case \"ping\": sendResult(id, {}); return;\n case \"resources/list\": sendResult(id, { resources: await listResourcesMcp() }); return;\n case \"resources/read\": sendResult(id, { contents: await readResource(String(request.params?.uri ?? \"\")) }); return;\n case \"tools/list\": sendResult(id, { tools: listTools() }); return;\n case \"tools/call\": sendResult(id, await callTool(String(request.params?.name ?? \"\"), (request.params?.arguments as Record<string, unknown> | undefined) ?? {})); return;\n case \"prompts/list\": sendResult(id, { prompts: listPrompts() }); return;\n case \"prompts/get\": sendResult(id, await getPrompt(String(request.params?.name ?? \"\"), (request.params?.arguments as Record<string, unknown> | undefined) ?? {})); return;\n default: sendError(id, -32601, `Method not found: ${request.method}`);\n }\n } catch (error) {\n sendError(id, -32000, String(error));\n }\n}\n\nfunction processIncomingBuffer(): void {\n while (true) {\n const separatorIndex = incomingBuffer.indexOf(\"\\r\\n\\r\\n\");\n if (separatorIndex === -1) return;\n\n const headerText = incomingBuffer.subarray(0, separatorIndex).toString(\"utf8\");\n const contentLengthHeader = headerText.split(\"\\r\\n\").find((line) => line.toLowerCase().startsWith(\"content-length:\"));\n if (!contentLengthHeader) { incomingBuffer = Buffer.alloc(0); return; }\n\n const contentLength = Number.parseInt(contentLengthHeader.split(\":\")[1]?.trim() ?? \"0\", 10);\n const messageStart = separatorIndex + 4;\n const messageEnd = messageStart + contentLength;\n if (incomingBuffer.length < messageEnd) return;\n\n const messageBody = incomingBuffer.subarray(messageStart, messageEnd).toString(\"utf8\");\n incomingBuffer = incomingBuffer.subarray(messageEnd);\n\n let request: JsonRpcRequest;\n try {\n request = JSON.parse(messageBody) as JsonRpcRequest;\n } catch (error) {\n sendError(null, -32700, `Invalid JSON: ${String(error)}`);\n continue;\n }\n\n void handleRequest(request);\n }\n}\n\n// ── Bootstrap ────────────────────────────────────────────────────────────────\n\nasync function bootstrap(): Promise<void> {\n debugBoot(\"mcp:bootstrap:start\");\n await initDatabase();\n debugBoot(\"mcp:bootstrap:database-ready\");\n await appendEvent(\"info\", \"Fifony MCP server started.\", { workspaceRoot: WORKSPACE_ROOT, persistenceRoot: PERSISTENCE_ROOT });\n\n stdin.on(\"data\", (chunk: Buffer) => {\n incomingBuffer = Buffer.concat([incomingBuffer, chunk]);\n processIncomingBuffer();\n });\n\n stdin.resume();\n debugBoot(\"mcp:bootstrap:stdin-ready\");\n}\n\nbootstrap().catch((error) => {\n sendError(null, -32001, `Failed to start Fifony MCP server: ${String(error)}`);\n process.exit(1);\n});\n\nprocess.on(\"SIGINT\", async () => {\n const db = getDatabase();\n if (db) await db.disconnect();\n process.exit(0);\n});\n\nprocess.on(\"SIGTERM\", async () => {\n const db = getDatabase();\n if (db) await db.disconnect();\n process.exit(0);\n});\n","import { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport { renderPrompt } from \"../prompting.ts\";\n\nexport type FifonyIntegration = {\n id: \"agency-agents\" | \"impeccable\";\n kind: \"agents\" | \"skills\";\n installed: boolean;\n locations: string[];\n items: string[];\n summary: string;\n};\n\nfunction listNames(basePath: string): string[] {\n if (!existsSync(basePath)) {\n return [];\n }\n\n return readdirSync(basePath, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() || entry.isFile())\n .map((entry) => entry.name)\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction readSkillSummary(skillPath: string): string {\n try {\n const skillFile = join(skillPath, \"SKILL.md\");\n if (!existsSync(skillFile)) {\n return \"\";\n }\n const contents = readFileSync(skillFile, \"utf8\");\n const firstParagraph = contents\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter(Boolean)\n .find((line) => !line.startsWith(\"#\"));\n return firstParagraph ?? \"\";\n } catch {\n return \"\";\n }\n}\n\nexport function discoverIntegrations(workspaceRoot: string): FifonyIntegration[] {\n const home = homedir();\n const agentLocations = [\n resolve(workspaceRoot, \".codex\", \"agents\"),\n resolve(workspaceRoot, \"agents\"),\n join(home, \".codex\", \"agents\"),\n join(home, \".claude\", \"agents\"),\n ];\n const skillLocations = [\n resolve(workspaceRoot, \".codex\", \"skills\"),\n resolve(workspaceRoot, \".claude\", \"skills\"),\n join(home, \".codex\", \"skills\"),\n join(home, \".claude\", \"skills\"),\n ];\n\n const agencyItems = agentLocations\n .flatMap((location) => listNames(location).map((name) => ({ location, name })))\n .filter(({ name }) => name.startsWith(\"agency-\"))\n .map(({ location, name }) => `${name} @ ${location}`);\n\n const impeccableItems = skillLocations\n .flatMap((location) => listNames(location).map((name) => ({ location, name })))\n .filter(({ name }) =>\n name === \"teach-impeccable\"\n || name === \"frontend-design\"\n || name === \"polish\"\n || name === \"audit\"\n || name === \"critique\"\n || name.includes(\"impeccable\")\n )\n .map(({ location, name }) => {\n const summary = readSkillSummary(join(location, name));\n return summary ? `${name} @ ${location} — ${summary}` : `${name} @ ${location}`;\n });\n\n return [\n {\n id: \"agency-agents\",\n kind: \"agents\",\n installed: agencyItems.length > 0,\n locations: agentLocations.filter((location) => existsSync(location)),\n items: agencyItems,\n summary: agencyItems.length > 0\n ? \"Local specialized agent profiles are available for planner/executor/reviewer roles.\"\n : \"No agency agent profiles were detected in the standard local locations.\",\n },\n {\n id: \"impeccable\",\n kind: \"skills\",\n installed: impeccableItems.length > 0,\n locations: skillLocations.filter((location) => existsSync(location)),\n items: impeccableItems,\n summary: impeccableItems.length > 0\n ? \"Frontend and design-oriented skills are available for review and polish workflows.\"\n : \"No impeccable-related skills were detected in the standard local skill directories.\",\n },\n ];\n}\n\nexport async function buildIntegrationSnippet(integrationId: string, workspaceRoot: string): Promise<string> {\n if (integrationId === \"agency-agents\") {\n return renderPrompt(\"integrations-agency-agents\", { workspaceRoot });\n }\n\n if (integrationId === \"impeccable\") {\n return renderPrompt(\"integrations-impeccable\");\n }\n\n return \"Unknown integration.\";\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { basename, join, resolve } from \"node:path\";\nimport { env } from \"node:process\";\nimport { homedir } from \"node:os\";\nimport { fileURLToPath } from \"node:url\";\n\n// ── Types ────────────────────────────────────────────────────────────────────\n\nexport type IssueRecord = {\n id: string;\n identifier?: string;\n title: string;\n description?: string;\n priority?: number;\n state?: string;\n labels?: string[];\n paths?: string[];\n url?: string;\n assigned_to_worker?: boolean;\n [key: string]: unknown;\n};\n\nexport type RuntimeSnapshot = {\n updatedAt?: string;\n config?: Record<string, unknown>;\n issues?: IssueRecord[];\n metrics?: Record<string, unknown>;\n notes?: string[];\n [key: string]: unknown;\n};\n\nexport type S3dbResource = {\n insert: (record: Record<string, unknown>) => Promise<Record<string, unknown>>;\n get: (id: string) => Promise<Record<string, unknown> | null>;\n update: (id: string, patch: Record<string, unknown>) => Promise<Record<string, unknown>>;\n list: (options?: {\n partition?: string | null;\n partitionValues?: Record<string, string | number>;\n limit?: number;\n offset?: number;\n }) => Promise<Record<string, unknown>[]>;\n query?: (options?: Record<string, unknown>) => Promise<Record<string, unknown>[]>;\n};\n\nexport type S3dbDatabase = {\n connect: () => Promise<void>;\n disconnect: () => Promise<void>;\n createResource: (config: Record<string, unknown>) => Promise<S3dbResource>;\n resources: Record<string, S3dbResource>;\n};\n\ntype S3dbModule = {\n default: new (config: Record<string, unknown>) => S3dbDatabase;\n FileSystemClient: new (config: Record<string, unknown>) => unknown;\n};\n\n// ── Constants ────────────────────────────────────────────────────────────────\n\nconst WORKSPACE_ROOT = env.FIFONY_WORKSPACE_ROOT ?? process.cwd();\nconst PERSISTENCE_ROOT = env.FIFONY_PERSISTENCE ?? WORKSPACE_ROOT;\nconst STATE_ROOT = resolvePersistenceRoot(PERSISTENCE_ROOT);\nconst DATABASE_PATH = join(STATE_ROOT, \"s3db\");\nconst STORAGE_BUCKET = env.FIFONY_STORAGE_BUCKET ?? \"fifony\";\nconst STORAGE_KEY_PREFIX = env.FIFONY_STORAGE_KEY_PREFIX ?? \"state\";\nconst DEBUG_BOOT = env.FIFONY_DEBUG_BOOT === \"1\";\n\nfunction resolvePersistenceRoot(value: string): string {\n const resolved = value.startsWith(\"file://\")\n ? fileURLToPath(value)\n : value.startsWith(\"~/\")\n ? resolve(homedir(), value.slice(2))\n : resolve(value);\n\n return basename(resolved) === \".fifony\" ? resolved : join(resolved, \".fifony\");\n}\n\nexport const RUNTIME_RESOURCE = \"runtime_state\";\nexport const ISSUE_RESOURCE = \"issues\";\nexport const EVENT_RESOURCE = \"events\";\nexport const SESSION_RESOURCE = \"agent_sessions\";\nexport const PIPELINE_RESOURCE = \"agent_pipelines\";\nexport const RUNTIME_RECORD_ID = \"current\";\nexport { WORKSPACE_ROOT, PERSISTENCE_ROOT, STATE_ROOT };\n\n// ── State ────────────────────────────────────────────────────────────────────\n\nlet database: S3dbDatabase | null = null;\nlet runtimeResource: S3dbResource | null = null;\nlet issueResource: S3dbResource | null = null;\nlet eventResource: S3dbResource | null = null;\nlet sessionResource: S3dbResource | null = null;\nlet pipelineResource: S3dbResource | null = null;\n\nexport function getResources() {\n return { runtimeResource, issueResource, eventResource, sessionResource, pipelineResource };\n}\n\nexport function getDatabase(): S3dbDatabase | null {\n return database;\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction debugBoot(message: string): void {\n if (!DEBUG_BOOT) return;\n process.stderr.write(`[FIFONY_DEBUG_BOOT] ${message}\\n`);\n}\n\nexport function nowIso(): string {\n return new Date().toISOString();\n}\n\nexport function safeRead(path: string): string {\n return existsSync(path) ? readFileSync(path, \"utf8\") : \"\";\n}\n\n// ── Module loading ───────────────────────────────────────────────────────────\n\nasync function loadS3dbModule(): Promise<S3dbModule> {\n try {\n const imported = await import(\"s3db.js/lite\");\n return {\n default: imported.default,\n FileSystemClient: imported.FileSystemClient,\n };\n } catch (error) {\n throw new Error(`Unable to load s3db.js: ${String(error)}`);\n }\n}\n\n// ── Database initialization ──────────────────────────────────────────────────\n\nexport async function initDatabase(): Promise<S3dbDatabase> {\n if (database) return database;\n\n debugBoot(\"mcp:getDatabase:start\");\n const s3db = await loadS3dbModule();\n debugBoot(\"mcp:getDatabase:module-loaded\");\n const client = new s3db.FileSystemClient({\n basePath: DATABASE_PATH,\n bucket: STORAGE_BUCKET,\n keyPrefix: STORAGE_KEY_PREFIX,\n verbose: false,\n });\n\n database = new s3db.default({ client, verbose: false });\n await database.connect();\n debugBoot(\"mcp:getDatabase:connected\");\n\n runtimeResource = database.resources[RUNTIME_RESOURCE] ?? await database.createResource({\n name: RUNTIME_RESOURCE,\n behavior: \"body-overflow\",\n attributes: {\n updatedAt: \"datetime|required\",\n state: \"json|required\",\n },\n });\n\n issueResource = database.resources[ISSUE_RESOURCE] ?? await database.createResource({\n name: ISSUE_RESOURCE,\n behavior: \"body-overflow\",\n attributes: {\n id: \"string|required\",\n identifier: \"string|required\",\n title: \"string|required\",\n description: \"string|optional\",\n priority: \"number|required\",\n state: \"string|required\",\n branchName: \"string|optional\",\n labels: \"json|required\",\n paths: \"json|optional\",\n inferredPaths: \"json|optional\",\n capabilityCategory: \"string|optional\",\n capabilityOverlays: \"json|optional\",\n capabilityRationale: \"json|optional\",\n blockedBy: \"json|required\",\n assignedToWorker: \"boolean|required\",\n createdAt: \"datetime|required\",\n updatedAt: \"datetime|required\",\n history: \"json|required\",\n attempts: \"number|required\",\n maxAttempts: \"number|required\",\n url: \"string|optional\",\n assigneeId: \"string|optional\",\n startedAt: \"datetime|optional\",\n completedAt: \"datetime|optional\",\n nextRetryAt: \"datetime|optional\",\n workspacePath: \"string|optional\",\n workspacePreparedAt: \"datetime|optional\",\n lastError: \"string|optional\",\n durationMs: \"number|optional\",\n commandExitCode: \"number|optional\",\n commandOutputTail: \"string|optional\",\n },\n partitions: {\n byState: { fields: { state: \"string\" } },\n byCapabilityCategory: { fields: { capabilityCategory: \"string\" } },\n byStateAndCapability: {\n fields: { state: \"string\", capabilityCategory: \"string\" },\n },\n },\n asyncPartitions: true,\n });\n\n eventResource = database.resources[EVENT_RESOURCE] ?? await database.createResource({\n name: EVENT_RESOURCE,\n behavior: \"body-overflow\",\n attributes: {\n id: \"string|required\",\n issueId: \"string|optional\",\n kind: \"string|required\",\n message: \"string|required\",\n at: \"datetime|required\",\n },\n partitions: {\n byIssueId: { fields: { issueId: \"string\" } },\n byKind: { fields: { kind: \"string\" } },\n byIssueIdAndKind: { fields: { issueId: \"string\", kind: \"string\" } },\n },\n asyncPartitions: true,\n });\n\n sessionResource = database.resources[SESSION_RESOURCE] ?? await database.createResource({\n name: SESSION_RESOURCE,\n behavior: \"body-overflow\",\n attributes: {\n id: \"string|required\",\n issueId: \"string|required\",\n issueIdentifier: \"string|required\",\n attempt: \"number|required\",\n provider: \"string|required\",\n role: \"string|required\",\n cycle: \"number|required\",\n session: \"json|required\",\n updatedAt: \"datetime|required\",\n },\n partitions: {\n byIssueId: { fields: { issueId: \"string\" } },\n byIssueAttempt: { fields: { issueId: \"string\", attempt: \"number\" } },\n byProviderRole: { fields: { provider: \"string\", role: \"string\" } },\n },\n asyncPartitions: true,\n });\n\n pipelineResource = database.resources[PIPELINE_RESOURCE] ?? await database.createResource({\n name: PIPELINE_RESOURCE,\n behavior: \"body-overflow\",\n attributes: {\n id: \"string|required\",\n issueId: \"string|required\",\n issueIdentifier: \"string|required\",\n attempt: \"number|required\",\n pipeline: \"json|required\",\n updatedAt: \"datetime|required\",\n },\n partitions: {\n byIssueId: { fields: { issueId: \"string\" } },\n byIssueAttempt: { fields: { issueId: \"string\", attempt: \"number\" } },\n },\n asyncPartitions: true,\n });\n\n debugBoot(\"mcp:getDatabase:resources-ready\");\n return database;\n}\n\n// ── Query helpers ────────────────────────────────────────────────────────────\n\nexport async function listRecords(resource: S3dbResource | null, limit: number = 100): Promise<Record<string, unknown>[]> {\n if (!resource) return [];\n if (typeof resource.query === \"function\") return await resource.query({});\n return await resource.list({ limit });\n}\n\nexport async function listIssues(filters: { state?: string; capabilityCategory?: string } = {}): Promise<IssueRecord[]> {\n await initDatabase();\n const { state, capabilityCategory } = filters;\n\n if (!issueResource) return [];\n\n const partition = state && capabilityCategory\n ? \"byStateAndCapability\"\n : state ? \"byState\"\n : capabilityCategory ? \"byCapabilityCategory\"\n : null;\n const partitionValues = state && capabilityCategory\n ? { state, capabilityCategory }\n : state ? { state }\n : capabilityCategory ? { capabilityCategory }\n : {};\n\n const records = await issueResource.list({ partition, partitionValues, limit: 500 });\n return records.map((record) => record as IssueRecord);\n}\n\nexport async function listEvents(filters: { issueId?: string; kind?: string; limit?: number } = {}): Promise<Record<string, unknown>[]> {\n await initDatabase();\n const { issueId, kind, limit = 100 } = filters;\n\n if (!eventResource) return [];\n\n const partition = issueId && kind\n ? \"byIssueIdAndKind\"\n : issueId ? \"byIssueId\"\n : kind ? \"byKind\"\n : null;\n const partitionValues = issueId && kind\n ? { issueId, kind }\n : issueId ? { issueId }\n : kind ? { kind }\n : {};\n\n return await eventResource.list({ partition, partitionValues, limit });\n}\n\nexport async function getRuntimeSnapshot(): Promise<RuntimeSnapshot> {\n await initDatabase();\n const record = await runtimeResource?.get(RUNTIME_RECORD_ID);\n const state = record?.state;\n if (state && typeof state === \"object\") return state as RuntimeSnapshot;\n return {};\n}\n\nexport async function getIssues(): Promise<IssueRecord[]> {\n return await listIssues();\n}\n\nexport async function getIssue(issueId: string): Promise<IssueRecord | null> {\n await initDatabase();\n const issue = await issueResource?.get(issueId);\n return (issue as IssueRecord | null) ?? null;\n}\n\nexport async function appendEvent(level: string, message: string, payload: Record<string, unknown> = {}, issueId?: string): Promise<void> {\n await initDatabase();\n const { randomUUID } = await import(\"node:crypto\");\n await eventResource?.insert({\n id: randomUUID(),\n issueId,\n kind: level,\n message,\n at: nowIso(),\n });\n}\n"],"mappings":";;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,cAAAA,mBAAkB;AAC3B,SAAS,SAAS,QAAAC,OAAM,WAAAC,gBAAe;AACvC,SAAS,OAAAC,MAAK,OAAO,cAAc;AACnC,SAAS,iBAAAC,sBAAqB;;;ACJ9B,SAAS,YAAY,aAAa,oBAAoB;AACtD,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAY9B,SAAS,UAAU,UAA4B;AAC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,QAAI;AACF,gBAAU,KAAK,MAAM,WAAW;AAAA,IAClC,SAAS,OAAO;AACd,gBAAU,MAAM,QAAQ,iBAAiB,OAAO,KAAK,CAAC,EAAE;AACxD;AAAA,IACF;AAEA,SAAK,cAAc,OAAO;AAAA,EAC5B;AACF;AAIA,eAAe,YAA2B;AACxC,EAAAJ,WAAU,qBAAqB;AAC/B,QAAM,aAAa;AACnB,EAAAA,WAAU,8BAA8B;AACxC,QAAM,YAAY,QAAQ,8BAA8B,EAAE,eAAe,gBAAgB,iBAAiB,iBAAiB,CAAC;AAE5H,QAAM,GAAG,QAAQ,CAAC,UAAkB;AAClC,qBAAiB,OAAO,OAAO,CAAC,gBAAgB,KAAK,CAAC;AACtD,0BAAsB;AAAA,EACxB,CAAC;AAED,QAAM,OAAO;AACb,EAAAA,WAAU,2BAA2B;AACvC;AAEA,UAAU,EAAE,MAAM,CAAC,UAAU;AAC3B,YAAU,MAAM,QAAQ,sCAAsC,OAAO,KAAK,CAAC,EAAE;AAC7E,UAAQ,KAAK,CAAC;AAChB,CAAC;AAED,QAAQ,GAAG,UAAU,YAAY;AAC/B,QAAM,KAAK,YAAY;AACvB,MAAI,GAAI,OAAM,GAAG,WAAW;AAC5B,UAAQ,KAAK,CAAC;AAChB,CAAC;AAED,QAAQ,GAAG,WAAW,YAAY;AAChC,QAAM,KAAK,YAAY;AACvB,MAAI,GAAI,OAAM,GAAG,WAAW;AAC5B,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["existsSync","join","resolve","env","fileURLToPath","existsSync","readFileSync","join","resolve","homedir","existsSync","readFileSync","fileURLToPath","resolve","join","DEBUG_BOOT","env","debugBoot","sessionResource","pipelineResource","existsSync","issueResource"]}
|