@adminide-stack/yantra-mobile 12.0.173 → 12.0.174-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 (130) hide show
  1. package/lib/compute.js +54 -1
  2. package/lib/compute.js.map +1 -1
  3. package/lib/features/apps/AppsCatalog.js +10 -0
  4. package/lib/features/apps/AppsCatalog.js.map +1 -1
  5. package/lib/features/apps/mobileAppCatalog.js +6 -1
  6. package/lib/features/apps/mobileAppCatalog.js.map +1 -1
  7. package/lib/features/apps/nativeAppHandoff.js +4 -1
  8. package/lib/features/apps/nativeAppHandoff.js.map +1 -1
  9. package/lib/features/apps/nativeSurfaceTwin.js +2 -1
  10. package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
  11. package/lib/features/channels/ChannelIcon.js +13 -3
  12. package/lib/features/channels/ChannelIcon.js.map +1 -1
  13. package/lib/features/channels/ConnectAppsSheet.js +5 -5
  14. package/lib/features/channels/ConnectAppsSheet.js.map +1 -1
  15. package/lib/features/channels/HomeImessage.js +5 -3
  16. package/lib/features/channels/HomeImessage.js.map +1 -1
  17. package/lib/features/channels/channelLinks.js +13 -1
  18. package/lib/features/channels/channelLinks.js.map +1 -1
  19. package/lib/features/computer/ComputerAgentChatPane.js +45 -0
  20. package/lib/features/computer/ComputerAgentChatPane.js.map +1 -0
  21. package/lib/features/computer/ComputerDesktop.js +164 -0
  22. package/lib/features/computer/ComputerDesktop.js.map +1 -0
  23. package/lib/features/computer/ComputerExperience.js +79 -0
  24. package/lib/features/computer/ComputerExperience.js.map +1 -0
  25. package/lib/features/computer/ComputerHandoff.js +142 -0
  26. package/lib/features/computer/ComputerHandoff.js.map +1 -0
  27. package/lib/features/computer/FilesPane.js +179 -0
  28. package/lib/features/computer/FilesPane.js.map +1 -0
  29. package/lib/features/computer/LivePage.js +1093 -0
  30. package/lib/features/computer/LivePage.js.map +1 -0
  31. package/lib/features/computer/TerminalPane.js +139 -0
  32. package/lib/features/computer/TerminalPane.js.map +1 -0
  33. package/lib/features/computer/computerApi.js +819 -0
  34. package/lib/features/computer/computerApi.js.map +1 -0
  35. package/lib/features/computer/computerChat.js +42 -0
  36. package/lib/features/computer/computerChat.js.map +1 -0
  37. package/lib/features/computer/computerControls.js +227 -0
  38. package/lib/features/computer/computerControls.js.map +1 -0
  39. package/lib/features/computer/computerStyles.js +384 -0
  40. package/lib/features/computer/computerStyles.js.map +1 -0
  41. package/lib/features/computer/computerTheme.js +133 -0
  42. package/lib/features/computer/computerTheme.js.map +1 -0
  43. package/lib/features/computer/handoff.js +73 -0
  44. package/lib/features/computer/handoff.js.map +1 -0
  45. package/lib/features/computer/inputLane.js +171 -0
  46. package/lib/features/computer/inputLane.js.map +1 -0
  47. package/lib/features/computer/inputPump.js +77 -0
  48. package/lib/features/computer/inputPump.js.map +1 -0
  49. package/lib/features/computer/inputSocket.js +148 -0
  50. package/lib/features/computer/inputSocket.js.map +1 -0
  51. package/lib/features/computer/keyboardBridge.js +176 -0
  52. package/lib/features/computer/keyboardBridge.js.map +1 -0
  53. package/lib/features/computer/pageCoordinates.js +19 -0
  54. package/lib/features/computer/pageCoordinates.js.map +1 -0
  55. package/lib/features/computer/pageZoom.js +12 -0
  56. package/lib/features/computer/pageZoom.js.map +1 -0
  57. package/lib/features/computer/pictureGeometry.js +68 -0
  58. package/lib/features/computer/pictureGeometry.js.map +1 -0
  59. package/lib/features/computer/tabsState.js +7 -0
  60. package/lib/features/computer/tabsState.js.map +1 -0
  61. package/lib/features/computer/useComputerHooks.js +146 -0
  62. package/lib/features/computer/useComputerHooks.js.map +1 -0
  63. package/lib/features/links/openInApp.js +10 -1
  64. package/lib/features/links/openInApp.js.map +1 -1
  65. package/lib/features/webbuilder/WebBuilderExperience.js +180 -44
  66. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  67. package/lib/features/webbuilder/buildFragments.js +16 -3
  68. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  69. package/lib/features/webbuilder/codezenHandoff.js +29 -1
  70. package/lib/features/webbuilder/codezenHandoff.js.map +1 -1
  71. package/lib/features/webbuilder/components/CodeView.js +69 -23
  72. package/lib/features/webbuilder/components/CodeView.js.map +1 -1
  73. package/lib/features/webbuilder/components/PreviewFrame.js +62 -2
  74. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  75. package/lib/features/webbuilder/components/PreviewScreen.js +37 -2
  76. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  77. package/lib/features/webbuilder/components/ProjectChat.js +2 -1
  78. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  79. package/lib/features/webbuilder/components/ProjectSheets.js +147 -57
  80. package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
  81. package/lib/features/webbuilder/components/PublishSheet.js +106 -2
  82. package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
  83. package/lib/features/webbuilder/components/ReferenceModeChoice.js +105 -0
  84. package/lib/features/webbuilder/components/ReferenceModeChoice.js.map +1 -0
  85. package/lib/features/webbuilder/components/RetentionBanner.js +17 -6
  86. package/lib/features/webbuilder/components/RetentionBanner.js.map +1 -1
  87. package/lib/features/webbuilder/components/SiteUploadSheet.js +327 -0
  88. package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -0
  89. package/lib/features/webbuilder/components/StreamStallNote.js +38 -0
  90. package/lib/features/webbuilder/components/StreamStallNote.js.map +1 -0
  91. package/lib/features/webbuilder/components/StudioHome.js +18 -8
  92. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  93. package/lib/features/webbuilder/previewRoutes.js +30 -1
  94. package/lib/features/webbuilder/previewRoutes.js.map +1 -1
  95. package/lib/features/webbuilder/studioCatalog.js +9 -2
  96. package/lib/features/webbuilder/studioCatalog.js.map +1 -1
  97. package/lib/features/webbuilder/web/chat/referenceMode.js +11 -0
  98. package/lib/features/webbuilder/web/chat/referenceMode.js.map +1 -0
  99. package/lib/features/webbuilder/web/chat/siteCopy.js +5 -2
  100. package/lib/features/webbuilder/web/chat/siteCopy.js.map +1 -1
  101. package/lib/features/webbuilder/web/chat/streamStall.js +6 -0
  102. package/lib/features/webbuilder/web/chat/streamStall.js.map +1 -0
  103. package/lib/features/webbuilder/web/code/savedCode.js +7 -0
  104. package/lib/features/webbuilder/web/code/savedCode.js.map +1 -0
  105. package/lib/features/webbuilder/web/design/directions.js.map +1 -1
  106. package/lib/features/webbuilder/web/history/versions.js.map +1 -1
  107. package/lib/features/webbuilder/web/import/websiteImport.js +27 -0
  108. package/lib/features/webbuilder/web/import/websiteImport.js.map +1 -0
  109. package/lib/features/webbuilder/web/preview/setupPhase.js +31 -0
  110. package/lib/features/webbuilder/web/preview/setupPhase.js.map +1 -0
  111. package/lib/features/webbuilder/web/publish/siteInsights.js +23 -1
  112. package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -1
  113. package/lib/features/webbuilder/web/upload/sitePhotos.js +102 -0
  114. package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -0
  115. package/lib/routes.json +54 -0
  116. package/lib/screens/ComputerNative/index.js +124 -0
  117. package/lib/screens/ComputerNative/index.js.map +1 -0
  118. package/lib/screens/ComputerNative/useComputerHostChat.js +83 -0
  119. package/lib/screens/ComputerNative/useComputerHostChat.js.map +1 -0
  120. package/lib/screens/Home/components/homeCatalog.js +2 -1
  121. package/lib/screens/Home/components/homeCatalog.js.map +1 -1
  122. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +6 -2
  123. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
  124. package/lib/screens/WebBuilderNative/index.js +15 -3
  125. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  126. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +18 -3
  127. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  128. package/lib/screens/WebBuilderNative/webbuilderTransport.js +16 -7
  129. package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
  130. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"homeCatalog.js","sources":["../../../../src/screens/Home/components/homeCatalog.ts"],"sourcesContent":["/**\n * The chat home's pure parts, kept apart from the components so they run under jest: the\n * \"Start something\" catalogue and draw (the web's YANTRA_SUGGESTIONS / useHomeSuggestions) and\n * the greeting (the web's HomeHero `greetingFor`).\n */\nimport type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\nimport type { BlankGuide } from '../../../features/chat/promptBlanks';\nimport type { RoutingMode } from '../types';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\nexport type HomeSuggestion = {\n id: string;\n label: string;\n /** What the row is for, on the line under its label. */\n hint: string;\n icon: IconName;\n prompt: string;\n mode?: RoutingMode;\n /** Navigate here instead of injecting the prompt, when the host wires navigation. */\n nativeRoute?: string;\n /**\n * The app this shortcut is for: a registry intent id, the one the brain answers with\n * (the web's `panel`). Chat opens it when the brain names no other app for the send.\n */\n app?: string;\n /** For each `[blank]` in the prompt, in order: what to ask, and answers one tap away. */\n blanks?: readonly BlankGuide[];\n};\n\n/** The web's YANTRA_SUGGESTIONS, in its order. */\nexport const HOME_SUGGESTIONS: readonly HomeSuggestion[] = [\n {\n id: 'design',\n icon: 'palette-outline',\n label: 'Design a landing page',\n hint: 'Chat-driven design canvas — iterate on a real page, not a mockup',\n prompt: 'Design a landing page for [your product]. Start with the hero and the pricing section.',\n blanks: [\n {\n ask: \"What's the product?\",\n suggestions: ['a dog-walking app', 'a coffee subscription', 'a yoga studio'],\n },\n ],\n app: 'design',\n },\n {\n id: 'webbuilder',\n icon: 'web',\n label: 'Build a working web app',\n hint: 'Scaffold and edit a real app from a prompt',\n prompt: 'Build me a small web app with a form that stores submissions and a page that lists them.',\n app: 'webbuilder',\n },\n {\n id: 'poster',\n icon: 'post-outline',\n label: 'Turn a paper into a poster',\n hint: 'A paper PDF or arXiv link → an editable, print-ready conference poster',\n prompt: 'Turn [arXiv link or paper title] into a 48 x 36 inch conference poster I can edit and print.',\n blanks: [{ ask: 'Paste the arXiv link or paper title' }],\n app: 'poster',\n },\n {\n id: 'canvas',\n icon: 'view-grid-outline',\n label: 'Open a canvas',\n hint: 'Spread images, video and audio out and work on them together',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'MainStack.CanvasNative',\n },\n {\n id: 'workflow',\n icon: 'sitemap-outline',\n label: 'Automate something repetitive',\n hint: 'A visual workflow across 1,000+ connectors',\n prompt: 'Build a workflow that runs every morning and sends me a summary of [what to keep an eye on].',\n blanks: [\n {\n ask: 'What should it summarize?',\n suggestions: ['new support emails', 'overnight sales', \"today's calendar\"],\n },\n ],\n app: 'workflow-studio',\n },\n {\n id: 'computer',\n icon: 'monitor',\n label: 'Drive my browser',\n hint: 'The CLI runs your OS and browser for you',\n prompt: 'Open my browser, find the pricing pages of [3 competitors], and put them side by side.',\n blanks: [{ ask: 'Which 3 competitors?' }],\n },\n {\n id: 'connect-apps',\n icon: 'puzzle-outline',\n label: 'Connect your apps',\n hint: 'Link a tool once, then just @-mention it in any chat',\n prompt: 'Show me which apps I can connect, and help me connect the ones I use daily.',\n },\n {\n id: 'research',\n icon: 'magnify',\n label: 'Research a market',\n hint: 'Deep multi-source research, written up',\n prompt: 'Research the market for [your idea] - who the players are, how they price, and where the gaps are.',\n blanks: [\n {\n ask: \"What's the idea?\",\n suggestions: ['a dog-walking app', 'an AI tutor for kids', 'a meal-prep service'],\n },\n ],\n mode: 'deep-search',\n },\n {\n id: 'notion',\n icon: 'notebook-outline',\n label: 'Write it up in Notion',\n hint: 'Findings land as a page in Yantra Notion',\n prompt: 'Research [a topic] and write the findings up as a page in Yantra Notion with sources.',\n blanks: [\n {\n ask: 'What topic?',\n suggestions: ['the four-day work week', 'onboarding remote teams', 'home solar payback'],\n },\n ],\n app: 'notion',\n },\n {\n id: 'shopping',\n icon: 'shopping-outline',\n label: 'Compare products',\n hint: 'Search across sources and line them up',\n prompt: 'Compare the best [product] options and show me the tradeoffs.',\n blanks: [\n {\n ask: 'What are you shopping for?',\n suggestions: ['noise-cancelling headphones', 'robot vacuums', 'carry-on luggage'],\n },\n ],\n app: 'shopping',\n },\n {\n id: 'travel',\n icon: 'airplane',\n label: 'Plan a trip',\n hint: 'Flights, hotels and a day-by-day plan',\n prompt: 'Plan a 4-day trip to [destination] for me - flights, somewhere to stay, and what to do each day.',\n blanks: [{ ask: 'Where to?', suggestions: ['Lisbon', 'Tokyo', 'Mexico City', 'Reykjavik'] }],\n app: 'travel',\n },\n {\n id: 'meetings',\n icon: 'microphone-outline',\n label: 'Send a notetaker to a meeting',\n hint: 'Records, transcribes, and writes the notes up',\n prompt: 'Send the notetaker to my next meeting and write up the notes and action items afterwards.',\n app: 'meetings',\n },\n {\n id: 'inbox',\n icon: 'inbox-outline',\n label: 'Get to inbox zero',\n hint: 'Triage the inbox and draft the replies',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n app: 'inbox',\n },\n {\n id: 'crm',\n icon: 'account-group-outline',\n label: 'Chase my pipeline',\n hint: 'See what is stalling and what to do next',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n app: 'crm',\n },\n {\n id: 'invoices',\n icon: 'file-document-outline',\n label: 'Get paid',\n hint: 'Invoice a customer and see what is still owed',\n prompt: 'Show me which invoices are unpaid, and send a reminder for the overdue ones.',\n app: 'invoices',\n },\n {\n id: 'expenses',\n icon: 'receipt',\n label: 'Sort out expenses',\n hint: 'Claims, budgets, and card spend in one place',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n app: 'expenses',\n },\n {\n id: 'mailcampaign',\n icon: 'bullhorn-outline',\n label: 'Send a campaign',\n hint: 'Write it, segment it, send it',\n prompt: 'Draft an email campaign announcing [what you shipped or launched].',\n blanks: [\n { ask: 'What did you launch?', suggestions: ['our new mobile app', 'a spring sale', 'a new pricing plan'] },\n ],\n app: 'mailcampaign',\n },\n {\n id: 'smscampaign',\n icon: 'message-text-outline',\n label: 'Text your customers',\n hint: 'SMS campaigns with replies',\n prompt: \"Write a short text reminding my customers about [this week's offer], then send it to my VIP list.\",\n blanks: [\n {\n ask: \"What's the offer?\",\n suggestions: ['20% off this weekend', 'free shipping until Sunday', 'buy one, get one free'],\n },\n ],\n app: 'smscampaign',\n },\n];\n\n/** `count` distinct entries, drawn at random (the web's draw, without its welcome-answer weights). */\nexport function drawSuggestions(\n count: number,\n pool: readonly HomeSuggestion[] = HOME_SUGGESTIONS,\n random: () => number = Math.random,\n): HomeSuggestion[] {\n const remaining = [...pool];\n const picked: HomeSuggestion[] = [];\n while (picked.length < count && remaining.length > 0) {\n picked.push(remaining.splice(Math.floor(random() * remaining.length), 1)[0]);\n }\n return picked;\n}\n\n/** Same boundaries as the web's `greetingFor`; anything past ten at night reads as late. */\nexport function greetingFor(hour: number): string {\n if (hour >= 5 && hour < 12) return 'Good morning';\n if (hour >= 12 && hour < 17) return 'Good afternoon';\n if (hour >= 17 && hour < 22) return 'Good evening';\n return 'Working late';\n}\n"],"names":[],"mappings":"AA8BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,uBAAA;AAAA,EACP,IAAM,EAAA,uEAAA;AAAA,EACN,MAAQ,EAAA,wFAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,qBAAA;AAAA,IACL,WAAa,EAAA,CAAC,mBAAqB,EAAA,uBAAA,EAAyB,eAAe;AAAA,GAC5E,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA,KAAA;AAAA,EACN,KAAO,EAAA,yBAAA;AAAA,EACP,IAAM,EAAA,4CAAA;AAAA,EACN,MAAQ,EAAA,0FAAA;AAAA,EACR,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,cAAA;A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AAA,EACD,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA,sBAAA;AAAA,EACN,KAAO,EAAA,qBAAA;AAAA,EACP,IAAM,EAAA,4BAAA;AAAA,EACN,MAAQ,EAAA,mGAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,mBAAA;AAAA,IACL,WAAa,EAAA,CAAC,sBAAwB,EAAA,4BAAA,EAA8B,uBAAuB;AAAA,GAC5F,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAC;AAGM,SAAS,gBAAgB,KAAe,EAAA,IAAA,GAAkC,gBAAkB,EAAA,MAAA,GAAuB,KAAK,MAA0B,EAAA;AACvJ,EAAM,MAAA,SAAA,GAAY,CAAC,GAAG,IAAI,CAAA;AAC1B,EAAA,MAAM,SAA2B,EAAC;AAClC,EAAA,OAAO,MAAO,CAAA,MAAA,GAAS,KAAS,IAAA,SAAA,CAAU,SAAS,CAAG,EAAA;AACpD,IAAA,MAAA,CAAO,IAAK,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,KAAM,CAAA,MAAA,EAAW,GAAA,SAAA,CAAU,MAAM,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA;AAE7E,EAAO,OAAA,MAAA;AACT;AAGO,SAAS,YAAY,IAAsB,EAAA;AAChD,EAAA,IAAI,IAAQ,IAAA,CAAA,IAAK,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACnC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,gBAAA;AACpC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACpC,EAAO,OAAA,cAAA;AACT"}
