@shepai/cli 1.68.1 → 1.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts +1 -1
  2. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts.map +1 -1
  3. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts +2 -1
  4. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.d.ts.map +1 -1
  5. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-installer.service.js +17 -2
  6. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts +1 -1
  7. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts.map +1 -1
  8. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/CLAUDE.md +45 -18
  9. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/alacritty.json +18 -0
  10. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/iterm2.json +17 -0
  11. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/kitty.json +18 -0
  12. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/tmux.json +27 -0
  13. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/warp.json +17 -0
  14. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +2 -0
  15. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
  16. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  17. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +32 -0
  18. package/dist/src/presentation/web/components/features/tools/tool-card.d.ts.map +1 -1
  19. package/dist/src/presentation/web/components/features/tools/tool-card.js +1 -0
  20. package/dist/src/presentation/web/components/features/tools/tools-page-client.d.ts.map +1 -1
  21. package/dist/src/presentation/web/components/features/tools/tools-page-client.js +2 -1
  22. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  23. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +7 -2
  24. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts +3 -3
  25. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
  26. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +1 -1
  27. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
  28. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.js +36 -11
  29. package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts +26 -0
  30. package/dist/src/presentation/web/hooks/sidebar-features-context.d.ts.map +1 -0
  31. package/dist/src/presentation/web/hooks/sidebar-features-context.js +34 -0
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/web/.next/BUILD_ID +1 -1
  35. package/web/.next/build-manifest.json +2 -2
  36. package/web/.next/cache/.previewinfo +1 -1
  37. package/web/.next/cache/.rscinfo +1 -1
  38. package/web/.next/cache/.tsbuildinfo +1 -1
  39. package/web/.next/cache/config.json +3 -3
  40. package/web/.next/fallback-build-manifest.json +2 -2
  41. package/web/.next/prerender-manifest.json +3 -3
  42. package/web/.next/required-server-files.js +1 -1
  43. package/web/.next/required-server-files.json +1 -1
  44. package/web/.next/server/app/_global-error.html +2 -2
  45. package/web/.next/server/app/_global-error.rsc +1 -1
  46. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  47. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  48. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  49. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  50. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  51. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  52. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  53. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/page/server-reference-manifest.json +18 -18
  55. package/web/.next/server/app/page.js.nft.json +1 -1
  56. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  57. package/web/.next/server/app/skills/page/server-reference-manifest.json +5 -5
  58. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  59. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  60. package/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  61. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  62. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  64. package/web/.next/server/app/version/page.js.nft.json +1 -1
  65. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/chunks/[root-of-the-server]__09413611._.js.map +1 -1
  67. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  68. package/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js.map +1 -1
  69. package/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  70. package/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js +1 -1
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js.map +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
  74. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  75. package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
  76. package/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js +2 -2
  77. package/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js.map +1 -1
  78. package/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js +2 -2
  79. package/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js.map +1 -1
  80. package/web/.next/server/chunks/ssr/_49bf495c._.js +1 -1
  81. package/web/.next/server/chunks/ssr/_49bf495c._.js.map +1 -1
  82. package/web/.next/server/chunks/ssr/_68b5e0de._.js +6 -0
  83. package/web/.next/server/chunks/ssr/_68b5e0de._.js.map +1 -0
  84. package/web/.next/server/chunks/ssr/_690ea95f._.js +1 -1
  85. package/web/.next/server/chunks/ssr/_690ea95f._.js.map +1 -1
  86. package/web/.next/server/chunks/ssr/_725584e5._.js +1 -1
  87. package/web/.next/server/chunks/ssr/_725584e5._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  89. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  90. package/web/.next/server/pages/500.html +2 -2
  91. package/web/.next/server/server-reference-manifest.js +1 -1
  92. package/web/.next/server/server-reference-manifest.json +19 -19
  93. package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
  94. package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +2 -2
  95. package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
  96. package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +1 -1
  97. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
  98. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +1 -1
  99. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  100. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  101. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  102. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  103. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  105. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  106. package/web/.next/standalone/src/presentation/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  107. package/web/.next/standalone/src/presentation/web/.next/server/app/page/server-reference-manifest.json +18 -18
  108. package/web/.next/standalone/src/presentation/web/.next/server/app/page.js.nft.json +1 -1
  109. package/web/.next/standalone/src/presentation/web/.next/server/app/page_client-reference-manifest.js +1 -1
  110. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page/server-reference-manifest.json +5 -5
  111. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page.js.nft.json +1 -1
  112. package/web/.next/standalone/src/presentation/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  113. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page/server-reference-manifest.json +1 -1
  114. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page.js.nft.json +1 -1
  115. package/web/.next/standalone/src/presentation/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  116. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  117. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page.js.nft.json +1 -1
  118. package/web/.next/standalone/src/presentation/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  119. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__08ba9bd3._.js +1 -1
  120. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__249c74f6._.js +1 -1
  121. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__551fb7e1._.js +1 -1
  122. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
  123. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
  124. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__9add7c3a._.js +2 -2
  125. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__e41b5eec._.js +2 -2
  126. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_49bf495c._.js +1 -1
  127. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_68b5e0de._.js +6 -0
  128. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_690ea95f._.js +1 -1
  129. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_725584e5._.js +1 -1
  130. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  131. package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
  132. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
  133. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +19 -19
  134. package/web/.next/standalone/src/presentation/web/components/common/feature-node/feature-node-state-config.ts +2 -0
  135. package/web/.next/standalone/src/presentation/web/components/features/control-center/control-center-inner.tsx +44 -0
  136. package/web/.next/standalone/src/presentation/web/components/features/tools/tool-card.tsx +1 -0
  137. package/web/.next/standalone/src/presentation/web/components/features/tools/tools-page-client.tsx +5 -1
  138. package/web/.next/standalone/src/presentation/web/components/layouts/app-shell/app-shell.tsx +18 -2
  139. package/web/.next/standalone/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.tsx +36 -11
  140. package/web/.next/standalone/src/presentation/web/components/layouts/app-sidebar/app-sidebar.tsx +7 -4
  141. package/web/.next/standalone/src/presentation/web/hooks/sidebar-features-context.tsx +69 -0
  142. package/web/.next/standalone/src/presentation/web/server.js +1 -1
  143. package/web/.next/static/chunks/{491ae2bbae40857c.js → 505c6a9e4c5d0808.js} +1 -1
  144. package/web/.next/static/chunks/{caa2e7e1618e2179.js → 51c94a563ecc565d.js} +1 -1
  145. package/web/.next/static/chunks/6d7d233d07d9a026.js +1 -0
  146. package/web/.next/static/chunks/{ac9971b036d46eca.js → 86b38e36afcd19f3.js} +1 -1
  147. package/web/.next/static/chunks/{7b56cca1fa91c197.js → 94562d62bf8e4bf7.js} +1 -1
  148. package/web/.next/static/chunks/{babbd238fc276df2.js → fdfd68aacc4727cf.js} +2 -2
  149. package/web/.next/trace +1 -1
  150. package/web/.next/trace-build +1 -1
  151. package/web/.next/server/chunks/ssr/_23c92688._.js +0 -6
  152. package/web/.next/server/chunks/ssr/_23c92688._.js.map +0 -1
  153. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/_23c92688._.js +0 -6
  154. package/web/.next/static/chunks/eaf9699a447461e1.js +0 -1
  155. /package/web/.next/static/{VcKnu_EsfkBbSZnJoevS7 → 6pJLWKt-ohZJ_2kGrHG_m}/_buildManifest.js +0 -0
  156. /package/web/.next/static/{VcKnu_EsfkBbSZnJoevS7 → 6pJLWKt-ohZJ_2kGrHG_m}/_clientMiddlewareManifest.json +0 -0
  157. /package/web/.next/static/{VcKnu_EsfkBbSZnJoevS7 → 6pJLWKt-ohZJ_2kGrHG_m}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/tools/%5Bid%5D/install/route.ts","../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-metadata.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { InstallToolUseCase } from '@shepai/core/application/use-cases/tools/install-tool.use-case';\nimport { TOOL_METADATA } from '@shepai/core/infrastructure/services/tool-installer/tool-metadata';\n\nexport async function POST(\n _request: Request,\n { params }: { params: Promise<{ id: string }> }\n): Promise<NextResponse> {\n const { id } = await params;\n\n if (!TOOL_METADATA[id]) {\n return NextResponse.json({ error: 'Tool not found' }, { status: 404 });\n }\n\n try {\n const useCase = resolve<InstallToolUseCase>('InstallToolUseCase');\n const status = await useCase.execute(id);\n return NextResponse.json({ status });\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to install tool';\n return NextResponse.json({ error: message }, { status: 500 });\n }\n}\n","/**\n * Tool Installation Metadata\n *\n * Dynamically loads tool definitions from individual JSON files in the tools/ directory.\n * Each JSON file defines installation commands and metadata for a single development tool.\n *\n * To add a new tool, create a JSON file in tools/ matching the ToolMetadata schema:\n * tools/<tool-name>.json\n */\n\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join, basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface ToolMetadata {\n /** Human-readable display name */\n name: string;\n\n /** Short one-line summary */\n summary: string;\n\n /** Detailed description */\n description: string;\n\n /** Tool tags for grouping in listings. A tool can belong to multiple categories. */\n tags: ('ide' | 'cli-agent' | 'vcs')[];\n\n /** URL to the tool's icon/logo image */\n iconUrl?: string;\n\n /** Binary name to check with 'which' command (string or per-platform map) */\n binary: string | Record<string, string>;\n\n /** Package manager or installation method */\n packageManager: string;\n\n /** Platform-specific installation commands as shell strings (keyed by os.platform()) */\n commands: Record<string, string>;\n\n /** Installation timeout in milliseconds */\n timeout: number;\n\n /** Official documentation URL */\n documentationUrl: string;\n\n /** Command to verify installation (e.g., \"code --version\") */\n verifyCommand: string;\n\n /** Whether the tool supports automated installation (default: true) */\n autoInstall?: boolean;\n\n /** Whether this tool is required for the platform to function (default: false) */\n required?: boolean;\n\n /** Command to open a directory in this tool.\n * String format: \"code {dir}\" — single command for all platforms.\n * Object format: { \"linux\": \"antigravity {dir}\", \"darwin\": \"agy {dir}\" } — per-platform commands. */\n openDirectory?: string | Record<string, string>;\n\n /** Override default spawn options for the launch process.\n * Defaults: { detached: true, stdio: \"ignore\" } (GUI IDEs).\n * CLI agents should use { shell: true, stdio: \"inherit\" } to run in the current terminal. */\n spawnOptions?: {\n shell?: boolean;\n stdio?: 'ignore' | 'inherit' | 'pipe';\n detached?: boolean;\n };\n\n /** Platform-specific command to launch this tool in a new terminal window.\n * Used when launching from the web UI where no terminal is available.\n * When set, the launcher spawns a new terminal window with this command.\n * Supports {dir} placeholder like openDirectory.\n * Example: \"x-terminal-emulator -e bash -c 'cd {dir} && claude'\" */\n terminalCommand?: string | Record<string, string>;\n}\n\nconst REQUIRED_FIELDS: (keyof ToolMetadata)[] = [\n 'name',\n 'summary',\n 'description',\n 'tags',\n 'binary',\n 'packageManager',\n 'commands',\n 'timeout',\n 'documentationUrl',\n 'verifyCommand',\n];\n\nfunction loadToolMetadata(): Record<string, ToolMetadata> {\n const toolsDir = join(fileURLToPath(import.meta.url), '..', 'tools');\n const metadata: Record<string, ToolMetadata> = {};\n\n let files: string[];\n try {\n files = readdirSync(toolsDir).filter((f) => f.endsWith('.json'));\n } catch {\n return metadata;\n }\n\n for (const file of files) {\n const toolName = basename(file, '.json');\n try {\n const raw = readFileSync(join(toolsDir, file), 'utf-8');\n const parsed = JSON.parse(raw) as ToolMetadata;\n\n const missing = REQUIRED_FIELDS.filter((field) => !(field in parsed));\n if (missing.length > 0) {\n continue;\n }\n\n metadata[toolName] = parsed;\n } catch {\n // Skip malformed JSON files\n }\n }\n\n return metadata;\n}\n\nexport const TOOL_METADATA: Record<string, ToolMetadata> = loadToolMetadata();\n\n/**\n * Returns entries from TOOL_METADATA that can open a directory as an IDE.\n * A tool qualifies if it has an `openDirectory` field, regardless of category.\n * Each entry is [toolId, metadata].\n */\nexport function getIdeEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(([, meta]) => meta.openDirectory != null);\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 } 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 = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/tools/[id]/install/route\",\n pathname: \"/api/tools/[id]/install\",\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/presentation/web/app/api/tools/[id]/install/route.ts\",\n nextConfigOutput,\n userland\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 (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/tools/[id]/install/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, 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.experimental.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 context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, '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 }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\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 } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\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 (activeSpan) {\n await handleResponse(activeSpan);\n } else {\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));\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":[],"mappings":"wjCAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,kLGnCA,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,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,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,OFhBA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCSA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,6HAgEM,EAA0C,CAC9C,O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AAAS,GAAG,CAAC,kBAC3E,AAD6F,EACrF,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,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,EAEA,qCAAqC","ignoreList":[3]}
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/app/api/tools/%5Bid%5D/install/route.ts","../../../../../../packages/core/src/infrastructure/services/tool-installer/tool-metadata.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { InstallToolUseCase } from '@shepai/core/application/use-cases/tools/install-tool.use-case';\nimport { TOOL_METADATA } from '@shepai/core/infrastructure/services/tool-installer/tool-metadata';\n\nexport async function POST(\n _request: Request,\n { params }: { params: Promise<{ id: string }> }\n): Promise<NextResponse> {\n const { id } = await params;\n\n if (!TOOL_METADATA[id]) {\n return NextResponse.json({ error: 'Tool not found' }, { status: 404 });\n }\n\n try {\n const useCase = resolve<InstallToolUseCase>('InstallToolUseCase');\n const status = await useCase.execute(id);\n return NextResponse.json({ status });\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to install tool';\n return NextResponse.json({ error: message }, { status: 500 });\n }\n}\n","/**\n * Tool Installation Metadata\n *\n * Dynamically loads tool definitions from individual JSON files in the tools/ directory.\n * Each JSON file defines installation commands and metadata for a single development tool.\n *\n * To add a new tool, create a JSON file in tools/ matching the ToolMetadata schema:\n * tools/<tool-name>.json\n */\n\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join, basename } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface ToolMetadata {\n /** Human-readable display name */\n name: string;\n\n /** Short one-line summary */\n summary: string;\n\n /** Detailed description */\n description: string;\n\n /** Tool tags for grouping in listings. A tool can belong to multiple categories. */\n tags: ('ide' | 'cli-agent' | 'vcs' | 'terminal')[];\n\n /** URL to the tool's icon/logo image */\n iconUrl?: string;\n\n /** Binary name to check with 'which' command (string or per-platform map) */\n binary: string | Record<string, string>;\n\n /** Package manager or installation method */\n packageManager: string;\n\n /** Platform-specific installation commands as shell strings (keyed by os.platform()) */\n commands: Record<string, string>;\n\n /** Installation timeout in milliseconds */\n timeout: number;\n\n /** Official documentation URL */\n documentationUrl: string;\n\n /** Command to verify installation (e.g., \"code --version\") */\n verifyCommand: string;\n\n /** Whether the tool supports automated installation (default: true) */\n autoInstall?: boolean;\n\n /** Whether this tool is required for the platform to function (default: false) */\n required?: boolean;\n\n /** Command to open a directory in this tool.\n * String format: \"code {dir}\" — single command for all platforms.\n * Object format: { \"linux\": \"antigravity {dir}\", \"darwin\": \"agy {dir}\" } — per-platform commands. */\n openDirectory?: string | Record<string, string>;\n\n /** Override default spawn options for the launch process.\n * Defaults: { detached: true, stdio: \"ignore\" } (GUI IDEs).\n * CLI agents should use { shell: true, stdio: \"inherit\" } to run in the current terminal. */\n spawnOptions?: {\n shell?: boolean;\n stdio?: 'ignore' | 'inherit' | 'pipe';\n detached?: boolean;\n };\n\n /** Platform-specific command to launch this tool in a new terminal window.\n * Used when launching from the web UI where no terminal is available.\n * When set, the launcher spawns a new terminal window with this command.\n * Supports {dir} placeholder like openDirectory.\n * Example: \"x-terminal-emulator -e bash -c 'cd {dir} && claude'\" */\n terminalCommand?: string | Record<string, string>;\n}\n\nconst REQUIRED_FIELDS: (keyof ToolMetadata)[] = [\n 'name',\n 'summary',\n 'description',\n 'tags',\n 'binary',\n 'packageManager',\n 'commands',\n 'timeout',\n 'documentationUrl',\n 'verifyCommand',\n];\n\nfunction loadToolMetadata(): Record<string, ToolMetadata> {\n const toolsDir = join(fileURLToPath(import.meta.url), '..', 'tools');\n const metadata: Record<string, ToolMetadata> = {};\n\n let files: string[];\n try {\n files = readdirSync(toolsDir).filter((f) => f.endsWith('.json'));\n } catch {\n return metadata;\n }\n\n for (const file of files) {\n const toolName = basename(file, '.json');\n try {\n const raw = readFileSync(join(toolsDir, file), 'utf-8');\n const parsed = JSON.parse(raw) as ToolMetadata;\n\n const missing = REQUIRED_FIELDS.filter((field) => !(field in parsed));\n if (missing.length > 0) {\n continue;\n }\n\n metadata[toolName] = parsed;\n } catch {\n // Skip malformed JSON files\n }\n }\n\n return metadata;\n}\n\nexport const TOOL_METADATA: Record<string, ToolMetadata> = loadToolMetadata();\n\n/**\n * Returns entries from TOOL_METADATA that can open a directory as an IDE.\n * A tool qualifies if it has an `openDirectory` field, regardless of category.\n * Each entry is [toolId, metadata].\n */\nexport function getIdeEntries(): [string, ToolMetadata][] {\n return Object.entries(TOOL_METADATA).filter(([, meta]) => meta.openDirectory != null);\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 } 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 = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/tools/[id]/install/route\",\n pathname: \"/api/tools/[id]/install\",\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/presentation/web/app/api/tools/[id]/install/route.ts\",\n nextConfigOutput,\n userland\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 (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/tools/[id]/install/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, 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.experimental.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 context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, '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 }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\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 } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\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 (activeSpan) {\n await handleResponse(activeSpan);\n } else {\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));\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":[],"mappings":"wjCAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,kLGnCA,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,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA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[3]}
@@ -1,4 +1,4 @@
1
1
  module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},92658,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(28478)},12581,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"007904f92b37e3fb1ddaa8cf3b3331b5785965e1c9",null),a.s(["pickFolder",()=>g],12513)},19036,a=>{"use strict";var b=a.i(12513);a.s([],9762),a.i(9762),a.s(["007904f92b37e3fb1ddaa8cf3b3331b5785965e1c9",()=>b.pickFolder],19036)}];
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"00be2fc10adebcfc2f426a24668679c45663250f3a",null),a.s(["pickFolder",()=>g],12513)},19036,a=>{"use strict";var b=a.i(12513);a.s([],9762),a.i(9762),a.s(["00be2fc10adebcfc2f426a24668679c45663250f3a",()=>b.pickFolder],19036)}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__08ba9bd3._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/.next-internal/server/app/tools/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","export {pickFolder as '007904f92b37e3fb1ddaa8cf3b3331b5785965e1c9'} from 'ACTIONS_MODULE0'\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"oIAAoD,OAAA,cAAA,CAAA,EAAA,aAAA,oCAC3CA,0BAAAA,qCAAAA,EAAAA,uBAAuB,YAAQ,CAAA,CAAA,IAAA,iCCEjC,SAASC,EAAyBC,CAAc,EACrD,IAAK,IA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G,CAApB,EAAM,MAAM,CACpC,OAAO,IAET,OAAM,CACR,CACF,CACF,CCrDO,eAAe,IACpB,IAAM,EAAU,IAAI,EAEpB,GAAI,CAEF,MAAO,CAAE,KADI,EAAQ,UAAU,EACjB,CAChB,CAAE,MAAO,EAAgB,CAEvB,MAAO,CAAE,KAAM,KAAM,MADL,CACY,YADK,MAAQ,EAAM,OAAO,CAAG,8BACrB,CACtC,CACF,0CAVsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA,8DCJtB,IAAA,EAAA,EAAA,CAAA,CAAA","ignoreList":[0,1]}
1
+ {"version":3,"sources":["../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/server-reference.ts","../../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/src/build/webpack/loaders/next-flight-loader/action-validate.ts","../../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../../src/presentation/web/app/actions/pick-folder.ts","../../../../../../../src/presentation/web/.next-internal/server/app/tools/page/actions.js%20%28server%20actions%20loader%29"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nexport { registerServerReference } from 'react-server-dom-webpack/server'\n","// This function ensures that all the exported values are valid server actions,\n// during the runtime. By definition all actions are required to be async\n// functions, but here we can only check that they are functions.\nexport function ensureServerEntryExports(actions: any[]) {\n for (let i = 0; i < actions.length; i++) {\n const action = actions[i]\n if (typeof action !== 'function') {\n throw new Error(\n `A \"use server\" file can only export async functions, found ${typeof action}.\\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`\n )\n }\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","'use server';\n\nimport { FolderDialogService } from '@shepai/core/infrastructure/services/folder-dialog.service';\n\nexport async function pickFolder(): Promise<{ path: string | null; error?: string }> {\n const service = new FolderDialogService();\n\n try {\n const path = service.pickFolder();\n return { path };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to open folder dialog';\n return { path: null, error: message };\n }\n}\n","export {pickFolder as '00be2fc10adebcfc2f426a24668679c45663250f3a'} from 'ACTIONS_MODULE0'\n"],"names":["registerServerReference","ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"oIAAoD,OAAA,cAAA,CAAA,EAAA,aAAA,oCAC3CA,0BAAAA,qCAAAA,EAAAA,uBAAuB,YAAQ,CAAA,CAAA,IAAA,iCCEjC,SAASC,EAAyBC,CAAc,EACrD,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,MAAM,CAAED,IAAK,CACvC,IAAME,EAASH,CAAO,CAACC,EAAE,CACzB,GAAI,AAAkB,YAAY,OAAvBE,EACT,MAAM,OAAA,cAEL,CAFK,AAAIC,MACR,CAAC,2DAA2D,EAAE,OAAOD,EAAO;AAAA,oEAAuE,CAAC,EADhJ,oBAAA,OAAA,mBAAA,gBAAA,CAEN,EAEJ,CACF,0EATgBJ,2BAAAA,qCAAAA,8CCHhB,EAAA,EAAA,CAAA,CAAA,OAOA,IAAM,EAAgC,CACpC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EAAK,IAAS,CAAA,EAAA,EAAA,QAAQ,AAAR,EAAS,EAAK,EACrC,EAMM,EAA4C,CAChD,OAAQ,CAAC,qFAAqF,CAAC,GAC/F,MAAO,CAAC,oFAAoF,CAAC,CAC7F,MAAO,CAAC,wPAAwP,CAAC,EACnQ,CAEO,OAAM,EACH,IAAuB,AAE/B,aAAY,EAAkC,CAAC,CAAC,CAAE,CAChD,IAAI,CAAC,IAAI,CAAG,CAAE,GAAG,CAAW,CAAE,GAAG,CAAI,AAAC,CACxC,CAGA,YAA4B,CAC1B,OAAO,CAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAI,IAClD,CAOA,YAA4B,CAC1B,IAAM,EAAU,IAAI,CAAC,UAAU,GAC/B,GAAI,CAAC,EACH,MAAM,AAAI,CADE,KACI,CAAC,sBAAsB,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAA,CAAE,EAG/D,GAAI,CAEF,IAAM,EADS,AACC,IADG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAS,CAAE,SAAU,QAAS,QAAS,GAAO,GACrD,IAAI,GAC3B,OAAO,EAAQ,MAAM,CAAG,EAAI,EAAU,IACxC,CAAE,MAAO,EAAgB,OAEvB,GAAI,AASgB,UAAjB,OADY,AACL,EATM,GAQa,CACa,OAAV,GAAkB,WAAY,GATnB,GAAG,CAApB,EAAM,MAAM,CACpC,OAAO,IAET,OAAM,CACR,CACF,CACF,CCrDO,eAAe,IACpB,IAAM,EAAU,IAAI,EAEpB,GAAI,CAEF,MAAO,CAAE,KADI,EAAQ,UAAU,EACjB,CAChB,CAAE,MAAO,EAAgB,CAEvB,MAAO,CAAE,KAAM,KAAM,MADL,CACY,YADK,MAAQ,EAAM,OAAO,CAAG,8BACrB,CACtC,CACF,0CAVsB,IAAA,CAAA,EAAA,EAAA,uBAAA,EAAA,EAAA,6CAAA,8DCJtB,IAAA,EAAA,EAAA,CAAA,CAAA","ignoreList":[0,1]}
@@ -1,3 +1,3 @@
1
- module.exports=[60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},59975,a=>{a.n(a.i(72884))},63754,a=>{a.n(a.i(39838))},27075,a=>{a.n(a.i(26048))},37458,a=>{a.n(a.i(72330))},22672,a=>{a.n(a.i(41208))},32459,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(28478).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/presentation/web/components/features/version/version-page-client.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/presentation/web/components/features/version/version-page-client.tsx <module evaluation>","default")},93933,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(28478).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/presentation/web/components/features/version/version-page-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/presentation/web/components/features/version/version-page-client.tsx","default")},67651,a=>{"use strict";a.i(32459);var b=a.i(93933);a.n(b)},77048,a=>{"use strict";var b=a.i(92807),c=a.i(60526),d=a.i(67651);function e(){let a={nodeVersion:process.version,platform:(0,c.platform)(),arch:(0,c.arch)()};return(0,b.jsx)(d.default,{versionInfo:{version:"1.68.0",name:"@shepai/cli",description:"Autonomous AI Native SDLC Platform - Automate the development cycle from idea to deploy"},systemInfo:a})}a.s(["default",()=>e],77048)}];
1
+ module.exports=[60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},59975,a=>{a.n(a.i(72884))},63754,a=>{a.n(a.i(39838))},27075,a=>{a.n(a.i(26048))},37458,a=>{a.n(a.i(72330))},22672,a=>{a.n(a.i(41208))},32459,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(28478).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/presentation/web/components/features/version/version-page-client.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/presentation/web/components/features/version/version-page-client.tsx <module evaluation>","default")},93933,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(28478).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/presentation/web/components/features/version/version-page-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/presentation/web/components/features/version/version-page-client.tsx","default")},67651,a=>{"use strict";a.i(32459);var b=a.i(93933);a.n(b)},77048,a=>{"use strict";var b=a.i(92807),c=a.i(60526),d=a.i(67651);function e(){let a={nodeVersion:process.version,platform:(0,c.platform)(),arch:(0,c.arch)()};return(0,b.jsx)(d.default,{versionInfo:{version:"1.69.0",name:"@shepai/cli",description:"Autonomous AI Native SDLC Platform - Automate the development cycle from idea to deploy"},systemInfo:a})}a.s(["default",()=>e],77048)}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__249c74f6._.js.map
@@ -1,4 +1,4 @@
1
1
  module.exports=[74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},92658,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(28478)},12581,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
