@jiggai/kitchen 0.3.9 → 0.3.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.
Files changed (200) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +2 -2
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +3 -3
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  15. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  20. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/goals/[id]/promote/route.js.nft.json +1 -1
  22. package/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/goals/route.js.nft.json +1 -1
  24. package/.next/server/app/api/recipes/[id]/route.js.nft.json +1 -1
  25. package/.next/server/app/api/recipes/clone/route.js.nft.json +1 -1
  26. package/.next/server/app/api/recipes/custom-team/route.js.nft.json +1 -1
  27. package/.next/server/app/api/recipes/delete/route.js.nft.json +1 -1
  28. package/.next/server/app/api/recipes/team-agents/route.js.nft.json +1 -1
  29. package/.next/server/app/api/scaffold/route.js.nft.json +1 -1
  30. package/.next/server/app/api/teams/[teamId]/tickets/assign/route.js.nft.json +1 -1
  31. package/.next/server/app/api/teams/[teamId]/tickets/comment/route.js.nft.json +1 -1
  32. package/.next/server/app/api/teams/[teamId]/tickets/delete/route.js.nft.json +1 -1
  33. package/.next/server/app/api/teams/[teamId]/tickets/move/route.js.nft.json +1 -1
  34. package/.next/server/app/api/teams/[teamId]/tickets/move-to-goals/route.js.nft.json +1 -1
  35. package/.next/server/app/api/teams/orchestrator/route.js.nft.json +1 -1
  36. package/.next/server/app/api/teams/remove-team/route.js.nft.json +1 -1
  37. package/.next/server/app/api/tickets/assign/route.js.nft.json +1 -1
  38. package/.next/server/app/api/tickets/assignees/route.js.nft.json +1 -1
  39. package/.next/server/app/api/tickets/move/route.js.nft.json +1 -1
  40. package/.next/server/app/channels/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/channels.html +2 -2
  42. package/.next/server/app/channels.rsc +4 -4
  43. package/.next/server/app/channels.segments/_full.segment.rsc +4 -4
  44. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  45. package/.next/server/app/channels.segments/_index.segment.rsc +3 -3
  46. package/.next/server/app/channels.segments/_tree.segment.rsc +2 -2
  47. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +2 -2
  48. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  49. package/.next/server/app/cron-jobs/page_client-reference-manifest.js +1 -1
  50. package/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/goals/new/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/goals/new.html +2 -2
  53. package/.next/server/app/goals/new.rsc +4 -4
  54. package/.next/server/app/goals/new.segments/_full.segment.rsc +4 -4
  55. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/goals/new.segments/_index.segment.rsc +3 -3
  57. package/.next/server/app/goals/new.segments/_tree.segment.rsc +2 -2
  58. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +2 -2
  59. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  60. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  61. package/.next/server/app/goals/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/goals.html +1 -1
  63. package/.next/server/app/goals.rsc +4 -4
  64. package/.next/server/app/goals.segments/_full.segment.rsc +4 -4
  65. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  66. package/.next/server/app/goals.segments/_index.segment.rsc +3 -3
  67. package/.next/server/app/goals.segments/_tree.segment.rsc +2 -2
  68. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +2 -2
  69. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  70. package/.next/server/app/page.js +2 -2
  71. package/.next/server/app/page.js.nft.json +1 -1
  72. package/.next/server/app/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/recipes/[id]/page.js +3 -3
  74. package/.next/server/app/recipes/[id]/page.js.nft.json +1 -1
  75. package/.next/server/app/recipes/[id]/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app/recipes/page.js +2 -2
  77. package/.next/server/app/recipes/page.js.nft.json +1 -1
  78. package/.next/server/app/recipes/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/runs/page.js +3 -3
  80. package/.next/server/app/runs/page.js.nft.json +1 -1
  81. package/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  82. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/settings.html +1 -1
  84. package/.next/server/app/settings.rsc +4 -4
  85. package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  86. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  87. package/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  88. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  89. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  90. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  91. package/.next/server/app/teams/[teamId]/page.js +3 -3
  92. package/.next/server/app/teams/[teamId]/page.js.nft.json +1 -1
  93. package/.next/server/app/teams/[teamId]/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page.js +2 -2
  95. package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page.js.nft.json +1 -1
  96. package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app/teams/[teamId]/runs/page_client-reference-manifest.js +1 -1
  98. package/.next/server/app/teams/[teamId]/tickets/[ticket]/page.js.nft.json +1 -1
  99. package/.next/server/app/teams/[teamId]/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  100. package/.next/server/app/teams/[teamId]/tickets/page.js.nft.json +1 -1
  101. package/.next/server/app/teams/[teamId]/tickets/page_client-reference-manifest.js +1 -1
  102. package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js +3 -3
  103. package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js.nft.json +1 -1
  104. package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/teams/[teamId]/workflows/page.js +3 -3
  106. package/.next/server/app/teams/[teamId]/workflows/page.js.nft.json +1 -1
  107. package/.next/server/app/teams/[teamId]/workflows/page_client-reference-manifest.js +1 -1
  108. package/.next/server/app/tickets/[ticket]/page.js.nft.json +1 -1
  109. package/.next/server/app/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/tickets/page.js.nft.json +1 -1
  111. package/.next/server/app/tickets/page_client-reference-manifest.js +1 -1
  112. package/.next/server/chunks/[root-of-the-server]__ff69832c._.js.map +1 -1
  113. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js +1 -1
  114. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js.map +1 -1
  115. package/.next/server/chunks/ssr/[root-of-the-server]__24c20736._.js +3 -0
  116. package/.next/server/chunks/ssr/[root-of-the-server]__24c20736._.js.map +1 -0
  117. package/.next/server/chunks/ssr/[root-of-the-server]__30619465._.js +3 -0
  118. package/.next/server/chunks/ssr/[root-of-the-server]__30619465._.js.map +1 -0
  119. package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js +1 -1
  120. package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js.map +1 -1
  121. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js +1 -1
  122. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js.map +1 -1
  123. package/.next/server/chunks/ssr/[root-of-the-server]__4981f370._.js +3 -0
  124. package/.next/server/chunks/ssr/[root-of-the-server]__4981f370._.js.map +1 -0
  125. package/.next/server/chunks/ssr/[root-of-the-server]__4c66998a._.js +3 -0
  126. package/.next/server/chunks/ssr/[root-of-the-server]__4c66998a._.js.map +1 -0
  127. package/.next/server/chunks/ssr/[root-of-the-server]__7fcc6175._.js +3 -0
  128. package/.next/server/chunks/ssr/[root-of-the-server]__7fcc6175._.js.map +1 -0
  129. package/.next/server/chunks/ssr/[root-of-the-server]__8e001110._.js +3 -0
  130. package/.next/server/chunks/ssr/[root-of-the-server]__8e001110._.js.map +1 -0
  131. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js +1 -1
  132. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js.map +1 -1
  133. package/.next/server/chunks/ssr/[root-of-the-server]__ad4e8478._.js +3 -0
  134. package/.next/server/chunks/ssr/[root-of-the-server]__ad4e8478._.js.map +1 -0
  135. package/.next/server/chunks/ssr/[root-of-the-server]__bd20cf10._.js +3 -0
  136. package/.next/server/chunks/ssr/[root-of-the-server]__bd20cf10._.js.map +1 -0
  137. package/.next/server/chunks/ssr/[root-of-the-server]__cefae8c8._.js +3 -0
  138. package/.next/server/chunks/ssr/[root-of-the-server]__cefae8c8._.js.map +1 -0
  139. package/.next/server/chunks/ssr/{node_modules_next_10fb6ad9._.js → _7f9e89d2._.js} +2 -2
  140. package/.next/server/chunks/ssr/_7f9e89d2._.js.map +1 -0
  141. package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js +1 -1
  142. package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js.map +1 -1
  143. package/.next/server/chunks/ssr/src_59477309._.js +1 -1
  144. package/.next/server/chunks/ssr/src_59477309._.js.map +1 -1
  145. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js +1 -1
  146. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js.map +1 -1
  147. package/.next/server/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js +3 -0
  148. package/.next/server/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js.map +1 -0
  149. package/.next/server/chunks/ssr/src_lib_errors_ts_f440efeb._.js +3 -0
  150. package/.next/server/chunks/ssr/src_lib_errors_ts_f440efeb._.js.map +1 -0
  151. package/.next/server/pages/404.html +1 -1
  152. package/.next/server/pages/500.html +2 -2
  153. package/.next/server/server-reference-manifest.js +1 -1
  154. package/.next/server/server-reference-manifest.json +1 -1
  155. package/.next/static/chunks/3e0d3a43014c0ad2.css +3 -0
  156. package/.next/static/chunks/43d0024279c6160e.js +1 -0
  157. package/.next/static/chunks/4f5e02a609758a0b.js +1 -0
  158. package/.next/static/chunks/5e3b1d0f61a651bf.js +1 -0
  159. package/.next/static/chunks/5f77499ca309ab9d.js +10 -0
  160. package/.next/static/chunks/be12a66bd736fad8.js +1 -0
  161. package/.next/static/chunks/{b28737d6a10af30d.js → ecdc9465f0e4d954.js} +1 -1
  162. package/README.md +6 -5
  163. package/openclaw.plugin.json +1 -1
  164. package/package.json +1 -1
  165. package/public/images/clawkitchen/home.png +0 -0
  166. package/public/images/clawkitchen/recipes.png +0 -0
  167. package/public/images/clawkitchen/runs.png +0 -0
  168. package/public/images/clawkitchen/team.png +0 -0
  169. package/public/images/clawkitchen/tickets.png +0 -0
  170. package/public/images/clawkitchen/workflows.png +0 -0
  171. package/.next/server/chunks/ssr/[root-of-the-server]__1d65fddf._.js +0 -3
  172. package/.next/server/chunks/ssr/[root-of-the-server]__1d65fddf._.js.map +0 -1
  173. package/.next/server/chunks/ssr/[root-of-the-server]__450d6006._.js +0 -3
  174. package/.next/server/chunks/ssr/[root-of-the-server]__450d6006._.js.map +0 -1
  175. package/.next/server/chunks/ssr/[root-of-the-server]__76f9757d._.js +0 -3
  176. package/.next/server/chunks/ssr/[root-of-the-server]__76f9757d._.js.map +0 -1
  177. package/.next/server/chunks/ssr/[root-of-the-server]__9ffebe91._.js +0 -3
  178. package/.next/server/chunks/ssr/[root-of-the-server]__9ffebe91._.js.map +0 -1
  179. package/.next/server/chunks/ssr/[root-of-the-server]__a26db919._.js +0 -3
  180. package/.next/server/chunks/ssr/[root-of-the-server]__a26db919._.js.map +0 -1
  181. package/.next/server/chunks/ssr/[root-of-the-server]__afaa71fe._.js +0 -3
  182. package/.next/server/chunks/ssr/[root-of-the-server]__afaa71fe._.js.map +0 -1
  183. package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js +0 -3
  184. package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js.map +0 -1
  185. package/.next/server/chunks/ssr/[root-of-the-server]__e94ab521._.js +0 -3
  186. package/.next/server/chunks/ssr/[root-of-the-server]__e94ab521._.js.map +0 -1
  187. package/.next/server/chunks/ssr/[root-of-the-server]__fb6781d4._.js +0 -3
  188. package/.next/server/chunks/ssr/[root-of-the-server]__fb6781d4._.js.map +0 -1
  189. package/.next/server/chunks/ssr/node_modules_next_10fb6ad9._.js.map +0 -1
  190. package/.next/server/chunks/ssr/src_e54f24fb._.js +0 -3
  191. package/.next/server/chunks/ssr/src_e54f24fb._.js.map +0 -1
  192. package/.next/static/chunks/42b3230688d0834c.js +0 -1
  193. package/.next/static/chunks/635adeaf329f2446.js +0 -1
  194. package/.next/static/chunks/6427cd3eaffdd572.js +0 -10
  195. package/.next/static/chunks/be874907adf946fd.js +0 -1
  196. package/.next/static/chunks/cfe32a0bce2eab2b.css +0 -3
  197. package/.next/static/chunks/e397a21bf5f13650.js +0 -1
  198. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → pW5SAQ1dzPcsq_66yy5po}/_buildManifest.js +0 -0
  199. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → pW5SAQ1dzPcsq_66yy5po}/_clientMiddlewareManifest.json +0 -0
  200. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → pW5SAQ1dzPcsq_66yy5po}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/next/dist/client/app-dir/link.js/__nextjs-internal-proxy.cjs","../../../../node_modules/next/src/client/app-dir/link.tsx","../../../../node_modules/next/src/client/app-dir/link.react-server.tsx","../../../../src/app/recipes/%5Bid%5D/RecipeEditor/index.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/recipes/%5Bid%5D/page.tsx"],"sourcesContent":["// This file is generated by next-core EcmascriptClientReferenceModule.\nconst { createClientModuleProxy } = require(\"react-server-dom-turbopack/server\");\n\n__turbopack_context__.n(createClientModuleProxy(\"[project]/node_modules/next/dist/client/app-dir/link.js\"));\n","'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport { errorOnce } from '../../shared/lib/utils/error-once'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n as: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n as || href,\n replace ? 'replace' : 'push',\n scroll ?? true,\n linkInstanceRef.current\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof hrefProp === 'string') {\n href = hrefProp\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }, [hrefProp, asProp])\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n href,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [prefetchEnabled, href, router, fetchStrategy, setOptimisticLinkStatus]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(e, href, as, linkInstanceRef, replace, scroll, onNavigate)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(as)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n","import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport default registerClientReference(\n function() { throw new Error(\"Attempted to call the default export of [project]/src/app/recipes/[id]/RecipeEditor/index.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.\"); },\n \"[project]/src/app/recipes/[id]/RecipeEditor/index.tsx\",\n \"default\",\n);\n","import Link from \"next/link\";\nimport { unstable_noStore as noStore } from \"next/cache\";\n\nimport { listRecipes } from \"@/lib/recipes\";\nimport RecipeEditor from \"./RecipeEditor\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\n\nasync function getKind(id: string): Promise<\"agent\" | \"team\" | null> {\n const recipes = await listRecipes();\n return recipes.find((r) => r.id === id)?.kind ?? null;\n}\n\nexport default async function RecipePage({ params }: { params: Promise<{ id: string }> }) {\n noStore();\n\n const { id } = await params;\n await getKind(id); // Resolved for future redirect logic; kept for cache consistency\n\n // NOTE: We do NOT redirect team recipes to /teams/<id>.\n // /recipes/<id> is the recipe editor/preview surface; /teams/<id> is the installed team editor.\n\n return (\n <main className=\"min-h-screen p-8\">\n <div className=\"mx-auto mb-4 max-w-6xl\">\n <Link\n href=\"/recipes\"\n className=\"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]\"\n >\n ← Back to recipes\n </Link>\n </div>\n <RecipeEditor recipeId={id} />\n </main>\n );\n}\n"],"names":["LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","as","linkInstanceRef","replace","scroll","onNavigate","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","useMemo","resolvedHref","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","undefined","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext","__NEXT_CACHE_COMPONENTS","Full","isLegacyBehavior","childIsHostComponent","childIsClientComponent","error","ClientLinkComponent"],"mappings":"6yBACA,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,iGAFhD,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,2MEAhD,OAyBC,CAAA,kBAzBuBA,GA2BCC,aAAa,CAAA,kBAAbA,EAAAA,aAAa,2GA7B6B,CAAA,CAAA,IAAA,IAEpD,SAASD,EACtBuC,CAAiD,EAEjD,IAAMkG,EAAmBlG,EAAMmB,cAAc,CACvCgF,EACsB,UAA1B,OAAOnG,EAAMK,QAAQ,EACK,UAA1B,OAAOL,EAAMK,QAAQ,EACrB,AAAyC,iBAAjCL,EAAMK,QAAQ,EAAUkE,KAC5B6B,EACHpG,EAAMK,QAAQ,EAAUkE,MAAMR,WAC/BC,OAAOC,GAAG,CAAC,0BAcb,OAZIiC,AAYJ,GAZyBC,GAAyBC,IAC3CpG,CAWP,CAXaK,QADW,AACH,EAAUkE,KADkB,CACZR,EADqC,SACxBC,OAAOC,GAAG,CAAC,cACzDC,CADwE,OAChEmC,KAAK,CACX,CAAC,8NAGHnC,CAHkO,CAAC,MAG3NmC,KAAK,CACX,CAAC,2MAKA,AAL2M,CAK3M,AAL4M,EAK5M,EAAA,GAAA,EAACC,EAAAA,OAAmB,CAAA,CAAE,GAAGtG,CAAK,EACvC,6QC1Be,CAAA,EADf,AACe,EADf,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,6SAA+S,EAC5U,4EACA,gEAHW,CAAA,EADf,AACe,EADf,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,yRAA2R,EACxT,wDACA,8GCLJ,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAKA,eAAe,EAAQ,CAAU,EAC/B,IAAM,EAAU,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,IACjC,OAAO,EAAQ,IAAI,CAAC,AAAC,GAAM,EAAE,EAAE,GAAK,IAAK,MAAQ,IACnD,CAEe,eAAe,EAAW,QAAE,CAAM,CAAuC,EACtF,CAAA,EAAA,EAAA,gBAAA,AAAO,IAEP,GAAM,IAAE,CAAE,CAAE,CAAG,MAAM,EAMrB,OALA,MAAM,EAAQ,GAMZ,CAAA,CANiB,CAMjB,EAAA,IAAA,EAAC,OAAA,CAAK,UAAU,6BACd,CAAA,EAAA,EAAA,GAAA,CAPgF,CAO/E,MAAA,CAAI,UAAU,kCACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAI,CAAA,CACH,KAAK,WACL,UAAU,iIACX,wBAIH,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAY,CAAA,CAAC,SAAU,MAG9B,kCA9BuB,+BACG","ignoreList":[0,2,3]}