1
+ {"version":3,"file":"homeCatalog.js","sources":["../../../../src/screens/Home/components/homeCatalog.ts"],"sourcesContent":["/**\n * The chat home's pure parts, kept apart from the components so they run under jest: the\n * \"Start something\" catalogue and draw (the web's YANTRA_SUGGESTIONS / useHomeSuggestions) and\n * the greeting (the web's HomeHero `greetingFor`).\n */\nimport type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\nimport type { BlankGuide } from '../../../features/chat/promptBlanks';\nimport type { RoutingMode } from '../types';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\nexport type HomeSuggestion = {\n id: string;\n label: string;\n /** What the row is for, on the line under its label. */\n hint: string;\n icon: IconName;\n prompt: string;\n mode?: RoutingMode;\n /** Navigate here instead of injecting the prompt, when the host wires navigation. */\n nativeRoute?: string;\n /**\n * The app this shortcut is for: a registry intent id, the one the brain answers with\n * (the web's `panel`). Chat opens it when the brain names no other app for the send.\n */\n app?: string;\n /** For each `[blank]` in the prompt, in order: what to ask, and answers one tap away. */\n blanks?: readonly BlankGuide[];\n};\n\n/** The web's YANTRA_SUGGESTIONS, in its order. */\nexport const HOME_SUGGESTIONS: readonly HomeSuggestion[] = [\n {\n id: 'design',\n icon: 'palette-outline',\n label: 'Design a landing page',\n hint: 'Chat-driven design canvas — iterate on a real page, not a mockup',\n prompt: 'Design a landing page for [your product]. Start with the hero and the pricing section.',\n blanks: [\n {\n ask: \"What's the product?\",\n suggestions: ['a dog-walking app', 'a coffee subscription', 'a yoga studio'],\n },\n ],\n app: 'design',\n },\n {\n id: 'webbuilder',\n icon: 'web',\n label: 'Build a working web app',\n hint: 'Scaffold and edit a real app from a prompt',\n prompt: 'Build me a small web app with a form that stores submissions and a page that lists them.',\n app: 'webbuilder',\n },\n {\n id: 'poster',\n icon: 'post-outline',\n label: 'Turn a paper into a poster',\n hint: 'A paper PDF or arXiv link → an editable, print-ready conference poster',\n prompt: 'Turn [arXiv link or paper title] into a 48 x 36 inch conference poster I can edit and print.',\n blanks: [{ ask: 'Paste the arXiv link or paper title' }],\n app: 'poster',\n },\n {\n id: 'canvas',\n icon: 'view-grid-outline',\n label: 'Open a canvas',\n hint: 'Spread images, video and audio out and work on them together',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'MainStack.CanvasNative',\n },\n {\n id: 'workflow',\n icon: 'sitemap-outline',\n label: 'Automate something repetitive',\n hint: 'A visual workflow across 1,000+ connectors',\n prompt: 'Build a workflow that runs every morning and sends me a summary of [what to keep an eye on].',\n blanks: [\n {\n ask: 'What should it summarize?',\n suggestions: ['new support emails', 'overnight sales', \"today's calendar\"],\n },\n ],\n app: 'workflow-studio',\n },\n {\n id: 'computer',\n icon: 'monitor',\n label: 'Drive my browser',\n hint: 'The CLI runs your OS and browser for you',\n prompt: 'Open my browser, find the pricing pages of [3 competitors], and put them side by side.',\n blanks: [{ ask: 'Which 3 competitors?' }],\n app: 'computer',\n },\n {\n id: 'connect-apps',\n icon: 'puzzle-outline',\n label: 'Connect your apps',\n hint: 'Link a tool once, then just @-mention it in any chat',\n prompt: 'Show me which apps I can connect, and help me connect the ones I use daily.',\n },\n {\n id: 'research',\n icon: 'magnify',\n label: 'Research a market',\n hint: 'Deep multi-source research, written up',\n prompt: 'Research the market for [your idea] - who the players are, how they price, and where the gaps are.',\n blanks: [\n {\n ask: \"What's the idea?\",\n suggestions: ['a dog-walking app', 'an AI tutor for kids', 'a meal-prep service'],\n },\n ],\n mode: 'deep-search',\n },\n {\n id: 'notion',\n icon: 'notebook-outline',\n label: 'Write it up in Notion',\n hint: 'Findings land as a page in Yantra Notion',\n prompt: 'Research [a topic] and write the findings up as a page in Yantra Notion with sources.',\n blanks: [\n {\n ask: 'What topic?',\n suggestions: ['the four-day work week', 'onboarding remote teams', 'home solar payback'],\n },\n ],\n app: 'notion',\n },\n {\n id: 'shopping',\n icon: 'shopping-outline',\n label: 'Compare products',\n hint: 'Search across sources and line them up',\n prompt: 'Compare the best [product] options and show me the tradeoffs.',\n blanks: [\n {\n ask: 'What are you shopping for?',\n suggestions: ['noise-cancelling headphones', 'robot vacuums', 'carry-on luggage'],\n },\n ],\n app: 'shopping',\n },\n {\n id: 'travel',\n icon: 'airplane',\n label: 'Plan a trip',\n hint: 'Flights, hotels and a day-by-day plan',\n prompt: 'Plan a 4-day trip to [destination] for me - flights, somewhere to stay, and what to do each day.',\n blanks: [{ ask: 'Where to?', suggestions: ['Lisbon', 'Tokyo', 'Mexico City', 'Reykjavik'] }],\n app: 'travel',\n },\n {\n id: 'meetings',\n icon: 'microphone-outline',\n label: 'Send a notetaker to a meeting',\n hint: 'Records, transcribes, and writes the notes up',\n prompt: 'Send the notetaker to my next meeting and write up the notes and action items afterwards.',\n app: 'meetings',\n },\n {\n id: 'inbox',\n icon: 'inbox-outline',\n label: 'Get to inbox zero',\n hint: 'Triage the inbox and draft the replies',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n app: 'inbox',\n },\n {\n id: 'crm',\n icon: 'account-group-outline',\n label: 'Chase my pipeline',\n hint: 'See what is stalling and what to do next',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n app: 'crm',\n },\n {\n id: 'invoices',\n icon: 'file-document-outline',\n label: 'Get paid',\n hint: 'Invoice a customer and see what is still owed',\n prompt: 'Show me which invoices are unpaid, and send a reminder for the overdue ones.',\n app: 'invoices',\n },\n {\n id: 'expenses',\n icon: 'receipt',\n label: 'Sort out expenses',\n hint: 'Claims, budgets, and card spend in one place',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n app: 'expenses',\n },\n {\n id: 'mailcampaign',\n icon: 'bullhorn-outline',\n label: 'Send a campaign',\n hint: 'Write it, segment it, send it',\n prompt: 'Draft an email campaign announcing [what you shipped or launched].',\n blanks: [\n { ask: 'What did you launch?', suggestions: ['our new mobile app', 'a spring sale', 'a new pricing plan'] },\n ],\n app: 'mailcampaign',\n },\n {\n id: 'smscampaign',\n icon: 'message-text-outline',\n label: 'Text your customers',\n hint: 'SMS campaigns with replies',\n prompt: \"Write a short text reminding my customers about [this week's offer], then send it to my VIP list.\",\n blanks: [\n {\n ask: \"What's the offer?\",\n suggestions: ['20% off this weekend', 'free shipping until Sunday', 'buy one, get one free'],\n },\n ],\n app: 'smscampaign',\n },\n];\n\n/** `count` distinct entries, drawn at random (the web's draw, without its welcome-answer weights). */\nexport function drawSuggestions(\n count: number,\n pool: readonly HomeSuggestion[] = HOME_SUGGESTIONS,\n random: () => number = Math.random,\n): HomeSuggestion[] {\n const remaining = [...pool];\n const picked: HomeSuggestion[] = [];\n while (picked.length < count && remaining.length > 0) {\n picked.push(remaining.splice(Math.floor(random() * remaining.length), 1)[0]);\n }\n return picked;\n}\n\n/** Same boundaries as the web's `greetingFor`; anything past ten at night reads as late. */\nexport function greetingFor(hour: number): string {\n if (hour >= 5 && hour < 12) return 'Good morning';\n if (hour >= 12 && hour < 17) return 'Good afternoon';\n if (hour >= 17 && hour < 22) return 'Good evening';\n return 'Working late';\n}\n"],"names":[],"mappings":"AA8BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,uBAAA;AAAA,EACP,IAAM,EAAA,uEAAA;AAAA,EACN,MAAQ,EAAA,wFAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,qBAAA;AAAA,IACL,WAAa,EAAA,CAAC,mBAAqB,EAAA,uBAAA,EAAyB,eAAe;AAAA,GAC5E,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA,KAAA;AAAA,EACN,KAAO,EAAA,yBAAA;AAAA,EACP,IAAM,EAAA,4CAAA;AAAA,EACN,MAAQ,EAAA,0FAAA;AAAA,EACR,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,cAAA;AAAA,EACN,KAAO,EAAA,4BAAA;AAAA,EACP,IAAM,EAAA,6EAAA;AAAA,EACN,MAAQ,EAAA,8FAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,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AM,EAAA,4BAAA;AAAA,EACN,MAAQ,EAAA,mGAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,mBAAA;AAAA,IACL,WAAa,EAAA,CAAC,sBAAwB,EAAA,4BAAA,EAA8B,uBAAuB;AAAA,GAC5F,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAC;AAGM,SAAS,gBAAgB,KAAe,EAAA,IAAA,GAAkC,gBAAkB,EAAA,MAAA,GAAuB,KAAK,MAA0B,EAAA;AACvJ,EAAM,MAAA,SAAA,GAAY,CAAC,GAAG,IAAI,CAAA;AAC1B,EAAA,MAAM,SAA2B,EAAC;AAClC,EAAA,OAAO,MAAO,CAAA,MAAA,GAAS,KAAS,IAAA,SAAA,CAAU,SAAS,CAAG,EAAA;AACpD,IAAA,MAAA,CAAO,IAAK,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,KAAM,CAAA,MAAA,EAAW,GAAA,SAAA,CAAU,MAAM,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA;AAE7E,EAAO,OAAA,MAAA;AACT;AAGO,SAAS,YAAY,IAAsB,EAAA;AAChD,EAAA,IAAI,IAAQ,IAAA,CAAA,IAAK,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACnC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,gBAAA;AACpC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACpC,EAAO,OAAA,cAAA;AACT"}
@@ -1,4 +1,4 @@
1
- var __defProp = Object.defineProperty;
1
+ import {isUploadLink,uploadBuildKey}from'../../features/webbuilder/web/upload/sitePhotos.js';var __defProp = Object.defineProperty;
2
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -29,6 +29,7 @@ function opensWebBuilderSurface(url, urls) {
29
29
  return target !== originOf(urls.DESIGN_SURFACE_URL) && target !== originOf(urls.CANVAS_SURFACE_URL);
30
30
  }