2
- Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"007904f92b37e3fb1ddaa8cf3b3331b5785965e1c9",null),a.s(["pickFolder",()=>g],12513)},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},96380,a=>{"use strict";function b(a){let b=globalThis.__shepContainer;if(!b)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return b.resolve(a)}a.s(["resolve",()=>b])},81719,a=>{"use strict";var b,c,d,e,f=((b={}).Todo="Todo",b.WIP="Work in Progress",b.Done="Done",b.Review="Review",b),g=((c={}).Started="Started",c.Analyze="Analyze",c.Requirements="Requirements",c.Research="Research",c.Planning="Planning",c.Implementation="Implementation",c.Review="Review",c.Maintain="Maintain",c.Blocked="Blocked",c),h=((d={}).Booting="Booting",d.Ready="Ready",d.Stopped="Stopped",d),i=((e={}).pending="pending",e.running="running",e.completed="completed",e.failed="failed",e.interrupted="interrupted",e.cancelled="cancelled",e.waitingApproval="waiting_approval",e);a.s(["AgentRunStatus",()=>i,"DeploymentState",()=>h,"SdlcLifecycle",()=>g,"TaskState",()=>f])},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},33841,29918,46646,68670,85321,a=>{"use strict";var b=a.i(92658),c=a.i(2157),d=a.i(96380),e=a.i(66680),f=a.i(50227);a.i(12714);var g=a.i(60526);function h(a,b){let c=(0,e.createHash)("sha256").update(a).digest("hex").slice(0,16),d=b.replace(/\//g,"-");return(0,f.join)(process.env.SHEP_HOME??(0,f.join)((0,g.homedir)(),".shep"),"repos",c,"wt",d)}a.s(["computeWorktreePath",()=>h],29918);var i=a.i(81719),j=a.i(12581);async function k(a){if(!a?.trim())return{success:!1,error:"featureId is required"};try{let b=(0,d.resolve)("IFeatureRepository"),e=await b.findById(a);if(!e)return{success:!1,error:`Feature not found: ${a}`};let f=h(e.repositoryPath,e.branch);if(!(0,c.existsSync)(f))return{success:!1,error:`Worktree path does not exist: ${f}`};return(0,d.resolve)("IDeploymentService").start(a,f),{success:!0,state:i.DeploymentState.Booting}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to deploy feature"}}}async function l(a){if(!a?.startsWith("/"))return{success:!1,error:"repositoryPath must be an absolute path"};try{if(!(0,c.existsSync)(a))return{success:!1,error:`Directory does not exist: ${a}`};return(0,d.resolve)("IDeploymentService").start(a,a),{success:!0,state:i.DeploymentState.Booting}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to deploy repository"}}}async function m(a){if(!a?.trim())return{success:!1,error:"targetId is required"};try{let b=(0,d.resolve)("IDeploymentService");return await b.stop(a),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to stop deployment"}}}async function n(a){return a?.trim()?(0,d.resolve)("IDeploymentService").getStatus(a):null}(0,j.ensureServerEntryExports)([k]),(0,b.registerServerReference)(k,"40091ac70dbece6329609e9da1410745b8e79a1978",null),a.s(["deployFeature",()=>k],33841),(0,j.ensureServerEntryExports)([l]),(0,b.registerServerReference)(l,"40ed5afaeb300463c182041f77eaa948fa86386a5c",null),a.s(["deployRepository",()=>l],46646),(0,j.ensureServerEntryExports)([m]),(0,b.registerServerReference)(m,"4046dda08e3ac125dd85a6e30729cf9ce5ff5fc9fc",null),a.s(["stopDeployment",()=>m],68670),(0,j.ensureServerEntryExports)([n]),(0,b.registerServerReference)(n,"400b1e92a6c3cb7d2e398f6b1fa858860eb0af1683",null),a.s(["getDeploymentStatus",()=>n],85321)},43368,a=>{"use strict";var b=a.i(12513),c=a.i(33841),d=a.i(46646),e=a.i(68670),f=a.i(85321);a.s([],43272),a.i(43272),a.s(["007904f92b37e3fb1ddaa8cf3b3331b5785965e1c9",()=>b.pickFolder,"40091ac70dbece6329609e9da1410745b8e79a1978",()=>c.deployFeature,"400b1e92a6c3cb7d2e398f6b1fa858860eb0af1683",()=>f.getDeploymentStatus,"4046dda08e3ac125dd85a6e30729cf9ce5ff5fc9fc",()=>e.stopDeployment,"40ed5afaeb300463c182041f77eaa948fa86386a5c",()=>d.deployRepository],43368)}];
2
+ Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},12513,a=>{"use strict";var b=a.i(92658),c=a.i(74533);let d={platform:process.platform,exec:(a,b)=>(0,c.execSync)(a,b)},e={darwin:"osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'",linux:'zenity --file-selection --directory --title="Select a repository folder" 2>/dev/null',win32:"powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\""};class f{deps;constructor(a={}){this.deps={...d,...a}}getCommand(){return e[this.deps.platform]??null}pickFolder(){let a=this.getCommand();if(!a)throw Error(`Unsupported platform: ${this.deps.platform}`);try{let b=this.deps.exec(a,{encoding:"utf-8",timeout:6e4}).trim();return b.length>0?b:null}catch(a){var b;if("object"==typeof(b=a)&&null!==b&&"status"in b&&1===a.status)return null;throw a}}}async function g(){let a=new f;try{return{path:a.pickFolder()}}catch(a){return{path:null,error:a instanceof Error?a.message:"Failed to open folder dialog"}}}(0,a.i(12581).ensureServerEntryExports)([g]),(0,b.registerServerReference)(g,"00be2fc10adebcfc2f426a24668679c45663250f3a",null),a.s(["pickFolder",()=>g],12513)},2157,(a,b,c)=>{b.exports=a.x("node:fs",()=>require("node:fs"))},96380,a=>{"use strict";function b(a){let b=globalThis.__shepContainer;if(!b)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return b.resolve(a)}a.s(["resolve",()=>b])},81719,a=>{"use strict";var b,c,d,e,f=((b={}).Todo="Todo",b.WIP="Work in Progress",b.Done="Done",b.Review="Review",b),g=((c={}).Started="Started",c.Analyze="Analyze",c.Requirements="Requirements",c.Research="Research",c.Planning="Planning",c.Implementation="Implementation",c.Review="Review",c.Maintain="Maintain",c.Blocked="Blocked",c),h=((d={}).Booting="Booting",d.Ready="Ready",d.Stopped="Stopped",d),i=((e={}).pending="pending",e.running="running",e.completed="completed",e.failed="failed",e.interrupted="interrupted",e.cancelled="cancelled",e.waitingApproval="waiting_approval",e);a.s(["AgentRunStatus",()=>i,"DeploymentState",()=>h,"SdlcLifecycle",()=>g,"TaskState",()=>f])},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},66680,(a,b,c)=>{b.exports=a.x("node:crypto",()=>require("node:crypto"))},33841,29918,46646,68670,85321,a=>{"use strict";var b=a.i(92658),c=a.i(2157),d=a.i(96380),e=a.i(66680),f=a.i(50227);a.i(12714);var g=a.i(60526);function h(a,b){let c=(0,e.createHash)("sha256").update(a).digest("hex").slice(0,16),d=b.replace(/\//g,"-");return(0,f.join)(process.env.SHEP_HOME??(0,f.join)((0,g.homedir)(),".shep"),"repos",c,"wt",d)}a.s(["computeWorktreePath",()=>h],29918);var i=a.i(81719),j=a.i(12581);async function k(a){if(!a?.trim())return{success:!1,error:"featureId is required"};try{let b=(0,d.resolve)("IFeatureRepository"),e=await b.findById(a);if(!e)return{success:!1,error:`Feature not found: ${a}`};let f=h(e.repositoryPath,e.branch);if(!(0,c.existsSync)(f))return{success:!1,error:`Worktree path does not exist: ${f}`};return(0,d.resolve)("IDeploymentService").start(a,f),{success:!0,state:i.DeploymentState.Booting}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to deploy feature"}}}async function l(a){if(!a?.startsWith("/"))return{success:!1,error:"repositoryPath must be an absolute path"};try{if(!(0,c.existsSync)(a))return{success:!1,error:`Directory does not exist: ${a}`};return(0,d.resolve)("IDeploymentService").start(a,a),{success:!0,state:i.DeploymentState.Booting}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to deploy repository"}}}async function m(a){if(!a?.trim())return{success:!1,error:"targetId is required"};try{let b=(0,d.resolve)("IDeploymentService");return await b.stop(a),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Failed to stop deployment"}}}async function n(a){return a?.trim()?(0,d.resolve)("IDeploymentService").getStatus(a):null}(0,j.ensureServerEntryExports)([k]),(0,b.registerServerReference)(k,"402688cf2b9feee0c53225056605d9e5a9f0f409e6",null),a.s(["deployFeature",()=>k],33841),(0,j.ensureServerEntryExports)([l]),(0,b.registerServerReference)(l,"40342cdffce744e263c8ea15e16f076ce9ff4eaa00",null),a.s(["deployRepository",()=>l],46646),(0,j.ensureServerEntryExports)([m]),(0,b.registerServerReference)(m,"4016a359d9c8578ef9ac7cf6942a02a39801fde73d",null),a.s(["stopDeployment",()=>m],68670),(0,j.ensureServerEntryExports)([n]),(0,b.registerServerReference)(n,"4053062518c8311a3874802bc886588bb58d6e3dd8",null),a.s(["getDeploymentStatus",()=>n],85321)},43368,a=>{"use strict";var b=a.i(12513),c=a.i(33841),d=a.i(46646),e=a.i(68670),f=a.i(85321);a.s([],43272),a.i(43272),a.s(["00be2fc10adebcfc2f426a24668679c45663250f3a",()=>b.pickFolder,"4016a359d9c8578ef9ac7cf6942a02a39801fde73d",()=>e.stopDeployment,"402688cf2b9feee0c53225056605d9e5a9f0f409e6",()=>c.deployFeature,"40342cdffce744e263c8ea15e16f076ce9ff4eaa00",()=>d.deployRepository,"4053062518c8311a3874802bc886588bb58d6e3dd8",()=>f.getDeploymentStatus],43368)}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__551fb7e1._.js.map