@@ -1,3 +1,3 @@
1
- module.exports=[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"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},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"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},37941,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);function e(a){return a.includes("/")||a.includes("\\")}function f(a,b="development-team"){let g=e(b)?b:function(a){if(!/^[a-z0-9][a-z0-9-]{1,63}$/.test(a))throw Error(`Invalid teamId "${a}"`);return d.default.join(c.default.homedir(),".openclaw",`workspace-${a}`)}(b);return d.default.join(g,{backlog:"work/backlog","in-progress":"work/in-progress",testing:"work/testing",done:"work/done"}[a])}async function g(a="development-team"){let c,h=e(a)?(c=d.default.basename(a)).startsWith("workspace-")?c.slice(10):c:a,i=[];for(let c of["backlog","in-progress","testing","done"]){let e=[];try{e=await b.default.readdir(f(c,a))}catch{e=[]}for(let g of e){if(!g.endsWith(".md"))continue;let e=function(a){let b=a.match(/^(\d{4})-/);return b?Number(b[1]):null}(g);if(null==e)continue;let j=d.default.join(f(c,a),g),[k,l]=await Promise.all([b.default.readFile(j,"utf8"),b.default.stat(j)]),m=function(a){let b=a.split("\n")[0]??"",c=b.startsWith("# ")?b.slice(2).trim():"",d=c.indexOf(" ");if(d>0){let a=c.slice(d+1).trim();if(a)return a}let e=c.replace(/^\d{4}-/,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),f=new Set(["api","cli","ui","ux","gpu","cpu","npm","pr","ci","cd","json","yaml","md"]),g=e?e.split(" ").filter(Boolean).map(a=>{let b=a.toLowerCase();return f.has(b)?a.toUpperCase():b.startsWith("v")&&/^\d/.test(b.slice(1))||/^[\d.]+$/.test(a)?a:a.slice(0,1).toUpperCase()+a.slice(1)}).join(" "):"";return g||c||"(untitled)"}(k),n=function(a,b){let c=RegExp(`^${b}:\\s*(.*)$`,"mi"),d=a.match(c);return d?.[1]?.trim()||null}(k,"Owner"),o=l.mtime.toISOString(),p=(Date.now()-l.mtimeMs)/36e5;i.push({teamId:h,number:e,id:g.replace(/\.md$/,""),title:m,owner:n,stage:c,file:j,updatedAt:o,ageHours:p})}}return i.sort((a,b)=>a.number-b.number),i}async function h(a,b="development-team"){let c=await g(b),d=a.trim(),e=d.match(/^\d+$/)?c.find(a=>a.number===Number(d)):null;return c.find(a=>a.id===d)??e??null}async function i(a,c){let d=await h(c,a);return d?{teamId:d.teamId,id:d.id,file:d.file,markdown:await b.default.readFile(d.file,"utf8"),owner:d.owner,stage:d.stage}:null}a.s(["getTicketMarkdown",()=>i,"listTickets",()=>g])},65892,a=>{"use strict";a.s(["TicketDetailClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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/app/tickets/TicketDetailClient.tsx <module evaluation>","TicketDetailClient")},95433,a=>{"use strict";a.s(["TicketDetailClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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/app/tickets/TicketDetailClient.tsx","TicketDetailClient")},18192,a=>{"use strict";a.i(65892);var b=a.i(95433);a.n(b)},44612,a=>{"use strict";var b=a.i(7997),c=a.i(18192),d=a.i(37941);async function e({params:a}){let{teamId:e,ticket:f}=await a,g=await (0,d.getTicketMarkdown)(e,f);return g?(0,b.jsx)(c.TicketDetailClient,{teamId:e,ticketId:g.id,file:g.file,markdown:g.markdown,backHref:`/teams/${encodeURIComponent(e)}/tickets`,currentOwner:g.owner}):(0,b.jsxs)("div",{className:"ck-glass p-6",children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Ticket not found"}),(0,b.jsxs)("p",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:["Couldn’t locate “",f,"” in backlog/in-progress/testing/done for team “",e,"”."]})]})}a.s(["default",()=>e,"dynamic",0,"force-dynamic"])}];
1
+ module.exports=[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"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},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"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},37941,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);function e(a){return a.includes("/")||a.includes("\\")}function f(a,b="development-team"){let g=e(b)?b:function(a){if(!/^[a-z0-9][a-z0-9-]{1,63}$/.test(a))throw Error(`Invalid teamId "${a}"`);return d.default.join(c.default.homedir(),".openclaw",`workspace-${a}`)}(b);return d.default.join(g,{backlog:"work/backlog","in-progress":"work/in-progress",testing:"work/testing",done:"work/done"}[a])}async function g(a="development-team"){let c,h=e(a)?(c=d.default.basename(a)).startsWith("workspace-")?c.slice(10):c:a,i=[];for(let c of["backlog","in-progress","testing","done"]){let e=[];try{e=await b.default.readdir(f(c,a))}catch{e=[]}for(let g of e){if(!g.endsWith(".md"))continue;let e=function(a){let b=a.match(/^(\d{4})-/);return b?Number(b[1]):null}(g);if(null==e)continue;let j=d.default.join(f(c,a),g),[k,l]=await Promise.all([b.default.readFile(j,"utf8"),b.default.stat(j)]),m=function(a){let b=a.split("\n")[0]??"",c=b.startsWith("# ")?b.slice(2).trim():"",d=c.indexOf(" ");if(d>0){let a=c.slice(d+1).trim();if(a)return a}let e=c.replace(/^\d{4}-/,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),f=new Set(["api","cli","ui","ux","gpu","cpu","npm","pr","ci","cd","json","yaml","md"]),g=e?e.split(" ").filter(Boolean).map(a=>{let b=a.toLowerCase();return f.has(b)?a.toUpperCase():b.startsWith("v")&&/^\d/.test(b.slice(1))||/^[\d.]+$/.test(a)?a:a.slice(0,1).toUpperCase()+a.slice(1)}).join(" "):"";return g||c||"(untitled)"}(k),n=function(a,b){let c=RegExp(`^${b}:\\s*(.*)$`,"mi"),d=a.match(c);return d?.[1]?.trim()||null}(k,"Owner"),o=l.mtime.toISOString(),p=(Date.now()-l.mtimeMs)/36e5;i.push({teamId:h,number:e,id:g.replace(/\.md$/,""),title:m,owner:n,stage:c,file:j,updatedAt:o,ageHours:p})}}return i.sort((a,b)=>a.number-b.number),i}async function h(a,b="development-team"){let c=await g(b),d=a.trim(),e=d.match(/^\d+$/)?c.find(a=>a.number===Number(d)):null;return c.find(a=>a.id===d)??e??null}async function i(a,c){let d=await h(c,a);return d?{teamId:d.teamId,id:d.id,file:d.file,markdown:await b.default.readFile(d.file,"utf8"),owner:d.owner,stage:d.stage}:null}a.s(["getTicketMarkdown",()=>i,"listTickets",()=>g])},65892,a=>{"use strict";a.s(["TicketDetailClient",()=>c,"isPostCommentDisabled",()=>d]);var b=a.i(11857);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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/app/tickets/TicketDetailClient.tsx <module evaluation>","TicketDetailClient"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call isPostCommentDisabled() from the server but isPostCommentDisabled is 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/app/tickets/TicketDetailClient.tsx <module evaluation>","isPostCommentDisabled")},95433,a=>{"use strict";a.s(["TicketDetailClient",()=>c,"isPostCommentDisabled",()=>d]);var b=a.i(11857);let c=(0,b.registerClientReference)(function(){throw Error("Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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/app/tickets/TicketDetailClient.tsx","TicketDetailClient"),d=(0,b.registerClientReference)(function(){throw Error("Attempted to call isPostCommentDisabled() from the server but isPostCommentDisabled is 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/app/tickets/TicketDetailClient.tsx","isPostCommentDisabled")},18192,a=>{"use strict";a.i(65892);var b=a.i(95433);a.n(b)},44612,a=>{"use strict";var b=a.i(7997),c=a.i(18192),d=a.i(37941);async function e({params:a}){let{teamId:e,ticket:f}=await a,g=await (0,d.getTicketMarkdown)(e,f);return g?(0,b.jsx)(c.TicketDetailClient,{teamId:e,ticketId:g.id,file:g.file,markdown:g.markdown,stage:g.stage,backHref:`/teams/${encodeURIComponent(e)}/tickets`,currentOwner:g.owner}):(0,b.jsxs)("div",{className:"ck-glass p-6",children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Ticket not found"}),(0,b.jsxs)("p",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:["Couldn’t locate “",f,"” in backlog/in-progress/testing/done for team “",e,"”."]})]})}a.s(["default",()=>e,"dynamic",0,"force-dynamic"])}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__9a7d79aa._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/tickets.ts","../../../../src/app/tickets/TicketDetailClient.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/tickets/%5Bticket%5D/page.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nexport type TicketStage = \"backlog\" | \"in-progress\" | \"testing\" | \"done\";\n\nexport interface TicketSummary {\n teamId: string;\n number: number;\n id: string;\n title: string;\n owner: string | null;\n stage: TicketStage;\n file: string;\n updatedAt: string; // ISO\n ageHours: number;\n}\n\nfunction assertSafeTeamId(teamId: string) {\n // Conservative: matches OpenClaw team ids like \"development-team\".\n if (!/^[a-z0-9][a-z0-9-]{1,63}$/.test(teamId)) {\n throw new Error(`Invalid teamId \"${teamId}\"`);\n }\n}\n\nfunction isPathLike(s: string) {\n return s.includes(\"/\") || s.includes(\"\\\\\");\n}\n\nexport function teamWorkspace(teamId: string) {\n assertSafeTeamId(teamId);\n return path.join(os.homedir(), \".openclaw\", `workspace-${teamId}`);\n}\n\n/**\n * Back-compat helper for older non-team-scoped code paths.\n * Prefer passing explicit teamId into APIs instead.\n */\nexport function getTeamWorkspaceDir(teamId?: string): string {\n if (teamId) return teamWorkspace(teamId);\n return process.env.CK_TEAM_WORKSPACE_DIR ?? teamWorkspace(process.env.CK_TEAM_ID ?? \"development-team\");\n}\n\nexport function stageDir(stage: TicketStage, teamIdOrDir: string = \"development-team\") {\n const map: Record<TicketStage, string> = {\n backlog: \"work/backlog\",\n \"in-progress\": \"work/in-progress\",\n testing: \"work/testing\",\n done: \"work/done\",\n };\n\n const base = isPathLike(teamIdOrDir) ? teamIdOrDir : teamWorkspace(teamIdOrDir);\n return path.join(base, map[stage]);\n}\n\nexport function parseTitle(md: string) {\n // Ticket markdown files typically start with: # 0033-some-slug\n const firstLine = md.split(\"\\n\")[0] ?? \"\";\n const header = firstLine.startsWith(\"# \") ? firstLine.slice(2).trim() : \"\";\n\n // If header is like: \"<id> <title...>\" keep the explicit title portion.\n const firstSpace = header.indexOf(\" \");\n if (firstSpace > 0) {\n const afterSpace = header.slice(firstSpace + 1).trim();\n if (afterSpace) return afterSpace;\n }\n\n // Otherwise derive from the slug: strip leading number + hyphen, then de-kebab.\n const derivedRaw = header\n .replace(/^\\d{4}-/, \"\")\n .replace(/[-_]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n\n const ACRONYMS = new Set([\"api\", \"cli\", \"ui\", \"ux\", \"gpu\", \"cpu\", \"npm\", \"pr\", \"ci\", \"cd\", \"json\", \"yaml\", \"md\"]);\n const titleCase = (s: string) =>\n s\n .split(\" \")\n .filter(Boolean)\n .map((w) => {\n const lower = w.toLowerCase();\n if (ACRONYMS.has(lower)) return w.toUpperCase();\n if (lower.startsWith(\"v\") && /^\\d/.test(lower.slice(1))) return w; // version-like\n if (/^[\\d.]+$/.test(w)) return w; // numbers/semver\n return w.slice(0, 1).toUpperCase() + w.slice(1);\n })\n .join(\" \");\n\n const derived = derivedRaw ? titleCase(derivedRaw) : \"\";\n\n if (derived) return derived;\n return header || \"(untitled)\";\n}\n\nfunction parseField(md: string, field: string): string | null {\n const re = new RegExp(`^${field}:\\\\s*(.*)$`, \"mi\");\n const m = md.match(re);\n return m?.[1]?.trim() || null;\n}\n\nexport function parseNumberFromFilename(filename: string): number | null {\n const m = filename.match(/^(\\d{4})-/);\n if (!m) return null;\n return Number(m[1]);\n}\n\nfunction teamIdFromTeamDir(teamDir: string): string {\n const base = path.basename(teamDir);\n if (base.startsWith(\"workspace-\")) return base.slice(\"workspace-\".length);\n return base;\n}\n\nexport async function discoverTeamIds(): Promise<string[]> {\n // Convention: ~/.openclaw/workspace-<teamId>\n const root = path.join(os.homedir(), \".openclaw\");\n let entries: string[] = [];\n try {\n entries = await fs.readdir(root);\n } catch {\n return [];\n }\n\n return entries\n .filter((e) => e.startsWith(\"workspace-\"))\n .map((e) => e.slice(\"workspace-\".length))\n .filter((id) => Boolean(id) && id !== \"workspace\")\n .sort();\n}\n\n/**\n * List tickets for a specific team (recommended).\n * - listTickets(\"development-team\")\n * - listTickets(teamWorkspaceDir)\n */\nexport async function listTickets(teamIdOrDir: string = \"development-team\"): Promise<TicketSummary[]> {\n const teamId = isPathLike(teamIdOrDir) ? teamIdFromTeamDir(teamIdOrDir) : teamIdOrDir;\n const stages: TicketStage[] = [\"backlog\", \"in-progress\", \"testing\", \"done\"];\n const all: TicketSummary[] = [];\n\n for (const stage of stages) {\n let files: string[] = [];\n try {\n files = await fs.readdir(stageDir(stage, teamIdOrDir));\n } catch {\n files = [];\n }\n\n for (const f of files) {\n if (!f.endsWith(\".md\")) continue;\n const number = parseNumberFromFilename(f);\n if (number == null) continue;\n\n const file = path.join(stageDir(stage, teamIdOrDir), f);\n const [md, stat] = await Promise.all([fs.readFile(file, \"utf8\"), fs.stat(file)]);\n\n const title = parseTitle(md);\n const owner = parseField(md, \"Owner\");\n const updatedAt = stat.mtime.toISOString();\n const ageHours = (Date.now() - stat.mtimeMs) / (1000 * 60 * 60);\n\n all.push({\n teamId,\n number,\n id: f.replace(/\\.md$/, \"\"),\n title,\n owner,\n stage,\n file,\n updatedAt,\n ageHours,\n });\n }\n }\n\n all.sort((a, b) => a.number - b.number);\n return all;\n}\n\n/**\n * List tickets across all discovered teams (used for /tickets?team=all).\n */\nexport async function listAllTeamsTickets(): Promise<TicketSummary[]> {\n const teamIds = await discoverTeamIds();\n const all: TicketSummary[] = [];\n\n for (const teamId of teamIds) {\n all.push(...(await listTickets(teamId)));\n }\n\n all.sort((a, b) => (a.teamId === b.teamId ? a.number - b.number : a.teamId.localeCompare(b.teamId)));\n return all;\n}\n\n/**\n * Back-compat helper used by some API routes.\n */\nexport async function getTicketByIdOrNumber(ticketIdOrNumber: string, teamIdOrDir: string = \"development-team\") {\n const tickets = await listTickets(teamIdOrDir);\n const normalized = ticketIdOrNumber.trim();\n\n const byNumber = normalized.match(/^\\d+$/) ? tickets.find((t) => t.number === Number(normalized)) : null;\n const byId = tickets.find((t) => t.id === normalized);\n return byId ?? byNumber ?? null;\n}\n\nexport async function resolveTicket(teamId: string, ticketIdOrNumber: string): Promise<TicketSummary | null> {\n return getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n}\n\n/**\n * getTicketMarkdown(teamId, ticketIdOrNumber)\n */\nexport async function getTicketMarkdown(\n teamId: string,\n ticketIdOrNumber: string,\n): Promise<{ teamId: string; id: string; file: string; markdown: string; owner: string | null; stage: TicketStage } | null> {\n const hit = await getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n if (!hit) return null;\n\n return {\n teamId: hit.teamId,\n id: hit.id,\n file: hit.file,\n markdown: await fs.readFile(hit.file, \"utf8\"),\n owner: hit.owner,\n stage: hit.stage,\n };\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const TicketDetailClient = registerClientReference(\n function() { throw new Error(\"Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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.\"); },\n \"[project]/src/app/tickets/TicketDetailClient.tsx\",\n \"TicketDetailClient\",\n);\n","import { TicketDetailClient } from \"@/app/tickets/TicketDetailClient\";\nimport { getTicketMarkdown } from \"@/lib/tickets\";\n\nexport const dynamic = \"force-dynamic\";\n\nexport default async function TeamTicketDetailPage({\n params,\n}: {\n params: Promise<{ teamId: string; ticket: string }>;\n}) {\n const { teamId, ticket } = await params;\n const data = await getTicketMarkdown(teamId, ticket);\n\n if (!data) {\n return (\n <div className=\"ck-glass p-6\">\n <h1 className=\"text-xl font-semibold tracking-tight\">Ticket not found</h1>\n <p className=\"mt-3 text-sm text-[color:var(--ck-text-secondary)]\">\n Couldn’t locate “{ticket}” in backlog/in-progress/testing/done for team “{teamId}”.\n </p>\n </div>\n );\n }\n\n return (\n <TicketDetailClient\n teamId={teamId}\n ticketId={data.id}\n file={data.file}\n markdown={data.markdown}\n backHref={`/teams/${encodeURIComponent(teamId)}/tickets`}\n currentOwner={data.owner}\n />\n );\n}\n"],"names":[],"mappings":"6hBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAuBA,SAAS,EAAW,CAAS,EAC3B,OAAO,EAAE,QAAQ,CAAC,MAAQ,EAAE,QAAQ,CAAC,KACvC,CAgBO,SAAS,EAAS,CAAkB,CAAE,EAAsB,kBAAkB,EAQnF,IAAM,EAAO,EAAW,GAAe,EAAc,AAtBhD,SAAS,AAAc,CAAc,EAT1C,GAAI,CAAC,4BAA4B,IAAI,CAUpB,AAVqB,GACpC,MAD6C,AACvC,AAAI,MAAM,CAAC,gBAAgB,EAAE,EAAO,CAAC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AE,CAAM,QAAE,CAAM,CAAE,CAAG,MAAM,EAC3B,EAAO,MAAM,CAAA,EAAA,EAAA,iBAAA,AAAiB,EAAC,EAAQ,UAE7C,AAAK,EAYH,CAAA,CAZE,CAYF,CAZS,CAYT,GAAA,EAAC,EAAA,kBAAkB,CAAA,CACjB,OAAQ,EACR,SAAU,EAAK,EAAE,CACjB,KAAM,EAAK,IAAI,CACf,SAAU,EAAK,QAAQ,CACvB,SAAU,CAAC,OAAO,EAAE,mBAAmB,GAAQ,QAAQ,CAAC,CACxD,aAAc,EAAK,KAAK,GAhBxB,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,yBACb,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,gDAAuC,qBACrD,CAAA,EAAA,EAAA,IAAA,EAAC,IAAA,CAAE,UAAU,+DAAqD,oBAC9C,EAAO,mDAAiD,EAAO,UAgB3F,kCA/BuB","ignoreList":[1]}
1
+ {"version":3,"sources":["../../../../src/lib/tickets.ts","../../../../src/app/tickets/TicketDetailClient.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/tickets/%5Bticket%5D/page.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nexport type TicketStage = \"backlog\" | \"in-progress\" | \"testing\" | \"done\";\n\nexport interface TicketSummary {\n teamId: string;\n number: number;\n id: string;\n title: string;\n owner: string | null;\n stage: TicketStage;\n file: string;\n updatedAt: string; // ISO\n ageHours: number;\n}\n\nfunction assertSafeTeamId(teamId: string) {\n // Conservative: matches OpenClaw team ids like \"development-team\".\n if (!/^[a-z0-9][a-z0-9-]{1,63}$/.test(teamId)) {\n throw new Error(`Invalid teamId \"${teamId}\"`);\n }\n}\n\nfunction isPathLike(s: string) {\n return s.includes(\"/\") || s.includes(\"\\\\\");\n}\n\nexport function teamWorkspace(teamId: string) {\n assertSafeTeamId(teamId);\n return path.join(os.homedir(), \".openclaw\", `workspace-${teamId}`);\n}\n\n/**\n * Back-compat helper for older non-team-scoped code paths.\n * Prefer passing explicit teamId into APIs instead.\n */\nexport function getTeamWorkspaceDir(teamId?: string): string {\n if (teamId) return teamWorkspace(teamId);\n return process.env.CK_TEAM_WORKSPACE_DIR ?? teamWorkspace(process.env.CK_TEAM_ID ?? \"development-team\");\n}\n\nexport function stageDir(stage: TicketStage, teamIdOrDir: string = \"development-team\") {\n const map: Record<TicketStage, string> = {\n backlog: \"work/backlog\",\n \"in-progress\": \"work/in-progress\",\n testing: \"work/testing\",\n done: \"work/done\",\n };\n\n const base = isPathLike(teamIdOrDir) ? teamIdOrDir : teamWorkspace(teamIdOrDir);\n return path.join(base, map[stage]);\n}\n\nexport function parseTitle(md: string) {\n // Ticket markdown files typically start with: # 0033-some-slug\n const firstLine = md.split(\"\\n\")[0] ?? \"\";\n const header = firstLine.startsWith(\"# \") ? firstLine.slice(2).trim() : \"\";\n\n // If header is like: \"<id> <title...>\" keep the explicit title portion.\n const firstSpace = header.indexOf(\" \");\n if (firstSpace > 0) {\n const afterSpace = header.slice(firstSpace + 1).trim();\n if (afterSpace) return afterSpace;\n }\n\n // Otherwise derive from the slug: strip leading number + hyphen, then de-kebab.\n const derivedRaw = header\n .replace(/^\\d{4}-/, \"\")\n .replace(/[-_]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n\n const ACRONYMS = new Set([\"api\", \"cli\", \"ui\", \"ux\", \"gpu\", \"cpu\", \"npm\", \"pr\", \"ci\", \"cd\", \"json\", \"yaml\", \"md\"]);\n const titleCase = (s: string) =>\n s\n .split(\" \")\n .filter(Boolean)\n .map((w) => {\n const lower = w.toLowerCase();\n if (ACRONYMS.has(lower)) return w.toUpperCase();\n if (lower.startsWith(\"v\") && /^\\d/.test(lower.slice(1))) return w; // version-like\n if (/^[\\d.]+$/.test(w)) return w; // numbers/semver\n return w.slice(0, 1).toUpperCase() + w.slice(1);\n })\n .join(\" \");\n\n const derived = derivedRaw ? titleCase(derivedRaw) : \"\";\n\n if (derived) return derived;\n return header || \"(untitled)\";\n}\n\nfunction parseField(md: string, field: string): string | null {\n const re = new RegExp(`^${field}:\\\\s*(.*)$`, \"mi\");\n const m = md.match(re);\n return m?.[1]?.trim() || null;\n}\n\nexport function parseNumberFromFilename(filename: string): number | null {\n const m = filename.match(/^(\\d{4})-/);\n if (!m) return null;\n return Number(m[1]);\n}\n\nfunction teamIdFromTeamDir(teamDir: string): string {\n const base = path.basename(teamDir);\n if (base.startsWith(\"workspace-\")) return base.slice(\"workspace-\".length);\n return base;\n}\n\nexport async function discoverTeamIds(): Promise<string[]> {\n // Convention: ~/.openclaw/workspace-<teamId>\n const root = path.join(os.homedir(), \".openclaw\");\n let entries: string[] = [];\n try {\n entries = await fs.readdir(root);\n } catch {\n return [];\n }\n\n return entries\n .filter((e) => e.startsWith(\"workspace-\"))\n .map((e) => e.slice(\"workspace-\".length))\n .filter((id) => Boolean(id) && id !== \"workspace\")\n .sort();\n}\n\n/**\n * List tickets for a specific team (recommended).\n * - listTickets(\"development-team\")\n * - listTickets(teamWorkspaceDir)\n */\nexport async function listTickets(teamIdOrDir: string = \"development-team\"): Promise<TicketSummary[]> {\n const teamId = isPathLike(teamIdOrDir) ? teamIdFromTeamDir(teamIdOrDir) : teamIdOrDir;\n const stages: TicketStage[] = [\"backlog\", \"in-progress\", \"testing\", \"done\"];\n const all: TicketSummary[] = [];\n\n for (const stage of stages) {\n let files: string[] = [];\n try {\n files = await fs.readdir(stageDir(stage, teamIdOrDir));\n } catch {\n files = [];\n }\n\n for (const f of files) {\n if (!f.endsWith(\".md\")) continue;\n const number = parseNumberFromFilename(f);\n if (number == null) continue;\n\n const file = path.join(stageDir(stage, teamIdOrDir), f);\n const [md, stat] = await Promise.all([fs.readFile(file, \"utf8\"), fs.stat(file)]);\n\n const title = parseTitle(md);\n const owner = parseField(md, \"Owner\");\n const updatedAt = stat.mtime.toISOString();\n const ageHours = (Date.now() - stat.mtimeMs) / (1000 * 60 * 60);\n\n all.push({\n teamId,\n number,\n id: f.replace(/\\.md$/, \"\"),\n title,\n owner,\n stage,\n file,\n updatedAt,\n ageHours,\n });\n }\n }\n\n all.sort((a, b) => a.number - b.number);\n return all;\n}\n\n/**\n * List tickets across all discovered teams (used for /tickets?team=all).\n */\nexport async function listAllTeamsTickets(): Promise<TicketSummary[]> {\n const teamIds = await discoverTeamIds();\n const all: TicketSummary[] = [];\n\n for (const teamId of teamIds) {\n all.push(...(await listTickets(teamId)));\n }\n\n all.sort((a, b) => (a.teamId === b.teamId ? a.number - b.number : a.teamId.localeCompare(b.teamId)));\n return all;\n}\n\n/**\n * Back-compat helper used by some API routes.\n */\nexport async function getTicketByIdOrNumber(ticketIdOrNumber: string, teamIdOrDir: string = \"development-team\") {\n const tickets = await listTickets(teamIdOrDir);\n const normalized = ticketIdOrNumber.trim();\n\n const byNumber = normalized.match(/^\\d+$/) ? tickets.find((t) => t.number === Number(normalized)) : null;\n const byId = tickets.find((t) => t.id === normalized);\n return byId ?? byNumber ?? null;\n}\n\nexport async function resolveTicket(teamId: string, ticketIdOrNumber: string): Promise<TicketSummary | null> {\n return getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n}\n\n/**\n * getTicketMarkdown(teamId, ticketIdOrNumber)\n */\nexport async function getTicketMarkdown(\n teamId: string,\n ticketIdOrNumber: string,\n): Promise<{ teamId: string; id: string; file: string; markdown: string; owner: string | null; stage: TicketStage } | null> {\n const hit = await getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n if (!hit) return null;\n\n return {\n teamId: hit.teamId,\n id: hit.id,\n file: hit.file,\n markdown: await fs.readFile(hit.file, \"utf8\"),\n owner: hit.owner,\n stage: hit.stage,\n };\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const TicketDetailClient = registerClientReference(\n function() { throw new Error(\"Attempted to call TicketDetailClient() from the server but TicketDetailClient is 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.\"); },\n \"[project]/src/app/tickets/TicketDetailClient.tsx\",\n \"TicketDetailClient\",\n);\nexport const isPostCommentDisabled = registerClientReference(\n function() { throw new Error(\"Attempted to call isPostCommentDisabled() from the server but isPostCommentDisabled is 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.\"); },\n \"[project]/src/app/tickets/TicketDetailClient.tsx\",\n \"isPostCommentDisabled\",\n);\n","import { TicketDetailClient } from \"@/app/tickets/TicketDetailClient\";\nimport { getTicketMarkdown } from \"@/lib/tickets\";\n\nexport const dynamic = \"force-dynamic\";\n\nexport default async function TeamTicketDetailPage({\n params,\n}: {\n params: Promise<{ teamId: string; ticket: string }>;\n}) {\n const { teamId, ticket } = await params;\n const data = await getTicketMarkdown(teamId, ticket);\n\n if (!data) {\n return (\n <div className=\"ck-glass p-6\">\n <h1 className=\"text-xl font-semibold tracking-tight\">Ticket not found</h1>\n <p className=\"mt-3 text-sm text-[color:var(--ck-text-secondary)]\">\n Couldn’t locate “{ticket}” in backlog/in-progress/testing/done for team “{teamId}”.\n </p>\n </div>\n );\n }\n\n return (\n <TicketDetailClient\n teamId={teamId}\n ticketId={data.id}\n file={data.file}\n markdown={data.markdown}\n stage={data.stage}\n backHref={`/teams/${encodeURIComponent(teamId)}/tickets`}\n currentOwner={data.owner}\n />\n );\n}\n"],"names":[],"mappings":"6hBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAuBA,SAAS,EAAW,CAAS,EAC3B,OAAO,EAAE,QAAQ,CAAC,MAAQ,EAAE,QAAQ,CAAC,KACvC,CAgBO,SAAS,EAAS,CAAkB,CAAE,EAAsB,kBAAkB,EAQnF,IAAM,EAAO,EAAW,GAAe,EAtBlC,AAsBgD,SAtBvC,AAAc,CAAc,EAT1C,GAAI,CAAC,4BAA4B,IAAI,CAUpB,AAVqB,GACpC,MAD6C,AACvC,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ACrD,WAAa,MAAM,AAAI,MAAM,kPAAoP,EACjR,mDACA,sBAES,EAAwB,CAAA,EAAA,EAAA,uBAAA,AAAuB,EACxD,WAAa,MAAM,AAAI,MAAM,wPAA0P,EACvR,mDACA,4HCVJ,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIe,eAAe,EAAqB,QACjD,CAAM,CAGP,EACC,GAAM,QAAE,CAAM,QAAE,CAAM,CAAE,CAAG,MAAM,EAC3B,EAAO,MAAM,CAAA,EAAA,EAAA,iBAAA,AAAiB,EAAC,EAAQ,UAE7C,AAAK,EAYH,CAAA,CAZE,CAYF,CAZS,CAYT,GAAA,EAAC,EAAA,kBAAkB,CAAA,CACjB,OAAQ,EACR,SAAU,EAAK,EAAE,CACjB,KAAM,EAAK,IAAI,CACf,SAAU,EAAK,QAAQ,CACvB,MAAO,EAAK,KAAK,CACjB,SAAU,CAAC,OAAO,EAAE,mBAAmB,GAAQ,QAAQ,CAAC,CACxD,aAAc,EAAK,KAAK,GAjBxB,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,yBACb,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,gDAAuC,qBACrD,CAAA,EAAA,EAAA,IAAA,EAAC,IAAA,CAAE,UAAU,+DAAqD,oBAC9C,EAAO,mDAAiD,EAAO,UAiB3F,kCAhCuB","ignoreList":[1]}
@@ -0,0 +1,3 @@
1
+ module.exports=[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"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},12057,(a,b,c)=>{b.exports=a.x("node:util",()=>require("node:util"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},81511,a=>{"use strict";var b=a.i(83643);async function c(){let a=await (0,b.runOpenClaw)(["plugins","list","--json","--verbose"]);if(!a.ok)return{ok:!1,error:a.stderr.trim()||`openclaw plugins list failed (exit=${a.exitCode})`};try{var c,d;return{ok:!0,ids:(c=a.stdout,(Array.isArray(d=JSON.parse(c))?d:d&&"object"==typeof d&&Array.isArray(d.plugins)?d.plugins:[]).filter(a=>!!a&&"object"==typeof a&&!0===a.enabled).map(a=>String(a.id??"")).filter(Boolean))}}catch{return{ok:!1,error:"Failed to parse openclaw plugins list output"}}}async function d(a){let b=await c();return!!b.ok&&b.ids.includes(a)}a.s(["isPluginEnabled",()=>d])},78892,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-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/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-client.tsx <module evaluation>","default")},49752,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-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/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-client.tsx","default")},21895,a=>{"use strict";a.i(78892);var b=a.i(49752);a.n(b)},23388,a=>{"use strict";var b=a.i(7997),c=a.i(18558),d=a.i(21895),e=a.i(81511);async function f({params:a,searchParams:f}){(0,c.unstable_noStore)();let{teamId:g,workflowId:h}=await a,i=(await f??{}).draft,j=Array.isArray(i)?i[0]:i;return(0,b.jsx)("div",{className:"flex h-full min-h-0 flex-col",children:(0,b.jsx)(d.default,{teamId:g,workflowId:h,draft:"1"===j,llmTaskEnabled:await (0,e.isPluginEnabled)("llm-task")})})}a.s(["default",()=>f,"dynamic",0,"force-dynamic","revalidate",0,0])}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__ad4e8478._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/plugins.ts","../../../../src/app/teams/%5BteamId%5D/workflows/%5BworkflowId%5D/workflows-editor-client.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/workflows/%5BworkflowId%5D/page.tsx"],"sourcesContent":["import { runOpenClaw } from \"@/lib/openclaw\";\n\nexport type PluginListEntry = {\n id?: unknown;\n enabled?: unknown;\n};\n\nfunction extractPluginEntries(raw: unknown): PluginListEntry[] {\n if (Array.isArray(raw)) return raw as PluginListEntry[];\n if (raw && typeof raw === \"object\" && Array.isArray((raw as { plugins?: unknown }).plugins)) {\n return (raw as { plugins: PluginListEntry[] }).plugins;\n }\n return [];\n}\n\nexport function parseEnabledPluginIds(stdout: string): string[] {\n const parsed = JSON.parse(stdout) as unknown;\n const items = extractPluginEntries(parsed);\n return items\n .filter((p) => Boolean(p) && typeof p === \"object\" && (p as { enabled?: unknown }).enabled === true)\n .map((p) => String(p.id ?? \"\"))\n .filter(Boolean);\n}\n\nexport async function getEnabledPluginIds(): Promise<{ ok: true; ids: string[] } | { ok: false; error: string }> {\n const res = await runOpenClaw([\"plugins\", \"list\", \"--json\", \"--verbose\"]);\n if (!res.ok) {\n const err = res.stderr.trim() || `openclaw plugins list failed (exit=${res.exitCode})`;\n return { ok: false, error: err };\n }\n\n try {\n return { ok: true, ids: parseEnabledPluginIds(res.stdout) };\n } catch {\n return { ok: false, error: \"Failed to parse openclaw plugins list output\" };\n }\n}\n\nexport async function isPluginEnabled(pluginId: string): Promise<boolean> {\n const res = await getEnabledPluginIds();\n if (!res.ok) return false;\n return res.ids.includes(pluginId);\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport default registerClientReference(\n function() { throw new Error(\"Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-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.\"); },\n \"[project]/src/app/teams/[teamId]/workflows/[workflowId]/workflows-editor-client.tsx\",\n \"default\",\n);\n","import { unstable_noStore as noStore } from \"next/cache\";\nimport WorkflowsEditorClient from \"./workflows-editor-client\";\nimport { isPluginEnabled } from \"@/lib/plugins\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\n\nexport default async function WorkflowEditorPage({\n params,\n searchParams,\n}: {\n params: Promise<{ teamId: string; workflowId: string }>;\n searchParams?: Promise<Record<string, string | string[] | undefined>>;\n}) {\n noStore();\n\n const { teamId, workflowId } = await params;\n const sp = (await searchParams) ?? {};\n const draftRaw = sp.draft;\n const draft = Array.isArray(draftRaw) ? draftRaw[0] : draftRaw;\n\n // Full-bleed workflows editor (no extra top row / padding / border).\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n <WorkflowsEditorClient\n teamId={teamId}\n workflowId={workflowId}\n draft={draft === \"1\"}\n llmTaskEnabled={await isPluginEnabled(\"llm-task\")}\n />\n </div>\n );\n}\n"],"names":[],"mappings":"geAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAwBO,eAAe,IACpB,IAAM,EAAM,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,EAAC,CAAC,UAAW,OAAQ,SAAU,YAAY,EACxE,GAAI,CAAC,EAAI,EAAE,CAET,CAFW,KAEJ,CAAE,IAAI,EAAO,MADR,CACe,CADX,MAAM,CAAC,IAAI,IAAM,CAAC,mCAAmC,EAAE,EAAI,QAAQ,CAAC,CAAC,CAAC,AACvD,EAGjC,GAAI,SACF,MAAO,CAAE,IAAI,EAAM,GAAA,EAjBe,AAiBV,EAAsB,EAAI,EAjBF,IAiBQ,CAdnD,CAVH,AAAJ,MAAU,OAAO,CADW,AACV,EAQH,CATyB,GAChB,CAQJ,KAAK,CAAC,IARK,EAC3B,GAAsB,UA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AAe,EAAC,eAI9C,kCA5BuB,+BACG","ignoreList":[1]}
@@ -0,0 +1,3 @@
1
+ module.exports=[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"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},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"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},12057,(a,b,c)=>{b.exports=a.x("node:util",()=>require("node:util"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},5365,(a,b,c)=>{b.exports=a.x("process",()=>require("process"))},874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},790,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>"))},84707,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js"))},97647,a=>{"use strict";a.i(790);var b=a.i(84707);a.n(b)},95936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(64240),g=a.r(7997),h=f._(a.r(97647));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("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)},30095,88241,a=>{"use strict";var b=a.i(12714),c=a.i(50227),d=a.i(28215);let e=c.default.join("shared-context","workflows");function f(a){let b=String(a??"").trim();if(!b)throw Error("workflow id is required");if(!/^[a-z0-9][a-z0-9-]{0,62}$/.test(b))throw Error("Invalid workflow id. Use lowercase letters, numbers, and dashes (max 63 chars), e.g. marketing-cadence-v1");return b}async function g(a){let b=await (0,d.getTeamWorkspaceDir)(a);return c.default.join(b,e)}async function h(a,d){let e=f(d),h=await g(a),i=c.default.join(h,`${e}.workflow.json`),j=JSON.parse(await b.default.readFile(i,"utf8"));return{ok:!0,path:i,workflow:j}}a.s(["assertSafeWorkflowId",()=>f,"readWorkflow",()=>h],88241);let i=c.default.join("shared-context","workflow-runs");async function j(a,b){f(b);let e=await (0,d.getTeamWorkspaceDir)(a);return c.default.join(e,i)}function k(a){return`${a}.run.json`}async function l(a,d,e){let g=f(d),h=function(a){let b=String(a??"").trim();if(!b)throw Error("run id is required");if(!/^[A-Za-z0-9][A-Za-z0-9-]{0,120}$/.test(b))throw Error("Invalid run id. Use letters, numbers, and dashes.");return b}(e),i=await j(a,g),l=c.default.join(i,h,"run.json");try{let d=await b.default.readFile(l,"utf8"),e=JSON.parse(d),f=n(a,g,e,h);if(Array.isArray(f.nodes)&&f.nodes.length){let a=c.default.join(i,h,"node-outputs"),d=[];try{d=await b.default.readdir(a)}catch{d=[]}let e=new Map;for(let b of d.slice().sort()){let d=b.match(/-([^/]+)\.json$/);if(!d)continue;let f=d[1];if(!f)continue;let g=e.get(f)??[];g.push(c.default.join(a,b)),e.set(f,g)}await Promise.all(f.nodes.map(async a=>{if(!a||"object"!=typeof a||void 0!==a.output)return;let c=e.get(a.nodeId);if(!c||!c.length)return;let d=c.shift();if(d)try{let c=await b.default.readFile(d,"utf8");a.output=JSON.parse(c)}catch{}}))}return{ok:!0,path:l,run:f}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}let m=c.default.join(i,k(h));try{let c=await b.default.readFile(m,"utf8"),d=JSON.parse(c);return{ok:!0,path:m,run:n(a,g,d,h)}}catch(d){if(d&&"object"==typeof d&&"ENOENT"===d.code){let d=c.default.join(i,g,k(h)),e=JSON.parse(await b.default.readFile(d,"utf8"));return{ok:!0,path:d,run:n(a,g,e,h)}}throw d}}async function m(a){let e=await (0,d.getTeamWorkspaceDir)(a),f=c.default.join(e,i),g=[];try{for(let d of(await b.default.readdir(f,{withFileTypes:!0})).filter(a=>a.isDirectory()).map(a=>a.name).sort()){let e=c.default.join(f,d,"run.json");try{let[c,f]=await Promise.all([b.default.readFile(e,"utf8"),b.default.stat(e)]),h=n(a,"(unknown)",JSON.parse(c),d);g.push({workflowId:h.workflowId,runId:h.id,status:h.status,startedAt:h.startedAt,endedAt:h.endedAt,updatedAt:f.mtime?new Date(f.mtime).toISOString():void 0,path:e})}catch{}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}try{for(let d of(await b.default.readdir(f)).filter(a=>a.endsWith(".run.json")).sort()){let e=d.replace(/\.run\.json$/i,""),h=c.default.join(f,d);try{let[c,d]=await Promise.all([b.default.readFile(h,"utf8"),b.default.stat(h)]),f=n(a,"(unknown)",JSON.parse(c),e);g.push({workflowId:f.workflowId,runId:f.id,status:f.status,startedAt:f.startedAt,endedAt:f.endedAt,updatedAt:d.mtime?new Date(d.mtime).toISOString():void 0,path:h})}catch{g.push({workflowId:"(unknown)",runId:e,path:h})}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}try{for(let a of(await b.default.readdir(f,{withFileTypes:!0})).filter(a=>a.isDirectory()).map(a=>a.name).sort()){let d=c.default.join(f,a),e=[];try{e=(await b.default.readdir(d)).filter(a=>a.endsWith(".run.json")).sort()}catch(a){if(a&&"object"==typeof a&&"ENOENT"===a.code)continue;throw a}for(let f of e){let e=f.replace(/\.run\.json$/i,""),h=c.default.join(d,f);try{let[c,d]=await Promise.all([b.default.readFile(h,"utf8"),b.default.stat(h)]),f=JSON.parse(c);g.push({workflowId:a,runId:e,status:f.status,startedAt:"string"==typeof f.startedAt?f.startedAt:void 0,endedAt:"string"==typeof f.endedAt?f.endedAt:void 0,updatedAt:d.mtime?new Date(d.mtime).toISOString():void 0,path:h})}catch{g.push({workflowId:a,runId:e,path:h})}}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}let h=new Map;for(let a of g){let b=`${a.workflowId}:${a.runId}`,d=h.get(b);if(!d){h.set(b,a);continue}let e=a=>{let b=0;return a.status&&(b+=2),a.startedAt&&(b+=1),a.endedAt&&(b+=1),a.updatedAt&&(b+=1),a.path.endsWith(`${c.default.sep}run.json`)&&(b+=2),b};e(a)>=e(d)&&h.set(b,a)}let j=Array.from(h.values());return j.sort((a,b)=>String(b.updatedAt??b.startedAt??"").localeCompare(String(a.updatedAt??a.startedAt??""))),{ok:!0,dir:f,runs:j}}function n(a,b,d,e){if(d&&"object"==typeof d&&"clawkitchen.workflow-run.v1"===d.schema)return d;if(d&&"object"==typeof d&&"runId"in d&&"workflow"in d){let f=d.workflow&&"object"==typeof d.workflow?d.workflow:{},g="string"==typeof f.file?f.file:"",h=g?c.default.basename(g).replace(/\.workflow\.json$/i,""):"",i="string"==typeof f.id&&f.id?f.id:h||b,j=String(d.status??""),k="awaiting_approval"===j?"waiting_for_approval":"completed"===j?"success":"rejected"===j||"error"===j?"error":"canceled"===j?"canceled":"running",l=Array.isArray(d.nodeResults)?d.nodeResults.map(a=>{if(!a||"object"!=typeof a)return null;let b="string"==typeof a.nodeId?a.nodeId:"";if(!b)return null;let c=String(a.status??"pending"),d="awaiting_approval"===c?"waiting":"completed"===c?"success":"error"===c?"error":c,e=["pending","running","waiting","success","error","skipped"].includes(d)?d:"pending",f="string"==typeof a.error?a.error:a.error&&"object"==typeof a.error&&"message"in a.error?{message:String(a.error.message??"")}:void 0,g="string"==typeof a.startedAt?a.startedAt:void 0,h="string"==typeof a.endedAt?a.endedAt:void 0;return{nodeId:b,status:e,...g?{startedAt:g}:{},...h?{endedAt:h}:{},...void 0!==a.output?{output:a.output}:{},...void 0!==f?{error:f}:{}}}).filter(a=>null!==a):void 0;return{schema:"clawkitchen.workflow-run.v1",id:"string"==typeof d.runId?d.runId:e,workflowId:i,teamId:a,startedAt:"string"==typeof d.createdAt?d.createdAt:new Date().toISOString(),endedAt:("success"===k||"error"===k||"canceled"===k)&&"string"==typeof d.updatedAt?d.updatedAt:void 0,status:k,summary:"Executed by workflow runner",nodes:l}}return{schema:"clawkitchen.workflow-run.v1",id:e,workflowId:b,teamId:a,startedAt:new Date().toISOString(),status:"error",summary:"Malformed run file"}}a.s(["listAllWorkflowRuns",()=>m,"readWorkflowRun",()=>l],30095)},51551,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-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/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-client.tsx <module evaluation>","default")},9936,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-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/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-client.tsx","default")},37381,a=>{"use strict";a.i(51551);var b=a.i(9936);a.n(b)},2018,a=>{"use strict";var b=a.i(7997),c=a.i(95936),d=a.i(18558),e=a.i(15629),f=a.i(30095),g=a.i(88241),h=a.i(37381);async function i({params:a}){(0,d.unstable_noStore)();let{teamId:i,workflowId:j,runId:k}=await a,l=await (0,e.getTeamDisplayName)(i),[{run:m},n]=await Promise.all([(0,f.readWorkflowRun)(i,j,k),(0,g.readWorkflow)(i,j).catch(()=>null)]),o=n?.workflow?.name;return(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,b.jsx)(c.default,{href:`/runs?team=${encodeURIComponent(i)}`,className:"hover:underline",children:"Runs"}),(0,b.jsx)("span",{className:"mx-2",children:"/"}),(0,b.jsx)("span",{className:"font-mono",children:j})]}),(0,b.jsxs)("h1",{className:"mt-1 text-2xl font-semibold tracking-tight",children:[o?`${o} \xb7 `:"",(0,b.jsx)("span",{className:"font-mono",children:k})]}),(0,b.jsxs)("div",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:[l||i," · ",(0,b.jsx)("span",{className:"font-mono",children:i})]})]}),(0,b.jsx)("div",{className:"flex items-center gap-3",children:(0,b.jsx)(c.default,{href:`/teams/${encodeURIComponent(i)}/workflows/${encodeURIComponent(j)}`,className:"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline",children:"Workflow editor →"})})]}),(0,b.jsx)(h.default,{run:m})]})}a.s(["default",()=>i,"dynamic",0,"force-dynamic","revalidate",0,0])}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__bd20cf10._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/next/dist/client/app-dir/link.js/__nextjs-internal-proxy.cjs","../../../../node_modules/next/src/client/app-dir/link.tsx","../../../../node_modules/next/src/client/app-dir/link.react-server.tsx","../../../../src/lib/workflows/runs-storage.ts","../../../../src/lib/workflows/readdir.ts","../../../../src/lib/workflows/storage.ts","../../../../src/app/teams/%5BteamId%5D/runs/%5BworkflowId%5D/%5BrunId%5D/run-detail-client.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/runs/%5BworkflowId%5D/%5BrunId%5D/page.tsx"],"sourcesContent":["// This file is generated by next-core EcmascriptClientReferenceModule.\nconst { createClientModuleProxy } = require(\"react-server-dom-turbopack/server\");\n\n__turbopack_context__.n(createClientModuleProxy(\"[project]/node_modules/next/dist/client/app-dir/link.js\"));\n","'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport { errorOnce } from '../../shared/lib/utils/error-once'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n as: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n as || href,\n replace ? 'replace' : 'push',\n scroll ?? true,\n linkInstanceRef.current\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof hrefProp === 'string') {\n href = hrefProp\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }, [hrefProp, asProp])\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n href,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [prefetchEnabled, href, router, fetchStrategy, setOptimisticLinkStatus]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(e, href, as, linkInstanceRef, replace, scroll, onNavigate)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(as)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n","import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getTeamWorkspaceDir } from \"@/lib/paths\";\nimport { readdirFiles } from \"@/lib/workflows/readdir\";\nimport { assertSafeWorkflowId } from \"@/lib/workflows/storage\";\nimport type { WorkflowRunFileV1, WorkflowRunNodeResultV1 } from \"@/lib/workflows/runs-types\";\n\nconst RUNS_DIR = path.join(\"shared-context\", \"workflow-runs\");\n\n/**\n * Back-compat:\n * - Legacy Kitchen layout: shared-context/workflow-runs/<workflowId>/*.run.json\n * - Runner layout (preferred): shared-context/workflow-runs/*.run.json\n */\nconst LEGACY_PER_WORKFLOW_LAYOUT = true;\n\nexport function assertSafeRunId(runId: string) {\n const id = String(runId ?? \"\").trim();\n if (!id) throw new Error(\"run id is required\");\n\n // Accept both Kitchen-style run ids (lowercase) and runner ids that include ISO timestamps (T/Z).\n // We still keep it conservative: only letters/numbers/dashes.\n if (!/^[A-Za-z0-9][A-Za-z0-9-]{0,120}$/.test(id)) {\n throw new Error(\"Invalid run id. Use letters, numbers, and dashes.\"\n );\n }\n return id;\n}\n\nexport async function getWorkflowRunsDir(teamId: string, workflowId: string) {\n // Validate workflowId (we no longer use it for the directory name).\n void assertSafeWorkflowId(workflowId);\n const teamDir = await getTeamWorkspaceDir(teamId);\n return path.join(teamDir, RUNS_DIR);\n}\n\nexport function workflowRunFileName(runId: string) {\n return `${runId}.run.json`;\n}\n\nexport async function listWorkflowRuns(teamId: string, workflowId: string) {\n const wfId = assertSafeWorkflowId(workflowId);\n const dir = await getWorkflowRunsDir(teamId, wfId);\n\n const runIds: string[] = [];\n\n // Preferred: runner directory-per-run layout: shared-context/workflow-runs/<runId>/run.json\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n const runDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();\n\n for (const runId of runDirs) {\n const p = path.join(dir, runId, \"run.json\");\n try {\n const raw = await fs.readFile(p, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n const normalized = normalizeRunFile(teamId, wfId, parsed, runId);\n if (normalized.workflowId === wfId) runIds.push(runId);\n } catch {\n // ignore\n }\n }\n } catch {\n // ignore\n }\n\n // Legacy: flat *.run.json at root\n try {\n const { files } = await readdirFiles(dir, \".run.json\", true);\n for (const f of files) {\n const runId = f.replace(/\\.run\\.json$/i, \"\");\n try {\n const raw = await fs.readFile(path.join(dir, f), \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n const normalized = normalizeRunFile(teamId, wfId, parsed, runId);\n if (normalized.workflowId === wfId) runIds.push(runId);\n } catch {\n // ignore\n }\n }\n } catch {\n // ignore\n }\n\n // Back-compat: legacy per-workflow directory.\n if (LEGACY_PER_WORKFLOW_LAYOUT) {\n try {\n const legacyDir = path.join(dir, wfId);\n const { files } = await readdirFiles(legacyDir, \".run.json\", true);\n for (const f of files) runIds.push(f.replace(/\\.run\\.json$/i, \"\"));\n } catch {\n // ignore\n }\n }\n\n const uniq = Array.from(new Set(runIds)).sort().reverse();\n return { ok: true as const, dir, runIds: uniq };\n}\n\nexport async function readWorkflowRun(teamId: string, workflowId: string, runId: string) {\n const wfId = assertSafeWorkflowId(workflowId);\n const rId = assertSafeRunId(runId);\n const dir = await getWorkflowRunsDir(teamId, wfId);\n\n // Preferred (runner) layout: shared-context/workflow-runs/<runId>/run.json\n const pRunner = path.join(dir, rId, \"run.json\");\n try {\n const raw = await fs.readFile(pRunner, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n const run = normalizeRunFile(teamId, wfId, parsed, rId);\n\n // Runner stores rich node outputs as files under:\n // workflow-runs/<runId>/node-outputs/*-<nodeId>.json\n // Normalize by hydrating node.output from those files when missing.\n if (Array.isArray(run.nodes) && run.nodes.length) {\n const outputsDir = path.join(dir, rId, \"node-outputs\");\n let files: string[] = [];\n try {\n files = await fs.readdir(outputsDir);\n } catch {\n files = [];\n }\n\n // Multiple output files may exist for the same nodeId when a workflow executes a node\n // more than once. Preserve ordering by assigning outputs sequentially per nodeId.\n //\n // NOTE: Runner output filenames are typically prefixed with a sortable counter (e.g. 001-<nodeId>.json).\n // We rely on lexicographic order of filenames within node-outputs.\n const byNodeId = new Map<string, string[]>();\n for (const f of files.slice().sort()) {\n const m = f.match(/-([^/]+)\\.json$/);\n if (!m) continue;\n const nodeId = m[1];\n if (!nodeId) continue;\n const existing = byNodeId.get(nodeId) ?? [];\n existing.push(path.join(outputsDir, f));\n byNodeId.set(nodeId, existing);\n }\n\n await Promise.all(\n run.nodes.map(async (n) => {\n if (!n || typeof n !== \"object\") return;\n // Only hydrate if output is truly missing.\n if (typeof n.output !== \"undefined\") return;\n\n const arr = byNodeId.get(n.nodeId);\n if (!arr || !arr.length) return;\n\n const pOut = arr.shift();\n if (!pOut) return;\n\n try {\n const outRaw = await fs.readFile(pOut, \"utf8\");\n n.output = JSON.parse(outRaw) as unknown;\n } catch {\n // ignore\n }\n })\n );\n }\n\n return { ok: true as const, path: pRunner, run };\n } catch (err: unknown) {\n // fallthrough\n if (!(err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\")) throw err;\n }\n\n // Legacy flat layout: shared-context/workflow-runs/<runId>.run.json\n const p0 = path.join(dir, workflowRunFileName(rId));\n try {\n const raw = await fs.readFile(p0, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n return { ok: true as const, path: p0, run: normalizeRunFile(teamId, wfId, parsed, rId) };\n } catch (err: unknown) {\n if (LEGACY_PER_WORKFLOW_LAYOUT && err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\") {\n const legacy = path.join(dir, wfId, workflowRunFileName(rId));\n const raw = await fs.readFile(legacy, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n return { ok: true as const, path: legacy, run: normalizeRunFile(teamId, wfId, parsed, rId) };\n }\n throw err;\n }\n}\n\nexport async function writeWorkflowRun(teamId: string, workflowId: string, run: WorkflowRunFileV1) {\n const wfId = assertSafeWorkflowId(workflowId);\n const rId = assertSafeRunId(run.id);\n const dir = await getWorkflowRunsDir(teamId, wfId);\n await fs.mkdir(dir, { recursive: true });\n\n // Default layout: write to shared-context/workflow-runs/<runId>.run.json\n //\n // IMPORTANT: that filename may already be occupied by a runner-owned run log (different schema).\n // In that case, keep the runner log intact and write the Kitchen run file to the legacy\n // per-workflow directory shared-context/workflow-runs/<workflowId>/<runId>.run.json.\n const p0 = path.join(dir, workflowRunFileName(rId));\n\n let p = p0;\n try {\n const raw = await fs.readFile(p0, \"utf8\");\n const existing = JSON.parse(raw) as unknown;\n const isRunnerLog =\n Boolean(existing) &&\n typeof existing === \"object\" &&\n !Array.isArray(existing) &&\n \"runId\" in (existing as Record<string, unknown>) &&\n !(\"schema\" in (existing as Record<string, unknown>));\n\n if (isRunnerLog && LEGACY_PER_WORKFLOW_LAYOUT) {\n const legacyDir = path.join(dir, wfId);\n await fs.mkdir(legacyDir, { recursive: true });\n p = path.join(legacyDir, workflowRunFileName(rId));\n }\n } catch {\n // ignore read/parse errors; we'll write to p0\n }\n\n const toWrite: WorkflowRunFileV1 = {\n ...run,\n schema: \"clawkitchen.workflow-run.v1\",\n id: rId,\n workflowId: wfId,\n teamId,\n };\n await fs.writeFile(p, JSON.stringify(toWrite, null, 2) + \"\\n\", \"utf8\");\n return { ok: true as const, path: p };\n}\n\nexport type WorkflowRunSummary = {\n workflowId: string;\n runId: string;\n status?: WorkflowRunFileV1[\"status\"];\n startedAt?: string;\n endedAt?: string;\n /** ISO timestamp derived from file mtime (best-effort) */\n updatedAt?: string;\n /** Absolute path to the run file on disk (server-side only) */\n path: string;\n};\n\nexport async function listAllWorkflowRuns(teamId: string): Promise<{ ok: true; dir: string; runs: WorkflowRunSummary[] }> {\n const teamDir = await getTeamWorkspaceDir(teamId);\n const dir = path.join(teamDir, RUNS_DIR);\n\n const runs: WorkflowRunSummary[] = [];\n\n // Preferred: runner directory-per-run layout:\n // shared-context/workflow-runs/<runId>/run.json\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n const runDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();\n\n for (const runId of runDirs) {\n const full = path.join(dir, runId, \"run.json\");\n try {\n const [raw, st] = await Promise.all([fs.readFile(full, \"utf8\"), fs.stat(full)]);\n const normalized = normalizeRunFile(teamId, \"(unknown)\", JSON.parse(raw) as unknown, runId);\n runs.push({\n workflowId: normalized.workflowId,\n runId: normalized.id,\n status: normalized.status,\n startedAt: normalized.startedAt,\n endedAt: normalized.endedAt,\n updatedAt: st.mtime ? new Date(st.mtime).toISOString() : undefined,\n path: full,\n });\n } catch {\n // ignore missing run.json/parse errors; keep going\n }\n }\n } catch (err: unknown) {\n if (!(err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\")) throw err;\n }\n\n // Legacy: flat run files at root: shared-context/workflow-runs/<runId>.run.json\n try {\n const entries = (await fs.readdir(dir)).filter((n) => n.endsWith(\".run.json\")).sort();\n for (const fileName of entries) {\n const runId = fileName.replace(/\\.run\\.json$/i, \"\");\n const full = path.join(dir, fileName);\n try {\n const [raw, st] = await Promise.all([fs.readFile(full, \"utf8\"), fs.stat(full)]);\n const normalized = normalizeRunFile(teamId, \"(unknown)\", JSON.parse(raw) as unknown, runId);\n runs.push({\n workflowId: normalized.workflowId,\n runId: normalized.id,\n status: normalized.status,\n startedAt: normalized.startedAt,\n endedAt: normalized.endedAt,\n updatedAt: st.mtime ? new Date(st.mtime).toISOString() : undefined,\n path: full,\n });\n } catch {\n runs.push({ workflowId: \"(unknown)\", runId, path: full });\n }\n }\n } catch (err: unknown) {\n if (!(err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\")) throw err;\n }\n\n // Back-compat: legacy per-workflow directory.\n if (LEGACY_PER_WORKFLOW_LAYOUT) {\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n const wfDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();\n\n for (const workflowId of wfDirs) {\n const wfDir = path.join(dir, workflowId);\n let entries2: string[] = [];\n try {\n entries2 = (await fs.readdir(wfDir)).filter((n) => n.endsWith(\".run.json\")).sort();\n } catch (err: unknown) {\n if (err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\") continue;\n throw err;\n }\n\n for (const fileName of entries2) {\n const runId = fileName.replace(/\\.run\\.json$/i, \"\");\n const full = path.join(wfDir, fileName);\n try {\n const [raw, st] = await Promise.all([fs.readFile(full, \"utf8\"), fs.stat(full)]);\n const parsed = JSON.parse(raw) as Partial<WorkflowRunFileV1>;\n runs.push({\n workflowId,\n runId,\n status: parsed.status as WorkflowRunFileV1[\"status\"],\n startedAt: typeof parsed.startedAt === \"string\" ? parsed.startedAt : undefined,\n endedAt: typeof parsed.endedAt === \"string\" ? parsed.endedAt : undefined,\n updatedAt: st.mtime ? new Date(st.mtime).toISOString() : undefined,\n path: full,\n });\n } catch {\n runs.push({ workflowId, runId, path: full });\n }\n }\n }\n } catch (err: unknown) {\n if (!(err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\")) throw err;\n }\n }\n\n // Deduplicate across layouts. It's possible for the same logical run to appear in multiple places\n // (runner dir-per-run + legacy flat/per-workflow layouts). Prefer the richest record.\n const byKey = new Map<string, WorkflowRunSummary>();\n for (const r of runs) {\n const key = `${r.workflowId}:${r.runId}`;\n const prev = byKey.get(key);\n if (!prev) {\n byKey.set(key, r);\n continue;\n }\n\n const score = (x: WorkflowRunSummary) => {\n let s = 0;\n if (x.status) s += 2;\n if (x.startedAt) s += 1;\n if (x.endedAt) s += 1;\n if (x.updatedAt) s += 1;\n // Prefer runner dir-per-run run.json over legacy .run.json files.\n if (x.path.endsWith(`${path.sep}run.json`)) s += 2;\n return s;\n };\n\n if (score(r) >= score(prev)) byKey.set(key, r);\n }\n\n const deduped = Array.from(byKey.values());\n deduped.sort((a, b) => String(b.updatedAt ?? b.startedAt ?? \"\").localeCompare(String(a.updatedAt ?? a.startedAt ?? \"\")));\n return { ok: true as const, dir, runs: deduped };\n}\n\nfunction normalizeRunFile(teamId: string, workflowId: string, parsed: unknown, runIdFallback: string): WorkflowRunFileV1 {\n // Kitchen schema\n if (parsed && typeof parsed === \"object\" && (parsed as { schema?: unknown }).schema === \"clawkitchen.workflow-run.v1\") {\n return parsed as WorkflowRunFileV1;\n }\n\n // Runner schema (RunLog from ClawRecipes). Convert to Kitchen's display schema.\n if (parsed && typeof parsed === \"object\" && \"runId\" in parsed && \"workflow\" in parsed) {\n const o = parsed as {\n runId?: unknown;\n createdAt?: unknown;\n updatedAt?: unknown;\n status?: unknown;\n workflow?: { id?: unknown; file?: unknown };\n nodeResults?: unknown;\n };\n\n const wfObj = o.workflow && typeof o.workflow === \"object\" ? o.workflow : {};\n const file = typeof wfObj.file === \"string\" ? wfObj.file : \"\";\n const inferredWfId = file ? path.basename(file).replace(/\\.workflow\\.json$/i, \"\") : \"\";\n const wfId = typeof wfObj.id === \"string\" && wfObj.id ? wfObj.id : inferredWfId || workflowId;\n\n const statusRaw = String(o.status ?? \"\");\n const status: WorkflowRunFileV1[\"status\"] =\n statusRaw === \"awaiting_approval\"\n ? \"waiting_for_approval\"\n : statusRaw === \"completed\"\n ? \"success\"\n : statusRaw === \"rejected\"\n ? \"error\"\n : statusRaw === \"error\"\n ? \"error\"\n : statusRaw === \"canceled\"\n ? \"canceled\"\n : \"running\";\n\n const nodes = Array.isArray(o.nodeResults)\n ? o.nodeResults\n .map((nr) => {\n if (!nr || typeof nr !== \"object\") return null;\n const r = nr as {\n nodeId?: unknown;\n status?: unknown;\n startedAt?: unknown;\n endedAt?: unknown;\n output?: unknown;\n error?: unknown;\n };\n const nodeId = typeof r.nodeId === \"string\" ? r.nodeId : \"\";\n if (!nodeId) return null;\n\n const st = String(r.status ?? \"pending\");\n const mapped =\n st === \"awaiting_approval\"\n ? \"waiting\"\n : st === \"completed\"\n ? \"success\"\n : st === \"error\"\n ? \"error\"\n : st;\n\n const allowed = [\"pending\", \"running\", \"waiting\", \"success\", \"error\", \"skipped\"] as const;\n const status = (allowed as readonly string[]).includes(mapped) ? (mapped as (typeof allowed)[number]) : \"pending\";\n\n const error =\n typeof r.error === \"string\"\n ? r.error\n : r.error && typeof r.error === \"object\" && \"message\" in r.error\n ? { message: String((r.error as { message?: unknown }).message ?? \"\") }\n : undefined;\n\n const startedAt = typeof r.startedAt === \"string\" ? r.startedAt : undefined;\n const endedAt = typeof r.endedAt === \"string\" ? r.endedAt : undefined;\n\n return {\n nodeId,\n status,\n ...(startedAt ? { startedAt } : {}),\n ...(endedAt ? { endedAt } : {}),\n ...(typeof r.output !== \"undefined\" ? { output: r.output } : {}),\n ...(typeof error !== \"undefined\" ? { error } : {}),\n } satisfies WorkflowRunNodeResultV1;\n })\n .filter((x): x is WorkflowRunNodeResultV1 => x !== null)\n : undefined;\n\n return {\n schema: \"clawkitchen.workflow-run.v1\",\n id: typeof o.runId === \"string\" ? o.runId : runIdFallback,\n workflowId: wfId,\n teamId,\n startedAt: typeof o.createdAt === \"string\" ? o.createdAt : new Date().toISOString(),\n endedAt:\n status === \"success\" || status === \"error\" || status === \"canceled\"\n ? typeof o.updatedAt === \"string\"\n ? o.updatedAt\n : undefined\n : undefined,\n status,\n summary: \"Executed by workflow runner\",\n nodes,\n };\n }\n\n // Unknown schema; keep a placeholder so UI can still render.\n return {\n schema: \"clawkitchen.workflow-run.v1\",\n id: runIdFallback,\n workflowId,\n teamId,\n startedAt: new Date().toISOString(),\n status: \"error\",\n summary: \"Malformed run file\",\n };\n}","import fs from \"node:fs/promises\";\n\n/** Reads dir with optional suffix filter and reverse sort. Returns { ok, dir, files } or { ok, dir, files: [] } on ENOENT. */\nexport async function readdirFiles(\n dir: string,\n suffix: string,\n reverse = false\n): Promise<{ ok: true; dir: string; files: string[] }> {\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n let files = entries\n .filter((e) => e.isFile() && e.name.endsWith(suffix))\n .map((e) => e.name)\n .sort();\n if (reverse) files = files.reverse();\n return { ok: true as const, dir, files };\n } catch (err: unknown) {\n if (err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\") {\n return { ok: true as const, dir, files: [] as string[] };\n }\n throw err;\n }\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getTeamWorkspaceDir } from \"@/lib/paths\";\nimport { readdirFiles } from \"@/lib/workflows/readdir\";\nimport type { WorkflowFileV1 } from \"@/lib/workflows/types\";\n\nconst WORKFLOWS_DIR = path.join(\"shared-context\", \"workflows\");\n\nexport function workflowFileName(workflowId: string) {\n return `${workflowId}.workflow.json`;\n}\n\nexport function assertSafeWorkflowId(workflowId: string) {\n const id = String(workflowId ?? \"\").trim();\n if (!id) throw new Error(\"workflow id is required\");\n if (!/^[a-z0-9][a-z0-9-]{0,62}$/.test(id)) {\n throw new Error(\n \"Invalid workflow id. Use lowercase letters, numbers, and dashes (max 63 chars), e.g. marketing-cadence-v1\"\n );\n }\n return id;\n}\n\nexport async function getTeamWorkflowsDir(teamId: string) {\n const teamDir = await getTeamWorkspaceDir(teamId);\n return path.join(teamDir, WORKFLOWS_DIR);\n}\n\nexport async function listWorkflows(teamId: string) {\n const dir = await getTeamWorkflowsDir(teamId);\n return readdirFiles(dir, \".workflow.json\");\n}\n\nexport async function readWorkflow(teamId: string, workflowId: string) {\n const id = assertSafeWorkflowId(workflowId);\n const dir = await getTeamWorkflowsDir(teamId);\n const p = path.join(dir, workflowFileName(id));\n const raw = await fs.readFile(p, \"utf8\");\n const parsed = JSON.parse(raw) as WorkflowFileV1;\n return { ok: true as const, path: p, workflow: parsed };\n}\n\nexport async function writeWorkflow(teamId: string, workflow: WorkflowFileV1) {\n const id = assertSafeWorkflowId(workflow.id);\n const dir = await getTeamWorkflowsDir(teamId);\n await fs.mkdir(dir, { recursive: true });\n const p = path.join(dir, workflowFileName(id));\n const toWrite: WorkflowFileV1 = {\n ...workflow,\n schema: \"clawkitchen.workflow.v1\",\n id,\n };\n await fs.writeFile(p, JSON.stringify(toWrite, null, 2) + \"\\n\", \"utf8\");\n return { ok: true as const, path: p };\n}\n\nexport async function deleteWorkflow(teamId: string, workflowId: string) {\n const id = assertSafeWorkflowId(workflowId);\n const dir = await getTeamWorkflowsDir(teamId);\n const p = path.join(dir, workflowFileName(id));\n try {\n await fs.unlink(p);\n } catch (err: unknown) {\n if (err && typeof err === \"object\" && (err as { code?: unknown }).code === \"ENOENT\") {\n return { ok: true as const, path: p, existed: false as const };\n }\n throw err;\n }\n return { ok: true as const, path: p, existed: true as const };\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport default registerClientReference(\n function() { throw new Error(\"Attempted to call the default export of [project]/src/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-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.\"); },\n \"[project]/src/app/teams/[teamId]/runs/[workflowId]/[runId]/run-detail-client.tsx\",\n \"default\",\n);\n","import Link from \"next/link\";\nimport { unstable_noStore as noStore } from \"next/cache\";\n\nimport { getTeamDisplayName } from \"@/lib/recipes\";\nimport { readWorkflowRun } from \"@/lib/workflows/runs-storage\";\nimport { readWorkflow } from \"@/lib/workflows/storage\";\nimport RunDetailClient from \"./run-detail-client\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\n\nexport default async function TeamRunDetailPage({\n params,\n}: {\n params: Promise<{ teamId: string; workflowId: string; runId: string }>;\n}) {\n noStore();\n\n const { teamId, workflowId, runId } = await params;\n const name = await getTeamDisplayName(teamId);\n\n const [{ run }, workflowRes] = await Promise.all([\n readWorkflowRun(teamId, workflowId, runId),\n readWorkflow(teamId, workflowId).catch(() => null),\n ]);\n\n const wfName = workflowRes?.workflow?.name;\n\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-wrap items-start justify-between gap-4\">\n <div>\n <div className=\"text-xs text-[color:var(--ck-text-tertiary)]\">\n <Link href={`/runs?team=${encodeURIComponent(teamId)}`} className=\"hover:underline\">\n Runs\n </Link>\n <span className=\"mx-2\">/</span>\n <span className=\"font-mono\">{workflowId}</span>\n </div>\n <h1 className=\"mt-1 text-2xl font-semibold tracking-tight\">\n {wfName ? `${wfName} · ` : \"\"}\n <span className=\"font-mono\">{runId}</span>\n </h1>\n <div className=\"mt-1 text-sm text-[color:var(--ck-text-secondary)]\">\n {name || teamId} · <span className=\"font-mono\">{teamId}</span>\n </div>\n </div>\n\n <div className=\"flex items-center gap-3\">\n <Link\n href={`/teams/${encodeURIComponent(teamId)}/workflows/${encodeURIComponent(workflowId)}`}\n className=\"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline\"\n >\n Workflow editor →\n </Link>\n </div>\n </div>\n\n <RunDetailClient run={run} />\n </div>\n );\n}\n"],"names":["LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","as","linkInstanceRef","replace","scroll","onNavigate","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","useMemo","resolvedHref","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","undefined","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext","__NEXT_CACHE_COMPONENTS","Full","isLegacyBehavior","childIsHostComponent","childIsClientComponent","error","ClientLinkComponent"],"mappings":"6yBACA,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,iGAFhD,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,2MEAhD,OAyBC,CAAA,kBAzBuBA,GA2BCC,aAAa,CAAA,kBAAbA,EAAAA,aAAa,2GA7B6B,CAAA,CAAA,IAAA,IAEpD,SAASD,EACtBuC,CAAiD,EAEjD,IAAMkG,EAAmBlG,EAAMmB,cAAc,CACvCgF,EACsB,UAA1B,OAAOnG,EAAMK,QAAQ,EACK,UAA1B,OAAOL,EAAMK,QAAQ,EACoB,UAAzC,OAAQL,EAAMK,QAAQ,EAAUkE,KAC5B6B,EACHpG,EAAMK,QAAQ,EAAUkE,MAAMR,WAC/BC,OAAOC,GAAG,CAAC,0BAcb,OAZIiC,AAYJ,GAZyBC,GAAyBC,IAC3CpG,CAWP,CAXaK,QADW,AACH,EAAUkE,KADkB,CACZR,EADqC,SACxBC,OAAOC,GAAG,CAAC,cACzDC,CADwE,OAChEmC,KAAK,CACX,CAAC,8NAGHnC,CAHkO,CA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M,CAAC,WAAW,EAAE,mBAAmB,GAAA,CAAS,CAAE,UAAU,2BAAkB,SAGpF,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,gBAAO,MACvB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,qBAAa,OAE/B,CAAA,EAAA,EAAA,IAAA,EAAC,KAAA,CAAG,UAAU,uDACX,EAAS,CAAA,EAAG,EAAO,MAAG,CAAC,CAAG,GAC3B,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,qBAAa,OAE/B,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,+DACZ,GAAQ,EAAO,MAAG,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,qBAAa,UAIpD,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,mCACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAI,CAAA,CACH,KAAM,CAAC,OAAO,EAAE,mBAAmB,GAAQ,WAAW,EAAE,mBAAmB,GAAA,CAAa,CACxF,UAAU,qFACX,2BAML,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAe,CAAA,CAAC,IAAK,MAG5B,kCArDuB,+BACG","ignoreList":[0,2,6]}
@@ -0,0 +1,3 @@
1
+ module.exports=[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"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},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"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},12057,(a,b,c)=>{b.exports=a.x("node:util",()=>require("node:util"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},5365,(a,b,c)=>{b.exports=a.x("process",()=>require("process"))},874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},62188,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/HomeClient.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/app/HomeClient.tsx <module evaluation>","default")},49735,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/HomeClient.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/app/HomeClient.tsx","default")},73189,a=>{"use strict";a.i(62188);var b=a.i(49735);a.n(b)},60168,a=>{"use strict";var b=a.i(7997),c=a.i(18558),d=a.i(83643),e=a.i(15629),f=a.i(73189);async function g(){let a=await (0,d.runOpenClaw)(["agents","list","--json"]);return a.ok?JSON.parse(a.stdout):[]}async function h(){let a=await (0,e.listRecipes)(),b={};for(let c of a){if("team"!==c.kind)continue;let a=String(c.name??"").trim();a&&(b[c.id]=a)}return{teamNames:b}}async function i(){(0,c.unstable_noStore)();let[a,{teamNames:d}]=await Promise.all([g(),h()]);return(0,b.jsx)(f.default,{agents:a,teamNames:d})}a.s(["default",()=>i,"dynamic",0,"force-dynamic","revalidate",0,0])}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__cefae8c8._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/app/HomeClient.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/page.tsx"],"sourcesContent":["// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport default registerClientReference(\n function() { throw new Error(\"Attempted to call the default export of [project]/src/app/HomeClient.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.\"); },\n \"[project]/src/app/HomeClient.tsx\",\n \"default\",\n);\n","import { unstable_noStore as noStore } from \"next/cache\";\nimport { type AgentListItem } from \"@/lib/agents\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { listRecipes } from \"@/lib/recipes\";\nimport HomeClient from \"./HomeClient\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\nasync function getAgents(): Promise<AgentListItem[]> {\n const res = await runOpenClaw([\"agents\", \"list\", \"--json\"]);\n if (!res.ok) return [];\n return JSON.parse(res.stdout) as AgentListItem[];\n}\n\nasync function getTeamsFromRecipes(): Promise<{ teamNames: Record<string, string> }> {\n const items = await listRecipes();\n const teamNames: Record<string, string> = {};\n for (const r of items) {\n if (r.kind !== \"team\") continue;\n const name = String(r.name ?? \"\").trim();\n if (!name) continue;\n teamNames[r.id] = name;\n }\n return { teamNames };\n}\n\nexport default async function Home() {\n // Home should always reflect the current OpenClaw state (teams/agents can change outside Next).\n noStore();\n\n const [agents, { teamNames }] = await Promise.all([getAgents(), getTeamsFromRecipes()]);\n return <HomeClient agents={agents} teamNames={teamNames} />;\n}\n"],"names":[],"mappings":"m1BAEe,CAAA,EAAA,AADf,EAAA,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,wRAA0R,EACvT,uDACA,gEAHW,CAAA,EAAA,AADf,EAAA,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,oQAAsQ,EACnS,mCACA,8GCLJ,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIA,eAAe,IACb,IAAM,EAAM,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,EAAC,CAAC,SAAU,OAAQ,SAAS,SAC1D,AAAK,EAAI,EAAE,AAAP,CACG,CADM,IACD,KAAK,CAAC,EAAI,MAAM,EADR,EAAE,AAExB,CAEA,eAAe,IACb,IAAM,EAAQ,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,IACzB,EAAoC,CAAC,EAC3C,IAAK,IAAM,KAAK,EAAO,CACrB,GAAe,SAAX,EAAE,IAAI,CAAa,SACvB,IAAM,EAAO,OAAO,EAAE,IAAI,EAAI,IAAI,IAAI,GACjC,IACL,CAAS,CADE,AACD,EAAE,EAAE,CAAC,CAAG,CAAA,CACpB,CACA,MAAO,WAAE,CAAU,CACrB,CAEe,eAAe,IAE5B,CAAA,EAAA,EAAA,gBAAA,AAAO,IAEP,GAAM,CAAC,EAAQ,WAAE,CAAS,CAAE,CAAC,CAAG,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAa,IAAsB,EACtF,MAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAU,CAAA,CAAC,OAAQ,EAAQ,UAAW,GAChD,kCA1BuB,+BACG","ignoreList":[0]}