@adminide-stack/yantra-mobile 12.0.141-alpha.1 → 12.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/features/agent-chat/NativeAgentChat.js +21 -4
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ApprovalCard.js +353 -0
- package/lib/features/chat/ApprovalCard.js.map +1 -0
- package/lib/features/chat/AskUserCard.js +9 -2
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/askUser.js +25 -3
- package/lib/features/chat/askUser.js.map +1 -1
- package/lib/features/chat/queuedFollowUpRows.js +13 -0
- package/lib/features/chat/queuedFollowUpRows.js.map +1 -0
- package/lib/features/devices/bodyComposition.js +116 -0
- package/lib/features/devices/bodyComposition.js.map +1 -0
- package/lib/features/devices/readings.js.map +1 -1
- package/lib/features/devices/session.js +22 -2
- package/lib/features/devices/session.js.map +1 -1
- package/lib/features/discover/DiscoverArticle.js +105 -92
- package/lib/features/discover/DiscoverArticle.js.map +1 -1
- package/lib/features/discover/DiscoverFeed.js +97 -48
- package/lib/features/discover/DiscoverFeed.js.map +1 -1
- package/lib/features/discover/DiscoverFollowUp.js +135 -0
- package/lib/features/discover/DiscoverFollowUp.js.map +1 -0
- package/lib/features/discover/DiscoverSidebar.js +555 -0
- package/lib/features/discover/DiscoverSidebar.js.map +1 -0
- package/lib/features/discover/DiscoverSkeletons.js +123 -0
- package/lib/features/discover/DiscoverSkeletons.js.map +1 -0
- package/lib/features/discover/DiscoverStoryCards.js +193 -87
- package/lib/features/discover/DiscoverStoryCards.js.map +1 -1
- package/lib/features/discover/followUpQuery.js +42 -0
- package/lib/features/discover/followUpQuery.js.map +1 -0
- package/lib/features/discover/markets.js +37 -0
- package/lib/features/discover/markets.js.map +1 -0
- package/lib/features/discover/useDiscoverSidebar.js +148 -0
- package/lib/features/discover/useDiscoverSidebar.js.map +1 -0
- package/lib/features/discover/weather.js +42 -0
- package/lib/features/discover/weather.js.map +1 -0
- package/lib/features/expenses/ExpensesAgentChatPane.js +1 -1
- package/lib/features/expenses/ExpensesAgentChatPane.js.map +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js +1 -1
- package/lib/features/inbox/InboxAgentChatPane.js.map +1 -1
- package/lib/features/job-search/JobSearchAgentChatPane.js +1 -0
- package/lib/features/job-search/JobSearchAgentChatPane.js.map +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js +1 -1
- package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js +1 -1
- package/lib/features/movies/MoviesAgentChatPane.js.map +1 -1
- package/lib/features/notion/NotionBlockSheets.js +206 -0
- package/lib/features/notion/NotionBlockSheets.js.map +1 -0
- package/lib/features/notion/NotionBlockView.js +36 -0
- package/lib/features/notion/NotionBlockView.js.map +1 -0
- package/lib/features/notion/NotionCommentsSheet.js +461 -0
- package/lib/features/notion/NotionCommentsSheet.js.map +1 -0
- package/lib/features/notion/NotionConnectionsSheet.js +244 -0
- package/lib/features/notion/NotionConnectionsSheet.js.map +1 -0
- package/lib/features/notion/NotionHistorySheet.js +439 -0
- package/lib/features/notion/NotionHistorySheet.js.map +1 -0
- package/lib/features/notion/NotionMediaBlocks.js +803 -0
- package/lib/features/notion/NotionMediaBlocks.js.map +1 -0
- package/lib/features/notion/NotionMentionSheet.js +279 -0
- package/lib/features/notion/NotionMentionSheet.js.map +1 -0
- package/lib/features/notion/NotionPageMenu.js +585 -0
- package/lib/features/notion/NotionPageMenu.js.map +1 -0
- package/lib/features/notion/NotionPageTree.js +220 -0
- package/lib/features/notion/NotionPageTree.js.map +1 -0
- package/lib/features/notion/NotionPageView.js +1253 -152
- package/lib/features/notion/NotionPageView.js.map +1 -1
- package/lib/features/notion/NotionShareSheet.js +606 -0
- package/lib/features/notion/NotionShareSheet.js.map +1 -0
- package/lib/features/notion/NotionSheets.js +87 -15
- package/lib/features/notion/NotionSheets.js.map +1 -1
- package/lib/features/notion/NotionSidebarSections.js +492 -0
- package/lib/features/notion/NotionSidebarSections.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js +659 -0
- package/lib/features/notion/NotionWorkspaceAdmin.js.map +1 -0
- package/lib/features/notion/NotionWorkspaceView.js +257 -45
- package/lib/features/notion/NotionWorkspaceView.js.map +1 -1
- package/lib/features/notion/database/DatabaseCells.js +554 -0
- package/lib/features/notion/database/DatabaseCells.js.map +1 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js +792 -0
- package/lib/features/notion/database/DatabaseDateLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseLayouts.js +461 -0
- package/lib/features/notion/database/DatabaseLayouts.js.map +1 -0
- package/lib/features/notion/database/DatabaseSheets.js +791 -0
- package/lib/features/notion/database/DatabaseSheets.js.map +1 -0
- package/lib/features/notion/database/NotionDatabaseView.js +817 -0
- package/lib/features/notion/database/NotionDatabaseView.js.map +1 -0
- package/lib/features/notion/database/RowPropertiesPanel.js +162 -0
- package/lib/features/notion/database/RowPropertiesPanel.js.map +1 -0
- package/lib/features/notion/database/chartData.js +89 -0
- package/lib/features/notion/database/chartData.js.map +1 -0
- package/lib/features/notion/database/chartView.js +112 -0
- package/lib/features/notion/database/chartView.js.map +1 -0
- package/lib/features/notion/database/connectorButton.js +33 -0
- package/lib/features/notion/database/connectorButton.js.map +1 -0
- package/lib/features/notion/database/databaseCalc.js +208 -0
- package/lib/features/notion/database/databaseCalc.js.map +1 -0
- package/lib/features/notion/database/databaseCalendar.js +157 -0
- package/lib/features/notion/database/databaseCalendar.js.map +1 -0
- package/lib/features/notion/database/databaseCsv.js +98 -0
- package/lib/features/notion/database/databaseCsv.js.map +1 -0
- package/lib/features/notion/database/databaseCsvActions.js +58 -0
- package/lib/features/notion/database/databaseCsvActions.js.map +1 -0
- package/lib/features/notion/database/databaseFilter.js +473 -0
- package/lib/features/notion/database/databaseFilter.js.map +1 -0
- package/lib/features/notion/database/databaseFormula.js +1072 -0
- package/lib/features/notion/database/databaseFormula.js.map +1 -0
- package/lib/features/notion/database/databaseGroup.js +151 -0
- package/lib/features/notion/database/databaseGroup.js.map +1 -0
- package/lib/features/notion/database/databaseRollup.js +58 -0
- package/lib/features/notion/database/databaseRollup.js.map +1 -0
- package/lib/features/notion/database/databaseTimeline.js +156 -0
- package/lib/features/notion/database/databaseTimeline.js.map +1 -0
- package/lib/features/notion/database/databaseView.js +1188 -0
- package/lib/features/notion/database/databaseView.js.map +1 -0
- package/lib/features/notion/database/databaseViews.js +310 -0
- package/lib/features/notion/database/databaseViews.js.map +1 -0
- package/lib/features/notion/database/relationSource.js +92 -0
- package/lib/features/notion/database/relationSource.js.map +1 -0
- package/lib/features/notion/database/uniqueId.js +17 -0
- package/lib/features/notion/database/uniqueId.js.map +1 -0
- package/lib/features/notion/database/useNotionDatabase.js +617 -0
- package/lib/features/notion/database/useNotionDatabase.js.map +1 -0
- package/lib/features/notion/notionAgentRunStatus.js +39 -0
- package/lib/features/notion/notionAgentRunStatus.js.map +1 -0
- package/lib/features/notion/notionCodeLanguages.js +112 -0
- package/lib/features/notion/notionCodeLanguages.js.map +1 -0
- package/lib/features/notion/notionComments.js +86 -0
- package/lib/features/notion/notionComments.js.map +1 -0
- package/lib/features/notion/notionConnections.js +74 -0
- package/lib/features/notion/notionConnections.js.map +1 -0
- package/lib/features/notion/notionDocuments.js +453 -1
- package/lib/features/notion/notionDocuments.js.map +1 -1
- package/lib/features/notion/notionEditorModel.js +142 -7
- package/lib/features/notion/notionEditorModel.js.map +1 -1
- package/lib/features/notion/notionMarkdownShortcuts.js +51 -0
- package/lib/features/notion/notionMarkdownShortcuts.js.map +1 -0
- package/lib/features/notion/notionMedia.js +119 -0
- package/lib/features/notion/notionMedia.js.map +1 -0
- package/lib/features/notion/notionMentionDate.js +32 -0
- package/lib/features/notion/notionMentionDate.js.map +1 -0
- package/lib/features/notion/notionMentionOptions.js +162 -0
- package/lib/features/notion/notionMentionOptions.js.map +1 -0
- package/lib/features/notion/notionNotesAgent.js +445 -0
- package/lib/features/notion/notionNotesAgent.js.map +1 -0
- package/lib/features/notion/notionPageAccess.js +168 -0
- package/lib/features/notion/notionPageAccess.js.map +1 -0
- package/lib/features/notion/notionPageActions.js +138 -0
- package/lib/features/notion/notionPageActions.js.map +1 -0
- package/lib/features/notion/notionPageHistory.js +154 -0
- package/lib/features/notion/notionPageHistory.js.map +1 -0
- package/lib/features/notion/notionPageKinds.js +200 -0
- package/lib/features/notion/notionPageKinds.js.map +1 -0
- package/lib/features/notion/notionRecents.js +48 -0
- package/lib/features/notion/notionRecents.js.map +1 -0
- package/lib/features/notion/notionRichText.js +177 -0
- package/lib/features/notion/notionRichText.js.map +1 -0
- package/lib/features/notion/notionRichTitle.js +336 -0
- package/lib/features/notion/notionRichTitle.js.map +1 -0
- package/lib/features/notion/useNotionWorkspace.js +272 -13
- package/lib/features/notion/useNotionWorkspace.js.map +1 -1
- package/lib/features/notion/usePageActions.js +155 -0
- package/lib/features/notion/usePageActions.js.map +1 -0
- package/lib/features/resume/ResumeAgentChatPane.js +1 -1
- package/lib/features/resume/ResumeAgentChatPane.js.map +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js +1 -1
- package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
- package/lib/features/study/StudyAgentChatPane.js +1 -1
- package/lib/features/study/StudyAgentChatPane.js.map +1 -1
- package/lib/features/travel/TravelAgentChatPane.js +1 -1
- package/lib/features/travel/TravelAgentChatPane.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +40 -8
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +1 -1
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/codeFiles.js +302 -0
- package/lib/features/webbuilder/codeFiles.js.map +1 -0
- package/lib/features/webbuilder/codeHighlight.js +209 -0
- package/lib/features/webbuilder/codeHighlight.js.map +1 -0
- package/lib/features/webbuilder/components/CodeView.js +682 -52
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +59 -38
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +3 -3
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/stepLabels.js +68 -0
- package/lib/features/webbuilder/stepLabels.js.map +1 -0
- package/lib/hooks/useHostChatSteering.js +45 -0
- package/lib/hooks/useHostChatSteering.js.map +1 -0
- package/lib/screens/Chat/index.js +2 -12
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Devices/index.js +205 -3
- package/lib/screens/Devices/index.js.map +1 -1
- package/lib/screens/ExpensesNative/useExpensesHostChat.js +25 -5
- package/lib/screens/ExpensesNative/useExpensesHostChat.js.map +1 -1
- package/lib/screens/InboxNative/useInboxHostChat.js +25 -5
- package/lib/screens/InboxNative/useInboxHostChat.js.map +1 -1
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js +25 -5
- package/lib/screens/JobSearchNative/useJobSearchHostChat.js.map +1 -1
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +25 -5
- package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -1
- package/lib/screens/MoviesNative/useMoviesHostChat.js +25 -5
- package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -1
- package/lib/screens/NotionPage/index.js +2 -2
- package/lib/screens/NotionPage/index.js.map +1 -1
- package/lib/screens/ResumeNative/useResumeHostChat.js +25 -5
- package/lib/screens/ResumeNative/useResumeHostChat.js.map +1 -1
- package/lib/screens/ShoppingNative/useShoppingHostChat.js +25 -5
- package/lib/screens/ShoppingNative/useShoppingHostChat.js.map +1 -1
- package/lib/screens/StudyNative/useStudyHostChat.js +25 -5
- package/lib/screens/StudyNative/useStudyHostChat.js.map +1 -1
- package/lib/screens/TravelNative/useTravelHostChat.js +25 -5
- package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -1
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +222 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -0
- package/lib/screens/WebBuilderNative/index.js +1 -1
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js +126 -4
- package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +120 -11
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFragments.js","sources":["../../../src/features/webbuilder/buildFragments.ts"],"sourcesContent":["/**\n * Reads builds out of a build chat's posts.\n *\n * The build workflow posts its result as a \"fragment\" on an assistant post:\n * sandbox id and preview URL, the source files, and after a publish the live\n * address. Native twin of the web host's `creationsFromMessages`\n * (browser `pages/webbuilder/remoteWebbuilder.ts`) and the surface's\n * `extractFragmentFromSource` lookup order: `propsConfiguration.contents`\n * first (where the real fragment lives; `props` is account-scoped), then the\n * post's own fields. Pure but for the platform's sandbox domain, read from\n * config (publicSandboxDomain), so the host and jest can both use it.\n */\nimport type { WebBuilderBuild, WebBuilderProject } from './types';\nimport { rewritePagesDevLinks, shownLiveUrl, siteAddress } from './siteAddress';\nimport { publicSandboxDomain } from './publicSandboxDomain';\nimport {\n DEFAULT_E2B_SANDBOX_DOMAIN,\n previewDomainFor,\n sandboxPreviewDomainsSource,\n sandboxPreviewLinkRe,\n sandboxPreviewUrlFor,\n withPublicSandboxHosts,\n} from './sandboxPublicHost';\nimport { renderWidgetBlocks } from './widgetBlocks';\nimport { stripAskUser } from '../chat/askUser';\n\ntype Loose = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n\ninterface Fragment {\n sandboxUrl?: string;\n sandboxId?: string;\n liveUrl?: string;\n files?: Record<string, string> | null;\n title?: string;\n projectId?: string;\n /** Stack the build was made from (`vite-react`, `nextjs`), shown on the tile. */\n template?: string;\n /** Screenshot of the build: an object key or a full URL. */\n coverImageUrl?: string;\n /** CDN origin the cover key was stored under. */\n coverImagePath?: string;\n /** The agent's restore point for this build (design-pro snapshots after each turn). */\n snapshotId?: string;\n /** Read from the agent's words (the agent-chat lane), not a workflow fragment. */\n fromReply?: boolean;\n isCreatingSandbox: boolean;\n isDeploying: boolean;\n}\n\n/** `contents` arrives as an object or, from some resolvers, as JSON text. */\nfunction asObject(value: unknown): Loose | null {\n if (!value) return null;\n if (typeof value === 'object') return Array.isArray(value) ? null : (value as Loose);\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed.startsWith('{')) return null;\n try {\n const parsed = JSON.parse(trimmed);\n return parsed && typeof parsed === 'object' ? (parsed as Loose) : null;\n } catch {\n return null;\n }\n }\n return null;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\n/** `props` is account-scoped (`props[\"<accountId>\"] = {…}`): the records one level down. */\nfunction accountRecords(record: Loose): Loose[] {\n return Object.values(record)\n .map((v) => asObject(v))\n .filter((v): v is Loose => v !== null);\n}\n\n/** First non-empty string among `key` on each record (and on its `fragment`). */\nfunction pick(records: Loose[], key: string): string | undefined {\n for (const record of records) {\n const value = str(record[key]) || str(asObject(record.fragment)?.[key]);\n if (value) return value;\n }\n return undefined;\n}\n\n/** A live sandbox URL (`https://3000-<id>.sb.yantra.app`, `.e2b.dev`, any domain) - never a cover. */\nconst LIVE_SANDBOX = /^https?:\\/\\/\\d+-[a-z0-9]+(\\.|\\/|$)/i;\n\n/**\n * The preview origin for a sandbox. A bare `https://3000-<id>` (no domain) is\n * the E2B default domain, as the surface's `liveSandboxIframeSrc` maps it. An\n * e2b cloud preview is shown on the platform's sandbox domain when one is set\n * (`E2B_SANDBOX_DOMAIN`), and so is a preview named only by its sandbox id.\n */\nexport function sandboxPreviewUrl(url: string | undefined, sandboxId: string | undefined): string | null {\n const domain = publicSandboxDomain();\n const given = str(url);\n if (given) {\n if (/^https?:\\/\\/\\d+-[a-z0-9]+\\/?$/i.test(given)) {\n return `${given.replace(/\\/$/, '')}.${previewDomainFor(DEFAULT_E2B_SANDBOX_DOMAIN, domain)}`;\n }\n return withPublicSandboxHosts(given, domain);\n }\n const id = str(sandboxId);\n return id ? sandboxPreviewUrlFor(id, domain) : null;\n}\n\nfunction httpOrigin(value: string | undefined): string | null {\n const match = /^(https?:\\/\\/[^/?#]+)/i.exec((value ?? '').trim());\n return match && !LIVE_SANDBOX.test(match[1]) ? match[1] : null;\n}\n\n/**\n * The image to show for a cover - the web `resolveCoverDisplayUrl`: an object\n * key joined to the origin it was stored under, else to the app's CDN, else a\n * full https URL as given. A live sandbox URL is never a cover.\n */\nexport function coverDisplayUrl(cover: string | undefined, path?: string, cdnOrigin?: string): string | null {\n const raw = str(cover);\n if (!raw || LIVE_SANDBOX.test(raw)) return null;\n if (/^https?:\\/\\//i.test(raw)) return raw.split('?')[0];\n const key = raw.replace(/^\\/+/, '');\n if (!/\\/uploads\\//i.test(`/${key}`) && !/\\.(png|jpe?g|webp|gif|svg)$/i.test(key)) return null;\n const origin = httpOrigin(path) || httpOrigin(cdnOrigin);\n return origin ? `${origin}/${key}` : null;\n}\n\nexport function readFragment(post: unknown): Fragment | null {\n if (!post || typeof post !== 'object') return null;\n const p = post as Loose;\n const cfg: Loose = p.propsConfiguration || {};\n const contents: Loose = asObject(cfg.contents) || asObject(cfg.content) || {};\n const contentsProps: Loose = asObject(contents.props) || {};\n const props: Loose = asObject(p.props) || {};\n const fragment: Loose | null =\n asObject(contentsProps.fragment) ||\n asObject(contents.fragment) ||\n asObject(cfg.fragment) ||\n asObject(props.fragment) ||\n asObject(p.fragment) ||\n null;\n const f: Loose = fragment || {};\n const sandboxUrl = str(f.sandboxUrl) || str(f.url) || str(p.sandboxUrl) || str(contents.sandboxUrl);\n const sandboxId = str(f.sandboxId) || str(p.sandboxId) || str(contents.sandboxId) || str(cfg.sandboxId);\n const publish = asObject(f.publish);\n // Shown on the custom or company domain, never pages.dev (web `siteAddress`, #446).\n const liveUrl =\n siteAddress({\n customDomainUrl: str(f.customDomainUrl),\n urls: [str(f.cloudflareUrl), str(f.deployUrl), str(publish?.url)],\n projectName: str(publish?.projectName) || str(f.projectName),\n }) || undefined;\n const attachment = asObject(props.attachment) || asObject(contents.attachment) || {};\n const isCreatingSandbox =\n f.isCreatingSandbox === true || contents.isCreatingSandbox === true || p.isCreatingSandbox === true;\n const isDeploying = attachment.isDeploying === true || f.isDeploying === true;\n if (!sandboxUrl && !sandboxId && !liveUrl && !fragment && !isCreatingSandbox && !isDeploying) return null;\n const files = f.files && typeof f.files === 'object' ? (f.files as Record<string, string>) : null;\n // The cover rides on the fragment, the post's props, or an account record of either.\n const coverSources = [f, props, contents, contentsProps, p, ...accountRecords(props), ...accountRecords(contents)];\n const coverImageUrl = [\n pick(coverSources, 'coverImageUrl'),\n pick(coverSources, 'previewImageUrl'),\n str(f.cover),\n ].find((c) => c && !LIVE_SANDBOX.test(c));\n return {\n sandboxUrl,\n sandboxId,\n liveUrl,\n files,\n title: str(f.title),\n projectId: str(f.projectId) || str(contentsProps.projectId),\n template: str(f.templateId) || str(f.template) || str(contentsProps.template) || str(contents.template),\n coverImageUrl,\n coverImagePath: pick(coverSources, 'coverImagePath'),\n isCreatingSandbox,\n isDeploying,\n };\n}\n\n/**\n * Published addresses the agent names (web `chat/agentBuild.ts`); its sandbox previews are\n * `sandboxPreviewLinkRe`: on e2b's domains or the platform's sandbox domain, never another host.\n */\nconst LIVE_URL_RE = /https:\\/\\/([a-z0-9][a-z0-9-]{1,60})\\.(?:pages\\.dev|yarntra\\.com)\\b[^\\s)\\]\"'<>*`]*/gi;\nconst RESTORE_POINT_RE = /restore point \\(snapshot `([^`\\s]{4,200})`\\)/gi;\n\nconst trimUrl = (url: string) => url.replace(/[.,;:!?]+$/, '');\n\n/**\n * The last sandbox preview link in the text (the agent's latest), with its sandbox id.\n * An e2b link comes back on the platform's sandbox domain when one is set.\n */\nexport function previewFrom(text: string): { url: string; sandboxId: string } | null {\n const domain = publicSandboxDomain();\n const all = Array.from(text.matchAll(sandboxPreviewLinkRe(domain)));\n const last = all[all.length - 1];\n return last ? { url: withPublicSandboxHosts(trimUrl(last[0]), domain), sandboxId: last[2] } : null;\n}\n\n/** The published address the agent reports: `<name>.yarntra.com` first, pages.dev only when it is the only one (web #428). */\nexport function liveUrlFrom(text: string): string | null {\n const hits = Array.from(text.matchAll(LIVE_URL_RE)).map((m) => trimUrl(m[0]));\n if (!hits.length) return null;\n const hit = hits.find((h) => h.includes('.yarntra.com')) ?? hits[0];\n return shownLiveUrl(hit) ?? hit;\n}\n\n/** The restore point the skill reports: \"Saved a restore point (snapshot `<id>`).\" (design-pro 3.3, #388). */\nexport function snapshotFrom(text: string): string | null {\n const all = Array.from(text.matchAll(RESTORE_POINT_RE));\n return all.length ? all[all.length - 1][1] : null;\n}\n\n/** \"Your Lotus Flow site is built…\", \"**Lotus Flow** is live\" -> \"Lotus Flow\". */\nexport function siteNameFrom(text: string): string | null {\n const m =\n text.match(\n /\\bYour ([A-Z][\\w&'’ .-]{1,40}?)(?: (?:yoga|coffee|wedding|photography|bakery))? (?:site|website|app) is (?:built|ready|live|running)/,\n ) ??\n text.match(/\\*\\*([A-Z][^*\\n]{1,40})\\*\\* is (?:live|ready|built)/) ??\n text.match(/^([A-Z][\\w&'’ .-]{1,40}?) is live at\\b/m);\n return m ? m[1].trim() : null;\n}\n\n/** A sandbox preview link (e2b's or the platform's domain), without the sentence's closing punctuation. */\nfunction sandboxLinkSource(domain: string): string {\n return String.raw`https:\\/\\/\\d{2,5}-[a-z0-9]{8,40}\\.${sandboxPreviewDomainsSource(domain)}\\b(?:[^\\s)\\]\"'<>*\\x60]*[^\\s)\\]\"'<>*\\x60.,;:!?])?`;\n}\n\n/**\n * The agent's reply as the reader sees it. The restore point's id and the sandbox\n * preview are for the builder, not them (web `assistantBubbleContent`, design-pro\n * 3.11): a sandbox link dies with the sandbox (\"Sandbox not found\"), so the site\n * card's Preview, which can wake it, is the way in. Replies from before 3.11 wrote\n * the link in the prose; it goes too, keeping a markdown link's words.\n */\nexport function displayAgentText(text: string): string {\n const link = sandboxLinkSource(publicSandboxDomain());\n // Widget blocks (logo designs) show as their picture, not JSON (web #469); pages.dev is\n // shown as the site's company address (web #446).\n return (\n // The agent's [ASK_USER] question is a card, not prose (also while it streams).\n rewritePagesDevLinks(renderWidgetBlocks(stripAskUser(text)))\n .replace(/(restore point) \\(snapshot `[^`]+`\\)/gi, '$1')\n .replace(/\\s*\\(preview `[^`]+`\\)/gi, '')\n // cdecli's \"billing policy check unavailable … allowing metered action\" is an operator\n // notice, not the answer (a real refusal says \"billing policy blocks\" and stays).\n .replace(/^[ \\t>]*⚠?\\s*billing policy check unavailable\\b[^\\n]*\\n?/gim, '')\n .replace(new RegExp(String.raw`\\[([^\\]]+)\\]\\(${link}\\)`, 'gi'), '$1')\n .replace(new RegExp(String.raw`:?[ \\t]*<?${link}>?`, 'gi'), '')\n .trim()\n );\n}\n\n/**\n * A build named only in the agent's words: the agent-chat lane (template remix,\n * building from chat) replies with the preview link, the live address once it\n * publishes, and its restore point - no fragment - so those are the build.\n */\nfunction linkFragment(post: unknown): Fragment | null {\n const p = (post ?? {}) as Loose;\n const text = typeof p.message === 'string' ? p.message : '';\n const preview = previewFrom(text);\n const liveUrl = liveUrlFrom(text) ?? undefined;\n const snapshotId = snapshotFrom(text) ?? undefined;\n if (!preview && !liveUrl && !snapshotId) return null;\n return {\n sandboxUrl: preview?.url,\n sandboxId: preview?.sandboxId,\n liveUrl,\n snapshotId,\n title: siteNameFrom(text) ?? undefined,\n fromReply: true,\n isCreatingSandbox: false,\n isDeploying: false,\n };\n}\n\nfunction postTime(post: unknown): number {\n const p = (post ?? {}) as Loose;\n const raw = p.updatedAt || p.createdAt;\n const ms = typeof raw === 'number' ? raw : Date.parse(String(raw ?? ''));\n return Number.isFinite(ms) ? ms : 0;\n}\n\n/** Posts in the order they happened (the query is not sorted). */\nfunction chronological(posts: readonly unknown[]): unknown[] {\n return [...posts].sort((a, b) => postTime(a) - postTime(b));\n}\n\nfunction isUserPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const props = asObject(p.props) || {};\n const role = String(props.role ?? contents.role ?? asObject(contents.props)?.role ?? '').toUpperCase();\n return role === 'USER';\n}\n\n/** The stack label the web tile shows when a build does not name one. */\nexport const DEFAULT_TEMPLATE = 'vite-react';\n\n/**\n * Newest-first builds of one site. A later post about the same sandbox (a\n * publish, a re-post, its screenshot) updates that build.\n */\nexport function buildsFromPosts(\n posts: readonly unknown[],\n fallbackTitle?: string,\n cdnOrigin?: string,\n): WebBuilderBuild[] {\n const fallback = fallbackTitle ?? 'Web app';\n const byKey = new Map<string, WebBuilderBuild>();\n let lastKey: string | null = null;\n // The web hydrate's rule: a build is an ASSISTANT post with something to show - a\n // preview URL, a live address or a screenshot. A user turn carries the sandbox it\n // edits (and a bare sandbox id is a turn in flight), neither is a build.\n const fragments = chronological(posts)\n .filter((post) => !isUserPost(post))\n .map((post) => ({ post, fragment: readFragment(post) ?? linkFragment(post) }))\n .filter(\n (row): row is { post: unknown; fragment: Fragment } =>\n row.fragment !== null &&\n Boolean(\n row.fragment.sandboxUrl ||\n row.fragment.liveUrl ||\n row.fragment.coverImageUrl ||\n row.fragment.snapshotId,\n ),\n );\n for (const { post, fragment } of fragments) {\n const previewUrl = sandboxPreviewUrl(fragment.sandboxUrl, fragment.sandboxId);\n const key = fragment.sandboxId || previewUrl || '';\n // A publish or screenshot post may name no sandbox: it belongs to the latest build.\n const target: string | null =\n key || (fragment.liveUrl || fragment.coverImageUrl || fragment.snapshotId ? lastKey : null);\n if (target) {\n const existing = byKey.get(target);\n byKey.set(target, {\n key: target,\n // A workflow fragment names the build; a reply's site name only names a build with none yet.\n title:\n (fragment.fromReply ? existing?.title || fragment.title : fragment.title || existing?.title) ||\n fallback,\n previewUrl: previewUrl || existing?.previewUrl || null,\n sandboxId: fragment.sandboxId || existing?.sandboxId || null,\n projectId: fragment.projectId || existing?.projectId || null,\n liveUrl: fragment.liveUrl || existing?.liveUrl || null,\n files: fragment.files || existing?.files || null,\n snapshotId: fragment.snapshotId || existing?.snapshotId || null,\n origin: existing?.origin === 'workflow' || !fragment.fromReply ? 'workflow' : 'agent',\n templateId: fragment.template || existing?.templateId || DEFAULT_TEMPLATE,\n coverUrl:\n coverDisplayUrl(fragment.coverImageUrl, fragment.coverImagePath, cdnOrigin) ||\n existing?.coverUrl ||\n null,\n updatedAt: Math.max(postTime(post), existing?.updatedAt ?? 0),\n });\n lastKey = target;\n }\n }\n return [...byKey.values()].filter((b) => b.previewUrl || b.liveUrl).sort((a, b) => b.updatedAt - a.updatedAt);\n}\n\n/** The newest post flags a sandbox still being created or a publish still running. */\nexport function pendingWork(posts: readonly unknown[]): 'creating' | 'publishing' | null {\n const newest = chronological(posts)\n .map((post) => readFragment(post))\n .filter((f): f is Fragment => f !== null)\n .pop();\n if (!newest) return null;\n if (newest.isCreatingSandbox && !newest.sandboxUrl && !newest.sandboxId) return 'creating';\n if (newest.isDeploying && !newest.liveUrl) return 'publishing';\n return null;\n}\n\n// ── Titles: the web surface's `resolveArtifactTitle` rules ─────────────────\n\n/** Not a product name: what the workflow and the chat call a site before it has one. */\nexport function isGenericTitle(title?: string | null): boolean {\n const t = (title || '').trim().toLowerCase();\n return (\n !t ||\n t === 'generated page' ||\n t === 'generated project' ||\n t === 'generated with cdecli' ||\n t === 'ai assistant' ||\n t === 'web app' ||\n /^build \\d+$/.test(t) ||\n /^build\\s+me\\b/.test(t) ||\n /^remix\\s+the\\b/.test(t) ||\n /^(build|chat)[- ]channel\\b/.test(t) ||\n t.startsWith('selected skill') ||\n /^code[\\s_-]?assist/.test(t)\n );\n}\n\nconst TITLE_STOP_WORDS = new Set([\n 'a',\n 'an',\n 'the',\n 'create',\n 'build',\n 'make',\n 'please',\n 'me',\n 'my',\n 'for',\n 'with',\n 'simple',\n 'using',\n 'from',\n 'template',\n 'to',\n 'and',\n 'or',\n 'remix',\n 'yantra',\n]);\n\nfunction titleCase(words: string[]): string {\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');\n}\n\n/** The person's words, without the internal lines a turn carries. */\nexport function cleanPrompt(text: string): string {\n return text\n .replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '')\n .replace(/^build\\s*me\\s*:\\s*/i, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Product name from a brief: \"Build me: todo app\" -> \"Todo App\". An edit\n * (\"make the header blue\") is not a name.\n */\nexport function titleFromPrompt(message?: string | null): string | null {\n const raw = (message || '').replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '').trim();\n if (!raw) return null;\n const buildMe = raw.match(/^\\s*Build me:\\s*(.+)$/im)?.[1]?.trim();\n if (!buildMe && /^(change|update|rename|fix|edit|add|remove|delete|improve|make|refactor)\\b/i.test(raw)) {\n return null;\n }\n const source = (buildMe || raw.split(/\\n+/)[0] || '').replace(/^[\"']|[\"']$/g, '');\n const words = source\n .replace(/[^\\w\\s-]/g, ' ')\n .split(/\\s+/)\n .filter((w) => w.length > 1 && !TITLE_STOP_WORDS.has(w.toLowerCase()))\n .slice(0, 3);\n if (!words.length) return null;\n const title = titleCase(words);\n return isGenericTitle(title) ? null : title;\n}\n\n/** `package.json` name of the build (\"bakery-site\" -> \"Bakery Site\"). */\nfunction titleFromPackageJson(files?: Record<string, string> | null): string | null {\n if (!files) return null;\n const raw = Object.entries(files).find(([path]) => /(^|\\/)package\\.json$/.test(path))?.[1];\n if (!raw) return null;\n try {\n const name = String((JSON.parse(raw) as { name?: string }).name || '').trim();\n if (!name || name === 'vite-react' || name === 'project') return null;\n return name\n .replace(/^@[^/]+\\//, '')\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n } catch {\n return null;\n }\n}\n\n/** The build's own title, then the brief's product name, the chat's name, the package name. */\nexport function resolveSiteTitle(opts: {\n fragmentTitle?: string | null;\n channelTitle?: string | null;\n userPrompt?: string | null;\n files?: Record<string, string> | null;\n}): string {\n const candidates = [\n opts.fragmentTitle,\n titleFromPrompt(opts.userPrompt),\n opts.channelTitle,\n titleFromPackageJson(opts.files),\n ];\n const found = candidates.find((c) => c && !isGenericTitle(c));\n return (found || 'Generated Page').trim();\n}\n\n// ── Sites ──────────────────────────────────────────────────────────────────\n\nexport interface ChannelLike {\n id?: string | null;\n title?: string | null;\n displayName?: string | null;\n updatedAt?: unknown;\n createdAt?: unknown;\n lastMessage?: unknown;\n}\n\n/** True when the newest build in `lastMessage` already carries a cover - the web skips the thread read then. */\nexport function lastMessageHasCover(channel: ChannelLike): boolean {\n return Boolean(readFragment(channel.lastMessage)?.coverImageUrl);\n}\n\n/**\n * A site from one chat's posts, the way the web gallery hydrates a tile: only\n * a chat with a build is a site; its name follows `resolveSiteTitle`.\n */\nexport function projectFromPosts(\n channel: ChannelLike,\n posts: readonly unknown[],\n cdnOrigin?: string,\n): WebBuilderProject | null {\n const channelId = str(channel.id);\n if (!channelId) return null;\n const builds = buildsFromPosts(posts, '', cdnOrigin);\n const latest = builds[0];\n if (!latest) return null;\n const userPrompts = chronological(posts)\n .filter((post) => isUserPost(post) && str((post as Loose).message))\n .map((post) => String((post as Loose).message));\n // The brief names the product (\"Build me: …\"); a later message (\"the live preview is\n // not loading\") never does, so only the brief - or failing that the first ask - counts.\n const brief = userPrompts.find((m) => /build\\s*me\\s*:/i.test(m)) ?? userPrompts[0];\n const rawChannelTitle = [channel.displayName, channel.title]\n .map((t) => str(t))\n .find((t) => t && !isGenericTitle(t));\n // A chat named after its brief (\"Build simple calculator app\") gives the product name, not the sentence.\n const channelTitle =\n rawChannelTitle && /^(build|create|make)\\b/i.test(rawChannelTitle)\n ? (titleFromPrompt(rawChannelTitle) ?? rawChannelTitle)\n : rawChannelTitle;\n const title = resolveSiteTitle({\n fragmentTitle: latest.title,\n channelTitle,\n userPrompt: brief,\n files: latest.files,\n });\n const updated = Date.parse(String(channel.updatedAt ?? channel.createdAt ?? ''));\n return {\n channelId,\n title,\n updatedAt: Math.max(Number.isFinite(updated) ? updated : 0, latest.updatedAt),\n previewUrl: latest.previewUrl,\n liveUrl: builds.find((b) => b.liveUrl)?.liveUrl ?? null,\n coverUrl: builds.find((b) => b.coverUrl)?.coverUrl ?? null,\n templateId: latest.templateId,\n };\n}\n\n/** `?wb=<n>` on the preview so a rebuilt sandbox is fetched again, not served from cache. */\nexport function cacheBustedUrl(url: string, nonce: number | string): string {\n const [base, hash = ''] = url.split('#');\n const clean = base.replace(/([?&])wb=[^&]*(&|$)/, '$1').replace(/[?&]$/, '');\n const sep = clean.includes('?') ? '&' : '?';\n return `${clean}${sep}wb=${nonce}${hash ? `#${hash}` : ''}`;\n}\n\n/**\n * The publish name the web dialog suggests: the site's title as a slug,\n * `[a-z0-9-]`, at most 58 characters (`<name>.yarntra.com`).\n */\nexport function publishSlug(title: string): string {\n const slug = title\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 58)\n .replace(/-+$/, '');\n return slug || 'my-site';\n}\n\nexport function isValidPublishSlug(value: string): boolean {\n return /^[a-z0-9](?:[a-z0-9-]{0,56}[a-z0-9])?$/.test(value);\n}\n\n/** Display host of a URL: `https://bakery.pages.dev/` -> `bakery.pages.dev`. */\nexport function displayHost(url: string | null | undefined): string {\n const match = /^https?:\\/\\/([^/?#]+)/i.exec((url ?? '').trim());\n return match ? match[1] : (url ?? '').trim();\n}\n\n/** \"just now\", \"5 min ago\", \"3 h ago\", \"Yesterday\", \"12 Oct\". */\nexport function relativeTime(ms: number, now = Date.now()): string {\n if (!ms) return '';\n const diff = Math.max(0, now - ms);\n const min = Math.floor(diff / 60_000);\n if (min < 1) return 'just now';\n if (min < 60) return `${min} min ago`;\n const hours = Math.floor(min / 60);\n if (hours < 24) return `${hours} h ago`;\n if (hours < 48) return 'Yesterday';\n const d = new Date(ms);\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${d.getDate()} ${months[d.getMonth()]}`;\n}\n\n// ── The agent transcript: the build chat's posts, as the web Agent pane shows them ──\n\n/** A live progress row (web `isThinkingPost`): shown as the agent's status, never kept. */\nexport function isThinkingPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const attachment = asObject(props.attachment) || {};\n const msg = String(p.message ?? '')\n .trim()\n .toLowerCase();\n return (\n String(p.type ?? '').toUpperCase() === 'THINKING' ||\n Boolean(props.thinking ?? props.isThinking) ||\n props.kind === 'thinking' ||\n Boolean(attachment.isThinking) ||\n msg === 'thinking...' ||\n msg === 'initializing...' ||\n msg === 'initializing…'\n );\n}\n\nfunction readFragmentStatus(p: Loose): string | undefined {\n const contents = asObject(p.propsConfiguration?.contents) || {};\n return (\n str(asObject(asObject(contents.props)?.fragment)?.statusText) || str(asObject(contents.fragment)?.statusText)\n );\n}\n\n/** The workflow's progress line on a post: its thought, else the fragment's status. */\nexport function progressText(post: unknown): string | null {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const thought = str(asObject(props.attachment)?.thought);\n if (thought) return thought;\n const status = str(asObject(props.fragment)?.statusText) || str(readFragmentStatus(p));\n if (status) return status;\n return isThinkingPost(post) ? (str(p.message) ?? null) : null;\n}\n\n/** A post the workflow wrote when the build failed (`fragment.isError` / `type: 'error'`). */\nexport function isErrorPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const f =\n asObject(props.fragment) || asObject(asObject(contents.props)?.fragment) || asObject(contents.fragment) || {};\n return f.isError === true || f.type === 'error';\n}\n\nexport interface TranscriptMessage {\n id: string;\n role: 'user' | 'assistant';\n content: string;\n createdAt: number;\n}\n\n/**\n * The conversation in a build chat: the person's turns and the agent's replies,\n * oldest first, without progress rows or empty build markers.\n */\nexport function transcriptFromPosts(posts: readonly unknown[]): TranscriptMessage[] {\n const out: TranscriptMessage[] = [];\n for (const post of chronological(posts)) {\n const p = post as Loose;\n const text = str(p.message);\n if (text && !isThinkingPost(post)) {\n const user = isUserPost(post);\n out.push({\n id: String(p.id ?? `${user ? 'u' : 'a'}-${out.length}`),\n role: user ? 'user' : 'assistant',\n content: user ? cleanPrompt(text) || text : text,\n createdAt: postTime(post),\n });\n }\n }\n return out;\n}\n\n/**\n * How a turn started at `since` is going, read from the posts that arrived after it.\n * `heard` is whether the build posted anything back yet (a progress row, an answer).\n */\nexport function turnState(\n posts: readonly unknown[],\n since: number,\n): { status: 'running' | 'done' | 'failed'; progress: string | null; error: string | null; heard: boolean } {\n // A clock skew allowance, as the web ignores posts older than start - 2 s.\n const after = chronological(posts).filter((post) => postTime(post) >= since - 2_000);\n let progress: string | null = null;\n for (const post of after) {\n if (!isUserPost(post)) {\n if (isErrorPost(post)) {\n const p = post as Loose;\n return { status: 'failed', progress: null, error: str(p.message) ?? 'The build failed.', heard: true };\n }\n const fragment = readFragment(post);\n if (fragment && (fragment.sandboxUrl || fragment.liveUrl) && !isThinkingPost(post)) {\n return { status: 'done', progress: null, error: null, heard: true };\n }\n progress = progressText(post) ?? progress;\n }\n }\n // A plain answer (the agent asked a question, or replied without building) ends\n // the turn too - unless progress rows keep arriving after it.\n const newest = after.filter((post) => !isUserPost(post)).pop() as Loose | undefined;\n if (newest && !isThinkingPost(newest) && !progressText(newest) && str(newest.message)) {\n return { status: 'done', progress: null, error: null, heard: true };\n }\n return { status: 'running', progress, error: null, heard: Boolean(newest) };\n}\n\n/**\n * A turn sent through the build workflow: its USER post carries the workflow's\n * route (`templateTarget`). A blank build sends an empty fragment, which\n * the server drops, so this post is the only workflow mark until a build lands.\n */\nfunction isWorkflowTurnPost(post: unknown): boolean {\n if (!post || typeof post !== 'object') return false;\n const p = post as Loose;\n const contents = asObject(p.propsConfiguration?.contents) || {};\n return Boolean(str(asObject(p.props)?.templateTarget) || str(asObject(contents.props)?.templateTarget));\n}\n\n/**\n * The chat was built through the build workflow (its posts carry fragments or\n * the workflow's route): edits go back through the workflow. A chat without\n * any is an agent-chat site (a template remix), and its turns stay in the\n * agent chat.\n */\nexport function hasWorkflowPosts(posts: readonly unknown[]): boolean {\n return posts.some((post) => readFragment(post) !== null || isWorkflowTurnPost(post));\n}\n\n/** The person's words, without the agent-only template note a remix turn carries. */\nexport function stripAgentNote(content: string): string {\n return content.replace(/\\n*\\[(?:Template|Open build|Export)\\][\\s\\S]*$/, '').trim();\n}\n"],"names":["_a"],"mappings":"uZA0CA,SAAS,SAAS,KAA8B,EAAA;AAC9C,EAAI,IAAA,CAAC,OAAc,OAAA,IAAA;AACnB,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA,OAAO,MAAM,OAAQ,CAAA,KAAK,IAAI,IAAO,GAAA,KAAA;AACpE,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAC7B,IAAM,MAAA,OAAA,GAAU,MAAM,IAAK,EAAA;AAC3B,IAAA,IAAI,CAAC,OAAA,CAAQ,UAAW,CAAA,GAAG,GAAU,OAAA,IAAA;AACrC,IAAI,IAAA;AACF,MAAM,MAAA,MAAA,GAAS,IAAK,CAAA,KAAA,CAAM,OAAO,CAAA;AACjC,MAAA,OAAO,MAAU,IAAA,OAAO,MAAW,KAAA,QAAA,GAAW,MAAkB,GAAA,IAAA;AAAA,KAC1D,CAAA,OAAA,CAAA,EAAA;AACN,MAAO,OAAA,IAAA;AAAA;AACT;AAEF,EAAO,OAAA,IAAA;AACT;AACA,SAAS,IAAI,KAAoC,EAAA;AAC/C,EAAO,OAAA,OAAO,UAAU,QAAY,IAAA,KAAA,CAAM,MAAS,GAAA,KAAA,CAAM,MAAS,GAAA,MAAA;AACpE;AAGA,SAAS,eAA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;AAAA,IACP,KAAA,EAAO,QAAQ,MAAM;AAAA,GACvB;AACF;AAOA,SAAS,mBAAmB,IAAwB,EAAA;AA/lBpD,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAgmBE,EAAA,IAAI,CAAC,IAAA,IAAQ,OAAO,IAAA,KAAS,UAAiB,OAAA,KAAA;AAC9C,EAAA,MAAM,CAAI,GAAA,IAAA;AACV,EAAA,MAAM,WAAW,QAAS,CAAA,CAAA,EAAA,GAAA,CAAA,CAAE,uBAAF,IAAsB,GAAA,MAAA,GAAA,EAAA,CAAA,QAAQ,KAAK,EAAC;AAC9D,EAAA,OAAO,QAAQ,GAAI,CAAA,CAAA,EAAA,GAAA,QAAA,CAAS,CAAE,CAAA,KAAK,MAAhB,IAAmB,GAAA,MAAA,GAAA,EAAA,CAAA,cAAc,CAAK,IAAA,GAAA,CAAA,CAAI,cAAS,QAAS,CAAA,KAAK,CAAvB,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAA0B,cAAc,CAAC,CAAA;AACxG;AAQO,SAAS,iBAAiB,KAAoC,EAAA;AACnE,EAAO,OAAA,KAAA,CAAM,KAAK,CAAQ,IAAA,KAAA,YAAA,CAAa,IAAI,CAAM,KAAA,IAAA,IAAQ,kBAAmB,CAAA,IAAI,CAAC,CAAA;AACnF;AAGO,SAAS,eAAe,OAAyB,EAAA;AACtD,EAAA,OAAO,OAAQ,CAAA,OAAA,CAAQ,+CAAiD,EAAA,EAAE,EAAE,IAAK,EAAA;AACnF"}
|
|
1
|
+
{"version":3,"file":"buildFragments.js","sources":["../../../src/features/webbuilder/buildFragments.ts"],"sourcesContent":["/**\n * Reads builds out of a build chat's posts.\n *\n * The build workflow posts its result as a \"fragment\" on an assistant post:\n * sandbox id and preview URL, the source files, and after a publish the live\n * address. Native twin of the web host's `creationsFromMessages`\n * (browser `pages/webbuilder/remoteWebbuilder.ts`) and the surface's\n * `extractFragmentFromSource` lookup order: `propsConfiguration.contents`\n * first (where the real fragment lives; `props` is account-scoped), then the\n * post's own fields. Pure but for the platform's sandbox domain, read from\n * config (publicSandboxDomain), so the host and jest can both use it.\n */\nimport type { WebBuilderBuild, WebBuilderProject } from './types';\nimport { rewritePagesDevLinks, shownLiveUrl, siteAddress } from './siteAddress';\nimport { publicSandboxDomain } from './publicSandboxDomain';\nimport {\n DEFAULT_E2B_SANDBOX_DOMAIN,\n previewDomainFor,\n sandboxPreviewDomainsSource,\n sandboxPreviewLinkRe,\n sandboxPreviewUrlFor,\n withPublicSandboxHosts,\n} from './sandboxPublicHost';\nimport { renderWidgetBlocks } from './widgetBlocks';\nimport { stripAskUser } from '../chat/askUser';\n\ntype Loose = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n\ninterface Fragment {\n sandboxUrl?: string;\n sandboxId?: string;\n liveUrl?: string;\n files?: Record<string, string> | null;\n title?: string;\n projectId?: string;\n /** Stack the build was made from (`vite-react`, `nextjs`), shown on the tile. */\n template?: string;\n /** Screenshot of the build: an object key or a full URL. */\n coverImageUrl?: string;\n /** CDN origin the cover key was stored under. */\n coverImagePath?: string;\n /** The agent's restore point for this build (design-pro snapshots after each turn). */\n snapshotId?: string;\n /** Read from the agent's words (the agent-chat lane), not a workflow fragment. */\n fromReply?: boolean;\n isCreatingSandbox: boolean;\n isDeploying: boolean;\n}\n\n/** `contents` arrives as an object or, from some resolvers, as JSON text. */\nfunction asObject(value: unknown): Loose | null {\n if (!value) return null;\n if (typeof value === 'object') return Array.isArray(value) ? null : (value as Loose);\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed.startsWith('{')) return null;\n try {\n const parsed = JSON.parse(trimmed);\n return parsed && typeof parsed === 'object' ? (parsed as Loose) : null;\n } catch {\n return null;\n }\n }\n return null;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\n/** `props` is account-scoped (`props[\"<accountId>\"] = {…}`): the records one level down. */\nfunction accountRecords(record: Loose): Loose[] {\n return Object.values(record)\n .map((v) => asObject(v))\n .filter((v): v is Loose => v !== null);\n}\n\n/** First non-empty string among `key` on each record (and on its `fragment`). */\nfunction pick(records: Loose[], key: string): string | undefined {\n for (const record of records) {\n const value = str(record[key]) || str(asObject(record.fragment)?.[key]);\n if (value) return value;\n }\n return undefined;\n}\n\n/** A live sandbox URL (`https://3000-<id>.sb.yantra.app`, `.e2b.dev`, any domain) - never a cover. */\nconst LIVE_SANDBOX = /^https?:\\/\\/\\d+-[a-z0-9]+(\\.|\\/|$)/i;\n\n/**\n * The preview origin for a sandbox. A bare `https://3000-<id>` (no domain) is\n * the E2B default domain, as the surface's `liveSandboxIframeSrc` maps it. An\n * e2b cloud preview is shown on the platform's sandbox domain when one is set\n * (`E2B_SANDBOX_DOMAIN`), and so is a preview named only by its sandbox id.\n */\nexport function sandboxPreviewUrl(url: string | undefined, sandboxId: string | undefined): string | null {\n const domain = publicSandboxDomain();\n const given = str(url);\n if (given) {\n if (/^https?:\\/\\/\\d+-[a-z0-9]+\\/?$/i.test(given)) {\n return `${given.replace(/\\/$/, '')}.${previewDomainFor(DEFAULT_E2B_SANDBOX_DOMAIN, domain)}`;\n }\n return withPublicSandboxHosts(given, domain);\n }\n const id = str(sandboxId);\n return id ? sandboxPreviewUrlFor(id, domain) : null;\n}\n\nfunction httpOrigin(value: string | undefined): string | null {\n const match = /^(https?:\\/\\/[^/?#]+)/i.exec((value ?? '').trim());\n return match && !LIVE_SANDBOX.test(match[1]) ? match[1] : null;\n}\n\n/**\n * The image to show for a cover - the web `resolveCoverDisplayUrl`: an object\n * key joined to the origin it was stored under, else to the app's CDN, else a\n * full https URL as given. A live sandbox URL is never a cover.\n */\nexport function coverDisplayUrl(cover: string | undefined, path?: string, cdnOrigin?: string): string | null {\n const raw = str(cover);\n if (!raw || LIVE_SANDBOX.test(raw)) return null;\n if (/^https?:\\/\\//i.test(raw)) return raw.split('?')[0];\n const key = raw.replace(/^\\/+/, '');\n if (!/\\/uploads\\//i.test(`/${key}`) && !/\\.(png|jpe?g|webp|gif|svg)$/i.test(key)) return null;\n const origin = httpOrigin(path) || httpOrigin(cdnOrigin);\n return origin ? `${origin}/${key}` : null;\n}\n\nexport function readFragment(post: unknown): Fragment | null {\n if (!post || typeof post !== 'object') return null;\n const p = post as Loose;\n const cfg: Loose = p.propsConfiguration || {};\n const contents: Loose = asObject(cfg.contents) || asObject(cfg.content) || {};\n const contentsProps: Loose = asObject(contents.props) || {};\n const props: Loose = asObject(p.props) || {};\n const fragment: Loose | null =\n asObject(contentsProps.fragment) ||\n asObject(contents.fragment) ||\n asObject(cfg.fragment) ||\n asObject(props.fragment) ||\n asObject(p.fragment) ||\n null;\n const f: Loose = fragment || {};\n const sandboxUrl = str(f.sandboxUrl) || str(f.url) || str(p.sandboxUrl) || str(contents.sandboxUrl);\n const sandboxId = str(f.sandboxId) || str(p.sandboxId) || str(contents.sandboxId) || str(cfg.sandboxId);\n const publish = asObject(f.publish);\n // Shown on the custom or company domain, never pages.dev (web `siteAddress`, #446).\n const liveUrl =\n siteAddress({\n customDomainUrl: str(f.customDomainUrl),\n urls: [str(f.cloudflareUrl), str(f.deployUrl), str(publish?.url)],\n projectName: str(publish?.projectName) || str(f.projectName),\n }) || undefined;\n const attachment = asObject(props.attachment) || asObject(contents.attachment) || {};\n const isCreatingSandbox =\n f.isCreatingSandbox === true || contents.isCreatingSandbox === true || p.isCreatingSandbox === true;\n const isDeploying = attachment.isDeploying === true || f.isDeploying === true;\n if (!sandboxUrl && !sandboxId && !liveUrl && !fragment && !isCreatingSandbox && !isDeploying) return null;\n const files = f.files && typeof f.files === 'object' ? (f.files as Record<string, string>) : null;\n // The cover rides on the fragment, the post's props, or an account record of either.\n const coverSources = [f, props, contents, contentsProps, p, ...accountRecords(props), ...accountRecords(contents)];\n const coverImageUrl = [\n pick(coverSources, 'coverImageUrl'),\n pick(coverSources, 'previewImageUrl'),\n str(f.cover),\n ].find((c) => c && !LIVE_SANDBOX.test(c));\n return {\n sandboxUrl,\n sandboxId,\n liveUrl,\n files,\n title: str(f.title),\n projectId: str(f.projectId) || str(contentsProps.projectId),\n template: str(f.templateId) || str(f.template) || str(contentsProps.template) || str(contents.template),\n coverImageUrl,\n coverImagePath: pick(coverSources, 'coverImagePath'),\n isCreatingSandbox,\n isDeploying,\n };\n}\n\n/**\n * Published addresses the agent names (web `chat/agentBuild.ts`); its sandbox previews are\n * `sandboxPreviewLinkRe`: on e2b's domains or the platform's sandbox domain, never another host.\n */\nconst LIVE_URL_RE = /https:\\/\\/([a-z0-9][a-z0-9-]{1,60})\\.(?:pages\\.dev|yarntra\\.com)\\b[^\\s)\\]\"'<>*`]*/gi;\nconst RESTORE_POINT_RE = /restore point \\(snapshot `([^`\\s]{4,200})`\\)/gi;\n\nconst trimUrl = (url: string) => url.replace(/[.,;:!?]+$/, '');\n\n/**\n * The last sandbox preview link in the text (the agent's latest), with its sandbox id.\n * An e2b link comes back on the platform's sandbox domain when one is set.\n */\nexport function previewFrom(text: string): { url: string; sandboxId: string } | null {\n const domain = publicSandboxDomain();\n const all = Array.from(text.matchAll(sandboxPreviewLinkRe(domain)));\n const last = all[all.length - 1];\n return last ? { url: withPublicSandboxHosts(trimUrl(last[0]), domain), sandboxId: last[2] } : null;\n}\n\n/** The published address the agent reports: `<name>.yarntra.com` first, pages.dev only when it is the only one (web #428). */\nexport function liveUrlFrom(text: string): string | null {\n const hits = Array.from(text.matchAll(LIVE_URL_RE)).map((m) => trimUrl(m[0]));\n if (!hits.length) return null;\n const hit = hits.find((h) => h.includes('.yarntra.com')) ?? hits[0];\n return shownLiveUrl(hit) ?? hit;\n}\n\n/** The restore point the skill reports: \"Saved a restore point (snapshot `<id>`).\" (design-pro 3.3, #388). */\nexport function snapshotFrom(text: string): string | null {\n const all = Array.from(text.matchAll(RESTORE_POINT_RE));\n return all.length ? all[all.length - 1][1] : null;\n}\n\n/** \"Your Lotus Flow site is built…\", \"**Lotus Flow** is live\" -> \"Lotus Flow\". */\nexport function siteNameFrom(text: string): string | null {\n const m =\n text.match(\n /\\bYour ([A-Z][\\w&'’ .-]{1,40}?)(?: (?:yoga|coffee|wedding|photography|bakery))? (?:site|website|app) is (?:built|ready|live|running)/,\n ) ??\n text.match(/\\*\\*([A-Z][^*\\n]{1,40})\\*\\* is (?:live|ready|built)/) ??\n text.match(/^([A-Z][\\w&'’ .-]{1,40}?) is live at\\b/m);\n return m ? m[1].trim() : null;\n}\n\n/** A sandbox preview link (e2b's or the platform's domain), without the sentence's closing punctuation. */\nfunction sandboxLinkSource(domain: string): string {\n return String.raw`https:\\/\\/\\d{2,5}-[a-z0-9]{8,40}\\.${sandboxPreviewDomainsSource(domain)}\\b(?:[^\\s)\\]\"'<>*\\x60]*[^\\s)\\]\"'<>*\\x60.,;:!?])?`;\n}\n\n/**\n * The agent's reply as the reader sees it. The restore point's id and the sandbox\n * preview are for the builder, not them (web `assistantBubbleContent`, design-pro\n * 3.11): a sandbox link dies with the sandbox (\"Sandbox not found\"), so the site\n * card's Preview, which can wake it, is the way in. Replies from before 3.11 wrote\n * the link in the prose; it goes too, keeping a markdown link's words.\n */\nexport function displayAgentText(text: string): string {\n const link = sandboxLinkSource(publicSandboxDomain());\n // Widget blocks (logo designs) show as their picture, not JSON (web #469); pages.dev is\n // shown as the site's company address (web #446).\n return (\n // The agent's [ASK_USER] question is a card, not prose (also while it streams).\n rewritePagesDevLinks(renderWidgetBlocks(stripAskUser(text)))\n .replace(/(restore point) \\(snapshot `[^`]+`\\)/gi, '$1')\n .replace(/\\s*\\(preview `[^`]+`\\)/gi, '')\n // cdecli's \"billing policy check unavailable … allowing metered action\" is an operator\n // notice, not the answer (a real refusal says \"billing policy blocks\" and stays).\n .replace(/^[ \\t>]*⚠?\\s*billing policy check unavailable\\b[^\\n]*\\n?/gim, '')\n .replace(new RegExp(String.raw`\\[([^\\]]+)\\]\\(${link}\\)`, 'gi'), '$1')\n .replace(new RegExp(String.raw`:?[ \\t]*<?${link}>?`, 'gi'), '')\n .trim()\n );\n}\n\n/**\n * A build named only in the agent's words: the agent-chat lane (template remix,\n * building from chat) replies with the preview link, the live address once it\n * publishes, and its restore point - no fragment - so those are the build.\n */\nfunction linkFragment(post: unknown): Fragment | null {\n const p = (post ?? {}) as Loose;\n const text = typeof p.message === 'string' ? p.message : '';\n const preview = previewFrom(text);\n const liveUrl = liveUrlFrom(text) ?? undefined;\n const snapshotId = snapshotFrom(text) ?? undefined;\n if (!preview && !liveUrl && !snapshotId) return null;\n return {\n sandboxUrl: preview?.url,\n sandboxId: preview?.sandboxId,\n liveUrl,\n snapshotId,\n title: siteNameFrom(text) ?? undefined,\n fromReply: true,\n isCreatingSandbox: false,\n isDeploying: false,\n };\n}\n\nfunction postTime(post: unknown): number {\n const p = (post ?? {}) as Loose;\n const raw = p.updatedAt || p.createdAt;\n const ms = typeof raw === 'number' ? raw : Date.parse(String(raw ?? ''));\n return Number.isFinite(ms) ? ms : 0;\n}\n\n/** Posts in the order they happened (the query is not sorted). */\nfunction chronological(posts: readonly unknown[]): unknown[] {\n return [...posts].sort((a, b) => postTime(a) - postTime(b));\n}\n\nfunction isUserPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const props = asObject(p.props) || {};\n const role = String(props.role ?? contents.role ?? asObject(contents.props)?.role ?? '').toUpperCase();\n return role === 'USER';\n}\n\n/** The stack label the web tile shows when a build does not name one. */\nexport const DEFAULT_TEMPLATE = 'vite-react';\n\n/**\n * Newest-first builds of one site. A later post about the same sandbox (a\n * publish, a re-post, its screenshot) updates that build.\n */\nexport function buildsFromPosts(\n posts: readonly unknown[],\n fallbackTitle?: string,\n cdnOrigin?: string,\n): WebBuilderBuild[] {\n const fallback = fallbackTitle ?? 'Web app';\n const byKey = new Map<string, WebBuilderBuild>();\n let lastKey: string | null = null;\n // The web hydrate's rule: a build is an ASSISTANT post with something to show - a\n // preview URL, a live address or a screenshot. A user turn carries the sandbox it\n // edits (and a bare sandbox id is a turn in flight), neither is a build.\n const fragments = chronological(posts)\n .filter((post) => !isUserPost(post))\n .map((post) => ({ post, fragment: readFragment(post) ?? linkFragment(post) }))\n .filter(\n (row): row is { post: unknown; fragment: Fragment } =>\n row.fragment !== null &&\n Boolean(\n row.fragment.sandboxUrl ||\n row.fragment.liveUrl ||\n row.fragment.coverImageUrl ||\n row.fragment.snapshotId,\n ),\n );\n for (const { post, fragment } of fragments) {\n const previewUrl = sandboxPreviewUrl(fragment.sandboxUrl, fragment.sandboxId);\n const key = fragment.sandboxId || previewUrl || '';\n // A publish or screenshot post may name no sandbox: it belongs to the latest build.\n const target: string | null =\n key || (fragment.liveUrl || fragment.coverImageUrl || fragment.snapshotId ? lastKey : null);\n if (target) {\n const existing = byKey.get(target);\n byKey.set(target, {\n key: target,\n // A workflow fragment names the build; a reply's site name only names a build with none yet.\n title:\n (fragment.fromReply ? existing?.title || fragment.title : fragment.title || existing?.title) ||\n fallback,\n previewUrl: previewUrl || existing?.previewUrl || null,\n sandboxId: fragment.sandboxId || existing?.sandboxId || null,\n projectId: fragment.projectId || existing?.projectId || null,\n liveUrl: fragment.liveUrl || existing?.liveUrl || null,\n files: fragment.files || existing?.files || null,\n snapshotId: fragment.snapshotId || existing?.snapshotId || null,\n origin: existing?.origin === 'workflow' || !fragment.fromReply ? 'workflow' : 'agent',\n templateId: fragment.template || existing?.templateId || DEFAULT_TEMPLATE,\n coverUrl:\n coverDisplayUrl(fragment.coverImageUrl, fragment.coverImagePath, cdnOrigin) ||\n existing?.coverUrl ||\n null,\n updatedAt: Math.max(postTime(post), existing?.updatedAt ?? 0),\n });\n lastKey = target;\n }\n }\n return [...byKey.values()].filter((b) => b.previewUrl || b.liveUrl).sort((a, b) => b.updatedAt - a.updatedAt);\n}\n\n/** The newest post flags a sandbox still being created or a publish still running. */\nexport function pendingWork(posts: readonly unknown[]): 'creating' | 'publishing' | null {\n const newest = chronological(posts)\n .map((post) => readFragment(post))\n .filter((f): f is Fragment => f !== null)\n .pop();\n if (!newest) return null;\n if (newest.isCreatingSandbox && !newest.sandboxUrl && !newest.sandboxId) return 'creating';\n if (newest.isDeploying && !newest.liveUrl) return 'publishing';\n return null;\n}\n\n// ── Titles: the web surface's `resolveArtifactTitle` rules ─────────────────\n\n/** Not a product name: what the workflow and the chat call a site before it has one. */\nexport function isGenericTitle(title?: string | null): boolean {\n const t = (title || '').trim().toLowerCase();\n return (\n !t ||\n t === 'generated page' ||\n t === 'generated project' ||\n t === 'generated with cdecli' ||\n t === 'ai assistant' ||\n t === 'web app' ||\n /^build \\d+$/.test(t) ||\n /^build\\s+me\\b/.test(t) ||\n /^remix\\s+the\\b/.test(t) ||\n /^(build|chat)[- ]channel\\b/.test(t) ||\n t.startsWith('selected skill') ||\n /^code[\\s_-]?assist/.test(t)\n );\n}\n\nconst TITLE_STOP_WORDS = new Set([\n 'a',\n 'an',\n 'the',\n 'create',\n 'build',\n 'make',\n 'please',\n 'me',\n 'my',\n 'for',\n 'with',\n 'simple',\n 'using',\n 'from',\n 'template',\n 'to',\n 'and',\n 'or',\n 'remix',\n 'yantra',\n]);\n\nfunction titleCase(words: string[]): string {\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');\n}\n\n/** The person's words, without the internal lines a turn carries. */\nexport function cleanPrompt(text: string): string {\n return text\n .replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '')\n .replace(/^build\\s*me\\s*:\\s*/i, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Product name from a brief: \"Build me: todo app\" -> \"Todo App\". An edit\n * (\"make the header blue\") is not a name.\n */\nexport function titleFromPrompt(message?: string | null): string | null {\n const raw = (message || '').replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '').trim();\n if (!raw) return null;\n const buildMe = raw.match(/^\\s*Build me:\\s*(.+)$/im)?.[1]?.trim();\n if (!buildMe && /^(change|update|rename|fix|edit|add|remove|delete|improve|make|refactor)\\b/i.test(raw)) {\n return null;\n }\n const source = (buildMe || raw.split(/\\n+/)[0] || '').replace(/^[\"']|[\"']$/g, '');\n const words = source\n .replace(/[^\\w\\s-]/g, ' ')\n .split(/\\s+/)\n .filter((w) => w.length > 1 && !TITLE_STOP_WORDS.has(w.toLowerCase()))\n .slice(0, 3);\n if (!words.length) return null;\n const title = titleCase(words);\n return isGenericTitle(title) ? null : title;\n}\n\n/** `package.json` name of the build (\"bakery-site\" -> \"Bakery Site\"). */\nfunction titleFromPackageJson(files?: Record<string, string> | null): string | null {\n if (!files) return null;\n const raw = Object.entries(files).find(([path]) => /(^|\\/)package\\.json$/.test(path))?.[1];\n if (!raw) return null;\n try {\n const name = String((JSON.parse(raw) as { name?: string }).name || '').trim();\n if (!name || name === 'vite-react' || name === 'project') return null;\n return name\n .replace(/^@[^/]+\\//, '')\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n } catch {\n return null;\n }\n}\n\n/** The build's own title, then the brief's product name, the chat's name, the package name. */\nexport function resolveSiteTitle(opts: {\n fragmentTitle?: string | null;\n channelTitle?: string | null;\n userPrompt?: string | null;\n files?: Record<string, string> | null;\n}): string {\n const candidates = [\n opts.fragmentTitle,\n titleFromPrompt(opts.userPrompt),\n opts.channelTitle,\n titleFromPackageJson(opts.files),\n ];\n const found = candidates.find((c) => c && !isGenericTitle(c));\n return (found || 'Generated Page').trim();\n}\n\n// ── Sites ──────────────────────────────────────────────────────────────────\n\nexport interface ChannelLike {\n id?: string | null;\n title?: string | null;\n displayName?: string | null;\n updatedAt?: unknown;\n createdAt?: unknown;\n lastMessage?: unknown;\n}\n\n/** True when the newest build in `lastMessage` already carries a cover - the web skips the thread read then. */\nexport function lastMessageHasCover(channel: ChannelLike): boolean {\n return Boolean(readFragment(channel.lastMessage)?.coverImageUrl);\n}\n\n/**\n * A site from one chat's posts, the way the web gallery hydrates a tile: only\n * a chat with a build is a site; its name follows `resolveSiteTitle`.\n */\nexport function projectFromPosts(\n channel: ChannelLike,\n posts: readonly unknown[],\n cdnOrigin?: string,\n): WebBuilderProject | null {\n const channelId = str(channel.id);\n if (!channelId) return null;\n const builds = buildsFromPosts(posts, '', cdnOrigin);\n const latest = builds[0];\n if (!latest) return null;\n const userPrompts = chronological(posts)\n .filter((post) => isUserPost(post) && str((post as Loose).message))\n .map((post) => String((post as Loose).message));\n // The brief names the product (\"Build me: …\"); a later message (\"the live preview is\n // not loading\") never does, so only the brief - or failing that the first ask - counts.\n const brief = userPrompts.find((m) => /build\\s*me\\s*:/i.test(m)) ?? userPrompts[0];\n const rawChannelTitle = [channel.displayName, channel.title]\n .map((t) => str(t))\n .find((t) => t && !isGenericTitle(t));\n // A chat named after its brief (\"Build simple calculator app\") gives the product name, not the sentence.\n const channelTitle =\n rawChannelTitle && /^(build|create|make)\\b/i.test(rawChannelTitle)\n ? (titleFromPrompt(rawChannelTitle) ?? rawChannelTitle)\n : rawChannelTitle;\n const title = resolveSiteTitle({\n fragmentTitle: latest.title,\n channelTitle,\n userPrompt: brief,\n files: latest.files,\n });\n const updated = Date.parse(String(channel.updatedAt ?? channel.createdAt ?? ''));\n return {\n channelId,\n title,\n updatedAt: Math.max(Number.isFinite(updated) ? updated : 0, latest.updatedAt),\n previewUrl: latest.previewUrl,\n liveUrl: builds.find((b) => b.liveUrl)?.liveUrl ?? null,\n coverUrl: builds.find((b) => b.coverUrl)?.coverUrl ?? null,\n templateId: latest.templateId,\n };\n}\n\n/** `?wb=<n>` on the preview so a rebuilt sandbox is fetched again, not served from cache. */\nexport function cacheBustedUrl(url: string, nonce: number | string): string {\n const [base, hash = ''] = url.split('#');\n const clean = base.replace(/([?&])wb=[^&]*(&|$)/, '$1').replace(/[?&]$/, '');\n const sep = clean.includes('?') ? '&' : '?';\n return `${clean}${sep}wb=${nonce}${hash ? `#${hash}` : ''}`;\n}\n\n/**\n * The publish name the web dialog suggests: the site's title as a slug,\n * `[a-z0-9-]`, at most 58 characters (`<name>.yarntra.com`).\n */\nexport function publishSlug(title: string): string {\n const slug = title\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 58)\n .replace(/-+$/, '');\n return slug || 'my-site';\n}\n\nexport function isValidPublishSlug(value: string): boolean {\n return /^[a-z0-9](?:[a-z0-9-]{0,56}[a-z0-9])?$/.test(value);\n}\n\n/** Display host of a URL: `https://bakery.pages.dev/` -> `bakery.pages.dev`. */\nexport function displayHost(url: string | null | undefined): string {\n const match = /^https?:\\/\\/([^/?#]+)/i.exec((url ?? '').trim());\n return match ? match[1] : (url ?? '').trim();\n}\n\n/** \"just now\", \"5 min ago\", \"3 h ago\", \"Yesterday\", \"12 Oct\". */\nexport function relativeTime(ms: number, now = Date.now()): string {\n if (!ms) return '';\n const diff = Math.max(0, now - ms);\n const min = Math.floor(diff / 60_000);\n if (min < 1) return 'just now';\n if (min < 60) return `${min} min ago`;\n const hours = Math.floor(min / 60);\n if (hours < 24) return `${hours} h ago`;\n if (hours < 48) return 'Yesterday';\n const d = new Date(ms);\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${d.getDate()} ${months[d.getMonth()]}`;\n}\n\n// ── The agent transcript: the build chat's posts, as the web Agent pane shows them ──\n\n/** A live progress row (web `isThinkingPost`): shown as the agent's status, never kept. */\nexport function isThinkingPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const attachment = asObject(props.attachment) || {};\n const msg = String(p.message ?? '')\n .trim()\n .toLowerCase();\n return (\n String(p.type ?? '').toUpperCase() === 'THINKING' ||\n Boolean(props.thinking ?? props.isThinking) ||\n props.kind === 'thinking' ||\n Boolean(attachment.isThinking) ||\n msg === 'thinking...' ||\n msg === 'initializing...' ||\n msg === 'initializing…'\n );\n}\n\nfunction readFragmentStatus(p: Loose): string | undefined {\n const contents = asObject(p.propsConfiguration?.contents) || {};\n return (\n str(asObject(asObject(contents.props)?.fragment)?.statusText) || str(asObject(contents.fragment)?.statusText)\n );\n}\n\n/** The workflow's progress line on a post: its thought, else the fragment's status. */\nexport function progressText(post: unknown): string | null {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const thought = str(asObject(props.attachment)?.thought);\n if (thought) return thought;\n const status = str(asObject(props.fragment)?.statusText) || str(readFragmentStatus(p));\n if (status) return status;\n return isThinkingPost(post) ? (str(p.message) ?? null) : null;\n}\n\n/** A post the workflow wrote when the build failed (`fragment.isError` / `type: 'error'`). */\nexport function isErrorPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const f =\n asObject(props.fragment) || asObject(asObject(contents.props)?.fragment) || asObject(contents.fragment) || {};\n return f.isError === true || f.type === 'error';\n}\n\nexport interface TranscriptMessage {\n id: string;\n role: 'user' | 'assistant';\n content: string;\n createdAt: number;\n}\n\n/**\n * The conversation in a build chat: the person's turns and the agent's replies,\n * oldest first, without progress rows or empty build markers.\n */\nexport function transcriptFromPosts(posts: readonly unknown[]): TranscriptMessage[] {\n const out: TranscriptMessage[] = [];\n for (const post of chronological(posts)) {\n const p = post as Loose;\n const text = str(p.message);\n if (text && !isThinkingPost(post)) {\n const user = isUserPost(post);\n out.push({\n id: String(p.id ?? `${user ? 'u' : 'a'}-${out.length}`),\n role: user ? 'user' : 'assistant',\n content: user ? cleanPrompt(text) || text : text,\n createdAt: postTime(post),\n });\n }\n }\n return out;\n}\n\n/**\n * How a turn started at `since` is going, read from the posts that arrived after it.\n * `heard` is whether the build posted anything back yet (a progress row, an answer).\n */\nexport function turnState(\n posts: readonly unknown[],\n since: number,\n): { status: 'running' | 'done' | 'failed'; progress: string | null; error: string | null; heard: boolean } {\n // A clock skew allowance, as the web ignores posts older than start - 2 s.\n const after = chronological(posts).filter((post) => postTime(post) >= since - 2_000);\n let progress: string | null = null;\n for (const post of after) {\n if (!isUserPost(post)) {\n if (isErrorPost(post)) {\n const p = post as Loose;\n return { status: 'failed', progress: null, error: str(p.message) ?? 'The build failed.', heard: true };\n }\n const fragment = readFragment(post);\n if (fragment && (fragment.sandboxUrl || fragment.liveUrl) && !isThinkingPost(post)) {\n return { status: 'done', progress: null, error: null, heard: true };\n }\n progress = progressText(post) ?? progress;\n }\n }\n // A plain answer (the agent asked a question, or replied without building) ends\n // the turn too - unless progress rows keep arriving after it.\n const newest = after.filter((post) => !isUserPost(post)).pop() as Loose | undefined;\n if (newest && !isThinkingPost(newest) && !progressText(newest) && str(newest.message)) {\n return { status: 'done', progress: null, error: null, heard: true };\n }\n return { status: 'running', progress, error: null, heard: Boolean(newest) };\n}\n\n/**\n * A turn sent through the build workflow: its USER post carries the workflow's\n * route (`templateTarget`). A blank build sends an empty fragment, which\n * the server drops, so this post is the only workflow mark until a build lands.\n */\nfunction isWorkflowTurnPost(post: unknown): boolean {\n if (!post || typeof post !== 'object') return false;\n const p = post as Loose;\n const contents = asObject(p.propsConfiguration?.contents) || {};\n return Boolean(str(asObject(p.props)?.templateTarget) || str(asObject(contents.props)?.templateTarget));\n}\n\n/**\n * The chat was built through the build workflow (its posts carry fragments or\n * the workflow's route): edits go back through the workflow. A chat without\n * any is an agent-chat site (a template remix), and its turns stay in the\n * agent chat.\n */\nexport function hasWorkflowPosts(posts: readonly unknown[]): boolean {\n return posts.some((post) => readFragment(post) !== null || isWorkflowTurnPost(post));\n}\n\n/** The person's words, without the agent-only template note a remix turn carries. */\nexport function stripAgentNote(content: string): string {\n return content.replace(/\\n*\\[(?:Template|Open build|Export|Hand edits)\\][\\s\\S]*$/, '').trim();\n}\n"],"names":["_a"],"mappings":"uZA0CA,SAAS,SAAS,KAA8B,EAAA;AAC9C,EAAI,IAAA,CAAC,OAAc,OAAA,IAAA;AACnB,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA,OAAO,MAAM,OAAQ,CAAA,KAAK,IAAI,IAAO,GAAA,KAAA;AACpE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,iBAAiB,KAAoC,EAAA;AACnE,EAAO,OAAA,KAAA,CAAM,KAAK,CAAQ,IAAA,KAAA,YAAA,CAAa,IAAI,CAAM,KAAA,IAAA,IAAQ,kBAAmB,CAAA,IAAI,CAAC,CAAA;AACnF;AAGO,SAAS,eAAe,OAAyB,EAAA;AACtD,EAAA,OAAO,OAAQ,CAAA,OAAA,CAAQ,0DAA4D,EAAA,EAAE,EAAE,IAAK,EAAA;AAC9F"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import {siteProjectName}from'./siteAddress.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const MAX_EDITABLE_BYTES = 1048576;
|
|
18
|
+
const READ_FILE_MAX_BYTES = 2097152;
|
|
19
|
+
const MAX_TREE_FILES = 2e3;
|
|
20
|
+
const SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".output"]);
|
|
21
|
+
function isListablePath(path) {
|
|
22
|
+
const p = path.trim();
|
|
23
|
+
if (!p || p.includes("\0") || p.startsWith("/")) return false;
|
|
24
|
+
const segments = p.split("/");
|
|
25
|
+
if (segments.some((s) => s === "" || s === "." || s === "..")) return false;
|
|
26
|
+
if (segments.some((s) => SKIP_DIRS.has(s))) return false;
|
|
27
|
+
return !segments.some((s) => s.startsWith(".env"));
|
|
28
|
+
}
|
|
29
|
+
function normalizeEditorPath(path) {
|
|
30
|
+
const p = (path || "").trim().replace(/\\/g, "/").replace(/^(\.\/)+/, "");
|
|
31
|
+
return isListablePath(p) ? p : null;
|
|
32
|
+
}
|
|
33
|
+
const TREE_EXCLUDE = "':!node_modules' ':!**/node_modules/**' ':!dist' ':!**/dist/**' ':!.output' ':!.env*' ':!**/.env*'";
|
|
34
|
+
function buildListFilesCommand() {
|
|
35
|
+
return ['echo "__FILES_BEGIN"', "if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then", ` git -c core.quotepath=off ls-files --cached --others --exclude-standard -- . ${TREE_EXCLUDE} 2>/dev/null | head -n ${MAX_TREE_FILES + 1}`, "else", ` find . -type d \\( -name node_modules -o -name .git -o -name dist -o -name .output \\) -prune -o -type f ! -name '.env*' -print 2>/dev/null | sed 's|^\\./||' | head -n ${MAX_TREE_FILES + 1}`, "fi", 'echo "__FILES_END"', "exit 0"].join("\n");
|
|
36
|
+
}
|
|
37
|
+
function sortTree(paths) {
|
|
38
|
+
return [...paths].sort((a, b) => {
|
|
39
|
+
const pa = a.split("/");
|
|
40
|
+
const pb = b.split("/");
|
|
41
|
+
const n = Math.min(pa.length, pb.length);
|
|
42
|
+
for (let i = 0; i < n; i += 1) {
|
|
43
|
+
if (pa[i] !== pb[i]) {
|
|
44
|
+
const aDir = i < pa.length - 1;
|
|
45
|
+
const bDir = i < pb.length - 1;
|
|
46
|
+
if (aDir !== bDir) return aDir ? -1 : 1;
|
|
47
|
+
return pa[i].localeCompare(pb[i], void 0, {
|
|
48
|
+
sensitivity: "base"
|
|
49
|
+
}) || (pa[i] < pb[i] ? -1 : 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return pa.length - pb.length;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function betweenMarkers(stdout, begin, end) {
|
|
56
|
+
const text = String(stdout || "");
|
|
57
|
+
const at = text.indexOf(begin);
|
|
58
|
+
if (at < 0) return null;
|
|
59
|
+
const endIdx = text.indexOf(end, at);
|
|
60
|
+
const lines = text.slice(at + begin.length, endIdx < 0 ? void 0 : endIdx).split("\n").map((l) => l.replace(/\r$/, ""));
|
|
61
|
+
if (endIdx < 0) lines.pop();
|
|
62
|
+
return {
|
|
63
|
+
lines,
|
|
64
|
+
cut: endIdx < 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function parseListFilesOutput(stdout, opts) {
|
|
68
|
+
const body = betweenMarkers(stdout, "__FILES_BEGIN", "__FILES_END");
|
|
69
|
+
if (!body) return null;
|
|
70
|
+
const seen = /* @__PURE__ */ new Set();
|
|
71
|
+
for (const line of body.lines) {
|
|
72
|
+
const p = normalizeEditorPath(line);
|
|
73
|
+
if (p) seen.add(p);
|
|
74
|
+
}
|
|
75
|
+
const all = sortTree([...seen]);
|
|
76
|
+
return {
|
|
77
|
+
files: all.slice(0, MAX_TREE_FILES),
|
|
78
|
+
partial: body.cut || Boolean(opts == null ? void 0 : opts.truncated) || all.length > MAX_TREE_FILES
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function parseListFilesResult(data) {
|
|
82
|
+
if (!data || typeof data !== "object") return null;
|
|
83
|
+
const d = data;
|
|
84
|
+
if (!Array.isArray(d.files)) return null;
|
|
85
|
+
const seen = /* @__PURE__ */ new Set();
|
|
86
|
+
for (const f of d.files) {
|
|
87
|
+
const p = typeof f === "string" ? normalizeEditorPath(f) : null;
|
|
88
|
+
if (p) seen.add(p);
|
|
89
|
+
}
|
|
90
|
+
const all = sortTree([...seen]);
|
|
91
|
+
return {
|
|
92
|
+
files: all.slice(0, MAX_TREE_FILES),
|
|
93
|
+
partial: d.truncated === true || all.length > MAX_TREE_FILES
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function preferredFile(paths) {
|
|
97
|
+
const preferred = ["src/App.tsx", "src/App.jsx", "src/main.tsx", "src/main.jsx", "app/page.tsx", "pages/index.tsx", "index.html", "package.json"];
|
|
98
|
+
return preferred.find((p) => paths.includes(p)) || paths[0] || "";
|
|
99
|
+
}
|
|
100
|
+
const BINARY_EXT = /\.(png|jpe?g|gif|webp|avif|ico|bmp|tiff?|psd|woff2?|ttf|otf|eot|mp3|mp4|m4a|wav|ogg|webm|mov|avi|zip|gz|tgz|bz2|xz|7z|rar|tar|pdf|wasm|exe|dll|so|dylib|bin|class|jar|sqlite|db|lockb)$/i;
|
|
101
|
+
function isBinaryPath(path) {
|
|
102
|
+
return BINARY_EXT.test(path);
|
|
103
|
+
}
|
|
104
|
+
function openModeFor(path, data) {
|
|
105
|
+
if (isBinaryPath(path) || data.binary === true || data.encoding === "base64") return {
|
|
106
|
+
kind: "binary"
|
|
107
|
+
};
|
|
108
|
+
if (typeof data.content !== "string") return {
|
|
109
|
+
kind: "error",
|
|
110
|
+
message: "The file came back empty."
|
|
111
|
+
};
|
|
112
|
+
const size = typeof data.size === "number" ? data.size : data.content.length;
|
|
113
|
+
if (data.truncated === true || size > MAX_EDITABLE_BYTES) return {
|
|
114
|
+
kind: "readonly",
|
|
115
|
+
reason: "large"
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
kind: "edit"
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function decideSave(base, disk, draft) {
|
|
122
|
+
if (disk === null) return "missing";
|
|
123
|
+
if (disk !== base) return disk === draft ? "unchanged" : "conflict";
|
|
124
|
+
return draft === base ? "unchanged" : "write";
|
|
125
|
+
}
|
|
126
|
+
function lineDelta(before, after) {
|
|
127
|
+
const a = before.split("\n");
|
|
128
|
+
const b = after.split("\n");
|
|
129
|
+
let start = 0;
|
|
130
|
+
while (start < a.length && start < b.length && a[start] === b[start]) start += 1;
|
|
131
|
+
let endA = a.length - 1;
|
|
132
|
+
let endB = b.length - 1;
|
|
133
|
+
while (endA >= start && endB >= start && a[endA] === b[endB]) {
|
|
134
|
+
endA -= 1;
|
|
135
|
+
endB -= 1;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
removed: Math.max(0, endA - start + 1),
|
|
139
|
+
added: Math.max(0, endB - start + 1)
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function codeEditSummary(before, after) {
|
|
143
|
+
const {
|
|
144
|
+
added,
|
|
145
|
+
removed
|
|
146
|
+
} = lineDelta(before, after);
|
|
147
|
+
const parts = [];
|
|
148
|
+
if (added) parts.push(`+${added}`);
|
|
149
|
+
if (removed) parts.push(`-${removed}`);
|
|
150
|
+
return `edited in the code view (${parts.join(" / ") || "whitespace"} lines)`;
|
|
151
|
+
}
|
|
152
|
+
function handEditsNote(edits) {
|
|
153
|
+
if (!edits.length) return "";
|
|
154
|
+
return `[Hand edits] The user already changed these by hand (keep them): ${edits.map((m) => `${m.file}: ${m.summary}`).join("; ")}.`;
|
|
155
|
+
}
|
|
156
|
+
const MIN_SEARCH_CHARS = 2;
|
|
157
|
+
const MAX_SEARCH_CHARS = 200;
|
|
158
|
+
const MAX_SEARCH_LINES = 400;
|
|
159
|
+
const MAX_RAW_LINE_CHARS = 400;
|
|
160
|
+
const PREVIEW_CHARS = 160;
|
|
161
|
+
const MAX_NAME_MATCHES = 50;
|
|
162
|
+
function normalizeQuery(query) {
|
|
163
|
+
const q = String(query || "").replace(/[\r\n\0]+/g, " ").trim().slice(0, MAX_SEARCH_CHARS);
|
|
164
|
+
return q.length >= MIN_SEARCH_CHARS ? q : null;
|
|
165
|
+
}
|
|
166
|
+
function shellQuote(s) {
|
|
167
|
+
return `'${s.replace(/'/g, `'\\''`)}'`;
|
|
168
|
+
}
|
|
169
|
+
function buildSearchCommand(query) {
|
|
170
|
+
const q = normalizeQuery(query);
|
|
171
|
+
if (!q) throw new Error("query too short");
|
|
172
|
+
const pattern = shellQuote(q);
|
|
173
|
+
const exclude = `${TREE_EXCLUDE} ':!**/.output/**'`;
|
|
174
|
+
const cap = `cut -c1-${MAX_RAW_LINE_CHARS} | head -n ${MAX_SEARCH_LINES + 1}`;
|
|
175
|
+
return ['echo "__GREP_BEGIN"', "if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then", ` git -c core.quotepath=off grep --untracked -n -I -i -F --no-color -e ${pattern} -- . ${exclude} 2>/dev/null | ${cap}`, "else", ` grep -rnIiF --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=dist --exclude-dir=.output --exclude='.env*' -e ${pattern} . 2>/dev/null | sed 's|^\\./||' | ${cap}`, "fi", 'echo "__GREP_END"', "exit 0"].join("\n");
|
|
176
|
+
}
|
|
177
|
+
function matchRanges(text, query) {
|
|
178
|
+
const q = query.toLowerCase();
|
|
179
|
+
if (!q) return [];
|
|
180
|
+
const hay = text.toLowerCase();
|
|
181
|
+
const out = [];
|
|
182
|
+
let at = hay.indexOf(q);
|
|
183
|
+
while (at >= 0 && out.length < 20) {
|
|
184
|
+
out.push([at, at + q.length]);
|
|
185
|
+
at = hay.indexOf(q, at + q.length);
|
|
186
|
+
}
|
|
187
|
+
return out;
|
|
188
|
+
}
|
|
189
|
+
function previewLine(raw, query) {
|
|
190
|
+
let text = raw.replace(/\t/g, " ").replace(/\s+$/, "");
|
|
191
|
+
text = text.slice(text.length - text.trimStart().length);
|
|
192
|
+
if (text.length > PREVIEW_CHARS) {
|
|
193
|
+
const first = text.toLowerCase().indexOf(query.toLowerCase());
|
|
194
|
+
const start = first > PREVIEW_CHARS / 3 ? first - Math.floor(PREVIEW_CHARS / 3) : 0;
|
|
195
|
+
text = `${start > 0 ? "\u2026" : ""}${text.slice(start, start + PREVIEW_CHARS)}${start + PREVIEW_CHARS < text.length ? "\u2026" : ""}`;
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
text,
|
|
199
|
+
ranges: matchRanges(text, query)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function groupRows(rows, query, truncated) {
|
|
203
|
+
var _a;
|
|
204
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
205
|
+
for (const r of rows) {
|
|
206
|
+
const list = (_a = byPath.get(r.path)) != null ? _a : [];
|
|
207
|
+
list.push(__spreadValues({
|
|
208
|
+
line: r.line
|
|
209
|
+
}, previewLine(r.raw, query)));
|
|
210
|
+
byPath.set(r.path, list);
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
files: [...byPath].map(([path, matches]) => ({
|
|
214
|
+
path,
|
|
215
|
+
matches
|
|
216
|
+
})),
|
|
217
|
+
total: rows.length,
|
|
218
|
+
truncated
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
const GREP_LINE = /^(.+?):(\d+):(.*)$/;
|
|
222
|
+
function parseSearchOutput(stdout, query, opts) {
|
|
223
|
+
const body = betweenMarkers(stdout, "__GREP_BEGIN", "__GREP_END");
|
|
224
|
+
if (!body) return null;
|
|
225
|
+
const rows = [];
|
|
226
|
+
for (const l of body.lines) {
|
|
227
|
+
const m = GREP_LINE.exec(l);
|
|
228
|
+
const path = m ? m[1].replace(/^\.\//, "") : "";
|
|
229
|
+
if (m && isListablePath(path)) rows.push({
|
|
230
|
+
path,
|
|
231
|
+
line: Number(m[2]),
|
|
232
|
+
raw: m[3]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
const truncated = body.cut || Boolean(opts == null ? void 0 : opts.truncated) || rows.length > MAX_SEARCH_LINES;
|
|
236
|
+
return groupRows(rows.slice(0, MAX_SEARCH_LINES), query, truncated);
|
|
237
|
+
}
|
|
238
|
+
function searchDocs(docs, query) {
|
|
239
|
+
const q = normalizeQuery(query);
|
|
240
|
+
if (!q) return {
|
|
241
|
+
files: [],
|
|
242
|
+
total: 0,
|
|
243
|
+
truncated: false
|
|
244
|
+
};
|
|
245
|
+
const needle = q.toLowerCase();
|
|
246
|
+
const rows = [];
|
|
247
|
+
let truncated = false;
|
|
248
|
+
Object.keys(docs).sort().filter(isListablePath).forEach((path) => {
|
|
249
|
+
docs[path].split("\n").forEach((text, i) => {
|
|
250
|
+
if (!text.toLowerCase().includes(needle)) return;
|
|
251
|
+
if (rows.length >= MAX_SEARCH_LINES) {
|
|
252
|
+
truncated = true;
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
rows.push({
|
|
256
|
+
path,
|
|
257
|
+
line: i + 1,
|
|
258
|
+
raw: text.slice(0, MAX_RAW_LINE_CHARS)
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
return groupRows(rows, q, truncated);
|
|
263
|
+
}
|
|
264
|
+
function matchFileNames(files, query) {
|
|
265
|
+
var _a;
|
|
266
|
+
const q = (_a = normalizeQuery(query)) == null ? void 0 : _a.toLowerCase();
|
|
267
|
+
if (!q) return [];
|
|
268
|
+
const scored = [];
|
|
269
|
+
for (const path of files) {
|
|
270
|
+
const lower = path.toLowerCase();
|
|
271
|
+
if (lower.includes(q)) {
|
|
272
|
+
const base = lower.slice(lower.lastIndexOf("/") + 1);
|
|
273
|
+
let rank = 2;
|
|
274
|
+
if (base.startsWith(q)) rank = 0;
|
|
275
|
+
else if (base.includes(q)) rank = 1;
|
|
276
|
+
scored.push({
|
|
277
|
+
path,
|
|
278
|
+
score: rank * 1e3 + path.length
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return scored.sort((a, b) => a.score - b.score || a.path.localeCompare(b.path)).slice(0, MAX_NAME_MATCHES).map((s) => s.path);
|
|
283
|
+
}
|
|
284
|
+
function savedCodeSource(opts) {
|
|
285
|
+
const published = String(opts.publishProjectName || "").trim() || siteProjectName(opts.liveUrl);
|
|
286
|
+
if (published) return {
|
|
287
|
+
projectName: published
|
|
288
|
+
};
|
|
289
|
+
const repo = String(opts.backupRepo || "").trim();
|
|
290
|
+
const name = repo.split("/").filter(Boolean).pop() || "";
|
|
291
|
+
return name ? {
|
|
292
|
+
projectName: name
|
|
293
|
+
} : null;
|
|
294
|
+
}
|
|
295
|
+
function isSavedCodeRead(data) {
|
|
296
|
+
if (!data || typeof data !== "object") return false;
|
|
297
|
+
const d = data;
|
|
298
|
+
return d.readOnly === true || d.sandboxGone === true || d.source === "repo";
|
|
299
|
+
}
|
|
300
|
+
function isSandboxUnavailableError(message) {
|
|
301
|
+
return /sandbox not found|not found \(404\)|no sandbox|does not exist|sandbox.*(paused|expired|killed)|not running anymore|timed? ?out|ETIMEDOUT|\b502\b/i.test(String(message || ""));
|
|
302
|
+
}export{MAX_EDITABLE_BYTES,MAX_SEARCH_CHARS,MAX_SEARCH_LINES,MAX_TREE_FILES,MIN_SEARCH_CHARS,READ_FILE_MAX_BYTES,buildListFilesCommand,buildSearchCommand,codeEditSummary,decideSave,handEditsNote,isBinaryPath,isListablePath,isSandboxUnavailableError,isSavedCodeRead,lineDelta,matchFileNames,matchRanges,normalizeEditorPath,normalizeQuery,openModeFor,parseListFilesOutput,parseListFilesResult,parseSearchOutput,preferredFile,savedCodeSource,searchDocs,shellQuote,sortTree};//# sourceMappingURL=codeFiles.js.map
|