31
31
  function nativeWebBuilderParams(params, urls) {
32
+ var _a;
32
33
  if (!opensWebBuilderSurface(params == null ? void 0 : params.url, urls)) return null;
33
34
  const str = (value) => typeof value === "string" ? value.trim() : "";
34
35
  const message = str(params == null ? void 0 : params.message);
@@ -43,7 +44,10 @@ function nativeWebBuilderParams(params, urls) {
43
44
  } : {}), str(params == null ? void 0 : params.seedTemplate) ? {
44
45
  templateName: str(params == null ? void 0 : params.seedTemplate)
45
46
  } : {}) : null;
46
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, str(params == null ? void 0 : params.orgName) ? {
47
+ const upload = isUploadLink(params == null ? void 0 : params.url) ? {
48
+ uploadLink: (_a = uploadBuildKey(params == null ? void 0 : params.url)) != null ? _a : ""
49
+ } : {};
50
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, upload), str(params == null ? void 0 : params.orgName) ? {
47
51
  orgName: str(params == null ? void 0 : params.orgName)
48
52
  } : {}), message ? {
49
53
  initialAgentQuery: message
@@ -1 +1 @@
1
- {"version":3,"file":"nativeWebBuilderRedirect.js","sources":["../../../src/screens/WebBuilder/nativeWebBuilderRedirect.ts"],"sourcesContent":["/**\n * The Web Builder has a native screen (screens/WebBuilderNative), so the surface shell never loads\n * the web Web Builder in a WebView. The shell opened without a `url` falls back to WEB_BUILDER_URL -\n * that is the web Web Builder (locally :5174 / :4174) - and so does a URL on that surface's origin.\n * Those opens become the native screen, the hand-off carried over: the first ask, the site to open,\n * a starter to remix. Every other surface (Codezen, CRM, …) still loads in the shell.\n */\nimport type { WebBuilderTemplate } from '../../features/webbuilder/workflow';\n\nexport interface SurfaceShellParams {\n url?: string | null;\n orgName?: string | null;\n channelId?: string | null;\n message?: string | null;\n snapshotId?: string | null;\n templateId?: string | null;\n templateTitle?: string | null;\n seedTemplate?: string | null;\n}\n\nexport interface SurfaceUrls {\n WEB_BUILDER_URL?: string;\n DESIGN_SURFACE_URL?: string;\n CANVAS_SURFACE_URL?: string;\n}\n\nfunction originOf(url?: string | null): string | null {\n const raw = url?.trim();\n if (!raw) return null;\n const match = /^([a-z][a-z0-9+.-]*:\\/\\/[^/?#]+)/i.exec(raw);\n return match ? match[1].toLowerCase() : null;\n}\n\n/** True when the shell would load the web Web Builder. */\nexport function opensWebBuilderSurface(url: string | null | undefined, urls: SurfaceUrls): boolean {\n const target = originOf(url);\n if (!target) return true;\n if (/(^|[/.])webbuilder(-surface)?[.-]/i.test(target)) return true;\n const webBuilder = originOf(urls.WEB_BUILDER_URL);\n if (!webBuilder || target !== webBuilder) return false;\n // Locally the Design surface can share the Web Builder's port; a URL that is also one of those\n // surfaces is that surface, not the Web Builder.\n return target !== originOf(urls.DESIGN_SURFACE_URL) && target !== originOf(urls.CANVAS_SURFACE_URL);\n}\n\n/** The native Web Builder's params for a shell open, or null when the shell should load it. */\nexport function nativeWebBuilderParams(\n params: SurfaceShellParams | undefined,\n urls: SurfaceUrls,\n): Record<string, unknown> | null {\n if (!opensWebBuilderSurface(params?.url, urls)) return null;\n const str = (value?: string | null) => (typeof value === 'string' ? value.trim() : '');\n const message = str(params?.message);\n const snapshotId = str(params?.snapshotId);\n const channelId = str(params?.channelId);\n const template: WebBuilderTemplate | null = snapshotId\n ? {\n id: str(params?.templateId) || snapshotId,\n title: str(params?.templateTitle) || 'Template',\n snapshotId,\n ...(str(params?.templateId) ? { formTemplateId: str(params?.templateId) } : {}),\n ...(str(params?.seedTemplate) ? { templateName: str(params?.seedTemplate) } : {}),\n }\n : null;\n return {\n ...(str(params?.orgName) ? { orgName: str(params?.orgName) } : {}),\n ...(message ? { initialAgentQuery: message } : {}),\n ...(template ? { initialTemplate: template } : {}),\n // A site to continue; a new ask or a remix starts its own.\n ...(channelId && !message && !template ? { openChannelId: channelId } : {}),\n };\n}\n"],"names":[],"mappings":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CAAA,EACD,QAAW,GAAA;AAAA,IACb,eAAiB,EAAA;AAAA,MACf,EAAC,CAAA,EAED,aAAa,CAAC,OAAA,IAAW,CAAC,QAAW,GAAA;AAAA,IACvC,aAAe,EAAA;AAAA,MACb,EAAC,CAAA;AAET"}
1
+ {"version":3,"file":"nativeWebBuilderRedirect.js","sources":["../../../src/screens/WebBuilder/nativeWebBuilderRedirect.ts"],"sourcesContent":["/**\n * The Web Builder has a native screen (screens/WebBuilderNative), so the surface shell never loads\n * the web Web Builder in a WebView. The shell opened without a `url` falls back to WEB_BUILDER_URL -\n * that is the web Web Builder (locally :5174 / :4174) - and so does a URL on that surface's origin.\n * Those opens become the native screen, the hand-off carried over: the first ask, the site to open,\n * a starter to remix. Every other surface (Codezen, CRM, …) still loads in the shell.\n */\nimport type { WebBuilderTemplate } from '../../features/webbuilder/workflow';\nimport { isUploadLink, uploadBuildKey } from '../../features/webbuilder/web/upload/sitePhotos';\n\nexport interface SurfaceShellParams {\n url?: string | null;\n orgName?: string | null;\n channelId?: string | null;\n message?: string | null;\n snapshotId?: string | null;\n templateId?: string | null;\n templateTitle?: string | null;\n seedTemplate?: string | null;\n}\n\nexport interface SurfaceUrls {\n WEB_BUILDER_URL?: string;\n DESIGN_SURFACE_URL?: string;\n CANVAS_SURFACE_URL?: string;\n}\n\nfunction originOf(url?: string | null): string | null {\n const raw = url?.trim();\n if (!raw) return null;\n const match = /^([a-z][a-z0-9+.-]*:\\/\\/[^/?#]+)/i.exec(raw);\n return match ? match[1].toLowerCase() : null;\n}\n\n/** True when the shell would load the web Web Builder. */\nexport function opensWebBuilderSurface(url: string | null | undefined, urls: SurfaceUrls): boolean {\n const target = originOf(url);\n if (!target) return true;\n if (/(^|[/.])webbuilder(-surface)?[.-]/i.test(target)) return true;\n const webBuilder = originOf(urls.WEB_BUILDER_URL);\n if (!webBuilder || target !== webBuilder) return false;\n // Locally the Design surface can share the Web Builder's port; a URL that is also one of those\n // surfaces is that surface, not the Web Builder.\n return target !== originOf(urls.DESIGN_SURFACE_URL) && target !== originOf(urls.CANVAS_SURFACE_URL);\n}\n\n/** The native Web Builder's params for a shell open, or null when the shell should load it. */\nexport function nativeWebBuilderParams(\n params: SurfaceShellParams | undefined,\n urls: SurfaceUrls,\n): Record<string, unknown> | null {\n if (!opensWebBuilderSurface(params?.url, urls)) return null;\n const str = (value?: string | null) => (typeof value === 'string' ? value.trim() : '');\n const message = str(params?.message);\n const snapshotId = str(params?.snapshotId);\n const channelId = str(params?.channelId);\n const template: WebBuilderTemplate | null = snapshotId\n ? {\n id: str(params?.templateId) || snapshotId,\n title: str(params?.templateTitle) || 'Template',\n snapshotId,\n ...(str(params?.templateId) ? { formTemplateId: str(params?.templateId) } : {}),\n ...(str(params?.seedTemplate) ? { templateName: str(params?.seedTemplate) } : {}),\n }\n : null;\n // An upload link (web 0.18, `?upload=1&build=<site>`): \"Add to your site\" for that site, never another.\n const upload = isUploadLink(params?.url) ? { uploadLink: uploadBuildKey(params?.url) ?? '' } : {};\n return {\n ...upload,\n ...(str(params?.orgName) ? { orgName: str(params?.orgName) } : {}),\n ...(message ? { initialAgentQuery: message } : {}),\n ...(template ? { initialTemplate: template } : {}),\n // A site to continue; a new ask or a remix starts its own.\n ...(channelId && !message && !template ? { openChannelId: channelId } : {}),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAS,SAAS,GAAoC,EAAA;AACpD,EAAA,MAAM,MAAM,GAAK,IAAA,IAAA,GAAA,MAAA,GAAA,GAAA,CAAA,IAAA,EAAA;AACjB,EAAI,IAAA,CAAC,KAAY,OAAA,IAAA;AACjB,EAAM,MAAA,KAAA,GAAQ,mCAAoC,CAAA,IAAA,CAAK,GAAG,CAAA;AAC1D,EAAA,OAAO,KAAQ,GAAA,KAAA,CAAM,CAAC,CAAA,CAAE,aAAgB,GAAA,IAAA;AAC1C;AAGgB,SAAA,sBAAA,CAAuB,KAAgC,IAA4B,EAAA;AACjG,EAAM,MAAA,MAAA,GAA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OAAA,IAAW,CAAC,QAAW,GAAA;AAAA,IACvC,aAAe,EAAA;AAAA,MACb,EAAC,CAAA;AAET"}
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useLayoutEffect,useMemo,useRef,useEffect,useCallback}from'react';import {StyleSheet,View,Text}from'react-native';import {SafeAreaView}from'react-native-safe-area-context';import {useNavigation,useRoute}from'@react-navigation/native';import {getNativeWebBuilderExperience}from'../../features/webbuilder/nativeWebBuilderRegistry.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {useWebBuilderHost}from'./useWebBuilderHost.js';import {config}from'../../config/env-config.js';import {MOBILE_APP_CATALOG}from'../../features/apps/mobileAppCatalog.js';import {resolveSurfaceUrl}from'../../features/apps/resolveSurfaceUrl.js';import {CODEZEN_DEV_URL}from'../../features/webbuilder/codezenHandoff.js';var __defProp = Object.defineProperty;
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {useLayoutEffect,useMemo,useRef,useEffect,useState,useCallback}from'react';import {StyleSheet,View,Text}from'react-native';import {SafeAreaView}from'react-native-safe-area-context';import {useNavigation,useRoute}from'@react-navigation/native';import {getNativeWebBuilderExperience}from'../../features/webbuilder/nativeWebBuilderRegistry.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {useWebBuilderHost}from'./useWebBuilderHost.js';import {config}from'../../config/env-config.js';import {MOBILE_APP_CATALOG}from'../../features/apps/mobileAppCatalog.js';import {resolveSurfaceUrl}from'../../features/apps/resolveSurfaceUrl.js';import {CODEZEN_DEV_URL}from'../../features/webbuilder/codezenHandoff.js';var __defProp = Object.defineProperty;
2
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  function WebBuilderNativeScreen() {
18
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
19
19
  const {
20
20
  isDark
21
21
  } = useAppTheme();
@@ -78,6 +78,18 @@ function WebBuilderNativeScreen() {
78
78
  openChannelId: void 0
79
79
  });
80
80
  }, [openChannelId, openProject, navigation]);
