@adminide-stack/yantra-mobile 12.0.163-alpha.1 → 12.0.164-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/lib/components/CustomDrawer.js +8 -1
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/components/NavigationHeader/HeaderSheet.js +23 -8
  4. package/lib/components/NavigationHeader/HeaderSheet.js.map +1 -1
  5. package/lib/components/NavigationHeader/HeaderSkillsButton.js +6 -3
  6. package/lib/components/NavigationHeader/HeaderSkillsButton.js.map +1 -1
  7. package/lib/components/NavigationHeader/HeaderSystemButtons.js +7 -0
  8. package/lib/components/NavigationHeader/HeaderSystemButtons.js.map +1 -0
  9. package/lib/components/NavigationHeader/HeaderTasksButton.js +144 -93
  10. package/lib/components/NavigationHeader/HeaderTasksButton.js.map +1 -1
  11. package/lib/components/NavigationHeader/NavigationHeader.js +2 -2
  12. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  13. package/lib/features/agent-chat/NativeAgentChat.js +3 -3
  14. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  15. package/lib/features/audio-input/AudioRecorderPanel.js +1 -1
  16. package/lib/features/audio-input/NativeDictationBar.js +1 -1
  17. package/lib/features/canvas/CanvasExperience.js +1 -1
  18. package/lib/features/channels/ConnectAppsSheet.js +1 -1
  19. package/lib/features/channels/HomeImessage.js +1 -1
  20. package/lib/features/channels/useChannelsApi.js +1 -1
  21. package/lib/features/chat/OneTimeCodePrompt.js +1 -1
  22. package/lib/features/chat/QueuedFollowUps.js +4 -3
  23. package/lib/features/chat/QueuedFollowUps.js.map +1 -1
  24. package/lib/features/chat/TemporaryChatView.js +238 -0
  25. package/lib/features/chat/TemporaryChatView.js.map +1 -0
  26. package/lib/features/chat/connectorConnect.js +1 -1
  27. package/lib/features/chat/temporaryChatStore.js +59 -7
  28. package/lib/features/chat/temporaryChatStore.js.map +1 -1
  29. package/lib/features/chat/withTemporaryChat.js +24 -0
  30. package/lib/features/chat/withTemporaryChat.js.map +1 -0
  31. package/lib/features/dictate/recorderStatus.js +22 -0
  32. package/lib/features/dictate/recorderStatus.js.map +1 -0
  33. package/lib/features/dictate/useDictationRecorder.js +4 -4
  34. package/lib/features/dictate/useDictationRecorder.js.map +1 -1
  35. package/lib/features/home/sky/HomeSky.js +1 -1
  36. package/lib/features/skills/SkillTemplatePicker.js +107 -143
  37. package/lib/features/skills/SkillTemplatePicker.js.map +1 -1
  38. package/lib/features/webbuilder/WebBuilderExperience.js +402 -33
  39. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  40. package/lib/features/webbuilder/components/CloudSheet.js +35 -15
  41. package/lib/features/webbuilder/components/CloudSheet.js.map +1 -1
  42. package/lib/features/webbuilder/components/Credits.js +149 -0
  43. package/lib/features/webbuilder/components/Credits.js.map +1 -0
  44. package/lib/features/webbuilder/components/PreviewFrame.js +15 -4
  45. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  46. package/lib/features/webbuilder/components/PreviewScreen.js +5 -2
  47. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  48. package/lib/features/webbuilder/components/ProjectChat.js +58 -8
  49. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  50. package/lib/features/webbuilder/components/ProjectSheets.js +29 -6
  51. package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
  52. package/lib/features/webbuilder/components/ProjectsScreen.js +16 -7
  53. package/lib/features/webbuilder/components/ProjectsScreen.js.map +1 -1
  54. package/lib/features/webbuilder/components/PublishSheet.js +133 -2
  55. package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
  56. package/lib/features/webbuilder/components/RetentionBanner.js +130 -0
  57. package/lib/features/webbuilder/components/RetentionBanner.js.map +1 -0
  58. package/lib/features/webbuilder/components/ShareSheet.js +265 -0
  59. package/lib/features/webbuilder/components/ShareSheet.js.map +1 -0
  60. package/lib/features/webbuilder/components/SiteStatusSheet.js +533 -0
  61. package/lib/features/webbuilder/components/SiteStatusSheet.js.map +1 -0
  62. package/lib/features/webbuilder/components/StudioHome.js +8 -1
  63. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  64. package/lib/features/webbuilder/components/TemplateSuggestions.js +98 -0
  65. package/lib/features/webbuilder/components/TemplateSuggestions.js.map +1 -0
  66. package/lib/features/webbuilder/connectorTemplates.js +3 -3
  67. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  68. package/lib/features/webbuilder/creditsLinks.js +5 -0
  69. package/lib/features/webbuilder/creditsLinks.js.map +1 -0
  70. package/lib/features/webbuilder/previewAccess.js +207 -0
  71. package/lib/features/webbuilder/previewAccess.js.map +1 -0
  72. package/lib/features/webbuilder/previewProbe.js +49 -1
  73. package/lib/features/webbuilder/previewProbe.js.map +1 -1
  74. package/lib/features/webbuilder/readiness.js +14 -0
  75. package/lib/features/webbuilder/readiness.js.map +1 -0
  76. package/lib/features/webbuilder/shareLink.js +26 -0
  77. package/lib/features/webbuilder/shareLink.js.map +1 -0
  78. package/lib/features/webbuilder/templateCover.js +11 -0
  79. package/lib/features/webbuilder/templateCover.js.map +1 -0
  80. package/lib/features/webbuilder/templateSuggestions.js +112 -0
  81. package/lib/features/webbuilder/templateSuggestions.js.map +1 -0
  82. package/lib/features/webbuilder/useGithubAutoSync.js +83 -0
  83. package/lib/features/webbuilder/useGithubAutoSync.js.map +1 -0
  84. package/lib/features/webbuilder/usePreviewAccess.js +61 -0
  85. package/lib/features/webbuilder/usePreviewAccess.js.map +1 -0
  86. package/lib/features/webbuilder/useWebBuilderCredits.js +99 -0
  87. package/lib/features/webbuilder/useWebBuilderCredits.js.map +1 -0
  88. package/lib/features/webbuilder/web/credits/credits.js +203 -0
  89. package/lib/features/webbuilder/web/credits/credits.js.map +1 -0
  90. package/lib/features/webbuilder/web/credits/creditsReader.js +65 -0
  91. package/lib/features/webbuilder/web/credits/creditsReader.js.map +1 -0
  92. package/lib/features/webbuilder/web/data/cloud.js +3 -3
  93. package/lib/features/webbuilder/web/data/cloud.js.map +1 -1
  94. package/lib/features/webbuilder/web/data/database.js +4 -1
  95. package/lib/features/webbuilder/web/data/database.js.map +1 -1
  96. package/lib/features/webbuilder/web/github/autoSync.js +231 -0
  97. package/lib/features/webbuilder/web/github/autoSync.js.map +1 -0
  98. package/lib/features/webbuilder/web/github/autoSyncEngine.js +367 -0
  99. package/lib/features/webbuilder/web/github/autoSyncEngine.js.map +1 -0
  100. package/lib/features/webbuilder/web/github/githubSync.js +54 -0
  101. package/lib/features/webbuilder/web/github/githubSync.js.map +1 -0
  102. package/lib/features/webbuilder/web/history/versions.js +83 -0
  103. package/lib/features/webbuilder/web/history/versions.js.map +1 -0
  104. package/lib/features/webbuilder/web/project/retention.js +217 -0
  105. package/lib/features/webbuilder/web/project/retention.js.map +1 -0
  106. package/lib/features/webbuilder/web/publish/actionErrors.js +81 -0
  107. package/lib/features/webbuilder/web/publish/actionErrors.js.map +1 -0
  108. package/lib/features/webbuilder/web/publish/publishSteps.js +86 -0
  109. package/lib/features/webbuilder/web/publish/publishSteps.js.map +1 -0
  110. package/lib/features/webbuilder/web/publish/siteAddress.js +79 -0
  111. package/lib/features/webbuilder/web/publish/siteAddress.js.map +1 -0
  112. package/lib/features/webbuilder/web/publish/siteHealth.js +497 -0
  113. package/lib/features/webbuilder/web/publish/siteHealth.js.map +1 -0
  114. package/lib/features/webbuilder/web/publish/siteInsights.js +145 -0
  115. package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -0
  116. package/lib/features/webbuilder/web/sharing/roles.js +108 -2
  117. package/lib/features/webbuilder/web/sharing/roles.js.map +1 -1
  118. package/lib/features/webbuilder/web/sharing/share.js +52 -0
  119. package/lib/features/webbuilder/web/sharing/share.js.map +1 -0
  120. package/lib/features/webbuilder/web/sharing/sharingApi.js +199 -0
  121. package/lib/features/webbuilder/web/sharing/sharingApi.js.map +1 -0
  122. package/lib/features/webbuilder/web/webServices.js +13 -2
  123. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  124. package/lib/features/webbuilder/webbuilderPrompts.js +4 -1
  125. package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -1
  126. package/lib/features/webbuilder/workflow.js +2 -2
  127. package/lib/features/webbuilder/workflow.js.map +1 -1
  128. package/lib/hooks/useSurfaceJobs.js +113 -28
  129. package/lib/hooks/useSurfaceJobs.js.map +1 -1
  130. package/lib/index.js +1 -1
  131. package/lib/index.js.map +1 -1
  132. package/lib/screens/Chat/index.js +3 -2
  133. package/lib/screens/Chat/index.js.map +1 -1
  134. package/lib/screens/Home/HomeScreen.js +1 -1
  135. package/lib/screens/Home/components/BuildTemplatesSection.js +1 -1
  136. package/lib/screens/Home/components/ChooseTemplateModal.js +1 -1
  137. package/lib/screens/Home/components/HomeHero.js +1 -1
  138. package/lib/screens/Home/components/HomeSuggestions.js +1 -1
  139. package/lib/screens/Home/components/TemplateBrowserModal.js +1 -1
  140. package/lib/screens/Home/index.js +1 -1
  141. package/lib/screens/Home/index.js.map +1 -1
  142. package/lib/screens/WebBuilderNative/index.js +1 -1
  143. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  144. package/lib/screens/WebBuilderNative/sandboxProxyApi.js +33 -3
  145. package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
  146. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +33 -13
  147. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  148. package/lib/screens/WebBuilderNative/useWebBuilderJobs.js +11 -4
  149. package/lib/screens/WebBuilderNative/useWebBuilderJobs.js.map +1 -1
  150. package/lib/screens/WebBuilderNative/webbuilderTransport.js +1 -1
  151. package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
  152. package/lib/services/brainQuickReply.js +47 -14
  153. package/lib/services/brainQuickReply.js.map +1 -1
  154. package/package.json +2 -2
  155. package/lib/components/NavigationHeader/HeaderMoreMenu.js +0 -78
  156. package/lib/components/NavigationHeader/HeaderMoreMenu.js.map +0 -1
  157. package/lib/components/NavigationHeader/HeaderSettingsMenu.js +0 -132
  158. package/lib/components/NavigationHeader/HeaderSettingsMenu.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sources":["../../../../../src/features/webbuilder/web/history/versions.ts"],"sourcesContent":["/**\n * W17: version history, restore and bookmarks (spec Phase 3-4 §1).\n *\n * The connector actions WEBBUILDER_LIST_VERSIONS / RESTORE_VERSION /\n * BOOKMARK_VERSION may not exist on a hosted agent yet. Until they do, the\n * surface falls back to WEBBUILDER_RUN_COMMAND with the git scripts built\n * here. Everything is pure (no connector, no React) so it is unit-tested:\n * - every sha is validated strictly (hex, 7-40 chars) before it reaches a shell;\n * - bookmark names become a safe slug (`bookmark/<slug>` git tags);\n * - commit subjects are single-line and single-quoted.\n *\n * Restore is always FORWARD: the files of the old version become a new commit\n * \"Restore to <short>: <message>\". History is never rewritten.\n *\n * Dirty tree (decision): a restore never refuses a dirty tree and never loses\n * work. Uncommitted changes (hand edits still waiting for their debounced\n * commit) are first committed as \"Manual edits: saved before restore\", so they\n * stay one click away in the history. `.env*`, node_modules and build output\n * are never staged. Refusing would only push the user into a dead end, because\n * the surface itself produces those uncommitted edits.\n */\n\nexport const DEFAULT_VERSION_LIMIT = 50;\nexport const MAX_VERSION_LIMIT = 200;\n/** RUN_COMMAND stdout is capped (~12 KB) - the git-log fallback asks for fewer rows. */\nexport const FALLBACK_VERSION_LIMIT = 40;\n\nexport interface WebbuilderVersion {\n sha: string;\n shortSha: string;\n message: string;\n author?: string;\n /** ISO date. */\n date?: string;\n /** Bookmark slug (the `bookmark/<slug>` tag), when the version has one. */\n bookmark?: string;\n isHead: boolean;\n}\n\nexport interface VersionList {\n versions: WebbuilderVersion[];\n head: string | null;\n dirty: boolean;\n /** Output was cut off, or the clone is shallow: older versions may be missing. */\n partial?: boolean;\n /** The project has no git repository yet (native `isGitRepo: false`). */\n noRepo?: boolean;\n}\n\nconst SHA_RE = /^[0-9a-f]{7,40}$/;\n\n/** Strict sha check: lowercase hex, 7-40 characters. Anything else is refused. */\nexport function isValidSha(value: unknown): value is string {\n return typeof value === 'string' && SHA_RE.test(value);\n}\n\n/** Lower-cased, trimmed sha, or null when it is not a valid sha. */\nexport function normalizeSha(value: unknown): string | null {\n if (typeof value !== 'string') return null;\n const v = value.trim().toLowerCase();\n return isValidSha(v) ? v : null;\n}\n\nexport function clampLimit(limit: unknown, fallback = DEFAULT_VERSION_LIMIT): number {\n const n = typeof limit === 'number' && Number.isFinite(limit) ? Math.floor(limit) : fallback;\n return Math.min(MAX_VERSION_LIMIT, Math.max(1, n));\n}\n\n/** Safe bookmark slug: lowercase `a-z0-9-`, at most 40 chars. Null when nothing is left. */\nexport function bookmarkSlug(name: unknown): string | null {\n if (typeof name !== 'string') return null;\n const slug = name\n .normalize('NFKD')\n .replace(/[̀-ͯ]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 40)\n .replace(/-+$/g, '');\n return slug || null;\n}\n\nexport function shellQuote(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n\n/** Single-line, printable subject (max 72 chars). */\nexport function oneLineSubject(text: string, max = 72): string {\n const flat = String(text || '')\n .replace(/[\\r\\n\\t]+/g, ' ')\n .replace(/[^\\x20-\\x7E -￿]/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;\n}\n\n/** \"Restore to <short>: <message>\" - the forward restore's commit subject. */\nexport function restoreCommitMessage(sha: string, message: string): string {\n const short = sha.slice(0, 7);\n return oneLineSubject(`Restore to ${short}: ${oneLineSubject(message, 200) || 'earlier version'}`);\n}\n\nexport const NO_REPO = 'git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { echo \"__GIT=norepo\"; exit 0; }';\nconst IDENTITY =\n 'ID=\"\"; git config user.email >/dev/null 2>&1 || ID=\"-c user.name=Yantra -c user.email=webbuilder@yantra.dev\"';\n/** Stage everything except secrets, dependencies and build output (same rules as the manual-edit commit). */\nconst SAFE_STAGE = [\n \"git add -A -- . ':!.env*' ':!**/.env*' ':!node_modules' ':!**/node_modules' ':!dist' ':!.output' >/dev/null 2>&1 || true\",\n \"git reset -q -- '.env*' '**/.env*' >/dev/null 2>&1 || true\",\n];\n\n/**\n * RUN_COMMAND script: HEAD, dirty flag and the last `limit` commits, one per line:\n * `__V<TAB>sha<TAB>isoDate<TAB>author<TAB>refs<TAB>subject`. Always exits 0.\n */\nexport function buildListVersionsCommand(limit: number = FALLBACK_VERSION_LIMIT): string {\n const n = clampLimit(limit, FALLBACK_VERSION_LIMIT);\n return [\n NO_REPO,\n 'echo \"__GIT=ok\"',\n 'echo \"__HEAD=$(git rev-parse HEAD 2>/dev/null)\"',\n \"if [ -n \\\"$(git status --porcelain -- . ':!.env*' ':!**/.env*' ':!node_modules' ':!**/node_modules' ':!dist' ':!.output' 2>/dev/null | head -n 1)\\\" ]; then echo \\\"__DIRTY=1\\\"; else echo \\\"__DIRTY=0\\\"; fi\",\n `git log -n ${n} --no-color --pretty=format:'__V%x09%H%x09%aI%x09%an%x09%D%x09%s' 2>/dev/null || true`,\n 'echo',\n 'echo \"__END=1\"',\n 'exit 0',\n ].join('\\n');\n}\n\nexport type ParsedVersionList = (VersionList & { ok: true }) | { ok: false; reason: 'norepo' | 'unreadable' };\n\n/** Bookmark slug from a `%D` refs list (\"HEAD -> main, tag: bookmark/launch\"). */\nexport function bookmarkFromRefs(refs: string): string | undefined {\n for (const part of refs.split(',')) {\n const m = /^\\s*tag:\\s*bookmark\\/([a-z0-9-]{1,40})\\s*$/.exec(part);\n if (m) return m[1];\n }\n return undefined;\n}\n\nexport function parseListVersionsOutput(stdout: string, opts?: { truncated?: boolean }): ParsedVersionList {\n const text = String(stdout || '');\n if (/^__GIT=norepo\\s*$/m.test(text)) return { ok: false, reason: 'norepo' };\n if (!/^__GIT=ok\\s*$/m.test(text)) return { ok: false, reason: 'unreadable' };\n const head = normalizeSha(/^__HEAD=(.*)$/m.exec(text)?.[1] ?? '');\n const dirty = /^__DIRTY=1\\s*$/m.test(text);\n const versions: WebbuilderVersion[] = [];\n for (const line of text.split('\\n')) {\n if (!line.startsWith('__V\\t')) continue;\n const [, rawSha, date, author, refs, ...rest] = line.split('\\t');\n const sha = normalizeSha(rawSha);\n if (!sha || sha.length !== 40) continue;\n const bookmark = bookmarkFromRefs(refs ?? '');\n versions.push({\n sha,\n shortSha: sha.slice(0, 7),\n message: rest.join('\\t').replace(/\\r$/, '').trim(),\n ...(author ? { author: author.trim() } : {}),\n ...(date && !Number.isNaN(Date.parse(date)) ? { date: date.trim() } : {}),\n ...(bookmark ? { bookmark } : {}),\n isHead: sha === head,\n });\n }\n const ended = /^__END=1\\s*$/m.test(text);\n return {\n ok: true,\n versions,\n head,\n dirty,\n ...(opts?.truncated || !ended ? { partial: true } : {}),\n };\n}\n\n/**\n * The action's fields. The transport already unwraps `{ data }`; a second\n * `data` layer (older transports) is tolerated.\n */\nexport function actionFields(data: Record<string, unknown> | null | undefined): Record<string, unknown> {\n const rec = data && typeof data === 'object' ? data : {};\n const inner = rec.data;\n if (inner && typeof inner === 'object' && !Array.isArray(inner)) return inner as Record<string, unknown>;\n return rec;\n}\n\n/**\n * The plain sentence of a connector error: `\"<sentence> [CODE]\\nLast output:…\"`\n * -> `\"<sentence>\"`. Falls back when there is nothing readable.\n */\nexport function plainConnectorError(error: unknown, fallback: string): string {\n const first = String(error ?? '')\n .split('\\n')[0]\n .replace(/\\s*\\[[A-Z][A-Z0-9_]*(?:;[^\\]]*)?\\]\\s*$/, '')\n .trim();\n if (!first || /^at\\s/.test(first)) return fallback;\n return first.length > 240 ? `${first.slice(0, 239)}…` : first;\n}\n\n/**\n * Tolerant reader for WEBBUILDER_LIST_VERSIONS `{ versions:[{ sha, shortSha,\n * message, author, date, bookmark?, bookmarks?, isHead }], head, dirty, branch,\n * shallow, isGitRepo, count }`; drops rows with a bad sha.\n */\nexport function normalizeListVersionsData(input: Record<string, unknown>): VersionList | null {\n const data = actionFields(input);\n if (data.isGitRepo === false) return { versions: [], head: null, dirty: false, noRepo: true };\n const raw = Array.isArray(data.versions) ? data.versions : null;\n if (!raw) return null;\n const head = normalizeSha(data.head);\n const versions: WebbuilderVersion[] = [];\n for (const item of raw) {\n if (!item || typeof item !== 'object') continue;\n const r = item as Record<string, unknown>;\n const sha = normalizeSha(r.sha);\n if (!sha) continue;\n const marks = Array.isArray(r.bookmarks) ? r.bookmarks : [];\n const rawMark = typeof r.bookmark === 'string' ? r.bookmark : marks.find((m) => typeof m === 'string');\n const bookmark = typeof rawMark === 'string' ? bookmarkSlug(rawMark.replace(/^bookmark\\//, '')) : null;\n const date = typeof r.date === 'string' && !Number.isNaN(Date.parse(r.date)) ? r.date : undefined;\n versions.push({\n sha,\n shortSha: normalizeSha(r.shortSha) ?? sha.slice(0, 7),\n message: typeof r.message === 'string' ? r.message.split('\\n')[0].trim() : '',\n ...(typeof r.author === 'string' && r.author ? { author: r.author } : {}),\n ...(date ? { date } : {}),\n ...(bookmark ? { bookmark } : {}),\n isHead: r.isHead === true || (head !== null && sha === head),\n });\n }\n return {\n versions,\n head: head ?? versions.find((v) => v.isHead)?.sha ?? null,\n dirty: data.dirty === true,\n ...(data.shallow === true ? { partial: true } : {}),\n };\n}\n\n/**\n * WEBBUILDER_RESTORE_VERSION `{ restored, sha, shortSha, newHead, noChange,\n * autoSaved, message }`. `noChange` = the project already matched that version.\n */\nexport function normalizeRestoreData(\n input: Record<string, unknown>,\n): { ok: true; newHead: string | null; autoSaved: string | null } | { ok: false; reason: 'none' | 'failed' } {\n const data = actionFields(input);\n if (data.restored === false) return { ok: false, reason: 'failed' };\n if (data.noChange === true) return { ok: false, reason: 'none' };\n return { ok: true, newHead: normalizeSha(data.newHead), autoSaved: normalizeSha(data.autoSaved) };\n}\n\n/**\n * WEBBUILDER_BOOKMARK_VERSION `{ bookmark, tag, sha, moved }` or, on remove,\n * `{ bookmark, tag, sha, removed }`. The slug, from `bookmark` or `tag`.\n */\nexport function bookmarkFromData(input: Record<string, unknown>): string | null {\n const data = actionFields(input);\n const raw = typeof data.bookmark === 'string' ? data.bookmark : typeof data.tag === 'string' ? data.tag : '';\n return bookmarkSlug(raw.replace(/^bookmark\\//, ''));\n}\n\n/**\n * RUN_COMMAND script for the forward restore. Prints\n * `__RESTORE=ok <newHead>` | `__RESTORE=none` (already identical) |\n * `__RESTORE=unknown` (no such commit) | `__GIT=norepo` | `__RESTORE=failed`.\n *\n * `git read-tree --reset -u <sha>` makes index + tracked files match the old\n * version exactly (files added later are removed too, unlike\n * `git checkout <sha> -- .`). Untracked/ignored files (.env, node_modules) are\n * left alone, and the dev server keeps running and hot-reloads.\n */\nexport function buildRestoreCommand(sha: string, message: string): string {\n const s = normalizeSha(sha);\n if (!s) throw new Error('invalid version id');\n const msg = shellQuote(restoreCommitMessage(s, message));\n return [\n NO_REPO,\n `git cat-file -e '${s}^{commit}' 2>/dev/null || { echo \"__RESTORE=unknown\"; exit 0; }`,\n IDENTITY,\n // Keep uncommitted hand edits: commit them first (never .env*), so nothing is lost.\n ...SAFE_STAGE,\n 'git diff --cached --quiet || git $ID commit -q -m \\'Manual edits: saved before restore\\' >/dev/null 2>&1 || { echo \"__RESTORE=failed\"; exit 0; }',\n `git read-tree --reset -u '${s}' >/dev/null 2>&1 || { echo \"__RESTORE=failed\"; exit 0; }`,\n ...SAFE_STAGE,\n 'if git diff --cached --quiet HEAD; then echo \"__RESTORE=none\"; exit 0; fi',\n `if git $ID commit -q -m ${msg} >/dev/null 2>&1; then echo \"__RESTORE=ok $(git rev-parse HEAD)\"; else git reset -q --hard HEAD >/dev/null 2>&1; echo \"__RESTORE=failed\"; fi`,\n 'exit 0',\n ].join('\\n');\n}\n\nexport type RestoreOutcome =\n | { ok: true; newHead: string | null }\n | { ok: false; reason: 'none' | 'unknown' | 'norepo' | 'failed' };\n\nexport function parseRestoreOutput(stdout: string): RestoreOutcome {\n const text = String(stdout || '');\n if (/^__GIT=norepo\\s*$/m.test(text)) return { ok: false, reason: 'norepo' };\n const m = /^__RESTORE=(ok|none|unknown|failed)(?:\\s+([0-9a-f]{40}))?\\s*$/m.exec(text);\n if (!m) return { ok: false, reason: 'failed' };\n if (m[1] === 'ok') return { ok: true, newHead: normalizeSha(m[2] ?? '') };\n return { ok: false, reason: m[1] as 'none' | 'unknown' | 'failed' };\n}\n\n/**\n * RUN_COMMAND script for a bookmark: one bookmark per version, so existing\n * `bookmark/*` tags on that commit are removed first. `slug` null = remove.\n * Prints `__BOOKMARK=ok` | `__BOOKMARK=unknown` | `__BOOKMARK=failed` | `__GIT=norepo`.\n */\nexport function buildBookmarkCommand(sha: string, slug: string | null): string {\n const s = normalizeSha(sha);\n if (!s) throw new Error('invalid version id');\n if (slug !== null && bookmarkSlug(slug) !== slug) throw new Error('invalid bookmark name');\n return [\n NO_REPO,\n `git cat-file -e '${s}^{commit}' 2>/dev/null || { echo \"__BOOKMARK=unknown\"; exit 0; }`,\n `for T in $(git tag --points-at '${s}' --list 'bookmark/*' 2>/dev/null); do git tag -d \"$T\" >/dev/null 2>&1; done`,\n slug === null\n ? 'echo \"__BOOKMARK=ok\"'\n : `if git tag -f 'bookmark/${slug}' '${s}' >/dev/null 2>&1; then echo \"__BOOKMARK=ok\"; else echo \"__BOOKMARK=failed\"; fi`,\n 'exit 0',\n ].join('\\n');\n}\n\nexport function parseBookmarkOutput(stdout: string): 'ok' | 'unknown' | 'failed' | 'norepo' {\n const text = String(stdout || '');\n if (/^__GIT=norepo\\s*$/m.test(text)) return 'norepo';\n const m = /^__BOOKMARK=(ok|unknown|failed)\\s*$/m.exec(text);\n return (m?.[1] as 'ok' | 'unknown' | 'failed' | undefined) ?? 'failed';\n}\n\n/**\n * True when a connector error means \"this agent doesn't have that action yet\"\n * (the connector's `Unknown webbuilder action: X`, or the CLI's not-found forms).\n */\nexport function isUnknownActionError(error: string | null | undefined, data?: Record<string, unknown>): boolean {\n const blob = `${error || ''} ${typeof data?.error === 'string' ? data.error : ''} ${typeof data?.code === 'string' ? data.code : ''}`;\n return /unknown (webbuilder )?action|action[^\\n]{0,80}\\bnot (found|supported|available)|no such action|unsupported action|invalid action/i.test(\n blob,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Display helpers\n\nexport type VersionKind = 'ai' | 'manual' | 'restore' | 'backup' | 'other';\n\n/** The git identities the builder commits with (the connector's and the surface's own). */\nconst BUILDER_AUTHOR_RE = /^(?:yantra(?:[ -]?web ?builder)?|web ?builder|cdecli)$/i;\nconst BUILDER_MESSAGE_RE = /^(?:cdecli:|manual edits:|restore to [0-9a-f]{7,40}:|backup:|webbuilder:)/i;\n/** A restore point named after the site: \"Happy Paws - first build\". */\nconst SNAPSHOT_NAME_RE = /^.+?\\s+[-–—]\\s+(.+)$/;\nconst FIRST_BUILD_RE = /^(?:.+?\\s+[-–—]\\s+)?first build$/i;\n\nexport function isBuilderAuthor(author: string | undefined): boolean {\n return BUILDER_AUTHOR_RE.test((author || '').trim());\n}\n\n/** A commit the builder made (AI turns, hand edits, restores, backups), not one inherited with the starting code. */\nexport function isBuilderVersion(version: Pick<WebbuilderVersion, 'message' | 'author'>): boolean {\n const m = (version.message || '').trim();\n return isBuilderAuthor(version.author) || BUILDER_MESSAGE_RE.test(m) || FIRST_BUILD_RE.test(m);\n}\n\nfunction sentence(text: string): string {\n const t = text.trim();\n return t ? t[0].toUpperCase() + t.slice(1) : t;\n}\n\n/**\n * Friendly label for a commit subject: AI turns (\"cdecli: …\", \"webbuilder: …\", \"<site> - first build\"),\n * hand edits (\"Manual edits: …\"), restores and backups. `author` lets a builder snapshot name lose its site prefix.\n */\nexport function describeVersion(message: string, author?: string): { kind: VersionKind; label: string } {\n const m = (message || '').trim();\n let r = /^cdecli:\\s*(.*)$/i.exec(m);\n if (r) return { kind: 'ai', label: r[1].trim() || 'AI change' };\n r = /^Manual edits:\\s*(.*)$/i.exec(m);\n if (r) {\n const rest = r[1].trim();\n return { kind: 'manual', label: !rest || rest === 'canvas changes' ? 'Your edits' : `Your edits: ${rest}` };\n }\n r = /^Restore to ([0-9a-f]{7,40}):\\s*(.*)$/i.exec(m);\n if (r) {\n const inner = describeVersion(r[2]);\n // Restoring a restore (Undo right after one) names the original once, not \"Restored “Restored “…””\".\n return { kind: 'restore', label: inner.kind === 'restore' ? inner.label : `Restored “${inner.label}”` };\n }\n if (/^backup:/i.test(m)) return { kind: 'backup', label: 'Backup saved' };\n r = /^webbuilder:\\s*(.*)$/i.exec(m);\n if (r) return { kind: 'ai', label: sentence(r[1]) || 'AI change' };\n if (FIRST_BUILD_RE.test(m)) return { kind: 'ai', label: 'First build' };\n r = isBuilderAuthor(author) ? SNAPSHOT_NAME_RE.exec(m) : null;\n if (r) return { kind: 'ai', label: sentence(r[1]) };\n return { kind: 'other', label: m || '(no message)' };\n}\n\n/** What History lists: the build's own versions, and how many inherited template commits were left out. */\nexport interface HistoryView {\n versions: WebbuilderVersion[];\n templateCommits: number;\n}\n\nexport interface TimelineOptions {\n /** Backups that changed no file. */\n unchanged?: ReadonlySet<string>;\n /** An imported repo, whose older commits are the user's own. */\n keepEarlier?: boolean;\n}\n\n/** The versions the user sees and steps through (History, Undo, Revert), as a list of its own. */\nexport interface VersionTimeline extends VersionList {\n templateCommits: number;\n /** A longer list may hold older versions. */\n hasMore?: boolean;\n}\n\n/** `historyView` as a `VersionList`: HEAD follows a folded backup down to the version it stands for. */\nexport function versionTimeline(list: VersionList, opts: TimelineOptions = {}): VersionTimeline {\n const view = historyView(list, opts);\n const head = view.versions.find((v) => v.isHead)?.sha ?? list.head;\n return { ...list, versions: view.versions, head, templateCommits: view.templateCommits };\n}\n\n/**\n * Commits older than the first build are the template's own history (written for its maintainers), so\n * only their count is kept. A backup that changed no file is folded into the version below it.\n * `keepEarlier`: an imported repo, whose older commits are the user's own.\n */\nexport function historyView(\n list: Pick<VersionList, 'versions'> | null | undefined,\n opts: TimelineOptions = {},\n): HistoryView {\n const all = list?.versions ?? [];\n let own = all;\n if (!opts.keepEarlier) {\n const oldest = (match: (v: WebbuilderVersion) => boolean) => {\n for (let i = all.length - 1; i >= 0; i--) if (match(all[i])) return i;\n return -1;\n };\n const firstBuild = oldest((v) => FIRST_BUILD_RE.test((v.message || '').trim()));\n const start = firstBuild >= 0 ? firstBuild : oldest(isBuilderVersion);\n if (start >= 0) own = all.slice(0, start + 1);\n }\n const versions: WebbuilderVersion[] = [];\n let carryHead = false;\n own.forEach((v, i) => {\n const fold =\n i < own.length - 1 &&\n !v.bookmark &&\n opts.unchanged?.has(v.sha) &&\n describeVersion(v.message, v.author).kind === 'backup';\n if (fold) {\n carryHead ||= v.isHead;\n return;\n }\n versions.push(carryHead && !v.isHead ? { ...v, isHead: true } : v);\n carryHead = false;\n });\n return { versions, templateCommits: all.length - own.length };\n}\n\n/** RUN_COMMAND script: which of these commits changed no file since their parent (`__SAME=<sha>` each). */\nexport function buildUnchangedCommand(shas: ReadonlyArray<string>): string {\n const valid = shas.map(normalizeSha).filter((s): s is string => s !== null && s.length === 40);\n return [\n NO_REPO,\n ...valid.map((s) => `git diff --quiet '${s}~1' '${s}' -- >/dev/null 2>&1 && echo \"__SAME=${s}\"`),\n 'echo \"__END=1\"',\n 'exit 0',\n ].join('\\n');\n}\n\nexport function parseUnchangedOutput(stdout: string): Set<string> {\n const out = new Set<string>();\n for (const m of String(stdout || '').matchAll(/^__SAME=([0-9a-f]{40})\\s*$/gm)) out.add(m[1]);\n return out;\n}\n\n/** \"just now\", \"5 min ago\", \"3 h ago\", \"2 days ago\", else a short date. */\nexport function relativeTime(iso: string | undefined, now: number = Date.now()): string {\n if (!iso) return '';\n const t = Date.parse(iso);\n if (Number.isNaN(t)) return '';\n const s = Math.max(0, Math.round((now - t) / 1000));\n if (s < 45) return 'just now';\n const min = Math.round(s / 60);\n if (min < 60) return `${min} min ago`;\n const h = Math.round(min / 60);\n if (h < 24) return `${h} h ago`;\n const d = Math.round(h / 24);\n if (d === 1) return 'yesterday';\n if (d < 7) return `${d} days ago`;\n return new Date(t).toISOString().slice(0, 10);\n}\n\n/** Who made it, in plain words: the AI, you, or (only on a person's own commit) their name. */\nfunction versionAuthor(kind: VersionKind, author: string | undefined): string {\n const name = author?.trim() || '';\n if (kind === 'ai' || kind === 'backup') return 'AI';\n if (kind === 'manual' || kind === 'restore') return name && !isBuilderAuthor(name) ? name : 'You';\n return isBuilderAuthor(name) ? 'AI' : name;\n}\n\n/** A History row: the commit message as the title, then time and author; the sha only in the tooltip. */\nexport function versionRow(\n version: Pick<WebbuilderVersion, 'shortSha' | 'message' | 'author' | 'date'>,\n now: number = Date.now(),\n): { kind: VersionKind; title: string; meta: string[]; tooltip: string } {\n const { kind, label } = describeVersion(version.message, version.author);\n const when = relativeTime(version.date, now);\n const who = versionAuthor(kind, version.author);\n const exact = version.date ? new Date(Date.parse(version.date)).toLocaleString() : '';\n return {\n kind,\n title: label,\n meta: [when, who].filter(Boolean),\n tooltip: [`Version ${version.shortSha}`, exact].filter(Boolean).join(' · '),\n };\n}\n\n/** A bookmark slug as a readable name: \"launch-ready\" -> \"Launch ready\". */\nexport function bookmarkLabel(slug: string): string {\n const text = slug.replace(/-+/g, ' ').trim();\n return text ? text[0].toUpperCase() + text.slice(1) : slug;\n}\n\n/** Chat line after a restore. */\nexport function restoredChatLine(version: Pick<WebbuilderVersion, 'shortSha' | 'message'>): string {\n return `Restored to ${version.shortSha}: ${describeVersion(version.message).label}`;\n}\n\n/**\n * The `manualEdits`-style entry the next AI turn gets, so it knows the files\n * went back to an older version (and doesn't \"fix\" them forward again).\n */\nexport function restoreManualEdit(version: Pick<WebbuilderVersion, 'shortSha' | 'message'>): {\n file: string;\n summary: string;\n} {\n return {\n file: '(whole project)',\n summary: oneLineSubject(\n `The user restored every file to version ${version.shortSha} (\"${describeVersion(version.message).label}\"). Changes made after that version are gone on purpose; build on the restored code.`,\n 500,\n ),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA8CA,MAAM,MAAS,GAAA,k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+1,217 @@
1
+ import {isOutdatedServerError,jsonValue,errorMessageOf}from'../data/graphql.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 DAY_MS = 864e5;
18
+ const FREE_ACTIVE_DAYS = 3;
19
+ const FREE_GRACE_END_DAYS = 10;
20
+ const EXTENDED_DAYS = 30;
21
+ const EXTENDED_GRACE_END_DAYS = 37;
22
+ function toMs(v) {
23
+ if (v === null || v === void 0 || v === "") return null;
24
+ const n = typeof v === "number" ? v : Date.parse(v);
25
+ return Number.isFinite(n) ? n : null;
26
+ }
27
+ function retentionPhase(state, now) {
28
+ const tier = state.retentionTier === "extended" || state.retentionTier === "paid" ? state.retentionTier : "free";
29
+ const last = toMs(state.lastActivityAt);
30
+ const extendedAt = toMs(state.extendedAt);
31
+ const since = last === null ? extendedAt != null ? extendedAt : now : Math.max(last, extendedAt != null ? extendedAt : 0);
32
+ const days2 = Math.max(0, Math.floor((now - since) / DAY_MS));
33
+ if (tier === "paid") return {
34
+ phase: "active",
35
+ daysIdle: days2,
36
+ daysLeft: null,
37
+ canExtend: false
38
+ };
39
+ if (tier === "free") {
40
+ if (days2 < FREE_ACTIVE_DAYS) return {
41
+ phase: "active",
42
+ daysIdle: days2,
43
+ daysLeft: FREE_ACTIVE_DAYS - days2,
44
+ canExtend: false
45
+ };
46
+ if (days2 < FREE_GRACE_END_DAYS) return {
47
+ phase: "ask-extend",
48
+ daysIdle: days2,
49
+ daysLeft: FREE_GRACE_END_DAYS - days2,
50
+ canExtend: extendedAt === null
51
+ };
52
+ return {
53
+ phase: "expired",
54
+ daysIdle: days2,
55
+ daysLeft: 0,
56
+ canExtend: false
57
+ };
58
+ }
59
+ if (days2 < EXTENDED_DAYS) return {
60
+ phase: "extended",
61
+ daysIdle: days2,
62
+ daysLeft: EXTENDED_DAYS - days2,
63
+ canExtend: false
64
+ };
65
+ if (days2 < EXTENDED_GRACE_END_DAYS) return {
66
+ phase: "grace",
67
+ daysIdle: days2,
68
+ daysLeft: EXTENDED_GRACE_END_DAYS - days2,
69
+ canExtend: false
70
+ };
71
+ return {
72
+ phase: "expired",
73
+ daysIdle: days2,
74
+ daysLeft: 0,
75
+ canExtend: false
76
+ };
77
+ }
78
+ const RETENTION_QUERY = `query webbuilderRetention($channelId: String!) {
79
+ webbuilderRetention(channelId: $channelId)
80
+ }`;
81
+ const EXTEND_RETENTION_MUTATION = `mutation extendWebbuilderRetention($channelId: String!) {
82
+ extendWebbuilderRetention(channelId: $channelId)
83
+ }`;
84
+ const str = (v) => typeof v === "string" && v.trim() ? v.trim() : null;
85
+ const time = (v) => typeof v === "number" ? v : str(v);
86
+ function parseRetention(raw) {
87
+ const v = jsonValue(raw);
88
+ if (!v || typeof v !== "object" || Array.isArray(v)) return null;
89
+ const top = v;
90
+ if (top.ok === false) return null;
91
+ const rec = top.state && typeof top.state === "object" && !Array.isArray(top.state) ? __spreadValues(__spreadValues({}, top), top.state) : top;
92
+ const tier = str(rec.retentionTier);
93
+ const state = __spreadValues({
94
+ lastActivityAt: time(rec.lastActivityAt),
95
+ retentionTier: tier === "free" || tier === "extended" || tier === "paid" ? tier : "free",
96
+ extendedAt: time(rec.extendedAt),
97
+ backupRepo: str(rec.backupRepo),
98
+ snapshotAt: str(rec.snapshotAt),
99
+ sandboxKilledAt: str(rec.sandboxKilledAt),
100
+ killedSandboxId: str(rec.killedSandboxId)
101
+ }, typeof rec.enforced === "boolean" ? {
102
+ enforced: rec.enforced
103
+ } : {});
104
+ return state;
105
+ }
106
+ async function loadRetention(gql, channelId) {
107
+ var _a, _b, _c;
108
+ try {
109
+ const r = await gql(RETENTION_QUERY, {
110
+ channelId
111
+ });
112
+ const first = (_b = (_a = r.errors) == null ? void 0 : _a.find((e) => e == null ? void 0 : e.message)) == null ? void 0 : _b.message;
113
+ if (first) return {
114
+ ok: false,
115
+ outdated: isOutdatedServerError(first),
116
+ message: first
117
+ };
118
+ return {
119
+ ok: true,
120
+ state: parseRetention((_c = r.data) == null ? void 0 : _c.webbuilderRetention)
121
+ };
122
+ } catch (err) {
123
+ const message = errorMessageOf(err);
124
+ return {
125
+ ok: false,
126
+ outdated: isOutdatedServerError(message),
127
+ message
128
+ };
129
+ }
130
+ }
131
+ async function extendRetention(gql, channelId) {
132
+ var _a, _b, _c, _d;
133
+ try {
134
+ const r = await gql(EXTEND_RETENTION_MUTATION, {
135
+ channelId
136
+ });
137
+ const first = (_b = (_a = r.errors) == null ? void 0 : _a.find((e) => e == null ? void 0 : e.message)) == null ? void 0 : _b.message;
138
+ if (first) {
139
+ return {
140
+ ok: false,
141
+ message: isOutdatedServerError(first) ? "Keeping projects longer needs the latest server." : first
142
+ };
143
+ }
144
+ const raw = jsonValue((_c = r.data) == null ? void 0 : _c.extendWebbuilderRetention);
145
+ if (raw && typeof raw === "object" && raw.ok === false) {
146
+ const rec = raw;
147
+ return {
148
+ ok: false,
149
+ message: (_d = str(rec.error)) != null ? _d : "This project can't be kept longer right now."
150
+ };
151
+ }
152
+ return {
153
+ ok: true,
154
+ state: parseRetention(raw)
155
+ };
156
+ } catch (err) {
157
+ return {
158
+ ok: false,
159
+ message: errorMessageOf(err)
160
+ };
161
+ }
162
+ }
163
+ function createRetentionService(gql) {
164
+ return {
165
+ load: (channelId) => loadRetention(gql, channelId),
166
+ extend: (channelId) => extendRetention(gql, channelId)
167
+ };
168
+ }
169
+ const days = (n) => n === 1 ? "1 day" : `${n != null ? n : 0} days`;
170
+ const MAY_BE_PAUSED = "Projects that aren't used for a while may be paused.";
171
+ function retentionBanner(p, opts) {
172
+ const later = opts.canUpgrade ? ["upgrade", "download"] : ["download"];
173
+ if (p.phase !== "ask-extend" && p.phase !== "grace" && p.phase !== "expired") return null;
174
+ if (!opts.enforced) {
175
+ if (p.phase === "ask-extend" && p.canExtend) {
176
+ return {
177
+ phase: "ask-extend",
178
+ text: `${MAY_BE_PAUSED} Keep this one active for 30 more days?`,
179
+ actions: ["extend"],
180
+ soft: true
181
+ };
182
+ }
183
+ return {
184
+ phase: p.phase,
185
+ text: `${MAY_BE_PAUSED} Your code stays downloadable.`,
186
+ actions: later,
187
+ soft: true
188
+ };
189
+ }
190
+ if (p.phase === "ask-extend") {
191
+ return p.canExtend ? {
192
+ phase: "ask-extend",
193
+ text: `This project will be cleaned up in ${days(p.daysLeft)}. Keep it for 30 more days?`,
194
+ actions: ["extend"],
195
+ soft: false
196
+ } : {
197
+ phase: "ask-extend",
198
+ text: `This project will be cleaned up in ${days(p.daysLeft)}. Your code stays downloadable.`,
199
+ actions: later,
200
+ soft: false
201
+ };
202
+ }
203
+ if (p.phase === "grace") {
204
+ return {
205
+ phase: "grace",
206
+ text: opts.canUpgrade ? `Free storage ends in ${days(p.daysLeft)}. Upgrade to keep editing. Your code stays downloadable.` : `Free storage ends in ${days(p.daysLeft)}. Your code stays downloadable.`,
207
+ actions: later,
208
+ soft: false
209
+ };
210
+ }
211
+ return {
212
+ phase: "expired",
213
+ text: "This workspace was cleaned up. Download your code or rebuild from it.",
214
+ actions: ["download"],
215
+ soft: false
216
+ };
217
+ }export{EXTENDED_DAYS,EXTENDED_GRACE_END_DAYS,EXTEND_RETENTION_MUTATION,FREE_ACTIVE_DAYS,FREE_GRACE_END_DAYS,RETENTION_QUERY,createRetentionService,extendRetention,loadRetention,parseRetention,retentionBanner,retentionPhase};//# sourceMappingURL=retention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.js","sources":["../../../../../src/features/webbuilder/web/project/retention.ts"],"sourcesContent":["/** How long a project's live workspace is kept: the server's phase function, GraphQL calls, banner copy. Pure. */\nimport { errorMessageOf, isOutdatedServerError, jsonValue, type GqlResult } from '../data/graphql';\n\nexport type RetentionTier = 'free' | 'extended' | 'paid';\nexport type RetentionPhaseName = 'active' | 'ask-extend' | 'extended' | 'grace' | 'expired';\n\nexport interface RetentionState {\n lastActivityAt?: string | number | null;\n retentionTier?: RetentionTier | null;\n extendedAt?: string | number | null;\n /** The private backup repo FINISH pushed to (`yantra-userbase/<userId>-<repo>` or its name). */\n backupRepo?: string | null;\n /** The latest restore point taken through the proxy. */\n snapshotAt?: string | null;\n /** The nightly job stopped the live sandbox: skip the wake attempt, restore or show saved code. */\n sandboxKilledAt?: string | null;\n /** The sandbox the job stopped (a later wake/restore records a new one). */\n killedSandboxId?: string | null;\n /** The server pauses and cleans up idle projects; absent on older servers, which never do. */\n enforced?: boolean;\n}\n\nexport interface RetentionPhase {\n phase: RetentionPhaseName;\n daysIdle: number;\n /** Whole days until the next step (cleanup / end of the extension); null when nothing is due (paid). */\n daysLeft: number | null;\n canExtend: boolean;\n}\n\nconst DAY_MS = 86_400_000;\nexport const FREE_ACTIVE_DAYS = 3;\nexport const FREE_GRACE_END_DAYS = 10;\nexport const EXTENDED_DAYS = 30;\nexport const EXTENDED_GRACE_END_DAYS = 37;\n\nfunction toMs(v: string | number | null | undefined): number | null {\n if (v === null || v === undefined || v === '') return null;\n const n = typeof v === 'number' ? v : Date.parse(v);\n return Number.isFinite(n) ? n : null;\n}\n\n/** Mirrors the server's `retentionPhase` exactly; keep the two in sync. */\nexport function retentionPhase(state: RetentionState, now: number): RetentionPhase {\n const tier: RetentionTier =\n state.retentionTier === 'extended' || state.retentionTier === 'paid' ? state.retentionTier : 'free';\n const last = toMs(state.lastActivityAt);\n const extendedAt = toMs(state.extendedAt);\n const since = last === null ? (extendedAt ?? now) : Math.max(last, extendedAt ?? 0);\n const days = Math.max(0, Math.floor((now - since) / DAY_MS));\n if (tier === 'paid') return { phase: 'active', daysIdle: days, daysLeft: null, canExtend: false };\n if (tier === 'free') {\n if (days < FREE_ACTIVE_DAYS)\n return { phase: 'active', daysIdle: days, daysLeft: FREE_ACTIVE_DAYS - days, canExtend: false };\n if (days < FREE_GRACE_END_DAYS)\n return {\n phase: 'ask-extend',\n daysIdle: days,\n daysLeft: FREE_GRACE_END_DAYS - days,\n canExtend: extendedAt === null,\n };\n return { phase: 'expired', daysIdle: days, daysLeft: 0, canExtend: false };\n }\n if (days < EXTENDED_DAYS)\n return { phase: 'extended', daysIdle: days, daysLeft: EXTENDED_DAYS - days, canExtend: false };\n if (days < EXTENDED_GRACE_END_DAYS)\n return { phase: 'grace', daysIdle: days, daysLeft: EXTENDED_GRACE_END_DAYS - days, canExtend: false };\n return { phase: 'expired', daysIdle: days, daysLeft: 0, canExtend: false };\n}\n\nexport const RETENTION_QUERY = `query webbuilderRetention($channelId: String!) {\n webbuilderRetention(channelId: $channelId)\n}`;\n\nexport const EXTEND_RETENTION_MUTATION = `mutation extendWebbuilderRetention($channelId: String!) {\n extendWebbuilderRetention(channelId: $channelId)\n}`;\n\nconst str = (v: unknown): string | null => (typeof v === 'string' && v.trim() ? v.trim() : null);\nconst time = (v: unknown): string | number | null => (typeof v === 'number' ? v : str(v));\n\n/** State fields at the top level or under `state` (the server's `phase` is recomputed); null when unusable. */\nexport function parseRetention(raw: unknown): RetentionState | null {\n const v = jsonValue(raw);\n if (!v || typeof v !== 'object' || Array.isArray(v)) return null;\n const top = v as Record<string, unknown>;\n // `{ok:false, error}`: not a member (or another refusal) - nothing to show.\n if (top.ok === false) return null;\n const rec =\n top.state && typeof top.state === 'object' && !Array.isArray(top.state)\n ? { ...top, ...(top.state as Record<string, unknown>) }\n : top;\n const tier = str(rec.retentionTier);\n const state: RetentionState = {\n lastActivityAt: time(rec.lastActivityAt),\n retentionTier: tier === 'free' || tier === 'extended' || tier === 'paid' ? tier : 'free',\n extendedAt: time(rec.extendedAt),\n backupRepo: str(rec.backupRepo),\n snapshotAt: str(rec.snapshotAt),\n sandboxKilledAt: str(rec.sandboxKilledAt),\n killedSandboxId: str(rec.killedSandboxId),\n ...(typeof rec.enforced === 'boolean' ? { enforced: rec.enforced } : {}),\n };\n return state;\n}\n\n/** One shape (native has no strict null checks, where the web's union does not narrow). */\nexport interface RetentionLoad {\n ok: boolean;\n state?: RetentionState | null;\n /** `outdated`: the server has no `webbuilderRetention` (show nothing). */\n outdated?: boolean;\n message?: string;\n}\n\ntype Gql = <T>(document: string, variables: Record<string, unknown>) => Promise<GqlResult<T>>;\n\nexport async function loadRetention(gql: Gql, channelId: string): Promise<RetentionLoad> {\n try {\n const r = await gql<{ webbuilderRetention?: unknown }>(RETENTION_QUERY, { channelId });\n const first = r.errors?.find((e) => e?.message)?.message;\n if (first) return { ok: false, outdated: isOutdatedServerError(first), message: first };\n return { ok: true, state: parseRetention(r.data?.webbuilderRetention) };\n } catch (err) {\n const message = errorMessageOf(err);\n return { ok: false, outdated: isOutdatedServerError(message), message };\n }\n}\n\nexport async function extendRetention(\n gql: Gql,\n channelId: string,\n): Promise<{ ok: boolean; state?: RetentionState | null; message?: string }> {\n try {\n const r = await gql<{ extendWebbuilderRetention?: unknown }>(EXTEND_RETENTION_MUTATION, { channelId });\n const first = r.errors?.find((e) => e?.message)?.message;\n if (first) {\n return {\n ok: false,\n message: isOutdatedServerError(first) ? 'Keeping projects longer needs the latest server.' : first,\n };\n }\n // A refusal comes back as JSON: `{ok:false, code:\"paid\"|\"already-extended\"|\"not-yet\"|\"expired\", error}`.\n const raw = jsonValue(r.data?.extendWebbuilderRetention);\n if (raw && typeof raw === 'object' && (raw as Record<string, unknown>).ok === false) {\n const rec = raw as Record<string, unknown>;\n return { ok: false, message: str(rec.error) ?? \"This project can't be kept longer right now.\" };\n }\n return { ok: true, state: parseRetention(raw) };\n } catch (err) {\n return { ok: false, message: errorMessageOf(err) };\n }\n}\n\n/** The project view's transport for retention (absent: no banner). */\nexport interface WebBuilderRetentionService {\n load: (channelId: string) => Promise<RetentionLoad>;\n extend: (channelId: string) => ReturnType<typeof extendRetention>;\n}\n\nexport function createRetentionService(gql: Gql): WebBuilderRetentionService {\n return {\n load: (channelId) => loadRetention(gql, channelId),\n extend: (channelId) => extendRetention(gql, channelId),\n };\n}\n\nexport type RetentionAction = 'extend' | 'upgrade' | 'download';\n\nexport interface RetentionBannerModel {\n phase: Extract<RetentionPhaseName, 'ask-extend' | 'grace' | 'expired'>;\n text: string;\n actions: RetentionAction[];\n /** Nothing is paused or deleted yet, so the copy makes no promise about it. */\n soft: boolean;\n}\n\nconst days = (n: number | null) => (n === 1 ? '1 day' : `${n ?? 0} days`);\n\nconst MAY_BE_PAUSED = \"Projects that aren't used for a while may be paused.\";\n\n/** The project view's banner for a phase; null while nothing needs saying. */\nexport function retentionBanner(\n p: RetentionPhase,\n opts: { canUpgrade: boolean; enforced?: boolean },\n): RetentionBannerModel | null {\n const later: RetentionAction[] = opts.canUpgrade ? ['upgrade', 'download'] : ['download'];\n if (p.phase !== 'ask-extend' && p.phase !== 'grace' && p.phase !== 'expired') return null;\n if (!opts.enforced) {\n if (p.phase === 'ask-extend' && p.canExtend) {\n return {\n phase: 'ask-extend',\n text: `${MAY_BE_PAUSED} Keep this one active for 30 more days?`,\n actions: ['extend'],\n soft: true,\n };\n }\n return { phase: p.phase, text: `${MAY_BE_PAUSED} Your code stays downloadable.`, actions: later, soft: true };\n }\n if (p.phase === 'ask-extend') {\n return p.canExtend\n ? {\n phase: 'ask-extend',\n text: `This project will be cleaned up in ${days(p.daysLeft)}. Keep it for 30 more days?`,\n actions: ['extend'],\n soft: false,\n }\n : {\n phase: 'ask-extend',\n text: `This project will be cleaned up in ${days(p.daysLeft)}. Your code stays downloadable.`,\n actions: later,\n soft: false,\n };\n }\n if (p.phase === 'grace') {\n return {\n phase: 'grace',\n text: opts.canUpgrade\n ? `Free storage ends in ${days(p.daysLeft)}. Upgrade to keep editing. Your code stays downloadable.`\n : `Free storage ends in ${days(p.daysLeft)}. Your code stays downloadable.`,\n actions: later,\n soft: false,\n };\n }\n return {\n phase: 'expired',\n text: 'This workspace was cleaned up. Download your code or rebuild from it.',\n actions: ['download'],\n soft: false,\n };\n}\n\n/** The org FINISH backs projects up to; its repos are ours, not the user's. */\nexport const BACKUP_ORG = 'yantra-userbase';\n\n/** `owner/name` from a GitHub URL or an `owner/name` string; null otherwise. */\nexport function repoOwnerName(raw: string | null | undefined): { owner: string; name: string } | null {\n const s = String(raw || '')\n .trim()\n .replace(/\\.git$/i, '')\n .replace(/[.,;]+$/, '');\n if (!s) return null;\n const m =\n s.match(/^https?:\\/\\/(?:www\\.)?github\\.com\\/([^/\\s]+)\\/([^/\\s?#]+)/i) ??\n s.match(/^([A-Za-z0-9-]{1,39})\\/([A-Za-z0-9._-]{1,100})$/);\n return m ? { owner: m[1], name: m[2] } : null;\n}\n\n/** \"Your code: GitHub\" only for a repo the user owns, never the backup org's. */\nexport function isUserOwnedRepo(raw: string | null | undefined): boolean {\n const r = repoOwnerName(raw);\n return Boolean(r && r.owner.toLowerCase() !== BACKUP_ORG);\n}\n\n/** A clone URL for the backup repo (`name` alone lives in the backup org). */\nexport function backupRepoUrl(backupRepo: string | null | undefined): string | null {\n const raw = String(backupRepo || '').trim();\n if (!raw) return null;\n const r = repoOwnerName(raw);\n if (r) return `https://github.com/${r.owner}/${r.name}`;\n return /^[A-Za-z0-9._-]{1,100}$/.test(raw) ? `https://github.com/${BACKUP_ORG}/${raw}` : null;\n}\n\n/** The retention job stopped this build's sandbox: skip the wake attempt (restore / saved code). */\nexport function sandboxWasKilled(\n state: RetentionState | null | undefined,\n sandboxId: string | null | undefined,\n): boolean {\n if (!state?.sandboxKilledAt) return false;\n const killed = String(state.killedSandboxId || '').trim();\n return !killed || killed === String(sandboxId || '').trim();\n}\n"],"names":["days"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,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,CAAA;AAAA,MAClB,IAAM,EAAA;AAAA,KACJ,GAAA;AAAA,MACF,KAAO,EAAA,YAAA;AAAA,MACP,IAAM,EAAA,CAAA,mCAAA,EAAsC,IAAK,CAAA,CAAA,CAAE,QAAQ,CAAC,CAAA,+BAAA,CAAA;AAAA,MAC5D,OAAS,EAAA,KAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA;AAEF,EAAI,IAAA,CAAA,CAAE,UAAU,OAAS,EAAA;AACvB,IAAO,OAAA;AAAA,MACL,KAAO,EAAA,OAAA;AAAA,MACP,IAAM,EAAA,IAAA,CAAK,UAAa,GAAA,CAAA,qBAAA,EAAwB,IAAK,CAAA,CAAA,CAAE,QAAQ,CAAC,CAA6D,wDAAA,CAAA,GAAA,CAAA,qBAAA,EAAwB,IAAK,CAAA,CAAA,CAAE,QAAQ,CAAC,CAAA,+BAAA,CAAA;AAAA,MACrK,OAAS,EAAA,KAAA;AAAA,MACT,IAAM,EAAA;AAAA,KACR;AAAA;AAEF,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,SAAA;AAAA,IACP,IAAM,EAAA,uEAAA;AAAA,IACN,OAAA,EAAS,CAAC,UAAU,CAAA;AAAA,IACpB,IAAM,EAAA;AAAA,GACR;AACF"}
@@ -0,0 +1,81 @@
1
+ function isUnknownActionError(result) {
2
+ var _a;
3
+ const blob = typeof result === "string" ? result : [(result == null ? void 0 : result.error) || "", typeof ((_a = result == null ? void 0 : result.data) == null ? void 0 : _a.cause) === "string" ? result.data.cause : ""].join("\n");
4
+ return /unknown (webbuilder )?action|action[^\n]{0,60}(not found|is not supported|does not exist|unknown)|no such action|unsupported action|not a known action/i.test(blob);
5
+ }
6
+ const NOT_AVAILABLE = {
7
+ unpublish: "Unpublish is not available yet.",
8
+ analytics: "Analytics not available yet.",
9
+ status: "Site status is not available yet.",
10
+ snapshot: "Sharing as a template is not available yet.",
11
+ domain: "Custom domains are not available yet."
12
+ };
13
+ const NEEDS_CREDENTIAL = {
14
+ unpublish: "Connect your Cloudflare account to take this site offline.",
15
+ analytics: "Connect Cloudflare with analytics access to see visits.",
16
+ status: "Connect your Cloudflare account to check this site.",
17
+ snapshot: "Sign in again to share this project.",
18
+ domain: "Connect your Cloudflare account to manage this domain."
19
+ };
20
+ function firstLine(s, max = 240) {
21
+ const line = (s.split("\n").map((l) => l.trim()).find(Boolean) || "").replace(/\s*\[[A-Z][A-Z0-9_]*(?:;[^\]]*)?\]\s*$/, "").replace(/[;,]?\s*the user (?:cannot|can't|can not) fix this\.?/i, ".").replace(/\.\.$/, ".").trim();
22
+ if (/^at\s|\bError:\s*$/.test(line)) return "";
23
+ return line.length > max ? `${line.slice(0, max - 1)}\u2026` : line;
24
+ }
25
+ function codeTag(error) {
26
+ const m = /\[([A-Z][A-Z0-9_]*)(?:;[^\]]*)?\]\s*$/.exec(error.trim());
27
+ return m ? m[1] : "";
28
+ }
29
+ function actionFields(data) {
30
+ const rec = data && typeof data === "object" ? data : {};
31
+ const inner = rec.data;
32
+ if (inner && typeof inner === "object" && !Array.isArray(inner)) return inner;
33
+ return rec;
34
+ }
35
+ function forbiddenMessage(text) {
36
+ if (/no owner on record/i.test(text)) return "Publish once more, then unpublish.";
37
+ if (/could not confirm who you are/i.test(text)) return "Sign in again, then try once more.";
38
+ if (/turned off|reserved/i.test(text)) return firstLine(text) || "This site was published from another account.";
39
+ return "This site was published from another account.";
40
+ }
41
+ function classifyActionFailure(result, feature) {
42
+ var _a;
43
+ if (isUnknownActionError(result)) return {
44
+ kind: "not-available",
45
+ message: NOT_AVAILABLE[feature]
46
+ };
47
+ const data = actionFields(result.data);
48
+ const code = String(data.errorCode || ((_a = result.data) == null ? void 0 : _a.errorCode) || codeTag(result.error || ""));
49
+ const text = [result.error || "", typeof data.cause === "string" ? data.cause : ""].join("\n");
50
+ if (code === "FORBIDDEN" || /\[FORBIDDEN\]/.test(result.error || "")) {
51
+ return {
52
+ kind: "error",
53
+ message: forbiddenMessage(text)
54
+ };
55
+ }
56
+ const scopeMiss = feature === "analytics" && code !== "PLATFORM_NOT_CONFIGURED" && /\b(scope|permission|not authorized|unauthorized|forbidden|403)\b/i.test(text);
57
+ if (data.needsCredential || code === "CREDENTIAL_REQUIRED" || code === "CREDENTIAL_INCOMPLETE" || scopeMiss) {
58
+ return {
59
+ kind: "needs-credential",
60
+ message: NEEDS_CREDENTIAL[feature]
61
+ };
62
+ }
63
+ if (code === "PLATFORM_NOT_CONFIGURED") {
64
+ return {
65
+ kind: "platform",
66
+ message: feature === "analytics" ? "Analytics not available yet on this workspace." : "Publishing is not set up on this workspace yet. A Yantra admin needs to configure it."
67
+ };
68
+ }
69
+ const line = firstLine(text);
70
+ const fallback = {
71
+ unpublish: "Could not take the site offline.",
72
+ analytics: "Could not load analytics.",
73
+ status: "Could not check the site.",
74
+ snapshot: "Could not create the template link.",
75
+ domain: "Could not update the domain."
76
+ };
77
+ return {
78
+ kind: "error",
79
+ message: line ? `${fallback[feature]} ${line}` : fallback[feature]
80
+ };
81
+ }export{actionFields,classifyActionFailure,isUnknownActionError};//# sourceMappingURL=actionErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionErrors.js","sources":["../../../../../src/features/webbuilder/web/publish/actionErrors.ts"],"sourcesContent":["/**\n * Plain-language messages for failed publish-side connector calls. An\n * action the connector doesn't know yet (spec §1 \"when an action is missing\")\n * is \"Not available yet\" - never a fake success, never a stack trace.\n */\n\n/** A sandbox action's answer (web `canvas/types`). */\ninterface SandboxActionResult {\n successful: boolean;\n data?: Record<string, unknown>;\n error?: string | null;\n}\n\n/** The connector (or cdecli) does not know this action yet (web `publishState`). */\nexport function isUnknownActionError(\n result: Pick<SandboxActionResult, 'error' | 'data'> | string | null | undefined,\n): boolean {\n const blob =\n typeof result === 'string'\n ? result\n : [result?.error || '', typeof result?.data?.cause === 'string' ? result.data.cause : ''].join('\\n');\n return /unknown (webbuilder )?action|action[^\\n]{0,60}(not found|is not supported|does not exist|unknown)|no such action|unsupported action|not a known action/i.test(\n blob,\n );\n}\n\nexport type PublishFeature = 'unpublish' | 'analytics' | 'status' | 'snapshot' | 'domain';\nexport type ActionFailureKind = 'not-available' | 'needs-credential' | 'platform' | 'error';\n\nconst NOT_AVAILABLE: Record<PublishFeature, string> = {\n unpublish: 'Unpublish is not available yet.',\n analytics: 'Analytics not available yet.',\n status: 'Site status is not available yet.',\n snapshot: 'Sharing as a template is not available yet.',\n domain: 'Custom domains are not available yet.',\n};\n\nconst NEEDS_CREDENTIAL: Record<PublishFeature, string> = {\n unpublish: 'Connect your Cloudflare account to take this site offline.',\n analytics: 'Connect Cloudflare with analytics access to see visits.',\n status: 'Connect your Cloudflare account to check this site.',\n snapshot: 'Sign in again to share this project.',\n domain: 'Connect your Cloudflare account to manage this domain.',\n};\n\nfunction firstLine(s: string, max = 240): string {\n const line = (\n s\n .split('\\n')\n .map((l) => l.trim())\n .find(Boolean) || ''\n )\n // The connector's `[CODE]` / `[CODE; connect x]` tag is for programs, not people.\n .replace(/\\s*\\[[A-Z][A-Z0-9_]*(?:;[^\\]]*)?\\]\\s*$/, '')\n // Notes the connector writes for the AI (\"the user cannot fix this\") are not for people either.\n .replace(/[;,]?\\s*the user (?:cannot|can't|can not) fix this\\.?/i, '.')\n .replace(/\\.\\.$/, '.')\n .trim();\n // Never show stack frames.\n if (/^at\\s|\\bError:\\s*$/.test(line)) return '';\n return line.length > max ? `${line.slice(0, max - 1)}…` : line;\n}\n\nfunction codeTag(error: string): string {\n const m = /\\[([A-Z][A-Z0-9_]*)(?:;[^\\]]*)?\\]\\s*$/.exec(error.trim());\n return m ? m[1] : '';\n}\n\n/** The action's fields (the transport unwraps `{ data }`; a second layer is tolerated). */\nexport function actionFields(data: Record<string, unknown> | null | undefined): Record<string, unknown> {\n const rec = data && typeof data === 'object' ? data : {};\n const inner = rec.data;\n if (inner && typeof inner === 'object' && !Array.isArray(inner)) return inner as Record<string, unknown>;\n return rec;\n}\n\n/**\n * FORBIDDEN from UNPUBLISH / ANALYTICS (site ownership). The connector's\n * reasons: another owner, an older site with no owner on record yet (it is\n * claimed by the next publish), an unverified caller, or checks turned off.\n */\nfunction forbiddenMessage(text: string): string {\n if (/no owner on record/i.test(text)) return 'Publish once more, then unpublish.';\n if (/could not confirm who you are/i.test(text)) return 'Sign in again, then try once more.';\n if (/turned off|reserved/i.test(text)) return firstLine(text) || 'This site was published from another account.';\n return 'This site was published from another account.';\n}\n\nexport function classifyActionFailure(\n result: Pick<SandboxActionResult, 'error' | 'data'>,\n feature: PublishFeature,\n): { kind: ActionFailureKind; message: string } {\n if (isUnknownActionError(result)) return { kind: 'not-available', message: NOT_AVAILABLE[feature] };\n const data = actionFields(result.data);\n // The code may only survive as the error text's `[CODE]` tag when the transport drops `data`.\n const code = String(data.errorCode || result.data?.errorCode || codeTag(result.error || ''));\n const text = [result.error || '', typeof data.cause === 'string' ? data.cause : ''].join('\\n');\n if (code === 'FORBIDDEN' || /\\[FORBIDDEN\\]/.test(result.error || '')) {\n return { kind: 'error', message: forbiddenMessage(text) };\n }\n const scopeMiss =\n feature === 'analytics' &&\n code !== 'PLATFORM_NOT_CONFIGURED' &&\n /\\b(scope|permission|not authorized|unauthorized|forbidden|403)\\b/i.test(text);\n if (data.needsCredential || code === 'CREDENTIAL_REQUIRED' || code === 'CREDENTIAL_INCOMPLETE' || scopeMiss) {\n return { kind: 'needs-credential', message: NEEDS_CREDENTIAL[feature] };\n }\n if (code === 'PLATFORM_NOT_CONFIGURED') {\n return {\n kind: 'platform',\n message:\n feature === 'analytics'\n ? 'Analytics not available yet on this workspace.'\n : 'Publishing is not set up on this workspace yet. A Yantra admin needs to configure it.',\n };\n }\n const line = firstLine(text);\n const fallback: Record<PublishFeature, string> = {\n unpublish: 'Could not take the site offline.',\n analytics: 'Could not load analytics.',\n status: 'Could not check the site.',\n snapshot: 'Could not create the template link.',\n domain: 'Could not update the domain.',\n };\n return { kind: 'error', message: line ? `${fallback[feature]} ${line}` : fallback[feature] };\n}\n"],"names":[],"mappings":"AAcO,S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AAQ,EAAA,2BAAA;AAAA,IACR,QAAU,EAAA,qCAAA;AAAA,IACV,MAAQ,EAAA;AAAA,GACV;AACA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,OAAA,EAAS,IAAO,GAAA,CAAA,EAAG,QAAS,CAAA,OAAO,CAAC,CAAI,CAAA,EAAA,IAAI,CAAK,CAAA,GAAA,QAAA,CAAS,OAAO;AAAA,GACnE;AACF"}
@@ -0,0 +1,86 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const ORDER = ["check", "build", "upload", "live", "audit"];
21
+ const COPY = {
22
+ check: {
23
+ label: "Check",
24
+ hint: "Looking for problems before publishing"
25
+ },
26
+ build: {
27
+ label: "Build",
28
+ hint: "Making the fast, production version"
29
+ },
30
+ upload: {
31
+ label: "Upload",
32
+ hint: "Putting the files online"
33
+ },
34
+ live: {
35
+ label: "Live",
36
+ hint: "Making your address work"
37
+ },
38
+ audit: {
39
+ label: "Audit",
40
+ hint: "Checking speed, accessibility and SEO"
41
+ }
42
+ };
43
+ function publishStepFromText(text) {
44
+ const t = String(text || "").toLowerCase();
45
+ if (!t.trim()) return null;
46
+ if (/speed|accessibility|\bseo\b|audit|lighthouse|pagespeed/.test(t)) return "audit";
47
+ if (/live site|connecting your domain|going live|verif/.test(t)) return "live";
48
+ if (/preparing hosting|publishing your site|upload|deploy/.test(t)) return "upload";
49
+ if (/build|compil|bundl/.test(t)) return "build";
50
+ if (/check/.test(t)) return "check";
51
+ return null;
52
+ }
53
+ function laterStep(a, b) {
54
+ if (!a) return b;
55
+ if (!b) return a;
56
+ return ORDER.indexOf(b) > ORDER.indexOf(a) ? b : a;
57
+ }
58
+ function publishSteps(input) {
59
+ var _a;
60
+ const reached = (_a = input.reached) != null ? _a : "check";
61
+ const showAudit = reached === "audit" || Boolean(input.audited);
62
+ const ids = ORDER.filter((id) => id !== "audit" || showAudit);
63
+ const at = ids.indexOf(reached);
64
+ const view = (id, status) => __spreadProps(__spreadValues({
65
+ id
66
+ }, COPY[id]), {
67
+ status
68
+ });
69
+ if (input.outcome === "blocked") {
70
+ return ids.map((id) => view(id, id === "check" ? "failed" : "pending"));
71
+ }
72
+ if (input.failed) {
73
+ return ids.map((id, i) => view(id, i < at ? "done" : i === at ? "failed" : "pending"));
74
+ }
75
+ if (input.outcome === "running") {
76
+ return ids.map((id, i) => view(id, i < at ? "done" : i === at ? "active" : "pending"));
77
+ }
78
+ if (input.live) return ids.map((id) => view(id, "done"));
79
+ return ids.map((id, i) => view(id, i < at ? "done" : i === at ? "failed" : "pending"));
80
+ }
81
+ function formatElapsed(ms) {
82
+ const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1e3));
83
+ const m = Math.floor(total / 60);
84
+ const s = total % 60;
85
+ return `${m}:${String(s).padStart(2, "0")}`;
86
+ }export{formatElapsed,laterStep,publishStepFromText,publishSteps};//# sourceMappingURL=publishSteps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishSteps.js","sources":["../../../../../src/features/webbuilder/web/publish/publishSteps.ts"],"sourcesContent":["/** The publish step view (Check, Build, Upload, Live, Audit) from what the publish run already knows. Pure. */\n\n/** How a publish run ended (web `publishState`). */\nexport type PublishRunOutcome = 'running' | 'published' | 'blocked' | 'finished';\n\nexport type PublishStepId = 'check' | 'build' | 'upload' | 'live' | 'audit';\nexport type PublishStepStatus = 'done' | 'active' | 'pending' | 'failed';\n\nexport interface PublishStepView {\n id: PublishStepId;\n label: string;\n hint: string;\n status: PublishStepStatus;\n}\n\nconst ORDER: readonly PublishStepId[] = ['check', 'build', 'upload', 'live', 'audit'];\n\nconst COPY: Record<PublishStepId, { label: string; hint: string }> = {\n check: { label: 'Check', hint: 'Looking for problems before publishing' },\n build: { label: 'Build', hint: 'Making the fast, production version' },\n upload: { label: 'Upload', hint: 'Putting the files online' },\n live: { label: 'Live', hint: 'Making your address work' },\n audit: { label: 'Audit', hint: 'Checking speed, accessibility and SEO' },\n};\n\n/** The step a progress line belongs to (the agent's current action in words), or null when it says nothing new. */\nexport function publishStepFromText(text: string | null | undefined): PublishStepId | null {\n const t = String(text || '').toLowerCase();\n if (!t.trim()) return null;\n if (/speed|accessibility|\\bseo\\b|audit|lighthouse|pagespeed/.test(t)) return 'audit';\n if (/live site|connecting your domain|going live|verif/.test(t)) return 'live';\n if (/preparing hosting|publishing your site|upload|deploy/.test(t)) return 'upload';\n if (/build|compil|bundl/.test(t)) return 'build';\n if (/check/.test(t)) return 'check';\n return null;\n}\n\n/** The later of two steps: a run never moves backwards. */\nexport function laterStep(a: PublishStepId | null, b: PublishStepId | null): PublishStepId | null {\n if (!a) return b;\n if (!b) return a;\n return ORDER.indexOf(b) > ORDER.indexOf(a) ? b : a;\n}\n\nexport function publishSteps(input: {\n /** The furthest step the run has reached (null = just started). */\n reached: PublishStepId | null;\n outcome: PublishRunOutcome;\n failed?: boolean;\n /** The run ended live (a new record, or a live address once the watch ended). */\n live?: boolean;\n /** Speed / SEO scores came back for this run. */\n audited?: boolean;\n}): PublishStepView[] {\n const reached = input.reached ?? 'check';\n const showAudit = reached === 'audit' || Boolean(input.audited);\n const ids = ORDER.filter((id) => id !== 'audit' || showAudit);\n const at = ids.indexOf(reached);\n const view = (id: PublishStepId, status: PublishStepStatus): PublishStepView => ({ id, ...COPY[id], status });\n\n if (input.outcome === 'blocked') {\n return ids.map((id) => view(id, id === 'check' ? 'failed' : 'pending'));\n }\n if (input.failed) {\n return ids.map((id, i) => view(id, i < at ? 'done' : i === at ? 'failed' : 'pending'));\n }\n if (input.outcome === 'running') {\n return ids.map((id, i) => view(id, i < at ? 'done' : i === at ? 'active' : 'pending'));\n }\n if (input.live) return ids.map((id) => view(id, 'done'));\n // The watch ended without a live address: the step it stopped on did not finish.\n return ids.map((id, i) => view(id, i < at ? 'done' : i === at ? 'failed' : 'pending'));\n}\n\n/** \"0:07\", \"1:42\", \"12:05\". */\nexport function formatElapsed(ms: number): string {\n const total = Math.max(0, Math.floor((Number.isFinite(ms) ? ms : 0) / 1000));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${m}:${String(s).padStart(2, '0')}`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,MAAM,QAAkC,CAAC,OAAA,EAAS,OAAS,EAAA,QAAA,EAAU,QAAQ,OAAO,CAAA;AACpF,MAAM,IAGD,GAAA;AAAA,EACH,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,OAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,OAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,QAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,OAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAA;AAGO,SAAS,oBAAoB,IAAuD,E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AO,MAAO,CAAA,QAAA,CAAS,EAAE,CAAA,GAAI,EAAK,GAAA,CAAA,IAAK,GAAI,CAAC,CAAA;AAC3E,EAAA,MAAM,CAAI,GAAA,IAAA,CAAK,KAAM,CAAA,KAAA,GAAQ,EAAE,CAAA;AAC/B,EAAA,MAAM,IAAI,KAAQ,GAAA,EAAA;AAClB,EAAO,OAAA,CAAA,EAAG,CAAC,CAAI,CAAA,EAAA,MAAA,CAAO,CAAC,CAAE,CAAA,QAAA,CAAS,CAAG,EAAA,GAAG,CAAC,CAAA,CAAA;AAC3C"}
@@ -0,0 +1,79 @@
1
+ import {publicSandboxDomain}from'../../publicSandboxDomain.js';function configuredSuffix() {
2
+ return "yarntra.com";
3
+ }
4
+ const COMPANY_SITE_SUFFIX = configuredSuffix();
5
+ const PROJECT_NAME_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;
6
+ const PAGES_DEV_RE = /\.pages\.dev$/i;
7
+ const PLATFORM_LABELS = /* @__PURE__ */ new Set(["www", "app", "api", "cdn", "cdecli-agent", "idefront", "ideback", "sb"]);
8
+ const PLATFORM_LABEL_RE = /-surface$|^sb-|^\d+-/;
9
+ function hostOf(url) {
10
+ const raw = String(url != null ? url : "").trim();
11
+ if (!/^https?:\/\//i.test(raw)) return "";
12
+ try {
13
+ return new URL(raw).hostname.toLowerCase();
14
+ } catch (e) {
15
+ return "";
16
+ }
17
+ }
18
+ function isPagesDevHost(host) {
19
+ return PAGES_DEV_RE.test(host);
20
+ }
21
+ function companySiteName(host) {
22
+ const h = String(host || "").toLowerCase();
23
+ if (h.endsWith(".yarntra.com")) {
24
+ const name = h.slice(0, -".yarntra.com".length).split(".").pop() || "";
25
+ return PROJECT_NAME_RE.test(name) ? name : "";
26
+ }
27
+ if (h.endsWith(".yantra.app")) {
28
+ const name = h.slice(0, -".yantra.app".length);
29
+ if (!PROJECT_NAME_RE.test(name) || PLATFORM_LABELS.has(name) || PLATFORM_LABEL_RE.test(name)) return "";
30
+ return name;
31
+ }
32
+ return "";
33
+ }
34
+ function isCompanySiteHost(host) {
35
+ return companySiteName(host) !== "";
36
+ }
37
+ function siteProjectName(url) {
38
+ const host = hostOf(url);
39
+ if (!host) return "";
40
+ if (isPagesDevHost(host)) {
41
+ const name = host.replace(PAGES_DEV_RE, "").split(".").pop() || "";
42
+ return PROJECT_NAME_RE.test(name) ? name : "";
43
+ }
44
+ return companySiteName(host);
45
+ }
46
+ function companySiteUrl(projectName, suffix = COMPANY_SITE_SUFFIX) {
47
+ const name = String(projectName || "").trim().toLowerCase();
48
+ return PROJECT_NAME_RE.test(name) ? `https://${name}.${suffix}` : "";
49
+ }
50
+ function originOf(url) {
51
+ return `https://${hostOf(url)}`;
52
+ }
53
+ function isSandboxHost(host) {
54
+ const pub = publicSandboxDomain();
55
+ return /\.e2b\./.test(host) || Boolean(pub && host.endsWith(`.${pub}`));
56
+ }
57
+ function shownDomainUrl(value) {
58
+ const raw = String(value != null ? value : "").trim();
59
+ if (!raw) return "";
60
+ const host = hostOf(/^https?:\/\//i.test(raw) ? raw : `https://${raw}`);
61
+ if (!host || !/^[a-z0-9.-]+\.[a-z]{2,}$/.test(host) || isPagesDevHost(host) || isSandboxHost(host)) return "";
62
+ if (host.endsWith(".yantra.app") && !isCompanySiteHost(host)) return "";
63
+ return `https://${host}`;
64
+ }
65
+ function siteAddress(input) {
66
+ var _a, _b;
67
+ const custom = shownDomainUrl(input.customDomainUrl);
68
+ if (custom) return custom;
69
+ const urls = ((_a = input.urls) != null ? _a : []).map((u) => String(u != null ? u : "").trim()).filter(Boolean);
70
+ const company = urls.find((u) => isCompanySiteHost(hostOf(u)));
71
+ if (company) return originOf(company);
72
+ const name = String((_b = input.projectName) != null ? _b : "").trim() || urls.map(siteProjectName).find(Boolean) || "";
73
+ const built = companySiteUrl(name, input.suffix);
74
+ if (built) return built;
75
+ return urls.map(shownDomainUrl).find(Boolean) || "";
76
+ }
77
+ function siteHost(url) {
78
+ return url.replace(/^https?:\/\//, "").replace(/\/$/, "");
79
+ }export{COMPANY_SITE_SUFFIX,companySiteName,companySiteUrl,isCompanySiteHost,isPagesDevHost,siteAddress,siteHost,siteProjectName};//# sourceMappingURL=siteAddress.js.map