neural-loom 0.2.10 → 0.2.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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +2 -2
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0e5cwnx._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0e5cwnx._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0efi5cr._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0efi5cr._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0l7c-gn._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0l7c-gn._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ntt3om._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ntt3om._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0tl2n51._.js +6 -6
- package/.next/server/chunks/[root-of-the-server]__0tl2n51._.js.map +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ev3h.z.js +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ev3h.z.js.map +1 -1
- package/.next/server/chunks/ssr/_0t7oqy6._.js +1 -1
- package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0gxf179bv7lwx.js +1 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/src/app/api/context/aider/route.ts +1 -1
- package/src/app/api/context/claude/route.ts +1 -1
- package/src/app/api/context/ssh/route.ts +1 -1
- package/src/app/api/files/route.ts +2 -2
- package/src/app/api/git/route.ts +1 -1
- package/src/app/api/sessions/route.ts +2 -1
- package/src/app/page.tsx +6 -2
- package/.next/static/chunks/0r1._76-1rt.-.js +0 -1
- /package/.next/static/{IUac8eI99EN-VEZyfxyCO → wQK-mTlFb-GEu4hEGNxK7}/_buildManifest.js +0 -0
- /package/.next/static/{IUac8eI99EN-VEZyfxyCO → wQK-mTlFb-GEu4hEGNxK7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{IUac8eI99EN-VEZyfxyCO → wQK-mTlFb-GEu4hEGNxK7}/_ssgManifest.js +0 -0
package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0ev3h.z.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/app/api/files/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { NextResponse } from \"next/server\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport os from \"os\";\n\n// Helper to recursively generate a tree nodes list for UI representation\ninterface TreeNode {\n name: string;\n path: string;\n type: \"file\" | \"directory\";\n children?: TreeNode[];\n}\n\nfunction getDirectoryTree(dirPath: string, depth = 0, maxDepth = 3): TreeNode[] {\n const normDirPath = dirPath.replace(/\\\\/g, \"/\");\n if (depth > maxDepth) return [];\n try {\n const items = fs.readdirSync(normDirPath, { withFileTypes: true });\n const nodes: TreeNode[] = [];\n\n for (const item of items) {\n // Skip hidden folders and build folders to keep explorer performant\n if (\n item.name.startsWith(\".\") ||\n item.name === \"node_modules\" ||\n item.name === \"out\" ||\n item.name === \".next\" ||\n item.name === \"dist\"\n ) {\n continue;\n }\n\n const itemPath = path.join(normDirPath, item.name).replace(/\\\\/g, \"/\");\n if (item.isDirectory()) {\n nodes.push({\n name: item.name,\n path: itemPath,\n type: \"directory\",\n children: getDirectoryTree(itemPath, depth + 1, maxDepth),\n });\n } else {\n nodes.push({\n name: item.name,\n path: itemPath,\n type: \"file\",\n });\n }\n }\n\n // Sort: directories first, then files alphabetically\n return nodes.sort((a, b) => {\n if (a.type !== b.type) {\n return a.type === \"directory\" ? -1 : 1;\n }\n return a.name.localeCompare(b.name);\n });\n } catch (err) {\n console.error(`Failed to read directory tree for ${normDirPath}:`, err);\n return [];\n }\n}\n\ninterface FlatFileItem {\n name: string;\n path: string;\n relativePath: string;\n}\n\nfunction getFlatFileList(dirPath: string, rootDir: string, list: FlatFileItem[] = [], maxFiles = 1500): FlatFileItem[] {\n const normDirPath = dirPath.replace(/\\\\/g, \"/\");\n const normRootDir = rootDir.replace(/\\\\/g, \"/\");\n if (list.length >= maxFiles) return list;\n try {\n const items = fs.readdirSync(normDirPath, { withFileTypes: true });\n for (const item of items) {\n if (list.length >= maxFiles) break;\n\n // Skip hidden folders and build folders\n if (\n item.name.startsWith(\".\") ||\n item.name === \"node_modules\" ||\n item.name === \"out\" ||\n item.name === \".next\" ||\n item.name === \"dist\"\n ) {\n continue;\n }\n\n const itemPath = path.join(normDirPath, item.name).replace(/\\\\/g, \"/\");\n if (item.isDirectory()) {\n getFlatFileList(itemPath, normRootDir, list, maxFiles);\n } else {\n const relativePath = path.relative(normRootDir, itemPath).replace(/\\\\/g, \"/\");\n list.push({\n name: item.name,\n path: itemPath,\n relativePath: relativePath,\n });\n }\n }\n } catch (err) {\n console.error(`Failed to read flat file list for ${normDirPath}:`, err);\n }\n return list;\n}\n\nexport async function GET(request: Request) {\n try {\n const { searchParams } = new URL(request.url);\n const action = searchParams.get(\"action\");\n\n if (action === \"list\") {\n const rootPath = searchParams.get(\"root\");\n const scopedStr = searchParams.get(\"scoped\");\n \n const targetRoot = ((rootPath && fs.existsSync(rootPath)) ? rootPath : process.cwd()).replace(/\\\\/g, \"/\");\n const workspaceTree = getDirectoryTree(targetRoot);\n const scopedTrees: { name: string; path: string; tree: TreeNode[] }[] = [];\n\n if (scopedStr) {\n const scopedPaths = scopedStr.split(\",\");\n for (const p of scopedPaths) {\n const trimmed = p.trim().replace(/\\\\/g, \"/\");\n if (trimmed && fs.existsSync(trimmed)) {\n scopedTrees.push({\n name: path.basename(trimmed),\n path: trimmed,\n tree: getDirectoryTree(trimmed),\n });\n }\n }\n }\n\n return NextResponse.json({\n success: true,\n workspace: {\n name: path.basename(targetRoot) || \"Workspace\",\n path: targetRoot,\n tree: workspaceTree,\n },\n scoped: scopedTrees,\n });\n }\n\n if (action === \"flat_list\") {\n const rootPath = searchParams.get(\"root\");\n const scopedStr = searchParams.get(\"scoped\");\n \n const targetRoot = ((rootPath && fs.existsSync(rootPath)) ? rootPath : process.cwd()).replace(/\\\\/g, \"/\");\n const files: FlatFileItem[] = [];\n \n getFlatFileList(targetRoot, targetRoot, files);\n\n if (scopedStr) {\n const scopedPaths = scopedStr.split(\",\");\n for (const p of scopedPaths) {\n const trimmed = p.trim().replace(/\\\\/g, \"/\");\n if (trimmed && fs.existsSync(trimmed)) {\n getFlatFileList(trimmed, path.dirname(trimmed).replace(/\\\\/g, \"/\"), files);\n }\n }\n }\n\n return NextResponse.json({\n success: true,\n files: files,\n });\n }\n\n if (action === \"browse_dirs\") {\n const targetPathRaw = searchParams.get(\"path\");\n const defaultDir = (process.env.ORIGINAL_CWD || process.cwd() || os.homedir()).replace(/\\\\/g, \"/\");\n let targetPath = (targetPathRaw && targetPathRaw.trim()) ? path.resolve(targetPathRaw) : defaultDir;\n targetPath = targetPath.replace(/\\\\/g, \"/\");\n\n if (!fs.existsSync(targetPath)) {\n return NextResponse.json({ error: \"Directory does not exist\" }, { status: 404 });\n }\n\n const stat = fs.statSync(targetPath);\n if (!stat.isDirectory()) {\n return NextResponse.json({ error: \"Path is not a directory\" }, { status: 400 });\n }\n\n const items = fs.readdirSync(targetPath, { withFileTypes: true });\n const directories: { name: string; path: string }[] = [];\n\n for (const item of items) {\n if (item.isDirectory()) {\n // Skip hidden directories\n if (item.name.startsWith(\".\")) continue;\n directories.push({\n name: item.name,\n path: path.join(targetPath, item.name).replace(/\\\\/g, \"/\"),\n });\n }\n }\n\n // Sort alphabetically\n directories.sort((a, b) => a.name.localeCompare(b.name));\n\n const parentPath = path.dirname(targetPath).replace(/\\\\/g, \"/\");\n const isRoot = parentPath === targetPath;\n\n return NextResponse.json({\n success: true,\n currentPath: targetPath,\n parentPath: isRoot ? null : parentPath,\n directories,\n });\n }\n\n if (action === \"read\") {\n const filePathRaw = searchParams.get(\"path\");\n if (!filePathRaw) {\n return NextResponse.json({ error: \"Missing required parameter 'path'\" }, { status: 400 });\n }\n\n const filePath = filePathRaw.replace(/\\\\/g, \"/\");\n if (!fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"File does not exist\" }, { status: 404 });\n }\n\n const content = fs.readFileSync(filePath, \"utf8\");\n return NextResponse.json({ success: true, content });\n }\n\n return NextResponse.json({ error: \"Invalid action. Must be 'list', 'flat_list' or 'read'\" }, { status: 400 });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n return NextResponse.json({ error: errorMessage }, { status: 500 });\n }\n}\n\nexport async function POST(request: Request) {\n try {\n const body = await request.json();\n const { action, path: rawPath, content, type, oldPath: rawOldPath, newPath: rawNewPath } = body;\n const filePath = rawPath ? rawPath.replace(/\\\\/g, \"/\") : undefined;\n const oldPath = rawOldPath ? rawOldPath.replace(/\\\\/g, \"/\") : undefined;\n const newPath = rawNewPath ? rawNewPath.replace(/\\\\/g, \"/\") : undefined;\n\n if (action === \"write\") {\n if (!filePath || content === undefined) {\n return NextResponse.json({ error: \"Missing 'path' or 'content' in body\" }, { status: 400 });\n }\n\n // Ensure target directory exists\n const parentDir = path.dirname(filePath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n\n fs.writeFileSync(filePath, content, \"utf8\");\n return NextResponse.json({ success: true, message: \"File saved successfully\" });\n }\n\n if (action === \"create\") {\n if (!filePath || !type) {\n return NextResponse.json({ error: \"Missing 'path' or 'type' in request body\" }, { status: 400 });\n }\n\n if (fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"Path already exists\" }, { status: 400 });\n }\n\n if (type === \"directory\") {\n fs.mkdirSync(filePath, { recursive: true });\n return NextResponse.json({ success: true, message: \"Directory created successfully\" });\n } else {\n const parentDir = path.dirname(filePath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n fs.writeFileSync(filePath, \"\", \"utf8\");\n return NextResponse.json({ success: true, message: \"File created successfully\" });\n }\n }\n\n if (action === \"rename\") {\n if (!oldPath || !newPath) {\n return NextResponse.json({ error: \"Missing 'oldPath' or 'newPath' in request body\" }, { status: 400 });\n }\n\n if (!fs.existsSync(oldPath)) {\n return NextResponse.json({ error: \"Source path does not exist\" }, { status: 404 });\n }\n\n if (fs.existsSync(newPath)) {\n return NextResponse.json({ error: \"Target path already exists\" }, { status: 400 });\n }\n\n const parentDir = path.dirname(newPath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n\n fs.renameSync(oldPath, newPath);\n return NextResponse.json({ success: true, message: \"Renamed successfully\" });\n }\n\n if (action === \"delete\") {\n if (!filePath) {\n return NextResponse.json({ error: \"Missing 'path' in request body\" }, { status: 400 });\n }\n\n if (!fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"Path does not exist\" }, { status: 404 });\n }\n\n fs.rmSync(filePath, { recursive: true, force: true });\n return NextResponse.json({ success: true, message: \"Deleted successfully\" });\n }\n\n return NextResponse.json({ error: \"Invalid action.\" }, { status: 400 });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n return NextResponse.json({ error: errorMessage }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/files/route\",\n pathname: \"/api/files\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/files/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/files/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["getDirectoryTree","dirPath","depth","maxDepth","normDirPath","replace","items","readdirSync","withFileTypes","nodes","item","name","startsWith","itemPath","join","isDirectory","push","path","type","children","sort","a","b","localeCompare","request","err","console","error","targetRoot","split","getFlatFileList","rootDir","list","maxFiles","normRootDir","length","trimmed","scopedTrees","get","relativePath","relative","targetPathRaw","searchParams","env","ORIGINAL_CWD","GET","URL","url","targetPath","action","rootPath","scopedStr","directories","existsSync","process","cwd","workspaceTree","scopedPaths","p","parentPath","trim","basename","tree","json","success","workspace","readFileSync","content","errorMessage","scoped","POST","rawPath","files","rawNewPath","dirname","defaultDir","homedir","resolve","status","stat","statSync","oldPath","isRoot","currentPath","filePathRaw","filePath","Error","message","body","rawOldPath","newPath","undefined","parentDir","mkdirSync","recursive","writeFileSync","renameSync","rmSync","force"],"mappings":"qCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,KDhBA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAA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AAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA5TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
1
|
+
{"version":3,"sources":["../../../src/app/api/files/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { NextResponse } from \"next/server\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport os from \"os\";\n\n// Helper to recursively generate a tree nodes list for UI representation\ninterface TreeNode {\n name: string;\n path: string;\n type: \"file\" | \"directory\";\n children?: TreeNode[];\n}\n\nfunction getDirectoryTree(dirPath: string, depth = 0, maxDepth = 3): TreeNode[] {\n const normDirPath = dirPath.replace(/\\\\/g, \"/\");\n if (depth > maxDepth) return [];\n try {\n const items = fs.readdirSync(normDirPath, { withFileTypes: true });\n const nodes: TreeNode[] = [];\n\n for (const item of items) {\n // Skip hidden folders and build folders to keep explorer performant\n if (\n item.name.startsWith(\".\") ||\n item.name === \"node_modules\" ||\n item.name === \"out\" ||\n item.name === \".next\" ||\n item.name === \"dist\"\n ) {\n continue;\n }\n\n const itemPath = path.join(normDirPath, item.name).replace(/\\\\/g, \"/\");\n if (item.isDirectory()) {\n nodes.push({\n name: item.name,\n path: itemPath,\n type: \"directory\",\n children: getDirectoryTree(itemPath, depth + 1, maxDepth),\n });\n } else {\n nodes.push({\n name: item.name,\n path: itemPath,\n type: \"file\",\n });\n }\n }\n\n // Sort: directories first, then files alphabetically\n return nodes.sort((a, b) => {\n if (a.type !== b.type) {\n return a.type === \"directory\" ? -1 : 1;\n }\n return a.name.localeCompare(b.name);\n });\n } catch (err) {\n console.error(`Failed to read directory tree for ${normDirPath}:`, err);\n return [];\n }\n}\n\ninterface FlatFileItem {\n name: string;\n path: string;\n relativePath: string;\n}\n\nfunction getFlatFileList(dirPath: string, rootDir: string, list: FlatFileItem[] = [], maxFiles = 1500): FlatFileItem[] {\n const normDirPath = dirPath.replace(/\\\\/g, \"/\");\n const normRootDir = rootDir.replace(/\\\\/g, \"/\");\n if (list.length >= maxFiles) return list;\n try {\n const items = fs.readdirSync(normDirPath, { withFileTypes: true });\n for (const item of items) {\n if (list.length >= maxFiles) break;\n\n // Skip hidden folders and build folders\n if (\n item.name.startsWith(\".\") ||\n item.name === \"node_modules\" ||\n item.name === \"out\" ||\n item.name === \".next\" ||\n item.name === \"dist\"\n ) {\n continue;\n }\n\n const itemPath = path.join(normDirPath, item.name).replace(/\\\\/g, \"/\");\n if (item.isDirectory()) {\n getFlatFileList(itemPath, normRootDir, list, maxFiles);\n } else {\n const relativePath = path.relative(normRootDir, itemPath).replace(/\\\\/g, \"/\");\n list.push({\n name: item.name,\n path: itemPath,\n relativePath: relativePath,\n });\n }\n }\n } catch (err) {\n console.error(`Failed to read flat file list for ${normDirPath}:`, err);\n }\n return list;\n}\n\nexport async function GET(request: Request) {\n try {\n const { searchParams } = new URL(request.url);\n const action = searchParams.get(\"action\");\n\n if (action === \"list\") {\n const rootPath = searchParams.get(\"root\");\n const scopedStr = searchParams.get(\"scoped\");\n \n const targetRoot = ((rootPath && fs.existsSync(rootPath)) ? rootPath : process.env.ORIGINAL_CWD || process.cwd()).replace(/\\\\/g, \"/\");\n const workspaceTree = getDirectoryTree(targetRoot);\n const scopedTrees: { name: string; path: string; tree: TreeNode[] }[] = [];\n\n if (scopedStr) {\n const scopedPaths = scopedStr.split(\",\");\n for (const p of scopedPaths) {\n const trimmed = p.trim().replace(/\\\\/g, \"/\");\n if (trimmed && fs.existsSync(trimmed)) {\n scopedTrees.push({\n name: path.basename(trimmed),\n path: trimmed,\n tree: getDirectoryTree(trimmed),\n });\n }\n }\n }\n\n return NextResponse.json({\n success: true,\n workspace: {\n name: path.basename(targetRoot) || \"Workspace\",\n path: targetRoot,\n tree: workspaceTree,\n },\n scoped: scopedTrees,\n });\n }\n\n if (action === \"flat_list\") {\n const rootPath = searchParams.get(\"root\");\n const scopedStr = searchParams.get(\"scoped\");\n \n const targetRoot = ((rootPath && fs.existsSync(rootPath)) ? rootPath : process.env.ORIGINAL_CWD || process.cwd()).replace(/\\\\/g, \"/\");\n const files: FlatFileItem[] = [];\n \n getFlatFileList(targetRoot, targetRoot, files);\n\n if (scopedStr) {\n const scopedPaths = scopedStr.split(\",\");\n for (const p of scopedPaths) {\n const trimmed = p.trim().replace(/\\\\/g, \"/\");\n if (trimmed && fs.existsSync(trimmed)) {\n getFlatFileList(trimmed, path.dirname(trimmed).replace(/\\\\/g, \"/\"), files);\n }\n }\n }\n\n return NextResponse.json({\n success: true,\n files: files,\n });\n }\n\n if (action === \"browse_dirs\") {\n const targetPathRaw = searchParams.get(\"path\");\n const defaultDir = (process.env.ORIGINAL_CWD || process.cwd() || os.homedir()).replace(/\\\\/g, \"/\");\n let targetPath = (targetPathRaw && targetPathRaw.trim()) ? path.resolve(targetPathRaw) : defaultDir;\n targetPath = targetPath.replace(/\\\\/g, \"/\");\n\n if (!fs.existsSync(targetPath)) {\n return NextResponse.json({ error: \"Directory does not exist\" }, { status: 404 });\n }\n\n const stat = fs.statSync(targetPath);\n if (!stat.isDirectory()) {\n return NextResponse.json({ error: \"Path is not a directory\" }, { status: 400 });\n }\n\n const items = fs.readdirSync(targetPath, { withFileTypes: true });\n const directories: { name: string; path: string }[] = [];\n\n for (const item of items) {\n if (item.isDirectory()) {\n // Skip hidden directories\n if (item.name.startsWith(\".\")) continue;\n directories.push({\n name: item.name,\n path: path.join(targetPath, item.name).replace(/\\\\/g, \"/\"),\n });\n }\n }\n\n // Sort alphabetically\n directories.sort((a, b) => a.name.localeCompare(b.name));\n\n const parentPath = path.dirname(targetPath).replace(/\\\\/g, \"/\");\n const isRoot = parentPath === targetPath;\n\n return NextResponse.json({\n success: true,\n currentPath: targetPath,\n parentPath: isRoot ? null : parentPath,\n directories,\n });\n }\n\n if (action === \"read\") {\n const filePathRaw = searchParams.get(\"path\");\n if (!filePathRaw) {\n return NextResponse.json({ error: \"Missing required parameter 'path'\" }, { status: 400 });\n }\n\n const filePath = filePathRaw.replace(/\\\\/g, \"/\");\n if (!fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"File does not exist\" }, { status: 404 });\n }\n\n const content = fs.readFileSync(filePath, \"utf8\");\n return NextResponse.json({ success: true, content });\n }\n\n return NextResponse.json({ error: \"Invalid action. Must be 'list', 'flat_list' or 'read'\" }, { status: 400 });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n return NextResponse.json({ error: errorMessage }, { status: 500 });\n }\n}\n\nexport async function POST(request: Request) {\n try {\n const body = await request.json();\n const { action, path: rawPath, content, type, oldPath: rawOldPath, newPath: rawNewPath } = body;\n const filePath = rawPath ? rawPath.replace(/\\\\/g, \"/\") : undefined;\n const oldPath = rawOldPath ? rawOldPath.replace(/\\\\/g, \"/\") : undefined;\n const newPath = rawNewPath ? rawNewPath.replace(/\\\\/g, \"/\") : undefined;\n\n if (action === \"write\") {\n if (!filePath || content === undefined) {\n return NextResponse.json({ error: \"Missing 'path' or 'content' in body\" }, { status: 400 });\n }\n\n // Ensure target directory exists\n const parentDir = path.dirname(filePath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n\n fs.writeFileSync(filePath, content, \"utf8\");\n return NextResponse.json({ success: true, message: \"File saved successfully\" });\n }\n\n if (action === \"create\") {\n if (!filePath || !type) {\n return NextResponse.json({ error: \"Missing 'path' or 'type' in request body\" }, { status: 400 });\n }\n\n if (fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"Path already exists\" }, { status: 400 });\n }\n\n if (type === \"directory\") {\n fs.mkdirSync(filePath, { recursive: true });\n return NextResponse.json({ success: true, message: \"Directory created successfully\" });\n } else {\n const parentDir = path.dirname(filePath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n fs.writeFileSync(filePath, \"\", \"utf8\");\n return NextResponse.json({ success: true, message: \"File created successfully\" });\n }\n }\n\n if (action === \"rename\") {\n if (!oldPath || !newPath) {\n return NextResponse.json({ error: \"Missing 'oldPath' or 'newPath' in request body\" }, { status: 400 });\n }\n\n if (!fs.existsSync(oldPath)) {\n return NextResponse.json({ error: \"Source path does not exist\" }, { status: 404 });\n }\n\n if (fs.existsSync(newPath)) {\n return NextResponse.json({ error: \"Target path already exists\" }, { status: 400 });\n }\n\n const parentDir = path.dirname(newPath).replace(/\\\\/g, \"/\");\n if (!fs.existsSync(parentDir)) {\n fs.mkdirSync(parentDir, { recursive: true });\n }\n\n fs.renameSync(oldPath, newPath);\n return NextResponse.json({ success: true, message: \"Renamed successfully\" });\n }\n\n if (action === \"delete\") {\n if (!filePath) {\n return NextResponse.json({ error: \"Missing 'path' in request body\" }, { status: 400 });\n }\n\n if (!fs.existsSync(filePath)) {\n return NextResponse.json({ error: \"Path does not exist\" }, { status: 404 });\n }\n\n fs.rmSync(filePath, { recursive: true, force: true });\n return NextResponse.json({ success: true, message: \"Deleted successfully\" });\n }\n\n return NextResponse.json({ error: \"Invalid action.\" }, { status: 400 });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n return NextResponse.json({ error: errorMessage }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/files/route\",\n pathname: \"/api/files\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/files/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/files/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId,\n deploymentId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["getDirectoryTree","dirPath","depth","maxDepth","normDirPath","replace","items","readdirSync","withFileTypes","nodes","item","name","startsWith","itemPath","join","isDirectory","push","path","type","children","sort","a","b","localeCompare","request","err","console","error","targetRoot","getFlatFileList","rootDir","list","maxFiles","normRootDir","length","env","split","scopedPaths","trimmed","relativePath","relative","files","action","defaultDir","GET","searchParams","URL","url","status","get","statSync","targetPath","stat","rootPath","scopedStr","existsSync","process","ORIGINAL_CWD","cwd","workspaceTree","scopedTrees","p","trim","dirname","basename","tree","json","success","workspace","content","scoped","filePath","targetPathRaw","homedir","resolve","message","newPath","directories","oldPath","parentPath","isRoot","currentPath","filePathRaw","readFileSync","errorMessage","Error","POST","body","rawPath","rawOldPath","rawNewPath","undefined","parentDir","mkdirSync","recursive","writeFileSync","renameSync","rmSync","force"],"mappings":"qCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA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esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},32245,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=a.r(41997);function e({reason:a,children:b}){throw Object.defineProperty(new d.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},7773,(a,b,c)=>{"use strict";function d(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"encodeURIPath",{enumerable:!0,get:function(){return d}})},68063,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},97458,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"PreloadChunks",{enumerable:!0,get:function(){return i}});let d=a.r(87924),e=a.r(35112),f=a.r(56704),g=a.r(7773),h=a.r(68063);function i({moduleIds:a}){let b=f.workAsyncStorage.getStore();if(void 0===b)return null;let c=[];if(b.reactLoadableManifest&&a){let d=b.reactLoadableManifest;for(let b of a){if(!d[b])continue;let a=d[b].files;c.push(...a)}}if(0===c.length)return null;let j=(0,h.getAssetTokenQuery)();return(0,d.jsx)(d.Fragment,{children:c.map(a=>{let c=`${b.assetPrefix}/_next/${(0,g.encodeURIPath)(a)}${j}`;return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:c,rel:"stylesheet",as:"style",nonce:b.nonce},a):((0,e.preload)(c,{as:"script",fetchPriority:"low",nonce:b.nonce}),null)})})}},69853,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return j}});let d=a.r(87924),e=a.r(72131),f=a.r(32245),g=a.r(97458);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},19721,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return e}});let d=a.r(33354)._(a.r(69853));function e(a,b){let c={};"function"==typeof a&&(c.loader=a);let e={...c,...b};return(0,d.default)({...e,modules:e.loadableGenerated?.modules})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},46845,a=>{a.v({activeBorder:"page-module___8aEwW__activeBorder",agentBadge:"page-module___8aEwW__agentBadge",agentCard:"page-module___8aEwW__agentCard",agentGrid:"page-module___8aEwW__agentGrid",agentHeader:"page-module___8aEwW__agentHeader",agentName:"page-module___8aEwW__agentName",ansiCyan:"page-module___8aEwW__ansiCyan",ansiGreen:"page-module___8aEwW__ansiGreen",ansiMagenta:"page-module___8aEwW__ansiMagenta",ansiRed:"page-module___8aEwW__ansiRed",ansiYellow:"page-module___8aEwW__ansiYellow",cardBody:"page-module___8aEwW__cardBody",container:"page-module___8aEwW__container",containerActive:"page-module___8aEwW__containerActive",contextDetails:"page-module___8aEwW__contextDetails",contextItem:"page-module___8aEwW__contextItem",contextList:"page-module___8aEwW__contextList",contextMeta:"page-module___8aEwW__contextMeta",contextTitle:"page-module___8aEwW__contextTitle",dashboardGrid:"page-module___8aEwW__dashboardGrid",envGrid:"page-module___8aEwW__envGrid",envName:"page-module___8aEwW__envName",envRow:"page-module___8aEwW__envRow",envStatus:"page-module___8aEwW__envStatus",footer:"page-module___8aEwW__footer",header:"page-module___8aEwW__header",logoArea:"page-module___8aEwW__logoArea",mainPanel:"page-module___8aEwW__mainPanel",pulse:"page-module___8aEwW__pulse",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel",statusIndicator:"page-module___8aEwW__statusIndicator",stoppedBadge:"page-module___8aEwW__stoppedBadge",subtitle:"page-module___8aEwW__subtitle",terminalContainer:"page-module___8aEwW__terminalContainer",terminalInput:"page-module___8aEwW__terminalInput",terminalInputArea:"page-module___8aEwW__terminalInputArea",terminalLine:"page-module___8aEwW__terminalLine",terminalSendBtn:"page-module___8aEwW__terminalSendBtn",title:"page-module___8aEwW__title"})},40777,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(19721),e=a.i(46845);let f=(0,d.default)(async()=>{},{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,b.jsx)("div",{style:{height:"400px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#05070a",color:"var(--muted)",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"},children:(0,b.jsx)("span",{children:"Initializing terminal emulator..."})})}),g=(0,d.default)(async()=>{},{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,b.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--card)",border:"1px solid var(--border)",borderRadius:"12px",marginTop:"1.5rem"},children:(0,b.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),h=(0,d.default)(async()=>{},{loadableGenerated:{modules:[99026]},ssr:!1}),i=(0,d.default)(async()=>{},{loadableGenerated:{modules:[9949]},ssr:!1}),j=(0,d.default)(async()=>{},{loadableGenerated:{modules:[20032]},ssr:!1}),k=(0,d.default)(async()=>{},{loadableGenerated:{modules:[97722]},ssr:!1});a.s(["default",0,function(){let[a,d]=(0,c.useState)([]),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1),z=a.find(a=>a.id===l),A=a.some(a=>("claude-docker"===a.type||"aider-docker"===a.type)&&"running"===a.status),B=a.some(a=>"claude-ssh"===a.type&&"running"===a.status),C=async()=>{try{let a=await fetch("/api/sessions"),b=await a.json();b.sessions&&d(b.sessions)}catch(a){console.error("Failed to fetch sessions:",a)}};(0,c.useEffect)(()=>{(async()=>{await C()})();let a=setInterval(C,4e3);return()=>clearInterval(a)},[]);let D=async(a,b,c,d)=>{o(!0);try{let e=b;e||("claude"===a?e="Claude Local":"claude-docker"===a?e="Claude Docker":"claude-ssh"===a?e="Claude SSH":"aider"===a?e="Aider Local":"aider-docker"===a?e="Aider Docker":"mock"===a&&(e="Mock Session"));let f={type:a,name:e,workspaceRoot:c,scopedDirs:d};if(("aider"===a||"aider-docker"===a)&&!c)try{let a=await fetch("/api/context/aider");if(a.ok){let b=await a.json();b.success&&b.config&&(f.workspaceRoot=b.config.workspaceRoot,f.scopedDirs=b.config.scopedDirs)}}catch(a){console.error("Failed to load aider configuration before launch:",a)}let g=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),h=await g.json();h.success&&(await C(),m(h.session.id))}catch(a){console.error("Failed to launch session:",a)}finally{o(!1)}},E=async(a,b=!1)=>{try{let c=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,delete:b})});(await c.json()).success&&(b&&l===a&&m(null),await C())}catch(a){console.error("Failed to stop session:",a)}};return(0,b.jsxs)("div",{className:`${e.default.container} ${z?e.default.containerActive:""}`,children:[(0,b.jsxs)("header",{className:e.default.header,children:[(0,b.jsxs)("div",{className:e.default.logoArea,children:[(0,b.jsx)("h1",{className:e.default.title,children:"NeuralLoom"}),(0,b.jsx)("span",{className:e.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]}),(0,b.jsxs)("div",{className:e.default.statusIndicator,children:[(0,b.jsx)("span",{className:e.default.pulseDot}),(0,b.jsx)("span",{children:"Orchestrator Online"})]})]}),z?(0,b.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,b.jsx)(k,{sessionId:z.id,workspaceRoot:z.workspaceRoot||"",scopedDirs:z.scopedDirs||[],onClose:()=>m(null),sessions:a,onSwitchSession:a=>m(a)})}):(0,b.jsxs)("div",{className:e.default.dashboardGrid,children:[(0,b.jsxs)("main",{className:e.default.mainPanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Active AI Agents"}),0===a.length?(0,b.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,b.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions in this workspace. Launch a simulated session to verify the control bridge."}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>D("mock"),disabled:n,style:{maxWidth:"240px",margin:"0 auto"},children:n?"Launching...":"⚡ Launch Simulated Session"})]}):(0,b.jsx)("div",{className:e.default.agentGrid,children:a.map(a=>(0,b.jsxs)("div",{className:`${e.default.agentCard} card ${l===a.id?e.default.activeBorder:""}`,children:[(0,b.jsxs)("div",{className:e.default.agentHeader,children:[(0,b.jsx)("span",{className:e.default.agentName,children:a.name}),(0,b.jsx)("span",{className:`${e.default.agentBadge} ${"stopped"===a.status?e.default.stoppedBadge:""}`,children:a.status})]}),(0,b.jsxs)("div",{className:e.default.cardBody,children:[(0,b.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,b.jsx)("code",{style:{fontSize:"0.75rem"},children:a.id.substring(0,8)}),(0,b.jsx)("br",{}),"Type: ","claude"===a.type?"Claude Local PTY":"claude-docker"===a.type?"Claude Docker PTY":"claude-ssh"===a.type?"Claude SSH PTY":"aider"===a.type?"Aider Local PTY":"aider-docker"===a.type?"Aider Docker PTY":"mock"===a.type?"Simulated Mock PTY":"Unknown PTY",(0,b.jsx)("br",{}),"Logs: ",a.logsCount," captured lines"]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===a.status?(0,b.jsx)("button",{onClick:()=>E(a.id,!1),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--danger)"},children:"Stop"}):(0,b.jsx)("button",{onClick:()=>E(a.id,!0),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},children:"Delete"}),(0,b.jsx)("button",{onClick:()=>m(a.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:l===a.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:l===a.id?"Connected":"Open Session"})]})]})]},a.id))})]}),l&&(0,b.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",a.find(a=>a.id===l)?.name]}),(0,b.jsx)("button",{onClick:()=>m(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]}),(0,b.jsx)(f,{sessionId:l})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,b.jsxs)("div",{className:e.default.contextList,children:[(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccc"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccp"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,b.jsx)(g,{})]})]}),(0,b.jsxs)("aside",{className:e.default.sidePanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Execution Environments"}),(0,b.jsxs)("div",{className:e.default.envGrid,children:[(0,b.jsxs)("div",{className:e.default.envRow,children:[(0,b.jsx)("span",{className:e.default.envName,children:"💻 Local host OS"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:A?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🐳 Docker Sandbox"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:A?"var(--success)":"var(--muted)"},children:A?"Active":"Not Mounted"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:B?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🌐 Remote VM (SSH)"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:B?"var(--success)":"var(--muted)"},children:B?"Active":"Disconnected"})]})]})]}),(0,b.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>D("mock"),disabled:n,children:[(0,b.jsx)("span",{children:"⚡"}),(0,b.jsx)("span",{children:"Launch Mock Agent"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!1),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🤖"}),(0,b.jsx)("span",{children:"Launch Claude PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!0),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Docker PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>q(!0),disabled:n,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🌐"}),(0,b.jsx)("span",{children:"Launch SSH PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!1),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐍"}),(0,b.jsx)("span",{children:"Launch Aider PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!0),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,b.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,b.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Configure global API Keys"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Edit rules templates"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Inspect process locks"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,b.jsxs)("footer",{className:e.default.footer,children:[(0,b.jsx)("span",{children:"NeuralLoom v0.2.10 — Experimental AI Orchestrator Bridge"}),(0,b.jsx)("span",{children:"Directory: C:\\Users\\Dave\\OneDrive\\Projects\\JS\\neural-loom"})]}),p&&(0,b.jsx)(h,{onClose:()=>q(!1),onConfirmLaunch:()=>{q(!1),D("claude-ssh")}}),r&&(0,b.jsx)(i,{onClose:()=>s(!1),isDocker:t,onConfirmLaunch:()=>{s(!1),D(t?"aider-docker":"aider")}}),v&&(0,b.jsx)(j,{onClose:()=>w(!1),isDocker:x,onConfirmLaunch:(a,b,c)=>{w(!1),D(x?"claude-docker":"claude",a,b,c)}})]})}])}];
|
|
1
|
+
module.exports=[41997,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},32245,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"BailoutToCSR",{enumerable:!0,get:function(){return e}});let d=a.r(41997);function e({reason:a,children:b}){throw Object.defineProperty(new d.BailoutToCSRError(a),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},7773,(a,b,c)=>{"use strict";function d(a){return a.split("/").map(a=>encodeURIComponent(a)).join("/")}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"encodeURIPath",{enumerable:!0,get:function(){return d}})},68063,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},97458,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"PreloadChunks",{enumerable:!0,get:function(){return i}});let d=a.r(87924),e=a.r(35112),f=a.r(56704),g=a.r(7773),h=a.r(68063);function i({moduleIds:a}){let b=f.workAsyncStorage.getStore();if(void 0===b)return null;let c=[];if(b.reactLoadableManifest&&a){let d=b.reactLoadableManifest;for(let b of a){if(!d[b])continue;let a=d[b].files;c.push(...a)}}if(0===c.length)return null;let j=(0,h.getAssetTokenQuery)();return(0,d.jsx)(d.Fragment,{children:c.map(a=>{let c=`${b.assetPrefix}/_next/${(0,g.encodeURIPath)(a)}${j}`;return a.endsWith(".css")?(0,d.jsx)("link",{precedence:"dynamic",href:c,rel:"stylesheet",as:"style",nonce:b.nonce},a):((0,e.preload)(c,{as:"script",fetchPriority:"low",nonce:b.nonce}),null)})})}},69853,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return j}});let d=a.r(87924),e=a.r(72131),f=a.r(32245),g=a.r(97458);function h(a){return{default:a&&"default"in a?a.default:a}}let i={loader:()=>Promise.resolve(h(()=>null)),loading:null,ssr:!0},j=function(a){let b={...i,...a},c=(0,e.lazy)(()=>b.loader().then(h)),j=b.loading;function k(a){let h=j?(0,d.jsx)(j,{isLoading:!0,pastDelay:!0,error:null}):null,i=!b.ssr||!!b.loading,k=i?e.Suspense:e.Fragment,l=b.ssr?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.PreloadChunks,{moduleIds:b.modules}),(0,d.jsx)(c,{...a})]}):(0,d.jsx)(f.BailoutToCSR,{reason:"next/dynamic",children:(0,d.jsx)(c,{...a})});return(0,d.jsx)(k,{...i?{fallback:h}:{},children:l})}return k.displayName="LoadableComponent",k}},19721,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return e}});let d=a.r(33354)._(a.r(69853));function e(a,b){let c={};"function"==typeof a&&(c.loader=a);let e={...c,...b};return(0,d.default)({...e,modules:e.loadableGenerated?.modules})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},46845,a=>{a.v({activeBorder:"page-module___8aEwW__activeBorder",agentBadge:"page-module___8aEwW__agentBadge",agentCard:"page-module___8aEwW__agentCard",agentGrid:"page-module___8aEwW__agentGrid",agentHeader:"page-module___8aEwW__agentHeader",agentName:"page-module___8aEwW__agentName",ansiCyan:"page-module___8aEwW__ansiCyan",ansiGreen:"page-module___8aEwW__ansiGreen",ansiMagenta:"page-module___8aEwW__ansiMagenta",ansiRed:"page-module___8aEwW__ansiRed",ansiYellow:"page-module___8aEwW__ansiYellow",cardBody:"page-module___8aEwW__cardBody",container:"page-module___8aEwW__container",containerActive:"page-module___8aEwW__containerActive",contextDetails:"page-module___8aEwW__contextDetails",contextItem:"page-module___8aEwW__contextItem",contextList:"page-module___8aEwW__contextList",contextMeta:"page-module___8aEwW__contextMeta",contextTitle:"page-module___8aEwW__contextTitle",dashboardGrid:"page-module___8aEwW__dashboardGrid",envGrid:"page-module___8aEwW__envGrid",envName:"page-module___8aEwW__envName",envRow:"page-module___8aEwW__envRow",envStatus:"page-module___8aEwW__envStatus",footer:"page-module___8aEwW__footer",header:"page-module___8aEwW__header",logoArea:"page-module___8aEwW__logoArea",mainPanel:"page-module___8aEwW__mainPanel",pulse:"page-module___8aEwW__pulse",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel",statusIndicator:"page-module___8aEwW__statusIndicator",stoppedBadge:"page-module___8aEwW__stoppedBadge",subtitle:"page-module___8aEwW__subtitle",terminalContainer:"page-module___8aEwW__terminalContainer",terminalInput:"page-module___8aEwW__terminalInput",terminalInputArea:"page-module___8aEwW__terminalInputArea",terminalLine:"page-module___8aEwW__terminalLine",terminalSendBtn:"page-module___8aEwW__terminalSendBtn",title:"page-module___8aEwW__title"})},40777,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(19721),e=a.i(46845);let f=(0,d.default)(async()=>{},{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,b.jsx)("div",{style:{height:"400px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#05070a",color:"var(--muted)",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"},children:(0,b.jsx)("span",{children:"Initializing terminal emulator..."})})}),g=(0,d.default)(async()=>{},{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,b.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--card)",border:"1px solid var(--border)",borderRadius:"12px",marginTop:"1.5rem"},children:(0,b.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),h=(0,d.default)(async()=>{},{loadableGenerated:{modules:[99026]},ssr:!1}),i=(0,d.default)(async()=>{},{loadableGenerated:{modules:[9949]},ssr:!1}),j=(0,d.default)(async()=>{},{loadableGenerated:{modules:[20032]},ssr:!1}),k=(0,d.default)(async()=>{},{loadableGenerated:{modules:[97722]},ssr:!1});a.s(["default",0,function(){let[a,d]=(0,c.useState)([]),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),B=a.find(a=>a.id===l),C=a.some(a=>("claude-docker"===a.type||"aider-docker"===a.type)&&"running"===a.status),D=a.some(a=>"claude-ssh"===a.type&&"running"===a.status),E=async()=>{try{let a=await fetch("/api/sessions"),b=await a.json();b.sessions&&d(b.sessions),b.originalCwd&&A(b.originalCwd)}catch(a){console.error("Failed to fetch sessions:",a)}};(0,c.useEffect)(()=>{(async()=>{await E()})();let a=setInterval(E,4e3);return()=>clearInterval(a)},[]);let F=async(a,b,c,d)=>{o(!0);try{let e=b;e||("claude"===a?e="Claude Local":"claude-docker"===a?e="Claude Docker":"claude-ssh"===a?e="Claude SSH":"aider"===a?e="Aider Local":"aider-docker"===a?e="Aider Docker":"mock"===a&&(e="Mock Session"));let f={type:a,name:e,workspaceRoot:c,scopedDirs:d};if(("aider"===a||"aider-docker"===a)&&!c)try{let a=await fetch("/api/context/aider");if(a.ok){let b=await a.json();b.success&&b.config&&(f.workspaceRoot=b.config.workspaceRoot,f.scopedDirs=b.config.scopedDirs)}}catch(a){console.error("Failed to load aider configuration before launch:",a)}let g=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),h=await g.json();h.success&&(await E(),m(h.session.id))}catch(a){console.error("Failed to launch session:",a)}finally{o(!1)}},G=async(a,b=!1)=>{try{let c=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,delete:b})});(await c.json()).success&&(b&&l===a&&m(null),await E())}catch(a){console.error("Failed to stop session:",a)}};return(0,b.jsxs)("div",{className:`${e.default.container} ${B?e.default.containerActive:""}`,children:[(0,b.jsxs)("header",{className:e.default.header,children:[(0,b.jsxs)("div",{className:e.default.logoArea,children:[(0,b.jsx)("h1",{className:e.default.title,children:"NeuralLoom"}),(0,b.jsx)("span",{className:e.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]}),(0,b.jsxs)("div",{className:e.default.statusIndicator,children:[(0,b.jsx)("span",{className:e.default.pulseDot}),(0,b.jsx)("span",{children:"Orchestrator Online"})]})]}),B?(0,b.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,b.jsx)(k,{sessionId:B.id,workspaceRoot:B.workspaceRoot||"",scopedDirs:B.scopedDirs||[],onClose:()=>m(null),sessions:a,onSwitchSession:a=>m(a)})}):(0,b.jsxs)("div",{className:e.default.dashboardGrid,children:[(0,b.jsxs)("main",{className:e.default.mainPanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Active AI Agents"}),0===a.length?(0,b.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,b.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions in this workspace. Launch a simulated session to verify the control bridge."}),(0,b.jsx)("button",{className:e.default.quickLaunchBtn,onClick:()=>F("mock"),disabled:n,style:{maxWidth:"240px",margin:"0 auto"},children:n?"Launching...":"⚡ Launch Simulated Session"})]}):(0,b.jsx)("div",{className:e.default.agentGrid,children:a.map(a=>(0,b.jsxs)("div",{className:`${e.default.agentCard} card ${l===a.id?e.default.activeBorder:""}`,children:[(0,b.jsxs)("div",{className:e.default.agentHeader,children:[(0,b.jsx)("span",{className:e.default.agentName,children:a.name}),(0,b.jsx)("span",{className:`${e.default.agentBadge} ${"stopped"===a.status?e.default.stoppedBadge:""}`,children:a.status})]}),(0,b.jsxs)("div",{className:e.default.cardBody,children:[(0,b.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,b.jsx)("code",{style:{fontSize:"0.75rem"},children:a.id.substring(0,8)}),(0,b.jsx)("br",{}),"Type: ","claude"===a.type?"Claude Local PTY":"claude-docker"===a.type?"Claude Docker PTY":"claude-ssh"===a.type?"Claude SSH PTY":"aider"===a.type?"Aider Local PTY":"aider-docker"===a.type?"Aider Docker PTY":"mock"===a.type?"Simulated Mock PTY":"Unknown PTY",(0,b.jsx)("br",{}),"Logs: ",a.logsCount," captured lines"]}),(0,b.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===a.status?(0,b.jsx)("button",{onClick:()=>G(a.id,!1),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--danger)"},children:"Stop"}):(0,b.jsx)("button",{onClick:()=>G(a.id,!0),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},children:"Delete"}),(0,b.jsx)("button",{onClick:()=>m(a.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:l===a.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:l===a.id?"Connected":"Open Session"})]})]})]},a.id))})]}),l&&(0,b.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,b.jsxs)("div",{className:e.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,b.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",a.find(a=>a.id===l)?.name]}),(0,b.jsx)("button",{onClick:()=>m(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]}),(0,b.jsx)(f,{sessionId:l})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,b.jsxs)("div",{className:e.default.contextList,children:[(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccc"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,b.jsxs)("div",{className:`${e.default.contextItem} card`,children:[(0,b.jsxs)("div",{className:e.default.contextMeta,children:[(0,b.jsx)("span",{className:e.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,b.jsx)("span",{className:e.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,b.jsx)("button",{onClick:async()=>{l&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,command:"/ccp"})})},disabled:!l,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:l?1:.5,cursor:l?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,b.jsx)(g,{})]})]}),(0,b.jsxs)("aside",{className:e.default.sidePanel,children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h2",{className:e.default.sectionTitle,children:"Execution Environments"}),(0,b.jsxs)("div",{className:e.default.envGrid,children:[(0,b.jsxs)("div",{className:e.default.envRow,children:[(0,b.jsx)("span",{className:e.default.envName,children:"💻 Local host OS"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:C?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🐳 Docker Sandbox"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:C?"var(--success)":"var(--muted)"},children:C?"Active":"Not Mounted"})]}),(0,b.jsxs)("div",{className:e.default.envRow,style:{opacity:D?1:.6},children:[(0,b.jsx)("span",{className:e.default.envName,children:"🌐 Remote VM (SSH)"}),(0,b.jsx)("span",{className:e.default.envStatus,style:{color:D?"var(--success)":"var(--muted)"},children:D?"Active":"Disconnected"})]})]})]}),(0,b.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>F("mock"),disabled:n,children:[(0,b.jsx)("span",{children:"⚡"}),(0,b.jsx)("span",{children:"Launch Mock Agent"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!1),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🤖"}),(0,b.jsx)("span",{children:"Launch Claude PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{y(!0),w(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Docker PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>q(!0),disabled:n,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🌐"}),(0,b.jsx)("span",{children:"Launch SSH PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!1),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐍"}),(0,b.jsx)("span",{children:"Launch Aider PTY"})]}),(0,b.jsxs)("button",{className:e.default.quickLaunchBtn,onClick:()=>{u(!0),s(!0)},disabled:n,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,b.jsx)("span",{children:"🐳"}),(0,b.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,b.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,b.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,b.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Configure global API Keys"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Edit rules templates"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,b.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsx)("span",{children:"Inspect process locks"}),(0,b.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]})]})]})]}),(0,b.jsxs)("footer",{className:e.default.footer,children:[(0,b.jsx)("span",{children:"NeuralLoom v0.2.11 — Experimental AI Orchestrator Bridge"}),(0,b.jsxs)("span",{children:["Directory: ",z||"Loading..."]})]}),p&&(0,b.jsx)(h,{onClose:()=>q(!1),onConfirmLaunch:()=>{q(!1),F("claude-ssh")}}),r&&(0,b.jsx)(i,{onClose:()=>s(!1),isDocker:t,onConfirmLaunch:()=>{s(!1),F(t?"aider-docker":"aider")}}),v&&(0,b.jsx)(j,{onClose:()=>w(!1),isDocker:x,onConfirmLaunch:(a,b,c)=>{w(!1),F(x?"claude-docker":"claude",a,b,c)}})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0t7oqy6._.js.map
|