81
+ const [uploadLink, setUploadLink] = useState(null);
82
+ const uploadParam = (_j = route.params) == null ? void 0 : _j.uploadLink;
83
+ useEffect(() => {
84
+ if (typeof uploadParam !== "string") return;
85
+ setUploadLink({
86
+ build: uploadParam.trim() || null
87
+ });
88
+ navigation.setParams({
89
+ uploadLink: void 0
90
+ });
91
+ }, [uploadParam, navigation]);
92
+ const onUploadLinkDone = useCallback(() => setUploadLink(null), []);
81
93
  const onExit = useCallback(() => {
82
94
  var _a2;
83
95
  if ((_a2 = navigation.canGoBack) == null ? void 0 : _a2.call(navigation)) navigation.goBack();
@@ -100,7 +112,7 @@ function WebBuilderNativeScreen() {
100
112
  /* @__PURE__ */ jsx(Text, { style: [styles.detail, isDark && styles.textMuted], children: "This build does not carry the federation host runtime." })
101
113
  ] }) });
102
114
  }
103
- return /* @__PURE__ */ jsx(SafeAreaView, { style: [styles.fill, isDark && styles.fillDark], edges: ["left", "right"], children: /* @__PURE__ */ jsx(Experience, { isDark, onExit, projects: host.projects, projectsLoading: host.projectsLoading, projectsError: host.projectsError, onRefreshProjects: host.refreshProjects, projectsHasMore: host.projectsHasMore, onLoadMoreProjects: host.loadMoreProjects, templates: host.templates, templatesLoading: host.templatesLoading, templatesError: host.templatesError, onReloadTemplates: host.reloadTemplates, startBlocked: host.startBlocked, startNotice: host.startNotice, activeChannelId: host.activeChannelId, onOpenProject: host.openProject, onCloseProject: host.closeProject, onStartProject: host.startProject, builds: host.builds, buildsLoading: host.buildsLoading, historyLoading: host.historyLoading, building: host.building, publishing: host.publishing, hostChat: host.hostChat, onPublish: host.publish, onResumePreview: host.resumePreview, onRestorePreview: host.restorePreview, goneSandboxIds: host.goneSandboxIds, onUndo: host.undo, onRedo: host.redo, onDownloadCode: host.downloadCode, publishTools: host.publishTools, projectTools: host.projectTools, brandTools: host.brandTools, code: host.code, previewAccess: host.previewAccess, onOpenCodezen, initialAgentSeed: seed }) });
115
+ return /* @__PURE__ */ jsx(SafeAreaView, { style: [styles.fill, isDark && styles.fillDark], edges: ["left", "right"], children: /* @__PURE__ */ jsx(Experience, { isDark, onExit, projects: host.projects, projectsLoading: host.projectsLoading, projectsError: host.projectsError, onRefreshProjects: host.refreshProjects, projectsHasMore: host.projectsHasMore, onLoadMoreProjects: host.loadMoreProjects, templates: host.templates, templatesLoading: host.templatesLoading, templatesError: host.templatesError, onReloadTemplates: host.reloadTemplates, startBlocked: host.startBlocked, startNotice: host.startNotice, activeChannelId: host.activeChannelId, onOpenProject: host.openProject, onCloseProject: host.closeProject, onStartProject: host.startProject, builds: host.builds, buildsLoading: host.buildsLoading, historyLoading: host.historyLoading, building: host.building, publishing: host.publishing, hostChat: host.hostChat, onPublish: host.publish, onResumePreview: host.resumePreview, onRestorePreview: host.restorePreview, goneSandboxIds: host.goneSandboxIds, onUndo: host.undo, onRedo: host.redo, onDownloadCode: host.downloadCode, publishTools: host.publishTools, projectTools: host.projectTools, brandTools: host.brandTools, code: host.code, previewAccess: host.previewAccess, onOpenCodezen, initialAgentSeed: seed, uploadLink, onUploadLinkDone }) });
104
116
  }
