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

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 (132) hide show
  1. package/lib/bridge/handlers/NavigationBridgeHandler.js +6 -9
  2. package/lib/bridge/handlers/NavigationBridgeHandler.js.map +1 -1
  3. package/lib/components/BrandBar/BrandBarBackground.js +27 -0
  4. package/lib/components/BrandBar/BrandBarBackground.js.map +1 -0
  5. package/lib/components/BrandBar/MenuToggle.js +73 -0
  6. package/lib/components/BrandBar/MenuToggle.js.map +1 -0
  7. package/lib/components/CustomDrawer.js +6 -6
  8. package/lib/components/CustomDrawer.js.map +1 -1
  9. package/lib/components/GatewayConnector/GatewayConnector.js +3 -2
  10. package/lib/components/GatewayConnector/GatewayConnector.js.map +1 -1
  11. package/lib/components/GatewayToolbarButtonMobile.js +12 -2
  12. package/lib/components/GatewayToolbarButtonMobile.js.map +1 -1
  13. package/lib/components/NavigationHeader/HeaderChip.js +76 -0
  14. package/lib/components/NavigationHeader/HeaderChip.js.map +1 -0
  15. package/lib/components/NavigationHeader/HeaderSkillsButton.js +4 -3
  16. package/lib/components/NavigationHeader/HeaderSkillsButton.js.map +1 -1
  17. package/lib/components/NavigationHeader/HeaderTasksButton.js +4 -3
  18. package/lib/components/NavigationHeader/HeaderTasksButton.js.map +1 -1
  19. package/lib/components/NavigationHeader/NavigationHeader.js +96 -41
  20. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  21. package/lib/components/YantraTopBar/YantraTopBar.js +98 -0
  22. package/lib/components/YantraTopBar/YantraTopBar.js.map +1 -0
  23. package/lib/compute.js +18 -25
  24. package/lib/compute.js.map +1 -1
  25. package/lib/features/apps/AppsCatalog.js +7 -4
  26. package/lib/features/apps/AppsCatalog.js.map +1 -1
  27. package/lib/features/apps/MarketplaceGallery.js +6 -3
  28. package/lib/features/apps/MarketplaceGallery.js.map +1 -1
  29. package/lib/features/apps/nativeSurfaceTwin.js +1 -1
  30. package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
  31. package/lib/features/apps/useMarketplaceApps.js +6 -2
  32. package/lib/features/apps/useMarketplaceApps.js.map +1 -1
  33. package/lib/features/attachments/useImageAttachments.js +44 -1
  34. package/lib/features/attachments/useImageAttachments.js.map +1 -1
  35. package/lib/features/credits/FreeCreditsPhoneStepHost.js +67 -0
  36. package/lib/features/credits/FreeCreditsPhoneStepHost.js.map +1 -0
  37. package/lib/features/credits/freeCredits.js +52 -13
  38. package/lib/features/credits/freeCredits.js.map +1 -1
  39. package/lib/features/credits/freeCreditsPhoneStep.js +55 -0
  40. package/lib/features/credits/freeCreditsPhoneStep.js.map +1 -0
  41. package/lib/features/credits/useFreeCredits.js +29 -3
  42. package/lib/features/credits/useFreeCredits.js.map +1 -1
  43. package/lib/features/links/openInApp.js +3 -6
  44. package/lib/features/links/openInApp.js.map +1 -1
  45. package/lib/features/webbuilder/WebBuilderExperience.js +88 -28
  46. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  47. package/lib/features/webbuilder/appPreview.js +70 -0
  48. package/lib/features/webbuilder/appPreview.js.map +1 -0
  49. package/lib/features/webbuilder/buildFragments.js +33 -12
  50. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  51. package/lib/features/webbuilder/components/AppPhoneSheet.js +127 -0
  52. package/lib/features/webbuilder/components/AppPhoneSheet.js.map +1 -0
  53. package/lib/features/webbuilder/components/BottomTabs.js +32 -21
  54. package/lib/features/webbuilder/components/BottomTabs.js.map +1 -1
  55. package/lib/features/webbuilder/components/Composer.js +144 -47
  56. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  57. package/lib/features/webbuilder/components/PreviewFrame.js +1 -1
  58. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  59. package/lib/features/webbuilder/components/PreviewScreen.js +9 -4
  60. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  61. package/lib/features/webbuilder/components/ProjectSheets.js +76 -22
  62. package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
  63. package/lib/features/webbuilder/components/ProjectsScreen.js +30 -12
  64. package/lib/features/webbuilder/components/ProjectsScreen.js.map +1 -1
  65. package/lib/features/webbuilder/components/PublishSheet.js +2 -2
  66. package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
  67. package/lib/features/webbuilder/components/SiteUploadSheet.js +17 -2
  68. package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -1
  69. package/lib/features/webbuilder/components/SocialExportPicker.js +253 -0
  70. package/lib/features/webbuilder/components/SocialExportPicker.js.map +1 -0
  71. package/lib/features/webbuilder/components/StudioHome.js +300 -185
  72. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  73. package/lib/features/webbuilder/components/TemplateCard.js +13 -5
  74. package/lib/features/webbuilder/components/TemplateCard.js.map +1 -1
  75. package/lib/features/webbuilder/connectorTemplates.js +3 -2
  76. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  77. package/lib/features/webbuilder/liveSiteDelete.js +58 -0
  78. package/lib/features/webbuilder/liveSiteDelete.js.map +1 -0
  79. package/lib/features/webbuilder/publishTools.js +3 -1
  80. package/lib/features/webbuilder/publishTools.js.map +1 -1
  81. package/lib/features/webbuilder/socialExportFile.js +84 -0
  82. package/lib/features/webbuilder/socialExportFile.js.map +1 -0
  83. package/lib/features/webbuilder/stepLabels.js +7 -7
  84. package/lib/features/webbuilder/stepLabels.js.map +1 -1
  85. package/lib/features/webbuilder/thumbSources.js +17 -3
  86. package/lib/features/webbuilder/thumbSources.js.map +1 -1
  87. package/lib/features/webbuilder/useVoiceTyping.js +169 -0
  88. package/lib/features/webbuilder/useVoiceTyping.js.map +1 -0
  89. package/lib/features/webbuilder/web/chat/connectRequest.js +17 -0
  90. package/lib/features/webbuilder/web/chat/connectRequest.js.map +1 -0
  91. package/lib/features/webbuilder/web/notify/turnDone.js +20 -0
  92. package/lib/features/webbuilder/web/notify/turnDone.js.map +1 -0
  93. package/lib/features/webbuilder/web/project/coverRequest.js +22 -0
  94. package/lib/features/webbuilder/web/project/coverRequest.js.map +1 -0
  95. package/lib/features/webbuilder/web/project/deleteFlow.js +57 -0
  96. package/lib/features/webbuilder/web/project/deleteFlow.js.map +1 -0
  97. package/lib/features/webbuilder/web/publish/siteAddress.js +5 -1
  98. package/lib/features/webbuilder/web/publish/siteAddress.js.map +1 -1
  99. package/lib/features/webbuilder/web/upload/sitePhotos.js +2 -2
  100. package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -1
  101. package/lib/features/webbuilder/web/upload/socialExport.js +191 -0
  102. package/lib/features/webbuilder/web/upload/socialExport.js.map +1 -0
  103. package/lib/features/webbuilder/web/upload/zipRandomAccess.js +64 -0
  104. package/lib/features/webbuilder/web/upload/zipRandomAccess.js.map +1 -0
  105. package/lib/features/webbuilder/web/webServices.js +27 -3
  106. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  107. package/lib/hooks/useHeaderProfile.js +25 -0
  108. package/lib/hooks/useHeaderProfile.js.map +1 -0
  109. package/lib/index.js +1 -1
  110. package/lib/index.js.map +1 -1
  111. package/lib/routes.json +21 -29
  112. package/lib/screens/Account/AccountSheets.js +140 -74
  113. package/lib/screens/Account/AccountSheets.js.map +1 -1
  114. package/lib/screens/Account/index.js +3 -3
  115. package/lib/screens/Account/index.js.map +1 -1
  116. package/lib/screens/Apps/index.js +1 -1
  117. package/lib/screens/Apps/index.js.map +1 -1
  118. package/lib/screens/ChatHistory/index.js +1 -1
  119. package/lib/screens/ChatHistory/index.js.map +1 -1
  120. package/lib/screens/ExpensesNative/index.js +3 -3
  121. package/lib/screens/ExpensesNative/index.js.map +1 -1
  122. package/lib/screens/Home/HomeScreen.js +11 -0
  123. package/lib/screens/Home/HomeScreen.js.map +1 -1
  124. package/lib/screens/Home/components/ChatHistoryLanding.js +3 -2
  125. package/lib/screens/Home/components/ChatHistoryLanding.js.map +1 -1
  126. package/lib/screens/WebBuilderNative/index.js +3 -2
  127. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  128. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +2 -2
  129. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  130. package/lib/utils/drawerRoutes.js +13 -0
  131. package/lib/utils/drawerRoutes.js.map +1 -0
  132. package/package.json +2 -2
