Skip to content

Commit 9774fdd

Browse files
committed
remove ngrok
1 parent 79847fc commit 9774fdd

7 files changed

Lines changed: 30 additions & 162 deletions

File tree

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ packages/
5959
frontend/ React 19 SPA, Vite, React Router
6060
shared/ Shared TypeScript types
6161
widget/ Embeddable lead capture form & chat widgets
62-
ngrok/ ngrok tunnel utility for local webhook testing
6362
scripts/ Dev utility scripts (cert generation)
6463
docs/ Design system, API guidelines
6564
```
@@ -105,10 +104,6 @@ Usage example:
105104
<script src="https://your-cdn.example.com/crm-form.js"></script>
106105
```
107106

108-
### `packages/ngrok`
109-
110-
Utility package that runs an ngrok tunnel to expose the local backend (port 3000) for webhook testing during development.
111-
112107
### `scripts/`
113108

114109
- **`generate-certs.sh`** — generates local HTTPS certificates via [mkcert](https://github.com/FiloSottile/mkcert) into `certs/`. Run with `pnpm certs:generate`.
@@ -120,8 +115,6 @@ Utility package that runs an ngrok tunnel to expose the local backend (port 3000
120115
| `pnpm dev` | Start all dev servers in parallel |
121116
| `pnpm dev:backend` | Start backend only |
122117
| `pnpm dev:frontend` | Start frontend only |
123-
| `pnpm dev:backend:ngrok` | Start backend + ngrok tunnel |
124-
| `pnpm dev:ngrok` | Start ngrok tunnel to local backend (3000) |
125118
| `pnpm build` | Build all packages |
126119
| `pnpm lint` | Lint all packages |
127120
| `pnpm typecheck` | Type-check all packages |

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"dev": "pnpm --parallel -r run dev",
77
"dev:backend": "pnpm --filter backend dev",
88
"dev:frontend": "pnpm --filter frontend dev",
9-
"dev:ngrok": "ngrok http --url=posticous-unmaturely-theola.ngrok-free.dev 3000 --log stdout --log-format logfmt",
10-
"dev:backend:ngrok": "bash scripts/dev-backend-ngrok.sh",
119
"build": "pnpm -r run build",
1210
"build:backend": "pnpm --filter backend build",
1311
"build:frontend": "pnpm --filter frontend build",

packages/frontend/src/pages/AgentsPage.tsx

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { api, apiUpload, ApiError } from '../lib/api';
4040
import { formatFileSize, formatFileDate, isTextPreviewable, isImagePreviewable, isPreviewable } from '../lib/file-utils';
4141
import { scrollToFirstError } from '../lib/scroll-to-error';
4242
import { FilePreviewModal } from '../components/FilePreviewModal';
43+
import { FileSystemBrowserModal } from '../components/FileSystemBrowserModal';
4344
import { AgentAvatar, AgentAvatarPicker, randomPalette, randomIcon, type AvatarConfig } from '../components/AgentAvatar';
4445
import {
4546
getLatestStreamingAgentChatStream,
@@ -278,10 +279,7 @@ function AgentFiles({ agentId }: { agentId: string }) {
278279
const [folderName, setFolderName] = useState('');
279280
const [creatingFolder, setCreatingFolder] = useState(false);
280281

281-
const [showNewRef, setShowNewRef] = useState(false);
282-
const [refName, setRefName] = useState('');
283-
const [refTarget, setRefTarget] = useState('');
284-
const [creatingRef, setCreatingRef] = useState(false);
282+
const [showFsBrowser, setShowFsBrowser] = useState(false);
285283

286284
const [deletingPath, setDeletingPath] = useState<string | null>(null);
287285
const [deleteLoading, setDeleteLoading] = useState(false);
@@ -320,7 +318,6 @@ function AgentFiles({ agentId }: { agentId: string }) {
320318
function navigateTo(dirPath: string) {
321319
setCurrentPath(dirPath);
322320
setShowNewFolder(false);
323-
setShowNewRef(false);
324321
setDeletingPath(null);
325322
}
326323

@@ -347,25 +344,21 @@ function AgentFiles({ agentId }: { agentId: string }) {
347344
}
348345
}
349346

350-
async function handleCreateReference() {
351-
if (!refName.trim() || !refTarget.trim()) return;
352-
setCreatingRef(true);
347+
async function handleCreateReference(targetPath: string) {
348+
const name = targetPath.split('/').filter(Boolean).pop();
349+
if (!name) return;
350+
setShowFsBrowser(false);
353351
setError('');
354352
try {
355353
await api(`/agents/${agentId}/files/references`, {
356354
method: 'POST',
357-
body: JSON.stringify({ path: currentPath, name: refName.trim(), target: refTarget.trim() }),
355+
body: JSON.stringify({ path: currentPath, name, target: targetPath }),
358356
});
359-
setShowNewRef(false);
360-
setRefName('');
361-
setRefTarget('');
362357
setSuccess('Reference created');
363358
await fetchEntries(currentPath);
364359
setTimeout(() => setSuccess(''), 3000);
365360
} catch (err) {
366361
setError(err instanceof ApiError ? err.message : 'Failed to create reference');
367-
} finally {
368-
setCreatingRef(false);
369362
}
370363
}
371364

@@ -527,7 +520,6 @@ function AgentFiles({ agentId }: { agentId: string }) {
527520
onClick={() => {
528521
setShowNewFolder(!showNewFolder);
529522
setFolderName('');
530-
setShowNewRef(false);
531523
}}
532524
>
533525
<FolderPlus size={14} />
@@ -536,12 +528,7 @@ function AgentFiles({ agentId }: { agentId: string }) {
536528
<Button
537529
size="sm"
538530
variant="ghost"
539-
onClick={() => {
540-
setShowNewRef(!showNewRef);
541-
setRefName('');
542-
setRefTarget('');
543-
setShowNewFolder(false);
544-
}}
531+
onClick={() => setShowFsBrowser(true)}
545532
>
546533
<Link2 size={14} />
547534
Reference
@@ -573,39 +560,6 @@ function AgentFiles({ agentId }: { agentId: string }) {
573560
</div>
574561
)}
575562

576-
{showNewRef && (
577-
<div className={styles.filesNewFolderRow}>
578-
<div className={styles.filesNewFolderIcon}>
579-
<Link2 size={18} className={styles.filesIconReference} />
580-
</div>
581-
<Input
582-
label=""
583-
placeholder="Reference name"
584-
value={refName}
585-
onChange={(e) => setRefName(e.target.value)}
586-
onKeyDown={(e: KeyboardEvent) => {
587-
if (e.key === 'Escape') setShowNewRef(false);
588-
}}
589-
/>
590-
<Input
591-
label=""
592-
placeholder="Target path (e.g. /tmp)"
593-
value={refTarget}
594-
onChange={(e) => setRefTarget(e.target.value)}
595-
onKeyDown={(e: KeyboardEvent) => {
596-
if (e.key === 'Enter') handleCreateReference();
597-
if (e.key === 'Escape') setShowNewRef(false);
598-
}}
599-
/>
600-
<Button size="sm" onClick={handleCreateReference} disabled={creatingRef || !refName.trim() || !refTarget.trim()}>
601-
{creatingRef ? 'Creating...' : 'Create'}
602-
</Button>
603-
<Button size="sm" variant="ghost" onClick={() => setShowNewRef(false)}>
604-
Cancel
605-
</Button>
606-
</div>
607-
)}
608-
609563
{parentPath !== null && (
610564
<div className={styles.filesRow}>
611565
<button className={styles.filesColName} onClick={() => navigateTo(parentPath === '/' ? '/' : parentPath)}>
@@ -712,6 +666,13 @@ function AgentFiles({ agentId }: { agentId: string }) {
712666
onDownload={() => handleDownload(previewEntry.path)}
713667
/>
714668
)}
669+
670+
{showFsBrowser && (
671+
<FileSystemBrowserModal
672+
onSelect={handleCreateReference}
673+
onClose={() => setShowFsBrowser(false)}
674+
/>
675+
)}
715676
</div>
716677
);
717678
}

packages/frontend/src/pages/StoragePage.tsx

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ export function StoragePage() {
5151
const [folderName, setFolderName] = useState('');
5252
const [creatingFolder, setCreatingFolder] = useState(false);
5353

54-
// New reference
55-
const [showNewRef, setShowNewRef] = useState(false);
56-
const [refName, setRefName] = useState('');
57-
const [refTarget, setRefTarget] = useState('');
58-
const [creatingRef, setCreatingRef] = useState(false);
54+
// Reference browser
55+
const [showFsBrowser, setShowFsBrowser] = useState(false);
5956

6057
// Delete confirmation
6158
const [deletingPath, setDeletingPath] = useState<string | null>(null);
@@ -92,7 +89,6 @@ export function StoragePage() {
9289
function navigateTo(dirPath: string) {
9390
setCurrentPath(dirPath);
9491
setShowNewFolder(false);
95-
setShowNewRef(false);
9692
setDeletingPath(null);
9793
}
9894

@@ -120,25 +116,21 @@ export function StoragePage() {
120116
}
121117
}
122118

123-
async function handleCreateReference() {
124-
if (!refName.trim() || !refTarget.trim()) return;
125-
setCreatingRef(true);
119+
async function handleCreateReference(targetPath: string) {
120+
const name = targetPath.split('/').filter(Boolean).pop();
121+
if (!name) return;
122+
setShowFsBrowser(false);
126123
setError('');
127124
try {
128125
await api('/storage/references', {
129126
method: 'POST',
130-
body: JSON.stringify({ path: currentPath, name: refName.trim(), target: refTarget.trim() }),
127+
body: JSON.stringify({ path: currentPath, name, target: targetPath }),
131128
});
132-
setShowNewRef(false);
133-
setRefName('');
134-
setRefTarget('');
135129
setSuccess('Reference created');
136130
await fetchEntries(currentPath);
137131
setTimeout(() => setSuccess(''), 3000);
138132
} catch (err) {
139133
setError(err instanceof ApiError ? err.message : 'Failed to create reference');
140-
} finally {
141-
setCreatingRef(false);
142134
}
143135
}
144136

@@ -310,7 +302,6 @@ export function StoragePage() {
310302
onClick={() => {
311303
setShowNewFolder(!showNewFolder);
312304
setFolderName('');
313-
setShowNewRef(false);
314305
}}
315306
>
316307
<FolderPlus size={14} />
@@ -319,12 +310,7 @@ export function StoragePage() {
319310
<Button
320311
size="sm"
321312
variant="ghost"
322-
onClick={() => {
323-
setShowNewRef(!showNewRef);
324-
setRefName('');
325-
setRefTarget('');
326-
setShowNewFolder(false);
327-
}}
313+
onClick={() => setShowFsBrowser(true)}
328314
>
329315
<Link2 size={14} />
330316
Reference
@@ -354,38 +340,6 @@ export function StoragePage() {
354340
</Button>
355341
</div>
356342
)}
357-
{showNewRef && (
358-
<div className={styles.newFolderRow}>
359-
<div className={styles.newFolderIcon}>
360-
<Link2 size={18} className={styles.iconReference} />
361-
</div>
362-
<Input
363-
label=""
364-
placeholder="Reference name"
365-
value={refName}
366-
onChange={(e) => setRefName(e.target.value)}
367-
onKeyDown={(e) => {
368-
if (e.key === 'Escape') setShowNewRef(false);
369-
}}
370-
/>
371-
<Input
372-
label=""
373-
placeholder="Target path (e.g. /tmp)"
374-
value={refTarget}
375-
onChange={(e) => setRefTarget(e.target.value)}
376-
onKeyDown={(e) => {
377-
if (e.key === 'Enter') handleCreateReference();
378-
if (e.key === 'Escape') setShowNewRef(false);
379-
}}
380-
/>
381-
<Button size="sm" onClick={handleCreateReference} disabled={creatingRef || !refName.trim() || !refTarget.trim()}>
382-
{creatingRef ? 'Creating...' : 'Create'}
383-
</Button>
384-
<Button size="sm" variant="ghost" onClick={() => setShowNewRef(false)}>
385-
Cancel
386-
</Button>
387-
</div>
388-
)}
389343
{parentPath !== null && (
390344
<div className={styles.fileRow}>
391345
<button className={styles.colName} onClick={() => navigateTo(parentPath === '/' ? '/' : parentPath)}>
@@ -504,6 +458,13 @@ export function StoragePage() {
504458
onDownload={() => handleDownload(previewEntry.path)}
505459
/>
506460
)}
461+
462+
{showFsBrowser && (
463+
<FileSystemBrowserModal
464+
onSelect={handleCreateReference}
465+
onClose={() => setShowFsBrowser(false)}
466+
/>
467+
)}
507468
</>
508469
);
509470
}

packages/ngrok/package.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/dev-backend-ngrok.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)