105
117
  const styles = StyleSheet.create({
106
118
  fill: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/screens/WebBuilderNative/index.tsx"],"sourcesContent":["/**\n * Native Web Builder screen - host route for the federated web builder experience.\n *\n * Same delivery contract as Expenses / Movies / Study: the App registers the\n * federated component; this screen reads the registry and hands over what\n * needs the app's data stack - the builds, the templates, the build workflow\n * (the web surface's connector lane), the publish mutation - plus\n * navigation for leaving. A brain-routed hand-off arrives as\n * `initialAgentQuery` and starts a new site with it - from `initialTemplate` when\n * Home's Build gallery picked one to remix; a task in the Tasks sheet arrives as\n * `openChannelId` and opens that site. Web Builder draws its own\n * header, so the stack header stays hidden.\n *\n * Not to be confused with `screens/WebBuilder`: that is the shared WebView\n * surface shell (historical name), which still opens the web Web Builder.\n */\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport {\n useNavigation,\n useRoute,\n type NavigationProp,\n type ParamListBase,\n type RouteProp,\n} from '@react-navigation/native';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { getNativeWebBuilderExperience } from '../../features/webbuilder/nativeWebBuilderRegistry';\nimport { useAppTheme } from '../../theme/AppThemeProvider';\nimport { useWebBuilderHost } from './useWebBuilderHost';\nimport { config } from '../../config/env-config';\nimport { MOBILE_APP_CATALOG } from '../../features/apps/mobileAppCatalog';\nimport { resolveSurfaceUrl } from '../../features/apps/resolveSurfaceUrl';\nimport { CODEZEN_DEV_URL } from '../../features/webbuilder/codezenHandoff';\nimport type { WebBuilderTemplate } from '../../features/webbuilder/workflow';\n\n/** What the launcher and the chat hand-offs may pass. */\ntype WebBuilderRouteParams = {\n orgName?: string | null;\n initialAgentQuery?: string;\n /** Photos or files the ask was typed with; they go to the agent with it. */\n initialAgentAttachments?: MessageAttachment[];\n /** A site to open (its chat), e.g. from its build's task in the Tasks sheet. */\n openChannelId?: string;\n /** A starter picked in Home's Build gallery: the new site remixes it (its snapshot). */\n initialTemplate?: WebBuilderTemplate;\n hideNavigationHeader?: boolean;\n};\n\nexport default function WebBuilderNativeScreen() {\n // The in-app light/dark choice (the drawer's Appearance), not only the device setting.\n const { isDark } = useAppTheme();\n const navigation = useNavigation<NavigationProp<ParamListBase>>();\n const route = useRoute<RouteProp<Record<string, WebBuilderRouteParams | undefined>, string>>();\n const routeOrg = typeof route.params?.orgName === 'string' ? route.params.orgName.trim() : '';\n const Experience = getNativeWebBuilderExperience();\n const host = useWebBuilderHost(routeOrg || undefined);\n\n useLayoutEffect(() => {\n if (!route.params?.hideNavigationHeader) navigation.setParams({ hideNavigationHeader: true });\n }, [navigation, route.params?.hideNavigationHeader]);\n\n const initialTemplate = route.params?.initialTemplate?.snapshotId ? route.params.initialTemplate : null;\n const seed = useMemo(() => {\n // A picked starter is started below, as a remix; it is not an agent seed.\n if (initialTemplate) return null;\n const query = typeof route.params?.initialAgentQuery === 'string' ? route.params.initialAgentQuery.trim() : '';\n const files = Array.isArray(route.params?.initialAgentAttachments)\n ? route.params.initialAgentAttachments\n : undefined;\n if (!query && !files?.length) return null;\n return { text: query, files };\n }, [initialTemplate, route.params?.initialAgentQuery, route.params?.initialAgentAttachments]);\n\n /**\n * Home's Build gallery hands over a starter to remix: start the site from it once, the way the\n * Web Builder's own template picker does. The catalog's entry wins (it carries the workflow\n * metadata); Home's card stands in when the catalog doesn't list it.\n */\n const { startProject, templates, templatesLoading } = host;\n const startedTemplate = useRef(false);\n useEffect(() => {\n if (!initialTemplate) {\n // Cleared after its start, so the next hand-off starts too.\n startedTemplate.current = false;\n return;\n }\n if (startedTemplate.current || templatesLoading) return;\n startedTemplate.current = true;\n const listed = templates.find(\n (entry) =>\n entry.id === initialTemplate.id ||\n (initialTemplate.formTemplateId && entry.formTemplateId === initialTemplate.formTemplateId) ||\n entry.snapshotId === initialTemplate.snapshotId,\n );\n const query = typeof route.params?.initialAgentQuery === 'string' ? route.params.initialAgentQuery.trim() : '';\n startProject({\n text: query || `Build me: ${initialTemplate.title}`,\n template: listed ?? initialTemplate,\n attachments: Array.isArray(route.params?.initialAgentAttachments)\n ? route.params.initialAgentAttachments\n : undefined,\n });\n navigation.setParams({ initialTemplate: undefined });\n }, [\n initialTemplate,\n templates,\n templatesLoading,\n startProject,\n navigation,\n route.params?.initialAgentQuery,\n route.params?.initialAgentAttachments,\n ]);\n\n // Opened once per hand-off: the param is cleared, so the same task can open it again later.\n const openChannelId = typeof route.params?.openChannelId === 'string' ? route.params.openChannelId.trim() : '';\n const { openProject } = host;\n useEffect(() => {\n if (!openChannelId) return;\n openProject(openChannelId);\n navigation.setParams({ openChannelId: undefined });\n }, [openChannelId, openProject, navigation]);\n\n const onExit = useCallback(() => {\n if (navigation.canGoBack?.()) navigation.goBack();\n else navigation.navigate('MainStack.Layout.Home');\n }, [navigation]);\n\n // \"Demo video\" (web 0.5.0): the Codezen surface, in the app's surface shell, with the handoff fragment.\n const onOpenCodezen = useCallback(\n (fragment: string) => {\n const tile = MOBILE_APP_CATALOG.find((app) => app.key === 'codezen');\n const base = (tile && resolveSurfaceUrl(tile, config)) || CODEZEN_DEV_URL;\n navigation.navigate('MainStack.WebBuilder', {\n url: `${base.split('#')[0]}#${fragment}`,\n appTitle: tile?.label ?? 'Codezen',\n ...(routeOrg ? { orgName: routeOrg } : {}),\n });\n },\n [navigation, routeOrg],\n );\n\n if (!Experience) {\n return (\n <SafeAreaView style={[styles.fill, isDark && styles.fillDark]}>\n <View style={styles.center}>\n <Text style={[styles.title, isDark && styles.textLight]}>Native web builder unavailable</Text>\n <Text style={[styles.detail, isDark && styles.textMuted]}>\n This build does not carry the federation host runtime.\n </Text>\n </View>\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={[styles.fill, isDark && styles.fillDark]} edges={['left', 'right']}>\n <Experience\n isDark={isDark}\n onExit={onExit}\n projects={host.projects}\n projectsLoading={host.projectsLoading}\n projectsError={host.projectsError}\n onRefreshProjects={host.refreshProjects}\n projectsHasMore={host.projectsHasMore}\n onLoadMoreProjects={host.loadMoreProjects}\n templates={host.templates}\n templatesLoading={host.templatesLoading}\n templatesError={host.templatesError}\n onReloadTemplates={host.reloadTemplates}\n startBlocked={host.startBlocked}\n startNotice={host.startNotice}\n activeChannelId={host.activeChannelId}\n onOpenProject={host.openProject}\n onCloseProject={host.closeProject}\n onStartProject={host.startProject}\n builds={host.builds}\n buildsLoading={host.buildsLoading}\n historyLoading={host.historyLoading}\n building={host.building}\n publishing={host.publishing}\n hostChat={host.hostChat}\n onPublish={host.publish}\n onResumePreview={host.resumePreview}\n onRestorePreview={host.restorePreview}\n goneSandboxIds={host.goneSandboxIds}\n onUndo={host.undo}\n onRedo={host.redo}\n onDownloadCode={host.downloadCode}\n publishTools={host.publishTools}\n projectTools={host.projectTools}\n brandTools={host.brandTools}\n code={host.code}\n previewAccess={host.previewAccess}\n onOpenCodezen={onOpenCodezen}\n initialAgentSeed={seed}\n />\n </SafeAreaView>\n );\n}\n\nconst styles = StyleSheet.create({\n fill: { flex: 1, backgroundColor: '#f5f6f8' },\n fillDark: { backgroundColor: '#0c0e14' },\n center: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24 },\n title: { fontSize: 15, fontWeight: '600', color: '#111827', marginBottom: 6 },\n detail: { fontSize: 13, color: '#5d6575', textAlign: 'center' },\n textLight: { color: '#eceff6' },\n textMuted: { color: '#9ca4b6' },\n});\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;AA0CA,SAAwB,sBAAyB,GAAA;AA1CjD,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AA4CE,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,WAAY,EAAA;AAChB,EAAA,MAAM,aAAa,aAA6C,EAAA;AAChE,EAAA,MAAM,QAAQ,QAA+E,EAAA;AAC7F,EAAM,MAAA,QAAA,GAAW,QAAO,CAAA,EAAA,GAAA,KAAA,CAAM,MAAN,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAc,OAAY,CAAA,KAAA,QAAA,GAAW,KAAM,CAAA,MAAA,CAAO,OAAQ,CAAA,IAAA,EAAS,GAAA,EAAA;AAC3F,EAAA,MAAM,aAAa,6BAA8B,EAAA;AACjD,EAAM,MAAA,IAAA,GAAO,iBAAkB,CAAA,QAAA,IAAY,MAAS,CAAA;AACpD,EAAA,eAAA,CAAgB,MAAM;AApDxB,IAAAA,IAAAA,GAAAA;AAqDI,IAAI,IAAA,EAAA,CAACA,MAAA,KAAM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ilderNative/index.tsx"],"sourcesContent":["/**\n * Native Web Builder screen - host route for the federated web builder experience.\n *\n * Same delivery contract as Expenses / Movies / Study: the App registers the\n * federated component; this screen reads the registry and hands over what\n * needs the app's data stack - the builds, the templates, the build workflow\n * (the web surface's connector lane), the publish mutation - plus\n * navigation for leaving. A brain-routed hand-off arrives as\n * `initialAgentQuery` and starts a new site with it - from `initialTemplate` when\n * Home's Build gallery picked one to remix; a task in the Tasks sheet arrives as\n * `openChannelId` and opens that site. Web Builder draws its own\n * header, so the stack header stays hidden.\n *\n * Not to be confused with `screens/WebBuilder`: that is the shared WebView\n * surface shell (historical name), which still opens the web Web Builder.\n */\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport {\n useNavigation,\n useRoute,\n type NavigationProp,\n type ParamListBase,\n type RouteProp,\n} from '@react-navigation/native';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { getNativeWebBuilderExperience } from '../../features/webbuilder/nativeWebBuilderRegistry';\nimport { useAppTheme } from '../../theme/AppThemeProvider';\nimport { useWebBuilderHost } from './useWebBuilderHost';\nimport { config } from '../../config/env-config';\nimport { MOBILE_APP_CATALOG } from '../../features/apps/mobileAppCatalog';\nimport { resolveSurfaceUrl } from '../../features/apps/resolveSurfaceUrl';\nimport { CODEZEN_DEV_URL } from '../../features/webbuilder/codezenHandoff';\nimport type { WebBuilderTemplate } from '../../features/webbuilder/workflow';\n\n/** What the launcher and the chat hand-offs may pass. */\ntype WebBuilderRouteParams = {\n orgName?: string | null;\n initialAgentQuery?: string;\n /** Photos or files the ask was typed with; they go to the agent with it. */\n initialAgentAttachments?: MessageAttachment[];\n /** A site to open (its chat), e.g. from its build's task in the Tasks sheet. */\n openChannelId?: string;\n /** A starter picked in Home's Build gallery: the new site remixes it (its snapshot). */\n initialTemplate?: WebBuilderTemplate;\n /** An upload link (`?upload=1&build=<site>`): the site's chat, or '' when the link names none. */\n uploadLink?: string;\n hideNavigationHeader?: boolean;\n};\n\nexport default function WebBuilderNativeScreen() {\n // The in-app light/dark choice (the drawer's Appearance), not only the device setting.\n const { isDark } = useAppTheme();\n const navigation = useNavigation<NavigationProp<ParamListBase>>();\n const route = useRoute<RouteProp<Record<string, WebBuilderRouteParams | undefined>, string>>();\n const routeOrg = typeof route.params?.orgName === 'string' ? route.params.orgName.trim() : '';\n const Experience = getNativeWebBuilderExperience();\n const host = useWebBuilderHost(routeOrg || undefined);\n\n useLayoutEffect(() => {\n if (!route.params?.hideNavigationHeader) navigation.setParams({ hideNavigationHeader: true });\n }, [navigation, route.params?.hideNavigationHeader]);\n\n const initialTemplate = route.params?.initialTemplate?.snapshotId ? route.params.initialTemplate : null;\n const seed = useMemo(() => {\n // A picked starter is started below, as a remix; it is not an agent seed.\n if (initialTemplate) return null;\n const query = typeof route.params?.initialAgentQuery === 'string' ? route.params.initialAgentQuery.trim() : '';\n const files = Array.isArray(route.params?.initialAgentAttachments)\n ? route.params.initialAgentAttachments\n : undefined;\n if (!query && !files?.length) return null;\n return { text: query, files };\n }, [initialTemplate, route.params?.initialAgentQuery, route.params?.initialAgentAttachments]);\n\n /**\n * Home's Build gallery hands over a starter to remix: start the site from it once, the way the\n * Web Builder's own template picker does. The catalog's entry wins (it carries the workflow\n * metadata); Home's card stands in when the catalog doesn't list it.\n */\n const { startProject, templates, templatesLoading } = host;\n const startedTemplate = useRef(false);\n useEffect(() => {\n if (!initialTemplate) {\n // Cleared after its start, so the next hand-off starts too.\n startedTemplate.current = false;\n return;\n }\n if (startedTemplate.current || templatesLoading) return;\n startedTemplate.current = true;\n const listed = templates.find(\n (entry) =>\n entry.id === initialTemplate.id ||\n (initialTemplate.formTemplateId && entry.formTemplateId === initialTemplate.formTemplateId) ||\n entry.snapshotId === initialTemplate.snapshotId,\n );\n const query = typeof route.params?.initialAgentQuery === 'string' ? route.params.initialAgentQuery.trim() : '';\n startProject({\n text: query || `Build me: ${initialTemplate.title}`,\n template: listed ?? initialTemplate,\n attachments: Array.isArray(route.params?.initialAgentAttachments)\n ? route.params.initialAgentAttachments\n : undefined,\n });\n navigation.setParams({ initialTemplate: undefined });\n }, [\n initialTemplate,\n templates,\n templatesLoading,\n startProject,\n navigation,\n route.params?.initialAgentQuery,\n route.params?.initialAgentAttachments,\n ]);\n\n // Opened once per hand-off: the param is cleared, so the same task can open it again later.\n const openChannelId = typeof route.params?.openChannelId === 'string' ? route.params.openChannelId.trim() : '';\n const { openProject } = host;\n useEffect(() => {\n if (!openChannelId) return;\n openProject(openChannelId);\n navigation.setParams({ openChannelId: undefined });\n }, [openChannelId, openProject, navigation]);\n\n // An upload link opens \"Add to your site\" (web 0.18); the param is cleared, the sheet stays until closed.\n const [uploadLink, setUploadLink] = useState<{ build: string | null } | null>(null);\n const uploadParam = route.params?.uploadLink;\n useEffect(() => {\n if (typeof uploadParam !== 'string') return;\n setUploadLink({ build: uploadParam.trim() || null });\n navigation.setParams({ uploadLink: undefined });\n }, [uploadParam, navigation]);\n const onUploadLinkDone = useCallback(() => setUploadLink(null), []);\n\n const onExit = useCallback(() => {\n if (navigation.canGoBack?.()) navigation.goBack();\n else navigation.navigate('MainStack.Layout.Home');\n }, [navigation]);\n\n // \"Demo video\" (web 0.5.0): the Codezen surface, in the app's surface shell, with the handoff fragment.\n const onOpenCodezen = useCallback(\n (fragment: string) => {\n const tile = MOBILE_APP_CATALOG.find((app) => app.key === 'codezen');\n const base = (tile && resolveSurfaceUrl(tile, config)) || CODEZEN_DEV_URL;\n navigation.navigate('MainStack.WebBuilder', {\n url: `${base.split('#')[0]}#${fragment}`,\n appTitle: tile?.label ?? 'Codezen',\n ...(routeOrg ? { orgName: routeOrg } : {}),\n });\n },\n [navigation, routeOrg],\n );\n\n if (!Experience) {\n return (\n <SafeAreaView style={[styles.fill, isDark && styles.fillDark]}>\n <View style={styles.center}>\n <Text style={[styles.title, isDark && styles.textLight]}>Native web builder unavailable</Text>\n <Text style={[styles.detail, isDark && styles.textMuted]}>\n This build does not carry the federation host runtime.\n </Text>\n </View>\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={[styles.fill, isDark && styles.fillDark]} edges={['left', 'right']}>\n <Experience\n isDark={isDark}\n onExit={onExit}\n projects={host.projects}\n projectsLoading={host.projectsLoading}\n projectsError={host.projectsError}\n onRefreshProjects={host.refreshProjects}\n projectsHasMore={host.projectsHasMore}\n onLoadMoreProjects={host.loadMoreProjects}\n templates={host.templates}\n templatesLoading={host.templatesLoading}\n templatesError={host.templatesError}\n onReloadTemplates={host.reloadTemplates}\n startBlocked={host.startBlocked}\n startNotice={host.startNotice}\n activeChannelId={host.activeChannelId}\n onOpenProject={host.openProject}\n onCloseProject={host.closeProject}\n onStartProject={host.startProject}\n builds={host.builds}\n buildsLoading={host.buildsLoading}\n historyLoading={host.historyLoading}\n building={host.building}\n publishing={host.publishing}\n hostChat={host.hostChat}\n onPublish={host.publish}\n onResumePreview={host.resumePreview}\n onRestorePreview={host.restorePreview}\n goneSandboxIds={host.goneSandboxIds}\n onUndo={host.undo}\n onRedo={host.redo}\n onDownloadCode={host.downloadCode}\n publishTools={host.publishTools}\n projectTools={host.projectTools}\n brandTools={host.brandTools}\n code={host.code}\n previewAccess={host.previewAccess}\n onOpenCodezen={onOpenCodezen}\n initialAgentSeed={seed}\n uploadLink={uploadLink}\n onUploadLinkDone={onUploadLinkDone}\n />\n </SafeAreaView>\n );\n}\n\nconst styles = StyleSheet.create({\n fill: { flex: 1, backgroundColor: '#f5f6f8' },\n fillDark: { backgroundColor: '#0c0e14' },\n center: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24 },\n title: { fontSize: 15, fontWeight: '600', color: '#111827', marginBottom: 6 },\n detail: { fontSize: 13, color: '#5d6575', textAlign: 'center' },\n textLight: { color: '#eceff6' },\n textMuted: { color: '#9ca4b6' },\n});\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;AA4CA,SAAwB,sBAA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@@ -1,4 +1,4 @@
1
- import {useRef,useState,useMemo,useCallback,useEffect,useSyncExternalStore}from'react';import {useApolloClient,gql}from'@apollo/client/index.js';import {useAiCodeDeployToCloudflareMutation}from'common/graphql';import {v4}from'uuid';import AsyncStorage from'@react-native-async-storage/async-storage';import {projectInstructionsNote,readDeleteReply,readSettingsUpdateReply,parseProjectSettings}from'../../features/webbuilder/projectTools.js';import'react/jsx-runtime';import'react-native';import {config}from'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {withoutBusyRepeats,isAgentBusyReply,BUSY_RETRY_DELAYS_MS,busyRetryText}from'./agentBusyRetry.js';import {useChatMessages,subscribeRememberedHistory,historyRunningChannelIds}from'../../hooks/useChatApi.js';import {useCanvasSession}from'../../features/canvas/useCanvasSession.js';import {tokenClaims}from'../../features/canvas/sessionIdentity.js';import {buildsFromPosts,hasWorkflowPosts,siteNameFromRequest,titleFromPrompt,stripAgentNote,projectFromPosts,turnState,pendingWork,transcriptFromPosts,userBubbleText,displayAgentText,isGenericTitle}from'../../features/webbuilder/buildFragments.js';import {handEditsNote,savedCodeSource}from'../../features/webbuilder/codeFiles.js';import {createCodeWorkspace}from'./codeWorkspaceApi.js';import {WEBBUILDER_CHAT_SKILL,buildTriggerParams,templateRemixNote,newObjectId}from'../../features/webbuilder/workflow.js';import {useWebBuilderGallery}from'./useWebBuilderGallery.js';import {agentEditNote,isPublishMessage,agentPublishMessage}from'../../features/webbuilder/webbuilderPrompts.js';import {plainActionError}from'../../features/webbuilder/publishTools.js';import {parseProjectSettings as parseProjectSettings$1}from'../../features/webbuilder/web/data/database.js';import {useCodeAssistantCatalog}from'./useCodeAssistantCatalog.js';import {useConnectorTemplates}from'./useConnectorTemplates.js';import {createRemoteConnectorExec}from'../../features/canvas/videoEditor/remoteMediaClient.js';import {createAgentCompleteJson}from'../../features/design/surface/agentWriter.js';import {directChannels,uploadAttachment,triggerBuild,createSandboxRouter,directSandboxRun,wakeSandbox,restoreFromSavedCopy,isNoProjectRefusal,OUTDATED_SERVER_RE}from'./webbuilderTransport.js';import {useSandboxProxyApi}from'./sandboxProxyApi.js';import {createPreviewAccess}from'../../features/webbuilder/previewAccess.js';import {publicSandboxDomain}from'../../features/webbuilder/publicSandboxDomain.js';import {useSandboxKeepAlive}from'./useSandboxKeepAlive.js';import {pendingAskUser}from'../../features/chat/askUser.js';import {runningBuild,useRunningBuilds,markBuildDone}from'./runningBuilds.js';import {isAgentSite}from'./siteLane.js';import {undoLastChange,redoChange}from'./versionUndo.js';import {WEBBUILDER_EXPORT_ZIP_ACTION,exportZipParams,exportZipUrl}from'../../features/webbuilder/exportCode.js';import {useRestoredSandboxes,applyRestored}from'./useRestoredSandboxes.js';import {useWebBuilderJobs}from'./useWebBuilderJobs.js';var __defProp = Object.defineProperty;
1
+ import {useRef,useState,useMemo,useCallback,useEffect,useSyncExternalStore}from'react';import {useApolloClient,gql}from'@apollo/client/index.js';import {useAiCodeDeployToCloudflareMutation}from'common/graphql';import {v4}from'uuid';import AsyncStorage from'@react-native-async-storage/async-storage';import {manualEditsCommitMessage}from'../../features/webbuilder/web/github/autoSync.js';import {handEditBackupRepo}from'../../features/webbuilder/web/code/savedCode.js';import {projectInstructionsNote,readDeleteReply,readSettingsUpdateReply,parseProjectSettings}from'../../features/webbuilder/projectTools.js';import'react/jsx-runtime';import'react-native';import {config}from'../../config/env-config.js';import {usePrerequisiteIds}from'../../hooks/usePrerequisiteIds.js';import'common';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import'../../contexts/GatewayContext.js';import {useChatStream}from'../../hooks/useChatStream.js';import {useHostChatChannel}from'../../hooks/useHostChatChannel.js';import {useHostChatSteering}from'../../hooks/useHostChatSteering.js';import {withoutBusyRepeats,isAgentBusyReply,BUSY_RETRY_DELAYS_MS,busyRetryText}from'./agentBusyRetry.js';import {useChatMessages,subscribeRememberedHistory,historyRunningChannelIds}from'../../hooks/useChatApi.js';import {useCanvasSession}from'../../features/canvas/useCanvasSession.js';import {tokenClaims}from'../../features/canvas/sessionIdentity.js';import {buildsFromPosts,hasWorkflowPosts,siteNameFromRequest,titleFromPrompt,stripAgentNote,projectFromPosts,turnState,pendingWork,transcriptFromPosts,userBubbleText,displayAgentText,isGenericTitle}from'../../features/webbuilder/buildFragments.js';import {handEditsNote,savedCodeSource}from'../../features/webbuilder/codeFiles.js';import {createCodeWorkspace}from'./codeWorkspaceApi.js';import {WEBBUILDER_CHAT_SKILL,buildTriggerParams,templateRemixNote,newObjectId}from'../../features/webbuilder/workflow.js';import {useWebBuilderGallery}from'./useWebBuilderGallery.js';import {agentEditNote,isPublishMessage,agentPublishMessage}from'../../features/webbuilder/webbuilderPrompts.js';import {plainActionError}from'../../features/webbuilder/publishTools.js';import {parseProjectSettings as parseProjectSettings$1}from'../../features/webbuilder/web/data/database.js';import {useCodeAssistantCatalog}from'./useCodeAssistantCatalog.js';import {useConnectorTemplates}from'./useConnectorTemplates.js';import {createRemoteConnectorExec}from'../../features/canvas/videoEditor/remoteMediaClient.js';import {createAgentCompleteJson}from'../../features/design/surface/agentWriter.js';import {directChannels,uploadAttachment,triggerBuild,createSandboxRouter,directSandboxRun,wakeSandbox,restoreFromSavedCopy,isNoProjectRefusal,OUTDATED_SERVER_RE}from'./webbuilderTransport.js';import {useSandboxProxyApi}from'./sandboxProxyApi.js';import {createPreviewAccess}from'../../features/webbuilder/previewAccess.js';import {publicSandboxDomain}from'../../features/webbuilder/publicSandboxDomain.js';import {useSandboxKeepAlive}from'./useSandboxKeepAlive.js';import {pendingAskUser}from'../../features/chat/askUser.js';import {runningBuild,useRunningBuilds,markBuildDone}from'./runningBuilds.js';import {isAgentSite}from'./siteLane.js';import {undoLastChange,redoChange}from'./versionUndo.js';import {WEBBUILDER_EXPORT_ZIP_ACTION,exportZipParams,exportZipUrl}from'../../features/webbuilder/exportCode.js';import {useRestoredSandboxes,applyRestored}from'./useRestoredSandboxes.js';import {useWebBuilderJobs}from'./useWebBuilderJobs.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -1298,10 +1298,25 @@ ${agentEditNote(target)}` : ""}${editsNote}`;
1298
1298
  };
1299
1299
  },
1300
1300
  readFile: (build, path, saved) => codeApi.readFile(target(build), path, saved),
1301
- saveFile: (build, path, base, draft, force) => codeApi.saveFile(target(build), path, base, draft, force),
1301
+ saveFile: async (build, path, base, draft, force) => {
1302
+ var _a2;
1303
+ const r = await codeApi.saveFile(target(build), path, base, draft, force);
1304
+ const repo = handEditBackupRepo({
1305
+ liveUrl: build.liveUrl || siteLiveUrl,
1306
+ backupRepo: siteBackupRepo
1307
+ });
1308
+ if (r.ok && !r.unchanged && repo && build.sandboxId) {
1309
+ sandboxCall("WEBBUILDER_BACKUP_GITHUB", {
1310
+ sandbox_id: build.sandboxId,
1311
+ repo,
1312
+ message: manualEditsCommitMessage([`${path}: ${(_a2 = r.summary) != null ? _a2 : "edited"}`])
1313
+ }, 12e4).catch(() => void 0);
1314
+ }
1315
+ return r;
1316
+ },
1302
1317
  search: (build, query, live, openDocs) => codeApi.search(target(build), query, live, openDocs)
1303
1318
  };
1304
- }, [codeApi, siteLiveUrl, siteBackupRepo]);
1319
+ }, [codeApi, siteLiveUrl, siteBackupRepo, sandboxCall]);
1305
1320
  const [deployToCloudflare] = useAiCodeDeployToCloudflareMutation({});
1306
1321
  const publish = useCallback(async (build, projectName, customDomain, force = false) => {
1307
1322
  var _a2, _b2, _c2, _d2, _e2;