@@ -0,0 +1,169 @@
1
+ import {useState,useRef,useCallback,useEffect}from'react';import {useAudioRecorder,RecordingPresets,useAudioRecorderState,setAudioModeAsync}from'expo-audio';import {transcribeAsCaller}from'../../api/stt.js';import {useOptionalCdecliConnection}from'../../contexts/cdecliConnection.js';import {requestMicPermission}from'../audio-input/useAudioPermission.js';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 SPEECH_DB = -38;
21
+ const PAUSE_MS = 1200;
22
+ const MAX_PHRASE_MS = 25e3;
23
+ function phraseOver(s) {
24
+ if (!s.spoke) return false;
25
+ return s.now - s.lastLoud >= PAUSE_MS || s.now - s.startedAt >= MAX_PHRASE_MS;
26
+ }
27
+ function useVoiceTyping({
28
+ onPhrase,
29
+ onError
30
+ }) {
31
+ const connection = useOptionalCdecliConnection();
32
+ const recorder = useAudioRecorder(__spreadProps(__spreadValues({}, RecordingPresets.HIGH_QUALITY), {
33
+ isMeteringEnabled: true
34
+ }));
35
+ const state = useAudioRecorderState(recorder, 150);
36
+ const [phase, setPhase] = useState("off");
37
+ const [pending, setPending] = useState(0);
38
+ const active = useRef(false);
39
+ const switching = useRef(false);
40
+ const phrase = useRef({
41
+ spoke: false,
42
+ lastLoud: 0,
43
+ startedAt: 0
44
+ });
45
+ const queue = useRef(Promise.resolve());
46
+ const callbacks = useRef({
47
+ onPhrase,
48
+ onError
49
+ });
50
+ callbacks.current = {
51
+ onPhrase,
52
+ onError
53
+ };
54
+ const begin = useCallback(async () => {
55
+ await recorder.prepareToRecordAsync();
56
+ recorder.record();
57
+ phrase.current = {
58
+ spoke: false,
59
+ lastLoud: Date.now(),
60
+ startedAt: Date.now()
61
+ };
62
+ }, [recorder]);
63
+ const typeRecording = useCallback((uri) => {
64
+ if (!connection) return;
65
+ setPending((n) => n + 1);
66
+ const text = transcribeAsCaller({
67
+ uri,
68
+ mimeType: "audio/m4a",
69
+ filename: "audio.m4a"
70
+ }, {
71
+ endpoint: connection.agentEndpoint,
72
+ obtainToken: connection.obtainAgentToken,
73
+ recover: connection.recoverAgentAuth
74
+ });
75
+ queue.current = queue.current.then(() => text).then((t) => {
76
+ const said = (t != null ? t : "").trim();
77
+ if (said) callbacks.current.onPhrase(said);
78
+ }).catch((err) => callbacks.current.onError(err instanceof Error ? err.message : "Couldn't hear that. Try again.")).finally(() => setPending((n) => Math.max(0, n - 1)));
79
+ }, [connection]);
80
+ const nextPhrase = useCallback(async () => {
81
+ if (switching.current) return;
82
+ switching.current = true;
83
+ try {
84
+ await recorder.stop();
85
+ const {
86
+ uri
87
+ } = recorder;
88
+ if (uri) typeRecording(uri);
89
+ if (active.current) await begin();
90
+ } catch (err) {
91
+ active.current = false;
92
+ setPhase("off");
93
+ callbacks.current.onError(err instanceof Error ? err.message : "The microphone stopped.");
94
+ } finally {
95
+ switching.current = false;
96
+ }
97
+ }, [recorder, begin, typeRecording]);
98
+ useEffect(() => {
99
+ if (!active.current || switching.current || !state.isRecording) return;
100
+ const now = Date.now();
101
+ const level = typeof state.metering === "number" ? state.metering : -160;
102
+ if (level > SPEECH_DB) phrase.current = __spreadProps(__spreadValues({}, phrase.current), {
103
+ spoke: true,
104
+ lastLoud: now
105
+ });
106
+ if (phraseOver(__spreadProps(__spreadValues({}, phrase.current), {
107
+ now
108
+ }))) nextPhrase().catch(() => void 0);
109
+ }, [state.metering, state.durationMillis, state.isRecording, nextPhrase]);
110
+ const start = useCallback(async () => {
111
+ if (active.current) return;
112
+ if (!connection) {
113
+ callbacks.current.onError("Dictation isn't available here. Type what you'd like to build.");
114
+ return;
115
+ }
116
+ const {
117
+ granted,
118
+ error
119
+ } = await requestMicPermission();
120
+ if (!granted) {
121
+ callbacks.current.onError(error || "Microphone is not available.");
122
+ return;
123
+ }
124
+ try {
125
+ active.current = true;
126
+ setPhase("listening");
127
+ await begin();
128
+ } catch (err) {
129
+ active.current = false;
130
+ setPhase("off");
131
+ callbacks.current.onError(err instanceof Error ? err.message : "The microphone did not start.");
132
+ }
133
+ }, [connection, begin]);
134
+ const stop = useCallback(async () => {
135
+ if (!active.current) return;
136
+ active.current = false;
137
+ const {
138
+ spoke
139
+ } = phrase.current;
140
+ try {
141
+ await recorder.stop();
142
+ if (spoke && recorder.uri) typeRecording(recorder.uri);
143
+ } catch (e) {
144
+ }
145
+ setPhase("off");
146
+ await setAudioModeAsync({
147
+ allowsRecording: false,
148
+ playsInSilentMode: true
149
+ }).catch(() => void 0);
150
+ }, [recorder, typeRecording]);
151
+ useEffect(() => () => {
152
+ if (!active.current) return;
153
+ active.current = false;
154
+ recorder.stop().catch(() => void 0);
155
+ setAudioModeAsync({
156
+ allowsRecording: false,
157
+ playsInSilentMode: true
158
+ }).catch(() => void 0);
159
+ }, [recorder]);
160
+ return {
161
+ /** Listening, or not; `typing` while a phrase is still being transcribed after listening stopped. */
162
+ phase: phase === "off" && pending > 0 ? "typing" : phase,
163
+ /** Phrases still being transcribed. */
164
+ pending,
165
+ available: Boolean(connection),
166
+ start,
167
+ stop
168
+ };
169
+ }export{MAX_PHRASE_MS,PAUSE_MS,SPEECH_DB,phraseOver,useVoiceTyping};//# sourceMappingURL=useVoiceTyping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVoiceTyping.js","sources":["../../../src/features/webbuilder/useVoiceTyping.ts"],"sourcesContent":["/**\n * Voice typing for the prompt box where the phone has no live speech recognition (Expo Go, older builds): it\n * listens, and each time the person pauses, the phrase just spoken is transcribed through the app's agent (the\n * same speech-to-text as the chat's recorder) and typed in, in the order spoken. It keeps listening until stopped.\n *\n * A pause is told from the microphone's level (expo-audio metering): speech above `SPEECH_DB`, then quiet for\n * `PAUSE_MS`. A phrase never runs past `MAX_PHRASE_MS`.\n */\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { RecordingPresets, setAudioModeAsync, useAudioRecorder, useAudioRecorderState } from 'expo-audio';\nimport { transcribeAsCaller } from '../../api/stt';\nimport { useOptionalCdecliConnection } from '../../contexts/cdecliConnection';\nimport { requestMicPermission } from '../audio-input/useAudioPermission';\n\n/** Louder than this (dBFS) is speech. */\nexport const SPEECH_DB = -38;\n/** Quiet this long after speech ends a phrase. */\nexport const PAUSE_MS = 1200;\n/** A phrase is sent at this length even without a pause. */\nexport const MAX_PHRASE_MS = 25_000;\n\nexport type VoiceTypingPhase = 'off' | 'listening' | 'typing';\n\n/** Whether a phrase is over: something was said, then quiet long enough (or it ran too long). Pure. */\nexport function phraseOver(s: { spoke: boolean; now: number; lastLoud: number; startedAt: number }): boolean {\n if (!s.spoke) return false;\n return s.now - s.lastLoud >= PAUSE_MS || s.now - s.startedAt >= MAX_PHRASE_MS;\n}\n\nexport function useVoiceTyping({\n onPhrase,\n onError,\n}: {\n /** One phrase, transcribed: the caller types it in. */\n onPhrase: (text: string) => void;\n onError: (message: string) => void;\n}) {\n const connection = useOptionalCdecliConnection();\n const recorder = useAudioRecorder({ ...RecordingPresets.HIGH_QUALITY, isMeteringEnabled: true });\n const state = useAudioRecorderState(recorder, 150);\n const [phase, setPhase] = useState<VoiceTypingPhase>('off');\n const [pending, setPending] = useState(0);\n const active = useRef(false);\n const switching = useRef(false);\n const phrase = useRef({ spoke: false, lastLoud: 0, startedAt: 0 });\n // Phrases are typed in the order spoken, even when a later one transcribes first.\n const queue = useRef<Promise<void>>(Promise.resolve());\n const callbacks = useRef({ onPhrase, onError });\n callbacks.current = { onPhrase, onError };\n\n const begin = useCallback(async () => {\n await recorder.prepareToRecordAsync();\n recorder.record();\n phrase.current = { spoke: false, lastLoud: Date.now(), startedAt: Date.now() };\n }, [recorder]);\n\n /** Transcribes one finished recording and types it, after the ones before it. */\n const typeRecording = useCallback(\n (uri: string) => {\n if (!connection) return;\n setPending((n) => n + 1);\n const text = transcribeAsCaller(\n { uri, mimeType: 'audio/m4a', filename: 'audio.m4a' },\n {\n endpoint: connection.agentEndpoint,\n obtainToken: connection.obtainAgentToken,\n recover: connection.recoverAgentAuth,\n },\n );\n queue.current = queue.current\n .then(() => text)\n .then((t) => {\n const said = (t ?? '').trim();\n if (said) callbacks.current.onPhrase(said);\n })\n .catch((err: unknown) =>\n callbacks.current.onError(err instanceof Error ? err.message : \"Couldn't hear that. Try again.\"),\n )\n .finally(() => setPending((n) => Math.max(0, n - 1)));\n },\n [connection],\n );\n\n /** Ends the phrase: the recording goes to be typed, and listening starts again at once. */\n const nextPhrase = useCallback(async () => {\n if (switching.current) return;\n switching.current = true;\n try {\n await recorder.stop();\n const { uri } = recorder;\n if (uri) typeRecording(uri);\n if (active.current) await begin();\n } catch (err) {\n active.current = false;\n setPhase('off');\n callbacks.current.onError(err instanceof Error ? err.message : 'The microphone stopped.');\n } finally {\n switching.current = false;\n }\n }, [recorder, begin, typeRecording]);\n\n // The level, read every tick: speech marks the phrase, a pause after it ends the phrase.\n useEffect(() => {\n if (!active.current || switching.current || !state.isRecording) return;\n const now = Date.now();\n const level = typeof state.metering === 'number' ? state.metering : -160;\n if (level > SPEECH_DB) phrase.current = { ...phrase.current, spoke: true, lastLoud: now };\n if (phraseOver({ ...phrase.current, now })) nextPhrase().catch(() => undefined);\n }, [state.metering, state.durationMillis, state.isRecording, nextPhrase]);\n\n const start = useCallback(async () => {\n if (active.current) return;\n if (!connection) {\n callbacks.current.onError(\"Dictation isn't available here. Type what you'd like to build.\");\n return;\n }\n const { granted, error } = await requestMicPermission();\n if (!granted) {\n callbacks.current.onError(error || 'Microphone is not available.');\n return;\n }\n try {\n active.current = true;\n setPhase('listening');\n await begin();\n } catch (err) {\n active.current = false;\n setPhase('off');\n callbacks.current.onError(err instanceof Error ? err.message : 'The microphone did not start.');\n }\n }, [connection, begin]);\n\n /** Stops listening; what was said since the last pause is still typed. */\n const stop = useCallback(async () => {\n if (!active.current) return;\n active.current = false;\n const { spoke } = phrase.current;\n try {\n await recorder.stop();\n if (spoke && recorder.uri) typeRecording(recorder.uri);\n } catch {\n /* already stopped */\n }\n setPhase('off');\n await setAudioModeAsync({ allowsRecording: false, playsInSilentMode: true }).catch(() => undefined);\n }, [recorder, typeRecording]);\n\n useEffect(\n () => () => {\n if (!active.current) return;\n active.current = false;\n recorder.stop().catch(() => undefined);\n setAudioModeAsync({ allowsRecording: false, playsInSilentMode: true }).catch(() => undefined);\n },\n [recorder],\n );\n\n return {\n /** Listening, or not; `typing` while a phrase is still being transcribed after listening stopped. */\n phase: phase === 'off' && pending > 0 ? ('typing' as const) : phase,\n /** Phrases still being transcribed. */\n pending,\n available: Boolean(connection),\n start,\n stop,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAeO,MAAM,SAAY,GAAA;AAElB,MAAM,QAAW,GAAA;AAEjB,MAAM,aAAgB,GAAA;AAItB,SAAS,WAAW,CAKf,EAAA;AACV,EAAI,IAAA,CAAC,CAAE,CAAA,KAAA,EAAc,OAAA,KAAA;AACrB,EAAO,OAAA,CAAA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
2
+ function hasConnectorConnect(text) {
3
+ return /\[CONNECTOR_CONNECT(?:\]|:|\s)/.test(String(text != null ? text : ""));
4
+ }
5
+ function stripConnectorConnect(text) {
6
+ let out = String(text != null ? text : "");
7
+ if (!hasConnectorConnect(out)) return out;
8
+ for (const re of CONNECT_MARKER_RES) out = out.replace(re, "");
9
+ return out.replace(/\n{3,}/g, "\n\n").trim();
10
+ }
11
+ function pendingConnectorConnect(messages) {
12
+ const last = messages[messages.length - 1];
13
+ if (!last || last.role !== "assistant" || typeof last.content !== "string") return null;
14
+ return hasConnectorConnect(last.content) ? {
15
+ messageId: last.id
16
+ } : null;
17
+ }export{hasConnectorConnect,pendingConnectorConnect,stripConnectorConnect};//# sourceMappingURL=connectRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectRequest.js","sources":["../../../../../src/features/webbuilder/web/chat/connectRequest.ts"],"sourcesContent":["/**\n * The agent's `[CONNECTOR_CONNECT]` request, as the upload sheet reads it (web 0.20.14, surface-kit\n * `parseConnectorConnect` / `openConnectorConnect` / `stripConnectorConnect`). The card itself is the host's\n * (`renderConnectorCard`, the one the app's chat shows): this only finds a request still waiting and takes the\n * marker out of the words. Pure.\n */\n\n/** Every shape of the marker the web's parser takes (the same list as the Design surface's chat). */\nconst CONNECT_MARKER_RES = [\n /\\[CONNECTOR_CONNECT\\][\\s\\S]*?\\[\\/CONNECTOR_CONNECT\\]/g,\n /\\[CONNECTOR_CONNECT(?::[A-Za-z0-9_-]+)?:\\s*\\{[\\s\\S]*\\}\\s*\\]/g,\n /\\[CONNECTOR_CONNECT(?:\\s+[A-Za-z][\\w-]*\\s*=\\s*(?:\"[^\"]*\"|'[^']*'))+\\s*\\]/g,\n /\\[CONNECTOR_CONNECT:\\s*[A-Za-z0-9_.-]+\\s*\\](?:\\s*\\[\\/CONNECTOR_CONNECT\\])?/g,\n /\\[CONNECTOR_CONNECT\\][\\s\\S]*$/g,\n];\n\n/** The card's answer (`[CONNECTOR_CONNECTED:…]` / `[CONNECTOR_DECLINED:…]`): protocol, never something said. */\nconst CONNECT_REPLY_RE = /^\\s*\\[CONNECTOR_(CONNECTED|DECLINED)(?::[^\\]]*)?\\]\\s*$/;\n\n/** Whether the text carries a connect request. */\nexport function hasConnectorConnect(text: string | null | undefined): boolean {\n return /\\[CONNECTOR_CONNECT(?:\\]|:|\\s)/.test(String(text ?? ''));\n}\n\n/** The text without its connect request (the card shows it). */\nexport function stripConnectorConnect(text: string | null | undefined): string {\n let out = String(text ?? '');\n if (!hasConnectorConnect(out)) return out;\n for (const re of CONNECT_MARKER_RES) out = out.replace(re, '');\n return out.replace(/\\n{3,}/g, '\\n\\n').trim();\n}\n\nexport function isConnectorReply(text: string | null | undefined): boolean {\n return CONNECT_REPLY_RE.test(String(text ?? ''));\n}\n\n/**\n * The connect request still waiting on the person: only one in the thread's LAST message (the app's rule,\n * surface-kit `openConnectorConnect`). Anything after it - the card's own reply, or the person moving on - means\n * the turn has moved on.\n */\nexport function pendingConnectorConnect(\n messages: ReadonlyArray<{ id: string; role: string; content?: unknown }>,\n): { messageId: string } | null {\n const last = messages[messages.length - 1];\n if (!last || last.role !== 'assistant' || typeof last.content !== 'string') return null;\n return hasConnectorConnect(last.content) ? { messageId: last.id } : null;\n}\n"],"names":[],"mappings":"AAQA,MAAM,qBAAqB,CAAC,uDAAA,EAAyD,8DAAgE,EAAA,2EAAA,EAA6E,+EAA+E,gCAAgC,CAAA;AAM1U,SAAS,oBAAoB,IAA0C,EAAA;AAC5E,EAAA,OAAO,gCAAiC,CAAA,IAAA,CAAK,MAAO,CAAA,IAAA,IAAA,IAAA,GAAA,IAAA,GAAQ,EAAE,CAAC,CAAA;AACjE;AAGO,SAAS,sBAAsB,IAAyC,EAAA;AAC7E,EAAI,IAAA,GAAA,GAAM,MAAO,CAAA,IAAA,IAAA,IAAA,GAAA,IAAA,GAAQ,EAAE,CAAA;AAC3B,EAAA,IAAI,CAAC,mBAAA,CAAoB,GAAG,CAAA,EAAU,OAAA,GAAA;AACtC,EAAA,KAAA,MAAW,MAAM,kBAAoB,EAAA,GAAA,GAAM,GAAI,CAAA,OAAA,CAAQ,IAAI,EAAE,CAAA;AAC7D,EAAA,OAAO,GAAI,CAAA,OAAA,CAAQ,SAAW,EAAA,MAAM,EAAE,IAAK,EAAA;AAC7C;AAUO,SAAS,wBAAwB,QAM/B,EAAA;AACP,EAAA,MAAM,IAAO,GAAA,QAAA,CAAS,QAAS,CAAA,MAAA,GAAS,CAAC,CAAA;AACzC,EAAI,IAAA,CAAC,QAAQ,IAAK,CAAA,IAAA,KAAS,eAAe,OAAO,IAAA,CAAK,OAAY,KAAA,QAAA,EAAiB,OAAA,IAAA;AACnF,EAAO,OAAA,mBAAA,CAAoB,IAAK,CAAA,OAAO,CAAI,GAAA;AAAA,IACzC,WAAW,IAAK,CAAA;AAAA,GACd,GAAA,IAAA;AACN"}
@@ -0,0 +1,20 @@
1
+ const LONG_TURN_MS = 2e4;
2
+ const INTENT = /^(I'll|I will|I'm going to|Let me|Let's|Sure|Okay|OK|Got it|Great|On it)\b/i;
3
+ function turnReplySummary(reply, max = 120) {
4
+ var _a, _b, _c, _d;
5
+ const lines = (reply != null ? reply : "").split("\n").filter((l) => !/^\s*⚙|mcp__|\b[A-Z]+_[A-Z_]{3,}\b/.test(l)).join("\n").replace(/```[\s\S]*?```/g, " ").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\[[A-Z_]+(?::[^\]]*)?\][^\n]*/g, " ").replace(/https?:\/\/\S+/g, " ").replace(/[*_`#>]+/g, "").split("\n").map((l) => l.replace(/^\s*[-•]\s*/, "").replace(/\s+/g, " ").trim()).filter((l) => l.length > 2 && !/^(to confirm|next steps?):?$/i.test(l));
6
+ const outcome = lines.filter((l) => !INTENT.test(l));
7
+ const first = (_b = (_a = outcome[0]) != null ? _a : lines[0]) != null ? _b : "";
8
+ const sentence = (_d = (_c = /^(.+?[.!?])(\s|$)/.exec(first)) == null ? void 0 : _c[1]) != null ? _d : first;
9
+ return sentence.length > max ? `${sentence.slice(0, max - 1).trimEnd()}\u2026` : sentence;
10
+ }
11
+ function turnDoneText(project, reply) {
12
+ const name = (project != null ? project : "").trim();
13
+ return {
14
+ title: name ? `${name}: done` : "Yantra is done",
15
+ body: turnReplySummary(reply) || "Your last request has finished."
16
+ };
17
+ }
18
+ function longTurn(startedAt, endedAt) {
19
+ return startedAt !== null && endedAt - startedAt >= LONG_TURN_MS;
20
+ }export{LONG_TURN_MS,longTurn,turnDoneText,turnReplySummary};//# sourceMappingURL=turnDone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnDone.js","sources":["../../../../../src/features/webbuilder/web/notify/turnDone.ts"],"sourcesContent":["/**\n * Telling the owner a long AI turn (build, import, publish, edit) has finished (web 0.20.16 `notify/turnDone`).\n * Pure. On the phone the notice is the app's own toast; see `useTurnDoneNotice` for why no system notification.\n */\n\n/** A turn at least this long is worth a \"done\" notice. */\nexport const LONG_TURN_MS = 20_000;\n\nconst INTENT = /^(I'll|I will|I'm going to|Let me|Let's|Sure|Okay|OK|Got it|Great|On it)\\b/i;\n\n/** The reply's first real sentence, as plain words: no markdown, links, markers or code. */\nexport function turnReplySummary(reply: string | null | undefined, max = 120): string {\n const lines = (reply ?? '')\n .split('\\n')\n // Tool steps (\"⚙ mcp__cdecli__execute_action — …\") are the work, not the answer.\n .filter((l) => !/^\\s*⚙|mcp__|\\b[A-Z]+_[A-Z_]{3,}\\b/.test(l))\n .join('\\n')\n .replace(/```[\\s\\S]*?```/g, ' ')\n .replace(/\\[([^\\]]+)\\]\\([^)]*\\)/g, '$1')\n .replace(/\\[[A-Z_]+(?::[^\\]]*)?\\][^\\n]*/g, ' ')\n .replace(/https?:\\/\\/\\S+/g, ' ')\n .replace(/[*_`#>]+/g, '')\n .split('\\n')\n .map((l) =>\n l\n .replace(/^\\s*[-•]\\s*/, '')\n .replace(/\\s+/g, ' ')\n .trim(),\n )\n .filter((l) => l.length > 2 && !/^(to confirm|next steps?):?$/i.test(l));\n // \"I'll build…\" / \"Let me…\" says what it set out to do; the outcome comes after.\n const outcome = lines.filter((l) => !INTENT.test(l));\n const first = outcome[0] ?? lines[0] ?? '';\n const sentence = /^(.+?[.!?])(\\s|$)/.exec(first)?.[1] ?? first;\n return sentence.length > max ? `${sentence.slice(0, max - 1).trimEnd()}…` : sentence;\n}\n\nexport function turnDoneText(\n project: string | null | undefined,\n reply: string | null | undefined,\n): { title: string; body: string } {\n const name = (project ?? '').trim();\n return {\n title: name ? `${name}: done` : 'Yantra is done',\n body: turnReplySummary(reply) || 'Your last request has finished.',\n };\n}\n\n/** Whether a turn that ran from `startedAt` to `endedAt` earns the notice. */\nexport function longTurn(startedAt: number | null, endedAt: number): boolean {\n return startedAt !== null && endedAt - startedAt >= LONG_TURN_MS;\n}\n"],"names":[],"mappings":"AAMO,MAAM,YAAe,GAAA;AAC5B,MAAM,MAAS,GAAA,6EAAA;AAGC,SAAA,gBAAA,CAAiB,KAAkC,EAAA,GAAA,GAAM,GAAa,EAAA;AAVtF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAWE,EAAA,MAAM,KAAS,GAAA,CAAA,KAAA,IAAA,IAAA,GAAA,KAAA,GAAS,EAAI,EAAA,KAAA,CAAM,IAAI,CAAA,CAErC,MAAO,CAAA,CAAA,CAAA,KAAK,CAAC,mCAAA,CAAoC,IAAK,CAAA,CAAC,CAAC,CAAA,CAAE,IAAK,CAAA,IAAI,CAAE,CAAA,OAAA,CAAQ,iBAAmB,EAAA,GAAG,CAAE,CAAA,OAAA,CAAQ,wBAA0B,EAAA,IAAI,CAAE,CAAA,OAAA,CAAQ,gCAAkC,EAAA,GAAG,EAAE,OAAQ,CAAA,iBAAA,EAAmB,GAAG,CAAA,CAAE,OAAQ,CAAA,WAAA,EAAa,EAAE,CAAA,CAAE,KAAM,CAAA,IAAI,CAAE,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,OAAQ,CAAA,aAA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Aa,IAAA,YAAA;AACtD"}
@@ -0,0 +1,22 @@
1
+ const REQUEST_COVER = `mutation aiCodeRequestCover($channelId: ID!, $sandboxId: String!) {
2
+ aiCodeRequestCover(channelId: $channelId, sandboxId: $sandboxId) { queued reason }
3
+ }`;
4
+ function createCoverRequester(call) {
5
+ const asked = /* @__PURE__ */ new Set();
6
+ return async (channelId, sandboxId) => {
7
+ var _a, _b;
8
+ const key = `${channelId}:${sandboxId}`;
9
+ if (!channelId || !sandboxId || asked.has(key)) return false;
10
+ asked.add(key);
11
+ try {
12
+ const r = await call(REQUEST_COVER, {
13
+ channelId,
14
+ sandboxId
15
+ });
16
+ return Boolean((_b = (_a = r.data) == null ? void 0 : _a.aiCodeRequestCover) == null ? void 0 : _b.queued);
17
+ } catch (e) {
18
+ asked.delete(key);
19
+ return false;
20
+ }
21
+ };
22
+ }export{REQUEST_COVER,createCoverRequester};//# sourceMappingURL=coverRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverRequest.js","sources":["../../../../../src/features/webbuilder/web/project/coverRequest.ts"],"sourcesContent":["/**\n * A build's preview is on screen and it has no cover: ask the server to take one (web 0.20.12,\n * `project/coverRequest`). Every lane ends here (agent builds, imports, copies, restores), so a card gets its\n * picture the first time anyone sees the site running. Pure.\n */\nimport type { GqlCall } from '../sharing/sharingApi';\n\nexport const REQUEST_COVER = `mutation aiCodeRequestCover($channelId: ID!, $sandboxId: String!) {\n aiCodeRequestCover(channelId: $channelId, sandboxId: $sandboxId) { queued reason }\n}`;\n\nexport type CoverRequester = (channelId: string, sandboxId: string) => Promise<boolean>;\n\n/** Whether a build on screen should ask for its cover. */\nexport function needsCover(c: {\n coverImageUrl?: string | null;\n sandboxId?: string | null;\n sandboxGone?: boolean;\n}): boolean {\n return !String(c.coverImageUrl || '').trim() && Boolean(String(c.sandboxId || '').trim()) && !c.sandboxGone;\n}\n\n/** Asks once per sandbox per app session; the server throttles and dedupes the capture itself. */\nexport function createCoverRequester(call: GqlCall): CoverRequester {\n const asked = new Set<string>();\n return async (channelId, sandboxId) => {\n const key = `${channelId}:${sandboxId}`;\n if (!channelId || !sandboxId || asked.has(key)) return false;\n asked.add(key);\n try {\n const r = await call<{ aiCodeRequestCover?: { queued?: boolean } | null }>(REQUEST_COVER, {\n channelId,\n sandboxId,\n });\n return Boolean(r.data?.aiCodeRequestCover?.queued);\n } catch {\n // An older server has no such mutation; a later open may try again.\n asked.delete(key);\n return false;\n }\n };\n}\n"],"names":[],"mappings":"AAMO,MAAM,aAAgB,GAAA,CAAA;AAAA;AAAA,CAAA;AAetB,SAAS,qBAAqB,IAA+B,EAAA;AAClE,EAAM,MAAA,KAAA,uBAAY,GAAY,EAAA;AAC9B,EAAO,OAAA,OAAO,WAAW,SAAc,KAAA;AAvBzC,IAAA,IAAA,EAAA,EAAA,EAAA;AAwBI,IAAA,MAAM,GAAM,GAAA,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AACrC,IAAI,IAAA,CAAC,aAAa,CAAC,SAAA,IAAa,MAAM,GAAI,CAAA,GAAG,GAAU,OAAA,KAAA;AACvD,IAAA,KAAA,CAAM,IAAI,GAAG,CAAA;AACb,IAAI,IAAA;AACF,MAAM,MAAA,CAAA,GAAI,MAAM,IAAA,CAIb,aAAe,EAAA;AAAA,QAChB,SAAA;AAAA,QACA;AAAA,OACD,CAAA;AACD,MAAA,OAAO,SAAQ,EAAE,GAAA,CAAA,EAAA,GAAA,CAAA,CAAA,IAAA,KAAF,IAAQ,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,kBAAA,KAAR,mBAA4B,MAAM,CAAA;AAAA,KAC3C,CAAA,OAAA,CAAA,EAAA;AAEN,MAAA,KAAA,CAAM,OAAO,GAAG,CAAA;AAChB,MAAO,OAAA,KAAA;AAAA;AACT,GACF;AACF"}
@@ -0,0 +1,57 @@
1
+ import {siteProjectName,siteAddress,siteHost}from'../publish/siteAddress.js';var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ const CLOUDFLARE_PROJECT_QUERY = `query WebbuilderCloudflareProject($channelId: String!) {
18
+ aiCodeGetCloudflareProject(channelId: $channelId)
19
+ }`;
20
+ const PAGES_PROJECT_RE = /^[a-z0-9][a-z0-9-]{0,57}$/;
21
+ function publishedSiteFor(projectName, known) {
22
+ var _a;
23
+ const name = String(projectName != null ? projectName : "").trim().toLowerCase();
24
+ if (!PAGES_PROJECT_RE.test(name)) return null;
25
+ const customDomain = String((_a = known.customDomain) != null ? _a : "").trim().toLowerCase();
26
+ const liveUrl = known.liveUrl && siteProjectName(known.liveUrl) === name ? known.liveUrl : null;
27
+ const url = siteAddress({
28
+ customDomainUrl: customDomain,
29
+ urls: [liveUrl],
30
+ projectName: name
31
+ });
32
+ return __spreadValues({
33
+ projectName: name,
34
+ url
35
+ }, customDomain ? {
36
+ customDomain
37
+ } : {});
38
+ }
39
+ function siteFromLookup(lookup, known) {
40
+ var _a;
41
+ let name = String((_a = lookup.name) != null ? _a : "").trim();
42
+ if (!name && lookup.failed) name = siteProjectName(known.liveUrl);
43
+ if (!name) return lookup.failed ? "unknown" : null;
44
+ return publishedSiteFor(name, known);
45
+ }
46
+ const SITE_UNKNOWN_NOTICE = "Couldn't check whether this site is published. If it is, it may stay online after the project is deleted.";
47
+ function deleteSiteNotice(site) {
48
+ if (site === "unknown") return SITE_UNKNOWN_NOTICE;
49
+ return site ? `This also takes ${siteHost(site.url)} offline.` : "Nothing is published from this project.";
50
+ }
51
+ function unpublishFailedQuestion(site, reason) {
52
+ const why = reason.trim() ? ` ${reason.trim().replace(/\.?$/, ".")}` : "";
53
+ return `Couldn't take ${siteHost(site.url)} offline.${why} Delete the project anyway? The site will stay online.`;
54
+ }
55
+ function deleteButtonLabel(site) {
56
+ return site && site !== "unknown" ? "Unpublish and delete" : "Delete project";
57
+ }export{CLOUDFLARE_PROJECT_QUERY,SITE_UNKNOWN_NOTICE,deleteButtonLabel,deleteSiteNotice,publishedSiteFor,siteFromLookup,unpublishFailedQuestion};//# sourceMappingURL=deleteFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteFlow.js","sources":["../../../../../src/features/webbuilder/web/project/deleteFlow.ts"],"sourcesContent":["/**\n * Deleting a project takes its published site offline first (web Phase 5 §7 `project/deleteFlow`, and 0.20.12\n * #822: Delete pressed while the check runs goes ahead once it is done).\n * 1. `aiCodeGetCloudflareProject(channelId)` -> the Pages project name (or null).\n * 2. When the site is live, the confirmation says so; on confirm `WEBBUILDER_UNPUBLISH {projectName}` runs, then\n * the project is deleted.\n * 3. If the unpublish fails, the person decides whether to delete anyway.\n * 4. If the lookup fails and the project has no live address either, the confirmation warns that the site may\n * stay online ('unknown').\n * Pure helpers; the settings sheet drives the steps.\n */\nimport { siteAddress, siteHost, siteProjectName } from '../publish/siteAddress';\n\nexport const CLOUDFLARE_PROJECT_QUERY = `query WebbuilderCloudflareProject($channelId: String!) {\n aiCodeGetCloudflareProject(channelId: $channelId)\n}`;\n\nexport interface PublishedSite {\n projectName: string;\n /** What the person knows the site by: the custom domain, else the production address. */\n url: string;\n customDomain?: string;\n}\n\n/** The lookup's outcome: a live site, nothing published, or \"couldn't check\". */\nexport type SiteLookup = PublishedSite | null | 'unknown';\n\nconst PAGES_PROJECT_RE = /^[a-z0-9][a-z0-9-]{0,57}$/;\n\n/** What the phone knows of the project's publish: its live address and the domain connected here. */\nexport interface KnownPublish {\n liveUrl?: string | null;\n customDomain?: string | null;\n}\n\n/** The live site for this project, or null when the name isn't a site name. */\nexport function publishedSiteFor(projectName: string | null | undefined, known: KnownPublish): PublishedSite | null {\n const name = String(projectName ?? '')\n .trim()\n .toLowerCase();\n if (!PAGES_PROJECT_RE.test(name)) return null;\n const customDomain = String(known.customDomain ?? '')\n .trim()\n .toLowerCase();\n const liveUrl = known.liveUrl && siteProjectName(known.liveUrl) === name ? known.liveUrl : null;\n const url = siteAddress({ customDomainUrl: customDomain, urls: [liveUrl], projectName: name });\n return { projectName: name, url, ...(customDomain ? { customDomain } : {}) };\n}\n\n/**\n * Turn the lookup's answer into a {@link SiteLookup}. A failed lookup falls back to the live address the phone\n * knows; with none either, the answer is 'unknown' (never \"nothing published\": the site may be live).\n */\nexport function siteFromLookup(lookup: { name?: string | null; failed: boolean }, known: KnownPublish): SiteLookup {\n let name = String(lookup.name ?? '').trim();\n if (!name && lookup.failed) name = siteProjectName(known.liveUrl);\n if (!name) return lookup.failed ? 'unknown' : null;\n return publishedSiteFor(name, known);\n}\n\nexport const SITE_UNKNOWN_NOTICE =\n \"Couldn't check whether this site is published. If it is, it may stay online after the project is deleted.\";\n\n/** The confirmation sentence about the site. */\nexport function deleteSiteNotice(site: SiteLookup): string {\n if (site === 'unknown') return SITE_UNKNOWN_NOTICE;\n return site ? `This also takes ${siteHost(site.url)} offline.` : 'Nothing is published from this project.';\n}\n\n/** Shown when the unpublish failed, before \"Delete anyway\". */\nexport function unpublishFailedQuestion(site: PublishedSite, reason: string): string {\n const why = reason.trim() ? ` ${reason.trim().replace(/\\.?$/, '.')}` : '';\n return `Couldn't take ${siteHost(site.url)} offline.${why} Delete the project anyway? The site will stay online.`;\n}\n\n/** The confirmation's button: what pressing it does. */\nexport function deleteButtonLabel(site: SiteLookup): string {\n return site && site !== 'unknown' ? 'Unpublish and delete' : 'Delete project';\n}\n"],"names":[],"mappings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AA,EAAa,OAAA,MAAA,CAAO,SAAS,SAAY,GAAA,IAAA;AAC9C,EAAO,OAAA,gBAAA,CAAiB,MAAM,KAAK,CAAA;AACrC;AACO,MAAM,mBAAsB,GAAA;AAG5B,SAAS,iBAAiB,IAA0B,EAAA;AACzD,EAAI,IAAA,IAAA,KAAS,WAAkB,OAAA,mBAAA;AAC/B,EAAA,OAAO,OAAO,CAAmB,gBAAA,EAAA,QAAA,CAAS,IAAK,CAAA,GAAG,CAAC,CAAc,SAAA,CAAA,GAAA,yCAAA;AACnE;AAGgB,SAAA,uBAAA,CAAwB,MAAqB,MAAwB,EAAA;AACnF,EAAA,MAAM,GAAM,GAAA,MAAA,CAAO,IAAK,EAAA,GAAI,CAAI,CAAA,EAAA,MAAA,CAAO,IAAK,EAAA,CAAE,OAAQ,CAAA,MAAA,EAAQ,GAAG,CAAC,CAAK,CAAA,GAAA,EAAA;AACvE,EAAA,OAAO,iBAAiB,QAAS,CAAA,IAAA,CAAK,GAAG,CAAC,YAAY,GAAG,CAAA,sDAAA,CAAA;AAC3D;AAGO,SAAS,kBAAkB,IAA0B,EAAA;AAC1D,EAAO,OAAA,IAAA,IAAQ,IAAS,KAAA,SAAA,GAAY,sBAAyB,GAAA,gBAAA;AAC/D"}
@@ -34,6 +34,10 @@ function companySiteName(host) {
34
34
  function isCompanySiteHost(host) {
35
35
  return companySiteName(host) !== "";
36
36
  }
37
+ function isLiveSiteUrl(url) {
38
+ const host = hostOf(url);
39
+ return Boolean(host) && (isCompanySiteHost(host) || isPagesDevHost(host) && siteProjectName(url) !== "");
40
+ }
37
41
  function siteProjectName(url) {
38
42
  const host = hostOf(url);
39
43
  if (!host) return "";
@@ -76,4 +80,4 @@ function siteAddress(input) {
76
80
  }
77
81
  function siteHost(url) {
78
82
  return url.replace(/^https?:\/\//, "").replace(/\/$/, "");
79
- }export{COMPANY_SITE_SUFFIX,companySiteName,companySiteUrl,isCompanySiteHost,isPagesDevHost,siteAddress,siteHost,siteProjectName};//# sourceMappingURL=siteAddress.js.map
83
+ }export{COMPANY_SITE_SUFFIX,companySiteName,companySiteUrl,isCompanySiteHost,isLiveSiteUrl,isPagesDevHost,siteAddress,siteHost,siteProjectName};//# sourceMappingURL=siteAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"siteAddress.js","sources":["../../../../../src/features/webbuilder/web/publish/siteAddress.ts"],"sourcesContent":["/** The only place that knows site domains: shown on a company or custom domain, never pages.dev (parsed only). */\nimport { publicSandboxDomain } from '../../publicSandboxDomain';\n\nexport const COMPANY_SITE_DOMAINS = ['yarntra.com', 'yantra.app'] as const;\nexport type CompanySiteDomain = (typeof COMPANY_SITE_DOMAINS)[number];\n\n/** The web reads `VITE_SITE_DOMAIN_SUFFIX`; the phone has no build env for it, so the default (`PLATFORM_DOMAIN_SUFFIX`). */\nfunction configuredSuffix(): CompanySiteDomain {\n return 'yarntra.com';\n}\n\n/** `VITE_SITE_DOMAIN_SUFFIX`, default yarntra.com. */\nexport const COMPANY_SITE_SUFFIX: CompanySiteDomain = configuredSuffix();\n\nconst PROJECT_NAME_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\nconst PAGES_DEV_RE = /\\.pages\\.dev$/i;\n// yantra.app is also the platform domain: these first labels are platform hosts, not sites.\nconst PLATFORM_LABELS = new Set(['www', 'app', 'api', 'cdn', 'cdecli-agent', 'idefront', 'ideback', 'sb']);\nconst PLATFORM_LABEL_RE = /-surface$|^sb-|^\\d+-/;\n\nfunction hostOf(url: string | null | undefined): string {\n const raw = String(url ?? '').trim();\n if (!/^https?:\\/\\//i.test(raw)) return '';\n try {\n return new URL(raw).hostname.toLowerCase();\n } catch {\n return '';\n }\n}\n\nexport function isPagesDevHost(host: string): boolean {\n return PAGES_DEV_RE.test(host);\n}\n\nexport function companySiteName(host: string): string {\n const h = String(host || '').toLowerCase();\n if (h.endsWith('.yarntra.com')) {\n const name = h.slice(0, -'.yarntra.com'.length).split('.').pop() || '';\n return PROJECT_NAME_RE.test(name) ? name : '';\n }\n if (h.endsWith('.yantra.app')) {\n const name = h.slice(0, -'.yantra.app'.length);\n if (!PROJECT_NAME_RE.test(name) || PLATFORM_LABELS.has(name) || PLATFORM_LABEL_RE.test(name)) return '';\n return name;\n }\n return '';\n}\n\nexport function isCompanySiteHost(host: string): boolean {\n return companySiteName(host) !== '';\n}\n\nexport function isLiveSiteUrl(url: string | null | undefined): boolean {\n const host = hostOf(url);\n return Boolean(host) && (isCompanySiteHost(host) || (isPagesDevHost(host) && siteProjectName(url) !== ''));\n}\n\nexport function siteProjectName(url: string | null | undefined): string {\n const host = hostOf(url);\n if (!host) return '';\n if (isPagesDevHost(host)) {\n const name = host.replace(PAGES_DEV_RE, '').split('.').pop() || '';\n return PROJECT_NAME_RE.test(name) ? name : '';\n }\n return companySiteName(host);\n}\n\nexport function companySiteUrl(projectName: string, suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX): string {\n const name = String(projectName || '')\n .trim()\n .toLowerCase();\n return PROJECT_NAME_RE.test(name) ? `https://${name}.${suffix}` : '';\n}\n\n/** What a typed site name becomes (\"Lotus Flow\" -> \"lotus-flow\"); empty when nothing usable is left. */\nexport function siteNameFromInput(raw: string | null | undefined): string {\n return String(raw ?? '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9-]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 58)\n .replace(/-+$/, '');\n}\n\n/** The address a typed site name gets (`lotus-flow.yarntra.com`), or '' while the name is empty. */\nexport function siteHostForName(\n raw: string | null | undefined,\n suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX,\n): string {\n const url = companySiteUrl(siteNameFromInput(raw), suffix);\n return url ? siteHost(url) : '';\n}\n\nfunction originOf(url: string): string {\n return `https://${hostOf(url)}`;\n}\n\n/** A sandbox preview host - e2b's or the platform's sandbox domain - is never a site address. */\nfunction isSandboxHost(host: string): boolean {\n const pub = publicSandboxDomain();\n return /\\.e2b\\./.test(host) || Boolean(pub && host.endsWith(`.${pub}`));\n}\n\nfunction shownDomainUrl(value: string | null | undefined): string {\n const raw = String(value ?? '').trim();\n if (!raw) return '';\n const host = hostOf(/^https?:\\/\\//i.test(raw) ? raw : `https://${raw}`);\n if (!host || !/^[a-z0-9.-]+\\.[a-z]{2,}$/.test(host) || isPagesDevHost(host) || isSandboxHost(host)) return '';\n if (host.endsWith('.yantra.app') && !isCompanySiteHost(host)) return '';\n return `https://${host}`;\n}\n\nexport interface SiteAddressInput {\n customDomainUrl?: string | null;\n urls?: Array<string | null | undefined>;\n projectName?: string | null;\n suffix?: CompanySiteDomain;\n}\n\n/** Custom domain > recorded company URL > `https://<projectName>.<suffix>`; never pages.dev. */\nexport function siteAddress(input: SiteAddressInput): string {\n const custom = shownDomainUrl(input.customDomainUrl);\n if (custom) return custom;\n const urls = (input.urls ?? []).map((u) => String(u ?? '').trim()).filter(Boolean);\n const company = urls.find((u) => isCompanySiteHost(hostOf(u)));\n if (company) return originOf(company);\n const name = String(input.projectName ?? '').trim() || urls.map(siteProjectName).find(Boolean) || '';\n const built = companySiteUrl(name, input.suffix);\n if (built) return built;\n return urls.map(shownDomainUrl).find(Boolean) || '';\n}\n\nexport function siteHost(url: string): string {\n return url.replace(/^https?:\\/\\//, '').replace(/\\/$/, '');\n}\n\nconst LIVE_LINK_RE =\n /https?:\\/\\/((?:[a-z0-9-]+\\.)*[a-z0-9][a-z0-9-]*)\\.(pages\\.dev|yarntra\\.com|yantra\\.app)\\b[^\\s)\\]\"'<>*`]*/gi;\n\nexport function liveSiteLinks(text: string): Array<{ url: string; projectName: string; company: boolean }> {\n const out: Array<{ url: string; projectName: string; company: boolean }> = [];\n for (const m of String(text || '').matchAll(LIVE_LINK_RE)) {\n const url = m[0].replace(/[.,;:!?]+$/, '');\n if (!isLiveSiteUrl(url)) continue;\n out.push({ url, projectName: siteProjectName(url), company: m[2].toLowerCase() !== 'pages.dev' });\n }\n return out;\n}\n\nexport function hasLiveSiteLink(text: string): boolean {\n return liveSiteLinks(text).length > 0;\n}\n\nconst PAGES_DEV_LINK_RE = /(https?:\\/\\/)?((?:[a-z0-9-]+\\.)*[a-z0-9][a-z0-9-]*)\\.pages\\.dev\\b/gi;\n\n/** Display only: `<name>.pages.dev[/path]` becomes the company address, path kept. */\nexport function rewritePagesDevLinks(\n text: string,\n projectName?: string | null,\n suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX,\n): string {\n const fixed = String(projectName ?? '')\n .trim()\n .toLowerCase();\n return String(text ?? '').replace(PAGES_DEV_LINK_RE, (match, scheme: string | undefined, labels: string) => {\n const name = PROJECT_NAME_RE.test(fixed) ? fixed : labels.toLowerCase().split('.').pop() || '';\n const url = companySiteUrl(name, suffix);\n if (!url) return match;\n return scheme ? url : siteHost(url);\n });\n}\n"],"names":[],"mappings":"+DAMA,SAAS,gBAAsC,GAAA;AAC7C,EAAO,OAAA,aAAA;AACT;AAGO,MAAM,sBAAyC,gBAAiB;AACvE,MAAM,eAAkB,GAAA,2BAAA;AACxB,MAAM,YAAe,GAAA,gBAAA;AAErB,MAAM,eAAkB,mBAAA,IAAI,GAAI,CAAA,CAAC,KAAO,EAAA,KAAA,EAAO,KAAO,EAAA,KAAA,EAAO,cAAgB,EAAA,UAAA,EAAY,SAAW,EAAA,IAAI,CAAC,CAAA;AACzG,MAAM,iBAAoB,GAAA,sBAAA;AAC1B,SAAS,OAAO,GAAwC,EAAA;AACtD,EAAA,MAAM,GAAM,GAAA,MAAA,CAAO,GAAO,IAAA,IAAA,GAAA,GAAA,GAAA,EAAE,EAAE,IAAK,EAAA;AACnC,EAAA,IAAI,CAAC,eAAA,CAAgB,IAAK,CAAA,GAAG,GAAU,OAAA,EAAA;AACvC,EAAI,IAAA;AACF,IAAA,OAAO,IAAI,GAAA,CAAI,GAAG,CAAA,CAAE,SAAS,WAAY,EAAA;AAAA,GACnC,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX;AACO,SAAS,eAAe,IAAuB,EAAA;AACpD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AQ,OAAO,EAAE,CAAA;AAC1D"}
1
+ {"version":3,"file":"siteAddress.js","sources":["../../../../../src/features/webbuilder/web/publish/siteAddress.ts"],"sourcesContent":["/** The only place that knows site domains: shown on a company or custom domain, never pages.dev (parsed only). */\nimport { publicSandboxDomain } from '../../publicSandboxDomain';\n\nexport const COMPANY_SITE_DOMAINS = ['yarntra.com', 'yantra.app'] as const;\nexport type CompanySiteDomain = (typeof COMPANY_SITE_DOMAINS)[number];\n\n/** The web reads `VITE_SITE_DOMAIN_SUFFIX`; the phone has no build env for it, so the default (`PLATFORM_DOMAIN_SUFFIX`). */\nfunction configuredSuffix(): CompanySiteDomain {\n return 'yarntra.com';\n}\n\n/** `VITE_SITE_DOMAIN_SUFFIX`, default yarntra.com. */\nexport const COMPANY_SITE_SUFFIX: CompanySiteDomain = configuredSuffix();\n\nconst PROJECT_NAME_RE = /^[a-z0-9][a-z0-9-]{0,62}$/;\nconst PAGES_DEV_RE = /\\.pages\\.dev$/i;\n// yantra.app is also the platform domain: these first labels are platform hosts, not sites.\nconst PLATFORM_LABELS = new Set(['www', 'app', 'api', 'cdn', 'cdecli-agent', 'idefront', 'ideback', 'sb']);\nconst PLATFORM_LABEL_RE = /-surface$|^sb-|^\\d+-/;\n\nfunction hostOf(url: string | null | undefined): string {\n const raw = String(url ?? '').trim();\n if (!/^https?:\\/\\//i.test(raw)) return '';\n try {\n return new URL(raw).hostname.toLowerCase();\n } catch {\n return '';\n }\n}\n\nexport function isPagesDevHost(host: string): boolean {\n return PAGES_DEV_RE.test(host);\n}\n\nexport function companySiteName(host: string): string {\n const h = String(host || '').toLowerCase();\n if (h.endsWith('.yarntra.com')) {\n const name = h.slice(0, -'.yarntra.com'.length).split('.').pop() || '';\n return PROJECT_NAME_RE.test(name) ? name : '';\n }\n if (h.endsWith('.yantra.app')) {\n const name = h.slice(0, -'.yantra.app'.length);\n if (!PROJECT_NAME_RE.test(name) || PLATFORM_LABELS.has(name) || PLATFORM_LABEL_RE.test(name)) return '';\n return name;\n }\n return '';\n}\n\nexport function isCompanySiteHost(host: string): boolean {\n return companySiteName(host) !== '';\n}\n\nexport function isLiveSiteUrl(url: string | null | undefined): boolean {\n const host = hostOf(url);\n return Boolean(host) && (isCompanySiteHost(host) || (isPagesDevHost(host) && siteProjectName(url) !== ''));\n}\n\nexport function siteProjectName(url: string | null | undefined): string {\n const host = hostOf(url);\n if (!host) return '';\n if (isPagesDevHost(host)) {\n const name = host.replace(PAGES_DEV_RE, '').split('.').pop() || '';\n return PROJECT_NAME_RE.test(name) ? name : '';\n }\n return companySiteName(host);\n}\n\nexport function companySiteUrl(projectName: string, suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX): string {\n const name = String(projectName || '')\n .trim()\n .toLowerCase();\n return PROJECT_NAME_RE.test(name) ? `https://${name}.${suffix}` : '';\n}\n\n/** What a typed site name becomes (\"Lotus Flow\" -> \"lotus-flow\"); empty when nothing usable is left. */\nexport function siteNameFromInput(raw: string | null | undefined): string {\n return String(raw ?? '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9-]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 58)\n .replace(/-+$/, '');\n}\n\n/** The address a typed site name gets (`lotus-flow.yarntra.com`), or '' while the name is empty. */\nexport function siteHostForName(\n raw: string | null | undefined,\n suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX,\n): string {\n const url = companySiteUrl(siteNameFromInput(raw), suffix);\n return url ? siteHost(url) : '';\n}\n\nfunction originOf(url: string): string {\n return `https://${hostOf(url)}`;\n}\n\n/** A sandbox preview host - e2b's or the platform's sandbox domain - is never a site address. */\nfunction isSandboxHost(host: string): boolean {\n const pub = publicSandboxDomain();\n return /\\.e2b\\./.test(host) || Boolean(pub && host.endsWith(`.${pub}`));\n}\n\nfunction shownDomainUrl(value: string | null | undefined): string {\n const raw = String(value ?? '').trim();\n if (!raw) return '';\n const host = hostOf(/^https?:\\/\\//i.test(raw) ? raw : `https://${raw}`);\n if (!host || !/^[a-z0-9.-]+\\.[a-z]{2,}$/.test(host) || isPagesDevHost(host) || isSandboxHost(host)) return '';\n if (host.endsWith('.yantra.app') && !isCompanySiteHost(host)) return '';\n return `https://${host}`;\n}\n\nexport interface SiteAddressInput {\n customDomainUrl?: string | null;\n urls?: Array<string | null | undefined>;\n projectName?: string | null;\n suffix?: CompanySiteDomain;\n}\n\n/** Custom domain > recorded company URL > `https://<projectName>.<suffix>`; never pages.dev. */\nexport function siteAddress(input: SiteAddressInput): string {\n const custom = shownDomainUrl(input.customDomainUrl);\n if (custom) return custom;\n const urls = (input.urls ?? []).map((u) => String(u ?? '').trim()).filter(Boolean);\n const company = urls.find((u) => isCompanySiteHost(hostOf(u)));\n if (company) return originOf(company);\n const name = String(input.projectName ?? '').trim() || urls.map(siteProjectName).find(Boolean) || '';\n const built = companySiteUrl(name, input.suffix);\n if (built) return built;\n return urls.map(shownDomainUrl).find(Boolean) || '';\n}\n\nexport function siteHost(url: string): string {\n return url.replace(/^https?:\\/\\//, '').replace(/\\/$/, '');\n}\n\nconst LIVE_LINK_RE =\n /https?:\\/\\/((?:[a-z0-9-]+\\.)*[a-z0-9][a-z0-9-]*)\\.(pages\\.dev|yarntra\\.com|yantra\\.app)\\b[^\\s)\\]\"'<>*`]*/gi;\n\nexport function liveSiteLinks(text: string): Array<{ url: string; projectName: string; company: boolean }> {\n const out: Array<{ url: string; projectName: string; company: boolean }> = [];\n for (const m of String(text || '').matchAll(LIVE_LINK_RE)) {\n const url = m[0].replace(/[.,;:!?]+$/, '');\n if (!isLiveSiteUrl(url)) continue;\n out.push({ url, projectName: siteProjectName(url), company: m[2].toLowerCase() !== 'pages.dev' });\n }\n return out;\n}\n\nexport function hasLiveSiteLink(text: string): boolean {\n return liveSiteLinks(text).length > 0;\n}\n\nconst PAGES_DEV_LINK_RE = /(https?:\\/\\/)?((?:[a-z0-9-]+\\.)*[a-z0-9][a-z0-9-]*)\\.pages\\.dev\\b/gi;\n\n/** Display only: `<name>.pages.dev[/path]` becomes the company address, path kept. */\nexport function rewritePagesDevLinks(\n text: string,\n projectName?: string | null,\n suffix: CompanySiteDomain = COMPANY_SITE_SUFFIX,\n): string {\n const fixed = String(projectName ?? '')\n .trim()\n .toLowerCase();\n return String(text ?? '').replace(PAGES_DEV_LINK_RE, (match, scheme: string | undefined, labels: string) => {\n const name = PROJECT_NAME_RE.test(fixed) ? fixed : labels.toLowerCase().split('.').pop() || '';\n const url = companySiteUrl(name, suffix);\n if (!url) return match;\n return scheme ? url : siteHost(url);\n });\n}\n"],"names":[],"mappings":"+DAMA,SAAS,gBAAsC,GAAA;AAC7C,EAAO,OAAA,aAAA;AACT;AAGO,MAAM,sBAAyC,gBAAiB;AACvE,MAAM,eAAkB,GAAA,2BAAA;AACxB,MAAM,YAAe,GAAA,gBAAA;AAErB,MAAM,eAAkB,mBAAA,IAAI,GAAI,CAAA,CAAC,KAAO,EAAA,KAAA,EAAO,KAAO,EAAA,KAAA,EAAO,cAAgB,EAAA,UAAA,EAAY,SAAW,EAAA,IAAI,CAAC,CAAA;AACzG,MAAM,iBAAoB,GAAA,sBAAA;AAC1B,SAAS,OAAO,GAAwC,EAAA;AACtD,EAAA,MAAM,GAAM,GAAA,MAAA,CAAO,GAAO,IAAA,IAAA,GAAA,GAAA,GAAA,EAAE,EAAE,IAAK,EAAA;AACnC,EAAA,IAAI,CAAC,eAAA,CAAgB,IAAK,CAAA,GAAG,GAAU,OAAA,EAAA;AACvC,EAAI,IAAA;AACF,IAAA,OAAO,IAAI,GAAA,CAAI,GAAG,CAAA,CAAE,SAAS,WAAY,EAAA;AAAA,GACnC,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX;AACO,SAAS,eAAe,IAAuB,EAAA;AACpD,EAAO,OAAA,YAAA,CAAa,KAAK,IAAI,CAAA;AAC/B;AACO,SAAS,gBAAgB,IAAsB,EAAA;AACpD,EAAA,MAAM,CAAI,GAAA,MAAA,CAAO,IAAQ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ACO,SAAS,SAAS,GAAqB,EAAA;AAC5C,EAAA,OAAO,IAAI,OAAQ,CAAA,cAAA,EAAgB,EAAE,CAAE,CAAA,OAAA,CAAQ,OAAO,EAAE,CAAA;AAC1D"}
@@ -1,4 +1,4 @@
1
- import {stripAskUser}from'../../../chat/askUser.js';import {isGenericTitle}from'../../buildFragments.js';import {withoutRestorePointLine}from'../../webbuilderPrompts.js';import {parseToolActivity}from'../../../chat/toolActivity.js';var __defProp = Object.defineProperty;
1
+ import {stripConnectorConnect}from'../chat/connectRequest.js';import {stripAskUser}from'../../../chat/askUser.js';import {isGenericTitle}from'../../buildFragments.js';import {withoutRestorePointLine}from'../../webbuilderPrompts.js';import {parseToolActivity}from'../../../chat/toolActivity.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -168,7 +168,7 @@ function uploadStep(state) {
168
168
  return state.sawBusy && !state.busy ? "finished" : "adding";
169
169
  }
170
170
  function replySummary(reply) {
171
- const text = withoutRestorePointLine(parseToolActivity(stripAskUser(String(reply != null ? reply : "")), false).text).text.replace(/\n\s*\**\s*Next steps?\s*\**\s*:[\s\S]*$/i, "").replace(/\s*\(\s*(?:live\s+)?preview:?\s+https?:\/\/\S+?\)/gi, "").replace(/^[ \t]*(?:live\s+)?preview:?\s+https?:\/\/\S+[ \t]*$/gim, "").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*|__|`/g, "").trim();
171
+ const text = withoutRestorePointLine(parseToolActivity(stripAskUser(stripConnectorConnect(String(reply != null ? reply : ""))), false).text).text.replace(/\n\s*\**\s*Next steps?\s*\**\s*:[\s\S]*$/i, "").replace(/\s*\(\s*(?:live\s+)?preview:?\s+https?:\/\/\S+?\)/gi, "").replace(/^[ \t]*(?:live\s+)?preview:?\s+https?:\/\/\S+[ \t]*$/gim, "").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*|__|`/g, "").trim();
172
172
  return text || null;
173
173
  }
174
174
  function replyAsks(reply) {